diff --git a/.htaccess b/.htaccess index 13564585ac2274e074728c844aa119b8df9d61a6..a0d1710a8aa55721fbdae884b0018c1a9d254c95 100644 --- a/.htaccess +++ b/.htaccess @@ -252,3 +252,10 @@ ## http://developer.yahoo.com/performance/rules.html#etags #FileETag none + +############################################ +## Add custom headers +<IfModule mod_headers.c> + Header set X-Content-Type-Options "nosniff" + Header set X-XSS-Protection "1; mode=block" +</IfModule> diff --git a/app/code/Magento/AdminNotification/composer.json b/app/code/Magento/AdminNotification/composer.json index 3c4c622a01085f1add06476ab6c5f28ca4757d96..c272955b69ee305372e4d3f071fef84e770fbef4 100644 --- a/app/code/Magento/AdminNotification/composer.json +++ b/app/code/Magento/AdminNotification/composer.json @@ -7,8 +7,7 @@ "magento/module-backend": "1.0.0-beta", "magento/module-media-storage": "1.0.0-beta", "magento/framework": "1.0.0-beta", - "lib-libxml": "*", - "magento/magento-composer-installer": "*" + "lib-libxml": "*" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -16,12 +15,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/AdminNotification" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\AdminNotification\\": "" + } } } diff --git a/app/code/Magento/AdminNotification/etc/acl.xml b/app/code/Magento/AdminNotification/etc/acl.xml index 01ae3b6da6fbb3a4f9373f9ad3bf0c7bfe0067cb..f044e9fd1e97e379408e60086c9bb24162b512b9 100644 --- a/app/code/Magento/AdminNotification/etc/acl.xml +++ b/app/code/Magento/AdminNotification/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/app/code/Magento/AdminNotification/etc/adminhtml/di.xml b/app/code/Magento/AdminNotification/etc/adminhtml/di.xml index e2d49bcd181d9adba6cac5e47a283683e83f9c44..677ab26847b869b7f865589023de0309a1425e5d 100644 --- a/app/code/Magento/AdminNotification/etc/adminhtml/di.xml +++ b/app/code/Magento/AdminNotification/etc/adminhtml/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Framework\Notification\MessageList"> <arguments> <argument name="messages" xsi:type="array"> diff --git a/app/code/Magento/AdminNotification/etc/adminhtml/events.xml b/app/code/Magento/AdminNotification/etc/adminhtml/events.xml index 5a5df967fc1b9265536f34b24a7b2cf154b16c1c..c63c602ed4279ffeb443f9628d9b7e776ae8d144 100644 --- a/app/code/Magento/AdminNotification/etc/adminhtml/events.xml +++ b/app/code/Magento/AdminNotification/etc/adminhtml/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="controller_action_predispatch"> <observer name="adminnotification" instance="Magento\AdminNotification\Observer\PredispathAdminActionControllerObserver" method="execute" /> </event> diff --git a/app/code/Magento/AdminNotification/etc/adminhtml/menu.xml b/app/code/Magento/AdminNotification/etc/adminhtml/menu.xml index 5d447f35265ec31e9c904a009c4450b88bc01514..d3829d8b5fefae47eb3b9e34e8eedb28e4ff0169 100644 --- a/app/code/Magento/AdminNotification/etc/adminhtml/menu.xml +++ b/app/code/Magento/AdminNotification/etc/adminhtml/menu.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Backend/etc/menu.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd"> <menu> <add id="Magento_AdminNotification::system_adminnotification" title="Notifications" module="Magento_AdminNotification" sortOrder="10" parent="Magento_Backend::system_other_settings" action="adminhtml/notification" resource="Magento_AdminNotification::adminnotification"/> </menu> diff --git a/app/code/Magento/AdminNotification/etc/adminhtml/routes.xml b/app/code/Magento/AdminNotification/etc/adminhtml/routes.xml index 19c3fc2200c6697ddd56ad9696dc460a215c5f82..29fbad84a2d584ef659f124de7751372e56da8af 100644 --- a/app/code/Magento/AdminNotification/etc/adminhtml/routes.xml +++ b/app/code/Magento/AdminNotification/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="admin"> <route id="adminhtml"> <module name="Magento_AdminNotification" before="Magento_Backend" /> diff --git a/app/code/Magento/AdminNotification/etc/adminhtml/system.xml b/app/code/Magento/AdminNotification/etc/adminhtml/system.xml index 0be0367132a7502ae5f5d415d8c86a4bab215b9b..77f781fb455ea6a9220b214f9fdf5de558652420 100644 --- a/app/code/Magento/AdminNotification/etc/adminhtml/system.xml +++ b/app/code/Magento/AdminNotification/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="system"> <group id="adminnotification" translate="label" type="text" sortOrder="250" showInDefault="1" showInWebsite="0" showInStore="0"> diff --git a/app/code/Magento/AdminNotification/etc/config.xml b/app/code/Magento/AdminNotification/etc/config.xml index 63c65f9ed9bfe8f6a121cc171d1778eac64f7652..ee3de27eab961b42a3f550e7c3dbfea737b3fd4f 100644 --- a/app/code/Magento/AdminNotification/etc/config.xml +++ b/app/code/Magento/AdminNotification/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <system> <adminnotification> diff --git a/app/code/Magento/AdminNotification/etc/di.xml b/app/code/Magento/AdminNotification/etc/di.xml index 49edeb34f4734400a2ec82060db612c199cedcb5..8f91e2f230fee2109cd5d31ad39b1d80c307acd5 100644 --- a/app/code/Magento/AdminNotification/etc/di.xml +++ b/app/code/Magento/AdminNotification/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Framework\Notification\NotifierList"> <arguments> <argument name="notifiers" xsi:type="array"> diff --git a/app/code/Magento/AdminNotification/etc/module.xml b/app/code/Magento/AdminNotification/etc/module.xml index dd60aeb295b79ab9516a5482f221a1748bf27382..33b302559afd4e03eb165a78a20936635060341f 100644 --- a/app/code/Magento/AdminNotification/etc/module.xml +++ b/app/code/Magento/AdminNotification/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_AdminNotification" setup_version="2.0.0"> <sequence> <module name="Magento_Store"/> diff --git a/app/code/Magento/AdminNotification/registration.php b/app/code/Magento/AdminNotification/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..97ce996e0cea86a0ce7eee32ed4318389b8c9af7 --- /dev/null +++ b/app/code/Magento/AdminNotification/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_AdminNotification', + __DIR__ +); 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 cc6ac2e669008373a78c3da9fe51dcb492d98d33..0d3b6979ea92679dd4306d14cccb6359c272296a 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 @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="adminhtml.notification.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.notification.container.grid" as="grid"> diff --git a/app/code/Magento/AdminNotification/view/adminhtml/layout/adminhtml_notification_index.xml b/app/code/Magento/AdminNotification/view/adminhtml/layout/adminhtml_notification_index.xml index 69a0f31fdd62860addd36a6a5491a08f5b7dfbd0..5f03bed8cf0cf33826fbd595ac885837bf2b456f 100644 --- a/app/code/Magento/AdminNotification/view/adminhtml/layout/adminhtml_notification_index.xml +++ b/app/code/Magento/AdminNotification/view/adminhtml/layout/adminhtml_notification_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="adminhtml_notification_block"/> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/AdminNotification/view/adminhtml/layout/default.xml b/app/code/Magento/AdminNotification/view/adminhtml/layout/default.xml index b93a40dade162f6b92648032860fb0413d2c489f..5f79a20ba4b56884b3e506bd3fbc77cf0e939c27 100644 --- a/app/code/Magento/AdminNotification/view/adminhtml/layout/default.xml +++ b/app/code/Magento/AdminNotification/view/adminhtml/layout/default.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="notifications"> <block class="Magento\AdminNotification\Block\System\Messages" name="system_messages" as="system_messages" before="-" template="Magento_AdminNotification::system/messages.phtml"/> diff --git a/app/code/Magento/AdvancedPricingImportExport/composer.json b/app/code/Magento/AdvancedPricingImportExport/composer.json index e16aa8af8d54cfaf98612717d386d1eeab9628c1..f250ed75ae605b43d9fd0b5382bad7775aeeb03b 100644 --- a/app/code/Magento/AdvancedPricingImportExport/composer.json +++ b/app/code/Magento/AdvancedPricingImportExport/composer.json @@ -10,8 +10,7 @@ "magento/module-catalog-import-export": "1.0.0-beta", "magento/module-customer": "1.0.0-beta", "magento/module-store": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -19,12 +18,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/AdvancedPricingImportExport" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\AdvancedPricingImportExport\\": "" + } } } diff --git a/app/code/Magento/AdvancedPricingImportExport/etc/adminhtml/routes.xml b/app/code/Magento/AdvancedPricingImportExport/etc/adminhtml/routes.xml index bd01a7fb02242dfbf4784e15d0efe7515fdc99c2..9e09f447f44b4054a1dfdf3e2b8f7f1367d482a7 100644 --- a/app/code/Magento/AdvancedPricingImportExport/etc/adminhtml/routes.xml +++ b/app/code/Magento/AdvancedPricingImportExport/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="admin"> <route id="adminhtml"> <module name="Magento_AdvancedPricingImportExport" before="Magento_ImportExport" /> diff --git a/app/code/Magento/AdvancedPricingImportExport/etc/di.xml b/app/code/Magento/AdvancedPricingImportExport/etc/di.xml index 9871308ef1a357812242dc878d693314edb8403d..4119871e0b306e50514d4782fccf3d0b7e964993 100644 --- a/app/code/Magento/AdvancedPricingImportExport/etc/di.xml +++ b/app/code/Magento/AdvancedPricingImportExport/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\AdvancedPricingImportExport\Model\Import\AdvancedPricing"> <plugin name="invalidateAdvancedPriceIndexerOnImport" type="Magento\AdvancedPricingImportExport\Model\Indexer\Product\Price\Plugin\Import" /> </type> diff --git a/app/code/Magento/AdvancedPricingImportExport/etc/export.xml b/app/code/Magento/AdvancedPricingImportExport/etc/export.xml index 3da9449102b64fec75896988bd0d837e1de19a93..6d059826c91679b42821ab471304d4da5a2186ca 100644 --- a/app/code/Magento/AdvancedPricingImportExport/etc/export.xml +++ b/app/code/Magento/AdvancedPricingImportExport/etc/export.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../ImportExport/etc/export.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_ImportExport:etc/export.xsd"> <entity name="advanced_pricing" label="Advanced Pricing" model="Magento\AdvancedPricingImportExport\Model\Export\AdvancedPricing" entityAttributeFilterType="advanced_pricing"/> -</config> \ No newline at end of file +</config> diff --git a/app/code/Magento/AdvancedPricingImportExport/etc/import.xml b/app/code/Magento/AdvancedPricingImportExport/etc/import.xml index 0d113f745d6f8608e5ebbfcbff755ee8aa684aaf..140da19547b7f36633d3edeec2fcc4a5e922e8ac 100644 --- a/app/code/Magento/AdvancedPricingImportExport/etc/import.xml +++ b/app/code/Magento/AdvancedPricingImportExport/etc/import.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../ImportExport/etc/import.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_ImportExport:etc/import.xsd"> <entity name="advanced_pricing" label="Advanced Pricing" model="Magento\AdvancedPricingImportExport\Model\Import\AdvancedPricing" behaviorModel="Magento\ImportExport\Model\Source\Import\Behavior\Basic" /> -</config> \ No newline at end of file +</config> diff --git a/app/code/Magento/AdvancedPricingImportExport/etc/module.xml b/app/code/Magento/AdvancedPricingImportExport/etc/module.xml index ef30304b507d2d1448bfc3b406ab6ae98d23b526..a5db856f301770fdb780cc3a3c2112d1289da49f 100644 --- a/app/code/Magento/AdvancedPricingImportExport/etc/module.xml +++ b/app/code/Magento/AdvancedPricingImportExport/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_AdvancedPricingImportExport" setup_version="2.0.0"> </module> </config> diff --git a/app/code/Magento/AdvancedPricingImportExport/registration.php b/app/code/Magento/AdvancedPricingImportExport/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..ada9c5dc775befe89d9395aca3c231198873bb00 --- /dev/null +++ b/app/code/Magento/AdvancedPricingImportExport/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_AdvancedPricingImportExport', + __DIR__ +); diff --git a/app/code/Magento/Authorization/composer.json b/app/code/Magento/Authorization/composer.json index eefa0dfd35d1a816b685a95361bec50dec76ea8f..44cfd3ae731acaed01a494aebb5252062aeaedf8 100644 --- a/app/code/Magento/Authorization/composer.json +++ b/app/code/Magento/Authorization/composer.json @@ -4,8 +4,7 @@ "require": { "php": "~5.5.0|~5.6.0|~7.0.0", "magento/module-backend": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -13,12 +12,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Authorization" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Authorization\\": "" + } } } diff --git a/app/code/Magento/Authorization/etc/di.xml b/app/code/Magento/Authorization/etc/di.xml index 9aa6661d1a8203bc50736f838574c477dde6dba1..094b43dddcc7a089dcf3d976ce479638ecfdafde 100644 --- a/app/code/Magento/Authorization/etc/di.xml +++ b/app/code/Magento/Authorization/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Authorization\Model\Role" shared="false" /> <type name="Magento\Authorization\Model\Resource\Rules"> <arguments> diff --git a/app/code/Magento/Authorization/etc/module.xml b/app/code/Magento/Authorization/etc/module.xml index 6c30cdc5c72ecb5d340044fbb39f171fb354b316..1fa80d2f2b94043b89a350406f0259a4687f50ca 100644 --- a/app/code/Magento/Authorization/etc/module.xml +++ b/app/code/Magento/Authorization/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Authorization" setup_version="2.0.0"> <sequence> <module name="Magento_Backend"/> diff --git a/app/code/Magento/Authorization/registration.php b/app/code/Magento/Authorization/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..d0f2766549041098bee1d599eace2be812a1a865 --- /dev/null +++ b/app/code/Magento/Authorization/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Authorization', + __DIR__ +); diff --git a/app/code/Magento/Authorizenet/composer.json b/app/code/Magento/Authorizenet/composer.json index 886de1c84f865e66544ba9450e03ade0381971e1..32a79c80c58df6cdfa0a1b86fd915390b9902633 100644 --- a/app/code/Magento/Authorizenet/composer.json +++ b/app/code/Magento/Authorizenet/composer.json @@ -10,20 +10,17 @@ "magento/module-backend": "1.0.0-beta", "magento/module-payment": "1.0.0-beta", "magento/module-catalog": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", "license": [ "proprietary" ], - "extra": { - "map": [ - [ - "*", - "Magento/Authorizenet" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Authorizenet\\": "" + } } } diff --git a/app/code/Magento/Authorizenet/etc/adminhtml/di.xml b/app/code/Magento/Authorizenet/etc/adminhtml/di.xml index cad68b99f6da832324a0c67110ade7660b82bd89..76f7e407f17aadb35be918b69f18198014ce7f00 100644 --- a/app/code/Magento/Authorizenet/etc/adminhtml/di.xml +++ b/app/code/Magento/Authorizenet/etc/adminhtml/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Authorizenet\Model\Directpost"> <arguments> <argument name="session" xsi:type="object">Magento\Backend\Model\Session\Quote</argument> diff --git a/app/code/Magento/Authorizenet/etc/adminhtml/events.xml b/app/code/Magento/Authorizenet/etc/adminhtml/events.xml index 9121acb67fba680a8cefd6acf19483c09b2baa47..6af0e3cc979df6ea8ec77e6dda85a9fb8670ae97 100644 --- a/app/code/Magento/Authorizenet/etc/adminhtml/events.xml +++ b/app/code/Magento/Authorizenet/etc/adminhtml/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="checkout_submit_all_after"> <observer name="directpost_update_all_edit_increments" instance="Magento\Authorizenet\Observer\UpdateAllEditIncrementsObserver" method="execute" /> </event> diff --git a/app/code/Magento/Authorizenet/etc/adminhtml/routes.xml b/app/code/Magento/Authorizenet/etc/adminhtml/routes.xml index a1d23a80590acfcba2af0891af849bb13540549c..041690cc8e6347bf996a2aff840b89ed0cb025e8 100644 --- a/app/code/Magento/Authorizenet/etc/adminhtml/routes.xml +++ b/app/code/Magento/Authorizenet/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="admin"> <route id="adminhtml"> <module name="Magento_Authorizenet" before="Magento_Backend" /> diff --git a/app/code/Magento/Authorizenet/etc/adminhtml/system.xml b/app/code/Magento/Authorizenet/etc/adminhtml/system.xml index 7dc326ff9c56954251e0834fca20874d5835522f..f745bf99afdae21d5efc285873d6686e513fdd25 100644 --- a/app/code/Magento/Authorizenet/etc/adminhtml/system.xml +++ b/app/code/Magento/Authorizenet/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="payment"> <group id="authorizenet_directpost" translate="label" type="text" sortOrder="34" showInDefault="1" showInWebsite="1" showInStore="1"> diff --git a/app/code/Magento/Authorizenet/etc/config.xml b/app/code/Magento/Authorizenet/etc/config.xml index d672c305df335f70d3474fc4901e1154dd68e861..51eb9509c117f45b18c50ada5b1606f0a863f258 100644 --- a/app/code/Magento/Authorizenet/etc/config.xml +++ b/app/code/Magento/Authorizenet/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <payment> <authorizenet_directpost> diff --git a/app/code/Magento/Authorizenet/etc/di.xml b/app/code/Magento/Authorizenet/etc/di.xml index d55345e3272817f0dbca76fa9456603f588351ab..65ae7ef13500c02b7f962f3847977a4414b8cdef 100644 --- a/app/code/Magento/Authorizenet/etc/di.xml +++ b/app/code/Magento/Authorizenet/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <virtualType name="Magento\Authorizenet\Model\Directpost\Session\Storage" type="Magento\Framework\Session\Storage"> <arguments> <argument name="namespace" xsi:type="string">authorizenet_directpost</argument> diff --git a/app/code/Magento/Authorizenet/etc/frontend/di.xml b/app/code/Magento/Authorizenet/etc/frontend/di.xml index 915ef3bb288f5a376ad5977179d52ce1d99fe7f3..aaf07b605cb4edabcc6f8a6eece6695976034b05 100644 --- a/app/code/Magento/Authorizenet/etc/frontend/di.xml +++ b/app/code/Magento/Authorizenet/etc/frontend/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Authorizenet\Model\Directpost"> <arguments> <argument name="session" xsi:type="object">Magento\Checkout\Model\Session</argument> diff --git a/app/code/Magento/Authorizenet/etc/frontend/events.xml b/app/code/Magento/Authorizenet/etc/frontend/events.xml index a2d55bbcfbcf9ad4ba19d221502b6fad8e21abd5..6bdc45a80e3892f856fa6278ff750f4ebbbf50ed 100644 --- a/app/code/Magento/Authorizenet/etc/frontend/events.xml +++ b/app/code/Magento/Authorizenet/etc/frontend/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="checkout_submit_all_after"> <observer name="directpost_save_order_after_submit" instance="Magento\Authorizenet\Observer\SaveOrderAfterSubmitObserver" method="execute" /> </event> diff --git a/app/code/Magento/Authorizenet/etc/frontend/page_types.xml b/app/code/Magento/Authorizenet/etc/frontend/page_types.xml index dafa9fe416ee0c78539005ae69932767eac45a06..80f1a4dbb2816fed6d78c2a2f56bd8ce8eca7d60 100644 --- a/app/code/Magento/Authorizenet/etc/frontend/page_types.xml +++ b/app/code/Magento/Authorizenet/etc/frontend/page_types.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page_types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_types.xsd"> +<page_types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_types.xsd"> <type id="authorizenet_directpost_payment_redirect" label="AuthorizeNet Directpost Redirect"/> <type id="authorizenet_directpost_payment_response" label="AuthorizeNet Directpost Response"/> </page_types> diff --git a/app/code/Magento/Authorizenet/etc/frontend/routes.xml b/app/code/Magento/Authorizenet/etc/frontend/routes.xml index d9ebbfadff20117631558a7ac28c304d4edb76cc..0ecc4d183449198cf572ec72c2294531cfdba70e 100644 --- a/app/code/Magento/Authorizenet/etc/frontend/routes.xml +++ b/app/code/Magento/Authorizenet/etc/frontend/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="standard"> <route id="authorizenet" frontName="authorizenet"> <module name="Magento_Authorizenet" /> diff --git a/app/code/Magento/Authorizenet/etc/module.xml b/app/code/Magento/Authorizenet/etc/module.xml index 229118564b3f8f477f8dbd6690ec31db16448776..8ad345a289738e09a27df606e21c620e2248a1e9 100644 --- a/app/code/Magento/Authorizenet/etc/module.xml +++ b/app/code/Magento/Authorizenet/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Authorizenet" setup_version="2.0.0"> <sequence> <module name="Magento_Sales"/> diff --git a/app/code/Magento/Authorizenet/registration.php b/app/code/Magento/Authorizenet/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..949ec71a4482655688a0b873f6f134b90fc2fee2 --- /dev/null +++ b/app/code/Magento/Authorizenet/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Authorizenet', + __DIR__ +); diff --git a/app/code/Magento/Authorizenet/view/adminhtml/layout/adminhtml_authorizenet_directpost_payment_redirect.xml b/app/code/Magento/Authorizenet/view/adminhtml/layout/adminhtml_authorizenet_directpost_payment_redirect.xml index d3f5ec48384034f36aa8c7efd3633a558306ad05..9faedca094f5220a42db525743adab1917b448f2 100644 --- a/app/code/Magento/Authorizenet/view/adminhtml/layout/adminhtml_authorizenet_directpost_payment_redirect.xml +++ b/app/code/Magento/Authorizenet/view/adminhtml/layout/adminhtml_authorizenet_directpost_payment_redirect.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root" label="Root"> <block class="Magento\Authorizenet\Block\Transparent\Iframe" name="authorizenet_directpost_iframe" template="Magento_Authorizenet::directpost/iframe.phtml"/> </container> diff --git a/app/code/Magento/Authorizenet/view/adminhtml/layout/sales_order_create_index.xml b/app/code/Magento/Authorizenet/view/adminhtml/layout/sales_order_create_index.xml index e14a5a03af11b804644abacbdff9cd89f198d96e..647da0aced79062e89b8664cc051efc477f0d647 100644 --- a/app/code/Magento/Authorizenet/view/adminhtml/layout/sales_order_create_index.xml +++ b/app/code/Magento/Authorizenet/view/adminhtml/layout/sales_order_create_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="order_create_billing_form"> <action method="setMethodFormTemplate"> diff --git a/app/code/Magento/Authorizenet/view/adminhtml/layout/sales_order_create_load_block_billing_method.xml b/app/code/Magento/Authorizenet/view/adminhtml/layout/sales_order_create_load_block_billing_method.xml index b3451c3c683a9ca23aef5cdae81ca29a4f40f83e..ac2b0fa65f6959b9c3bf2a1f164504cec3f9ebf3 100644 --- a/app/code/Magento/Authorizenet/view/adminhtml/layout/sales_order_create_load_block_billing_method.xml +++ b/app/code/Magento/Authorizenet/view/adminhtml/layout/sales_order_create_load_block_billing_method.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="order.create.billing.method.form"> <action method="setMethodFormTemplate"> diff --git a/app/code/Magento/Authorizenet/view/adminhtml/layout/sales_order_view.xml b/app/code/Magento/Authorizenet/view/adminhtml/layout/sales_order_view.xml index 0c44217a8700e8a60aa1f1073c843d7698e1f5ce..15858ce1a239bf893523d10546cffef979017ed7 100644 --- a/app/code/Magento/Authorizenet/view/adminhtml/layout/sales_order_view.xml +++ b/app/code/Magento/Authorizenet/view/adminhtml/layout/sales_order_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="payment_additional_info"> <block class="Magento\Authorizenet\Block\Adminhtml\Order\View\Info\FraudDetails" name="authorizenet_fraud_details" template="Magento_Authorizenet::order/view/info/fraud_details.phtml" /> diff --git a/app/code/Magento/Authorizenet/view/frontend/layout/authorizenet_directpost_payment_backendresponse.xml b/app/code/Magento/Authorizenet/view/frontend/layout/authorizenet_directpost_payment_backendresponse.xml index affaef4af2b27ce3189fd1cf8a8ae16e16f499c9..c378be90cf91085567312004bd47cc1c701c1979 100644 --- a/app/code/Magento/Authorizenet/view/frontend/layout/authorizenet_directpost_payment_backendresponse.xml +++ b/app/code/Magento/Authorizenet/view/frontend/layout/authorizenet_directpost_payment_backendresponse.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root"> <block class="Magento\Payment\Block\Transparent\Iframe" name="authorizenet_directpost_iframe" template="Magento_Payment::transparent/iframe.phtml"/> </container> diff --git a/app/code/Magento/Authorizenet/view/frontend/layout/authorizenet_directpost_payment_redirect.xml b/app/code/Magento/Authorizenet/view/frontend/layout/authorizenet_directpost_payment_redirect.xml index affaef4af2b27ce3189fd1cf8a8ae16e16f499c9..c378be90cf91085567312004bd47cc1c701c1979 100644 --- a/app/code/Magento/Authorizenet/view/frontend/layout/authorizenet_directpost_payment_redirect.xml +++ b/app/code/Magento/Authorizenet/view/frontend/layout/authorizenet_directpost_payment_redirect.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root"> <block class="Magento\Payment\Block\Transparent\Iframe" name="authorizenet_directpost_iframe" template="Magento_Payment::transparent/iframe.phtml"/> </container> diff --git a/app/code/Magento/Authorizenet/view/frontend/layout/authorizenet_directpost_payment_response.xml b/app/code/Magento/Authorizenet/view/frontend/layout/authorizenet_directpost_payment_response.xml index affaef4af2b27ce3189fd1cf8a8ae16e16f499c9..c378be90cf91085567312004bd47cc1c701c1979 100644 --- a/app/code/Magento/Authorizenet/view/frontend/layout/authorizenet_directpost_payment_response.xml +++ b/app/code/Magento/Authorizenet/view/frontend/layout/authorizenet_directpost_payment_response.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root"> <block class="Magento\Payment\Block\Transparent\Iframe" name="authorizenet_directpost_iframe" template="Magento_Payment::transparent/iframe.phtml"/> </container> diff --git a/app/code/Magento/Authorizenet/view/frontend/layout/checkout_index_index.xml b/app/code/Magento/Authorizenet/view/frontend/layout/checkout_index_index.xml index c23121d30ce8e317dcb2054075501bd41a666c31..788aba1b51d2d8fe18862e359cecb25ab489bee6 100644 --- a/app/code/Magento/Authorizenet/view/frontend/layout/checkout_index_index.xml +++ b/app/code/Magento/Authorizenet/view/frontend/layout/checkout_index_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout.root"> <arguments> diff --git a/app/code/Magento/Backend/App/AbstractAction.php b/app/code/Magento/Backend/App/AbstractAction.php index 1f094afbd7d651369aa927936e454d7f675cb86b..c41338591d3449d6826e14a0c9eb8a409522765b 100644 --- a/app/code/Magento/Backend/App/AbstractAction.php +++ b/app/code/Magento/Backend/App/AbstractAction.php @@ -300,7 +300,6 @@ abstract class AbstractAction extends \Magento\Framework\App\Action\Action /** * Set redirect into response * - * @deprecated * @TODO MAGETWO-28356: Refactor controller actions to new ResultInterface * @param string $path * @param array $arguments @@ -316,7 +315,6 @@ abstract class AbstractAction extends \Magento\Framework\App\Action\Action /** * Forward to action * - * @deprecated * @TODO MAGETWO-28356: Refactor controller actions to new ResultInterface * @param string $action * @param string|null $controller diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Massaction/Extended.php b/app/code/Magento/Backend/Block/Widget/Grid/Massaction/Extended.php index dfb6677bf3920f12b33c65a9f6b5ebc5f21ac21a..4bc92e84267b3cd5536f1b96a99c95c3a1b9b2ac 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Massaction/Extended.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Massaction/Extended.php @@ -11,7 +11,6 @@ namespace Magento\Backend\Block\Widget\Grid\Massaction; * @method \Magento\Quote\Model\Quote setHideFormElement(boolean $value) Hide Form element to prevent IE errors * @method boolean getHideFormElement() * @author Magento Core Team <core@magentocommerce.com> - * @deprecated support Magento 1.x grid massaction implementation * @TODO MAGETWO-31510: Remove deprecated class */ class Extended extends \Magento\Backend\Block\Widget diff --git a/app/code/Magento/Backend/Model/Menu/Config/SchemaLocator.php b/app/code/Magento/Backend/Model/Menu/Config/SchemaLocator.php index 5854daae5e4b8cba4e5bf654488b21cf9073f914..8d414584642ab3e63ecafbb7c33ff265ed23309b 100644 --- a/app/code/Magento/Backend/Model/Menu/Config/SchemaLocator.php +++ b/app/code/Magento/Backend/Model/Menu/Config/SchemaLocator.php @@ -7,6 +7,8 @@ */ namespace Magento\Backend\Model\Menu\Config; +use Magento\Framework\Module\Dir; + class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface { /** @@ -28,7 +30,7 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface */ public function __construct(\Magento\Framework\Module\Dir\Reader $moduleReader) { - $this->_schema = $moduleReader->getModuleDir('etc', 'Magento_Backend') . '/menu.xsd'; + $this->_schema = $moduleReader->getModuleDir(Dir::MODULE_ETC_DIR, 'Magento_Backend') . '/menu.xsd'; } /** diff --git a/app/code/Magento/Backend/Test/Unit/Model/Menu/Config/XsdTest.php b/app/code/Magento/Backend/Test/Unit/Model/Menu/Config/XsdTest.php index 9974071cc8f976c0c63e650e819798470d331f56..2abea56803762bcf60ee737c4c309c4cd406faa5 100644 --- a/app/code/Magento/Backend/Test/Unit/Model/Menu/Config/XsdTest.php +++ b/app/code/Magento/Backend/Test/Unit/Model/Menu/Config/XsdTest.php @@ -14,13 +14,14 @@ class XsdTest extends \PHPUnit_Framework_TestCase protected $_xsdSchema; /** - * @var \Magento\TestFramework\Utility\XsdValidator + * @var \Magento\Framework\TestFramework\Unit\Utility\XsdValidator() */ protected $_xsdValidator; protected function setUp() { - $this->_xsdSchema = BP . '/app/code/Magento/Backend/etc/menu.xsd'; + $urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + $this->_xsdSchema = $urnResolver->getRealPath('urn:magento:module:Magento_Backend:etc/menu.xsd'); $this->_xsdValidator = new \Magento\Framework\TestFramework\Unit\Utility\XsdValidator(); } diff --git a/app/code/Magento/Backend/Test/Unit/Model/Menu/Config/_files/invalidMenuXmlArray.php b/app/code/Magento/Backend/Test/Unit/Model/Menu/Config/_files/invalidMenuXmlArray.php index a187bc629dcbbfa39e88ba2aa935604ff9812d67..3de2e1e1987fb03afa28d4ef49fb4507ee305f2b 100644 --- a/app/code/Magento/Backend/Test/Unit/Model/Menu/Config/_files/invalidMenuXmlArray.php +++ b/app/code/Magento/Backend/Test/Unit/Model/Menu/Config/_files/invalidMenuXmlArray.php @@ -10,8 +10,8 @@ return [ ' resource="Test_Value::value"/></menu></config>', [ "Element 'add', attribute 'action': [facet 'pattern'] The value '' is not accepted by the " . - "pattern '[a-zA-Z0-9/_]{3,}'.", - "Element 'add', attribute 'action': '' is not a valid value of the atomic type 'typeAction'." + "pattern '[a-zA-Z0-9/_]{3,}'.\nLine: 1\n", + "Element 'add', attribute 'action': '' is not a valid value of the atomic type 'typeAction'.\nLine: 1\n" ], ], 'add_action_attribute_less_minLenght_value' => [ @@ -20,8 +20,8 @@ return [ 'resource="Test_Value::value"/></menu></config>', [ "Element 'add', attribute 'action': [facet 'pattern'] The value 'ad' is not accepted by the " . - "pattern '[a-zA-Z0-9/_]{3,}'.", - "Element 'add', attribute 'action': 'ad' is not a valid value of the atomic type 'typeAction'." + "pattern '[a-zA-Z0-9/_]{3,}'.\nLine: 1\n", + "Element 'add', attribute 'action': 'ad' is not a valid value of the atomic type 'typeAction'.\nLine: 1\n" ], ], 'add_action_attribute_notallowed_symbols_value' => [ @@ -31,9 +31,9 @@ return [ '</menu></config>', [ "Element 'add', attribute 'action': [facet 'pattern'] The value 'adm$#@inhtml/notification' is not " . - "accepted by the pattern '[a-zA-Z0-9/_]{3,}'.", + "accepted by the pattern '[a-zA-Z0-9/_]{3,}'.\nLine: 1\n", "Element 'add', attribute 'action': 'adm$#@inhtml/notification' is not a valid value of the atomic " . - "type 'typeAction'." + "type 'typeAction'.\nLine: 1\n" ], ], 'add_dependsOnConfig_attribute_empty_value' => [ @@ -43,9 +43,9 @@ return [ '</menu></config>', [ "Element 'add', attribute 'dependsOnConfig': [facet 'pattern'] The value '' is not accepted by the " . - "pattern '[A-Za-z0-9_/]{3,}'.", + "pattern '[A-Za-z0-9_/]{3,}'.\nLine: 1\n", "Element 'add', attribute 'dependsOnConfig': '' " . - "is not a valid value of the atomic type 'typeDependsConfig'." + "is not a valid value of the atomic type 'typeDependsConfig'.\nLine: 1\n" ], ], 'add_dependsOnConfig_attribute_less_minLenght_value' => [ @@ -55,9 +55,9 @@ return [ '</menu></config>', [ "Element 'add', attribute 'dependsOnConfig': [facet 'pattern'] The value 'v' is not accepted by the " . - "pattern '[A-Za-z0-9_/]{3,}'.", + "pattern '[A-Za-z0-9_/]{3,}'.\nLine: 1\n", "Element 'add', attribute 'dependsOnConfig': 'v' is not a valid value of the atomic " . - "type 'typeDependsConfig'." + "type 'typeDependsConfig'.\nLine: 1\n" ], ], 'add_dependsOnConfig_attribute_notallowed_symbols_value' => [ @@ -67,9 +67,9 @@ return [ '</menu></config>', [ "Element 'add', attribute 'dependsOnConfig': [facet 'pattern'] The value 'name#1' is not accepted by " . - "the pattern '[A-Za-z0-9_/]{3,}'.", + "the pattern '[A-Za-z0-9_/]{3,}'.\nLine: 1\n", "Element 'add', attribute 'dependsOnConfig': 'name#1' is not a valid value of the atomic " . - "type 'typeDependsConfig'." + "type 'typeDependsConfig'.\nLine: 1\n" ], ], 'add_dependsOnModule_attribute_empty_value' => [ @@ -79,8 +79,9 @@ return [ '</menu></config>', [ "Element 'add', attribute 'dependsOnModule': [facet 'pattern'] The value '' is not accepted by the " . - "pattern '[A-Za-z0-9_]{3,}'.", - "Element 'add', attribute 'dependsOnModule': '' is not a valid value of the atomic type 'typeModule'." + "pattern '[A-Za-z0-9_]{3,}'.\nLine: 1\n", + "Element 'add', attribute 'dependsOnModule': '' is not a valid value of the atomic type" . + " 'typeModule'.\nLine: 1\n" ], ], 'add_dependsOnModule_attribute_less_minLenght_value' => [ @@ -90,8 +91,9 @@ return [ '</menu></config>', [ "Element 'add', attribute 'dependsOnModule': [facet 'pattern'] The value 'w' is not accepted by the " . - "pattern '[A-Za-z0-9_]{3,}'.", - "Element 'add', attribute 'dependsOnModule': 'w' is not a valid value of the atomic type 'typeModule'." + "pattern '[A-Za-z0-9_]{3,}'.\nLine: 1\n", + "Element 'add', attribute 'dependsOnModule': 'w' is not a valid value of the atomic type" + . " 'typeModule'.\nLine: 1\n" ], ], 'add_dependsOnModule_attribute_notallowed_symbols_value' => [ @@ -101,9 +103,9 @@ return [ '</menu></config>', [ "Element 'add', attribute 'dependsOnModule': [facet 'pattern'] The value '@#erw' is not " . - "accepted by the pattern '[A-Za-z0-9_]{3,}'.", + "accepted by the pattern '[A-Za-z0-9_]{3,}'.\nLine: 1\n", "Element 'add', attribute 'dependsOnModule': '@#erw' is not a valid value of the atomic " . - "type 'typeModule'." + "type 'typeModule'.\nLine: 1\n" ], ], 'add_id_attribute_empty_value' => [ @@ -111,10 +113,10 @@ return [ 'resource="Test_Value::value"/></menu></config>', [ "Element 'add', attribute 'id': [facet 'pattern'] The value '' is not accepted by the " . - "pattern '[A-Za-z0-9/_:]{3,}'.", - "Element 'add', attribute 'id': '' is not a valid value of the atomic type 'typeId'.", + "pattern '[A-Za-z0-9/_:]{3,}'.\nLine: 1\n", + "Element 'add', attribute 'id': '' is not a valid value of the atomic type 'typeId'.\nLine: 1\n", "Element 'add', attribute 'id': Warning: No precomputed value available, the value was either invalid or " . - "something strange happend." + "something strange happend.\nLine: 1\n" ], ], 'add_id_attribute_less_minLenght_value' => [ @@ -122,10 +124,10 @@ return [ 'resource="Test_Value::value"/></menu></config>', [ "Element 'add', attribute 'id': [facet 'pattern'] The value 'ma' is not accepted by the " . - "pattern '[A-Za-z0-9/_:]{3,}'.", - "Element 'add', attribute 'id': 'ma' is not a valid value of the atomic type 'typeId'.", + "pattern '[A-Za-z0-9/_:]{3,}'.\nLine: 1\n", + "Element 'add', attribute 'id': 'ma' is not a valid value of the atomic type 'typeId'.\nLine: 1\n", "Element 'add', attribute 'id': Warning: No precomputed value available, the value was either invalid or " . - "something strange happend." + "something strange happend.\nLine: 1\n" ], ], 'add_id_attribute_notallowed_symbols_value' => [ @@ -134,11 +136,11 @@ return [ 'resource="Test_Value::value"/></menu></config>', [ "Element 'add', attribute 'id': [facet 'pattern'] The value 'Magento)value::some_value' is not " . - "accepted by the pattern '[A-Za-z0-9/_:]{3,}'.", + "accepted by the pattern '[A-Za-z0-9/_:]{3,}'.\nLine: 1\n", "Element 'add', attribute 'id': 'Magento)value::some_value' " . - "is not a valid value of the atomic type 'typeId'.", + "is not a valid value of the atomic type 'typeId'.\nLine: 1\n", "Element 'add', attribute 'id': Warning: No precomputed value available, the value was either invalid or " . - "something strange happend." + "something strange happend.\nLine: 1\n" ], ], 'add_module_attribute_empty_value' => [ @@ -146,8 +148,8 @@ return [ 'title="Notifications" resource="Test_Value::value"/></menu></config>', [ "Element 'add', attribute 'module': [facet 'pattern'] The value '' is not accepted by the " . - "pattern '[A-Za-z0-9_]{3,}'.", - "Element 'add', attribute 'module': '' is not a valid value of the atomic type 'typeModule'." + "pattern '[A-Za-z0-9_]{3,}'.\nLine: 1\n", + "Element 'add', attribute 'module': '' is not a valid value of the atomic type 'typeModule'.\nLine: 1\n" ], ], 'add_module_attribute_less_minLenght_value' => [ @@ -156,8 +158,8 @@ return [ 'resource="Test_Value::value"/></menu></config>', [ "Element 'add', attribute 'module': [facet 'pattern'] The value 'we' is not accepted by the " . - "pattern '[A-Za-z0-9_]{3,}'.", - "Element 'add', attribute 'module': 'we' is not a valid value of the atomic type 'typeModule'." + "pattern '[A-Za-z0-9_]{3,}'.\nLine: 1\n", + "Element 'add', attribute 'module': 'we' is not a valid value of the atomic type 'typeModule'.\nLine: 1\n" ], ], 'add_module_attribute_notallowed_symbols_value' => [ @@ -166,8 +168,9 @@ return [ 'resource="Test_Value::value"/></menu></config>', [ "Element 'add', attribute 'module': [facet 'pattern'] The value 'Test_Va%lue' is not accepted by the " . - "pattern '[A-Za-z0-9_]{3,}'.", - "Element 'add', attribute 'module': 'Test_Va%lue' is not a valid value of the atomic type 'typeModule'." + "pattern '[A-Za-z0-9_]{3,}'.\nLine: 1\n", + "Element 'add', attribute 'module': 'Test_Va%lue' is not a valid value of the atomic type" + . " 'typeModule'.\nLine: 1\n" ], ], 'add_parent_attribute_empty_value' => [ @@ -176,8 +179,8 @@ return [ 'resource="Test_Value::value"/></menu></config>', [ "Element 'add', attribute 'parent': [facet 'pattern'] The value '' is not accepted by the " . - "pattern '[A-Za-z0-9/_:]{3,}'.", - "Element 'add', attribute 'parent': '' is not a valid value of the atomic type 'typeId'." + "pattern '[A-Za-z0-9/_:]{3,}'.\nLine: 1\n", + "Element 'add', attribute 'parent': '' is not a valid value of the atomic type 'typeId'.\nLine: 1\n" ], ], 'add_parent_attribute_less_minLenght_value' => [ @@ -186,8 +189,8 @@ return [ 'resource="Test_Value::value"/></menu></config>', [ "Element 'add', attribute 'parent': [facet 'pattern'] The value 'Ma' is not accepted by the " . - "pattern '[A-Za-z0-9/_:]{3,}'.", - "Element 'add', attribute 'parent': 'Ma' is not a valid value of the atomic type 'typeId'." + "pattern '[A-Za-z0-9/_:]{3,}'.\nLine: 1\n", + "Element 'add', attribute 'parent': 'Ma' is not a valid value of the atomic type 'typeId'.\nLine: 1\n" ], ], 'add_parent_attribute_notallowed_symbols_value' => [ @@ -197,10 +200,10 @@ return [ '</menu></config>', [ "Element 'add', attribute 'parent': [facet 'pattern'] The value 'Some#Name::system_other_settings' " . - "is not accepted by the pattern '[A-Za-z0-9/_:]{3,}'.", + "is not accepted by the pattern '[A-Za-z0-9/_:]{3,}'.\nLine: 1\n", "Element 'add', attribute 'parent': 'Some#Name::system_other_settings' " . "is not a valid value of the atomic " . - "type 'typeId'." + "type 'typeId'.\nLine: 1\n" ], ], 'add_resource_attribute_notvalid_regexp_value1' => [ @@ -209,9 +212,9 @@ return [ 'resource="test_Value::value"/></menu></config>', [ "Element 'add', attribute 'resource': [facet 'pattern'] The value 'test_Value::value' is not " . - "accepted by the pattern '[A-Z]+[A-Za-z0-9]{1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.", + "accepted by the pattern '[A-Z]+[A-Za-z0-9]{1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.\nLine: 1\n", "Element 'add', attribute 'resource': 'test_Value::value' is not a valid value of the atomic " . - "type 'typeResource'." + "type 'typeResource'.\nLine: 1\n" ], ], 'add_resource_attribute_notvalid_regexp_value2' => [ @@ -220,9 +223,9 @@ return [ 'resource="Test_value::value"/></menu></config>', [ "Element 'add', attribute 'resource': [facet 'pattern'] The value 'Test_value::value' is not " . - "accepted by the pattern '[A-Z]+[A-Za-z0-9]{1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.", + "accepted by the pattern '[A-Z]+[A-Za-z0-9]{1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.\nLine: 1\n", "Element 'add', attribute 'resource': 'Test_value::value' is not a valid value of the atomic " . - "type 'typeResource'." + "type 'typeResource'.\nLine: 1\n" ], ], 'add_resource_attribute_notvalid_regexp_value3' => [ @@ -231,9 +234,9 @@ return [ 'resource="M#$%23_value::value"/></menu></config>', [ "Element 'add', attribute 'resource': [facet 'pattern'] The value 'M#$%23_value::value' is not " . - "accepted by the pattern '[A-Z]+[A-Za-z0-9]{1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.", + "accepted by the pattern '[A-Z]+[A-Za-z0-9]{1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.\nLine: 1\n", "Element 'add', attribute 'resource': 'M#$%23_value::value' is not a valid value of the atomic " . - "type 'typeResource'." + "type 'typeResource'.\nLine: 1\n" ], ], 'add_resource_attribute_notvalid_regexp_value4' => [ @@ -242,9 +245,9 @@ return [ 'resource="_value::value"/></menu></config>', [ "Element 'add', attribute 'resource': [facet 'pattern'] The value '_value::value' is not accepted by " . - "the pattern '[A-Z]+[A-Za-z0-9]{1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.", + "the pattern '[A-Z]+[A-Za-z0-9]{1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.\nLine: 1\n", "Element 'add', attribute 'resource': '_value::value' is not a valid value of the atomic " . - "type 'typeResource'." + "type 'typeResource'.\nLine: 1\n" ], ], 'add_resource_attribute_notvalid_regexp_value5' => [ @@ -253,9 +256,9 @@ return [ '</menu></config>', [ "Element 'add', attribute 'resource': [facet 'pattern'] The value 'Magento_::value' is not " . - "accepted by the pattern '[A-Z]+[A-Za-z0-9]{1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.", + "accepted by the pattern '[A-Z]+[A-Za-z0-9]{1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.\nLine: 1\n", "Element 'add', attribute 'resource': 'Magento_::value' is not a valid value of the atomic " . - "type 'typeResource'." + "type 'typeResource'.\nLine: 1\n" ], ], 'add_resource_attribute_notvalid_regexp_value6' => [ @@ -264,9 +267,9 @@ return [ 'resource="Test_Value:value"/></menu></config>', [ "Element 'add', attribute 'resource': [facet 'pattern'] The value 'Test_Value:value' is not " . - "accepted by the pattern '[A-Z]+[A-Za-z0-9]{1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.", + "accepted by the pattern '[A-Z]+[A-Za-z0-9]{1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.\nLine: 1\n", "Element 'add', attribute 'resource': 'Test_Value:value' is not a valid value of the atomic " . - "type 'typeResource'." + "type 'typeResource'.\nLine: 1\n" ], ], 'add_resource_attribute_notvalid_regexp_value7' => [ @@ -275,16 +278,16 @@ return [ 'resource="Test_Value::"/></menu></config>', [ "Element 'add', attribute 'resource': [facet 'pattern'] The value 'Test_Value::' is not " . - "accepted by the pattern '[A-Z]+[A-Za-z0-9]{1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.", + "accepted by the pattern '[A-Z]+[A-Za-z0-9]{1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.\nLine: 1\n", "Element 'add', attribute 'resource': 'Test_Value::' " . - "is not a valid value of the atomic type 'typeResource'." + "is not a valid value of the atomic type 'typeResource'.\nLine: 1\n" ], ], 'add_sortOrder_attribute_empty_value' => [ '<?xml version="1.0"?><config><menu><add sortOrder="" id="Test_Value::some_value" ' . 'title="Notifications" module="Test_Value" ' . 'resource="Test_Value::value"/></menu></config>', - ["Element 'add', attribute 'sortOrder': '' is not a valid value of the atomic type 'xs:int'."], + ["Element 'add', attribute 'sortOrder': '' is not a valid value of the atomic type 'xs:int'.\nLine: 1\n"], ], 'add_sortOrder_attribute_wrong_value_type' => [ '<?xml version="1.0"?><config><menu><add sortOrder="string value" ' . @@ -293,7 +296,7 @@ return [ '</menu></config>', [ "Element 'add', attribute 'sortOrder': 'string value' is not a valid value of the atomic " . - "type 'xs:int'." + "type 'xs:int'.\nLine: 1\n" ], ], 'add_title_attribute_empty_value' => [ @@ -302,8 +305,8 @@ return [ '</menu></config>', [ "Element 'add', attribute 'title': [facet 'minLength'] The value '' has a length of '0'; this " . - "underruns the allowed minimum length of '3'.", - "Element 'add', attribute 'title': '' is not a valid value of the atomic type 'typeTitle'." + "underruns the allowed minimum length of '3'.\nLine: 1\n", + "Element 'add', attribute 'title': '' is not a valid value of the atomic type 'typeTitle'.\nLine: 1\n" ], ], 'add_title_attribute_less_minLenght_value' => [ @@ -312,8 +315,8 @@ return [ '</menu></config>', [ "Element 'add', attribute 'title': [facet 'minLength'] The value 'No' has a length of '2'; this " . - "underruns the allowed minimum length of '3'.", - "Element 'add', attribute 'title': 'No' is not a valid value of the atomic type 'typeTitle'." + "underruns the allowed minimum length of '3'.\nLine: 1\n", + "Element 'add', attribute 'title': 'No' is not a valid value of the atomic type 'typeTitle'.\nLine: 1\n" ], ], 'add_title_attribute_more_maxLenght_value' => [ @@ -322,9 +325,10 @@ return [ 'resource="Test_Value::value"/></menu></config>', [ "Element 'add', attribute 'title': [facet 'maxLength'] The value 'Lorem ipsum dolor sit amet, " . - "consectetur adipisicing' has a length of '51'; this exceeds the allowed maximum length of '50'.", + "consectetur adipisicing' has a length of '51'; this exceeds the allowed maximum length" . + " of '50'.\nLine: 1\n", "Element 'add', attribute 'title': 'Lorem ipsum dolor sit amet, consectetur adipisicing' is not a " . - "valid value of the atomic type 'typeTitle'." + "valid value of the atomic type 'typeTitle'.\nLine: 1\n" ], ], 'add_toolTip_attribute_empty_value' => [ @@ -333,8 +337,8 @@ return [ 'resource="Test_Value::value"/></menu></config>', [ "Element 'add', attribute 'toolTip': [facet 'minLength'] The value '' has a length of '0'; this " . - "underruns the allowed minimum length of '3'.", - "Element 'add', attribute 'toolTip': '' is not a valid value of the atomic type 'typeTitle'." + "underruns the allowed minimum length of '3'.\nLine: 1\n", + "Element 'add', attribute 'toolTip': '' is not a valid value of the atomic type 'typeTitle'.\nLine: 1\n" ], ], 'add_toolTip_attribute_less_minLenght_value' => [ @@ -343,8 +347,8 @@ return [ 'resource="Test_Value::value"/></menu></config>', [ "Element 'add', attribute 'toolTip': [facet 'minLength'] The value 'st' has a length of '2'; this " . - "underruns the allowed minimum length of '3'.", - "Element 'add', attribute 'toolTip': 'st' is not a valid value of the atomic type 'typeTitle'." + "underruns the allowed minimum length of '3'.\nLine: 1\n", + "Element 'add', attribute 'toolTip': 'st' is not a valid value of the atomic type 'typeTitle'.\nLine: 1\n" ], ], 'add_toolTip_attribute_more_maxLenght_value' => [ @@ -354,9 +358,10 @@ return [ '</menu></config>', [ "Element 'add', attribute 'toolTip': [facet 'maxLength'] The value 'Lorem ipsum dolor sit amet, " . - "consectetur adipisicing' has a length of '51'; this exceeds the allowed maximum length of '50'.", + "consectetur adipisicing' has a length of '51'; this exceeds the allowed maximum length" . + " of '50'.\nLine: 1\n", "Element 'add', attribute 'toolTip': 'Lorem ipsum dolor sit amet, consectetur adipisicing' is not a " . - "valid value of the atomic type 'typeTitle'." + "valid value of the atomic type 'typeTitle'.\nLine: 1\n" ], ], 'add_with_notallowed_atrribute' => [ @@ -364,7 +369,7 @@ return [ 'id="Test_Value::some_value" title="Notifications" ' . 'module="Test_Value" resource="Test_Value::value"/>' . '</menu></config>', - ["Element 'add', attribute 'notallowed': The attribute 'notallowed' is not allowed."], + ["Element 'add', attribute 'notallowed': The attribute 'notallowed' is not allowed.\nLine: 1\n"], ], 'add_with_same_id_attribute_value' => [ '<?xml version="1.0"?><config><menu><add id="Test_Value::some_value" ' . @@ -376,79 +381,79 @@ return [ '</menu></config>', [ "Element 'add': Duplicate key-sequence ['Test_Value::some_value'] in unique " . - "identity-constraint 'uniqueAddItemId'." + "identity-constraint 'uniqueAddItemId'.\nLine: 1\n" ], ], 'add_without_req_attr' => [ '<?xml version="1.0"?><config><menu><add action="adminhtml/notification"/></menu></config>', [ - "Element 'add': The attribute 'id' is required but missing.", - "Element 'add': The attribute 'title' is required but missing.", - "Element 'add': The attribute 'module' is required but missing.", - "Element 'add': The attribute 'resource' is required but missing." + "Element 'add': The attribute 'id' is required but missing.\nLine: 1\n", + "Element 'add': The attribute 'title' is required but missing.\nLine: 1\n", + "Element 'add': The attribute 'module' is required but missing.\nLine: 1\n", + "Element 'add': The attribute 'resource' is required but missing.\nLine: 1\n" ], ], 'add_without_required_attribute_id' => [ '<?xml version="1.0"?><config><menu><add title="Notifications" module="Test_Value" ' . 'sortOrder="10" parent="Test_Value::system_other_settings" action="adminhtml/notification" ' . 'resource="Test_Value::value"/></menu></config>', - ["Element 'add': The attribute 'id' is required but missing."], + ["Element 'add': The attribute 'id' is required but missing.\nLine: 1\n"], ], 'add_without_required_attribute_module' => [ '<?xml version="1.0"?><config><menu><add id="Test_Value::some_value" ' . 'title="Notifications" resource="Test_Value::value"/></menu></config>', - ["Element 'add': The attribute 'module' is required but missing."], + ["Element 'add': The attribute 'module' is required but missing.\nLine: 1\n"], ], 'add_without_required_attribute_resource' => [ '<?xml version="1.0"?><config><menu><add id="Test_Value::some_value" ' . 'title="Notifications" module="Test_Value"/></menu></config>', - ["Element 'add': The attribute 'resource' is required but missing."], + ["Element 'add': The attribute 'resource' is required but missing.\nLine: 1\n"], ], 'double_menu' => [ '<?xml version="1.0"?><config><menu></menu><menu/></config>', - ["Element 'menu': This element is not expected."], + ["Element 'menu': This element is not expected.\nLine: 1\n"], ], 'remove_id_attribute_empty_value' => [ '<?xml version="1.0"?><config><menu><remove id=""/></menu></config>', [ "Element 'remove', attribute 'id': [facet 'pattern'] The value '' is not accepted by the " . - "pattern '[A-Za-z0-9/_:]{3,}'.", - "Element 'remove', attribute 'id': '' is not a valid value of the atomic type 'typeId'." + "pattern '[A-Za-z0-9/_:]{3,}'.\nLine: 1\n", + "Element 'remove', attribute 'id': '' is not a valid value of the atomic type 'typeId'.\nLine: 1\n" ], ], 'remove_id_attribute_less_minLenght_value' => [ '<?xml version="1.0"?><config><menu><remove id="Test_Value::system_%currency"/></menu></config>', [ "Element 'remove', attribute 'id': [facet 'pattern'] The value 'Test_Value::system_%currency' is not " . - "accepted by the pattern '[A-Za-z0-9/_:]{3,}'.", + "accepted by the pattern '[A-Za-z0-9/_:]{3,}'.\nLine: 1\n", "Element 'remove', attribute 'id': 'Test_Value::system_%currency' is not a valid value of the " . - "atomic type 'typeId'." + "atomic type 'typeId'.\nLine: 1\n" ], ], 'remove_id_attribute_notallowed_symbols_value' => [ '<?xml version="1.0"?><config><menu><remove id="Test_Value::system#currency"/></menu></config>', [ "Element 'remove', attribute 'id': [facet 'pattern'] The value 'Test_Value::system#currency' is not " . - "accepted by the pattern '[A-Za-z0-9/_:]{3,}'.", + "accepted by the pattern '[A-Za-z0-9/_:]{3,}'.\nLine: 1\n", "Element 'remove', attribute 'id': 'Test_Value::system#currency' is not a valid value of the " . - "atomic type 'typeId'." + "atomic type 'typeId'.\nLine: 1\n" ], ], 'remove_with_notallowed_atrribute' => [ '<?xml version="1.0"?><config><menu><remove id="Test_Value::system_currency" notallowe="some text"/>' . '</menu></config>', - ["Element 'remove', attribute 'notallowe': The attribute 'notallowe' is not allowed."], + ["Element 'remove', attribute 'notallowe': The attribute 'notallowe' is not allowed.\nLine: 1\n"], ], 'remove_without_required_attribute_id' => [ '<?xml version="1.0"?><config><menu><remove/></menu></config>', - ["Element 'remove': The attribute 'id' is required but missing."], + ["Element 'remove': The attribute 'id' is required but missing.\nLine: 1\n"], ], 'update_action_attribute_empty_value' => [ '<?xml version="1.0"?><config><menu><update action="" ' . 'id="Test_Value::some_value"/></menu></config>', [ "Element 'update', attribute 'action': [facet 'pattern'] The value '' is not accepted by the " . - "pattern '[a-zA-Z0-9/_]{3,}'.", - "Element 'update', attribute 'action': '' is not a valid value of the atomic type 'typeAction'." + "pattern '[a-zA-Z0-9/_]{3,}'.\nLine: 1\n", + "Element 'update', attribute 'action': '' is not a valid value of the atomic type 'typeAction'.\nLine: 1\n" ], ], 'update_action_attribute_less_minLenght_value' => [ @@ -457,8 +462,8 @@ return [ 'resource="Test_Value::value"/></menu></config>', [ "Element 'update', attribute 'action': [facet 'pattern'] The value 'v' is not accepted by the " . - "pattern '[a-zA-Z0-9/_]{3,}'.", - "Element 'update', attribute 'action': 'v' is not a valid value of the atomic type 'typeAction'." + "pattern '[a-zA-Z0-9/_]{3,}'.\nLine: 1\n", + "Element 'update', attribute 'action': 'v' is not a valid value of the atomic type 'typeAction'.\nLine: 1\n" ], ], 'update_action_attribute_notallowed_symbols_value' => [ @@ -466,8 +471,9 @@ return [ 'id="Test_Value::some_value"/></menu></config>', [ "Element 'update', attribute 'action': [facet 'pattern'] The value '/@##gt;' is not " . - "accepted by the pattern '[a-zA-Z0-9/_]{3,}'.", - "Element 'update', attribute 'action': '/@##gt;' is not a valid value of the atomic type 'typeAction'." + "accepted by the pattern '[a-zA-Z0-9/_]{3,}'.\nLine: 1\n", + "Element 'update', attribute 'action': '/@##gt;' is not a valid value of the atomic" . + " type 'typeAction'.\nLine: 1\n" ], ], 'update_dependsOnConfig_attribute_empty_value' => [ @@ -475,9 +481,9 @@ return [ '</config>', [ "Element 'update', attribute 'dependsOnConfig': [facet 'pattern'] The value '' is not accepted by the " . - "pattern '[A-Za-z0-9_/]{3,}'.", + "pattern '[A-Za-z0-9_/]{3,}'.\nLine: 1\n", "Element 'update', attribute 'dependsOnConfig': '' is not a valid value of the atomic " . - "type 'typeDependsConfig'." + "type 'typeDependsConfig'.\nLine: 1\n" ], ], 'update_dependsOnConfig_attribute_less_minLenght_value' => [ @@ -485,9 +491,9 @@ return [ 'dependsOnConfig="we"/></menu></config>', [ "Element 'update', attribute 'dependsOnConfig': [facet 'pattern'] The value 'we' is not accepted by " . - "the pattern '[A-Za-z0-9_/]{3,}'.", + "the pattern '[A-Za-z0-9_/]{3,}'.\nLine: 1\n", "Element 'update', attribute 'dependsOnConfig': 'we' is not a valid value of the atomic " . - "type 'typeDependsConfig'." + "type 'typeDependsConfig'.\nLine: 1\n" ], ], 'update_dependsOnConfig_attribute_notallowed_symbols_value' => [ @@ -495,9 +501,9 @@ return [ '</menu></config>', [ "Element 'update', attribute 'dependsOnConfig': [facet 'pattern'] The value 'someconf%' is not " . - "accepted by the pattern '[A-Za-z0-9_/]{3,}'.", + "accepted by the pattern '[A-Za-z0-9_/]{3,}'.\nLine: 1\n", "Element 'update', attribute 'dependsOnConfig': 'someconf%' is not a valid value of the atomic " . - "type 'typeDependsConfig'." + "type 'typeDependsConfig'.\nLine: 1\n" ], ], 'update_dependsOnModule_attribute_empty_value' => [ @@ -505,8 +511,9 @@ return [ 'dependsOnModule=""/></menu></config>', [ "Element 'update', attribute 'dependsOnModule': [facet 'pattern'] The value '' is not accepted by " . - "the pattern '[A-Za-z0-9_]{3,}'.", - "Element 'update', attribute 'dependsOnModule': '' is not a valid value of the atomic type 'typeModule'." + "the pattern '[A-Za-z0-9_]{3,}'.\nLine: 1\n", + "Element 'update', attribute 'dependsOnModule': '' is not a valid value of the atomic" . + " type 'typeModule'.\nLine: 1\n" ], ], 'update_dependsOnModule_attribute_less_minLenght_value' => [ @@ -514,8 +521,9 @@ return [ 'dependsOnModule="qw"/></menu></config>', [ "Element 'update', attribute 'dependsOnModule': [facet 'pattern'] The value 'qw' is not accepted " . - "by the pattern '[A-Za-z0-9_]{3,}'.", - "Element 'update', attribute 'dependsOnModule': 'qw' is not a valid value of the atomic type 'typeModule'." + "by the pattern '[A-Za-z0-9_]{3,}'.\nLine: 1\n", + "Element 'update', attribute 'dependsOnModule': 'qw' is not a valid value of the atomic" . + " type 'typeModule'.\nLine: 1\n" ], ], 'update_dependsOnModule_attribute_notallowed_symbols_value' => [ @@ -523,74 +531,77 @@ return [ 'dependsOnModule="someModule#1"/></menu></config>', [ "Element 'update', attribute 'dependsOnModule': [facet 'pattern'] The value 'someModule#1' is not " . - "accepted by the pattern '[A-Za-z0-9_]{3,}'.", + "accepted by the pattern '[A-Za-z0-9_]{3,}'.\nLine: 1\n", "Element 'update', attribute 'dependsOnModule': 'someModule#1' is not a valid value of the atomic " . - "type 'typeModule'." + "type 'typeModule'.\nLine: 1\n" ], ], 'update_id_attribute_empty_value' => [ '<?xml version="1.0"?><config><menu><update id="" title="Notifications"/></menu></config>', [ "Element 'update', attribute 'id': [facet 'pattern'] The value '' is not accepted by the " . - "pattern '[A-Za-z0-9/_:]{3,}'.", - "Element 'update', attribute 'id': '' is not a valid value of the atomic type 'typeId'." + "pattern '[A-Za-z0-9/_:]{3,}'.\nLine: 1\n", + "Element 'update', attribute 'id': '' is not a valid value of the atomic type 'typeId'.\nLine: 1\n" ], ], 'update_id_attribute_less_minLenght_value' => [ '<?xml version="1.0"?><config><menu><update id="g" module="Test_Value"/></menu></config>', [ "Element 'update', attribute 'id': [facet 'pattern'] The value 'g' is not accepted by the " . - "pattern '[A-Za-z0-9/_:]{3,}'.", - "Element 'update', attribute 'id': 'g' is not a valid value of the atomic type 'typeId'." + "pattern '[A-Za-z0-9/_:]{3,}'.\nLine: 1\n", + "Element 'update', attribute 'id': 'g' is not a valid value of the atomic type 'typeId'.\nLine: 1\n" ], ], 'update_id_attribute_notallowed_symbols_value' => [ '<?xml version="1.0"?><config><menu><update id="Magento+value::some_value"/>' . '</menu></config>', [ "Element 'update', attribute 'id': [facet 'pattern'] The value 'Magento+value::some_value' is not " . - "accepted by the pattern '[A-Za-z0-9/_:]{3,}'.", + "accepted by the pattern '[A-Za-z0-9/_:]{3,}'.\nLine: 1\n", "Element 'update', attribute 'id': 'Magento+value::some_value' is not a valid value of the atomic " . - "type 'typeId'." + "type 'typeId'.\nLine: 1\n" ], ], 'update_module_attribute_empty_value' => [ '<?xml version="1.0"?><config><menu><update module="" id="Module_Name::system_config"/></menu></config>', [ "Element 'update', attribute 'module': [facet 'pattern'] The value '' is not accepted by the " . - "pattern '[A-Za-z0-9_]{3,}'.", - "Element 'update', attribute 'module': '' is not a valid value of the atomic type 'typeModule'." + "pattern '[A-Za-z0-9_]{3,}'.\nLine: 1\n", + "Element 'update', attribute 'module': '' is not a valid value of the atomic type 'typeModule'.\nLine: 1\n" ], ], 'update_module_attribute_less_minLenght_value' => [ '<?xml version="1.0"?><config><menu><update id="Module_Name::system_config" module="we"/></menu></config>', [ "Element 'update', attribute 'module': [facet 'pattern'] The value 'we' is not accepted by the " . - "pattern '[A-Za-z0-9_]{3,}'.", - "Element 'update', attribute 'module': 'we' is not a valid value of the atomic type 'typeModule'." + "pattern '[A-Za-z0-9_]{3,}'.\nLine: 1\n", + "Element 'update', attribute 'module': 'we' is not a valid value of the atomic" . + " type 'typeModule'.\nLine: 1\n" ], ], 'update_module_attribute_notallowed_symbols_value' => [ '<?xml version="1.0"?><config><menu><update id="Module_Name::system_config" module="@#$"/></menu></config>', [ "Element 'update', attribute 'module': [facet 'pattern'] The value '@#$' is not accepted by the " . - "pattern '[A-Za-z0-9_]{3,}'.", - "Element 'update', attribute 'module': '@#$' is not a valid value of the atomic type 'typeModule'." + "pattern '[A-Za-z0-9_]{3,}'.\nLine: 1\n", + "Element 'update', attribute 'module': '@#$' is not a valid value of the atomic" . + " type 'typeModule'.\nLine: 1\n" ], ], 'update_parent_attribute_empty_value' => [ '<?xml version="1.0"?><config><menu><update parent="" ' . 'id="Test_Value::some_value"/></menu></config>', [ "Element 'update', attribute 'parent': [facet 'pattern'] The value '' is not accepted by the " . - "pattern '[A-Za-z0-9/_:]{3,}'.", - "Element 'update', attribute 'parent': '' is not a valid value of the atomic type 'typeId'." + "pattern '[A-Za-z0-9/_:]{3,}'.\nLine: 1\n", + "Element 'update', attribute 'parent': '' is not a valid value of the atomic" . + " type 'typeId'.\nLine: 1\n" ], ], 'update_parent_attribute_less_minLenght_value' => [ '<?xml version="1.0"?><config><menu><update parent="fg" ' . 'id="Test_Value::some_value"/></menu></config>', [ "Element 'update', attribute 'parent': [facet 'pattern'] The value 'fg' is not accepted by " . - "the pattern '[A-Za-z0-9/_:]{3,}'.", - "Element 'update', attribute 'parent': 'fg' is not a valid value of the atomic type 'typeId'." + "the pattern '[A-Za-z0-9/_:]{3,}'.\nLine: 1\n", + "Element 'update', attribute 'parent': 'fg' is not a valid value of the atomic type 'typeId'.\nLine: 1\n" ], ], 'update_parent_attribute_notallowed_symbols_value' => [ @@ -598,9 +609,9 @@ return [ 'id="Test_Value::some_value"/></menu></config>', [ "Element 'update', attribute 'parent': [facet 'pattern'] The value " . - "'Test_Value::system_other%settings' is not accepted by the pattern '[A-Za-z0-9/_:]{3,}'.", + "'Test_Value::system_other%settings' is not accepted by the pattern '[A-Za-z0-9/_:]{3,}'.\nLine: 1\n", "Element 'update', attribute 'parent': 'Test_Value::system_other%settings' is not a valid value of the " . - "atomic type 'typeId'." + "atomic type 'typeId'.\nLine: 1\n" ], ], 'update_resource_attribute_notvalid_regexp_value1' => [ @@ -608,9 +619,9 @@ return [ 'resource="test_Value::value"/></menu></config>', [ "Element 'update', attribute 'resource': [facet 'pattern'] The value 'test_Value::value' is not " . - "accepted by the pattern '[A-Z]+[A-Za-z0-9]{1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.", + "accepted by the pattern '[A-Z]+[A-Za-z0-9]{1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.\nLine: 1\n", "Element 'update', attribute 'resource': 'test_Value::value' is not a valid value of the atomic " . - "type 'typeResource'." + "type 'typeResource'.\nLine: 1\n" ], ], 'update_resource_attribute_notvalid_regexp_value2' => [ @@ -618,9 +629,9 @@ return [ 'resource="Test_value::value"/></menu></config>', [ "Element 'update', attribute 'resource': [facet 'pattern'] The value 'Test_value::value' is not " . - "accepted by the pattern '[A-Z]+[A-Za-z0-9]{1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.", + "accepted by the pattern '[A-Z]+[A-Za-z0-9]{1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.\nLine: 1\n", "Element 'update', attribute 'resource': 'Test_value::value' is not a valid value of the atomic " . - "type 'typeResource'." + "type 'typeResource'.\nLine: 1\n" ], ], 'update_resource_attribute_notvalid_regexp_value3' => [ @@ -628,9 +639,9 @@ return [ 'resource="M#$%23_value::value"/></menu></config>', [ "Element 'update', attribute 'resource': [facet 'pattern'] The value 'M#$%23_value::value' is not " . - "accepted by the pattern '[A-Z]+[A-Za-z0-9]{1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.", + "accepted by the pattern '[A-Z]+[A-Za-z0-9]{1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.\nLine: 1\n", "Element 'update', attribute 'resource': 'M#$%23_value::value' is not a valid value of the atomic " . - "type 'typeResource'." + "type 'typeResource'.\nLine: 1\n" ], ], 'update_resource_attribute_notvalid_regexp_value4' => [ @@ -638,9 +649,9 @@ return [ 'resource="_value::value"/></menu></config>', [ "Element 'update', attribute 'resource': [facet 'pattern'] The value '_value::value' is not " . - "accepted by the pattern '[A-Z]+[A-Za-z0-9]{1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.", + "accepted by the pattern '[A-Z]+[A-Za-z0-9]{1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.\nLine: 1\n", "Element 'update', attribute 'resource': '_value::value' is not a valid value of the atomic " . - "type 'typeResource'." + "type 'typeResource'.\nLine: 1\n" ], ], 'update_resource_attribute_notvalid_regexp_value5' => [ @@ -648,9 +659,9 @@ return [ 'resource="Magento_::value"/></menu></config>', [ "Element 'update', attribute 'resource': [facet 'pattern'] The value 'Magento_::value' is not " . - "accepted by the pattern '[A-Z]+[A-Za-z0-9]{1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.", + "accepted by the pattern '[A-Z]+[A-Za-z0-9]{1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.\nLine: 1\n", "Element 'update', attribute 'resource': 'Magento_::value' is not a valid value of the atomic " . - "type 'typeResource'." + "type 'typeResource'.\nLine: 1\n" ], ], 'update_resource_attribute_notvalid_regexp_value6' => [ @@ -658,9 +669,9 @@ return [ 'resource="Test_Value:value"/></menu></config>', [ "Element 'update', attribute 'resource': [facet 'pattern'] The value 'Test_Value:value' is not " . - "accepted by the pattern '[A-Z]+[A-Za-z0-9]{1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.", + "accepted by the pattern '[A-Z]+[A-Za-z0-9]{1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.\nLine: 1\n", "Element 'update', attribute 'resource': 'Test_Value:value' is not a valid value of the atomic " . - "type 'typeResource'." + "type 'typeResource'.\nLine: 1\n" ], ], 'update_resource_attribute_notvalid_regexp_value7' => [ @@ -668,36 +679,36 @@ return [ 'resource="Test_Value::"/></menu></config>', [ "Element 'update', attribute 'resource': [facet 'pattern'] The value 'Test_Value::' is not " . - "accepted by the pattern '[A-Z]+[A-Za-z0-9]{1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.", + "accepted by the pattern '[A-Z]+[A-Za-z0-9]{1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.\nLine: 1\n", "Element 'update', attribute 'resource': 'Test_Value::' is not a valid value of the atomic " . - "type 'typeResource'." + "type 'typeResource'.\nLine: 1\n" ], ], 'update_sortOrder_attribute_empty_value' => [ '<?xml version="1.0"?><config><menu><update sortOrder="" ' . 'id="Test_Value::some_value"/></menu></config>', - ["Element 'update', attribute 'sortOrder': '' is not a valid value of the atomic type 'xs:int'."], + ["Element 'update', attribute 'sortOrder': '' is not a valid value of the atomic type 'xs:int'.\nLine: 1\n"], ], 'update_sortOrder_attribute_wrong_value_type' => [ '<?xml version="1.0"?><config><menu><add sortOrder="string" ' . 'id="Test_Value::some_value" title="Notifications" ' . 'module="Test_Value" resource="Test_Value::value"/>' . '</menu></config>', - ["Element 'add', attribute 'sortOrder': 'string' is not a valid value of the atomic type 'xs:int'."], + ["Element 'add', attribute 'sortOrder': 'string' is not a valid value of the atomic type 'xs:int'.\nLine: 1\n"], ], 'update_title_attribute_empty_value' => [ '<?xml version="1.0"?><config><menu><update id="Module_Name::system_config" title=""/></menu></config>', [ "Element 'update', attribute 'title': [facet 'minLength'] The value '' has a length of '0'; this " . - "underruns the allowed minimum length of '3'.", - "Element 'update', attribute 'title': '' is not a valid value of the atomic type 'typeTitle'." + "underruns the allowed minimum length of '3'.\nLine: 1\n", + "Element 'update', attribute 'title': '' is not a valid value of the atomic type 'typeTitle'.\nLine: 1\n" ], ], 'update_title_attribute_less_minLenght_value' => [ '<?xml version="1.0"?><config><menu><update id="Module_Name::system_config" title="am"/></menu></config>', [ "Element 'update', attribute 'title': [facet 'minLength'] The value 'am' has a length of '2'; this " . - "underruns the allowed minimum length of '3'.", - "Element 'update', attribute 'title': 'am' is not a valid value of the atomic type 'typeTitle'." + "underruns the allowed minimum length of '3'.\nLine: 1\n", + "Element 'update', attribute 'title': 'am' is not a valid value of the atomic type 'typeTitle'.\nLine: 1\n" ], ], 'update_title_attribute_more_maxLenght_value' => [ @@ -705,26 +716,28 @@ return [ 'title="Lorem ipsum dolor sit amet, consectetur adipisicing"/></menu></config>', [ "Element 'update', attribute 'title': [facet 'maxLength'] The value 'Lorem ipsum dolor sit amet, " . - "consectetur adipisicing' has a length of '51'; this exceeds the allowed maximum length of '50'.", + "consectetur adipisicing' has a length of '51'; this exceeds the allowed maximum" . + " length of '50'.\nLine: 1\n", "Element 'update', attribute 'title': 'Lorem ipsum dolor sit amet, " . "consectetur adipisicing' is not a valid " . - "value of the atomic type 'typeTitle'." + "value of the atomic type 'typeTitle'.\nLine: 1\n" ], ], 'update_toolTip_attribute_empty_value ' => [ '<?xml version="1.0"?><config><menu><update id="Module_Name::system_config" toolTip=""/></menu></config>', [ "Element 'update', attribute 'toolTip': [facet 'minLength'] The value '' has a length of '0'; this " . - "underruns the allowed minimum length of '3'.", - "Element 'update', attribute 'toolTip': '' is not a valid value of the atomic type 'typeTitle'." + "underruns the allowed minimum length of '3'.\nLine: 1\n", + "Element 'update', attribute 'toolTip': '' is not a valid value of the atomic type 'typeTitle'.\nLine: 1\n" ], ], 'update_toolTip_attribute_less_minLenght_value' => [ '<?xml version="1.0"?><config><menu><update id="Module_Name::system_config" toolTip="we"/></menu></config>', [ "Element 'update', attribute 'toolTip': [facet 'minLength'] The value 'we' has a length of '2'; this " . - "underruns the allowed minimum length of '3'.", - "Element 'update', attribute 'toolTip': 'we' is not a valid value of the atomic type 'typeTitle'." + "underruns the allowed minimum length of '3'.\nLine: 1\n", + "Element 'update', attribute 'toolTip': 'we' is not a valid value of the atomic" . + " type 'typeTitle'.\nLine: 1\n" ], ], 'update_toolTip_attribute_more_maxLenght_value' => [ @@ -732,9 +745,10 @@ return [ 'toolTip="Lorem ipsum dolor sit amet, consectetur adipisicing"/></menu></config>', [ "Element 'update', attribute 'toolTip': [facet 'maxLength'] The value 'Lorem ipsum dolor sit " . - "amet, consectetur adipisicing' has a length of '51'; this exceeds the allowed maximum length of '50'.", + "amet, consectetur adipisicing' has a length of '51'; this exceeds the allowed maximum" . + " length of '50'.\nLine: 1\n", "Element 'update', attribute 'toolTip': 'Lorem ipsum dolor sit amet, consectetur adipisicing' " . - "is not a valid value of the atomic type 'typeTitle'." + "is not a valid value of the atomic type 'typeTitle'.\nLine: 1\n" ], ], 'update_with_notallowed_atrribute' => [ @@ -743,14 +757,14 @@ return [ 'module="Test_Value" sortOrder="10" parent="Test_Value::system_other_settings" ' . 'action="adminhtml/notification" resource="Test_Value::value"/>' . '</menu></config>', - ["Element 'update', attribute 'notallowed': The attribute 'notallowed' is not allowed."], + ["Element 'update', attribute 'notallowed': The attribute 'notallowed' is not allowed.\nLine: 1\n"], ], 'update_without_required_attribute_id' => [ '<?xml version="1.0"?><config><menu><update title="some text"/></menu></config>', - ["Element 'update': The attribute 'id' is required but missing."], + ["Element 'update': The attribute 'id' is required but missing.\nLine: 1\n"], ], 'without_menu' => [ '<?xml version="1.0"?><config></config>', - ["Element 'config': Missing child element(s). Expected is ( menu )."], + ["Element 'config': Missing child element(s). Expected is ( menu ).\nLine: 1\n"], ] ]; diff --git a/app/code/Magento/Backend/Test/Unit/Model/Menu/Config/_files/valid_menu.xml b/app/code/Magento/Backend/Test/Unit/Model/Menu/Config/_files/valid_menu.xml index a0358a1dfbf89397cdedfcbe63cdad77106f25eb..bbade91bb68c64bdd269f3d8b5313704d0f80788 100644 --- a/app/code/Magento/Backend/Test/Unit/Model/Menu/Config/_files/valid_menu.xml +++ b/app/code/Magento/Backend/Test/Unit/Model/Menu/Config/_files/valid_menu.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/Backend/etc/menu.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd"> <menu> <add id="Some_TestName::catalog_some_events" title="Events" module="SomeTest_TestValue" sortOrder="10" parent="SomeTest_TestValue::someTest_testValue" action="action/actions" resource="SomeTest_TestValue::eventsTest_value" dependsOnModule="SomeTest_TestValue" dependsOnConfig="catalog/SomeTest_TestValue/enabled" toolTip="some tool tip" /> <update id="Module_Name::system_config" title="some title" sortOrder="12" action="some_action" resource="Some_Test::events" dependsOnModule="Some_Test" dependsOnConfig="catalog/Some_value/enabled" module="Some_Module" parent="Some_Test::test_value" toolTip="some toolTip" /> diff --git a/app/code/Magento/Backend/Test/Unit/Model/_files/menu_merged.xml b/app/code/Magento/Backend/Test/Unit/Model/_files/menu_merged.xml index 18610897398ce3f6fbe1d7a139a5a5cf3937db97..47163dcb7d8700c0538e8c9af957c3eab152550a 100644 --- a/app/code/Magento/Backend/Test/Unit/Model/_files/menu_merged.xml +++ b/app/code/Magento/Backend/Test/Unit/Model/_files/menu_merged.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../app/code/Magento/Backend/etc/menu.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd"> <menu> <add id="elem_one_zero" toolTip='toolTip 1' title="Title one.zero" module="Module_One" sortOrder="90" action="adminhtml/system" resource="Module_One::one_zero" dependsOnModule="Module_One" dependsOnConfig="/one/two" /> <add id="elem_one_one" toolTip='toolTip 2' title="Title one.one" module="Module_One" sortOrder="90" action="adminhtml/system" parent="elem_one_zero" resource="Module_One::one_one" /> diff --git a/app/code/Magento/Backend/composer.json b/app/code/Magento/Backend/composer.json index a63aaf72ca6db4592da490a7d48ece663199c18e..01768f8eb8dc600905a1513c9b4c87936f1031b1 100644 --- a/app/code/Magento/Backend/composer.json +++ b/app/code/Magento/Backend/composer.json @@ -18,8 +18,7 @@ "magento/module-translation": "1.0.0-beta", "magento/module-require-js": "1.0.0-beta", "magento/module-config": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -27,12 +26,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Backend" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Backend\\": "" + } } } diff --git a/app/code/Magento/Backend/etc/acl.xml b/app/code/Magento/Backend/etc/acl.xml index 01b54591ef6efd235c14c0cbc6b0fbaab6a47955..15f22c515b39ed048f26d1dce5ccbea7cc6db3a0 100644 --- a/app/code/Magento/Backend/etc/acl.xml +++ b/app/code/Magento/Backend/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::all" title="Allow everything" sortOrder="10" /> diff --git a/app/code/Magento/Backend/etc/adminhtml/di.xml b/app/code/Magento/Backend/etc/adminhtml/di.xml index fd969977eb0df3f8aad3239ddc768a248f35155e..1c281b424840c1d1ff87c06388e351a0056e5b00 100644 --- a/app/code/Magento/Backend/etc/adminhtml/di.xml +++ b/app/code/Magento/Backend/etc/adminhtml/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Framework\Authorization\RoleLocatorInterface" type="Magento\Backend\Model\Authorization\RoleLocator" /> <preference for="Magento\Framework\Locale\ResolverInterface" type="Magento\Backend\Model\Locale\Resolver" /> <preference for="Magento\Framework\App\Action\Context" type="Magento\Backend\App\Action\Context" /> diff --git a/app/code/Magento/Backend/etc/adminhtml/menu.xml b/app/code/Magento/Backend/etc/adminhtml/menu.xml index acba492937e5666580eb8c03880253104b62cbb1..821b79cf65956915b6b4205ae21e8ae519d8cdf7 100644 --- a/app/code/Magento/Backend/etc/adminhtml/menu.xml +++ b/app/code/Magento/Backend/etc/adminhtml/menu.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Backend/etc/menu.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd"> <menu> <add id="Magento_Backend::system_design_schedule" title="Schedule" module="Magento_Backend" sortOrder="30" parent="Magento_Backend::system_design" action="adminhtml/system_design" resource="Magento_Backend::schedule"/> <add id="Magento_Backend::system_currency" title="Currency" module="Magento_Backend" sortOrder="30" parent="Magento_Backend::stores" action="adminhtml/system_currency" resource="Magento_CurrencySymbol::system_currency"/> diff --git a/app/code/Magento/Backend/etc/adminhtml/routes.xml b/app/code/Magento/Backend/etc/adminhtml/routes.xml index 85dc2f4a557a047fad4f2394ce483a5f9d396302..c8ba69f56277fdd9d95391d0f8d5e2e4fd558c0b 100644 --- a/app/code/Magento/Backend/etc/adminhtml/routes.xml +++ b/app/code/Magento/Backend/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn: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/adminhtml/system.xml b/app/code/Magento/Backend/etc/adminhtml/system.xml index e755e364cde87cdb9b7b04ad6b5d7e86ee8eb35b..a7bc97027bbafa4b8d77edd6aaa1750bdc8144d1 100644 --- a/app/code/Magento/Backend/etc/adminhtml/system.xml +++ b/app/code/Magento/Backend/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <tab id="general" translate="label" sortOrder="100"> <label>General</label> diff --git a/app/code/Magento/Backend/etc/config.xml b/app/code/Magento/Backend/etc/config.xml index d83c36cda31cc1936127d317ea7404fc911a6b6c..cf9cecac75801df5e99a44d549da5a6850655afa 100644 --- a/app/code/Magento/Backend/etc/config.xml +++ b/app/code/Magento/Backend/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <dev> <template> diff --git a/app/code/Magento/Backend/etc/crontab.xml b/app/code/Magento/Backend/etc/crontab.xml index a74ebb04da38c0602cbebb020a90b67c389d6acc..c7067d45170795d45a08a33a0721aea540e00a60 100644 --- a/app/code/Magento/Backend/etc/crontab.xml +++ b/app/code/Magento/Backend/etc/crontab.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Cron/etc/crontab.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd"> <group id="default"> <job name="backend_clean_cache" instance="Magento\Backend\Cron\CleanCache" method="execute"> <schedule>30 2 * * *</schedule> diff --git a/app/code/Magento/Backend/etc/di.xml b/app/code/Magento/Backend/etc/di.xml index ba74fb97b39c310acff282dc310359634bfb2acf..943d1846f8e3fa3750dd71387c9f97044eb2b355 100644 --- a/app/code/Magento/Backend/etc/di.xml +++ b/app/code/Magento/Backend/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <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" /> diff --git a/app/code/Magento/Backend/etc/module.xml b/app/code/Magento/Backend/etc/module.xml index a2d0faca404afe3d83623d72bee424ce4bcd2236..d701c62238fb653473be991bc55543b9dd584903 100644 --- a/app/code/Magento/Backend/etc/module.xml +++ b/app/code/Magento/Backend/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Backend" setup_version="2.0.0"> <sequence> <module name="Magento_Directory"/> diff --git a/app/code/Magento/Backend/etc/webapi.xml b/app/code/Magento/Backend/etc/webapi.xml index 8d6b69d864e598ac6aab1ae7dfd4a01f4369413e..9994cf92af8e76a0f92154c6b7332b378f73b024 100644 --- a/app/code/Magento/Backend/etc/webapi.xml +++ b/app/code/Magento/Backend/etc/webapi.xml @@ -6,7 +6,7 @@ */ --> <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../app/code/Magento/Webapi/etc/webapi.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd"> <route url="/V1/modules" method="GET"> <service class="Magento\Backend\Service\V1\ModuleServiceInterface" method="getModules"/> <resources> diff --git a/app/code/Magento/Backend/registration.php b/app/code/Magento/Backend/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..85b9e918845db012bca8b4e9c8d77efe467f293b --- /dev/null +++ b/app/code/Magento/Backend/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Backend', + __DIR__ +); diff --git a/app/code/Magento/Backend/view/adminhtml/layout/admin_login.xml b/app/code/Magento/Backend/view/adminhtml/layout/admin_login.xml index b0891c464f5f31aeffeeb9faf7f895384430c03e..7d151f34009aa00e9a7d5dba44ce599a08d9255e 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/admin_login.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/admin_login.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-login" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-login" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="styles" /> <body> <!-- @todo ui: - delete after bugfix --> diff --git a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_auth_login.xml b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_auth_login.xml index 8c2213fd721424a9fc64c5e63fe2124196dba4d3..ceffce4445ca4c3ecb61eedf71e45723d9b187f6 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_auth_login.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_auth_login.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="admin_login" /> <body> <referenceContainer name="login.content"> diff --git a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_cache_block.xml b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_cache_block.xml index 3f8bd3d162813a9b8a14ac6061149875b14a7053..f698cfe3f1a701f07b296597f6098d56387c5e81 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_cache_block.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_cache_block.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="adminhtml.cache.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.cache.grid" as="grid"> diff --git a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_cache_index.xml b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_cache_index.xml index c232fecd76f4cd72cdb488ae3f4febdddce569f5..3eff6397e07705fd9732451eda8218f11477588c 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_cache_index.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_cache_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="formkey"/> <update handle="adminhtml_cache_block"/> <body> diff --git a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_dashboard_customersmost.xml b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_dashboard_customersmost.xml index 6022cbd3b7053e62c2a1248aa5524f34ebbc690e..fe915a4d54d0e54e4056e5456b16d4e2e8e10bf0 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_dashboard_customersmost.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_dashboard_customersmost.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root" label="Root"> <block class="Magento\Backend\Block\Dashboard\Tab\Customers\Most" name="adminhtml.dashboard.tab.customers.most"/> </container> diff --git a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_dashboard_customersnewest.xml b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_dashboard_customersnewest.xml index 8afb2c660532476fde2c45fdb093859f8350d614..43c799a6b558a2b618225fab47ac5f28b2c11508 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_dashboard_customersnewest.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_dashboard_customersnewest.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root" label="Root"> <block class="Magento\Backend\Block\Dashboard\Tab\Customers\Newest" name="adminhtml.dashboard.tab.customers.newest"/> </container> diff --git a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_dashboard_index.xml b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_dashboard_index.xml index a28e0fa25d6816678da725dd37b491198dda25fe..d3bef5af3b7710df66734b0280da39266a78648f 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_dashboard_index.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_dashboard_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="styles" /> <body> <referenceContainer name="page.main.actions"> diff --git a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_dashboard_productsviewed.xml b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_dashboard_productsviewed.xml index 2544e0dc241ba878ebfdbbad20b3f583cce877b8..807ed95381217d693e7eb5928745c6b48ff2c351 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_dashboard_productsviewed.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_dashboard_productsviewed.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root" label="Root"> <block class="Magento\Backend\Block\Dashboard\Tab\Products\Viewed" name="adminhtml.dashboard.tab.products.viewed"/> </container> diff --git a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_denied.xml b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_denied.xml index 2451f1ea2b35d45d3aad3491b1a6ef724b668630..8bb2efc11076f076914b515a929cc152d84b8674 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_denied.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_denied.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Backend\Block\Denied" name="content.denied" template="admin/access_denied.phtml"/> diff --git a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_noroute.xml b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_noroute.xml index 4d7efc1ee556a25f4e28e08d2ff2e90f07ac8bf4..e9551940aaaa81f396caa477df9a8c22a4195831 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_noroute.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_noroute.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Framework\View\Element\Text" name="content.noRoute"> diff --git a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_account_index.xml b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_account_index.xml index f5a87c87fd8e4ed9a60ce8a881f1b883fbeec026..bc2d2aa672c17961cb3393d5aaca9d3f20d655db 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_account_index.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_account_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Backend\Block\System\Account\Edit" name="adminhtml.system.account.edit"/> diff --git a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_design_edit.xml b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_design_edit.xml index 0ad93985a539b13718a6e59974de103ef9dbdb7c..b10a3d99d806a9f51cf2d6dff57b4ff63cbfeed2 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_design_edit.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_design_edit.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body/> </page> diff --git a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_design_grid.xml b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_design_grid.xml index c3a5d9bc9e597ad56b1c3dddf7204fcb17cb1109..965361e02f2c32da27aef138da105c1088daacbf 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_design_grid.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_design_grid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <update handle="formkey"/> <update handle="adminhtml_system_design_grid_block"/> <container name="root"> diff --git a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_design_grid_block.xml b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_design_grid_block.xml index fc93ac15471fe2a904960a194ab93f223bb25133..5024f216cdf22a5645d77bb57147405f020dca6b 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_design_grid_block.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_design_grid_block.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="adminhtml.system.design.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.system.design.grid" as="grid"> diff --git a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_design_index.xml b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_design_index.xml index 20bd7e434870298857f8bc1805321e16a3ad24b7..5dfd7b98a6b2a43fb420267d5065d084b80c9e7b 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_design_index.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_design_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="formkey"/> <update handle="adminhtml_system_design_grid_block"/> <body> diff --git a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_store_grid_block.xml b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_store_grid_block.xml index fcb5f112b7f06cd7da64ef88466915d3e598b8df..a0ccf18641151219212dd22f98e41376ce1feb68 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_store_grid_block.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_store_grid_block.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="adminhtml.system.store.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.system.store.grid" as="grid"> diff --git a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_store_index.xml b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_store_index.xml index 3936f88e8d1c732e64553e581b16f89912bbb4df..4bf91402bc24eec250c0d6be29f3a2d086bc5e77 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_store_index.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_store_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="formkey"/> <update handle="adminhtml_system_store_grid_block"/> <body> diff --git a/app/code/Magento/Backend/view/adminhtml/layout/default.xml b/app/code/Magento/Backend/view/adminhtml/layout/default.xml index 328c230ef95a71dc717afdc2bbfdbb6e54b4f486..f960316fcc92933bc64b33f9457f50335ec8eb46 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/default.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/default.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <title>Magento Admin</title> <meta name="viewport" content="width=device-width"/> diff --git a/app/code/Magento/Backend/view/adminhtml/layout/editor.xml b/app/code/Magento/Backend/view/adminhtml/layout/editor.xml index 891c280df8b3244e210326cca6d5ccbe2df755c4..473a09ef336a1bee774f89cdccfbaa67d9543827 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/editor.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/editor.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <link src="Magento_Backend::js/bootstrap/editor.js"/> <css src="prototype/windows/themes/default.css"/> diff --git a/app/code/Magento/Backend/view/adminhtml/layout/empty.xml b/app/code/Magento/Backend/view/adminhtml/layout/empty.xml index a024d6e563cb581c15476d71430b89f2dd05ea36..44eec0b583d14104b76b334e2395d72d5b2bf778 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/empty.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/empty.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body/> </page> diff --git a/app/code/Magento/Backend/view/adminhtml/layout/formkey.xml b/app/code/Magento/Backend/view/adminhtml/layout/formkey.xml index 9e8ec3841ac3924cc9f3ba3e0058ca299791ca27..3292f2680e03ca4f65539a79f37c03130afcb7c6 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/formkey.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/formkey.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <block class="Magento\Backend\Block\Admin\Formkey" name="formkey" as="formkey" template="Magento_Backend::admin/formkey.phtml"/> </body> diff --git a/app/code/Magento/Backend/view/adminhtml/layout/overlay_popup.xml b/app/code/Magento/Backend/view/adminhtml/layout/overlay_popup.xml index 5a06a893cf131bc6ca3e4ae42bcfd531e413b0aa..8d004960498f17bef654116520c820659ed3a116 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/overlay_popup.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/overlay_popup.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="popup"/> <body> <referenceBlock name="backend.page"> diff --git a/app/code/Magento/Backend/view/adminhtml/layout/popup.xml b/app/code/Magento/Backend/view/adminhtml/layout/popup.xml index e6f59c729501df79abc221989f45be6fde13c2e3..df56bd0b14cce987e5e8e295de8280960faeeae9 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/popup.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/popup.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="header" remove="true"/> <referenceBlock name="menu" remove="true"/> diff --git a/app/code/Magento/Backend/view/adminhtml/templates/widget/grid/massaction_extended.phtml b/app/code/Magento/Backend/view/adminhtml/templates/widget/grid/massaction_extended.phtml index 11755f0891962193598b61e2dd40b0c025211b12..6db2850603afbdba47543beb838536559c9a7c59 100644 --- a/app/code/Magento/Backend/view/adminhtml/templates/widget/grid/massaction_extended.phtml +++ b/app/code/Magento/Backend/view/adminhtml/templates/widget/grid/massaction_extended.phtml @@ -6,9 +6,6 @@ // @codingStandardsIgnoreFile -/** -* @deprecated support Magento 1.x grid massaction implementation - */ ?> <div id="<?php echo $block->getHtmlId() ?>" class="admin__grid-massaction"> diff --git a/app/code/Magento/Backup/composer.json b/app/code/Magento/Backup/composer.json index 141c0dff1cf6a7874919a99a6a84697ffb118e11..b0210f6cac458f8aac4912cccda04f35f9659491 100644 --- a/app/code/Magento/Backup/composer.json +++ b/app/code/Magento/Backup/composer.json @@ -6,8 +6,7 @@ "magento/module-store": "1.0.0-beta", "magento/module-backend": "1.0.0-beta", "magento/module-cron": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -15,12 +14,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Backup" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Backup\\": "" + } } } diff --git a/app/code/Magento/Backup/etc/acl.xml b/app/code/Magento/Backup/etc/acl.xml index 6b9dda6244e7d739cdfcba36337fc57888aecb2d..8fea71f5f11e7fa3195e0f497e61483aa9a0b944 100644 --- a/app/code/Magento/Backup/etc/acl.xml +++ b/app/code/Magento/Backup/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/app/code/Magento/Backup/etc/adminhtml/menu.xml b/app/code/Magento/Backup/etc/adminhtml/menu.xml index 741b8674c94fa0cb622ad7219753d346adbdfe1e..0940441771aece3877f19809bb51f22a7947567d 100644 --- a/app/code/Magento/Backup/etc/adminhtml/menu.xml +++ b/app/code/Magento/Backup/etc/adminhtml/menu.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Backend/etc/menu.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd"> <menu> <add id="Magento_Backup::system_tools_backup" title="Backups" module="Magento_Backup" sortOrder="30" parent="Magento_Backend::system_tools" action="backup/index" resource="Magento_Backup::backup"/> </menu> diff --git a/app/code/Magento/Backup/etc/adminhtml/routes.xml b/app/code/Magento/Backup/etc/adminhtml/routes.xml index 8993bc033dc68c5a394af30008b0826ade1ac614..89a635a50ca71ec4ef4a96e59a40e0cf3e41f63d 100644 --- a/app/code/Magento/Backup/etc/adminhtml/routes.xml +++ b/app/code/Magento/Backup/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="admin"> <route id="backup" frontName="backup"> <module name="Magento_Backup" before="Magento_Backend" /> diff --git a/app/code/Magento/Backup/etc/adminhtml/system.xml b/app/code/Magento/Backup/etc/adminhtml/system.xml index e108e1d1c5e25e1728e45904394daf043c845260..650b5af89c0a9c40bb51f92c27114a00dcc7c0c9 100644 --- a/app/code/Magento/Backup/etc/adminhtml/system.xml +++ b/app/code/Magento/Backup/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="system"> <group id="backup" translate="label" type="text" sortOrder="500" showInDefault="1" showInWebsite="0" showInStore="0"> diff --git a/app/code/Magento/Backup/etc/crontab.xml b/app/code/Magento/Backup/etc/crontab.xml index 12ee11af575bb57128dc9af597e2c6c82b76dd9c..1fc9f36be3e641434861faa0cbefc9121a9a7914 100644 --- a/app/code/Magento/Backup/etc/crontab.xml +++ b/app/code/Magento/Backup/etc/crontab.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Cron/etc/crontab.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd"> <group id="default"> <job name="system_backup" instance="Magento\Backup\Cron\SystemBackup" method="execute" /> </group> diff --git a/app/code/Magento/Backup/etc/di.xml b/app/code/Magento/Backup/etc/di.xml index c4f522f6d17783dd56b9bbd88a14399dcc670f9c..8fa192d73d2b06697c876234512ce12311d2f76d 100644 --- a/app/code/Magento/Backup/etc/di.xml +++ b/app/code/Magento/Backup/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Framework\Backup\Db\BackupFactory"> <arguments> <argument name="backupInstanceName" xsi:type="string">Magento\Backup\Model\Backup</argument> diff --git a/app/code/Magento/Backup/etc/module.xml b/app/code/Magento/Backup/etc/module.xml index 80d19293753e874c3d835847ad9914bf7fae3811..f10e1bef2b2eec766fd4ca68dfcea502c23a284b 100644 --- a/app/code/Magento/Backup/etc/module.xml +++ b/app/code/Magento/Backup/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Backup" setup_version="2.0.0"> <sequence> <module name="Magento_Store"/> diff --git a/app/code/Magento/Backup/registration.php b/app/code/Magento/Backup/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..36394020abca0a9a7a4bc7b430e77a7b0746531b --- /dev/null +++ b/app/code/Magento/Backup/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Backup', + __DIR__ +); 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 1553a783f6356dca8510044813cd919312ff5fdb..cb9295b3b76774d99447e9a676b0ee46f4df6982 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 @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="adminhtml.system.backup.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.system.backup.grid" as="grid"> diff --git a/app/code/Magento/Backup/view/adminhtml/layout/backup_index_grid.xml b/app/code/Magento/Backup/view/adminhtml/layout/backup_index_grid.xml index fb9bbfa9b85d4e8b5d639973d8d119f55369f5a8..093e9b6265aec6a5ae71f5a7c5d56ce422e0a2aa 100644 --- a/app/code/Magento/Backup/view/adminhtml/layout/backup_index_grid.xml +++ b/app/code/Magento/Backup/view/adminhtml/layout/backup_index_grid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <update handle="formkey"/> <update handle="backup_index_block"/> <container name="root"> diff --git a/app/code/Magento/Backup/view/adminhtml/layout/backup_index_index.xml b/app/code/Magento/Backup/view/adminhtml/layout/backup_index_index.xml index cafc4835da4a0f89ebd36bf7cf7106c8c90e7136..220cebe6135524760f485af7940ee976ab200fac 100644 --- a/app/code/Magento/Backup/view/adminhtml/layout/backup_index_index.xml +++ b/app/code/Magento/Backup/view/adminhtml/layout/backup_index_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="formkey"/> <update handle="backup_index_block"/> <body> diff --git a/app/code/Magento/Braintree/composer.json b/app/code/Magento/Braintree/composer.json index d260dab6e9ee48db5ace6fbf6bb22df581ba7892..20d507049cf0f725b81a0f32e7ebb9f7efa421a2 100644 --- a/app/code/Magento/Braintree/composer.json +++ b/app/code/Magento/Braintree/composer.json @@ -16,8 +16,7 @@ "magento/module-directory": "1.0.0-beta", "magento/module-theme": "1.0.0-beta", "magento/framework": "1.0.0-beta", - "braintree/braintree_php": "2.39.0", - "magento/magento-composer-installer": "*" + "braintree/braintree_php": "2.39.0" }, "suggest": { "magento/module-checkout-agreements": "1.0.0-beta" @@ -27,12 +26,10 @@ "license": [ "proprietary" ], - "extra": { - "map": [ - [ - "*", - "Magento/Braintree" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Braintree\\": "" + } } } diff --git a/app/code/Magento/Braintree/etc/adminhtml/system.xml b/app/code/Magento/Braintree/etc/adminhtml/system.xml index ea679ab62015d36bb4e440209a359030eccf4ba0..c0d1804e8807290274d2f4af3e0994526f9dbd49 100644 --- a/app/code/Magento/Braintree/etc/adminhtml/system.xml +++ b/app/code/Magento/Braintree/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="payment"> <group id="braintree_section" translate="label" type="text" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1"> diff --git a/app/code/Magento/Braintree/etc/config.xml b/app/code/Magento/Braintree/etc/config.xml index f90c552a946abc9e5729f093878f90a2e525760b..325439b6c8cbd24add45e3d15801bd40f2bb650b 100644 --- a/app/code/Magento/Braintree/etc/config.xml +++ b/app/code/Magento/Braintree/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <payment> <braintree> diff --git a/app/code/Magento/Braintree/etc/di.xml b/app/code/Magento/Braintree/etc/di.xml index 41ec339435ed0c3d8e90e19eeefda311713ce6ba..575aa507e7ca84a4a8f57e36f84761691088cb99 100644 --- a/app/code/Magento/Braintree/etc/di.xml +++ b/app/code/Magento/Braintree/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Sales\Model\Order\Payment"> <plugin name="braintreeSalesOrderPayment" type="\Magento\Braintree\Model\Plugin\Sales\Order\PaymentPlugin"/> </type> diff --git a/app/code/Magento/Braintree/etc/events.xml b/app/code/Magento/Braintree/etc/events.xml index 3de13ddef898d89cd7fd69ddbd713196a72bfa68..843cf78f7cf0cd2d6c7d74e1ef36d86cb3bc9509 100644 --- a/app/code/Magento/Braintree/etc/events.xml +++ b/app/code/Magento/Braintree/etc/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="sales_order_shipment_save_after"> <observer name="braintree" instance="Magento\Braintree\Observer\ProcessBraintreePayment" method="execute" /> </event> diff --git a/app/code/Magento/Braintree/etc/frontend/di.xml b/app/code/Magento/Braintree/etc/frontend/di.xml index aad0b10b2cd2846c59cab3cd5554f81ff9ac6ae8..ddc18722e8df532bf34fb3e30b4122e24e4e8445 100644 --- a/app/code/Magento/Braintree/etc/frontend/di.xml +++ b/app/code/Magento/Braintree/etc/frontend/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Payment\Model\CcGenericConfigProvider"> <arguments> <argument name="methodCodes" xsi:type="array"> diff --git a/app/code/Magento/Braintree/etc/frontend/events.xml b/app/code/Magento/Braintree/etc/frontend/events.xml index 38dc2ebc01304ca8ae2b39cd11cd808e855f0499..c9afec78aa4a43feb8841274ba8dd6dcc7a6e47c 100644 --- a/app/code/Magento/Braintree/etc/frontend/events.xml +++ b/app/code/Magento/Braintree/etc/frontend/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="shortcut_buttons_container"> <observer name="braintree_paypal_shortcuts" instance="Magento\Braintree\Observer\AddPaypalShortcuts" method="execute" /> </event> diff --git a/app/code/Magento/Braintree/etc/frontend/routes.xml b/app/code/Magento/Braintree/etc/frontend/routes.xml index b422312a61a2effb414cfced0971b77326b86258..7177e15a55eca8c226ec883acb91bfb337689574 100644 --- a/app/code/Magento/Braintree/etc/frontend/routes.xml +++ b/app/code/Magento/Braintree/etc/frontend/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="standard"> <route id="braintree" frontName="braintree"> <module name="Magento_Braintree" /> diff --git a/app/code/Magento/Braintree/etc/frontend/sections.xml b/app/code/Magento/Braintree/etc/frontend/sections.xml index 4f03d7c6d1ee799627ac8c1c8bf7603bdaba31d3..622d0ac8a9e325b34ce1ad2c42368e36d7a4e166 100644 --- a/app/code/Magento/Braintree/etc/frontend/sections.xml +++ b/app/code/Magento/Braintree/etc/frontend/sections.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../Customer/etc/sections.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd"> <action name="braintree/paypal/placeOrder"> <section name="cart"/> <section name="checkout-data"/> diff --git a/app/code/Magento/Braintree/etc/module.xml b/app/code/Magento/Braintree/etc/module.xml index 5dbd18b04495a5a898ef41a699ad6b3a8f2a2946..edf1cfe4a5f73fc4055652163d6cdfa1395ab025 100644 --- a/app/code/Magento/Braintree/etc/module.xml +++ b/app/code/Magento/Braintree/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Braintree" setup_version="2.0.0"> <sequence> <module name="Magento_Checkout"/> diff --git a/app/code/Magento/Braintree/etc/payment.xml b/app/code/Magento/Braintree/etc/payment.xml index 95ba5f633336183f15941b58b26e794f603a57d5..0ad37aefce23a4262be4a915207afbc8a763cecf 100644 --- a/app/code/Magento/Braintree/etc/payment.xml +++ b/app/code/Magento/Braintree/etc/payment.xml @@ -6,7 +6,7 @@ */ --> <payment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../Magento/Payment/etc/payment.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Payment:etc/payment.xsd"> <methods> <method name="braintree"> <allow_multiple_address>1</allow_multiple_address> diff --git a/app/code/Magento/Braintree/registration.php b/app/code/Magento/Braintree/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..913c5ea6786a671578696791ec3bb4d9ab6ad3d3 --- /dev/null +++ b/app/code/Magento/Braintree/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Braintree', + __DIR__ +); diff --git a/app/code/Magento/Braintree/view/adminhtml/layout/adminhtml_system_config_edit.xml b/app/code/Magento/Braintree/view/adminhtml/layout/adminhtml_system_config_edit.xml index e5e5735e9269ae966196adf2bc7d1b3fee429d87..08cbf3988c77f716f649e87322370154416d5165 100644 --- a/app/code/Magento/Braintree/view/adminhtml/layout/adminhtml_system_config_edit.xml +++ b/app/code/Magento/Braintree/view/adminhtml/layout/adminhtml_system_config_edit.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <css src="Magento_Braintree::styles.css"/> </head> diff --git a/app/code/Magento/Braintree/view/adminhtml/layout/sales_order_create_index.xml b/app/code/Magento/Braintree/view/adminhtml/layout/sales_order_create_index.xml index 07dc95255e0a557a71c9f7f0cb7b094fef1edcd4..e42d10356bde9a6bf13b078641bdd5a3ed3be78c 100644 --- a/app/code/Magento/Braintree/view/adminhtml/layout/sales_order_create_index.xml +++ b/app/code/Magento/Braintree/view/adminhtml/layout/sales_order_create_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="footer"> <block class="Magento\Braintree\Block\Datajs" name="braintree_data_js" template="data_js.phtml" ifconfig="payment/braintree/fraudprotection"/> diff --git a/app/code/Magento/Braintree/view/frontend/layout/braintree_creditcard_delete.xml b/app/code/Magento/Braintree/view/frontend/layout/braintree_creditcard_delete.xml index 1bee126cab709df16a855d00990483d9c498ebe1..bdff568967a353fd94e648906f4f8d345229ee58 100644 --- a/app/code/Magento/Braintree/view/frontend/layout/braintree_creditcard_delete.xml +++ b/app/code/Magento/Braintree/view/frontend/layout/braintree_creditcard_delete.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="customer_account"/> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/Braintree/view/frontend/layout/braintree_creditcard_edit.xml b/app/code/Magento/Braintree/view/frontend/layout/braintree_creditcard_edit.xml index 928be0659a05439ac2278c5c8df6e381f0d05054..1b15add780fb94e7d544e1b8c28644233cd12a0e 100644 --- a/app/code/Magento/Braintree/view/frontend/layout/braintree_creditcard_edit.xml +++ b/app/code/Magento/Braintree/view/frontend/layout/braintree_creditcard_edit.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="customer_account"/> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/Braintree/view/frontend/layout/braintree_creditcard_index.xml b/app/code/Magento/Braintree/view/frontend/layout/braintree_creditcard_index.xml index 4ae1cf4d758580ac42b0e52c6a6bfc3591450606..e4b3010ca3fa6ddb3defa3d856d48244d967ae33 100644 --- a/app/code/Magento/Braintree/view/frontend/layout/braintree_creditcard_index.xml +++ b/app/code/Magento/Braintree/view/frontend/layout/braintree_creditcard_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="customer_account"/> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/Braintree/view/frontend/layout/braintree_creditcard_newcard.xml b/app/code/Magento/Braintree/view/frontend/layout/braintree_creditcard_newcard.xml index ae806acae0e2a271e322ce335736563681e03837..704f8562f8b3bd330011b8aef2f7e4b016a3546c 100644 --- a/app/code/Magento/Braintree/view/frontend/layout/braintree_creditcard_newcard.xml +++ b/app/code/Magento/Braintree/view/frontend/layout/braintree_creditcard_newcard.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="customer_account"/> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/Braintree/view/frontend/layout/braintree_paypal_review.xml b/app/code/Magento/Braintree/view/frontend/layout/braintree_paypal_review.xml index 1b570cecc2765e009e9bc00e127381cd649e5b25..1c7b14abfa13d308f65ec8ff17aa6042c42a1497 100644 --- a/app/code/Magento/Braintree/view/frontend/layout/braintree_paypal_review.xml +++ b/app/code/Magento/Braintree/view/frontend/layout/braintree_paypal_review.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <title>Review Order</title> </head> diff --git a/app/code/Magento/Braintree/view/frontend/layout/checkout_index_index.xml b/app/code/Magento/Braintree/view/frontend/layout/checkout_index_index.xml index 45530aba73fe837214355a3b75686e8327f348b6..d855f38eb52c1f82f400fbc65158a92225871e13 100644 --- a/app/code/Magento/Braintree/view/frontend/layout/checkout_index_index.xml +++ b/app/code/Magento/Braintree/view/frontend/layout/checkout_index_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout.root"> <arguments> diff --git a/app/code/Magento/Braintree/view/frontend/layout/customer_account.xml b/app/code/Magento/Braintree/view/frontend/layout/customer_account.xml index b6d4b31606ad81947e8b6207bbc501218661f392..70411f8f47f39660c2414a775bc2195c86b69a27 100644 --- a/app/code/Magento/Braintree/view/frontend/layout/customer_account.xml +++ b/app/code/Magento/Braintree/view/frontend/layout/customer_account.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="customer_account_navigation"> <block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-navigation-my-credit-cards" ifconfig="payment/braintree/use_vault"> diff --git a/app/code/Magento/Bundle/Model/CartItemProcessor.php b/app/code/Magento/Bundle/Model/CartItemProcessor.php index 28fabb39a9ed176d145c01edccea5a5093a76805..a0d7e6d21e81a56626ea143d18cd1036cb456e32 100644 --- a/app/code/Magento/Bundle/Model/CartItemProcessor.php +++ b/app/code/Magento/Bundle/Model/CartItemProcessor.php @@ -76,7 +76,7 @@ class CartItemProcessor implements CartItemProcessorInterface * {@inheritdoc} * @SuppressWarnings(PHPMD.NPathComplexity) */ - public function processProductOptions(CartItemInterface $cartItem) + public function processOptions(CartItemInterface $cartItem) { if ($cartItem->getProductType() !== \Magento\Catalog\Model\Product\Type::TYPE_BUNDLE) { return $cartItem; diff --git a/app/code/Magento/Bundle/Model/Product/Price.php b/app/code/Magento/Bundle/Model/Product/Price.php index a2c0430d00d431cea0aaa587064d8ff07a4c7998..4a1a21d27bd0c0365decbb2875109b51f5f27ac4 100644 --- a/app/code/Magento/Bundle/Model/Product/Price.php +++ b/app/code/Magento/Bundle/Model/Product/Price.php @@ -97,8 +97,6 @@ class Price extends \Magento\Catalog\Model\Product\Type\Price * * @param \Magento\Catalog\Model\Product $product * @return float - * - * @deprecated (MAGETWO-31476) */ public function getPrice($product) { @@ -375,7 +373,6 @@ class Price extends \Magento\Catalog\Model\Product\Type\Price * @param null|bool $multiplyQty Whether to multiply selection's price by its quantity * @return float * - * @deprecated after 1.6.2.0 (MAGETWO-31475) * @see \Magento\Bundle\Model\Product\Price::getSelectionFinalTotalPrice() */ public function getSelectionPrice($bundleProduct, $selectionProduct, $selectionQty = null, $multiplyQty = true) diff --git a/app/code/Magento/Bundle/Model/ProductOptionProcessor.php b/app/code/Magento/Bundle/Model/ProductOptionProcessor.php new file mode 100644 index 0000000000000000000000000000000000000000..9a163ba3af262e92e258adcfe76f6a360f043947 --- /dev/null +++ b/app/code/Magento/Bundle/Model/ProductOptionProcessor.php @@ -0,0 +1,112 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Bundle\Model; + +use Magento\Bundle\Api\Data\BundleOptionInterface; +use Magento\Bundle\Api\Data\BundleOptionInterfaceFactory; +use Magento\Catalog\Api\Data\ProductOptionInterface; +use Magento\Catalog\Model\Product\Type as ProductType; +use Magento\Catalog\Model\ProductOptionProcessorInterface; +use Magento\Framework\DataObject; +use Magento\Framework\DataObject\Factory as DataObjectFactory; + +class ProductOptionProcessor implements ProductOptionProcessorInterface +{ + /** + * @var DataObjectFactory + */ + protected $objectFactory; + + /** + * @var BundleOptionInterfaceFactory + */ + protected $bundleOptionFactory; + + /** + * @param DataObjectFactory $objectFactory + * @param BundleOptionInterfaceFactory $bundleOptionFactory + */ + public function __construct( + DataObjectFactory $objectFactory, + BundleOptionInterfaceFactory $bundleOptionFactory + ) { + $this->objectFactory = $objectFactory; + $this->bundleOptionFactory = $bundleOptionFactory; + } + + /** + * {@inheritdoc} + */ + public function convertToBuyRequest(ProductOptionInterface $productOption) + { + /** @var DataObject $request */ + $request = $this->objectFactory->create(); + + $bundleOptions = $this->getBundleOptions($productOption); + if (!empty($bundleOptions) && is_array($bundleOptions)) { + $requestData = []; + foreach ($bundleOptions as $option) { + /** @var BundleOptionInterface $option */ + foreach ($option->getOptionSelections() as $selection) { + $requestData['bundle_option'][$option->getOptionId()][] = $selection; + $requestData['bundle_option_qty'][$option->getOptionId()] = $option->getOptionQty(); + } + } + $request->addData($requestData); + } + + return $request; + } + + /** + * Retrieve bundle options + * + * @param ProductOptionInterface $productOption + * @return array + */ + protected function getBundleOptions(ProductOptionInterface $productOption) + { + if ($productOption + && $productOption->getExtensionAttributes() + && $productOption->getExtensionAttributes()->getBundleOptions() + ) { + return $productOption->getExtensionAttributes() + ->getBundleOptions(); + } + return []; + } + + /** + * {@inheritdoc} + */ + public function convertToProductOption(DataObject $request) + { + $bundleOptions = $request->getBundleOption(); + $bundleOptionsQty = $request->getBundleOptionQty(); + + if (!empty($bundleOptions) && is_array($bundleOptions)) { + $data = []; + foreach ($bundleOptions as $optionId => $optionSelections) { + if (empty($optionSelections)) { + continue; + } + $optionSelections = is_array($optionSelections) ? $optionSelections : [$optionSelections]; + $optionQty = isset($bundleOptionsQty[$optionId]) ? $bundleOptionsQty[$optionId] : 1; + + /** @var BundleOptionInterface $productOption */ + $productOption = $this->bundleOptionFactory->create(); + $productOption->setOptionId($optionId); + $productOption->setOptionSelections($optionSelections); + $productOption->setOptionQty($optionQty); + $data[] = $productOption; + } + + return ['bundle_options' => $data]; + } + + return []; + } +} diff --git a/app/code/Magento/Bundle/Pricing/Render/FinalPriceBox.php b/app/code/Magento/Bundle/Pricing/Render/FinalPriceBox.php index bfabe8db552810b2eec12fac217ecfc70d9fa56a..ce4b4f9df763475f39e7fd65bdd1080966b1d3c4 100644 --- a/app/code/Magento/Bundle/Pricing/Render/FinalPriceBox.php +++ b/app/code/Magento/Bundle/Pricing/Render/FinalPriceBox.php @@ -8,6 +8,7 @@ namespace Magento\Bundle\Pricing\Render; use Magento\Bundle\Pricing\Price; use Magento\Catalog\Pricing\Render as CatalogRender; +use Magento\Catalog\Pricing\Price\CustomOptionPrice; /** * Class for final_price rendering @@ -15,14 +16,25 @@ use Magento\Catalog\Pricing\Render as CatalogRender; class FinalPriceBox extends CatalogRender\FinalPriceBox { /** - * Check if bundle product has one more custom option with different prices + * Check if bundle product has one or more options, or custom options, with different prices * * @return bool */ public function showRangePrice() { - /** @var Price\BundleOptionPrice $optionPrice */ - $optionPrice = $this->getPriceType(Price\BundleOptionPrice::PRICE_CODE); - return $optionPrice->getValue() !== $optionPrice->getMaxValue(); + //Check the bundle options + /** @var Price\BundleOptionPrice $bundleOptionPrice */ + $bundleOptionPrice = $this->getPriceType(Price\BundleOptionPrice::PRICE_CODE); + $showRange = $bundleOptionPrice->getValue() != $bundleOptionPrice->getMaxValue(); + + if (!$showRange) { + //Check the custom options, if any + /** @var \Magento\Catalog\Pricing\Price\CustomOptionPrice $customOptionPrice */ + $customOptionPrice = $this->getPriceType(CustomOptionPrice::PRICE_CODE); + $showRange = + $customOptionPrice->getCustomOptionRange(true) != $customOptionPrice->getCustomOptionRange(false); + } + + return $showRange; } } diff --git a/app/code/Magento/Bundle/Test/Unit/Model/CartItemProcessorTest.php b/app/code/Magento/Bundle/Test/Unit/Model/CartItemProcessorTest.php index 2ffde6aa43b640d6c1ddbde28b4b1f5185004284..02be067f9e68ae1944a871ad06bb0ecd9f8d9341 100644 --- a/app/code/Magento/Bundle/Test/Unit/Model/CartItemProcessorTest.php +++ b/app/code/Magento/Bundle/Test/Unit/Model/CartItemProcessorTest.php @@ -147,13 +147,13 @@ class CartItemProcessorTest extends \PHPUnit_Framework_TestCase $cartItemMock->expects($this->atLeastOnce())->method('getProductOption')->willReturn($productOptionMock); $productOptionMock->expects($this->once())->method('setExtensionAttributes')->with($optionExtensionMock); - $this->assertSame($cartItemMock, $this->model->processProductOptions($cartItemMock)); + $this->assertSame($cartItemMock, $this->model->processOptions($cartItemMock)); } public function testProcessProductOptionsInvalidType() { $cartItemMock = $this->getMock('\Magento\Quote\Model\Quote\Item', ['getProductType'], [], '', false); $cartItemMock->expects($this->once())->method('getProductType')->willReturn(Type::TYPE_SIMPLE); - $this->assertSame($cartItemMock, $this->model->processProductOptions($cartItemMock)); + $this->assertSame($cartItemMock, $this->model->processOptions($cartItemMock)); } } diff --git a/app/code/Magento/Bundle/Test/Unit/Model/ProductOptionProcessorTest.php b/app/code/Magento/Bundle/Test/Unit/Model/ProductOptionProcessorTest.php new file mode 100644 index 0000000000000000000000000000000000000000..f19b881c3eb3d852322e5dc063ac5ea307d144b7 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Unit/Model/ProductOptionProcessorTest.php @@ -0,0 +1,222 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Bundle\Test\Unit\Model; + +use Magento\Bundle\Api\Data\BundleOptionInterface; +use Magento\Bundle\Api\Data\BundleOptionInterfaceFactory; +use Magento\Bundle\Model\ProductOptionProcessor; +use Magento\Framework\DataObject; +use Magento\Framework\DataObject\Factory as DataObjectFactory; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; + +class ProductOptionProcessorTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var ProductOptionProcessor + */ + protected $processor; + + /** + * @var DataObject | \PHPUnit_Framework_MockObject_MockObject + */ + protected $dataObject; + + /** + * @var DataObjectFactory | \PHPUnit_Framework_MockObject_MockObject + */ + protected $dataObjectFactory; + + /** + * @var BundleOptionInterfaceFactory | \PHPUnit_Framework_MockObject_MockObject + */ + protected $bundleOptionInterfaceFactory; + + /** + * @var BundleOptionInterface | \PHPUnit_Framework_MockObject_MockObject + */ + protected $bundleOption; + + protected function setUp() + { + $this->dataObject = $this->getMockBuilder('Magento\Framework\DataObject') + ->setMethods([ + 'getBundleOption', + 'getBundleOptionQty', + 'create', + ]) + ->disableOriginalConstructor() + ->getMock(); + + $this->dataObjectFactory = $this->getMockBuilder('Magento\Framework\DataObject\Factory') + ->setMethods(['create']) + ->disableOriginalConstructor() + ->getMock(); + $this->dataObjectFactory->expects($this->any()) + ->method('create') + ->willReturn($this->dataObject); + + $this->bundleOption = $this->getMockBuilder( + 'Magento\Bundle\Api\Data\BundleOptionInterface' + ) + ->getMockForAbstractClass(); + + $this->bundleOptionInterfaceFactory = $this->getMockBuilder( + 'Magento\Bundle\Api\Data\BundleOptionInterfaceFactory' + ) + ->setMethods(['create']) + ->disableOriginalConstructor() + ->getMock(); + $this->bundleOptionInterfaceFactory->expects($this->any()) + ->method('create') + ->willReturn($this->bundleOption); + + $this->processor = new ProductOptionProcessor( + $this->dataObjectFactory, + $this->bundleOptionInterfaceFactory + ); + } + + /** + * @param array|string $options + * @param array $requestData + * @dataProvider dataProviderConvertToBuyRequest + */ + public function testConvertToBuyRequest( + $options, + $requestData + ) { + $productOptionMock = $this->getMockBuilder('Magento\Catalog\Api\Data\ProductOptionInterface') + ->getMockForAbstractClass(); + + $productOptionExtensionMock = $this->getMockBuilder('Magento\Catalog\Api\Data\ProductOptionExtensionInterface') + ->setMethods([ + 'getBundleOptions', + ]) + ->getMockForAbstractClass(); + + $productOptionMock->expects($this->any()) + ->method('getExtensionAttributes') + ->willReturn($productOptionExtensionMock); + + $productOptionExtensionMock->expects($this->any()) + ->method('getBundleOptions') + ->willReturn($options); + + $this->dataObject->expects($this->any()) + ->method('addData') + ->with($requestData) + ->willReturnSelf(); + + $this->assertEquals($this->dataObject, $this->processor->convertToBuyRequest($productOptionMock)); + } + + /** + * @return array + */ + public function dataProviderConvertToBuyRequest() + { + $objectManager = new ObjectManager($this); + + /** @var \Magento\Bundle\Model\BundleOption $option */ + $option = $objectManager->getObject('Magento\Bundle\Model\BundleOption'); + $option->setOptionId(1); + $option->setOptionQty(1); + $option->setOptionSelections(['selection']); + + return [ + [ + [$option], + [ + 'bundle_option' => [ + 1 => ['selection'], + ], + 'bundle_option_qty' => [ + 1 => 1, + ], + ], + ], + [[], []], + ['is not array', []], + ]; + } + + /** + * @param array|string $options + * @param array|int $optionsQty + * @param string|null $expected + * @dataProvider dataProviderConvertToProductOption + */ + public function testConvertToProductOption( + $options, + $optionsQty, + $expected + ) { + $this->dataObject->expects($this->any()) + ->method('getBundleOption') + ->willReturn($options); + $this->dataObject->expects($this->any()) + ->method('getBundleOptionQty') + ->willReturn($optionsQty); + + if (!empty($options) && is_array($options)) { + $this->bundleOption->expects($this->any()) + ->method('setOptionId') + ->willReturnMap([ + [1, $this->bundleOption], + [2, $this->bundleOption], + ]); + $this->bundleOption->expects($this->any()) + ->method('setOptionSelections') + ->willReturnMap([ + [$options[1], $this->bundleOption], + [$options[2], $this->bundleOption], + ]); + $this->bundleOption->expects($this->any()) + ->method('setOptionQty') + ->willReturnMap([ + [1, $this->bundleOption], + ]); + } + + $result = $this->processor->convertToProductOption($this->dataObject); + + if (!empty($expected)) { + $this->assertArrayHasKey($expected, $result); + $this->assertTrue(is_array($result[$expected])); + } + } + + /** + * @return array + */ + public function dataProviderConvertToProductOption() + { + return [ + [ + 'options' => [ + 1 => ['selection1'], + 2 => ['selection2'], + 3 => [], + 4 => '', + ], + 'options_qty' => [ + 1 => 1, + ], + 'expected' => 'bundle_options', + ], + [ + 'options' => [], + 'options_qty' => 0, + 'expected' => null, + ], + [ + 'options' => 'is not array', + 'options_qty' => 0, + 'expected' => null, + ], + ]; + } +} diff --git a/app/code/Magento/Bundle/Test/Unit/Pricing/Render/FinalPriceBoxTest.php b/app/code/Magento/Bundle/Test/Unit/Pricing/Render/FinalPriceBoxTest.php index 6b7bec5533e8b70146c95ac5424f004e0f7301fc..3e341d2f5befcd859aa728f4b39b9e7f78a570d8 100644 --- a/app/code/Magento/Bundle/Test/Unit/Pricing/Render/FinalPriceBoxTest.php +++ b/app/code/Magento/Bundle/Test/Unit/Pricing/Render/FinalPriceBoxTest.php @@ -5,9 +5,9 @@ */ namespace Magento\Bundle\Test\Unit\Pricing\Render; -use \Magento\Bundle\Pricing\Render\FinalPriceBox; - +use Magento\Bundle\Pricing\Render\FinalPriceBox; use Magento\Bundle\Pricing\Price; +use Magento\Catalog\Pricing\Price\CustomOptionPrice; class FinalPriceBoxTest extends \PHPUnit_Framework_TestCase { @@ -34,10 +34,15 @@ class FinalPriceBoxTest extends \PHPUnit_Framework_TestCase /** * @dataProvider showRangePriceDataProvider */ - public function testShowRangePrice($value, $maxValue, $result) + public function testShowRangePrice($optMinValue, $optMaxValue, $custMinValue, $custMaxValue, $expectedShowRange) { + $enableCustomOptionMocks = ($optMinValue == $optMaxValue); + $priceInfo = $this->getMock('Magento\Framework\Pricing\PriceInfo\Base', [], [], '', false); - $optionPrice = $this->getMockBuilder('Magento\Bundle\Pricing\Price\BundleOptionPrice') + $bundleOptionPrice = $this->getMockBuilder('Magento\Bundle\Pricing\Price\BundleOptionPrice') + ->disableOriginalConstructor() + ->getMock(); + $customOptionPrice = $this->getMockBuilder('Magento\Catalog\Pricing\Price\CustomOptionPrice') ->disableOriginalConstructor() ->getMock(); @@ -45,20 +50,34 @@ class FinalPriceBoxTest extends \PHPUnit_Framework_TestCase ->method('getPriceInfo') ->will($this->returnValue($priceInfo)); - $priceInfo->expects($this->atLeastOnce()) + $priceInfo->expects($this->at(0)) ->method('getPrice') ->with(Price\BundleOptionPrice::PRICE_CODE) - ->will($this->returnValue($optionPrice)); + ->will($this->returnValue($bundleOptionPrice)); + if ($enableCustomOptionMocks) { + $priceInfo->expects($this->at(1)) + ->method('getPrice') + ->with(CustomOptionPrice::PRICE_CODE) + ->will($this->returnValue($customOptionPrice)); + } - $optionPrice->expects($this->once()) + $bundleOptionPrice->expects($this->once()) ->method('getValue') - ->will($this->returnValue($value)); - - $optionPrice->expects($this->once()) + ->will($this->returnValue($optMinValue)); + $bundleOptionPrice->expects($this->once()) ->method('getMaxValue') - ->will($this->returnValue($maxValue)); + ->will($this->returnValue($optMaxValue)); - $this->assertEquals($result, $this->model->showRangePrice()); + if ($enableCustomOptionMocks) { + $customOptionPrice->expects($this->at(0)) + ->method('getCustomOptionRange') + ->will($this->returnValue($custMinValue)); + $customOptionPrice->expects($this->at(1)) + ->method('getCustomOptionRange') + ->will($this->returnValue($custMaxValue)); + } + + $this->assertEquals($expectedShowRange, $this->model->showRangePrice()); } /** @@ -67,9 +86,37 @@ class FinalPriceBoxTest extends \PHPUnit_Framework_TestCase public function showRangePriceDataProvider() { return [ - ['value' => 40.2, 'maxValue' => 45., 'result' => true], - ['value' => false, 'maxValue' => false, 'result' => false], - ['value' => 45.0, 'maxValue' => 45., 'result' => false], + 'bundle options different, custom options noop' => [ + 'optMinValue' => 40.2, + 'optMaxValue' => 45., + 'custMinValue' => 0, + 'custMaxValue' => 0, + 'expectedShowRange' => true + ], + + 'bundle options same boolean, custom options same boolean' => [ + 'optMinValue' => false, + 'optMaxValue' => false, + 'custMinValue' => false, + 'custMaxValue' => false, + 'expectedShowRange' => false + ], + + 'bundle options same numeric, custom options same' => [ + 'optMinValue' => 45.0, + 'optMaxValue' => 45, + 'custMinValue' => 1.0, + 'custMaxValue' => 1, + 'expectedShowRange' => false + ], + + 'bundle options same numeric, custom options different' => [ + 'optMinValue' => 45.0, + 'optMaxValue' => 45., + 'custMinValue' => 0, + 'custMaxValue' => 1, + 'expectedShowRange' => true + ], ]; } } diff --git a/app/code/Magento/Bundle/composer.json b/app/code/Magento/Bundle/composer.json index 24351f5012a5d7cd967a50164c7a7bebaa8b3905..0da5b0193e94f39c86dc1b012873aead8b2a9808 100644 --- a/app/code/Magento/Bundle/composer.json +++ b/app/code/Magento/Bundle/composer.json @@ -17,8 +17,7 @@ "magento/module-gift-message": "1.0.0-beta", "magento/framework": "1.0.0-beta", "magento/module-quote": "1.0.0-beta", - "magento/module-media-storage": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/module-media-storage": "1.0.0-beta" }, "suggest": { "magento/module-webapi": "1.0.0-beta" @@ -29,12 +28,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Bundle" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Bundle\\": "" + } } } diff --git a/app/code/Magento/Bundle/etc/adminhtml/di.xml b/app/code/Magento/Bundle/etc/adminhtml/di.xml index ea56d323af512b80bde7a2d48976cce930288cdf..0270ff9164b5980aa8c6b8b62c32bcea0e21a628 100644 --- a/app/code/Magento/Bundle/etc/adminhtml/di.xml +++ b/app/code/Magento/Bundle/etc/adminhtml/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Catalog\Controller\Adminhtml\Product\Initialization\Helper"> <plugin name="Bundle" type="Magento\Bundle\Controller\Adminhtml\Product\Initialization\Helper\Plugin\Bundle" sortOrder="60" /> </type> diff --git a/app/code/Magento/Bundle/etc/adminhtml/events.xml b/app/code/Magento/Bundle/etc/adminhtml/events.xml index c7b96920d8e993dd8dd57aec99c19984425e8838..8b0ce8cd5a1d07aa588e693f822d6a1608182105 100644 --- a/app/code/Magento/Bundle/etc/adminhtml/events.xml +++ b/app/code/Magento/Bundle/etc/adminhtml/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="catalog_product_edit_action"> <observer name="bundle_observer" instance="Magento\Bundle\Observer\SetAttributeTabBlockObserver" method="execute" /> </event> diff --git a/app/code/Magento/Bundle/etc/adminhtml/routes.xml b/app/code/Magento/Bundle/etc/adminhtml/routes.xml index ee8835be1a6802a4f5a27031a8ae32bd1e219e5c..3cdf77099f686d2549c5a3018985552ee66e199e 100644 --- a/app/code/Magento/Bundle/etc/adminhtml/routes.xml +++ b/app/code/Magento/Bundle/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="admin"> <route id="adminhtml"> <module name="Magento_Bundle" before="Magento_Backend" /> diff --git a/app/code/Magento/Bundle/etc/catalog_attributes.xml b/app/code/Magento/Bundle/etc/catalog_attributes.xml index b9a8f3332bf4c72b5ab6a04d2b1647436b3fc8ac..427372a6c583a33b4d29f4dcc25e12808cff678c 100644 --- a/app/code/Magento/Bundle/etc/catalog_attributes.xml +++ b/app/code/Magento/Bundle/etc/catalog_attributes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Catalog/etc/catalog_attributes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/catalog_attributes.xsd"> <group name="catalog_product"> <attribute name="price_view"/> <attribute name="price_type"/> diff --git a/app/code/Magento/Bundle/etc/config.xml b/app/code/Magento/Bundle/etc/config.xml index 10a14c0aab73d501f8581ba9245116e6b5246df9..e2145f133b4a55cc5495bfcd7c1252aa94e7077c 100644 --- a/app/code/Magento/Bundle/etc/config.xml +++ b/app/code/Magento/Bundle/etc/config.xml @@ -5,5 +5,5 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> </config> diff --git a/app/code/Magento/Bundle/etc/di.xml b/app/code/Magento/Bundle/etc/di.xml index 31a87838890f8eef251744b8e915bff4b48cb999..3119f8ef53b0bf939ddc1a7e3c047d1a6a433d97 100644 --- a/app/code/Magento/Bundle/etc/di.xml +++ b/app/code/Magento/Bundle/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Bundle\Api\ProductOptionTypeListInterface" type="Magento\Bundle\Model\OptionTypeList" /> <preference for="Magento\Bundle\Api\Data\OptionTypeInterface" type="Magento\Bundle\Model\Source\Option\Type" /> <preference for="Magento\Bundle\Api\ProductLinkManagementInterface" type="Magento\Bundle\Model\LinkManagement" /> @@ -109,4 +109,11 @@ </argument> </arguments> </type> + <type name="Magento\Sales\Api\OrderItemRepositoryInterface"> + <arguments> + <argument name="processorPool" xsi:type="array"> + <item name="bundle" xsi:type="object">Magento\Bundle\Model\ProductOptionProcessor</item> + </argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/Bundle/etc/extension_attributes.xml b/app/code/Magento/Bundle/etc/extension_attributes.xml index 48646e276a7298aae7b43fcdcf63ddc251b5e96a..10b49f44e750207ba726ea094e971782755a62b9 100644 --- a/app/code/Magento/Bundle/etc/extension_attributes.xml +++ b/app/code/Magento/Bundle/etc/extension_attributes.xml @@ -5,11 +5,14 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Api/etc/extension_attributes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> <extension_attributes for="Magento\Catalog\Api\Data\ProductInterface"> <attribute code="bundle_product_options" type="Magento\Bundle\Api\Data\OptionInterface[]" /> </extension_attributes> <extension_attributes for="Magento\Quote\Api\Data\ProductOptionInterface"> <attribute code="bundle_options" type="Magento\Bundle\Api\Data\BundleOptionInterface[]" /> </extension_attributes> + <extension_attributes for="Magento\Catalog\Api\Data\ProductOptionInterface"> + <attribute code="bundle_options" type="Magento\Bundle\Api\Data\BundleOptionInterface[]" /> + </extension_attributes> </config> diff --git a/app/code/Magento/Bundle/etc/frontend/di.xml b/app/code/Magento/Bundle/etc/frontend/di.xml index e8af96e9bb10af2c038311fa0a3e7a8a61b66d99..be661c8b07bb63e941a2b916c4e85b8b6861ca45 100644 --- a/app/code/Magento/Bundle/etc/frontend/di.xml +++ b/app/code/Magento/Bundle/etc/frontend/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Catalog\Helper\Product\ConfigurationPool"> <arguments> <argument name="instancesByType" xsi:type="array"> diff --git a/app/code/Magento/Bundle/etc/frontend/events.xml b/app/code/Magento/Bundle/etc/frontend/events.xml index 1a098812ec5117de2668aa7fab68a7b36579ea26..087214a11ede2c0cdf62a2a9b7065596b1e4b312 100644 --- a/app/code/Magento/Bundle/etc/frontend/events.xml +++ b/app/code/Magento/Bundle/etc/frontend/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="catalog_product_upsell"> <observer name="bundle_observer" instance="Magento\Bundle\Observer\AppendUpsellProductsObserver" method="execute"/> </event> diff --git a/app/code/Magento/Bundle/etc/module.xml b/app/code/Magento/Bundle/etc/module.xml index 133212807a9be24fc67c63f33342c8e266bb6580..88acb1686093560ca81fba50725109e4364b64af 100644 --- a/app/code/Magento/Bundle/etc/module.xml +++ b/app/code/Magento/Bundle/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Bundle" setup_version="2.0.1"> <sequence> <module name="Magento_Catalog"/> diff --git a/app/code/Magento/Bundle/etc/pdf.xml b/app/code/Magento/Bundle/etc/pdf.xml index b56000d4030983b7d594e603858082d4c9ea5e7a..bdc05487c5663c90780416bae2a0c0d32ccee21c 100644 --- a/app/code/Magento/Bundle/etc/pdf.xml +++ b/app/code/Magento/Bundle/etc/pdf.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Sales/etc/pdf_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Sales:etc/pdf_file.xsd"> <renderers> <page type="invoice"> <renderer product_type="bundle">Magento\Bundle\Model\Sales\Order\Pdf\Items\Invoice</renderer> diff --git a/app/code/Magento/Bundle/etc/product_types.xml b/app/code/Magento/Bundle/etc/product_types.xml index c4fc5cded4cfefb9b2d9d7eb4da6c082b21cb910..fff21fd0ba521467085c36d72ae5794615ba8a7d 100644 --- a/app/code/Magento/Bundle/etc/product_types.xml +++ b/app/code/Magento/Bundle/etc/product_types.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Catalog/etc/product_types.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/product_types.xsd"> <type name="bundle" label="Bundle Product" modelInstance="Magento\Bundle\Model\Product\Type" composite='true' indexPriority="40" sortOrder="50"> <priceModel instance="Magento\Bundle\Model\Product\Price" /> <indexerModel instance="Magento\Bundle\Model\Resource\Indexer\Price" /> diff --git a/app/code/Magento/Bundle/etc/sales.xml b/app/code/Magento/Bundle/etc/sales.xml index be0eea60450f6051d1b1a7b5f9103f9a35e0796f..e894a91eb9737e0cc07c7ceaa931fce0883f199f 100644 --- a/app/code/Magento/Bundle/etc/sales.xml +++ b/app/code/Magento/Bundle/etc/sales.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Sales/etc/sales.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Sales:etc/sales.xsd"> <order> <available_product_type name="bundle"/> </order> diff --git a/app/code/Magento/Bundle/etc/webapi.xml b/app/code/Magento/Bundle/etc/webapi.xml index 550987ba13e669b5e2a5634384b3793d8932f97e..3c293e8658cfde3a32d76e77f616535948fd8b6c 100644 --- a/app/code/Magento/Bundle/etc/webapi.xml +++ b/app/code/Magento/Bundle/etc/webapi.xml @@ -6,7 +6,7 @@ */ --> <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../app/code/Magento/Webapi/etc/webapi.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd"> <route url="/V1/bundle-products/:sku/links/:optionId" method="POST"> <service class="Magento\Bundle\Api\ProductLinkManagementInterface" method="addChildByProductSku"/> <resources> diff --git a/app/code/Magento/Bundle/etc/webapi_rest/di.xml b/app/code/Magento/Bundle/etc/webapi_rest/di.xml index e8af96e9bb10af2c038311fa0a3e7a8a61b66d99..be661c8b07bb63e941a2b916c4e85b8b6861ca45 100644 --- a/app/code/Magento/Bundle/etc/webapi_rest/di.xml +++ b/app/code/Magento/Bundle/etc/webapi_rest/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Catalog\Helper\Product\ConfigurationPool"> <arguments> <argument name="instancesByType" xsi:type="array"> diff --git a/app/code/Magento/Bundle/etc/webapi_soap/di.xml b/app/code/Magento/Bundle/etc/webapi_soap/di.xml index e8af96e9bb10af2c038311fa0a3e7a8a61b66d99..be661c8b07bb63e941a2b916c4e85b8b6861ca45 100644 --- a/app/code/Magento/Bundle/etc/webapi_soap/di.xml +++ b/app/code/Magento/Bundle/etc/webapi_soap/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Catalog\Helper\Product\ConfigurationPool"> <arguments> <argument name="instancesByType" xsi:type="array"> diff --git a/app/code/Magento/Bundle/registration.php b/app/code/Magento/Bundle/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..8d7712c274ae16ad317e57a275531ed09d89f8c1 --- /dev/null +++ b/app/code/Magento/Bundle/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Bundle', + __DIR__ +); diff --git a/app/code/Magento/Bundle/view/adminhtml/layout/adminhtml_order_shipment_new.xml b/app/code/Magento/Bundle/view/adminhtml/layout/adminhtml_order_shipment_new.xml index 566261318a619f5dcb1d5dbbddf9ade413ce9224..d76318e5b4baaf659f39eddbb7f8e23d6c505205 100644 --- a/app/code/Magento/Bundle/view/adminhtml/layout/adminhtml_order_shipment_new.xml +++ b/app/code/Magento/Bundle/view/adminhtml/layout/adminhtml_order_shipment_new.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="order_items"> <block class="Magento\Bundle\Block\Adminhtml\Sales\Order\Items\Renderer" as="bundle" template="sales/shipment/create/items/renderer.phtml"/> diff --git a/app/code/Magento/Bundle/view/adminhtml/layout/adminhtml_order_shipment_view.xml b/app/code/Magento/Bundle/view/adminhtml/layout/adminhtml_order_shipment_view.xml index 2ad571c05f8ccaeec5ce6cd7127a0f67b0b38557..e6b5239ee1aff597e236a835d22683158b8b3d8d 100644 --- a/app/code/Magento/Bundle/view/adminhtml/layout/adminhtml_order_shipment_view.xml +++ b/app/code/Magento/Bundle/view/adminhtml/layout/adminhtml_order_shipment_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="shipment_items"> <block class="Magento\Bundle\Block\Adminhtml\Sales\Order\Items\Renderer" as="bundle" template="sales/shipment/view/items/renderer.phtml"/> diff --git a/app/code/Magento/Bundle/view/adminhtml/layout/catalog_product_bundle.xml b/app/code/Magento/Bundle/view/adminhtml/layout/catalog_product_bundle.xml index 2e273fa9e1cfedcf2234bd103e8a438e5608ca75..d2c07aed3bd394b4e3749283ee0719bf173eeca1 100644 --- a/app/code/Magento/Bundle/view/adminhtml/layout/catalog_product_bundle.xml +++ b/app/code/Magento/Bundle/view/adminhtml/layout/catalog_product_bundle.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <css src="Magento_Bundle::css/bundle-product.css"/> </head> diff --git a/app/code/Magento/Bundle/view/adminhtml/layout/catalog_product_new.xml b/app/code/Magento/Bundle/view/adminhtml/layout/catalog_product_new.xml index e197eba9b489739eec0015a2b70aab60b33aa18a..5c9ab01bcfd2aea0302382540301e2649f03258a 100644 --- a/app/code/Magento/Bundle/view/adminhtml/layout/catalog_product_new.xml +++ b/app/code/Magento/Bundle/view/adminhtml/layout/catalog_product_new.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="js"> <block class="Magento\Framework\View\Element\Template" template="Magento_Bundle::product/stock/disabler.phtml"/> diff --git a/app/code/Magento/Bundle/view/adminhtml/layout/catalog_product_view_type_bundle.xml b/app/code/Magento/Bundle/view/adminhtml/layout/catalog_product_view_type_bundle.xml index a99f38382e7b8481311910616e8fe83d9aeef9ba..92fdb1806e890563fdbe0da233af056000dd7218 100644 --- a/app/code/Magento/Bundle/view/adminhtml/layout/catalog_product_view_type_bundle.xml +++ b/app/code/Magento/Bundle/view/adminhtml/layout/catalog_product_view_type_bundle.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="product.composite.fieldset"> <block class="Magento\Bundle\Block\Adminhtml\Catalog\Product\Composite\Fieldset\Bundle" before="product.composite.fieldset.options" name="product.composite.fieldset.bundle" template="product/composite/fieldset/options/bundle.phtml"> diff --git a/app/code/Magento/Bundle/view/adminhtml/layout/customer_index_wishlist.xml b/app/code/Magento/Bundle/view/adminhtml/layout/customer_index_wishlist.xml index f59f4e46d7e8bc964298951fc40e72e407906ba5..23834c7d562c59c19159a0ebd606fd635c43de04 100644 --- a/app/code/Magento/Bundle/view/adminhtml/layout/customer_index_wishlist.xml +++ b/app/code/Magento/Bundle/view/adminhtml/layout/customer_index_wishlist.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="customer.wishlist.edit.tab"> <arguments> diff --git a/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_creditmemo_new.xml b/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_creditmemo_new.xml index 52351b6f6e88196560ab81781bb9848adfbd4100..6394da560f7f687d949b699b5b47ee408789ef5b 100644 --- a/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_creditmemo_new.xml +++ b/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_creditmemo_new.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="order_items"> <block class="Magento\Bundle\Block\Adminhtml\Sales\Order\Items\Renderer" as="bundle" template="sales/creditmemo/create/items/renderer.phtml"/> diff --git a/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_creditmemo_updateqty.xml b/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_creditmemo_updateqty.xml index 52351b6f6e88196560ab81781bb9848adfbd4100..6394da560f7f687d949b699b5b47ee408789ef5b 100644 --- a/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_creditmemo_updateqty.xml +++ b/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_creditmemo_updateqty.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="order_items"> <block class="Magento\Bundle\Block\Adminhtml\Sales\Order\Items\Renderer" as="bundle" template="sales/creditmemo/create/items/renderer.phtml"/> diff --git a/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_creditmemo_view.xml b/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_creditmemo_view.xml index b86e546e2fc2f9bbc023d9f3f4493d83f69f23d0..237ff03e8336fdfed3774f25d8d2040f9ca792d4 100644 --- a/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_creditmemo_view.xml +++ b/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_creditmemo_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="creditmemo_items"> <block class="Magento\Bundle\Block\Adminhtml\Sales\Order\Items\Renderer" as="bundle" template="sales/creditmemo/view/items/renderer.phtml"/> diff --git a/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_invoice_new.xml b/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_invoice_new.xml index ca180be2706feb7187a6c065eac7270ae0692666..843539dca0895753175ba2ca0794753eb2b6cb02 100644 --- a/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_invoice_new.xml +++ b/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_invoice_new.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="order_items"> <block class="Magento\Bundle\Block\Adminhtml\Sales\Order\Items\Renderer" as="bundle" template="sales/invoice/create/items/renderer.phtml"/> diff --git a/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_invoice_updateqty.xml b/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_invoice_updateqty.xml index ca180be2706feb7187a6c065eac7270ae0692666..843539dca0895753175ba2ca0794753eb2b6cb02 100644 --- a/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_invoice_updateqty.xml +++ b/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_invoice_updateqty.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="order_items"> <block class="Magento\Bundle\Block\Adminhtml\Sales\Order\Items\Renderer" as="bundle" template="sales/invoice/create/items/renderer.phtml"/> diff --git a/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_invoice_view.xml b/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_invoice_view.xml index 1a1dc0bcd67e44324aec77f307a7e5ade20d5120..9df8b3dccb83c5243c381e0a1da20d8c3be9f384 100644 --- a/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_invoice_view.xml +++ b/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_invoice_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="invoice_items"> <block class="Magento\Bundle\Block\Adminhtml\Sales\Order\Items\Renderer" as="bundle" template="sales/invoice/view/items/renderer.phtml"/> diff --git a/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_view.xml b/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_view.xml index 8f70cf4ebe784c99acbfdef61042679415ce76bf..62ee9d5ccd3386dfb1160142e8511059d4f7380e 100644 --- a/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_view.xml +++ b/app/code/Magento/Bundle/view/adminhtml/layout/sales_order_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="order_items"> <block class="Magento\Bundle\Block\Adminhtml\Sales\Order\View\Items\Renderer" as="bundle" template="sales/order/view/items/renderer.phtml"/> diff --git a/app/code/Magento/Bundle/view/base/layout/catalog_product_prices.xml b/app/code/Magento/Bundle/view/base/layout/catalog_product_prices.xml index 2f1733cd012a3b5d6b66cd65eed521c5c05e3258..5af80e3622073e0cfed785b18583b5b664a0e969 100644 --- a/app/code/Magento/Bundle/view/base/layout/catalog_product_prices.xml +++ b/app/code/Magento/Bundle/view/base/layout/catalog_product_prices.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <referenceBlock name="render.product.prices"> <arguments> <argument name="bundle" xsi:type="array"> 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 67fe6f16a339b7229f7bbd695a1b2926e2b2288d..de0a546928f75ff6d21c68cc91f63c0e5e21d0f7 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 @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <attribute name="class" value="page-product-bundle"/> <referenceBlock name="product.info"> diff --git a/app/code/Magento/Bundle/view/frontend/layout/catalog_product_view_type_simple.xml b/app/code/Magento/Bundle/view/frontend/layout/catalog_product_view_type_simple.xml index f4970b4369404a4b073508fd8812ea660d4d595f..0a5cca6fea16c352d6c6165129651036c213c35b 100644 --- a/app/code/Magento/Bundle/view/frontend/layout/catalog_product_view_type_simple.xml +++ b/app/code/Magento/Bundle/view/frontend/layout/catalog_product_view_type_simple.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="product.info.upsell"> <action method="setItemLimit"> diff --git a/app/code/Magento/Bundle/view/frontend/layout/checkout_cart_configure_type_bundle.xml b/app/code/Magento/Bundle/view/frontend/layout/checkout_cart_configure_type_bundle.xml index 8860d46d398b747d097ca47a160e05a4b884e109..b10942c20b1a0e6019b4ec9b719f3f91316364d6 100644 --- a/app/code/Magento/Bundle/view/frontend/layout/checkout_cart_configure_type_bundle.xml +++ b/app/code/Magento/Bundle/view/frontend/layout/checkout_cart_configure_type_bundle.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="catalog_product_view_type_bundle"/> <body> <referenceBlock name="head.components"> diff --git a/app/code/Magento/Bundle/view/frontend/layout/checkout_cart_item_renderers.xml b/app/code/Magento/Bundle/view/frontend/layout/checkout_cart_item_renderers.xml index 94ceb9f5440cc6de01d0a7a13863b41d8b753f71..a568cf88e6ae99c4ddd1a08d31004799cca18f60 100644 --- a/app/code/Magento/Bundle/view/frontend/layout/checkout_cart_item_renderers.xml +++ b/app/code/Magento/Bundle/view/frontend/layout/checkout_cart_item_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout.cart.item.renderers"> <block class="Magento\Bundle\Block\Checkout\Cart\Item\Renderer" as="bundle" template="Magento_Checkout::cart/item/default.phtml"> diff --git a/app/code/Magento/Bundle/view/frontend/layout/checkout_onepage_review_item_renderers.xml b/app/code/Magento/Bundle/view/frontend/layout/checkout_onepage_review_item_renderers.xml index 9e0d6c78d354f7c69b1a13c55921ba3e8100bbc2..d1a42de24a7b73627b5b519d8b7bbe343a062cbd 100644 --- a/app/code/Magento/Bundle/view/frontend/layout/checkout_onepage_review_item_renderers.xml +++ b/app/code/Magento/Bundle/view/frontend/layout/checkout_onepage_review_item_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout.onepage.review.item.renderers"> <block class="Magento\Bundle\Block\Checkout\Cart\Item\Renderer" as="bundle" template="Magento_Checkout::onepage/review/item.phtml"/> diff --git a/app/code/Magento/Bundle/view/frontend/layout/default.xml b/app/code/Magento/Bundle/view/frontend/layout/default.xml index 1d50d6b73dd7fe3ded3df05c7b0b6b8813c7028f..03f496a73e3ae335564aba56c7f74bf3439d73c8 100644 --- a/app/code/Magento/Bundle/view/frontend/layout/default.xml +++ b/app/code/Magento/Bundle/view/frontend/layout/default.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="head.components"> <block class="Magento\Framework\View\Element\Js\Components" name="bundle_checkout_page_head_components" template="Magento_Bundle::js/components.phtml"/> diff --git a/app/code/Magento/Bundle/view/frontend/layout/sales_email_order_creditmemo_renderers.xml b/app/code/Magento/Bundle/view/frontend/layout/sales_email_order_creditmemo_renderers.xml index a48e879236896077e5abf4fc48d1cf540bdcda03..69974ce033ba5d05cfbfb82d91cb682c022878fb 100644 --- a/app/code/Magento/Bundle/view/frontend/layout/sales_email_order_creditmemo_renderers.xml +++ b/app/code/Magento/Bundle/view/frontend/layout/sales_email_order_creditmemo_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="sales.email.order.creditmemo.renderers"> <block class="Magento\Bundle\Block\Sales\Order\Items\Renderer" as="bundle" template="email/order/items/creditmemo/default.phtml"/> diff --git a/app/code/Magento/Bundle/view/frontend/layout/sales_email_order_invoice_renderers.xml b/app/code/Magento/Bundle/view/frontend/layout/sales_email_order_invoice_renderers.xml index fffad4bbdcea38b7aeb7b59b3b58e5304b356212..af3ccadfa5856ea75cb2d2bc8ce93afd09f30c23 100644 --- a/app/code/Magento/Bundle/view/frontend/layout/sales_email_order_invoice_renderers.xml +++ b/app/code/Magento/Bundle/view/frontend/layout/sales_email_order_invoice_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="sales.email.order.invoice.renderers"> <block class="Magento\Bundle\Block\Sales\Order\Items\Renderer" as="bundle" template="email/order/items/invoice/default.phtml"/> diff --git a/app/code/Magento/Bundle/view/frontend/layout/sales_email_order_renderers.xml b/app/code/Magento/Bundle/view/frontend/layout/sales_email_order_renderers.xml index 98f632bc1a08f9f08e52ed7dbf2f1f8b46994367..7cc86f42dd268e8f43e4ae25182fcef88e80078a 100644 --- a/app/code/Magento/Bundle/view/frontend/layout/sales_email_order_renderers.xml +++ b/app/code/Magento/Bundle/view/frontend/layout/sales_email_order_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="sales.email.order.renderers"> <block class="Magento\Bundle\Block\Sales\Order\Items\Renderer" as="bundle" template="email/order/items/order/default.phtml"/> diff --git a/app/code/Magento/Bundle/view/frontend/layout/sales_email_order_shipment_renderers.xml b/app/code/Magento/Bundle/view/frontend/layout/sales_email_order_shipment_renderers.xml index baf583cee2bae7c5307a73d18f3dd532616037a9..173fac5e7e3532537fc422c4693005fc2b75a636 100644 --- a/app/code/Magento/Bundle/view/frontend/layout/sales_email_order_shipment_renderers.xml +++ b/app/code/Magento/Bundle/view/frontend/layout/sales_email_order_shipment_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="sales.email.order.shipment.renderers"> <block class="Magento\Bundle\Block\Sales\Order\Items\Renderer" as="bundle" template="email/order/items/shipment/default.phtml"/> diff --git a/app/code/Magento/Bundle/view/frontend/layout/sales_order_creditmemo_renderers.xml b/app/code/Magento/Bundle/view/frontend/layout/sales_order_creditmemo_renderers.xml index b865635999a3e2cac69afcdb394e58511fb6a51c..ee7005065f058f5e5572555e4d8d9828f532c85d 100644 --- a/app/code/Magento/Bundle/view/frontend/layout/sales_order_creditmemo_renderers.xml +++ b/app/code/Magento/Bundle/view/frontend/layout/sales_order_creditmemo_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="sales.order.creditmemo.renderers"> <block class="Magento\Bundle\Block\Sales\Order\Items\Renderer" as="bundle" template="sales/order/creditmemo/items/renderer.phtml"/> diff --git a/app/code/Magento/Bundle/view/frontend/layout/sales_order_invoice_renderers.xml b/app/code/Magento/Bundle/view/frontend/layout/sales_order_invoice_renderers.xml index 4f743f070d910f9d2893d7f39d8ef84bae6ed2a8..795f4de92fb8457b9b15504ec10add3b8fe18f47 100644 --- a/app/code/Magento/Bundle/view/frontend/layout/sales_order_invoice_renderers.xml +++ b/app/code/Magento/Bundle/view/frontend/layout/sales_order_invoice_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="sales.order.invoice.renderers"> <block class="Magento\Bundle\Block\Sales\Order\Items\Renderer" as="bundle" template="sales/order/invoice/items/renderer.phtml"/> diff --git a/app/code/Magento/Bundle/view/frontend/layout/sales_order_item_renderers.xml b/app/code/Magento/Bundle/view/frontend/layout/sales_order_item_renderers.xml index 29d4974de6c1e6fdae15dc52f010469ec94c69a2..4ac44a8bc09ff50f9704944a63fa0436b038d5bb 100644 --- a/app/code/Magento/Bundle/view/frontend/layout/sales_order_item_renderers.xml +++ b/app/code/Magento/Bundle/view/frontend/layout/sales_order_item_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="sales.order.items.renderers"> <block class="Magento\Bundle\Block\Sales\Order\Items\Renderer" as="bundle" template="sales/order/items/renderer.phtml"/> diff --git a/app/code/Magento/Bundle/view/frontend/layout/sales_order_print_creditmemo_renderers.xml b/app/code/Magento/Bundle/view/frontend/layout/sales_order_print_creditmemo_renderers.xml index 8ba8d5c1d4c369a32716e226c9e9e99675603b88..7f66fa30a789f66649f49e175163d2624419953d 100644 --- a/app/code/Magento/Bundle/view/frontend/layout/sales_order_print_creditmemo_renderers.xml +++ b/app/code/Magento/Bundle/view/frontend/layout/sales_order_print_creditmemo_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="sales.order.print.creditmemo.renderers"> <block class="Magento\Bundle\Block\Sales\Order\Items\Renderer" as="bundle" template="sales/order/creditmemo/items/renderer.phtml"/> diff --git a/app/code/Magento/Bundle/view/frontend/layout/sales_order_print_invoice_renderers.xml b/app/code/Magento/Bundle/view/frontend/layout/sales_order_print_invoice_renderers.xml index 52ec580cbd74e365e4a43784260d693aa062864e..4c3464bf852869da36e82989ecb12771178d48da 100644 --- a/app/code/Magento/Bundle/view/frontend/layout/sales_order_print_invoice_renderers.xml +++ b/app/code/Magento/Bundle/view/frontend/layout/sales_order_print_invoice_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="sales.order.print.invoice.renderers"> <block class="Magento\Bundle\Block\Sales\Order\Items\Renderer" as="bundle" template="sales/order/invoice/items/renderer.phtml"/> diff --git a/app/code/Magento/Bundle/view/frontend/layout/sales_order_print_renderers.xml b/app/code/Magento/Bundle/view/frontend/layout/sales_order_print_renderers.xml index b62e6afdd5fb4011c86a355705e22513fcb63b28..406ccd41d1c86dab45d4b0e22a7fd4f0578d9991 100644 --- a/app/code/Magento/Bundle/view/frontend/layout/sales_order_print_renderers.xml +++ b/app/code/Magento/Bundle/view/frontend/layout/sales_order_print_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="sales.order.print.renderers"> <block class="Magento\Bundle\Block\Sales\Order\Items\Renderer" as="bundle" template="sales/order/items/renderer.phtml"/> diff --git a/app/code/Magento/Bundle/view/frontend/layout/sales_order_print_shipment_renderers.xml b/app/code/Magento/Bundle/view/frontend/layout/sales_order_print_shipment_renderers.xml index 11dccc70c9cce57f57e48e26fccd1d4670a6043c..ef28012d53d5552d9a1919d979c27937a679080a 100644 --- a/app/code/Magento/Bundle/view/frontend/layout/sales_order_print_shipment_renderers.xml +++ b/app/code/Magento/Bundle/view/frontend/layout/sales_order_print_shipment_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="sales.order.print.shipment.renderers"> <block class="Magento\Bundle\Block\Sales\Order\Items\Renderer" as="bundle" template="sales/order/shipment/items/renderer.phtml"/> diff --git a/app/code/Magento/Bundle/view/frontend/layout/sales_order_shipment_renderers.xml b/app/code/Magento/Bundle/view/frontend/layout/sales_order_shipment_renderers.xml index 2792c0dbbee1c8d61f96fbdc3e02c891f725b033..a6b90cd11815490aa14a5be436bc27f398104c72 100644 --- a/app/code/Magento/Bundle/view/frontend/layout/sales_order_shipment_renderers.xml +++ b/app/code/Magento/Bundle/view/frontend/layout/sales_order_shipment_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="sales.order.shipment.renderers"> <block class="Magento\Bundle\Block\Sales\Order\Items\Renderer" as="bundle" template="sales/order/shipment/items/renderer.phtml"/> diff --git a/app/code/Magento/BundleImportExport/composer.json b/app/code/Magento/BundleImportExport/composer.json index 5554045a2b6e5f8e84d80cc21f171f8f2dacd354..cab9e259a7c77c5a96599e2af62986d4434bc66b 100644 --- a/app/code/Magento/BundleImportExport/composer.json +++ b/app/code/Magento/BundleImportExport/composer.json @@ -8,8 +8,7 @@ "magento/module-catalog-import-export": "1.0.0-beta", "magento/module-bundle": "1.0.0-beta", "magento/module-eav": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -17,12 +16,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/BundleImportExport" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\BundleImportExport\\": "" + } } } diff --git a/app/code/Magento/BundleImportExport/etc/di.xml b/app/code/Magento/BundleImportExport/etc/di.xml index f91245bf6ad7510845ffcdcb5f6a322cbc658bc6..13e9d10d034749d97d8b5d6c6eadcf8ab72213a2 100644 --- a/app/code/Magento/BundleImportExport/etc/di.xml +++ b/app/code/Magento/BundleImportExport/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\CatalogImportExport\Model\Export\RowCustomizer\Composite"> <arguments> <argument name="customizers" xsi:type="array"> diff --git a/app/code/Magento/BundleImportExport/etc/export.xml b/app/code/Magento/BundleImportExport/etc/export.xml index 53950ed3b4210307fc3846ce2f9dd63b864fd7e8..ffce4a2fdf68d89577d6de307a05b9e41a1e47f5 100644 --- a/app/code/Magento/BundleImportExport/etc/export.xml +++ b/app/code/Magento/BundleImportExport/etc/export.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../ImportExport/etc/export.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_ImportExport:etc/export.xsd"> <entityType entity="catalog_product" name="bundle" model="Magento\BundleImportExport\Model\Export\Product\Type\Bundle" /> </config> diff --git a/app/code/Magento/BundleImportExport/etc/import.xml b/app/code/Magento/BundleImportExport/etc/import.xml index 551a8bf71c0d0c760f597d9365b0ab261b1b8664..c7cd129225794caa6f44b9c8731bfa4e610fc47e 100644 --- a/app/code/Magento/BundleImportExport/etc/import.xml +++ b/app/code/Magento/BundleImportExport/etc/import.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../ImportExport/etc/import.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_ImportExport:etc/import.xsd"> <entityType entity="catalog_product" name="bundle" model="Magento\BundleImportExport\Model\Import\Product\Type\Bundle" /> </config> diff --git a/app/code/Magento/BundleImportExport/etc/module.xml b/app/code/Magento/BundleImportExport/etc/module.xml index 76f0abbdfe9e0fc9deb584514269d8d7860a2dea..44ef8c5ab7336159b69a8af633e04517d9b3a2bf 100644 --- a/app/code/Magento/BundleImportExport/etc/module.xml +++ b/app/code/Magento/BundleImportExport/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_BundleImportExport" setup_version="2.0.0"> </module> </config> diff --git a/app/code/Magento/BundleImportExport/registration.php b/app/code/Magento/BundleImportExport/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..78aa21fe46130db433c73cdd44f6361a93838355 --- /dev/null +++ b/app/code/Magento/BundleImportExport/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_BundleImportExport', + __DIR__ +); diff --git a/app/code/Magento/CacheInvalidate/Model/PurgeCache.php b/app/code/Magento/CacheInvalidate/Model/PurgeCache.php index 86f1edfd8df54938faf156e2a7becbbed02f9a41..49dc557201ecca35da92c96f06c1f6bb601fe185 100644 --- a/app/code/Magento/CacheInvalidate/Model/PurgeCache.php +++ b/app/code/Magento/CacheInvalidate/Model/PurgeCache.php @@ -5,23 +5,20 @@ */ namespace Magento\CacheInvalidate\Model; -use Symfony\Component\Config\Definition\Exception\Exception; -use Zend\Uri\Uri; -use Zend\Http\Client\Adapter\Socket; use Magento\Framework\Cache\InvalidateLogger; use Magento\Framework\App\DeploymentConfig; -use Magento\Framework\Config\ConfigOptionsListConstants; -use Magento\Framework\App\RequestInterface; class PurgeCache { + const HEADER_X_MAGENTO_TAGS_PATTERN = 'X-Magento-Tags-Pattern'; + /** - * @var UriFactory + * @var \Magento\PageCache\Model\Cache\Server */ - protected $uriFactory; + protected $cacheServer; /** - * @var SocketFactory + * @var \Magento\CacheInvalidate\Model\SocketFactory */ protected $socketAdapterFactory; @@ -30,39 +27,21 @@ class PurgeCache */ private $logger; - /** - * @var DeploymentConfig - */ - private $config; - - /** - * @var RequestInterface - */ - private $request; - - const DEFAULT_PORT = 80; - /** * Constructor * - * @param UriFactory $uriFactory - * @param SocketFactory $socketAdapterFactory + * @param \Magento\PageCache\Model\Cache\Server $cacheServer + * @param \Magento\CacheInvalidate\Model\SocketFactory $socketAdapterFactory * @param InvalidateLogger $logger - * @param Reader $configReader - * @param RequestInterface $request */ public function __construct( - UriFactory $uriFactory, - SocketFactory $socketAdapterFactory, - InvalidateLogger $logger, - DeploymentConfig $config, - RequestInterface $request + \Magento\PageCache\Model\Cache\Server $cacheServer, + \Magento\CacheInvalidate\Model\SocketFactory $socketAdapterFactory, + InvalidateLogger $logger ) { - $this->uriFactory = $uriFactory; + $this->cacheServer = $cacheServer; $this->socketAdapterFactory = $socketAdapterFactory; $this->logger = $logger; - $this->config = $config; - $this->request = $request; } /** @@ -70,35 +49,31 @@ class PurgeCache * to invalidate cache by tags pattern * * @param string $tagsPattern - * @return void + * @return bool Return true if successful; otherwise return false */ public function sendPurgeRequest($tagsPattern) { - $uri = $this->uriFactory->create(); $socketAdapter = $this->socketAdapterFactory->create(); - $servers = $this->config->get(ConfigOptionsListConstants::CONFIG_PATH_CACHE_HOSTS) - ?: [['host' => $this->request->getHttpHost()]]; - $headers = ['X-Magento-Tags-Pattern' => $tagsPattern]; + $servers = $this->cacheServer->getUris(); + $headers = [self::HEADER_X_MAGENTO_TAGS_PATTERN => $tagsPattern]; $socketAdapter->setOptions(['timeout' => 10]); foreach ($servers as $server) { - $port = isset($server['port']) ? $server['port'] : self::DEFAULT_PORT; - $uri->setScheme('http') - ->setHost($server['host']) - ->setPort($port); try { - $socketAdapter->connect($server['host'], $port); + $socketAdapter->connect($server->getHost(), $server->getPort()); $socketAdapter->write( 'PURGE', - $uri, + $server, '1.1', $headers ); $socketAdapter->close(); - } catch (Exception $e) { + } catch (\Exception $e) { $this->logger->critical($e->getMessage(), compact('server', 'tagsPattern')); + return false; } } $this->logger->execute(compact('servers', 'tagsPattern')); + return true; } } diff --git a/app/code/Magento/CacheInvalidate/Model/UriFactory.php b/app/code/Magento/CacheInvalidate/Model/UriFactory.php deleted file mode 100644 index 8e19a15e97d57c561ec92091ae37a4e21bf5e24c..0000000000000000000000000000000000000000 --- a/app/code/Magento/CacheInvalidate/Model/UriFactory.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\CacheInvalidate\Model; - -class UriFactory -{ - - /** - * @return \Zend\Uri\Uri - */ - public function create() - { - return new \Zend\Uri\Uri(); - } -} diff --git a/app/code/Magento/CacheInvalidate/Test/Unit/Model/PurgeCacheTest.php b/app/code/Magento/CacheInvalidate/Test/Unit/Model/PurgeCacheTest.php index 64b7ea446e876daa9cc251a32864e36372a8b040..cd6f2baabac29e2ae5b82166264f166b0de693db 100644 --- a/app/code/Magento/CacheInvalidate/Test/Unit/Model/PurgeCacheTest.php +++ b/app/code/Magento/CacheInvalidate/Test/Unit/Model/PurgeCacheTest.php @@ -5,144 +5,115 @@ */ namespace Magento\CacheInvalidate\Test\Unit\Model; +use \Zend\Uri\UriFactory; + class PurgeCacheTest extends \PHPUnit_Framework_TestCase { - /** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\CacheInvalidate\Model\PurgeCache */ + /** @var \Magento\CacheInvalidate\Model\PurgeCache */ protected $model; - /** @var \PHPUnit_Framework_MockObject_MockObject | \Zend\Uri\Uri */ - protected $uriMock; - /** @var \PHPUnit_Framework_MockObject_MockObject | \Zend\Http\Client\Adapter\Socket */ protected $socketAdapterMock; /** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Framework\Cache\InvalidateLogger */ protected $loggerMock; - /** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Framework\App\DeploymentConfig\Reader */ - protected $configReaderMock; + /** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\PageCache\Model\Cache\Server */ + protected $cacheServer; - /** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Framework\App\RequestInterface */ - protected $requestMock; - - /** - * Set up all mocks and data for test - */ public function setUp() { - $this->uriFactoryMock = $this->getMock('Magento\CacheInvalidate\Model\UriFactory', [], [], '', false); - $this->uriMock = $this->getMock('\Zend\Uri\Uri', [], [], '', false); - $this->socketFactoryMock = $this->getMock('Magento\CacheInvalidate\Model\SocketFactory', [], [], '', false); + $socketFactoryMock = $this->getMock('Magento\CacheInvalidate\Model\SocketFactory', [], [], '', false); $this->socketAdapterMock = $this->getMock('\Zend\Http\Client\Adapter\Socket', [], [], '', false); - $this->configMock = $this->getMock('Magento\Framework\App\DeploymentConfig', [], [], '', false); - $this->loggerMock = $this->getMock('Magento\Framework\Cache\InvalidateLogger', [], [], '', false); - $this->requestMock = $this->getMock('Magento\Framework\App\Request\Http', [], [], '', false); $this->socketAdapterMock->expects($this->once()) ->method('setOptions') ->with(['timeout' => 10]); - $this->uriFactoryMock->expects($this->once()) - ->method('create') - ->willReturn($this->uriMock); - $this->socketFactoryMock->expects($this->once()) + $socketFactoryMock->expects($this->once()) ->method('create') ->willReturn($this->socketAdapterMock); - $this->model = new \Magento\CacheInvalidate\Model\PurgeCache( - $this->uriFactoryMock, - $this->socketFactoryMock, - $this->loggerMock, - $this->configMock, - $this->requestMock + + $this->loggerMock = $this->getMock('Magento\Framework\Cache\InvalidateLogger', [], [], '', false); + $this->cacheServer = $this->getMock('Magento\PageCache\Model\Cache\Server', [], [], '', false); + + $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); + $this->model = $objectManager->getObject( + 'Magento\CacheInvalidate\Model\PurgeCache', + [ + 'cacheServer' => $this->cacheServer, + 'socketAdapterFactory' => $socketFactoryMock, + 'logger' => $this->loggerMock, + ] ); } - public function testSendPurgeRequestEmptyConfig() + /** + * @param string[] $hosts + * @dataProvider sendPurgeRequestDataProvider + */ + public function testSendPurgeRequest($hosts) { - $this->socketAdapterMock->expects($this->once()) - ->method('write') - ->with('PURGE', $this->uriMock, '1.1', $this->equalTo(['X-Magento-Tags-Pattern' => 'tags'])); - $this->socketAdapterMock->expects($this->once()) - ->method('close'); - $this->configMock->expects($this->once()) - ->method('get') - ->willReturn(''); - $this->requestMock->expects($this->any()) - ->method('getHttpHost') - ->willReturn('127.0.0.1'); - $this->uriMock->expects($this->once()) - ->method('setScheme') - ->with('http') - ->willReturnSelf(); - $this->uriMock->expects($this->once()) - ->method('setHost') - ->with('127.0.0.1') - ->willReturnSelf(); - $this->uriMock->expects($this->once()) - ->method('setPort') - ->with(\Magento\CacheInvalidate\Model\PurgeCache::DEFAULT_PORT); - $this->model->sendPurgeRequest('tags'); - } + $uris = []; + foreach ($hosts as $host) { + $port = isset($host['port']) ? $host['port'] : \Magento\PageCache\Model\Cache\Server::DEFAULT_PORT; + $uris[] = UriFactory::factory('')->setHost($host['host']) + ->setPort($port) + ->setScheme('http'); + } + $this->cacheServer->expects($this->once()) + ->method('getUris') + ->willReturn($uris); - public function testSendPurgeRequestOneServer() - { - $this->socketAdapterMock->expects($this->once()) - ->method('write') - ->with('PURGE', $this->uriMock, '1.1', $this->equalTo(['X-Magento-Tags-Pattern' => 'tags'])); - $this->socketAdapterMock->expects($this->once()) + $i = 1; + foreach ($uris as $uri) { + $this->socketAdapterMock->expects($this->at($i++)) + ->method('connect') + ->with($uri->getHost(), $uri->getPort()); + $this->socketAdapterMock->expects($this->at($i++)) + ->method('write') + ->with('PURGE', $uri, '1.1', ['X-Magento-Tags-Pattern' => 'tags']); + $i++; + } + $this->socketAdapterMock->expects($this->exactly(count($uris))) ->method('close'); - $this->configMock->expects($this->once()) - ->method('get') - ->willReturn([['host' => '127.0.0.2', 'port' => 1234]]); - $this->uriMock->expects($this->once()) - ->method('setScheme') - ->with('http') - ->willReturnSelf(); - $this->uriMock->expects($this->once()) - ->method('setHost') - ->with('127.0.0.2') - ->willReturnSelf(); - $this->uriMock->expects($this->once()) - ->method('setPort') - ->with(1234); - $this->model->sendPurgeRequest('tags'); + + $this->loggerMock->expects($this->once()) + ->method('execute'); + + $this->assertTrue($this->model->sendPurgeRequest('tags')); } - public function testSendPurgeRequestMultipleServers() + public function sendPurgeRequestDataProvider() { - $this->socketAdapterMock->expects($this->exactly(2)) - ->method('write') - ->with('PURGE', $this->uriMock, '1.1', $this->equalTo(['X-Magento-Tags-Pattern' => 'tags'])); - $this->socketAdapterMock->expects($this->exactly(2)) - ->method('close'); - $this->configMock->expects($this->once()) - ->method('get') - ->willReturn( + return [ + [ + [['host' => '127.0.0.1', 'port' => 8080],] + ], + [ [ ['host' => '127.0.0.1', 'port' => 8080], - ['host' => '127.0.0.2', 'port' => 1234] + ['host' => '127.0.0.2', 'port' => 1234], + ['host' => 'host'] ] - ); - $this->uriMock->expects($this->at(0)) - ->method('setScheme') - ->with('http') - ->willReturnSelf(); - $this->uriMock->expects($this->at(1)) - ->method('setHost') - ->with('127.0.0.1') - ->willReturnSelf(); - $this->uriMock->expects($this->at(2)) - ->method('setPort') - ->with(8080); - $this->uriMock->expects($this->at(3)) - ->method('setScheme') - ->with('http') - ->willReturnSelf(); - $this->uriMock->expects($this->at(4)) - ->method('setHost') - ->with('127.0.0.2') - ->willReturnSelf(); - $this->uriMock->expects($this->at(5)) - ->method('setPort') - ->with(1234); - $this->model->sendPurgeRequest('tags'); + ] + ]; + } + + public function testSendPurgeRequestWithException() + { + $uris[] = UriFactory::factory('')->setHost('127.0.0.1') + ->setPort(8080) + ->setScheme('http'); + + $this->cacheServer->expects($this->once()) + ->method('getUris') + ->willReturn($uris); + $this->socketAdapterMock->method('connect') + ->willThrowException(new \Zend\Http\Client\Adapter\Exception\RuntimeException()); + $this->loggerMock->expects($this->never()) + ->method('execute'); + $this->loggerMock->expects($this->once()) + ->method('critical'); + + $this->assertFalse($this->model->sendPurgeRequest('tags')); } } diff --git a/app/code/Magento/CacheInvalidate/Test/Unit/Model/UriFactoryTest.php b/app/code/Magento/CacheInvalidate/Test/Unit/Model/UriFactoryTest.php deleted file mode 100644 index 3053d9adbcdd8ac75519801c4aea1c278292120c..0000000000000000000000000000000000000000 --- a/app/code/Magento/CacheInvalidate/Test/Unit/Model/UriFactoryTest.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\CacheInvalidate\Test\Unit\Model; - -class UriFactoryTest extends \PHPUnit_Framework_TestCase -{ - - public function testCreate() - { - $factory = new \Magento\CacheInvalidate\Model\UriFactory(); - $this->assertInstanceOf('\Zend\Uri\Uri', $factory->create()); - } -} diff --git a/app/code/Magento/CacheInvalidate/composer.json b/app/code/Magento/CacheInvalidate/composer.json index 87cca87af67a57f9c6a8dfc15241188782774095..571b05102d96bd45cac69ef7425378323ec205f5 100644 --- a/app/code/Magento/CacheInvalidate/composer.json +++ b/app/code/Magento/CacheInvalidate/composer.json @@ -4,8 +4,7 @@ "require": { "php": "~5.5.0|~5.6.0|~7.0.0", "magento/module-page-cache": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -13,12 +12,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/CacheInvalidate" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\CacheInvalidate\\": "" + } } } diff --git a/app/code/Magento/CacheInvalidate/etc/events.xml b/app/code/Magento/CacheInvalidate/etc/events.xml index 014368a767fb2dfff28864d631ce36f8b899cf16..ff1a55ff609a9801e0cbe5eb0ce3f5c0ea3acffd 100644 --- a/app/code/Magento/CacheInvalidate/etc/events.xml +++ b/app/code/Magento/CacheInvalidate/etc/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="clean_cache_by_tags"> <observer name="invalidate_varnish" instance="Magento\CacheInvalidate\Observer\InvalidateVarnishObserver" method="execute"/> </event> diff --git a/app/code/Magento/CacheInvalidate/etc/module.xml b/app/code/Magento/CacheInvalidate/etc/module.xml index ca87df877a43a93eb2be450fa10b0013d099eff9..6318f1166ede912a0562c363eba18a3222a3f2f8 100644 --- a/app/code/Magento/CacheInvalidate/etc/module.xml +++ b/app/code/Magento/CacheInvalidate/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_CacheInvalidate" setup_version="2.0.0"> <sequence> <module name="Magento_Store"/> diff --git a/app/code/Magento/CacheInvalidate/registration.php b/app/code/Magento/CacheInvalidate/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..222f5fba1c1106af60ec18f642dd3d221b3eb4b1 --- /dev/null +++ b/app/code/Magento/CacheInvalidate/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_CacheInvalidate', + __DIR__ +); diff --git a/app/code/Magento/Captcha/composer.json b/app/code/Magento/Captcha/composer.json index 3d395345b7c727e49ed99a9ecc374366e72c2f57..5c00e24023b280ea282244f8af6cfaf99e4d82dd 100644 --- a/app/code/Magento/Captcha/composer.json +++ b/app/code/Magento/Captcha/composer.json @@ -7,8 +7,7 @@ "magento/module-customer": "1.0.0-beta", "magento/module-checkout": "1.0.0-beta", "magento/module-backend": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -16,12 +15,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Captcha" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Captcha\\": "" + } } } diff --git a/app/code/Magento/Captcha/etc/adminhtml/di.xml b/app/code/Magento/Captcha/etc/adminhtml/di.xml index 22119c80cdb99c77c2dc03e614162b107545093a..13b04bf73a324b856788890d1e05c8de9bd1a959 100644 --- a/app/code/Magento/Captcha/etc/adminhtml/di.xml +++ b/app/code/Magento/Captcha/etc/adminhtml/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Captcha\Block\Captcha\DefaultCaptcha" type="Magento\Captcha\Block\Adminhtml\Captcha\DefaultCaptcha" /> <type name="Magento\Captcha\Model\DefaultModel"> <arguments> diff --git a/app/code/Magento/Captcha/etc/adminhtml/events.xml b/app/code/Magento/Captcha/etc/adminhtml/events.xml index 6fd36d3ae3a6020b9e38a77245dcba2ba12c5bea..5a64fcb0125f055b5d1691b4288b605d0344fee0 100644 --- a/app/code/Magento/Captcha/etc/adminhtml/events.xml +++ b/app/code/Magento/Captcha/etc/adminhtml/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="controller_action_predispatch_adminhtml_auth_forgotpassword"> <observer name="captcha" instance="Magento\Captcha\Observer\CheckUserForgotPasswordBackendObserver" method="execute" /> </event> diff --git a/app/code/Magento/Captcha/etc/adminhtml/routes.xml b/app/code/Magento/Captcha/etc/adminhtml/routes.xml index abb5f6be6307755d1c4d2f434a3c244b147a7adb..7fcddacd3ed66d8ccc172b8c33f90396172ed393 100644 --- a/app/code/Magento/Captcha/etc/adminhtml/routes.xml +++ b/app/code/Magento/Captcha/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="admin"> <route id="adminhtml"> <module name="Magento_Captcha" /> diff --git a/app/code/Magento/Captcha/etc/adminhtml/system.xml b/app/code/Magento/Captcha/etc/adminhtml/system.xml index d1777164dc91644cc64ae91c4e06f1017ac9c92d..3af3236755fb7120744b41abdc2a6c250c85c4bb 100644 --- a/app/code/Magento/Captcha/etc/adminhtml/system.xml +++ b/app/code/Magento/Captcha/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="admin"> <group id="captcha" translate="label" type="text" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="0"> diff --git a/app/code/Magento/Captcha/etc/config.xml b/app/code/Magento/Captcha/etc/config.xml index acb9a76cdbfcdd35a11efa0ed0e6e42a2c402305..342819294bca554af688c8e246a610fffbe87dd8 100644 --- a/app/code/Magento/Captcha/etc/config.xml +++ b/app/code/Magento/Captcha/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <system> <media_storage_configuration> diff --git a/app/code/Magento/Captcha/etc/crontab.xml b/app/code/Magento/Captcha/etc/crontab.xml index 06948c15f93fd581aac891569e3a56b8a6761537..d6afbadffc17d62a89446848b0cc19e92ddadd2d 100644 --- a/app/code/Magento/Captcha/etc/crontab.xml +++ b/app/code/Magento/Captcha/etc/crontab.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Cron/etc/crontab.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd"> <group id="default"> <job name="captcha_delete_old_attempts" instance="Magento\Captcha\Cron\DeleteOldAttempts" method="execute"> <schedule>*/30 * * * *</schedule> diff --git a/app/code/Magento/Captcha/etc/crontab/di.xml b/app/code/Magento/Captcha/etc/crontab/di.xml index 07673b7f1ff6924eaa48959c88f4bdbc70fa667f..e11e041d664ef19ea8ec3a5533fe80c21cb2956a 100644 --- a/app/code/Magento/Captcha/etc/crontab/di.xml +++ b/app/code/Magento/Captcha/etc/crontab/di.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Backend\App\ConfigInterface" type="Magento\Backend\App\Config" /> </config> diff --git a/app/code/Magento/Captcha/etc/di.xml b/app/code/Magento/Captcha/etc/di.xml index e3c4ac427935c0784fa9381bd7eaa62735fc1d28..1d309aa06b27cb557eb4741867c7fc76ccf7fd3c 100644 --- a/app/code/Magento/Captcha/etc/di.xml +++ b/app/code/Magento/Captcha/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Captcha\Model\DefaultModel"> <arguments> <argument name="session" xsi:type="object">Magento\Customer\Model\Session</argument> diff --git a/app/code/Magento/Captcha/etc/events.xml b/app/code/Magento/Captcha/etc/events.xml index daa5eef7a6c348ea8a022ec9825e409f892576c3..76e183742da5c2f36693a770b80f68a3726867d7 100644 --- a/app/code/Magento/Captcha/etc/events.xml +++ b/app/code/Magento/Captcha/etc/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="controller_action_predispatch_customer_account_loginPost"> <observer name="captcha" instance="Magento\Captcha\Observer\CheckUserLoginObserver" method="execute" /> </event> diff --git a/app/code/Magento/Captcha/etc/frontend/di.xml b/app/code/Magento/Captcha/etc/frontend/di.xml index a768ffac2f67e372ed36af36133105b7ca909f54..638e020754bd93d681482895b76ff2d7eed2b98e 100644 --- a/app/code/Magento/Captcha/etc/frontend/di.xml +++ b/app/code/Magento/Captcha/etc/frontend/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Checkout\Model\CompositeConfigProvider"> <arguments> <argument name="configProviders" xsi:type="array"> diff --git a/app/code/Magento/Captcha/etc/frontend/events.xml b/app/code/Magento/Captcha/etc/frontend/events.xml index 8d454b9844ad0b93b15e0c778c35cfb8f4226dce..7948d0932628c8bc70618aa4cc6e23da1f81be15 100644 --- a/app/code/Magento/Captcha/etc/frontend/events.xml +++ b/app/code/Magento/Captcha/etc/frontend/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="controller_action_predispatch_contact_index_post"> <observer name="captcha_contact_us_form" instance="Magento\Captcha\Observer\CheckContactUsFormObserver" method="execute" /> </event> diff --git a/app/code/Magento/Captcha/etc/frontend/routes.xml b/app/code/Magento/Captcha/etc/frontend/routes.xml index 8731f05e493e8f647bb4c9c234eeed3087a5b35a..74a73fe33b22874461974ac0553b044f0ff2a89a 100644 --- a/app/code/Magento/Captcha/etc/frontend/routes.xml +++ b/app/code/Magento/Captcha/etc/frontend/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="standard"> <route id="captcha" frontName="captcha"> <module name="Magento_Captcha" /> diff --git a/app/code/Magento/Captcha/etc/module.xml b/app/code/Magento/Captcha/etc/module.xml index c12f90813ab7a9a86d231ec5c1baf7d6cddb61ab..2fffd6e4f53a9a842acc8b186405f289e16ce37e 100644 --- a/app/code/Magento/Captcha/etc/module.xml +++ b/app/code/Magento/Captcha/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Captcha" setup_version="2.0.0"> <sequence> <module name="Magento_Customer"/> diff --git a/app/code/Magento/Captcha/registration.php b/app/code/Magento/Captcha/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..856e7b4979d1d3807e1026587238e38c4a274dba --- /dev/null +++ b/app/code/Magento/Captcha/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Captcha', + __DIR__ +); diff --git a/app/code/Magento/Captcha/view/adminhtml/layout/adminhtml_auth_forgotpassword.xml b/app/code/Magento/Captcha/view/adminhtml/layout/adminhtml_auth_forgotpassword.xml index 5cc7cc6d1c95865d2f46e3491b1371bb5c26a9a1..814e34118e60204d4da89c6745732bc786210c4a 100644 --- a/app/code/Magento/Captcha/view/adminhtml/layout/adminhtml_auth_forgotpassword.xml +++ b/app/code/Magento/Captcha/view/adminhtml/layout/adminhtml_auth_forgotpassword.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="form.additional.info"> <block class="Magento\Captcha\Block\Captcha" name="captcha"> diff --git a/app/code/Magento/Captcha/view/adminhtml/layout/adminhtml_auth_login.xml b/app/code/Magento/Captcha/view/adminhtml/layout/adminhtml_auth_login.xml index 75cd02e5b99877e059b25e15e9ea259b8a6197d7..8dddd9130e02a1102c9f3abea3487c255b416e31 100644 --- a/app/code/Magento/Captcha/view/adminhtml/layout/adminhtml_auth_login.xml +++ b/app/code/Magento/Captcha/view/adminhtml/layout/adminhtml_auth_login.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="form.additional.info"> <block class="Magento\Captcha\Block\Captcha" name="captcha"> diff --git a/app/code/Magento/Captcha/view/frontend/layout/checkout_index_index.xml b/app/code/Magento/Captcha/view/frontend/layout/checkout_index_index.xml index d7d6fc551c5ff3f777effb8a6cf3b573c60113a1..048c8a05b2e6a335a07b58065e9310bd6be2c528 100644 --- a/app/code/Magento/Captcha/view/frontend/layout/checkout_index_index.xml +++ b/app/code/Magento/Captcha/view/frontend/layout/checkout_index_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout.root"> <arguments> diff --git a/app/code/Magento/Captcha/view/frontend/layout/contact_index_index.xml b/app/code/Magento/Captcha/view/frontend/layout/contact_index_index.xml index 38c3c0431352dc833b941f113d00b87758a6c676..033e87a4f09db051a2f0b23379ddee95ccb57c14 100644 --- a/app/code/Magento/Captcha/view/frontend/layout/contact_index_index.xml +++ b/app/code/Magento/Captcha/view/frontend/layout/contact_index_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="form.additional.info"> <block class="Magento\Captcha\Block\Captcha" name="captcha" after="-"> diff --git a/app/code/Magento/Captcha/view/frontend/layout/customer_account_create.xml b/app/code/Magento/Captcha/view/frontend/layout/customer_account_create.xml index 1696cfec0ae061e6eabb551e5ea2f24fae13bd14..dd1362958e04be38e8cd79800701ef6cb7440d4a 100644 --- a/app/code/Magento/Captcha/view/frontend/layout/customer_account_create.xml +++ b/app/code/Magento/Captcha/view/frontend/layout/customer_account_create.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="form.additional.info"> <block class="Magento\Captcha\Block\Captcha" name="captcha" after="-"> diff --git a/app/code/Magento/Captcha/view/frontend/layout/customer_account_forgotpassword.xml b/app/code/Magento/Captcha/view/frontend/layout/customer_account_forgotpassword.xml index b60de8c8a81dd11a78b07a504df2d96a54376df2..0462a785b60e69b11fdf00d76229861116ba4a35 100644 --- a/app/code/Magento/Captcha/view/frontend/layout/customer_account_forgotpassword.xml +++ b/app/code/Magento/Captcha/view/frontend/layout/customer_account_forgotpassword.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="form.additional.info"> <block class="Magento\Captcha\Block\Captcha" name="captcha" after="-"> diff --git a/app/code/Magento/Captcha/view/frontend/layout/customer_account_login.xml b/app/code/Magento/Captcha/view/frontend/layout/customer_account_login.xml index 0a9091219cf4ae6aef0ac4055d585519324d53f5..9d9278304d38d1b061a49f93bd949c91e9af53e4 100644 --- a/app/code/Magento/Captcha/view/frontend/layout/customer_account_login.xml +++ b/app/code/Magento/Captcha/view/frontend/layout/customer_account_login.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="form.additional.info"> <block class="Magento\Captcha\Block\Captcha" name="captcha" after="-"> diff --git a/app/code/Magento/Captcha/view/frontend/layout/default.xml b/app/code/Magento/Captcha/view/frontend/layout/default.xml index 873ac2607c2a81349a2ef571d5713d113d2a3214..18700e24e7e50c7bd819b05d5036581397051952 100644 --- a/app/code/Magento/Captcha/view/frontend/layout/default.xml +++ b/app/code/Magento/Captcha/view/frontend/layout/default.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="authentication-popup"> <arguments> diff --git a/app/code/Magento/Catalog/Api/Data/CustomOptionInterface.php b/app/code/Magento/Catalog/Api/Data/CustomOptionInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..58a986b246f925ba558496813f4ac9309bee4f4e --- /dev/null +++ b/app/code/Magento/Catalog/Api/Data/CustomOptionInterface.php @@ -0,0 +1,67 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Catalog\Api\Data; + +/** + * Interface CustomOptionInterface + * @api + */ +interface CustomOptionInterface extends \Magento\Framework\Api\ExtensibleDataInterface +{ + /**#@+ + * Constants + */ + const OPTION_ID = 'option_id'; + const OPTION_VALUE = 'option_value'; + /**#@-*/ + + /** + * Get option id + * + * @return string + */ + public function getOptionId(); + + /** + * Set option id + * + * @param string $value + * @return bool + */ + public function setOptionId($value); + + /** + * Get option value + * + * @return string + */ + public function getOptionValue(); + + /** + * Set option value + * + * @param string $value + * @return bool + */ + public function setOptionValue($value); + + /** + * Retrieve existing extension attributes object or create a new one. + * + * @return \Magento\Catalog\Api\Data\CustomOptionExtensionInterface|null + */ + public function getExtensionAttributes(); + + /** + * Set an extension attributes object. + * + * @param \Magento\Catalog\Api\Data\CustomOptionExtensionInterface|null $extensionAttributes + * @return $this + */ + public function setExtensionAttributes( + \Magento\Catalog\Api\Data\CustomOptionExtensionInterface $extensionAttributes + ); +} diff --git a/app/code/Magento/Catalog/Api/Data/ProductOptionInterface.php b/app/code/Magento/Catalog/Api/Data/ProductOptionInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..cbf2cb99f7513f2cb02d4e233b5ffb4aff984983 --- /dev/null +++ b/app/code/Magento/Catalog/Api/Data/ProductOptionInterface.php @@ -0,0 +1,31 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Catalog\Api\Data; + +use Magento\Framework\Api\ExtensibleDataInterface; + +/** + * Product option interface + */ +interface ProductOptionInterface extends ExtensibleDataInterface +{ + /** + * Retrieve existing extension attributes object or create a new one. + * + * @return \Magento\Catalog\Api\Data\ProductOptionExtensionInterface|null + */ + public function getExtensionAttributes(); + + /** + * Set an extension attributes object. + * + * @param \Magento\Catalog\Api\Data\ProductOptionExtensionInterface $extensionAttributes + * @return $this + */ + public function setExtensionAttributes( + \Magento\Catalog\Api\Data\ProductOptionExtensionInterface $extensionAttributes + ); +} 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 26491d6934760197d63d73ec0cf92fa76830287c..15807366d1970de51fe37b72e6b2b97419c135e4 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Category/Edit/Form.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Category/Edit/Form.php @@ -142,7 +142,6 @@ class Form extends \Magento\Catalog\Block\Adminhtml\Category\AbstractCategory /** * @return string - * @deprecated (MAGETWO-31464) */ public function getDeleteButtonHtml() { @@ -151,7 +150,6 @@ class Form extends \Magento\Catalog\Block\Adminhtml\Category\AbstractCategory /** * @return string - * @deprecated (MAGETWO-31464) */ public function getSaveButtonHtml() { @@ -163,7 +161,6 @@ class Form extends \Magento\Catalog\Block\Adminhtml\Category\AbstractCategory /** * @return string - * @deprecated (MAGETWO-31464) */ public function getResetButtonHtml() { diff --git a/app/code/Magento/Catalog/Model/Attribute/Config/SchemaLocator.php b/app/code/Magento/Catalog/Model/Attribute/Config/SchemaLocator.php index 82112a9ede0321eb589b24d3898e113311389d15..2adfc3b0ffcb109dd107ac98493039d08ae366f5 100644 --- a/app/code/Magento/Catalog/Model/Attribute/Config/SchemaLocator.php +++ b/app/code/Magento/Catalog/Model/Attribute/Config/SchemaLocator.php @@ -7,6 +7,8 @@ */ namespace Magento\Catalog\Model\Attribute\Config; +use Magento\Framework\Module\Dir; + class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface { /** @@ -21,7 +23,8 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface */ public function __construct(\Magento\Framework\Module\Dir\Reader $moduleReader) { - $this->_schema = $moduleReader->getModuleDir('etc', 'Magento_Catalog') . '/catalog_attributes.xsd'; + $this->_schema = $moduleReader->getModuleDir(Dir::MODULE_ETC_DIR, 'Magento_Catalog') + . '/catalog_attributes.xsd'; } /** diff --git a/app/code/Magento/Catalog/Model/CustomOptions/CustomOption.php b/app/code/Magento/Catalog/Model/CustomOptions/CustomOption.php new file mode 100644 index 0000000000000000000000000000000000000000..02a59140493bbb7be8e1649991cb09f918c9cf38 --- /dev/null +++ b/app/code/Magento/Catalog/Model/CustomOptions/CustomOption.php @@ -0,0 +1,110 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Catalog\Model\CustomOptions; + +use Magento\Framework\Model\AbstractExtensibleModel; +use Magento\Catalog\Api\Data\CustomOptionInterface; +use Magento\Framework\Api\AttributeValueFactory; +use Magento\Framework\Model\Context; +use Magento\Framework\Registry; +use Magento\Framework\Api\ExtensionAttributesFactory; +use Magento\Framework\Model\Resource\AbstractResource; +use Magento\Framework\Data\Collection\AbstractDb; +use Magento\Catalog\Model\Webapi\Product\Option\Type\File\Processor as FileProcessor; + +class CustomOption extends AbstractExtensibleModel implements CustomOptionInterface +{ + /** + * @param Context $context + * @param Registry $registry + * @param ExtensionAttributesFactory $extensionFactory + * @param AttributeValueFactory $customAttributeFactory + * @param AbstractResource|null $resource + * @param AbstractDb|null $resourceCollection + * @param FileProcessor $fileProcessor + * @param array $data + */ + public function __construct( + Context $context, + Registry $registry, + ExtensionAttributesFactory $extensionFactory, + AttributeValueFactory $customAttributeFactory, + FileProcessor $fileProcessor, + AbstractResource $resource = null, + AbstractDb $resourceCollection = null, + array $data = [] + ) { + $this->fileProcessor = $fileProcessor; + parent::__construct( + $context, + $registry, + $extensionFactory, + $customAttributeFactory, + $resource, + $resourceCollection, + $data + ); + } + + /** + * @inheritDoc + */ + public function getOptionId() + { + return $this->getData(self::OPTION_ID); + } + + /** + * @inheritDoc + */ + public function setOptionId($value) + { + return $this->setData(self::OPTION_ID, $value); + } + + /** + * @inheritDoc + */ + public function getOptionValue() + { + $value = $this->getData(self::OPTION_VALUE); + if ($value == 'file') { + /** @var \Magento\Framework\Api\Data\ImageContentInterface $fileInfo */ + $imageContent = $this->getExtensionAttributes() + ? $this->getExtensionAttributes()->getFileInfo() + : null; + if ($imageContent) { + $value = $this->fileProcessor->processFileContent($imageContent); + } + } + return $value; + } + + /** + * @inheritDoc + */ + public function setOptionValue($value) + { + return $this->setData(self::OPTION_VALUE, $value); + } + + /** + * @inheritDoc + */ + public function getExtensionAttributes() + { + return $this->_getExtensionAttributes(); + } + + /** + * @inheritDoc + */ + public function setExtensionAttributes( + \Magento\Catalog\Api\Data\CustomOptionExtensionInterface $extensionAttributes + ) { + return $this->_setExtensionAttributes($extensionAttributes); + } +} diff --git a/app/code/Magento/Catalog/Model/CustomOptions/CustomOptionProcessor.php b/app/code/Magento/Catalog/Model/CustomOptions/CustomOptionProcessor.php new file mode 100644 index 0000000000000000000000000000000000000000..a8edb4dd4e7cb3f20354acc325198d4c43f65a95 --- /dev/null +++ b/app/code/Magento/Catalog/Model/CustomOptions/CustomOptionProcessor.php @@ -0,0 +1,126 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Catalog\Model\CustomOptions; + +use Magento\Framework\DataObject; +use Magento\Quote\Api\Data\CartItemInterface; +use Magento\Quote\Model\Quote\Item\CartItemProcessorInterface; +use Magento\Quote\Api\Data\ProductOptionExtensionFactory; +use Magento\Quote\Model\Quote\ProductOptionFactory; + +class CustomOptionProcessor implements CartItemProcessorInterface +{ + /** @var DataObject\Factory */ + protected $objectFactory; + + /** @var \Magento\Quote\Model\Quote\ProductOptionFactory */ + protected $productOptionFactory; + + /** @var \Magento\Quote\Api\Data\ProductOptionExtensionFactory */ + protected $extensionFactory; + + /** @var CustomOptionFactory */ + protected $customOptionFactory; + + /** + * @param DataObject\Factory $objectFactory + * @param ProductOptionFactory $productOptionFactory + * @param ProductOptionExtensionFactory $extensionFactory + * @param CustomOptionFactory $customOptionFactory + */ + public function __construct( + \Magento\Framework\DataObject\Factory $objectFactory, + \Magento\Quote\Model\Quote\ProductOptionFactory $productOptionFactory, + \Magento\Quote\Api\Data\ProductOptionExtensionFactory $extensionFactory, + \Magento\Catalog\Model\CustomOptions\CustomOptionFactory $customOptionFactory + ) { + $this->objectFactory = $objectFactory; + $this->productOptionFactory = $productOptionFactory; + $this->extensionFactory = $extensionFactory; + $this->customOptionFactory = $customOptionFactory; + } + + /** + * @inheritDoc + */ + public function convertToBuyRequest(CartItemInterface $cartItem) + { + if ($cartItem->getProductOption() + && $cartItem->getProductOption()->getExtensionAttributes() + && $cartItem->getProductOption()->getExtensionAttributes()->getCustomOptions()) { + $customOptions = $cartItem->getProductOption()->getExtensionAttributes()->getCustomOptions(); + if (!empty($customOptions) && is_array($customOptions)) { + $requestData = []; + foreach ($customOptions as $option) { + $requestData['options'][$option->getOptionId()] = $option->getOptionValue(); + } + return $this->objectFactory->create($requestData); + } + } + return null; + } + + + /** + * @inheritDoc + */ + public function processOptions(CartItemInterface $cartItem) + { + $options = $this->getOptions($cartItem); + if (!empty($options) && is_array($options)) { + $this->updateOptionsValues($options); + $productOption = $cartItem->getProductOption() + ? $cartItem->getProductOption() + : $this->productOptionFactory->create(); + + /** @var \Magento\Quote\Api\Data\ProductOptionExtensionInterface $extensibleAttribute */ + $extensibleAttribute = $productOption->getExtensionAttributes() + ? $productOption->getExtensionAttributes() + : $this->extensionFactory->create(); + + $extensibleAttribute->setCustomOptions($options); + $productOption->setExtensionAttributes($extensibleAttribute); + $cartItem->setProductOption($productOption); + } + return $cartItem; + } + + /** + * Receive custom option from buy request + * + * @param CartItemInterface $cartItem + * @return array + */ + protected function getOptions(CartItemInterface $cartItem) + { + $buyRequest = !empty($cartItem->getOptionByCode('info_buyRequest')) + ? unserialize($cartItem->getOptionByCode('info_buyRequest')->getValue()) + : null; + return is_array($buyRequest) && isset($buyRequest['options']) + ? $buyRequest['options'] + : []; + } + + /** + * Update options values + * + * @param array $options + * @return null + */ + protected function updateOptionsValues(array &$options) + { + foreach ($options as $optionId => &$optionValue) { + /** @var \Magento\Catalog\Model\CustomOptions\CustomOption $option */ + $option = $this->customOptionFactory->create(); + $option->setOptionId($optionId); + if (is_array($optionValue)) { + $optionValue = implode(',', $optionValue); + } + $option->setOptionValue($optionValue); + $optionValue = $option; + } + } +} diff --git a/app/code/Magento/Catalog/Model/Product.php b/app/code/Magento/Catalog/Model/Product.php index c571d1e0b4e1a67c5978d58489943524d53392be..b45e8f8ff564043e1a765c6c879866f399ec29a8 100644 --- a/app/code/Magento/Catalog/Model/Product.php +++ b/app/code/Magento/Catalog/Model/Product.php @@ -1089,7 +1089,6 @@ class Product extends \Magento\Catalog\Model\AbstractModel implements * * @param float $qty * @return float|array - * @deprecated (MAGETWO-31465) */ public function getTierPrice($qty = null) { diff --git a/app/code/Magento/Catalog/Model/Product/Type/Price.php b/app/code/Magento/Catalog/Model/Product/Type/Price.php index 3ae0481599236e88586287f9b43f36f4f3a265d1..102b2d80dbcb1c7452ce7807ef7ec7168a6157f1 100644 --- a/app/code/Magento/Catalog/Model/Product/Type/Price.php +++ b/app/code/Magento/Catalog/Model/Product/Type/Price.php @@ -254,7 +254,6 @@ class Price * @param float $qty * @param Product $product * @return float|array - * @deprecated (MAGETWO-31465) * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.NPathComplexity) */ @@ -438,7 +437,6 @@ class Price * * @param Product $product * @return int - * @deprecated */ public function getTierPriceCount($product) { @@ -452,7 +450,6 @@ class Price * @param float $qty * @param Product $product * @return array|float - * @deprecated */ public function getFormatedTierPrice($qty, $product) { @@ -488,7 +485,6 @@ class Price * @param int $qty * @param float $finalPrice * @return float - * @deprecated (MAGETWO-31469) * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ protected function _applyOptionsPrice($product, $qty, $finalPrice) diff --git a/app/code/Magento/Catalog/Model/ProductOption.php b/app/code/Magento/Catalog/Model/ProductOption.php new file mode 100644 index 0000000000000000000000000000000000000000..4ab04f67bbcaf6d7f9380df7a4336b96043b30e4 --- /dev/null +++ b/app/code/Magento/Catalog/Model/ProductOption.php @@ -0,0 +1,29 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Catalog\Model; + +use Magento\Catalog\Api\Data\ProductOptionInterface; +use Magento\Framework\Model\AbstractExtensibleModel; + +class ProductOption extends AbstractExtensibleModel implements ProductOptionInterface +{ + /** + * {@inheritdoc} + */ + public function getExtensionAttributes() + { + return $this->_getExtensionAttributes(); + } + + /** + * {@inheritdoc} + */ + public function setExtensionAttributes( + \Magento\Catalog\Api\Data\ProductOptionExtensionInterface $extensionAttributes + ) { + return $this->_setExtensionAttributes($extensionAttributes); + } +} diff --git a/app/code/Magento/Catalog/Model/ProductOptionProcessor.php b/app/code/Magento/Catalog/Model/ProductOptionProcessor.php new file mode 100644 index 0000000000000000000000000000000000000000..9f46d4504a6fe33bf9a569512527f9f1b152b04f --- /dev/null +++ b/app/code/Magento/Catalog/Model/ProductOptionProcessor.php @@ -0,0 +1,101 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Catalog\Model; + +use Magento\Catalog\Api\Data\ProductOptionExtensionFactory; +use Magento\Catalog\Api\Data\ProductOptionInterface; +use Magento\Catalog\Model\CustomOptions\CustomOption; +use Magento\Catalog\Model\CustomOptions\CustomOptionFactory; +use Magento\Framework\DataObject; +use Magento\Framework\DataObject\Factory as DataObjectFactory; + +class ProductOptionProcessor implements ProductOptionProcessorInterface +{ + /** + * @var DataObjectFactory + */ + protected $objectFactory; + + /** + * @var CustomOptionFactory + */ + protected $customOptionFactory; + + /** + * @param DataObjectFactory $objectFactory + * @param CustomOptionFactory $customOptionFactory + */ + public function __construct( + DataObjectFactory $objectFactory, + CustomOptionFactory $customOptionFactory + ) { + $this->objectFactory = $objectFactory; + $this->customOptionFactory = $customOptionFactory; + } + + /** + * @inheritDoc + */ + public function convertToBuyRequest(ProductOptionInterface $productOption) + { + /** @var DataObject $request */ + $request = $this->objectFactory->create(); + + $options = $this->getCustomOptions($productOption); + if (!empty($options)) { + $requestData = []; + foreach ($options as $option) { + $requestData['options'][$option->getOptionId()] = $option->getOptionValue(); + } + $request->addData($requestData); + } + + return $request; + } + + /** + * Retrieve custom options + * + * @param ProductOptionInterface $productOption + * @return array + */ + protected function getCustomOptions(ProductOptionInterface $productOption) + { + if ($productOption + && $productOption->getExtensionAttributes() + && $productOption->getExtensionAttributes()->getCustomOptions() + ) { + return $productOption->getExtensionAttributes() + ->getCustomOptions(); + } + return []; + } + + /** + * @inheritDoc + */ + public function convertToProductOption(DataObject $request) + { + $options = $request->getOptions(); + if (!empty($options) && is_array($options)) { + $data = []; + foreach ($options as $optionId => $optionValue) { + if (is_array($optionValue)) { + $optionValue = implode(',', $optionValue); + } + + /** @var CustomOption $option */ + $option = $this->customOptionFactory->create(); + $option->setOptionId($optionId)->setOptionValue($optionValue); + $data[] = $option; + } + + return ['custom_options' => $data]; + } + + return []; + } +} diff --git a/app/code/Magento/Catalog/Model/ProductOptionProcessorInterface.php b/app/code/Magento/Catalog/Model/ProductOptionProcessorInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..26fb25d097486dbf39abffb98a406860beb38cee --- /dev/null +++ b/app/code/Magento/Catalog/Model/ProductOptionProcessorInterface.php @@ -0,0 +1,28 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Catalog\Model; + +use Magento\Catalog\Api\Data\ProductOptionInterface; +use Magento\Framework\DataObject; + +interface ProductOptionProcessorInterface +{ + /** + * Convert product option data to buy request data + * + * @param ProductOptionInterface $productOption + * @return DataObject + */ + public function convertToBuyRequest(ProductOptionInterface $productOption); + + /** + * Convert buy request data to product option data + * + * @param DataObject $request + * @return array + */ + public function convertToProductOption(DataObject $request); +} diff --git a/app/code/Magento/Catalog/Model/ProductOptions/Config/SchemaLocator.php b/app/code/Magento/Catalog/Model/ProductOptions/Config/SchemaLocator.php index 5ef58cdc7b93dcd3e389341ae4377fc967c86bcb..e22200936b5fd76aa6edc7383340dc8814900234 100644 --- a/app/code/Magento/Catalog/Model/ProductOptions/Config/SchemaLocator.php +++ b/app/code/Magento/Catalog/Model/ProductOptions/Config/SchemaLocator.php @@ -5,6 +5,8 @@ */ namespace Magento\Catalog\Model\ProductOptions\Config; +use Magento\Framework\Module\Dir; + class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface { /** @@ -26,7 +28,7 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface */ public function __construct(\Magento\Framework\Module\Dir\Reader $moduleReader) { - $etcDir = $moduleReader->getModuleDir('etc', 'Magento_Catalog'); + $etcDir = $moduleReader->getModuleDir(Dir::MODULE_ETC_DIR, 'Magento_Catalog'); $this->_schema = $etcDir . '/product_options_merged.xsd'; $this->_perFileSchema = $etcDir . '/product_options.xsd'; } diff --git a/app/code/Magento/Catalog/Model/ProductTypes/Config/SchemaLocator.php b/app/code/Magento/Catalog/Model/ProductTypes/Config/SchemaLocator.php index 7e46ca3d4ef5e270bdc6032dc8ac0230a702eaea..61d1777dbfceda1a27eb595c5255c3c3ff4c673d 100644 --- a/app/code/Magento/Catalog/Model/ProductTypes/Config/SchemaLocator.php +++ b/app/code/Magento/Catalog/Model/ProductTypes/Config/SchemaLocator.php @@ -5,6 +5,8 @@ */ namespace Magento\Catalog\Model\ProductTypes\Config; +use Magento\Framework\Module\Dir; + class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface { /** @@ -26,7 +28,7 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface */ public function __construct(\Magento\Framework\Module\Dir\Reader $moduleReader) { - $etcDir = $moduleReader->getModuleDir('etc', 'Magento_Catalog'); + $etcDir = $moduleReader->getModuleDir(Dir::MODULE_ETC_DIR, 'Magento_Catalog'); $this->_schema = $etcDir . '/product_types_merged.xsd'; $this->_perFileSchema = $etcDir . '/product_types.xsd'; } diff --git a/app/code/Magento/Catalog/Model/Webapi/Product/Option/Type/Date.php b/app/code/Magento/Catalog/Model/Webapi/Product/Option/Type/Date.php new file mode 100644 index 0000000000000000000000000000000000000000..779ed277e0699420e08df09b5e5f78093d0684a1 --- /dev/null +++ b/app/code/Magento/Catalog/Model/Webapi/Product/Option/Type/Date.php @@ -0,0 +1,343 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Catalog\Model\Webapi\Product\Option\Type; + +use Magento\Framework\Stdlib\DateTime; + +/** + * Catalog product option date validator + */ +class Date extends \Magento\Catalog\Model\Product\Option\Type\DefaultType +{ + /** + * @var string + */ + protected $_formattedOptionValue = null; + + /** + * @var \Magento\Framework\Stdlib\DateTime\TimezoneInterface + */ + protected $_localeDate; + + /** + * @param \Magento\Checkout\Model\Session $checkoutSession + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate + * @param array $data + */ + public function __construct( + \Magento\Checkout\Model\Session $checkoutSession, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, + array $data = [] + ) { + $this->_localeDate = $localeDate; + parent::__construct($checkoutSession, $scopeConfig, $data); + } + + /** + * Validate user input for option + * + * @param array $values All product option values, i.e. array (option_id => mixed, option_id => mixed...) + * @return $this + * @throws \Magento\Framework\Exception\LocalizedException + * @SuppressWarnings(PHPMD.CyclomaticComplexity) + * @SuppressWarnings(PHPMD.NPathComplexity) + */ + public function validateUserValue($values) + { + parent::validateUserValue($values); + + $option = $this->getOption(); + $value = $this->getUserValue(); + $dateTime = \DateTime::createFromFormat(DateTime::DATETIME_PHP_FORMAT, $value); + + $dateValid = true; + $lastErrors = \DateTime::getLastErrors(); + if (!($dateTime && $lastErrors['error_count'] == 0)) { + $dateValid = false; + } + + if ($dateValid && $dateTime) { + $this->setUserValue( + [ + 'date' => $value, + 'year' => $dateTime->format('Y'), + 'month' => $dateTime->format('m'), + 'day' => $dateTime->format('d'), + 'hour' => $dateTime->format('H'), + 'minute' => intval($dateTime->format('i')), + 'day_part' => $dateTime->format('a'), + 'date_internal' => '', + ] + ); + } elseif (!$dateValid && $option->getIsRequire() && !$this->getSkipCheckRequiredOption()) { + $this->setIsValid(false); + throw new \Magento\Framework\Exception\LocalizedException( + __('Please specify product\'s required option(s).') + ); + } else { + $this->setUserValue(null); + return $this; + } + + return $this; + } + + /** + * Prepare option value for cart + * + * @return string|null Prepared option value + * @throws \Magento\Framework\Exception\LocalizedException + * @SuppressWarnings(PHPMD.CyclomaticComplexity) + * @SuppressWarnings(PHPMD.UnusedLocalVariable) + */ + public function prepareForCart() + { + if ($this->getIsValid() && $this->getUserValue() !== null) { + $option = $this->getOption(); + $value = $this->getUserValue(); + + if (isset($value['date_internal']) && $value['date_internal'] != '') { + $this->_setInternalInRequest($value['date_internal']); + return $value['date_internal']; + } + + $timestamp = 0; + + if ($this->_dateExists()) { + if ($this->useCalendar()) { + $timestamp += (new \DateTime($value['date']))->getTimestamp(); + } else { + $timestamp += mktime(0, 0, 0, $value['month'], $value['day'], $value['year']); + } + } else { + $timestamp += mktime(0, 0, 0, date('m'), date('d'), date('Y')); + } + + if ($this->_timeExists()) { + // 24hr hour conversion + if (!$this->is24hTimeFormat()) { + $pmDayPart = 'pm' == strtolower($value['day_part']); + if (12 == $value['hour']) { + $value['hour'] = $pmDayPart ? 12 : 0; + } elseif ($pmDayPart) { + $value['hour'] += 12; + } + } + + $timestamp += 60 * 60 * $value['hour'] + 60 * $value['minute']; + } + + $date = (new \DateTime())->setTimestamp($timestamp); + $result = $date->format('Y-m-d H:i:s'); + + // Save date in internal format to avoid locale date bugs + $this->_setInternalInRequest($result); + + return $result; + } else { + return null; + } + } + + /** + * Return formatted option value for quote option + * + * @param string $optionValue Prepared for cart option value + * @return string + * @SuppressWarnings(PHPMD.UnusedLocalVariable) + */ + public function getFormattedOptionValue($optionValue) + { + if ($this->_formattedOptionValue === null) { + if ($this->getOption()->getType() == \Magento\Catalog\Model\Product\Option::OPTION_TYPE_DATE) { + $result = $this->_localeDate->formatDateTime( + new \DateTime($optionValue), + \IntlDateFormatter::MEDIUM, + \IntlDateFormatter::NONE + ); + } elseif ($this->getOption()->getType() == \Magento\Catalog\Model\Product\Option::OPTION_TYPE_DATE_TIME) { + $result = $this->_localeDate->formatDateTime( + new \DateTime($optionValue), + \IntlDateFormatter::SHORT, + \IntlDateFormatter::SHORT + ); + } elseif ($this->getOption()->getType() == \Magento\Catalog\Model\Product\Option::OPTION_TYPE_TIME) { + $result = $this->_localeDate->formatDateTime( + new \DateTime($optionValue), + \IntlDateFormatter::NONE, + \IntlDateFormatter::SHORT + ); + } else { + $result = $optionValue; + } + $this->_formattedOptionValue = $result; + } + return $this->_formattedOptionValue; + } + + /** + * Return printable option value + * + * @param string $optionValue Prepared for cart option value + * @return string + */ + public function getPrintableOptionValue($optionValue) + { + return $this->getFormattedOptionValue($optionValue); + } + + /** + * Return formatted option value ready to edit, ready to parse + * + * @param string $optionValue Prepared for cart option value + * @return string + */ + public function getEditableOptionValue($optionValue) + { + return $this->getFormattedOptionValue($optionValue); + } + + /** + * Parse user input value and return cart prepared value + * + * @param string $optionValue + * @param array $productOptionValues Values for product option + * @return string|null + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function parseOptionValue($optionValue, $productOptionValues) + { + try { + $date = new \DateTime($optionValue); + } catch (\Exception $e) { + return null; + } + return $date->format('Y-m-d H:i:s'); + } + + /** + * Prepare option value for info buy request + * + * @param string $optionValue + * @return array + */ + public function prepareOptionValueForRequest($optionValue) + { + $confItem = $this->getConfigurationItem(); + $infoBuyRequest = $confItem->getOptionByCode('info_buyRequest'); + try { + $value = unserialize($infoBuyRequest->getValue()); + if (is_array($value) && isset($value['options']) && isset($value['options'][$this->getOption()->getId()]) + ) { + return $value['options'][$this->getOption()->getId()]; + } else { + return ['date_internal' => $optionValue]; + } + } catch (\Exception $e) { + return ['date_internal' => $optionValue]; + } + } + + /** + * Use Calendar on frontend or not + * + * @return boolean + */ + public function useCalendar() + { + return (bool)$this->getConfigData('use_calendar'); + } + + /** + * Time Format + * + * @return boolean + */ + public function is24hTimeFormat() + { + return (bool)($this->getConfigData('time_format') == '24h'); + } + + /** + * Year range start + * + * @return string|false + */ + public function getYearStart() + { + $_range = explode(',', $this->getConfigData('year_range')); + if (isset($_range[0]) && !empty($_range[0])) { + return $_range[0]; + } else { + return date('Y'); + } + } + + /** + * Year range end + * + * @return string|false + */ + public function getYearEnd() + { + $_range = explode(',', $this->getConfigData('year_range')); + if (isset($_range[1]) && !empty($_range[1])) { + return $_range[1]; + } else { + return date('Y'); + } + } + + /** + * Save internal value of option in infoBuy_request + * + * @param string $internalValue Datetime value in internal format + * @return void + */ + protected function _setInternalInRequest($internalValue) + { + $requestOptions = $this->getRequest()->getOptions(); + if (!isset($requestOptions[$this->getOption()->getId()])) { + $requestOptions[$this->getOption()->getId()] = []; + } + $requestOptions[$this->getOption()->getId()] = ['date_internal' => $internalValue]; + $this->getRequest()->setOptions($requestOptions); + } + + /** + * Does option have date? + * + * @return boolean + */ + protected function _dateExists() + { + return in_array( + $this->getOption()->getType(), + [ + \Magento\Catalog\Model\Product\Option::OPTION_TYPE_DATE, + \Magento\Catalog\Model\Product\Option::OPTION_TYPE_DATE_TIME + ] + ); + } + + /** + * Does option have time? + * + * @return boolean + */ + protected function _timeExists() + { + return in_array( + $this->getOption()->getType(), + [ + \Magento\Catalog\Model\Product\Option::OPTION_TYPE_DATE_TIME, + \Magento\Catalog\Model\Product\Option::OPTION_TYPE_TIME + ] + ); + } +} diff --git a/app/code/Magento/Catalog/Model/Webapi/Product/Option/Type/File/Processor.php b/app/code/Magento/Catalog/Model/Webapi/Product/Option/Type/File/Processor.php new file mode 100644 index 0000000000000000000000000000000000000000..e577a0a51baa47e3fe226c8119fcfba8ffb98040 --- /dev/null +++ b/app/code/Magento/Catalog/Model/Webapi/Product/Option/Type/File/Processor.php @@ -0,0 +1,73 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Catalog\Model\Webapi\Product\Option\Type\File; + +use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Api\Data\ImageContentInterface; +use Magento\Catalog\Model\Product\Option\Type\File\ValidateFactory; +use Magento\Framework\Api\ImageProcessor; +use Magento\Framework\Filesystem; + +class Processor +{ + /** @var Filesystem */ + protected $filesystem; + + /** @var ImageProcessor */ + protected $imageProcessor; + + /** @var string */ + protected $destinationFolder = '/custom_options/quote'; + + /** + * @param Filesystem $filesystem + * @param ImageProcessor $imageProcessor + */ + public function __construct( + Filesystem $filesystem, + ImageProcessor $imageProcessor + ) { + $this->filesystem = $filesystem; + $this->imageProcessor = $imageProcessor; + } + + /** + * @param ImageContentInterface $imageContent + * @return string + */ + protected function saveFile(ImageContentInterface $imageContent) + { + $uri = $this->filesystem->getUri(DirectoryList::MEDIA); + $filePath = $this->imageProcessor->processImageContent($this->destinationFolder, $imageContent); + return $uri . $this->destinationFolder . $filePath; + } + + /** + * @param ImageContentInterface $imageContent + * @return array + * @throws \Magento\Framework\Exception\LocalizedException + */ + public function processFileContent(ImageContentInterface $imageContent) + { + $filePath = $this->saveFile($imageContent); + + $fileAbsolutePath = $this->filesystem->getDirectoryRead(DirectoryList::ROOT)->getAbsolutePath($filePath); + $fileHash = md5($this->filesystem->getDirectoryRead(DirectoryList::ROOT)->readFile($filePath)); + $imageSize = getimagesize($fileAbsolutePath); + $result = [ + 'type' => $imageContent->getType(), + 'title' => $imageContent->getName(), + 'fullpath' => $fileAbsolutePath, + 'quote_path' => $filePath, + 'order_path' => $filePath, + 'size' => filesize($fileAbsolutePath), + 'width' => $imageSize ? $imageSize[0] : 0, + 'height' => $imageSize ? $imageSize[1] : 0, + 'secret_key' => substr($fileHash, 0, 20), + ]; + return $result; + } +} diff --git a/app/code/Magento/Catalog/Model/Webapi/Product/Option/Type/File/Validator.php b/app/code/Magento/Catalog/Model/Webapi/Product/Option/Type/File/Validator.php new file mode 100644 index 0000000000000000000000000000000000000000..7e94351e75cfb92558c111f404e798c8fd492687 --- /dev/null +++ b/app/code/Magento/Catalog/Model/Webapi/Product/Option/Type/File/Validator.php @@ -0,0 +1,52 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Catalog\Model\Webapi\Product\Option\Type\File; + +class Validator extends \Magento\Catalog\Model\Product\Option\Type\File\ValidatorInfo +{ + /** + * @param array $optionValue + * @param \Magento\Catalog\Model\Product\Option $option + * @return bool + * @throws \Magento\Framework\Exception\LocalizedException + */ + public function validate($optionValue, $option) + { + if (!is_array($optionValue)) { + return false; + } + + $this->fileFullPath = null; + $this->fileRelativePath = null; + $this->initFilePath($optionValue); + + if ($this->fileFullPath === null) { + return false; + } + + $validatorChain = $this->validateFactory->create(); + try { + $validatorChain = $this->buildImageValidator($validatorChain, $option, $this->fileFullPath); + } catch (\Magento\Framework\Exception\InputException $notImage) { + return false; + } + + $result = false; + if ($validatorChain->isValid($this->fileFullPath) + && $this->rootDirectory->isReadable($this->fileRelativePath) + ) { + $result = true; + } elseif ($validatorChain->getErrors()) { + $errors = $this->getValidatorErrors($validatorChain->getErrors(), $optionValue, $option); + throw new \Magento\Framework\Exception\LocalizedException(__(implode("\n", $errors))); + } else { + throw new \Magento\Framework\Exception\LocalizedException( + __('Please specify product\'s required option(s).') + ); + } + return $result; + } +} diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Config/XsdTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Config/XsdTest.php index 5018bd7129b1a953936db8ffdf3b5f31d41378de..033cd5038928fa41488ae0838cda7896ab01efee 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Config/XsdTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Config/XsdTest.php @@ -16,7 +16,8 @@ class XsdTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_schemaFile = BP . '/app/code/Magento/Catalog/etc/catalog_attributes.xsd'; + $urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + $this->_schemaFile = $urnResolver->getRealPath('urn:magento:module:Magento_Catalog:etc/catalog_attributes.xsd'); } /** diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Config/_files/attributes_config_merged.xml b/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Config/_files/attributes_config_merged.xml index 8f1e158d7adcb9100a9cbabde349785afa5a3caa..470fb492ddf672641f765029e1790919a3d5924f 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Config/_files/attributes_config_merged.xml +++ b/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Config/_files/attributes_config_merged.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/Catalog/etc/catalog_attributes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/catalog_attributes.xsd"> <group name="group_one"> <attribute name="test_attribute"/> </group> diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Config/_files/attributes_config_one.xml b/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Config/_files/attributes_config_one.xml index 7e110169849071e5740dbb7bd9f186e6df4ddc42..db722b15559dc31ce6d57ab25469cb997c3037e8 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Config/_files/attributes_config_one.xml +++ b/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Config/_files/attributes_config_one.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/Catalog/etc/catalog_attributes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/catalog_attributes.xsd"> <group name="group_one"> <attribute name="test_attribute"/> </group> diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Config/_files/attributes_config_two.xml b/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Config/_files/attributes_config_two.xml index e52d9922a50b3151dcb17344d8b7450595bc15ff..657b0921793ba0bc8d001517b08129a002f23edd 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Config/_files/attributes_config_two.xml +++ b/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Config/_files/attributes_config_two.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/Catalog/etc/catalog_attributes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/catalog_attributes.xsd"> <group name="group_two"> <attribute name="attribute_one"/> <attribute name="attribute_two"/> diff --git a/app/code/Magento/Catalog/Test/Unit/Model/CustomOptions/CustomOptionProcessorTest.php b/app/code/Magento/Catalog/Test/Unit/Model/CustomOptions/CustomOptionProcessorTest.php new file mode 100644 index 0000000000000000000000000000000000000000..0bf376941d190a877d18a85ba7a642aa404fbb0b --- /dev/null +++ b/app/code/Magento/Catalog/Test/Unit/Model/CustomOptions/CustomOptionProcessorTest.php @@ -0,0 +1,168 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Catalog\Test\Unit\Model\CustomOptions; + +use Magento\Catalog\Model\CustomOptions\CustomOptionProcessor; + +class CustomOptionProcessorTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Framework\DataObject\Factory|\PHPUnit_Framework_MockObject_MockObject + */ + protected $objectFactory; + + /** + * @var \Magento\Quote\Model\Quote\ProductOptionFactory|\PHPUnit_Framework_MockObject_MockObject + */ + protected $productOptionFactory; + + /** + * @var \Magento\Quote\Api\Data\ProductOptionExtensionFactory|\PHPUnit_Framework_MockObject_MockObject + */ + protected $extensionFactory; + + /** + * @var \Magento\Catalog\Model\CustomOptions\CustomOptionFactory + * |\PHPUnit_Framework_MockObject_MockObject + */ + protected $customOptionFactory; + + /** @var \Magento\Quote\Api\Data\CartItemInterface|\PHPUnit_Framework_MockObject_MockObject */ + protected $cartItem; + + /** @var \Magento\Quote\Api\Data\ProductOptionExtensionInterface|\PHPUnit_Framework_MockObject_MockObject */ + protected $extensibleAttribute; + + /** @var \Magento\Quote\Model\Quote\ProductOption|\PHPUnit_Framework_MockObject_MockObject */ + protected $productOption; + + /** @var \Magento\Catalog\Model\CustomOptions\CustomOption|\PHPUnit_Framework_MockObject_MockObject */ + protected $customOption; + + /** @var \Magento\Framework\DataObject|\PHPUnit_Framework_MockObject_MockObject */ + protected $buyRequest; + + /** @var CustomOptionProcessor */ + protected $processor; + + public function setUp() + { + $this->objectFactory = $this->getMockBuilder('Magento\Framework\DataObject\Factory') + ->setMethods(['create']) + ->disableOriginalConstructor() + ->getMock(); + $this->productOptionFactory = $this->getMockBuilder('Magento\Quote\Model\Quote\ProductOptionFactory') + ->setMethods(['create']) + ->disableOriginalConstructor() + ->getMock(); + $this->extensionFactory = $this->getMockBuilder('Magento\Quote\Api\Data\ProductOptionExtensionFactory') + ->setMethods(['create']) + ->disableOriginalConstructor() + ->getMock(); + $this->customOptionFactory = $this->getMockBuilder('Magento\Catalog\Model\CustomOptions\CustomOptionFactory') + ->setMethods(['create']) + ->disableOriginalConstructor() + ->getMock(); + $this->cartItem = $this->getMockBuilder('Magento\Quote\Api\Data\CartItemInterface') + ->disableOriginalConstructor() + ->setMethods(['getOptionByCode', 'getProductOption', 'setProductOption']) + ->getMockForAbstractClass(); + $this->extensibleAttribute = $this->getMockBuilder('Magento\Quote\Api\Data\ProductOptionExtensionInterface') + ->disableOriginalConstructor() + ->setMethods(['setCustomOptions', 'getCustomOptions']) + ->getMockForAbstractClass(); + $this->productOption = $this->getMockBuilder('Magento\Quote\Model\Quote\ProductOption') + ->disableOriginalConstructor() + ->getMock(); + $this->customOption = $this->getMockBuilder('Magento\Catalog\Api\Data\CustomOptionInterface') + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + $this->buyRequest = $this->getMockBuilder('Magento\Framework\DataObject') + ->disableOriginalConstructor() + ->getMock(); + + $this->processor = new CustomOptionProcessor( + $this->objectFactory, + $this->productOptionFactory, + $this->extensionFactory, + $this->customOptionFactory + ); + + } + + public function testConvertToBuyRequest() + { + $optionId = 23; + $optionValue = 'Option value'; + $this->objectFactory->expects($this->once()) + ->method('create') + ->willReturn($this->buyRequest); + $this->cartItem->expects($this->any()) + ->method('getProductOption') + ->willReturn($this->productOption); + $this->productOption->expects($this->any()) + ->method('getExtensionAttributes') + ->willReturn($this->extensibleAttribute); + $this->extensibleAttribute->expects($this->atLeastOnce()) + ->method('getCustomOptions') + ->willReturn([$this->customOption]); + $this->customOption->expects($this->once()) + ->method('getOptionId') + ->willReturn($optionId); + $this->customOption->expects($this->once()) + ->method('getOptionValue') + ->willReturn($optionValue); + + $this->assertSame($this->buyRequest, $this->processor->convertToBuyRequest($this->cartItem)); + } + + public function testProcessCustomOptions() + { + $optionId = 23; + $quoteItemOption = $this->getMockBuilder('Magento\Quote\Model\Quote\Item\Option') + ->disableOriginalConstructor() + ->getMock(); + $this->cartItem->expects($this->atLeastOnce()) + ->method('getOptionByCode') + ->with('info_buyRequest') + ->willReturn($quoteItemOption); + $quoteItemOption->expects($this->once()) + ->method('getValue') + ->willReturn('a:1:{s:7:"options";a:1:{i:' . $optionId . ';a:2:{i:0;s:1:"5";i:1;s:1:"6";}}} '); + $this->customOptionFactory->expects($this->once()) + ->method('create') + ->willReturn($this->customOption); + $this->customOption->expects($this->once()) + ->method('setOptionId') + ->with($optionId); + $this->customOption->expects($this->once()) + ->method('setOptionValue') + ->with('5,6'); + $this->cartItem->expects($this->atLeastOnce()) + ->method('getProductOption') + ->willReturn(false); + $this->productOptionFactory->expects($this->once()) + ->method('create') + ->willReturn($this->productOption); + $this->productOption->expects($this->once()) + ->method('getExtensionAttributes') + ->willReturn(false); + $this->extensionFactory->expects($this->once()) + ->method('create') + ->willReturn($this->extensibleAttribute); + $this->extensibleAttribute->expects($this->once()) + ->method('setCustomOptions') + ->with([$optionId => $this->customOption]); + $this->productOption->expects($this->once()) + ->method('setExtensionAttributes') + ->with($this->extensibleAttribute); + $this->cartItem->expects($this->once()) + ->method('setProductOption') + ->with($this->productOption); + + $this->assertSame($this->cartItem, $this->processor->processOptions($this->cartItem)); + } +} diff --git a/app/code/Magento/Catalog/Test/Unit/Model/CustomOptions/CustomOptionTest.php b/app/code/Magento/Catalog/Test/Unit/Model/CustomOptions/CustomOptionTest.php new file mode 100644 index 0000000000000000000000000000000000000000..c929761291de4920663a309c2118f2ec61f62a66 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Unit/Model/CustomOptions/CustomOptionTest.php @@ -0,0 +1,123 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Catalog\Test\Unit\Model\CustomOptions; + +use Magento\Catalog\Model\CustomOptions\CustomOption; +use Magento\Catalog\Model\Webapi\Product\Option\Type\File\Processor as FileProcessor; + +class CustomOptionTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var CustomOption + */ + protected $model; + + /** + * @var FileProcessor | \PHPUnit_Framework_MockObject_MockObject + */ + protected $fileProcessor; + + public function setUp() + { + $context = $this->getMockBuilder('Magento\Framework\Model\Context') + ->disableOriginalConstructor() + ->getMock(); + + $registry = $this->getMockBuilder('Magento\Framework\Registry') + ->disableOriginalConstructor() + ->getMock(); + + $extensionAttributesFactory = $this->getMockBuilder('Magento\Framework\Api\ExtensionAttributesFactory') + ->disableOriginalConstructor() + ->getMock(); + + $attributeValueFactory = $this->getMockBuilder('Magento\Framework\Api\AttributeValueFactory') + ->disableOriginalConstructor() + ->getMock(); + + $this->fileProcessor = $this->getMockBuilder('Magento\Catalog\Model\Webapi\Product\Option\Type\File\Processor') + ->disableOriginalConstructor() + ->getMock(); + + $resource = $this->getMockBuilder('Magento\Framework\Model\Resource\AbstractResource') + ->disableOriginalConstructor() + ->getMock(); + + $collection = $this->getMockBuilder('Magento\Framework\Data\Collection\AbstractDb') + ->disableOriginalConstructor() + ->getMock(); + + $this->model = new CustomOption( + $context, + $registry, + $extensionAttributesFactory, + $attributeValueFactory, + $this->fileProcessor, + $resource, + $collection + ); + } + + public function testGetSetOptionId() + { + $this->assertNull($this->model->getOptionId()); + + $this->model->setOptionId(1); + $this->assertEquals(1, $this->model->getOptionId()); + } + + public function testGetOptionValue() + { + $this->assertNull($this->model->getOptionValue()); + + $this->model->setData(\Magento\Catalog\Api\Data\CustomOptionInterface::OPTION_VALUE, 'test'); + $this->assertEquals('test', $this->model->getOptionValue()); + + $this->model->setData(\Magento\Catalog\Api\Data\CustomOptionInterface::OPTION_VALUE, 'file'); + $this->assertEquals('file', $this->model->getOptionValue()); + } + + public function testGetOptionValueWithFileInfo() + { + $customOption = $this->getMockBuilder('Magento\Catalog\Api\Data\CustomOptionExtensionInterface') + ->setMethods(['getFileInfo']) + ->getMockForAbstractClass(); + + $imageContent = $this->getMockBuilder('Magento\Framework\Api\Data\ImageContentInterface') + ->getMockForAbstractClass(); + + $customOption->expects($this->once()) + ->method('getFileInfo') + ->willReturn($imageContent); + + $imageResult = [ + 'type' => 'type', + 'title' => 'title', + 'fullpath' => 'fullpath', + 'quote_path' => 'quote_path', + 'order_path' => 'order_path', + 'size' => 100, + 'width' => 100, + 'height' => 100, + 'secret_key' => 'secret_key', + ]; + + $this->fileProcessor->expects($this->once()) + ->method('processFileContent') + ->with($imageContent) + ->willReturn($imageResult); + + $this->model->setExtensionAttributes($customOption); + $this->model->setData(\Magento\Catalog\Api\Data\CustomOptionInterface::OPTION_VALUE, 'file'); + $this->assertEquals($imageResult, $this->model->getOptionValue()); + } + + public function testSetOptionValue() + { + $this->model->setOptionValue('test'); + $this->assertEquals('test', $this->model->getOptionValue()); + } +} diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ProductOptionProcessorTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ProductOptionProcessorTest.php new file mode 100644 index 0000000000000000000000000000000000000000..cad719d5d3aa37e102741adb7258bd76b531af7c --- /dev/null +++ b/app/code/Magento/Catalog/Test/Unit/Model/ProductOptionProcessorTest.php @@ -0,0 +1,203 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Catalog\Test\Unit\Model; + +use Magento\Catalog\Api\Data\CustomOptionInterface; +use Magento\Catalog\Model\CustomOptions\CustomOptionFactory; +use Magento\Catalog\Model\ProductOptionProcessor; +use Magento\Framework\DataObject; +use Magento\Framework\DataObject\Factory as DataObjectFactory; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; + +class ProductOptionProcessorTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var ProductOptionProcessor + */ + protected $processor; + + /** + * @var DataObject | \PHPUnit_Framework_MockObject_MockObject + */ + protected $dataObject; + + /** + * @var DataObjectFactory | \PHPUnit_Framework_MockObject_MockObject + */ + protected $dataObjectFactory; + + /** + * @var CustomOptionFactory | \PHPUnit_Framework_MockObject_MockObject + */ + protected $customOptionFactory; + + /** + * @var CustomOptionInterface | \PHPUnit_Framework_MockObject_MockObject + */ + protected $customOption; + + protected function setUp() + { + $this->dataObject = $this->getMockBuilder('Magento\Framework\DataObject') + ->setMethods([ + 'getOptions', + ]) + ->disableOriginalConstructor() + ->getMock(); + + $this->dataObjectFactory = $this->getMockBuilder('Magento\Framework\DataObject\Factory') + ->setMethods(['create']) + ->disableOriginalConstructor() + ->getMock(); + $this->dataObjectFactory->expects($this->any()) + ->method('create') + ->willReturn($this->dataObject); + + $this->customOption = $this->getMockBuilder( + 'Magento\Catalog\Api\Data\CustomOptionInterface' + ) + ->setMethods([ + 'getDownloadableLinks', + ]) + ->getMockForAbstractClass(); + + $this->customOptionFactory = $this->getMockBuilder( + 'Magento\Catalog\Model\CustomOptions\CustomOptionFactory' + ) + ->setMethods(['create']) + ->disableOriginalConstructor() + ->getMock(); + $this->customOptionFactory->expects($this->any()) + ->method('create') + ->willReturn($this->customOption); + + $this->processor = new ProductOptionProcessor( + $this->dataObjectFactory, + $this->customOptionFactory + ); + } + + /** + * @param array|string $options + * @param array $requestData + * @dataProvider dataProviderConvertToBuyRequest + */ + public function testConvertToBuyRequest( + $options, + $requestData + ) { + $productOptionMock = $this->getMockBuilder('Magento\Catalog\Api\Data\ProductOptionInterface') + ->getMockForAbstractClass(); + + $productOptionExtensionMock = $this->getMockBuilder('Magento\Catalog\Api\Data\ProductOptionExtensionInterface') + ->setMethods([ + 'getCustomOptions', + ]) + ->getMockForAbstractClass(); + + $productOptionMock->expects($this->any()) + ->method('getExtensionAttributes') + ->willReturn($productOptionExtensionMock); + + $productOptionExtensionMock->expects($this->any()) + ->method('getCustomOptions') + ->willReturn($options); + + $this->dataObject->expects($this->any()) + ->method('addData') + ->with($requestData) + ->willReturnSelf(); + + $this->assertEquals($this->dataObject, $this->processor->convertToBuyRequest($productOptionMock)); + } + + /** + * @return array + */ + public function dataProviderConvertToBuyRequest() + { + $objectManager = new ObjectManager($this); + + /** @var \Magento\Catalog\Model\CustomOptions\CustomOption $option */ + $option = $objectManager->getObject('Magento\Catalog\Model\CustomOptions\CustomOption'); + $option->setOptionId(1); + $option->setOptionValue(1); + + return [ + [ + [$option], + [ + 'options' => [ + 1 => 1, + ], + ], + ], + [[], []], + ['', []], + ]; + } + + /** + * @param array|string $options + * @param string|null $expected + * @dataProvider dataProviderConvertToProductOption + */ + public function testConvertToProductOption( + $options, + $expected + ) { + $this->dataObject->expects($this->any()) + ->method('getOptions') + ->willReturn($options); + + if (!empty($options) && is_array($options)) { + $this->customOption->expects($this->any()) + ->method('setOptionId') + ->willReturnMap([ + [1, $this->customOption], + [2, $this->customOption], + ]); + $this->customOption->expects($this->any()) + ->method('setOptionValue') + ->willReturnMap([ + [1, $this->customOption], + [2, $this->customOption], + ]); + } + + $result = $this->processor->convertToProductOption($this->dataObject); + + if (!empty($expected)) { + $this->assertArrayHasKey($expected, $result); + $this->assertTrue(is_array($result)); + $this->assertSame($this->customOption, $result['custom_options'][0]); + } + } + + /** + * @return array + */ + public function dataProviderConvertToProductOption() + { + return [ + [ + 'options' => [ + 1 => 'value', + 2 => [1, 2], + ], + 'expected' => 'custom_options', + ], + [ + 'options' => [], + 'expected' => null, + ], + [ + 'options' => 'is not array', + 'expected' => null, + ], + ]; + } +} diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ProductOptions/Config/XsdTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ProductOptions/Config/XsdTest.php index 6c217812b181557cff6cd94b65b9de6623f80cb0..7bc7ebfd0fe42ed417cb7e35f7fadd88a4bc1e13 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ProductOptions/Config/XsdTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ProductOptions/Config/XsdTest.php @@ -14,13 +14,14 @@ class XsdTest extends \PHPUnit_Framework_TestCase protected $_xsdSchemaPath; /** - * @var \Magento\TestFramework\Utility\XsdValidator + * @var \Magento\Framework\TestFramework\Unit\Utility\XsdValidator */ protected $_xsdValidator; protected function setUp() { - $this->_xsdSchemaPath = BP . '/app/code/Magento/Catalog/etc/'; + $urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + $this->_xsdSchemaPath = $urnResolver->getRealPath('urn:magento:module:Magento_Catalog:etc/'); $this->_xsdValidator = new \Magento\Framework\TestFramework\Unit\Utility\XsdValidator(); } diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ProductOptions/Config/_files/invalidProductOptionsMergedXmlArray.php b/app/code/Magento/Catalog/Test/Unit/Model/ProductOptions/Config/_files/invalidProductOptionsMergedXmlArray.php index 0addf03d3489ffb0ae8392bb5d68d62ca90a2f43..e7e544509eb6b6cc2935b0f4e2ca7119e790c33c 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ProductOptions/Config/_files/invalidProductOptionsMergedXmlArray.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ProductOptions/Config/_files/invalidProductOptionsMergedXmlArray.php @@ -6,20 +6,20 @@ return [ 'options_node_is_required' => [ '<?xml version="1.0"?><config><inputType name="name_one" label="Label One"/></config>', - ["Element 'inputType': This element is not expected. Expected is ( option )."], + ["Element 'inputType': This element is not expected. Expected is ( option ).\nLine: 1\n"], ], 'inputType_node_is_required' => [ '<?xml version="1.0"?><config><option name="name_one" label="Label One" renderer="one"/></config>', - ["Element 'option': Missing child element(s). Expected is ( inputType )."], + ["Element 'option': Missing child element(s). Expected is ( inputType ).\nLine: 1\n"], ], 'options_node_without_required_attributes' => [ '<?xml version="1.0"?><config><option name="name_one" label="label one"><inputType name="name" label="one"/>' . '</option><option name="name_two" renderer="renderer"><inputType name="name_two" label="one" /></option>' . '<option label="label three" renderer="renderer"><inputType name="name_one" label="one"/></option></config>', [ - "Element 'option': The attribute 'renderer' is required but missing.", - "Element 'option': The attribute " . "'label' is required but missing.", - "Element 'option': The attribute 'name' is required but missing." + "Element 'option': The attribute 'renderer' is required but missing.\nLine: 1\n", + "Element 'option': The attribute " . "'label' is required but missing.\nLine: 1\n", + "Element 'option': The attribute 'name' is required but missing.\nLine: 1\n" ], ], 'inputType_node_without_required_attributes' => [ @@ -27,8 +27,8 @@ return [ '<inputType name="name_one"/></option><option name="name_two" renderer="renderer" label="label">' . '<inputType label="name_two"/></option></config>', [ - "Element 'inputType': The attribute 'label' is required but missing.", - "Element 'inputType': The " . "attribute 'name' is required but missing." + "Element 'inputType': The attribute 'label' is required but missing.\nLine: 1\n", + "Element 'inputType': The " . "attribute 'name' is required but missing.\nLine: 1\n" ], ] ]; diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ProductOptions/Config/_files/invalidProductOptionsXmlArray.php b/app/code/Magento/Catalog/Test/Unit/Model/ProductOptions/Config/_files/invalidProductOptionsXmlArray.php index 10910dd083a8382e50d11efd317ded70b21345be..9dc6ee8983052666999945a7397df3a1b7563d4e 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ProductOptions/Config/_files/invalidProductOptionsXmlArray.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ProductOptions/Config/_files/invalidProductOptionsXmlArray.php @@ -6,18 +6,18 @@ return [ 'options_node_is_required' => [ '<?xml version="1.0"?><config><inputType name="name_one" /></config>', - ["Element 'inputType': This element is not expected. Expected is ( option )."], + ["Element 'inputType': This element is not expected. Expected is ( option ).\nLine: 1\n"], ], 'inputType_node_is_required' => [ '<?xml version="1.0"?><config><option name="name_one"/></config>', - ["Element 'option': Missing child element(s). Expected is ( inputType )."], + ["Element 'option': Missing child element(s). Expected is ( inputType ).\nLine: 1\n"], ], 'options_name_must_be_unique' => [ '<?xml version="1.0"?><config><option name="name_one"><inputType name="name"/>' . '</option><option name="name_one"><inputType name="name_two"/></option></config>', [ "Element 'option': Duplicate key-sequence ['name_one'] in unique identity-constraint " . - "'uniqueOptionName'." + "'uniqueOptionName'.\nLine: 1\n" ], ], 'inputType_name_must_be_unique' => [ @@ -25,7 +25,7 @@ return [ '<inputType name="name_one"/></option></config>', [ "Element 'inputType': Duplicate key-sequence ['name_one'] in unique identity-constraint " . - "'uniqueInputTypeName'." + "'uniqueInputTypeName'.\nLine: 1\n" ], ], 'renderer_attribute_with_invalid_value' => [ @@ -33,18 +33,19 @@ return [ '</option></config>', [ "Element 'option', attribute 'renderer': [facet 'pattern'] The value 'true12' is not accepted by the " . - "pattern '[a-zA-Z_\\\\\\\\]+'.", + "pattern '[a-zA-Z_\\\\\\\\]+'.\nLine: 1\n", "Element 'option', attribute 'renderer': 'true12' is not a valid value of the atomic" . - " type 'modelName'." + " type 'modelName'.\nLine: 1\n" ], ], 'disabled_attribute_with_invalid_value' => [ '<?xml version="1.0"?><config><option name="name_one"><inputType name="name_one" disabled="7"/>' . '<inputType name="name_two" disabled="some_string"/></option></config>', [ - "Element 'inputType', attribute 'disabled': '7' is not a valid value of the atomic type 'xs:boolean'.", + "Element 'inputType', attribute 'disabled': '7' is not a valid value of the atomic type" . + " 'xs:boolean'.\nLine: 1\n", "Element 'inputType', attribute 'disabled': 'some_string' is not a valid value of the atomic type " . - "'xs:boolean'." + "'xs:boolean'.\nLine: 1\n" ], ] ]; diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ProductOptions/Config/_files/product_options_merged_valid.xml b/app/code/Magento/Catalog/Test/Unit/Model/ProductOptions/Config/_files/product_options_merged_valid.xml index e7e7c3c59977b9783d5848ea5f7f4d9b79f2f0e4..1a66857911c2287d38d343acbb4072ff143a9b34 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ProductOptions/Config/_files/product_options_merged_valid.xml +++ b/app/code/Magento/Catalog/Test/Unit/Model/ProductOptions/Config/_files/product_options_merged_valid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/Catalog/etc/product_options_merged.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/product_options_merged.xsd"> <option name="name_one" label="Label One" renderer="Name_One_Two"> <inputType name="input_name" label="Label Two" /> </option> diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ProductOptions/Config/_files/product_options_valid.xml b/app/code/Magento/Catalog/Test/Unit/Model/ProductOptions/Config/_files/product_options_valid.xml index 63042451bc23c2dddf0a529039cde44974741637..6724569a99c9154cc7f541c42703d078aeed2a14 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ProductOptions/Config/_files/product_options_valid.xml +++ b/app/code/Magento/Catalog/Test/Unit/Model/ProductOptions/Config/_files/product_options_valid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/Catalog/etc/product_options.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/product_options.xsd"> <option name="name_one" label="Label One" renderer="Name_One_Two"> <inputType name="input_name" label="Label Two" /> </option> diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/Config/XsdMergedTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/Config/XsdMergedTest.php index 0bf1676058c35836eb68f29ccfb629f85071de41..72d9cc7976644dcbc090d0b90698fa05c820d716 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/Config/XsdMergedTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/Config/XsdMergedTest.php @@ -14,13 +14,16 @@ class XsdMergedTest extends \PHPUnit_Framework_TestCase protected $_xsdSchema; /** - * @var \Magento\TestFramework\Utility\XsdValidator + * @var \Magento\Framework\TestFramework\Unit\Utility\XsdValidator */ protected $_xsdValidator; protected function setUp() { - $this->_xsdSchema = BP . '/app/code/Magento/Catalog/etc/product_types_merged.xsd'; + $urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + $this->_xsdSchema = $urnResolver->getRealPath( + 'urn:magento:module:Magento_Catalog:etc/product_types_merged.xsd' + ); $this->_xsdValidator = new \Magento\Framework\TestFramework\Unit\Utility\XsdValidator(); } diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/Config/XsdTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/Config/XsdTest.php index 92968fffe2c06a638bc32ec40e91c418098cf318..0ab57229f0e1065b12f19bef9a8e1e3ee9815435 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/Config/XsdTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/Config/XsdTest.php @@ -14,13 +14,14 @@ class XsdTest extends \PHPUnit_Framework_TestCase protected $_xsdSchema; /** - * @var \Magento\TestFramework\Utility\XsdValidator + * @var \Magento\Framework\TestFramework\Unit\Utility\XsdValidator */ protected $_xsdValidator; protected function setUp() { - $this->_xsdSchema = BP . '/app/code/Magento/Catalog/etc/product_types.xsd'; + $urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + $this->_xsdSchema = $urnResolver->getRealPath('urn:magento:module:Magento_Catalog:etc/product_types.xsd'); $this->_xsdValidator = new \Magento\Framework\TestFramework\Unit\Utility\XsdValidator(); } diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/Config/_files/invalidProductTypesMergedXmlArray.php b/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/Config/_files/invalidProductTypesMergedXmlArray.php index 4d5d7d82049fb25e05c762c946ae82549aa72ff2..eed728b2c74688917a1e315611b7338d0e591784 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/Config/_files/invalidProductTypesMergedXmlArray.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/Config/_files/invalidProductTypesMergedXmlArray.php @@ -7,31 +7,31 @@ return [ 'type_without_required_name' => [ '<?xml version="1.0" encoding="UTF-8"?><config><type label="some label" modelInstance="model_name" /></config>', [ - "Element 'type': The attribute 'name' is required but missing.", - "Element 'type': Not all fields of key identity-constraint 'productTypeKey' evaluate to a node." + "Element 'type': The attribute 'name' is required but missing.\nLine: 1\n", + "Element 'type': Not all fields of key identity-constraint 'productTypeKey' evaluate to a node.\nLine: 1\n" ], ], 'type_without_required_label' => [ '<?xml version="1.0" encoding="UTF-8"?><config><type name="some_name" modelInstance="model_name" /></config>', - ["Element 'type': The attribute 'label' is required but missing."], + ["Element 'type': The attribute 'label' is required but missing.\nLine: 1\n"], ], 'type_without_required_modelInstance' => [ '<?xml version="1.0" encoding="UTF-8"?><config><type label="some_label" name="some_name" /></config>', - ["Element 'type': The attribute 'modelInstance' is required but missing."], + ["Element 'type': The attribute 'modelInstance' is required but missing.\nLine: 1\n"], ], 'type_pricemodel_without_required_instance_attribute' => [ '<?xml version="1.0" encoding="UTF-8"?><config>' . '<type label="some_label" name="some_name" modelInstance="model_name"><priceModel/></type></config>', - ["Element 'priceModel': The attribute 'instance' is required but missing."], + ["Element 'priceModel': The attribute 'instance' is required but missing.\nLine: 1\n"], ], 'type_indexmodel_without_required_instance_attribute' => [ '<?xml version="1.0" encoding="UTF-8"?><config>' . '<type label="some_label" name="some_name" modelInstance="model_name"><indexerModel/></type></config>', - ["Element 'indexerModel': The attribute 'instance' is required but missing."], + ["Element 'indexerModel': The attribute 'instance' is required but missing.\nLine: 1\n"], ], 'type_stockindexermodel_without_required_instance_attribute' => [ '<?xml version="1.0" encoding="UTF-8"?><config><type label="some_label" ' . 'name="some_name" modelInstance="model_name"><stockIndexerModel/></type></config>', - ["Element 'stockIndexerModel': The attribute 'instance' is required but missing."], + ["Element 'stockIndexerModel': The attribute 'instance' is required but missing.\nLine: 1\n"], ] ]; diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/Config/_files/invalidProductTypesXmlArray.php b/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/Config/_files/invalidProductTypesXmlArray.php index 44fc5fe16429e990c3afa5034d9b3bfac185b3ba..36e2560189b5078743949d5e516daee4fa331afc 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/Config/_files/invalidProductTypesXmlArray.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/Config/_files/invalidProductTypesXmlArray.php @@ -6,90 +6,99 @@ return [ 'types_with_same_name_attribute_value' => [ '<?xml version="1.0"?><config><type name="some_name" /><type name="some_name" /></config>', - ["Element 'type': Duplicate key-sequence ['some_name'] in unique identity-constraint 'uniqueTypeName'."], + [ + "Element 'type': Duplicate key-sequence ['some_name'] in unique identity-constraint" . + " 'uniqueTypeName'.\nLine: 1\n" + ], ], 'type_without_required_name_attribute' => [ '<?xml version="1.0"?><config><type /></config>', - ["Element 'type': The attribute 'name' is required but missing."], + ["Element 'type': The attribute 'name' is required but missing.\nLine: 1\n"], ], 'type_with_notallowed_attribute' => [ '<?xml version="1.0"?><config><type name="some_name" notallowed="text"/></config>', - ["Element 'type', attribute 'notallowed': The attribute 'notallowed' is not allowed."], + ["Element 'type', attribute 'notallowed': The attribute 'notallowed' is not allowed.\nLine: 1\n"], ], 'type_modelinstance_invalid_value' => [ '<?xml version="1.0"?><config><type name="some_name" modelInstance="123" /></config>', [ "Element 'type', attribute 'modelInstance': [facet 'pattern'] The value '123' is not accepted by the" . - " pattern '[a-zA-Z_\\\\\\\\]+'.", - "Element 'type', attribute 'modelInstance': '123' is not a valid value of the atomic type 'modelName'." + " pattern '[a-zA-Z_\\\\\\\\]+'.\nLine: 1\n", + "Element 'type', attribute 'modelInstance': '123' is not a valid value of the atomic type" . + " 'modelName'.\nLine: 1\n" ], ], 'type_indexpriority_invalid_value' => [ '<?xml version="1.0"?><config><type name="some_name" indexPriority="-1" /></config>', [ "Element 'type', attribute 'indexPriority': '-1' is not a valid value of the atomic " . - "type 'xs:nonNegativeInteger'." + "type 'xs:nonNegativeInteger'.\nLine: 1\n" ], ], 'type_canuseqtydecimals_invalid_value' => [ '<?xml version="1.0"?><config><type name="some_name" canUseQtyDecimals="string" /></config>', [ "Element 'type', attribute 'canUseQtyDecimals': 'string' is not a valid value of the atomic" . - " type 'xs:boolean'." + " type 'xs:boolean'.\nLine: 1\n" ], ], 'type_isqty_invalid_value' => [ '<?xml version="1.0"?><config><type name="some_name" isQty="string" /></config>', - ["Element 'type', attribute 'isQty': 'string' is not a valid value of the atomic type 'xs:boolean'."], + [ + "Element 'type', attribute 'isQty': 'string' is not a valid value of the atomic type" . + " 'xs:boolean'.\nLine: 1\n" + ], ], 'type_pricemodel_without_required_instance_attribute' => [ '<?xml version="1.0"?><config><type name="some_name"><priceModel /></type></config>', - ["Element 'priceModel': The attribute 'instance' is required but missing."], + ["Element 'priceModel': The attribute 'instance' is required but missing.\nLine: 1\n"], ], 'type_pricemodel_instance_invalid_value' => [ '<?xml version="1.0"?><config><type name="some_name"><priceModel instance="123123" /></type></config>', [ "Element 'priceModel', attribute 'instance': [facet 'pattern'] The value '123123' is not accepted " . - "by the pattern '[a-zA-Z_\\\\\\\\]+'.", - "Element 'priceModel', attribute 'instance': '123123' is not a valid value of the atomic type 'modelName'." + "by the pattern '[a-zA-Z_\\\\\\\\]+'.\nLine: 1\n", + "Element 'priceModel', attribute 'instance': '123123' is not a valid value of the atomic type" . + " 'modelName'.\nLine: 1\n" ], ], 'type_indexermodel_instance_invalid_value' => [ '<?xml version="1.0"?><config><type name="some_name"><indexerModel instance="123" /></type></config>', [ "Element 'indexerModel', attribute 'instance': [facet 'pattern'] The value '123' is not accepted by " . - "the pattern '[a-zA-Z_\\\\\\\\]+'.", - "Element 'indexerModel', attribute 'instance': '123' is not a valid value of the atomic type 'modelName'." + "the pattern '[a-zA-Z_\\\\\\\\]+'.\nLine: 1\n", + "Element 'indexerModel', attribute 'instance': '123' is not a valid value of the atomic type" . + " 'modelName'.\nLine: 1\n" ], ], 'type_indexermodel_without_required_instance_attribute' => [ '<?xml version="1.0"?><config><type name="some_name"><indexerModel /></type></config>', - ["Element 'indexerModel': The attribute 'instance' is required but missing."], + ["Element 'indexerModel': The attribute 'instance' is required but missing.\nLine: 1\n"], ], 'stockindexermodel_without_required_instance_attribute' => [ '<?xml version="1.0"?><config><type name="some_name"><stockIndexerModel /></type></config>', - ["Element 'stockIndexerModel': The attribute 'instance' is required but missing."], + ["Element 'stockIndexerModel': The attribute 'instance' is required but missing.\nLine: 1\n"], ], 'stockindexermodel_instance_invalid_value' => [ '<?xml version="1.0"?><config><type name="some_name"><stockIndexerModel instance="1234"/></type></config>', [ "Element 'stockIndexerModel', attribute 'instance': [facet 'pattern'] The value '1234' is not " . - "accepted by the pattern '[a-zA-Z_\\\\\\\\]+'.", + "accepted by the pattern '[a-zA-Z_\\\\\\\\]+'.\nLine: 1\n", "Element 'stockIndexerModel', attribute 'instance': '1234' is not a valid value of the atomic " . - "type 'modelName'." + "type 'modelName'.\nLine: 1\n" ], ], 'allowedselectiontypes_without_required_type_handle' => [ '<?xml version="1.0"?><config><type name="some_name"><allowedSelectionTypes /></type></config>', - ["Element 'allowedSelectionTypes': Missing child element(s). Expected is ( type )."], + ["Element 'allowedSelectionTypes': Missing child element(s). Expected is ( type ).\nLine: 1\n"], ], 'allowedselectiontypes_type_without_required_name' => [ '<?xml version="1.0"?><config><type name="some_name"><allowedSelectionTypes><type/></allowedSelectionTypes>" . "</type></config>', [ - "Element 'type': The attribute 'name' is required but missing.", + "Element 'type': The attribute 'name' is required but missing.\nLine: 1\n", "Element 'type': Character content other than whitespace is not allowed because the content " . - "type is 'element-only'." + "type is 'element-only'.\nLine: 1\n" ], ] ]; diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/Config/_files/product_types.xml b/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/Config/_files/product_types.xml index f14ef6e58838ec0bd5302a81dceabde2cecc6ac0..c0ccc5a23ab828f28026b99f7460dfcd726661b1 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/Config/_files/product_types.xml +++ b/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/Config/_files/product_types.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/Catalog/etc/product_types.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/product_types.xsd"> <type name="type_one" label="Label One" modelInstance="Instance_Type" composite="true" indexPriority="40" canUseQtyDecimals="true" isQty="true" sortOrder="100"> <priceModel instance="Instance_Type_One" /> <indexerModel instance="Instance_Type_Two" /> diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/Config/_files/valid_product_types.xml b/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/Config/_files/valid_product_types.xml index 6cc2a40fe745ca32c34ecbf3a61e86d071b90b9b..e159a1035ba21a6ebc07f1251965e2264d0ef59d 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/Config/_files/valid_product_types.xml +++ b/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/Config/_files/valid_product_types.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/Catalog/etc/product_types.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/product_types.xsd"> <type name="some_name" label="label_name" modelInstance="Test_Instance_Name" composite='true' indexPriority="40"> <priceModel instance="Second_Test" /> <indexerModel instance="Test_Instance_Name" /> diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/Config/_files/valid_product_types_merged.xml b/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/Config/_files/valid_product_types_merged.xml index a5cfe29f2a389545d0bf0d550a6073b54c8e4503..c15b4e332aee7daac5ed9e479836d2a522565969 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/Config/_files/valid_product_types_merged.xml +++ b/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/Config/_files/valid_product_types_merged.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/Catalog/etc/product_types_merged.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/product_types_merged.xsd"> <type label="some_label" name="some_name" modelInstance="model_name"> <allowedSelectionTypes> <type name="some_name" /> diff --git a/app/code/Magento/Catalog/Test/Unit/Webapi/Product/Option/Type/File/ValidatorTest.php b/app/code/Magento/Catalog/Test/Unit/Webapi/Product/Option/Type/File/ValidatorTest.php new file mode 100644 index 0000000000000000000000000000000000000000..bcbbd5d56f4f5942d703bb803c4dc86cfd78e0e8 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Unit/Webapi/Product/Option/Type/File/ValidatorTest.php @@ -0,0 +1,223 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Catalog\Test\Unit\Webapi\Product\Option\Type\File; + +use Magento\Catalog\Model\Webapi\Product\Option\Type\File\Validator; + +class ValidatorTest extends \PHPUnit_Framework_TestCase +{ + /** @var \Magento\Framework\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject */ + protected $scopeConfig; + + /** @var \Magento\Framework\Filesystem|\PHPUnit_Framework_MockObject_MockObject */ + protected $filesystem; + + /** @var \Magento\Framework\File\Size|\PHPUnit_Framework_MockObject_MockObject */ + protected $fileSize; + + /** @var \Magento\MediaStorage\Helper\File\Storage\Database|\PHPUnit_Framework_MockObject_MockObject */ + protected $coreFileStorageDatabase; + + /** @var \Magento\Catalog\Model\Product\Option\Type\File\ValidateFactory|\PHPUnit_Framework_MockObject_MockObject */ + protected $validateFactory; + + /** @var \Magento\Catalog\Model\Product\Option|\PHPUnit_Framework_MockObject_MockObject */ + protected $option; + + /** @var \Magento\Framework\Filesystem\Directory\ReadInterface|\PHPUnit_Framework_MockObject_MockObject */ + protected $directoryRead; + + /** @var \Zend_Validate|\PHPUnit_Framework_MockObject_MockObject */ + protected $zendValidator; + + /** @var Validator */ + protected $validator; + + public function setUp() + { + $this->scopeConfig = $this->getMockForAbstractClass( + 'Magento\Framework\App\Config\ScopeConfigInterface', + [], + '', + false + ); + $this->filesystem = $this->getMock( + 'Magento\Framework\Filesystem', + [], + [], + '', + false + ); + $this->fileSize = $this->getMock( + 'Magento\Framework\File\Size', + [], + [], + '', + false + ); + $this->coreFileStorageDatabase = $this->getMock( + 'Magento\MediaStorage\Helper\File\Storage\Database', + [], + [], + '', + false + ); + $this->validateFactory = $this->getMock( + 'Magento\Catalog\Model\Product\Option\Type\File\ValidateFactory', + [], + [], + '', + false + ); + $this->option = $this->getMock( + 'Magento\Catalog\Model\Product\Option', + [], + [], + '', + false + ); + $this->directoryRead = $this->getMockForAbstractClass( + 'Magento\Framework\Filesystem\Directory\ReadInterface', + [], + '', + false + ); + $this->zendValidator = $this->getMock( + 'Zend_Validate', + [], + [], + '', + false + ); + + $this->filesystem->expects($this->once()) + ->method('getDirectoryRead') + ->with('base') + ->willReturn($this->directoryRead); + + $this->validator = new Validator( + $this->scopeConfig, + $this->filesystem, + $this->fileSize, + $this->coreFileStorageDatabase, + $this->validateFactory + ); + } + + public function testValidateWithoutOptionValue() + { + $this->assertFalse($this->validator->validate('', $this->option)); + } + + public function testValidateWithInvalidOptionValue() + { + $this->assertFalse($this->validator->validate([], $this->option)); + } + + protected function prepare() + { + $relativePath = '/custom_options/quote/file'; + $absolutePath = '/absolute/path' . $relativePath; + + $this->directoryRead->expects($this->once()) + ->method('isFile') + ->with('/custom_options/quote/file') + ->willReturn(true); + $this->directoryRead->expects($this->once()) + ->method('getAbsolutePath') + ->with('/custom_options/quote/file') + ->willReturn($absolutePath); + $this->validateFactory->expects($this->once()) + ->method('create') + ->willReturn($this->zendValidator); + $this->option->expects($this->once()) + ->method('getImageSizeX') + ->willReturn(0); + $this->option->expects($this->once()) + ->method('getImageSizeY') + ->willReturn(0); + $this->option->expects($this->once()) + ->method('getFileExtension') + ->willReturn(''); + $this->scopeConfig->expects($this->once()) + ->method('getValue') + ->with('catalog/custom_options/forbidden_extensions', \Magento\Store\Model\ScopeInterface::SCOPE_STORE) + ->willReturn(''); + $this->fileSize->expects($this->once()) + ->method('getMaxFileSize') + ->willReturn(9999999); + $this->zendValidator->expects($this->any()) + ->method('addValidator'); + $this->zendValidator->expects($this->once()) + ->method('isValid') + ->with($absolutePath) + ->willReturn(true); + } + + public function testValidate() + { + $relativePath = '/custom_options/quote/file'; + $optionValues = [ + 'quote_path' => '/custom_options/quote/file' + ]; + $this->prepare(); + + $this->directoryRead->expects($this->once()) + ->method('isReadable') + ->with($relativePath) + ->willReturn(true); + $this->assertTrue($this->validator->validate($optionValues, $this->option)); + } + + /** + * @expectedException \Magento\Framework\Exception\LocalizedException + * @expectedExceptionMessage The file 'File Title' for 'Option Title' has an invalid extension. + */ + public function testValidateWithInvalidFile() + { + $relativePath = '/custom_options/quote/file'; + $optionValues = [ + 'quote_path' => '/custom_options/quote/file', + 'title' => 'File Title' + ]; + $this->prepare(); + + $this->directoryRead->expects($this->once()) + ->method('isReadable') + ->with($relativePath) + ->willReturn(false); + $this->option->expects($this->once()) + ->method('getTitle') + ->willReturn('Option Title'); + $this->zendValidator->expects($this->at(2)) + ->method('getErrors') + ->willReturn(true); + $this->zendValidator->expects($this->at(3)) + ->method('getErrors') + ->willReturn([\Zend_Validate_File_ExcludeExtension::FALSE_EXTENSION]); + $this->validator->validate($optionValues, $this->option); + } + + /** + * @expectedException \Magento\Framework\Exception\LocalizedException + * @expectedExceptionMessage Please specify product's required option(s). + */ + public function testValidateWithUnreadableFile() + { + $relativePath = '/custom_options/quote/file'; + $optionValues = [ + 'quote_path' => '/custom_options/quote/file', + 'title' => 'File Title' + ]; + $this->prepare(); + + $this->directoryRead->expects($this->once()) + ->method('isReadable') + ->with($relativePath) + ->willReturn(false); + $this->validator->validate($optionValues, $this->option); + } +} diff --git a/app/code/Magento/Catalog/composer.json b/app/code/Magento/Catalog/composer.json index 732a9b6054523fb7f45b0f716b1514d6a959a94e..4b2838d34c1d36aa008bf80519eaf8e5c2e1a35d 100644 --- a/app/code/Magento/Catalog/composer.json +++ b/app/code/Magento/Catalog/composer.json @@ -27,8 +27,7 @@ "magento/module-media-storage": "1.0.0-beta", "magento/framework": "1.0.0-beta", "magento/module-configurable-product": "self.version", - "magento/module-ui": "self.version", - "magento/magento-composer-installer": "*" + "magento/module-ui": "self.version" }, "suggest": { "magento/module-cookie": "1.0.0-beta" @@ -39,12 +38,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Catalog" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Catalog\\": "" + } } } diff --git a/app/code/Magento/Catalog/etc/acl.xml b/app/code/Magento/Catalog/etc/acl.xml index 408c4cd7295c28becbb5dfee8f7cfd474948c34e..0811d1393129b0dc6ef29ae61fc8793474b6bd78 100644 --- a/app/code/Magento/Catalog/etc/acl.xml +++ b/app/code/Magento/Catalog/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/app/code/Magento/Catalog/etc/adminhtml/di.xml b/app/code/Magento/Catalog/etc/adminhtml/di.xml index 295f42a5b19495d8a1548cb840c1ba06e3de6a17..863877b8fa634d727c4309f40f0561b1799d6839 100644 --- a/app/code/Magento/Catalog/etc/adminhtml/di.xml +++ b/app/code/Magento/Catalog/etc/adminhtml/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <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> diff --git a/app/code/Magento/Catalog/etc/adminhtml/events.xml b/app/code/Magento/Catalog/etc/adminhtml/events.xml index 5f434a1672d6093a8897938a88f333335e20f62c..96670e412d9f50bb19760d13da29013687f0d6ad 100644 --- a/app/code/Magento/Catalog/etc/adminhtml/events.xml +++ b/app/code/Magento/Catalog/etc/adminhtml/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="cms_wysiwyg_images_static_urls_allowed"> <observer name="catalog_wysiwyg" instance="Magento\Catalog\Observer\CatalogCheckIsUsingStaticUrlsAllowedObserver" method="execute" /> </event> diff --git a/app/code/Magento/Catalog/etc/adminhtml/menu.xml b/app/code/Magento/Catalog/etc/adminhtml/menu.xml index 6ebe988c7dc0c8798b61bcb6b04bafbcd532230a..0d9783b0fea0af781b38b548aa6a26cf8abf00d7 100644 --- a/app/code/Magento/Catalog/etc/adminhtml/menu.xml +++ b/app/code/Magento/Catalog/etc/adminhtml/menu.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Backend/etc/menu.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd"> <menu> <add id="Magento_Catalog::catalog" title="Products" module="Magento_Catalog" sortOrder="20" dependsOnModule="Magento_Catalog" resource="Magento_Catalog::catalog"/> <add id="Magento_Catalog::catalog_products" title="Catalog" module="Magento_Catalog" sortOrder="10" parent="Magento_Catalog::inventory" action="catalog/product/" resource="Magento_Catalog::products"/> diff --git a/app/code/Magento/Catalog/etc/adminhtml/routes.xml b/app/code/Magento/Catalog/etc/adminhtml/routes.xml index 0c690d80e4ce183c1b8c0cd49568301a17888fea..ddfed985d9cf0b0b156f6df392d7a2e55a8f81dd 100644 --- a/app/code/Magento/Catalog/etc/adminhtml/routes.xml +++ b/app/code/Magento/Catalog/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="admin"> <route id="catalog" frontName="catalog"> <module name="Magento_Catalog" before="Magento_Backend" /> diff --git a/app/code/Magento/Catalog/etc/adminhtml/system.xml b/app/code/Magento/Catalog/etc/adminhtml/system.xml index 3b914826a2ac44449f419e108c04f5aacbe1a241..1b817e99c6873f9ac53bc928ed5e3be41cce0bcb 100644 --- a/app/code/Magento/Catalog/etc/adminhtml/system.xml +++ b/app/code/Magento/Catalog/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <tab id="catalog" translate="label" sortOrder="200"> <label>Catalog</label> diff --git a/app/code/Magento/Catalog/etc/catalog_attributes.xml b/app/code/Magento/Catalog/etc/catalog_attributes.xml index 3047ea441e2e348415f0d1fc9cfa005eb938c58d..706f98bbce3b7273c70e3a3a9d99f719a1c7f900 100644 --- a/app/code/Magento/Catalog/etc/catalog_attributes.xml +++ b/app/code/Magento/Catalog/etc/catalog_attributes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Catalog/etc/catalog_attributes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/catalog_attributes.xsd"> <group name="catalog_category"> <attribute name="name"/> <attribute name="is_active"/> diff --git a/app/code/Magento/Catalog/etc/config.xml b/app/code/Magento/Catalog/etc/config.xml index 75518179376fbb2d52d8dcb94379d29c41fb51d2..770b4936cff3eb6343ba1d72bbc6757405412ebf 100644 --- a/app/code/Magento/Catalog/etc/config.xml +++ b/app/code/Magento/Catalog/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <catalog> <navigation> diff --git a/app/code/Magento/Catalog/etc/crontab.xml b/app/code/Magento/Catalog/etc/crontab.xml index 7fb5b8bbd0293f126e1d1db36636d57c6c8297de..1a2664b36b58c1551bc664c893de0ca5563fa03c 100644 --- a/app/code/Magento/Catalog/etc/crontab.xml +++ b/app/code/Magento/Catalog/etc/crontab.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Cron/etc/crontab.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd"> <group id="default"> <job name="catalog_index_refresh_price" instance="Magento\Catalog\Cron\RefreshSpecialPrices" method="execute"> <schedule>0 * * * *</schedule> diff --git a/app/code/Magento/Catalog/etc/di.xml b/app/code/Magento/Catalog/etc/di.xml index a2bc7bcf6e1c6793aea2bda2f72d231393d50d7a..60d25ceb7e4770c8885cfc3886cb9d7cf0bde54f 100644 --- a/app/code/Magento/Catalog/etc/di.xml +++ b/app/code/Magento/Catalog/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Catalog\Api\Data\ProductInterface" type="Magento\Catalog\Model\Product" /> <preference for="Magento\Catalog\Api\ProductRepositoryInterface" type="Magento\Catalog\Model\ProductRepository" /> <preference for="Magento\Catalog\Api\CategoryAttributeRepositoryInterface" type="Magento\Catalog\Model\Category\AttributeRepository" /> @@ -468,6 +468,8 @@ <preference for="Magento\Catalog\Api\Data\CategoryProductLinkInterface" type="Magento\Catalog\Model\CategoryProductLink" /> <preference for="Magento\Catalog\Api\ProductCustomOptionTypeListInterface" type="Magento\Catalog\Model\ProductOptions\TypeList" /> <preference for="Magento\Catalog\Api\Data\ProductCustomOptionValuesInterface" type="\Magento\Catalog\Model\Product\Option\Value" /> + <preference for="Magento\Catalog\Api\Data\CustomOptionInterface" type="Magento\Catalog\Model\CustomOptions\CustomOption" /> + <preference for="Magento\Catalog\Api\Data\ProductOptionInterface" type="Magento\Catalog\Model\ProductOption" /> <virtualType name="Magento\Catalog\Model\Resource\Attribute\Collection" type="Magento\Eav\Model\Resource\Entity\Attribute\Collection"> </virtualType> <type name="Magento\Catalog\Api\ProductRepositoryInterface"> @@ -514,4 +516,18 @@ </argument> </arguments> </type> + <type name="Magento\Quote\Model\Quote\Item\Repository"> + <arguments> + <argument name="cartItemProcessors" xsi:type="array"> + <item name="custom_options" xsi:type="object">Magento\Catalog\Model\CustomOptions\CustomOptionProcessor</item> + </argument> + </arguments> + </type> + <type name="Magento\Sales\Api\OrderItemRepositoryInterface"> + <arguments> + <argument name="processorPool" xsi:type="array"> + <item name="custom_options" xsi:type="object">Magento\Catalog\Model\ProductOptionProcessor</item> + </argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/Catalog/etc/eav_attributes.xml b/app/code/Magento/Catalog/etc/eav_attributes.xml index 37623d9894b7f57a3c9ec1d8d4d6246b1ac69a16..9bccbe40656c9b5131a28f74ce001e591a0013c7 100644 --- a/app/code/Magento/Catalog/etc/eav_attributes.xml +++ b/app/code/Magento/Catalog/etc/eav_attributes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Eav/etc/eav_attributes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Eav:etc/eav_attributes.xsd"> <entity type="catalog_product"> <attribute code="sku"> <field code="is_global" locked="true" /> diff --git a/app/code/Magento/Catalog/etc/extension_attributes.xml b/app/code/Magento/Catalog/etc/extension_attributes.xml index 53c5e40db57372fe468aa8211427e722c380b70d..416a7c49a4fc3170c87d86c1ffd47ac86c847e38 100644 --- a/app/code/Magento/Catalog/etc/extension_attributes.xml +++ b/app/code/Magento/Catalog/etc/extension_attributes.xml @@ -5,8 +5,18 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Api/etc/extension_attributes.xsd"> + +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> + <extension_attributes for="Magento\Quote\Api\Data\ProductOptionInterface"> + <attribute code="custom_options" type="Magento\Catalog\Api\Data\CustomOptionInterface[]" /> + </extension_attributes> + <extension_attributes for="Magento\Catalog\Api\Data\ProductOptionInterface"> + <attribute code="custom_options" type="Magento\Catalog\Api\Data\CustomOptionInterface[]" /> + </extension_attributes> + <extension_attributes for="Magento\Catalog\Api\Data\CustomOptionInterface"> + <attribute code="file_info" type="Magento\Framework\Api\Data\ImageContentInterface"/> + </extension_attributes> <extension_attributes for="Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface"> <attribute code="video_content" type="Magento\Framework\Api\Data\VideoContentInterface" /> </extension_attributes> -</config> \ No newline at end of file +</config> diff --git a/app/code/Magento/Catalog/etc/frontend/di.xml b/app/code/Magento/Catalog/etc/frontend/di.xml index 328a35a83afa94594675fc685c0392abcbebc317..6cdb065f323ab4bd5de0d0c0f902ccdcae045367 100644 --- a/app/code/Magento/Catalog/etc/frontend/di.xml +++ b/app/code/Magento/Catalog/etc/frontend/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Catalog\Model\Resource\Category\Collection"> <arguments> <argument name="fetchStrategy" xsi:type="object">Magento\Framework\Data\Collection\Db\FetchStrategy\Cache</argument> diff --git a/app/code/Magento/Catalog/etc/frontend/events.xml b/app/code/Magento/Catalog/etc/frontend/events.xml index 219c16c445a777770729b54c9118fc21b8929801..1cd4531d5adf995face225583b5f0c3258187454 100644 --- a/app/code/Magento/Catalog/etc/frontend/events.xml +++ b/app/code/Magento/Catalog/etc/frontend/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="customer_login"> <observer name="catalog" instance="Magento\Catalog\Observer\Compare\BindCustomerLoginObserver" method="execute" shared="false" /> </event> diff --git a/app/code/Magento/Catalog/etc/frontend/page_types.xml b/app/code/Magento/Catalog/etc/frontend/page_types.xml index 7dc0beef39a5bfe7c47a704f09831547c1e9629d..421e2ae521cc931452ef462e0a81f5fd2d3fc839 100644 --- a/app/code/Magento/Catalog/etc/frontend/page_types.xml +++ b/app/code/Magento/Catalog/etc/frontend/page_types.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page_types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_types.xsd"> +<page_types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_types.xsd"> <type id="catalog_category_view" label="Catalog Category"/> <type id="catalog_product_compare_index" label="Catalog Product Compare List"/> <type id="catalog_product_gallery" label="Catalog Product Image Gallery Popup"/> diff --git a/app/code/Magento/Catalog/etc/frontend/routes.xml b/app/code/Magento/Catalog/etc/frontend/routes.xml index 4f887b5f4baea78b4f0cf92a83cb019d6a113a1e..dbca250557aadc75981b07800cd912aa6c5d5792 100644 --- a/app/code/Magento/Catalog/etc/frontend/routes.xml +++ b/app/code/Magento/Catalog/etc/frontend/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn: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/etc/frontend/sections.xml b/app/code/Magento/Catalog/etc/frontend/sections.xml index 0b4c17a28cde9983242579a03b97e4d3f8d3d8f2..b413a6fe27deefbfe6b12efd932748126bbe24aa 100644 --- a/app/code/Magento/Catalog/etc/frontend/sections.xml +++ b/app/code/Magento/Catalog/etc/frontend/sections.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../Magento/Customer/etc/sections.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd"> <action name="catalog/product_compare/add"> <section name="compare-products"/> </action> diff --git a/app/code/Magento/Catalog/etc/indexer.xml b/app/code/Magento/Catalog/etc/indexer.xml index 9d47564852fb75bc0954bddbdafbbb4f4687af72..62b4930a6b92900b7368326e74357d4d68328e9c 100644 --- a/app/code/Magento/Catalog/etc/indexer.xml +++ b/app/code/Magento/Catalog/etc/indexer.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Indexer/etc/indexer.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Indexer/etc/indexer.xsd"> <indexer id="catalog_product_flat" view_id="catalog_product_flat" class="Magento\Catalog\Model\Indexer\Product\Flat"> <title translate="true">Product Flat Data</title> <description translate="true">Reorganize EAV product structure to flat structure</description> diff --git a/app/code/Magento/Catalog/etc/module.xml b/app/code/Magento/Catalog/etc/module.xml index ace5d6f78eb07415e33b681700926508558ba3b1..dd1aeca305761fc7a8a5e657ed18a9d15abace24 100644 --- a/app/code/Magento/Catalog/etc/module.xml +++ b/app/code/Magento/Catalog/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Catalog" setup_version="2.0.1"> <sequence> <module name="Magento_Eav"/> diff --git a/app/code/Magento/Catalog/etc/mview.xml b/app/code/Magento/Catalog/etc/mview.xml index 292dc1d421642ca866937f3aeb18988048ed55a9..b7eced86158e5920c03440351b679aaab13a6a08 100644 --- a/app/code/Magento/Catalog/etc/mview.xml +++ b/app/code/Magento/Catalog/etc/mview.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Mview/etc/mview.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Mview/etc/mview.xsd"> <view id="catalog_category_flat" class="Magento\Catalog\Model\Indexer\Category\Flat" group="indexer"> <subscriptions> <table name="catalog_category_entity" entity_column="entity_id" /> diff --git a/app/code/Magento/Catalog/etc/product_options.xml b/app/code/Magento/Catalog/etc/product_options.xml index d1c60935ad5f9124393ce606e6b6b991dc668ae3..42ab096937d77a2435d92cf9d47f815bde74567e 100644 --- a/app/code/Magento/Catalog/etc/product_options.xml +++ b/app/code/Magento/Catalog/etc/product_options.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Catalog/etc/product_options.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/product_options.xsd"> <option name="text" label="Text" renderer="Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Options\Type\Text"> <inputType name="field" label="Field" /> <inputType name="area" label="Area" /> diff --git a/app/code/Magento/Catalog/etc/product_types.xml b/app/code/Magento/Catalog/etc/product_types.xml index 4998c0cae3359b28da9703ea6caabc2ae1119c31..a5ab3be0db2c508f9fb604ea11c6c6ce065b48b7 100644 --- a/app/code/Magento/Catalog/etc/product_types.xml +++ b/app/code/Magento/Catalog/etc/product_types.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Catalog/etc/product_types.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/product_types.xsd"> <type name="simple" label="Simple Product" modelInstance="Magento\Catalog\Model\Product\Type\Simple" indexPriority="10" sortOrder="10"> <customAttributes> <attribute name="refundable" value="true"/> diff --git a/app/code/Magento/Catalog/etc/view.xml b/app/code/Magento/Catalog/etc/view.xml index e487426151f62a045bcf0b79a177c86f867bbec7..fd4b28a0bd4458786b722337cebd818b2278630d 100644 --- a/app/code/Magento/Catalog/etc/view.xml +++ b/app/code/Magento/Catalog/etc/view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="view.xsd"> +<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/view.xsd"> <vars module="Magento_Catalog"> <var name="product_image_white_borders">1</var> </vars> diff --git a/app/code/Magento/Catalog/etc/webapi.xml b/app/code/Magento/Catalog/etc/webapi.xml index 498863eeb9ab235122afc8a9517acb198da17435..24492cbc019b977e402a81c66b1f2f81163b2a2a 100644 --- a/app/code/Magento/Catalog/etc/webapi.xml +++ b/app/code/Magento/Catalog/etc/webapi.xml @@ -6,7 +6,7 @@ */ --> <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../app/code/Magento/Webapi/etc/webapi.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd"> <!-- Product Service --> <route url="/V1/products" method="POST"> diff --git a/app/code/Magento/Catalog/etc/webapi_rest/di.xml b/app/code/Magento/Catalog/etc/webapi_rest/di.xml index 3f332bacb9e8675111f0bb462ce6822cbdaeacdc..84caa2541da98972f4fe29bbf92ff3be7910be91 100644 --- a/app/code/Magento/Catalog/etc/webapi_rest/di.xml +++ b/app/code/Magento/Catalog/etc/webapi_rest/di.xml @@ -5,7 +5,11 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> + +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> + <preference for="Magento\Catalog\Model\Product\Option\Type\Date" type="Magento\Catalog\Model\Webapi\Product\Option\Type\Date" /> + <preference for="Magento\Catalog\Model\Product\Option\Type\File\ValidatorInfo" type="Magento\Catalog\Model\Webapi\Product\Option\Type\File\Validator" /> + <type name="Magento\Catalog\Helper\Product\ConfigurationPool"> <arguments> <argument name="instancesByType" xsi:type="array"> diff --git a/app/code/Magento/Catalog/etc/webapi_soap/di.xml b/app/code/Magento/Catalog/etc/webapi_soap/di.xml index 3f332bacb9e8675111f0bb462ce6822cbdaeacdc..57ef5276afebda4cae406b2dd477ce511a06fc8a 100644 --- a/app/code/Magento/Catalog/etc/webapi_soap/di.xml +++ b/app/code/Magento/Catalog/etc/webapi_soap/di.xml @@ -5,7 +5,9 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> + +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> + <preference for="Magento\Catalog\Model\Product\Option\Type\Date" type="Magento\Catalog\Model\Webapi\Product\Option\Type\Date" /> <type name="Magento\Catalog\Helper\Product\ConfigurationPool"> <arguments> <argument name="instancesByType" xsi:type="array"> diff --git a/app/code/Magento/Catalog/etc/widget.xml b/app/code/Magento/Catalog/etc/widget.xml index 9317297c3e3329bf860e4cc6bc24a9a490249a91..127efb3a4537b92c7239d5d857108c7b8bcb92c8 100644 --- a/app/code/Magento/Catalog/etc/widget.xml +++ b/app/code/Magento/Catalog/etc/widget.xml @@ -6,7 +6,7 @@ */ --> <widgets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../Magento/Widget/etc/widget.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Widget:etc/widget.xsd"> <widget id="new_products" class="Magento\Catalog\Block\Product\Widget\NewWidget" is_email_compatible="true" placeholder_image="Magento_Catalog::images/product_widget_new.png" ttl="86400"> <label translate="true">Catalog New Products List</label> diff --git a/app/code/Magento/Catalog/registration.php b/app/code/Magento/Catalog/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..06bb9881a1640b2127986844503f6f78ffe3f893 --- /dev/null +++ b/app/code/Magento/Catalog/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Catalog', + __DIR__ +); diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/CATALOG_PRODUCT_COMPOSITE_CONFIGURE.xml b/app/code/Magento/Catalog/view/adminhtml/layout/CATALOG_PRODUCT_COMPOSITE_CONFIGURE.xml index 87798013492e43395455f53bbeb32bf5a6a89d60..718c0440fb376853bf5e29a5fcce6f74e1cc1432 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/CATALOG_PRODUCT_COMPOSITE_CONFIGURE.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/CATALOG_PRODUCT_COMPOSITE_CONFIGURE.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root"> <block class="Magento\Catalog\Block\Adminhtml\Product\Composite\Fieldset" name="product.composite.fieldset"> <block class="Magento\Catalog\Block\Adminhtml\Product\Composite\Fieldset\Options" template="catalog/product/composite/fieldset/options.phtml"> diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/CATALOG_PRODUCT_COMPOSITE_CONFIGURE_ERROR.xml b/app/code/Magento/Catalog/view/adminhtml/layout/CATALOG_PRODUCT_COMPOSITE_CONFIGURE_ERROR.xml index 42a5aeccb7a2f79a09efd9a70943da6b9fe531e6..936170ecea211c7cea094099e1334be3e9ce6196 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/CATALOG_PRODUCT_COMPOSITE_CONFIGURE_ERROR.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/CATALOG_PRODUCT_COMPOSITE_CONFIGURE_ERROR.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root"> <block class="Magento\Catalog\Block\Adminhtml\Product\Composite\Error" name="product.composite.error"/> <block class="Magento\Framework\Pricing\Render" name="product.price.render.default"> diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/CATALOG_PRODUCT_COMPOSITE_UPDATE_RESULT.xml b/app/code/Magento/Catalog/view/adminhtml/layout/CATALOG_PRODUCT_COMPOSITE_UPDATE_RESULT.xml index 0fffb0a5eebb905bb03b0bf713e87bf6a25805f8..9f6758fddd77cce01bddf1382d44a78ba9730fa5 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/CATALOG_PRODUCT_COMPOSITE_UPDATE_RESULT.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/CATALOG_PRODUCT_COMPOSITE_UPDATE_RESULT.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root"> <block class="Magento\Catalog\Block\Adminhtml\Product\Composite\Update\Result" name="product.composite.update.result"/> <block class="Magento\Framework\Pricing\Render" name="product.price.render.default"> diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_category_edit.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_category_edit.xml index b70f31162fff2fb5b377ac9c98a4831c58eb8e1a..751b71449d794c101e111552bbf8a329e570ce09 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_category_edit.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_category_edit.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <css src="jquery/fileUploader/css/jquery.fileupload-ui.css"/> </head> diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_action_attribute_edit.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_action_attribute_edit.xml index c906770cb72824bf39652209b29d854b94431281..a4c754e6de2c9961a358191da5f6a473c827581c 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_action_attribute_edit.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_action_attribute_edit.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="page.main.actions"> <block class="Magento\Backend\Block\Store\Switcher" name="store_switcher" template="Magento_Backend::store/switcher.phtml"/> diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_alertspricegrid.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_alertspricegrid.xml index 6ebc1a76d29413973e912a8b600c45d91ef3f7ec..6b2a6cb851b55a09f5006b6206f69273be5d5d07 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_alertspricegrid.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_alertspricegrid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root"> <block class="Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Alerts\Price" name="admin.product.edit.tab.alerts.price"/> </container> diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_alertsstockgrid.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_alertsstockgrid.xml index 3fbc9bdae246b04c6d6cc8d3f2bf166feffea2b8..04b6c148ebd7813472b3f19f3d1802219ed04da4 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_alertsstockgrid.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_alertsstockgrid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root"> <block class="Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Alerts\Stock" name="admin.product.edit.tab.alerts.stock"/> </container> diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_attribute_edit.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_attribute_edit.xml index ed4308b081ae6cdf49c6434f41f6cbc285d6f75c..48cf982efc24fe2343a5d485d7d9e03e6b59745d 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_attribute_edit.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_attribute_edit.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="left"> <block class="Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Tabs" name="attribute_edit_tabs"> diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_attribute_edit_popup.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_attribute_edit_popup.xml index 3e99afa0dbeacd4ebf21f3320e2cc5a11a86d7d2..9b4087c9d24ddffec5c9c6e507af079fe3ce0d82 100755 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_attribute_edit_popup.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_attribute_edit_popup.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page layout="admin-1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page layout="admin-1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="notifications" remove="true"/> <referenceBlock name="locale.switcher" remove="true"/> diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_crosssell.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_crosssell.xml index c2f1bc7b877b9300c469d1b9a8ccafff94e70e29..788200977c54ede0db38f7a43364527434946b30 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_crosssell.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_crosssell.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root" label="Root"> <block class="Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Crosssell" name="catalog.product.edit.tab.crosssell"/> <block class="Magento\Backend\Block\Widget\Grid\Serializer" name="crosssell_grid_serializer"> diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_crosssellgrid.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_crosssellgrid.xml index e954b943522ab28f063d951b3971a93d5db9afd8..e8e7fe5c72df7d7a2e4cf4c2bd37fe6db1795f74 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_crosssellgrid.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_crosssellgrid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root" label="Root"> <block class="Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Crosssell" name="catalog.product.edit.tab.crosssell"/> </container> diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_customoptions.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_customoptions.xml index ea0aa946b399825326db92fcf43f41d931b63d7c..1dadc59400adedf7cf85f0b28bc627c563ed6111 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_customoptions.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_customoptions.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root" label="Root"> <block class="Magento\Catalog\Block\Adminhtml\Product\Options\Ajax" name="catalog.product.import.custom.options"/> </container> diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_edit.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_edit.xml index dda778ccfb92860c07fd0aec15712d90beda1824..d60af679da888b0a8067f5fb652187411d9e47bb 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_edit.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_edit.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="catalog_product_new"/> <body> <referenceBlock name="page.title"> diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_grid.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_grid.xml index 953d28868c7b663f5fbb60324986e0021e1e85b2..a9679c30841006ed79d59671d3aa2d831af4ead6 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_grid.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_grid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <update handle="formkey"/> <container name="root" label="Root"> <block class="Magento\Catalog\Block\Adminhtml\Product\Grid" name="admin.product.grid"/> diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_index.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_index.xml index c61f287a6aad330814187a7d8cdac4d982e276df..219a7593eaad160f6254a8139ec50e465b3f94a9 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_index.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="styles"/> <body> <referenceBlock name="menu"> diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_new.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_new.xml index c0605b000485fe572e5e5fc365e531e1f63bcb3d..3882bec15c528bdf6436235dd7d5dea4c0e8d27d 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_new.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_new.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <css src="jquery/fileUploader/css/jquery.fileupload-ui.css"/> <css src="Magento_Catalog::catalog/category-selector.css"/> diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_options.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_options.xml index 49a9c80f3c499d1b32e49bd79d50a477d33f0628..70d467c3cc4f01734ef0abf2d26fc746f1ae29f2 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_options.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_options.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root" label="Root"> <block class="Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Options" name="admin.product.options"/> </container> diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_optionsimportgrid.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_optionsimportgrid.xml index 0793b33a84b5351b9258bc190a0ce641bf763ce0..3030bdc5a6b564020c8f3845cbb0bec9008d283e 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_optionsimportgrid.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_optionsimportgrid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root" label="Root"> <block class="Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Options\Popup\Grid" name="catalog.product.import.custom.options"/> </container> diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_related.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_related.xml index d5ac0717cb2b16e075675b1248e0738891c2ef03..d4203e3f8e4121f28312e2be3ec83bcdf04112bc 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_related.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_related.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root" label="Root"> <block class="Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Related" name="catalog.product.edit.tab.related"/> <block class="Magento\Backend\Block\Widget\Grid\Serializer" name="related_grid_serializer"> diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_relatedgrid.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_relatedgrid.xml index ac7a31113562ec81bc58d73f71afa7d4d4c38085..f50bb0db00fb78f6ded9d802f43223f3b6917db1 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_relatedgrid.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_relatedgrid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root" label="Root"> <block class="Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Related" name="catalog.product.edit.tab.related"/> </container> diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_set_block.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_set_block.xml index 4124f791b06be5f304398f9a7504bdbdda5669be..8937bb572bacbf0ee4afac5d235ed105b15a8b8c 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_set_block.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_set_block.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="adminhtml.catalog.product.set.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.catalog.product.set.grid" as="grid"> diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_set_edit.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_set_edit.xml index 70c75cbb57c68ef4c54dacb622f5ee6981746399..30d421cfe85949e262c51f087306b6d7a25933ee 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_set_edit.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_set_edit.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Catalog\Block\Adminhtml\Product\Attribute\Set\Main" name="adminhtml.catalog.product.set.edit" template="catalog/product/attribute/set/main.phtml"/> diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_set_index.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_set_index.xml index 05d1772f73257f4d9d472fa4d42bce111631a04f..c452615218d673ccb9fb8e8691b35f1625b798cd 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_set_index.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_set_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="formkey"/> <update handle="catalog_product_set_block"/> <body> diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_upsell.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_upsell.xml index b0907b659dea2bde6b9b81b6ee3aed38601865ce..0648822865ad5b89929c575a073e04aeccfa97b3 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_upsell.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_upsell.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root" label="Root"> <block class="Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Upsell" name="catalog.product.edit.tab.upsell"/> <block class="Magento\Backend\Block\Widget\Grid\Serializer" name="upsell_grid_serializer"> diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_upsellgrid.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_upsellgrid.xml index e63a0ee3fedc4ef3a761fafeabedfb19e5dee9cc..971aea638610af809a9f5a66c30de9726e33744d 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_upsellgrid.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_upsellgrid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root" label="Root"> <block class="Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Upsell" name="catalog.product.edit.tab.upsell"/> </container> diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/product/grid/massaction_extended.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/product/grid/massaction_extended.phtml index ff16849927eaf36b39296776b1a411886363fb29..16a8e51523103990c39c3f77c6e07679f3c2c441 100644 --- a/app/code/Magento/Catalog/view/adminhtml/templates/product/grid/massaction_extended.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/templates/product/grid/massaction_extended.phtml @@ -6,9 +6,6 @@ // @codingStandardsIgnoreFile -/** -* @deprecated support Magento 1.x grid massaction implementation (MAGETWO-11122) - */ ?> <div id="<?php echo $block->getHtmlId() ?>" class="admin__grid-massaction"> <?php if ($block->getHideFormElement() !== true):?> diff --git a/app/code/Magento/Catalog/view/adminhtml/ui_component/product_listing.xml b/app/code/Magento/Catalog/view/adminhtml/ui_component/product_listing.xml index e15e5dd3c1340c4aad8a7985e8dbd0749881a554..b000975b7343ec939dfd9ae02f75ae1196d212b2 100644 --- a/app/code/Magento/Catalog/view/adminhtml/ui_component/product_listing.xml +++ b/app/code/Magento/Catalog/view/adminhtml/ui_component/product_listing.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Ui/etc/ui_configuration.xsd"> +<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Ui/etc/ui_configuration.xsd"> <argument name="data" xsi:type="array"> <item name="js_config" xsi:type="array"> <item name="provider" xsi:type="string">product_listing.product_listing_data_source</item> diff --git a/app/code/Magento/Catalog/view/base/layout/catalog_product_prices.xml b/app/code/Magento/Catalog/view/base/layout/catalog_product_prices.xml index 135f43cdce6d9cd07f01de92904d6721f86db2d4..cb57bf62e65583214021fb8302459acf4fa27b35 100644 --- a/app/code/Magento/Catalog/view/base/layout/catalog_product_prices.xml +++ b/app/code/Magento/Catalog/view/base/layout/catalog_product_prices.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <block class="Magento\Framework\Pricing\Render\RendererPool" name="render.product.prices"> <arguments> <argument name="default" xsi:type="array"> diff --git a/app/code/Magento/Catalog/view/base/layout/default.xml b/app/code/Magento/Catalog/view/base/layout/default.xml index 5f0df6827e5fccc615a2a8e210d641cad2edcaa8..ac4a3e31bccd7bdd7a9b45596221d985301a2f3f 100644 --- a/app/code/Magento/Catalog/view/base/layout/default.xml +++ b/app/code/Magento/Catalog/view/base/layout/default.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <block class="Magento\Framework\Pricing\Render" name="product.price.render.default"> <arguments> diff --git a/app/code/Magento/Catalog/view/base/layout/empty.xml b/app/code/Magento/Catalog/view/base/layout/empty.xml index 5f0df6827e5fccc615a2a8e210d641cad2edcaa8..ac4a3e31bccd7bdd7a9b45596221d985301a2f3f 100644 --- a/app/code/Magento/Catalog/view/base/layout/empty.xml +++ b/app/code/Magento/Catalog/view/base/layout/empty.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <block class="Magento\Framework\Pricing\Render" name="product.price.render.default"> <arguments> diff --git a/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view.xml b/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view.xml index 0deca46153b69ce9e56169c8c7273be53e582bb7..72aabb5be51f35b274311bd0b3b81d6c44eb2607 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="columns.top"> <container name="category.view.container" htmlTag="div" htmlClass="category-view" after="-"> diff --git a/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view_type_default.xml b/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view_type_default.xml index 1ab06f70b33dac141e7ede531671121575736097..c1d5e0785318d11ff871c1b1a05cd26086337a9c 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view_type_default.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view_type_default.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="sidebar.main"> <block class="Magento\Catalog\Block\Navigation" name="catalog.leftnav" before="-" template="navigation/left.phtml"/> diff --git a/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view_type_default_without_children.xml b/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view_type_default_without_children.xml index a024d6e563cb581c15476d71430b89f2dd05ea36..44eec0b583d14104b76b334e2395d72d5b2bf778 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view_type_default_without_children.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view_type_default_without_children.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body/> </page> diff --git a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_compare_index.xml b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_compare_index.xml index 6b9e4065e91571a56a17010b6fb1042247735f36..9192099839966a1935e34218db1840d19e7ceced 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_compare_index.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_compare_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="page.main.title"> <action method="setPageTitle"> diff --git a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_gallery.xml b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_gallery.xml index 3eba65002e1a24d3e6c4e6fb744ec1ee337def8c..9555fed561a7f7673ec58eb44e761fd90e5ce1e9 100755 --- a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_gallery.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_gallery.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="root"> <action method="setTemplate"> diff --git a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_opengraph.xml b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_opengraph.xml index b4f9abae1e61b0029b464869c96a6a1f8ee2124a..ec1a3a74deea9e2f0c68860deec5fb2757f1ced9 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_opengraph.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_opengraph.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <attribute name="prefix" value="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# product: http://ogp.me/ns/product#" /> </head> 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 09b23fc3465d1a515835d57267ee5bd1b44bdc06..9428bf3a55b86891c9303027df8f0c07b86cbb24 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 @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <css src="mage/gallery/gallery.css"/> </head> diff --git a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view_type_simple.xml b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view_type_simple.xml index 6ee348a24c06388e3fee9fa120d557b03b1ed2c7..6a94f092a1d33ca759d60ccf67942ca2dec3a36a 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view_type_simple.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view_type_simple.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="product.info.type"> <block class="Magento\Catalog\Block\Product\View\Type\Simple" name="product.info.simple" as="product_type_data" template="product/view/type/default.phtml"/> diff --git a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view_type_virtual.xml b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view_type_virtual.xml index 722ff8f307c2b09da71e8955373f276899695430..83442b9559215b01c8122a1fff5176eb1ca30e15 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view_type_virtual.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view_type_virtual.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="product.info.type"> <block class="Magento\Catalog\Block\Product\View\Type\Virtual" name="product.info.virtual" as="product_type_data" template="product/view/type/default.phtml"/> diff --git a/app/code/Magento/Catalog/view/frontend/layout/checkout_cart_item_renderers.xml b/app/code/Magento/Catalog/view/frontend/layout/checkout_cart_item_renderers.xml index 8760461ac724838b80814aee5db7c635edaccf82..5286a1c03b9fe43ad60cf9934782fbf1cc423294 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/checkout_cart_item_renderers.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/checkout_cart_item_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout.cart.item.renderers"> <block class="Magento\Checkout\Block\Cart\Item\Renderer" as="virtual" template="cart/item/default.phtml"> diff --git a/app/code/Magento/Catalog/view/frontend/layout/default.xml b/app/code/Magento/Catalog/view/frontend/layout/default.xml index eafab8d764e6c8c402d98530915737e48ceadb3b..bfc1a32492d6783c26b0352be818d6efe31cce07 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/default.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/default.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="top.links"> <block class="Magento\Framework\View\Element\Template" name="catalog.compare.link" before="-" diff --git a/app/code/Magento/CatalogImportExport/composer.json b/app/code/Magento/CatalogImportExport/composer.json index 5a8ed9cc3086d905e0a54346ff1bd4c70bf59546..553da0c22bbba55633005e20e7756fd42caca746 100644 --- a/app/code/Magento/CatalogImportExport/composer.json +++ b/app/code/Magento/CatalogImportExport/composer.json @@ -12,8 +12,7 @@ "magento/module-media-storage": "1.0.0-beta", "magento/module-customer": "1.0.0-beta", "magento/framework": "1.0.0-beta", - "ext-ctype": "*", - "magento/magento-composer-installer": "*" + "ext-ctype": "*" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -21,12 +20,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/CatalogImportExport" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\CatalogImportExport\\": "" + } } } diff --git a/app/code/Magento/CatalogImportExport/etc/config.xml b/app/code/Magento/CatalogImportExport/etc/config.xml index 707ae08d9c77fe25b799ff5199b36bf69f93de61..820f581576acee70f7c2268a170b6cc4cfc7ba08 100644 --- a/app/code/Magento/CatalogImportExport/etc/config.xml +++ b/app/code/Magento/CatalogImportExport/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <export> </export> diff --git a/app/code/Magento/CatalogImportExport/etc/di.xml b/app/code/Magento/CatalogImportExport/etc/di.xml index 1af0ab15f61444d0b9ddec9dd3c3e08ebb1b0bbd..51d6d92321feafa5287489c3456a8446a0e601fd 100644 --- a/app/code/Magento/CatalogImportExport/etc/di.xml +++ b/app/code/Magento/CatalogImportExport/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\CatalogImportExport\Model\Export\RowCustomizerInterface" type="Magento\CatalogImportExport\Model\Export\RowCustomizer\Composite" /> <type name="Magento\ImportExport\Model\Import"> <plugin name="catalogProductFlatIndexerImport" type="\Magento\CatalogImportExport\Model\Indexer\Product\Flat\Plugin\Import" /> diff --git a/app/code/Magento/CatalogImportExport/etc/export.xml b/app/code/Magento/CatalogImportExport/etc/export.xml index 683771db89fa6840119796ca60f7adcecfea55da..bf6c7ed2e6b2f38a5e9b6ea8e7341efe753827fe 100644 --- a/app/code/Magento/CatalogImportExport/etc/export.xml +++ b/app/code/Magento/CatalogImportExport/etc/export.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../ImportExport/etc/export.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_ImportExport:etc/export.xsd"> <entity name="catalog_product" label="Products" model="Magento\CatalogImportExport\Model\Export\Product" entityAttributeFilterType="catalog_product"/> <entityType entity="catalog_product" name="simple" model="Magento\CatalogImportExport\Model\Export\Product\Type\Simple" /> <entityType entity="catalog_product" name="virtual" model="Magento\CatalogImportExport\Model\Export\Product\Type\Simple" /> diff --git a/app/code/Magento/CatalogImportExport/etc/import.xml b/app/code/Magento/CatalogImportExport/etc/import.xml index be9807d91486669da2395d01c4e6d33ac776f5a6..8f86f96e44c2731079811cf60d4e892eb954601e 100644 --- a/app/code/Magento/CatalogImportExport/etc/import.xml +++ b/app/code/Magento/CatalogImportExport/etc/import.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../ImportExport/etc/import.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_ImportExport:etc/import.xsd"> <entity name="catalog_product" label="Products" model="Magento\CatalogImportExport\Model\Import\Product" behaviorModel="Magento\ImportExport\Model\Source\Import\Behavior\Basic" /> <entityType entity="catalog_product" name="simple" model="Magento\CatalogImportExport\Model\Import\Product\Type\Simple" /> <entityType entity="catalog_product" name="virtual" model="Magento\CatalogImportExport\Model\Import\Product\Type\Virtual" /> diff --git a/app/code/Magento/CatalogImportExport/etc/module.xml b/app/code/Magento/CatalogImportExport/etc/module.xml index b54786a0521ceb3f4104810a3eb3856744239d0d..755b32f6ef71bd71ad090b3e6c73c0c715615811 100644 --- a/app/code/Magento/CatalogImportExport/etc/module.xml +++ b/app/code/Magento/CatalogImportExport/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_CatalogImportExport" setup_version="2.0.0"> </module> </config> diff --git a/app/code/Magento/CatalogImportExport/registration.php b/app/code/Magento/CatalogImportExport/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..a7f56291680a1dbc5ea398674645e0efe4deeeb8 --- /dev/null +++ b/app/code/Magento/CatalogImportExport/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_CatalogImportExport', + __DIR__ +); diff --git a/app/code/Magento/CatalogInventory/composer.json b/app/code/Magento/CatalogInventory/composer.json index 991c2a36d4479869ca51e9f3942b61eb1475511a..bb6833528e84925425fa3bdae6383d0df2f02a2f 100644 --- a/app/code/Magento/CatalogInventory/composer.json +++ b/app/code/Magento/CatalogInventory/composer.json @@ -10,8 +10,7 @@ "magento/module-eav": "1.0.0-beta", "magento/module-quote": "1.0.0-beta", "magento/framework": "1.0.0-beta", - "magento/module-ui": "self.version", - "magento/magento-composer-installer": "*" + "magento/module-ui": "self.version" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -19,12 +18,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/CatalogInventory" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\CatalogInventory\\": "" + } } } diff --git a/app/code/Magento/CatalogInventory/etc/acl.xml b/app/code/Magento/CatalogInventory/etc/acl.xml index 64726f2802948c0de5d836e53925f74e3603bd27..9f04d41794fbdcf150aca5a1dccfaa42c83a1e96 100644 --- a/app/code/Magento/CatalogInventory/etc/acl.xml +++ b/app/code/Magento/CatalogInventory/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/app/code/Magento/CatalogInventory/etc/adminhtml/di.xml b/app/code/Magento/CatalogInventory/etc/adminhtml/di.xml index 3dd1f22f53de915d9af56a44b3219dd2df3a674c..e5eb6603b1592ce945f38cf8d02be9bfe773cfa1 100644 --- a/app/code/Magento/CatalogInventory/etc/adminhtml/di.xml +++ b/app/code/Magento/CatalogInventory/etc/adminhtml/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\CatalogInventory\Model\Stock\Item" type="Magento\CatalogInventory\Model\Adminhtml\Stock\Item" /> <type name="Magento\Catalog\Model\Product\CopyConstructor\Composite"> <arguments> diff --git a/app/code/Magento/CatalogInventory/etc/adminhtml/system.xml b/app/code/Magento/CatalogInventory/etc/adminhtml/system.xml index 4155c546202032ff28065dfff77eee82745e3ed7..d3b611bd1f45d7b046dd8e62e87955345cd6b706 100644 --- a/app/code/Magento/CatalogInventory/etc/adminhtml/system.xml +++ b/app/code/Magento/CatalogInventory/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="cataloginventory" translate="label" type="text" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Inventory</label> diff --git a/app/code/Magento/CatalogInventory/etc/config.xml b/app/code/Magento/CatalogInventory/etc/config.xml index 52c6f7ce2f7b2e11a2cff2c3bd2f3e066e916835..97e7e90a7bf500313af4b5d0e0558eca9bf0eb1b 100644 --- a/app/code/Magento/CatalogInventory/etc/config.xml +++ b/app/code/Magento/CatalogInventory/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <cataloginventory> <options> diff --git a/app/code/Magento/CatalogInventory/etc/di.xml b/app/code/Magento/CatalogInventory/etc/di.xml index 4332e525c3260619830f2e5f2102759edf2e346e..f16ec07ea279a7b6e9a3073f14b671ff47d5a920 100644 --- a/app/code/Magento/CatalogInventory/etc/di.xml +++ b/app/code/Magento/CatalogInventory/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\CatalogInventory\Api\Data\StockInterface" type="Magento\CatalogInventory\Model\Stock" /> <preference for="Magento\CatalogInventory\Api\Data\StockItemInterface" type="Magento\CatalogInventory\Model\Stock\Item" /> <preference for="Magento\CatalogInventory\Api\Data\StockStatusInterface" type="Magento\CatalogInventory\Model\Stock\Status" /> diff --git a/app/code/Magento/CatalogInventory/etc/events.xml b/app/code/Magento/CatalogInventory/etc/events.xml index 59b7b88391e2bb2c4b73b5de5dd715d20243df84..536c465e4b3e68788b7812e42ac56359590068b6 100644 --- a/app/code/Magento/CatalogInventory/etc/events.xml +++ b/app/code/Magento/CatalogInventory/etc/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="catalog_block_product_status_display"> <observer name="inventory" instance="Magento\CatalogInventory\Observer\DisplayProductStatusInfoObserver" method="execute"/> </event> diff --git a/app/code/Magento/CatalogInventory/etc/extension_attributes.xml b/app/code/Magento/CatalogInventory/etc/extension_attributes.xml index aeb9bc602fbae927efd85d59a8019da5df6b4669..8c49230c9dbc3025f8735d71dd4b6050838ff9dc 100644 --- a/app/code/Magento/CatalogInventory/etc/extension_attributes.xml +++ b/app/code/Magento/CatalogInventory/etc/extension_attributes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Api/etc/extension_attributes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> <extension_attributes for="Magento\Catalog\Api\Data\ProductInterface"> <attribute code="stock_item" type="Magento\CatalogInventory\Api\Data\StockItemInterface"> <resources> diff --git a/app/code/Magento/CatalogInventory/etc/indexer.xml b/app/code/Magento/CatalogInventory/etc/indexer.xml index 80b1c5f4faa8e2a7a3fa5b8177a6b69983f1c88c..87b18f22205dc4da95d249da8783c3efaba6d905 100644 --- a/app/code/Magento/CatalogInventory/etc/indexer.xml +++ b/app/code/Magento/CatalogInventory/etc/indexer.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Indexer/etc/indexer.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Indexer/etc/indexer.xsd"> <indexer id="cataloginventory_stock" view_id="cataloginventory_stock" class="Magento\CatalogInventory\Model\Indexer\Stock"> <title translate="true">Stock</title> <description translate="true">Index stock</description> diff --git a/app/code/Magento/CatalogInventory/etc/module.xml b/app/code/Magento/CatalogInventory/etc/module.xml index e13f240678f49d3b087325b4ce5a035dde1b7015..f3226f2450e0248aa85357fdc5af8cf4c5d293dc 100644 --- a/app/code/Magento/CatalogInventory/etc/module.xml +++ b/app/code/Magento/CatalogInventory/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_CatalogInventory" setup_version="2.0.0"> <sequence> <module name="Magento_Catalog"/> diff --git a/app/code/Magento/CatalogInventory/etc/mview.xml b/app/code/Magento/CatalogInventory/etc/mview.xml index 84359fea957f0e684c8b20f6699856720170b908..dac1a5f1ac9cf83fe4966a425aeb3cd45e939a62 100644 --- a/app/code/Magento/CatalogInventory/etc/mview.xml +++ b/app/code/Magento/CatalogInventory/etc/mview.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Mview/etc/mview.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Mview/etc/mview.xsd"> <view id="cataloginventory_stock" class="Magento\CatalogInventory\Model\Indexer\Stock" group="indexer"> <subscriptions> <table name="cataloginventory_stock_item" entity_column="product_id" /> diff --git a/app/code/Magento/CatalogInventory/etc/product_types.xml b/app/code/Magento/CatalogInventory/etc/product_types.xml index dda68f865eb0565263b33dec31577d8992dd3348..d05d2678191d629229ea9f8e174fd2dda0ed34b0 100644 --- a/app/code/Magento/CatalogInventory/etc/product_types.xml +++ b/app/code/Magento/CatalogInventory/etc/product_types.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Catalog/etc/product_types.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/product_types.xsd"> <type name="simple" isQty="true" /> <type name="virtual" isQty="true" /> </config> diff --git a/app/code/Magento/CatalogInventory/etc/webapi.xml b/app/code/Magento/CatalogInventory/etc/webapi.xml index fe200c8628cb130aa2f3847283c7b52e0bac3b23..4f60062b9b30e27670b29906d1d525e7deffeb8d 100644 --- a/app/code/Magento/CatalogInventory/etc/webapi.xml +++ b/app/code/Magento/CatalogInventory/etc/webapi.xml @@ -6,7 +6,7 @@ */ --> <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../app/code/Magento/Webapi/etc/webapi.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd"> <route url="/V1/stockItems/:productSku" method="GET"> <service class="Magento\CatalogInventory\Api\StockRegistryInterface" method="getStockItemBySku"/> <resources> diff --git a/app/code/Magento/CatalogInventory/registration.php b/app/code/Magento/CatalogInventory/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..1e2d5650ddd9998df97e3a982204ce9cbfaa23c1 --- /dev/null +++ b/app/code/Magento/CatalogInventory/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_CatalogInventory', + __DIR__ +); diff --git a/app/code/Magento/CatalogInventory/view/adminhtml/ui_component/product_listing.xml b/app/code/Magento/CatalogInventory/view/adminhtml/ui_component/product_listing.xml index 9851ef90bb95f069c4f4af7b3931e4d17eb8f272..01bd9d50c93f5f69ac9b17c0bf06f292f4301373 100644 --- a/app/code/Magento/CatalogInventory/view/adminhtml/ui_component/product_listing.xml +++ b/app/code/Magento/CatalogInventory/view/adminhtml/ui_component/product_listing.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Ui/etc/ui_configuration.xsd"> +<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Ui/etc/ui_configuration.xsd"> <container name="listing_top"> <filters name="listing_filters" class="Magento\Catalog\Ui\Component\Listing\Filters"> <filterRange name="qty"> diff --git a/app/code/Magento/CatalogInventory/view/frontend/layout/catalog_product_view.xml b/app/code/Magento/CatalogInventory/view/frontend/layout/catalog_product_view.xml index 271f676f7f7ccc83206f3ebae99746422acdcfee..97512ac9bf9c58db62e8935ea69493e83cf81191 100644 --- a/app/code/Magento/CatalogInventory/view/frontend/layout/catalog_product_view.xml +++ b/app/code/Magento/CatalogInventory/view/frontend/layout/catalog_product_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="product.info.extrahint"> <block class="Magento\CatalogInventory\Block\Qtyincrements" name="product.info.extrahint.qtyincrements" template="qtyincrements.phtml"/> diff --git a/app/code/Magento/CatalogInventory/view/frontend/layout/catalog_product_view_type_simple.xml b/app/code/Magento/CatalogInventory/view/frontend/layout/catalog_product_view_type_simple.xml index d50146e51a5f3f3145c75e20b8385891c3422cba..69a37d6a69f9a826e1393c14b28007ffa05a1d33 100644 --- a/app/code/Magento/CatalogInventory/view/frontend/layout/catalog_product_view_type_simple.xml +++ b/app/code/Magento/CatalogInventory/view/frontend/layout/catalog_product_view_type_simple.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="product.info.simple.extra"> <block class="Magento\CatalogInventory\Block\Stockqty\DefaultStockqty" template="stockqty/default.phtml"/> diff --git a/app/code/Magento/CatalogInventory/view/frontend/layout/catalog_product_view_type_virtual.xml b/app/code/Magento/CatalogInventory/view/frontend/layout/catalog_product_view_type_virtual.xml index 99463589550e8a66d41e11e70a86b1ee010f4015..af07fb1bd41d0150cbe618816ed990a4417bff7f 100644 --- a/app/code/Magento/CatalogInventory/view/frontend/layout/catalog_product_view_type_virtual.xml +++ b/app/code/Magento/CatalogInventory/view/frontend/layout/catalog_product_view_type_virtual.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="product.info.virtual.extra"> <block class="Magento\CatalogInventory\Block\Stockqty\DefaultStockqty" template="stockqty/default.phtml"/> diff --git a/app/code/Magento/CatalogRule/composer.json b/app/code/Magento/CatalogRule/composer.json index 887ed8b40e83cf9513fb518be418a16b42bc284e..6ecef40f903ca08d8c204d9b1f7bf2b953d4e76c 100644 --- a/app/code/Magento/CatalogRule/composer.json +++ b/app/code/Magento/CatalogRule/composer.json @@ -9,8 +9,7 @@ "magento/module-customer": "1.0.0-beta", "magento/module-backend": "1.0.0-beta", "magento/module-eav": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "suggest": { "magento/module-import-export": "1.0.0-beta" @@ -21,12 +20,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/CatalogRule" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\CatalogRule\\": "" + } } } diff --git a/app/code/Magento/CatalogRule/etc/acl.xml b/app/code/Magento/CatalogRule/etc/acl.xml index 3f8941d24f70885bcdcffb0139a180994157a165..727d4eec7490a39c8e1a167400bf25084664faec 100644 --- a/app/code/Magento/CatalogRule/etc/acl.xml +++ b/app/code/Magento/CatalogRule/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/app/code/Magento/CatalogRule/etc/adminhtml/di.xml b/app/code/Magento/CatalogRule/etc/adminhtml/di.xml index 7787f9068a4498048e1725acca602686f77ef077..e9fc1e75afd4acc163923db923f8d06bb6559539 100644 --- a/app/code/Magento/CatalogRule/etc/adminhtml/di.xml +++ b/app/code/Magento/CatalogRule/etc/adminhtml/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\CatalogRule\Model\Rule"> <arguments> <argument name="relatedCacheTypes" xsi:type="array"> diff --git a/app/code/Magento/CatalogRule/etc/adminhtml/events.xml b/app/code/Magento/CatalogRule/etc/adminhtml/events.xml index 201b6778638ce5b8620efc0a19c1e6a02c00522e..bf3988a2062fdb34ded651b2594d99a216b021bd 100644 --- a/app/code/Magento/CatalogRule/etc/adminhtml/events.xml +++ b/app/code/Magento/CatalogRule/etc/adminhtml/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="catalog_product_get_final_price"> <observer name="catalogrule" instance="Magento\CatalogRule\Observer\ProcessAdminFinalPriceObserver" method="execute" /> </event> diff --git a/app/code/Magento/CatalogRule/etc/adminhtml/menu.xml b/app/code/Magento/CatalogRule/etc/adminhtml/menu.xml index cb0545bf17eb2cb100c33b2c1a76a1ebd4cbdfbc..a5531bee0041a630494b4ee886c678b9e5b497b1 100644 --- a/app/code/Magento/CatalogRule/etc/adminhtml/menu.xml +++ b/app/code/Magento/CatalogRule/etc/adminhtml/menu.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Backend/etc/menu.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd"> <menu> <add id="Magento_CatalogRule::promo" title="Promotions" module="Magento_CatalogRule" parent="Magento_Backend::marketing" sortOrder="10" resource="Magento_CatalogRule::promo"/> <add id="Magento_CatalogRule::promo_catalog" title="Catalog Price Rule" sortOrder="10" module="Magento_CatalogRule" parent="Magento_CatalogRule::promo" action="catalog_rule/promo_catalog/" dependsOnModule="Magento_Catalog" resource="Magento_CatalogRule::promo_catalog"/> diff --git a/app/code/Magento/CatalogRule/etc/adminhtml/routes.xml b/app/code/Magento/CatalogRule/etc/adminhtml/routes.xml index b085941c0c111f45aaeca2f128da2522169fcf01..baba59844ff5b17e394f94aa084fc3662a95f509 100644 --- a/app/code/Magento/CatalogRule/etc/adminhtml/routes.xml +++ b/app/code/Magento/CatalogRule/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="admin"> <route id="catalog_rule" frontName="catalog_rule"> <module name="Magento_CatalogRule" before="Magento_Backend" /> diff --git a/app/code/Magento/CatalogRule/etc/crontab.xml b/app/code/Magento/CatalogRule/etc/crontab.xml index d3b95609fb79ae1e81dd97a9bf446618239b9a50..4b4cc862b7e11d314d33b09a99c5eda37b385326 100644 --- a/app/code/Magento/CatalogRule/etc/crontab.xml +++ b/app/code/Magento/CatalogRule/etc/crontab.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Cron/etc/crontab.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd"> <group id="default"> <job name="catalogrule_apply_all" instance="Magento\CatalogRule\Cron\DailyCatalogUpdate" method="execute"> <schedule>0 1 * * *</schedule> diff --git a/app/code/Magento/CatalogRule/etc/crontab/events.xml b/app/code/Magento/CatalogRule/etc/crontab/events.xml index 201b6778638ce5b8620efc0a19c1e6a02c00522e..bf3988a2062fdb34ded651b2594d99a216b021bd 100644 --- a/app/code/Magento/CatalogRule/etc/crontab/events.xml +++ b/app/code/Magento/CatalogRule/etc/crontab/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="catalog_product_get_final_price"> <observer name="catalogrule" instance="Magento\CatalogRule\Observer\ProcessAdminFinalPriceObserver" method="execute" /> </event> diff --git a/app/code/Magento/CatalogRule/etc/di.xml b/app/code/Magento/CatalogRule/etc/di.xml index 92866f3e6d4d0fceeb10613802e543903f3f8569..769d2bb38a30b5078ce1609956447246badcd567 100644 --- a/app/code/Magento/CatalogRule/etc/di.xml +++ b/app/code/Magento/CatalogRule/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\CatalogRule\Model\Resource\Rule"> <arguments> <argument name="eventManager" xsi:type="object">Magento\Framework\Event\Manager\Proxy</argument> diff --git a/app/code/Magento/CatalogRule/etc/frontend/events.xml b/app/code/Magento/CatalogRule/etc/frontend/events.xml index 036efa00a8ba8f42aff311db3341dda8b947db2f..cab8eb3c1dbd586223d1f1e221bc212e4d1a451e 100644 --- a/app/code/Magento/CatalogRule/etc/frontend/events.xml +++ b/app/code/Magento/CatalogRule/etc/frontend/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="catalog_product_get_final_price"> <observer name="catalogrule" instance="Magento\CatalogRule\Observer\ProcessFrontFinalPriceObserver" method="execute" /> </event> diff --git a/app/code/Magento/CatalogRule/etc/indexer.xml b/app/code/Magento/CatalogRule/etc/indexer.xml index b957d9c66400429f1b987966ef941c09859a5a85..de847b1ffca5538b38b7eed01ec3d7b5383ddf33 100644 --- a/app/code/Magento/CatalogRule/etc/indexer.xml +++ b/app/code/Magento/CatalogRule/etc/indexer.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Indexer/etc/indexer.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Indexer/etc/indexer.xsd"> <indexer id="catalogrule_rule" view_id="catalogrule_rule" class="Magento\CatalogRule\Model\Indexer\Rule\RuleProductIndexer"> <title translate="true">Catalog Rule Product</title> <description translate="true">Indexed rule/product association</description> diff --git a/app/code/Magento/CatalogRule/etc/module.xml b/app/code/Magento/CatalogRule/etc/module.xml index ecd6a4eac2cdad98e667470312f279f3ae92c243..19dfacb2cc3bd13319104c104ca4b19bf1e313ab 100644 --- a/app/code/Magento/CatalogRule/etc/module.xml +++ b/app/code/Magento/CatalogRule/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_CatalogRule" setup_version="2.0.0"> <sequence> <module name="Magento_Rule"/> diff --git a/app/code/Magento/CatalogRule/etc/mview.xml b/app/code/Magento/CatalogRule/etc/mview.xml index 9959fbb75d98aa0b30a6d808885cf83786fff24b..28bc4b1588d51428b327bd7814825986437a966c 100644 --- a/app/code/Magento/CatalogRule/etc/mview.xml +++ b/app/code/Magento/CatalogRule/etc/mview.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Mview/etc/mview.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Mview/etc/mview.xsd"> <view id="catalogrule_rule" class="Magento\CatalogRule\Model\Indexer\Rule\RuleProductIndexer" group="indexer"> <subscriptions> <table name="catalogrule" entity_column="rule_id" /> diff --git a/app/code/Magento/CatalogRule/etc/webapi_rest/events.xml b/app/code/Magento/CatalogRule/etc/webapi_rest/events.xml index 036efa00a8ba8f42aff311db3341dda8b947db2f..cab8eb3c1dbd586223d1f1e221bc212e4d1a451e 100644 --- a/app/code/Magento/CatalogRule/etc/webapi_rest/events.xml +++ b/app/code/Magento/CatalogRule/etc/webapi_rest/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="catalog_product_get_final_price"> <observer name="catalogrule" instance="Magento\CatalogRule\Observer\ProcessFrontFinalPriceObserver" method="execute" /> </event> diff --git a/app/code/Magento/CatalogRule/etc/webapi_soap/events.xml b/app/code/Magento/CatalogRule/etc/webapi_soap/events.xml index 036efa00a8ba8f42aff311db3341dda8b947db2f..cab8eb3c1dbd586223d1f1e221bc212e4d1a451e 100644 --- a/app/code/Magento/CatalogRule/etc/webapi_soap/events.xml +++ b/app/code/Magento/CatalogRule/etc/webapi_soap/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="catalog_product_get_final_price"> <observer name="catalogrule" instance="Magento\CatalogRule\Observer\ProcessFrontFinalPriceObserver" method="execute" /> </event> diff --git a/app/code/Magento/CatalogRule/registration.php b/app/code/Magento/CatalogRule/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..028df4fee7ffdc03d22abe69cbbaef9809ec6820 --- /dev/null +++ b/app/code/Magento/CatalogRule/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_CatalogRule', + __DIR__ +); 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 d73e06da7d2557f19b1dbcf771cd1c4b263e0d8c..56bc29579bb4261b184c99b3ae31e92ee72fb97e 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 @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="adminhtml.promo.catalog.grid.container"> <block class="Magento\Backend\Block\Widget\Grid" name="promo.catalog.grid" as="grid"> diff --git a/app/code/Magento/CatalogRule/view/adminhtml/layout/catalog_rule_promo_catalog_edit.xml b/app/code/Magento/CatalogRule/view/adminhtml/layout/catalog_rule_promo_catalog_edit.xml index f6f8e32d696a542a67257d61bec2873a6f291455..879963b295409ee03df5194274d13461cd5e0489 100644 --- a/app/code/Magento/CatalogRule/view/adminhtml/layout/catalog_rule_promo_catalog_edit.xml +++ b/app/code/Magento/CatalogRule/view/adminhtml/layout/catalog_rule_promo_catalog_edit.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="left"> <block class="Magento\CatalogRule\Block\Adminhtml\Promo\Catalog\Edit\Tabs" name="promo_catalog_edit_tabs"> diff --git a/app/code/Magento/CatalogRule/view/adminhtml/layout/catalog_rule_promo_catalog_index.xml b/app/code/Magento/CatalogRule/view/adminhtml/layout/catalog_rule_promo_catalog_index.xml index 9ee35c6550aea5f005e41a8363d557227062f01f..f8e87f234c2fac8b12a18007aff9e72f42ebf948 100644 --- a/app/code/Magento/CatalogRule/view/adminhtml/layout/catalog_rule_promo_catalog_index.xml +++ b/app/code/Magento/CatalogRule/view/adminhtml/layout/catalog_rule_promo_catalog_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="catalog_rule_promo_catalog_block"/> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/CatalogRuleConfigurable/composer.json b/app/code/Magento/CatalogRuleConfigurable/composer.json index fc6bea322d3c59aacb561c8b166823a5d3ea0720..152297de72f500d973907ec4097bf2d4f9dd5bce 100644 --- a/app/code/Magento/CatalogRuleConfigurable/composer.json +++ b/app/code/Magento/CatalogRuleConfigurable/composer.json @@ -16,12 +16,11 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/CatalogRuleConfigurable" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\CatalogRuleConfigurable\\": "" + } } + } diff --git a/app/code/Magento/CatalogRuleConfigurable/etc/adminhtml/di.xml b/app/code/Magento/CatalogRuleConfigurable/etc/adminhtml/di.xml index 051dd103f5d62c20ad7315ab075ed3ee7b7cd22c..a08d84b7287f246874bc9ecec345ffbc750b01cd 100644 --- a/app/code/Magento/CatalogRuleConfigurable/etc/adminhtml/di.xml +++ b/app/code/Magento/CatalogRuleConfigurable/etc/adminhtml/di.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\CatalogRule\Model\Rule"> <plugin name="addVariationsToProductRule" type="Magento\CatalogRuleConfigurable\Plugin\CatalogRule\Model\Rule\ConfigurableProductHandler"/> <plugin name="configurableChildValidation" type="Magento\CatalogRuleConfigurable\Plugin\CatalogRule\Model\Rule\Validation"/> diff --git a/app/code/Magento/CatalogRuleConfigurable/etc/crontab/di.xml b/app/code/Magento/CatalogRuleConfigurable/etc/crontab/di.xml index 051dd103f5d62c20ad7315ab075ed3ee7b7cd22c..a08d84b7287f246874bc9ecec345ffbc750b01cd 100644 --- a/app/code/Magento/CatalogRuleConfigurable/etc/crontab/di.xml +++ b/app/code/Magento/CatalogRuleConfigurable/etc/crontab/di.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\CatalogRule\Model\Rule"> <plugin name="addVariationsToProductRule" type="Magento\CatalogRuleConfigurable\Plugin\CatalogRule\Model\Rule\ConfigurableProductHandler"/> <plugin name="configurableChildValidation" type="Magento\CatalogRuleConfigurable\Plugin\CatalogRule\Model\Rule\Validation"/> diff --git a/app/code/Magento/CatalogRuleConfigurable/etc/module.xml b/app/code/Magento/CatalogRuleConfigurable/etc/module.xml index ed99399ed8cc75369164307727b3e4be7b303625..e2b0a9ca346cf7855c1515147a8de526fa1f31b7 100644 --- a/app/code/Magento/CatalogRuleConfigurable/etc/module.xml +++ b/app/code/Magento/CatalogRuleConfigurable/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_CatalogRuleConfigurable" setup_version="2.0.0"> <sequence> <module name="Magento_CatalogRule"/> diff --git a/app/code/Magento/CatalogRuleConfigurable/registration.php b/app/code/Magento/CatalogRuleConfigurable/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..8b557765f57762c14fcc5e4a1f073a23c1ddf729 --- /dev/null +++ b/app/code/Magento/CatalogRuleConfigurable/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_CatalogRuleConfigurable', + __DIR__ +); diff --git a/app/code/Magento/CatalogSearch/Model/Resource/Search/Collection.php b/app/code/Magento/CatalogSearch/Model/Resource/Search/Collection.php index 53ccd8fb83b1f81fb36629561ac960f5b0d48c69..cb016b37d73ad7750fda72f91a6dad2564a40dbe 100644 --- a/app/code/Magento/CatalogSearch/Model/Resource/Search/Collection.php +++ b/app/code/Magento/CatalogSearch/Model/Resource/Search/Collection.php @@ -11,7 +11,6 @@ namespace Magento\CatalogSearch\Model\Resource\Search; /** * Search collection * - * @deprecated * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection implements \Magento\Search\Model\SearchCollectionInterface diff --git a/app/code/Magento/CatalogSearch/composer.json b/app/code/Magento/CatalogSearch/composer.json index 3b19f2f76bd75eb5ef976d5c9502039c860467ff..8543053ff9f9d44e05dc8b32fbe6ecd5e78783f6 100644 --- a/app/code/Magento/CatalogSearch/composer.json +++ b/app/code/Magento/CatalogSearch/composer.json @@ -11,8 +11,7 @@ "magento/module-eav": "1.0.0-beta", "magento/module-backend": "1.0.0-beta", "magento/module-theme": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -20,12 +19,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/CatalogSearch" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\CatalogSearch\\": "" + } } } diff --git a/app/code/Magento/CatalogSearch/etc/adminhtml/di.xml b/app/code/Magento/CatalogSearch/etc/adminhtml/di.xml index 18cde6cdc8aa7e4ea9eb8e918e7bf11f50cf7e1b..51bd17de1358b586e5ba711ca13e05053a98d751 100644 --- a/app/code/Magento/CatalogSearch/etc/adminhtml/di.xml +++ b/app/code/Magento/CatalogSearch/etc/adminhtml/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <virtualType name="Magento\CatalogSearch\Model\Session\Storage" type="Magento\Framework\Session\Storage"> <arguments> <argument name="namespace" xsi:type="string">catalogsearch</argument> diff --git a/app/code/Magento/CatalogSearch/etc/adminhtml/events.xml b/app/code/Magento/CatalogSearch/etc/adminhtml/events.xml index 2651121514b585d198fec874f580385aa3f7046d..3a3a2bc612d81cfbb789d540ae4f557f1858c972 100644 --- a/app/code/Magento/CatalogSearch/etc/adminhtml/events.xml +++ b/app/code/Magento/CatalogSearch/etc/adminhtml/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="store_add"> <observer name="catalog_search" instance="Magento\CatalogSearch\Model\Indexer\Fulltext\Store" method="execute" /> </event> diff --git a/app/code/Magento/CatalogSearch/etc/adminhtml/system.xml b/app/code/Magento/CatalogSearch/etc/adminhtml/system.xml index 98b2123e03f5a327b30270ca2862d749d7db31dc..64c40be45f2dd9e0c9d094663c10c951635d8c30 100644 --- a/app/code/Magento/CatalogSearch/etc/adminhtml/system.xml +++ b/app/code/Magento/CatalogSearch/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="catalog"> <group id="seo"> diff --git a/app/code/Magento/CatalogSearch/etc/catalog_attributes.xml b/app/code/Magento/CatalogSearch/etc/catalog_attributes.xml index ca82165777f611ca238940b15305ee8123ed3610..6a9521e237b0ba3669d93ca44d162fd92ed210fb 100644 --- a/app/code/Magento/CatalogSearch/etc/catalog_attributes.xml +++ b/app/code/Magento/CatalogSearch/etc/catalog_attributes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Catalog/etc/catalog_attributes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/catalog_attributes.xsd"> <group name="catalog_product"> <attribute name="description"/> </group> diff --git a/app/code/Magento/CatalogSearch/etc/config.xml b/app/code/Magento/CatalogSearch/etc/config.xml index a29db223f42df34564539bff7af30620bee812c4..8ff9c9f527dad85252d1b01a6468c5fc889b4af5 100644 --- a/app/code/Magento/CatalogSearch/etc/config.xml +++ b/app/code/Magento/CatalogSearch/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <catalog> <seo> diff --git a/app/code/Magento/CatalogSearch/etc/di.xml b/app/code/Magento/CatalogSearch/etc/di.xml index 2f973a2e7b21847df9c18ab53d782e224f296d28..5c6f16702e85b21f7c7ed1153f69294aa1275933 100644 --- a/app/code/Magento/CatalogSearch/etc/di.xml +++ b/app/code/Magento/CatalogSearch/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Framework\Search\Adapter\Mysql\Field\ResolverInterface" type="Magento\CatalogSearch\Model\Adapter\Mysql\Field\Resolver" /> <preference for="Magento\Framework\Search\Adapter\Mysql\Aggregation\DataProviderInterface" type="Magento\CatalogSearch\Model\Adapter\Mysql\Aggregation\DataProvider"/> <preference for="Magento\Framework\Search\Adapter\Mysql\Filter\PreprocessorInterface" type="Magento\CatalogSearch\Model\Adapter\Mysql\Filter\Preprocessor" /> diff --git a/app/code/Magento/CatalogSearch/etc/frontend/di.xml b/app/code/Magento/CatalogSearch/etc/frontend/di.xml index 693c6e80b5753c8963b4f46e110d8d71424fd7b7..09a5d24aefa6c04ff3148dce8c2cbe9fa8bb2092 100644 --- a/app/code/Magento/CatalogSearch/etc/frontend/di.xml +++ b/app/code/Magento/CatalogSearch/etc/frontend/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <virtualType name="Magento\CatalogSearch\Model\Session\Storage" type="Magento\Framework\Session\Storage"> <arguments> <argument name="namespace" xsi:type="string">catalogsearch</argument> diff --git a/app/code/Magento/CatalogSearch/etc/frontend/page_types.xml b/app/code/Magento/CatalogSearch/etc/frontend/page_types.xml index 5f4367132ae9b7dd9ce2095e035c01302234fe3c..ea912f8535ae6ac43d9c7a956b4d074d430c73af 100644 --- a/app/code/Magento/CatalogSearch/etc/frontend/page_types.xml +++ b/app/code/Magento/CatalogSearch/etc/frontend/page_types.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page_types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_types.xsd"> +<page_types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_types.xsd"> <type id="catalogsearch_advanced_index" label="Advanced Search Form"/> <type id="catalogsearch_advanced_result" label="Advanced Search Result"/> <type id="catalogsearch_result_index" label="Quick Search Form"/> diff --git a/app/code/Magento/CatalogSearch/etc/frontend/routes.xml b/app/code/Magento/CatalogSearch/etc/frontend/routes.xml index c65d910f46094d30b6d96c2e31f289e0fb3dda38..1c469692a2a073ecfbaaf217e06f3b6716e88969 100644 --- a/app/code/Magento/CatalogSearch/etc/frontend/routes.xml +++ b/app/code/Magento/CatalogSearch/etc/frontend/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn: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/etc/indexer.xml b/app/code/Magento/CatalogSearch/etc/indexer.xml index e86e606ea201cd889769a38578bad671bd1cf28b..3ce8b6456b191442b3905ff549b97abdacd979f6 100644 --- a/app/code/Magento/CatalogSearch/etc/indexer.xml +++ b/app/code/Magento/CatalogSearch/etc/indexer.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Indexer/etc/indexer.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Indexer/etc/indexer.xsd"> <indexer id="catalogsearch_fulltext" view_id="catalogsearch_fulltext" class="Magento\CatalogSearch\Model\Indexer\Fulltext"> <title translate="true">Catalog Search</title> <description translate="true">Rebuild Catalog product fulltext search index</description> diff --git a/app/code/Magento/CatalogSearch/etc/module.xml b/app/code/Magento/CatalogSearch/etc/module.xml index 269b6462350b0291650c8acd6cc06019b0a54993..a0c263e189c79c1f81111840bcba2f50a6586c07 100644 --- a/app/code/Magento/CatalogSearch/etc/module.xml +++ b/app/code/Magento/CatalogSearch/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_CatalogSearch" setup_version="2.0.0"> <sequence> <module name="Magento_Search"/> diff --git a/app/code/Magento/CatalogSearch/etc/mview.xml b/app/code/Magento/CatalogSearch/etc/mview.xml index 8e9fb605186ddb7392a5d87ff38efac9df69f7f4..7b53240586de156416df45869ef57081d7207cdb 100644 --- a/app/code/Magento/CatalogSearch/etc/mview.xml +++ b/app/code/Magento/CatalogSearch/etc/mview.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Mview/etc/mview.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Mview/etc/mview.xsd"> <view id="catalogsearch_fulltext" class="\Magento\CatalogSearch\Model\Indexer\Mview\Action" group="indexer"> <subscriptions> <table name="catalog_product_entity" entity_column="entity_id" /> diff --git a/app/code/Magento/CatalogSearch/etc/search_request.xml b/app/code/Magento/CatalogSearch/etc/search_request.xml index 88e2c8c20c75468169380830ab06ad16f90342c9..5fa0b6a60cdf295b34db8b65c856ebedee09e5cc 100644 --- a/app/code/Magento/CatalogSearch/etc/search_request.xml +++ b/app/code/Magento/CatalogSearch/etc/search_request.xml @@ -6,7 +6,7 @@ */ --> <requests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Search/etc/search_request.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:framework:Search/etc/search_request.xsd"> <request query="quick_search_container" index="catalogsearch_fulltext"> <dimensions> <dimension name="scope" value="default"/> diff --git a/app/code/Magento/CatalogSearch/registration.php b/app/code/Magento/CatalogSearch/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..4c9fa0a30238d70e9b77a34dbb52b13c89e6e09d --- /dev/null +++ b/app/code/Magento/CatalogSearch/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_CatalogSearch', + __DIR__ +); diff --git a/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_advanced_index.xml b/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_advanced_index.xml index 4734a68b1d7cb4d80e0498559b51b2ce2638cb52..573b5ad5f5226179501b1be8df80eb520b7bc62c 100644 --- a/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_advanced_index.xml +++ b/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_advanced_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <title>Advanced Search</title> </head> diff --git a/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_advanced_result.xml b/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_advanced_result.xml index 5dc1857a43c04b5f4638453f213a574bbb3b382c..4c21c149342f6155219d552538568a5eba214b85 100644 --- a/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_advanced_result.xml +++ b/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_advanced_result.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <attribute name="class" value="page-products"/> <referenceBlock name="page.main.title"> diff --git a/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_result_index.xml b/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_result_index.xml index 34a0e54cfc942d52f591c471d13f06a5a835c7ce..aa0d0c5b849172c6f56b7bb5c2e51b6b7252a05d 100644 --- a/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_result_index.xml +++ b/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_result_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <attribute name="class" value="page-products"/> <referenceContainer name="content"> diff --git a/app/code/Magento/CatalogSearch/view/frontend/layout/default.xml b/app/code/Magento/CatalogSearch/view/frontend/layout/default.xml index 892395ec75e3ec1735901258972bc4a589ca97eb..bb28429fe00fd2c5d3c02d7c31bb8ec49c4e8d6e 100644 --- a/app/code/Magento/CatalogSearch/view/frontend/layout/default.xml +++ b/app/code/Magento/CatalogSearch/view/frontend/layout/default.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="top.search"> <block class="Magento\Framework\View\Element\Template" name="advanced-search-link" template="Magento_CatalogSearch::advanced/link.phtml" /> diff --git a/app/code/Magento/CatalogUrlRewrite/composer.json b/app/code/Magento/CatalogUrlRewrite/composer.json index f5171cd51d8be450906f272ef7ad9511630c4ec2..f850f90c5e0fd23d0ac76c821b6a7a8c3a0ee8df 100644 --- a/app/code/Magento/CatalogUrlRewrite/composer.json +++ b/app/code/Magento/CatalogUrlRewrite/composer.json @@ -10,8 +10,7 @@ "magento/module-import-export": "1.0.0-beta", "magento/module-store": "1.0.0-beta", "magento/module-url-rewrite": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -19,12 +18,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/CatalogUrlRewrite" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\CatalogUrlRewrite\\": "" + } } } diff --git a/app/code/Magento/CatalogUrlRewrite/etc/adminhtml/di.xml b/app/code/Magento/CatalogUrlRewrite/etc/adminhtml/di.xml index f25e169050bfc2166fce1fa1882fc26ff04be9e8..65314e7076e9544bca0605a337c2f40814a52c2d 100644 --- a/app/code/Magento/CatalogUrlRewrite/etc/adminhtml/di.xml +++ b/app/code/Magento/CatalogUrlRewrite/etc/adminhtml/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Store\Model\Resource\Store"> <plugin name="store_plugin" type="Magento\CatalogUrlRewrite\Model\Category\Plugin\Store\View"/> </type> diff --git a/app/code/Magento/CatalogUrlRewrite/etc/adminhtml/events.xml b/app/code/Magento/CatalogUrlRewrite/etc/adminhtml/events.xml index 69f2c74804bafff7812411018920c277cfb7829e..101d948e3af5a45a6c12f032d80eb8765719970d 100644 --- a/app/code/Magento/CatalogUrlRewrite/etc/adminhtml/events.xml +++ b/app/code/Magento/CatalogUrlRewrite/etc/adminhtml/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="catalog_category_prepare_save"> <observer name="category_save_rewrites_history_setter" instance="Magento\CatalogUrlRewrite\Observer\CategorySaveRewritesHistorySetterObserver" method="execute"/> </event> diff --git a/app/code/Magento/CatalogUrlRewrite/etc/adminhtml/system.xml b/app/code/Magento/CatalogUrlRewrite/etc/adminhtml/system.xml index 0b8a6027012dbd43ac6ade1f6fdfff05a35be766..09d1a1a800d8489ea559c8e924286eafeb5bb8c3 100644 --- a/app/code/Magento/CatalogUrlRewrite/etc/adminhtml/system.xml +++ b/app/code/Magento/CatalogUrlRewrite/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="catalog"> <group id="seo"> diff --git a/app/code/Magento/CatalogUrlRewrite/etc/catalog_attributes.xml b/app/code/Magento/CatalogUrlRewrite/etc/catalog_attributes.xml index 1749ceba5ae42ea828f71a075d83158f9e43bca4..e919d12098e34bf28cf5a4abe0e45ea4f5759da1 100644 --- a/app/code/Magento/CatalogUrlRewrite/etc/catalog_attributes.xml +++ b/app/code/Magento/CatalogUrlRewrite/etc/catalog_attributes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Catalog/etc/catalog_attributes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/catalog_attributes.xsd"> <group name="catalog_category"> <attribute name="url_key"/> </group> diff --git a/app/code/Magento/CatalogUrlRewrite/etc/di.xml b/app/code/Magento/CatalogUrlRewrite/etc/di.xml index c2bdc96137ba92616b9353801b58fca5a57b09b5..b08033b7e45a417331280eaf04248853cd90976c 100644 --- a/app/code/Magento/CatalogUrlRewrite/etc/di.xml +++ b/app/code/Magento/CatalogUrlRewrite/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Catalog\Block\Widget\Link"> <arguments> <argument name="urlFinder" xsi:type="object">Magento\CatalogUrlRewrite\Model\Storage\DbStorage</argument> diff --git a/app/code/Magento/CatalogUrlRewrite/etc/eav_attributes.xml b/app/code/Magento/CatalogUrlRewrite/etc/eav_attributes.xml index 076ffe0382866087359a58d4900893e47c158e9d..7fb8c08b9aa346ad7aa504e250487c7e6ed85d69 100644 --- a/app/code/Magento/CatalogUrlRewrite/etc/eav_attributes.xml +++ b/app/code/Magento/CatalogUrlRewrite/etc/eav_attributes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Eav/etc/eav_attributes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Eav:etc/eav_attributes.xsd"> <entity type="catalog_product"> <attribute code="url_key"> <field code="is_unique" locked="true" /> diff --git a/app/code/Magento/CatalogUrlRewrite/etc/events.xml b/app/code/Magento/CatalogUrlRewrite/etc/events.xml index 54b570b7030680afaed7c9c41991e25735c19321..24dd48a69cd0564a363766817abaee05d4013f7d 100644 --- a/app/code/Magento/CatalogUrlRewrite/etc/events.xml +++ b/app/code/Magento/CatalogUrlRewrite/etc/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="catalog_category_prepare_save"> <observer name="category_save_rewrites_history_setter" instance="Magento\CatalogUrlRewrite\Observer\CategorySaveRewritesHistorySetterObserver" method="execute"/> </event> diff --git a/app/code/Magento/CatalogUrlRewrite/etc/module.xml b/app/code/Magento/CatalogUrlRewrite/etc/module.xml index 9b9ebb4f15bc62813a7d7d9b7c18970929743db7..d518ba78597aba5fe67b8657a7547e31a6cde4fa 100644 --- a/app/code/Magento/CatalogUrlRewrite/etc/module.xml +++ b/app/code/Magento/CatalogUrlRewrite/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_CatalogUrlRewrite" setup_version="2.0.0"> <sequence> <module name="Magento_Catalog"/> diff --git a/app/code/Magento/CatalogUrlRewrite/registration.php b/app/code/Magento/CatalogUrlRewrite/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..ddbb85efbf59d9298ee55fc216e2e655cabde926 --- /dev/null +++ b/app/code/Magento/CatalogUrlRewrite/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_CatalogUrlRewrite', + __DIR__ +); diff --git a/app/code/Magento/CatalogWidget/composer.json b/app/code/Magento/CatalogWidget/composer.json index 5d94e978f191fa835a229fd41558abd121eca2b8..aa3e1932cdce4f651c8c75c1dfaa94833b7e0fe5 100644 --- a/app/code/Magento/CatalogWidget/composer.json +++ b/app/code/Magento/CatalogWidget/composer.json @@ -11,8 +11,7 @@ "magento/module-customer": "1.0.0-beta", "magento/module-store": "1.0.0-beta", "magento/module-wishlist": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -20,12 +19,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/CatalogWidget" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\CatalogWidget\\": "" + } } } diff --git a/app/code/Magento/CatalogWidget/etc/adminhtml/routes.xml b/app/code/Magento/CatalogWidget/etc/adminhtml/routes.xml index 870b1cabec0be48ae6c5fccee6dd9bad67c1b36d..252c946a14d18b535a6514c69b5ecb61fdb8db21 100644 --- a/app/code/Magento/CatalogWidget/etc/adminhtml/routes.xml +++ b/app/code/Magento/CatalogWidget/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="admin"> <route id="catalog_widget" frontName="catalog_widget"> <module name="Magento_CatalogWidget" before="Magento_Backend" /> diff --git a/app/code/Magento/CatalogWidget/etc/module.xml b/app/code/Magento/CatalogWidget/etc/module.xml index b49ad17357a69e439cf6af4408a4805b8a280b7d..ac80120de6b0a40132352dedcbd24d5c4259d8db 100644 --- a/app/code/Magento/CatalogWidget/etc/module.xml +++ b/app/code/Magento/CatalogWidget/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_CatalogWidget" setup_version="2.0.0"> <sequence> <module name="Magento_Catalog"/> diff --git a/app/code/Magento/CatalogWidget/etc/widget.xml b/app/code/Magento/CatalogWidget/etc/widget.xml index 4257c3f07329b98e25dc051f01e8365e12b38ed1..734d67e388fef2e46a6c8add4f960818ff2faa19 100644 --- a/app/code/Magento/CatalogWidget/etc/widget.xml +++ b/app/code/Magento/CatalogWidget/etc/widget.xml @@ -6,7 +6,7 @@ */ --> <widgets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../Magento/Widget/etc/widget.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Widget:etc/widget.xsd"> <widget id="products_list" class="Magento\CatalogWidget\Block\Product\ProductsList" is_email_compatible="true" placeholder_image="Magento_CatalogWidget::images/products_list.png" ttl="86400"> <label translate="true">Catalog Products List</label> diff --git a/app/code/Magento/CatalogWidget/registration.php b/app/code/Magento/CatalogWidget/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..7114504d48dc752dcfdd215d4ca925769e26876a --- /dev/null +++ b/app/code/Magento/CatalogWidget/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_CatalogWidget', + __DIR__ +); diff --git a/app/code/Magento/Checkout/Block/Onepage/AbstractOnepage.php b/app/code/Magento/Checkout/Block/Onepage/AbstractOnepage.php index dd87c65ecee83ea2c2483623ffd4fd2b7692c888..8cf9596488da2abea1b2d6f60eea332cb996da77 100644 --- a/app/code/Magento/Checkout/Block/Onepage/AbstractOnepage.php +++ b/app/code/Magento/Checkout/Block/Onepage/AbstractOnepage.php @@ -188,7 +188,6 @@ abstract class AbstractOnepage extends \Magento\Framework\View\Element\Template /** * @return Collection - * @deprecated * @removeCandidate */ public function getCountryCollection() @@ -201,7 +200,6 @@ abstract class AbstractOnepage extends \Magento\Framework\View\Element\Template /** * @return RegionCollection - * @deprecated * @removeCandidate */ public function getRegionCollection() @@ -216,7 +214,6 @@ abstract class AbstractOnepage extends \Magento\Framework\View\Element\Template /** * @return int - * @deprecated * @removeCandidate */ public function customerHasAddresses() @@ -231,7 +228,6 @@ abstract class AbstractOnepage extends \Magento\Framework\View\Element\Template /** * @param string $type * @return string - * @deprecated * @removeCandidate */ public function getAddressesHtmlSelect($type) @@ -285,7 +281,6 @@ abstract class AbstractOnepage extends \Magento\Framework\View\Element\Template /** * @param string $type * @return string - * @deprecated * @removeCandidate */ public function getCountryHtmlSelect($type) @@ -315,7 +310,6 @@ abstract class AbstractOnepage extends \Magento\Framework\View\Element\Template /** * @param string $type * @return string - * @deprecated * @removeCandidate */ public function getRegionHtmlSelect($type) @@ -341,7 +335,6 @@ abstract class AbstractOnepage extends \Magento\Framework\View\Element\Template /** * @return mixed - * @deprecated * @removeCandidate */ public function getCountryOptions() @@ -363,7 +356,6 @@ abstract class AbstractOnepage extends \Magento\Framework\View\Element\Template * Get checkout steps codes * * @return string[] - * @deprecated * @removeCandidate */ protected function _getStepCodes() @@ -375,7 +367,6 @@ abstract class AbstractOnepage extends \Magento\Framework\View\Element\Template * Retrieve is allow and show block * * @return bool - * @deprecated * @removeCandidate */ public function isShow() @@ -388,7 +379,6 @@ abstract class AbstractOnepage extends \Magento\Framework\View\Element\Template * * @param \Magento\Quote\Model\Quote\Address\Rate $rate * @return string - * @deprecated * @removeCandidate */ public function getShippingPriceHtml(\Magento\Quote\Model\Quote\Address\Rate $rate) diff --git a/app/code/Magento/Checkout/Block/Onepage/Billing.php b/app/code/Magento/Checkout/Block/Onepage/Billing.php index f4ddf26ba9126b9042e52e5322767f15a21fdbb4..ceba318dbe6e28e213a85601bd52de9fcc7ef6c2 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Billing.php +++ b/app/code/Magento/Checkout/Block/Onepage/Billing.php @@ -11,7 +11,6 @@ use Magento\Customer\Model\Address\Config as AddressConfig; /** * One page checkout status * @SuppressWarnings(PHPMD.CouplingBetweenObjects) - * @deprecated * @removeCandidate */ class Billing extends \Magento\Checkout\Block\Onepage\AbstractOnepage diff --git a/app/code/Magento/Checkout/Block/Onepage/Payment.php b/app/code/Magento/Checkout/Block/Onepage/Payment.php index ad6fe3ff05067e918ba553adc1b3bf8a1682ba9d..4298784226ae932e3c74dea26f35d79cf082b1eb 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Payment.php +++ b/app/code/Magento/Checkout/Block/Onepage/Payment.php @@ -9,7 +9,6 @@ namespace Magento\Checkout\Block\Onepage; * One page checkout status * * @author Magento Core Team <core@magentocommerce.com> - * @deprecated * @removeCandidate */ class Payment extends \Magento\Checkout\Block\Onepage\AbstractOnepage diff --git a/app/code/Magento/Checkout/Block/Onepage/Payment/Info.php b/app/code/Magento/Checkout/Block/Onepage/Payment/Info.php index 594927cb117b33f837c076251c80d5a41dae01a9..67f682a25c19d95c37798e534a75376a8f7c2b49 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Payment/Info.php +++ b/app/code/Magento/Checkout/Block/Onepage/Payment/Info.php @@ -9,7 +9,6 @@ namespace Magento\Checkout\Block\Onepage\Payment; * Checkout payment information data * * @author Magento Core Team <core@magentocommerce.com> - * @deprecated * @removeCandidate */ class Info extends \Magento\Payment\Block\Info\AbstractContainer diff --git a/app/code/Magento/Checkout/Block/Onepage/Payment/Methods.php b/app/code/Magento/Checkout/Block/Onepage/Payment/Methods.php index 7ee38eae1823b26711c82d93a50f88b20e93954e..48285ad73dc277fa9890d46e7fa758246d5865e0 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Payment/Methods.php +++ b/app/code/Magento/Checkout/Block/Onepage/Payment/Methods.php @@ -8,7 +8,6 @@ * One page checkout status * * @author Magento Core Team <core@magentocommerce.com> - * @deprecated * @removeCandidate */ namespace Magento\Checkout\Block\Onepage\Payment; diff --git a/app/code/Magento/Checkout/Block/Onepage/Review/Button.php b/app/code/Magento/Checkout/Block/Onepage/Review/Button.php index 769b747d91ea037904ac2fa9c27ab0df7d1fef9e..39cba9ffce7470f1f0508fc8503fed741cf84341 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Review/Button.php +++ b/app/code/Magento/Checkout/Block/Onepage/Review/Button.php @@ -9,7 +9,6 @@ use Magento\Framework\View\Element\Template; /** * One page checkout order review button - * @deprecated * @removeCandidate */ class Button extends Template diff --git a/app/code/Magento/Checkout/Block/Onepage/Review/Info.php b/app/code/Magento/Checkout/Block/Onepage/Review/Info.php index 89dea275fec9060be912bfa5881b0666cda68f07..9adbc1c4e5ed140507e0c613ae8bd66c13ea7b6b 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Review/Info.php +++ b/app/code/Magento/Checkout/Block/Onepage/Review/Info.php @@ -7,7 +7,6 @@ namespace Magento\Checkout\Block\Onepage\Review; /** * One page checkout order review - * @deprecated * @removeCandidate */ class Info extends \Magento\Sales\Block\Items\AbstractItems diff --git a/app/code/Magento/Checkout/Block/Onepage/Shipping.php b/app/code/Magento/Checkout/Block/Onepage/Shipping.php index 45eff05bf29620128b33d537dc5b2892fdeb094a..9c5902dec74738a14e892c1cffc5f6ce4b785c2a 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Shipping.php +++ b/app/code/Magento/Checkout/Block/Onepage/Shipping.php @@ -11,7 +11,6 @@ use Magento\Customer\Model\Address\Config as AddressConfig; /** * One page checkout status * @SuppressWarnings(PHPMD.CouplingBetweenObjects) - * @deprecated * @removeCandidate */ class Shipping extends \Magento\Checkout\Block\Onepage\AbstractOnepage diff --git a/app/code/Magento/Checkout/Block/Onepage/Shipping/Method.php b/app/code/Magento/Checkout/Block/Onepage/Shipping/Method.php index 015c661dc3b60df044cef481402ee10b95a8a724..5145d6fdca269a7613618b6b12f0dd979220e0e9 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Shipping/Method.php +++ b/app/code/Magento/Checkout/Block/Onepage/Shipping/Method.php @@ -9,7 +9,6 @@ namespace Magento\Checkout\Block\Onepage\Shipping; * One page checkout status * * @author Magento Core Team <core@magentocommerce.com> - * @deprecated * @removeCandidate */ class Method extends \Magento\Checkout\Block\Onepage\AbstractOnepage diff --git a/app/code/Magento/Checkout/Block/Onepage/Shipping/Method/Additional.php b/app/code/Magento/Checkout/Block/Onepage/Shipping/Method/Additional.php index 1078da93c715012c54a8aec5c7407b8ee65eb1c5..bf27a8fa212086889f4b88616f84edb14f6307df 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Shipping/Method/Additional.php +++ b/app/code/Magento/Checkout/Block/Onepage/Shipping/Method/Additional.php @@ -9,7 +9,6 @@ namespace Magento\Checkout\Block\Onepage\Shipping\Method; * Block for additional information in shipping method * * @author Magento Core Team <core@magentocommerce.com> - * @deprecated * @removeCandidate */ class Additional extends \Magento\Checkout\Block\Onepage\AbstractOnepage 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 5c68cde56d177ad9d94a0ac0ca47ee1ac725a4d5..e054809319ca13169ec6810570d1eb2927c5f233 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Shipping/Method/Available.php +++ b/app/code/Magento/Checkout/Block/Onepage/Shipping/Method/Available.php @@ -12,7 +12,6 @@ use Magento\Quote\Model\Quote\Address; /** * One page checkout status * @SuppressWarnings(PHPMD.CouplingBetweenObjects) - * @deprecated * @removeCandidate */ class Available extends \Magento\Checkout\Block\Onepage\AbstractOnepage diff --git a/app/code/Magento/Checkout/Controller/Onepage/SaveOrder.php b/app/code/Magento/Checkout/Controller/Onepage/SaveOrder.php index 6cc1a82963f5d42074aebeecb2b906832d697542..82e9d18b8854e5e2f0e51b131a2f4a84a496bb69 100644 --- a/app/code/Magento/Checkout/Controller/Onepage/SaveOrder.php +++ b/app/code/Magento/Checkout/Controller/Onepage/SaveOrder.php @@ -9,7 +9,6 @@ use Magento\Framework\DataObject; use Magento\Framework\Exception\PaymentException; /** - * @deprecated * @removeCandidate */ class SaveOrder extends \Magento\Checkout\Controller\Onepage diff --git a/app/code/Magento/Checkout/composer.json b/app/code/Magento/Checkout/composer.json index 17833f6bf524ed8dc6bb0af4a216fe533718d9a4..775fe8406e930313ad64a49daf716d7792b60335 100644 --- a/app/code/Magento/Checkout/composer.json +++ b/app/code/Magento/Checkout/composer.json @@ -22,8 +22,7 @@ "magento/module-msrp": "1.0.0-beta", "magento/framework": "1.0.0-beta", "magento/module-ui": "1.0.0-beta", - "magento/module-quote": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/module-quote": "1.0.0-beta" }, "suggest": { "magento/module-cookie": "1.0.0-beta" @@ -34,12 +33,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Checkout" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Checkout\\": "" + } } } diff --git a/app/code/Magento/Checkout/etc/adminhtml/system.xml b/app/code/Magento/Checkout/etc/adminhtml/system.xml index 40787d2ee67632883afe8adb372164a948c4cf91..39393518e7942f2199ba9ff8508c5899cc2fcb75 100644 --- a/app/code/Magento/Checkout/etc/adminhtml/system.xml +++ b/app/code/Magento/Checkout/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="checkout" translate="label" type="text" sortOrder="305" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Checkout</label> diff --git a/app/code/Magento/Checkout/etc/config.xml b/app/code/Magento/Checkout/etc/config.xml index 060d51932d09facdc524faa5e64d3a4032df9d90..b235bd4e4c94640fe06c4fadfc1c66b1f88aa892 100644 --- a/app/code/Magento/Checkout/etc/config.xml +++ b/app/code/Magento/Checkout/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <checkout> <options> diff --git a/app/code/Magento/Checkout/etc/di.xml b/app/code/Magento/Checkout/etc/di.xml index a1996fd8bc1bde9c7971929cbb4e946156523249..2658a5700cf7344b76cae0d57176df27833fa186 100644 --- a/app/code/Magento/Checkout/etc/di.xml +++ b/app/code/Magento/Checkout/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <virtualType name="Magento\Checkout\Model\Session\Storage" type="Magento\Framework\Session\Storage"> <arguments> <argument name="namespace" xsi:type="string">checkout</argument> diff --git a/app/code/Magento/Checkout/etc/email_templates.xml b/app/code/Magento/Checkout/etc/email_templates.xml index 56e2a0618fd5ae2c904bbac574b1f4ef001b15a9..1466eb2d39228ad9407fed922731eda89aa29bd1 100644 --- a/app/code/Magento/Checkout/etc/email_templates.xml +++ b/app/code/Magento/Checkout/etc/email_templates.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Email/etc/email_templates.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Email:etc/email_templates.xsd"> <template id="checkout_payment_failed_template" label="Payment Failed" file="failed_payment.html" type="html" module="Magento_Checkout" area="adminhtml"/> </config> diff --git a/app/code/Magento/Checkout/etc/events.xml b/app/code/Magento/Checkout/etc/events.xml index 1d98923fed434f56576bf8fa19406c857766e9c3..24e284722a55fc42ca5ca0a3b859e0321c70a5e8 100644 --- a/app/code/Magento/Checkout/etc/events.xml +++ b/app/code/Magento/Checkout/etc/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="sales_quote_save_after"> <observer name="set_checkout_quote_id" instance="Magento\Checkout\Observer\SalesQuoteSaveAfterObserver" method="execute" /> </event> diff --git a/app/code/Magento/Checkout/etc/fieldset.xml b/app/code/Magento/Checkout/etc/fieldset.xml index cf8aed6d65ecb7b06a9593d320ee992e4bd651a9..ca85eb28c6b224b2f5fec96a484cab84fda0b407 100644 --- a/app/code/Magento/Checkout/etc/fieldset.xml +++ b/app/code/Magento/Checkout/etc/fieldset.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/DataObject/etc/fieldset.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:framework:DataObject/etc/fieldset.xsd"> <scope id="global"> <fieldset id="customer_account"> <field name="prefix"> diff --git a/app/code/Magento/Checkout/etc/frontend/di.xml b/app/code/Magento/Checkout/etc/frontend/di.xml index ecdcc3f249c654666977439f684e991c0e282874..c7937f39884fd9dda8927589b2fb5f816b0c2e91 100644 --- a/app/code/Magento/Checkout/etc/frontend/di.xml +++ b/app/code/Magento/Checkout/etc/frontend/di.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Framework\Url\SecurityInfo"> <arguments> <argument name="secureUrlList" xsi:type="array"> diff --git a/app/code/Magento/Checkout/etc/frontend/events.xml b/app/code/Magento/Checkout/etc/frontend/events.xml index a6e2de33de2b6cd2d7c123f0696eaf94cb063812..891b460f3aa219bcab335820673bee85c3f51914 100644 --- a/app/code/Magento/Checkout/etc/frontend/events.xml +++ b/app/code/Magento/Checkout/etc/frontend/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="customer_login"> <observer name="loadCustomerQuote" instance="Magento\Checkout\Observer\LoadCustomerQuoteObserver" method="execute" /> </event> diff --git a/app/code/Magento/Checkout/etc/frontend/page_types.xml b/app/code/Magento/Checkout/etc/frontend/page_types.xml index 88d2dc95d584c0b24057cb04835c42bb980e5055..1ac00712bc2dbc154623f90f8116e945a43efbdb 100644 --- a/app/code/Magento/Checkout/etc/frontend/page_types.xml +++ b/app/code/Magento/Checkout/etc/frontend/page_types.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page_types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_types.xsd"> +<page_types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_types.xsd"> <type id="checkout_cart_configure" label="Configure Cart Item (Any)"/> <type id="checkout_cart_index" label="Shopping Cart"/> <type id="checkout_onepage_failure" label="One Page Checkout Failure"/> diff --git a/app/code/Magento/Checkout/etc/frontend/routes.xml b/app/code/Magento/Checkout/etc/frontend/routes.xml index d68de17a77674f3d41644793edb38993f5248078..90fa1ffe5999f7edcabc6a541d7b0c09c050e69a 100644 --- a/app/code/Magento/Checkout/etc/frontend/routes.xml +++ b/app/code/Magento/Checkout/etc/frontend/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn: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/etc/frontend/sections.xml b/app/code/Magento/Checkout/etc/frontend/sections.xml index 9cf51d9dcc73e2103ee12c64a36200ec4c06a4d0..f699adac929131f66a40cac2e3fca6a382e80a8c 100644 --- a/app/code/Magento/Checkout/etc/frontend/sections.xml +++ b/app/code/Magento/Checkout/etc/frontend/sections.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../Magento/Customer/etc/sections.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd"> <action name="checkout/cart/add"> <section name="cart"/> </action> diff --git a/app/code/Magento/Checkout/etc/module.xml b/app/code/Magento/Checkout/etc/module.xml index e73a054bd0b2395c5a75a6d1cbe84124a9b45530..b7d2d39d09105480820eca5b15c7368f499c410d 100644 --- a/app/code/Magento/Checkout/etc/module.xml +++ b/app/code/Magento/Checkout/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Checkout" setup_version="2.0.0"> <sequence> <module name="Magento_Sales"/> diff --git a/app/code/Magento/Checkout/etc/webapi.xml b/app/code/Magento/Checkout/etc/webapi.xml index 11cf289277bbbd0d9e95f5bc05e6ed227ec243cf..f0312ec1776cfa4ebcec86276e1c00b3a438c3f6 100644 --- a/app/code/Magento/Checkout/etc/webapi.xml +++ b/app/code/Magento/Checkout/etc/webapi.xml @@ -6,7 +6,7 @@ */ --> <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../app/code/Magento/Webapi/etc/webapi.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd"> <!-- Managing shipping guest information --> <route url="/V1/carts/:cartId/shipping-information" method="POST"> diff --git a/app/code/Magento/Checkout/registration.php b/app/code/Magento/Checkout/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..5766c0f44fc428820d23dd8bda74c7f34638fe95 --- /dev/null +++ b/app/code/Magento/Checkout/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Checkout', + __DIR__ +); diff --git a/app/code/Magento/Checkout/view/frontend/layout/braintree_paypal_review.xml b/app/code/Magento/Checkout/view/frontend/layout/braintree_paypal_review.xml index 33a71f5c81b99b4ee2dab02cd844a788bf2a2c52..584acf04fccd853873b22c6b22bf421bfa7289b7 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/braintree_paypal_review.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/braintree_paypal_review.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="paypal.additional.actions"> <block class="Magento\Checkout\Block\Cart\Coupon" name="paypal.cart.coupon" as="coupon" template="cart/coupon.phtml"/> diff --git a/app/code/Magento/Checkout/view/frontend/layout/catalog_category_view.xml b/app/code/Magento/Checkout/view/frontend/layout/catalog_category_view.xml index 93042d3a00d9a1b7732bfe5eec5a195c75b2cd01..475d3b07efeb4f0e908e8848ee70cb925858ddf0 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/catalog_category_view.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/catalog_category_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Cookie\Block\RequireCookie" name="require-cookie" template="Magento_Cookie::require_cookie.phtml"> diff --git a/app/code/Magento/Checkout/view/frontend/layout/catalog_product_view.xml b/app/code/Magento/Checkout/view/frontend/layout/catalog_product_view.xml index 93042d3a00d9a1b7732bfe5eec5a195c75b2cd01..475d3b07efeb4f0e908e8848ee70cb925858ddf0 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/catalog_product_view.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/catalog_product_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Cookie\Block\RequireCookie" name="require-cookie" template="Magento_Cookie::require_cookie.phtml"> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_configure.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_configure.xml index dcd8cd5035e00ee2d92cdebfdb244a195635ca05..550de79db1327a9fa53dee3356b68523c6d95ab0 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_configure.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_configure.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="catalog_product_view"/> <body> <referenceBlock name="head.components"> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_configure_type_simple.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_configure_type_simple.xml index 774f970c0e759c15b851fe8e1a5efdb15bb847fa..9eccd2e4d5c1e67a4ff0ae5f0690abd4ab301e1d 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_configure_type_simple.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_configure_type_simple.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="catalog_product_view_type_simple"/> <body/> </page> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_index.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_index.xml index 737751c3ee947f79a6a0c065b28e17dcbfc0557e..75c80fd010d66aae2331bccbd797d7cd7d22af4b 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_index.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="checkout_cart_item_renderers"/> <update handle="checkout_shipping_price_renderer"/> <body> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_item_renderers.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_item_renderers.xml index 572820909c24eaf337b6cb1131f1f59199c83972..83196054d80b262e056e501347ea78c3a76cdd62 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_item_renderers.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_item_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="checkout_item_price_renderers"/> <body> <referenceBlock name="checkout.cart.item.renderers"> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_sidebar_item_price_renderers.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_sidebar_item_price_renderers.xml index 9a3fb4907333720e3c24e8ab37f41ef572504ef4..cda3b87d03adf40a5ab0b5777e44b2bf5bb96fed 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_sidebar_item_price_renderers.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_sidebar_item_price_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="minicart"> <block class="Magento\Checkout\Block\Item\Price\Renderer" name="checkout.cart.item.price.sidebar" template="cart/item/price/sidebar.phtml"/> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_sidebar_item_renderers.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_sidebar_item_renderers.xml index 95b2d0a739b4b65158de0067111071734613dd42..779da9042ade5fc4008ae4a69854d17ff5003c11 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_sidebar_item_renderers.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_sidebar_item_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="minicart"> <arguments> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_sidebar_total_renderers.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_sidebar_total_renderers.xml index 5630e0e9c06dd68a43e851e4052b6c58840c1232..21a9bada1622f12b9422b0ba2f80fd27e51db983 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_sidebar_total_renderers.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_sidebar_total_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="minicart"> <arguments> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_index_index.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_index_index.xml index f9d93d1bd90905b6dd1d81a4101449baf5a5156d..da33d39e159aadb17af734a5bc01548cc5704c71 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_index_index.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_index_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <script src="Magento_Checkout/js/checkout-loader.js"/> </head> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_item_price_renderers.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_item_price_renderers.xml index 3818e3b099f165ea70e55238fa2cfa7d3fd94a63..1ea8c04c1f5118ae05324cd2ace135dff9ecc4f9 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_item_price_renderers.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_item_price_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <block class="Magento\Checkout\Block\Item\Price\Renderer" name="checkout.item.price.unit" template="item/price/unit.phtml"/> <block class="Magento\Checkout\Block\Item\Price\Renderer" name="checkout.item.price.row" template="item/price/row.phtml"/> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_failure.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_failure.xml index b17b2423c18b6dd37767139b97954444a7310479..e0fdcda1d992bc868c290a362b17bbc308c664e8 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_failure.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_failure.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="page.main.title"> <action method="setPageTitle"> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_review_item_renderers.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_review_item_renderers.xml index 90a2cf09f6a10cc3f4defcb7653011647661e241..e43f1a40b4d2af7ce5035ca97938a4d13940d333 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_review_item_renderers.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_review_item_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="checkout_item_price_renderers"/> <body> <referenceBlock name="checkout.onepage.review.item.renderers"> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_success.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_success.xml index 51774753078040e8dbf356de8fbf38a7106c92ab..6cce5503d652ac915d7d1e5c0d9e3eb75de9a09c 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_success.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_success.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <title>Success Page</title> </head> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_shipping_price_renderer.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_shipping_price_renderer.xml index 1a9310082c8ff7b5fc18d095a2026e6086634163..799c45f9d110162122a468b98adebef717ffddaf 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_shipping_price_renderer.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_shipping_price_renderer.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <referenceContainer name="root"> <block class="Magento\Checkout\Block\Shipping\Price" name="checkout.shipping.price" as="shipping.price" template="shipping/price.phtml"/> </referenceContainer> diff --git a/app/code/Magento/Checkout/view/frontend/layout/default.xml b/app/code/Magento/Checkout/view/frontend/layout/default.xml index 2ac27890ca18a2a79b604c647abe24eb95f14625..7800a3d48068e5b3d2e8145f9ce966b02ef8c7b4 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/default.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/default.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="checkout_cart_sidebar_item_renderers"/> <update handle="checkout_cart_sidebar_item_price_renderers"/> <update handle="checkout_cart_sidebar_total_renderers"/> diff --git a/app/code/Magento/Checkout/view/frontend/layout/paypal_express_review.xml b/app/code/Magento/Checkout/view/frontend/layout/paypal_express_review.xml index 33a71f5c81b99b4ee2dab02cd844a788bf2a2c52..584acf04fccd853873b22c6b22bf421bfa7289b7 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/paypal_express_review.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/paypal_express_review.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="paypal.additional.actions"> <block class="Magento\Checkout\Block\Cart\Coupon" name="paypal.cart.coupon" as="coupon" template="cart/coupon.phtml"/> diff --git a/app/code/Magento/Checkout/view/frontend/layout/paypal_payflowexpress_review.xml b/app/code/Magento/Checkout/view/frontend/layout/paypal_payflowexpress_review.xml index 33a71f5c81b99b4ee2dab02cd844a788bf2a2c52..584acf04fccd853873b22c6b22bf421bfa7289b7 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/paypal_payflowexpress_review.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/paypal_payflowexpress_review.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="paypal.additional.actions"> <block class="Magento\Checkout\Block\Cart\Coupon" name="paypal.cart.coupon" as="coupon" template="cart/coupon.phtml"/> diff --git a/app/code/Magento/Checkout/view/frontend/templates/onepage/billing.phtml b/app/code/Magento/Checkout/view/frontend/templates/onepage/billing.phtml index 05bcdf18b1f2693f24ed95c20dda69c4b589d8c0..49369053b5be56cb3ea02dee5726ba776aa1c40d 100644 --- a/app/code/Magento/Checkout/view/frontend/templates/onepage/billing.phtml +++ b/app/code/Magento/Checkout/view/frontend/templates/onepage/billing.phtml @@ -8,7 +8,6 @@ /** @var \Magento\Checkout\Block\Onepage\Billing $block */ /** - * @deprecated * @removeCandidate */ ?> diff --git a/app/code/Magento/Checkout/view/frontend/templates/onepage/payment.phtml b/app/code/Magento/Checkout/view/frontend/templates/onepage/payment.phtml index 8f28e59c07305b464e0c61f22f11be77322caad6..f9ac39fd39dca380af9b9e422fb7e45656f50c20 100644 --- a/app/code/Magento/Checkout/view/frontend/templates/onepage/payment.phtml +++ b/app/code/Magento/Checkout/view/frontend/templates/onepage/payment.phtml @@ -7,7 +7,6 @@ // @codingStandardsIgnoreFile /** - * @deprecated * @removeCandidate */ ?> diff --git a/app/code/Magento/Checkout/view/frontend/templates/onepage/payment/methods.phtml b/app/code/Magento/Checkout/view/frontend/templates/onepage/payment/methods.phtml index 38d0d293ae439921051130a5612485916d4af89b..f3c0f86cc46bb59bf8528a71db0e40a63635ec1a 100644 --- a/app/code/Magento/Checkout/view/frontend/templates/onepage/payment/methods.phtml +++ b/app/code/Magento/Checkout/view/frontend/templates/onepage/payment/methods.phtml @@ -7,7 +7,6 @@ // @codingStandardsIgnoreFile /** - * @deprecated * @removeCandidate */ ?> diff --git a/app/code/Magento/Checkout/view/frontend/templates/onepage/review/button.phtml b/app/code/Magento/Checkout/view/frontend/templates/onepage/review/button.phtml index 971bde0c161f7f87d3d90b057c9bdc0aeb0c11b0..1b26f9922c5faac3b3dc2e0e72d9a60644d0a925 100644 --- a/app/code/Magento/Checkout/view/frontend/templates/onepage/review/button.phtml +++ b/app/code/Magento/Checkout/view/frontend/templates/onepage/review/button.phtml @@ -6,7 +6,6 @@ // @codingStandardsIgnoreFile /** - * @deprecated * @removeCandidate */ ?> diff --git a/app/code/Magento/Checkout/view/frontend/templates/onepage/review/info.phtml b/app/code/Magento/Checkout/view/frontend/templates/onepage/review/info.phtml index 812f7b450250413ae3ffe48825c4c04040d7286c..8e390e653fd79cf1743b4b7c6d134310d2f02f21 100644 --- a/app/code/Magento/Checkout/view/frontend/templates/onepage/review/info.phtml +++ b/app/code/Magento/Checkout/view/frontend/templates/onepage/review/info.phtml @@ -9,7 +9,6 @@ /** @var $block \Magento\Checkout\Block\Onepage\Review\Info */ /** - * @deprecated * @removeCandidate */ ?> diff --git a/app/code/Magento/Checkout/view/frontend/templates/onepage/review/item.phtml b/app/code/Magento/Checkout/view/frontend/templates/onepage/review/item.phtml index 2466bae94057f99d123f0d82bf29d73d21baad99..7d107a0589d53580c0e9b9512b3c936b063b49be 100644 --- a/app/code/Magento/Checkout/view/frontend/templates/onepage/review/item.phtml +++ b/app/code/Magento/Checkout/view/frontend/templates/onepage/review/item.phtml @@ -9,7 +9,6 @@ /** @var $block Magento\Checkout\Block\Cart\Item\Renderer */ /** - * @deprecated * @removeCandidate */ diff --git a/app/code/Magento/Checkout/view/frontend/templates/onepage/review/item/price/row_excl_tax.phtml b/app/code/Magento/Checkout/view/frontend/templates/onepage/review/item/price/row_excl_tax.phtml index f4f20582bb638b7b5c501b52b9c2f700061a8c4b..d10b01b1591fca77c9bd511743064a94588b836d 100644 --- a/app/code/Magento/Checkout/view/frontend/templates/onepage/review/item/price/row_excl_tax.phtml +++ b/app/code/Magento/Checkout/view/frontend/templates/onepage/review/item/price/row_excl_tax.phtml @@ -9,7 +9,6 @@ /** @var $block \Magento\Checkout\Block\Item\Price\Renderer */ /** - * @deprecated * @removeCandidate */ diff --git a/app/code/Magento/Checkout/view/frontend/templates/onepage/review/item/price/row_incl_tax.phtml b/app/code/Magento/Checkout/view/frontend/templates/onepage/review/item/price/row_incl_tax.phtml index b957ecb04ab1f02dfc1e06423c2c3907a089c6dc..09230fd5c336c67769392d2d083cb95af64e20f0 100644 --- a/app/code/Magento/Checkout/view/frontend/templates/onepage/review/item/price/row_incl_tax.phtml +++ b/app/code/Magento/Checkout/view/frontend/templates/onepage/review/item/price/row_incl_tax.phtml @@ -9,7 +9,6 @@ /** @var $block \Magento\Checkout\Block\Item\Price\Renderer */ /** - * @deprecated * @removeCandidate */ diff --git a/app/code/Magento/Checkout/view/frontend/templates/onepage/review/item/price/unit_excl_tax.phtml b/app/code/Magento/Checkout/view/frontend/templates/onepage/review/item/price/unit_excl_tax.phtml index dde06bd176d0bf7bdbdb6c3ad0097e937f65cb29..f81ddc607c938bbc6acc8ba9897b1a296a7e14c6 100644 --- a/app/code/Magento/Checkout/view/frontend/templates/onepage/review/item/price/unit_excl_tax.phtml +++ b/app/code/Magento/Checkout/view/frontend/templates/onepage/review/item/price/unit_excl_tax.phtml @@ -9,7 +9,6 @@ /** @var $block \Magento\Checkout\Block\Item\Price\Renderer */ /** - * @deprecated * @removeCandidate */ diff --git a/app/code/Magento/Checkout/view/frontend/templates/onepage/review/item/price/unit_incl_tax.phtml b/app/code/Magento/Checkout/view/frontend/templates/onepage/review/item/price/unit_incl_tax.phtml index a41c88f2063b437c6d1dc5af765f06b2655fc6c8..6ff351b90f76a939edd05cce488504d0df22cf70 100644 --- a/app/code/Magento/Checkout/view/frontend/templates/onepage/review/item/price/unit_incl_tax.phtml +++ b/app/code/Magento/Checkout/view/frontend/templates/onepage/review/item/price/unit_incl_tax.phtml @@ -9,7 +9,6 @@ /** @var $block \Magento\Checkout\Block\Item\Price\Renderer */ /** - * @deprecated * @removeCandidate */ diff --git a/app/code/Magento/Checkout/view/frontend/templates/onepage/review/totals.phtml b/app/code/Magento/Checkout/view/frontend/templates/onepage/review/totals.phtml index 3c16c49d4efbe2822f5abb01d633c3c6bf62758a..ab70dbab565d4019eb9edbca45eef9ad0a9c6f4e 100644 --- a/app/code/Magento/Checkout/view/frontend/templates/onepage/review/totals.phtml +++ b/app/code/Magento/Checkout/view/frontend/templates/onepage/review/totals.phtml @@ -11,7 +11,6 @@ */ /** - * @deprecated * @removeCandidate */ ?> diff --git a/app/code/Magento/Checkout/view/frontend/templates/onepage/shipping.phtml b/app/code/Magento/Checkout/view/frontend/templates/onepage/shipping.phtml index 1144b9f16c8c6930f3ccfd1c26d1831b57ba0479..aaff68ef03aca5f2230b68512bca28792c3cee9f 100644 --- a/app/code/Magento/Checkout/view/frontend/templates/onepage/shipping.phtml +++ b/app/code/Magento/Checkout/view/frontend/templates/onepage/shipping.phtml @@ -7,7 +7,6 @@ // @codingStandardsIgnoreFile /** - * @deprecated * @removeCandidate */ ?> diff --git a/app/code/Magento/Checkout/view/frontend/templates/onepage/shipping_method.phtml b/app/code/Magento/Checkout/view/frontend/templates/onepage/shipping_method.phtml index 41ac2e61b3b8faab1e56a9e67979cec3312ce41a..4ab0004006b422c96f48ffd63410853abd473a8c 100644 --- a/app/code/Magento/Checkout/view/frontend/templates/onepage/shipping_method.phtml +++ b/app/code/Magento/Checkout/view/frontend/templates/onepage/shipping_method.phtml @@ -7,7 +7,6 @@ // @codingStandardsIgnoreFile /** - * @deprecated * @removeCandidate */ ?> diff --git a/app/code/Magento/Checkout/view/frontend/templates/onepage/shipping_method/additional.phtml b/app/code/Magento/Checkout/view/frontend/templates/onepage/shipping_method/additional.phtml index abf5d0b218dfae674952e3a794b35290b40adb0f..ac87ff9ce6691d7e0062c81b1fa59d59aa817df2 100644 --- a/app/code/Magento/Checkout/view/frontend/templates/onepage/shipping_method/additional.phtml +++ b/app/code/Magento/Checkout/view/frontend/templates/onepage/shipping_method/additional.phtml @@ -7,7 +7,6 @@ // @codingStandardsIgnoreFile /** - * @deprecated * @removeCandidate */ ?> diff --git a/app/code/Magento/Checkout/view/frontend/templates/onepage/shipping_method/available.phtml b/app/code/Magento/Checkout/view/frontend/templates/onepage/shipping_method/available.phtml index 4ccf006d34eaedb45fafc969782dc75bc15487fb..f2b37b4be7c835b7ec4fe521af4b907e35678510 100644 --- a/app/code/Magento/Checkout/view/frontend/templates/onepage/shipping_method/available.phtml +++ b/app/code/Magento/Checkout/view/frontend/templates/onepage/shipping_method/available.phtml @@ -7,7 +7,6 @@ // @codingStandardsIgnoreFile /** - * @deprecated * @removeCandidate */ ?> diff --git a/app/code/Magento/Checkout/view/frontend/web/js/model/authentication-messages.js b/app/code/Magento/Checkout/view/frontend/web/js/model/authentication-messages.js index 2ccc4e13688518d94f11fc1e95f08281f4398c75..6891a6b9de372f97fa3c74c6ac2c7b367fcaf727 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/model/authentication-messages.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/model/authentication-messages.js @@ -10,3 +10,4 @@ define([ return new Messages(); }); + diff --git a/app/code/Magento/Checkout/view/frontend/web/js/opc-billing-info.js b/app/code/Magento/Checkout/view/frontend/web/js/opc-billing-info.js index 8977f0a7dd66bb0a695b4652ea1d658184e24e84..5ed385463d8bca9873012ce9effe69244762c47a 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/opc-billing-info.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/opc-billing-info.js @@ -7,7 +7,6 @@ /*jshint browser:true jquery:true*/ /*global alert*/ /** - * @deprecated * @removeCandidate */ define([ diff --git a/app/code/Magento/Checkout/view/frontend/web/js/opc-checkout-method.js b/app/code/Magento/Checkout/view/frontend/web/js/opc-checkout-method.js index 059595059e51bd7cc167c8d6dca289dceaff2440..dd675d53117b01cc785f8497b7e324c100a351a3 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/opc-checkout-method.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/opc-checkout-method.js @@ -7,7 +7,6 @@ /*jshint browser:true jquery:true*/ /*global alert*/ /** - * @deprecated * @removeCandidate */ define([ diff --git a/app/code/Magento/Checkout/view/frontend/web/js/opc-order-review.js b/app/code/Magento/Checkout/view/frontend/web/js/opc-order-review.js index a837566f0e712e77adfa52676f05b7b12e90a767..83313faeebf5c513acfc11577db030f644b15500 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/opc-order-review.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/opc-order-review.js @@ -7,7 +7,6 @@ /*jshint browser:true jquery:true*/ /*global alert*/ /** - * @deprecated * @removeCandidate */ define([ diff --git a/app/code/Magento/Checkout/view/frontend/web/js/opc-payment-info.js b/app/code/Magento/Checkout/view/frontend/web/js/opc-payment-info.js index 6a5b67d0d138062a4a5c3046a91ff17c2200738e..8d6793b5ad461d4e63ea69682fa3b81469473b74 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/opc-payment-info.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/opc-payment-info.js @@ -7,7 +7,6 @@ /*jshint browser:true*/ /*global alert*/ /** - * @deprecated * @removeCandidate */ define([ diff --git a/app/code/Magento/Checkout/view/frontend/web/js/opc-shipping-info.js b/app/code/Magento/Checkout/view/frontend/web/js/opc-shipping-info.js index 76251d82fc200f0117eb8fa0bece7e1e8aacdd9e..bf3ef59bcf42938b341150c75d6df91d497be10f 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/opc-shipping-info.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/opc-shipping-info.js @@ -7,7 +7,6 @@ /*jshint browser:true jquery:true*/ /*global alert*/ /** - * @deprecated * @removeCandidate */ define([ diff --git a/app/code/Magento/Checkout/view/frontend/web/js/opc-shipping-method.js b/app/code/Magento/Checkout/view/frontend/web/js/opc-shipping-method.js index ba64095ce8b714ae1f97cf97372e2e68c532e4e5..6dd87549e1bcfc7ad4d3494d9df4b4aa24da81b8 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/opc-shipping-method.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/opc-shipping-method.js @@ -7,7 +7,6 @@ /*jshint browser:true jquery:true*/ /*global alert*/ /** - * @deprecated * @removeCandidate */ define([ diff --git a/app/code/Magento/Checkout/view/frontend/web/js/opcheckout.js b/app/code/Magento/Checkout/view/frontend/web/js/opcheckout.js index dfa427d7c4dad0809d612262f329a43d66abdc85..b7665f89c0db66e94c016cf4835a7a499da17da5 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/opcheckout.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/opcheckout.js @@ -5,7 +5,6 @@ /*jshint browser:true*/ /*global alert*/ /** - * @deprecated * @removeCandidate */ define([ diff --git a/app/code/Magento/Checkout/view/frontend/web/js/payment-authentication.js b/app/code/Magento/Checkout/view/frontend/web/js/payment-authentication.js index 3f0cfc7b7f274250306c3a645d561a82a71243a6..8b03193bb79c95626391cfb4d75691def2f3a1cd 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/payment-authentication.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/payment-authentication.js @@ -4,7 +4,6 @@ */ /*jshint jquery:true*/ /** - * @deprecated * @removeCandidate */ define([ diff --git a/app/code/Magento/Checkout/view/frontend/web/js/payment.js b/app/code/Magento/Checkout/view/frontend/web/js/payment.js index 258531548bc842fd5ff4cf65b05727ec1b641b67..507322ba4a200b87d773aaf1f60d3690ccfe7a3f 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/payment.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/payment.js @@ -5,7 +5,6 @@ /*jshint browser:true*/ /*global alert*/ /** - * @deprecated * @removeCandidate */ define([ diff --git a/app/code/Magento/Checkout/view/frontend/web/js/view/authentication-messages.js b/app/code/Magento/Checkout/view/frontend/web/js/view/authentication-messages.js index 2c2f5fbbf2c9074b4f2097a5a4996ef75005e998..f47e5f4aa1c738f713669fdcf35075805c77bdf9 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/view/authentication-messages.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/view/authentication-messages.js @@ -9,6 +9,7 @@ define([ 'use strict'; return Component.extend({ + initialize: function (config) { return this._super(config, messageContainer); } diff --git a/app/code/Magento/CheckoutAgreements/composer.json b/app/code/Magento/CheckoutAgreements/composer.json index c875c9fa8bcafdcc72024c68063177c80a10af6b..f1e063699edb76743cc8721c20ba14c80c3ce622 100644 --- a/app/code/Magento/CheckoutAgreements/composer.json +++ b/app/code/Magento/CheckoutAgreements/composer.json @@ -7,8 +7,7 @@ "magento/module-quote": "1.0.0-beta", "magento/module-store": "1.0.0-beta", "magento/module-backend": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -16,12 +15,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/CheckoutAgreements" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\CheckoutAgreements\\": "" + } } } diff --git a/app/code/Magento/CheckoutAgreements/etc/acl.xml b/app/code/Magento/CheckoutAgreements/etc/acl.xml index d3ae7b6338cbd1674401ec83f16f06e7bc4b525f..06c32f5d30f67d183e26baa50f97da17eacfb7d4 100644 --- a/app/code/Magento/CheckoutAgreements/etc/acl.xml +++ b/app/code/Magento/CheckoutAgreements/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/app/code/Magento/CheckoutAgreements/etc/adminhtml/menu.xml b/app/code/Magento/CheckoutAgreements/etc/adminhtml/menu.xml index 0a3a39d66cf07f0a4e09776dd4f0764cba0bb883..70d40348d61f85b4d4f7d99e9202735d4f6f9a6b 100644 --- a/app/code/Magento/CheckoutAgreements/etc/adminhtml/menu.xml +++ b/app/code/Magento/CheckoutAgreements/etc/adminhtml/menu.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Backend/etc/menu.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd"> <menu> <add id="Magento_CheckoutAgreements::sales_checkoutagreement" title="Terms and Conditions" module="Magento_CheckoutAgreements" sortOrder="30" parent="Magento_Backend::stores_settings" action="checkout/agreement/" resource="Magento_CheckoutAgreements::checkoutagreement"/> </menu> diff --git a/app/code/Magento/CheckoutAgreements/etc/adminhtml/routes.xml b/app/code/Magento/CheckoutAgreements/etc/adminhtml/routes.xml index 5d1ee9a70e41561654d2212514e05f1c8a1676b3..4b926ae2abb3953576689dce0c26a0a72bf22a80 100644 --- a/app/code/Magento/CheckoutAgreements/etc/adminhtml/routes.xml +++ b/app/code/Magento/CheckoutAgreements/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="admin"> <route id="checkout" frontName="checkout"> <module name="Magento_CheckoutAgreements" before="Magento_Backend" /> diff --git a/app/code/Magento/CheckoutAgreements/etc/adminhtml/system.xml b/app/code/Magento/CheckoutAgreements/etc/adminhtml/system.xml index bfcd5b8d919f78a2199a650017d6257e421cfbc1..9cc84e592c106479fdaeff678955496d3aaca8d1 100644 --- a/app/code/Magento/CheckoutAgreements/etc/adminhtml/system.xml +++ b/app/code/Magento/CheckoutAgreements/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="checkout"> <group id="options"> diff --git a/app/code/Magento/CheckoutAgreements/etc/di.xml b/app/code/Magento/CheckoutAgreements/etc/di.xml index 29566ec36db49d7a3b7ee51deb0cc31f9628ceca..2e312b82cdad1c2e42dff6fcd71ab22e0454d7da 100644 --- a/app/code/Magento/CheckoutAgreements/etc/di.xml +++ b/app/code/Magento/CheckoutAgreements/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\CheckoutAgreements\Api\CheckoutAgreementsRepositoryInterface" type="Magento\CheckoutAgreements\Model\CheckoutAgreementsRepository" /> <preference for="Magento\CheckoutAgreements\Api\Data\AgreementInterface" type="Magento\CheckoutAgreements\Model\Agreement" /> <type name="Magento\CheckoutAgreements\Model\AgreementsValidator"> diff --git a/app/code/Magento/CheckoutAgreements/etc/extension_attributes.xml b/app/code/Magento/CheckoutAgreements/etc/extension_attributes.xml index b6ae8360a260d76d584862e8f51aa531486c6a38..cb17c56c4bd81d974fa3dee12a9bef157c32c285 100644 --- a/app/code/Magento/CheckoutAgreements/etc/extension_attributes.xml +++ b/app/code/Magento/CheckoutAgreements/etc/extension_attributes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Api/etc/extension_attributes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> <extension_attributes for="Magento\Quote\Api\Data\PaymentInterface"> <!-- This is needed to provide type hint to serializer --> <attribute code="agreement_ids" type="string[]" /> diff --git a/app/code/Magento/CheckoutAgreements/etc/frontend/di.xml b/app/code/Magento/CheckoutAgreements/etc/frontend/di.xml index cd9b4b73fe3b7c4203adcde9bff6efc9512a9b1f..27d3797f7f4da619e627d25c1587b5af36c779b4 100644 --- a/app/code/Magento/CheckoutAgreements/etc/frontend/di.xml +++ b/app/code/Magento/CheckoutAgreements/etc/frontend/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Checkout\Model\CompositeConfigProvider"> <arguments> <argument name="configProviders" xsi:type="array"> diff --git a/app/code/Magento/CheckoutAgreements/etc/module.xml b/app/code/Magento/CheckoutAgreements/etc/module.xml index 2fc3dff7b8b1a67ef18dc5627e53faefe939a2d6..07ea99a18fbe1fddebbb3d3e52b736fbbba49404 100644 --- a/app/code/Magento/CheckoutAgreements/etc/module.xml +++ b/app/code/Magento/CheckoutAgreements/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_CheckoutAgreements" setup_version="2.0.1"> <sequence> <module name="Magento_Store"/> diff --git a/app/code/Magento/CheckoutAgreements/etc/webapi.xml b/app/code/Magento/CheckoutAgreements/etc/webapi.xml index 5b66e1ff52d5c71af405581abd683fbdf9547249..962795a9d0bbc4dc34003aff8c06093ecdb437b6 100644 --- a/app/code/Magento/CheckoutAgreements/etc/webapi.xml +++ b/app/code/Magento/CheckoutAgreements/etc/webapi.xml @@ -6,7 +6,7 @@ */ --> <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../app/code/Magento/Webapi/etc/webapi.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd"> <route url="/V1/carts/licence" method="GET"> <service class="Magento\CheckoutAgreements\Api\CheckoutAgreementsRepositoryInterface" method="getList"/> <resources> diff --git a/app/code/Magento/CheckoutAgreements/registration.php b/app/code/Magento/CheckoutAgreements/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..dee6e43ad0553f5ef33d4f463ebbac590d6ee478 --- /dev/null +++ b/app/code/Magento/CheckoutAgreements/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_CheckoutAgreements', + __DIR__ +); diff --git a/app/code/Magento/CheckoutAgreements/view/frontend/layout/checkout_index_index.xml b/app/code/Magento/CheckoutAgreements/view/frontend/layout/checkout_index_index.xml index ccf040f301602807ab459239fe3fb0ee0c2a1d06..da7dd9cbf7795ce6bea69e2c333729823fd3dcd8 100644 --- a/app/code/Magento/CheckoutAgreements/view/frontend/layout/checkout_index_index.xml +++ b/app/code/Magento/CheckoutAgreements/view/frontend/layout/checkout_index_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout.root"> <arguments> diff --git a/app/code/Magento/CheckoutAgreements/view/frontend/layout/multishipping_checkout_overview.xml b/app/code/Magento/CheckoutAgreements/view/frontend/layout/multishipping_checkout_overview.xml index 28c7e5b8d48e77dd06846f5aa263ea2ef6b8c2b7..4c3668c19e31c9f9b539617bbaac3c55b82bd854 100644 --- a/app/code/Magento/CheckoutAgreements/view/frontend/layout/multishipping_checkout_overview.xml +++ b/app/code/Magento/CheckoutAgreements/view/frontend/layout/multishipping_checkout_overview.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout_overview"> <block class="Magento\CheckoutAgreements\Block\Agreements" name="checkout.multishipping.agreements" as="agreements" template="multishipping_agreements.phtml"/> diff --git a/app/code/Magento/Cms/composer.json b/app/code/Magento/Cms/composer.json index 8c7b5d321e4aed91ab1cc8b8300433a325aa5674..324eb22f51a417359b4f62ce75ab6982a36da6e9 100644 --- a/app/code/Magento/Cms/composer.json +++ b/app/code/Magento/Cms/composer.json @@ -12,8 +12,7 @@ "magento/module-ui": "1.0.0-beta", "magento/module-variable": "1.0.0-beta", "magento/module-media-storage": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -21,12 +20,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Cms" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Cms\\": "" + } } } diff --git a/app/code/Magento/Cms/etc/acl.xml b/app/code/Magento/Cms/etc/acl.xml index 833ae2d03e7fb4a4313e457f0bc24bbcdd94b77f..9037ac5a408704096d3e06d6719910163036136b 100644 --- a/app/code/Magento/Cms/etc/acl.xml +++ b/app/code/Magento/Cms/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/app/code/Magento/Cms/etc/adminhtml/di.xml b/app/code/Magento/Cms/etc/adminhtml/di.xml index 555c2e336cb20ab20df15b092644c3fa3d5cbbca..ac39bea43980cee28ff31d7491bb7b97eaa21772 100644 --- a/app/code/Magento/Cms/etc/adminhtml/di.xml +++ b/app/code/Magento/Cms/etc/adminhtml/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Cms\Block\Adminhtml\Page\Grid\Renderer\Action\UrlBuilder"> <arguments> <argument name="frontendUrlBuilder" xsi:type="object">Magento\Framework\Url</argument> diff --git a/app/code/Magento/Cms/etc/adminhtml/menu.xml b/app/code/Magento/Cms/etc/adminhtml/menu.xml index 2ed91e5766e67dc130da725a476de2a1f862bc93..cdebb7efa5365162882b3d1bc0173838692baa7d 100644 --- a/app/code/Magento/Cms/etc/adminhtml/menu.xml +++ b/app/code/Magento/Cms/etc/adminhtml/menu.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Backend/etc/menu.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd"> <menu> <add id="Magento_Cms::cms_page" title="Pages" module="Magento_Cms" sortOrder="0" parent="Magento_Backend::content_elements" action="cms/page" resource="Magento_Cms::page"/> <add id="Magento_Cms::cms_block" title="Blocks" module="Magento_Cms" sortOrder="30" parent="Magento_Backend::content_elements" action="cms/block" resource="Magento_Cms::block"/> diff --git a/app/code/Magento/Cms/etc/adminhtml/routes.xml b/app/code/Magento/Cms/etc/adminhtml/routes.xml index b0ddbbf93e31cfe46a4a5c85339bc154c1dd19f3..349a1caf79a5b907cf65ae858cce4f2edf422038 100644 --- a/app/code/Magento/Cms/etc/adminhtml/routes.xml +++ b/app/code/Magento/Cms/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="admin"> <route id="cms" frontName="cms"> <module name="Magento_Cms" before="Magento_Backend" /> diff --git a/app/code/Magento/Cms/etc/adminhtml/system.xml b/app/code/Magento/Cms/etc/adminhtml/system.xml index 22f67606c535b62a0e1e5f5f4a0ae68dd398ed59..c09ecb3c9fee4222c9cf3106f10652e3d1b90fc2 100644 --- a/app/code/Magento/Cms/etc/adminhtml/system.xml +++ b/app/code/Magento/Cms/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="web"> <group id="default"> diff --git a/app/code/Magento/Cms/etc/config.xml b/app/code/Magento/Cms/etc/config.xml index 5b25edb764f4d8e03ddb79a8c404d3475707c2fb..8fccb4b1ebf465ab45c65bc9480149996ff1f77c 100644 --- a/app/code/Magento/Cms/etc/config.xml +++ b/app/code/Magento/Cms/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <web> <default> diff --git a/app/code/Magento/Cms/etc/di.xml b/app/code/Magento/Cms/etc/di.xml index 3c24a50d54504ad1fef4d7837ca67c72dc0dae81..caa3df5997c9e2770341723ae2e0f826eca08a82 100644 --- a/app/code/Magento/Cms/etc/di.xml +++ b/app/code/Magento/Cms/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Cms\Api\Data\PageSearchResultsInterface" type="Magento\Framework\Api\SearchResults" /> <preference for="Magento\Cms\Api\Data\BlockSearchResultsInterface" diff --git a/app/code/Magento/Cms/etc/frontend/di.xml b/app/code/Magento/Cms/etc/frontend/di.xml index ba99dd4361b896ae147132d3114609e1a3646270..4e2957c1daeaec1efa5bf402624f6425115eda5b 100644 --- a/app/code/Magento/Cms/etc/frontend/di.xml +++ b/app/code/Magento/Cms/etc/frontend/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Framework\App\RouterList"> <arguments> <argument name="routerList" xsi:type="array"> diff --git a/app/code/Magento/Cms/etc/frontend/events.xml b/app/code/Magento/Cms/etc/frontend/events.xml index b912b1974a44cb3c436b3ad35ede812b7774204c..6826c24af7da1b44b9c18197e3e41cda938ebdd0 100644 --- a/app/code/Magento/Cms/etc/frontend/events.xml +++ b/app/code/Magento/Cms/etc/frontend/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="controller_action_noroute"> <observer name="cms" instance="Magento\Cms\Observer\NoRouteObserver" method="execute" /> </event> diff --git a/app/code/Magento/Cms/etc/frontend/page_types.xml b/app/code/Magento/Cms/etc/frontend/page_types.xml index a6284ce44454b14ce4a256d0fa0db37d49cb0999..2f1fa428eb26f143a2ef0245859a0bcc14dafb9d 100644 --- a/app/code/Magento/Cms/etc/frontend/page_types.xml +++ b/app/code/Magento/Cms/etc/frontend/page_types.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page_types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_types.xsd"> +<page_types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_types.xsd"> <type id="cms_index_defaultindex" label="CMS Home Default Page"/> <type id="cms_index_defaultnoroute" label="CMS No-Route Default Page"/> <type id="cms_index_index" label="CMS Home Page"/> diff --git a/app/code/Magento/Cms/etc/frontend/routes.xml b/app/code/Magento/Cms/etc/frontend/routes.xml index 811a778ee14ddcbe7692388e4ac064ccbf0fadd4..10e64ae9464020046b8bfdc9e564544104e1f1d4 100644 --- a/app/code/Magento/Cms/etc/frontend/routes.xml +++ b/app/code/Magento/Cms/etc/frontend/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn: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/etc/module.xml b/app/code/Magento/Cms/etc/module.xml index 9103575c3a6b146e2e8fa1559ac1eeb91fd4625c..d8ff62b8d24130dff7daf919bf6d7aa05b42da3e 100644 --- a/app/code/Magento/Cms/etc/module.xml +++ b/app/code/Magento/Cms/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Cms" setup_version="2.0.0"> <sequence> <module name="Magento_Store"/> diff --git a/app/code/Magento/Cms/etc/mview.xml b/app/code/Magento/Cms/etc/mview.xml index 8052d5b9dfbbc4c0a5e65f024f8ce0296ddd5953..7a28ccc54dfc52d2c10649e07a075dc8cf4c29a8 100644 --- a/app/code/Magento/Cms/etc/mview.xml +++ b/app/code/Magento/Cms/etc/mview.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Mview/etc/mview.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Mview/etc/mview.xsd"> <view id="cms_page_grid" class="Magento\Catalog\Model\Indexer\Category\Flat" group="indexer"> <subscriptions> <table name="cms_page" entity_column="page_id" /> diff --git a/app/code/Magento/Cms/etc/webapi.xml b/app/code/Magento/Cms/etc/webapi.xml index 10b3d1a119d6b8cf569ac91c65bd6ab64cae7b5e..1ac2c7dff41b34bc5c2a9d2d4983297067731d47 100644 --- a/app/code/Magento/Cms/etc/webapi.xml +++ b/app/code/Magento/Cms/etc/webapi.xml @@ -6,7 +6,7 @@ */ --> <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../app/code/Magento/Webapi/etc/webapi.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd"> <!-- Cms Page --> <route url="/V1/cmsPage/:pageId" method="GET"> <service class="Magento\Cms\Api\PageRepositoryInterface" method="getById"/> diff --git a/app/code/Magento/Cms/etc/widget.xml b/app/code/Magento/Cms/etc/widget.xml index b69e13fc5cb094cb80c59aa9bfe4a247ae2f6df2..5256c82b8e365dab0778a6b16daf4749a04c0bae 100644 --- a/app/code/Magento/Cms/etc/widget.xml +++ b/app/code/Magento/Cms/etc/widget.xml @@ -6,7 +6,7 @@ */ --> <widgets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../Magento/Widget/etc/widget.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Widget:etc/widget.xsd"> <widget id="cms_page_link" class="Magento\Cms\Block\Widget\Page\Link" is_email_compatible="true" placeholder_image="Magento_Cms::images/widget_page_link.png"> <label translate="true">CMS Page Link</label> diff --git a/app/code/Magento/Cms/registration.php b/app/code/Magento/Cms/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..cd6957e1c40c0c938cdcab289ac2ae66ad4d802b --- /dev/null +++ b/app/code/Magento/Cms/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Cms', + __DIR__ +); diff --git a/app/code/Magento/Cms/view/adminhtml/layout/cms_block_edit.xml b/app/code/Magento/Cms/view/adminhtml/layout/cms_block_edit.xml index 8d00302c4285be19d50cd64e961f707a19abcafb..a6da9cc84132d6a9bdd099c92fec793665948995 100644 --- a/app/code/Magento/Cms/view/adminhtml/layout/cms_block_edit.xml +++ b/app/code/Magento/Cms/view/adminhtml/layout/cms_block_edit.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <css src="jquery/fileUploader/css/jquery.fileupload-ui.css"/> </head> 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 dbdf185d5083e02bd98847af6d282fc1f0de91b3..73601ae8be1ecf0768ed0a60c11e8c48f83f0d0f 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 @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <uiComponent name="cms_block_listing"/> diff --git a/app/code/Magento/Cms/view/adminhtml/layout/cms_block_new.xml b/app/code/Magento/Cms/view/adminhtml/layout/cms_block_new.xml index ce722d0ebf5fd8342ec5ee8fed7c69e43b906d0c..4c80538b0bf8429c73c33c3fc0ee9ce2c894e511 100644 --- a/app/code/Magento/Cms/view/adminhtml/layout/cms_block_new.xml +++ b/app/code/Magento/Cms/view/adminhtml/layout/cms_block_new.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="cms_block_edit"/> <body/> </page> 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 dc56780bbdca4e0c03883c6f3e1a7161575ad15a..093edd48a2917c0eae9635f15d275e923daecbe3 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 @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <css src="jquery/fileUploader/css/jquery.fileupload-ui.css"/> </head> diff --git a/app/code/Magento/Cms/view/adminhtml/layout/cms_page_index.xml b/app/code/Magento/Cms/view/adminhtml/layout/cms_page_index.xml index b5fbe5373d4f837ce76412ae4d417d182eae26d9..51410a08606e1e79dbc9c79e35659fbfb4d01961 100644 --- a/app/code/Magento/Cms/view/adminhtml/layout/cms_page_index.xml +++ b/app/code/Magento/Cms/view/adminhtml/layout/cms_page_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="styles"/> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/Cms/view/adminhtml/layout/cms_page_new.xml b/app/code/Magento/Cms/view/adminhtml/layout/cms_page_new.xml index dcd2ea87a0844ef0426608105bc4eeb59345429f..583c19e760417a3336ee37a3864f05479fcd3314 100644 --- a/app/code/Magento/Cms/view/adminhtml/layout/cms_page_new.xml +++ b/app/code/Magento/Cms/view/adminhtml/layout/cms_page_new.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="cms_page_edit"/> <body/> </page> diff --git a/app/code/Magento/Cms/view/adminhtml/layout/cms_wysiwyg_images_contents.xml b/app/code/Magento/Cms/view/adminhtml/layout/cms_wysiwyg_images_contents.xml index aa4a5f1ab87d5131b6f11e7e7451c578ac47da21..640fc5b4e6d1b154031613afcbfefd39eab6df30 100644 --- a/app/code/Magento/Cms/view/adminhtml/layout/cms_wysiwyg_images_contents.xml +++ b/app/code/Magento/Cms/view/adminhtml/layout/cms_wysiwyg_images_contents.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root"> <block class="Magento\Cms\Block\Adminhtml\Wysiwyg\Images\Content\Files" name="wysiwyg_images.files" template="browser/content/files.phtml"/> </container> diff --git a/app/code/Magento/Cms/view/adminhtml/layout/cms_wysiwyg_images_index.xml b/app/code/Magento/Cms/view/adminhtml/layout/cms_wysiwyg_images_index.xml index 8468113c8249d3e8807d62ecd6d15af719fa9eb0..b39a28cd28365271b1370a2bdee1f9eb2c7a5e7a 100644 --- a/app/code/Magento/Cms/view/adminhtml/layout/cms_wysiwyg_images_index.xml +++ b/app/code/Magento/Cms/view/adminhtml/layout/cms_wysiwyg_images_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root"> <block class="Magento\Cms\Block\Adminhtml\Wysiwyg\Images\Content" name="wysiwyg_images.content" template="browser/content.phtml"> <block class="Magento\Cms\Block\Adminhtml\Wysiwyg\Images\Tree" name="wysiwyg_images.tree" template="browser/tree.phtml"/> diff --git a/app/code/Magento/Cms/view/adminhtml/ui_component/cms_block_listing.xml b/app/code/Magento/Cms/view/adminhtml/ui_component/cms_block_listing.xml index d3c2f5386df72df5c9fdcbfbede648ba82b4eeab..b00694b3d94fa66c478b62b5f8fb495615143bc8 100644 --- a/app/code/Magento/Cms/view/adminhtml/ui_component/cms_block_listing.xml +++ b/app/code/Magento/Cms/view/adminhtml/ui_component/cms_block_listing.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Ui/etc/ui_configuration.xsd"> +<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Ui/etc/ui_configuration.xsd"> <argument name="data" xsi:type="array"> <item name="js_config" xsi:type="array"> <item name="provider" xsi:type="string">cms_block_listing.cms_block_listing_data_source</item> diff --git a/app/code/Magento/Cms/view/adminhtml/ui_component/cms_page_listing.xml b/app/code/Magento/Cms/view/adminhtml/ui_component/cms_page_listing.xml index 342d4d0a4b83efe2dc56ce1f29586bffcdf603ab..fbef0a00a3a17c807e992660d5fcb5ec4a046093 100644 --- a/app/code/Magento/Cms/view/adminhtml/ui_component/cms_page_listing.xml +++ b/app/code/Magento/Cms/view/adminhtml/ui_component/cms_page_listing.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Ui/etc/ui_configuration.xsd"> +<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Ui/etc/ui_configuration.xsd"> <argument name="data" xsi:type="array"> <item name="js_config" xsi:type="array"> <item name="provider" xsi:type="string">cms_page_listing.cms_page_listing_data_source</item> diff --git a/app/code/Magento/Cms/view/frontend/layout/cms_index_defaultindex.xml b/app/code/Magento/Cms/view/frontend/layout/cms_index_defaultindex.xml index 7fd5363c7474ac4bff150a58135123aec7f7829d..7d5d4d7976fda0c66761fbca078f77b05957cfd1 100644 --- a/app/code/Magento/Cms/view/frontend/layout/cms_index_defaultindex.xml +++ b/app/code/Magento/Cms/view/frontend/layout/cms_index_defaultindex.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Framework\View\Element\Template" name="default_home_page" template="Magento_Cms::default/home.phtml"/> diff --git a/app/code/Magento/Cms/view/frontend/layout/cms_index_defaultnoroute.xml b/app/code/Magento/Cms/view/frontend/layout/cms_index_defaultnoroute.xml index 7859532692e9bd9f2943a4cc49e34fc0327e86f1..ea8e0598ad5ba6a029a6be2a73793610b8beb807 100644 --- a/app/code/Magento/Cms/view/frontend/layout/cms_index_defaultnoroute.xml +++ b/app/code/Magento/Cms/view/frontend/layout/cms_index_defaultnoroute.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Framework\View\Element\Template" name="default_no_route" template="Magento_Cms::default/no-route.phtml"/> diff --git a/app/code/Magento/Cms/view/frontend/layout/cms_index_index.xml b/app/code/Magento/Cms/view/frontend/layout/cms_index_index.xml index a024d6e563cb581c15476d71430b89f2dd05ea36..44eec0b583d14104b76b334e2395d72d5b2bf778 100644 --- a/app/code/Magento/Cms/view/frontend/layout/cms_index_index.xml +++ b/app/code/Magento/Cms/view/frontend/layout/cms_index_index.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body/> </page> diff --git a/app/code/Magento/Cms/view/frontend/layout/cms_index_nocookies.xml b/app/code/Magento/Cms/view/frontend/layout/cms_index_nocookies.xml index a024d6e563cb581c15476d71430b89f2dd05ea36..44eec0b583d14104b76b334e2395d72d5b2bf778 100644 --- a/app/code/Magento/Cms/view/frontend/layout/cms_index_nocookies.xml +++ b/app/code/Magento/Cms/view/frontend/layout/cms_index_nocookies.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body/> </page> diff --git a/app/code/Magento/Cms/view/frontend/layout/cms_index_noroute.xml b/app/code/Magento/Cms/view/frontend/layout/cms_index_noroute.xml index a024d6e563cb581c15476d71430b89f2dd05ea36..44eec0b583d14104b76b334e2395d72d5b2bf778 100644 --- a/app/code/Magento/Cms/view/frontend/layout/cms_index_noroute.xml +++ b/app/code/Magento/Cms/view/frontend/layout/cms_index_noroute.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body/> </page> diff --git a/app/code/Magento/Cms/view/frontend/layout/cms_page_view.xml b/app/code/Magento/Cms/view/frontend/layout/cms_page_view.xml index add0968041be7526b1bbabd542d9b137210342d1..5462e34e452b2e92193f47a8a914e4289fa80480 100644 --- a/app/code/Magento/Cms/view/frontend/layout/cms_page_view.xml +++ b/app/code/Magento/Cms/view/frontend/layout/cms_page_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Cms\Block\Page" name="cms_page"/> diff --git a/app/code/Magento/Cms/view/frontend/layout/default.xml b/app/code/Magento/Cms/view/frontend/layout/default.xml index ce0ba4c0f58cb0b9796687aa4986aff05ccd8a57..d1ab2aa6f9d66a2fbcc26cae038021d84ffbda69 100644 --- a/app/code/Magento/Cms/view/frontend/layout/default.xml +++ b/app/code/Magento/Cms/view/frontend/layout/default.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="footer"> <container name="cms_footer_links_container" label="CMS Footer Links" htmlTag="div" htmlClass="links" before="footer_links" /> diff --git a/app/code/Magento/Cms/view/frontend/layout/print.xml b/app/code/Magento/Cms/view/frontend/layout/print.xml index a024d6e563cb581c15476d71430b89f2dd05ea36..44eec0b583d14104b76b334e2395d72d5b2bf778 100644 --- a/app/code/Magento/Cms/view/frontend/layout/print.xml +++ b/app/code/Magento/Cms/view/frontend/layout/print.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body/> </page> diff --git a/app/code/Magento/CmsUrlRewrite/composer.json b/app/code/Magento/CmsUrlRewrite/composer.json index 4ca4642d5db72ce3153b4df45b59d31fbd8f16c0..da98d893e9f80ae72fa693ea34c7c1e34bc11f41 100644 --- a/app/code/Magento/CmsUrlRewrite/composer.json +++ b/app/code/Magento/CmsUrlRewrite/composer.json @@ -6,8 +6,7 @@ "magento/module-store": "1.0.0-beta", "magento/module-cms": "1.0.0-beta", "magento/module-url-rewrite": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -15,12 +14,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/CmsUrlRewrite" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\CmsUrlRewrite\\": "" + } } } diff --git a/app/code/Magento/CmsUrlRewrite/etc/adminhtml/di.xml b/app/code/Magento/CmsUrlRewrite/etc/adminhtml/di.xml index 5864595aee9e266815d3c57724a0566dfe522968..3466b36a83d72047fd340e73cd6cf9ea9ba9e10c 100644 --- a/app/code/Magento/CmsUrlRewrite/etc/adminhtml/di.xml +++ b/app/code/Magento/CmsUrlRewrite/etc/adminhtml/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Cms\Model\Resource\Page"> <plugin name="cms_url_rewrite_plugin" type="Magento\CmsUrlRewrite\Plugin\Cms\Model\Resource\Page"/> </type> diff --git a/app/code/Magento/CmsUrlRewrite/etc/adminhtml/events.xml b/app/code/Magento/CmsUrlRewrite/etc/adminhtml/events.xml index 37ae7cdccea698e2cdbb5be14b4d076d5b4b11ef..28f880fa12595f4fb65c2dfd4795d90989b92dbf 100644 --- a/app/code/Magento/CmsUrlRewrite/etc/adminhtml/events.xml +++ b/app/code/Magento/CmsUrlRewrite/etc/adminhtml/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="cms_page_save_after"> <observer name="process_url_rewrite_saving" instance="Magento\CmsUrlRewrite\Observer\ProcessUrlRewriteSavingObserver" method="execute" /> </event> diff --git a/app/code/Magento/CmsUrlRewrite/etc/module.xml b/app/code/Magento/CmsUrlRewrite/etc/module.xml index c209306fd7e41adc7f6cab8f69abe7bdbb0b4503..255332564817a1b05d5d49f250fa4875ec4db449 100644 --- a/app/code/Magento/CmsUrlRewrite/etc/module.xml +++ b/app/code/Magento/CmsUrlRewrite/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_CmsUrlRewrite" setup_version="2.0.0"> </module> </config> diff --git a/app/code/Magento/CmsUrlRewrite/etc/setup/events.xml b/app/code/Magento/CmsUrlRewrite/etc/setup/events.xml index 37ae7cdccea698e2cdbb5be14b4d076d5b4b11ef..28f880fa12595f4fb65c2dfd4795d90989b92dbf 100644 --- a/app/code/Magento/CmsUrlRewrite/etc/setup/events.xml +++ b/app/code/Magento/CmsUrlRewrite/etc/setup/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="cms_page_save_after"> <observer name="process_url_rewrite_saving" instance="Magento\CmsUrlRewrite\Observer\ProcessUrlRewriteSavingObserver" method="execute" /> </event> diff --git a/app/code/Magento/CmsUrlRewrite/registration.php b/app/code/Magento/CmsUrlRewrite/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..287bc718443b659137bfcc2af33ad19ba96dca52 --- /dev/null +++ b/app/code/Magento/CmsUrlRewrite/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_CmsUrlRewrite', + __DIR__ +); diff --git a/app/code/Magento/Config/Model/Config/Compiler/IncludeElement.php b/app/code/Magento/Config/Model/Config/Compiler/IncludeElement.php index 22843a83326b3417c407cc7c8f331fccc94861d5..941cdc8529a1b149e748af386767ac10628fec64 100644 --- a/app/code/Magento/Config/Model/Config/Compiler/IncludeElement.php +++ b/app/code/Magento/Config/Model/Config/Compiler/IncludeElement.php @@ -7,9 +7,9 @@ namespace Magento\Config\Model\Config\Compiler; use Magento\Framework\DataObject; use Magento\Framework\Filesystem; +use Magento\Framework\Module\Dir; use Magento\Framework\Module\Dir\Reader; use Magento\Framework\Exception\LocalizedException; -use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\View\TemplateEngine\Xhtml\CompilerInterface; use Magento\Framework\View\TemplateEngine\Xhtml\Compiler\Element\ElementInterface; @@ -26,19 +26,19 @@ class IncludeElement implements ElementInterface protected $moduleReader; /** - * @var Filesystem + * @var Filesystem\Directory\ReadFactory */ - protected $filesystem; + protected $readFactory; /** * Constructor * * @param Reader $moduleReader - * @param Filesystem $filesystem + * @param Filesystem\Directory\ReadFactory $readFactory */ - public function __construct(Reader $moduleReader, Filesystem $filesystem) + public function __construct(Reader $moduleReader, Filesystem\Directory\ReadFactory $readFactory) { - $this->filesystem = $filesystem; + $this->readFactory = $readFactory; $this->moduleReader = $moduleReader; } @@ -92,7 +92,7 @@ class IncludeElement implements ElementInterface } /** - * Get content include file (in adminhtml area) + * Get content of include file (in adminhtml area) * * @param string $includePath * @return string @@ -100,16 +100,16 @@ class IncludeElement implements ElementInterface */ protected function getContent($includePath) { - $modulesDirectory = $this->filesystem->getDirectoryRead(DirectoryList::MODULES); - // <include path="Magento_Payment::my_payment.xml" /> list($moduleName, $filename) = explode('::', $includePath); - $file = $this->moduleReader->getModuleDir('etc', $moduleName) . '/adminhtml/' . $filename; - $path = $modulesDirectory->getRelativePath($file); + $path = 'adminhtml/' . $filename; + $directoryRead = $this->readFactory->create( + $this->moduleReader->getModuleDir(Dir::MODULE_ETC_DIR, $moduleName) + ); - if ($modulesDirectory->isExist($path) && $modulesDirectory->isFile($path)) { - return $modulesDirectory->readFile($path); + if ($directoryRead->isExist($path) && $directoryRead->isFile($path)) { + return $directoryRead->readFile($path); } throw new LocalizedException(__('The file "' . $path . '" does not exist')); diff --git a/app/code/Magento/Config/Model/Config/SchemaLocator.php b/app/code/Magento/Config/Model/Config/SchemaLocator.php index 6222bd70796fb0a856c15ebda8683425fe6c6378..2016dfe514535a058e4dc83dd69696fda409c0ba 100644 --- a/app/code/Magento/Config/Model/Config/SchemaLocator.php +++ b/app/code/Magento/Config/Model/Config/SchemaLocator.php @@ -7,6 +7,8 @@ */ namespace Magento\Config\Model\Config; +use Magento\Framework\Module\Dir; + class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface { /** @@ -28,9 +30,9 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface */ public function __construct(\Magento\Framework\Module\Dir\Reader $moduleReader) { - $this->_schema = $moduleReader->getModuleDir('etc', 'Magento_Config') . '/system.xsd'; - - $this->_perFileSchema = $moduleReader->getModuleDir('etc', 'Magento_Config') . '/system_file.xsd'; + $etcDir = $moduleReader->getModuleDir(\Magento\Framework\Module\Dir::MODULE_ETC_DIR, 'Magento_Config'); + $this->_schema = $etcDir . '/system.xsd'; + $this->_perFileSchema = $etcDir . '/system_file.xsd'; } /** diff --git a/app/code/Magento/Config/Test/Unit/Model/Compiler/IncludeElementTest.php b/app/code/Magento/Config/Test/Unit/Model/Compiler/IncludeElementTest.php index b9247bb304a29020baea78000a033e3b1d54a2f9..c1ee32e7ce3f14c566d1dd319c14f1e741f89238 100644 --- a/app/code/Magento/Config/Test/Unit/Model/Compiler/IncludeElementTest.php +++ b/app/code/Magento/Config/Test/Unit/Model/Compiler/IncludeElementTest.php @@ -5,8 +5,6 @@ */ namespace Magento\Config\Test\Unit\Model\Compiler; -use Magento\Framework\App\Filesystem\DirectoryList; - /** * Class IncludeElementTest */ @@ -23,9 +21,9 @@ class IncludeElementTest extends \PHPUnit_Framework_TestCase protected $moduleReaderMock; /** - * @var \Magento\Framework\Filesystem|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\Filesystem\Directory\ReadFactory|\PHPUnit_Framework_MockObject_MockObject */ - protected $filesystemMock; + protected $readFactoryMock; /** * Set up @@ -37,13 +35,13 @@ class IncludeElementTest extends \PHPUnit_Framework_TestCase $this->moduleReaderMock = $this->getMockBuilder('Magento\Framework\Module\Dir\Reader') ->disableOriginalConstructor() ->getMock(); - $this->filesystemMock = $this->getMockBuilder('Magento\Framework\Filesystem') + $this->readFactoryMock = $this->getMockBuilder('Magento\Framework\Filesystem\Directory\ReadFactory') ->disableOriginalConstructor() ->getMock(); $this->includeElement = new \Magento\Config\Model\Config\Compiler\IncludeElement( $this->moduleReaderMock, - $this->filesystemMock + $this->readFactoryMock ); } @@ -84,7 +82,7 @@ class IncludeElementTest extends \PHPUnit_Framework_TestCase /** * @expectedException \Magento\Framework\Exception\LocalizedException - * @expectedExceptionMessage The file "relative/path/to/file.xml" does not exist + * @expectedExceptionMessage The file "adminhtml/path/to/file.xml" does not exist */ public function testCompileException() { @@ -118,15 +116,14 @@ class IncludeElementTest extends \PHPUnit_Framework_TestCase */ protected function getContentStep($check = true) { - $resultPath = 'relative/path/to/file.xml'; + $resultPath = 'adminhtml/path/to/file.xml'; $includeXmlContent = '<config><item id="1"><test/></item><item id="2"></item></config>'; $modulesDirectoryMock = $this->getMockBuilder('Magento\Framework\Filesystem\Directory\ReadInterface') ->getMockForAbstractClass(); - $this->filesystemMock->expects($this->once()) - ->method('getDirectoryRead') - ->with(DirectoryList::MODULES) + $this->readFactoryMock->expects($this->once()) + ->method('create') ->willReturn($modulesDirectoryMock); $this->moduleReaderMock->expects($this->once()) @@ -134,11 +131,6 @@ class IncludeElementTest extends \PHPUnit_Framework_TestCase ->with('etc', 'Module_Name') ->willReturn('path/in/application/module'); - $modulesDirectoryMock->expects($this->once()) - ->method('getRelativePath') - ->with('path/in/application/module/adminhtml/path/to/file.xml') - ->willReturn($resultPath); - $modulesDirectoryMock->expects($this->once()) ->method('isExist') ->with($resultPath) diff --git a/app/code/Magento/Config/Test/Unit/Model/Config/XsdTest.php b/app/code/Magento/Config/Test/Unit/Model/Config/XsdTest.php index 4f71971b972dc4bcdc6e02c5236be7c99fd6de1e..8ea0e30fa36577250c0f7009eb81938fc21eed6f 100644 --- a/app/code/Magento/Config/Test/Unit/Model/Config/XsdTest.php +++ b/app/code/Magento/Config/Test/Unit/Model/Config/XsdTest.php @@ -14,13 +14,14 @@ class XsdTest extends \PHPUnit_Framework_TestCase protected $_xsdSchema; /** - * @var \Magento\TestFramework\Utility\XsdValidator + * @var \Magento\Framework\TestFramework\Unit\Utility\XsdValidator */ protected $_xsdValidator; protected function setUp() { - $this->_xsdSchema = BP . '/app/code/Magento/Config/etc/system.xsd'; + $urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + $this->_xsdSchema = $urnResolver->getRealPath('urn:magento:module:Magento_Config:etc/system.xsd'); $this->_xsdValidator = new \Magento\Framework\TestFramework\Unit\Utility\XsdValidator(); } diff --git a/app/code/Magento/Config/Test/Unit/Model/Config/_files/invalidSystemXmlArray.php b/app/code/Magento/Config/Test/Unit/Model/Config/_files/invalidSystemXmlArray.php index 049d852ebfa9f82e66aeab1d2fa340c6c7402e45..b8d18c2e097947330fd89340cb79e645e88b191c 100644 --- a/app/code/Magento/Config/Test/Unit/Model/Config/_files/invalidSystemXmlArray.php +++ b/app/code/Magento/Config/Test/Unit/Model/Config/_files/invalidSystemXmlArray.php @@ -7,46 +7,52 @@ return [ 'tab_id_not_unique' => [ '<?xml version="1.0"?><config><system><tab id="tab1"><label>Label One</label>' . '</tab><tab id="tab1"><label>Label Two</label></tab></system></config>', - ["Element 'tab': Duplicate key-sequence ['tab1'] in unique identity-constraint 'uniqueTabId'."], + ["Element 'tab': Duplicate key-sequence ['tab1'] in unique identity-constraint 'uniqueTabId'.\nLine: 1\n"], ], 'section_id_not_unique' => [ '<?xml version="1.0"?><config><system><section id="section1"><label>Label</label><tab>Tab</tab></section>' . '<section id="section1"><label>Label_One</label><tab>Tab_One</tab></section></system></config>', [ "Element 'section': Duplicate key-sequence ['section1'] " . - "in unique identity-constraint 'uniqueSectionId'." + "in unique identity-constraint 'uniqueSectionId'.\nLine: 1\n" ], ], 'field_id_not_unique' => [ '<?xml version="1.0"?><config><system><section id="section1"><group id="group1">' . '<label>Label</label><field id="field_id" /><field id="field_id" /></group>' . '<group id="group2"><label>Label_One</label></group></section></system></config>', - ["Element 'field': Duplicate key-sequence ['field_id'] in unique identity-constraint 'uniqueFieldId'."], + [ + "Element 'field': Duplicate key-sequence ['field_id'] in unique identity-constraint" . + " 'uniqueFieldId'.\nLine: 1\n" + ], ], 'field_element_id_not_expected' => [ '<?xml version="1.0"?><config><system><section id="section1"><label>Label</label><field id="field_id">' . '</field><field id="new_field_id"/></section></system></config>', [ - "Element 'field': This element is not expected." + "Element 'field': This element is not expected.\nLine: 1\n" ], ], 'group_id_not_unique' => [ '<?xml version="1.0"?><config><system><section id="section1"><group id="group1">' . '<label>Label</label></group>' . '<group id="group1"><label>Label_One</label></group></section></system></config>', - ["Element 'group': Duplicate key-sequence ['group1'] in unique identity-constraint 'uniqueGroupId'."], + [ + "Element 'group': Duplicate key-sequence ['group1'] in unique identity-constraint" . + " 'uniqueGroupId'.\nLine: 1\n" + ], ], 'group_is_not_expected' => [ '<?xml version="1.0"?><config><system><group id="group1"><label>Label</label><tab>Tab</tab></group>' . '<group id="group1"><label>Label_One</label><tab>Tab_One</tab></group></system></config>', - ["Element 'group': This element is not expected. Expected is one of ( tab, section )."], + ["Element 'group': This element is not expected. Expected is one of ( tab, section ).\nLine: 1\n"], ], 'upload_dir_is_not_expected' => [ '<?xml version="1.0"?><config><system><section id="section1"><group id="group1">' . '<label>Label</label><field id="field_id" /><upload_dir config="node_one/node_two/node_three" scope_info="1">' . 'node_one/node_two/node_three</upload_dir></group>' . '<group id="group2"><label>Label_One</label></group></section></system></config>', - ["Element 'upload_dir': This element is not expected."], + ["Element 'upload_dir': This element is not expected.\nLine: 1\n"], ], 'upload_dir_with_invalid_type' => [ '<?xml version="1.0"?><config><system><section id="section1"><group id="group1">' . @@ -55,10 +61,10 @@ return [ '<group id="group2"><label>Label_One</label></group></section></system></config>', [ "Element 'config_path': [facet 'minLength'] The value has a length of '2'; this underruns " . - "the allowed minimum length of '5'.", + "the allowed minimum length of '5'.\nLine: 1\n", "Element 'config_path': [facet 'pattern'] The value 'co' is not " . - "accepted by the pattern '[a-zA-Z0-9_\\\\\\\\]+/[a-zA-Z0-9_\\\\\\\\]+/[a-zA-Z0-9_\\\\\\\\]+'.", - "Element 'config_path': 'co' is " . "not a valid value of the atomic type 'typeConfigPath'." + "accepted by the pattern '[a-zA-Z0-9_\\\\\\\\]+/[a-zA-Z0-9_\\\\\\\\]+/[a-zA-Z0-9_\\\\\\\\]+'.\nLine: 1\n", + "Element 'config_path': 'co' is " . "not a valid value of the atomic type 'typeConfigPath'.\nLine: 1\n" ], ], 'if_module_enabled_with_invalid_type' => [ @@ -68,10 +74,10 @@ return [ '<group id="group2"><label>Label_One</label></group></section></system></config>', [ "Element 'if_module_enabled': [facet 'minLength'] The value has a length of '3'; this underruns the " . - "allowed minimum length of '5'.", + "allowed minimum length of '5'.\nLine: 1\n", "Element 'if_module_enabled': [facet 'pattern'] The value 'Som' is not " . - "accepted by the pattern '[A-Z]+[a-zA-Z0-9]{1,}[_\\\\\\\\][A-Z]+[A-Z0-9a-z]{1,}'.", - "Element 'if_module_enabled': 'Som' " . "is not a valid value of the atomic type 'typeModule'." + "accepted by the pattern '[A-Z]+[a-zA-Z0-9]{1,}[_\\\\\\\\][A-Z]+[A-Z0-9a-z]{1,}'.\nLine: 1\n", + "Element 'if_module_enabled': 'Som' " . "is not a valid value of the atomic type 'typeModule'.\nLine: 1\n" ], ], 'id_minimum length' => [ @@ -80,23 +86,23 @@ return [ '<tab id="h"><label>Label_One</label></tab></system></config>', [ "Element 'section', attribute 'id': [facet 'minLength'] The value 's' has a length of '1'; this " . - "underruns the allowed minimum length of '2'.", - "Element 'section', attribute 'id': 's' is not a valid value " . "of the atomic type 'typeId'.", + "underruns the allowed minimum length of '2'.\nLine: 1\n", + "Element 'section', attribute 'id': 's' is not a valid value " . "of the atomic type 'typeId'.\nLine: 1\n", "Element 'section', attribute 'id': Warning: No precomputed " . - "value available, the value was either invalid or something strange happend.", + "value available, the value was either invalid or something strange happend.\nLine: 1\n", "Element 'field', attribute " . "'id': [facet 'minLength'] The value 'f' has a length of '1'; this underruns the allowed minimum length " . - "of '2'.", - "Element 'field', attribute 'id': 'f' is not a valid value of the atomic type 'typeId'.", + "of '2'.\nLine: 1\n", + "Element 'field', attribute 'id': 'f' is not a valid value of the atomic type 'typeId'.\nLine: 1\n", "Element" . " 'field', attribute 'id': " . "Warning: No precomputed value available, the value was either invalid or something" . - " strange happend.", + " strange happend.\nLine: 1\n", "Element 'tab', attribute 'id': [facet 'minLength'] The value 'h' has a length of '1'; " . - "this underruns the allowed minimum length of '2'.", - "Element 'tab', attribute 'id': 'h' is not a valid value" . " of the atomic type 'typeId'.", + "this underruns the allowed minimum length of '2'.\nLine: 1\n", + "Element 'tab', attribute 'id': 'h' is not a valid value" . " of the atomic type 'typeId'.\nLine: 1\n", "Element 'tab', attribute 'id': Warning: No precomputed value available, " . - "the value was either invalid or something strange happend." + "the value was either invalid or something strange happend.\nLine: 1\n" ], ], 'source_model_with_invalid_type' => [ @@ -106,8 +112,8 @@ return [ '<group id="group2"><label>Label_One</label></group></section></system></config>', [ "Element 'source_model': [facet 'minLength'] The value has a length of '4'; this underruns the allowed " . - "minimum length of '5'.", - "Element 'source_model': 'Sour' is not a valid value of the atomic" . " type 'typeModel'." + "minimum length of '5'.\nLine: 1\n", + "Element 'source_model': 'Sour' is not a valid value of the atomic" . " type 'typeModel'.\nLine: 1\n" ], ], 'base_url_with_invalid_type' => [ @@ -116,10 +122,10 @@ return [ '<group id="group2"><label>Label_One</label></group></section></system></config>', [ "Element 'resource': [facet 'minLength'] The value has a length of '4'; this underruns the allowed " . - "minimum length of '8'.", + "minimum length of '8'.\nLine: 1\n", "Element 'resource': [facet 'pattern'] The value 'One:' is not accepted by the " . - "pattern '([A-Z]+[a-zA-Z0-9]{1,}){1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.", - "Element 'resource': 'One:' is not " . "a valid value of the atomic type 'typeAclResourceId'." + "pattern '([A-Z]+[a-zA-Z0-9]{1,}){1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.\nLine: 1\n", + "Element 'resource': 'One:' is not " . "a valid value of the atomic type 'typeAclResourceId'.\nLine: 1\n" ], ], 'advanced_with_invalid_type' => [ @@ -128,7 +134,7 @@ return [ '<group id="group2"><label>Label_One</label></group></section></system></config>', [ "Element 'section', attribute 'advanced': 'string' is not a valid value of the atomic type " . - "'xs:boolean'." + "'xs:boolean'.\nLine: 1\n" ], ], 'advanced_attribute_with_invalid_value' => [ @@ -137,22 +143,22 @@ return [ '<group id="group2"><label>Label_One</label></group></section></system></config>', [ "Element 'section', attribute 'advanced': 'string' is not a valid value of the atomic type " . - "'xs:boolean'." + "'xs:boolean'.\nLine: 1\n" ], ], 'options_node_without_any_options' => [ '<?xml version="1.0"?><config><system><section id="section1" advanced="false">' . '<group id="group1"><label>Label</label><field id="field_id"><options />' . '</field></group><group id="group2"><label>Label_One</label></group></section></system></config>', - ["Element 'options': Missing child element(s). Expected is ( option )."], + ["Element 'options': Missing child element(s). Expected is ( option ).\nLine: 1\n"], ], 'system_node_without_allowed_elements' => [ '<?xml version="1.0"?><config><system/></config>', - ["Element 'system': Missing child element(s). Expected is one of ( tab, section )."], + ["Element 'system': Missing child element(s). Expected is one of ( tab, section ).\nLine: 1\n"], ], 'config_node_without_allowed_elements' => [ '<?xml version="1.0"?><config></config>', - ["Element 'config': Missing child element(s). Expected is ( system )."], + ["Element 'config': Missing child element(s). Expected is ( system ).\nLine: 1\n"], ], 'config_without_required_attributes' => [ '<?xml version="1.0"?><config><system><section><group>' . @@ -161,13 +167,13 @@ return [ '</label></group></section><tab><label>Label</label></tab></system>' . '</config>', [ - "Element 'section': The attribute 'id' is required but missing.", - "Element 'group': The attribute 'id' " . "is required but missing.", - "Element 'attribute': The attribute 'type' is " . "required but missing.", - "Element 'field': The attribute 'id' is required but missing.", - "Element " . "'field': The attribute 'id' is required but missing.", - "Element 'option': The attribute 'label' is " . "required but missing.", - "Element 'tab': The attribute 'id' is required but missing." + "Element 'section': The attribute 'id' is required but missing.\nLine: 1\n", + "Element 'group': The attribute 'id' " . "is required but missing.\nLine: 1\n", + "Element 'attribute': The attribute 'type' is " . "required but missing.\nLine: 1\n", + "Element 'field': The attribute 'id' is required but missing.\nLine: 1\n", + "Element " . "'field': The attribute 'id' is required but missing.\nLine: 1\n", + "Element 'option': The attribute 'label' is " . "required but missing.\nLine: 1\n", + "Element 'tab': The attribute 'id' is required but missing.\nLine: 1\n" ], ], 'attribute_type_is_unique' => [ @@ -177,7 +183,7 @@ return [ '</config>', [ "Element 'attribute': Duplicate key-sequence ['one'] in unique identity-constraint " . - "'uniqueAttributeType'." + "'uniqueAttributeType'.\nLine: 1\n" ], ] ]; diff --git a/app/code/Magento/Config/Test/Unit/Model/Config/_files/valid_system.xml b/app/code/Magento/Config/Test/Unit/Model/Config/_files/valid_system.xml index 3df939a6a5745e7f622a8a87fd8fd8b6b06fb8cc..487f9f1d205ada208a33c42949faa0d9160f5b8b 100644 --- a/app/code/Magento/Config/Test/Unit/Model/Config/_files/valid_system.xml +++ b/app/code/Magento/Config/Test/Unit/Model/Config/_files/valid_system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../app/code/Magento/Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="some_id" translate="label" type="some_type" advanced="true" sortOrder="1001" showInDefault="1" showInWebsite="1" showInStore="1"> <tab>resource</tab> diff --git a/app/code/Magento/Config/Test/Unit/Model/_files/acl.xml b/app/code/Magento/Config/Test/Unit/Model/_files/acl.xml index d5f11c7fb1a4c101e8ca162e2be03f657100df89..c07d5d58db67cef231829c9baaeceacbcbae6a10 100644 --- a/app/code/Magento/Config/Test/Unit/Model/_files/acl.xml +++ b/app/code/Magento/Config/Test/Unit/Model/_files/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::all" title="Allow everything" /> diff --git a/app/code/Magento/Config/Test/Unit/Model/_files/acl_1.xml b/app/code/Magento/Config/Test/Unit/Model/_files/acl_1.xml index 2ee255d7b559effa592fdc4ae123321e85fc6c72..40e68c9f76533d102f69b2d243ba783a35a8d7d4 100644 --- a/app/code/Magento/Config/Test/Unit/Model/_files/acl_1.xml +++ b/app/code/Magento/Config/Test/Unit/Model/_files/acl_1.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Backend_Dummy1::all" title="Allow everything"/> diff --git a/app/code/Magento/Config/Test/Unit/Model/_files/acl_2.xml b/app/code/Magento/Config/Test/Unit/Model/_files/acl_2.xml index 9eb7a2066b0087ad549a6526213ab5067086c27f..ff3e990b6b6913ddf307a9bb9546bf55a53c4454 100644 --- a/app/code/Magento/Config/Test/Unit/Model/_files/acl_2.xml +++ b/app/code/Magento/Config/Test/Unit/Model/_files/acl_2.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Backend_Dummy1::parent"> diff --git a/app/code/Magento/Config/Test/Unit/Model/_files/acl_merged.xml b/app/code/Magento/Config/Test/Unit/Model/_files/acl_merged.xml index a182f8600abcaf6cffe27b01d961aadedaeb0d45..a7eeadb4480f091081a2264d8a1193d4309d2a98 100644 --- a/app/code/Magento/Config/Test/Unit/Model/_files/acl_merged.xml +++ b/app/code/Magento/Config/Test/Unit/Model/_files/acl_merged.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Backend_Dummy1::all" title="Allow everything" /> diff --git a/app/code/Magento/Config/Test/Unit/Model/_files/converted_config.php b/app/code/Magento/Config/Test/Unit/Model/_files/converted_config.php index b957db7565be1d9fb807b3addb33169b3d877ed7..d32243c59501f4565df6b39775b2376938b1ba1b 100644 --- a/app/code/Magento/Config/Test/Unit/Model/_files/converted_config.php +++ b/app/code/Magento/Config/Test/Unit/Model/_files/converted_config.php @@ -6,7 +6,7 @@ return [ 'config' => [ - 'noNamespaceSchemaLocation' => '../../../../../../../../app/code/Magento/Config/etc/system_file.xsd', + 'noNamespaceSchemaLocation' => 'urn:magento:module:Magento_Config:etc/system_file.xsd', 'system' => [ 'tabs' => [ 'tab_1' => [ diff --git a/app/code/Magento/Config/Test/Unit/Model/_files/menu_1.xml b/app/code/Magento/Config/Test/Unit/Model/_files/menu_1.xml index 94621c367d18adff1e485e364ebe499e4ded5445..f36ae5bd34611889a3a14aa9fc542fadfb6085d1 100644 --- a/app/code/Magento/Config/Test/Unit/Model/_files/menu_1.xml +++ b/app/code/Magento/Config/Test/Unit/Model/_files/menu_1.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../app/code/Magento/Backend/etc/menu.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd"> <menu> <add id="elem_one_zero" toolTip='toolTip 1' title="Title one.zero" module="Module_One" sortOrder="90" action="adminhtml/system" resource="Module_One::one_zero" dependsOnModule="Module_One" dependsOnConfig="/one/two"/> <add id="elem_one_one" toolTip='toolTip 2' title="Title one.one" module="Module_One" sortOrder="90" action="adminhtml/system" parent="elem_one_zero" resource="Module_One::one_one" /> diff --git a/app/code/Magento/Config/Test/Unit/Model/_files/menu_2.xml b/app/code/Magento/Config/Test/Unit/Model/_files/menu_2.xml index 6661b3804a36a2736dfba76db3fb0a3488b1cff2..faa4b6bdbf4bcc76d2bde8746937ac209ec3751e 100644 --- a/app/code/Magento/Config/Test/Unit/Model/_files/menu_2.xml +++ b/app/code/Magento/Config/Test/Unit/Model/_files/menu_2.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../app/code/Magento/Backend/etc/menu.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd"> <menu> <add id="elem_two_zero" toolTip='toolTip 4' title="Title two.zero" module="Module_Two" sortOrder="90" action="adminhtml/system" resource="Module_Two::two_zero" /> <add id="elem_two_two" toolTip='toolTip 5' title="Title two.two" module="Module_Two" sortOrder="90" action="adminhtml/system" parent="elem_two_zero" resource="Module_Two::two_two" /> diff --git a/app/code/Magento/Config/Test/Unit/Model/_files/system_1.xml b/app/code/Magento/Config/Test/Unit/Model/_files/system_1.xml index 527c74ba2f5e2b7673c2a34f80bc1b2c3814ae3c..a59e4c2335b83a14bac97a5723930dcc0268225d 100644 --- a/app/code/Magento/Config/Test/Unit/Model/_files/system_1.xml +++ b/app/code/Magento/Config/Test/Unit/Model/_files/system_1.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../app/code/Magento/Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <tab id="tab_1"> <label>Tab 1</label> diff --git a/app/code/Magento/Config/Test/Unit/Model/_files/system_2.xml b/app/code/Magento/Config/Test/Unit/Model/_files/system_2.xml index ea5e8010e03ddc49dff11f777ae2b114ffa6eb34..4573b1084a5cdb36fc59e4c41424b112ee1c81c3 100644 --- a/app/code/Magento/Config/Test/Unit/Model/_files/system_2.xml +++ b/app/code/Magento/Config/Test/Unit/Model/_files/system_2.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../app/code/Magento/Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <tab id="tab_1"> <label>Tab 1 New</label> diff --git a/app/code/Magento/Config/Test/Unit/Model/_files/system_config_options_1.xml b/app/code/Magento/Config/Test/Unit/Model/_files/system_config_options_1.xml index 5b173cf3843ddec12511ad94527bc20dc23d1963..bf37b422f4954b91cd928077e7abea8628344295 100644 --- a/app/code/Magento/Config/Test/Unit/Model/_files/system_config_options_1.xml +++ b/app/code/Magento/Config/Test/Unit/Model/_files/system_config_options_1.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../app/code/Magento/Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="customer"> <group id="create_account"> diff --git a/app/code/Magento/Config/Test/Unit/Model/_files/system_config_options_2.xml b/app/code/Magento/Config/Test/Unit/Model/_files/system_config_options_2.xml index b11b730472dbe3eea33fbadaa0ae04d3dc4bd3a9..e36f40fe40b57f5a745fc6550de42ff58c584c3a 100644 --- a/app/code/Magento/Config/Test/Unit/Model/_files/system_config_options_2.xml +++ b/app/code/Magento/Config/Test/Unit/Model/_files/system_config_options_2.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../app/code/Magento/Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="customer"> <group id="create_account"> diff --git a/app/code/Magento/Config/Test/Unit/Model/_files/system_unknown_attribute_1.xml b/app/code/Magento/Config/Test/Unit/Model/_files/system_unknown_attribute_1.xml index df92f9627cf66562fe855144eda98964821f76ef..a0febb7a754cffc5d1dce0efae1946bbae1bf395 100644 --- a/app/code/Magento/Config/Test/Unit/Model/_files/system_unknown_attribute_1.xml +++ b/app/code/Magento/Config/Test/Unit/Model/_files/system_unknown_attribute_1.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../app/code/Magento/Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="customer"> <group id="create_account"> diff --git a/app/code/Magento/Config/Test/Unit/Model/_files/system_unknown_attribute_2.xml b/app/code/Magento/Config/Test/Unit/Model/_files/system_unknown_attribute_2.xml index 26fed1c80d955e5097975b0bf906605546c67739..c586a7f4ed738cc5c32d9ab48230922e9a68bb3e 100644 --- a/app/code/Magento/Config/Test/Unit/Model/_files/system_unknown_attribute_2.xml +++ b/app/code/Magento/Config/Test/Unit/Model/_files/system_unknown_attribute_2.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../app/code/Magento/Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="customer"> <group id="create_account"> diff --git a/app/code/Magento/Config/composer.json b/app/code/Magento/Config/composer.json index 6654941fe2c2c95176e966d30f869b8c6ba086f2..2f754752051f68609b383461dca01e0b643f4fb3 100644 --- a/app/code/Magento/Config/composer.json +++ b/app/code/Magento/Config/composer.json @@ -9,8 +9,7 @@ "magento/module-email": "1.0.0-beta", "magento/module-directory": "1.0.0-beta", "magento/module-backend": "1.0.0-beta", - "magento/module-media-storage": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/module-media-storage": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -18,12 +17,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Config" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Config\\": "" + } } } diff --git a/app/code/Magento/Config/etc/acl.xml b/app/code/Magento/Config/etc/acl.xml index 7ed3d5a5b6a9674423d27bbbc927b83501f5ce21..71150bfaed99ffa96aa6dfade68221be16d86e69 100644 --- a/app/code/Magento/Config/etc/acl.xml +++ b/app/code/Magento/Config/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/app/code/Magento/Config/etc/adminhtml/di.xml b/app/code/Magento/Config/etc/adminhtml/di.xml index 7f36cb3df060b1fc24d10a0559f051780167d714..fd70dcfe8a29f2b011ff1014573784c7372c1513 100644 --- a/app/code/Magento/Config/etc/adminhtml/di.xml +++ b/app/code/Magento/Config/etc/adminhtml/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Config\Model\Config\Structure\SearchInterface" type="Magento\Config\Model\Config\Structure" /> <preference for="Magento\Config\Model\Config\Backend\File\RequestData\RequestDataInterface" type="Magento\Config\Model\Config\Backend\File\RequestData" /> <type name="Magento\Config\Model\Config\Structure\Element\Iterator\Tab" shared="false" /> diff --git a/app/code/Magento/Config/etc/adminhtml/events.xml b/app/code/Magento/Config/etc/adminhtml/events.xml index a25b6a693e78b435a35529ee551ae13b6c95b29e..432149ddd005d78fef7a8624b15692e034d6b99f 100644 --- a/app/code/Magento/Config/etc/adminhtml/events.xml +++ b/app/code/Magento/Config/etc/adminhtml/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="admin_system_config_changed_section_admin"> <observer name="bind_locale" instance="Magento\Config\Observer\Config\Backend\Admin\AfterCustomUrlChangedObserver" method="execute" /> </event> diff --git a/app/code/Magento/Config/etc/adminhtml/menu.xml b/app/code/Magento/Config/etc/adminhtml/menu.xml index 0be2a4e0c08b4220748f31ccf14444ae9d9b4c81..d7bf04d92e4247dad1cbe61ea2fc1b1aadb044c8 100644 --- a/app/code/Magento/Config/etc/adminhtml/menu.xml +++ b/app/code/Magento/Config/etc/adminhtml/menu.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Backend/etc/menu.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd"> <menu> <add id="Magento_Config::system_config" title="Configuration" module="Magento_Config" sortOrder="20" parent="Magento_Backend::stores_settings" action="adminhtml/system_config" resource="Magento_Config::config"/> </menu> diff --git a/app/code/Magento/Config/etc/adminhtml/routes.xml b/app/code/Magento/Config/etc/adminhtml/routes.xml index 7173d57774f92e18e58888e848ddeb3ea1dddfe2..f7be63ee5be411aa446b6d35ba81bb1189b155fc 100644 --- a/app/code/Magento/Config/etc/adminhtml/routes.xml +++ b/app/code/Magento/Config/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="admin"> <route id="adminhtml"> <module name="Magento_Config"/> diff --git a/app/code/Magento/Config/etc/di.xml b/app/code/Magento/Config/etc/di.xml index 1ead2f9a3418a2587f84577d7a274416eddc9da7..73adec65c51356d29a7d080db7d2f30b621d22e3 100644 --- a/app/code/Magento/Config/etc/di.xml +++ b/app/code/Magento/Config/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Config\Model\Config\Structure\SearchInterface" type="Magento\Config\Model\Config\Structure" /> <preference for="Magento\Config\Model\Config\Backend\File\RequestData\RequestDataInterface" type="Magento\Config\Model\Config\Backend\File\RequestData" /> <preference for="Magento\Framework\App\Config\Resource\ConfigInterface" type="Magento\Config\Model\Resource\Config" /> diff --git a/app/code/Magento/Config/etc/module.xml b/app/code/Magento/Config/etc/module.xml index 9d3539c1da16e197ddf3841a2b2f56a031471c6d..c4223f1f0f59492add96b3350ffbfb8d8ea3ac50 100644 --- a/app/code/Magento/Config/etc/module.xml +++ b/app/code/Magento/Config/etc/module.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Config" setup_version="2.0.0"/> </config> diff --git a/app/code/Magento/Config/registration.php b/app/code/Magento/Config/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..41a97b9b28fefc25b3eac0b4bdbd351b5fd3a370 --- /dev/null +++ b/app/code/Magento/Config/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Config', + __DIR__ +); diff --git a/app/code/Magento/Config/view/adminhtml/layout/adminhtml_system_config_edit.xml b/app/code/Magento/Config/view/adminhtml/layout/adminhtml_system_config_edit.xml index d0535015780eea0aa7dd3bf631da1d620be67861..447c67df2a77c132b800be135b63245020793f96 100644 --- a/app/code/Magento/Config/view/adminhtml/layout/adminhtml_system_config_edit.xml +++ b/app/code/Magento/Config/view/adminhtml/layout/adminhtml_system_config_edit.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="js"> <block class="Magento\Backend\Block\Template" template="Magento_Config::system/config/js.phtml"/> diff --git a/app/code/Magento/ConfigurableImportExport/composer.json b/app/code/Magento/ConfigurableImportExport/composer.json index 85a5e2af8abbb179c74e5e2bedcfbd2fd99531d3..1d013376cd771348b6b05e2800e712c63bf8464e 100644 --- a/app/code/Magento/ConfigurableImportExport/composer.json +++ b/app/code/Magento/ConfigurableImportExport/composer.json @@ -8,8 +8,7 @@ "magento/module-eav": "1.0.0-beta", "magento/module-import-export": "1.0.0-beta", "magento/module-configurable-product": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -17,12 +16,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/ConfigurableImportExport" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\ConfigurableImportExport\\": "" + } } } diff --git a/app/code/Magento/ConfigurableImportExport/etc/di.xml b/app/code/Magento/ConfigurableImportExport/etc/di.xml index 3abd4ee64c7ea909545cecab14e54210fc4679f3..91dc16dd0164a84e9e41dee0ccdf999603a4084d 100644 --- a/app/code/Magento/ConfigurableImportExport/etc/di.xml +++ b/app/code/Magento/ConfigurableImportExport/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\CatalogImportExport\Model\Export\RowCustomizer\Composite"> <arguments> <argument name="customizers" xsi:type="array"> diff --git a/app/code/Magento/ConfigurableImportExport/etc/export.xml b/app/code/Magento/ConfigurableImportExport/etc/export.xml index e309ff36d0003c5877446ff6f99216c1860a92cd..bff20663e65724f6bb2bd630f0f99792788e1d10 100644 --- a/app/code/Magento/ConfigurableImportExport/etc/export.xml +++ b/app/code/Magento/ConfigurableImportExport/etc/export.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../ImportExport/etc/export.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_ImportExport:etc/export.xsd"> <entityType entity="catalog_product" name="configurable" model="Magento\ConfigurableImportExport\Model\Export\Product\Type\Configurable" /> </config> diff --git a/app/code/Magento/ConfigurableImportExport/etc/import.xml b/app/code/Magento/ConfigurableImportExport/etc/import.xml index b99e3b27fbac49ad152661591bea9d30561e4a9b..189800694d448270af1bccc611e9bb51fbbcf813 100644 --- a/app/code/Magento/ConfigurableImportExport/etc/import.xml +++ b/app/code/Magento/ConfigurableImportExport/etc/import.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../ImportExport/etc/import.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_ImportExport:etc/import.xsd"> <entityType entity="catalog_product" name="configurable" model="Magento\ConfigurableImportExport\Model\Import\Product\Type\Configurable" /> </config> diff --git a/app/code/Magento/ConfigurableImportExport/etc/module.xml b/app/code/Magento/ConfigurableImportExport/etc/module.xml index a44fb38ec5d10e228bd353d927683173091d97d4..6f6a04b2af091a977b5d4540803069c35e63e95a 100644 --- a/app/code/Magento/ConfigurableImportExport/etc/module.xml +++ b/app/code/Magento/ConfigurableImportExport/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_ConfigurableImportExport" setup_version="2.0.0"> </module> </config> diff --git a/app/code/Magento/ConfigurableImportExport/registration.php b/app/code/Magento/ConfigurableImportExport/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..8e1dad3f348f877dd36e7cf635cc059f7071c759 --- /dev/null +++ b/app/code/Magento/ConfigurableImportExport/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_ConfigurableImportExport', + __DIR__ +); diff --git a/app/code/Magento/ConfigurableProduct/Model/ProductOptionProcessor.php b/app/code/Magento/ConfigurableProduct/Model/ProductOptionProcessor.php new file mode 100644 index 0000000000000000000000000000000000000000..c8b3345bd1e4483e36eef3001b001ca37a1fa3c7 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Model/ProductOptionProcessor.php @@ -0,0 +1,99 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\ConfigurableProduct\Model; + +use Magento\Catalog\Api\Data\ProductOptionInterface; +use Magento\Catalog\Model\ProductOptionProcessorInterface; +use Magento\ConfigurableProduct\Api\Data\ConfigurableItemOptionValueInterface; +use Magento\ConfigurableProduct\Model\Quote\Item\ConfigurableItemOptionValueFactory; +use Magento\Framework\DataObject; +use Magento\Framework\DataObject\Factory as DataObjectFactory; + +class ProductOptionProcessor implements ProductOptionProcessorInterface +{ + /** + * @var DataObjectFactory + */ + protected $objectFactory; + + /** + * @var ConfigurableItemOptionValueFactory + */ + protected $itemOptionValueFactory; + + /** + * @param DataObjectFactory $objectFactory + * @param ConfigurableItemOptionValueFactory $itemOptionValueFactory + */ + public function __construct( + DataObjectFactory $objectFactory, + ConfigurableItemOptionValueFactory $itemOptionValueFactory + ) { + $this->objectFactory = $objectFactory; + $this->itemOptionValueFactory = $itemOptionValueFactory; + } + + /** + * {@inheritdoc} + */ + public function convertToBuyRequest(ProductOptionInterface $productOption) + { + /** @var DataObject $request */ + $request = $this->objectFactory->create(); + + $options = $this->getConfigurableItemOptions($productOption); + if (!empty($options)) { + $requestData = []; + foreach ($options as $option) { + /** @var ConfigurableItemOptionValueInterface $option */ + $requestData['super_attribute'][$option->getOptionId()] = $option->getOptionValue(); + } + $request->addData($requestData); + } + + return $request; + } + + /** + * Retrieve configurable item options + * + * @param ProductOptionInterface $productOption + * @return array + */ + protected function getConfigurableItemOptions(ProductOptionInterface $productOption) + { + if ($productOption + && $productOption->getExtensionAttributes() + && $productOption->getExtensionAttributes()->getConfigurableItemOptions() + ) { + return $productOption->getExtensionAttributes() + ->getConfigurableItemOptions(); + } + return []; + } + + /** + * {@inheritdoc} + */ + public function convertToProductOption(DataObject $request) + { + $superAttribute = $request->getSuperAttribute(); + if (!empty($superAttribute) && is_array($superAttribute)) { + $data = []; + foreach ($superAttribute as $optionId => $optionValue) { + /** @var ConfigurableItemOptionValueInterface $option */ + $option = $this->itemOptionValueFactory->create(); + $option->setOptionId($optionId); + $option->setOptionValue($optionValue); + $data[] = $option; + } + + return ['configurable_item_options' => $data]; + } + + return []; + } +} diff --git a/app/code/Magento/ConfigurableProduct/Model/Quote/Item/CartItemProcessor.php b/app/code/Magento/ConfigurableProduct/Model/Quote/Item/CartItemProcessor.php index 3ec1ff1fcc5d008b9f2d23280627235b0f12dda7..2728a2df4446aec8a7188260683da35391e038b1 100644 --- a/app/code/Magento/ConfigurableProduct/Model/Quote/Item/CartItemProcessor.php +++ b/app/code/Magento/ConfigurableProduct/Model/Quote/Item/CartItemProcessor.php @@ -70,7 +70,7 @@ class CartItemProcessor implements CartItemProcessorInterface /** * {@inheritdoc} */ - public function processProductOptions(CartItemInterface $cartItem) + public function processOptions(CartItemInterface $cartItem) { $attributesOption = $cartItem->getProduct()->getCustomOption('attributes'); $selectedConfigurableOptions = unserialize($attributesOption->getValue()); diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/ProductOptionProcessorTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/ProductOptionProcessorTest.php new file mode 100644 index 0000000000000000000000000000000000000000..eae13db2c43591df22b68f18f98a662ef8b1d6e9 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/ProductOptionProcessorTest.php @@ -0,0 +1,195 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\ConfigurableProduct\Test\Unit\Model; + +use Magento\ConfigurableProduct\Api\Data\ConfigurableItemOptionValueInterface; +use Magento\ConfigurableProduct\Model\ProductOptionProcessor; +use Magento\ConfigurableProduct\Model\Quote\Item\ConfigurableItemOptionValueFactory; +use Magento\Framework\DataObject; +use Magento\Framework\DataObject\Factory as DataObjectFactory; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; + +class ProductOptionProcessorTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var ProductOptionProcessor + */ + protected $processor; + + /** + * @var DataObject | \PHPUnit_Framework_MockObject_MockObject + */ + protected $dataObject; + + /** + * @var DataObjectFactory | \PHPUnit_Framework_MockObject_MockObject + */ + protected $dataObjectFactory; + + /** + * @var ConfigurableItemOptionValueFactory | \PHPUnit_Framework_MockObject_MockObject + */ + protected $itemOptionValueFactory; + + /** + * @var ConfigurableItemOptionValueInterface | \PHPUnit_Framework_MockObject_MockObject + */ + protected $itemOptionValue; + + protected function setUp() + { + $this->dataObject = $this->getMockBuilder('Magento\Framework\DataObject') + ->setMethods([ + 'getSuperAttribute', + ]) + ->disableOriginalConstructor() + ->getMock(); + + $this->dataObjectFactory = $this->getMockBuilder('Magento\Framework\DataObject\Factory') + ->setMethods(['create']) + ->disableOriginalConstructor() + ->getMock(); + $this->dataObjectFactory->expects($this->any()) + ->method('create') + ->willReturn($this->dataObject); + + $this->itemOptionValue = $this->getMockBuilder( + 'Magento\ConfigurableProduct\Api\Data\ConfigurableItemOptionValueInterface' + ) + ->getMockForAbstractClass(); + + $this->itemOptionValueFactory = $this->getMockBuilder( + 'Magento\ConfigurableProduct\Model\Quote\Item\ConfigurableItemOptionValueFactory' + ) + ->setMethods(['create']) + ->disableOriginalConstructor() + ->getMock(); + $this->itemOptionValueFactory->expects($this->any()) + ->method('create') + ->willReturn($this->itemOptionValue); + + $this->processor = new ProductOptionProcessor( + $this->dataObjectFactory, + $this->itemOptionValueFactory + ); + } + + /** + * @param array|string $options + * @param array $requestData + * @dataProvider dataProviderConvertToBuyRequest + */ + public function testConvertToBuyRequest( + $options, + $requestData + ) { + $productOptionMock = $this->getMockBuilder('Magento\Catalog\Api\Data\ProductOptionInterface') + ->getMockForAbstractClass(); + + $productOptionExtensionMock = $this->getMockBuilder('Magento\Catalog\Api\Data\ProductOptionExtensionInterface') + ->setMethods([ + 'getConfigurableItemOptions', + ]) + ->getMockForAbstractClass(); + + $productOptionMock->expects($this->any()) + ->method('getExtensionAttributes') + ->willReturn($productOptionExtensionMock); + + $productOptionExtensionMock->expects($this->any()) + ->method('getConfigurableItemOptions') + ->willReturn($options); + + $this->dataObject->expects($this->any()) + ->method('addData') + ->with($requestData) + ->willReturnSelf(); + + $this->assertEquals($this->dataObject, $this->processor->convertToBuyRequest($productOptionMock)); + } + + /** + * @return array + */ + public function dataProviderConvertToBuyRequest() + { + $objectManager = new ObjectManager($this); + + /** @var \Magento\ConfigurableProduct\Model\Quote\Item\ConfigurableItemOptionValue $option */ + $option = $objectManager->getObject( + 'Magento\ConfigurableProduct\Model\Quote\Item\ConfigurableItemOptionValue' + ); + $option->setOptionId(1); + $option->setOptionValue('test'); + + return [ + [ + [$option], + [ + 'super_attribute' => [ + 1 => 'test', + ], + ], + ], + [[], []], + ]; + } + + /** + * @param array|string $options + * @param string|null $expected + * @dataProvider dataProviderConvertToProductOption + */ + public function testConvertToProductOption( + $options, + $expected + ) { + $this->dataObject->expects($this->any()) + ->method('getSuperAttribute') + ->willReturn($options); + + if (!empty($options) && is_array($options)) { + $this->itemOptionValue->expects($this->any()) + ->method('setOptionId') + ->with(1) + ->willReturnSelf(); + $this->itemOptionValue->expects($this->any()) + ->method('setOptionValue') + ->with($options[1]) + ->willReturnSelf(); + } + + $result = $this->processor->convertToProductOption($this->dataObject); + + if (!empty($expected)) { + $this->assertArrayHasKey($expected, $result); + $this->assertTrue(is_array($result[$expected])); + } + } + + /** + * @return array + */ + public function dataProviderConvertToProductOption() + { + return [ + [ + 'options' => [ + 1 => 'value', + ], + 'expected' => 'configurable_item_options', + ], + [ + 'options' => [], + 'expected' => null, + ], + [ + 'options' => 'is not array', + 'expected' => null, + ], + ]; + } +} diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Quote/Item/CartItemProcessorTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Quote/Item/CartItemProcessorTest.php index bdaa41b5c24bbe3c390515b93deb269811b9e844..6c1eff26cb135e2c1f815ac6e9634073a3b5390b 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Quote/Item/CartItemProcessorTest.php +++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Quote/Item/CartItemProcessorTest.php @@ -124,7 +124,7 @@ class CartItemProcessorTest extends \PHPUnit_Framework_TestCase $cartItemMock = $this->getMock('\Magento\Quote\Model\Quote\Item', ['getProduct'], [], '', false); $cartItemMock->expects($this->once())->method('getProduct')->willReturn($productMock); - $this->assertEquals($cartItemMock, $this->model->processProductOptions($cartItemMock)); + $this->assertEquals($cartItemMock, $this->model->processOptions($cartItemMock)); } public function testProcessProductOptions() @@ -174,7 +174,7 @@ class CartItemProcessorTest extends \PHPUnit_Framework_TestCase ->willReturnSelf(); $cartItemMock->expects($this->once())->method('setProductOption')->with($productOptionMock)->willReturnSelf(); - $this->assertEquals($cartItemMock, $this->model->processProductOptions($cartItemMock)); + $this->assertEquals($cartItemMock, $this->model->processOptions($cartItemMock)); } public function testProcessProductOptionsIfOptionsExist() @@ -224,6 +224,6 @@ class CartItemProcessorTest extends \PHPUnit_Framework_TestCase ->willReturnSelf(); $cartItemMock->expects($this->once())->method('setProductOption')->with($productOptionMock)->willReturnSelf(); - $this->assertEquals($cartItemMock, $this->model->processProductOptions($cartItemMock)); + $this->assertEquals($cartItemMock, $this->model->processOptions($cartItemMock)); } } diff --git a/app/code/Magento/ConfigurableProduct/composer.json b/app/code/Magento/ConfigurableProduct/composer.json index 3ed8b8b4eaf5f709299df8fd1db5f517779e5b3e..bbf56b1cb0475391d4b23edd114833dc75ec34a7 100644 --- a/app/code/Magento/ConfigurableProduct/composer.json +++ b/app/code/Magento/ConfigurableProduct/composer.json @@ -14,8 +14,7 @@ "magento/framework": "1.0.0-beta", "magento/module-media-storage": "1.0.0-beta", "magento/module-quote": "1.0.0-beta", - "magento/module-ui": "self.version", - "magento/magento-composer-installer": "*" + "magento/module-ui": "self.version" }, "suggest": { "magento/module-webapi": "1.0.0-beta", @@ -27,12 +26,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/ConfigurableProduct" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\ConfigurableProduct\\": "" + } } } diff --git a/app/code/Magento/ConfigurableProduct/etc/adminhtml/di.xml b/app/code/Magento/ConfigurableProduct/etc/adminhtml/di.xml index 226e2f9f2a2eaf852ee09b522578925dd77870c5..bfcfd49f5e2ee6646332e39bd3be3874083684ce 100644 --- a/app/code/Magento/ConfigurableProduct/etc/adminhtml/di.xml +++ b/app/code/Magento/ConfigurableProduct/etc/adminhtml/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Catalog\Controller\Adminhtml\Product\Initialization\Helper"> <plugin name="configurable" type="Magento\ConfigurableProduct\Controller\Adminhtml\Product\Initialization\Helper\Plugin\Configurable" sortOrder="50" /> <plugin name="updateConfigurations" type="Magento\ConfigurableProduct\Controller\Adminhtml\Product\Initialization\Helper\Plugin\UpdateConfigurations" sortOrder="60" /> diff --git a/app/code/Magento/ConfigurableProduct/etc/adminhtml/routes.xml b/app/code/Magento/ConfigurableProduct/etc/adminhtml/routes.xml index fe46504bef1bd93a198d56d1e5f323bee910af1d..951962b3f3caf3fbfa1136aafefc5f4df4e6afd1 100644 --- a/app/code/Magento/ConfigurableProduct/etc/adminhtml/routes.xml +++ b/app/code/Magento/ConfigurableProduct/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn: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/etc/adminhtml/system.xml b/app/code/Magento/ConfigurableProduct/etc/adminhtml/system.xml index 7a34c0d39ed50f8b3e29fb087f8c9d78f77d8f23..db0fa97b114f766b180d1f0fc35cb9fedb53d895 100644 --- a/app/code/Magento/ConfigurableProduct/etc/adminhtml/system.xml +++ b/app/code/Magento/ConfigurableProduct/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="checkout"> <group id="cart"> diff --git a/app/code/Magento/ConfigurableProduct/etc/config.xml b/app/code/Magento/ConfigurableProduct/etc/config.xml index 9cbd5d1e351f252168756cac3dd03ade2e3cc296..2ce1fea0c829737d65ae551724ec3d2a17bc5285 100644 --- a/app/code/Magento/ConfigurableProduct/etc/config.xml +++ b/app/code/Magento/ConfigurableProduct/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <checkout> <cart> diff --git a/app/code/Magento/ConfigurableProduct/etc/di.xml b/app/code/Magento/ConfigurableProduct/etc/di.xml index 7bf23bc01780a7fda341ce3412b8b734b77a9eef..a36abf69f5d48ef81f9ef406c03057f330dec018 100644 --- a/app/code/Magento/ConfigurableProduct/etc/di.xml +++ b/app/code/Magento/ConfigurableProduct/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\ConfigurableProduct\Api\ConfigurableProductManagementInterface" type="Magento\ConfigurableProduct\Model\ConfigurableProductManagement" /> <preference for="Magento\ConfigurableProduct\Api\LinkManagementInterface" type="Magento\ConfigurableProduct\Model\LinkManagement" /> <preference for="Magento\ConfigurableProduct\Api\OptionRepositoryInterface" type="Magento\ConfigurableProduct\Model\OptionRepository" /> @@ -97,6 +97,13 @@ </argument> </arguments> </type> + <type name="Magento\Sales\Api\OrderItemRepositoryInterface"> + <arguments> + <argument name="processorPool" xsi:type="array"> + <item name="configurable" xsi:type="object">Magento\ConfigurableProduct\Model\ProductOptionProcessor</item> + </argument> + </arguments> + </type> <virtualType name="ConfigurableFinalPriceResolver" type="Magento\ConfigurableProduct\Pricing\Price\ConfigurablePriceResolver"> <arguments> <argument name="priceResolver" xsi:type="object">Magento\ConfigurableProduct\Pricing\Price\FinalPriceResolver</argument> diff --git a/app/code/Magento/ConfigurableProduct/etc/extension_attributes.xml b/app/code/Magento/ConfigurableProduct/etc/extension_attributes.xml index 255b93d18fc8329adfcf87d18760b5f284d06e74..f163cbad43c40cc839edd2f55755d6b825c4a7d1 100644 --- a/app/code/Magento/ConfigurableProduct/etc/extension_attributes.xml +++ b/app/code/Magento/ConfigurableProduct/etc/extension_attributes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Api/etc/extension_attributes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> <extension_attributes for="Magento\Catalog\Api\Data\ProductInterface"> <attribute code="configurable_product_options" type="Magento\ConfigurableProduct\Api\Data\OptionInterface[]" /> <attribute code="configurable_product_links" type="int[]" /> @@ -13,4 +13,7 @@ <extension_attributes for="Magento\Quote\Api\Data\ProductOptionInterface"> <attribute code="configurable_item_options" type="Magento\ConfigurableProduct\Api\Data\ConfigurableItemOptionValueInterface[]" /> </extension_attributes> + <extension_attributes for="Magento\Catalog\Api\Data\ProductOptionInterface"> + <attribute code="configurable_item_options" type="Magento\ConfigurableProduct\Api\Data\ConfigurableItemOptionValueInterface[]" /> + </extension_attributes> </config> diff --git a/app/code/Magento/ConfigurableProduct/etc/frontend/di.xml b/app/code/Magento/ConfigurableProduct/etc/frontend/di.xml index 27a999c47887d5829f2cbc512640d0d2d884a55f..b7761cfb9e07ea2dee88ee44e37b72853fba359e 100644 --- a/app/code/Magento/ConfigurableProduct/etc/frontend/di.xml +++ b/app/code/Magento/ConfigurableProduct/etc/frontend/di.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Checkout\CustomerData\ItemPoolInterface"> <arguments> <argument name="itemMap" xsi:type="array"> diff --git a/app/code/Magento/ConfigurableProduct/etc/module.xml b/app/code/Magento/ConfigurableProduct/etc/module.xml index 193c0adb48ca30fddfaad582ac09a792904ff361..f44eea9b0bd07a4eade367bf45797ef9cea27dab 100644 --- a/app/code/Magento/ConfigurableProduct/etc/module.xml +++ b/app/code/Magento/ConfigurableProduct/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_ConfigurableProduct" setup_version="2.0.0"> <sequence> <module name="Magento_Catalog"/> diff --git a/app/code/Magento/ConfigurableProduct/etc/product_types.xml b/app/code/Magento/ConfigurableProduct/etc/product_types.xml index 64b97e9a1676994d505fbdeace1224e4b23222e2..0462f57a0fb9de1bf607066b1958db9160da1dad 100644 --- a/app/code/Magento/ConfigurableProduct/etc/product_types.xml +++ b/app/code/Magento/ConfigurableProduct/etc/product_types.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Catalog/etc/product_types.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/product_types.xsd"> <type name="configurable" label="Configurable Product" modelInstance="Magento\ConfigurableProduct\Model\Product\Type\Configurable" composite='true' indexPriority="30" sortOrder="20"> <priceModel instance="Magento\ConfigurableProduct\Model\Product\Type\Configurable\Price" /> <indexerModel instance="Magento\ConfigurableProduct\Model\Resource\Product\Indexer\Price\Configurable" /> diff --git a/app/code/Magento/ConfigurableProduct/etc/sales.xml b/app/code/Magento/ConfigurableProduct/etc/sales.xml index bf2630cece5e344b846e5180983eb1265a7a8da8..3ec19cd5211d9b1cfbfdda9fc9b1a227325996b9 100644 --- a/app/code/Magento/ConfigurableProduct/etc/sales.xml +++ b/app/code/Magento/ConfigurableProduct/etc/sales.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Sales/etc/sales.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Sales:etc/sales.xsd"> <order> <available_product_type name="configurable"/> </order> diff --git a/app/code/Magento/ConfigurableProduct/etc/webapi.xml b/app/code/Magento/ConfigurableProduct/etc/webapi.xml index 6c0d76b6140c096b51b445c0b9b3ae3af26dc969..3f76bf4bfaaa56db03768890f95e44bf628a7dd9 100644 --- a/app/code/Magento/ConfigurableProduct/etc/webapi.xml +++ b/app/code/Magento/ConfigurableProduct/etc/webapi.xml @@ -6,7 +6,7 @@ */ --> <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../app/code/Magento/Webapi/etc/webapi.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd"> <route url="/V1/configurable-products/:sku/children" method="GET"> <service class="Magento\ConfigurableProduct\Api\LinkManagementInterface" method="getChildren"/> <resources> diff --git a/app/code/Magento/ConfigurableProduct/registration.php b/app/code/Magento/ConfigurableProduct/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..411e42eeecbfe0a04df689061ad056f01337894d --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_ConfigurableProduct', + __DIR__ +); diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_associated_grid.xml b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_associated_grid.xml index d9dc4c65e3331f03d50db1f22b96b3dff8a71513..b5d57ac33dd541b0ddbeca4fbf511719097c90f9 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_associated_grid.xml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_associated_grid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root"> <uiComponent name="configurable_associated_product_listing"/> </container> diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_attribute_edit_product_tab_variations_popup.xml b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_attribute_edit_product_tab_variations_popup.xml index 8ffec72e74e4aff949c83bb6ba69892ee13e143f..b7f81ac9e9fcb818afb69f98206d8bcb64a57050 100755 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_attribute_edit_product_tab_variations_popup.xml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_attribute_edit_product_tab_variations_popup.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="catalog_product_attribute_edit_popup"/> </page> 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 2a361a45de36c62309abd33455a61e65355e376f..7c8de9c8ee011fbcb0615909545bb84ab636811c 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 @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <css src="Magento_ConfigurableProduct::css/configurable-product.css"/> </head> diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_downloadable.xml b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_downloadable.xml index 51f8a6ef6cbf833a1735821f931caa8897d0afc8..0151308bd2ddf4af7ecd8cc5fca9f77114ccf05d 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_downloadable.xml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_downloadable.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="catalog_product_superconfig_config"/> </page> diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_new.xml b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_new.xml index e3f54be9e1bca0ec1f190cbb21814b7728850a88..b6683bdeca4a7f6866a9adc90581af1e59afc2f4 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_new.xml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_new.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <css src="Magento_ConfigurableProduct::product/product.css"/> </head> diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_set_edit.xml b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_set_edit.xml index 35dd527e241e1abdb579577c02a53de6a4c61445..5ae007cd3fb531ab7720dfe2a2f6aa0230e97681 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_set_edit.xml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_set_edit.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Backend\Block\Template" name="adminhtml.catalog.product.set.edit.configurable" template="Magento_ConfigurableProduct::catalog/product/attribute/set/js.phtml" after="adminhtml.catalog.product.set.edit"/> diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_simple.xml b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_simple.xml index 51f8a6ef6cbf833a1735821f931caa8897d0afc8..0151308bd2ddf4af7ecd8cc5fca9f77114ccf05d 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_simple.xml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_simple.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="catalog_product_superconfig_config"/> </page> diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_superconfig_config.xml b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_superconfig_config.xml index bd9103028a8455ab6357816c9c474a3505127e60..afb59db24d96a52acff24e22f7d56bf3f94e6371 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_superconfig_config.xml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_superconfig_config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="product_tabs"> <block class="Magento\ConfigurableProduct\Block\Adminhtml\Product\Edit\Tab\Super\Config" name="admin.product.edit.tab.super.config.grid.container"> diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_view_type_configurable.xml b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_view_type_configurable.xml index 2e8f21ee84ba2431fd07584ebfb54056452d2982..e040e30cee86dede061a37f447e38117adcde4bf 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_view_type_configurable.xml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_view_type_configurable.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="product.composite.fieldset"> <block class="Magento\ConfigurableProduct\Block\Adminhtml\Product\Composite\Fieldset\Configurable" name="product.composite.fieldset.configurable" before="product.composite.fieldset.options" template="catalog/product/composite/fieldset/configurable.phtml"/> diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_virtual.xml b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_virtual.xml index 51f8a6ef6cbf833a1735821f931caa8897d0afc8..0151308bd2ddf4af7ecd8cc5fca9f77114ccf05d 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_virtual.xml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_virtual.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="catalog_product_superconfig_config"/> </page> diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/ui_component/configurable_associated_product_listing.xml b/app/code/Magento/ConfigurableProduct/view/adminhtml/ui_component/configurable_associated_product_listing.xml index f8ff2b7872c7cac2898d4e1baa2c12bc03520db4..8212cbc0c4a22e90c63a9473f6875b54b06b82c1 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/ui_component/configurable_associated_product_listing.xml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/ui_component/configurable_associated_product_listing.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Ui/etc/ui_configuration.xsd"> +<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Ui/etc/ui_configuration.xsd"> <argument name="data" xsi:type="array"> <item name="js_config" xsi:type="array"> <item name="provider" xsi:type="string">configurable_associated_product_listing.data_source</item> diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/ui_component/product_attributes_listing.xml b/app/code/Magento/ConfigurableProduct/view/adminhtml/ui_component/product_attributes_listing.xml index 0ed4b7a3ac3c4e63b85625ccd2fb8787a2b60ac0..e72edb975aede0f02d705f2a4f55de072ef3ba9a 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/ui_component/product_attributes_listing.xml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/ui_component/product_attributes_listing.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Ui/etc/ui_configuration.xsd"> +<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Ui/etc/ui_configuration.xsd"> <argument name="data" xsi:type="array"> <item name="js_config" xsi:type="array"> <item name="provider" xsi:type="string">product_attributes_listing.product_attributes_listing_data_source</item> diff --git a/app/code/Magento/ConfigurableProduct/view/frontend/layout/catalog_product_view_type_configurable.xml b/app/code/Magento/ConfigurableProduct/view/frontend/layout/catalog_product_view_type_configurable.xml index 6c80f8fe902e92be7e1d69bf96d48f1ac16ec124..49c1fc190475e63e253cf46fb5eb3ec6f6204ea3 100644 --- a/app/code/Magento/ConfigurableProduct/view/frontend/layout/catalog_product_view_type_configurable.xml +++ b/app/code/Magento/ConfigurableProduct/view/frontend/layout/catalog_product_view_type_configurable.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <attribute name="class" value="page-product-configurable"/> <referenceBlock name="head.components"> diff --git a/app/code/Magento/ConfigurableProduct/view/frontend/layout/checkout_cart_configure_type_configurable.xml b/app/code/Magento/ConfigurableProduct/view/frontend/layout/checkout_cart_configure_type_configurable.xml index 76f152b64e240e825e3edb7ef39a16f9f80c50d8..6c7496eed0df0d8f987830d93dc4623d1f48fa4c 100644 --- a/app/code/Magento/ConfigurableProduct/view/frontend/layout/checkout_cart_configure_type_configurable.xml +++ b/app/code/Magento/ConfigurableProduct/view/frontend/layout/checkout_cart_configure_type_configurable.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="catalog_product_view_type_configurable"/> <body/> </page> diff --git a/app/code/Magento/ConfigurableProduct/view/frontend/layout/checkout_cart_item_renderers.xml b/app/code/Magento/ConfigurableProduct/view/frontend/layout/checkout_cart_item_renderers.xml index 8b303c7a667fcec5c25753db40715ed3e168e8b4..5fc80c5390b2c8f89300f92a587ef8b9c87a2cb2 100644 --- a/app/code/Magento/ConfigurableProduct/view/frontend/layout/checkout_cart_item_renderers.xml +++ b/app/code/Magento/ConfigurableProduct/view/frontend/layout/checkout_cart_item_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout.cart.item.renderers"> <block class="Magento\ConfigurableProduct\Block\Cart\Item\Renderer\Configurable" as="configurable" template="Magento_Checkout::cart/item/default.phtml"> diff --git a/app/code/Magento/ConfigurableProduct/view/frontend/layout/checkout_onepage_review_item_renderers.xml b/app/code/Magento/ConfigurableProduct/view/frontend/layout/checkout_onepage_review_item_renderers.xml index 4b6e5809647bf1fe3d54f410fe968a5feac8f7f5..77a866bbd1ca1249134b4dcc816a08a13b76d251 100644 --- a/app/code/Magento/ConfigurableProduct/view/frontend/layout/checkout_onepage_review_item_renderers.xml +++ b/app/code/Magento/ConfigurableProduct/view/frontend/layout/checkout_onepage_review_item_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout.onepage.review.item.renderers"> <block class="Magento\ConfigurableProduct\Block\Cart\Item\Renderer\Configurable" as="configurable" template="Magento_Checkout::onepage/review/item.phtml" cacheable="false"/> diff --git a/app/code/Magento/Contact/composer.json b/app/code/Magento/Contact/composer.json index 27185c09c5557bef4f95f53f5171d735e779c843..bfbc8b5e9332916c477ac2a36b7380b39edef9e2 100644 --- a/app/code/Magento/Contact/composer.json +++ b/app/code/Magento/Contact/composer.json @@ -8,8 +8,7 @@ "magento/module-backend": "1.0.0-beta", "magento/module-customer": "1.0.0-beta", "magento/module-cms": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -17,12 +16,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Contact" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Contact\\": "" + } } } diff --git a/app/code/Magento/Contact/etc/acl.xml b/app/code/Magento/Contact/etc/acl.xml index 2924079a113cebd2a3a5e8c36a0946cccd7884a9..4eeba1de353377d1ab61e08172b383100db6f4e1 100644 --- a/app/code/Magento/Contact/etc/acl.xml +++ b/app/code/Magento/Contact/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/app/code/Magento/Contact/etc/adminhtml/system.xml b/app/code/Magento/Contact/etc/adminhtml/system.xml index b6471ae8a066baea5f7ea6a08f7ca4c9b20064af..59eb3525e0e11b21b555caad0e4526f3c7fc67db 100644 --- a/app/code/Magento/Contact/etc/adminhtml/system.xml +++ b/app/code/Magento/Contact/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="contact" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Contacts</label> diff --git a/app/code/Magento/Contact/etc/config.xml b/app/code/Magento/Contact/etc/config.xml index fb2a17aa0100cbc9524c4692881ac265f7fe2275..31cbbbbdcb0b737da493cf446658ca7bfb4ecbe5 100644 --- a/app/code/Magento/Contact/etc/config.xml +++ b/app/code/Magento/Contact/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <contact> <contact> diff --git a/app/code/Magento/Contact/etc/email_templates.xml b/app/code/Magento/Contact/etc/email_templates.xml index 10b1171395b7e1e463522d012be582353f82834b..26edbbc47589b3a18e6296b1d37c6798ee03d185 100644 --- a/app/code/Magento/Contact/etc/email_templates.xml +++ b/app/code/Magento/Contact/etc/email_templates.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Email/etc/email_templates.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Email:etc/email_templates.xsd"> <template id="contact_email_email_template" label="Contact Form" file="submitted_form.html" type="text" module="Magento_Contact" area="adminhtml"/> </config> diff --git a/app/code/Magento/Contact/etc/frontend/di.xml b/app/code/Magento/Contact/etc/frontend/di.xml index 3bee0d4b8d91885ff52faac54d8a4b9737eaff6a..f07d7340d4a82594928622895437c06f0be76acb 100644 --- a/app/code/Magento/Contact/etc/frontend/di.xml +++ b/app/code/Magento/Contact/etc/frontend/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Framework\Url\SecurityInfo"> <arguments> <argument name="secureUrlList" xsi:type="array"> diff --git a/app/code/Magento/Contact/etc/frontend/page_types.xml b/app/code/Magento/Contact/etc/frontend/page_types.xml index 9e85e85522a1557017ebbb649332049502d381fb..0b339a1ddeb4be6da51ede69d2f2b481fa52a6c7 100644 --- a/app/code/Magento/Contact/etc/frontend/page_types.xml +++ b/app/code/Magento/Contact/etc/frontend/page_types.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<page_types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_types.xsd"> +<page_types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_types.xsd"> <type id="contact_index_index" label="Contact Us Form"/> </page_types> diff --git a/app/code/Magento/Contact/etc/frontend/routes.xml b/app/code/Magento/Contact/etc/frontend/routes.xml index 9caada7acfe06e998eac722f5a51435cfe8c4b1a..dc34678aa9ff019a1cd50541832a4aea5286a069 100644 --- a/app/code/Magento/Contact/etc/frontend/routes.xml +++ b/app/code/Magento/Contact/etc/frontend/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="standard"> <route id="contact" frontName="contact"> <module name="Magento_Contact" /> diff --git a/app/code/Magento/Contact/etc/module.xml b/app/code/Magento/Contact/etc/module.xml index 96f06a6c555a729a02b8643f7e01b3987e5a9bf0..d9158bbcbfb54e3db86c7d7772636a7b096c3a38 100644 --- a/app/code/Magento/Contact/etc/module.xml +++ b/app/code/Magento/Contact/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Contact" setup_version="2.0.0"> <sequence> <module name="Magento_Store"/> diff --git a/app/code/Magento/Contact/registration.php b/app/code/Magento/Contact/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..3ebc422ed8f772440f6578fe10f6d4c89b4fc7ec --- /dev/null +++ b/app/code/Magento/Contact/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Contact', + __DIR__ +); diff --git a/app/code/Magento/Contact/view/frontend/layout/contact_index_index.xml b/app/code/Magento/Contact/view/frontend/layout/contact_index_index.xml index 843206e4e00d54257207e8c74ce8e856d8f59f5b..28868008b0187419b221c9d86abed835064973f9 100644 --- a/app/code/Magento/Contact/view/frontend/layout/contact_index_index.xml +++ b/app/code/Magento/Contact/view/frontend/layout/contact_index_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <title>Contact Us</title> </head> diff --git a/app/code/Magento/Contact/view/frontend/layout/default.xml b/app/code/Magento/Contact/view/frontend/layout/default.xml index 9665e1908a28ebd976b664d6a1d88553093a1fb3..9b7417a841f08daea5f43e10f1fac7d8358221cd 100644 --- a/app/code/Magento/Contact/view/frontend/layout/default.xml +++ b/app/code/Magento/Contact/view/frontend/layout/default.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="footer_links"> <block class="Magento\Framework\View\Element\Html\Link\Current" ifconfig="contact/contact/enabled" name="contact-us-link"> diff --git a/app/code/Magento/Cookie/View/frontend/layout/default.xml b/app/code/Magento/Cookie/View/frontend/layout/default.xml index d614b1930796ec1da177962c3bd1cc3c13ce02d6..8409002e39a5f6c84c24085a70643fed6bc6f8da 100644 --- a/app/code/Magento/Cookie/View/frontend/layout/default.xml +++ b/app/code/Magento/Cookie/View/frontend/layout/default.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="after.body.start"> <block class="Magento\Cookie\Block\Html\Notices" name="cookie_notices" template="html/notices.phtml" after="global_notices" /> diff --git a/app/code/Magento/Cookie/composer.json b/app/code/Magento/Cookie/composer.json index ce2f7105503aa5b96a0d67ea38c9bb57f16b15ac..4c1eb56566a7f4c771d7667adcb3a7f79c73faf0 100644 --- a/app/code/Magento/Cookie/composer.json +++ b/app/code/Magento/Cookie/composer.json @@ -4,8 +4,7 @@ "require": { "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "suggest": { "magento/module-backend": "1.0.0-beta" @@ -16,12 +15,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Cookie" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Cookie\\": "" + } } } diff --git a/app/code/Magento/Cookie/etc/adminhtml/system.xml b/app/code/Magento/Cookie/etc/adminhtml/system.xml index 3bab296d60e07658aafc9bcd5fda0dde957a22fd..d81843b3c9a59e4a803a1983bc38f680830e6ea2 100644 --- a/app/code/Magento/Cookie/etc/adminhtml/system.xml +++ b/app/code/Magento/Cookie/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="web"> <group id="cookie" translate="label" type="text" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="1"> diff --git a/app/code/Magento/Cookie/etc/config.xml b/app/code/Magento/Cookie/etc/config.xml index 7ebaec497d7bfd166822f31eb274c3e2feeb3692..4e00a40ab8b08c50353bb3039d0d870dcabe8a3c 100644 --- a/app/code/Magento/Cookie/etc/config.xml +++ b/app/code/Magento/Cookie/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <web> <cookie> diff --git a/app/code/Magento/Cookie/etc/di.xml b/app/code/Magento/Cookie/etc/di.xml index 799e0fe695c6c5dd7b0a2d04035df64bcfc9325b..f36629779b784203bcee611ed2b5fa01f5864730 100644 --- a/app/code/Magento/Cookie/etc/di.xml +++ b/app/code/Magento/Cookie/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Framework\Stdlib\CookieManagerInterface" type="Magento\Framework\Stdlib\Cookie\PhpCookieManager" /> </config> diff --git a/app/code/Magento/Cookie/etc/frontend/routes.xml b/app/code/Magento/Cookie/etc/frontend/routes.xml index c4cfd0133086fe8508f9952df04f89988d497374..c56059f32fd595ea9f0e1b47d5e9b70c20a21500 100644 --- a/app/code/Magento/Cookie/etc/frontend/routes.xml +++ b/app/code/Magento/Cookie/etc/frontend/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="standard"> <route id="cookie" frontName="cookie"> <module name="Magento_Cookie" /> diff --git a/app/code/Magento/Cookie/etc/module.xml b/app/code/Magento/Cookie/etc/module.xml index 462bc56f2ec7bae419abced02057b16840e4e2d7..424b34d7a625c03a997ae52ddf12d47c8fc43f88 100644 --- a/app/code/Magento/Cookie/etc/module.xml +++ b/app/code/Magento/Cookie/etc/module.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Cookie" setup_version="2.0.0"/> </config> diff --git a/app/code/Magento/Cookie/registration.php b/app/code/Magento/Cookie/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..23fff0217dba407c392c7e5a40770f22930c7910 --- /dev/null +++ b/app/code/Magento/Cookie/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Cookie', + __DIR__ +); diff --git a/app/code/Magento/Cron/Model/Config/SchemaLocator.php b/app/code/Magento/Cron/Model/Config/SchemaLocator.php index 8887de8068332334ab3216d947e6e0ed40a0e3e0..10077cc0834a22c02ff5d2daae29552078e5fb19 100644 --- a/app/code/Magento/Cron/Model/Config/SchemaLocator.php +++ b/app/code/Magento/Cron/Model/Config/SchemaLocator.php @@ -5,6 +5,8 @@ */ namespace Magento\Cron\Model\Config; +use Magento\Framework\Module\Dir; + /** * Cron locator */ @@ -29,7 +31,7 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface */ public function __construct(\Magento\Framework\Module\Dir\Reader $moduleReader) { - $this->_schema = $moduleReader->getModuleDir('etc', 'Magento_Cron') . '/' . 'crontab.xsd'; + $this->_schema = $moduleReader->getModuleDir(Dir::MODULE_ETC_DIR, 'Magento_Cron') . '/' . 'crontab.xsd'; } /** diff --git a/app/code/Magento/Cron/Model/Groups/Config/SchemaLocator.php b/app/code/Magento/Cron/Model/Groups/Config/SchemaLocator.php index 7590035eafdb473fde09a0e59a53b553b13a4c66..cf7923da375bced1fafa8ea665afce4dadc09031 100644 --- a/app/code/Magento/Cron/Model/Groups/Config/SchemaLocator.php +++ b/app/code/Magento/Cron/Model/Groups/Config/SchemaLocator.php @@ -5,6 +5,8 @@ */ namespace Magento\Cron\Model\Groups\Config; +use Magento\Framework\Module\Dir; + /** * Cron locator */ @@ -29,7 +31,7 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface */ public function __construct(\Magento\Framework\Module\Dir\Reader $moduleReader) { - $this->_schema = $moduleReader->getModuleDir('etc', 'Magento_Cron') . '/' . 'cron_groups.xsd'; + $this->_schema = $moduleReader->getModuleDir(Dir::MODULE_ETC_DIR, 'Magento_Cron') . '/' . 'cron_groups.xsd'; $this->_perFileSchema = $this->_schema; } diff --git a/app/code/Magento/Cron/Test/Unit/Model/Config/XsdTest.php b/app/code/Magento/Cron/Test/Unit/Model/Config/XsdTest.php index 7ce347921056347ba4383585a0892aa192200f5a..38274f3f04e7bf4088e956ca160cdd513eb0d237 100644 --- a/app/code/Magento/Cron/Test/Unit/Model/Config/XsdTest.php +++ b/app/code/Magento/Cron/Test/Unit/Model/Config/XsdTest.php @@ -7,11 +7,15 @@ namespace Magento\Cron\Test\Unit\Model\Config; class XsdTest extends \PHPUnit_Framework_TestCase { + /** + * @var string + */ protected $_xsdFile; public function setUp() { - $this->_xsdFile = __DIR__ . "/../../../../../../../../app/code/Magento/Cron/etc/crontab.xsd"; + $urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + $this->_xsdFile = $urnResolver->getRealPath('urn:magento:module:Magento_Cron:etc/crontab.xsd'); } /** @@ -23,9 +27,9 @@ class XsdTest extends \PHPUnit_Framework_TestCase $dom = new \DOMDocument(); $dom->load(__DIR__ . "/_files/{$xmlFile}"); libxml_use_internal_errors(true); - $result = $dom->schemaValidate($this->_xsdFile); + $result = \Magento\Framework\Config\Dom::validateDomDocument($dom, $this->_xsdFile); libxml_use_internal_errors(false); - $this->assertTrue($result); + $this->assertEmpty($result, 'Validation failed with errors: ' . join(', ', $result)); } /** @@ -46,16 +50,11 @@ class XsdTest extends \PHPUnit_Framework_TestCase $dom = new \DOMDocument(); $dom->load(__DIR__ . "/_files/{$xmlFile}"); libxml_use_internal_errors(true); - $dom->schemaValidate($this->_xsdFile); - $errors = libxml_get_errors(); - $actualErrors = []; - foreach ($errors as $error) { - $actualErrors[] = $error->message; - } + $result = \Magento\Framework\Config\Dom::validateDomDocument($dom, $this->_xsdFile); libxml_use_internal_errors(false); - $this->assertEquals($expectedErrors, $actualErrors); + $this->assertEquals($expectedErrors, $result); } /** @@ -67,33 +66,35 @@ class XsdTest extends \PHPUnit_Framework_TestCase [ 'crontab_invalid.xml', [ - "Element 'job', attribute 'wrongName': The attribute 'wrongName' is not allowed.\n", - "Element 'job', attribute 'wrongInstance': The attribute 'wrongInstance' is not allowed.\n", - "Element 'job', attribute 'wrongMethod': The attribute 'wrongMethod' is not allowed.\n", - "Element 'job': The attribute 'name' is required but missing.\n", - "Element 'job': The attribute 'instance' is required but missing.\n", - "Element 'job': The attribute 'method' is required but missing.\n", + "Element 'job', attribute 'wrongName': The attribute 'wrongName' is not allowed.\nLine: 10\n", + "Element 'job', attribute 'wrongInstance': " . + "The attribute 'wrongInstance' is not allowed.\nLine: 10\n", + "Element 'job', attribute 'wrongMethod': The attribute 'wrongMethod' is not allowed.\nLine: 10\n", + "Element 'job': The attribute 'name' is required but missing.\nLine: 10\n", + "Element 'job': The attribute 'instance' is required but missing.\nLine: 10\n", + "Element 'job': The attribute 'method' is required but missing.\nLine: 10\n", "Element 'wrongSchedule': This element is not expected." . - " Expected is one of ( schedule, config_path ).\n" + " Expected is one of ( schedule, config_path ).\nLine: 11\n" ], ], [ 'crontab_invalid_duplicates.xml', [ - "Element 'job': Duplicate key-sequence ['job1'] in unique identity-constraint 'uniqueJobName'.\n" + "Element 'job': Duplicate key-sequence ['job1'] in " . + "unique identity-constraint 'uniqueJobName'.\nLine: 13\n" ] ], [ 'crontab_invalid_without_name.xml', - ["Element 'job': The attribute 'name' is required but missing.\n"] + ["Element 'job': The attribute 'name' is required but missing.\nLine: 10\n"] ], [ 'crontab_invalid_without_instance.xml', - ["Element 'job': The attribute 'instance' is required but missing.\n"] + ["Element 'job': The attribute 'instance' is required but missing.\nLine: 10\n"] ], [ 'crontab_invalid_without_method.xml', - ["Element 'job': The attribute 'method' is required but missing.\n"] + ["Element 'job': The attribute 'method' is required but missing.\nLine: 10\n"] ] ]; } diff --git a/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_invalid.xml b/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_invalid.xml index d043aa0ab3364c2b026c35b2abe5e835627497c2..34c7acde92aaeccf63bfdf39c2aa442edb1a53b5 100644 --- a/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_invalid.xml +++ b/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_invalid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../app/code/Magento/Cron/etc/crontab.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd"> <group id="default"> <job wrongName="job1" wrongInstance="Model1" wrongMethod="method1"> <wrongSchedule>30 2 * * *</wrongSchedule> diff --git a/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_invalid_duplicates.xml b/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_invalid_duplicates.xml index 84fa9923453bb09db043f2d74c4e8ed92fba1917..d5eaad73a0736feae096ff74641ba724e49585b0 100644 --- a/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_invalid_duplicates.xml +++ b/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_invalid_duplicates.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../app/code/Magento/Cron/etc/crontab.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd"> <group id="default"> <job name="job1" instance="Model1" method="method1"> <schedule>30 2 * * *</schedule> diff --git a/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_invalid_node_typo.xml b/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_invalid_node_typo.xml index 3857f6bea24eab5514aef94512d771cedac74ec7..578d9fdf9350c08c0d53dc7a2cb9de380bccc812 100644 --- a/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_invalid_node_typo.xml +++ b/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_invalid_node_typo.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../app/code/Magento/Cron/etc/crontab.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd"> <group id="default"> <typo name="job1" instance="Model1" method="method1"> <schedule>30 2 * * *</schedule> diff --git a/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_invalid_without_instance.xml b/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_invalid_without_instance.xml index 7bab7e343bcdfe34df73438774b7c272d90e4c2b..05c7d94543643fb61252732d91dda87e15dc9373 100644 --- a/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_invalid_without_instance.xml +++ b/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_invalid_without_instance.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../app/code/Magento/Cron/etc/crontab.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd"> <group id="default"> <job name="job1" method="method1"> <schedule>30 2 * * *</schedule> diff --git a/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_invalid_without_method.xml b/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_invalid_without_method.xml index bc4fb9aae2a7148ce95ddbf7885d37f70a0c1b92..41bdcebfa79b813b0d2ccdad5b3ab10ecb85d26d 100644 --- a/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_invalid_without_method.xml +++ b/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_invalid_without_method.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../app/code/Magento/Cron/etc/crontab.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd"> <group id="default"> <job name="job1" instance="Model1"> <schedule>30 2 * * *</schedule> diff --git a/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_invalid_without_name.xml b/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_invalid_without_name.xml index 749125f39bc7b243a5fb777be3ff204adf4668b9..49153bf49a97b6190c442acff922ef9da7bf8ece 100644 --- a/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_invalid_without_name.xml +++ b/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_invalid_without_name.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../app/code/Magento/Cron/etc/crontab.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd"> <group id="default"> <job instance="Model1" method="method1"> <schedule>30 2 * * *</schedule> diff --git a/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_valid.xml b/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_valid.xml index 4c77e535a8db9806e243cfcb6f4510954ac88bd2..082903e7b2e61647f5e44348ffe6f6ff34cbaac4 100644 --- a/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_valid.xml +++ b/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_valid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../app/code/Magento/Cron/etc/crontab.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd"> <group id="default"> <job name="job1" instance="Model1" method="method1"> <schedule>30 2 * * *</schedule> diff --git a/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_valid_without_schedule.xml b/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_valid_without_schedule.xml index 5076c0feb65e62aa91df9fe3f44f6c6567c7e51b..ff90e8269d388b384742bf9523cae212515b5a4a 100644 --- a/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_valid_without_schedule.xml +++ b/app/code/Magento/Cron/Test/Unit/Model/Config/_files/crontab_valid_without_schedule.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../app/code/Magento/Cron/etc/crontab.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd"> <group id="default"> <job name="job1" instance="Model1" method="method1"/> </group> diff --git a/app/code/Magento/Cron/composer.json b/app/code/Magento/Cron/composer.json index 653e1f8443cbba8f049eb397c299bde7ec9ac3f6..ee63854bcc4fd529bd3b04c5ef3836c47512b4d6 100644 --- a/app/code/Magento/Cron/composer.json +++ b/app/code/Magento/Cron/composer.json @@ -4,8 +4,7 @@ "require": { "php": "~5.5.0|~5.6.0|~7.0.0", "magento/module-store": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "suggest": { "magento/module-config": "1.0.0-beta" @@ -16,12 +15,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Cron" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Cron\\": "" + } } } diff --git a/app/code/Magento/Cron/etc/adminhtml/system.xml b/app/code/Magento/Cron/etc/adminhtml/system.xml index 994982713d89e05a701f216c9d952f6d06719e60..dd9131d8c1761bc1373a1578df6a07c015914cdf 100644 --- a/app/code/Magento/Cron/etc/adminhtml/system.xml +++ b/app/code/Magento/Cron/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="system"> <group id="cron" translate="label comment" type="text" sortOrder="15" showInDefault="1" showInWebsite="0" showInStore="0"> diff --git a/app/code/Magento/Cron/etc/cron_groups.xml b/app/code/Magento/Cron/etc/cron_groups.xml index 0067b22a8a3f18b2fc0c7b724ce0ad2d48e5271c..cc3db511c39cc1813213b585e4f133009d113973 100644 --- a/app/code/Magento/Cron/etc/cron_groups.xml +++ b/app/code/Magento/Cron/etc/cron_groups.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Cron/etc/cron_groups.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/cron_groups.xsd"> <group id="default"> <schedule_generate_every>15</schedule_generate_every> <schedule_ahead_for>20</schedule_ahead_for> diff --git a/app/code/Magento/Cron/etc/crontab/events.xml b/app/code/Magento/Cron/etc/crontab/events.xml index bc0cba873a0b829ca8f2b257f2b4a129a4680726..db50815fbe89d12210001b756a54edf837f19cfa 100644 --- a/app/code/Magento/Cron/etc/crontab/events.xml +++ b/app/code/Magento/Cron/etc/crontab/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="default"> <observer name="cron_observer" instance="Magento\Cron\Observer\ProcessCronQueueObserver" method="execute" /> </event> diff --git a/app/code/Magento/Cron/etc/di.xml b/app/code/Magento/Cron/etc/di.xml index 603c51b5c0c85eeb55151cb16a19d8c8c38704a5..ae600be3c5c8abea278989211f7bd68cb6741e41 100644 --- a/app/code/Magento/Cron/etc/di.xml +++ b/app/code/Magento/Cron/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Cron\Model\ConfigInterface" type="Magento\Cron\Model\Config" /> <preference for="Magento\Framework\Shell\CommandRendererInterface" type="Magento\Framework\Shell\CommandRenderer" /> <type name="Magento\Cron\Model\Config\Reader\Db"> diff --git a/app/code/Magento/Cron/etc/module.xml b/app/code/Magento/Cron/etc/module.xml index ff3babd7e198b42eb985644fc96b17961e7376ac..f98f1581079dd503f3dded207ce8b983dd543925 100644 --- a/app/code/Magento/Cron/etc/module.xml +++ b/app/code/Magento/Cron/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Cron" setup_version="2.0.0"> <sequence> <module name="Magento_Store"/> diff --git a/app/code/Magento/Cron/registration.php b/app/code/Magento/Cron/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..d1b83845fe0c4fd57e091dc95a7708774272241d --- /dev/null +++ b/app/code/Magento/Cron/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Cron', + __DIR__ +); diff --git a/app/code/Magento/CurrencySymbol/composer.json b/app/code/Magento/CurrencySymbol/composer.json index a087b919c807c2cf953afe6abafb0d963f2407c9..986794624718e50610908f49a8f08d66cd66ff97 100644 --- a/app/code/Magento/CurrencySymbol/composer.json +++ b/app/code/Magento/CurrencySymbol/composer.json @@ -8,8 +8,7 @@ "magento/module-page-cache": "1.0.0-beta", "magento/module-directory": "1.0.0-beta", "magento/module-backend": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -17,12 +16,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/CurrencySymbol" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\CurrencySymbol\\": "" + } } } diff --git a/app/code/Magento/CurrencySymbol/etc/acl.xml b/app/code/Magento/CurrencySymbol/etc/acl.xml index 98eba2a12defc2533466d809470eef8d2e5d38ab..4303892275523697ef591b6d628e1068b3f769aa 100644 --- a/app/code/Magento/CurrencySymbol/etc/acl.xml +++ b/app/code/Magento/CurrencySymbol/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/app/code/Magento/CurrencySymbol/etc/adminhtml/menu.xml b/app/code/Magento/CurrencySymbol/etc/adminhtml/menu.xml index 210df17a83de83643ffe8dff7fe8baf9ebae9c9b..1db0f3239f9597ebdf013d16886578af1c2f58c9 100644 --- a/app/code/Magento/CurrencySymbol/etc/adminhtml/menu.xml +++ b/app/code/Magento/CurrencySymbol/etc/adminhtml/menu.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Backend/etc/menu.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd"> <menu> <remove id="Magento_Backend::system_currency" /> <add id="Magento_CurrencySymbol::system_currency" title="Currency" module="Magento_CurrencySymbol" sortOrder="30" parent="Magento_Backend::stores" resource="Magento_CurrencySymbol::system_currency" /> diff --git a/app/code/Magento/CurrencySymbol/etc/adminhtml/routes.xml b/app/code/Magento/CurrencySymbol/etc/adminhtml/routes.xml index 225b8d6db2af53e75ed5fb188fe70dd80ce94d32..86130962318c4efccfe1986fb8be86f8d1eda6cd 100644 --- a/app/code/Magento/CurrencySymbol/etc/adminhtml/routes.xml +++ b/app/code/Magento/CurrencySymbol/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="admin"> <route id="adminhtml"> <module name="Magento_CurrencySymbol" /> diff --git a/app/code/Magento/CurrencySymbol/etc/di.xml b/app/code/Magento/CurrencySymbol/etc/di.xml index 997753e3f7d36b973fca0abe4e2694d86f617f19..2aaf78bb4bb03c815f544dc2ae5cb48474a1b0b9 100644 --- a/app/code/Magento/CurrencySymbol/etc/di.xml +++ b/app/code/Magento/CurrencySymbol/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Framework\Module\Setup\Migration"> <arguments> <argument name="compositeModules" xsi:type="array"> diff --git a/app/code/Magento/CurrencySymbol/etc/events.xml b/app/code/Magento/CurrencySymbol/etc/events.xml index 9ca0b8f6d75da3399e833d264e36dd384bd1ba34..57abb36aff585f552a2bccc9841a85ad312443e5 100644 --- a/app/code/Magento/CurrencySymbol/etc/events.xml +++ b/app/code/Magento/CurrencySymbol/etc/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="currency_display_options_forming"> <observer name="magento_currencysymbol_currency_display_options" instance="Magento\CurrencySymbol\Observer\CurrencyDisplayOptions" method="execute" /> </event> diff --git a/app/code/Magento/CurrencySymbol/etc/module.xml b/app/code/Magento/CurrencySymbol/etc/module.xml index 97cf5f60eefb333e86154d3dd5535e5b3484c5c7..b41a9d2e19bb7dae5fbbb8db610521233b5c6820 100644 --- a/app/code/Magento/CurrencySymbol/etc/module.xml +++ b/app/code/Magento/CurrencySymbol/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_CurrencySymbol" setup_version="2.0.0"> <sequence> <module name="Magento_Widget"/> diff --git a/app/code/Magento/CurrencySymbol/registration.php b/app/code/Magento/CurrencySymbol/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..09b8d2933a32cf053694c30459e3b9ee0f54a0c3 --- /dev/null +++ b/app/code/Magento/CurrencySymbol/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_CurrencySymbol', + __DIR__ +); diff --git a/app/code/Magento/CurrencySymbol/view/adminhtml/layout/adminhtml_system_currency_index.xml b/app/code/Magento/CurrencySymbol/view/adminhtml/layout/adminhtml_system_currency_index.xml index 950253bcdb1df18879f605699d4f8a0ef9295a9e..caf5be833b15bd3adb1bb1a18c08b6f8f8def18b 100644 --- a/app/code/Magento/CurrencySymbol/view/adminhtml/layout/adminhtml_system_currency_index.xml +++ b/app/code/Magento/CurrencySymbol/view/adminhtml/layout/adminhtml_system_currency_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="styles" /> <body/> </page> diff --git a/app/code/Magento/CurrencySymbol/view/adminhtml/layout/adminhtml_system_currencysymbol_index.xml b/app/code/Magento/CurrencySymbol/view/adminhtml/layout/adminhtml_system_currencysymbol_index.xml index 72d6afb67e40d6ffe835b957ac4ca7955bf0511a..4376bc5439935c1686986c9ccbbba05f92118a38 100644 --- a/app/code/Magento/CurrencySymbol/view/adminhtml/layout/adminhtml_system_currencysymbol_index.xml +++ b/app/code/Magento/CurrencySymbol/view/adminhtml/layout/adminhtml_system_currencysymbol_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="styles" /> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/Customer/Block/Address/Renderer/DefaultRenderer.php b/app/code/Magento/Customer/Block/Address/Renderer/DefaultRenderer.php index 20ac4dd71f066b6a14c4b6e59b9e65e21ae71b35..74084a8d602f0ad5e20ed008056b02112d8f2e6a 100644 --- a/app/code/Magento/Customer/Block/Address/Renderer/DefaultRenderer.php +++ b/app/code/Magento/Customer/Block/Address/Renderer/DefaultRenderer.php @@ -93,7 +93,7 @@ class DefaultRenderer extends AbstractBlock implements RendererInterface /** * @param AbstractAddress|null $address * @return string - * @deprecated All new code should use renderArray based on Metadata service + * All new code should use renderArray based on Metadata service */ public function getFormat(AbstractAddress $address = null) { diff --git a/app/code/Magento/Customer/Block/Address/Renderer/RendererInterface.php b/app/code/Magento/Customer/Block/Address/Renderer/RendererInterface.php index 9331838c59ba07ad0f7b5ae1b7486ddec1a67198..95fbfbf508b7a3bdeff85c1a873b216e82df087d 100644 --- a/app/code/Magento/Customer/Block/Address/Renderer/RendererInterface.php +++ b/app/code/Magento/Customer/Block/Address/Renderer/RendererInterface.php @@ -36,7 +36,7 @@ interface RendererInterface * @param AddressModelInterface $address * @param string|null $format * @return mixed - * @deprecated All new code should use renderArray based on Metadata service + * All new code should use renderArray based on Metadata service */ public function render(AddressModelInterface $address, $format = null); diff --git a/app/code/Magento/Customer/CustomerData/SchemaLocator.php b/app/code/Magento/Customer/CustomerData/SchemaLocator.php index 5460548ee9cec832bcb93551cedbe81de9c4baf2..2fb5f36348fa0fe501fde9517eb48b52fecacce0 100644 --- a/app/code/Magento/Customer/CustomerData/SchemaLocator.php +++ b/app/code/Magento/Customer/CustomerData/SchemaLocator.php @@ -5,6 +5,8 @@ */ namespace Magento\Customer\CustomerData; +use Magento\Framework\Module\Dir; + class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface { /** @@ -19,7 +21,7 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface */ public function __construct(\Magento\Framework\Module\Dir\Reader $moduleReader) { - $this->_schema = $moduleReader->getModuleDir('etc', 'Magento_Customer') . '/' . 'sections.xsd'; + $this->_schema = $moduleReader->getModuleDir(Dir::MODULE_ETC_DIR, 'Magento_Customer') . '/' . 'sections.xsd'; } /** diff --git a/app/code/Magento/Customer/Model/Address.php b/app/code/Magento/Customer/Model/Address.php index c80b2aba4be32c577b6bbe9c2efa3d9429e5a673..f5d0ff2f06e60f6c4d508aea339b8c13810a64b6 100644 --- a/app/code/Magento/Customer/Model/Address.php +++ b/app/code/Magento/Customer/Model/Address.php @@ -127,7 +127,7 @@ class Address extends \Magento\Customer\Model\Address\AbstractAddress * * @param AddressInterface $address * @return $this - * @deprecated Use Api/RepositoryInterface for the operations in the Data Interfaces. Don't rely on Address Model + * Use Api/RepositoryInterface for the operations in the Data Interfaces. Don't rely on Address Model */ public function updateData(AddressInterface $address) { diff --git a/app/code/Magento/Customer/Model/Address/AbstractAddress.php b/app/code/Magento/Customer/Model/Address/AbstractAddress.php index 527cbd7becea4f2aadae842be09d45bf1633c209..1cb5d95310fabe611868538812e4a2922714ec47 100644 --- a/app/code/Magento/Customer/Model/Address/AbstractAddress.php +++ b/app/code/Magento/Customer/Model/Address/AbstractAddress.php @@ -453,7 +453,6 @@ class AbstractAddress extends AbstractExtensibleModel implements AddressModelInt * * @param string $type * @return string|null - * @deprecated */ public function format($type) { @@ -490,7 +489,7 @@ class AbstractAddress extends AbstractExtensibleModel implements AddressModelInt * @param int|null $defaultBillingAddressId * @param int|null $defaultShippingAddressId * @return AddressInterface - * @deprecated Use Api/Data/AddressInterface as a result of service operations. Don't rely on the model to provide + * Use Api/Data/AddressInterface as a result of service operations. Don't rely on the model to provide * the instance of Api/Data/AddressInterface * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ diff --git a/app/code/Magento/Customer/Model/Address/Config/SchemaLocator.php b/app/code/Magento/Customer/Model/Address/Config/SchemaLocator.php index be4744d4b3417720261c78a1d306f8add1bf4e20..c5e3b510c628f06a45eb10fa1018745056d75520 100644 --- a/app/code/Magento/Customer/Model/Address/Config/SchemaLocator.php +++ b/app/code/Magento/Customer/Model/Address/Config/SchemaLocator.php @@ -7,6 +7,8 @@ */ namespace Magento\Customer\Model\Address\Config; +use Magento\Framework\Module\Dir; + class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface { /** @@ -21,7 +23,7 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface */ public function __construct(\Magento\Framework\Module\Dir\Reader $moduleReader) { - $this->_schema = $moduleReader->getModuleDir('etc', 'Magento_Customer') . '/address_formats.xsd'; + $this->_schema = $moduleReader->getModuleDir(Dir::MODULE_ETC_DIR, 'Magento_Customer') . '/address_formats.xsd'; } /** diff --git a/app/code/Magento/Customer/Model/Customer.php b/app/code/Magento/Customer/Model/Customer.php index dc8085e7e25fdbd767daac4b328d6c2d53419739..60d88415ffcf34e804dcd8015b348febd13b4398 100644 --- a/app/code/Magento/Customer/Model/Customer.php +++ b/app/code/Magento/Customer/Model/Customer.php @@ -369,7 +369,7 @@ class Customer extends \Magento\Framework\Model\AbstractModel * @param string $password * @return bool * @throws \Magento\Framework\Exception\LocalizedException - * @deprecated Use \Magento\Customer\Api\AccountManagementInterface::authenticate + * Use \Magento\Customer\Api\AccountManagementInterface::authenticate */ public function authenticate($login, $password) { @@ -768,7 +768,6 @@ class Customer extends \Magento\Framework\Model\AbstractModel * Check if accounts confirmation is required in config * * @return bool - * @deprecated */ public function isConfirmationRequired() { @@ -1278,7 +1277,6 @@ class Customer extends \Magento\Framework\Model\AbstractModel * Check if current reset password link token is expired * * @return boolean - * @deprecated */ public function isResetPasswordLinkTokenExpired() { diff --git a/app/code/Magento/Customer/Model/Session.php b/app/code/Magento/Customer/Model/Session.php index 9de29d06fa537298d7f70d80d7faf7ff699ab80c..72881c58d4890ac61abe7af93a298be9bcbff826 100644 --- a/app/code/Magento/Customer/Model/Session.php +++ b/app/code/Magento/Customer/Model/Session.php @@ -208,7 +208,6 @@ class Session extends \Magento\Framework\Session\SessionManager /** * Retrieve customer model object * - * @deprecated * @return CustomerData */ public function getCustomerData() @@ -249,7 +248,7 @@ class Session extends \Magento\Framework\Session\SessionManager * * @param Customer $customerModel * @return $this - * @deprecated use setCustomerId() instead + * use setCustomerId() instead */ public function setCustomer(Customer $customerModel) { @@ -277,7 +276,7 @@ class Session extends \Magento\Framework\Session\SessionManager * Retrieve customer model object * * @return Customer - * @deprecated use getCustomerId() instead + * use getCustomerId() instead */ public function getCustomer() { diff --git a/app/code/Magento/Customer/Test/Unit/CustomerData/_files/sections.xml b/app/code/Magento/Customer/Test/Unit/CustomerData/_files/sections.xml index 4296ea8ddad757c7d4c554c3f6126282d3a1f0d9..e7d2e3742c1ae9f59b330bad48d01401c49a758f 100644 --- a/app/code/Magento/Customer/Test/Unit/CustomerData/_files/sections.xml +++ b/app/code/Magento/Customer/Test/Unit/CustomerData/_files/sections.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../etc/sections.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd"> <action name="customer/account/logout"/> <action name="customer/account/editPost"> <section name="account"/> diff --git a/app/code/Magento/Customer/Test/Unit/Model/Address/Config/XsdTest.php b/app/code/Magento/Customer/Test/Unit/Model/Address/Config/XsdTest.php index 0cbf47484cc337f6c8a005aeb3626dd65283f7ad..a69261461775b839c858dd2a5e37e8d833611d1d 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/Address/Config/XsdTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/Address/Config/XsdTest.php @@ -16,7 +16,8 @@ class XsdTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_schemaFile = BP . '/app/code/Magento/Customer/etc/address_formats.xsd'; + $urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + $this->_schemaFile = $urnResolver->getRealPath('urn:magento:module:Magento_Customer:etc/address_formats.xsd'); } /** diff --git a/app/code/Magento/Customer/Test/Unit/Model/Address/Config/_files/formats_merged.xml b/app/code/Magento/Customer/Test/Unit/Model/Address/Config/_files/formats_merged.xml index 9cf3ef0325559a1f69cc1d81ff43dc6e36e3c863..200caddca13476bed0a31a158b411f6154f5e2af 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/Address/Config/_files/formats_merged.xml +++ b/app/code/Magento/Customer/Test/Unit/Model/Address/Config/_files/formats_merged.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/Customer/etc/address_formats.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/address_formats.xsd"> <format code="format_one" title="format_one_title" /> <format code="format_two" title="format_two_title" escapeHtml="true" /> </config> diff --git a/app/code/Magento/Customer/Test/Unit/Model/Address/Config/_files/formats_one.xml b/app/code/Magento/Customer/Test/Unit/Model/Address/Config/_files/formats_one.xml index 131820496f561e54a54aecfc790e20a85ca82c95..bdcf0d854cdf77d0169c6515d72ddac8e240ff8d 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/Address/Config/_files/formats_one.xml +++ b/app/code/Magento/Customer/Test/Unit/Model/Address/Config/_files/formats_one.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/Customer/etc/address_formats.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/address_formats.xsd"> <format code="format_one" title="format_one_title" /> <format code="format_two" title="format_two_title_before merge" /> </config> diff --git a/app/code/Magento/Customer/Test/Unit/Model/Address/Config/_files/formats_two.xml b/app/code/Magento/Customer/Test/Unit/Model/Address/Config/_files/formats_two.xml index b2ddc00ca166f7b73050c89c430b3c03da9a6607..30342e4ae77a74e2b9bd697d81a8a465a94fdbfc 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/Address/Config/_files/formats_two.xml +++ b/app/code/Magento/Customer/Test/Unit/Model/Address/Config/_files/formats_two.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/Customer/etc/address_formats.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/address_formats.xsd"> <format code="format_two" title="format_two_title" escapeHtml="true" /> </config> diff --git a/app/code/Magento/Customer/composer.json b/app/code/Magento/Customer/composer.json index 7f9afc76480980ac8874500b683b10cfa1cbb589..5bf95b1f878c100a33ffe0eec5e96cc3a87b146e 100644 --- a/app/code/Magento/Customer/composer.json +++ b/app/code/Magento/Customer/composer.json @@ -22,8 +22,7 @@ "magento/module-media-storage": "1.0.0-beta", "magento/module-ui": "1.0.0-beta", "magento/module-config": "1.0.0-beta", - "magento/module-quote": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/module-quote": "1.0.0-beta" }, "suggest": { "magento/module-cookie": "1.0.0-beta" @@ -34,12 +33,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Customer" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Customer\\": "" + } } } diff --git a/app/code/Magento/Customer/etc/acl.xml b/app/code/Magento/Customer/etc/acl.xml index f991f71dd7feb6c6b60ec91260b41ea3af170870..1980480ee0da24b0996a3a7e18f42cb20e75b62c 100644 --- a/app/code/Magento/Customer/etc/acl.xml +++ b/app/code/Magento/Customer/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/app/code/Magento/Customer/etc/address_formats.xml b/app/code/Magento/Customer/etc/address_formats.xml index baf4f346ba45632a81f62bd4786722a4683a74b4..d2ff37c77b07e996709cb05bf785568bbe9aee92 100644 --- a/app/code/Magento/Customer/etc/address_formats.xml +++ b/app/code/Magento/Customer/etc/address_formats.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Customer/etc/address_formats.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/address_formats.xsd"> <format code="text" title="Text" /> <format code="oneline" title="Text One Line" /> <format code="html" title="HTML" escapeHtml="true" /> diff --git a/app/code/Magento/Customer/etc/adminhtml/di.xml b/app/code/Magento/Customer/etc/adminhtml/di.xml index 28238183bd3c29bc1ed869048bafdd3ce4fc6aaf..ebde7213624e788b957d2eff2e8db16ee441002e 100644 --- a/app/code/Magento/Customer/etc/adminhtml/di.xml +++ b/app/code/Magento/Customer/etc/adminhtml/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Customer\Model\Customer" type="Magento\Customer\Model\Backend\Customer" /> <type name="Magento\Customer\Model\Resource\Customer\Collection"> <arguments> diff --git a/app/code/Magento/Customer/etc/adminhtml/menu.xml b/app/code/Magento/Customer/etc/adminhtml/menu.xml index 85e881d26aa2896bf4edfd4277bf531543883440..29a851643c581fe31d0d1b41b0521f292fd5d504 100644 --- a/app/code/Magento/Customer/etc/adminhtml/menu.xml +++ b/app/code/Magento/Customer/etc/adminhtml/menu.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Backend/etc/menu.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd"> <menu> <add id="Magento_Customer::customer" title="Customers" module="Magento_Customer" sortOrder="30" resource="Magento_Customer::customer"/> <add id="Magento_Customer::customer_manage" title="All Customers" module="Magento_Customer" sortOrder="10" parent="Magento_Customer::customer" action="customer/index/" resource="Magento_Customer::manage"/> diff --git a/app/code/Magento/Customer/etc/adminhtml/routes.xml b/app/code/Magento/Customer/etc/adminhtml/routes.xml index 73910b3d59b987c9b541f7a3dbfd17b1fb41ea75..7451a401c3b0ee4cd54b70acb9c9d51ccb41a7a1 100644 --- a/app/code/Magento/Customer/etc/adminhtml/routes.xml +++ b/app/code/Magento/Customer/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn: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/adminhtml/system.xml b/app/code/Magento/Customer/etc/adminhtml/system.xml index 1fbab886101e6c3b83ea98438f62d7642cc85433..8df8738db0cdbc60c9095723609f8c86d2bef15b 100644 --- a/app/code/Magento/Customer/etc/adminhtml/system.xml +++ b/app/code/Magento/Customer/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <tab id="customer" translate="label" sortOrder="300"> <label>Customers</label> diff --git a/app/code/Magento/Customer/etc/config.xml b/app/code/Magento/Customer/etc/config.xml index c730c1c61b12c1ec47be51488f6c150656ec7a9e..2be876f72a4df217835e511c82f392fa00260047 100644 --- a/app/code/Magento/Customer/etc/config.xml +++ b/app/code/Magento/Customer/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <customer> <account_share> diff --git a/app/code/Magento/Customer/etc/crontab.xml b/app/code/Magento/Customer/etc/crontab.xml index 26f1056f2d72444afdac1a44c715fcdb72a9b3c8..4a689d0569e191e2accc1f40cbd8bef84cd2da0c 100644 --- a/app/code/Magento/Customer/etc/crontab.xml +++ b/app/code/Magento/Customer/etc/crontab.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Cron/etc/crontab.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd"> <group id="default"> <job name="visitor_clean" instance="Magento\Customer\Model\Visitor" method="clean"> <schedule>0 0 * * *</schedule> diff --git a/app/code/Magento/Customer/etc/di.xml b/app/code/Magento/Customer/etc/di.xml index 9be4d0c89cd64f62a6a9791fb88f4bbcceba8d4e..30b47cdf9f9795b05dd243dc857269d416317200 100644 --- a/app/code/Magento/Customer/etc/di.xml +++ b/app/code/Magento/Customer/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Customer\Api\AddressRepositoryInterface" type="Magento\Customer\Model\Resource\AddressRepository" /> <preference for="Magento\Customer\Api\CustomerRepositoryInterface" diff --git a/app/code/Magento/Customer/etc/email_templates.xml b/app/code/Magento/Customer/etc/email_templates.xml index 0fea9f1988dae8be5744c9791231d1d73bf4b2fe..9f8a131df00b588717a839130457bde2fe6c2503 100644 --- a/app/code/Magento/Customer/etc/email_templates.xml +++ b/app/code/Magento/Customer/etc/email_templates.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Email/etc/email_templates.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Email:etc/email_templates.xsd"> <template id="customer_create_account_email_template" label="New Account" file="account_new.html" type="html" module="Magento_Customer" area="frontend"/> <template id="customer_create_account_email_no_password_template" label="New Account Without Password" file="account_new_no_password.html" type="html" module="Magento_Customer" area="frontend"/> <template id="customer_create_account_email_confirmation_template" label="New Account Confirmation Key" file="account_new_confirmation.html" type="html" module="Magento_Customer" area="frontend"/> diff --git a/app/code/Magento/Customer/etc/events.xml b/app/code/Magento/Customer/etc/events.xml index 7f95ead89bb5fb9005b1fd78b30fed8b97276900..c4e0f72765f836bef4422d59fd51f2fd73e13d0a 100644 --- a/app/code/Magento/Customer/etc/events.xml +++ b/app/code/Magento/Customer/etc/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="customer_address_save_before"> <observer name="customer_address_before_save_viv_observer" instance="Magento\Customer\Observer\BeforeAddressSaveObserver" method="execute" /> </event> diff --git a/app/code/Magento/Customer/etc/fieldset.xml b/app/code/Magento/Customer/etc/fieldset.xml index c2d875d7175062a167169b456fc69e444063d635..241e6347ba317d336bbbb174445af6175edf6539 100644 --- a/app/code/Magento/Customer/etc/fieldset.xml +++ b/app/code/Magento/Customer/etc/fieldset.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/DataObject/etc/fieldset.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:framework:DataObject/etc/fieldset.xsd"> <scope id="global"> <fieldset id="customer_account"> <field name="prefix"> diff --git a/app/code/Magento/Customer/etc/frontend/di.xml b/app/code/Magento/Customer/etc/frontend/di.xml index 0c3cab5aa7056f8fdc7270c89d372333653ee6dd..ad1f406500e98edf92f80ea8a3edd7a2a24f968f 100644 --- a/app/code/Magento/Customer/etc/frontend/di.xml +++ b/app/code/Magento/Customer/etc/frontend/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Framework\Url\SecurityInfo"> <arguments> <argument name="secureUrlList" xsi:type="array"> diff --git a/app/code/Magento/Customer/etc/frontend/events.xml b/app/code/Magento/Customer/etc/frontend/events.xml index 0be20dea284eb60faac73efd782e2334dd63c53b..d82220f964d756d3791d4bd3115e55e71e2f3443 100644 --- a/app/code/Magento/Customer/etc/frontend/events.xml +++ b/app/code/Magento/Customer/etc/frontend/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="controller_action_predispatch"> <observer name="customer_visitor" instance="Magento\Customer\Observer\Visitor\InitByRequestObserver" method="execute" /> </event> diff --git a/app/code/Magento/Customer/etc/frontend/page_types.xml b/app/code/Magento/Customer/etc/frontend/page_types.xml index e895bca1e8bd6ec9f833b43d0b15754d5b0e1495..d60c8023c413131a71b3162aeab31650a286749a 100644 --- a/app/code/Magento/Customer/etc/frontend/page_types.xml +++ b/app/code/Magento/Customer/etc/frontend/page_types.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page_types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_types.xsd"> +<page_types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_types.xsd"> <type id="customer_account_confirmation" label="Customer Account Confirmation"/> <type id="customer_account_create" label="Customer Account Registration Form"/> <type id="customer_account_createpassword" label="Reset a Password"/> diff --git a/app/code/Magento/Customer/etc/frontend/routes.xml b/app/code/Magento/Customer/etc/frontend/routes.xml index d65ccaed3e6ef91814c06a3b6e9e38414fc3a908..70d25b693f987ab45fcfe58999a953acf488e083 100644 --- a/app/code/Magento/Customer/etc/frontend/routes.xml +++ b/app/code/Magento/Customer/etc/frontend/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn: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/frontend/sections.xml b/app/code/Magento/Customer/etc/frontend/sections.xml index 9fe9ab9fb6ad5f9fb513c394f769ddc4db4024b4..f10f811db93c8350a0ccd52b532c992e3c9b3640 100644 --- a/app/code/Magento/Customer/etc/frontend/sections.xml +++ b/app/code/Magento/Customer/etc/frontend/sections.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../Magento/Customer/etc/sections.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd"> <action name="customer/account/logout"/> <action name="customer/account/loginPost"/> <action name="customer/account/createPost"/> diff --git a/app/code/Magento/Customer/etc/indexer.xml b/app/code/Magento/Customer/etc/indexer.xml index d7aa80a12f7b5198037aa85c2e57df7be3a79542..3843c29d8e86d4b8d743378ce18702cd7ae3dfb0 100644 --- a/app/code/Magento/Customer/etc/indexer.xml +++ b/app/code/Magento/Customer/etc/indexer.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Indexer/etc/indexer.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:framework:Indexer/etc/indexer.xsd"> <indexer id="customer_grid" view_id="dummy" class="Magento\Framework\Indexer\Action\Entity" primary="customer"> <title translate="true">Customer Grid</title> <description translate="true">Rebuild Customer grid index</description> diff --git a/app/code/Magento/Customer/etc/module.xml b/app/code/Magento/Customer/etc/module.xml index a41e8a12c45094a46b97c28b720b05e4d2e5d9e5..a2b9b1eacfe848a8c9f392d5c2cdf09da8062161 100644 --- a/app/code/Magento/Customer/etc/module.xml +++ b/app/code/Magento/Customer/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Customer" setup_version="2.0.5"> <sequence> <module name="Magento_Eav"/> diff --git a/app/code/Magento/Customer/etc/mview.xml b/app/code/Magento/Customer/etc/mview.xml index bdb6d2b667fb63dfa5fb39c9900a5e556ba10f38..d9a4568adfbdee1152712b5b623b6d6aee574c9c 100644 --- a/app/code/Magento/Customer/etc/mview.xml +++ b/app/code/Magento/Customer/etc/mview.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Mview/etc/mview.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Mview/etc/mview.xsd"> <view id="dummy" class="Magento\Customer\Model\Indexer\Mview\Dummy" group="indexer"/> </config> diff --git a/app/code/Magento/Customer/etc/validation.xml b/app/code/Magento/Customer/etc/validation.xml index ae5d5314c66a9fdea7d8c2906b8c6d4da9f16117..ad38c4691b6cb5202fda43143347f00224a6e734 100644 --- a/app/code/Magento/Customer/etc/validation.xml +++ b/app/code/Magento/Customer/etc/validation.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<validation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Validator/etc/validation.xsd"> +<validation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Validator/etc/validation.xsd"> <entity name="customer"> <rules> <rule name="check_eav"> diff --git a/app/code/Magento/Customer/etc/webapi.xml b/app/code/Magento/Customer/etc/webapi.xml index f86073a571c151ee3b05a7e9489a8dde8b96436c..41872e39d2369dd376f472565106545987721292 100644 --- a/app/code/Magento/Customer/etc/webapi.xml +++ b/app/code/Magento/Customer/etc/webapi.xml @@ -6,7 +6,7 @@ */ --> <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../app/code/Magento/Webapi/etc/webapi.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd"> <!-- Customer Group --> <route url="/V1/customerGroups/:id" method="GET"> <service class="Magento\Customer\Api\GroupRepositoryInterface" method="getById"/> diff --git a/app/code/Magento/Customer/etc/webapi_rest/di.xml b/app/code/Magento/Customer/etc/webapi_rest/di.xml index a5a37d5a682719b84913d9dba7c3591801a61807..bcf52d0ff3925093084b6465cf67e82e61133736 100644 --- a/app/code/Magento/Customer/etc/webapi_rest/di.xml +++ b/app/code/Magento/Customer/etc/webapi_rest/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Framework\Authorization"> <plugin name="customerAuthorization" type="Magento\Customer\Model\Plugin\CustomerAuthorization" /> </type> diff --git a/app/code/Magento/Customer/etc/webapi_soap/di.xml b/app/code/Magento/Customer/etc/webapi_soap/di.xml index 150ccaa32fba2a98b3bd80dbed97321b1c0a32eb..f37cb1c2415560634b6013804fa6da4ab7d9df6e 100644 --- a/app/code/Magento/Customer/etc/webapi_soap/di.xml +++ b/app/code/Magento/Customer/etc/webapi_soap/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Framework\Authorization"> <plugin name="customerAuthorization" type="Magento\Customer\Model\Plugin\CustomerAuthorization" /> </type> diff --git a/app/code/Magento/Customer/registration.php b/app/code/Magento/Customer/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..88ff7b8bc1d7182b616dd956ee820316aeb666c3 --- /dev/null +++ b/app/code/Magento/Customer/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Customer', + __DIR__ +); 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 a1046cac958f4cb5fee948c2cf96d1a54e72ce8e..b7181bbe45e4e49bac475872c560dd964173d66a 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 @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Customer\Block\Adminhtml\Group" name="adminhtml.block.customer.group.grid.container"> diff --git a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_cart.xml b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_cart.xml index f84d48941d787658564dc33be05576e740a5b99e..ea3ce5607d5dc0ea0082e52ddb426e2d82b09d26 100644 --- a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_cart.xml +++ b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_cart.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root" label="Root"> <block class="Magento\Customer\Block\Adminhtml\Edit\Tab\Cart" name="admin.customer.view.edit.cart"/> </container> diff --git a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_carts.xml b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_carts.xml index 74683d0c7cd0ff68aa7a8803510869842eb4193d..61d90f55af503c2581fd53fdf9d82bb23e5020a3 100644 --- a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_carts.xml +++ b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_carts.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root" label="Root"> <block class="Magento\Customer\Block\Adminhtml\Edit\Tab\Carts" name="admin.customer.carts"/> </container> diff --git a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_edit.xml b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_edit.xml index 4d3ff76ccb80b348cf0a9bee817580682f7dd61b..df07e62835ea7430c51e704e0746008c61c6c7ea 100644 --- a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_edit.xml +++ b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_edit.xml @@ -6,7 +6,7 @@ */ --> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" - xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="admin.scope.col.wrap" htmlClass="admin__old" /> <!-- ToDo UI: remove this wrapper with old styles removal. The class name "admin__old" is for tests only, we shouldn't use it in any way --> <referenceContainer name="content"> diff --git a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_index.xml b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_index.xml index b45c461ad53a8e9c886e463861d6b4217a0ea8a1..5b319f803cb80a9e25fff7f69444784c4b0ea7f0 100644 --- a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_index.xml +++ b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="formkey"/> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_newsletter.xml b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_newsletter.xml index b89b0e9b09617f3b359db4cad19b805a61b11b0c..947426c27eb4b58947095c81fec55e25f02fefc5 100644 --- a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_newsletter.xml +++ b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_newsletter.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root" label="Root"> <block class="Magento\Customer\Block\Adminhtml\Edit\Tab\Newsletter\Grid" name="admin.customer.newsletter.grid"/> </container> diff --git a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_orders.xml b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_orders.xml index 82d3ed6adf0a13d716ef3dabbe8f2c76918210e0..ba17937f063b6930174c5e2ade1656e6ea3128ff 100644 --- a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_orders.xml +++ b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_orders.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root" label="Root"> <block class="Magento\Customer\Block\Adminhtml\Edit\Tab\Orders" name="adminhtml.customer.edit.tab.orders"/> </container> diff --git a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_productreviews.xml b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_productreviews.xml index a3fed32fb808854c5eee0004c9aa787376da3307..827f06aa27b2970df696c28bc1b59d72d616ff20 100644 --- a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_productreviews.xml +++ b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_productreviews.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root" label="Root"> <block class="Magento\Customer\Block\Adminhtml\Edit\Tab\Reviews" name="admin.customer.reviews"/> </container> diff --git a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_viewcart.xml b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_viewcart.xml index 15779ee132ac2dcac5bea9949985d47cf521b1e2..e2652257297f20cd3278d70345464d0891badfae 100644 --- a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_viewcart.xml +++ b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_viewcart.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root" label="Root"> <block class="Magento\Customer\Block\Adminhtml\Edit\Tab\View\Cart" name="admin.customer.view.cart"/> </container> diff --git a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_viewwishlist.xml b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_viewwishlist.xml index 2493a3aba7677b2c9e0d138caad7b75584de10bf..62e7dc4dc981e9d197dd69554bff799313ffbc82 100644 --- a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_viewwishlist.xml +++ b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_viewwishlist.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root" label="Root"> <block class="Magento\Customer\Block\Adminhtml\Edit\Tab\View\Wishlist" name="admin.customer.view.wishlist"/> </container> diff --git a/app/code/Magento/Customer/view/adminhtml/layout/customer_online_index.xml b/app/code/Magento/Customer/view/adminhtml/layout/customer_online_index.xml index c4841884aa0cdc0fe3d33c1f607dbe68c8c4626e..4af503eae5e64003bc8ba09bee61f990d6f423f1 100644 --- a/app/code/Magento/Customer/view/adminhtml/layout/customer_online_index.xml +++ b/app/code/Magento/Customer/view/adminhtml/layout/customer_online_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="styles"/> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/Customer/view/adminhtml/ui_component/customer_listing.xml b/app/code/Magento/Customer/view/adminhtml/ui_component/customer_listing.xml index bb0a4f029a1d97cbe485130341c0efeb36c34073..fe0584651a288a31ae6c7b2d911c95c08210d8b9 100644 --- a/app/code/Magento/Customer/view/adminhtml/ui_component/customer_listing.xml +++ b/app/code/Magento/Customer/view/adminhtml/ui_component/customer_listing.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Ui/etc/ui_configuration.xsd"> +<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Ui/etc/ui_configuration.xsd"> <argument name="data" xsi:type="array"> <item name="js_config" xsi:type="array"> <item name="provider" xsi:type="string">customer_listing.customer_listing_data_source</item> diff --git a/app/code/Magento/Customer/view/adminhtml/ui_component/customer_online_grid.xml b/app/code/Magento/Customer/view/adminhtml/ui_component/customer_online_grid.xml index b144ac27d89bb6a514f786631375d9765ab0432d..4c7b5ed565fb1c03faebb1afcdde2f34b2a8c49c 100644 --- a/app/code/Magento/Customer/view/adminhtml/ui_component/customer_online_grid.xml +++ b/app/code/Magento/Customer/view/adminhtml/ui_component/customer_online_grid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Ui/etc/ui_configuration.xsd"> +<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Ui/etc/ui_configuration.xsd"> <argument name="data" xsi:type="array"> <item name="js_config" xsi:type="array"> <item name="provider" xsi:type="string">customer_online_grid.customer_online_grid_data_source</item> diff --git a/app/code/Magento/Customer/view/base/ui_component/customer_form.xml b/app/code/Magento/Customer/view/base/ui_component/customer_form.xml index 4a4305c82fd4d92fd4671cca1e7149c1fa680fdf..b7646d9b11f48af4e8f40c5154be6897150f9877 100644 --- a/app/code/Magento/Customer/view/base/ui_component/customer_form.xml +++ b/app/code/Magento/Customer/view/base/ui_component/customer_form.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Ui/etc/ui_configuration.xsd"> +<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Ui/etc/ui_configuration.xsd"> <argument name="data" xsi:type="array"> <item name="js_config" xsi:type="array"> <item name="provider" xsi:type="string">customer_form.customer_form_data_source</item> diff --git a/app/code/Magento/Customer/view/frontend/layout/customer_account.xml b/app/code/Magento/Customer/view/frontend/layout/customer_account.xml index 98d5b2e886b3273e2c5792d2b467444336713120..2081d30dc39852ac26dbf981dcd5a04efec41241 100644 --- a/app/code/Magento/Customer/view/frontend/layout/customer_account.xml +++ b/app/code/Magento/Customer/view/frontend/layout/customer_account.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd" label="Customer My Account (All Pages)" design_abstraction="custom"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="Customer My Account (All Pages)" design_abstraction="custom"> <body> <attribute name="class" value="account"/> <referenceContainer name="sidebar.main"> diff --git a/app/code/Magento/Customer/view/frontend/layout/customer_account_confirmation.xml b/app/code/Magento/Customer/view/frontend/layout/customer_account_confirmation.xml index 6300b313e43023907bb372359734f6fa7833f508..78508f8783cacba94aa2c63b06af2a6655ef28d7 100644 --- a/app/code/Magento/Customer/view/frontend/layout/customer_account_confirmation.xml +++ b/app/code/Magento/Customer/view/frontend/layout/customer_account_confirmation.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <title>Send confirmation link</title> </head> diff --git a/app/code/Magento/Customer/view/frontend/layout/customer_account_create.xml b/app/code/Magento/Customer/view/frontend/layout/customer_account_create.xml index c931d10ffacfca9771214fa8b2186555d5e516de..3b20f44aa7ba163df4a6ccb5b11a7ce3cd4f6117 100644 --- a/app/code/Magento/Customer/view/frontend/layout/customer_account_create.xml +++ b/app/code/Magento/Customer/view/frontend/layout/customer_account_create.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="head.components"> <block class="Magento\Framework\View\Element\Js\Components" name="customer_account_create_head_components" template="Magento_Customer::js/components.phtml"/> diff --git a/app/code/Magento/Customer/view/frontend/layout/customer_account_createpassword.xml b/app/code/Magento/Customer/view/frontend/layout/customer_account_createpassword.xml index 643e9b7fd9c86d1b3cbf3d9b30472735ccae8aa1..459754277786a8f8d809114d694559d1f72cc3ab 100644 --- a/app/code/Magento/Customer/view/frontend/layout/customer_account_createpassword.xml +++ b/app/code/Magento/Customer/view/frontend/layout/customer_account_createpassword.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <title>Set a New Password</title> </head> diff --git a/app/code/Magento/Customer/view/frontend/layout/customer_account_edit.xml b/app/code/Magento/Customer/view/frontend/layout/customer_account_edit.xml index f274295f11edd14b4524839e13a23b28ed7d81da..d1fc8cf0499c1e40201e7eec2e875d8fbdf3f62e 100644 --- a/app/code/Magento/Customer/view/frontend/layout/customer_account_edit.xml +++ b/app/code/Magento/Customer/view/frontend/layout/customer_account_edit.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="customer_account"/> <body> <referenceBlock name="head.components"> diff --git a/app/code/Magento/Customer/view/frontend/layout/customer_account_forgotpassword.xml b/app/code/Magento/Customer/view/frontend/layout/customer_account_forgotpassword.xml index 7bd2fe2e0c33f72197ceabd34085d85f5832f06d..8e41302cdd0457cb98922af41b3ea70ee1a66d4f 100644 --- a/app/code/Magento/Customer/view/frontend/layout/customer_account_forgotpassword.xml +++ b/app/code/Magento/Customer/view/frontend/layout/customer_account_forgotpassword.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <title>Forgot Your Password</title> </head> diff --git a/app/code/Magento/Customer/view/frontend/layout/customer_account_index.xml b/app/code/Magento/Customer/view/frontend/layout/customer_account_index.xml index 0af5249207b66c816013b619828c474c22449484..1bbafb510000d56b335278c6ac60b2845756dab2 100644 --- a/app/code/Magento/Customer/view/frontend/layout/customer_account_index.xml +++ b/app/code/Magento/Customer/view/frontend/layout/customer_account_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="customer_account"/> <body> <referenceBlock name="page.main.title"> diff --git a/app/code/Magento/Customer/view/frontend/layout/customer_account_login.xml b/app/code/Magento/Customer/view/frontend/layout/customer_account_login.xml index 6dafbfb6cecb2b19cc5f787050abb2065a05d163..ba57b754b4f1c16f9f01ccd5141d0e3d0f7e4fb8 100644 --- a/app/code/Magento/Customer/view/frontend/layout/customer_account_login.xml +++ b/app/code/Magento/Customer/view/frontend/layout/customer_account_login.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <!-- customer.form.login.extra --> diff --git a/app/code/Magento/Customer/view/frontend/layout/customer_account_logoutsuccess.xml b/app/code/Magento/Customer/view/frontend/layout/customer_account_logoutsuccess.xml index adebacc5bacce04aada49bef761031890956b214..9a5dc588380889d8211efb8ff6ebd3e0e759898e 100644 --- a/app/code/Magento/Customer/view/frontend/layout/customer_account_logoutsuccess.xml +++ b/app/code/Magento/Customer/view/frontend/layout/customer_account_logoutsuccess.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="page.main.title"> <action method="setPageTitle"> diff --git a/app/code/Magento/Customer/view/frontend/layout/customer_address_form.xml b/app/code/Magento/Customer/view/frontend/layout/customer_address_form.xml index 19c86d696000b111aa29d081a25fe9b4a6394f18..92c2865f44b950a7d9ae178154a2c68f8654168a 100644 --- a/app/code/Magento/Customer/view/frontend/layout/customer_address_form.xml +++ b/app/code/Magento/Customer/view/frontend/layout/customer_address_form.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="customer_account"/> <body> <referenceBlock name="head.components"> 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 da1196e1ddd24e3d65c4197bfe89edfcb3ec3521..42a0fccc0260e8ec0143987af6e396177b927abe 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 @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="customer_account"/> <body> <referenceBlock name="head.components"> diff --git a/app/code/Magento/Customer/view/frontend/layout/default.xml b/app/code/Magento/Customer/view/frontend/layout/default.xml index 3619b30faeea4bab0f548242e4485b5504a6ffba..ffc589dff636e27508f6d28e553b84ac9e88428f 100644 --- a/app/code/Magento/Customer/view/frontend/layout/default.xml +++ b/app/code/Magento/Customer/view/frontend/layout/default.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="top.links"> <block class="Magento\Customer\Block\Account\Link" name="my-account-link"> diff --git a/app/code/Magento/CustomerImportExport/composer.json b/app/code/Magento/CustomerImportExport/composer.json index 3670d769d010492b57ecf104babe9dfb50089504..0f9f8114cb199860ff943f9f106505a209e3eb17 100644 --- a/app/code/Magento/CustomerImportExport/composer.json +++ b/app/code/Magento/CustomerImportExport/composer.json @@ -9,8 +9,7 @@ "magento/module-eav": "1.0.0-beta", "magento/module-import-export": "1.0.0-beta", "magento/module-directory": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -18,12 +17,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/CustomerImportExport" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\CustomerImportExport\\": "" + } } } diff --git a/app/code/Magento/CustomerImportExport/etc/adminhtml/routes.xml b/app/code/Magento/CustomerImportExport/etc/adminhtml/routes.xml index 1f9c448d88ba38809b73856a1fc447514a6c13dc..87f04a86edfcc9d793a95cb17229d7f086c57c4c 100644 --- a/app/code/Magento/CustomerImportExport/etc/adminhtml/routes.xml +++ b/app/code/Magento/CustomerImportExport/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="admin"> <route id="customer_import_export" frontName="customer_import_export"> <module name="Magento_CustomerImportExport" /> diff --git a/app/code/Magento/CustomerImportExport/etc/config.xml b/app/code/Magento/CustomerImportExport/etc/config.xml index 000eef6ea21c83cdda49761e7cc61d40484fa993..0c3921e8ddc947cb18983abdc9b004508cbd40d2 100644 --- a/app/code/Magento/CustomerImportExport/etc/config.xml +++ b/app/code/Magento/CustomerImportExport/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <export> <customer_page_size> diff --git a/app/code/Magento/CustomerImportExport/etc/export.xml b/app/code/Magento/CustomerImportExport/etc/export.xml index 81365f80749f6faddf7a7b0b0f0f94533e2dea9f..7243e25a38d97aafdaf9c37445e8a147af229f1e 100644 --- a/app/code/Magento/CustomerImportExport/etc/export.xml +++ b/app/code/Magento/CustomerImportExport/etc/export.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../ImportExport/etc/export.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_ImportExport:etc/export.xsd"> <entity name="customer" label="Customers Main File" model="Magento\CustomerImportExport\Model\Export\Customer" entityAttributeFilterType="customer"/> <entity name="customer_address" label="Customer Addresses" model="Magento\CustomerImportExport\Model\Export\Address" entityAttributeFilterType="customer" /> <fileFormat name="csv" label="CSV" model="Magento\ImportExport\Model\Export\Adapter\Csv" /> diff --git a/app/code/Magento/CustomerImportExport/etc/import.xml b/app/code/Magento/CustomerImportExport/etc/import.xml index ccda471d84dd98a302545a388c526fb98cb2fce4..8a0fa98d2b2053c664fb771ebbf04fdefc53341a 100644 --- a/app/code/Magento/CustomerImportExport/etc/import.xml +++ b/app/code/Magento/CustomerImportExport/etc/import.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../ImportExport/etc/import.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_ImportExport:etc/import.xsd"> <entity name="customer_composite" label="Customers" model="Magento\CustomerImportExport\Model\Import\CustomerComposite" behaviorModel="Magento\ImportExport\Model\Source\Import\Behavior\Basic" /> <entity name="customer" label="Customers Main File" model="Magento\CustomerImportExport\Model\Import\Customer" behaviorModel="Magento\ImportExport\Model\Source\Import\Behavior\Custom" /> <entity name="customer_address" label="Customer Addresses" model="Magento\CustomerImportExport\Model\Import\Address" behaviorModel="Magento\ImportExport\Model\Source\Import\Behavior\Custom" /> diff --git a/app/code/Magento/CustomerImportExport/etc/module.xml b/app/code/Magento/CustomerImportExport/etc/module.xml index c4fc8e8a709e714962d726800e9308f8853a8961..0ce49e937c2f37d50fa11a21b7e4c5175af51884 100644 --- a/app/code/Magento/CustomerImportExport/etc/module.xml +++ b/app/code/Magento/CustomerImportExport/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_CustomerImportExport" setup_version="2.0.0"> </module> </config> diff --git a/app/code/Magento/CustomerImportExport/registration.php b/app/code/Magento/CustomerImportExport/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..6e2ee2f2f0ca4e2f268a4ee815826746ead92d57 --- /dev/null +++ b/app/code/Magento/CustomerImportExport/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_CustomerImportExport', + __DIR__ +); diff --git a/app/code/Magento/CustomerImportExport/view/adminhtml/layout/customer_import_export_index_exportcsv.xml b/app/code/Magento/CustomerImportExport/view/adminhtml/layout/customer_import_export_index_exportcsv.xml index 47a0f643098e6a0052fc62fc55eff8d3284983a2..bb8311205c3f41c8d33731c12aea01919d370732 100644 --- a/app/code/Magento/CustomerImportExport/view/adminhtml/layout/customer_import_export_index_exportcsv.xml +++ b/app/code/Magento/CustomerImportExport/view/adminhtml/layout/customer_import_export_index_exportcsv.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="customer_index_grid_block"/> <body> <block class="Magento\Backend\Block\Widget\Grid\Container" name="admin.block.customer.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> diff --git a/app/code/Magento/CustomerImportExport/view/adminhtml/layout/customer_import_export_index_exportxml.xml b/app/code/Magento/CustomerImportExport/view/adminhtml/layout/customer_import_export_index_exportxml.xml index 47a0f643098e6a0052fc62fc55eff8d3284983a2..bb8311205c3f41c8d33731c12aea01919d370732 100644 --- a/app/code/Magento/CustomerImportExport/view/adminhtml/layout/customer_import_export_index_exportxml.xml +++ b/app/code/Magento/CustomerImportExport/view/adminhtml/layout/customer_import_export_index_exportxml.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="customer_index_grid_block"/> <body> <block class="Magento\Backend\Block\Widget\Grid\Container" name="admin.block.customer.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> diff --git a/app/code/Magento/CustomerImportExport/view/adminhtml/layout/customer_index_grid_block.xml b/app/code/Magento/CustomerImportExport/view/adminhtml/layout/customer_index_grid_block.xml index 0b63a3cbb5def4035c2a1e2445f9b8e487d29f47..7265a2b02c99bf6256415c6765b2a995062dbd10 100644 --- a/app/code/Magento/CustomerImportExport/view/adminhtml/layout/customer_index_grid_block.xml +++ b/app/code/Magento/CustomerImportExport/view/adminhtml/layout/customer_index_grid_block.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="admin.block.customer.grid"> <block class="Magento\Backend\Block\Widget\Grid\Export" name="admin.block.customer.grid.export" as="grid.export"> diff --git a/app/code/Magento/Deploy/Console/Command/DeployStaticContentCommand.php b/app/code/Magento/Deploy/Console/Command/DeployStaticContentCommand.php index 6f44447da750d403eb28b67da5306ac1c707ec83..7c8292e564e38b01e7f5b030793db07c3321e8e1 100644 --- a/app/code/Magento/Deploy/Console/Command/DeployStaticContentCommand.php +++ b/app/code/Magento/Deploy/Console/Command/DeployStaticContentCommand.php @@ -111,10 +111,7 @@ class DeployStaticContentCommand extends Command try { // run the deployment logic - $filesUtil = $this->objectManager->create( - '\Magento\Framework\App\Utility\Files', - ['pathToSource' => BP] - ); + $filesUtil = $this->objectManager->create('\Magento\Framework\App\Utility\Files'); $deployer = $this->objectManager->create( 'Magento\Deploy\Model\Deployer', diff --git a/app/code/Magento/Deploy/composer.json b/app/code/Magento/Deploy/composer.json index 6ded1cb12ca10ab5f7cdff3d46120d7db94a2e0a..48b8e7f4ae081385d4623224c53b8fdfeb971a7e 100644 --- a/app/code/Magento/Deploy/composer.json +++ b/app/code/Magento/Deploy/composer.json @@ -7,8 +7,7 @@ "magento/module-developer": "1.0.0-beta", "magento/module-store": "1.0.0-beta", "magento/module-theme": "1.0.0-beta", - "magento/module-require-js": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/module-require-js": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -16,12 +15,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Deploy" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Deploy\\": "" + } } } diff --git a/app/code/Magento/Deploy/etc/di.xml b/app/code/Magento/Deploy/etc/di.xml index a93d924535371335c4ccd8b47712702affcfadc8..9d0ed7220c62a84f0dec3c4baab07c7c49e11131 100644 --- a/app/code/Magento/Deploy/etc/di.xml +++ b/app/code/Magento/Deploy/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Framework\Console\CommandList"> <arguments> <argument name="commands" xsi:type="array"> diff --git a/app/code/Magento/Deploy/etc/module.xml b/app/code/Magento/Deploy/etc/module.xml index c44117227dcd38407267a045ad44299a1da1a171..634622141f4b2cddc576d2378ec5619f8652bb69 100644 --- a/app/code/Magento/Deploy/etc/module.xml +++ b/app/code/Magento/Deploy/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Deploy" setup_version="2.0.0"> <sequence> <module name="Magento_Store"/> diff --git a/app/code/Magento/Deploy/registration.php b/app/code/Magento/Deploy/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..e9dcb9c291941a493c080ee7fd4dd6ad1d7d5add --- /dev/null +++ b/app/code/Magento/Deploy/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Deploy', + __DIR__ +); diff --git a/app/code/Magento/Developer/composer.json b/app/code/Magento/Developer/composer.json index 04940a1a58bb0b790c8e95cbab5fa9fb39cd6846..9f7441a999b20dfb6056fb51fd05c0b269cffc7f 100644 --- a/app/code/Magento/Developer/composer.json +++ b/app/code/Magento/Developer/composer.json @@ -4,8 +4,7 @@ "require": { "php": "~5.5.0|~5.6.0|~7.0.0", "magento/module-store": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -13,12 +12,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Developer" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Developer\\": "" + } } } diff --git a/app/code/Magento/Developer/etc/adminhtml/di.xml b/app/code/Magento/Developer/etc/adminhtml/di.xml index ff22a95f0e92c698ff6d80185c0f5e505fca1e32..01252f2ad0c6381e8578012e2f1975ec7656b6dd 100644 --- a/app/code/Magento/Developer/etc/adminhtml/di.xml +++ b/app/code/Magento/Developer/etc/adminhtml/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Framework\View\TemplateEngineFactory"> <plugin name="debug_hints" type="Magento\Developer\Model\TemplateEngine\Plugin\DebugHints" sortOrder="10"/> </type> diff --git a/app/code/Magento/Developer/etc/adminhtml/system.xml b/app/code/Magento/Developer/etc/adminhtml/system.xml index 13ec5c3a13106fc5820440bb0b7754e6404a5074..1142915ee8e61c65d81a154da0a2cee932fa568b 100644 --- a/app/code/Magento/Developer/etc/adminhtml/system.xml +++ b/app/code/Magento/Developer/etc/adminhtml/system.xml @@ -4,7 +4,7 @@ * Copyright © 2015 Magento. All rights reserved. * See COPYING.txt for license details. */--> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="dev" translate="label"> <group id="front_end_development_workflow" translate="label" type="text" sortOrder="8" showInDefault="1" showInWebsite="1" showInStore="1"> diff --git a/app/code/Magento/Developer/etc/config.xml b/app/code/Magento/Developer/etc/config.xml index 21e898035fb4b6c828aac28a65584eb13af0acd8..56dbd999cb4edc9f8d2bf7e734fc0fbea3af4482 100644 --- a/app/code/Magento/Developer/etc/config.xml +++ b/app/code/Magento/Developer/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <dev> <restrict> diff --git a/app/code/Magento/Developer/etc/di.xml b/app/code/Magento/Developer/etc/di.xml index 436385046bc060fdce294221979dae5a5f6383a4..c43c9e06ca2cfe9e1eee412b80729f12d1079df7 100644 --- a/app/code/Magento/Developer/etc/di.xml +++ b/app/code/Magento/Developer/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Framework\View\Asset\PreProcessor\ChainFactoryInterface" type="Magento\Developer\Model\View\Asset\PreProcessor\DeveloperChainFactory"/> <preference for="Magento\Framework\Css\PreProcessor\ErrorHandlerInterface" type="Magento\Framework\Css\PreProcessor\ErrorHandler" /> <preference for="Magento\Framework\Css\PreProcessor\AdapterInterface" type="Magento\Framework\Css\PreProcessor\Adapter\Less\Oyejorge" /> diff --git a/app/code/Magento/Developer/etc/frontend/di.xml b/app/code/Magento/Developer/etc/frontend/di.xml index 3fd5f545b9d04f1f9c68f9b2b969984c9ffaefba..9fff6047046fd3bf3ee88f9176c38eaadeac5525 100644 --- a/app/code/Magento/Developer/etc/frontend/di.xml +++ b/app/code/Magento/Developer/etc/frontend/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Framework\View\TemplateEngineFactory"> <plugin name="debug_hints" type="Magento\Developer\Model\TemplateEngine\Plugin\DebugHints" sortOrder="10"/> </type> diff --git a/app/code/Magento/Developer/etc/module.xml b/app/code/Magento/Developer/etc/module.xml index 2bc215c15c7cf5924f8b3258b65825f9145e9653..6ca6601c1a084da08e3b598e0bda1d06bf2739ef 100644 --- a/app/code/Magento/Developer/etc/module.xml +++ b/app/code/Magento/Developer/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Developer" setup_version="2.0.0"> </module> </config> diff --git a/app/code/Magento/Developer/registration.php b/app/code/Magento/Developer/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..e1b00f9be04b680a13271718937b2b4ecbff629a --- /dev/null +++ b/app/code/Magento/Developer/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Developer', + __DIR__ +); diff --git a/app/code/Magento/Dhl/Model/Carrier.php b/app/code/Magento/Dhl/Model/Carrier.php index 194f55d5822bb73d0eb67f2bdbc3f58a67748bee..e5735b780e958450e7ff56615fbd2440c1e94c1e 100644 --- a/app/code/Magento/Dhl/Model/Carrier.php +++ b/app/code/Magento/Dhl/Model/Carrier.php @@ -9,7 +9,7 @@ namespace Magento\Dhl\Model; use Magento\Catalog\Model\Product\Type; -use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Module\Dir; use Magento\Sales\Model\Order\Shipment; use Magento\Quote\Model\Quote\Address\RateRequest; use Magento\Quote\Model\Quote\Address\RateResult\Error; @@ -178,11 +178,9 @@ class Carrier extends \Magento\Dhl\Model\AbstractDhl implements \Magento\Shippin protected $mathDivision; /** - * Modules directory with read permissions - * - * @var \Magento\Framework\Filesystem\Directory\Read + * @var \Magento\Framework\Filesystem\Directory\ReadFactory */ - protected $modulesDirectory; + protected $readFactory; /** * @var \Magento\Framework\Stdlib\DateTime @@ -216,7 +214,7 @@ class Carrier extends \Magento\Dhl\Model\AbstractDhl implements \Magento\Shippin * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Framework\Stdlib\StringUtils $string * @param \Magento\Framework\Math\Division $mathDivision - * @param \Magento\Framework\Filesystem $filesystem + * @param \Magento\Framework\Filesystem\Directory\ReadFactory $readFactory * @param \Magento\Framework\Stdlib\DateTime $dateTime * @param \Magento\Framework\HTTP\ZendClientFactory $httpClientFactory * @param array $data @@ -244,12 +242,12 @@ class Carrier extends \Magento\Dhl\Model\AbstractDhl implements \Magento\Shippin \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\Stdlib\StringUtils $string, \Magento\Framework\Math\Division $mathDivision, - \Magento\Framework\Filesystem $filesystem, + \Magento\Framework\Filesystem\Directory\ReadFactory $readFactory, \Magento\Framework\Stdlib\DateTime $dateTime, \Magento\Framework\HTTP\ZendClientFactory $httpClientFactory, array $data = [] ) { - $this->modulesDirectory = $filesystem->getDirectoryRead(DirectoryList::MODULES); + $this->readFactory = $readFactory; $this->_carrierHelper = $carrierHelper; $this->_coreDate = $coreDate; $this->_storeManager = $storeManager; @@ -1251,9 +1249,9 @@ class Carrier extends \Magento\Dhl\Model\AbstractDhl implements \Magento\Shippin protected function getCountryParams($countryCode) { if (empty($this->_countryParams)) { - $etcPath = $this->_configReader->getModuleDir('etc', 'Magento_Dhl'); - $countriesXmlPath = $this->modulesDirectory->getRelativePath($etcPath . '/countries.xml'); - $countriesXml = $this->modulesDirectory->readFile($countriesXmlPath); + $etcPath = $this->_configReader->getModuleDir(Dir::MODULE_ETC_DIR, 'Magento_Dhl'); + $directoryRead = $this->readFactory->create($etcPath); + $countriesXml = $directoryRead->readFile('countries.xml'); $this->_countryParams = $this->_xmlElFactory->create(['data' => $countriesXml]); } if (isset($this->_countryParams->{$countryCode})) { diff --git a/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php b/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php index a5345477bfc0d96ab9d69c000829a8108f09d9ae..55bce336393bb72b2448483ae747777f87daadc3 100644 --- a/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php +++ b/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php @@ -145,12 +145,8 @@ class CarrierTest extends \PHPUnit_Framework_TestCase )->will( $this->returnValue(file_get_contents(__DIR__ . '/_files/countries.xml')) ); - $filesystem = $this->getMockBuilder( - '\Magento\Framework\Filesystem' - )->disableOriginalConstructor()->setMethods( - ['getDirectoryRead'] - )->getMock(); - $filesystem->expects($this->any())->method('getDirectoryRead')->will($this->returnValue($modulesDirectory)); + $readFactory = $this->getMock('Magento\Framework\Filesystem\Directory\ReadFactory', [], [], '', false); + $readFactory->expects($this->any())->method('create')->willReturn($modulesDirectory); $storeManager = $this->getMockBuilder( '\Magento\Store\Model\StoreManager' )->disableOriginalConstructor()->setMethods( @@ -185,7 +181,7 @@ class CarrierTest extends \PHPUnit_Framework_TestCase 'rateErrorFactory' => $this->errorFactory, 'rateMethodFactory' => $rateMethodFactory, 'httpClientFactory' => $httpClientFactory, - 'filesystem' => $filesystem, + 'readFactory' => $readFactory, 'storeManager' => $storeManager, 'data' => ['id' => 'dhl', 'store' => '1'] ] diff --git a/app/code/Magento/Dhl/Test/Unit/Model/_files/success_dhl_response_rates.xml b/app/code/Magento/Dhl/Test/Unit/Model/_files/success_dhl_response_rates.xml index 70a94aab5dc5208d78cdea7b256439f80b062b43..13863287b718c4cbbdaa423a88bb7b41408f31ee 100644 --- a/app/code/Magento/Dhl/Test/Unit/Model/_files/success_dhl_response_rates.xml +++ b/app/code/Magento/Dhl/Test/Unit/Model/_files/success_dhl_response_rates.xml @@ -475,4 +475,4 @@ </Srv> </Srvs> </GetQuoteResponse> -</res:DCTResponse> \ No newline at end of file +</res:DCTResponse> diff --git a/app/code/Magento/Dhl/composer.json b/app/code/Magento/Dhl/composer.json index 1f577af21d55cb1100238b9b8ce5a9bfc43ab029..eb9850db558e77b698eada0cd9ebff3a52785015 100644 --- a/app/code/Magento/Dhl/composer.json +++ b/app/code/Magento/Dhl/composer.json @@ -13,8 +13,7 @@ "magento/module-catalog-inventory": "1.0.0-beta", "magento/module-quote": "1.0.0-beta", "magento/framework": "1.0.0-beta", - "lib-libxml": "*", - "magento/magento-composer-installer": "*" + "lib-libxml": "*" }, "suggest": { "magento/module-checkout": "1.0.0-beta" @@ -25,12 +24,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Dhl" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Dhl\\": "" + } } } diff --git a/app/code/Magento/Dhl/etc/adminhtml/system.xml b/app/code/Magento/Dhl/etc/adminhtml/system.xml index c9a14fecf5d73ec06feee1a7bbf38a7f1c57c915..8af55bd39708c453dd3d7ddf10fe6f79578a353d 100644 --- a/app/code/Magento/Dhl/etc/adminhtml/system.xml +++ b/app/code/Magento/Dhl/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="carriers"> <group id="dhl" translate="label" type="text" sortOrder="140" showInDefault="1" showInWebsite="1" showInStore="1"> diff --git a/app/code/Magento/Dhl/etc/config.xml b/app/code/Magento/Dhl/etc/config.xml index 0d60e087a0e35b88c4d858b5332e5338dea2385c..a3f5239b83ea2bb5e67a1eef9eb11ca974dcfc38 100644 --- a/app/code/Magento/Dhl/etc/config.xml +++ b/app/code/Magento/Dhl/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <system> <media_storage_configuration> diff --git a/app/code/Magento/Dhl/etc/di.xml b/app/code/Magento/Dhl/etc/di.xml index ab7c4fd807d03463e78dc8c43073fdd0c6eb503f..f533b5d9d3b08502c670b90d5ddf7377636bd3d1 100644 --- a/app/code/Magento/Dhl/etc/di.xml +++ b/app/code/Magento/Dhl/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Checkout\Block\Cart\LayoutProcessor"> <plugin name="checkout_cart_shipping_dhl" type="Magento\Dhl\Model\Plugin\Checkout\Block\Cart\Shipping"/> </type> diff --git a/app/code/Magento/Dhl/etc/module.xml b/app/code/Magento/Dhl/etc/module.xml index 1bbb4b455fe934c136d19ce54fca965bce450095..0461024ade8d1adb68a4d381730fdc0735debe23 100644 --- a/app/code/Magento/Dhl/etc/module.xml +++ b/app/code/Magento/Dhl/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Dhl" setup_version="2.0.0"> </module> </config> diff --git a/app/code/Magento/Dhl/registration.php b/app/code/Magento/Dhl/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..8a06be1cc1c2b2ca5a575e4380b0080684b2e009 --- /dev/null +++ b/app/code/Magento/Dhl/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Dhl', + __DIR__ +); diff --git a/app/code/Magento/Dhl/view/frontend/layout/checkout_cart_index.xml b/app/code/Magento/Dhl/view/frontend/layout/checkout_cart_index.xml index 5fa4ed8655b22ae8e0c9685edf492c5de6124344..18f09edc9e5ae0e54d37d2da148781ea57718f73 100644 --- a/app/code/Magento/Dhl/view/frontend/layout/checkout_cart_index.xml +++ b/app/code/Magento/Dhl/view/frontend/layout/checkout_cart_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout.cart.shipping"> <arguments> diff --git a/app/code/Magento/Dhl/view/frontend/layout/checkout_index_index.xml b/app/code/Magento/Dhl/view/frontend/layout/checkout_index_index.xml index ac3abe1cd6cb6fa38d82426add0139152f4b1e5b..d677dce32148ec3b651026538aadb14a3d4e5eb2 100644 --- a/app/code/Magento/Dhl/view/frontend/layout/checkout_index_index.xml +++ b/app/code/Magento/Dhl/view/frontend/layout/checkout_index_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout.root"> <arguments> diff --git a/app/code/Magento/Directory/Model/Country/Postcode/Config/SchemaLocator.php b/app/code/Magento/Directory/Model/Country/Postcode/Config/SchemaLocator.php index 5984a2e501b71983b6c9c6a00bdf546e7f81827a..19c096ad4b2940defc605c433344668287781b95 100644 --- a/app/code/Magento/Directory/Model/Country/Postcode/Config/SchemaLocator.php +++ b/app/code/Magento/Directory/Model/Country/Postcode/Config/SchemaLocator.php @@ -5,6 +5,8 @@ */ namespace Magento\Directory\Model\Country\Postcode\Config; +use Magento\Framework\Module\Dir; + class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface { /** @@ -19,7 +21,7 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface */ public function __construct(\Magento\Framework\Module\Dir\Reader $moduleReader) { - $this->schema = $moduleReader->getModuleDir('etc', 'Magento_Directory') . '/zip_codes.xsd'; + $this->schema = $moduleReader->getModuleDir(Dir::MODULE_ETC_DIR, 'Magento_Directory') . '/zip_codes.xsd'; } /** diff --git a/app/code/Magento/Directory/Test/Unit/_files/zip_codes.xml b/app/code/Magento/Directory/Test/Unit/_files/zip_codes.xml index bbe7582ea62c267702eb25b4415ea01ac9585e8f..f18334d4ed5f7bf6466a5b62888bc0405e72dd8b 100644 --- a/app/code/Magento/Directory/Test/Unit/_files/zip_codes.xml +++ b/app/code/Magento/Directory/Test/Unit/_files/zip_codes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Directory/etc/zip_codes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Directory:etc/zip_codes.xsd"> <zip countryCode="US"> <codes> <code id="pattern_1" example="12345" active="true">^[0-9]{5}\-[0-9]{4}$</code> diff --git a/app/code/Magento/Directory/composer.json b/app/code/Magento/Directory/composer.json index ea9b1997fbafc854bd1c3ae2f67570cb3c32751b..03f91d9064c9ca393b1f9776e1695da989ffeb23 100644 --- a/app/code/Magento/Directory/composer.json +++ b/app/code/Magento/Directory/composer.json @@ -7,8 +7,7 @@ "magento/module-store": "1.0.0-beta", "magento/module-backend": "1.0.0-beta", "magento/framework": "1.0.0-beta", - "lib-libxml": "*", - "magento/magento-composer-installer": "*" + "lib-libxml": "*" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -16,12 +15,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Directory" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Directory\\": "" + } } } diff --git a/app/code/Magento/Directory/etc/adminhtml/di.xml b/app/code/Magento/Directory/etc/adminhtml/di.xml index 11638188dc65c6a120430f73a6e87f285d0de64c..2678f76fe1988296d5bef1af7737af9e5af402cf 100644 --- a/app/code/Magento/Directory/etc/adminhtml/di.xml +++ b/app/code/Magento/Directory/etc/adminhtml/di.xml @@ -5,5 +5,5 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> </config> diff --git a/app/code/Magento/Directory/etc/adminhtml/routes.xml b/app/code/Magento/Directory/etc/adminhtml/routes.xml index 3659f78c7e8389bc6985e6b186aa20a324339875..0ca7c9ea31cf56bccb0520e95f8a48ba36d78177 100644 --- a/app/code/Magento/Directory/etc/adminhtml/routes.xml +++ b/app/code/Magento/Directory/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="admin"> <route id="directory" frontName="directory"> <module name="Magento_Directory" before="Magento_Backend" /> diff --git a/app/code/Magento/Directory/etc/adminhtml/system.xml b/app/code/Magento/Directory/etc/adminhtml/system.xml index 7f6d63561141492060876303474293328aa7ee6f..fa22d9f4dd20ca29505fc7585e3b0b27490059ec 100644 --- a/app/code/Magento/Directory/etc/adminhtml/system.xml +++ b/app/code/Magento/Directory/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="currency" translate="label" sortOrder="60" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Currency Setup</label> diff --git a/app/code/Magento/Directory/etc/config.xml b/app/code/Magento/Directory/etc/config.xml index 54cec22d63ee92e7b5143778d51b003a09dc604f..d1a23705b3b4ede7f5ad53ba0bc66abd22b4c1d7 100644 --- a/app/code/Magento/Directory/etc/config.xml +++ b/app/code/Magento/Directory/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <system> <currency> diff --git a/app/code/Magento/Directory/etc/crontab.xml b/app/code/Magento/Directory/etc/crontab.xml index 16056fc807fbca42a0392194d499f425553191bf..d3ad6f933d66a7071a965df53a552c0636629ed9 100644 --- a/app/code/Magento/Directory/etc/crontab.xml +++ b/app/code/Magento/Directory/etc/crontab.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Cron/etc/crontab.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd"> <group id="default"> <job name="currency_rates_update" instance="Magento\Directory\Model\Observer" method="scheduledUpdateCurrencyRates" /> </group> diff --git a/app/code/Magento/Directory/etc/di.xml b/app/code/Magento/Directory/etc/di.xml index 20cc4c886fb7a22064b8e2938afa96bb2c9aa93f..9b89eb6977e934e9baa20c1fc1a1878b35113b2c 100644 --- a/app/code/Magento/Directory/etc/di.xml +++ b/app/code/Magento/Directory/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Directory\Model\Currency\Import\Config"> <arguments> <argument name="servicesConfig" xsi:type="array"> diff --git a/app/code/Magento/Directory/etc/email_templates.xml b/app/code/Magento/Directory/etc/email_templates.xml index 3f4ca760584253327a2840c4740bddda9320f354..62829e14782320944c1850ab85b81ccc9b7a30cf 100644 --- a/app/code/Magento/Directory/etc/email_templates.xml +++ b/app/code/Magento/Directory/etc/email_templates.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Email/etc/email_templates.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Email:etc/email_templates.xsd"> <template id="currency_import_error_email_template" label="Currency Update Warnings" file="currency_update_notification.html" type="text" module="Magento_Directory" area="adminhtml"/> </config> diff --git a/app/code/Magento/Directory/etc/frontend/routes.xml b/app/code/Magento/Directory/etc/frontend/routes.xml index 10095f985b2ead6fa3462ce84a4af49b6d0cb9ea..26e681ea16fcf9dc58bafda02c69358a9d42f803 100644 --- a/app/code/Magento/Directory/etc/frontend/routes.xml +++ b/app/code/Magento/Directory/etc/frontend/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="standard"> <route id="directory" frontName="directory"> <module name="Magento_Directory" /> diff --git a/app/code/Magento/Directory/etc/frontend/sections.xml b/app/code/Magento/Directory/etc/frontend/sections.xml index 2af7dde3b1a9810d2506d4927eec6f846a2ac222..d2110434ca7249c5953f77142d1b89b33998cbbe 100644 --- a/app/code/Magento/Directory/etc/frontend/sections.xml +++ b/app/code/Magento/Directory/etc/frontend/sections.xml @@ -6,6 +6,6 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../Magento/Customer/etc/sections.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd"> <action name="directory/currency/switch"/> </config> diff --git a/app/code/Magento/Directory/etc/module.xml b/app/code/Magento/Directory/etc/module.xml index 385b4422a936a867361ddb7f3c0cc21f94f5b52b..fc494f57df635384707bdb6d5d0ffaa5da6b9966 100644 --- a/app/code/Magento/Directory/etc/module.xml +++ b/app/code/Magento/Directory/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Directory" setup_version="2.0.0"> <sequence> <module name="Magento_Store"/> diff --git a/app/code/Magento/Directory/etc/webapi.xml b/app/code/Magento/Directory/etc/webapi.xml index c63efd9a3c073ea309c78f55715f82608c39e9fc..5fdd393a3dce5202a215acfe919dfd1515cc74d0 100644 --- a/app/code/Magento/Directory/etc/webapi.xml +++ b/app/code/Magento/Directory/etc/webapi.xml @@ -6,7 +6,7 @@ */ --> <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../app/code/Magento/Webapi/etc/webapi.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd"> <!-- Currency --> <route url="/V1/directory/currency" method="GET"> <service class="Magento\Directory\Api\CurrencyInformationAcquirerInterface" method="getCurrencyInfo"/> diff --git a/app/code/Magento/Directory/etc/zip_codes.xml b/app/code/Magento/Directory/etc/zip_codes.xml index 1c9a840a69633cf4a8136529ae31fcd132913d4f..a554530a591a22de94b0abd9aa2ba9a91ab9ffd6 100644 --- a/app/code/Magento/Directory/etc/zip_codes.xml +++ b/app/code/Magento/Directory/etc/zip_codes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Directory/etc/zip_codes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Directory:etc/zip_codes.xsd"> <zip countryCode="DZ"> <codes> <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> diff --git a/app/code/Magento/Directory/registration.php b/app/code/Magento/Directory/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..d2515bf56c42f7202a27c8581eff641811c1a5a1 --- /dev/null +++ b/app/code/Magento/Directory/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Directory', + __DIR__ +); diff --git a/app/code/Magento/Directory/view/frontend/layout/catalog_category_view.xml b/app/code/Magento/Directory/view/frontend/layout/catalog_category_view.xml index a024d6e563cb581c15476d71430b89f2dd05ea36..44eec0b583d14104b76b334e2395d72d5b2bf778 100644 --- a/app/code/Magento/Directory/view/frontend/layout/catalog_category_view.xml +++ b/app/code/Magento/Directory/view/frontend/layout/catalog_category_view.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body/> </page> diff --git a/app/code/Magento/Directory/view/frontend/layout/catalogsearch_advanced_index.xml b/app/code/Magento/Directory/view/frontend/layout/catalogsearch_advanced_index.xml index a024d6e563cb581c15476d71430b89f2dd05ea36..44eec0b583d14104b76b334e2395d72d5b2bf778 100644 --- a/app/code/Magento/Directory/view/frontend/layout/catalogsearch_advanced_index.xml +++ b/app/code/Magento/Directory/view/frontend/layout/catalogsearch_advanced_index.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body/> </page> diff --git a/app/code/Magento/Directory/view/frontend/layout/catalogsearch_advanced_result.xml b/app/code/Magento/Directory/view/frontend/layout/catalogsearch_advanced_result.xml index a024d6e563cb581c15476d71430b89f2dd05ea36..44eec0b583d14104b76b334e2395d72d5b2bf778 100644 --- a/app/code/Magento/Directory/view/frontend/layout/catalogsearch_advanced_result.xml +++ b/app/code/Magento/Directory/view/frontend/layout/catalogsearch_advanced_result.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body/> </page> diff --git a/app/code/Magento/Directory/view/frontend/layout/catalogsearch_result_index.xml b/app/code/Magento/Directory/view/frontend/layout/catalogsearch_result_index.xml index a024d6e563cb581c15476d71430b89f2dd05ea36..44eec0b583d14104b76b334e2395d72d5b2bf778 100644 --- a/app/code/Magento/Directory/view/frontend/layout/catalogsearch_result_index.xml +++ b/app/code/Magento/Directory/view/frontend/layout/catalogsearch_result_index.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body/> </page> diff --git a/app/code/Magento/Directory/view/frontend/layout/default.xml b/app/code/Magento/Directory/view/frontend/layout/default.xml index b3d22152d6a4efc7802da0b59945fd5b48d230f9..d2d191a2d88a680b41b53424c5f552f20d6f60fd 100644 --- a/app/code/Magento/Directory/view/frontend/layout/default.xml +++ b/app/code/Magento/Directory/view/frontend/layout/default.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="header.panel"> <block class="Magento\Directory\Block\Currency" name="currency" before="store_language" template="currency.phtml"/> diff --git a/app/code/Magento/Downloadable/Model/ProductOptionProcessor.php b/app/code/Magento/Downloadable/Model/ProductOptionProcessor.php new file mode 100644 index 0000000000000000000000000000000000000000..99472ec1bbccedfed1211360451b838e7da4b0bc --- /dev/null +++ b/app/code/Magento/Downloadable/Model/ProductOptionProcessor.php @@ -0,0 +1,103 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Downloadable\Model; + +use Magento\Catalog\Api\Data\ProductOptionInterface; +use Magento\Catalog\Model\ProductOptionProcessorInterface; +use Magento\Downloadable\Model\DownloadableOptionFactory; +use Magento\Framework\Api\DataObjectHelper; +use Magento\Framework\DataObject; +use Magento\Framework\DataObject\Factory as DataObjectFactory; + +class ProductOptionProcessor implements ProductOptionProcessorInterface +{ + /** + * @var DataObjectFactory + */ + protected $objectFactory; + + /** + * @var DataObjectHelper + */ + protected $dataObjectHelper; + + /** + * @var DownloadableOptionFactory + */ + protected $downloadableOptionFactory; + + /** + * @param DataObjectFactory $objectFactory + * @param DataObjectHelper $dataObjectHelper + * @param DownloadableOptionFactory $downloadableOptionFactory + */ + public function __construct( + DataObjectFactory $objectFactory, + DataObjectHelper $dataObjectHelper, + DownloadableOptionFactory $downloadableOptionFactory + ) { + $this->objectFactory = $objectFactory; + $this->dataObjectHelper = $dataObjectHelper; + $this->downloadableOptionFactory = $downloadableOptionFactory; + } + + /** + * {@inheritdoc} + */ + public function convertToBuyRequest(ProductOptionInterface $productOption) + { + /** @var DataObject $request */ + $request = $this->objectFactory->create(); + + $links = $this->getDownloadableLinks($productOption); + if (!empty($links)) { + $request->addData(['links' => $links]); + } + + return $request; + } + + /** + * Retrieve downloadable links option + * + * @param ProductOptionInterface $productOption + * @return array + */ + protected function getDownloadableLinks(ProductOptionInterface $productOption) + { + if ($productOption + && $productOption->getExtensionAttributes() + && $productOption->getExtensionAttributes()->getDownloadableOption() + ) { + return $productOption->getExtensionAttributes() + ->getDownloadableOption() + ->getDownloadableLinks(); + } + return []; + } + + /** + * {@inheritdoc} + */ + public function convertToProductOption(DataObject $request) + { + /** @var DownloadableOption $downloadableOption */ + $downloadableOption = $this->downloadableOptionFactory->create(); + + $links = $request->getLinks(); + if (!empty($links) && is_array($links)) { + $this->dataObjectHelper->populateWithArray( + $downloadableOption, + ['downloadable_links' => $links], + 'Magento\Downloadable\Api\Data\DownloadableOptionInterface' + ); + + return ['downloadable_option' => $downloadableOption]; + } + + return []; + } +} diff --git a/app/code/Magento/Downloadable/Model/Quote/Item/CartItemProcessor.php b/app/code/Magento/Downloadable/Model/Quote/Item/CartItemProcessor.php index 63db5a53e5d3fdc6799d5cdae713d1faf1da1d59..43cb6a5aae806b06c9bebebedee25192bbb1e21b 100644 --- a/app/code/Magento/Downloadable/Model/Quote/Item/CartItemProcessor.php +++ b/app/code/Magento/Downloadable/Model/Quote/Item/CartItemProcessor.php @@ -82,7 +82,7 @@ class CartItemProcessor implements CartItemProcessorInterface * @param CartItemInterface $cartItem * @return CartItemInterface */ - public function processProductOptions(CartItemInterface $cartItem) + public function processOptions(CartItemInterface $cartItem) { $downloadableLinkIds = []; $option = $cartItem->getOptionByCode('downloadable_link_ids'); diff --git a/app/code/Magento/Downloadable/Test/Unit/Model/ProductOptionProcessorTest.php b/app/code/Magento/Downloadable/Test/Unit/Model/ProductOptionProcessorTest.php new file mode 100644 index 0000000000000000000000000000000000000000..152309c4688f847ae513ea54c908a5bd172ef151 --- /dev/null +++ b/app/code/Magento/Downloadable/Test/Unit/Model/ProductOptionProcessorTest.php @@ -0,0 +1,198 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Downloadable\Test\Unit\Model; + +use Magento\Downloadable\Api\Data\DownloadableOptionInterface; +use Magento\Downloadable\Model\DownloadableOptionFactory; +use Magento\Downloadable\Model\ProductOptionProcessor; +use Magento\Framework\Api\DataObjectHelper; +use Magento\Framework\DataObject; +use Magento\Framework\DataObject\Factory as DataObjectFactory; + +class ProductOptionProcessorTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var ProductOptionProcessor + */ + protected $processor; + + /** + * @var DataObject | \PHPUnit_Framework_MockObject_MockObject + */ + protected $dataObject; + + /** + * @var DataObjectFactory | \PHPUnit_Framework_MockObject_MockObject + */ + protected $dataObjectFactory; + + /** + * @var DataObjectHelper | \PHPUnit_Framework_MockObject_MockObject + */ + protected $dataObjectHelper; + + /** + * @var DownloadableOptionFactory | \PHPUnit_Framework_MockObject_MockObject + */ + protected $downloadableOptionFactory; + + /** + * @var DownloadableOptionInterface | \PHPUnit_Framework_MockObject_MockObject + */ + protected $downloadableOption; + + protected function setUp() + { + $this->dataObject = $this->getMockBuilder('Magento\Framework\DataObject') + ->setMethods([ + 'getLinks', + ]) + ->disableOriginalConstructor() + ->getMock(); + + $this->dataObjectFactory = $this->getMockBuilder('Magento\Framework\DataObject\Factory') + ->setMethods(['create']) + ->disableOriginalConstructor() + ->getMock(); + $this->dataObjectFactory->expects($this->any()) + ->method('create') + ->willReturn($this->dataObject); + + $this->dataObjectHelper = $this->getMockBuilder('Magento\Framework\Api\DataObjectHelper') + ->disableOriginalConstructor() + ->getMock(); + + $this->downloadableOption = $this->getMockBuilder( + 'Magento\Downloadable\Api\Data\DownloadableOptionInterface' + ) + ->setMethods([ + 'getDownloadableLinks', + ]) + ->getMockForAbstractClass(); + + $this->downloadableOptionFactory = $this->getMockBuilder( + 'Magento\Downloadable\Model\DownloadableOptionFactory' + ) + ->setMethods(['create']) + ->disableOriginalConstructor() + ->getMock(); + $this->downloadableOptionFactory->expects($this->any()) + ->method('create') + ->willReturn($this->downloadableOption); + + $this->processor = new ProductOptionProcessor( + $this->dataObjectFactory, + $this->dataObjectHelper, + $this->downloadableOptionFactory + ); + } + + /** + * @param array|string $options + * @param array $requestData + * @dataProvider dataProviderConvertToBuyRequest + */ + public function testConvertToBuyRequest( + $options, + $requestData + ) { + $productOptionMock = $this->getMockBuilder('Magento\Catalog\Api\Data\ProductOptionInterface') + ->getMockForAbstractClass(); + + $productOptionExtensionMock = $this->getMockBuilder('Magento\Catalog\Api\Data\ProductOptionExtensionInterface') + ->setMethods([ + 'getDownloadableOption', + ]) + ->getMockForAbstractClass(); + + $productOptionMock->expects($this->any()) + ->method('getExtensionAttributes') + ->willReturn($productOptionExtensionMock); + + $productOptionExtensionMock->expects($this->any()) + ->method('getDownloadableOption') + ->willReturn($this->downloadableOption); + + $this->downloadableOption->expects($this->any()) + ->method('getDownloadableLinks') + ->willReturn($options); + + $this->dataObject->expects($this->any()) + ->method('addData') + ->with($requestData) + ->willReturnSelf(); + + $this->assertEquals($this->dataObject, $this->processor->convertToBuyRequest($productOptionMock)); + } + + /** + * @return array + */ + public function dataProviderConvertToBuyRequest() + { + return [ + [ + [1, 2, 3], + [ + 'links' => [1, 2, 3], + ], + ], + [[], []], + ['', []], + ]; + } + + /** + * @param array|string $options + * @param string|null $expected + * @dataProvider dataProviderConvertToProductOption + */ + public function testConvertToProductOption( + $options, + $expected + ) { + $this->dataObject->expects($this->any()) + ->method('getLinks') + ->willReturn($options); + + $this->dataObjectHelper->expects($this->any()) + ->method('populateWithArray') + ->with( + $this->downloadableOption, + ['downloadable_links' => $options], + 'Magento\Downloadable\Api\Data\DownloadableOptionInterface' + ) + ->willReturnSelf(); + + $result = $this->processor->convertToProductOption($this->dataObject); + + if (!empty($expected)) { + $this->assertArrayHasKey($expected, $result); + $this->assertSame($this->downloadableOption, $result[$expected]); + } + } + + /** + * @return array + */ + public function dataProviderConvertToProductOption() + { + return [ + [ + 'options' => [1, 2, 3], + 'expected' => 'downloadable_option', + ], + [ + 'options' => [], + 'expected' => null, + ], + [ + 'options' => 'is not array', + 'expected' => null, + ], + ]; + } +} diff --git a/app/code/Magento/Downloadable/Test/Unit/Model/Quote/Item/CartItemProcessorTest.php b/app/code/Magento/Downloadable/Test/Unit/Model/Quote/Item/CartItemProcessorTest.php index 9379e9a0bad4c95648f6bff5555de0ec753d51bd..b1c025acd616afd863a9235ca8a441a382e8b8ce 100644 --- a/app/code/Magento/Downloadable/Test/Unit/Model/Quote/Item/CartItemProcessorTest.php +++ b/app/code/Magento/Downloadable/Test/Unit/Model/Quote/Item/CartItemProcessorTest.php @@ -187,7 +187,7 @@ class CartItemProcessorTest extends \PHPUnit_Framework_TestCase ->with($extAttributeMock); $cartItemMock->expects($this->once())->method('setProductOption')->with($productOptionMock); - $this->assertEquals($cartItemMock, $this->model->processProductOptions($cartItemMock)); + $this->assertEquals($cartItemMock, $this->model->processOptions($cartItemMock)); } public function testProcessProductOptionsWhenItemDoesNotHaveDownloadableLinks() @@ -244,6 +244,6 @@ class CartItemProcessorTest extends \PHPUnit_Framework_TestCase ->with($extAttributeMock); $cartItemMock->expects($this->once())->method('setProductOption')->with($productOptionMock); - $this->assertEquals($cartItemMock, $this->model->processProductOptions($cartItemMock)); + $this->assertEquals($cartItemMock, $this->model->processOptions($cartItemMock)); } } diff --git a/app/code/Magento/Downloadable/composer.json b/app/code/Magento/Downloadable/composer.json index 7531ed93cfb64294f149fd0d0500bc48895eb20c..e2d2d2138672eafc41b9ee591834d027e4203284 100644 --- a/app/code/Magento/Downloadable/composer.json +++ b/app/code/Magento/Downloadable/composer.json @@ -18,8 +18,7 @@ "magento/module-config": "1.0.0-beta", "magento/module-media-storage": "1.0.0-beta", "magento/module-quote": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -27,12 +26,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Downloadable" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Downloadable\\": "" + } } } diff --git a/app/code/Magento/Downloadable/etc/acl.xml b/app/code/Magento/Downloadable/etc/acl.xml index a775b114bb9a3545392738a9a6fbc52065534c87..ef97ae3672908dbd8ec16640194041b03499620b 100644 --- a/app/code/Magento/Downloadable/etc/acl.xml +++ b/app/code/Magento/Downloadable/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/app/code/Magento/Downloadable/etc/adminhtml/di.xml b/app/code/Magento/Downloadable/etc/adminhtml/di.xml index 4e75634d3c235e68f0488801fe7c350d336373bc..2d91201537c901a01ad2c78581a5a85c980810a8 100644 --- a/app/code/Magento/Downloadable/etc/adminhtml/di.xml +++ b/app/code/Magento/Downloadable/etc/adminhtml/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Catalog\Controller\Adminhtml\Product\Initialization\Helper"> <plugin name="Downloadable" type="Magento\Downloadable\Controller\Adminhtml\Product\Initialization\Helper\Plugin\Downloadable" sortOrder="70" /> </type> diff --git a/app/code/Magento/Downloadable/etc/adminhtml/menu.xml b/app/code/Magento/Downloadable/etc/adminhtml/menu.xml index 66542947ad63adc138820cd43513b125819e6291..9fbdfc29378bc63e10c77dd52a1e543a54582f9f 100644 --- a/app/code/Magento/Downloadable/etc/adminhtml/menu.xml +++ b/app/code/Magento/Downloadable/etc/adminhtml/menu.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Backend/etc/menu.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd"> <menu> <add id="Magento_Downloadable::report_products_downloads" title="Downloads" module="Magento_Reports" sortOrder="50" parent="Magento_Reports::report_products" action="reports/report_product/downloads" resource="Magento_Reports::downloads"/> </menu> diff --git a/app/code/Magento/Downloadable/etc/adminhtml/routes.xml b/app/code/Magento/Downloadable/etc/adminhtml/routes.xml index 11aec011d13435c34a1dcaa29d1c6361d9008133..260e9900c5e63824269aec0c29060de2705fa565 100644 --- a/app/code/Magento/Downloadable/etc/adminhtml/routes.xml +++ b/app/code/Magento/Downloadable/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="admin"> <route id="adminhtml"> <module name="Magento_Downloadable" before="Magento_Backend" /> diff --git a/app/code/Magento/Downloadable/etc/adminhtml/system.xml b/app/code/Magento/Downloadable/etc/adminhtml/system.xml index b511b044d387f379fe68e3a88b2b4cd245b132ed..32797f20dbb4f148028c768832450f9fa9b6c7e8 100644 --- a/app/code/Magento/Downloadable/etc/adminhtml/system.xml +++ b/app/code/Magento/Downloadable/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="catalog"> <group id="downloadable" translate="label" type="text" sortOrder="600" showInDefault="1" showInWebsite="1" showInStore="1"> diff --git a/app/code/Magento/Downloadable/etc/catalog_attributes.xml b/app/code/Magento/Downloadable/etc/catalog_attributes.xml index cf8f4d0beca553ad48cd90d5bc5d6655e854dbcb..5d4f9562ebe0d5e9fb9ef9165b1a8f95b787405c 100644 --- a/app/code/Magento/Downloadable/etc/catalog_attributes.xml +++ b/app/code/Magento/Downloadable/etc/catalog_attributes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Catalog/etc/catalog_attributes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/catalog_attributes.xsd"> <group name="quote_item"> <attribute name="links_purchased_separately"/> <attribute name="links_title"/> diff --git a/app/code/Magento/Downloadable/etc/config.xml b/app/code/Magento/Downloadable/etc/config.xml index 4cd8938ad25e8124510f74e2ce8e4395de9573ef..57e981b36bd06189ec2511f8415e12134a630d69 100644 --- a/app/code/Magento/Downloadable/etc/config.xml +++ b/app/code/Magento/Downloadable/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <catalog> <downloadable> diff --git a/app/code/Magento/Downloadable/etc/di.xml b/app/code/Magento/Downloadable/etc/di.xml index a400d104749dfe9ec546dd8dd63eed93eb866240..0b8b82d9bf94626f0cdd53155a16f0b416d7fcde 100644 --- a/app/code/Magento/Downloadable/etc/di.xml +++ b/app/code/Magento/Downloadable/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Downloadable\Helper\Download"> <arguments> <argument name="coreFileStorageDb" xsi:type="object">Magento\MediaStorage\Helper\File\Storage\Database\Proxy</argument> @@ -66,6 +66,13 @@ </argument> </arguments> </type> + <type name="Magento\Sales\Api\OrderItemRepositoryInterface"> + <arguments> + <argument name="processorPool" xsi:type="array"> + <item name="downloadable" xsi:type="object">Magento\Downloadable\Model\ProductOptionProcessor</item> + </argument> + </arguments> + </type> <preference for="\Magento\Downloadable\Api\LinkRepositoryInterface" type="\Magento\Downloadable\Model\LinkRepository" /> <preference for="\Magento\Downloadable\Api\SampleRepositoryInterface" type="\Magento\Downloadable\Model\SampleRepository" /> <preference for="\Magento\Downloadable\Api\Data\LinkInterface" type="\Magento\Downloadable\Model\Link" /> diff --git a/app/code/Magento/Downloadable/etc/events.xml b/app/code/Magento/Downloadable/etc/events.xml index 8e6a0cd141ca01d2a86d63c6c5299573395958f3..ba57bb11aeaa925e93357690056774d4e4d15210 100644 --- a/app/code/Magento/Downloadable/etc/events.xml +++ b/app/code/Magento/Downloadable/etc/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="sales_order_item_save_commit_after"> <observer name="downloadable_observer" instance="Magento\Downloadable\Observer\SaveDownloadableOrderItemObserver" method="execute" /> </event> diff --git a/app/code/Magento/Downloadable/etc/extension_attributes.xml b/app/code/Magento/Downloadable/etc/extension_attributes.xml index da726515e91ba72ded30089e3aabac52f7cafad0..23ca0c7378a5c9d0a3bb627de387833b18e05118 100644 --- a/app/code/Magento/Downloadable/etc/extension_attributes.xml +++ b/app/code/Magento/Downloadable/etc/extension_attributes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Api/etc/extension_attributes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> <extension_attributes for="Magento\Catalog\Api\Data\ProductInterface"> <attribute code="downloadable_product_links" type="Magento\Downloadable\Api\Data\LinkInterface[]" /> <attribute code="downloadable_product_samples" type="Magento\Downloadable\Api\Data\SampleInterface[]" /> @@ -13,4 +13,7 @@ <extension_attributes for="Magento\Quote\Api\Data\ProductOptionInterface"> <attribute code="downloadable_option" type="Magento\Downloadable\Api\Data\DownloadableOptionInterface" /> </extension_attributes> + <extension_attributes for="Magento\Catalog\Api\Data\ProductOptionInterface"> + <attribute code="downloadable_option" type="Magento\Downloadable\Api\Data\DownloadableOptionInterface" /> + </extension_attributes> </config> diff --git a/app/code/Magento/Downloadable/etc/fieldset.xml b/app/code/Magento/Downloadable/etc/fieldset.xml index 42dd53dc68641e6235fffe36cf253fafca1fa786..a742e050c7f210a91d49be07bc3d4d4da74d0f97 100644 --- a/app/code/Magento/Downloadable/etc/fieldset.xml +++ b/app/code/Magento/Downloadable/etc/fieldset.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/DataObject/etc/fieldset.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:framework:DataObject/etc/fieldset.xsd"> <scope id="global"> <fieldset id="downloadable_sales_copy_order"> <field name="entity_id"> diff --git a/app/code/Magento/Downloadable/etc/frontend/di.xml b/app/code/Magento/Downloadable/etc/frontend/di.xml index 71ef98a6f3476a5a59df06f4270306b60449cac9..71defbd016e1899736da7b4dd912f18ad36fec17 100644 --- a/app/code/Magento/Downloadable/etc/frontend/di.xml +++ b/app/code/Magento/Downloadable/etc/frontend/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Framework\Url\SecurityInfo"> <arguments> <argument name="secureUrlList" xsi:type="array"> diff --git a/app/code/Magento/Downloadable/etc/frontend/events.xml b/app/code/Magento/Downloadable/etc/frontend/events.xml index 720a0fad0928132a899a8e45b419c696669cd0e1..b1834afe1815d18b47c039a891dd1a428d53338d 100644 --- a/app/code/Magento/Downloadable/etc/frontend/events.xml +++ b/app/code/Magento/Downloadable/etc/frontend/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="checkout_type_multishipping_create_orders_single"> <observer name="checkout_type_multishipping_create_orders_single" instance="Magento\Downloadable\Observer\SetHasDownloadableProductsObserver" method="execute" /> </event> diff --git a/app/code/Magento/Downloadable/etc/frontend/page_types.xml b/app/code/Magento/Downloadable/etc/frontend/page_types.xml index 609bc5837c17881bbedddb11c42a5e61e8de729a..15f7f396d23614d8112fb7a3b65a0b1269fb27d4 100644 --- a/app/code/Magento/Downloadable/etc/frontend/page_types.xml +++ b/app/code/Magento/Downloadable/etc/frontend/page_types.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<page_types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_types.xsd"> +<page_types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_types.xsd"> <type id="downloadable_customer_products" label="Customer My Account Downloadable Items"/> </page_types> diff --git a/app/code/Magento/Downloadable/etc/frontend/routes.xml b/app/code/Magento/Downloadable/etc/frontend/routes.xml index 2ddf3211937d91b496fbb41bff3dff144ca868c3..da68e1bb91cf037224c4164c52241d8ef72b6e47 100644 --- a/app/code/Magento/Downloadable/etc/frontend/routes.xml +++ b/app/code/Magento/Downloadable/etc/frontend/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn: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/etc/module.xml b/app/code/Magento/Downloadable/etc/module.xml index 7441c7e447d4488621f46bd2ee667bad1ac6b5fd..d006271c9818695ac003dac0459ac25ec121636b 100644 --- a/app/code/Magento/Downloadable/etc/module.xml +++ b/app/code/Magento/Downloadable/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Downloadable" setup_version="2.0.0"> <sequence> <module name="Magento_Catalog"/> diff --git a/app/code/Magento/Downloadable/etc/pdf.xml b/app/code/Magento/Downloadable/etc/pdf.xml index 918d4c8bfb7ca36b8b795b2b3829925092ce80cc..554502dfa67ef46779b391645b3251d0d9878253 100644 --- a/app/code/Magento/Downloadable/etc/pdf.xml +++ b/app/code/Magento/Downloadable/etc/pdf.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Sales/etc/pdf_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Sales:etc/pdf_file.xsd"> <renderers> <page type="invoice"> <renderer product_type="downloadable">Magento\Downloadable\Model\Sales\Order\Pdf\Items\Invoice</renderer> diff --git a/app/code/Magento/Downloadable/etc/product_types.xml b/app/code/Magento/Downloadable/etc/product_types.xml index 018e20cbc88209fb41499b7703c0feda7ba67665..8fbf0156144b9294ae5701916ae7563c9683e01a 100644 --- a/app/code/Magento/Downloadable/etc/product_types.xml +++ b/app/code/Magento/Downloadable/etc/product_types.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Catalog/etc/product_types.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/product_types.xsd"> <type name="downloadable" label="Downloadable Product" modelInstance="Magento\Downloadable\Model\Product\Type" composite="false" isQty="true" canUseQtyDecimals="false" sortOrder="60"> <priceModel instance="Magento\Downloadable\Model\Product\Price" /> <indexerModel instance="Magento\Downloadable\Model\Resource\Indexer\Price" /> diff --git a/app/code/Magento/Downloadable/etc/sales.xml b/app/code/Magento/Downloadable/etc/sales.xml index 249de64b3d2686d8fc3b41019825546ab1d509c1..47456dbd6b3358caae608cf781707914a339a5a6 100644 --- a/app/code/Magento/Downloadable/etc/sales.xml +++ b/app/code/Magento/Downloadable/etc/sales.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Sales/etc/sales.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Sales:etc/sales.xsd"> <order> <available_product_type name="downloadable"/> </order> diff --git a/app/code/Magento/Downloadable/etc/webapi.xml b/app/code/Magento/Downloadable/etc/webapi.xml index 4b1f86ead0eaaa52d66a9675c5c59d4f387a18b9..80bef62e4ad6dd87dc91c6b08d181eff8ae0a226 100644 --- a/app/code/Magento/Downloadable/etc/webapi.xml +++ b/app/code/Magento/Downloadable/etc/webapi.xml @@ -6,7 +6,7 @@ */ --> <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../app/code/Magento/Webapi/etc/webapi.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd"> <route url="/V1/products/:sku/downloadable-links" method="GET"> <service class="Magento\Downloadable\Api\LinkRepositoryInterface" method="getList"/> <resources> diff --git a/app/code/Magento/Downloadable/etc/webapi_rest/di.xml b/app/code/Magento/Downloadable/etc/webapi_rest/di.xml index 489aed0bf3f014fb9cee148aa4f5ca48959aeb53..e715fbea4ffe271ded638165e290df54f4c3c9de 100644 --- a/app/code/Magento/Downloadable/etc/webapi_rest/di.xml +++ b/app/code/Magento/Downloadable/etc/webapi_rest/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Catalog\Helper\Product\ConfigurationPool"> <arguments> <argument name="instancesByType" xsi:type="array"> diff --git a/app/code/Magento/Downloadable/etc/webapi_soap/di.xml b/app/code/Magento/Downloadable/etc/webapi_soap/di.xml index 489aed0bf3f014fb9cee148aa4f5ca48959aeb53..e715fbea4ffe271ded638165e290df54f4c3c9de 100644 --- a/app/code/Magento/Downloadable/etc/webapi_soap/di.xml +++ b/app/code/Magento/Downloadable/etc/webapi_soap/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Catalog\Helper\Product\ConfigurationPool"> <arguments> <argument name="instancesByType" xsi:type="array"> diff --git a/app/code/Magento/Downloadable/registration.php b/app/code/Magento/Downloadable/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..b079cc78b2777fc07c98e97545bd448c2dd9ffa7 --- /dev/null +++ b/app/code/Magento/Downloadable/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Downloadable', + __DIR__ +); diff --git a/app/code/Magento/Downloadable/view/adminhtml/layout/catalog_product_downloadable.xml b/app/code/Magento/Downloadable/view/adminhtml/layout/catalog_product_downloadable.xml index d1805ee4664957b564af9f10201aa00b8bbcf26a..62c83ccc449d6703b5637b0e5893f00b8bc18363 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/layout/catalog_product_downloadable.xml +++ b/app/code/Magento/Downloadable/view/adminhtml/layout/catalog_product_downloadable.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="product_tabs"> <!-- @todo ui: remove arguments within .admin__scope-old --> diff --git a/app/code/Magento/Downloadable/view/adminhtml/layout/catalog_product_simple.xml b/app/code/Magento/Downloadable/view/adminhtml/layout/catalog_product_simple.xml index a5feddff7a3aed6353f8137cc3dd8bf5f2943a4c..68f77732e53cad5fbd460eaa649210cc4d634746 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/layout/catalog_product_simple.xml +++ b/app/code/Magento/Downloadable/view/adminhtml/layout/catalog_product_simple.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="product_tabs"> <block name="downloadable_items" class="Magento\Downloadable\Block\Adminhtml\Catalog\Product\Edit\Tab\Downloadable"> diff --git a/app/code/Magento/Downloadable/view/adminhtml/layout/catalog_product_view_type_downloadable.xml b/app/code/Magento/Downloadable/view/adminhtml/layout/catalog_product_view_type_downloadable.xml index 417968bd9276bfc7db34d998d7721efc827bf2ef..c17a36d8d6841287afe0b6dc14cb41dfe550541c 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/layout/catalog_product_view_type_downloadable.xml +++ b/app/code/Magento/Downloadable/view/adminhtml/layout/catalog_product_view_type_downloadable.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="product.composite.fieldset"> <block class="Magento\Downloadable\Block\Adminhtml\Catalog\Product\Composite\Fieldset\Downloadable" name="product.composite.fieldset.downloadable" before="product.composite.fieldset.options" template="product/composite/fieldset/downloadable.phtml"/> diff --git a/app/code/Magento/Downloadable/view/adminhtml/layout/catalog_product_virtual.xml b/app/code/Magento/Downloadable/view/adminhtml/layout/catalog_product_virtual.xml index a5feddff7a3aed6353f8137cc3dd8bf5f2943a4c..68f77732e53cad5fbd460eaa649210cc4d634746 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/layout/catalog_product_virtual.xml +++ b/app/code/Magento/Downloadable/view/adminhtml/layout/catalog_product_virtual.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="product_tabs"> <block name="downloadable_items" class="Magento\Downloadable\Block\Adminhtml\Catalog\Product\Edit\Tab\Downloadable"> diff --git a/app/code/Magento/Downloadable/view/adminhtml/layout/customer_index_wishlist.xml b/app/code/Magento/Downloadable/view/adminhtml/layout/customer_index_wishlist.xml index d8db39e8500f64910410ce87dc0603f2ffa9ec41..f10e19cb18abd0cab7c2ca792af368bed97e9d7a 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/layout/customer_index_wishlist.xml +++ b/app/code/Magento/Downloadable/view/adminhtml/layout/customer_index_wishlist.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="customer.wishlist.edit.tab"> <arguments> diff --git a/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_creditmemo_new.xml b/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_creditmemo_new.xml index a2d332c5323406ca5ac20dc9e2c04e882ffc7ebd..a9ce9c2851c03067b65a9e1531d9276cc4e5676c 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_creditmemo_new.xml +++ b/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_creditmemo_new.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="order_items"> <block class="Magento\Downloadable\Block\Adminhtml\Sales\Items\Column\Downloadable\Name" name="column_name_downloadable" template="sales/items/column/downloadable/creditmemo/name.phtml" group="column"/> diff --git a/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_creditmemo_updateqty.xml b/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_creditmemo_updateqty.xml index a2d332c5323406ca5ac20dc9e2c04e882ffc7ebd..a9ce9c2851c03067b65a9e1531d9276cc4e5676c 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_creditmemo_updateqty.xml +++ b/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_creditmemo_updateqty.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="order_items"> <block class="Magento\Downloadable\Block\Adminhtml\Sales\Items\Column\Downloadable\Name" name="column_name_downloadable" template="sales/items/column/downloadable/creditmemo/name.phtml" group="column"/> diff --git a/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_creditmemo_view.xml b/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_creditmemo_view.xml index cab01edc87dd542a96080a1ba5eecd31602f07e9..de4b9a505da5ffca9cfcb6579f821938d5d09536 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_creditmemo_view.xml +++ b/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_creditmemo_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="creditmemo_items"> <block class="Magento\Downloadable\Block\Adminhtml\Sales\Items\Column\Downloadable\Name" name="column_name_downloadable" template="sales/items/column/downloadable/creditmemo/name.phtml" group="column"/> diff --git a/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_invoice_new.xml b/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_invoice_new.xml index 01baeb89a0a6848e40e7b7a53015eeb78e0932d5..4a4a7aa14e4ec46f9a067f6bc622661dd820ac72 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_invoice_new.xml +++ b/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_invoice_new.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="order_items"> <block class="Magento\Downloadable\Block\Adminhtml\Sales\Items\Column\Downloadable\Name" name="column_name_downloadable" template="sales/items/column/downloadable/invoice/name.phtml" group="column"/> diff --git a/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_invoice_updateqty.xml b/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_invoice_updateqty.xml index 01baeb89a0a6848e40e7b7a53015eeb78e0932d5..4a4a7aa14e4ec46f9a067f6bc622661dd820ac72 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_invoice_updateqty.xml +++ b/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_invoice_updateqty.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="order_items"> <block class="Magento\Downloadable\Block\Adminhtml\Sales\Items\Column\Downloadable\Name" name="column_name_downloadable" template="sales/items/column/downloadable/invoice/name.phtml" group="column"/> diff --git a/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_invoice_view.xml b/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_invoice_view.xml index a47761fca405f1bd233bf27d961d8b5bee3bb193..494e03e15e9e4fe5d12d20b70c6c18dda6f2cae6 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_invoice_view.xml +++ b/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_invoice_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="invoice_items"> <block class="Magento\Downloadable\Block\Adminhtml\Sales\Items\Column\Downloadable\Name" name="column_name_downloadable" template="sales/items/column/downloadable/invoice/name.phtml" group="column"/> diff --git a/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_view.xml b/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_view.xml index eee910a520823ed075dc4b3641d72ca8bb98da9b..2be6f4cf4ae65a713072d21b3929efd784e7b286 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_view.xml +++ b/app/code/Magento/Downloadable/view/adminhtml/layout/sales_order_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="order_items"> <block class="Magento\Downloadable\Block\Adminhtml\Sales\Items\Column\Downloadable\Name" name="column_name_downloadable" template="sales/items/column/downloadable/name.phtml" group="column"/> 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 3b5958b2dbd41564630fa29f46eeec61d2ebde71..8cee2ad16fa0aaf4750e7d519e24344bb24026aa 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 @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <attribute name="class" value="page-product-downloadable"/> <referenceContainer name="product.info.main"> diff --git a/app/code/Magento/Downloadable/view/frontend/layout/checkout_cart_configure_type_downloadable.xml b/app/code/Magento/Downloadable/view/frontend/layout/checkout_cart_configure_type_downloadable.xml index 027a4d2927e68a924fd67a8220e5544c2e81935c..61c8bb25909cbf550ee77af3dded187821c83628 100644 --- a/app/code/Magento/Downloadable/view/frontend/layout/checkout_cart_configure_type_downloadable.xml +++ b/app/code/Magento/Downloadable/view/frontend/layout/checkout_cart_configure_type_downloadable.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="catalog_product_view_type_downloadable"/> <body/> </page> diff --git a/app/code/Magento/Downloadable/view/frontend/layout/checkout_cart_item_renderers.xml b/app/code/Magento/Downloadable/view/frontend/layout/checkout_cart_item_renderers.xml index 946ae2be3d8fd6997369e7481bd897887d8b2357..3f27dd6c3820fc10480afa1a6001ad7f474cb207 100644 --- a/app/code/Magento/Downloadable/view/frontend/layout/checkout_cart_item_renderers.xml +++ b/app/code/Magento/Downloadable/view/frontend/layout/checkout_cart_item_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout.cart.item.renderers"> <block class="Magento\Downloadable\Block\Checkout\Cart\Item\Renderer" as="downloadable" template="Magento_Checkout::cart/item/default.phtml"> diff --git a/app/code/Magento/Downloadable/view/frontend/layout/checkout_onepage_review_item_renderers.xml b/app/code/Magento/Downloadable/view/frontend/layout/checkout_onepage_review_item_renderers.xml index cb28a3190d54c705316dfdd182b7f3b1773db147..838115018f8e786ef698853a267e3f18d19e3d73 100644 --- a/app/code/Magento/Downloadable/view/frontend/layout/checkout_onepage_review_item_renderers.xml +++ b/app/code/Magento/Downloadable/view/frontend/layout/checkout_onepage_review_item_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout.onepage.review.item.renderers"> <block class="Magento\Downloadable\Block\Checkout\Cart\Item\Renderer" as="downloadable" template="Magento_Checkout::onepage/review/item.phtml"/> diff --git a/app/code/Magento/Downloadable/view/frontend/layout/checkout_onepage_success.xml b/app/code/Magento/Downloadable/view/frontend/layout/checkout_onepage_success.xml index 51081a278458ad604e8529975fe9c66cc6038490..d75eb426519ea7a274259a9527c852e352180002 100644 --- a/app/code/Magento/Downloadable/view/frontend/layout/checkout_onepage_success.xml +++ b/app/code/Magento/Downloadable/view/frontend/layout/checkout_onepage_success.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout.success"> <block class="Magento\Downloadable\Block\Checkout\Success" name="downloadable.checkout.success" template="checkout/success.phtml"/> diff --git a/app/code/Magento/Downloadable/view/frontend/layout/customer_account.xml b/app/code/Magento/Downloadable/view/frontend/layout/customer_account.xml index 00fa920de648e8be63df65e8dbb53343aa645b6f..481137de5c091141786910c88cac5a62a91d757b 100644 --- a/app/code/Magento/Downloadable/view/frontend/layout/customer_account.xml +++ b/app/code/Magento/Downloadable/view/frontend/layout/customer_account.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="customer_account_navigation"> <block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-navigation-downloadable-products-link"> diff --git a/app/code/Magento/Downloadable/view/frontend/layout/downloadable_customer_products.xml b/app/code/Magento/Downloadable/view/frontend/layout/downloadable_customer_products.xml index a4715c36a418463a8dffed41096fa49780b2910a..d605fe483e8db1fdaf763611ac0f776ef4fd0b95 100644 --- a/app/code/Magento/Downloadable/view/frontend/layout/downloadable_customer_products.xml +++ b/app/code/Magento/Downloadable/view/frontend/layout/downloadable_customer_products.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="customer_account"/> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/Downloadable/view/frontend/layout/multishipping_checkout_success.xml b/app/code/Magento/Downloadable/view/frontend/layout/multishipping_checkout_success.xml index 3c252ffe2bcbf8f2c81d8ac0905ac2721aaa03ba..3d279025357f94f51933ff8256a3908e5ee956fb 100644 --- a/app/code/Magento/Downloadable/view/frontend/layout/multishipping_checkout_success.xml +++ b/app/code/Magento/Downloadable/view/frontend/layout/multishipping_checkout_success.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout_success"> <block class="Magento\Downloadable\Block\Checkout\Success" name="downloadable.checkout.success" template="checkout/success.phtml"/> diff --git a/app/code/Magento/Downloadable/view/frontend/layout/sales_email_order_creditmemo_renderers.xml b/app/code/Magento/Downloadable/view/frontend/layout/sales_email_order_creditmemo_renderers.xml index e285a09b82753d54bc9bc1610d37e0464c1a1749..2fded9011b4fb929eed3ba1d29dba3164c4d55e9 100644 --- a/app/code/Magento/Downloadable/view/frontend/layout/sales_email_order_creditmemo_renderers.xml +++ b/app/code/Magento/Downloadable/view/frontend/layout/sales_email_order_creditmemo_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="sales.email.order.creditmemo.renderers"> <block class="Magento\Downloadable\Block\Sales\Order\Email\Items\Downloadable" as="downloadable" template="email/order/items/creditmemo/downloadable.phtml"/> diff --git a/app/code/Magento/Downloadable/view/frontend/layout/sales_email_order_invoice_renderers.xml b/app/code/Magento/Downloadable/view/frontend/layout/sales_email_order_invoice_renderers.xml index 7afbaefd60e76a2dc62a25785dee00bd2eb6236b..95d45c05c066f5c80ac48f574041605ac69a1f26 100644 --- a/app/code/Magento/Downloadable/view/frontend/layout/sales_email_order_invoice_renderers.xml +++ b/app/code/Magento/Downloadable/view/frontend/layout/sales_email_order_invoice_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="sales.email.order.invoice.renderers"> <block class="Magento\Downloadable\Block\Sales\Order\Email\Items\Downloadable" as="downloadable" template="email/order/items/invoice/downloadable.phtml"/> diff --git a/app/code/Magento/Downloadable/view/frontend/layout/sales_email_order_renderers.xml b/app/code/Magento/Downloadable/view/frontend/layout/sales_email_order_renderers.xml index f9650e8c02d4431a80938276ae610813ec05d9ef..a0230af9dbb9e34c3683fed632a43b5d2fbacaa5 100644 --- a/app/code/Magento/Downloadable/view/frontend/layout/sales_email_order_renderers.xml +++ b/app/code/Magento/Downloadable/view/frontend/layout/sales_email_order_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="sales.email.order.renderers"> <block class="Magento\Downloadable\Block\Sales\Order\Email\Items\Order\Downloadable" as="downloadable" template="email/order/items/order/downloadable.phtml"/> diff --git a/app/code/Magento/Downloadable/view/frontend/layout/sales_order_creditmemo_renderers.xml b/app/code/Magento/Downloadable/view/frontend/layout/sales_order_creditmemo_renderers.xml index bee4bf89d67321a9985134621ea859ca1c195dc6..38e78c7744d402bd611048ec32195952cf4ad70f 100644 --- a/app/code/Magento/Downloadable/view/frontend/layout/sales_order_creditmemo_renderers.xml +++ b/app/code/Magento/Downloadable/view/frontend/layout/sales_order_creditmemo_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="sales.order.creditmemo.renderers"> <block class="Magento\Downloadable\Block\Sales\Order\Item\Renderer\Downloadable" as="downloadable" template="sales/order/creditmemo/items/renderer/downloadable.phtml"/> diff --git a/app/code/Magento/Downloadable/view/frontend/layout/sales_order_invoice_renderers.xml b/app/code/Magento/Downloadable/view/frontend/layout/sales_order_invoice_renderers.xml index 295596b6faccabf2c154627053f02c1af244cbe7..5d26c0b4a53c80012f1dc42a279cc26ba46929df 100644 --- a/app/code/Magento/Downloadable/view/frontend/layout/sales_order_invoice_renderers.xml +++ b/app/code/Magento/Downloadable/view/frontend/layout/sales_order_invoice_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="sales.order.invoice.renderers"> <block class="Magento\Downloadable\Block\Sales\Order\Item\Renderer\Downloadable" as="downloadable" template="sales/order/invoice/items/renderer/downloadable.phtml"/> diff --git a/app/code/Magento/Downloadable/view/frontend/layout/sales_order_item_renderers.xml b/app/code/Magento/Downloadable/view/frontend/layout/sales_order_item_renderers.xml index 7d1688cede5ff797362ea84cc7bf775aa2eb5711..b0b1c20fe76ebb7f0676c28f57c5d57f299a8f9b 100644 --- a/app/code/Magento/Downloadable/view/frontend/layout/sales_order_item_renderers.xml +++ b/app/code/Magento/Downloadable/view/frontend/layout/sales_order_item_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="sales.order.items.renderers"> <block class="Magento\Downloadable\Block\Sales\Order\Item\Renderer\Downloadable" as="downloadable" template="sales/order/items/renderer/downloadable.phtml"/> diff --git a/app/code/Magento/Downloadable/view/frontend/layout/sales_order_print_creditmemo_renderers.xml b/app/code/Magento/Downloadable/view/frontend/layout/sales_order_print_creditmemo_renderers.xml index e7cf62f251db103ed4a8f7dfc7aea1f1a9ed01cc..330288daf2564721fc58d78b2bb5313dd5d0ab98 100644 --- a/app/code/Magento/Downloadable/view/frontend/layout/sales_order_print_creditmemo_renderers.xml +++ b/app/code/Magento/Downloadable/view/frontend/layout/sales_order_print_creditmemo_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="sales.order.print.creditmemo.renderers"> <block class="Magento\Downloadable\Block\Sales\Order\Item\Renderer\Downloadable" as="downloadable" template="sales/order/creditmemo/items/renderer/downloadable.phtml"/> diff --git a/app/code/Magento/Downloadable/view/frontend/layout/sales_order_print_invoice_renderers.xml b/app/code/Magento/Downloadable/view/frontend/layout/sales_order_print_invoice_renderers.xml index ebeab93c8dbe6e094bf1a6256e62f82026d26dac..c746c5c633978cf938ebb03f0abc5976ac79ee18 100644 --- a/app/code/Magento/Downloadable/view/frontend/layout/sales_order_print_invoice_renderers.xml +++ b/app/code/Magento/Downloadable/view/frontend/layout/sales_order_print_invoice_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="sales.order.print.invoice.renderers"> <block class="Magento\Downloadable\Block\Sales\Order\Item\Renderer\Downloadable" as="downloadable" template="sales/order/invoice/items/renderer/downloadable.phtml"/> diff --git a/app/code/Magento/Downloadable/view/frontend/layout/sales_order_print_renderers.xml b/app/code/Magento/Downloadable/view/frontend/layout/sales_order_print_renderers.xml index 4b4e2fb1fe1e7e34abd19793b0910525fb6882df..488c46352404b76a9e915db059bbbb8a3f5667e9 100644 --- a/app/code/Magento/Downloadable/view/frontend/layout/sales_order_print_renderers.xml +++ b/app/code/Magento/Downloadable/view/frontend/layout/sales_order_print_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="sales.order.print.renderers"> <block class="Magento\Downloadable\Block\Sales\Order\Item\Renderer\Downloadable" as="downloadable" template="sales/order/items/renderer/downloadable.phtml"/> diff --git a/app/code/Magento/DownloadableImportExport/composer.json b/app/code/Magento/DownloadableImportExport/composer.json index 6d79b90effd59403d1541c5e68d3e26950faa424..4bfa578ff8b5333214dbd2d0cfa435c0eb4cac6f 100644 --- a/app/code/Magento/DownloadableImportExport/composer.json +++ b/app/code/Magento/DownloadableImportExport/composer.json @@ -9,8 +9,7 @@ "magento/module-downloadable": "1.0.0-beta", "magento/module-store": "1.0.0-beta", "magento/module-eav": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -18,12 +17,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/DownloadableImportExport" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\DownloadableImportExport\\": "" + } } } diff --git a/app/code/Magento/DownloadableImportExport/etc/import.xml b/app/code/Magento/DownloadableImportExport/etc/import.xml index fcce279dd795d26187a5867c5118f5479034e413..b3b030e71009ec87bd175f78a8afa6c063b89243 100644 --- a/app/code/Magento/DownloadableImportExport/etc/import.xml +++ b/app/code/Magento/DownloadableImportExport/etc/import.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../ImportExport/etc/import.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_ImportExport:etc/import.xsd"> <entityType entity="catalog_product" name="downloadable" model="Magento\DownloadableImportExport\Model\Import\Product\Type\Downloadable" /> -</config> \ No newline at end of file +</config> diff --git a/app/code/Magento/DownloadableImportExport/etc/module.xml b/app/code/Magento/DownloadableImportExport/etc/module.xml index 83e3f829921dc0e6df329341eb43afe4b656f1da..57ccfc28e335e2fe525fdb59e700878ca66deb89 100644 --- a/app/code/Magento/DownloadableImportExport/etc/module.xml +++ b/app/code/Magento/DownloadableImportExport/etc/module.xml @@ -5,7 +5,8 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_DownloadableImportExport" setup_version="2.0.0"> <sequence> <module name="Magento_ImportExport"/> diff --git a/app/code/Magento/DownloadableImportExport/registration.php b/app/code/Magento/DownloadableImportExport/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..a29186f647ea5f4b074d78b4f7d93ff3877d9dd8 --- /dev/null +++ b/app/code/Magento/DownloadableImportExport/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_DownloadableImportExport', + __DIR__ +); diff --git a/app/code/Magento/Eav/Model/Entity/AbstractEntity.php b/app/code/Magento/Eav/Model/Entity/AbstractEntity.php index 3fe074ac1c61fb74d5cfbdcdd7ebb4017f7bae57..2f222e7dabc88a4f56494c445a5340c3200d1057 100644 --- a/app/code/Magento/Eav/Model/Entity/AbstractEntity.php +++ b/app/code/Magento/Eav/Model/Entity/AbstractEntity.php @@ -224,7 +224,6 @@ abstract class AbstractEntity extends AbstractResource implements EntityInterfac /** * Set connections for entity operations * - * @deprecated * @param \Magento\Framework\DB\Adapter\AdapterInterface|string $connection * @return $this * @codeCoverageIgnore diff --git a/app/code/Magento/Eav/Model/Entity/Attribute/Config/SchemaLocator.php b/app/code/Magento/Eav/Model/Entity/Attribute/Config/SchemaLocator.php index 9b37dcbd61f6bddc240358c96bd1a4327892a9aa..2eeb2776f6019e316c263eb5d60541b954185d4d 100644 --- a/app/code/Magento/Eav/Model/Entity/Attribute/Config/SchemaLocator.php +++ b/app/code/Magento/Eav/Model/Entity/Attribute/Config/SchemaLocator.php @@ -7,6 +7,8 @@ */ namespace Magento\Eav\Model\Entity\Attribute\Config; +use Magento\Framework\Module\Dir; + class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface { /** @@ -22,7 +24,7 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface */ public function __construct(\Magento\Framework\Module\Dir\Reader $moduleReader) { - $this->_schema = $moduleReader->getModuleDir('etc', 'Magento_Eav') . '/eav_attributes.xsd'; + $this->_schema = $moduleReader->getModuleDir(Dir::MODULE_ETC_DIR, 'Magento_Eav') . '/eav_attributes.xsd'; } /** diff --git a/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Config/XsdTest.php b/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Config/XsdTest.php index 132ef93cfb60dba822e42fb8b62846b43fd68d85..f40245fca6bbcc35d895bad271f773250f55a994 100644 --- a/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Config/XsdTest.php +++ b/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Config/XsdTest.php @@ -14,13 +14,14 @@ class XsdTest extends \PHPUnit_Framework_TestCase protected $_xsdSchema; /** - * @var \Magento\TestFramework\Utility\XsdValidator + * @var \Magento\Framework\TestFramework\Unit\Utility\XsdValidator */ protected $_xsdValidator; protected function setUp() { - $this->_xsdSchema = BP . '/app/code/Magento/Eav/etc/eav_attributes.xsd'; + $urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + $this->_xsdSchema = $urnResolver->getRealPath('urn:magento:module:Magento_Eav:etc/eav_attributes.xsd'); $this->_xsdValidator = new \Magento\Framework\TestFramework\Unit\Utility\XsdValidator(); } diff --git a/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Config/_files/eav_attributes.xml b/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Config/_files/eav_attributes.xml index 0c0800c25477f3635a7363ece1f01eb39652ab0a..54d2de6c6eb914150eb4a318c8c100e1a9ab3f0a 100644 --- a/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Config/_files/eav_attributes.xml +++ b/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Config/_files/eav_attributes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../app/code/Magento/Eav/etc/eav_attributes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Eav:etc/eav_attributes.xsd"> <entity type="type_one"> <attribute code="code_one"> <field code="code_one_one" locked="true" /> diff --git a/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Config/_files/invalidEavAttributeXmlArray.php b/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Config/_files/invalidEavAttributeXmlArray.php index d12744e7683240b0c6d329e4b5a81d5bd4835d24..3a3b330edffa1de69ba5f897ab19281cfe2f8431 100644 --- a/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Config/_files/invalidEavAttributeXmlArray.php +++ b/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Config/_files/invalidEavAttributeXmlArray.php @@ -6,41 +6,44 @@ return [ 'config_only_with_entity_node' => [ '<?xml version="1.0"?><config><entity type="type_one" /></config>', - ["Element 'entity': Missing child element(s). Expected is ( attribute )."], + ["Element 'entity': Missing child element(s). Expected is ( attribute ).\nLine: 1\n"], ], 'field_code_must_be_unique' => [ '<?xml version="1.0"?><config><entity type="type_one"><attribute code="code_one"><field code="code_one_one" ' . 'locked="true" /><field code="code_one_one" locked="true" /></attribute></entity></config>', [ "Element 'field': Duplicate key-sequence ['code_one_one'] in unique identity-constraint " . - "'uniqueFieldCode'." + "'uniqueFieldCode'.\nLine: 1\n" ], ], 'type_attribute_is_required' => [ '<?xml version="1.0"?><config><entity><attribute code="code_one"><field code="code_one_one" ' . 'locked="true" /></attribute></entity></config>', - ["Element 'entity': The attribute 'type' is required but missing."], + ["Element 'entity': The attribute 'type' is required but missing.\nLine: 1\n"], ], 'attribute_without_required_attributes' => [ '<?xml version="1.0"?><config><entity type="name"><attribute><field code="code_one_one" ' . 'locked="true" /></attribute></entity></config>', - ["Element 'attribute': The attribute 'code' is required but missing."], + ["Element 'attribute': The attribute 'code' is required but missing.\nLine: 1\n"], ], 'field_node_without_required_attributes' => [ '<?xml version="1.0"?><config><entity type="name"><attribute code="code"><field code="code_one_one" />' . '<field locked="true"/></attribute></entity></config>', [ - "Element 'field': The attribute 'locked' is required but missing.", - "Element 'field': The attribute " . "'code' is required but missing." + "Element 'field': The attribute 'locked' is required but missing.\nLine: 1\n", + "Element 'field': The attribute " . "'code' is required but missing.\nLine: 1\n" ], ], 'locked_attribute_with_invalid_value' => [ '<?xml version="1.0"?><config><entity type="name"><attribute code="code"><field code="code_one" locked="7" />' . '<field code="code_one" locked="one_one" /></attribute></entity></config>', [ - "Element 'field', attribute 'locked': '7' is not a valid value of the atomic type 'xs:boolean'.", - "Element 'field', attribute 'locked': 'one_one' is not a valid value of the atomic type 'xs:boolean'.", - "Element 'field': Duplicate key-sequence ['code_one'] in unique identity-constraint 'uniqueFieldCode'." + "Element 'field', attribute 'locked': '7' is not a valid value of the atomic type" . + " 'xs:boolean'.\nLine: 1\n", + "Element 'field', attribute 'locked': 'one_one' is not a valid value of the atomic type" . + " 'xs:boolean'.\nLine: 1\n", + "Element 'field': Duplicate key-sequence ['code_one'] in unique identity-constraint" . + " 'uniqueFieldCode'.\nLine: 1\n" ], ], 'attribute_with_type_identifierType_with_invalid_value' => [ @@ -48,25 +51,25 @@ return [ 'locked="true" /><field code="code::one" locked="false" /></attribute></entity></config>', [ "Element 'entity', attribute 'type': [facet 'pattern'] The value 'Name' is not accepted by the pattern " . - "'[a-z_]+'.", + "'[a-z_]+'.\nLine: 1\n", "Element 'entity', attribute 'type': 'Name' is not a valid value of the atomic type " . - "'identifierType'.", + "'identifierType'.\nLine: 1\n", "Element 'entity', attribute 'type': Warning: No precomputed value available, the value" . - " was either invalid or something strange happend.", + " was either invalid or something strange happend.\nLine: 1\n", "Element 'attribute', attribute 'code': [facet " . - "'pattern'] The value 'code1' is not accepted by the pattern '[a-z_]+'.", + "'pattern'] The value 'code1' is not accepted by the pattern '[a-z_]+'.\nLine: 1\n", "Element 'attribute', attribute " . - "'code': 'code1' is not a valid value of the atomic type 'identifierType'.", + "'code': 'code1' is not a valid value of the atomic type 'identifierType'.\nLine: 1\n", "Element 'attribute', attribute " . "'code': Warning: No precomputed value available, " . - "the value was either invalid or something strange happend.", + "the value was either invalid or something strange happend.\nLine: 1\n", "Element 'field', attribute 'code': [facet 'pattern'] " . "The value 'code::one' is not accepted by the pattern '" . - "[a-z_]+'.", + "[a-z_]+'.\nLine: 1\n", "Element 'field', attribute 'code': 'code::one' is not a valid value of the atomic type " . - "'identifierType'.", + "'identifierType'.\nLine: 1\n", "Element 'field', attribute 'code': Warning: No precomputed value available, the value " . - "was either invalid or something strange happend." + "was either invalid or something strange happend.\nLine: 1\n" ], ] ]; diff --git a/app/code/Magento/Eav/composer.json b/app/code/Magento/Eav/composer.json index 4922ae86c55dce016792220187a0fa8ffaa99cc3..32adf5a1b3a18c8203d370387fc8a9d244f7400b 100644 --- a/app/code/Magento/Eav/composer.json +++ b/app/code/Magento/Eav/composer.json @@ -8,8 +8,7 @@ "magento/module-catalog": "1.0.0-beta", "magento/module-config": "1.0.0-beta", "magento/module-media-storage": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -17,12 +16,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Eav" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Eav\\": "" + } } } diff --git a/app/code/Magento/Eav/etc/cache.xml b/app/code/Magento/Eav/etc/cache.xml index 15b9e22562578bdc3b8788d6aba693aee51e728c..ee07b5b75cc1c233c2c8f998174cd8e3fc4f7f59 100644 --- a/app/code/Magento/Eav/etc/cache.xml +++ b/app/code/Magento/Eav/etc/cache.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Cache/etc/cache.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Cache/etc/cache.xsd"> <type name="eav" translate="label,description" instance="Magento\Eav\Model\Cache\Type"> <label>EAV types and attributes</label> <description>Entity types declaration cache.</description> diff --git a/app/code/Magento/Eav/etc/config.xml b/app/code/Magento/Eav/etc/config.xml index d6b5873aaf92e121cf985d6d1ad03f42c16e55ff..b74ab55e665f97d2cad9443a465aeaaf48904a92 100644 --- a/app/code/Magento/Eav/etc/config.xml +++ b/app/code/Magento/Eav/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <general> <validator_data> diff --git a/app/code/Magento/Eav/etc/di.xml b/app/code/Magento/Eav/etc/di.xml index 00524114f784dd3bc859a8395a9c1d23012433cc..3f3be1dddf79af28883c47666346e206ef231a92 100644 --- a/app/code/Magento/Eav/etc/di.xml +++ b/app/code/Magento/Eav/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Eav\Model\Entity\Setup\PropertyMapperInterface" type="Magento\Eav\Model\Entity\Setup\PropertyMapper\Composite" /> <preference for="Magento\Eav\Api\Data\AttributeInterface" type="Magento\Eav\Model\Entity\Attribute" /> <preference for="Magento\Eav\Api\AttributeRepositoryInterface" type="Magento\Eav\Model\AttributeRepository" /> diff --git a/app/code/Magento/Eav/etc/module.xml b/app/code/Magento/Eav/etc/module.xml index c4b4e458bd89df75bbe667371a54c90867752df2..c983f957d5d3a977b84cd927de8b64545c1fa031 100644 --- a/app/code/Magento/Eav/etc/module.xml +++ b/app/code/Magento/Eav/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Eav" setup_version="2.0.0"> <sequence> <module name="Magento_Store"/> diff --git a/app/code/Magento/Eav/etc/validation.xml b/app/code/Magento/Eav/etc/validation.xml index 3b471f8adc0db64f6434822c28f37b59f7e552fa..8be30155696519f370b08a69e522698a6f7abcf7 100644 --- a/app/code/Magento/Eav/etc/validation.xml +++ b/app/code/Magento/Eav/etc/validation.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<validation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Validator/etc/validation.xsd"> +<validation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Validator/etc/validation.xsd"> <entity name="eav_entity"> <rules> <rule name="eav_attribute_data"> diff --git a/app/code/Magento/Eav/etc/webapi.xml b/app/code/Magento/Eav/etc/webapi.xml index bb5bd767dc8fad16cc1ec95fc814174777cdae55..a9913db530a087f5df0053d3f6302a9d207dd06a 100644 --- a/app/code/Magento/Eav/etc/webapi.xml +++ b/app/code/Magento/Eav/etc/webapi.xml @@ -6,7 +6,7 @@ */ --> <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../app/code/Magento/Webapi/etc/webapi.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd"> <route url="/V1/eav/attribute-sets/list" method="GET"> <service class="Magento\Eav\Api\AttributeSetRepositoryInterface" method="getList"/> <resources> diff --git a/app/code/Magento/Eav/registration.php b/app/code/Magento/Eav/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..d4a9f06f65ba63d6957d5e60a92fdd54d2653e70 --- /dev/null +++ b/app/code/Magento/Eav/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Eav', + __DIR__ +); diff --git a/app/code/Magento/Email/Model/Template/Config.php b/app/code/Magento/Email/Model/Template/Config.php index 1fb2a86a6ba2a299885b7004ce5ab219427f0b58..f2ffafbcf6b09792f499852dc6b37ab4a9d24f0d 100644 --- a/app/code/Magento/Email/Model/Template/Config.php +++ b/app/code/Magento/Email/Model/Template/Config.php @@ -7,7 +7,8 @@ */ namespace Magento\Email\Model\Template; -use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Filesystem\Directory\ReadFactory; +use Magento\Framework\View\Design\Theme\ThemePackageList; class Config implements \Magento\Framework\Mail\Template\ConfigInterface { @@ -27,33 +28,39 @@ class Config implements \Magento\Framework\Mail\Template\ConfigInterface protected $fileSystem; /** - * Themes directory - * - * @var \Magento\Framework\Filesystem\Directory\ReadInterface + * @var \Magento\Framework\View\FileSystem */ - protected $themesDirectory; + protected $viewFileSystem; /** - * @var \Magento\Framework\View\FileSystem + * @var ReadFactory */ - protected $viewFileSystem; + private $readDirFactory; + + /** + * @var ThemePackageList + */ + private $themePackages; /** * @param \Magento\Email\Model\Template\Config\Data $dataStorage - * @param \Magento\Framework\Filesystem $fileSystem * @param \Magento\Framework\Module\Dir\Reader $moduleReader * @param \Magento\Framework\View\FileSystem $viewFileSystem + * @param ThemePackageList $themePackages + * @param ReadFactory $readDirFactory */ public function __construct( \Magento\Email\Model\Template\Config\Data $dataStorage, \Magento\Framework\Module\Dir\Reader $moduleReader, - \Magento\Framework\Filesystem $fileSystem, - \Magento\Framework\View\FileSystem $viewFileSystem + \Magento\Framework\View\FileSystem $viewFileSystem, + ThemePackageList $themePackages, + ReadFactory $readDirFactory ) { $this->_dataStorage = $dataStorage; $this->_moduleReader = $moduleReader; - $this->themesDirectory = $fileSystem->getDirectoryRead(DirectoryList::THEMES); $this->viewFileSystem = $viewFileSystem; + $this->themePackages = $themePackages; + $this->readDirFactory = $readDirFactory; } /** @@ -87,36 +94,33 @@ class Config implements \Magento\Framework\Mail\Template\ConfigInterface $templates = []; $area = $this->getTemplateArea($templateId); - $themePath = '*/*'; $module = $this->getTemplateModule($templateId); $filename = $this->_getInfo($templateId, 'file'); - $searchPattern = "{$area}/{$themePath}/{$module}/email/{$filename}"; - $files = $this->themesDirectory->search($searchPattern); - $pattern = "#^(?<area>[^/]+)/(?<themeVendor>[^/]+)/(?<themeName>[^/]+)/#i"; - foreach ($files as $file) { - if (!preg_match($pattern, $file, $matches)) { - continue; + foreach ($this->themePackages->getThemes() as $theme) { + if ($theme->getArea() == $area) { + $themeDir = $this->readDirFactory->create($theme->getPath()); + $file = "$module/email/$filename"; + if ($themeDir->isExist($file)) { + $templates[] = [ + 'value' => sprintf( + '%s/%s/%s', + $templateId, + $theme->getVendor(), + $theme->getName() + ), + 'label' => sprintf( + '%s (%s/%s)', + $this->getTemplateLabel($templateId), + $theme->getVendor(), + $theme->getName() + ), + 'group' => $this->getTemplateModule($templateId), + ]; + } } - $themeVendor = $matches['themeVendor']; - $themeName = $matches['themeName']; - - $templates[] = [ - 'value' => sprintf( - '%s/%s/%s', - $templateId, - $themeVendor, - $themeName - ), - 'label' => sprintf( - '%s (%s/%s)', - $this->getTemplateLabel($templateId), - $themeVendor, - $themeName - ), - 'group' => $this->getTemplateModule($templateId), - ]; } + return $templates; } diff --git a/app/code/Magento/Email/Model/Template/Config/FileIterator.php b/app/code/Magento/Email/Model/Template/Config/FileIterator.php index b30608ca2e49328d82aa4d6f5fcadc5f04608721..2b352900762193ea787824c1ede67cfe3dd4c571 100644 --- a/app/code/Magento/Email/Model/Template/Config/FileIterator.php +++ b/app/code/Magento/Email/Model/Template/Config/FileIterator.php @@ -6,6 +6,9 @@ */ namespace Magento\Email\Model\Template\Config; +use Magento\Framework\Filesystem\DriverPool; +use Magento\Framework\Filesystem\File\ReadFactory; + /** * Class FileIterator */ @@ -17,16 +20,16 @@ class FileIterator extends \Magento\Framework\Config\FileIterator protected $_moduleDirResolver; /** - * @param \Magento\Framework\Filesystem\Directory\ReadInterface $directory + * @param ReadFactory $readFactory * @param array $paths * @param \Magento\Framework\Module\Dir\ReverseResolver $dirResolver */ public function __construct( - \Magento\Framework\Filesystem\Directory\ReadInterface $directory, + ReadFactory $readFactory, array $paths, \Magento\Framework\Module\Dir\ReverseResolver $dirResolver ) { - parent::__construct($directory, $paths); + parent::__construct($readFactory, $paths); $this->_moduleDirResolver = $dirResolver; } @@ -36,14 +39,17 @@ class FileIterator extends \Magento\Framework\Config\FileIterator */ public function current() { - $path = $this->directoryRead->getAbsolutePath($this->key()); + $path = $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 = $this->directoryRead->readFile($this->key()); + + /** @var \Magento\Framework\Filesystem\File\Read $fileRead */ + $fileRead = $this->fileReadFactory->create($this->key(), DriverPool::FILE); + $contents = $fileRead->readAll(); 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 5d4ab59e7cf1f06e94dd517d9d6d90122b2c89df..a5a67c3841e41844fb1ec9735c77dc5ae1200c28 100644 --- a/app/code/Magento/Email/Model/Template/Config/FileResolver.php +++ b/app/code/Magento/Email/Model/Template/Config/FileResolver.php @@ -7,31 +7,34 @@ */ namespace Magento\Email\Model\Template\Config; -use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\DirSearch; use Magento\Framework\Config\FileIteratorFactory; class FileResolver implements \Magento\Framework\Config\FileResolverInterface { /** - * @var \Magento\Framework\Filesystem\Directory\ReadInterface + * @var \Magento\Framework\Config\FileIteratorFactory */ - protected $directoryRead; + protected $iteratorFactory; /** - * @var \Magento\Framework\Config\FileIteratorFactory + * @var DirSearch */ - protected $iteratorFactory; + protected $dirSearch; /** - * @param \Magento\Framework\Filesystem $filesystem - * @param \Magento\Framework\Config\FileIteratorFactory $iteratorFactory + * Constructor + * + * @param FileIteratorFactory $iteratorFactory + * @param DirSearch $dirSearch */ public function __construct( - \Magento\Framework\Filesystem $filesystem, - FileIteratorFactory $iteratorFactory + FileIteratorFactory $iteratorFactory, + DirSearch $dirSearch ) { - $this->directoryRead = $filesystem->getDirectoryRead(DirectoryList::MODULES); $this->iteratorFactory = $iteratorFactory; + $this->dirSearch = $dirSearch; } /** @@ -40,8 +43,7 @@ class FileResolver implements \Magento\Framework\Config\FileResolverInterface public function get($filename, $scope) { $iterator = $this->iteratorFactory->create( - $this->directoryRead, - $this->directoryRead->search('/*/*/etc/' . $filename) + $this->dirSearch->collectFiles(ComponentRegistrar::MODULE, 'etc/' . $filename) ); return $iterator; } diff --git a/app/code/Magento/Email/Model/Template/Config/SchemaLocator.php b/app/code/Magento/Email/Model/Template/Config/SchemaLocator.php index e0f9a696b835a0469d1fb5014c9b0535d8c900e0..69599018c9f24eadf0e05fed381077492ce8f434 100644 --- a/app/code/Magento/Email/Model/Template/Config/SchemaLocator.php +++ b/app/code/Magento/Email/Model/Template/Config/SchemaLocator.php @@ -7,6 +7,8 @@ */ namespace Magento\Email\Model\Template\Config; +use Magento\Framework\Module\Dir; + class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface { /** @@ -21,7 +23,7 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface */ public function __construct(\Magento\Framework\Module\Dir\Reader $moduleReader) { - $this->_schema = $moduleReader->getModuleDir('etc', 'Magento_Email') . '/email_templates.xsd'; + $this->_schema = $moduleReader->getModuleDir(Dir::MODULE_ETC_DIR, 'Magento_Email') . '/email_templates.xsd'; } /** diff --git a/app/code/Magento/Email/Test/Unit/Model/Template/Config/FileIteratorTest.php b/app/code/Magento/Email/Test/Unit/Model/Template/Config/FileIteratorTest.php index de3c7dc4cf4b5074853338be79d9df52ccfed04c..7c42a918f5f9e4b72b5946b2fb71b60544c96558 100644 --- a/app/code/Magento/Email/Test/Unit/Model/Template/Config/FileIteratorTest.php +++ b/app/code/Magento/Email/Test/Unit/Model/Template/Config/FileIteratorTest.php @@ -18,9 +18,14 @@ class FileIteratorTest extends \PHPUnit_Framework_TestCase protected $fileIterator; /** - * @var \Magento\Framework\Filesystem\Directory\Read | \PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\Filesystem\File\ReadFactory | \PHPUnit_Framework_MockObject_MockObject */ - protected $directoryMock; + protected $fileReadFactory; + + /** + * @var \Magento\Framework\Filesystem\File\Read | \PHPUnit_Framework_MockObject_MockObject + */ + protected $fileRead; /** * @var \Magento\Framework\Module\Dir\ReverseResolver | \PHPUnit_Framework_MockObject_MockObject @@ -36,8 +41,9 @@ class FileIteratorTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->filePaths = ['/file1', '/file2']; - $this->directoryMock = $this->getMock('Magento\Framework\Filesystem\Directory\Read', [], [], '', false); + $this->filePaths = ['directory/path/file1', 'directory/path/file2']; + $this->fileReadFactory = $this->getMock('Magento\Framework\Filesystem\File\ReadFactory', [], [], '', false); + $this->fileRead = $this->getMock('Magento\Framework\Filesystem\File\Read', [], [], '', false); $this->moduleDirResolverMock = $this->getMock( 'Magento\Framework\Module\Dir\ReverseResolver', [], @@ -47,7 +53,7 @@ class FileIteratorTest extends \PHPUnit_Framework_TestCase ); $this->fileIterator = new \Magento\Email\Model\Template\Config\FileIterator( - $this->directoryMock, + $this->fileReadFactory, $this->filePaths, $this->moduleDirResolverMock ); @@ -56,7 +62,6 @@ class FileIteratorTest extends \PHPUnit_Framework_TestCase protected function tearDown() { $this->fileIterator = null; - $this->directoryMock = null; $this->filePaths = null; $this->moduleDirResolverMock = null; } @@ -69,21 +74,19 @@ class FileIteratorTest extends \PHPUnit_Framework_TestCase '<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) + ->with($filePath) ->will($this->returnValue($moduleName)); - $this->directoryMock->expects($this->at($dirIndex++)) - ->method('readFile') + $this->fileReadFactory->expects($this->at($dirIndex)) + ->method('create') ->with($filePath) + ->willReturn($this->fileRead); + $this->fileRead->expects($this->at($dirIndex++)) + ->method('readAll') ->will($this->returnValue($contents[$index++])); } $index = 0; @@ -94,7 +97,6 @@ class FileIteratorTest extends \PHPUnit_Framework_TestCase public function testIteratorNegative() { - $directoryPath = 'directory/path'; $filePath = $this->filePaths[0]; $this->setExpectedException( @@ -102,16 +104,12 @@ class FileIteratorTest extends \PHPUnit_Framework_TestCase 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) + ->with($filePath) ->will($this->returnValue(false)); - $this->directoryMock->expects($this->never()) - ->method('readFile'); + $this->fileReadFactory->expects($this->never())->method('create'); + $this->fileRead->expects($this->never())->method('readAll'); $this->fileIterator->current(); } diff --git a/app/code/Magento/Email/Test/Unit/Model/Template/Config/FileResolverTest.php b/app/code/Magento/Email/Test/Unit/Model/Template/Config/FileResolverTest.php new file mode 100644 index 0000000000000000000000000000000000000000..a76b87762bfccf62b96d4c83f8ad939afc262e64 --- /dev/null +++ b/app/code/Magento/Email/Test/Unit/Model/Template/Config/FileResolverTest.php @@ -0,0 +1,26 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Email\Test\Unit\Model\Template\Config; + +use Magento\Framework\Component\ComponentRegistrar; + +class FileResolverTest extends \PHPUnit_Framework_TestCase +{ + public function testGet() + { + $fileIteratorFactory = $this->getMock('\Magento\Framework\Config\FileIteratorFactory', [], [], '', false); + $dirSearch = $this->getMock('\Magento\Framework\Component\DirSearch', [], [], '', false); + $model = new \Magento\Email\Model\Template\Config\FileResolver($fileIteratorFactory, $dirSearch); + $expected = ['found_file']; + $fileIteratorFactory->expects($this->once()) + ->method('create') + ->will($this->returnValue($expected)); + $dirSearch->expects($this->once()) + ->method('collectFiles') + ->with(ComponentRegistrar::MODULE, 'etc/file'); + $model->get('file', 'scope'); + } +} diff --git a/app/code/Magento/Email/Test/Unit/Model/Template/Config/ReaderTest.php b/app/code/Magento/Email/Test/Unit/Model/Template/Config/ReaderTest.php index a34f568e5a78bc24e8249d678d127d39d78b979c..e572b67abee1ea3d2fad797cdd9f580cbb65a888 100644 --- a/app/code/Magento/Email/Test/Unit/Model/Template/Config/ReaderTest.php +++ b/app/code/Magento/Email/Test/Unit/Model/Template/Config/ReaderTest.php @@ -23,9 +23,9 @@ class ReaderTest extends \PHPUnit_Framework_TestCase protected $_moduleDirResolver; /** - * @var \Magento\Framework\Filesystem\Directory\Read|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\Filesystem\File\Read|\PHPUnit_Framework_MockObject_MockObject */ - protected $_filesystemDirectoryMock; + protected $read; /** * Paths to fixtures @@ -79,24 +79,18 @@ class ReaderTest extends \PHPUnit_Framework_TestCase '', false ); - $this->_filesystemDirectoryMock = $this->getMock( - '\Magento\Framework\Filesystem\Directory\Read', + $readFactory = $this->getMock( + '\Magento\Framework\Filesystem\File\ReadFactory', [], [], '', false ); - - $this->_filesystemDirectoryMock->expects( - $this->any() - )->method( - 'getAbsolutePath' - )->will( - $this->returnArgument(0) - ); + $this->read = $this->getMock('Magento\Framework\Filesystem\File\Read', [], [], '', false); + $readFactory->expects($this->any())->method('create')->willReturn($this->read); $fileIterator = new \Magento\Email\Model\Template\Config\FileIterator( - $this->_filesystemDirectoryMock, + $readFactory, $this->_paths, $this->_moduleDirResolver ); @@ -121,17 +115,17 @@ class ReaderTest extends \PHPUnit_Framework_TestCase public function testRead() { - $this->_filesystemDirectoryMock->expects( - $this->at(1) + $this->read->expects( + $this->at(0) )->method( - 'readFile' + 'readAll' )->will( $this->returnValue(file_get_contents($this->_paths[0])) ); - $this->_filesystemDirectoryMock->expects( - $this->at(3) + $this->read->expects( + $this->at(1) )->method( - 'readFile' + 'readAll' )->will( $this->returnValue(file_get_contents($this->_paths[1])) ); diff --git a/app/code/Magento/Email/Test/Unit/Model/Template/Config/XsdTest.php b/app/code/Magento/Email/Test/Unit/Model/Template/Config/XsdTest.php index 1f813288ae0a0ba73f24d4410eb509151f32564f..f2eb7b69f76d8bb955898f4adaf0f38d83716c1c 100644 --- a/app/code/Magento/Email/Test/Unit/Model/Template/Config/XsdTest.php +++ b/app/code/Magento/Email/Test/Unit/Model/Template/Config/XsdTest.php @@ -21,7 +21,8 @@ class XsdTest extends \PHPUnit_Framework_TestCase */ public function testMergedXml($fixtureXml, array $expectedErrors) { - $schemaFile = BP . '/app/code/Magento/Email/etc/email_templates.xsd'; + $urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + $schemaFile = $urnResolver->getRealPath('urn:magento:module:Magento_Email:etc/email_templates.xsd'); $this->_testXmlAgainstXsd($fixtureXml, $schemaFile, $expectedErrors); } diff --git a/app/code/Magento/Email/Test/Unit/Model/Template/Config/_files/Fixture/ModuleOne/etc/email_templates_one.xml b/app/code/Magento/Email/Test/Unit/Model/Template/Config/_files/Fixture/ModuleOne/etc/email_templates_one.xml index afbb22b473dd8bbd95bf8db7a58f5dd226f97797..01dd0fa732b1c27c4db42f0ecb01b7a3ddfae5d5 100644 --- a/app/code/Magento/Email/Test/Unit/Model/Template/Config/_files/Fixture/ModuleOne/etc/email_templates_one.xml +++ b/app/code/Magento/Email/Test/Unit/Model/Template/Config/_files/Fixture/ModuleOne/etc/email_templates_one.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../../app/code/Magento/Email/etc/email_templates.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Email:etc/email_templates.xsd"> <template id="template_one" label="Template One" file="one.html" type="html" area="frontend"/> <template id="template_two" label="Template Two" file="two.html" type="html" area="adminhtml" /> </config> diff --git a/app/code/Magento/Email/Test/Unit/Model/Template/Config/_files/Fixture/ModuleTwo/etc/email_templates_two.xml b/app/code/Magento/Email/Test/Unit/Model/Template/Config/_files/Fixture/ModuleTwo/etc/email_templates_two.xml index f01600200209b46bdfc401ac797fe9fa1d0bdea9..93af6285e57143b2d4096ece119655e8e365f61a 100644 --- a/app/code/Magento/Email/Test/Unit/Model/Template/Config/_files/Fixture/ModuleTwo/etc/email_templates_two.xml +++ b/app/code/Magento/Email/Test/Unit/Model/Template/Config/_files/Fixture/ModuleTwo/etc/email_templates_two.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../../app/code/Magento/Email/etc/email_templates.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Email:etc/email_templates.xsd"> <template id="template_two" label="Template 2" file="2.txt" type="text" area="adminhtml"/> </config> diff --git a/app/code/Magento/Email/Test/Unit/Model/Template/Config/_files/email_templates_merged.xml b/app/code/Magento/Email/Test/Unit/Model/Template/Config/_files/email_templates_merged.xml index 720981799154c59840520e236442969b12f690b1..5d13e3e0dcfa874fa875cd23562a3e5f39881766 100644 --- a/app/code/Magento/Email/Test/Unit/Model/Template/Config/_files/email_templates_merged.xml +++ b/app/code/Magento/Email/Test/Unit/Model/Template/Config/_files/email_templates_merged.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/Email/etc/email_templates.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Email:etc/email_templates.xsd"> <template module="Fixture_ModuleOne" id="template_one" label="Template One" file="one.html" type="html" area="frontend"/> <template module="Fixture_ModuleTwo" id="template_two" label="Template 2" file="2.txt" type="text" area="adminhtml"/> </config> diff --git a/app/code/Magento/Email/Test/Unit/Model/Template/ConfigTest.php b/app/code/Magento/Email/Test/Unit/Model/Template/ConfigTest.php index 9114dc48788617778f6b48b5433e2f37921532f9..1ee22f79f75d45b3d25c89eac4d2da1df27a9d45 100644 --- a/app/code/Magento/Email/Test/Unit/Model/Template/ConfigTest.php +++ b/app/code/Magento/Email/Test/Unit/Model/Template/ConfigTest.php @@ -5,6 +5,8 @@ */ namespace Magento\Email\Test\Unit\Model\Template; +use Magento\Email\Model\Template\Config; + class ConfigTest extends \PHPUnit_Framework_TestCase { private $designParams = [ @@ -15,9 +17,9 @@ class ConfigTest extends \PHPUnit_Framework_TestCase ]; /** - * @var \Magento\Email\Model\Template\Config|\PHPUnit_Framework_MockObject_MockObject + * @var Config */ - protected $_model; + private $model; /** * @var \Magento\Email\Model\Template\Config\Data|\PHPUnit_Framework_MockObject_MockObject @@ -35,9 +37,14 @@ class ConfigTest extends \PHPUnit_Framework_TestCase protected $viewFileSystem; /** - * @var \Magento\Framework\Filesystem|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\View\Design\Theme\ThemePackageList|\PHPUnit_Framework_MockObject_MockObject + */ + private $themePackages; + + /** + * @var \Magento\Framework\Filesystem\Directory\ReadFactory|\PHPUnit_Framework_MockObject_MockObject */ - protected $fileSystem; + private $readDirFactory; protected function setUp() { @@ -69,37 +76,75 @@ class ConfigTest extends \PHPUnit_Framework_TestCase '', false ); - $this->fileSystem = $this->getMock( - '\Magento\Framework\Filesystem', + $this->themePackages = $this->getMock( + '\Magento\Framework\View\Design\Theme\ThemePackageList', [], [], '', false ); - $this->_model = $this->getMockBuilder('\Magento\Email\Model\Template\Config') - ->setConstructorArgs( - [ - $this->_dataStorage, - $this->_moduleReader, - $this->fileSystem, - $this->viewFileSystem - ] - ) - ->setMethods(['getThemeTemplates']) - ->getMock(); + $this->readDirFactory = $this->getMock('Magento\Framework\Filesystem\Directory\ReadFactory', [], [], '', false); + $this->model = new Config( + $this->_dataStorage, + $this->_moduleReader, + $this->viewFileSystem, + $this->themePackages, + $this->readDirFactory + ); } public function testGetAvailableTemplates() { - $this->_model->expects($this->atLeastOnce()) - ->method('getThemeTemplates') - ->will($this->returnValue([])); + $templates = require __DIR__ . '/Config/_files/email_templates_merged.php'; - $expectedTemplates = require __DIR__ . '/Config/_files/email_templates_merged.php'; + $themes = []; + $i = 1; + foreach ($templates as $templateData) { + $theme = $this->getMock('\Magento\Framework\View\Design\Theme\ThemePackage', [], [], '', false); + $theme->expects($this->any()) + ->method('getArea') + ->willReturn($templateData['area']); + $theme->expects($this->any()) + ->method('getVendor') + ->willReturn('Vendor'); + $theme->expects($this->any()) + ->method('getName') + ->willReturn('custom_theme'); + $theme->expects($this->any()) + ->method('getPath') + ->willReturn('/theme/path'); + $themes[] = $theme; + $i++; + } + $this->themePackages->expects($this->exactly(count($templates))) + ->method('getThemes') + ->willReturn($themes); + $dir = $this->getMockForAbstractClass('\Magento\Framework\Filesystem\Directory\ReadInterface'); + $this->readDirFactory->expects($this->any()) + ->method('create') + ->willReturn($dir); + $dir->expects($this->any()) + ->method('isExist') + ->willReturn(true); + + $expected = [ + 'template_one' => ['label' => 'Template One', 'module' => 'Fixture_ModuleOne'], + 'template_two' => ['label' => 'Template 2', 'module' => 'Fixture_ModuleTwo'], + 'template_one/Vendor/custom_theme' => [ + 'label' => 'Template One (Vendor/custom_theme)', + 'module' => 'Fixture_ModuleOne' + ], + 'template_two/Vendor/custom_theme' => [ + 'label' => 'Template 2 (Vendor/custom_theme)', + 'module' => 'Fixture_ModuleTwo' + ], + ]; - foreach ($this->_model->getAvailableTemplates() as $templateOptions) { - $this->assertArrayHasKey($templateOptions['value'], $expectedTemplates); - $expectedOptions = $expectedTemplates[$templateOptions['value']]; + $actualTemplates = $this->model->getAvailableTemplates(); + $this->assertCount(count($expected), $actualTemplates); + foreach ($actualTemplates as $templateOptions) { + $this->assertArrayHasKey($templateOptions['value'], $expected); + $expectedOptions = $expected[$templateOptions['value']]; $this->assertEquals($expectedOptions['label'], (string) $templateOptions['label']); $this->assertEquals($expectedOptions['module'], (string) $templateOptions['group']); @@ -108,43 +153,40 @@ class ConfigTest extends \PHPUnit_Framework_TestCase public function testGetThemeTemplates() { - $themeDirectory = $this->getMockBuilder('Magento\Framework\Filesystem\Directory\ReadInterface') - ->disableOriginalConstructor() - ->setMethods(['search']) - ->getMockForAbstractClass(); - $templates = require __DIR__ . '/Config/_files/email_templates_merged.php'; $templateId = 'template_one'; $template = $templates[$templateId]; - $area = $template['area']; - $searchThemePath = '*/*'; $foundThemePath = 'Vendor/custom_theme'; - $module = $template['module']; - $filename = $template['file']; - $themeDirectory->expects($this->once()) - ->method('search') - ->with("{$area}/{$searchThemePath}/{$module}/email/{$filename}") - ->will($this->returnValue(["{$area}/{$foundThemePath}/{$module}/email/{$filename}"])); - - $this->fileSystem->expects($this->once()) - ->method('getDirectoryRead') - ->will($this->returnValue($themeDirectory)); - - $this->_model = $this->getMockBuilder('\Magento\Email\Model\Template\Config') - ->setConstructorArgs( - [ - $this->_dataStorage, - $this->_moduleReader, - $this->fileSystem, - $this->viewFileSystem - ] - ) - ->setMethods(null) - ->getMock(); - - foreach ($this->_model->getThemeTemplates($templateId) as $templateOptions) { + $theme = $this->getMock('\Magento\Framework\View\Design\Theme\ThemePackage', [], [], '', false); + $theme->expects($this->any()) + ->method('getArea') + ->willReturn('frontend'); + $theme->expects($this->any()) + ->method('getVendor') + ->willReturn('Vendor'); + $theme->expects($this->any()) + ->method('getName') + ->willReturn('custom_theme'); + $theme->expects($this->any()) + ->method('getPath') + ->willReturn('/theme/path'); + $this->themePackages->expects($this->once()) + ->method('getThemes') + ->willReturn([$theme]); + $dir = $this->getMockForAbstractClass('\Magento\Framework\Filesystem\Directory\ReadInterface'); + $this->readDirFactory->expects($this->once()) + ->method('create') + ->with('/theme/path') + ->willReturn($dir); + $dir->expects($this->once()) + ->method('isExist') + ->willReturn(true); + + $actualTemplates = $this->model->getThemeTemplates($templateId); + $this->assertNotEmpty($actualTemplates); + foreach ($actualTemplates as $templateOptions) { $this->assertEquals( sprintf( '%s (%s)', @@ -166,7 +208,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase */ public function testParseTemplateIdParts($input, $expectedOutput) { - $this->assertEquals($this->_model->parseTemplateIdParts($input), $expectedOutput); + $this->assertEquals($this->model->parseTemplateIdParts($input), $expectedOutput); } public function parseTemplateCodePartsDataProvider() @@ -191,22 +233,22 @@ class ConfigTest extends \PHPUnit_Framework_TestCase public function testGetTemplateLabel() { - $this->assertEquals('Template One', $this->_model->getTemplateLabel('template_one')); + $this->assertEquals('Template One', $this->model->getTemplateLabel('template_one')); } public function testGetTemplateType() { - $this->assertEquals('html', $this->_model->getTemplateType('template_one')); + $this->assertEquals('html', $this->model->getTemplateType('template_one')); } public function testGetTemplateModule() { - $this->assertEquals('Fixture_ModuleOne', $this->_model->getTemplateModule('template_one')); + $this->assertEquals('Fixture_ModuleOne', $this->model->getTemplateModule('template_one')); } public function testGetTemplateArea() { - $this->assertEquals('frontend', $this->_model->getTemplateArea('template_one')); + $this->assertEquals('frontend', $this->model->getTemplateArea('template_one')); } public function testGetTemplateFilenameWithParams() @@ -223,7 +265,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase $this->returnValue('_files/Fixture/ModuleOne/view/frontend/email/one.html') ); - $actualResult = $this->_model->getTemplateFilename('template_one', $this->designParams); + $actualResult = $this->model->getTemplateFilename('template_one', $this->designParams); $this->assertEquals('_files/Fixture/ModuleOne/view/frontend/email/one.html', $actualResult); } @@ -247,7 +289,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase $this->returnValue('_files/Fixture/ModuleOne/view/frontend/email/one.html') ); - $actualResult = $this->_model->getTemplateFilename('template_one'); + $actualResult = $this->model->getTemplateFilename('template_one'); $this->assertEquals('_files/Fixture/ModuleOne/view/frontend/email/one.html', $actualResult); } @@ -261,9 +303,9 @@ class ConfigTest extends \PHPUnit_Framework_TestCase public function testGetterMethodUnknownTemplate($getterMethod, $argument = null) { if (!$argument) { - $this->_model->{$getterMethod}('unknown'); + $this->model->{$getterMethod}('unknown'); } else { - $this->_model->{$getterMethod}('unknown', $argument); + $this->model->{$getterMethod}('unknown', $argument); } } @@ -299,11 +341,12 @@ class ConfigTest extends \PHPUnit_Framework_TestCase )->will( $this->returnValue(['fixture' => $fixtureFields]) ); - $model = new \Magento\Email\Model\Template\Config( + $model = new Config( $dataStorage, $this->_moduleReader, - $this->fileSystem, - $this->viewFileSystem + $this->viewFileSystem, + $this->themePackages, + $this->readDirFactory ); if (!$argument) { $model->{$getterMethod}('fixture'); diff --git a/app/code/Magento/Email/composer.json b/app/code/Magento/Email/composer.json index ae31d1e3b25d6aa2b02d389a364be12328a17976..904bae2c84c0c8de1b0368f3e012e7ab7e550987 100644 --- a/app/code/Magento/Email/composer.json +++ b/app/code/Magento/Email/composer.json @@ -8,8 +8,7 @@ "magento/module-cms": "1.0.0-beta", "magento/module-backend": "1.0.0-beta", "magento/module-variable": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -17,12 +16,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Email" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Email\\": "" + } } } diff --git a/app/code/Magento/Email/etc/acl.xml b/app/code/Magento/Email/etc/acl.xml index 43c654d5b6e23ddb20bd1ce20dca2987e0236b95..874398f61a17e2313150fd0abeaefe3094baa934 100644 --- a/app/code/Magento/Email/etc/acl.xml +++ b/app/code/Magento/Email/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/app/code/Magento/Email/etc/adminhtml/menu.xml b/app/code/Magento/Email/etc/adminhtml/menu.xml index feed601dc43840a7053c4b509cbdf64309378806..055e00759ab949c046f4a099a2a333221bd181d7 100644 --- a/app/code/Magento/Email/etc/adminhtml/menu.xml +++ b/app/code/Magento/Email/etc/adminhtml/menu.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Backend/etc/menu.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd"> <menu> <add id="Magento_Email::template" title="Email Templates" module="Magento_Email" sortOrder="10" parent="Magento_Backend::marketing_communications" action="adminhtml/email_template" resource="Magento_Email::template"/> </menu> diff --git a/app/code/Magento/Email/etc/adminhtml/routes.xml b/app/code/Magento/Email/etc/adminhtml/routes.xml index e09e11132fce398fae15dca8f85d71f54a34e09e..300e3dcdc4a54361620deff25b68842197c445e3 100644 --- a/app/code/Magento/Email/etc/adminhtml/routes.xml +++ b/app/code/Magento/Email/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="admin"> <route id="adminhtml"> <module name="Magento_Email" before="Magento_Backend" /> diff --git a/app/code/Magento/Email/etc/adminhtml/system.xml b/app/code/Magento/Email/etc/adminhtml/system.xml index 96aa2302dc382ea0b46edb3fb4e989b44653c979..c56922f7272407c6eeb4b20670d9c54e0fadd5d6 100644 --- a/app/code/Magento/Email/etc/adminhtml/system.xml +++ b/app/code/Magento/Email/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="design"> <group id="email" translate="label" type="text" sortOrder="510" showInDefault="1" showInWebsite="1" showInStore="1"> diff --git a/app/code/Magento/Email/etc/config.xml b/app/code/Magento/Email/etc/config.xml index 2816858dd11026ba9f64314e696dc9282dd2da20..45e31c31e035cebc6a50c1b5e3925cc3d095a307 100644 --- a/app/code/Magento/Email/etc/config.xml +++ b/app/code/Magento/Email/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <design> <email> diff --git a/app/code/Magento/Email/etc/di.xml b/app/code/Magento/Email/etc/di.xml index 4c27f5b4878b5dcb218ee0ae1e8c86a44972f33e..fe70a343d34f46fa91a94d78252bd3bb0bda2a7b 100644 --- a/app/code/Magento/Email/etc/di.xml +++ b/app/code/Magento/Email/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Framework\Mail\TemplateInterface" type="Magento\Email\Model\Template" /> <preference for="Magento\Framework\Mail\Template\FactoryInterface" type="Magento\Framework\Mail\Template\Factory" /> <preference for="Magento\Framework\Mail\TransportInterface" type="Magento\Framework\Mail\Transport" /> diff --git a/app/code/Magento/Email/etc/email_templates.xml b/app/code/Magento/Email/etc/email_templates.xml index 6be93a0993829cbdf264cc9dc00566d6ac98ff5b..4bd95b20be1fe08fe049ddb3a4b23b35a75e3702 100644 --- a/app/code/Magento/Email/etc/email_templates.xml +++ b/app/code/Magento/Email/etc/email_templates.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Email/etc/email_templates.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Email:etc/email_templates.xsd"> <template id="design_email_header_template" label="Header" file="header.html" type="html" module="Magento_Email" area="frontend"/> <template id="design_email_footer_template" label="Footer" file="footer.html" type="html" module="Magento_Email" area="frontend"/> </config> diff --git a/app/code/Magento/Email/etc/frontend/di.xml b/app/code/Magento/Email/etc/frontend/di.xml index c4f0ac1fadfd552cd7c9d770d4393b9ae8cf92ce..ef254a8f522fc6ab430939e29ed6bd0966166381 100644 --- a/app/code/Magento/Email/etc/frontend/di.xml +++ b/app/code/Magento/Email/etc/frontend/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Widget\Model\Template\Filter"> <arguments> <argument name="backendUrlBuilder" xsi:type="object">Magento\Backend\Model\UrlInterface\Proxy</argument> diff --git a/app/code/Magento/Email/etc/module.xml b/app/code/Magento/Email/etc/module.xml index 3e5126d0e7e3a7c4997164f737f0fd6428bc9ead..ef0bd39381c5e87b8e0a2a0c7b8e6c5de5a7d75e 100644 --- a/app/code/Magento/Email/etc/module.xml +++ b/app/code/Magento/Email/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Email" setup_version="2.0.0"> <sequence> <module name="Magento_Store"/> diff --git a/app/code/Magento/Email/registration.php b/app/code/Magento/Email/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..12354803ede6f00478767df103b2eb135a0f3692 --- /dev/null +++ b/app/code/Magento/Email/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Email', + __DIR__ +); diff --git a/app/code/Magento/Email/view/adminhtml/layout/adminhtml_email_template_grid.xml b/app/code/Magento/Email/view/adminhtml/layout/adminhtml_email_template_grid.xml index 6b2b59461c47be46005ab0bf387f68595cf86d24..30ec8b04c7c89d588e5b52425aaf4717af73dd35 100644 --- a/app/code/Magento/Email/view/adminhtml/layout/adminhtml_email_template_grid.xml +++ b/app/code/Magento/Email/view/adminhtml/layout/adminhtml_email_template_grid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <update handle="formkey"/> <update handle="adminhtml_email_template_grid_block"/> <container name="root"> 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 bce5f1efb40902537c6bfc5eb429673e5074c21e..991e9a21a2d2689b1d904c9975fffa503fc527aa 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 @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="adminhtml.system.email.template.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.system.email.template.grid" as="grid"> diff --git a/app/code/Magento/Email/view/adminhtml/layout/adminhtml_email_template_index.xml b/app/code/Magento/Email/view/adminhtml/layout/adminhtml_email_template_index.xml index 5437989e6078c13c9156a254a073a175260bed6d..a82f72575b951bc9f6a8152e80f567e071ecdf0b 100644 --- a/app/code/Magento/Email/view/adminhtml/layout/adminhtml_email_template_index.xml +++ b/app/code/Magento/Email/view/adminhtml/layout/adminhtml_email_template_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="adminhtml_email_template_grid_block"/> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/Email/view/adminhtml/layout/systemPreview.xml b/app/code/Magento/Email/view/adminhtml/layout/systemPreview.xml index 52d9d4f2c5a933cc55c6ae64033ad3b6154cacac..f58984cc6ed62500df26595e7355357dcb713bab 100644 --- a/app/code/Magento/Email/view/adminhtml/layout/systemPreview.xml +++ b/app/code/Magento/Email/view/adminhtml/layout/systemPreview.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root"> <block class="Magento\Framework\View\Element\Template" name="page.block" template="Magento_Email::template/preview.phtml"> <block class="Magento\Email\Block\Adminhtml\Template\Preview" name="content" as="content"/> diff --git a/app/code/Magento/EncryptionKey/composer.json b/app/code/Magento/EncryptionKey/composer.json index 968d9155e504f16bf609cb0aff64d70937b8f821..c141092c24a37ccbe09cf974ba5cf8de73e0ee13 100644 --- a/app/code/Magento/EncryptionKey/composer.json +++ b/app/code/Magento/EncryptionKey/composer.json @@ -6,20 +6,17 @@ "magento/module-config": "1.0.0-beta", "magento/module-sales": "1.0.0-beta", "magento/module-backend": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", "license": [ "proprietary" ], - "extra": { - "map": [ - [ - "*", - "Magento/EncryptionKey" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\EncryptionKey\\": "" + } } } diff --git a/app/code/Magento/EncryptionKey/etc/acl.xml b/app/code/Magento/EncryptionKey/etc/acl.xml index 15dcb594e635b70fa87ea8d3541609345edaa627..706eefb6adb492a86bae5f9b0c515c92a9ad7d47 100644 --- a/app/code/Magento/EncryptionKey/etc/acl.xml +++ b/app/code/Magento/EncryptionKey/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/app/code/Magento/EncryptionKey/etc/adminhtml/menu.xml b/app/code/Magento/EncryptionKey/etc/adminhtml/menu.xml index df50e3ce95718ab548ca604f42f0ff0f2fbd9e39..c525fe1c4b55e0e63e77b5d1ec6192c42cfe39d9 100644 --- a/app/code/Magento/EncryptionKey/etc/adminhtml/menu.xml +++ b/app/code/Magento/EncryptionKey/etc/adminhtml/menu.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Backend/etc/menu.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd"> <menu> <add id="Magento_EncryptionKey::system_crypt_key" title="Manage Encryption Key" module="Magento_EncryptionKey" sortOrder="30" parent="Magento_Backend::system_other_settings" action="adminhtml/crypt_key" dependsOnModule="Magento_EncryptionKey" resource="Magento_EncryptionKey::crypt_key"/> </menu> diff --git a/app/code/Magento/EncryptionKey/etc/adminhtml/routes.xml b/app/code/Magento/EncryptionKey/etc/adminhtml/routes.xml index 4269e609c50cd5af712ddb1548ccc7cdf95147af..1d49255715a3fcfbd4fb86a57ece581b33de8759 100644 --- a/app/code/Magento/EncryptionKey/etc/adminhtml/routes.xml +++ b/app/code/Magento/EncryptionKey/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="admin"> <route id="adminhtml"> <module name="Magento_EncryptionKey" before="Magento_Backend" /> diff --git a/app/code/Magento/EncryptionKey/etc/config.xml b/app/code/Magento/EncryptionKey/etc/config.xml index 204937c0b0ae5e296e261cbeff248ad62eb99699..493e3441a4914c87fca3c35111136439d8398e90 100644 --- a/app/code/Magento/EncryptionKey/etc/config.xml +++ b/app/code/Magento/EncryptionKey/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <admin> <security> diff --git a/app/code/Magento/EncryptionKey/etc/module.xml b/app/code/Magento/EncryptionKey/etc/module.xml index b30faf3e0646e76efe13733961709adde79eb765..af972c6d63b0b21d7a620639ebdc14a390301e2a 100644 --- a/app/code/Magento/EncryptionKey/etc/module.xml +++ b/app/code/Magento/EncryptionKey/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_EncryptionKey" setup_version="2.0.0"> <sequence> <module name="Magento_Customer"/> diff --git a/app/code/Magento/EncryptionKey/registration.php b/app/code/Magento/EncryptionKey/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..fa66dfbec6adc5726115a9466ed33d3ed09aefbf --- /dev/null +++ b/app/code/Magento/EncryptionKey/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_EncryptionKey', + __DIR__ +); diff --git a/app/code/Magento/EncryptionKey/view/adminhtml/layout/adminhtml_crypt_key_index.xml b/app/code/Magento/EncryptionKey/view/adminhtml/layout/adminhtml_crypt_key_index.xml index 7180d426aceb84c2b6fa68b10200326bcb8720db..ffa60338121c67bafb1f9d0a6293c6ba2ec6068e 100644 --- a/app/code/Magento/EncryptionKey/view/adminhtml/layout/adminhtml_crypt_key_index.xml +++ b/app/code/Magento/EncryptionKey/view/adminhtml/layout/adminhtml_crypt_key_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\EncryptionKey\Block\Adminhtml\Crypt\Key\Edit" name="crypt.key.edit" as="crypt_key_edit" template="Magento_Backend::widget/form/container.phtml"> diff --git a/app/code/Magento/Fedex/Model/Carrier.php b/app/code/Magento/Fedex/Model/Carrier.php index 299615ad3c0e8afc01502816557efeb028011aff..6a36de79eef7f5a416aed6d6b3c42ae18565d6a7 100644 --- a/app/code/Magento/Fedex/Model/Carrier.php +++ b/app/code/Magento/Fedex/Model/Carrier.php @@ -8,6 +8,7 @@ namespace Magento\Fedex\Model; +use Magento\Framework\Module\Dir; use Magento\Quote\Model\Quote\Address\RateRequest; use Magento\Shipping\Model\Carrier\AbstractCarrierOnline; use Magento\Shipping\Model\Rate\Result; @@ -182,7 +183,7 @@ class Carrier extends AbstractCarrierOnline implements \Magento\Shipping\Model\C $stockRegistry, $data ); - $wsdlBasePath = $configReader->getModuleDir('etc', 'Magento_Fedex') . '/wsdl/'; + $wsdlBasePath = $configReader->getModuleDir(Dir::MODULE_ETC_DIR, 'Magento_Fedex') . '/wsdl/'; $this->_shipServiceWsdl = $wsdlBasePath . 'ShipService_v10.wsdl'; $this->_rateServiceWsdl = $wsdlBasePath . 'RateService_v10.wsdl'; $this->_trackServiceWsdl = $wsdlBasePath . 'TrackService_v5.wsdl'; diff --git a/app/code/Magento/Fedex/composer.json b/app/code/Magento/Fedex/composer.json index f5f6bb4e739cff0aa2ef7483b5b40229c7abb2f1..a1fbe63cc24b2b4c1bb014aeb541ea5d2ad4da61 100644 --- a/app/code/Magento/Fedex/composer.json +++ b/app/code/Magento/Fedex/composer.json @@ -12,8 +12,7 @@ "magento/module-quote": "1.0.0-beta", "magento/module-config": "1.0.0-beta", "magento/framework": "1.0.0-beta", - "lib-libxml": "*", - "magento/magento-composer-installer": "*" + "lib-libxml": "*" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -21,12 +20,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Fedex" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Fedex\\": "" + } } } diff --git a/app/code/Magento/Fedex/etc/adminhtml/system.xml b/app/code/Magento/Fedex/etc/adminhtml/system.xml index 87006b056be21b64024d1a6e14db178872b8a8b5..3011885ed1b8c6933b378b7d2b29bfaf837fa2fa 100644 --- a/app/code/Magento/Fedex/etc/adminhtml/system.xml +++ b/app/code/Magento/Fedex/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="carriers"> <group id="fedex" translate="label" type="text" sortOrder="120" showInDefault="1" showInWebsite="1" showInStore="1"> diff --git a/app/code/Magento/Fedex/etc/config.xml b/app/code/Magento/Fedex/etc/config.xml index 9d99b8997487bad3eae596d0b7b026be93f524d3..a9fa02ff9a3ecd0cd3f7e584d7a7c45b04aea528 100644 --- a/app/code/Magento/Fedex/etc/config.xml +++ b/app/code/Magento/Fedex/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <carriers> <fedex> diff --git a/app/code/Magento/Fedex/etc/di.xml b/app/code/Magento/Fedex/etc/di.xml index 46b13c87de25859c59845a2cd1b28e849e90feff..a3684efe06d87e84a489117c798e19813e32f3a1 100644 --- a/app/code/Magento/Fedex/etc/di.xml +++ b/app/code/Magento/Fedex/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Rma\Block\Adminhtml\Rma\Edit\Tab\General\Shippingmethod"> <plugin name="rma_tab_shippingmethod_fedex" type="Magento\Fedex\Model\Plugin\Rma\Block\Adminhtml\Rma\Edit\Tab\General\Shippingmethod"/> diff --git a/app/code/Magento/Fedex/etc/module.xml b/app/code/Magento/Fedex/etc/module.xml index d710c059676a4d63e1f7bd052d0773e3bff2be49..54b60fd2262cb70d98ef5bd5222ab3070a15b6d0 100644 --- a/app/code/Magento/Fedex/etc/module.xml +++ b/app/code/Magento/Fedex/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Fedex" setup_version="2.0.0"> </module> </config> diff --git a/app/code/Magento/Fedex/registration.php b/app/code/Magento/Fedex/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..bd5ad69e40918ad390a4ab3ec22dd302d3bb161b --- /dev/null +++ b/app/code/Magento/Fedex/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Fedex', + __DIR__ +); diff --git a/app/code/Magento/Fedex/view/frontend/layout/checkout_cart_index.xml b/app/code/Magento/Fedex/view/frontend/layout/checkout_cart_index.xml index 81eea3366c846b1e101a3f2033e640c7f29c3ac1..f65dcf1ccda1d7372b55ee744da6be169a5d6d38 100644 --- a/app/code/Magento/Fedex/view/frontend/layout/checkout_cart_index.xml +++ b/app/code/Magento/Fedex/view/frontend/layout/checkout_cart_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout.cart.shipping"> <arguments> diff --git a/app/code/Magento/Fedex/view/frontend/layout/checkout_index_index.xml b/app/code/Magento/Fedex/view/frontend/layout/checkout_index_index.xml index 541e46a36a627814c6989c5c8d237e7d1e83aaf5..c06c5dd94376654aa018a0d16678c076f4590841 100644 --- a/app/code/Magento/Fedex/view/frontend/layout/checkout_index_index.xml +++ b/app/code/Magento/Fedex/view/frontend/layout/checkout_index_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout.root"> <arguments> diff --git a/app/code/Magento/GiftMessage/composer.json b/app/code/Magento/GiftMessage/composer.json index 6230e36ff13e4051816047af7c4960e4b94dc0e5..3050a0324f5a0b401b631b2d2b579d19688dc7d3 100644 --- a/app/code/Magento/GiftMessage/composer.json +++ b/app/code/Magento/GiftMessage/composer.json @@ -11,8 +11,7 @@ "magento/module-customer": "1.0.0-beta", "magento/module-eav": "1.0.0-beta", "magento/module-quote": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "suggest": { "magento/module-multishipping": "1.0.0-beta" @@ -23,12 +22,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/GiftMessage" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\GiftMessage\\": "" + } } } diff --git a/app/code/Magento/GiftMessage/etc/adminhtml/events.xml b/app/code/Magento/GiftMessage/etc/adminhtml/events.xml index 35f6b95f5d3ee511d74bd76d9ce1b356ea5a6c47..5cd35ccf18fcd5b3b88da47d503c8204d0f26aec 100644 --- a/app/code/Magento/GiftMessage/etc/adminhtml/events.xml +++ b/app/code/Magento/GiftMessage/etc/adminhtml/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="sales_model_service_quote_submit_before"> <observer name="giftmessage" instance="Magento\GiftMessage\Observer\SalesEventQuoteSubmitBeforeObserver" method="execute" shared="false" /> </event> diff --git a/app/code/Magento/GiftMessage/etc/adminhtml/system.xml b/app/code/Magento/GiftMessage/etc/adminhtml/system.xml index 72d61c1c13ceebc8cef21597675f16d2c33804e6..88aafbdb7c3eadb3fb4df99b242cb9e8763f3f9a 100644 --- a/app/code/Magento/GiftMessage/etc/adminhtml/system.xml +++ b/app/code/Magento/GiftMessage/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="sales"> <group id="gift_options" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="0"> diff --git a/app/code/Magento/GiftMessage/etc/catalog_attributes.xml b/app/code/Magento/GiftMessage/etc/catalog_attributes.xml index 5bef2c686eee22c76a004454ad9e171df75f411a..56ba6bd8d89b8a9178671aa2fda96bd87ef55470 100644 --- a/app/code/Magento/GiftMessage/etc/catalog_attributes.xml +++ b/app/code/Magento/GiftMessage/etc/catalog_attributes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Catalog/etc/catalog_attributes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/catalog_attributes.xsd"> <group name="quote_item"> <attribute name="gift_message_available"/> </group> diff --git a/app/code/Magento/GiftMessage/etc/config.xml b/app/code/Magento/GiftMessage/etc/config.xml index dc21f3cfecaf4055397c3ee28d0e225f3135eb2c..0e60063daf84d5954ae1ebb3329ff816208f4638 100644 --- a/app/code/Magento/GiftMessage/etc/config.xml +++ b/app/code/Magento/GiftMessage/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <sales> <gift_messages> diff --git a/app/code/Magento/GiftMessage/etc/di.xml b/app/code/Magento/GiftMessage/etc/di.xml index 47a6c71f15a4028fed977849abe9e3f1e1221219..e412fe1e5d3a92108531cf9c8dab4ed389de5194 100644 --- a/app/code/Magento/GiftMessage/etc/di.xml +++ b/app/code/Magento/GiftMessage/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Framework\Module\Setup\Migration"> <arguments> <argument name="compositeModules" xsi:type="array"> diff --git a/app/code/Magento/GiftMessage/etc/extension_attributes.xml b/app/code/Magento/GiftMessage/etc/extension_attributes.xml index 604ebb9dc9ab6850e9e98729f20a2ac9b9bfb5e1..fff1eade716fd3ab43cbc9c660ac7b23f7f803ec 100644 --- a/app/code/Magento/GiftMessage/etc/extension_attributes.xml +++ b/app/code/Magento/GiftMessage/etc/extension_attributes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Api/etc/extension_attributes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> <extension_attributes for="Magento\Sales\Api\Data\OrderInterface"> <attribute code="gift_message" type="Magento\GiftMessage\Api\Data\MessageInterface" /> </extension_attributes> diff --git a/app/code/Magento/GiftMessage/etc/fieldset.xml b/app/code/Magento/GiftMessage/etc/fieldset.xml index 4883ee0129e208dc3ccb4044db9135a74dfb5a29..a0dbdece71e4517453cc5163d3146c84535e30fd 100644 --- a/app/code/Magento/GiftMessage/etc/fieldset.xml +++ b/app/code/Magento/GiftMessage/etc/fieldset.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/DataObject/etc/fieldset.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:framework:DataObject/etc/fieldset.xsd"> <scope id="global"> <fieldset id="quote_convert_address"> <field name="gift_message_id"> diff --git a/app/code/Magento/GiftMessage/etc/frontend/di.xml b/app/code/Magento/GiftMessage/etc/frontend/di.xml index faa2f043fe6059d83e3bd1dc97f92c25f6553be9..5c75ed5c6cda5627439aed242af774b2323e4288 100644 --- a/app/code/Magento/GiftMessage/etc/frontend/di.xml +++ b/app/code/Magento/GiftMessage/etc/frontend/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\GiftMessage\Model\Plugin\QuoteItem" shared="false" /> <type name="Magento\Quote\Model\Quote\Item\ToOrderItem"> <plugin name="gift_message_quote_item_conversion" type="Magento\GiftMessage\Model\Plugin\QuoteItem"/> diff --git a/app/code/Magento/GiftMessage/etc/frontend/events.xml b/app/code/Magento/GiftMessage/etc/frontend/events.xml index 9e28ce0067af05cb73b4851b4333b36694a6993d..96a7f216d9735b701c06acb579325f26c7fd4bd6 100644 --- a/app/code/Magento/GiftMessage/etc/frontend/events.xml +++ b/app/code/Magento/GiftMessage/etc/frontend/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="sales_model_service_quote_submit_before"> <observer name="giftmessage" instance="Magento\GiftMessage\Observer\SalesEventQuoteSubmitBeforeObserver" method="execute" shared="false" /> </event> diff --git a/app/code/Magento/GiftMessage/etc/frontend/routes.xml b/app/code/Magento/GiftMessage/etc/frontend/routes.xml index 92b42fe4a9cd8ad6d1b7af18ee5070fbd8492f1b..bad8ef291f79ac06cefdfdc8f91770a6c9285647 100644 --- a/app/code/Magento/GiftMessage/etc/frontend/routes.xml +++ b/app/code/Magento/GiftMessage/etc/frontend/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="standard"> <route id="giftmessage" frontName="giftmessage"> <module name="Magento_GiftMessage" /> diff --git a/app/code/Magento/GiftMessage/etc/module.xml b/app/code/Magento/GiftMessage/etc/module.xml index a40233763e30932d739855d8eba55a946b6718ef..54952bc9ae9d937fdd37465ba6258553c501733b 100644 --- a/app/code/Magento/GiftMessage/etc/module.xml +++ b/app/code/Magento/GiftMessage/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_GiftMessage" setup_version="2.0.0"> <sequence> <module name="Magento_Catalog"/> diff --git a/app/code/Magento/GiftMessage/etc/webapi.xml b/app/code/Magento/GiftMessage/etc/webapi.xml index bb0b2f0795634c0b1f798c27883a042dfdc72939..8db802e831115bb4794e6dd8e6a7a31835ce0e71 100644 --- a/app/code/Magento/GiftMessage/etc/webapi.xml +++ b/app/code/Magento/GiftMessage/etc/webapi.xml @@ -6,7 +6,7 @@ */ --> <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../app/code/Magento/Webapi/etc/webapi.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd"> <!-- For authorized customer --> <route url="/V1/carts/:cartId/gift-message" method="GET"> <service class="Magento\GiftMessage\Api\CartRepositoryInterface" method="get"/> diff --git a/app/code/Magento/GiftMessage/etc/webapi_rest/events.xml b/app/code/Magento/GiftMessage/etc/webapi_rest/events.xml index 253cb79c4eb416a9d2369c1cfe181504dae1833a..454d97783b05904d46aebd36a98eac1fd736c47b 100644 --- a/app/code/Magento/GiftMessage/etc/webapi_rest/events.xml +++ b/app/code/Magento/GiftMessage/etc/webapi_rest/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="sales_model_service_quote_submit_before"> <observer name="giftmessage" instance="Magento\GiftMessage\Observer\SalesEventQuoteSubmitBeforeObserver" method="execute" shared="false" /> </event> diff --git a/app/code/Magento/GiftMessage/registration.php b/app/code/Magento/GiftMessage/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..3b8af3d26702cb3fff20732b673763e5f03a32df --- /dev/null +++ b/app/code/Magento/GiftMessage/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_GiftMessage', + __DIR__ +); diff --git a/app/code/Magento/GiftMessage/view/adminhtml/layout/sales_order_create_index.xml b/app/code/Magento/GiftMessage/view/adminhtml/layout/sales_order_create_index.xml index 6336942be4cf9a6a9acf0372795bc79b4ef20da4..3bec03ebd42a09cc9384e1ad61623ac699bbf062 100644 --- a/app/code/Magento/GiftMessage/view/adminhtml/layout/sales_order_create_index.xml +++ b/app/code/Magento/GiftMessage/view/adminhtml/layout/sales_order_create_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="order_item_extra_info"> <block class="Magento\GiftMessage\Block\Adminhtml\Sales\Order\Create\Giftoptions" name="gift_options_link" template="sales/order/create/giftoptions.phtml"> diff --git a/app/code/Magento/GiftMessage/view/adminhtml/layout/sales_order_create_load_block_data.xml b/app/code/Magento/GiftMessage/view/adminhtml/layout/sales_order_create_load_block_data.xml index 6336942be4cf9a6a9acf0372795bc79b4ef20da4..3bec03ebd42a09cc9384e1ad61623ac699bbf062 100644 --- a/app/code/Magento/GiftMessage/view/adminhtml/layout/sales_order_create_load_block_data.xml +++ b/app/code/Magento/GiftMessage/view/adminhtml/layout/sales_order_create_load_block_data.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="order_item_extra_info"> <block class="Magento\GiftMessage\Block\Adminhtml\Sales\Order\Create\Giftoptions" name="gift_options_link" template="sales/order/create/giftoptions.phtml"> diff --git a/app/code/Magento/GiftMessage/view/adminhtml/layout/sales_order_create_load_block_items.xml b/app/code/Magento/GiftMessage/view/adminhtml/layout/sales_order_create_load_block_items.xml index 6336942be4cf9a6a9acf0372795bc79b4ef20da4..3bec03ebd42a09cc9384e1ad61623ac699bbf062 100644 --- a/app/code/Magento/GiftMessage/view/adminhtml/layout/sales_order_create_load_block_items.xml +++ b/app/code/Magento/GiftMessage/view/adminhtml/layout/sales_order_create_load_block_items.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="order_item_extra_info"> <block class="Magento\GiftMessage\Block\Adminhtml\Sales\Order\Create\Giftoptions" name="gift_options_link" template="sales/order/create/giftoptions.phtml"> diff --git a/app/code/Magento/GiftMessage/view/adminhtml/layout/sales_order_view.xml b/app/code/Magento/GiftMessage/view/adminhtml/layout/sales_order_view.xml index e30879e3ca02b11971a88d7387c7775d746bf6e6..84a9c565e51f86c84971106cdeade3357276007e 100644 --- a/app/code/Magento/GiftMessage/view/adminhtml/layout/sales_order_view.xml +++ b/app/code/Magento/GiftMessage/view/adminhtml/layout/sales_order_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="order_item_extra_info"> <block class="Magento\GiftMessage\Block\Adminhtml\Sales\Order\View\Giftoptions" name="gift_options_link" template="sales/order/view/giftoptions.phtml"> diff --git a/app/code/Magento/GiftMessage/view/frontend/layout/checkout_cart_index.xml b/app/code/Magento/GiftMessage/view/frontend/layout/checkout_cart_index.xml index 66e18b7a0f7f7ecb45b5e3ae98d5d2bc3b019cad..4b63f531a262da84c754ddb7e928bbf74bfe8ce5 100644 --- a/app/code/Magento/GiftMessage/view/frontend/layout/checkout_cart_index.xml +++ b/app/code/Magento/GiftMessage/view/frontend/layout/checkout_cart_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout.cart.order.actions"> <block class="Magento\GiftMessage\Block\Cart\GiftOptions" name="checkout.cart.order.actions.gift_options" template="cart/gift_options.phtml" cacheable="false"> diff --git a/app/code/Magento/GiftMessage/view/frontend/layout/checkout_cart_item_renderers.xml b/app/code/Magento/GiftMessage/view/frontend/layout/checkout_cart_item_renderers.xml index b94cab5dace25517631f0034bdf5098ee867b64d..533a8f0b0f1318cbd758ec340694a29a85524c60 100644 --- a/app/code/Magento/GiftMessage/view/frontend/layout/checkout_cart_item_renderers.xml +++ b/app/code/Magento/GiftMessage/view/frontend/layout/checkout_cart_item_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout.cart.item.renderers.default.actions"> <block class="Magento\GiftMessage\Block\Cart\Item\Renderer\Actions\GiftOptions" name="checkout.cart.item.renderers.default.actions.gift_options" template="cart/item/renderer/actions/gift_options.phtml" before="-" cacheable="false"> diff --git a/app/code/Magento/GoogleAdwords/composer.json b/app/code/Magento/GoogleAdwords/composer.json index c8f53522e8c4757d6906371a1426a8fde0e7168d..d22f6768ae1db39df745431141a02c05dff72c28 100644 --- a/app/code/Magento/GoogleAdwords/composer.json +++ b/app/code/Magento/GoogleAdwords/composer.json @@ -5,8 +5,7 @@ "php": "~5.5.0|~5.6.0|~7.0.0", "magento/module-store": "1.0.0-beta", "magento/module-sales": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -14,12 +13,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/GoogleAdwords" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\GoogleAdwords\\": "" + } } } diff --git a/app/code/Magento/GoogleAdwords/etc/adminhtml/system.xml b/app/code/Magento/GoogleAdwords/etc/adminhtml/system.xml index 1f6d8c79d6322eb27833f34c1759f0256d999386..12f1664b2af1e5e4375dd11da7f885b6807f440b 100644 --- a/app/code/Magento/GoogleAdwords/etc/adminhtml/system.xml +++ b/app/code/Magento/GoogleAdwords/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="google" translate="label"> <group id="adwords" translate="label" type="text" sortOrder="15" showInDefault="1" showInWebsite="1" showInStore="1"> diff --git a/app/code/Magento/GoogleAdwords/etc/config.xml b/app/code/Magento/GoogleAdwords/etc/config.xml index 71bd7813ad22278703215c1cb7c052cc72d16b5f..5779dce4f51b2d5e51506450c9c19c76deca853d 100644 --- a/app/code/Magento/GoogleAdwords/etc/config.xml +++ b/app/code/Magento/GoogleAdwords/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <google> <adwords> diff --git a/app/code/Magento/GoogleAdwords/etc/di.xml b/app/code/Magento/GoogleAdwords/etc/di.xml index 1efb032047af67ff0cdff7efec9a686d183fa9cd..38f64c848f77099570f5c3f6a02a657c4614c441 100644 --- a/app/code/Magento/GoogleAdwords/etc/di.xml +++ b/app/code/Magento/GoogleAdwords/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\GoogleAdwords\Observer\SetConversionValueObserver"> <arguments> <argument name="collection" xsi:type="object">Magento\Sales\Model\Resource\Order\Collection\Proxy</argument> diff --git a/app/code/Magento/GoogleAdwords/etc/frontend/events.xml b/app/code/Magento/GoogleAdwords/etc/frontend/events.xml index 1696e438eb2e492f76ee679bed45dc43447584fe..100800e6cfbd59581b5c214756d059ef10d1e3da 100644 --- a/app/code/Magento/GoogleAdwords/etc/frontend/events.xml +++ b/app/code/Magento/GoogleAdwords/etc/frontend/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="checkout_onepage_controller_success_action"> <observer name="googleadwords_order_success" instance="Magento\GoogleAdwords\Observer\SetConversionValueObserver" method="execute" /> </event> diff --git a/app/code/Magento/GoogleAdwords/etc/module.xml b/app/code/Magento/GoogleAdwords/etc/module.xml index a64f74385f0935cbc3dc57ae288922f63847dc38..ab9ebf5fcae4d1cf3959bd4329de7cb09f628be2 100644 --- a/app/code/Magento/GoogleAdwords/etc/module.xml +++ b/app/code/Magento/GoogleAdwords/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_GoogleAdwords" setup_version="2.0.0"> <sequence> <module name="Magento_Checkout"/> diff --git a/app/code/Magento/GoogleAdwords/registration.php b/app/code/Magento/GoogleAdwords/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..c907566628846a0406142f1b7ec25d0e0b3c9044 --- /dev/null +++ b/app/code/Magento/GoogleAdwords/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_GoogleAdwords', + __DIR__ +); diff --git a/app/code/Magento/GoogleAdwords/view/frontend/layout/checkout_onepage_success.xml b/app/code/Magento/GoogleAdwords/view/frontend/layout/checkout_onepage_success.xml index c08542011f78244a2c7b354012b8725233e0b270..b67ddfff6f2d6acfe882e1f3f775bb6ab7324f9e 100644 --- a/app/code/Magento/GoogleAdwords/view/frontend/layout/checkout_onepage_success.xml +++ b/app/code/Magento/GoogleAdwords/view/frontend/layout/checkout_onepage_success.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\GoogleAdwords\Block\Code" name="google.adwords.code" template="code.phtml"/> diff --git a/app/code/Magento/GoogleAnalytics/composer.json b/app/code/Magento/GoogleAnalytics/composer.json index ff50e52aa6987a4b0d168730eb73f04c4a13dcb4..c58857b343fb045c6f13ee2fa91efbec7d19a637 100644 --- a/app/code/Magento/GoogleAnalytics/composer.json +++ b/app/code/Magento/GoogleAnalytics/composer.json @@ -6,8 +6,7 @@ "magento/module-store": "1.0.0-beta", "magento/module-sales": "1.0.0-beta", "magento/framework": "1.0.0-beta", - "magento/module-cookie": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/module-cookie": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -15,12 +14,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/GoogleAnalytics" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\GoogleAnalytics\\": "" + } } } diff --git a/app/code/Magento/GoogleAnalytics/etc/acl.xml b/app/code/Magento/GoogleAnalytics/etc/acl.xml index 19a660ca1c824710229b83786d8204c8af4e282c..30e9bf1c8f4ff5034a67a979e3be44e275109369 100644 --- a/app/code/Magento/GoogleAnalytics/etc/acl.xml +++ b/app/code/Magento/GoogleAnalytics/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/app/code/Magento/GoogleAnalytics/etc/adminhtml/system.xml b/app/code/Magento/GoogleAnalytics/etc/adminhtml/system.xml index f91550a86996e16c624059e900bd865c3235491e..7244063d99a672b2b115726e3c6a6c6aefa03383 100644 --- a/app/code/Magento/GoogleAnalytics/etc/adminhtml/system.xml +++ b/app/code/Magento/GoogleAnalytics/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="google" translate="label" type="text" sortOrder="340" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Google API</label> diff --git a/app/code/Magento/GoogleAnalytics/etc/di.xml b/app/code/Magento/GoogleAnalytics/etc/di.xml index 56a57bc91c335ebf4a7ed601a3168f74d2c79aad..4d65d5d7849b9332eadecdc6248d9da72a28bcd3 100644 --- a/app/code/Magento/GoogleAnalytics/etc/di.xml +++ b/app/code/Magento/GoogleAnalytics/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Framework\Module\Setup\Migration"> <arguments> <argument name="compositeModules" xsi:type="array"> diff --git a/app/code/Magento/GoogleAnalytics/etc/frontend/events.xml b/app/code/Magento/GoogleAnalytics/etc/frontend/events.xml index 62a51ec20bcb93052a35a160d1585761b291fa85..0b6c14e9e39394c7d399ec9a612586de7a5e91a7 100644 --- a/app/code/Magento/GoogleAnalytics/etc/frontend/events.xml +++ b/app/code/Magento/GoogleAnalytics/etc/frontend/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="checkout_onepage_controller_success_action"> <observer name="googleanalytics_order_success" instance="Magento\GoogleAnalytics\Observer\SetGoogleAnalyticsOnOrderSuccessPageViewObserver" method="execute" /> </event> diff --git a/app/code/Magento/GoogleAnalytics/etc/module.xml b/app/code/Magento/GoogleAnalytics/etc/module.xml index bcb1b0ed7573d5f672b2c5bf77f1869b1ff16c1a..4d28eb8a4fc73541b764313810aa57593a133e69 100644 --- a/app/code/Magento/GoogleAnalytics/etc/module.xml +++ b/app/code/Magento/GoogleAnalytics/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_GoogleAnalytics" setup_version="2.0.0"> <sequence> <module name="Magento_Store"/> diff --git a/app/code/Magento/GoogleAnalytics/registration.php b/app/code/Magento/GoogleAnalytics/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..16de0f025c15d0ec49b8e370ab28f7e423ef8308 --- /dev/null +++ b/app/code/Magento/GoogleAnalytics/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_GoogleAnalytics', + __DIR__ +); diff --git a/app/code/Magento/GoogleAnalytics/view/frontend/layout/default.xml b/app/code/Magento/GoogleAnalytics/view/frontend/layout/default.xml index 73774c72bee2f422a04f49effbef83a5d1475a9f..1b199eea01afdc3e6f54cbf50c8458df7fe50c37 100644 --- a/app/code/Magento/GoogleAnalytics/view/frontend/layout/default.xml +++ b/app/code/Magento/GoogleAnalytics/view/frontend/layout/default.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="after.body.start"> <block class="Magento\GoogleAnalytics\Block\Ga" name="google_analytics" as="google_analytics" template="ga.phtml"/> diff --git a/app/code/Magento/GoogleOptimizer/composer.json b/app/code/Magento/GoogleOptimizer/composer.json index f3ff919695afbbee28826145f274fb036e8cce3b..bbd39986c2d0c00dae75302e59925a94db954d19 100644 --- a/app/code/Magento/GoogleOptimizer/composer.json +++ b/app/code/Magento/GoogleOptimizer/composer.json @@ -8,8 +8,7 @@ "magento/module-catalog": "1.0.0-beta", "magento/module-cms": "1.0.0-beta", "magento/module-backend": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -17,12 +16,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/GoogleOptimizer" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\GoogleOptimizer\\": "" + } } } diff --git a/app/code/Magento/GoogleOptimizer/etc/adminhtml/system.xml b/app/code/Magento/GoogleOptimizer/etc/adminhtml/system.xml index db5f8b37035946f7db4a570a89ebb63370b3152e..7bc7fb1526f68c41d7a2f1502e1ce112ef4b9af1 100644 --- a/app/code/Magento/GoogleOptimizer/etc/adminhtml/system.xml +++ b/app/code/Magento/GoogleOptimizer/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="google" translate="label"> <group id="analytics"> diff --git a/app/code/Magento/GoogleOptimizer/etc/config.xml b/app/code/Magento/GoogleOptimizer/etc/config.xml index fa510197464776407fb36f4f791bc34f827669f1..1ac2dcdaf129e425d0f514ee8a190c236b124ead 100644 --- a/app/code/Magento/GoogleOptimizer/etc/config.xml +++ b/app/code/Magento/GoogleOptimizer/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <google> <optimizer> diff --git a/app/code/Magento/GoogleOptimizer/etc/events.xml b/app/code/Magento/GoogleOptimizer/etc/events.xml index ec7f35ec1e506383cce8caf72ce9cd0fd20fe361..c8347f4e547405e8a9c13759b7d8685681f7f5b7 100644 --- a/app/code/Magento/GoogleOptimizer/etc/events.xml +++ b/app/code/Magento/GoogleOptimizer/etc/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="catalog_product_save_after"> <observer name="googleoptimizer_observer" instance="Magento\GoogleOptimizer\Observer\Product\SaveGoogleExperimentScriptObserver" method="execute" /> </event> diff --git a/app/code/Magento/GoogleOptimizer/etc/module.xml b/app/code/Magento/GoogleOptimizer/etc/module.xml index 869688b1a966d0d305f12adae4141a77fc9fae00..cddd051c5a53ef58ec70d9a35aedcd902662b2ef 100644 --- a/app/code/Magento/GoogleOptimizer/etc/module.xml +++ b/app/code/Magento/GoogleOptimizer/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_GoogleOptimizer" setup_version="2.0.0"> <sequence> <module name="Magento_GoogleAnalytics"/> diff --git a/app/code/Magento/GoogleOptimizer/registration.php b/app/code/Magento/GoogleOptimizer/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..fe81deb668c86d74927403e44061bb24598587b8 --- /dev/null +++ b/app/code/Magento/GoogleOptimizer/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_GoogleOptimizer', + __DIR__ +); diff --git a/app/code/Magento/GoogleOptimizer/view/adminhtml/layout/catalog_product_new.xml b/app/code/Magento/GoogleOptimizer/view/adminhtml/layout/catalog_product_new.xml index ddef4d658021d05c97f113dc4bd82bc363d3232d..ae86d67519b10a7a855fba15e170e96edf36b989 100644 --- a/app/code/Magento/GoogleOptimizer/view/adminhtml/layout/catalog_product_new.xml +++ b/app/code/Magento/GoogleOptimizer/view/adminhtml/layout/catalog_product_new.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="product_tabs"> <action method="addTab"> diff --git a/app/code/Magento/GoogleOptimizer/view/adminhtml/layout/cms_page_edit.xml b/app/code/Magento/GoogleOptimizer/view/adminhtml/layout/cms_page_edit.xml index 8546da9047001428b8fc6291654e2bc52f9d0426..c4994f79d66179f0072e3356c9129ec7d5768df8 100644 --- a/app/code/Magento/GoogleOptimizer/view/adminhtml/layout/cms_page_edit.xml +++ b/app/code/Magento/GoogleOptimizer/view/adminhtml/layout/cms_page_edit.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="cms_page_edit_tabs"> <action method="addTab"> diff --git a/app/code/Magento/GoogleOptimizer/view/frontend/layout/catalog_category_view.xml b/app/code/Magento/GoogleOptimizer/view/frontend/layout/catalog_category_view.xml index c93f0afdc5010ad82b8b33b55162627af11a0450..ed6ac9ef37ff04c853c55af8f769a06342a95083 100644 --- a/app/code/Magento/GoogleOptimizer/view/frontend/layout/catalog_category_view.xml +++ b/app/code/Magento/GoogleOptimizer/view/frontend/layout/catalog_category_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="after.body.start"> <block class="Magento\GoogleOptimizer\Block\Code\Category" before="-" name="googleoptimizer.experiment.script"/> diff --git a/app/code/Magento/GoogleOptimizer/view/frontend/layout/catalog_product_view.xml b/app/code/Magento/GoogleOptimizer/view/frontend/layout/catalog_product_view.xml index 4551f03a77284ff6a16eab4117cf7acbb2f47ea3..260c8ecfb4f0429c18eee5a52f42d0de421d21e4 100644 --- a/app/code/Magento/GoogleOptimizer/view/frontend/layout/catalog_product_view.xml +++ b/app/code/Magento/GoogleOptimizer/view/frontend/layout/catalog_product_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="after.body.start"> <block class="Magento\GoogleOptimizer\Block\Code\Product" before="-" name="googleoptimizer.experiment.script"/> diff --git a/app/code/Magento/GoogleOptimizer/view/frontend/layout/cms_page_view.xml b/app/code/Magento/GoogleOptimizer/view/frontend/layout/cms_page_view.xml index ea216460004a716cdc349bcc856d6ad27ad5660a..a7ac93959457b3b5ae65474478ac5b649733d3f0 100644 --- a/app/code/Magento/GoogleOptimizer/view/frontend/layout/cms_page_view.xml +++ b/app/code/Magento/GoogleOptimizer/view/frontend/layout/cms_page_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="after.body.start"> <block class="Magento\GoogleOptimizer\Block\Code\Page" before="-" name="googleoptimizer.experiment.script"/> diff --git a/app/code/Magento/GroupedImportExport/composer.json b/app/code/Magento/GroupedImportExport/composer.json index 86bef4ef0655baca87b3465b1a4b0b6cea45cc56..79be20401e06d275bb1ea4d6713d4d4a2bdd70c8 100644 --- a/app/code/Magento/GroupedImportExport/composer.json +++ b/app/code/Magento/GroupedImportExport/composer.json @@ -8,8 +8,7 @@ "magento/module-catalog-import-export": "1.0.0-beta", "magento/module-grouped-product": "1.0.0-beta", "magento/module-eav": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -17,12 +16,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/GroupedImportExport" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\GroupedImportExport\\": "" + } } } diff --git a/app/code/Magento/GroupedImportExport/etc/di.xml b/app/code/Magento/GroupedImportExport/etc/di.xml index 713e476dde7a271ff741141630f4f608f93d9f32..baf67df9d25435425ae3914956f275652e4cff86 100644 --- a/app/code/Magento/GroupedImportExport/etc/di.xml +++ b/app/code/Magento/GroupedImportExport/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\CatalogImportExport\Model\Export\RowCustomizer\Composite"> <arguments> <argument name="customizers" xsi:type="array"> diff --git a/app/code/Magento/GroupedImportExport/etc/export.xml b/app/code/Magento/GroupedImportExport/etc/export.xml index 9217e47bf3d83c18b137315f61f01e780d0eb9b5..b401c2ba525c80224f5d203915249042a4e49386 100644 --- a/app/code/Magento/GroupedImportExport/etc/export.xml +++ b/app/code/Magento/GroupedImportExport/etc/export.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../ImportExport/etc/export.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_ImportExport:etc/export.xsd"> <entityType entity="catalog_product" name="grouped" model="Magento\GroupedImportExport\Model\Export\Product\Type\Grouped" /> </config> diff --git a/app/code/Magento/GroupedImportExport/etc/import.xml b/app/code/Magento/GroupedImportExport/etc/import.xml index 911cf2c6783fbbba9afc889860e3bbbf5849aa3a..ec639306edac3829b67f0aa3553e6de079e87558 100644 --- a/app/code/Magento/GroupedImportExport/etc/import.xml +++ b/app/code/Magento/GroupedImportExport/etc/import.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../ImportExport/etc/import.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_ImportExport:etc/import.xsd"> <entityType entity="catalog_product" name="grouped" model="Magento\GroupedImportExport\Model\Import\Product\Type\Grouped" /> </config> diff --git a/app/code/Magento/GroupedImportExport/etc/module.xml b/app/code/Magento/GroupedImportExport/etc/module.xml index 3a478e2fbf59ce26bd6bff6511940c6b276350f9..88399f754fa4de80588c9afed375dadea6b81694 100644 --- a/app/code/Magento/GroupedImportExport/etc/module.xml +++ b/app/code/Magento/GroupedImportExport/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_GroupedImportExport" setup_version="2.0.0"> </module> </config> diff --git a/app/code/Magento/GroupedImportExport/registration.php b/app/code/Magento/GroupedImportExport/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..c96c75b72b33eea9616fb7eddd553015bae7ce6e --- /dev/null +++ b/app/code/Magento/GroupedImportExport/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_GroupedImportExport', + __DIR__ +); diff --git a/app/code/Magento/GroupedProduct/composer.json b/app/code/Magento/GroupedProduct/composer.json index f5190f0d5a60a4939284c0372b9d58d8d0966a81..3cb4722b9d07d8e03f7a8c6af400a2dcaa8147af 100644 --- a/app/code/Magento/GroupedProduct/composer.json +++ b/app/code/Magento/GroupedProduct/composer.json @@ -14,8 +14,7 @@ "magento/module-media-storage": "1.0.0-beta", "magento/module-msrp": "1.0.0-beta", "magento/module-quote": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -23,12 +22,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/GroupedProduct" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\GroupedProduct\\": "" + } } } diff --git a/app/code/Magento/GroupedProduct/etc/adminhtml/di.xml b/app/code/Magento/GroupedProduct/etc/adminhtml/di.xml index d3a3b79f08487e016aa76fdca6259b09087e4372..54eb955c26abc68c126684590a45160ecf5bcd34 100644 --- a/app/code/Magento/GroupedProduct/etc/adminhtml/di.xml +++ b/app/code/Magento/GroupedProduct/etc/adminhtml/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\GroupedProduct\Model\Product\Type\Grouped" type="Magento\GroupedProduct\Model\Product\Type\Grouped\Backend" /> <type name="Magento\Sales\Block\Adminhtml\Order\Create\Sidebar\AbstractSidebar"> <plugin name="GroupedProduct" type="Magento\GroupedProduct\Block\Adminhtml\Order\Create\Sidebar" sortOrder="100"/> diff --git a/app/code/Magento/GroupedProduct/etc/adminhtml/routes.xml b/app/code/Magento/GroupedProduct/etc/adminhtml/routes.xml index a72a8a44361e8792ebe97f298b1f99aa18915bea..7d177a6ca4c01a53e8c2814de5f7dcbc0e2234a2 100644 --- a/app/code/Magento/GroupedProduct/etc/adminhtml/routes.xml +++ b/app/code/Magento/GroupedProduct/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn: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/adminhtml/system.xml b/app/code/Magento/GroupedProduct/etc/adminhtml/system.xml index 72cefeb26de4b323c3c8901f3f3193e69c001469..ec1eeded6cc80d4bee1fd78b8e5bc5a11e83d785 100644 --- a/app/code/Magento/GroupedProduct/etc/adminhtml/system.xml +++ b/app/code/Magento/GroupedProduct/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="checkout" translate="label" type="text" sortOrder="305" showInDefault="1" showInWebsite="1" showInStore="1"> <group id="cart" translate="label" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1"> diff --git a/app/code/Magento/GroupedProduct/etc/config.xml b/app/code/Magento/GroupedProduct/etc/config.xml index 676a5554de340408a34f6244f78d2a3571c138f7..01b53f684251cd4d8d43aadcb6f1ad8e3feca5d6 100644 --- a/app/code/Magento/GroupedProduct/etc/config.xml +++ b/app/code/Magento/GroupedProduct/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <checkout> <cart> diff --git a/app/code/Magento/GroupedProduct/etc/di.xml b/app/code/Magento/GroupedProduct/etc/di.xml index d6bd0d0fe47935abfdf745f63acb3303ac795ae4..5bfcb47a96f050a211a8b53b98f5a4e86b8f41b4 100644 --- a/app/code/Magento/GroupedProduct/etc/di.xml +++ b/app/code/Magento/GroupedProduct/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Quote\Model\Quote\Item\RelatedProducts"> <arguments> <argument name="relatedProductTypes" xsi:type="array"> diff --git a/app/code/Magento/GroupedProduct/etc/extension_attributes.xml b/app/code/Magento/GroupedProduct/etc/extension_attributes.xml index cf0d9d57bfabc7609acd4b6fd56cddf602d484a1..8ba50a1ab6ea48fe77127dba30501b0934db0937 100644 --- a/app/code/Magento/GroupedProduct/etc/extension_attributes.xml +++ b/app/code/Magento/GroupedProduct/etc/extension_attributes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Api/etc/extension_attributes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> <extension_attributes for="Magento\Catalog\Api\Data\ProductLinkInterface"> <attribute code="qty" type="float" /> </extension_attributes> diff --git a/app/code/Magento/GroupedProduct/etc/frontend/di.xml b/app/code/Magento/GroupedProduct/etc/frontend/di.xml index 7732a1bdc4d37b36fdaa9adaed5973e50a08040c..2c4dfba73ae24e2348562d4d905aab7772f77563 100644 --- a/app/code/Magento/GroupedProduct/etc/frontend/di.xml +++ b/app/code/Magento/GroupedProduct/etc/frontend/di.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Checkout\CustomerData\ItemPoolInterface"> <arguments> <argument name="itemMap" xsi:type="array"> diff --git a/app/code/Magento/GroupedProduct/etc/module.xml b/app/code/Magento/GroupedProduct/etc/module.xml index a658f20e3758e691e516bf6c1b5ac784bd540538..7a36b0bec3b755b2d1318b31ccdb4f0382297325 100644 --- a/app/code/Magento/GroupedProduct/etc/module.xml +++ b/app/code/Magento/GroupedProduct/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_GroupedProduct" setup_version="2.0.0"> <sequence> <module name="Magento_Catalog"/> diff --git a/app/code/Magento/GroupedProduct/etc/pdf.xml b/app/code/Magento/GroupedProduct/etc/pdf.xml index 01b80d66b5bc47587617c3a1c2bc5bf317a630c6..9de2e0c8e8d60454c8ba0d6e11fdd218d161414d 100644 --- a/app/code/Magento/GroupedProduct/etc/pdf.xml +++ b/app/code/Magento/GroupedProduct/etc/pdf.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Sales/etc/pdf_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Sales:etc/pdf_file.xsd"> <renderers> <page type="invoice"> <renderer product_type="grouped">Magento\GroupedProduct\Model\Order\Pdf\Items\Invoice\Grouped</renderer> diff --git a/app/code/Magento/GroupedProduct/etc/product_types.xml b/app/code/Magento/GroupedProduct/etc/product_types.xml index f218dd60006d3682be12864c9405b4d57042bdeb..c13651ae0f779e44d9b62515c577a34f4b739a64 100644 --- a/app/code/Magento/GroupedProduct/etc/product_types.xml +++ b/app/code/Magento/GroupedProduct/etc/product_types.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Catalog/etc/product_types.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/product_types.xsd"> <type name="grouped" label="Grouped Product" modelInstance="Magento\GroupedProduct\Model\Product\Type\Grouped" composite='true' indexPriority="50" sortOrder="30"> <priceModel instance="Magento\GroupedProduct\Model\Product\Type\Grouped\Price" /> <indexerModel instance="Magento\GroupedProduct\Model\Resource\Product\Indexer\Price\Grouped" /> diff --git a/app/code/Magento/GroupedProduct/etc/sales.xml b/app/code/Magento/GroupedProduct/etc/sales.xml index a6d49ccfac6ed8dbdefbd34188f0b2cb6d2578b6..fd0886fb0272b93fdbdd71d8fe738669dea322bd 100644 --- a/app/code/Magento/GroupedProduct/etc/sales.xml +++ b/app/code/Magento/GroupedProduct/etc/sales.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Sales/etc/sales.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Sales:etc/sales.xsd"> <order> <available_product_type name="grouped"/> </order> diff --git a/app/code/Magento/GroupedProduct/registration.php b/app/code/Magento/GroupedProduct/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..d57f2b4a1feca2b653f53c2660928035c5a5f842 --- /dev/null +++ b/app/code/Magento/GroupedProduct/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_GroupedProduct', + __DIR__ +); diff --git a/app/code/Magento/GroupedProduct/view/adminhtml/layout/catalog_product_grouped.xml b/app/code/Magento/GroupedProduct/view/adminhtml/layout/catalog_product_grouped.xml index 220f40e999966287e94f0eda234770458cbfeb22..72b1c3f2e20b26523e2a2ecb36c49b39271d0284 100644 --- a/app/code/Magento/GroupedProduct/view/adminhtml/layout/catalog_product_grouped.xml +++ b/app/code/Magento/GroupedProduct/view/adminhtml/layout/catalog_product_grouped.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <css src="Magento_GroupedProduct::css/grouped-product.css"/> </head> diff --git a/app/code/Magento/GroupedProduct/view/adminhtml/layout/catalog_product_new.xml b/app/code/Magento/GroupedProduct/view/adminhtml/layout/catalog_product_new.xml index 48c5892bf60d827c68ef872610dee3a1aaaa8a1e..c816f54114a1685808cb112ad99e5106ac3a3c7f 100644 --- a/app/code/Magento/GroupedProduct/view/adminhtml/layout/catalog_product_new.xml +++ b/app/code/Magento/GroupedProduct/view/adminhtml/layout/catalog_product_new.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="js"> <block class="Magento\Framework\View\Element\Template" template="Magento_GroupedProduct::product/stock/disabler.phtml"/> diff --git a/app/code/Magento/GroupedProduct/view/adminhtml/layout/catalog_product_view_type_grouped.xml b/app/code/Magento/GroupedProduct/view/adminhtml/layout/catalog_product_view_type_grouped.xml index 1cfe367c7d69c32950593209d9d458d1ac14c645..2170e2df1fea3726cfddefc9c1238e6531738fe2 100644 --- a/app/code/Magento/GroupedProduct/view/adminhtml/layout/catalog_product_view_type_grouped.xml +++ b/app/code/Magento/GroupedProduct/view/adminhtml/layout/catalog_product_view_type_grouped.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="product.composite.fieldset"> <block class="Magento\GroupedProduct\Block\Adminhtml\Product\Composite\Fieldset\Grouped" name="product.composite.fieldset.grouped" before="product.composite.fieldset.options" template="catalog/product/composite/fieldset/grouped.phtml"/> diff --git a/app/code/Magento/GroupedProduct/view/adminhtml/layout/groupedproduct_edit_popup.xml b/app/code/Magento/GroupedProduct/view/adminhtml/layout/groupedproduct_edit_popup.xml index 26584fa77f0e26823c83fd63c958459eff63226b..f437d3325569eb7b030fecfdfea2c4a97e8b591e 100644 --- a/app/code/Magento/GroupedProduct/view/adminhtml/layout/groupedproduct_edit_popup.xml +++ b/app/code/Magento/GroupedProduct/view/adminhtml/layout/groupedproduct_edit_popup.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <update handle="catalog_product_grouped"/> <container name="root"> <block class="Magento\Backend\Block\Widget\Grid\Container" name="catalog.product.edit.tab.super.grid.popup.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> diff --git a/app/code/Magento/GroupedProduct/view/adminhtml/layout/groupedproduct_popup_grid.xml b/app/code/Magento/GroupedProduct/view/adminhtml/layout/groupedproduct_popup_grid.xml index e8fb0471717b7d12aaec38e7b8e211476142e280..d95ec9df8c14bf6ae780ce6fbbf16ab48690a06a 100644 --- a/app/code/Magento/GroupedProduct/view/adminhtml/layout/groupedproduct_popup_grid.xml +++ b/app/code/Magento/GroupedProduct/view/adminhtml/layout/groupedproduct_popup_grid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="catalog.product.edit.tab.super.grid.popup.container"> <block class="Magento\Backend\Block\Widget\Grid" name="catalog.product.edit.tab.super.group.popup" as="grid"> diff --git a/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_creditmemo_new.xml b/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_creditmemo_new.xml index 9163161011131e017e4d4a40b87237fb31766103..236cf3b1e0fb02fae8603068e70933d2c8ae927b 100644 --- a/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_creditmemo_new.xml +++ b/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_creditmemo_new.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="order_items"> <block class="Magento\GroupedProduct\Block\Adminhtml\Items\Column\Name\Grouped" name="column_name_grouped" template="Magento_Sales::items/column/name.phtml" group="column"/> diff --git a/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_creditmemo_updateqty.xml b/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_creditmemo_updateqty.xml index 9163161011131e017e4d4a40b87237fb31766103..236cf3b1e0fb02fae8603068e70933d2c8ae927b 100644 --- a/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_creditmemo_updateqty.xml +++ b/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_creditmemo_updateqty.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="order_items"> <block class="Magento\GroupedProduct\Block\Adminhtml\Items\Column\Name\Grouped" name="column_name_grouped" template="Magento_Sales::items/column/name.phtml" group="column"/> diff --git a/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_creditmemo_view.xml b/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_creditmemo_view.xml index 200fce56abe44f8ae027ceec302284d78c285bf9..ff54a6cbf3fd686a659c2171dd0dda772c427df9 100644 --- a/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_creditmemo_view.xml +++ b/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_creditmemo_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="creditmemo_items"> <block class="Magento\GroupedProduct\Block\Adminhtml\Items\Column\Name\Grouped" name="column_name_grouped" template="Magento_Sales::items/column/name.phtml" group="column"/> diff --git a/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_invoice_new.xml b/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_invoice_new.xml index 9163161011131e017e4d4a40b87237fb31766103..236cf3b1e0fb02fae8603068e70933d2c8ae927b 100644 --- a/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_invoice_new.xml +++ b/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_invoice_new.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="order_items"> <block class="Magento\GroupedProduct\Block\Adminhtml\Items\Column\Name\Grouped" name="column_name_grouped" template="Magento_Sales::items/column/name.phtml" group="column"/> diff --git a/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_invoice_updateqty.xml b/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_invoice_updateqty.xml index 9163161011131e017e4d4a40b87237fb31766103..236cf3b1e0fb02fae8603068e70933d2c8ae927b 100644 --- a/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_invoice_updateqty.xml +++ b/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_invoice_updateqty.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="order_items"> <block class="Magento\GroupedProduct\Block\Adminhtml\Items\Column\Name\Grouped" name="column_name_grouped" template="Magento_Sales::items/column/name.phtml" group="column"/> diff --git a/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_invoice_view.xml b/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_invoice_view.xml index 3a25793d1bce3b2b99c1f120eb66a5cda7211f0e..3b08fe624f5260306f78420554dcde7e43bb30ec 100644 --- a/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_invoice_view.xml +++ b/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_invoice_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="invoice_items"> <block class="Magento\GroupedProduct\Block\Adminhtml\Items\Column\Name\Grouped" name="column_name_grouped" template="Magento_Sales::items/column/name.phtml" group="column"/> diff --git a/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_view.xml b/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_view.xml index 9163161011131e017e4d4a40b87237fb31766103..236cf3b1e0fb02fae8603068e70933d2c8ae927b 100644 --- a/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_view.xml +++ b/app/code/Magento/GroupedProduct/view/adminhtml/layout/sales_order_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="order_items"> <block class="Magento\GroupedProduct\Block\Adminhtml\Items\Column\Name\Grouped" name="column_name_grouped" template="Magento_Sales::items/column/name.phtml" group="column"/> diff --git a/app/code/Magento/GroupedProduct/view/base/layout/catalog_product_prices.xml b/app/code/Magento/GroupedProduct/view/base/layout/catalog_product_prices.xml index f8b871a3cd44176194d1ad64bd1f657cd7343bde..f843c563039f791f817c5460c24ab3c5bd826380 100644 --- a/app/code/Magento/GroupedProduct/view/base/layout/catalog_product_prices.xml +++ b/app/code/Magento/GroupedProduct/view/base/layout/catalog_product_prices.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <referenceBlock name="render.product.prices"> <arguments> <argument name="grouped" xsi:type="array"> 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 354b80d9647eb1c511b88106fbf8a9a2a279ef6c..305f29c01988d01aec9b1475eb155af2b132627a 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 @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <block class="Magento\Framework\Pricing\Render" name="product.price.render.grouped"> <arguments> diff --git a/app/code/Magento/GroupedProduct/view/frontend/layout/catalog_product_view_type_grouped.xml b/app/code/Magento/GroupedProduct/view/frontend/layout/catalog_product_view_type_grouped.xml index 316d7ea133b56331f4e21b50acd4a8a40ea400db..9677b83828ffb4bf1f4f03b993fdccbafdebaf90 100644 --- a/app/code/Magento/GroupedProduct/view/frontend/layout/catalog_product_view_type_grouped.xml +++ b/app/code/Magento/GroupedProduct/view/frontend/layout/catalog_product_view_type_grouped.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <attribute name="class" value="page-product-grouped"/> <referenceContainer name="product.info.form.content"> diff --git a/app/code/Magento/GroupedProduct/view/frontend/layout/checkout_cart_item_renderers.xml b/app/code/Magento/GroupedProduct/view/frontend/layout/checkout_cart_item_renderers.xml index 8044a857c6a3e8863fc2f4299ebc39eb564b7793..295847ff9eb9436c5ae1bf745999603506cb750f 100644 --- a/app/code/Magento/GroupedProduct/view/frontend/layout/checkout_cart_item_renderers.xml +++ b/app/code/Magento/GroupedProduct/view/frontend/layout/checkout_cart_item_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout.cart.item.renderers"> <block class="Magento\GroupedProduct\Block\Cart\Item\Renderer\Grouped" as="grouped" template="Magento_Checkout::cart/item/default.phtml"> diff --git a/app/code/Magento/GroupedProduct/view/frontend/layout/checkout_onepage_review_item_renderers.xml b/app/code/Magento/GroupedProduct/view/frontend/layout/checkout_onepage_review_item_renderers.xml index 1708dc48bb9a588b4b861d02d1e99443b57b35a3..6c527710c3490264b2c874054b47dec558de1abc 100644 --- a/app/code/Magento/GroupedProduct/view/frontend/layout/checkout_onepage_review_item_renderers.xml +++ b/app/code/Magento/GroupedProduct/view/frontend/layout/checkout_onepage_review_item_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout.onepage.review.item.renderers"> <block class="Magento\GroupedProduct\Block\Cart\Item\Renderer\Grouped" as="grouped" template="Magento_Checkout::onepage/review/item.phtml"/> diff --git a/app/code/Magento/GroupedProduct/view/frontend/layout/sales_email_order_creditmemo_renderers.xml b/app/code/Magento/GroupedProduct/view/frontend/layout/sales_email_order_creditmemo_renderers.xml index 7e0ccd724aaffbf35c2e7d45641a8f3c33690bd1..6afee265972d1dfe14f32a3bc46e08458d8eaa8d 100644 --- a/app/code/Magento/GroupedProduct/view/frontend/layout/sales_email_order_creditmemo_renderers.xml +++ b/app/code/Magento/GroupedProduct/view/frontend/layout/sales_email_order_creditmemo_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd" label="Email Creditmemo Items List" design_abstraction="custom"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="Email Creditmemo Items List" design_abstraction="custom"> <body> <referenceBlock name="sales.email.order.creditmemo.renderers"> <block class="Magento\GroupedProduct\Block\Order\Email\Items\Order\Grouped" as="grouped" template="Magento_Sales::email/items/creditmemo/default.phtml"/> diff --git a/app/code/Magento/GroupedProduct/view/frontend/layout/sales_email_order_invoice_renderers.xml b/app/code/Magento/GroupedProduct/view/frontend/layout/sales_email_order_invoice_renderers.xml index b7a5c06d04be7382e9b85138a86a908ab1bd8467..5e172fd3580ba6438a9ec7f351c5b7aad0a00faf 100644 --- a/app/code/Magento/GroupedProduct/view/frontend/layout/sales_email_order_invoice_renderers.xml +++ b/app/code/Magento/GroupedProduct/view/frontend/layout/sales_email_order_invoice_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd" label="Email Invoice Items List" design_abstraction="custom"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="Email Invoice Items List" design_abstraction="custom"> <body> <referenceBlock name="sales.email.order.invoice.renderers"> <block class="Magento\GroupedProduct\Block\Order\Email\Items\Order\Grouped" as="grouped" template="Magento_Sales::email/items/invoice/default.phtml"/> diff --git a/app/code/Magento/GroupedProduct/view/frontend/layout/sales_email_order_renderers.xml b/app/code/Magento/GroupedProduct/view/frontend/layout/sales_email_order_renderers.xml index cd87e699451ea0c51f1f7b35356a3f8b4b9282fe..bea4e4ec2ce8c427bcb431e30f10c168b8a92270 100644 --- a/app/code/Magento/GroupedProduct/view/frontend/layout/sales_email_order_renderers.xml +++ b/app/code/Magento/GroupedProduct/view/frontend/layout/sales_email_order_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd" label="Email Order Items List" design_abstraction="custom"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="Email Order Items List" design_abstraction="custom"> <body> <block name="sales.email.order.renderers"> <block class="Magento\GroupedProduct\Block\Order\Email\Items\Order\Grouped" as="grouped" template="Magento_Sales::email/items/order/default.phtml"/> diff --git a/app/code/Magento/GroupedProduct/view/frontend/layout/sales_guest_invoice.xml b/app/code/Magento/GroupedProduct/view/frontend/layout/sales_guest_invoice.xml index 0993d6c0c5a2cae6ffddb9f40e5669362ae03088..cc19585dfee73ec069577aa7972affc2354e4158 100644 --- a/app/code/Magento/GroupedProduct/view/frontend/layout/sales_guest_invoice.xml +++ b/app/code/Magento/GroupedProduct/view/frontend/layout/sales_guest_invoice.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="sales.order.invoice.renderers"> <block class="Magento\GroupedProduct\Block\Order\Item\Renderer\Grouped" as="grouped" template="Magento_Sales::order/invoice/items/renderer/default.phtml"/> diff --git a/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_creditmemo_renderers.xml b/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_creditmemo_renderers.xml index 977763ddf92ee651c992335753609f534f67438d..29d639ced38ee3de686e7fa2fa70f1dcb8a67c5c 100644 --- a/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_creditmemo_renderers.xml +++ b/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_creditmemo_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="sales.order.creditmemo.renderers"> <block class="Magento\GroupedProduct\Block\Order\Item\Renderer\Grouped" as="grouped" template="Magento_Sales::order/creditmemo/items/renderer/default.phtml"/> diff --git a/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_invoice_renderers.xml b/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_invoice_renderers.xml index 0993d6c0c5a2cae6ffddb9f40e5669362ae03088..cc19585dfee73ec069577aa7972affc2354e4158 100644 --- a/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_invoice_renderers.xml +++ b/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_invoice_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="sales.order.invoice.renderers"> <block class="Magento\GroupedProduct\Block\Order\Item\Renderer\Grouped" as="grouped" template="Magento_Sales::order/invoice/items/renderer/default.phtml"/> diff --git a/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_item_renderers.xml b/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_item_renderers.xml index 5889082eba2c3f69fbe7fc59fb4449d8e9cd9a0b..1c5f6fa444e0de668c4574b729e889569a9efd15 100644 --- a/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_item_renderers.xml +++ b/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_item_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="sales.order.items.renderers"> <block class="Magento\GroupedProduct\Block\Order\Item\Renderer\Grouped" as="grouped" template="Magento_Sales::order/items/renderer/default.phtml"/> diff --git a/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_print_creditmemo_renderers.xml b/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_print_creditmemo_renderers.xml index 84f10691d30c63150c8504457d42033fa0d7d341..6a10e5e348098a76601d4eca2eb92abf5da3095e 100644 --- a/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_print_creditmemo_renderers.xml +++ b/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_print_creditmemo_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="sales.order.print.creditmemo.renderers"> <block class="Magento\GroupedProduct\Block\Order\Item\Renderer\Grouped" as="grouped" template="Magento_Sales::order/creditmemo/items/renderer/default.phtml"/> diff --git a/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_print_invoice_renderers.xml b/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_print_invoice_renderers.xml index 01148809c310fffe54994cf1ae4fd72b4ac2baf9..b1c98cb2ff22769472cda8a354fbbf1cfd4e2f41 100644 --- a/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_print_invoice_renderers.xml +++ b/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_print_invoice_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout.order.print.invoice.renderers"> <block class="Magento\GroupedProduct\Block\Order\Item\Renderer\Grouped" as="grouped" template="Magento_Sales::order/invoice/items/renderer/default.phtml"/> diff --git a/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_print_renderers.xml b/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_print_renderers.xml index 0b3a66b487b94f9677c7de51feca19d896c1728b..bfcb07281b177d4630536e7b1f3334068e4103d9 100644 --- a/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_print_renderers.xml +++ b/app/code/Magento/GroupedProduct/view/frontend/layout/sales_order_print_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="sales.order.print.renderers"> <block class="Magento\GroupedProduct\Block\Order\Item\Renderer\Grouped" as="grouped" template="Magento_Sales::order/items/renderer/default.phtml"/> diff --git a/app/code/Magento/ImportExport/Controller/Adminhtml/Import/Download.php b/app/code/Magento/ImportExport/Controller/Adminhtml/Import/Download.php index 0e7b20fd37bb8869e105406bac030ed364abc9dd..005a2b0cde1212220c2667c47b8445fdc859c141 100644 --- a/app/code/Magento/ImportExport/Controller/Adminhtml/Import/Download.php +++ b/app/code/Magento/ImportExport/Controller/Adminhtml/Import/Download.php @@ -13,7 +13,7 @@ use Magento\Framework\App\Filesystem\DirectoryList; */ class Download extends ImportController { - const SAMPLE_FILES_DIRECTORY = 'Magento/ImportExport/Files/Sample/'; + const SAMPLE_FILES_MODULE = 'Magento_ImportExport'; /** * @var \Magento\Framework\Controller\Result\RawFactory @@ -21,28 +21,43 @@ class Download extends ImportController protected $resultRawFactory; /** - * @var \Magento\Framework\Filesystem\Directory\WriteInterface + * @var \Magento\Framework\Filesystem\Directory\ReadFactory */ - protected $fileDirectory; + protected $readFactory; /** + * @var \Magento\Framework\Module\Dir\Reader + */ + protected $reader; + + /** + * @var \Magento\Framework\App\Response\Http\FileFactory + */ + protected $fileFactory; + + /** + * Constructor + * * @param \Magento\Backend\App\Action\Context $context * @param \Magento\Framework\App\Response\Http\FileFactory $fileFactory * @param \Magento\Framework\Controller\Result\RawFactory $resultRawFactory - * @param \Magento\Framework\Filesystem $filesystem + * @param \Magento\Framework\Filesystem\Directory\ReadFactory $readFactory + * @param \Magento\Framework\Module\Dir\Reader $reader */ public function __construct( \Magento\Backend\App\Action\Context $context, \Magento\Framework\App\Response\Http\FileFactory $fileFactory, \Magento\Framework\Controller\Result\RawFactory $resultRawFactory, - \Magento\Framework\Filesystem $filesystem + \Magento\Framework\Filesystem\Directory\ReadFactory $readFactory, + \Magento\Framework\Module\Dir\Reader $reader ) { parent::__construct( $context ); $this->fileFactory = $fileFactory; $this->resultRawFactory = $resultRawFactory; - $this->fileDirectory = $filesystem->getDirectoryWrite(DirectoryList::MODULES); + $this->readFactory = $readFactory; + $this->reader = $reader; } /** @@ -53,9 +68,12 @@ class Download extends ImportController public function execute() { $fileName = $this->getRequest()->getParam('filename') . '.csv'; - $filePath = self::SAMPLE_FILES_DIRECTORY . $fileName; + $moduleDir = $this->reader->getModuleDir('', self::SAMPLE_FILES_MODULE); + $fileAbsolutePath = $moduleDir . '/' . $fileName; + $directoryRead = $this->readFactory->create($moduleDir); + $filePath = $directoryRead->getRelativePath($fileAbsolutePath); - if (!$this->fileDirectory->isFile($filePath)) { + if (!$directoryRead->isFile($filePath)) { /** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */ $this->messageManager->addError(__('There is no sample file for this entity.')); $resultRedirect = $this->resultRedirectFactory->create(); @@ -63,8 +81,8 @@ class Download extends ImportController return $resultRedirect; } - $fileSize = isset($this->fileDirectory->stat($filePath)['size']) - ? $this->fileDirectory->stat($filePath)['size'] : null; + $fileSize = isset($directoryRead->stat($filePath)['size']) + ? $directoryRead->stat($filePath)['size'] : null; $this->fileFactory->create( $fileName, @@ -76,7 +94,7 @@ class Download extends ImportController /** @var \Magento\Framework\Controller\Result\Raw $resultRaw */ $resultRaw = $this->resultRawFactory->create(); - $resultRaw->setContents($this->fileDirectory->readFile($filePath)); + $resultRaw->setContents($directoryRead->readFile($filePath)); return $resultRaw; } } diff --git a/app/code/Magento/ImportExport/Model/Export/Config/SchemaLocator.php b/app/code/Magento/ImportExport/Model/Export/Config/SchemaLocator.php index 42e7a6d64d3e44c640641388e3617a4d531b04fc..afa3c37f8fe50629e3bc90ac0ca965ec2d5f3387 100644 --- a/app/code/Magento/ImportExport/Model/Export/Config/SchemaLocator.php +++ b/app/code/Magento/ImportExport/Model/Export/Config/SchemaLocator.php @@ -5,6 +5,8 @@ */ namespace Magento\ImportExport\Model\Export\Config; +use Magento\Framework\Module\Dir; + class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface { /** @@ -26,7 +28,7 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface */ public function __construct(\Magento\Framework\Module\Dir\Reader $moduleReader) { - $etcDir = $moduleReader->getModuleDir('etc', 'Magento_ImportExport'); + $etcDir = $moduleReader->getModuleDir(Dir::MODULE_ETC_DIR, 'Magento_ImportExport'); $this->_schema = $etcDir . '/export_merged.xsd'; $this->_perFileSchema = $etcDir . '/export.xsd'; } diff --git a/app/code/Magento/ImportExport/Model/Import/Config/SchemaLocator.php b/app/code/Magento/ImportExport/Model/Import/Config/SchemaLocator.php index 1069137c53b36d5e4732d824269de7df05e21978..e177f067244b5005228b9c1b45280fdacc73d88a 100644 --- a/app/code/Magento/ImportExport/Model/Import/Config/SchemaLocator.php +++ b/app/code/Magento/ImportExport/Model/Import/Config/SchemaLocator.php @@ -5,6 +5,8 @@ */ namespace Magento\ImportExport\Model\Import\Config; +use Magento\Framework\Module\Dir; + class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface { /** @@ -26,7 +28,7 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface */ public function __construct(\Magento\Framework\Module\Dir\Reader $moduleReader) { - $etcDir = $moduleReader->getModuleDir('etc', 'Magento_ImportExport'); + $etcDir = $moduleReader->getModuleDir(Dir::MODULE_ETC_DIR, 'Magento_ImportExport'); $this->_schema = $etcDir . '/import_merged.xsd'; $this->_perFileSchema = $etcDir . '/import.xsd'; } diff --git a/app/code/Magento/ImportExport/Test/Unit/Model/Export/Config/XsdTest.php b/app/code/Magento/ImportExport/Test/Unit/Model/Export/Config/XsdTest.php index acdebb5b30cd784ebf7a4e0ed41a4d7c539900d2..9bab6984238fcc950bc1dca34ecf7bad915bc922 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Model/Export/Config/XsdTest.php +++ b/app/code/Magento/ImportExport/Test/Unit/Model/Export/Config/XsdTest.php @@ -14,13 +14,14 @@ class XsdTest extends \PHPUnit_Framework_TestCase protected $_xsdSchemaPath; /** - * @var \Magento\TestFramework\Utility\XsdValidator + * @var \Magento\Framework\TestFramework\Unit\Utility\XsdValidator */ protected $_xsdValidator; protected function setUp() { - $this->_xsdSchemaPath = BP . '/app/code/Magento/ImportExport/etc/'; + $urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + $this->_xsdSchemaPath = $urnResolver->getRealPath('urn:magento:module:Magento_ImportExport:etc/'); $this->_xsdValidator = new \Magento\Framework\TestFramework\Unit\Utility\XsdValidator(); } diff --git a/app/code/Magento/ImportExport/Test/Unit/Model/Export/Config/_files/export.xml b/app/code/Magento/ImportExport/Test/Unit/Model/Export/Config/_files/export.xml index ac89b170c99aeea80898e15aa7eaba5e02c22ef5..8cd0f31a7662e92c65af4ced1bbf428f6e37423c 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Model/Export/Config/_files/export.xml +++ b/app/code/Magento/ImportExport/Test/Unit/Model/Export/Config/_files/export.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/ImportExport/etc/export.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_ImportExport:etc/export.xsd"> <entity name="product" label="Label_One" model="Model_One" entityAttributeFilterType="product"/> <entity name="customer" label="Label_One" model="Model_One" entityAttributeFilterType="customer"/> <entityType entity="customer" name="type_one" model="Model_Type_One" /> diff --git a/app/code/Magento/ImportExport/Test/Unit/Model/Export/Config/_files/export_merged_valid.xml b/app/code/Magento/ImportExport/Test/Unit/Model/Export/Config/_files/export_merged_valid.xml index dec2cb006e1df99d92e2229719374800ac385e74..0f2e678dc86adb1a71ea868400e316aa2d188f92 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Model/Export/Config/_files/export_merged_valid.xml +++ b/app/code/Magento/ImportExport/Test/Unit/Model/Export/Config/_files/export_merged_valid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/ImportExport/etc/export_merged.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_ImportExport:etc/export_merged.xsd"> <entity name="Entity_Name" label="Label_One" model="Model_One" entityAttributeFilterType="Entity_Name" /> <entityType entity="Entity_Name" name="productType_Name" model="Model_Two" /> <fileFormat name="file_Name" label="Label_Three" model="Model_Three" /> diff --git a/app/code/Magento/ImportExport/Test/Unit/Model/Export/Config/_files/export_valid.xml b/app/code/Magento/ImportExport/Test/Unit/Model/Export/Config/_files/export_valid.xml index 6fbc7200258b3f7ba6c4108a85cf16c6b93cd26e..1959b09c67a5c75253f7121754aabc23c6490619 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Model/Export/Config/_files/export_valid.xml +++ b/app/code/Magento/ImportExport/Test/Unit/Model/Export/Config/_files/export_valid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/ImportExport/etc/export.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_ImportExport:etc/export.xsd"> <entity name="name_one" label="Label_One" model="Model_One" entityAttributeFilterType="name_one"/> <entity name="name_two" entityAttributeFilterType="name_two"/> <entityType entity="name_one" name="name_two" model="Model_Two" /> diff --git a/app/code/Magento/ImportExport/Test/Unit/Model/Export/Config/_files/invalidExportMergedXmlArray.php b/app/code/Magento/ImportExport/Test/Unit/Model/Export/Config/_files/invalidExportMergedXmlArray.php index d63c611453509092e1034ccbf06321c17f36ca5a..a8511bbf84df1f57cc9d5405c3b808399a9f108d 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Model/Export/Config/_files/invalidExportMergedXmlArray.php +++ b/app/code/Magento/ImportExport/Test/Unit/Model/Export/Config/_files/invalidExportMergedXmlArray.php @@ -8,9 +8,9 @@ return [ '<?xml version="1.0"?><config><fileFormat label="name_one" model="model"/><fileFormat name="name_one" ' . 'model="model"/><fileFormat name="name" label="model"/></config>', [ - "Element 'fileFormat': The attribute 'name' is required but missing.", - "Element 'fileFormat': The " . "attribute 'label' is required but missing.", - "Element 'fileFormat': The attribute 'model' is required but " . "missing." + "Element 'fileFormat': The attribute 'name' is required but missing.\nLine: 1\n", + "Element 'fileFormat': The " . "attribute 'label' is required but missing.\nLine: 1\n", + "Element 'fileFormat': The attribute 'model' is required but " . "missing.\nLine: 1\n" ], ], 'entity_node_with_required_attribute' => [ @@ -19,10 +19,10 @@ return [ '<entity label="name" name="model" entityAttributeFilterType="name_three"/>' . '<entity label="name" name="model_two" model="model"/></config>', [ - "Element 'entity': The attribute 'name' is required but missing.", - "Element 'entity': The attribute " . "'label' is required but missing.", - "Element 'entity': The attribute 'model' is required but missing.", - "Element 'entity': The attribute 'entityAttributeFilterType' is required but missing." + "Element 'entity': The attribute 'name' is required but missing.\nLine: 1\n", + "Element 'entity': The attribute " . "'label' is required but missing.\nLine: 1\n", + "Element 'entity': The attribute 'model' is required but missing.\nLine: 1\n", + "Element 'entity': The attribute 'entityAttributeFilterType' is required but missing.\nLine: 1\n" ], ] ]; diff --git a/app/code/Magento/ImportExport/Test/Unit/Model/Export/Config/_files/invalidExportXmlArray.php b/app/code/Magento/ImportExport/Test/Unit/Model/Export/Config/_files/invalidExportXmlArray.php index 8497f0f35a33afce859cf513448316d683c66817..edbe084cb83b3c242ae0e42fb80d49df7780fa21 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Model/Export/Config/_files/invalidExportXmlArray.php +++ b/app/code/Magento/ImportExport/Test/Unit/Model/Export/Config/_files/invalidExportXmlArray.php @@ -9,14 +9,14 @@ return [ . '<entity name="name_one" entityAttributeFilterType="name_one"/></config>', [ "Element 'entity': Duplicate key-sequence ['name_one'] in unique identity-constraint " . - "'uniqueEntityName'." + "'uniqueEntityName'.\nLine: 1\n" ], ], 'export_fileFormat_name_must_be_unique' => [ '<?xml version="1.0"?><config><fileFormat name="name_one" /><fileFormat name="name_one" /></config>', [ "Element 'fileFormat': Duplicate key-sequence ['name_one'] in unique identity-constraint " . - "'uniqueFileFormatName'." + "'uniqueFileFormatName'.\nLine: 1\n" ], ], 'attributes_with_type_modelName_and_invalid_value' => [ @@ -25,32 +25,33 @@ return [ . ' <fileFormat name="name_one" model="model1"/></config>', [ "Element 'entityType', attribute 'model': [facet 'pattern'] The value '1' is not accepted by the " . - "pattern '[A-Za-z_\\\\\\\\]+'.", - "Element 'entityType', attribute 'model': '1' is not a valid value of the atomic " . "type 'modelName'.", + "pattern '[A-Za-z_\\\\\\\\]+'.\nLine: 1\n", + "Element 'entityType', attribute 'model': '1' is not a valid value of the atomic type" . + " 'modelName'.\nLine: 1\n", "Element 'fileFormat', attribute 'model': [facet 'pattern'] The value 'model1' is not " . - "accepted by the pattern '[A-Za-z_\\\\\\\\]+'.", + "accepted by the pattern '[A-Za-z_\\\\\\\\]+'.\nLine: 1\n", "Element 'fileFormat', attribute 'model': 'model1' is not a valid " . - "value of the atomic type 'modelName'." + "value of the atomic type 'modelName'.\nLine: 1\n" ], ], 'productType_node_with_required_attribute' => [ '<?xml version="1.0"?><config><entityType entity="name_one" name="name_one" />' . '<entityType entity="name_one" model="model" /></config>', [ - "Element 'entityType': The attribute 'model' is required but missing.", - "Element 'entityType': " . "The attribute 'name' is required but missing." + "Element 'entityType': The attribute 'model' is required but missing.\nLine: 1\n", + "Element 'entityType': " . "The attribute 'name' is required but missing.\nLine: 1\n" ], ], 'fileFormat_node_with_required_attribute' => [ '<?xml version="1.0"?><config><fileFormat label="name_one" /></config>', - ["Element 'fileFormat': The attribute 'name' is required but missing."], + ["Element 'fileFormat': The attribute 'name' is required but missing.\nLine: 1\n"], ], 'entity_node_with_required_attribute' => [ '<?xml version="1.0"?><config><entity label="name_one" entityAttributeFilterType="name_one"/></config>', - ["Element 'entity': The attribute 'name' is required but missing."], + ["Element 'entity': The attribute 'name' is required but missing.\nLine: 1\n"], ], 'entity_node_with_missing_filter_type_attribute' => [ '<?xml version="1.0"?><config><entity label="name_one" name="name_one"/></config>', - ["Element 'entity': The attribute 'entityAttributeFilterType' is required but missing."], + ["Element 'entity': The attribute 'entityAttributeFilterType' is required but missing.\nLine: 1\n"], ] ]; diff --git a/app/code/Magento/ImportExport/Test/Unit/Model/Import/Config/XsdMergedTest.php b/app/code/Magento/ImportExport/Test/Unit/Model/Import/Config/XsdMergedTest.php index dd30b487180c5e4d90c7e3d8a4a2417a73b84c7a..87f7f40853d20b13d198d6b7d02104b440f1abcc 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Model/Import/Config/XsdMergedTest.php +++ b/app/code/Magento/ImportExport/Test/Unit/Model/Import/Config/XsdMergedTest.php @@ -14,15 +14,14 @@ class XsdMergedTest extends \PHPUnit_Framework_TestCase protected $_xsdSchema; /** - * @var \Magento\TestFramework\Utility\XsdValidator + * @var \Magento\Framework\TestFramework\Unit\Utility\XsdValidator */ protected $_xsdValidator; protected function setUp() { - $this->_xsdSchema = realpath( - __DIR__ . '/../../../../../../../../../app/code/Magento/ImportExport/etc/import_merged.xsd' - ); + $urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + $this->_xsdSchema = $urnResolver->getRealPath('urn:magento:module:Magento_ImportExport:etc/import_merged.xsd'); $this->_xsdValidator = new \Magento\Framework\TestFramework\Unit\Utility\XsdValidator(); } diff --git a/app/code/Magento/ImportExport/Test/Unit/Model/Import/Config/XsdTest.php b/app/code/Magento/ImportExport/Test/Unit/Model/Import/Config/XsdTest.php index d85c7d474e98a086a8f35665f5c354dbdecb40f8..8f69612e348ab982e3e9271fe589b374f13245f8 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Model/Import/Config/XsdTest.php +++ b/app/code/Magento/ImportExport/Test/Unit/Model/Import/Config/XsdTest.php @@ -14,13 +14,14 @@ class XsdTest extends \PHPUnit_Framework_TestCase protected $_xsdSchema; /** - * @var \Magento\TestFramework\Utility\XsdValidator + * @var \Magento\Framework\TestFramework\Unit\Utility\XsdValidator */ protected $_xsdValidator; protected function setUp() { - $this->_xsdSchema = BP . '/app/code/Magento/ImportExport/etc/import.xsd'; + $urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + $this->_xsdSchema = $urnResolver->getRealPath('urn:magento:module:Magento_ImportExport:etc/import.xsd'); $this->_xsdValidator = new \Magento\Framework\TestFramework\Unit\Utility\XsdValidator(); } diff --git a/app/code/Magento/ImportExport/Test/Unit/Model/Import/Config/_files/import.xml b/app/code/Magento/ImportExport/Test/Unit/Model/Import/Config/_files/import.xml index 4425e69c434d5ea2e65e5c22f9bbc65d218b04c3..e289b33b54d1214546c220af3f08b74bc82eee45 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Model/Import/Config/_files/import.xml +++ b/app/code/Magento/ImportExport/Test/Unit/Model/Import/Config/_files/import.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/ImportExport/etc/import.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_ImportExport:etc/import.xsd"> <entity name="product" label="Label_One" model="Model_One" behaviorModel="Model_Basic" /> <entity name="customer" label="Label_One" model="Model_One" behaviorModel="Model_Basic" /> <entityType entity="customer" name="customer_type_one" model="Customer_Type_One" /> diff --git a/app/code/Magento/ImportExport/Test/Unit/Model/Import/Config/_files/invalidImportMergedXmlArray.php b/app/code/Magento/ImportExport/Test/Unit/Model/Import/Config/_files/invalidImportMergedXmlArray.php index 0206bb4364cc53b6c326769eadcba2b3c6ea9484..bd6c7a2f22ae34c03f317c757e87f739b839fa4e 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Model/Import/Config/_files/invalidImportMergedXmlArray.php +++ b/app/code/Magento/ImportExport/Test/Unit/Model/Import/Config/_files/invalidImportMergedXmlArray.php @@ -6,32 +6,33 @@ return [ 'entity_without_required_name' => [ '<?xml version="1.0"?><config><entity label="test" model="test" behaviorModel="test" /></config>', - ["Element 'entity': The attribute 'name' is required but missing."], + ["Element 'entity': The attribute 'name' is required but missing.\nLine: 1\n"], ], 'entity_without_required_label' => [ '<?xml version="1.0"?><config><entity name="test_name" model="test" behaviorModel="test" /></config>', - ["Element 'entity': The attribute 'label' is required but missing."], + ["Element 'entity': The attribute 'label' is required but missing.\nLine: 1\n"], ], 'entity_without_required_behaviormodel' => [ '<?xml version="1.0"?><config><entity name="test_name" label="test_label" model="test" /></config>', - ["Element 'entity': The attribute 'behaviorModel' is required but missing."], + ["Element 'entity': The attribute 'behaviorModel' is required but missing.\nLine: 1\n"], ], 'entity_without_required_model' => [ '<?xml version="1.0"?><config><entity name="test_name" label="test_label" behaviorModel="test" /></config>', - ["Element 'entity': The attribute 'model' is required but missing."], + ["Element 'entity': The attribute 'model' is required but missing.\nLine: 1\n"], ], 'entity_with_notallowed_atrribute' => [ '<?xml version="1.0"?><config><entity name="test_name" label="test_label" ' . 'model="test" behaviorModel="test" notallowed="text" /></config>', - ["Element 'entity', attribute 'notallowed': The attribute 'notallowed' is not allowed."], + ["Element 'entity', attribute 'notallowed': The attribute 'notallowed' is not allowed.\nLine: 1\n"], ], 'entity_model_with_invalid_value' => [ '<?xml version="1.0"?><config><entity name="test_name" label="test_label" model="afwer34" ' . 'behaviorModel="test" /></config>', [ "Element 'entity', attribute 'model': [facet 'pattern'] The value 'afwer34' is not " . - "accepted by the pattern '[A-Za-z_\\\\\\\\]+'.", - "Element 'entity', attribute 'model': 'afwer34' is not a valid value of the atomic type 'modelName'." + "accepted by the pattern '[A-Za-z_\\\\\\\\]+'.\nLine: 1\n", + "Element 'entity', attribute 'model': 'afwer34' is not a valid value of the atomic type" . + " 'modelName'.\nLine: 1\n" ], ], 'entity_behaviorModel_with_invalid_value' => [ @@ -39,8 +40,9 @@ return [ '</config>', [ "Element 'entity', attribute 'behaviorModel': [facet 'pattern'] The value '666' is not accepted by " . - "the pattern '[A-Za-z_\\\\\\\\]+'.", - "Element 'entity', attribute 'behaviorModel': '666' is not a valid value of the atomic type 'modelName'." + "the pattern '[A-Za-z_\\\\\\\\]+'.\nLine: 1\n", + "Element 'entity', attribute 'behaviorModel': '666' is not a valid value of the atomic type" . + " 'modelName'.\nLine: 1\n" ], ] ]; diff --git a/app/code/Magento/ImportExport/Test/Unit/Model/Import/Config/_files/invalidImportXmlArray.php b/app/code/Magento/ImportExport/Test/Unit/Model/Import/Config/_files/invalidImportXmlArray.php index ac42c94aee52011e2322467fe571d504c32d4674..9267bd2f4a795021bb29cc3749115b26d00a0073 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Model/Import/Config/_files/invalidImportXmlArray.php +++ b/app/code/Magento/ImportExport/Test/Unit/Model/Import/Config/_files/invalidImportXmlArray.php @@ -8,52 +8,55 @@ return [ '<?xml version="1.0"?><config><entity name="same_name"/><entity name="same_name"/></config>', [ "Element 'entity': Duplicate key-sequence ['same_name'] in unique " . - "identity-constraint 'uniqueEntityName'." + "identity-constraint 'uniqueEntityName'.\nLine: 1\n" ], ], 'entity_without_required_name_attribute' => [ '<?xml version="1.0"?><config><entity /></config>', - ["Element 'entity': The attribute 'name' is required but missing."], + ["Element 'entity': The attribute 'name' is required but missing.\nLine: 1\n"], ], 'entity_with_invalid_model_value' => [ '<?xml version="1.0"?><config><entity name="some_name" model="12345"/></config>', [ "Element 'entity', attribute 'model': [facet 'pattern'] The value '12345' is not accepted by " . - "the pattern '[A-Za-z_\\\\\\\\]+'.", - "Element 'entity', attribute 'model': '12345' is not a valid value of the atomic type 'modelName'." + "the pattern '[A-Za-z_\\\\\\\\]+'.\nLine: 1\n", + "Element 'entity', attribute 'model': '12345' is not a valid value of the atomic type" . + " 'modelName'.\nLine: 1\n" ], ], 'entity_with_invalid_behaviormodel_value' => [ '<?xml version="1.0"?><config><entity name="some_name" behaviorModel="=--09"/></config>', [ "Element 'entity', attribute 'behaviorModel': [facet 'pattern'] The value '=--09' is not " . - "accepted by the pattern '[A-Za-z_\\\\\\\\]+'.", - "Element 'entity', attribute 'behaviorModel': '=--09' is not a valid value of the atomic type 'modelName'." + "accepted by the pattern '[A-Za-z_\\\\\\\\]+'.\nLine: 1\n", + "Element 'entity', attribute 'behaviorModel': '=--09' is not a valid value of the atomic type" . + " 'modelName'.\nLine: 1\n" ], ], 'entity_with_notallowed_attribute' => [ '<?xml version="1.0"?><config><entity name="some_name" notallowd="aasd"/></config>', - ["Element 'entity', attribute 'notallowd': The attribute 'notallowd' is not allowed."], + ["Element 'entity', attribute 'notallowd': The attribute 'notallowd' is not allowed.\nLine: 1\n"], ], 'entitytype_without_required_name_attribute' => [ '<?xml version="1.0"?><config><entityType entity="entity_name" model="model_name" /></config>', - ["Element 'entityType': The attribute 'name' is required but missing."], + ["Element 'entityType': The attribute 'name' is required but missing.\nLine: 1\n"], ], 'entitytype_without_required_model_attribute' => [ '<?xml version="1.0"?><config><entityType entity="entity_name" name="some_name" /></config>', - ["Element 'entityType': The attribute 'model' is required but missing."], + ["Element 'entityType': The attribute 'model' is required but missing.\nLine: 1\n"], ], 'entitytype_with_invalid_model_attribute_value' => [ '<?xml version="1.0"?><config><entityType entity="entity_name" name="some_name" model="test1"/></config>', [ "Element 'entityType', attribute 'model': [facet 'pattern'] The value 'test1' is not " . - "accepted by the pattern '[A-Za-z_\\\\\\\\]+'.", - "Element 'entityType', attribute 'model': 'test1' is not a valid value of the atomic type 'modelName'." + "accepted by the pattern '[A-Za-z_\\\\\\\\]+'.\nLine: 1\n", + "Element 'entityType', attribute 'model': 'test1' is not a valid value of the atomic type" . + " 'modelName'.\nLine: 1\n" ], ], 'entitytype_with_notallowed' => [ '<?xml version="1.0"?><config><entityType entity="entity_name" name="some_name" ' . 'model="test" notallowed="test"/></config>', - ["Element 'entityType', attribute 'notallowed': The attribute 'notallowed' is not allowed."], + ["Element 'entityType', attribute 'notallowed': The attribute 'notallowed' is not allowed.\nLine: 1\n"], ] ]; diff --git a/app/code/Magento/ImportExport/Test/Unit/Model/Import/Config/_files/valid_import.xml b/app/code/Magento/ImportExport/Test/Unit/Model/Import/Config/_files/valid_import.xml index 7ea86368cae67608fb60dd9087194e8a79942755..cc053c70edbe1941b7d8ef19cb94fb5019820038 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Model/Import/Config/_files/valid_import.xml +++ b/app/code/Magento/ImportExport/Test/Unit/Model/Import/Config/_files/valid_import.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/ImportExport/etc/import.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_ImportExport:etc/import.xsd"> <entity name="test_name" label="Some Label" model="test_Model_name" behaviorModel="Test_value" /> <entityType entity="test_name" name="product_type" model="Test_Model_value" /> <relatedIndexer entity="test_name" name="product_type" /> diff --git a/app/code/Magento/ImportExport/Test/Unit/Model/Import/Config/_files/valid_import_merged.xml b/app/code/Magento/ImportExport/Test/Unit/Model/Import/Config/_files/valid_import_merged.xml index b06092c72578f49db9a6c75f56a3d5ce3e2d701c..f08f337e456c071dfdd7d0d4097aee830bb3022d 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Model/Import/Config/_files/valid_import_merged.xml +++ b/app/code/Magento/ImportExport/Test/Unit/Model/Import/Config/_files/valid_import_merged.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/ImportExport/etc/import_merged.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_ImportExport:etc/import_merged.xsd"> <entity name="test_name" label="test_label" model="test" behaviorModel="test" /> <entity name="test_name2" label="test_label" model="test" behaviorModel="test" /> </config> diff --git a/app/code/Magento/ImportExport/Test/Unit/Model/Import/Source/ZipTest.php b/app/code/Magento/ImportExport/Test/Unit/Model/Import/Source/ZipTest.php index bc92564b228e06d04005e9e64558c85f90858a10..70ae2cfe83f94de91c00f67b46f066463c9e02ac 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Model/Import/Source/ZipTest.php +++ b/app/code/Magento/ImportExport/Test/Unit/Model/Import/Source/ZipTest.php @@ -26,13 +26,6 @@ class ZipTest extends \PHPUnit_Framework_TestCase ->getMock(); } - public function testConstructorInternalCalls() - { - $this->directory->expects($this->any())->method('getRelativePath'); - $fileName = 'test_file'; - $this->_invokeConstructor($fileName); - } - /** * Test destination argument for the second getRelativePath after preg_replace. * diff --git a/app/code/Magento/ImportExport/composer.json b/app/code/Magento/ImportExport/composer.json index 87c4889fb8f8f09f85be7680a629219f6a1ceaf5..e5c6a6ad71de3de044da333deda709fc5f17bcd4 100644 --- a/app/code/Magento/ImportExport/composer.json +++ b/app/code/Magento/ImportExport/composer.json @@ -9,8 +9,7 @@ "magento/module-media-storage": "1.0.0-beta", "magento/module-user": "1.0.0-beta", "magento/framework": "1.0.0-beta", - "ext-ctype": "*", - "magento/magento-composer-installer": "*" + "ext-ctype": "*" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -18,12 +17,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/ImportExport" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\ImportExport\\": "" + } } } diff --git a/app/code/Magento/ImportExport/etc/acl.xml b/app/code/Magento/ImportExport/etc/acl.xml index 97de970293e9aad22053bb89dc9608aa9bc5c164..1bb96e00ef37095f3f9d119b6fbf59827a1af57a 100644 --- a/app/code/Magento/ImportExport/etc/acl.xml +++ b/app/code/Magento/ImportExport/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/app/code/Magento/ImportExport/etc/adminhtml/menu.xml b/app/code/Magento/ImportExport/etc/adminhtml/menu.xml index 4f85b6a0eab68c3ee3047f9c8dbcb782a9a4d079..d8dea48c5940f1dacaea6fb822260f3b0a47240a 100644 --- a/app/code/Magento/ImportExport/etc/adminhtml/menu.xml +++ b/app/code/Magento/ImportExport/etc/adminhtml/menu.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Backend/etc/menu.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd"> <menu> <add id="Magento_ImportExport::system_convert_import" title="Import" module="Magento_ImportExport" sortOrder="10" parent="Magento_Backend::system_convert" action="adminhtml/import" resource="Magento_ImportExport::import"/> <add id="Magento_ImportExport::system_convert_export" title="Export" module="Magento_ImportExport" sortOrder="20" parent="Magento_Backend::system_convert" action="adminhtml/export" resource="Magento_ImportExport::export"/> diff --git a/app/code/Magento/ImportExport/etc/adminhtml/routes.xml b/app/code/Magento/ImportExport/etc/adminhtml/routes.xml index 34c4c0dfdd7daebc9a659e4a13f011e48d4750d5..9fb7b287eb1a568377a34eb98b01e2552c1170b6 100644 --- a/app/code/Magento/ImportExport/etc/adminhtml/routes.xml +++ b/app/code/Magento/ImportExport/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="admin"> <route id="adminhtml"> <module name="Magento_ImportExport" before="Magento_Backend" /> diff --git a/app/code/Magento/ImportExport/etc/config.xml b/app/code/Magento/ImportExport/etc/config.xml index b10fbc4e34c2cfe47314390998c47d13001f77a6..cffd510ef0663210093fbf211dfb997772024d69 100644 --- a/app/code/Magento/ImportExport/etc/config.xml +++ b/app/code/Magento/ImportExport/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <general> <file> diff --git a/app/code/Magento/ImportExport/etc/di.xml b/app/code/Magento/ImportExport/etc/di.xml index 88e5915a35a2e75b3b94e0978db8cbaf7a69e0e3..5e32b04aff2139f731e57d202b4298585721ebf3 100644 --- a/app/code/Magento/ImportExport/etc/di.xml +++ b/app/code/Magento/ImportExport/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\ImportExport\Model\Import\ConfigInterface" type="Magento\ImportExport\Model\Import\Config" /> <preference for="Magento\ImportExport\Model\Export\ConfigInterface" type="Magento\ImportExport\Model\Export\Config" /> <preference for="Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface" type="Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregator" /> diff --git a/app/code/Magento/ImportExport/etc/module.xml b/app/code/Magento/ImportExport/etc/module.xml index e072148a1dd4b61376b2398dae5f3012e8d60da4..c91668e5ec3eba44fc8453fe8f4fb526b20feee6 100644 --- a/app/code/Magento/ImportExport/etc/module.xml +++ b/app/code/Magento/ImportExport/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_ImportExport" setup_version="2.0.1"> </module> </config> diff --git a/app/code/Magento/ImportExport/registration.php b/app/code/Magento/ImportExport/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..3a28c6ca75a7e612d7175e40ceeebc0ade8022cf --- /dev/null +++ b/app/code/Magento/ImportExport/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_ImportExport', + __DIR__ +); diff --git a/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_export_getfilter.xml b/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_export_getfilter.xml index 60170bf77ce21f80b594d8d04650537c02e24f54..cd6bda2493929a9570b7e6cefc623077066b6464 100644 --- a/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_export_getfilter.xml +++ b/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_export_getfilter.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root" label="Root"> <block class="Magento\ImportExport\Block\Adminhtml\Export\Filter" name="export.filter"/> <block class="Magento\Backend\Block\Template" template="Magento_ImportExport::export/form/filter/after.phtml" name="export.form.after" as="form_after"/> diff --git a/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_export_index.xml b/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_export_index.xml index f57ce86cd3fd619e7084a1d3393d0ad54ddd3356..76c5bb7ea97b84d6ea93ddaba44b2383e6ce6548 100644 --- a/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_export_index.xml +++ b/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_export_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Backend\Block\Template" template="Magento_ImportExport::export/form/before.phtml" name="export.form.before" as="form_before"/> diff --git a/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_history_grid_block.xml b/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_history_grid_block.xml index 22df8f655b3da46c9f40f5f3d763ed00c1c9af8c..1090bf46ecc0e24e971b9afa320f8bb5414573f6 100644 --- a/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_history_grid_block.xml +++ b/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_history_grid_block.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="adminhtml.import.history.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.import.history.grid" as="grid"> diff --git a/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_history_index.xml b/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_history_index.xml index dfdf5891b292a7b727de38a4f7f87fe257eeb354..f90188632ced46d39e3ea4e6799763cf40c49dac 100644 --- a/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_history_index.xml +++ b/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_history_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="formkey"/> <update handle="adminhtml_history_grid_block"/> <body> diff --git a/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_import_busy.xml b/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_import_busy.xml index 3d2a3d116c780c1c6d75966038cbb8d812c87a61..1a069769db5392b3879cad1b6dba79843ddac795 100644 --- a/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_import_busy.xml +++ b/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_import_busy.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Framework\View\Element\Template" template="Magento_ImportExport::busy.phtml" name="busy" as="busy"/> diff --git a/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_import_index.xml b/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_import_index.xml index 2168ec3cd341669991714fb7a59f11a69a2e8486..197f26ad3bae143bd5ecb3c55c7e5d09adc1d6f1 100644 --- a/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_import_index.xml +++ b/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_import_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <css src="Magento_ImportExport::css/importexport.css"/> </head> diff --git a/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_import_start.xml b/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_import_start.xml index 1de628d559f513fc911439130266517e3da7523f..f50c4aab54fa21a5b7eb44d97a3e9954bb7c0ebc 100644 --- a/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_import_start.xml +++ b/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_import_start.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root"> <block class="Magento\ImportExport\Block\Adminhtml\Import\Frame\Result" template="import/frame/result.phtml" name="import.frame.result" as="import_frame_result"/> </container> diff --git a/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_import_validate.xml b/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_import_validate.xml index 1de628d559f513fc911439130266517e3da7523f..f50c4aab54fa21a5b7eb44d97a3e9954bb7c0ebc 100644 --- a/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_import_validate.xml +++ b/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_import_validate.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root"> <block class="Magento\ImportExport\Block\Adminhtml\Import\Frame\Result" template="import/frame/result.phtml" name="import.frame.result" as="import_frame_result"/> </container> diff --git a/app/code/Magento/Indexer/composer.json b/app/code/Magento/Indexer/composer.json index be34cc4abf04af44c6afb4cda3730bcee9fe609c..4f2fdeb3359d4c27661b47542e29b76d11bab4ed 100644 --- a/app/code/Magento/Indexer/composer.json +++ b/app/code/Magento/Indexer/composer.json @@ -5,8 +5,7 @@ "php": "~5.5.0|~5.6.0|~7.0.0", "magento/module-backend": "1.0.0-beta", "magento/module-page-cache": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -14,12 +13,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Indexer" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Indexer\\": "" + } } } diff --git a/app/code/Magento/Indexer/etc/acl.xml b/app/code/Magento/Indexer/etc/acl.xml index bc1801d89cf8320e0524485832b2b2d241321906..7fcb2a4a9114425e3c0a4483a744e5bec4b34c5a 100644 --- a/app/code/Magento/Indexer/etc/acl.xml +++ b/app/code/Magento/Indexer/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/app/code/Magento/Indexer/etc/adminhtml/di.xml b/app/code/Magento/Indexer/etc/adminhtml/di.xml index c31dc932055e9c923a6717fdc5a3dd59bbc9e9c0..4f7eb242ba604cd563bbf1a6220b850cce7ceb34 100644 --- a/app/code/Magento/Indexer/etc/adminhtml/di.xml +++ b/app/code/Magento/Indexer/etc/adminhtml/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Framework\Notification\MessageList"> <arguments> <argument name="messages" xsi:type="array"> diff --git a/app/code/Magento/Indexer/etc/adminhtml/menu.xml b/app/code/Magento/Indexer/etc/adminhtml/menu.xml index cc7ed2928d2b788fe0c2785a431a7188dbd3a61c..cfc7847543179858e1c657810cb6347e8ca8ccb6 100644 --- a/app/code/Magento/Indexer/etc/adminhtml/menu.xml +++ b/app/code/Magento/Indexer/etc/adminhtml/menu.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Backend/etc/menu.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd"> <menu> <add id="Magento_Indexer::system_index" title="Index Management" module="Magento_Indexer" sortOrder="30" parent="Magento_Backend::system_tools" action="indexer/indexer/list" resource="Magento_Indexer::index"/> </menu> diff --git a/app/code/Magento/Indexer/etc/adminhtml/routes.xml b/app/code/Magento/Indexer/etc/adminhtml/routes.xml index 9e96efa28bcd164b4045c9ae7df7504c62036d5a..823b2e53cbc1256f5afc56ed1ef1dfa5fd56a166 100644 --- a/app/code/Magento/Indexer/etc/adminhtml/routes.xml +++ b/app/code/Magento/Indexer/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn: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/etc/cron_groups.xml b/app/code/Magento/Indexer/etc/cron_groups.xml index b805750e286f79c7ea6207096a99bfa5ff1d0b21..d4f2039ebdf4e1fdf58bb43032d137e398ca27cf 100644 --- a/app/code/Magento/Indexer/etc/cron_groups.xml +++ b/app/code/Magento/Indexer/etc/cron_groups.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Cron/etc/cron_groups.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/cron_groups.xsd"> <group id="index"> <schedule_generate_every>1</schedule_generate_every> <schedule_ahead_for>4</schedule_ahead_for> diff --git a/app/code/Magento/Indexer/etc/crontab.xml b/app/code/Magento/Indexer/etc/crontab.xml index 8ca689d30b292a80e2d00a57f01793aa188e91db..3207766e31c0f678b24e2024bcee607a52849952 100644 --- a/app/code/Magento/Indexer/etc/crontab.xml +++ b/app/code/Magento/Indexer/etc/crontab.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Cron/etc/crontab.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd"> <group id="index"> <job name="indexer_reindex_all_invalid" instance="Magento\Indexer\Cron\ReindexAllInvalid" method="execute"> <schedule>* * * * *</schedule> diff --git a/app/code/Magento/Indexer/etc/di.xml b/app/code/Magento/Indexer/etc/di.xml index cc0c4ff9b1f1b9551a2fd923ebba03d8d8f0c046..c747d46970eb31987def9d9d21e82e4edcb935a7 100644 --- a/app/code/Magento/Indexer/etc/di.xml +++ b/app/code/Magento/Indexer/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Framework\Mview\View\State\CollectionInterface" type="Magento\Indexer\Model\Resource\Mview\View\State\Collection" /> <preference for="Magento\Framework\Mview\View\StateInterface" type="Magento\Indexer\Model\Mview\View\State" /> <preference for="Magento\Framework\Indexer\ConfigInterface" type="Magento\Indexer\Model\Config" /> diff --git a/app/code/Magento/Indexer/etc/module.xml b/app/code/Magento/Indexer/etc/module.xml index 7d12e5d98535c1d04bb5ed7a7c3f8ec6eb779818..0426c33adbc33eabd5377ec85ac85b390b5e8b20 100644 --- a/app/code/Magento/Indexer/etc/module.xml +++ b/app/code/Magento/Indexer/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Indexer" setup_version="2.0.0"> <sequence> <module name="Magento_Store"/> diff --git a/app/code/Magento/Indexer/registration.php b/app/code/Magento/Indexer/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..ace398cb5f98d58918b068f187678aa6e5f674fb --- /dev/null +++ b/app/code/Magento/Indexer/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Indexer', + __DIR__ +); diff --git a/app/code/Magento/Indexer/view/adminhtml/layout/indexer_indexer_list.xml b/app/code/Magento/Indexer/view/adminhtml/layout/indexer_indexer_list.xml index 4a0dac088eee9f867e6958d2308d97b74ce69558..6628592b0abd8f8874d43a3d4e337d342b3a5590 100644 --- a/app/code/Magento/Indexer/view/adminhtml/layout/indexer_indexer_list.xml +++ b/app/code/Magento/Indexer/view/adminhtml/layout/indexer_indexer_list.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="indexer_indexer_list_grid"/> <body> <referenceContainer name="content"> 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 fcf4e057c39beeddaf1f1bc068893acd919f7036..ecce5072b13c0580a67553cb5ab1823a6b5fa5f6 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 @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="adminhtml.indexer.grid.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.indexer.grid" as="grid"> diff --git a/app/code/Magento/Integration/Model/Config/Integration/SchemaLocator.php b/app/code/Magento/Integration/Model/Config/Integration/SchemaLocator.php index 3e8a31d0e8fc2f8d43969c7574edffefe00774f4..b448904f0907da75edb67a88f9ba1247ab9f5180 100644 --- a/app/code/Magento/Integration/Model/Config/Integration/SchemaLocator.php +++ b/app/code/Magento/Integration/Model/Config/Integration/SchemaLocator.php @@ -5,6 +5,8 @@ */ namespace Magento\Integration\Model\Config\Integration; +use Magento\Framework\Module\Dir; + /** * Integration config schema locator. */ @@ -29,7 +31,8 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface */ public function __construct(\Magento\Framework\Module\Dir\Reader $moduleReader) { - $this->_schema = $moduleReader->getModuleDir('etc', 'Magento_Integration') . '/integration/api.xsd'; + $this->_schema = $moduleReader->getModuleDir(Dir::MODULE_ETC_DIR, 'Magento_Integration') + . '/integration/api.xsd'; } /** diff --git a/app/code/Magento/Integration/Model/Config/Reader.php b/app/code/Magento/Integration/Model/Config/Reader.php index 38649c0d0dec6c74be3e0c2c7f5c4c59b1b20886..dfd44ac74c714b0003425074fa77b2838969efa0 100644 --- a/app/code/Magento/Integration/Model/Config/Reader.php +++ b/app/code/Magento/Integration/Model/Config/Reader.php @@ -26,13 +26,14 @@ class Reader extends \Magento\Framework\Config\Reader\Filesystem * @param array $idAttributes * @param string $domDocumentClass * @param string $defaultScope + * @param string $filename */ public function __construct( \Magento\Framework\Config\FileResolverInterface $fileResolver, \Magento\Integration\Model\Config\Converter $converter, \Magento\Integration\Model\Config\SchemaLocator $schemaLocator, \Magento\Framework\Config\ValidationStateInterface $validationState, - $fileName = 'integration\config.xml', + $fileName = 'integration/config.xml', $idAttributes = [], $domDocumentClass = 'Magento\Framework\Config\Dom', $defaultScope = 'global' diff --git a/app/code/Magento/Integration/Model/Config/SchemaLocator.php b/app/code/Magento/Integration/Model/Config/SchemaLocator.php index 7839663368b6ce27cccbed1550ae3567bed018cf..a4f26b644688f47104fda1b87d6ded7cf354e851 100644 --- a/app/code/Magento/Integration/Model/Config/SchemaLocator.php +++ b/app/code/Magento/Integration/Model/Config/SchemaLocator.php @@ -5,6 +5,8 @@ */ namespace Magento\Integration\Model\Config; +use Magento\Framework\Module\Dir; + /** * Integration config schema locator. */ @@ -29,7 +31,8 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface */ public function __construct(\Magento\Framework\Module\Dir\Reader $moduleReader) { - $this->_schema = $moduleReader->getModuleDir('etc', 'Magento_Integration') . '/integration/config.xsd'; + $this->_schema = $moduleReader->getModuleDir(Dir::MODULE_ETC_DIR, 'Magento_Integration') + . '/integration/config.xsd'; } /** diff --git a/app/code/Magento/Integration/Model/Resource/Oauth/Consumer.php b/app/code/Magento/Integration/Model/Resource/Oauth/Consumer.php index 1dda4986d2d4b84d54de934644bf0519e9811553..c3cfd7bc502478ea91ac35118e19b0cd833337eb 100644 --- a/app/code/Magento/Integration/Model/Resource/Oauth/Consumer.php +++ b/app/code/Magento/Integration/Model/Resource/Oauth/Consumer.php @@ -74,7 +74,7 @@ class Consumer extends \Magento\Framework\Model\Resource\Db\AbstractDb $select = $connection->select() ->from($this->getMainTable()) ->reset(\Magento\Framework\DB\Select::COLUMNS) - ->columns('CURRENT_TIMESTAMP() - created_at') + ->columns(new \Zend_Db_Expr('CURRENT_TIMESTAMP() - created_at')) ->where('entity_id = ?', $consumerId); return $connection->fetchOne($select); diff --git a/app/code/Magento/Integration/Test/Unit/Model/Config/Integration/XsdTest.php b/app/code/Magento/Integration/Test/Unit/Model/Config/Integration/XsdTest.php index 36786e039e0708d6e66a5f0699e24fe1c941c0c2..5413ec66a33b1bceb05b1d50f0283acf3c74461f 100644 --- a/app/code/Magento/Integration/Test/Unit/Model/Config/Integration/XsdTest.php +++ b/app/code/Magento/Integration/Test/Unit/Model/Config/Integration/XsdTest.php @@ -17,7 +17,10 @@ class XsdTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_schemaFile = BP . '/app/code/Magento/Integration/etc/integration/api.xsd'; + $urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + $this->_schemaFile = $urnResolver->getRealPath( + 'urn:magento:module:Magento_Integration:etc/integration/api.xsd' + ); } /** diff --git a/app/code/Magento/Integration/Test/Unit/Model/Config/XsdTest.php b/app/code/Magento/Integration/Test/Unit/Model/Config/XsdTest.php index ce19b4a10e6654fd1068d43bf96f55eb2ba44676..8e1c4195a34a643fa08c516e3e8bea7006d2ed0b 100644 --- a/app/code/Magento/Integration/Test/Unit/Model/Config/XsdTest.php +++ b/app/code/Magento/Integration/Test/Unit/Model/Config/XsdTest.php @@ -17,7 +17,10 @@ class XsdTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_schemaFile = BP . '/app/code/Magento/Integration/etc/integration/config.xsd'; + $urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + $this->_schemaFile = $urnResolver->getRealPath( + 'urn:magento:module:Magento_Integration:etc/integration/config.xsd' + ); } /** diff --git a/app/code/Magento/Integration/composer.json b/app/code/Magento/Integration/composer.json index 6b22a17f501d538b23afaef786b17204bfb6751b..6092992c9a0026bca32d9a622365f661fd96d4d4 100644 --- a/app/code/Magento/Integration/composer.json +++ b/app/code/Magento/Integration/composer.json @@ -8,8 +8,7 @@ "magento/module-customer": "1.0.0-beta", "magento/module-user": "1.0.0-beta", "magento/framework": "1.0.0-beta", - "magento/module-authorization": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/module-authorization": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -17,12 +16,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Integration" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Integration\\": "" + } } } diff --git a/app/code/Magento/Integration/etc/adminhtml/menu.xml b/app/code/Magento/Integration/etc/adminhtml/menu.xml index 1b0788bc4a3f9d8f7b6c897c9052b208144003ed..ad3b0221b7190f18664aa83d6594d239f3469d32 100644 --- a/app/code/Magento/Integration/etc/adminhtml/menu.xml +++ b/app/code/Magento/Integration/etc/adminhtml/menu.xml @@ -7,7 +7,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Backend/etc/menu.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd"> <menu> <add id="Magento_Integration::system_extensions" title="Extensions" module="Magento_Integration" sortOrder="45" parent="Magento_Backend::system" resource="Magento_Integration::extensions"/> <add id="Magento_Integration::system_integrations" title="Integrations" module="Magento_Integration" sortOrder="10" parent="Magento_Integration::system_extensions" action="adminhtml/integration" resource="Magento_Integration::integrations"/> diff --git a/app/code/Magento/Integration/etc/adminhtml/routes.xml b/app/code/Magento/Integration/etc/adminhtml/routes.xml index 6547865b6865e27e7935fcf1a8e80f204d50706e..12c7d3f86007b7b0fab25a0a9c3359e2e3ec95eb 100644 --- a/app/code/Magento/Integration/etc/adminhtml/routes.xml +++ b/app/code/Magento/Integration/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="admin"> <route id="adminhtml"> <module name="Magento_Integration" before="Magento_Backend" /> diff --git a/app/code/Magento/Integration/etc/adminhtml/system.xml b/app/code/Magento/Integration/etc/adminhtml/system.xml index 8551884cbbb055f206d77ebd6e50f7b0987641ae..7df82ba8974224c0738497b2d1e776ca77d81d75 100644 --- a/app/code/Magento/Integration/etc/adminhtml/system.xml +++ b/app/code/Magento/Integration/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="oauth" translate="label" type="text" sortOrder="300" showInDefault="1" showInWebsite="1" showInStore="1"> <label>OAuth</label> diff --git a/app/code/Magento/Integration/etc/cache.xml b/app/code/Magento/Integration/etc/cache.xml index 8135ca70148e80d6e45754a07385552082cc5729..6499ec1231ee43ef296612bde5565d73d736989c 100644 --- a/app/code/Magento/Integration/etc/cache.xml +++ b/app/code/Magento/Integration/etc/cache.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Cache/etc/cache.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Cache/etc/cache.xsd"> <type name="config_integration" translate="label,description" instance="Magento\Integration\Model\Cache\Type"> <label>Integrations Configuration</label> <description>Integration configuration file.</description> diff --git a/app/code/Magento/Integration/etc/config.xml b/app/code/Magento/Integration/etc/config.xml index 6223b5bdc2d90b1dcd5c7facf13b46fa189589c8..de54f4de97023c7cb5792bdccfbbedba1741bd7a 100644 --- a/app/code/Magento/Integration/etc/config.xml +++ b/app/code/Magento/Integration/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <oauth> <cleanup> diff --git a/app/code/Magento/Integration/etc/di.xml b/app/code/Magento/Integration/etc/di.xml index 36429fa01027c309c26e98723ddd4bbfbb1e1387..e7dde4b78585b6377ad47c4b8755461b6c06f606 100644 --- a/app/code/Magento/Integration/etc/di.xml +++ b/app/code/Magento/Integration/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Integration\Api\IntegrationServiceInterface" type="Magento\Integration\Model\IntegrationService" /> <preference for="Magento\Integration\Api\AuthorizationServiceInterface" type="Magento\Integration\Model\AuthorizationService" /> <preference for="Magento\Integration\Api\OauthServiceInterface" type="Magento\Integration\Model\OauthService" /> diff --git a/app/code/Magento/Integration/etc/frontend/routes.xml b/app/code/Magento/Integration/etc/frontend/routes.xml index b346823e909141070734195100fd27a2ef7e1549..0531cd71665f28635e108c26185409b053afe447 100644 --- a/app/code/Magento/Integration/etc/frontend/routes.xml +++ b/app/code/Magento/Integration/etc/frontend/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn: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/etc/module.xml b/app/code/Magento/Integration/etc/module.xml index ca7838bfbb11cdfa6f9b6eeddf527786b87493f5..1f048263ec4a86197a10c7b984e93a5f8a2e5de0 100644 --- a/app/code/Magento/Integration/etc/module.xml +++ b/app/code/Magento/Integration/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Integration" setup_version="2.0.0"> <sequence> <module name="Magento_Store"/> diff --git a/app/code/Magento/Integration/etc/webapi.xml b/app/code/Magento/Integration/etc/webapi.xml index 10473f6d871ab661c3afe90555f6a85d2800ce38..2744e271e09e55d805b96322392f66220df29b3e 100644 --- a/app/code/Magento/Integration/etc/webapi.xml +++ b/app/code/Magento/Integration/etc/webapi.xml @@ -6,7 +6,7 @@ */ --> <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../app/code/Magento/Webapi/etc/webapi.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd"> <route url="/V1/integration/admin/token" method="POST"> <service class="Magento\Integration\Api\AdminTokenServiceInterface" method="createAdminAccessToken"/> <resources> diff --git a/app/code/Magento/Integration/registration.php b/app/code/Magento/Integration/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..b70e6ac6889939ec843b7570c4f88e845dcafe1f --- /dev/null +++ b/app/code/Magento/Integration/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Integration', + __DIR__ +); diff --git a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_edit.xml b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_edit.xml index e1a37b6c15c5e32d554baab8e8b91d0e595c8521..f7734d52a4aeaa4bc00fbc6d1a391e71b1f30612 100644 --- a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_edit.xml +++ b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_edit.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="editor"/> <body> <referenceContainer name="left"> diff --git a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_grid.xml b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_grid.xml index 59b97310b6e1443684e75e47b2cc2c5872bd73eb..f329a4b41892e9e4f7bceb2072ccb2c4f13b51c0 100644 --- a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_grid.xml +++ b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_grid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <update handle="adminhtml_integration_grid_block"/> <container name="root"> <block class="Magento\Integration\Block\Adminhtml\Integration" name="integration.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> diff --git a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_grid_block.xml b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_grid_block.xml index 524f8352a6a08d8abfbc1ef70e590533806e5737..8239310c3a98029bc28cb9d648b298fa81420c9f 100644 --- a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_grid_block.xml +++ b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_grid_block.xml @@ -7,7 +7,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="integration.grid.container"> <block class="Magento\Integration\Block\Adminhtml\Integration\Grid" name="integration.grid" as="grid"> diff --git a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_index.xml b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_index.xml index f3d0a79ac7ab3617e9e16c00848bf10b255bacea..12780125ded003496342bf67eaa99af58f7bca7d 100644 --- a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_index.xml +++ b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_index.xml @@ -7,7 +7,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <css src="Magento_Integration::integration.css"/> </head> diff --git a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_new.xml b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_new.xml index 1c6b551fd9ec9391095dde80cd1355a424b3e2ad..0fc4b4df0d1b2aadaf8e8dfc2d88aab3b34a3f94 100644 --- a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_new.xml +++ b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_new.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <css src="Magento_Integration::integration.css"/> </head> diff --git a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_permissionsdialog.xml b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_permissionsdialog.xml index 9397c7cc21d925638a7551e78893975b23e3ec89..e8e80a51f0c2f6efd8cf8d46577835e049236ed8 100644 --- a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_permissionsdialog.xml +++ b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_permissionsdialog.xml @@ -7,7 +7,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root"> <block class="Magento\Backend\Block\Template" name="integration.activate.permissions" template="Magento_Integration::integration/activate/permissions.phtml"> <block class="Magento\Integration\Block\Adminhtml\Integration\Activate\Permissions\Tabs" name="integration.activate.permissions.tabs" as="tabs"/> diff --git a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_tokensdialog.xml b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_tokensdialog.xml index 241abf7265d9060c81bb37d71e30b34f9bcdf689..10a4fd200547c514f5d2f7359190233807df498e 100644 --- a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_tokensdialog.xml +++ b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_tokensdialog.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root"> <block class="Magento\Integration\Block\Adminhtml\Integration\Tokens" name="integration_token_popup"/> </container> diff --git a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_tokensexchange.xml b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_tokensexchange.xml index 18f94af7068c43ad03a1c66578c273540f9eb890..59ce7af5631f6cc3bc200b101f09d4f65478891c 100644 --- a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_tokensexchange.xml +++ b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_tokensexchange.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root"> <block class="Magento\Backend\Block\Template" name="integration_tokenexchange_popup" template="Magento_Integration::integration/tokens_exchange.phtml"/> </container> diff --git a/app/code/Magento/LayeredNavigation/composer.json b/app/code/Magento/LayeredNavigation/composer.json index 108232f92b87795029ec4b710892fc5de1dcb462..bf445d660092c1914aa3417064d733b72be689f6 100644 --- a/app/code/Magento/LayeredNavigation/composer.json +++ b/app/code/Magento/LayeredNavigation/composer.json @@ -5,8 +5,7 @@ "php": "~5.5.0|~5.6.0|~7.0.0", "magento/module-config": "1.0.0-beta", "magento/module-catalog": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -14,12 +13,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/LayeredNavigation" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\LayeredNavigation\\": "" + } } } diff --git a/app/code/Magento/LayeredNavigation/etc/adminhtml/events.xml b/app/code/Magento/LayeredNavigation/etc/adminhtml/events.xml index 28ef9f9c4122467dfec35901605ea5e894ba2031..c81d702a2cfceeb883df39771fab92ad5c976b9a 100644 --- a/app/code/Magento/LayeredNavigation/etc/adminhtml/events.xml +++ b/app/code/Magento/LayeredNavigation/etc/adminhtml/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="product_attribute_form_build_front_tab"> <observer name="layeredNavigation" instance="Magento\LayeredNavigation\Observer\Edit\Tab\Front\ProductAttributeFormBuildFrontTabObserver" method="execute" /> </event> diff --git a/app/code/Magento/LayeredNavigation/etc/adminhtml/system.xml b/app/code/Magento/LayeredNavigation/etc/adminhtml/system.xml index ebf05de5a98d5ec449c9eeab19ecf8cef55a631b..b713104ac1b36238d49296b5545e04883296abaa 100644 --- a/app/code/Magento/LayeredNavigation/etc/adminhtml/system.xml +++ b/app/code/Magento/LayeredNavigation/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="catalog" translate="label" type="text" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1"> <group id="layered_navigation" translate="label" sortOrder="490" showInDefault="1" showInWebsite="1" showInStore="1"> diff --git a/app/code/Magento/LayeredNavigation/etc/config.xml b/app/code/Magento/LayeredNavigation/etc/config.xml index d8cfd0f552c797148358e62578f119f794cf695a..f376d824b6f4971ac60398b4bcd53cdeeab191fd 100644 --- a/app/code/Magento/LayeredNavigation/etc/config.xml +++ b/app/code/Magento/LayeredNavigation/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <catalog> <layered_navigation> diff --git a/app/code/Magento/LayeredNavigation/etc/di.xml b/app/code/Magento/LayeredNavigation/etc/di.xml index f90030a42ed0b13d0d34e61990c7e092321a1db9..22cd61331f9fcb37ae4a28149272761f3aff82d3 100644 --- a/app/code/Magento/LayeredNavigation/etc/di.xml +++ b/app/code/Magento/LayeredNavigation/etc/di.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Framework\Search\Request\Aggregation\StatusInterface" type="Magento\LayeredNavigation\Model\Aggregation\Status" /> </config> diff --git a/app/code/Magento/LayeredNavigation/etc/frontend/di.xml b/app/code/Magento/LayeredNavigation/etc/frontend/di.xml index dd498ea813c31c6c07adbea12db88d43f7e40800..689b520de61890694571335dfd0870171722d125 100644 --- a/app/code/Magento/LayeredNavigation/etc/frontend/di.xml +++ b/app/code/Magento/LayeredNavigation/etc/frontend/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Catalog\Model\Layer\AvailabilityFlagInterface" type="Magento\Catalog\Model\Layer\Category\AvailabilityFlag" /> <virtualType name="Magento\LayeredNavigation\Block\Navigation\Category" type="Magento\LayeredNavigation\Block\Navigation"> <arguments> diff --git a/app/code/Magento/LayeredNavigation/etc/module.xml b/app/code/Magento/LayeredNavigation/etc/module.xml index a2f79c4e234aa0af7543f34ac420d265de6e4c4e..c153f388d4ac53372418b455b8ccb09f10abaf55 100644 --- a/app/code/Magento/LayeredNavigation/etc/module.xml +++ b/app/code/Magento/LayeredNavigation/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_LayeredNavigation" setup_version="2.0.0"> </module> </config> diff --git a/app/code/Magento/LayeredNavigation/registration.php b/app/code/Magento/LayeredNavigation/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..23ac6139c0402840b1c439163bfd4a72e06dc824 --- /dev/null +++ b/app/code/Magento/LayeredNavigation/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_LayeredNavigation', + __DIR__ +); diff --git a/app/code/Magento/LayeredNavigation/view/adminhtml/ui_component/product_attributes_listing.xml b/app/code/Magento/LayeredNavigation/view/adminhtml/ui_component/product_attributes_listing.xml index 916c8ae10a117d01e0e1fe76e286bbddff4f4db6..6b7142d703cdfc489fc8229873359a8cdf4b65f7 100644 --- a/app/code/Magento/LayeredNavigation/view/adminhtml/ui_component/product_attributes_listing.xml +++ b/app/code/Magento/LayeredNavigation/view/adminhtml/ui_component/product_attributes_listing.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Ui/etc/ui_configuration.xsd"> +<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Ui/etc/ui_configuration.xsd"> <container name="listing_top"> <filters name="listing_filters"> <filterSelect name="is_filterable"> diff --git a/app/code/Magento/LayeredNavigation/view/frontend/layout/1column.xml b/app/code/Magento/LayeredNavigation/view/frontend/layout/1column.xml index 53508f721c41e5cacc85ad7c10878d1b02c73e8e..4d0318516508c3d23b6eea467edf8f855f3352c3 100644 --- a/app/code/Magento/LayeredNavigation/view/frontend/layout/1column.xml +++ b/app/code/Magento/LayeredNavigation/view/frontend/layout/1column.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd" label="All One-Column Layout Pages" design_abstraction="page_layout"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="All One-Column Layout Pages" design_abstraction="page_layout"> <body> <move element="catalog.leftnav" destination="content.top" after="-"/> </body> diff --git a/app/code/Magento/LayeredNavigation/view/frontend/layout/2columns-left.xml b/app/code/Magento/LayeredNavigation/view/frontend/layout/2columns-left.xml index 8f325f6f4b7ae77764573938c3a0a93683ad55b1..7b679489fe942bc693b9948de94883e4bcab25cd 100644 --- a/app/code/Magento/LayeredNavigation/view/frontend/layout/2columns-left.xml +++ b/app/code/Magento/LayeredNavigation/view/frontend/layout/2columns-left.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd" label="All Two-Column Layout Pages (Left Column)" design_abstraction="page_layout"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="All Two-Column Layout Pages (Left Column)" design_abstraction="page_layout"> <body> <move element="catalog.leftnav" destination="sidebar.main" before="-"/> </body> diff --git a/app/code/Magento/LayeredNavigation/view/frontend/layout/2columns-right.xml b/app/code/Magento/LayeredNavigation/view/frontend/layout/2columns-right.xml index f8a85d9c0ca525ca8d34b8abe2c4f589e4e25808..5e8b8e338716d710d43d7859a77557443cb0662e 100644 --- a/app/code/Magento/LayeredNavigation/view/frontend/layout/2columns-right.xml +++ b/app/code/Magento/LayeredNavigation/view/frontend/layout/2columns-right.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd" label="All Two-Column Layout Pages (Right Column)" design_abstraction="page_layout"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="All Two-Column Layout Pages (Right Column)" design_abstraction="page_layout"> <body> <move element="catalog.leftnav" destination="sidebar.main" before="-"/> </body> diff --git a/app/code/Magento/LayeredNavigation/view/frontend/layout/3columns.xml b/app/code/Magento/LayeredNavigation/view/frontend/layout/3columns.xml index 4f28692e74e2a9cd895cbfd156142282570c2b78..5b97b56d83d48958b92d9db9860d2c9f6b574a3e 100644 --- a/app/code/Magento/LayeredNavigation/view/frontend/layout/3columns.xml +++ b/app/code/Magento/LayeredNavigation/view/frontend/layout/3columns.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd" label="All Three-Column Layout Pages" design_abstraction="page_layout"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="All Three-Column Layout Pages" design_abstraction="page_layout"> <body> <move element="catalog.leftnav" destination="sidebar.main" before="-"/> </body> diff --git a/app/code/Magento/LayeredNavigation/view/frontend/layout/catalog_category_view_type_layered.xml b/app/code/Magento/LayeredNavigation/view/frontend/layout/catalog_category_view_type_layered.xml index 701e1eba42e01b5df49eb20ce16a458368dc8968..fa25a7ec88c234c7a605303f6365e162a51a5fd0 100644 --- a/app/code/Magento/LayeredNavigation/view/frontend/layout/catalog_category_view_type_layered.xml +++ b/app/code/Magento/LayeredNavigation/view/frontend/layout/catalog_category_view_type_layered.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <attribute name="class" value="page-with-filter"/> <referenceContainer name="sidebar.main"> diff --git a/app/code/Magento/LayeredNavigation/view/frontend/layout/catalog_category_view_type_layered_without_children.xml b/app/code/Magento/LayeredNavigation/view/frontend/layout/catalog_category_view_type_layered_without_children.xml index a024d6e563cb581c15476d71430b89f2dd05ea36..44eec0b583d14104b76b334e2395d72d5b2bf778 100644 --- a/app/code/Magento/LayeredNavigation/view/frontend/layout/catalog_category_view_type_layered_without_children.xml +++ b/app/code/Magento/LayeredNavigation/view/frontend/layout/catalog_category_view_type_layered_without_children.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body/> </page> diff --git a/app/code/Magento/LayeredNavigation/view/frontend/layout/catalogsearch_result_index.xml b/app/code/Magento/LayeredNavigation/view/frontend/layout/catalogsearch_result_index.xml index d5a4fafdd70cc43e28d9a0838ad43351f74d6552..da416e8f8b023d612cdf973d4798641ca98e023c 100644 --- a/app/code/Magento/LayeredNavigation/view/frontend/layout/catalogsearch_result_index.xml +++ b/app/code/Magento/LayeredNavigation/view/frontend/layout/catalogsearch_result_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="sidebar.main"> <block class="Magento\LayeredNavigation\Block\Navigation\Search" name="catalogsearch.leftnav" before="-" template="layer/view.phtml"> diff --git a/app/code/Magento/LayeredNavigation/view/frontend/layout/page_empty.xml b/app/code/Magento/LayeredNavigation/view/frontend/layout/page_empty.xml index 0c25c8f2f0ee343daad88cc5095b99d01c07863c..aaf387bdfdea016140bcf8e179ddd1174013d721 100644 --- a/app/code/Magento/LayeredNavigation/view/frontend/layout/page_empty.xml +++ b/app/code/Magento/LayeredNavigation/view/frontend/layout/page_empty.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd" label="All Empty Layout Pages" design_abstraction="page_layout"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="All Empty Layout Pages" design_abstraction="page_layout"> <body> <move element="catalog.leftnav" destination="category.product.list.additional" before="-"/> </body> diff --git a/app/code/Magento/Marketplace/composer.json b/app/code/Magento/Marketplace/composer.json index 968e022800ae90135622b871dcae5b8f504de540..c472be8a8fdac281ec2864811e986df0f73a4b40 100644 --- a/app/code/Magento/Marketplace/composer.json +++ b/app/code/Magento/Marketplace/composer.json @@ -3,7 +3,6 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/magento-composer-installer": "*", "magento/framework": "1.0.0-beta", "magento/module-backend": "1.0.0-beta" }, @@ -13,12 +12,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Marketplace" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Marketplace\\": "" + } } } diff --git a/app/code/Magento/Marketplace/etc/adminhtml/menu.xml b/app/code/Magento/Marketplace/etc/adminhtml/menu.xml index affde1772b2109342a80bbf92ba121b12a7dd9e9..080549d707c7ca591832a12fbee8837b6326a4cd 100644 --- a/app/code/Magento/Marketplace/etc/adminhtml/menu.xml +++ b/app/code/Magento/Marketplace/etc/adminhtml/menu.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Backend/etc/menu.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd"> <menu> <add id="Magento_Marketplace::partners" title="Find Partners & Extensions" module="Magento_Marketplace" sortOrder="80" action="marketplace/index" resource="Magento_Marketplace::partners"/> diff --git a/app/code/Magento/Marketplace/etc/adminhtml/routes.xml b/app/code/Magento/Marketplace/etc/adminhtml/routes.xml index c48cab8d6a0a80c4c21fd4cac39eee4b202264ea..32279d06dc79ca5b3fef2dc424fe9d044be51b92 100644 --- a/app/code/Magento/Marketplace/etc/adminhtml/routes.xml +++ b/app/code/Magento/Marketplace/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="admin"> <route id="marketplace" frontName="marketplace"> <module name="Magento_Marketplace" before="Magento_Backend"/> diff --git a/app/code/Magento/Marketplace/etc/module.xml b/app/code/Magento/Marketplace/etc/module.xml index d4b02164e42fdb48f2ccb0283fe465954e7af299..d9ba28c9639b2847b460c7a03cc0e40d991750e1 100644 --- a/app/code/Magento/Marketplace/etc/module.xml +++ b/app/code/Magento/Marketplace/etc/module.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Marketplace" setup_version="1.0.0"/> </config> diff --git a/app/code/Magento/Marketplace/registration.php b/app/code/Magento/Marketplace/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..d4d9d7dc636bb2542f349014f3dad4c81dc86ee5 --- /dev/null +++ b/app/code/Magento/Marketplace/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Marketplace', + __DIR__ +); diff --git a/app/code/Magento/Marketplace/view/adminhtml/layout/marketplace_index_index.xml b/app/code/Magento/Marketplace/view/adminhtml/layout/marketplace_index_index.xml index 388194f68bb842be05f30106caf15be1b7960e34..90087fc4635cb5cb33654bd7adf3f1b6f3f976e9 100644 --- a/app/code/Magento/Marketplace/view/adminhtml/layout/marketplace_index_index.xml +++ b/app/code/Magento/Marketplace/view/adminhtml/layout/marketplace_index_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="styles" /> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/Marketplace/view/adminhtml/layout/marketplace_partners_index.xml b/app/code/Magento/Marketplace/view/adminhtml/layout/marketplace_partners_index.xml index afeb7d23889899f0a14531ac14d91930fc6e0679..0337ddef45e8c448c312e805fbd6eba2820f740a 100644 --- a/app/code/Magento/Marketplace/view/adminhtml/layout/marketplace_partners_index.xml +++ b/app/code/Magento/Marketplace/view/adminhtml/layout/marketplace_partners_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="styles" /> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/MediaStorage/Model/File/Storage/Response.php b/app/code/Magento/MediaStorage/Model/File/Storage/Response.php index 60ab7e7f2d55aa5b34515eb4ab8d15eb55d49237..94d5c2f653949b632b57d8c8cfa4ca73297ca5eb 100644 --- a/app/code/Magento/MediaStorage/Model/File/Storage/Response.php +++ b/app/code/Magento/MediaStorage/Model/File/Storage/Response.php @@ -10,7 +10,9 @@ use Magento\Framework\App\Request\Http as HttpRequest; use Magento\Framework\Stdlib\Cookie\CookieMetadataFactory; use Magento\Framework\Stdlib\CookieManagerInterface; -class Response extends Http implements \Magento\Framework\App\Response\FileInterface +class Response extends Http implements + \Magento\Framework\App\Response\FileInterface, + \Magento\Framework\App\PageCache\NotCacheableInterface { /** * @var \Magento\Framework\File\Transfer\Adapter\Http diff --git a/app/code/Magento/MediaStorage/Test/Unit/Model/File/Storage/_files/config.xml b/app/code/Magento/MediaStorage/Test/Unit/Model/File/Storage/_files/config.xml index 4cffed1a1cc9e003d9a125797275c1787eca1afc..a5d2b493cfbb3ca0480930ab6adf409eb05dbe42 100644 --- a/app/code/Magento/MediaStorage/Test/Unit/Model/File/Storage/_files/config.xml +++ b/app/code/Magento/MediaStorage/Test/Unit/Model/File/Storage/_files/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <resources> <fixture_module_setup> diff --git a/app/code/Magento/MediaStorage/composer.json b/app/code/Magento/MediaStorage/composer.json index 1f50a200530b2ce71b54eaffd5ee85849af6a9f9..4cf877fee951476efe0494a1112a3a57955b0211 100644 --- a/app/code/Magento/MediaStorage/composer.json +++ b/app/code/Magento/MediaStorage/composer.json @@ -6,8 +6,7 @@ "magento/module-store": "1.0.0-beta", "magento/module-backend": "1.0.0-beta", "magento/module-config": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -15,12 +14,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/MediaStorage" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\MediaStorage\\": "" + } } } diff --git a/app/code/Magento/MediaStorage/etc/adminhtml/routes.xml b/app/code/Magento/MediaStorage/etc/adminhtml/routes.xml index a4c847bd08bc803ef4bcc72392fe365e63b010c7..5c8c48c6e009759db3299f66caf8874894db80e6 100644 --- a/app/code/Magento/MediaStorage/etc/adminhtml/routes.xml +++ b/app/code/Magento/MediaStorage/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="admin"> <route id="adminhtml"> <module name="Magento_MediaStorage" /> diff --git a/app/code/Magento/MediaStorage/etc/adminhtml/system.xml b/app/code/Magento/MediaStorage/etc/adminhtml/system.xml index 018c4457daee802da48ebf060d75312eb0295aef..6871cebeb0104fa629a0d368a6a85ab69442410c 100644 --- a/app/code/Magento/MediaStorage/etc/adminhtml/system.xml +++ b/app/code/Magento/MediaStorage/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="system" translate="label" type="text" sortOrder="900" showInDefault="1" showInWebsite="1" showInStore="1"> <group id="media_storage_configuration" translate="label" type="text" sortOrder="900" showInDefault="1" showInWebsite="1" showInStore="1"> diff --git a/app/code/Magento/MediaStorage/etc/di.xml b/app/code/Magento/MediaStorage/etc/di.xml index 4b098f20f52a9ce8e3f08a5a4944825636183880..5cdcdcf7ff5021d5a265843d88ae0b817a933581 100644 --- a/app/code/Magento/MediaStorage/etc/di.xml +++ b/app/code/Magento/MediaStorage/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\MediaStorage\Helper\File\Storage"> <arguments> <argument name="storage" xsi:type="object">Magento\MediaStorage\Model\File\Storage\Proxy</argument> diff --git a/app/code/Magento/MediaStorage/etc/module.xml b/app/code/Magento/MediaStorage/etc/module.xml index 6877843f2a73aea3a95eb043bf1ac98d7e0d1ee4..94465529b873f4952185fdd2c30de5d13671f53d 100644 --- a/app/code/Magento/MediaStorage/etc/module.xml +++ b/app/code/Magento/MediaStorage/etc/module.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_MediaStorage" setup_version="2.0.0"/> </config> diff --git a/app/code/Magento/MediaStorage/registration.php b/app/code/Magento/MediaStorage/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..06733697ff5bda108b2f1f945d4fdbe62f89283b --- /dev/null +++ b/app/code/Magento/MediaStorage/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_MediaStorage', + __DIR__ +); diff --git a/app/code/Magento/Msrp/composer.json b/app/code/Magento/Msrp/composer.json index efc09c43975ec86dc0ab09ad8d012c32402e8657..afa0ef50405d1511eb08ef64735584d1305ff4c7 100644 --- a/app/code/Magento/Msrp/composer.json +++ b/app/code/Magento/Msrp/composer.json @@ -9,8 +9,7 @@ "magento/module-eav": "1.0.0-beta", "magento/module-grouped-product": "1.0.0-beta", "magento/module-tax": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "suggest": { "magento/module-bundle": "1.0.0-beta" @@ -21,12 +20,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Msrp" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Msrp\\": "" + } } } diff --git a/app/code/Magento/Msrp/etc/adminhtml/di.xml b/app/code/Magento/Msrp/etc/adminhtml/di.xml index 3764f37a85b3b76b74823e5b711334339704a26d..15111af7000ed003b86bc074c723fdb408ce5001 100644 --- a/app/code/Magento/Msrp/etc/adminhtml/di.xml +++ b/app/code/Magento/Msrp/etc/adminhtml/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Bundle\Block\Adminhtml\Catalog\Product\Edit\Tab\Attributes"> <plugin name="bundle_msrp_plugin" type="Magento\Msrp\Plugin\Bundle\Block\Adminhtml\Catalog\Product\Edit\Tab\Attributes"/> </type> diff --git a/app/code/Magento/Msrp/etc/adminhtml/system.xml b/app/code/Magento/Msrp/etc/adminhtml/system.xml index bc779be0f268d0c62b099f3d38ae8b74ad666b41..288ec5d9ce0558b37adf0a17311542c484779a55 100644 --- a/app/code/Magento/Msrp/etc/adminhtml/system.xml +++ b/app/code/Magento/Msrp/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="sales"> <group id="msrp" translate="label" type="text" sortOrder="110" showInDefault="1" showInWebsite="1" showInStore="0"> diff --git a/app/code/Magento/Msrp/etc/catalog_attributes.xml b/app/code/Magento/Msrp/etc/catalog_attributes.xml index 10f4fcd97b7f89c66db134199dfd5375956d1617..29e8384bcb1525cc5feb6818cfda8ef8e6f87487 100644 --- a/app/code/Magento/Msrp/etc/catalog_attributes.xml +++ b/app/code/Magento/Msrp/etc/catalog_attributes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Catalog/etc/catalog_attributes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/catalog_attributes.xsd"> <group name="quote_item"> <attribute name="msrp"/> <attribute name="msrp_display_actual_price_type"/> diff --git a/app/code/Magento/Msrp/etc/config.xml b/app/code/Magento/Msrp/etc/config.xml index dd50e9de8178b9fb198156ab16074b9eede44a8f..1aa488f8bba6f795516676f4a767cb7e033f722c 100644 --- a/app/code/Magento/Msrp/etc/config.xml +++ b/app/code/Magento/Msrp/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <sales> <msrp> diff --git a/app/code/Magento/Msrp/etc/di.xml b/app/code/Magento/Msrp/etc/di.xml index 869c2044d3b133f2ef88bc4df09ad4e8a75f1e46..f178d0207fab25123a99b311effb6065d121f1a2 100644 --- a/app/code/Magento/Msrp/etc/di.xml +++ b/app/code/Magento/Msrp/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <virtualType name="Magento\Catalog\Pricing\Price\Pool"> <arguments> <argument name="prices" xsi:type="array"> diff --git a/app/code/Magento/Msrp/etc/frontend/events.xml b/app/code/Magento/Msrp/etc/frontend/events.xml index 6dccca17a65821f39484ea25dac0c5b463255b47..9ced90f1668de8efaa9a33527263eea94f9f3ae4 100644 --- a/app/code/Magento/Msrp/etc/frontend/events.xml +++ b/app/code/Magento/Msrp/etc/frontend/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="sales_quote_collect_totals_after"> <observer name="catalog_msrp" instance="Magento\Msrp\Observer\Frontend\Quote\SetCanApplyMsrpObserver" method="execute" /> </event> diff --git a/app/code/Magento/Msrp/etc/module.xml b/app/code/Magento/Msrp/etc/module.xml index ad6f4be3319df95d26fb4710b4ce5df742ee4a94..0e65c3f8aed37a40a44e2d0dfa3d354d8875a898 100644 --- a/app/code/Magento/Msrp/etc/module.xml +++ b/app/code/Magento/Msrp/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Msrp" setup_version="2.0.0"> <sequence> <module name="Magento_Catalog"/> diff --git a/app/code/Magento/Msrp/etc/webapi_rest/events.xml b/app/code/Magento/Msrp/etc/webapi_rest/events.xml index 6dccca17a65821f39484ea25dac0c5b463255b47..9ced90f1668de8efaa9a33527263eea94f9f3ae4 100644 --- a/app/code/Magento/Msrp/etc/webapi_rest/events.xml +++ b/app/code/Magento/Msrp/etc/webapi_rest/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="sales_quote_collect_totals_after"> <observer name="catalog_msrp" instance="Magento\Msrp\Observer\Frontend\Quote\SetCanApplyMsrpObserver" method="execute" /> </event> diff --git a/app/code/Magento/Msrp/etc/webapi_soap/events.xml b/app/code/Magento/Msrp/etc/webapi_soap/events.xml index 6dccca17a65821f39484ea25dac0c5b463255b47..9ced90f1668de8efaa9a33527263eea94f9f3ae4 100644 --- a/app/code/Magento/Msrp/etc/webapi_soap/events.xml +++ b/app/code/Magento/Msrp/etc/webapi_soap/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="sales_quote_collect_totals_after"> <observer name="catalog_msrp" instance="Magento\Msrp\Observer\Frontend\Quote\SetCanApplyMsrpObserver" method="execute" /> </event> diff --git a/app/code/Magento/Msrp/registration.php b/app/code/Magento/Msrp/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..a6c466c4beadcc2c2918021d6ef7da530277974f --- /dev/null +++ b/app/code/Magento/Msrp/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Msrp', + __DIR__ +); diff --git a/app/code/Magento/Msrp/view/base/layout/catalog_product_prices.xml b/app/code/Magento/Msrp/view/base/layout/catalog_product_prices.xml index b7b2585c7c1d4dd1686ed5020fa3c5ab1aa0532b..530e79c17b8c5e5fd757c331ec245ec5eea70864 100644 --- a/app/code/Magento/Msrp/view/base/layout/catalog_product_prices.xml +++ b/app/code/Magento/Msrp/view/base/layout/catalog_product_prices.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <referenceBlock name="render.product.prices"> <arguments> <argument name="default" xsi:type="array"> diff --git a/app/code/Magento/Msrp/view/frontend/layout/catalog_category_view.xml b/app/code/Magento/Msrp/view/frontend/layout/catalog_category_view.xml index 67e3f5985a1a8eff15cf8289859d9ae720b8e64f..9d2a3b8d5a57c62105c40536664c2ca9f05f1953 100644 --- a/app/code/Magento/Msrp/view/frontend/layout/catalog_category_view.xml +++ b/app/code/Magento/Msrp/view/frontend/layout/catalog_category_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="msrp_popup"/> <body/> </page> diff --git a/app/code/Magento/Msrp/view/frontend/layout/catalog_product_compare_index.xml b/app/code/Magento/Msrp/view/frontend/layout/catalog_product_compare_index.xml index cc6402b53bfdd25a622b7fb9bc05b3c1ce827bd8..697ffe0533faba51b5824f9e0bc4f79119799497 100644 --- a/app/code/Magento/Msrp/view/frontend/layout/catalog_product_compare_index.xml +++ b/app/code/Magento/Msrp/view/frontend/layout/catalog_product_compare_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="msrp_popup"/> <body/> </page> diff --git a/app/code/Magento/Msrp/view/frontend/layout/catalog_product_view.xml b/app/code/Magento/Msrp/view/frontend/layout/catalog_product_view.xml index 42df45edc1b2757afd1933dd5bf9b97e6579d889..546269e0a582a0641ebbeb52c9bc1c18bb7231f8 100644 --- a/app/code/Magento/Msrp/view/frontend/layout/catalog_product_view.xml +++ b/app/code/Magento/Msrp/view/frontend/layout/catalog_product_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <!--<update handle="MAP_price_msrp_item"/>--> <update handle="msrp_popup"/> <body> diff --git a/app/code/Magento/Msrp/view/frontend/layout/catalog_product_view_type_downloadable.xml b/app/code/Magento/Msrp/view/frontend/layout/catalog_product_view_type_downloadable.xml index 8ded15f0e897d94719a410291dc240ffff656aa5..cb184192dedcf40ba66da3a254f3fdc58d00c167 100644 --- a/app/code/Magento/Msrp/view/frontend/layout/catalog_product_view_type_downloadable.xml +++ b/app/code/Magento/Msrp/view/frontend/layout/catalog_product_view_type_downloadable.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="product.info.downloadable.options"> <arguments> diff --git a/app/code/Magento/Msrp/view/frontend/layout/catalogsearch_advanced_result.xml b/app/code/Magento/Msrp/view/frontend/layout/catalogsearch_advanced_result.xml index 303b3aa5806134e696da8cfc0ed68844da34f076..7974466830b1df19d654b63b7f1e198ee5a8f6db 100644 --- a/app/code/Magento/Msrp/view/frontend/layout/catalogsearch_advanced_result.xml +++ b/app/code/Magento/Msrp/view/frontend/layout/catalogsearch_advanced_result.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="msrp_popup"/> <body/> </page> diff --git a/app/code/Magento/Msrp/view/frontend/layout/catalogsearch_result_index.xml b/app/code/Magento/Msrp/view/frontend/layout/catalogsearch_result_index.xml index 303b3aa5806134e696da8cfc0ed68844da34f076..7974466830b1df19d654b63b7f1e198ee5a8f6db 100644 --- a/app/code/Magento/Msrp/view/frontend/layout/catalogsearch_result_index.xml +++ b/app/code/Magento/Msrp/view/frontend/layout/catalogsearch_result_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="msrp_popup"/> <body/> </page> diff --git a/app/code/Magento/Msrp/view/frontend/layout/checkout_cart_index.xml b/app/code/Magento/Msrp/view/frontend/layout/checkout_cart_index.xml index 2ddce1cfab9f5b5b7f12161750ae1c3e41cda2ae..f7d97602c77662ef77ae3d56b3d72754edc24e49 100644 --- a/app/code/Magento/Msrp/view/frontend/layout/checkout_cart_index.xml +++ b/app/code/Magento/Msrp/view/frontend/layout/checkout_cart_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="msrp_popup"/> <body> <referenceContainer name="checkout.cart.totals.container"> diff --git a/app/code/Magento/Msrp/view/frontend/layout/checkout_onepage_failure.xml b/app/code/Magento/Msrp/view/frontend/layout/checkout_onepage_failure.xml index 303b3aa5806134e696da8cfc0ed68844da34f076..7974466830b1df19d654b63b7f1e198ee5a8f6db 100644 --- a/app/code/Magento/Msrp/view/frontend/layout/checkout_onepage_failure.xml +++ b/app/code/Magento/Msrp/view/frontend/layout/checkout_onepage_failure.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="msrp_popup"/> <body/> </page> diff --git a/app/code/Magento/Msrp/view/frontend/layout/checkout_onepage_success.xml b/app/code/Magento/Msrp/view/frontend/layout/checkout_onepage_success.xml index 303b3aa5806134e696da8cfc0ed68844da34f076..7974466830b1df19d654b63b7f1e198ee5a8f6db 100644 --- a/app/code/Magento/Msrp/view/frontend/layout/checkout_onepage_success.xml +++ b/app/code/Magento/Msrp/view/frontend/layout/checkout_onepage_success.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="msrp_popup"/> <body/> </page> diff --git a/app/code/Magento/Msrp/view/frontend/layout/default.xml b/app/code/Magento/Msrp/view/frontend/layout/default.xml index ab943b1e1f8f6bc6de28e9751a0b39919c24ffe9..a2164e84c2e30594eb89e4e508e1b68db2a955cd 100644 --- a/app/code/Magento/Msrp/view/frontend/layout/default.xml +++ b/app/code/Magento/Msrp/view/frontend/layout/default.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="minicart.subtotal.container"> <block name="minicart.subtotal.msrp" before="minicart.subtotal" class="Magento\Msrp\Block\Total" template="cart/subtotal.phtml"> diff --git a/app/code/Magento/Msrp/view/frontend/layout/msrp_popup.xml b/app/code/Magento/Msrp/view/frontend/layout/msrp_popup.xml index 189f7173f2da19700cea9a1b29427738870141a8..e2ed94210609fbffc770c9891bbf05ca574953b4 100644 --- a/app/code/Magento/Msrp/view/frontend/layout/msrp_popup.xml +++ b/app/code/Magento/Msrp/view/frontend/layout/msrp_popup.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Msrp\Block\Popup" template="Magento_Msrp::popup.phtml" name="product.tooltip"> diff --git a/app/code/Magento/Msrp/view/frontend/layout/review_product_list.xml b/app/code/Magento/Msrp/view/frontend/layout/review_product_list.xml index fb79344d11d6ed54764b03286c89b7b17a97a44d..4a23f2632d101bf5310bc3e384d3b80ec68317ee 100644 --- a/app/code/Magento/Msrp/view/frontend/layout/review_product_list.xml +++ b/app/code/Magento/Msrp/view/frontend/layout/review_product_list.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <!--<update handle="MAP_price_msrp_item"/>--> <update handle="msrp_popup"/> <body/> diff --git a/app/code/Magento/Msrp/view/frontend/layout/wishlist_index_configure_type_downloadable.xml b/app/code/Magento/Msrp/view/frontend/layout/wishlist_index_configure_type_downloadable.xml index a7cc98f3df1114cf0f24d63986ef9b67a71f32e9..1146194d9545ad4361a1f25df12bb9169ce7e889 100644 --- a/app/code/Magento/Msrp/view/frontend/layout/wishlist_index_configure_type_downloadable.xml +++ b/app/code/Magento/Msrp/view/frontend/layout/wishlist_index_configure_type_downloadable.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="product.price.link"> <arguments> diff --git a/app/code/Magento/Msrp/view/frontend/layout/wishlist_index_index.xml b/app/code/Magento/Msrp/view/frontend/layout/wishlist_index_index.xml index 0b23302dff770e2369cdaaaff1f3f26f591bc931..7eae9c6373958521712fe391f6bad809fd5fa4c1 100644 --- a/app/code/Magento/Msrp/view/frontend/layout/wishlist_index_index.xml +++ b/app/code/Magento/Msrp/view/frontend/layout/wishlist_index_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <!--<update handle="MAP_price_msrp_wishlist_item"/>--> <update handle="msrp_popup"/> <body/> diff --git a/app/code/Magento/Msrp/view/frontend/layout/wishlist_search_view.xml b/app/code/Magento/Msrp/view/frontend/layout/wishlist_search_view.xml index 0b23302dff770e2369cdaaaff1f3f26f591bc931..7eae9c6373958521712fe391f6bad809fd5fa4c1 100644 --- a/app/code/Magento/Msrp/view/frontend/layout/wishlist_search_view.xml +++ b/app/code/Magento/Msrp/view/frontend/layout/wishlist_search_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <!--<update handle="MAP_price_msrp_wishlist_item"/>--> <update handle="msrp_popup"/> <body/> diff --git a/app/code/Magento/Msrp/view/frontend/layout/wishlist_shared_index.xml b/app/code/Magento/Msrp/view/frontend/layout/wishlist_shared_index.xml index 0b23302dff770e2369cdaaaff1f3f26f591bc931..7eae9c6373958521712fe391f6bad809fd5fa4c1 100644 --- a/app/code/Magento/Msrp/view/frontend/layout/wishlist_shared_index.xml +++ b/app/code/Magento/Msrp/view/frontend/layout/wishlist_shared_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <!--<update handle="MAP_price_msrp_wishlist_item"/>--> <update handle="msrp_popup"/> <body/> diff --git a/app/code/Magento/Multishipping/composer.json b/app/code/Magento/Multishipping/composer.json index 1bbc29b6ba15ce753b05118137e8b9282b4c544c..b1a79390d7f6ed1e3ba63413080f49c8ebb9a28b 100644 --- a/app/code/Magento/Multishipping/composer.json +++ b/app/code/Magento/Multishipping/composer.json @@ -11,8 +11,7 @@ "magento/module-customer": "1.0.0-beta", "magento/module-theme": "1.0.0-beta", "magento/module-quote": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -20,12 +19,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Multishipping" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Multishipping\\": "" + } } } diff --git a/app/code/Magento/Multishipping/etc/acl.xml b/app/code/Magento/Multishipping/etc/acl.xml index e3919a28a5af20c559e38704f60f60756fe28065..b38af4af7b4e12e18159cd6cda78d332298cf466 100644 --- a/app/code/Magento/Multishipping/etc/acl.xml +++ b/app/code/Magento/Multishipping/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/app/code/Magento/Multishipping/etc/adminhtml/system.xml b/app/code/Magento/Multishipping/etc/adminhtml/system.xml index 8b12a6b3816dd857de9c2f0bb79440dad4759b70..75d7a371ba0d8ca2ca152098f3ae235235d53104 100644 --- a/app/code/Magento/Multishipping/etc/adminhtml/system.xml +++ b/app/code/Magento/Multishipping/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="multishipping" translate="label" type="text" sortOrder="311" showInDefault="1" showInWebsite="1" showInStore="0"> <label>Multishipping Settings</label> diff --git a/app/code/Magento/Multishipping/etc/config.xml b/app/code/Magento/Multishipping/etc/config.xml index c08c0590401b67429190c650e3ae3f80a9d728f7..2bb92969626bb66c17842121ebda270a55d95c71 100644 --- a/app/code/Magento/Multishipping/etc/config.xml +++ b/app/code/Magento/Multishipping/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <multishipping> <options> diff --git a/app/code/Magento/Multishipping/etc/frontend/di.xml b/app/code/Magento/Multishipping/etc/frontend/di.xml index 61d72838f9ee3b28d606a80928262098d4c351b7..6c944b03ec686eda2ca355738ef35cff7e3c41a6 100644 --- a/app/code/Magento/Multishipping/etc/frontend/di.xml +++ b/app/code/Magento/Multishipping/etc/frontend/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Framework\Url\SecurityInfo"> <arguments> <argument name="secureUrlList" xsi:type="array"> diff --git a/app/code/Magento/Multishipping/etc/frontend/page_types.xml b/app/code/Magento/Multishipping/etc/frontend/page_types.xml index f58e8c5bb6a69f2c9d05fb543fd08eec5f1fd284..b238fe84d4cf6817c9e93ecdc54799678fbf18fc 100644 --- a/app/code/Magento/Multishipping/etc/frontend/page_types.xml +++ b/app/code/Magento/Multishipping/etc/frontend/page_types.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page_types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_types.xsd"> +<page_types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_types.xsd"> <type id="checkout_cart_multishipping" label="Catalog Quick Search Form Suggestions"/> <type id="checkout_cart_multishipping_address_editaddress" label="Multishipping Checkout One Address Edit Form"/> <type id="checkout_cart_multishipping_address_editbilling" label="Multishipping Checkout Billing Address Edit Form"/> diff --git a/app/code/Magento/Multishipping/etc/frontend/routes.xml b/app/code/Magento/Multishipping/etc/frontend/routes.xml index 95062ec02b3f342e4a2a03d7ed2400c7a7c4644f..9c1ab5b753c7607c890e00733a44c7d9d8ef9e62 100644 --- a/app/code/Magento/Multishipping/etc/frontend/routes.xml +++ b/app/code/Magento/Multishipping/etc/frontend/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn: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/etc/frontend/sections.xml b/app/code/Magento/Multishipping/etc/frontend/sections.xml index 4598808c1d6a91a5b19ed5394c61a3ba13302562..d8e806d5ae95732874ccf25f0f45461217a7d409 100644 --- a/app/code/Magento/Multishipping/etc/frontend/sections.xml +++ b/app/code/Magento/Multishipping/etc/frontend/sections.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../Magento/Customer/etc/sections.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd"> <action name="multishipping/checkout/overviewPost"> <section name="cart"/> </action> diff --git a/app/code/Magento/Multishipping/etc/module.xml b/app/code/Magento/Multishipping/etc/module.xml index 1e60e1c6f7c73c6d659502dab1ac634fb389ed02..6a8e2e46e0c52ff36bab367a7e43e7e2fdda22c0 100644 --- a/app/code/Magento/Multishipping/etc/module.xml +++ b/app/code/Magento/Multishipping/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Multishipping" setup_version="2.0.0"> <sequence> <module name="Magento_Store"/> diff --git a/app/code/Magento/Multishipping/registration.php b/app/code/Magento/Multishipping/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..0cd2ecac61d88b430240ad56ef70afaa3640d941 --- /dev/null +++ b/app/code/Magento/Multishipping/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Multishipping', + __DIR__ +); diff --git a/app/code/Magento/Multishipping/view/frontend/layout/checkout_cart_index.xml b/app/code/Magento/Multishipping/view/frontend/layout/checkout_cart_index.xml index a39fa497d611bfd9466ddd37c9ca2b2c8f4c86ba..ad8b477cc31ad907dfe0afffe47467db3785822d 100644 --- a/app/code/Magento/Multishipping/view/frontend/layout/checkout_cart_index.xml +++ b/app/code/Magento/Multishipping/view/frontend/layout/checkout_cart_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="checkout.cart.methods"> <block class="Magento\Multishipping\Block\Checkout\Link" name="checkout.cart.methods.multishipping" template="checkout/link.phtml"/> diff --git a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout.xml b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout.xml index cd004b253876d4084778862f5478a09074761557..097574d31074727178ac7c858fbccd10ee295b24 100644 --- a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout.xml +++ b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd" label="Multishipping Checkout" design_abstraction="custom"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="Multishipping Checkout" design_abstraction="custom"> <body> <referenceContainer name="sidebar.main"> <block class="Magento\Multishipping\Block\Checkout\State" name="checkout_state" template="checkout/state.phtml" cacheable="false"/> diff --git a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_editaddress.xml b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_editaddress.xml index bfb06d3999637515b4dba67d6236bd2e014ac3e7..0ac2c01104dce666a8b5d1260f00c70e2a7eed23 100644 --- a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_editaddress.xml +++ b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_editaddress.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="multishipping_checkout"/> <update handle="multishipping_checkout_customer_address"/> <body> diff --git a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_editbilling.xml b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_editbilling.xml index 6776ac8fb4508b4a545048d7f4d1aa63488c9eb8..3fb4d767b261f3730bb1daaae3e84b0a0d3bf6ef 100644 --- a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_editbilling.xml +++ b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_editbilling.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="multishipping_checkout"/> <update handle="multishipping_checkout_customer_address"/> <body> diff --git a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_editshipping.xml b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_editshipping.xml index 0ba4e1e3262fa5bdada6460b48ebe5a69691ddb0..e6379bbd1a57ddf83d8640f8db0e98497031c1ec 100644 --- a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_editshipping.xml +++ b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_editshipping.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="multishipping_checkout"/> <update handle="multishipping_checkout_customer_address"/> <body> diff --git a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_newbilling.xml b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_newbilling.xml index 945294942f3b7229a0598e00772a4c6088559714..705dee50c5bb695256e7aab55f8ce92ee14501a5 100644 --- a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_newbilling.xml +++ b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_newbilling.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="multishipping_checkout"/> <update handle="multishipping_checkout_customer_address"/> <body> diff --git a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_newshipping.xml b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_newshipping.xml index b7c9cb405bd6fedf7d10a51e592d7bd0b8966bb7..324d5907915fef73ceeb8bd48d6b99ce8768ad65 100644 --- a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_newshipping.xml +++ b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_newshipping.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="multishipping_checkout"/> <update handle="multishipping_checkout_customer_address"/> <body> diff --git a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_select.xml b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_select.xml index d5e123f16951118a00c6011211e5a05c540627d1..5e5e42985a2085cf59af865d692e0c8d2155ce62 100644 --- a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_select.xml +++ b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_select.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd" label="Multishipping Checkout Shipping Address Selection" design_abstraction="custom"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="Multishipping Checkout Shipping Address Selection" design_abstraction="custom"> <update handle="multishipping_checkout"/> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_selectbilling.xml b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_selectbilling.xml index 405ab4b4f967e6febaa816a0f4a8c568908f98bd..8c2e57b68a14e301f4ca9891c66c8752fd8cddae 100644 --- a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_selectbilling.xml +++ b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_address_selectbilling.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="multishipping_checkout"/> <body> <referenceBlock name="page.main.title"> diff --git a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_addresses.xml b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_addresses.xml index e00f3dc665c49116b8613c93d5fe9f7077e74555..7cd90cf55e9c1ea6c0af7ada50fe51624f64b2bb 100644 --- a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_addresses.xml +++ b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_addresses.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="multishipping_checkout"/> <update handle="checkout_cart_item_renderers"/> <body> diff --git a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_billing.xml b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_billing.xml index 8b4a59d84b375fe205144f1553e886a7c21644aa..d6585e20d28e082be302edfe84c33799d69ec843 100644 --- a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_billing.xml +++ b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_billing.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="multishipping_checkout"/> <body> <referenceBlock name="page.main.title"> diff --git a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_customer_address.xml b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_customer_address.xml index 98e442fb342cf36f5ed8756d04d2533a8e7578f4..efd0732282c0c5be3cd54e7314cb3bdbba89a2a2 100644 --- a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_customer_address.xml +++ b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_customer_address.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd" label="Multishipping Checkout Customer Address Edit Form" design_abstraction="custom"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="Multishipping Checkout Customer Address Edit Form" design_abstraction="custom"> <update handle="customer_form_template_handle"/> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_login.xml b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_login.xml index dd1db9822a2800e4a6cad4a3f5fa291501ee6446..b8464cc8d685838e50a1d154d97bbc273896d343 100644 --- a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_login.xml +++ b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_login.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="customer_account_login"/> <body/> </page> diff --git a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_overview.xml b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_overview.xml index 8ea4f26cae9086940879b09517d88a63951acce2..7f45793c513d2d3bd12f295145f6d1d05bd345a4 100644 --- a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_overview.xml +++ b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_overview.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="multishipping_checkout"/> <update handle="checkout_cart_item_renderers"/> <body> diff --git a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_register.xml b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_register.xml index e4911faebf25405414c27d8770322dadc6a2af89..256cdeea3a8c82f1ee55150c22776477f8ef04c1 100644 --- a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_register.xml +++ b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_register.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="customer_account_create"/> <body/> </page> diff --git a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_shipping.xml b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_shipping.xml index 8020a79055261d47eb720f33e370403f362aeef1..9a16c36eb7eaba5e07ddd3ebe118c17831b9abf5 100644 --- a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_shipping.xml +++ b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_shipping.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="multishipping_checkout"/> <update handle="checkout_cart_item_renderers"/> <body> diff --git a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_success.xml b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_success.xml index e75c9d462bf4045a4b4d142a15255ebdb31041c7..b6ed7c2a70604be394a8d76f76f0dbd216d3e464 100644 --- a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_success.xml +++ b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout_success.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <title>Success Page</title> </head> diff --git a/app/code/Magento/NewRelicReporting/composer.json b/app/code/Magento/NewRelicReporting/composer.json index 35f969663caaa086459652c496cdd8f82842ffad..d3336380128e1d464495ca6ac7143b043fe806b9 100644 --- a/app/code/Magento/NewRelicReporting/composer.json +++ b/app/code/Magento/NewRelicReporting/composer.json @@ -18,12 +18,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/NewRelicReporting" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\NewRelicReporting\\": "" + } } } diff --git a/app/code/Magento/NewRelicReporting/etc/acl.xml b/app/code/Magento/NewRelicReporting/etc/acl.xml index 95f173a505bb77b8d111ec1e3b62691afe7ec09e..4395fd3f25af235a42dbaffb0c9b5593cf4f1f2b 100644 --- a/app/code/Magento/NewRelicReporting/etc/acl.xml +++ b/app/code/Magento/NewRelicReporting/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/app/code/Magento/NewRelicReporting/etc/adminhtml/events.xml b/app/code/Magento/NewRelicReporting/etc/adminhtml/events.xml index 3c6f9edcd09a5365082d7a26b8cc52630d1f6992..81625db511373753077f0ebc21b7dd2cf9a10313 100644 --- a/app/code/Magento/NewRelicReporting/etc/adminhtml/events.xml +++ b/app/code/Magento/NewRelicReporting/etc/adminhtml/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="adminhtml_cache_flush_system"> <observer name="newrelicreporting_observer_report_system_cache_flush" instance="Magento\NewRelicReporting\Model\Observer\ReportSystemCacheFlush" method="execute" /> <observer name="newrelicreporting_newrelic_report_system_cache_flush" instance="Magento\NewRelicReporting\Model\Observer\ReportSystemCacheFlushToNewRelic" method="execute" /> diff --git a/app/code/Magento/NewRelicReporting/etc/adminhtml/system.xml b/app/code/Magento/NewRelicReporting/etc/adminhtml/system.xml index 8a7c5411ce8c17e2500b19ad4a3dba5127fd61a9..019267bb60fd0d9b78c437948fbc18e0e4a38eb8 100644 --- a/app/code/Magento/NewRelicReporting/etc/adminhtml/system.xml +++ b/app/code/Magento/NewRelicReporting/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="newrelicreporting" translate="label" type="text" sortOrder="1100" showInDefault="1" showInWebsite="1" showInStore="1"> <label>New Relic Reporting</label> diff --git a/app/code/Magento/NewRelicReporting/etc/config.xml b/app/code/Magento/NewRelicReporting/etc/config.xml index 047783546245db88a65ef987d95e4956e5bc8412..b54ef608610877fd5237d11d08f2247b8dd7b410 100644 --- a/app/code/Magento/NewRelicReporting/etc/config.xml +++ b/app/code/Magento/NewRelicReporting/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <newrelicreporting> <general> diff --git a/app/code/Magento/NewRelicReporting/etc/crontab.xml b/app/code/Magento/NewRelicReporting/etc/crontab.xml index e9e89039ded3d16abbd0e60a781da5fb8e7d2cd9..7578ed15545ff388d97becc7881f374f3c8b463a 100644 --- a/app/code/Magento/NewRelicReporting/etc/crontab.xml +++ b/app/code/Magento/NewRelicReporting/etc/crontab.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Cron/etc/crontab.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd"> <group id="default"> <job name="magento_newrelicreporting_cron" instance="Magento\NewRelicReporting\Model\Cron" method="runCron"> <schedule>*/2 * * * *</schedule> diff --git a/app/code/Magento/NewRelicReporting/etc/di.xml b/app/code/Magento/NewRelicReporting/etc/di.xml index c78ff649c5aec6d1cb6ef01412b91bb7808985a9..72a36416f1b3fd2a2fe847083cd8551731662d68 100644 --- a/app/code/Magento/NewRelicReporting/etc/di.xml +++ b/app/code/Magento/NewRelicReporting/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Framework\Module\ModuleListInterface" type="Magento\Framework\Module\ModuleList" /> <type name="Magento\NewRelicReporting\Model\Module\Collect"> <arguments> diff --git a/app/code/Magento/NewRelicReporting/etc/events.xml b/app/code/Magento/NewRelicReporting/etc/events.xml index 90dcf0625d6660833910488d0ed0054678411aed..11201397d87699eeef82e055dc3c2d3dc268dcaf 100644 --- a/app/code/Magento/NewRelicReporting/etc/events.xml +++ b/app/code/Magento/NewRelicReporting/etc/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="sales_order_place_after"> <observer name="newrelicreporting_observer_report_sales_order_place" instance="Magento\NewRelicReporting\Model\Observer\ReportOrderPlaced" method="execute" /> <observer name="newrelicreporting_newrelic_report_sales_order_place" instance="Magento\NewRelicReporting\Model\Observer\ReportOrderPlacedToNewRelic" method="execute" /> diff --git a/app/code/Magento/NewRelicReporting/etc/frontend/events.xml b/app/code/Magento/NewRelicReporting/etc/frontend/events.xml index 6e6ef76851efa6b8e2f15659e723c8b96a6a6833..471fa6c63ce619adef297feaf4f7da3aaf39f3ea 100644 --- a/app/code/Magento/NewRelicReporting/etc/frontend/events.xml +++ b/app/code/Magento/NewRelicReporting/etc/frontend/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="controller_action_predispatch"> <observer name="newrelicreporting_observer_report_concurrent_users" instance="Magento\NewRelicReporting\Model\Observer\ReportConcurrentUsers" method="execute" /> <observer name="newrelicreporting_newrelic_report_concurrent_users" instance="Magento\NewRelicReporting\Model\Observer\ReportConcurrentUsersToNewRelic" method="execute" /> diff --git a/app/code/Magento/NewRelicReporting/etc/module.xml b/app/code/Magento/NewRelicReporting/etc/module.xml index d9674d30ac315a4a5d67fbb9ca5a1fa2cb371b10..58a81d5accf8167d853458e7df9ec7edcf22b810 100644 --- a/app/code/Magento/NewRelicReporting/etc/module.xml +++ b/app/code/Magento/NewRelicReporting/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_NewRelicReporting" setup_version="2.0.0"> <sequence> <module name="Magento_Store"/> diff --git a/app/code/Magento/NewRelicReporting/registration.php b/app/code/Magento/NewRelicReporting/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..d342feffdd9e8049ddf8d2d25534ebf31a139c61 --- /dev/null +++ b/app/code/Magento/NewRelicReporting/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_NewRelicReporting', + __DIR__ +); diff --git a/app/code/Magento/Newsletter/composer.json b/app/code/Magento/Newsletter/composer.json index 2e3c31383b4a994e5e76a212c1feaf82e3a4d5c9..c5dd46c863ea86197d288c510e4280ad1bf9ae9a 100644 --- a/app/code/Magento/Newsletter/composer.json +++ b/app/code/Magento/Newsletter/composer.json @@ -12,8 +12,7 @@ "magento/module-cron": "1.0.0-beta", "magento/module-eav": "1.0.0-beta", "magento/module-require-js": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -21,12 +20,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Newsletter" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Newsletter\\": "" + } } } diff --git a/app/code/Magento/Newsletter/etc/acl.xml b/app/code/Magento/Newsletter/etc/acl.xml index 9ed4e7785d27dc5b0773cea1e0e9a4601183d426..f8e0ee8fb5dd497b8ba17382ce027b1e54abadb6 100644 --- a/app/code/Magento/Newsletter/etc/acl.xml +++ b/app/code/Magento/Newsletter/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/app/code/Magento/Newsletter/etc/adminhtml/menu.xml b/app/code/Magento/Newsletter/etc/adminhtml/menu.xml index 5a8217e12aa3696e74cb7ae7edfa48b3c3de2804..960be7637049f13ac4553b7b3d36b20ed967fcd0 100644 --- a/app/code/Magento/Newsletter/etc/adminhtml/menu.xml +++ b/app/code/Magento/Newsletter/etc/adminhtml/menu.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Backend/etc/menu.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd"> <menu> <add id="Magento_Newsletter::newsletter_template" title="Newsletter Template" module="Magento_Newsletter" parent="Magento_Backend::marketing_communications" sortOrder="30" action="newsletter/template/" resource="Magento_Newsletter::template"/> <add id="Magento_Newsletter::newsletter_queue" title="Newsletter Queue" module="Magento_Newsletter" sortOrder="40" parent="Magento_Backend::marketing_communications" action="newsletter/queue/" resource="Magento_Newsletter::queue"/> diff --git a/app/code/Magento/Newsletter/etc/adminhtml/routes.xml b/app/code/Magento/Newsletter/etc/adminhtml/routes.xml index c95dd696fb5318a105df24eb066d15b830d9a999..7ef8b603a7b5ea2b7b8c75a90463b38d5001ef98 100644 --- a/app/code/Magento/Newsletter/etc/adminhtml/routes.xml +++ b/app/code/Magento/Newsletter/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn: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/adminhtml/system.xml b/app/code/Magento/Newsletter/etc/adminhtml/system.xml index 9fdd0f6cb36a4da7e46ebcb60dbb8a90008b2892..62d3d19958718097a0433295f8ac6536d8fd1812 100644 --- a/app/code/Magento/Newsletter/etc/adminhtml/system.xml +++ b/app/code/Magento/Newsletter/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="newsletter" translate="label" type="text" sortOrder="110" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Newsletter</label> diff --git a/app/code/Magento/Newsletter/etc/config.xml b/app/code/Magento/Newsletter/etc/config.xml index 92b70813d46942884b7a4a55c7c69627612fef32..60d358da566419db89da0221ace6d481b1ad0bf2 100644 --- a/app/code/Magento/Newsletter/etc/config.xml +++ b/app/code/Magento/Newsletter/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <newsletter> <subscription> diff --git a/app/code/Magento/Newsletter/etc/crontab.xml b/app/code/Magento/Newsletter/etc/crontab.xml index 0c2daae3cf40414964d70d4f97da93c02055386e..1a61298ce725c94ad0927efb7d97f5887a06ec92 100644 --- a/app/code/Magento/Newsletter/etc/crontab.xml +++ b/app/code/Magento/Newsletter/etc/crontab.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Cron/etc/crontab.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd"> <group id="default"> <job name="newsletter_send_all" instance="Magento\Newsletter\Model\Observer" method="scheduledSend"> <schedule>*/5 * * * *</schedule> diff --git a/app/code/Magento/Newsletter/etc/di.xml b/app/code/Magento/Newsletter/etc/di.xml index b90d0f8064b32445fcfb417d70eb884eab78155d..e5b5267ee7400425ad2f2e1bab92f6314261d27b 100644 --- a/app/code/Magento/Newsletter/etc/di.xml +++ b/app/code/Magento/Newsletter/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <virtualType name="Magento\Newsletter\Model\Session\Storage" type="Magento\Framework\Session\Storage"> <arguments> <argument name="namespace" xsi:type="string">newsletter</argument> diff --git a/app/code/Magento/Newsletter/etc/email_templates.xml b/app/code/Magento/Newsletter/etc/email_templates.xml index 980d05693d22f00869dc8c92835994f4e58d1726..c0f3999d33c5ba490ee420e2cb5d69e6b6bdafba 100644 --- a/app/code/Magento/Newsletter/etc/email_templates.xml +++ b/app/code/Magento/Newsletter/etc/email_templates.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Email/etc/email_templates.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Email:etc/email_templates.xsd"> <template id="newsletter_subscription_confirm_email_template" label="Subscription Confirmation" file="subscr_confirm.html" type="html" module="Magento_Newsletter" area="frontend"/> <template id="newsletter_subscription_success_email_template" label="Subscription Success" file="subscr_success.html" type="html" module="Magento_Newsletter" area="frontend"/> <template id="newsletter_subscription_un_email_template" label="Unsubscription Success" file="unsub_success.html" type="html" module="Magento_Newsletter" area="frontend"/> diff --git a/app/code/Magento/Newsletter/etc/frontend/di.xml b/app/code/Magento/Newsletter/etc/frontend/di.xml index a97a0f3222237b0ed7594230c7b14b2088d34edb..c498f2a38f4a5891d1e5ef5f1fb4f66b3317d1ea 100644 --- a/app/code/Magento/Newsletter/etc/frontend/di.xml +++ b/app/code/Magento/Newsletter/etc/frontend/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Framework\Url\SecurityInfo"> <arguments> <argument name="secureUrlList" xsi:type="array"> diff --git a/app/code/Magento/Newsletter/etc/frontend/page_types.xml b/app/code/Magento/Newsletter/etc/frontend/page_types.xml index f6976324e9a862bec0d095ce8ada89ced4ee086f..3fac803da9c7acf6a222504ed9865c428699b193 100644 --- a/app/code/Magento/Newsletter/etc/frontend/page_types.xml +++ b/app/code/Magento/Newsletter/etc/frontend/page_types.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<page_types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_types.xsd"> +<page_types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_types.xsd"> <type id="newsletter_manage_index" label="Customer My Account Newsletter Subscriptions"/> </page_types> diff --git a/app/code/Magento/Newsletter/etc/frontend/routes.xml b/app/code/Magento/Newsletter/etc/frontend/routes.xml index a27839c5f0d37ab67e37b1704cb1b6feb1836cf3..97bc1e087e6953a48b8c900cc46f0f50fc090c10 100644 --- a/app/code/Magento/Newsletter/etc/frontend/routes.xml +++ b/app/code/Magento/Newsletter/etc/frontend/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn: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/etc/module.xml b/app/code/Magento/Newsletter/etc/module.xml index 7d5356b547755df7fd21858f504d8208d1339fd8..9f04155331ef8ba4fbb0074e19c608b5643f0346 100644 --- a/app/code/Magento/Newsletter/etc/module.xml +++ b/app/code/Magento/Newsletter/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Newsletter" setup_version="2.0.0"> <sequence> <module name="Magento_Store"/> diff --git a/app/code/Magento/Newsletter/registration.php b/app/code/Magento/Newsletter/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..0f282d1561dd35a2270965c073c1e138c212ea9a --- /dev/null +++ b/app/code/Magento/Newsletter/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Newsletter', + __DIR__ +); diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/customer_index_edit.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/customer_index_edit.xml index 9370c60513dc798de81b4d8a88a5b3c3b5678c1b..a2ea532626b1fbe84b1fc8d362d2576908ca1a9a 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/customer_index_edit.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/customer_index_edit.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="customer_form"> <block acl="Magento_Newsletter::subscriber" class="Magento\Customer\Block\Adminhtml\Edit\Tab\Newsletter" name="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 288acbc3fa150060ec48bc7e310ff113013ba637..8e97a9ce5abe2bd1ff4079b5d4239bf0d752a0a5 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 @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="adminhtml.newsletter.problem.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.newslettrer.problem.grid" as="grid"> diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_problem_grid.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_problem_grid.xml index 568681b97887d81f62bae6f4b070682557a3d394..db11a6a3895fb3110aab6712fb1b6bcf4e6e9f41 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_problem_grid.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_problem_grid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <update handle="formkey"/> <update handle="newsletter_problem_block"/> <container name="root"> diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_problem_index.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_problem_index.xml index 8fc18d4fd01cd8265e41d04287cfdc36b2e1e78e..8e4403dcaa87e8934f549108e26b8bbeeebd91a5 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_problem_index.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_problem_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="formkey"/> <update handle="newsletter_problem_block"/> <body> diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_edit.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_edit.xml index d56d1d79a1a2c149854274d47ca463cfd69db481..f6fe8d9f1990521979cc8665f7cda0a96f6d59a9 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_edit.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_edit.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <css src="jquery/fileUploader/css/jquery.fileupload-ui.css"/> </head> diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_grid.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_grid.xml index 10ff26c4439edb0a75800acb623a8b52e040cc2c..99d574026e4bc84dd7b5796119a28b1695c64ed8 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_grid.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_grid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <update handle="formkey"/> <update handle="newsletter_queue_grid_block"/> <container name="root"> diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_grid_block.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_grid_block.xml index ac08fae043118a0365f9641013dbffb8660ed51c..baa9e034df5e950d263ad590e02df82e7856ff26 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_grid_block.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_grid_block.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="adminhtml.newsletter.queue.grid.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.newsletter.queue.grid" as="grid"> diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_index.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_index.xml index 93c45a37bb5cd73c36e390c95d08bdf2d1e0ba4b..b1e18cbb45bfedbe34783564815a3a529b52c9c2 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_index.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="newsletter_queue_grid_block"/> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_preview.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_preview.xml index f4b996bcaa12deff38d0f5d33d2a15b7d1109226..3f53ab3ea5d2c9bf6d846909d1377e77b3e0f413 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_preview.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_preview.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <attribute name="id" value="html-body"/> <attribute name="class" value="preview-window"/> diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_preview_popup.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_preview_popup.xml index 0a4ba942d58a7fba4857cf931cfafb68af305c02..d446ee16e1fd3cb27be034e2684c05aa47089d1f 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_preview_popup.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_preview_popup.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root"> <block class="Magento\Framework\View\Element\Template" name="page.block" template="Magento_Newsletter::queue/preview.phtml"> <block class="Magento\Newsletter\Block\Adminhtml\Queue\Preview" name="content" as="content"/> diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_subscriber_block.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_subscriber_block.xml index a7519990856e317b52798cc4a62d330b14d19396..44b8cd7a827dc133d32546cbce7f28373d9039a9 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_subscriber_block.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_subscriber_block.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="adminhtml.newsletter.subscriber.container"> <block class="Magento\Newsletter\Block\Adminhtml\Subscriber\Grid" name="adminhtml.newslettrer.subscriber.grid" as="grid"> diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_subscriber_exportcsv.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_subscriber_exportcsv.xml index 5c2b151575f148986922c14a2bebacce2def8355..17c7b8e655685bad806d56325d978a6cce1f1d76 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_subscriber_exportcsv.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_subscriber_exportcsv.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="newsletter_subscriber_block"/> <body> <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.newsletter.subscriber.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_subscriber_exportxml.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_subscriber_exportxml.xml index 5c2b151575f148986922c14a2bebacce2def8355..17c7b8e655685bad806d56325d978a6cce1f1d76 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_subscriber_exportxml.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_subscriber_exportxml.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="newsletter_subscriber_block"/> <body> <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.newsletter.subscriber.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_subscriber_grid.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_subscriber_grid.xml index 42ce455e9ed2958d1dc1a268eeaf5a0e6cf61915..4ba480c1c03ecb699201c162c6422e77a1987b52 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_subscriber_grid.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_subscriber_grid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <update handle="formkey"/> <update handle="newsletter_subscriber_block"/> <container name="root"> diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_subscriber_index.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_subscriber_index.xml index 907ce6147b06c273f6118408b4c7c65c350811fc..7026a01266b359cbed93da0c5d031ad5d362c82f 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_subscriber_index.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_subscriber_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="formkey"/> <update handle="newsletter_subscriber_block"/> <body> diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_template_edit.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_template_edit.xml index 8c236ed2b11bea5f999cab9c08db6ab3951ac387..5608b9e877a587b8ca7a9f61bd1a5758b14e1f21 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_template_edit.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_template_edit.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <css src="jquery/fileUploader/css/jquery.fileupload-ui.css"/> </head> diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_template_preview.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_template_preview.xml index 5d6173d564e2027858f28deec58a2629fd2dccf9..4e9e88cb3a7c77595c182cfcf9fbf85c5a834c27 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_template_preview.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_template_preview.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <attribute name="id" value="html-body"/> <attribute name="class" value="preview-window"/> diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_template_preview_popup.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_template_preview_popup.xml index 5292f5a0ba5f09f8667be86d3640e8e69f24ce43..4d6649992154e721bbc581495c4f2a01c03027d2 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_template_preview_popup.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_template_preview_popup.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root"> <block class="Magento\Framework\View\Element\Template" name="page.block" template="Magento_Newsletter::template/preview.phtml"> <block class="Magento\Newsletter\Block\Adminhtml\Template\Preview" name="content" as="content"/> diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/preview.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/preview.xml index 5292f5a0ba5f09f8667be86d3640e8e69f24ce43..4d6649992154e721bbc581495c4f2a01c03027d2 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/preview.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/preview.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root"> <block class="Magento\Framework\View\Element\Template" name="page.block" template="Magento_Newsletter::template/preview.phtml"> <block class="Magento\Newsletter\Block\Adminhtml\Template\Preview" name="content" as="content"/> diff --git a/app/code/Magento/Newsletter/view/frontend/layout/customer_account.xml b/app/code/Magento/Newsletter/view/frontend/layout/customer_account.xml index e009e753a8bd0fbb0ad5476f0417b4fae7f3a2ad..ad87b14bd383e37f66ebf9f62d2331483c65aa11 100644 --- a/app/code/Magento/Newsletter/view/frontend/layout/customer_account.xml +++ b/app/code/Magento/Newsletter/view/frontend/layout/customer_account.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="customer_account_navigation"> <block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-navigation-newsletter-subscriptions-link"> diff --git a/app/code/Magento/Newsletter/view/frontend/layout/default.xml b/app/code/Magento/Newsletter/view/frontend/layout/default.xml index 1aed0d2d409871589975d497a94a2b489f75a9d8..ca78ee3ee02bfaa136d347ed8b2441e0bd5fb7e6 100644 --- a/app/code/Magento/Newsletter/view/frontend/layout/default.xml +++ b/app/code/Magento/Newsletter/view/frontend/layout/default.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="head.components"> <block class="Magento\Framework\View\Element\Js\Components" name="newsletter_head_components" template="Magento_Newsletter::js/components.phtml"/> diff --git a/app/code/Magento/Newsletter/view/frontend/layout/newsletter_manage_index.xml b/app/code/Magento/Newsletter/view/frontend/layout/newsletter_manage_index.xml index a2e65fc7bddc0da03a4242724e05c17a20f1880d..76700eca28793c8097893f04adf80ee4f547f618 100644 --- a/app/code/Magento/Newsletter/view/frontend/layout/newsletter_manage_index.xml +++ b/app/code/Magento/Newsletter/view/frontend/layout/newsletter_manage_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="customer_account"/> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/OfflinePayments/composer.json b/app/code/Magento/OfflinePayments/composer.json index b810b309fcc4c17234309b5a5b568947d1d1eb37..51c7d5bb3e20e3aa882374827c47383be888cd79 100644 --- a/app/code/Magento/OfflinePayments/composer.json +++ b/app/code/Magento/OfflinePayments/composer.json @@ -5,8 +5,7 @@ "php": "~5.5.0|~5.6.0|~7.0.0", "magento/module-checkout": "1.0.0-beta", "magento/module-payment": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -14,12 +13,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/OfflinePayments" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\OfflinePayments\\": "" + } } } diff --git a/app/code/Magento/OfflinePayments/etc/adminhtml/system.xml b/app/code/Magento/OfflinePayments/etc/adminhtml/system.xml index b793f098f93a8d2c98cd37cff5cc15a21d2a7fff..0d7f096027cbb8545928a25dc99a49383225fa19 100644 --- a/app/code/Magento/OfflinePayments/etc/adminhtml/system.xml +++ b/app/code/Magento/OfflinePayments/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="payment" translate="label" type="text" sortOrder="400" showInDefault="1" showInWebsite="1" showInStore="1"> <group id="checkmo" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1"> diff --git a/app/code/Magento/OfflinePayments/etc/config.xml b/app/code/Magento/OfflinePayments/etc/config.xml index 67b15cb57e22d428d611630b43dd3fbf39af3c83..fa8537700717e16df6a8b181ef8667cbf552bbe0 100644 --- a/app/code/Magento/OfflinePayments/etc/config.xml +++ b/app/code/Magento/OfflinePayments/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <payment> <checkmo> diff --git a/app/code/Magento/OfflinePayments/etc/events.xml b/app/code/Magento/OfflinePayments/etc/events.xml index be8329f965ba649ab7366a94aff5d1477b4c2e97..cda1bc21cb4eda5fb4b7021c45ebc8117866c16e 100644 --- a/app/code/Magento/OfflinePayments/etc/events.xml +++ b/app/code/Magento/OfflinePayments/etc/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="sales_order_payment_save_before"> <observer name="payment_before_save" instance="Magento\OfflinePayments\Observer\BeforeOrderPaymentSaveObserver" method="execute" /> </event> diff --git a/app/code/Magento/OfflinePayments/etc/frontend/di.xml b/app/code/Magento/OfflinePayments/etc/frontend/di.xml index 1c1cabff9633b74e24cb58ac2ccb09c7dad7bb9e..5b52b465b7396cefd0bc8e6411a3a2176a406c84 100644 --- a/app/code/Magento/OfflinePayments/etc/frontend/di.xml +++ b/app/code/Magento/OfflinePayments/etc/frontend/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Checkout\Model\CompositeConfigProvider"> <arguments> <argument name="configProviders" xsi:type="array"> diff --git a/app/code/Magento/OfflinePayments/etc/module.xml b/app/code/Magento/OfflinePayments/etc/module.xml index c6cc2bf889da1d50dd65d60f2205c291d3f94b8d..6eb1f94158fee95870aa43a3fb68b6db5d64dc14 100644 --- a/app/code/Magento/OfflinePayments/etc/module.xml +++ b/app/code/Magento/OfflinePayments/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_OfflinePayments" setup_version="2.0.0"> <sequence> <module name="Magento_Store"/> diff --git a/app/code/Magento/OfflinePayments/etc/payment.xml b/app/code/Magento/OfflinePayments/etc/payment.xml index d0f09bdb19febb9636b27b9508bf8e7992b20f64..a77a94508d3bc7db86adc58931086b12e6a8ad63 100644 --- a/app/code/Magento/OfflinePayments/etc/payment.xml +++ b/app/code/Magento/OfflinePayments/etc/payment.xml @@ -6,7 +6,7 @@ */ --> <payment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../Magento/Payment/etc/payment.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Payment:etc/payment.xsd"> <groups> <group id="offline"> <label>Offline Payment Methods</label> diff --git a/app/code/Magento/OfflinePayments/registration.php b/app/code/Magento/OfflinePayments/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..7cc05a9270df4ba730000f02ff60693539fa58c7 --- /dev/null +++ b/app/code/Magento/OfflinePayments/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_OfflinePayments', + __DIR__ +); diff --git a/app/code/Magento/OfflinePayments/view/frontend/layout/checkout_index_index.xml b/app/code/Magento/OfflinePayments/view/frontend/layout/checkout_index_index.xml index b590f7d3ae460d8e4b628d1ae5a8fd8576c69c96..efcaa908ff6aa85c540419631b02b57b0ca45b45 100644 --- a/app/code/Magento/OfflinePayments/view/frontend/layout/checkout_index_index.xml +++ b/app/code/Magento/OfflinePayments/view/frontend/layout/checkout_index_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout.root"> <arguments> diff --git a/app/code/Magento/OfflineShipping/composer.json b/app/code/Magento/OfflineShipping/composer.json index 88ac36533cbf5bd62183cb8722ef2613e241dd49..bb186fb3aeaa78345018819b57bf202955b12820 100644 --- a/app/code/Magento/OfflineShipping/composer.json +++ b/app/code/Magento/OfflineShipping/composer.json @@ -12,8 +12,7 @@ "magento/module-sales-rule": "1.0.0-beta", "magento/module-directory": "1.0.0-beta", "magento/module-quote": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "suggest": { "magento/module-checkout": "1.0.0-beta" @@ -24,12 +23,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/OfflineShipping" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\OfflineShipping\\": "" + } } } diff --git a/app/code/Magento/OfflineShipping/etc/adminhtml/events.xml b/app/code/Magento/OfflineShipping/etc/adminhtml/events.xml index 12dc2c8fafbfdb7c553f97a4e07ebf6ec71122ee..2c0f82125862dfaa125fb6caa2ad55588f53d30b 100644 --- a/app/code/Magento/OfflineShipping/etc/adminhtml/events.xml +++ b/app/code/Magento/OfflineShipping/etc/adminhtml/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="adminhtml_block_salesrule_actions_prepareform"> <observer name="offlineshipping_salesrule" instance="Magento\OfflineShipping\Observer\SalesRule\ActionsTabPrepareFormObserver" method="execute" /> </event> diff --git a/app/code/Magento/OfflineShipping/etc/adminhtml/routes.xml b/app/code/Magento/OfflineShipping/etc/adminhtml/routes.xml index 83356fa91b217da1c5aea65db9b561241ffffb02..d5a28ca447cb7c79ce1aa5fd1804a6f5e03c72c9 100644 --- a/app/code/Magento/OfflineShipping/etc/adminhtml/routes.xml +++ b/app/code/Magento/OfflineShipping/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn: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/adminhtml/system.xml b/app/code/Magento/OfflineShipping/etc/adminhtml/system.xml index e18d151f170bfef33fbbd8b89affa3f2cf0badca..30e1e8a97ebab5cd365343894d49911bcd02ed4b 100644 --- a/app/code/Magento/OfflineShipping/etc/adminhtml/system.xml +++ b/app/code/Magento/OfflineShipping/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="carriers" translate="label" type="text" sortOrder="320" showInDefault="1" showInWebsite="1" showInStore="1"> <group id="flatrate" translate="label" type="text" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1"> diff --git a/app/code/Magento/OfflineShipping/etc/config.xml b/app/code/Magento/OfflineShipping/etc/config.xml index 09dd89a88e3aa8da935ca5297094b58f1b67ee05..ae80850266386ca962a813cb88b8a3ac518b3a2d 100644 --- a/app/code/Magento/OfflineShipping/etc/config.xml +++ b/app/code/Magento/OfflineShipping/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <carriers> <flatrate> diff --git a/app/code/Magento/OfflineShipping/etc/di.xml b/app/code/Magento/OfflineShipping/etc/di.xml index 7773b54f4e16a111d2254182880526378a3140e0..5aa704de993027a8a84fc8746285d97a2ca52c74 100644 --- a/app/code/Magento/OfflineShipping/etc/di.xml +++ b/app/code/Magento/OfflineShipping/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Checkout\Block\Cart\LayoutProcessor"> <plugin name="checkout_cart_shipping_plugin" type="Magento\OfflineShipping\Model\Plugin\Checkout\Block\Cart\Shipping"/> </type> diff --git a/app/code/Magento/OfflineShipping/etc/fieldset.xml b/app/code/Magento/OfflineShipping/etc/fieldset.xml index 0e9c27801c8de308976e7f8307c13d07dea4d7d2..e8c36dfbd893ef7d49726712275ac3a9b637e9fa 100644 --- a/app/code/Magento/OfflineShipping/etc/fieldset.xml +++ b/app/code/Magento/OfflineShipping/etc/fieldset.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/DataObject/etc/fieldset.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:framework:DataObject/etc/fieldset.xsd"> <scope id="global"> <fieldset id="quote_convert_item"> <field name="free_shipping"> diff --git a/app/code/Magento/OfflineShipping/etc/module.xml b/app/code/Magento/OfflineShipping/etc/module.xml index 0fc26a22f65a05213c526a44a8750e52e6db656d..03224d265f948ad4381aaa018cf3ad1e67f3d779 100644 --- a/app/code/Magento/OfflineShipping/etc/module.xml +++ b/app/code/Magento/OfflineShipping/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_OfflineShipping" setup_version="2.0.0"> <sequence> <module name="Magento_Store"/> diff --git a/app/code/Magento/OfflineShipping/registration.php b/app/code/Magento/OfflineShipping/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..14c6bff9ecc8150bc47cd61577f5af81b878838b --- /dev/null +++ b/app/code/Magento/OfflineShipping/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_OfflineShipping', + __DIR__ +); diff --git a/app/code/Magento/OfflineShipping/view/frontend/layout/checkout_cart_index.xml b/app/code/Magento/OfflineShipping/view/frontend/layout/checkout_cart_index.xml index 3ebc48cb7533c7b66ed81bb984007151206ea02b..2c33eb208d49e8717a2bdd9679f8fcf3a3a5cd72 100644 --- a/app/code/Magento/OfflineShipping/view/frontend/layout/checkout_cart_index.xml +++ b/app/code/Magento/OfflineShipping/view/frontend/layout/checkout_cart_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout.cart.shipping"> <arguments> diff --git a/app/code/Magento/OfflineShipping/view/frontend/layout/checkout_index_index.xml b/app/code/Magento/OfflineShipping/view/frontend/layout/checkout_index_index.xml index f97709a21bd0aa5313a6bdc0f44ef0167205a1e1..3cf342b65aaeae01cb23a331f1fd00b88c2b743a 100644 --- a/app/code/Magento/OfflineShipping/view/frontend/layout/checkout_index_index.xml +++ b/app/code/Magento/OfflineShipping/view/frontend/layout/checkout_index_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout.root"> <arguments> diff --git a/app/code/Magento/PageCache/Model/App/Response/HttpPlugin.php b/app/code/Magento/PageCache/Model/App/Response/HttpPlugin.php index 3b4da78c355574e1cae7e28d5e04bbe4d7b06446..016d3d9409eb015de466d436e527996f24fa04e9 100644 --- a/app/code/Magento/PageCache/Model/App/Response/HttpPlugin.php +++ b/app/code/Magento/PageCache/Model/App/Response/HttpPlugin.php @@ -19,6 +19,9 @@ class HttpPlugin */ public function beforeSendResponse(\Magento\Framework\App\Response\Http $subject) { + if ($subject instanceof \Magento\Framework\App\PageCache\NotCacheableInterface) { + return; + } $subject->sendVary(); } } diff --git a/app/code/Magento/PageCache/Model/Cache/Server.php b/app/code/Magento/PageCache/Model/Cache/Server.php new file mode 100644 index 0000000000000000000000000000000000000000..fc52e41e3b23428142c147c8a13556005ca72e12 --- /dev/null +++ b/app/code/Magento/PageCache/Model/Cache/Server.php @@ -0,0 +1,77 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\PageCache\Model\Cache; + +use Zend\Uri\Uri; +use Magento\Framework\App\DeploymentConfig; +use Magento\Framework\Config\ConfigOptionsListConstants; +use Magento\Framework\App\RequestInterface; +use Zend\Uri\UriFactory; + +class Server +{ + /** + * @var \Magento\Framework\UrlInterface + */ + protected $urlBuilder; + + /** + * @var DeploymentConfig + */ + private $config; + + /** + * @var RequestInterface + */ + private $request; + + const DEFAULT_PORT = 80; + + /** + * Constructor + * + * @param \Magento\Framework\UrlInterface $urlBuilder + * @param DeploymentConfig $config + * @param RequestInterface $request + */ + public function __construct( + \Magento\Framework\UrlInterface $urlBuilder, + DeploymentConfig $config, + RequestInterface $request + ) { + $this->urlBuilder = $urlBuilder; + $this->config = $config; + $this->request = $request; + } + + /** + * Get cache servers' Uris + * + * @return Uri[] + */ + public function getUris() + { + $servers = []; + $configuredHosts = $this->config->get(ConfigOptionsListConstants::CONFIG_PATH_CACHE_HOSTS); + if (null == $configuredHosts) { + $httpHost = $this->request->getHttpHost(); + $servers[] = $httpHost ? + UriFactory::factory('')->setHost($httpHost)->setPort(self::DEFAULT_PORT)->setScheme('http') : + UriFactory::factory($this->urlBuilder->getUrl('*')) + ->setScheme('http') + ->setPath(null) + ->setQuery(null); + + } else { + foreach ($configuredHosts as $host) { + $servers[] = UriFactory::factory('')->setHost($host['host']) + ->setPort(isset($host['port']) ? $host['port'] : self::DEFAULT_PORT) + ->setScheme('http'); + } + } + return $servers; + } +} diff --git a/app/code/Magento/PageCache/Model/Config.php b/app/code/Magento/PageCache/Model/Config.php index 7ffeeddbe18b9a55142e9ffbae899ac2483ec812..2bde5406d126eebe983903ec2b6bb20c20997e6a 100644 --- a/app/code/Magento/PageCache/Model/Config.php +++ b/app/code/Magento/PageCache/Model/Config.php @@ -5,8 +5,8 @@ */ namespace Magento\PageCache\Model; -use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\Filesystem; +use Magento\Framework\Module\Dir; /** * Model is responsible for replacing default vcl template @@ -64,23 +64,31 @@ class Config protected $_cacheState; /** - * @var \Magento\Framework\Filesystem\Directory\WriteInterface + * @var Filesystem\Directory\ReadFactory */ - protected $_modulesDirectory; + protected $readFactory; /** - * @param Filesystem $filesystem + * @var \Magento\Framework\Module\Dir\Reader + */ + protected $reader; + + /** + * @param Filesystem\Directory\ReadFactory $readFactory * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Framework\App\Cache\StateInterface $cacheState + * @param Dir\Reader $reader */ public function __construct( - \Magento\Framework\Filesystem $filesystem, + \Magento\Framework\Filesystem\Directory\ReadFactory $readFactory, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\Framework\App\Cache\StateInterface $cacheState + \Magento\Framework\App\Cache\StateInterface $cacheState, + \Magento\Framework\Module\Dir\Reader $reader ) { - $this->_modulesDirectory = $filesystem->getDirectoryRead(DirectoryList::MODULES); + $this->readFactory = $readFactory; $this->_scopeConfig = $scopeConfig; $this->_cacheState = $cacheState; + $this->reader = $reader; } /** @@ -114,7 +122,11 @@ class Config */ public function getVclFile($vclTemplatePath) { - $data = $this->_modulesDirectory->readFile($this->_scopeConfig->getValue($vclTemplatePath)); + $moduleEtcPath = $this->reader->getModuleDir(Dir::MODULE_ETC_DIR, 'Magento_PageCache'); + $configFilePath = $moduleEtcPath . '/' . $this->_scopeConfig->getValue($vclTemplatePath); + $directoryRead = $this->readFactory->create($moduleEtcPath); + $configFilePath = $directoryRead->getRelativePath($configFilePath); + $data = $directoryRead->readFile($configFilePath); return strtr($data, $this->_getReplacements()); } diff --git a/app/code/Magento/PageCache/Test/Unit/Model/App/Response/HttpPluginTest.php b/app/code/Magento/PageCache/Test/Unit/Model/App/Response/HttpPluginTest.php index 33e3b02e3d53bceea48fb0cf3208017f9b811c85..f18226054bb6ba02fdddef5988d5bea46f1fca0c 100644 --- a/app/code/Magento/PageCache/Test/Unit/Model/App/Response/HttpPluginTest.php +++ b/app/code/Magento/PageCache/Test/Unit/Model/App/Response/HttpPluginTest.php @@ -4,22 +4,33 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\PageCache\Test\Unit\Model\App\Response; use Magento\PageCache\Model\App\Response\HttpPlugin; class HttpPluginTest extends \PHPUnit_Framework_TestCase { - public function testBeforeSendResponse() + /** + * @param \Magento\Framework\App\Response\FileInterface $responseInstanceClass + * @param int $sendVaryCalled + * + * @dataProvider beforeSendResponseDataProvider + */ + public function testBeforeSendResponse($responseInstanceClass, $sendVaryCalled) { - /** @var \Magento\Framework\App\Response\Http|\PHPUnit_Framework_MockObject_MockObject $responseMock */ - $responseMock = $this->getMockBuilder('Magento\Framework\App\Response\Http') - ->disableOriginalConstructor() - ->getMock(); - $responseMock->expects($this->once())->method('sendVary'); + /** @var \Magento\Framework\App\Response\Http | \PHPUnit_Framework_MockObject_MockObject $responseMock */ + $responseMock = $this->getMock($responseInstanceClass, [], [], '', false); + $responseMock->expects($this->exactly($sendVaryCalled)) + ->method('sendVary'); $plugin = new HttpPlugin(); $plugin->beforeSendResponse($responseMock); } + + public function beforeSendResponseDataProvider() + { + return [ + ['Magento\Framework\App\Response\Http', 1], + ['Magento\MediaStorage\Model\File\Storage\Response', 0] + ]; + } } diff --git a/app/code/Magento/PageCache/Test/Unit/Model/Cache/ServerTest.php b/app/code/Magento/PageCache/Test/Unit/Model/Cache/ServerTest.php new file mode 100644 index 0000000000000000000000000000000000000000..38cc49be2ff4839736af9bd27d18752a585e8aee --- /dev/null +++ b/app/code/Magento/PageCache/Test/Unit/Model/Cache/ServerTest.php @@ -0,0 +1,110 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\PageCache\Test\Unit\Model\Cache; + +use \Zend\Uri\UriFactory; + +class ServerTest extends \PHPUnit_Framework_TestCase +{ + /** @var \Magento\PageCache\Model\Cache\Server */ + protected $model; + + /** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Framework\App\DeploymentConfig */ + protected $configMock; + + /** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Framework\App\RequestInterface */ + protected $requestMock; + + /** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Framework\UrlInterface */ + protected $urlBuilderMock; + + public function setUp() + { + $this->configMock = $this->getMock('Magento\Framework\App\DeploymentConfig', [], [], '', false); + $this->loggerMock = $this->getMock('Magento\Framework\Cache\InvalidateLogger', [], [], '', false); + $this->requestMock = $this->getMock('Magento\Framework\App\Request\Http', [], [], '', false); + $this->urlBuilderMock = $this->getMockBuilder('Magento\Framework\UrlInterface') + ->disableOriginalConstructor() + ->getMock(); + + $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); + $this->model = $objectManager->getObject( + 'Magento\PageCache\Model\Cache\Server', + [ + 'urlBuilder' => $this->urlBuilderMock, + 'config' => $this->configMock, + 'request' => $this->requestMock, + ] + ); + } + + /** + * @param int $getHttpHostCallCtr + * @param string $httpHost + * @param int $getUrlCallCtr + * @param string $url + * @param string[] $hostConfig + * @dataProvider getUrisDataProvider + */ + public function testGetUris( + $getHttpHostCallCtr, + $httpHost, + $getUrlCallCtr, + $url, + $hostConfig = null + ) { + $this->configMock->expects($this->once()) + ->method('get') + ->willReturn($hostConfig); + $this->requestMock->expects($this->exactly($getHttpHostCallCtr)) + ->method('getHttpHost') + ->willReturn($httpHost); + $this->urlBuilderMock->expects($this->exactly($getUrlCallCtr)) + ->method('getUrl') + ->with('*') + ->willReturn($url); + + $uris = []; + if (null === $hostConfig) { + if (!empty($httpHost)) { + $uris[] = UriFactory::factory('')->setHost($httpHost) + ->setPort(\Magento\PageCache\Model\Cache\Server::DEFAULT_PORT) + ->setScheme('http'); + } + if (!empty($url)) { + $uris[] = UriFactory::factory($url); + } + } else { + foreach ($hostConfig as $host) { + $port = isset($host['port']) ? $host['port'] : \Magento\PageCache\Model\Cache\Server::DEFAULT_PORT; + $uris[] = UriFactory::factory('')->setHost($host['host']) + ->setPort($port) + ->setScheme('http'); + } + } + + $this->assertEquals($uris, $this->model->getUris()); + } + + public function getUrisDataProvider() + { + return [ + 'http host' => [1, '127.0.0.1', 0, '',], + 'url' => [1, '', 1, 'http://host',], + 'config' => [ + 0, + '', + 0, + '', + [ + ['host' => '127.0.0.1', 'port' => 8080], + ['host' => '127.0.0.2', 'port' => 1234], + ['host' => 'host'] + ] + ] + ]; + } +} diff --git a/app/code/Magento/PageCache/Test/Unit/Model/ConfigTest.php b/app/code/Magento/PageCache/Test/Unit/Model/ConfigTest.php index 933a0a66a5fac78809381467eed4ca57af0b490c..a9bcd4b4a59e9946424879028d175fee0a7fc351 100644 --- a/app/code/Magento/PageCache/Test/Unit/Model/ConfigTest.php +++ b/app/code/Magento/PageCache/Test/Unit/Model/ConfigTest.php @@ -5,7 +5,6 @@ */ namespace Magento\PageCache\Test\Unit\Model; -use Magento\Framework\App\Filesystem\DirectoryList; use Magento\PageCache\Model\Config; class ConfigTest extends \PHPUnit_Framework_TestCase @@ -25,13 +24,17 @@ class ConfigTest extends \PHPUnit_Framework_TestCase */ protected $_cacheState; + /** + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\Module\Dir\Reader + */ + protected $moduleReader; + /** * setUp all mocks and data function */ public function setUp() { - $filesystemMock = - $this->getMock('Magento\Framework\Filesystem', ['getDirectoryRead'], [], '', false); + $readFactoryMock = $this->getMock('Magento\Framework\Filesystem\Directory\ReadFactory', [], [], '', false); $this->_coreConfigMock = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->_cacheState = $this->getMockForAbstractClass('Magento\Framework\App\Cache\StateInterface'); @@ -42,12 +45,10 @@ class ConfigTest extends \PHPUnit_Framework_TestCase '', false ); - $filesystemMock->expects( - $this->once() + $readFactoryMock->expects( + $this->any() )->method( - 'getDirectoryRead' - )->with( - DirectoryList::MODULES + 'create' )->will( $this->returnValue($modulesDirectoryMock) ); @@ -93,10 +94,12 @@ class ConfigTest extends \PHPUnit_Framework_TestCase ) ); + $this->moduleReader = $this->getMock('Magento\Framework\Module\Dir\Reader', [], [], '', false); $this->_model = new \Magento\PageCache\Model\Config( - $filesystemMock, + $readFactoryMock, $this->_coreConfigMock, - $this->_cacheState + $this->_cacheState, + $this->moduleReader ); } @@ -105,6 +108,9 @@ class ConfigTest extends \PHPUnit_Framework_TestCase */ public function testGetVcl() { + $this->moduleReader->expects($this->once()) + ->method('getModuleDir') + ->willReturn('/magento/app/code/Magento/PageCache'); $test = $this->_model->getVclFile(Config::VARNISH_3_CONFIGURATION_PATH); $this->assertEquals(file_get_contents(__DIR__ . '/_files/result.vcl'), $test); } diff --git a/app/code/Magento/PageCache/Test/Unit/Observer/ProcessLayoutRenderElementTest.php b/app/code/Magento/PageCache/Test/Unit/Observer/ProcessLayoutRenderElementTest.php index ba7130bed145824014d8631807f981fbef211125..bd36c01c8feef440ac5e0aa7776d89b138450183 100644 --- a/app/code/Magento/PageCache/Test/Unit/Observer/ProcessLayoutRenderElementTest.php +++ b/app/code/Magento/PageCache/Test/Unit/Observer/ProcessLayoutRenderElementTest.php @@ -20,9 +20,6 @@ class ProcessLayoutRenderElementTest extends \PHPUnit_Framework_TestCase /** @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\View\Element\AbstractBlock */ protected $_blockMock; - /** @var \PHPUnit_Framework_MockObject_MockObject|\Magento\PageCache\Helper\Data */ - protected $_helperMock; - /** @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\View\Layout */ protected $_layoutMock; @@ -118,7 +115,7 @@ class ProcessLayoutRenderElementTest extends \PHPUnit_Framework_TestCase $this->_layoutMock->expects($this->any()) ->method('getHandles') ->will($this->returnValue([])); - + $this->_layoutMock->expects($this->once()) ->method('getBlock') ->will($this->returnValue($this->_blockMock)); diff --git a/app/code/Magento/PageCache/composer.json b/app/code/Magento/PageCache/composer.json index a0723993d3885f7b7fb55629c449c7a9d6a17f52..65cf3d05e4974244b42b9999d05cfda7ab70b472 100644 --- a/app/code/Magento/PageCache/composer.json +++ b/app/code/Magento/PageCache/composer.json @@ -6,8 +6,7 @@ "magento/module-config": "1.0.0-beta", "magento/module-store": "1.0.0-beta", "magento/module-backend": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -15,12 +14,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/PageCache" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\PageCache\\": "" + } } } diff --git a/app/code/Magento/PageCache/etc/adminhtml/di.xml b/app/code/Magento/PageCache/etc/adminhtml/di.xml index 168272e2b80e3bf81ecdd26de60ba1dcab7caea7..c38dd3fcfb08640505cafe06b3f359f3b7af1800 100644 --- a/app/code/Magento/PageCache/etc/adminhtml/di.xml +++ b/app/code/Magento/PageCache/etc/adminhtml/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Widget\Model\Widget\Instance"> <arguments> <argument name="relatedCacheTypes" xsi:type="array"> diff --git a/app/code/Magento/PageCache/etc/adminhtml/routes.xml b/app/code/Magento/PageCache/etc/adminhtml/routes.xml index 384b2f4df3a43f8ca23c079018ca326268ec2cb0..45dbf51872a5266fac96a470fc5603c79bc84168 100644 --- a/app/code/Magento/PageCache/etc/adminhtml/routes.xml +++ b/app/code/Magento/PageCache/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="admin"> <route id="adminhtml"> <module name="Magento_PageCache" before="Magento_Backend" /> diff --git a/app/code/Magento/PageCache/etc/adminhtml/system.xml b/app/code/Magento/PageCache/etc/adminhtml/system.xml index e1df259698163f172b13ea7d8c55684b83679dc7..b6c79ee8c853fed4c17e053f51c32e22027834f5 100644 --- a/app/code/Magento/PageCache/etc/adminhtml/system.xml +++ b/app/code/Magento/PageCache/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="system"> <group id="full_page_cache" translate="label" showInDefault="1" showInWebsite="0" showInStore="0" sortOrder="600"> diff --git a/app/code/Magento/PageCache/etc/cache.xml b/app/code/Magento/PageCache/etc/cache.xml index 9df0996161b5b2e7e521e9f96323b1c3fb90a1ab..b85fdbcd6475cf605de90354af98f8278e0df426 100644 --- a/app/code/Magento/PageCache/etc/cache.xml +++ b/app/code/Magento/PageCache/etc/cache.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Cache/etc/cache.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Cache/etc/cache.xsd"> <type name="full_page" translate="label,description" instance="Magento\PageCache\Model\Cache\Type"> <label>Page Cache</label> <description>Full page caching.</description> diff --git a/app/code/Magento/PageCache/etc/config.xml b/app/code/Magento/PageCache/etc/config.xml index 56b5f971854f0441e1d3f57a0d3bcf4efed17fef..1ecf8fe1cd7edb5f1186f14ef5823e699ce5294d 100644 --- a/app/code/Magento/PageCache/etc/config.xml +++ b/app/code/Magento/PageCache/etc/config.xml @@ -5,15 +5,15 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <system> <full_page_cache> <varnish3> - <path>Magento/PageCache/etc/varnish3.vcl</path> + <path>varnish3.vcl</path> </varnish3> <varnish4> - <path>Magento/PageCache/etc/varnish4.vcl</path> + <path>varnish4.vcl</path> </varnish4> <ttl>86400</ttl> <caching_application>1</caching_application> diff --git a/app/code/Magento/PageCache/etc/di.xml b/app/code/Magento/PageCache/etc/di.xml index 6e694f4729967ef84e73245d31af11ea4b25c138..b5a248f714ab99470403549ccf33b28391f9dbd1 100644 --- a/app/code/Magento/PageCache/etc/di.xml +++ b/app/code/Magento/PageCache/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Framework\App\PageCache\Identifier"> <plugin name="core-app-area-design-exception-plugin" type="Magento\PageCache\Model\App\CacheIdentifierPlugin" sortOrder="10"/> diff --git a/app/code/Magento/PageCache/etc/events.xml b/app/code/Magento/PageCache/etc/events.xml index 08d294a2f27f4a58dda18a7c73bc9bc1fc4052b1..dbe6c9bdc4bd5adfe53abcb82495f2c6140ee4a9 100644 --- a/app/code/Magento/PageCache/etc/events.xml +++ b/app/code/Magento/PageCache/etc/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="core_layout_render_element"> <observer name="pagecache" instance="Magento\PageCache\Observer\ProcessLayoutRenderElement" method="execute" /> </event> diff --git a/app/code/Magento/PageCache/etc/frontend/di.xml b/app/code/Magento/PageCache/etc/frontend/di.xml index 3bb0051df947e78652b735dcf1081023cf93d10c..658dce3f72ed6473e507ffabb07d541bf43e05da 100644 --- a/app/code/Magento/PageCache/etc/frontend/di.xml +++ b/app/code/Magento/PageCache/etc/frontend/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <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"/> diff --git a/app/code/Magento/PageCache/etc/frontend/routes.xml b/app/code/Magento/PageCache/etc/frontend/routes.xml index b67b9979321ac7125881d387da8e5968080136a0..2f6ebf1fda2299ab86102ca3f18e3a46308577f9 100644 --- a/app/code/Magento/PageCache/etc/frontend/routes.xml +++ b/app/code/Magento/PageCache/etc/frontend/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn: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/etc/module.xml b/app/code/Magento/PageCache/etc/module.xml index 8a461081663b3a62de597e0ca36abb10115da917..92d66ed489352eb165981affa26a10a32beabe98 100644 --- a/app/code/Magento/PageCache/etc/module.xml +++ b/app/code/Magento/PageCache/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_PageCache" setup_version="2.0.0"> <sequence> <module name="Magento_Store"/> diff --git a/app/code/Magento/PageCache/registration.php b/app/code/Magento/PageCache/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..f10b487e1a0b75b010e0925f372db392a8364bd6 --- /dev/null +++ b/app/code/Magento/PageCache/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_PageCache', + __DIR__ +); diff --git a/app/code/Magento/PageCache/view/adminhtml/layout/adminhtml_system_config_edit.xml b/app/code/Magento/PageCache/view/adminhtml/layout/adminhtml_system_config_edit.xml index ab65124736634d2b0f3cba660f36eaf68145a4e8..381274dd2b31b03771848b05192ad07562c62845 100644 --- a/app/code/Magento/PageCache/view/adminhtml/layout/adminhtml_system_config_edit.xml +++ b/app/code/Magento/PageCache/view/adminhtml/layout/adminhtml_system_config_edit.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="js"> <block class="Magento\PageCache\Block\System\Config\Form\Field\Export" template="Magento_PageCache::page_cache_validation.phtml"/> diff --git a/app/code/Magento/PageCache/view/frontend/layout/default.xml b/app/code/Magento/PageCache/view/frontend/layout/default.xml index f6af7ea2b9ba6cb547bd8bdd22e9231f3def92a6..9a7fcd963f94a4e48893dbe85713650ad106795b 100644 --- a/app/code/Magento/PageCache/view/frontend/layout/default.xml +++ b/app/code/Magento/PageCache/view/frontend/layout/default.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="head.components"> <block class="Magento\Framework\View\Element\Js\Components" name="pagecache_page_head_components" template="Magento_PageCache::js/components.phtml"/> diff --git a/app/code/Magento/Payment/Model/Config/SchemaLocator.php b/app/code/Magento/Payment/Model/Config/SchemaLocator.php index 92ca08d72b54585004a2ba23f745360e5a1f474d..dfed3a219c2a50bd65ea1607d2a8917b8e608c6f 100644 --- a/app/code/Magento/Payment/Model/Config/SchemaLocator.php +++ b/app/code/Magento/Payment/Model/Config/SchemaLocator.php @@ -7,6 +7,8 @@ */ namespace Magento\Payment\Model\Config; +use Magento\Framework\Module\Dir; + class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface { /** @@ -38,9 +40,9 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface */ public function __construct(\Magento\Framework\Module\Dir\Reader $moduleReader) { - $this->_schema = $moduleReader->getModuleDir('etc', 'Magento_Payment') . '/' . self::MERGED_CONFIG_SCHEMA; - $this->_perFileSchema = $moduleReader->getModuleDir('etc', 'Magento_Payment') - . '/' . self::PER_FILE_VALIDATION_SCHEMA; + $etcDir = $moduleReader->getModuleDir(\Magento\Framework\Module\Dir::MODULE_ETC_DIR, 'Magento_Payment'); + $this->_schema = $etcDir . '/' . self::MERGED_CONFIG_SCHEMA; + $this->_perFileSchema = $etcDir . '/' . self::PER_FILE_VALIDATION_SCHEMA; } /** diff --git a/app/code/Magento/Payment/Test/Unit/Model/Config/SchemaLocatorTest.php b/app/code/Magento/Payment/Test/Unit/Model/Config/SchemaLocatorTest.php index 6dc4fa6102766f659d605d4f5de6220de90807a6..3e835415c9a26210b94a6931ff173bac693bd4d5 100644 --- a/app/code/Magento/Payment/Test/Unit/Model/Config/SchemaLocatorTest.php +++ b/app/code/Magento/Payment/Test/Unit/Model/Config/SchemaLocatorTest.php @@ -21,7 +21,7 @@ class SchemaLocatorTest extends \PHPUnit_Framework_TestCase $moduleReader = $this->getMockBuilder( 'Magento\Framework\Module\Dir\Reader' )->disableOriginalConstructor()->setMethods([])->getMock(); - $moduleReader->expects($this->exactly(2))->method('getModuleDir')->with('etc', 'Magento_Payment')->will( + $moduleReader->expects($this->once())->method('getModuleDir')->with('etc', 'Magento_Payment')->will( $this->returnValue(self::MODULE_DIR_PATH) ); $this->model = new SchemaLocator($moduleReader); diff --git a/app/code/Magento/Payment/Test/Unit/Model/Config/_files/payment.xml b/app/code/Magento/Payment/Test/Unit/Model/Config/_files/payment.xml index 5c01da582585bf217051adbc0c95b8b635c2e3d9..97217673f495ab7e05832b5883a5de2fe5bdc05d 100644 --- a/app/code/Magento/Payment/Test/Unit/Model/Config/_files/payment.xml +++ b/app/code/Magento/Payment/Test/Unit/Model/Config/_files/payment.xml @@ -6,7 +6,7 @@ */ --> <payment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../../app/code/Magento/Payment/etc/payment.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Payment:etc/payment.xsd"> <credit_cards> <type id="SM" order="90"> <label>Switch/Maestro</label> diff --git a/app/code/Magento/Payment/composer.json b/app/code/Magento/Payment/composer.json index 5c4060d2a986afccc30cca16c427328ff47bb56d..434ed3158dfc555f9ecc505b44a0d97461581e58 100644 --- a/app/code/Magento/Payment/composer.json +++ b/app/code/Magento/Payment/composer.json @@ -9,8 +9,7 @@ "magento/module-checkout": "1.0.0-beta", "magento/module-quote": "1.0.0-beta", "magento/module-directory": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -18,12 +17,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Payment" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Payment\\": "" + } } } diff --git a/app/code/Magento/Payment/etc/acl.xml b/app/code/Magento/Payment/etc/acl.xml index d10dae3d0324f0f9abf8fb180841c9f833f15735..62de8778edd0fe0b9ba6294239b50c59552513dc 100644 --- a/app/code/Magento/Payment/etc/acl.xml +++ b/app/code/Magento/Payment/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/app/code/Magento/Payment/etc/adminhtml/system.xml b/app/code/Magento/Payment/etc/adminhtml/system.xml index d3723ad1168e475719c1f8a8feeb5e15e8a4ab2b..a4fd3e4189370d9518d0b230a39d2c08a532e9c8 100644 --- a/app/code/Magento/Payment/etc/adminhtml/system.xml +++ b/app/code/Magento/Payment/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="payment" translate="label" type="text" sortOrder="400" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Payment Methods</label> diff --git a/app/code/Magento/Payment/etc/config.xml b/app/code/Magento/Payment/etc/config.xml index 3fc78a9194a2cb6e78fc764c2734fa904cb8664d..0af4631cdfaf36569e5de6b5b8282eb5c3d31dc3 100644 --- a/app/code/Magento/Payment/etc/config.xml +++ b/app/code/Magento/Payment/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <payment> <free> diff --git a/app/code/Magento/Payment/etc/di.xml b/app/code/Magento/Payment/etc/di.xml index 0b3759bafef21fee647ecf9d0da00bd0e95f5a6e..2d5be54204f42d59d9aea9fc3beb499de6588c8d 100644 --- a/app/code/Magento/Payment/etc/di.xml +++ b/app/code/Magento/Payment/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Payment\Model\Config\Reader"> <arguments> <argument name="fileName" xsi:type="string">payment.xml</argument> diff --git a/app/code/Magento/Payment/etc/events.xml b/app/code/Magento/Payment/etc/events.xml index 9bf26f5ce73731ccbf6e7bbac722cf81b6d90785..0dfee90e37a4f3169d100e29c2fe0bd67f98d7c0 100644 --- a/app/code/Magento/Payment/etc/events.xml +++ b/app/code/Magento/Payment/etc/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="sales_order_save_before"> <observer name="payment_sales_order_save_before" instance="Magento\Payment\Observer\SalesOrderBeforeSaveObserver" method="execute" /> </event> diff --git a/app/code/Magento/Payment/etc/frontend/di.xml b/app/code/Magento/Payment/etc/frontend/di.xml index 797514311505dae79c1009bc280ee19a12a28887..c2e2158f7ff660e23e6dbbea4f0463e2cada50f5 100644 --- a/app/code/Magento/Payment/etc/frontend/di.xml +++ b/app/code/Magento/Payment/etc/frontend/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Payment\Model\CcGenericConfigProvider"> <arguments> <argument name="methodCodes" xsi:type="array"/> diff --git a/app/code/Magento/Payment/etc/module.xml b/app/code/Magento/Payment/etc/module.xml index 5839df9188b2e72038b7248c828305ce802a7e8d..63ad40fcccf669c3d957e19eb0b6be9b2a7e22d0 100644 --- a/app/code/Magento/Payment/etc/module.xml +++ b/app/code/Magento/Payment/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Payment" setup_version="2.0.0"> <sequence> <module name="Magento_Store"/> diff --git a/app/code/Magento/Payment/etc/payment.xml b/app/code/Magento/Payment/etc/payment.xml index 1d52b718925cddf25f531b1b6d8ea9c941a9b901..11a228061e87b27d26fcee6387fe0ee47f06f2c4 100644 --- a/app/code/Magento/Payment/etc/payment.xml +++ b/app/code/Magento/Payment/etc/payment.xml @@ -6,7 +6,7 @@ */ --> <payment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../Magento/Payment/etc/payment.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Payment:etc/payment.xsd"> <credit_cards> <type id="AE" order="0"> <label>American Express</label> diff --git a/app/code/Magento/Payment/registration.php b/app/code/Magento/Payment/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..eb2ae83543e9591db28c4268aaa15b4c8f490076 --- /dev/null +++ b/app/code/Magento/Payment/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Payment', + __DIR__ +); diff --git a/app/code/Magento/Payment/view/frontend/layout/checkout_index_index.xml b/app/code/Magento/Payment/view/frontend/layout/checkout_index_index.xml index 979a1c039cfedda69eb2821b528ad9c246824b68..1cc7614f1712bda9dddb6879510ee60a8b80f18a 100644 --- a/app/code/Magento/Payment/view/frontend/layout/checkout_index_index.xml +++ b/app/code/Magento/Payment/view/frontend/layout/checkout_index_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout.root"> <arguments> diff --git a/app/code/Magento/Payment/view/frontend/layout/checkout_onepage_review.xml b/app/code/Magento/Payment/view/frontend/layout/checkout_onepage_review.xml index 8bdab785e571d24a7092c52b5ac420fe697dc1d5..4ab75972af8d5408ebf301b0f8c15d7785868c5d 100644 --- a/app/code/Magento/Payment/view/frontend/layout/checkout_onepage_review.xml +++ b/app/code/Magento/Payment/view/frontend/layout/checkout_onepage_review.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="checkout.onepage.review.info.items.after"> <block class="Magento\Payment\Block\Transparent\Form" name="payment.form.transparent"> diff --git a/app/code/Magento/Paypal/Block/Iframe.php b/app/code/Magento/Paypal/Block/Iframe.php index c4f92a97f3b784f7fe750f2358ad3c253f08bb48..8cbc45586c369574c2c8151d73a89866e8c1ce83 100644 --- a/app/code/Magento/Paypal/Block/Iframe.php +++ b/app/code/Magento/Paypal/Block/Iframe.php @@ -5,8 +5,6 @@ */ namespace Magento\Paypal\Block; -use Magento\Framework\App\Filesystem\DirectoryList; - /** * HSS iframe block */ @@ -60,11 +58,23 @@ class Iframe extends \Magento\Payment\Block\Form */ protected $_hssHelper; + /** + * @var \Magento\Framework\Filesystem\Directory\ReadFactory + */ + protected $readFactory; + + /** + * @var \Magento\Framework\Module\Dir\Reader + */ + protected $reader; + /** * @param \Magento\Framework\View\Element\Template\Context $context * @param \Magento\Sales\Model\OrderFactory $orderFactory * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Paypal\Helper\Hss $hssHelper + * @param \Magento\Framework\Filesystem\Directory\ReadFactory $readFactory + * @param \Magento\Framework\Module\Dir\Reader $reader * @param array $data */ public function __construct( @@ -72,6 +82,8 @@ class Iframe extends \Magento\Payment\Block\Form \Magento\Sales\Model\OrderFactory $orderFactory, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Paypal\Helper\Hss $hssHelper, + \Magento\Framework\Filesystem\Directory\ReadFactory $readFactory, + \Magento\Framework\Module\Dir\Reader $reader, array $data = [] ) { $this->_hssHelper = $hssHelper; @@ -79,6 +91,8 @@ class Iframe extends \Magento\Payment\Block\Form $this->_checkoutSession = $checkoutSession; parent::__construct($context, $data); $this->_isScopePrivate = true; + $this->readFactory = $readFactory; + $this->reader = $reader; } /** @@ -94,8 +108,7 @@ class Iframe extends \Magento\Payment\Block\Form $this->_paymentMethodCode = $paymentCode; $templatePath = str_replace('_', '', $paymentCode); $templateFile = "{$templatePath}/iframe.phtml"; - - $directory = $this->_filesystem->getDirectoryRead(DirectoryList::MODULES); + $directory = $this->readFactory->create($this->reader->getModuleDir('', 'Magento_Paypal')); $file = $this->resolver->getTemplateFileName($templateFile, ['module' => 'Magento_Paypal']); if ($file && $directory->isExist($directory->getRelativePath($file))) { $this->setTemplate($templateFile); diff --git a/app/code/Magento/Paypal/Block/Payflow/Advanced/Iframe.php b/app/code/Magento/Paypal/Block/Payflow/Advanced/Iframe.php index b44293ae11c5adf18595b8fb7ec5c9df1bd8b928..70a8da897e4cb6d08552cd2bad283a1107bc0985 100644 --- a/app/code/Magento/Paypal/Block/Payflow/Advanced/Iframe.php +++ b/app/code/Magento/Paypal/Block/Payflow/Advanced/Iframe.php @@ -7,8 +7,6 @@ namespace Magento\Paypal\Block\Payflow\Advanced; /** * Payflow Advanced iframe block - * - * @author Magento Core Team <core@magentocommerce.com> */ class Iframe extends \Magento\Paypal\Block\Payflow\Link\Iframe { @@ -17,6 +15,8 @@ class Iframe extends \Magento\Paypal\Block\Payflow\Link\Iframe * @param \Magento\Sales\Model\OrderFactory $orderFactory * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Paypal\Helper\Hss $hssHelper + * @param \Magento\Framework\Filesystem\Directory\ReadFactory $readFactory + * @param \Magento\Framework\Module\Dir\Reader $reader * @param \Magento\Payment\Helper\Data $paymentData * @param array $data */ @@ -25,10 +25,21 @@ class Iframe extends \Magento\Paypal\Block\Payflow\Link\Iframe \Magento\Sales\Model\OrderFactory $orderFactory, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Paypal\Helper\Hss $hssHelper, + \Magento\Framework\Filesystem\Directory\ReadFactory $readFactory, + \Magento\Framework\Module\Dir\Reader $reader, \Magento\Payment\Helper\Data $paymentData, array $data = [] ) { - parent::__construct($context, $orderFactory, $checkoutSession, $hssHelper, $paymentData, $data); + parent::__construct( + $context, + $orderFactory, + $checkoutSession, + $hssHelper, + $readFactory, + $reader, + $paymentData, + $data + ); $this->_isScopePrivate = false; } diff --git a/app/code/Magento/Paypal/Block/Payflow/Link/Iframe.php b/app/code/Magento/Paypal/Block/Payflow/Link/Iframe.php index 75f708347585ccb771a4d05dbcd4cf345340987f..05028ace8b20a848c00c4afb1a88b5236236fefc 100644 --- a/app/code/Magento/Paypal/Block/Payflow/Link/Iframe.php +++ b/app/code/Magento/Paypal/Block/Payflow/Link/Iframe.php @@ -22,6 +22,8 @@ class Iframe extends \Magento\Paypal\Block\Iframe * @param \Magento\Sales\Model\OrderFactory $orderFactory * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Paypal\Helper\Hss $hssHelper + * @param \Magento\Framework\Filesystem\Directory\ReadFactory $readFactory + * @param \Magento\Framework\Module\Dir\Reader $reader * @param \Magento\Payment\Helper\Data $paymentData * @param array $data */ @@ -30,11 +32,13 @@ class Iframe extends \Magento\Paypal\Block\Iframe \Magento\Sales\Model\OrderFactory $orderFactory, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Paypal\Helper\Hss $hssHelper, + \Magento\Framework\Filesystem\Directory\ReadFactory $readFactory, + \Magento\Framework\Module\Dir\Reader $reader, \Magento\Payment\Helper\Data $paymentData, array $data = [] ) { $this->_paymentData = $paymentData; - parent::__construct($context, $orderFactory, $checkoutSession, $hssHelper, $data); + parent::__construct($context, $orderFactory, $checkoutSession, $hssHelper, $readFactory, $reader, $data); } /** diff --git a/app/code/Magento/Paypal/Model/Config/Rules/SchemaLocator.php b/app/code/Magento/Paypal/Model/Config/Rules/SchemaLocator.php index 513f52a200f3d5deae2a3fdcbc69ffe028599d09..bfb1f5e2349436e2981526972f2924287584e4b1 100644 --- a/app/code/Magento/Paypal/Model/Config/Rules/SchemaLocator.php +++ b/app/code/Magento/Paypal/Model/Config/Rules/SchemaLocator.php @@ -6,6 +6,7 @@ namespace Magento\Paypal\Model\Config\Rules; use Magento\Framework\Config\SchemaLocatorInterface; +use Magento\Framework\Module\Dir; /** * Class SchemaLocator @@ -31,7 +32,7 @@ class SchemaLocator implements SchemaLocatorInterface */ public function __construct(\Magento\Framework\Module\Dir\Reader $moduleReader) { - $xsd = $moduleReader->getModuleDir('etc', 'Magento_Paypal') . '/rules.xsd'; + $xsd = $moduleReader->getModuleDir(Dir::MODULE_ETC_DIR, 'Magento_Paypal') . '/rules.xsd'; $this->perFileSchema = $xsd; $this->schema = $xsd; } diff --git a/app/code/Magento/Paypal/Test/Unit/Block/Payflow/Link/IframeTest.php b/app/code/Magento/Paypal/Test/Unit/Block/Payflow/Link/IframeTest.php index 9a9685e1d623616732fbf297f3083831755a82bb..7144a10cfded3e6b0d2c070526f48d5b450665b7 100644 --- a/app/code/Magento/Paypal/Test/Unit/Block/Payflow/Link/IframeTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Block/Payflow/Link/IframeTest.php @@ -46,6 +46,16 @@ class IframeTest extends \PHPUnit_Framework_TestCase */ protected $paymentMock; + /** + * @var \Magento\Framework\Module\Dir\Reader|\PHPUnit_Framework_MockObject_MockObject + */ + protected $reader; + + /** + * @var \Magento\Framework\Filesystem\Directory\ReadFactory|\PHPUnit_Framework_MockObject_MockObject + */ + protected $readFactory; + public function prepare() { $this->contextMock = $this->getMock('Magento\Framework\View\Element\Template\Context', [], [], '', false); @@ -55,6 +65,8 @@ class IframeTest extends \PHPUnit_Framework_TestCase $this->paymentDataMock = $this->getMock('Magento\Payment\Helper\Data', [], [], '', false); $this->quoteMock = $this->getMock('Magento\Quote\Model\Quote', ['getPayment', '__wakeup'], [], '', false); $this->paymentMock = $this->getMock('Magento\Quote\Model\Quote\Payment', [], [], '', false); + $this->reader = $this->getMock('Magento\Framework\Module\Dir\Reader', [], [], '', false); + $this->readFactory = $this->getMock('Magento\Framework\Filesystem\Directory\ReadFactory', [], [], '', false); $this->checkoutSessionMock->expects($this->any()) ->method('getQuote') @@ -78,6 +90,8 @@ class IframeTest extends \PHPUnit_Framework_TestCase $this->orderFactoryMock, $this->checkoutSessionMock, $this->hssHelperMock, + $this->readFactory, + $this->reader, $this->paymentDataMock ); @@ -106,6 +120,8 @@ class IframeTest extends \PHPUnit_Framework_TestCase $this->orderFactoryMock, $this->checkoutSessionMock, $this->hssHelperMock, + $this->readFactory, + $this->reader, $this->paymentDataMock ); $this->assertEquals($expected, $block->getTransactionUrl()); @@ -133,6 +149,8 @@ class IframeTest extends \PHPUnit_Framework_TestCase $this->orderFactoryMock, $this->checkoutSessionMock, $this->hssHelperMock, + $this->readFactory, + $this->reader, $this->paymentDataMock ); $this->assertEquals($expected, $block->getTransactionUrl()); diff --git a/app/code/Magento/Paypal/composer.json b/app/code/Magento/Paypal/composer.json index a70606983236848e8049f52cc9d16d32c5c0c199..ca2fc1be2205de9387b5eee870b0ec8a61b77fb8 100644 --- a/app/code/Magento/Paypal/composer.json +++ b/app/code/Magento/Paypal/composer.json @@ -18,8 +18,7 @@ "magento/module-eav": "1.0.0-beta", "magento/framework": "1.0.0-beta", "magento/module-ui": "1.0.0-beta", - "lib-libxml": "*", - "magento/magento-composer-installer": "*" + "lib-libxml": "*" }, "suggest": { "magento/module-checkout-agreements": "1.0.0-beta" @@ -29,12 +28,10 @@ "license": [ "proprietary" ], - "extra": { - "map": [ - [ - "*", - "Magento/Paypal" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Paypal\\": "" + } } } diff --git a/app/code/Magento/Paypal/etc/acl.xml b/app/code/Magento/Paypal/etc/acl.xml index 521e65d03a1f8bea3b4745b1a35147642f9d942b..c719b821c45f0340eb30736a9b84e1237e65959d 100644 --- a/app/code/Magento/Paypal/etc/acl.xml +++ b/app/code/Magento/Paypal/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/app/code/Magento/Paypal/etc/adminhtml/di.xml b/app/code/Magento/Paypal/etc/adminhtml/di.xml index dea8c9982ea5b66f04a2ac66e652a8d5495446c3..193ef9eddcb050c863d1bfb0516591691b4ddf04 100644 --- a/app/code/Magento/Paypal/etc/adminhtml/di.xml +++ b/app/code/Magento/Paypal/etc/adminhtml/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <virtualType name="Magento\Paypal\Model\Session\Storage" type="Magento\Framework\Session\Storage"> <arguments> <argument name="namespace" xsi:type="string">paypal</argument> diff --git a/app/code/Magento/Paypal/etc/adminhtml/events.xml b/app/code/Magento/Paypal/etc/adminhtml/events.xml index e9e0999486295564939fd90332c09ec5dbb84552..729d5132f4fbe662402907223503dd777f43d53e 100644 --- a/app/code/Magento/Paypal/etc/adminhtml/events.xml +++ b/app/code/Magento/Paypal/etc/adminhtml/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="payment_method_is_active"> <observer name="sales_billing_agreement" instance="Magento\Paypal\Observer\RestrictAdminBillingAgreementUsageObserver" method="execute" /> </event> diff --git a/app/code/Magento/Paypal/etc/adminhtml/menu.xml b/app/code/Magento/Paypal/etc/adminhtml/menu.xml index 06687a485e1b966e7c4f8eae796385e8148a9cbe..ec8bdb6321abcc220a36f85b9542915b740a318e 100644 --- a/app/code/Magento/Paypal/etc/adminhtml/menu.xml +++ b/app/code/Magento/Paypal/etc/adminhtml/menu.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Backend/etc/menu.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd"> <menu> <add id="Magento_Paypal::report_salesroot_paypal_settlement_reports" title="PayPal Settlement" module="Magento_Paypal" sortOrder="70" parent="Magento_Reports::report_salesroot" action="paypal/paypal_reports" resource="Magento_Paypal::paypal_settlement_reports"/> <add id="Magento_Paypal::paypal_billing_agreement" title="Billing Agreements" module="Magento_Paypal" sortOrder="60" parent="Magento_Sales::sales_operation" action="paypal/billing_agreement" resource="Magento_Paypal::billing_agreement"/> diff --git a/app/code/Magento/Paypal/etc/adminhtml/routes.xml b/app/code/Magento/Paypal/etc/adminhtml/routes.xml index 4f3386c9d9932a75b05b7a6623f23ce9400b555c..eddaaee2e172c4d3333e61e9a6d62084d72b7a8f 100644 --- a/app/code/Magento/Paypal/etc/adminhtml/routes.xml +++ b/app/code/Magento/Paypal/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="admin"> <route id="paypal" frontName="paypal"> <module name="Magento_Paypal" before="Magento_Backend" /> diff --git a/app/code/Magento/Paypal/etc/adminhtml/rules/payment_au.xml b/app/code/Magento/Paypal/etc/adminhtml/rules/payment_au.xml index afc43cd0033d236ffb10bb22b733f6cf393da911..bf9e1f79c5ccdc457833466a3a88a34f85232598 100644 --- a/app/code/Magento/Paypal/etc/adminhtml/rules/payment_au.xml +++ b/app/code/Magento/Paypal/etc/adminhtml/rules/payment_au.xml @@ -6,7 +6,7 @@ */ --> <rules xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../app/code/Magento/Paypal/etc/rules.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Paypal:etc/rules.xsd"> <!--PayPal Website Payments Standard--> <payment id="wps_other"> <events selector="[data-enable='payment']"> diff --git a/app/code/Magento/Paypal/etc/adminhtml/rules/payment_ca.xml b/app/code/Magento/Paypal/etc/adminhtml/rules/payment_ca.xml index 7302ba739cbed5daa51c9dc158c558ed0c2a6b1a..6df1ad19898c67b6d2fd817bd5c87d6ecddd3ebe 100644 --- a/app/code/Magento/Paypal/etc/adminhtml/rules/payment_ca.xml +++ b/app/code/Magento/Paypal/etc/adminhtml/rules/payment_ca.xml @@ -6,7 +6,7 @@ */ --> <rules xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../app/code/Magento/Paypal/etc/rules.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Paypal:etc/rules.xsd"> <!-- Website Payments Standard --> <payment id="wps_other"> <events selector="[data-enable='payment']"> diff --git a/app/code/Magento/Paypal/etc/adminhtml/rules/payment_de.xml b/app/code/Magento/Paypal/etc/adminhtml/rules/payment_de.xml index 82a093c1f412f8f25ecd6155557921b12b4d5dd0..01d58b0ae9e924fcbb2fa0ea9c34d06a69e125e8 100644 --- a/app/code/Magento/Paypal/etc/adminhtml/rules/payment_de.xml +++ b/app/code/Magento/Paypal/etc/adminhtml/rules/payment_de.xml @@ -6,7 +6,7 @@ */ --> <rules xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../app/code/Magento/Paypal/etc/rules.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Paypal:etc/rules.xsd"> <payment id="express_checkout_de"> <events selector="[data-enable='payment']"> <event value="0" name="deactivate-rule"/> diff --git a/app/code/Magento/Paypal/etc/adminhtml/rules/payment_es.xml b/app/code/Magento/Paypal/etc/adminhtml/rules/payment_es.xml index 17e5381648f1a5ee9b30d2e9a1ea73445b977a86..0013ea4451b490843914971aa7e975f9d41cfc19 100644 --- a/app/code/Magento/Paypal/etc/adminhtml/rules/payment_es.xml +++ b/app/code/Magento/Paypal/etc/adminhtml/rules/payment_es.xml @@ -6,7 +6,7 @@ */ --> <rules xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../app/code/Magento/Paypal/etc/rules.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Paypal:etc/rules.xsd"> <!-- Website Payments Pro Hosted Solution (Includes Express Checkout) --> <payment id="payments_pro_hosted_solution_es"> <events selector="[data-enable='payment']"> diff --git a/app/code/Magento/Paypal/etc/adminhtml/rules/payment_fr.xml b/app/code/Magento/Paypal/etc/adminhtml/rules/payment_fr.xml index 29886c00ab57bb0a1d703ff52ac82dbfe55e5f38..536e6c8a6d002fca7e6a28588eda2a9000ad537f 100644 --- a/app/code/Magento/Paypal/etc/adminhtml/rules/payment_fr.xml +++ b/app/code/Magento/Paypal/etc/adminhtml/rules/payment_fr.xml @@ -6,7 +6,7 @@ */ --> <rules xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../app/code/Magento/Paypal/etc/rules.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Paypal:etc/rules.xsd"> <!-- Website Payments Pro Hosted Solution (Includes Express Checkout) --> <payment id="payments_pro_hosted_solution_fr"> <events selector="[data-enable='payment']"> diff --git a/app/code/Magento/Paypal/etc/adminhtml/rules/payment_gb.xml b/app/code/Magento/Paypal/etc/adminhtml/rules/payment_gb.xml index b55168d882848958b79d474f4a308d88e542b08f..37bc5b5a73e059c1852108065ce35544d4b2ea6c 100644 --- a/app/code/Magento/Paypal/etc/adminhtml/rules/payment_gb.xml +++ b/app/code/Magento/Paypal/etc/adminhtml/rules/payment_gb.xml @@ -6,7 +6,7 @@ */ --> <rules xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../app/code/Magento/Paypal/etc/rules.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Paypal:etc/rules.xsd"> <!-- Website Payments Pro Hosted Solution (Includes Express Checkout) --> <payment id="payments_pro_hosted_solution_with_express_checkout"> <events selector="[data-enable='payment']"> diff --git a/app/code/Magento/Paypal/etc/adminhtml/rules/payment_hk.xml b/app/code/Magento/Paypal/etc/adminhtml/rules/payment_hk.xml index 0fdb5250d0c5042bafb98ef2f6963484060724a8..c69b165a998c1a8e2e6059e367f6b6aab4db3c7f 100644 --- a/app/code/Magento/Paypal/etc/adminhtml/rules/payment_hk.xml +++ b/app/code/Magento/Paypal/etc/adminhtml/rules/payment_hk.xml @@ -6,7 +6,7 @@ */ --> <rules xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../app/code/Magento/Paypal/etc/rules.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Paypal:etc/rules.xsd"> <!-- Website Payments Pro Hosted Solution (Includes Express Checkout) --> <payment id="payments_pro_hosted_solution_hk"> <events selector="[data-enable='payment']"> diff --git a/app/code/Magento/Paypal/etc/adminhtml/rules/payment_it.xml b/app/code/Magento/Paypal/etc/adminhtml/rules/payment_it.xml index 63ae9f5e02478a4e6aa6ef5c4ec28fbc36df0c0b..d17126a52c9055f095a2635a5a117df1a4c91013 100644 --- a/app/code/Magento/Paypal/etc/adminhtml/rules/payment_it.xml +++ b/app/code/Magento/Paypal/etc/adminhtml/rules/payment_it.xml @@ -6,7 +6,7 @@ */ --> <rules xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../app/code/Magento/Paypal/etc/rules.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Paypal:etc/rules.xsd"> <!-- Website Payments Pro Hosted Solution (Includes Express Checkout) --> <payment id="payments_pro_hosted_solution_it"> <events selector="[data-enable='payment']"> diff --git a/app/code/Magento/Paypal/etc/adminhtml/rules/payment_jp.xml b/app/code/Magento/Paypal/etc/adminhtml/rules/payment_jp.xml index ca74b2579cbff1779468916b7be456986644a92b..315af327f0c758a5d99a2eb7cca3049d8909a63b 100644 --- a/app/code/Magento/Paypal/etc/adminhtml/rules/payment_jp.xml +++ b/app/code/Magento/Paypal/etc/adminhtml/rules/payment_jp.xml @@ -6,7 +6,7 @@ */ --> <rules xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../app/code/Magento/Paypal/etc/rules.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Paypal:etc/rules.xsd"> <!-- Website Payments Pro Hosted Solution (Includes Express Checkout) --> <payment id="payments_pro_hosted_solution_jp"> <events selector="[data-enable='payment']"> diff --git a/app/code/Magento/Paypal/etc/adminhtml/rules/payment_nz.xml b/app/code/Magento/Paypal/etc/adminhtml/rules/payment_nz.xml index 8833c4f7edf3b761e54f1d0f60cc0109bb942761..7af37a558d81297c308f7077bbf28627e140afeb 100644 --- a/app/code/Magento/Paypal/etc/adminhtml/rules/payment_nz.xml +++ b/app/code/Magento/Paypal/etc/adminhtml/rules/payment_nz.xml @@ -6,7 +6,7 @@ */ --> <rules xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../app/code/Magento/Paypal/etc/rules.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Paypal:etc/rules.xsd"> <!-- Website Payments Pro Hosted Solution (Includes Express Checkout) --> <payment id="paypal_payflowpro_nz"> <events selector="[data-enable='payment']"> diff --git a/app/code/Magento/Paypal/etc/adminhtml/rules/payment_other.xml b/app/code/Magento/Paypal/etc/adminhtml/rules/payment_other.xml index df49f08a3b89bae10bacb756e6880d6d312fc264..d4c1c86410dbd0436ed916352a928151ece3eec6 100644 --- a/app/code/Magento/Paypal/etc/adminhtml/rules/payment_other.xml +++ b/app/code/Magento/Paypal/etc/adminhtml/rules/payment_other.xml @@ -6,7 +6,7 @@ */ --> <rules xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../app/code/Magento/Paypal/etc/rules.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Paypal:etc/rules.xsd"> <!-- Website Payments Standard --> <payment id="wps_other"> <events selector="[data-enable='payment']"> diff --git a/app/code/Magento/Paypal/etc/adminhtml/rules/payment_us.xml b/app/code/Magento/Paypal/etc/adminhtml/rules/payment_us.xml index 6486f25d5f6af9cdd7f9574fc2d72ca2ded28fb1..c187130b357b85e975b93c17f457b30c78bd5f0f 100644 --- a/app/code/Magento/Paypal/etc/adminhtml/rules/payment_us.xml +++ b/app/code/Magento/Paypal/etc/adminhtml/rules/payment_us.xml @@ -6,7 +6,7 @@ */ --> <rules xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../app/code/Magento/Paypal/etc/rules.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Paypal:etc/rules.xsd"> <!-- PayPal Payments Advanced (Includes Express Checkout) --> <payment id="payflow_advanced"> <events selector="[data-enable='payment']"> diff --git a/app/code/Magento/Paypal/etc/adminhtml/system.xml b/app/code/Magento/Paypal/etc/adminhtml/system.xml index f79237b9e30615071bcc1630aea7673b02f43030..d716794f5ca8e67649354ac71a070af028661239 100644 --- a/app/code/Magento/Paypal/etc/adminhtml/system.xml +++ b/app/code/Magento/Paypal/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="payment"> <group id="paypal_notice" translate="label" sortOrder="3" showInDefault="1" showInWebsite="1" showInStore="1"> diff --git a/app/code/Magento/Paypal/etc/adminhtml/system/express_checkout.xml b/app/code/Magento/Paypal/etc/adminhtml/system/express_checkout.xml index 82e1e8135055ed43a4e069fd377c9f5aea95adc1..b95f686a3db73f2b5e9ae01954c2ae79199dbf5a 100644 --- a/app/code/Magento/Paypal/etc/adminhtml/system/express_checkout.xml +++ b/app/code/Magento/Paypal/etc/adminhtml/system/express_checkout.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Config/etc/system_include.xsd"> +<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_include.xsd"> <group id="express_checkout" translate="label comment" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="60"> <label>Express Checkout</label> <frontend_model>Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Payment</frontend_model> diff --git a/app/code/Magento/Paypal/etc/adminhtml/system/payflow_advanced.xml b/app/code/Magento/Paypal/etc/adminhtml/system/payflow_advanced.xml index c151127d80ec43866fcf33ca5f65f6d04c575706..0dc672cb509df1ce81cf47be6b0da763fcfd21ca 100644 --- a/app/code/Magento/Paypal/etc/adminhtml/system/payflow_advanced.xml +++ b/app/code/Magento/Paypal/etc/adminhtml/system/payflow_advanced.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Config/etc/system_include.xsd"> +<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_include.xsd"> <group id="payflow_advanced" translate="label comment" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="30"> <label>Payments Advanced (Includes Express Checkout)</label> <fieldset_css>pp-method-general</fieldset_css> diff --git a/app/code/Magento/Paypal/etc/adminhtml/system/payflow_link.xml b/app/code/Magento/Paypal/etc/adminhtml/system/payflow_link.xml index 543e06f52545060270ed70f475531856535d740e..db8cda7463fbde4e1cdbf34714e56628c115fa3a 100644 --- a/app/code/Magento/Paypal/etc/adminhtml/system/payflow_link.xml +++ b/app/code/Magento/Paypal/etc/adminhtml/system/payflow_link.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Config/etc/system_include.xsd"> +<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_include.xsd"> <group id="payflow_link" translate="label comment" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="20"> <label>Payflow Link (Includes Express Checkout)</label> <frontend_model>Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Payment</frontend_model> diff --git a/app/code/Magento/Paypal/etc/adminhtml/system/payments_pro_hosted_solution.xml b/app/code/Magento/Paypal/etc/adminhtml/system/payments_pro_hosted_solution.xml index ce1352473b34fb5a217c24af204bd0eb6ed2b50a..b1eeab90385f551d344e6075a71156bd0e19eb8f 100644 --- a/app/code/Magento/Paypal/etc/adminhtml/system/payments_pro_hosted_solution.xml +++ b/app/code/Magento/Paypal/etc/adminhtml/system/payments_pro_hosted_solution.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Config/etc/system_include.xsd"> +<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_include.xsd"> <group id="payments_pro_hosted_solution" translate="label comment" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="20"> <label>Website Payments Pro Hosted Solution</label> <fieldset_css>pp-method-general</fieldset_css> diff --git a/app/code/Magento/Paypal/etc/adminhtml/system/payments_pro_hosted_solution_with_express_checkout.xml b/app/code/Magento/Paypal/etc/adminhtml/system/payments_pro_hosted_solution_with_express_checkout.xml index 14092d59d0d6ad11f0d07cf9d7332da19ef50ea7..d13b13e563a6a76c06f727972a391449d2e08878 100644 --- a/app/code/Magento/Paypal/etc/adminhtml/system/payments_pro_hosted_solution_with_express_checkout.xml +++ b/app/code/Magento/Paypal/etc/adminhtml/system/payments_pro_hosted_solution_with_express_checkout.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Config/etc/system_include.xsd"> +<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_include.xsd"> <group id="payments_pro_hosted_solution_with_express_checkout" translate="labelcomment" extends="payment_all_paypal/payments_pro_hosted_solution_without_bml" sortOrder="30"> <label>Website Payments Pro Hosted Solution (Includes Express Checkout)</label> <fieldset_css>pp-general-uk</fieldset_css> diff --git a/app/code/Magento/Paypal/etc/adminhtml/system/paypal_payflowpro.xml b/app/code/Magento/Paypal/etc/adminhtml/system/paypal_payflowpro.xml index d8580f81e1a4c6155dffbde296d5b0df54b9c577..d3bd6fa3c0ec6f4ad4dd951ede884413710724a1 100644 --- a/app/code/Magento/Paypal/etc/adminhtml/system/paypal_payflowpro.xml +++ b/app/code/Magento/Paypal/etc/adminhtml/system/paypal_payflowpro.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Config/etc/system_include.xsd"> +<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_include.xsd"> <group id="paypal_payflowpro" translate="label comment" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="10"> <label>Payflow Pro</label> <frontend_model>Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Payment</frontend_model> diff --git a/app/code/Magento/Paypal/etc/adminhtml/system/paypal_payflowpro_with_express_checkout.xml b/app/code/Magento/Paypal/etc/adminhtml/system/paypal_payflowpro_with_express_checkout.xml index dd4934d2185d74176220233f29afa495c717adeb..9414163d384e18197de5f9f121de7f7e242e2a0f 100644 --- a/app/code/Magento/Paypal/etc/adminhtml/system/paypal_payflowpro_with_express_checkout.xml +++ b/app/code/Magento/Paypal/etc/adminhtml/system/paypal_payflowpro_with_express_checkout.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Config/etc/system_include.xsd"> +<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_include.xsd"> <group id="paypal_payflowpro_with_express_checkout" translate="label comment" extends="payment_all_paypal/paypal_payflowpro"> <label>Payflow Pro (Includes Express Checkout)</label> <attribute type="paypal_ec_separate">0</attribute> diff --git a/app/code/Magento/Paypal/etc/config.xml b/app/code/Magento/Paypal/etc/config.xml index 7922cc95767f3c95c4010dfc077e0b461391c72f..c21633f2ac981cbaeb44e97f42233306b6a0c2a8 100644 --- a/app/code/Magento/Paypal/etc/config.xml +++ b/app/code/Magento/Paypal/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <paypal> <bncode>Magento_Cart_Community</bncode> diff --git a/app/code/Magento/Paypal/etc/crontab.xml b/app/code/Magento/Paypal/etc/crontab.xml index 1c913c8762a89b95be486f796785b120c68448f4..298499e66829a40d31fd4354d0c693acebc7a04f 100644 --- a/app/code/Magento/Paypal/etc/crontab.xml +++ b/app/code/Magento/Paypal/etc/crontab.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Cron/etc/crontab.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd"> <group id="default"> <job name="paypal_fetch_settlement_reports" instance="Magento\Paypal\Cron\FetchReports" method="execute"/> </group> diff --git a/app/code/Magento/Paypal/etc/di.xml b/app/code/Magento/Paypal/etc/di.xml index 9c98bf856d64dba05bfb034b3e42da88a96aaa5e..6b4e7878018a4a987b2237eeba809d70773b4d0b 100644 --- a/app/code/Magento/Paypal/etc/di.xml +++ b/app/code/Magento/Paypal/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <virtualType name="Magento\Paypal\Model\PayflowadvancedFactory" type="Magento\Paypal\Model\PayflowlinkFactory"> <arguments> <argument name="instanceName" xsi:type="string">Magento\Paypal\Model\Payflowadvanced</argument> diff --git a/app/code/Magento/Paypal/etc/events.xml b/app/code/Magento/Paypal/etc/events.xml index 682aff5dc934fd1dec7528352f01753cb6fcc960..275fd93635b29d576ba7c6b87090f1be87f5f0ff 100644 --- a/app/code/Magento/Paypal/etc/events.xml +++ b/app/code/Magento/Paypal/etc/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="sales_order_payment_place_end"> <observer name="paypal" instance="Magento\Paypal\Observer\AddBillingAgreementToSessionObserver" method="execute"/> </event> diff --git a/app/code/Magento/Paypal/etc/frontend/di.xml b/app/code/Magento/Paypal/etc/frontend/di.xml index ba90a84a15a0fc7b7a8573713be30f057e34aeca..71408dd33e5328a469257fd220acde5b35d11cef 100644 --- a/app/code/Magento/Paypal/etc/frontend/di.xml +++ b/app/code/Magento/Paypal/etc/frontend/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <virtualType name="Magento\Paypal\Model\Session\Storage" type="Magento\Framework\Session\Storage"> <arguments> <argument name="namespace" xsi:type="string">paypal</argument> diff --git a/app/code/Magento/Paypal/etc/frontend/events.xml b/app/code/Magento/Paypal/etc/frontend/events.xml index e54561a41e8b397c5d75ec4cbaea6463b43df941..f6787521fa95ed1c859fae85a674c8576cd0d73c 100644 --- a/app/code/Magento/Paypal/etc/frontend/events.xml +++ b/app/code/Magento/Paypal/etc/frontend/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="checkout_submit_all_after"> <observer name="hss_save_order_after_submit" instance="Magento\Paypal\Observer\SaveOrderAfterSubmitObserver" method="execute"/> </event> diff --git a/app/code/Magento/Paypal/etc/frontend/page_types.xml b/app/code/Magento/Paypal/etc/frontend/page_types.xml index 891d19d1b44bc5dd91b8b772f20953ee1b7ff713..ffb061980e8a32ee8a707cd3ab780c33929c6d27 100644 --- a/app/code/Magento/Paypal/etc/frontend/page_types.xml +++ b/app/code/Magento/Paypal/etc/frontend/page_types.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page_types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_types.xsd"> +<page_types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_types.xsd"> <type id="paypal_billing_agreement_index" label="Billing Agreement"/> <type id="paypal_billing_agreement_view" label="Billing Agreement View"/> <type id="paypal_express_review" label="PayPal Express Order Review Form"/> diff --git a/app/code/Magento/Paypal/etc/frontend/routes.xml b/app/code/Magento/Paypal/etc/frontend/routes.xml index dfb09422e6a2b7290b6058d22c02db4260f94e92..e9216a51b0855641bc97c094db1875286a486288 100644 --- a/app/code/Magento/Paypal/etc/frontend/routes.xml +++ b/app/code/Magento/Paypal/etc/frontend/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn: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/etc/frontend/sections.xml b/app/code/Magento/Paypal/etc/frontend/sections.xml index a70ea95d3f1d8a4bb7e06ecb03f78a123ac17304..1a298d44576f99eb1bd867d64d48dcf4cee1681a 100644 --- a/app/code/Magento/Paypal/etc/frontend/sections.xml +++ b/app/code/Magento/Paypal/etc/frontend/sections.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../Customer/etc/sections.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd"> <action name="paypal/express/placeOrder"> <section name="cart"/> <section name="checkout-data"/> diff --git a/app/code/Magento/Paypal/etc/module.xml b/app/code/Magento/Paypal/etc/module.xml index 6374bf82584612fb610e055f8bab390bbc2ecc8a..48e13430f8cb9347c453b34b4456c4acb83b798f 100644 --- a/app/code/Magento/Paypal/etc/module.xml +++ b/app/code/Magento/Paypal/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Paypal" setup_version="2.0.0"> <sequence> <module name="Magento_Checkout"/> diff --git a/app/code/Magento/Paypal/etc/payment.xml b/app/code/Magento/Paypal/etc/payment.xml index c59675265a0af27fa1089c9b34127da005b9fd99..d5961864f88217f6de252d878eb2103985f5142d 100644 --- a/app/code/Magento/Paypal/etc/payment.xml +++ b/app/code/Magento/Paypal/etc/payment.xml @@ -6,7 +6,7 @@ */ --> <payment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../Magento/Payment/etc/payment.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Payment:etc/payment.xsd"> <credit_cards> <type id="SM" order="60"> <label>Switch/Maestro</label> diff --git a/app/code/Magento/Paypal/registration.php b/app/code/Magento/Paypal/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..59ea72b9d982797cde5b6b197dfdcbec58648782 --- /dev/null +++ b/app/code/Magento/Paypal/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Paypal', + __DIR__ +); diff --git a/app/code/Magento/Paypal/view/adminhtml/layout/adminhtml_paypal_reports_block.xml b/app/code/Magento/Paypal/view/adminhtml/layout/adminhtml_paypal_reports_block.xml index 4402b18316ccf78c9ef01267e65e6a79babb3801..f3361bc5da1f82f974966ee49b53233044413cbb 100644 --- a/app/code/Magento/Paypal/view/adminhtml/layout/adminhtml_paypal_reports_block.xml +++ b/app/code/Magento/Paypal/view/adminhtml/layout/adminhtml_paypal_reports_block.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="adminhtml.paypal.report.grid.container"> <block class="Magento\Backend\Block\Widget\Grid" name="paypal.report.grid" as="grid"> diff --git a/app/code/Magento/Paypal/view/adminhtml/layout/adminhtml_system_config_edit.xml b/app/code/Magento/Paypal/view/adminhtml/layout/adminhtml_system_config_edit.xml index 2a74b69a13ff6915a601b06da4848804f0211199..6219fedc05bfdc0adb889701451c24238618c3dd 100644 --- a/app/code/Magento/Paypal/view/adminhtml/layout/adminhtml_system_config_edit.xml +++ b/app/code/Magento/Paypal/view/adminhtml/layout/adminhtml_system_config_edit.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <css src="Magento_Paypal::styles.css"/> </head> diff --git a/app/code/Magento/Paypal/view/adminhtml/layout/customer_index_edit.xml b/app/code/Magento/Paypal/view/adminhtml/layout/customer_index_edit.xml index 567f1d5f6da6189c57b395e887f7986ef8f2fbcb..fb6b34388ea7ca6dcc01a7865f493593259a7a7b 100644 --- a/app/code/Magento/Paypal/view/adminhtml/layout/customer_index_edit.xml +++ b/app/code/Magento/Paypal/view/adminhtml/layout/customer_index_edit.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="customer_form"> <block class="Magento\Paypal\Block\Adminhtml\Customer\Edit\Tab\Agreement" name="customer_edit_tab_agreements" after="orders" /> diff --git a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_customergrid.xml b/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_customergrid.xml index 9167ed4ad7af092c56b648e6a0edc0deb1bda0d4..dd51b208c79cd94567adb05e5d75007252bcd0a0 100644 --- a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_customergrid.xml +++ b/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_customergrid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root"> <block class="Magento\Paypal\Block\Adminhtml\Customer\Edit\Tab\Agreement" name="customer.billing.agreement.grid"/> </container> diff --git a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_grid.xml b/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_grid.xml index 860e2a7ace0099b3333595fc9dd2570fefe560e4..61b89cff70de1005ac93323ca19c7d20939acc77 100644 --- a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_grid.xml +++ b/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_grid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root"> <block class="Magento\Paypal\Block\Adminhtml\Billing\Agreement\Grid" name="paypal.billing.agreement.grid"/> </container> diff --git a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_index.xml b/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_index.xml index 9c4d53759f24219438206b4df41343c532b73829..0b545e4a50228a8c964cef52dc89b0eb3275ef5b 100644 --- a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_index.xml +++ b/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Paypal\Block\Adminhtml\Billing\Agreement" name="paypal.billing.agreement.grid.container"/> diff --git a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_ordersgrid.xml b/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_ordersgrid.xml index 78e295bb5557f450aaf42bb9b7075de820ae8133..00ffa1d587549379818ecc3bf722b48eb9ceca14 100644 --- a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_ordersgrid.xml +++ b/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_ordersgrid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <update handle="sales_order_grid_block"/> <referenceBlock name="sales.order.grid"> <arguments> diff --git a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_view.xml b/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_view.xml index 2ea45b4fc1ffb27cf4d7617e6849082c05191a9c..801e4671f4932267aa3174a9aa5d72b76c774788 100644 --- a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_view.xml +++ b/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="sales_order_grid_block"/> <body> <referenceContainer name="admin.scope.col.wrap" htmlClass="admin__old" /> <!-- ToDo UI: remove this wrapper with old styles removal. The class name "admin__old" is for tests only, we shouldn't use it in any way --> diff --git a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_paypal_reports_grid.xml b/app/code/Magento/Paypal/view/adminhtml/layout/paypal_paypal_reports_grid.xml index f21f7b87ef9964538ddfc75c7ba93702c3f1fd90..f44c013cc41853c28cd6aa91042bc3b9f715bc0c 100644 --- a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_paypal_reports_grid.xml +++ b/app/code/Magento/Paypal/view/adminhtml/layout/paypal_paypal_reports_grid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <update handle="formkey"/> <update handle="adminhtml_paypal_reports_block"/> <container name="root"> diff --git a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_paypal_reports_index.xml b/app/code/Magento/Paypal/view/adminhtml/layout/paypal_paypal_reports_index.xml index 8337f8805026fa67d099af5a3face1d4c57a545e..a8354bb622307ba834e0347ffae1859a8201c6b9 100644 --- a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_paypal_reports_index.xml +++ b/app/code/Magento/Paypal/view/adminhtml/layout/paypal_paypal_reports_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="adminhtml_paypal_reports_block"/> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/Paypal/view/adminhtml/layout/sales_order_create_index.xml b/app/code/Magento/Paypal/view/adminhtml/layout/sales_order_create_index.xml index ea9b49e23e14edaf71d1fb00cf8f535b28e651bd..3d35899bc677d266735afd032d5d5f7ae7678969 100644 --- a/app/code/Magento/Paypal/view/adminhtml/layout/sales_order_create_index.xml +++ b/app/code/Magento/Paypal/view/adminhtml/layout/sales_order_create_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="order_create_billing_form"> <action method="setMethodFormTemplate"> diff --git a/app/code/Magento/Paypal/view/adminhtml/layout/sales_order_create_load_block_billing_method.xml b/app/code/Magento/Paypal/view/adminhtml/layout/sales_order_create_load_block_billing_method.xml index 7cfbed857b691d7776fcb120d0ec6bc5a46e6272..5efef6b88368438fbb7741073aa621578bbbe633 100644 --- a/app/code/Magento/Paypal/view/adminhtml/layout/sales_order_create_load_block_billing_method.xml +++ b/app/code/Magento/Paypal/view/adminhtml/layout/sales_order_create_load_block_billing_method.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="order.create.billing.method.form"> <action method="setMethodFormTemplate"> diff --git a/app/code/Magento/Paypal/view/adminhtml/layout/transparent_payment_response.xml b/app/code/Magento/Paypal/view/adminhtml/layout/transparent_payment_response.xml index 3f14942c6cdfdc6c3a7543c82075b8da86cf4a04..d48ecd043d1248fe66402eea2a49fb265495642b 100644 --- a/app/code/Magento/Paypal/view/adminhtml/layout/transparent_payment_response.xml +++ b/app/code/Magento/Paypal/view/adminhtml/layout/transparent_payment_response.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root" label="Root"> <block class="Magento\Payment\Block\Transparent\Iframe" name="transparent_iframe" template="Magento_Payment::transparent/iframe.phtml"/> </container> diff --git a/app/code/Magento/Paypal/view/frontend/layout/catalog_category_view.xml b/app/code/Magento/Paypal/view/frontend/layout/catalog_category_view.xml index 4e92a303bac46d06296fa45c0afa9c25fc2da142..fa916a38da555453af71b25324029d6f09eff73f 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/catalog_category_view.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/catalog_category_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="sidebar.additional"> <block class="Magento\Paypal\Block\Logo" name="paypal.partner.right.logo" template="partner/logo.phtml"/> diff --git a/app/code/Magento/Paypal/view/frontend/layout/catalog_product_view.xml b/app/code/Magento/Paypal/view/frontend/layout/catalog_product_view.xml index 7728cbc7226721b9a761c0c32d6d010b4d8ef366..c16b5bebfc6ffdf1d1c2206ae58876c72c8eaf67 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/catalog_product_view.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/catalog_product_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="top.container"> <block class="Magento\Paypal\Block\Bml\Banners" name="bml.center.logo" template="bml.phtml"> diff --git a/app/code/Magento/Paypal/view/frontend/layout/checkout_cart_index.xml b/app/code/Magento/Paypal/view/frontend/layout/checkout_cart_index.xml index ce6fb41f9d966649f720e70ee6dcaeae91a48c16..1f232b9b5a6094680fa235b950777f905224757d 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/checkout_cart_index.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/checkout_cart_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="top.container"> <block class="Magento\Paypal\Block\Bml\Banners" name="bml.center.logo" template="bml.phtml"> diff --git a/app/code/Magento/Paypal/view/frontend/layout/checkout_index_index.xml b/app/code/Magento/Paypal/view/frontend/layout/checkout_index_index.xml index 42d93bd24eaec73db5a4fc50e31aa25d673944c9..dd110f2b58f05d32f565bef3e6276b071994666a 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/checkout_index_index.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/checkout_index_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout.root"> <arguments> diff --git a/app/code/Magento/Paypal/view/frontend/layout/checkout_onepage_review.xml b/app/code/Magento/Paypal/view/frontend/layout/checkout_onepage_review.xml index 9b9237d672168c245224745aeb3eeb85258bb5d9..0bd4f9fb60f09c7da4e131e9680443242392feb3 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/checkout_onepage_review.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/checkout_onepage_review.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="checkout.onepage.review.info.items.after"> <block class="Magento\Paypal\Block\Iframe" name="paypal.iframe" cacheable="false"/> diff --git a/app/code/Magento/Paypal/view/frontend/layout/checkout_onepage_success.xml b/app/code/Magento/Paypal/view/frontend/layout/checkout_onepage_success.xml index beec563669570872d45abd0a10e7e3236a60b157..e12e33cd5bb4148d617231f501a4065566dda3ce 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/checkout_onepage_success.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/checkout_onepage_success.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="order.success.additional.info"> <block class="Magento\Paypal\Block\Checkout\Onepage\Success\BillingAgreement" name="onepage.success.billing_agreement" template="checkout/onepage/success/billing_agreement.phtml"/> diff --git a/app/code/Magento/Paypal/view/frontend/layout/cms_index_index.xml b/app/code/Magento/Paypal/view/frontend/layout/cms_index_index.xml index b7c0d3d140ccdfb85d976bb015ab4f23a7af375b..ebaa9622cf1b477559a962ff999a8593bc456bc6 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/cms_index_index.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/cms_index_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="sidebar.additional"> <block class="Magento\Paypal\Block\Logo" name="paypal.partner.right.logo" template="partner/logo.phtml"/> 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 6f091e27767537fa0bd726359aed1f7103da88a3..0138d6237d73c5ee777689c65270614e424c275b 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/customer_account.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/customer_account.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <title>Billing Agreements</title> </head> diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_billing_agreement_index.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_billing_agreement_index.xml index 50b60e3bf1f91f5e938d3801d34ceab356ebfad5..22376f53eda220dbe4672acff62e562ba1f59b0a 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_billing_agreement_index.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/paypal_billing_agreement_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="customer_account"/> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_billing_agreement_view.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_billing_agreement_view.xml index 69c77ab2a9acf603ccf2e0a8a27add269bad51f5..33059b9ca5719e171460cb3ab6f211ba5e39f928 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_billing_agreement_view.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/paypal_billing_agreement_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="customer_account"/> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_express_review.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_express_review.xml index fb51dc555e2c403155d8adb71c47fade1355013a..60e525f463b8f15ad65139be01d9d31017061bd1 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_express_review.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/paypal_express_review.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <title>Review Order</title> </head> diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_express_review_details.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_express_review_details.xml index aaa6885002defc6855922a48a56ea632da9422f0..01be224c3d0f1d5c88ddce44ae8a42d1a24e8d9a 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_express_review_details.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/paypal_express_review_details.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <update handle="checkout_onepage_review_item_renderers"/> <container name="root"> <block class="Magento\Paypal\Block\Express\Review\Details" name="page.block" template="express/review/details.phtml"> diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_hostedpro_cancel.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_hostedpro_cancel.xml index 33dc6423ec184bc46b0d69b34caab1b09e1045de..2e7fcc5d514e007b8f581e1a802af3b16397ec08 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_hostedpro_cancel.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/paypal_hostedpro_cancel.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root"> <block class="Magento\Paypal\Block\Hosted\Pro\Iframe" name="hosted.pro.iframe" template="hss/redirect.phtml"/> </container> diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_cancelpayment.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_cancelpayment.xml index efd09485f8691df28134c50661bf44c1b70461f1..556b91699aa14f8784b7c04dcd6e36e49e19d0b6 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_cancelpayment.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_cancelpayment.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root"> <block class="Magento\Paypal\Block\Payflow\Link\Iframe" name="payflow.link.iframe" template="payflowlink/redirect.phtml" cacheable="false"/> </container> diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_form.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_form.xml index 4325ef98cb1ff381ddedd6c6228363344059b2bb..04e27943bc4bdaedff49cad9de2a2cfe1cbc0f55 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_form.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_form.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root"> <block class="Magento\Paypal\Block\Payflow\Link\Iframe" name="payflow.link.iframe" template="payflowlink/form.phtml" cacheable="false"/> </container> diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_returnurl.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_returnurl.xml index efd09485f8691df28134c50661bf44c1b70461f1..556b91699aa14f8784b7c04dcd6e36e49e19d0b6 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_returnurl.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflow_returnurl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root"> <block class="Magento\Paypal\Block\Payflow\Link\Iframe" name="payflow.link.iframe" template="payflowlink/redirect.phtml" cacheable="false"/> </container> diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_cancelpayment.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_cancelpayment.xml index e0e22542ad808469f027830fb19d4f5150f71d4e..de130961d2ba03e04f4fdbdef30bd730ff04304c 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_cancelpayment.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_cancelpayment.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root"> <block class="Magento\Paypal\Block\Payflow\Advanced\Iframe" name="payflow.advanced.iframe" template="payflowlink/redirect.phtml" cacheable="false"/> </container> diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_form.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_form.xml index 7ee520ec5adeddb3afebd9dbc38079c67361185f..273340b4f04d4679b40df7d19d6537e254145b24 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_form.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_form.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root"> <block class="Magento\Paypal\Block\Payflow\Advanced\Iframe" name="payflow.advanced.iframe" template="payflowadvanced/form.phtml" cacheable="false"/> </container> diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_returnurl.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_returnurl.xml index e0e22542ad808469f027830fb19d4f5150f71d4e..de130961d2ba03e04f4fdbdef30bd730ff04304c 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_returnurl.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowadvanced_returnurl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root"> <block class="Magento\Paypal\Block\Payflow\Advanced\Iframe" name="payflow.advanced.iframe" template="payflowlink/redirect.phtml" cacheable="false"/> </container> diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowexpress_review.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowexpress_review.xml index f8848f64dcd448aaaba68ded7dc2bb0f8997a651..e41ab21bced7420064dde9f1340cb62e6a2279c6 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowexpress_review.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowexpress_review.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <title>Review Order</title> </head> diff --git a/app/code/Magento/Paypal/view/frontend/layout/transparent_payment_response.xml b/app/code/Magento/Paypal/view/frontend/layout/transparent_payment_response.xml index 3f14942c6cdfdc6c3a7543c82075b8da86cf4a04..d48ecd043d1248fe66402eea2a49fb265495642b 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/transparent_payment_response.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/transparent_payment_response.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root" label="Root"> <block class="Magento\Payment\Block\Transparent\Iframe" name="transparent_iframe" template="Magento_Payment::transparent/iframe.phtml"/> </container> diff --git a/app/code/Magento/Persistent/Helper/Data.php b/app/code/Magento/Persistent/Helper/Data.php index 9a9296c970055a23d13b2a2bfcf7b23f732eda7b..7b430b9d2d2d2fd941afa110e0718b4bb7726299 100644 --- a/app/code/Magento/Persistent/Helper/Data.php +++ b/app/code/Magento/Persistent/Helper/Data.php @@ -9,6 +9,7 @@ */ namespace Magento\Persistent\Helper; +use Magento\Framework\Module\Dir; use Magento\Store\Model\ScopeInterface; class Data extends \Magento\Framework\App\Helper\AbstractHelper @@ -174,7 +175,8 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper */ public function getPersistentConfigFilePath() { - return $this->_modulesReader->getModuleDir('etc', $this->_getModuleName()) . '/' . $this->_configFileName; + return $this->_modulesReader->getModuleDir(Dir::MODULE_ETC_DIR, $this->_getModuleName()) + . '/' . $this->_configFileName; } /** diff --git a/app/code/Magento/Persistent/Model/Persistent/Config.php b/app/code/Magento/Persistent/Model/Persistent/Config.php index bdbca254e8c860aa71a6a03e5f0ab40fd9d3073d..b0317504316d5a4b83caa0c5400152d9028b8a68 100644 --- a/app/code/Magento/Persistent/Model/Persistent/Config.php +++ b/app/code/Magento/Persistent/Model/Persistent/Config.php @@ -5,7 +5,7 @@ */ namespace Magento\Persistent\Model\Persistent; -use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Module\Dir; /** * Persistent Config Model @@ -56,11 +56,9 @@ class Config protected $_persistentFactory; /** - * Filesystem - * - * @var \Magento\Framework\Filesystem\Directory\Read; + * @var \Magento\Framework\Filesystem\Directory\ReadFactory */ - protected $_modulesDirectory; + protected $readFactory; /** * @param \Magento\Framework\Config\DomFactory $domFactory @@ -68,7 +66,7 @@ class Config * @param \Magento\Framework\View\LayoutInterface $layout * @param \Magento\Framework\App\State $appState * @param \Magento\Persistent\Model\Factory $persistentFactory - * @param \Magento\Framework\Filesystem $filesystem + * @param \Magento\Framework\Filesystem\Directory\ReadFactory $readFactory */ public function __construct( \Magento\Framework\Config\DomFactory $domFactory, @@ -76,14 +74,14 @@ class Config \Magento\Framework\View\LayoutInterface $layout, \Magento\Framework\App\State $appState, \Magento\Persistent\Model\Factory $persistentFactory, - \Magento\Framework\Filesystem $filesystem + \Magento\Framework\Filesystem\Directory\ReadFactory $readFactory ) { $this->_domFactory = $domFactory; $this->_moduleReader = $moduleReader; $this->_layout = $layout; $this->_appState = $appState; $this->_persistentFactory = $persistentFactory; - $this->_modulesDirectory = $filesystem->getDirectoryRead(DirectoryList::MODULES); + $this->readFactory = $readFactory; } /** @@ -108,21 +106,26 @@ class Config protected function _getConfigDomXPath() { if ($this->_configDomXPath === null) { - $filePath = $this->_modulesDirectory->getRelativePath($this->_configFilePath); - $isFile = $this->_modulesDirectory->isFile($filePath); - $isReadable = $this->_modulesDirectory->isReadable($filePath); + $dir = explode("/", $this->_configFilePath); + array_pop($dir); + $dir = implode("/", $dir); + $directoryRead = $this->readFactory->create($dir); + $filePath = $directoryRead->getRelativePath($this->_configFilePath); + $isFile = $directoryRead->isFile($filePath); + $isReadable = $directoryRead->isReadable($filePath); if (!$isFile || !$isReadable) { throw new \Magento\Framework\Exception\LocalizedException( __('We cannot load the configuration from file %1.', $this->_configFilePath) ); } - $xml = $this->_modulesDirectory->readFile($filePath); + $xml = $directoryRead->readFile($filePath); /** @var \Magento\Framework\Config\Dom $configDom */ $configDom = $this->_domFactory->createDom( [ 'xml' => $xml, 'idAttributes' => ['config/instances/blocks/reference' => 'id'], - 'schemaFile' => $this->_moduleReader->getModuleDir('etc', 'Magento_Persistent') . '/persistent.xsd', + 'schemaFile' => $this->_moduleReader->getModuleDir(Dir::MODULE_ETC_DIR, 'Magento_Persistent') + . '/persistent.xsd', ] ); $this->_configDomXPath = new \DOMXPath($configDom->getDom()); diff --git a/app/code/Magento/Persistent/composer.json b/app/code/Magento/Persistent/composer.json index 7464371fa9c8c684f964f1eca3b7d0669cb3ff5d..b66dbebcd3521866d1b20d4c2c42531186f482d4 100644 --- a/app/code/Magento/Persistent/composer.json +++ b/app/code/Magento/Persistent/composer.json @@ -9,8 +9,7 @@ "magento/module-cron": "1.0.0-beta", "magento/module-page-cache": "1.0.0-beta", "magento/module-quote": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -18,12 +17,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Persistent" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Persistent\\": "" + } } } diff --git a/app/code/Magento/Persistent/etc/acl.xml b/app/code/Magento/Persistent/etc/acl.xml index 102ac7ca91625ada872a59f514bd709cfad182a2..73913931ae4bd4ab7b0d41a05862b0f7fcd74bb0 100644 --- a/app/code/Magento/Persistent/etc/acl.xml +++ b/app/code/Magento/Persistent/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/app/code/Magento/Persistent/etc/adminhtml/system.xml b/app/code/Magento/Persistent/etc/adminhtml/system.xml index 6e04f0a06410bf5c37b349aa8d512351abe29e90..ba928474318e38b5e93e863bdccda507ef884d01 100644 --- a/app/code/Magento/Persistent/etc/adminhtml/system.xml +++ b/app/code/Magento/Persistent/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="persistent" translate="label" type="text" sortOrder="500" showInDefault="1" showInWebsite="1" showInStore="0"> <class>separator-top</class> diff --git a/app/code/Magento/Persistent/etc/config.xml b/app/code/Magento/Persistent/etc/config.xml index c34916a7735a29fff1ff7e2c9c6dbc90face6310..e196413c73414f8929efa1885bdedf01b3c6c664 100644 --- a/app/code/Magento/Persistent/etc/config.xml +++ b/app/code/Magento/Persistent/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <persistent> <options> diff --git a/app/code/Magento/Persistent/etc/crontab.xml b/app/code/Magento/Persistent/etc/crontab.xml index ebb943e1b0c22112c69419a48a09eb37cf8eb7e4..ffbb3bb19ea8cc8a5db715c07fb277899b245f30 100644 --- a/app/code/Magento/Persistent/etc/crontab.xml +++ b/app/code/Magento/Persistent/etc/crontab.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Cron/etc/crontab.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd"> <group id="default"> <job name="persistent_clear_expired" instance="Magento\Persistent\Observer\ClearExpiredCronJobObserver" method="execute"> <schedule>0 0 * * *</schedule> diff --git a/app/code/Magento/Persistent/etc/di.xml b/app/code/Magento/Persistent/etc/di.xml index 8ced83d2cc9016b31ca94ecc47285191d0c89578..41f061292f0407c8a61fdaca16db669882cd6849 100644 --- a/app/code/Magento/Persistent/etc/di.xml +++ b/app/code/Magento/Persistent/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Quote\Model\AddressAdditionalDataProcessor"> <plugin name="persistent_remember_me_checkbox_processor" type="Magento\Persistent\Model\Checkout\AddressDataProcessorPlugin" /> </type> diff --git a/app/code/Magento/Persistent/etc/extension_attributes.xml b/app/code/Magento/Persistent/etc/extension_attributes.xml index f5b2f2859e9decbabc36032460559afc00b99d48..5bd3f30a3045435c9221b829f1dd9a4c4816954c 100644 --- a/app/code/Magento/Persistent/etc/extension_attributes.xml +++ b/app/code/Magento/Persistent/etc/extension_attributes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Api/etc/extension_attributes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> <extension_attributes for="Magento\Quote\Api\Data\AddressAdditionalDataInterface"> <attribute code="persistent_remember_me" type="string" /> </extension_attributes> diff --git a/app/code/Magento/Persistent/etc/frontend/di.xml b/app/code/Magento/Persistent/etc/frontend/di.xml index 43ed89834020afad923fb9d4087b45e2ccbef8da..38b4501b7639db331b04455e8ea5f4898cab63cf 100644 --- a/app/code/Magento/Persistent/etc/frontend/di.xml +++ b/app/code/Magento/Persistent/etc/frontend/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Framework\Url\SecurityInfo"> <arguments> <argument name="secureUrlList" xsi:type="array"> diff --git a/app/code/Magento/Persistent/etc/frontend/events.xml b/app/code/Magento/Persistent/etc/frontend/events.xml index d21a8f193058d52b47ba708cafde5326e2777b6c..2da8dbc820e37bffca15518224386c8d0f7fbbe0 100644 --- a/app/code/Magento/Persistent/etc/frontend/events.xml +++ b/app/code/Magento/Persistent/etc/frontend/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="customer_data_object_login"> <observer name="persistent" instance="Magento\Persistent\Observer\SynchronizePersistentOnLoginObserver" method="execute" /> </event> diff --git a/app/code/Magento/Persistent/etc/frontend/routes.xml b/app/code/Magento/Persistent/etc/frontend/routes.xml index af73ccd1a0b05101abc73f05facc01e2a1ed10d9..29c26328da33f968c0c34cf40fd8170bd53a76b6 100644 --- a/app/code/Magento/Persistent/etc/frontend/routes.xml +++ b/app/code/Magento/Persistent/etc/frontend/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="standard"> <route id="persistent" frontName="persistent"> <module name="Magento_Persistent" /> diff --git a/app/code/Magento/Persistent/etc/module.xml b/app/code/Magento/Persistent/etc/module.xml index 1d36077f77a4426935d5ca68afe9959a250c2e59..56cb14885a46b9a19b029e17b8bc39b2be15408b 100644 --- a/app/code/Magento/Persistent/etc/module.xml +++ b/app/code/Magento/Persistent/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Persistent" setup_version="2.0.0"> <sequence> <module name="Magento_Checkout"/> diff --git a/app/code/Magento/Persistent/etc/persistent.xml b/app/code/Magento/Persistent/etc/persistent.xml index fe5138b065419a2666dc2c070d037feee05ca655..5852621ae3518a38a0951e04830d36686b479abe 100644 --- a/app/code/Magento/Persistent/etc/persistent.xml +++ b/app/code/Magento/Persistent/etc/persistent.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="./persistent.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Persistent:etc/./persistent.xsd"> <instances> <blocks> <reference id="top_links"> diff --git a/app/code/Magento/Persistent/etc/webapi_rest/events.xml b/app/code/Magento/Persistent/etc/webapi_rest/events.xml index fafa91cd463ad95e3548f1ccbb27a491c2149304..c11bdcb0faa3666e01a7ef27eec16d296cce6eb6 100644 --- a/app/code/Magento/Persistent/etc/webapi_rest/events.xml +++ b/app/code/Magento/Persistent/etc/webapi_rest/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="customer_data_object_login"> <observer name="persistent" instance="Magento\Persistent\Observer\SynchronizePersistentOnLoginObserver" method="execute" /> </event> diff --git a/app/code/Magento/Persistent/etc/webapi_soap/events.xml b/app/code/Magento/Persistent/etc/webapi_soap/events.xml index fafa91cd463ad95e3548f1ccbb27a491c2149304..c11bdcb0faa3666e01a7ef27eec16d296cce6eb6 100644 --- a/app/code/Magento/Persistent/etc/webapi_soap/events.xml +++ b/app/code/Magento/Persistent/etc/webapi_soap/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="customer_data_object_login"> <observer name="persistent" instance="Magento\Persistent\Observer\SynchronizePersistentOnLoginObserver" method="execute" /> </event> diff --git a/app/code/Magento/Persistent/registration.php b/app/code/Magento/Persistent/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..a66ba40c2fb65521f2675b6cf524568e8506f93a --- /dev/null +++ b/app/code/Magento/Persistent/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Persistent', + __DIR__ +); diff --git a/app/code/Magento/Persistent/view/frontend/layout/customer_account_create.xml b/app/code/Magento/Persistent/view/frontend/layout/customer_account_create.xml index e69560acde292653a0091bc99ec6968b9429f0c1..376cf1576a731fa4066b486c6284cb1783bbd26e 100644 --- a/app/code/Magento/Persistent/view/frontend/layout/customer_account_create.xml +++ b/app/code/Magento/Persistent/view/frontend/layout/customer_account_create.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="form.additional.info"> <block class="Magento\Persistent\Block\Form\Remember" name="persistent.remember.me" template="remember_me.phtml" before="-"/> diff --git a/app/code/Magento/Persistent/view/frontend/layout/customer_account_login.xml b/app/code/Magento/Persistent/view/frontend/layout/customer_account_login.xml index e69560acde292653a0091bc99ec6968b9429f0c1..376cf1576a731fa4066b486c6284cb1783bbd26e 100644 --- a/app/code/Magento/Persistent/view/frontend/layout/customer_account_login.xml +++ b/app/code/Magento/Persistent/view/frontend/layout/customer_account_login.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="form.additional.info"> <block class="Magento\Persistent\Block\Form\Remember" name="persistent.remember.me" template="remember_me.phtml" before="-"/> diff --git a/app/code/Magento/ProductAlert/composer.json b/app/code/Magento/ProductAlert/composer.json index 7a6bed0b7495b53546362598b9377e41ce9b0181..c5e34352bc65e23b687f7032bb68b23b7d771d2d 100644 --- a/app/code/Magento/ProductAlert/composer.json +++ b/app/code/Magento/ProductAlert/composer.json @@ -7,8 +7,7 @@ "magento/module-store": "1.0.0-beta", "magento/module-catalog": "1.0.0-beta", "magento/module-customer": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -16,12 +15,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/ProductAlert" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\ProductAlert\\": "" + } } } diff --git a/app/code/Magento/ProductAlert/etc/adminhtml/system.xml b/app/code/Magento/ProductAlert/etc/adminhtml/system.xml index 3b7c405529615327f5bb844c45e2b9c4ec6ef8ba..4ec8fc2bdbff3a39b6236bb574932754331607eb 100644 --- a/app/code/Magento/ProductAlert/etc/adminhtml/system.xml +++ b/app/code/Magento/ProductAlert/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="catalog"> <group id="productalert" translate="label" type="text" sortOrder="250" showInDefault="1" showInWebsite="1" showInStore="1"> diff --git a/app/code/Magento/ProductAlert/etc/config.xml b/app/code/Magento/ProductAlert/etc/config.xml index aae9903bfd345db05443b7180a285e3026c85aa5..03a87ebbc54208443cd89de9f6461f163c89d8c3 100644 --- a/app/code/Magento/ProductAlert/etc/config.xml +++ b/app/code/Magento/ProductAlert/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <catalog> <productalert> diff --git a/app/code/Magento/ProductAlert/etc/crontab.xml b/app/code/Magento/ProductAlert/etc/crontab.xml index 4182793ff9b8a5fa9a09f3ddf890f7d8bc88b0a3..019a53f0e7fd3bbbe7a0a9ff248579f01cfa8acc 100644 --- a/app/code/Magento/ProductAlert/etc/crontab.xml +++ b/app/code/Magento/ProductAlert/etc/crontab.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Cron/etc/crontab.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd"> <group id="default"> <job name="catalog_product_alert" instance="Magento\ProductAlert\Model\Observer" method="process"> <config_path>crontab/default/jobs/catalog_product_alert/schedule/cron_expr</config_path> diff --git a/app/code/Magento/ProductAlert/etc/di.xml b/app/code/Magento/ProductAlert/etc/di.xml index 4b95bd4e79c74a508ddf1f7077e48394b6c6d6b2..5b0824a75f2ab1670eff80c85189f7627cef1350 100644 --- a/app/code/Magento/ProductAlert/etc/di.xml +++ b/app/code/Magento/ProductAlert/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Framework\Module\Setup\Migration"> <arguments> <argument name="compositeModules" xsi:type="array"> diff --git a/app/code/Magento/ProductAlert/etc/email_templates.xml b/app/code/Magento/ProductAlert/etc/email_templates.xml index ce8e0ecd3801e18b35393dcecd52db74a2830db1..98acc8b137bed07dba667be288c7521932d9fb38 100644 --- a/app/code/Magento/ProductAlert/etc/email_templates.xml +++ b/app/code/Magento/ProductAlert/etc/email_templates.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Email/etc/email_templates.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Email:etc/email_templates.xsd"> <template id="catalog_productalert_email_stock_template" label="Stock Alert" file="stock_alert.html" type="html" module="Magento_ProductAlert" area="frontend"/> <template id="catalog_productalert_email_price_template" label="Price Alert" file="price_alert.html" type="html" module="Magento_ProductAlert" area="frontend"/> <template id="catalog_productalert_cron_error_email_template" label="Cron Error Warning" file="cron_error.html" type="text" module="Magento_ProductAlert" area="adminhtml"/> diff --git a/app/code/Magento/ProductAlert/etc/frontend/routes.xml b/app/code/Magento/ProductAlert/etc/frontend/routes.xml index f62e8565c2afbbc0f3ecbea473063e772750136a..94e874dd37026d6581ea101ebbef307a2fd3a1db 100644 --- a/app/code/Magento/ProductAlert/etc/frontend/routes.xml +++ b/app/code/Magento/ProductAlert/etc/frontend/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="standard"> <route id="productalert" frontName="productalert"> <module name="Magento_ProductAlert" /> diff --git a/app/code/Magento/ProductAlert/etc/module.xml b/app/code/Magento/ProductAlert/etc/module.xml index ff314d32a05f4f622bb2431c10ff944f5cb358ef..b9492a6ae476e44af777680d3392a8e88758749c 100644 --- a/app/code/Magento/ProductAlert/etc/module.xml +++ b/app/code/Magento/ProductAlert/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_ProductAlert" setup_version="2.0.0"> <sequence> <module name="Magento_Catalog"/> diff --git a/app/code/Magento/ProductAlert/registration.php b/app/code/Magento/ProductAlert/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..2ca33694cbfb06cf3fabb2b9f51bad14ad536f28 --- /dev/null +++ b/app/code/Magento/ProductAlert/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_ProductAlert', + __DIR__ +); diff --git a/app/code/Magento/ProductAlert/view/frontend/layout/catalog_product_view.xml b/app/code/Magento/ProductAlert/view/frontend/layout/catalog_product_view.xml index a305787e508982fe106de7e5fd6bdc30a5a0d4e1..fbe7eaf00fbefd891e9e932719d3ead838806cc1 100644 --- a/app/code/Magento/ProductAlert/view/frontend/layout/catalog_product_view.xml +++ b/app/code/Magento/ProductAlert/view/frontend/layout/catalog_product_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="alert.urls"> <block class="Magento\ProductAlert\Block\Product\View\Price" name="productalert.price" as="productalert_price" template="product/view.phtml"> diff --git a/app/code/Magento/ProductVideo/composer.json b/app/code/Magento/ProductVideo/composer.json index bc5bc2ace966684f9eca8b66ea54fc6f8b4b8b9c..bf05bc02219b2b96e7ba73705e31f42e680c9a51 100644 --- a/app/code/Magento/ProductVideo/composer.json +++ b/app/code/Magento/ProductVideo/composer.json @@ -17,12 +17,10 @@ "license": [ "proprietary" ], - "extra": { - "map": [ - [ - "*", - "Magento/ProductVideo" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\ProductVideo\\": "" + } } } diff --git a/app/code/Magento/ProductVideo/etc/adminhtml/events.xml b/app/code/Magento/ProductVideo/etc/adminhtml/events.xml index 89f8e14360b2d6b259dceff6033ec444ddc12c68..f543abe50d25df24061b7298bfab092d89643dd6 100644 --- a/app/code/Magento/ProductVideo/etc/adminhtml/events.xml +++ b/app/code/Magento/ProductVideo/etc/adminhtml/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="catalog_product_gallery_prepare_layout"> <observer name="change_template" instance="Magento\ProductVideo\Model\Observer" method="changeTemplate" /> </event> diff --git a/app/code/Magento/ProductVideo/etc/adminhtml/routes.xml b/app/code/Magento/ProductVideo/etc/adminhtml/routes.xml index 4b2b87d4857c391013d65770a5a5648915bef2db..db6eae1a1301ec6265d36a07337d82b07f23c370 100644 --- a/app/code/Magento/ProductVideo/etc/adminhtml/routes.xml +++ b/app/code/Magento/ProductVideo/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="admin"> <route id="product_video" frontName="product_video"> <module name="Magento_ProductVideo" /> diff --git a/app/code/Magento/ProductVideo/etc/di.xml b/app/code/Magento/ProductVideo/etc/di.xml index 48a8cf3c937bc440d4a628b98b64cdb0e4f68c3c..99aeef0a7251e7f2cbbf54abfc4471fdf1ce1b97 100644 --- a/app/code/Magento/ProductVideo/etc/di.xml +++ b/app/code/Magento/ProductVideo/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Framework\Api\Data\VideoContentInterface" type="Magento\ProductVideo\Model\Product\Attribute\Media\VideoEntry" /> <type name="Magento\Catalog\Model\Product\Attribute\Backend\Media\EntryConverterPool"> <arguments> diff --git a/app/code/Magento/ProductVideo/etc/extension_attributes.xml b/app/code/Magento/ProductVideo/etc/extension_attributes.xml index 53c5e40db57372fe468aa8211427e722c380b70d..5b4f9e6a4e0049ad34e6bdeb0f23f73d1ca39c71 100644 --- a/app/code/Magento/ProductVideo/etc/extension_attributes.xml +++ b/app/code/Magento/ProductVideo/etc/extension_attributes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Api/etc/extension_attributes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> <extension_attributes for="Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface"> <attribute code="video_content" type="Magento\Framework\Api\Data\VideoContentInterface" /> </extension_attributes> diff --git a/app/code/Magento/ProductVideo/etc/module.xml b/app/code/Magento/ProductVideo/etc/module.xml index 7c2c42fe48cd9827353092af5401b71b30740d70..a6bc6bab40b5a7f40f29fb4cc7d1f677a4b46471 100644 --- a/app/code/Magento/ProductVideo/etc/module.xml +++ b/app/code/Magento/ProductVideo/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_ProductVideo" setup_version="2.0.0.1"> <sequence> <module name="Magento_Catalog"/> diff --git a/app/code/Magento/ProductVideo/etc/view.xml b/app/code/Magento/ProductVideo/etc/view.xml index cd678dfd1c58a5567361b34c3dd5c61fcd43d713..3a09480fc4c57b0092b8e12760ca1514036e99b5 100644 --- a/app/code/Magento/ProductVideo/etc/view.xml +++ b/app/code/Magento/ProductVideo/etc/view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="view.xsd"> +<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ProductVideo/etc/view.xsd"> <media> <videos module="Magento_ProductVideo"> <video id="play_if_base" type="play_if_base"> diff --git a/app/code/Magento/ProductVideo/registration.php b/app/code/Magento/ProductVideo/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..8c5e3263fea71ff1afbdab1e259625e8fecf52f3 --- /dev/null +++ b/app/code/Magento/ProductVideo/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_ProductVideo', + __DIR__ +); diff --git a/app/code/Magento/ProductVideo/view/adminhtml/layout/catalog_product_new.xml b/app/code/Magento/ProductVideo/view/adminhtml/layout/catalog_product_new.xml index e2362f9473219e7d5ac0454e8a01a611ee13ffae..eff4727524c00cbcde913abfb8ca5395199165e7 100755 --- a/app/code/Magento/ProductVideo/view/adminhtml/layout/catalog_product_new.xml +++ b/app/code/Magento/ProductVideo/view/adminhtml/layout/catalog_product_new.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <css src="Magento_ProductVideo::css/productvideo.css"/> <link src="Magento_ProductVideo::js/get-video-information.js"/> diff --git a/app/code/Magento/ProductVideo/view/frontend/layout/catalog_product_view.xml b/app/code/Magento/ProductVideo/view/frontend/layout/catalog_product_view.xml index 340d82d4adac41a6de04225cbc5bf69ac7493567..81d7989a521f2d0cb270ad9e0adcb07c9c2f99ce 100644 --- a/app/code/Magento/ProductVideo/view/frontend/layout/catalog_product_view.xml +++ b/app/code/Magento/ProductVideo/view/frontend/layout/catalog_product_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <css src="Magento_ProductVideo::css/product-video.css"/> <link src="Magento_ProductVideo::js/fotorama-add-video-events.js"/> diff --git a/app/code/Magento/Quote/Model/Quote/Item/CartItemProcessorInterface.php b/app/code/Magento/Quote/Model/Quote/Item/CartItemProcessorInterface.php index 0f1fa2ae93ac079f63e3fb87600be735c5474058..e57570092dbea269fc21ca9c6c7330d74fdf8164 100644 --- a/app/code/Magento/Quote/Model/Quote/Item/CartItemProcessorInterface.php +++ b/app/code/Magento/Quote/Model/Quote/Item/CartItemProcessorInterface.php @@ -21,10 +21,10 @@ interface CartItemProcessorInterface public function convertToBuyRequest(CartItemInterface $cartItem); /** - * Process cart item product options + * Process cart item product/custom options * * @param CartItemInterface $cartItem * @return CartItemInterface */ - public function processProductOptions(CartItemInterface $cartItem); + public function processOptions(CartItemInterface $cartItem); } diff --git a/app/code/Magento/Quote/Model/Quote/Item/Repository.php b/app/code/Magento/Quote/Model/Quote/Item/Repository.php index c979c5a52a4c2e3442c8de58b50f79b63699ea03..3d28a4c84fbca31e970b6c2600b9664ec9ec2057 100644 --- a/app/code/Magento/Quote/Model/Quote/Item/Repository.php +++ b/app/code/Magento/Quote/Model/Quote/Item/Repository.php @@ -33,7 +33,7 @@ class Repository implements \Magento\Quote\Api\CartItemRepositoryInterface protected $itemDataFactory; /** - * @var \Magento\Quote\Model\Quote\Item\CartItemProcessorInterface[] + * @var CartItemProcessorInterface[] */ protected $cartItemProcessors; @@ -41,7 +41,7 @@ class Repository implements \Magento\Quote\Api\CartItemRepositoryInterface * @param \Magento\Quote\Model\QuoteRepository $quoteRepository * @param \Magento\Catalog\Api\ProductRepositoryInterface $productRepository * @param \Magento\Quote\Api\Data\CartItemInterfaceFactory $itemDataFactory - * @param \Magento\Quote\Model\Quote\Item\CartItemProcessorInterface[] $cartItemProcessors + * @param CartItemProcessorInterface[] $cartItemProcessors */ public function __construct( \Magento\Quote\Model\QuoteRepository $quoteRepository, @@ -67,7 +67,8 @@ class Repository implements \Magento\Quote\Api\CartItemRepositoryInterface /** @var \Magento\Quote\Model\Quote\Item $item */ foreach ($quote->getAllItems() as $item) { if (!$item->isDeleted() && !$item->getParentItemId()) { - $output[] = $this->addProductOptions($item->getProductType(), $item); + $item = $this->addProductOptions($item->getProductType(), $item); + $output[] = $this->applyCustomOptions($item); } } return $output; @@ -128,7 +129,8 @@ class Repository implements \Magento\Quote\Api\CartItemRepositoryInterface $itemId = $cartItem->getId(); foreach ($quote->getAllItems() as $quoteItem) { if ($itemId == $quoteItem->getId()) { - return $this->addProductOptions($productType, $quoteItem); + $cartItem = $this->addProductOptions($productType, $quoteItem); + return $this->applyCustomOptions($cartItem); } } throw new CouldNotSaveException(__('Could not save quote')); @@ -146,7 +148,47 @@ class Repository implements \Magento\Quote\Api\CartItemRepositoryInterface $params = (isset($this->cartItemProcessors[$productType])) ? $this->cartItemProcessors[$productType]->convertToBuyRequest($cartItem) : null; - return ($params === null) ? $cartItem->getQty() : $params->setQty($cartItem->getQty()); + + $params = ($params === null) ? $cartItem->getQty() : $params->setQty($cartItem->getQty()); + return $this->addCustomOptionsToBuyRequest($cartItem, $params); + } + + /** + * Add to buy request custom options + * + * @param \Magento\Quote\Api\Data\CartItemInterface $cartItem + * @param \Magento\Framework\DataObject|float $params + * @return \Magento\Framework\DataObject|float + */ + protected function addCustomOptionsToBuyRequest( + \Magento\Quote\Api\Data\CartItemInterface $cartItem, + $params + ) { + if (isset($this->cartItemProcessors['custom_options'])) { + $buyRequestUpdate = $this->cartItemProcessors['custom_options']->convertToBuyRequest($cartItem); + if (!$buyRequestUpdate) { + return $params; + } + if ($params instanceof \Magento\Framework\DataObject) { + $buyRequestUpdate->addData($params->getData()); + } else if (is_numeric($params)) { + $buyRequestUpdate->setData('qty', $params); + } + return $buyRequestUpdate; + } + return $params; + } + + /** + * @param \Magento\Quote\Api\Data\CartItemInterface $cartItem + * @return \Magento\Quote\Api\Data\CartItemInterface + */ + protected function applyCustomOptions(\Magento\Quote\Api\Data\CartItemInterface $cartItem) + { + if (isset($this->cartItemProcessors['custom_options'])) { + $this->cartItemProcessors['custom_options']->processOptions($cartItem); + } + return $cartItem; } /** @@ -159,7 +201,7 @@ class Repository implements \Magento\Quote\Api\CartItemRepositoryInterface \Magento\Quote\Api\Data\CartItemInterface $cartItem ) { $cartItem = (isset($this->cartItemProcessors[$productType])) - ? $this->cartItemProcessors[$productType]->processProductOptions($cartItem) + ? $this->cartItemProcessors[$productType]->processOptions($cartItem) : $cartItem; return $cartItem; } diff --git a/app/code/Magento/Quote/Test/Unit/Model/Quote/Item/RepositoryTest.php b/app/code/Magento/Quote/Test/Unit/Model/Quote/Item/RepositoryTest.php index 7836d91000c5baf03915d18c1bdad16b4e70fc2b..e4a2901609c6eae9df103748002f446e176c8d36 100644 --- a/app/code/Magento/Quote/Test/Unit/Model/Quote/Item/RepositoryTest.php +++ b/app/code/Magento/Quote/Test/Unit/Model/Quote/Item/RepositoryTest.php @@ -51,6 +51,9 @@ class RepositoryTest extends \PHPUnit_Framework_TestCase */ protected $itemDataFactoryMock; + /** @var \Magento\Catalog\Model\CustomOptions\CustomOptionProcessor|\PHPUnit_Framework_MockObject_MockObject */ + protected $customOptionProcessor; + /** * @return void */ @@ -68,11 +71,19 @@ class RepositoryTest extends \PHPUnit_Framework_TestCase $methods = ['getId', 'getSku', 'getQty', 'setData', '__wakeUp', 'getProduct', 'addProduct']; $this->quoteItemMock = $this->getMock('Magento\Quote\Model\Quote\Item', $methods, [], '', false); + $this->customOptionProcessor = $this->getMock( + 'Magento\Catalog\Model\CustomOptions\CustomOptionProcessor', + [], + [], + '', + false + ); $this->repository = new Repository( $this->quoteRepositoryMock, $this->productRepositoryMock, - $this->itemDataFactoryMock + $this->itemDataFactoryMock, + ['custom_options' => $this->customOptionProcessor] ); } @@ -113,6 +124,10 @@ class RepositoryTest extends \PHPUnit_Framework_TestCase public function testSaveCouldNotAddProduct() { $cartId = 13; + $buyRequest = $this->getMock('Magento\Framework\DataObject', [], [], '', false); + $buyRequest->expects($this->once()) + ->method('setData') + ->with('qty', '12'); $this->dataMock->expects($this->exactly(2))->method('getQty')->will($this->returnValue(12)); $this->dataMock->expects($this->once())->method('getQuoteId')->willReturn($cartId); $this->quoteRepositoryMock->expects($this->once()) @@ -124,13 +139,17 @@ class RepositoryTest extends \PHPUnit_Framework_TestCase $this->quoteMock ->expects($this->once()) ->method('addProduct') - ->with($this->productMock, 12) + ->with($this->productMock, $buyRequest) ->willReturn('Please specify all the required information.'); $this->quoteMock->expects($this->never())->method('getItemById'); $this->quoteRepositoryMock->expects($this->never())->method('save')->with($this->quoteMock); $this->quoteMock ->expects($this->never()) ->method('getAllItems'); + $this->customOptionProcessor->expects($this->once()) + ->method('convertToBuyRequest') + ->with($this->dataMock) + ->willReturn($buyRequest); $this->repository->save($this->dataMock); } @@ -142,6 +161,7 @@ class RepositoryTest extends \PHPUnit_Framework_TestCase public function testSaveCouldNotSaveException() { $cartId = 13; + $buyRequest = $this->getMock('Magento\Framework\DataObject', [], [], '', false); $this->dataMock->expects($this->exactly(2))->method('getQty')->will($this->returnValue(12)); $this->dataMock->expects($this->once())->method('getQuoteId')->willReturn($cartId); $this->quoteRepositoryMock->expects($this->once()) @@ -153,7 +173,7 @@ class RepositoryTest extends \PHPUnit_Framework_TestCase $this->quoteMock ->expects($this->once()) ->method('addProduct') - ->with($this->productMock, 12) + ->with($this->productMock, $buyRequest) ->willReturn($this->productMock); $this->quoteMock->expects($this->never())->method('getItemById'); $this->quoteMock->expects($this->once())->method('collectTotals')->will($this->returnValue($this->quoteMock)); @@ -168,14 +188,26 @@ class RepositoryTest extends \PHPUnit_Framework_TestCase $this->quoteMock ->expects($this->never()) ->method('getAllItems'); + $this->customOptionProcessor->expects($this->once()) + ->method('convertToBuyRequest') + ->with($this->dataMock) + ->willReturn($buyRequest); + $buyRequest->expects($this->once()) + ->method('setData') + ->with('qty', '12'); $this->repository->save($this->dataMock); } + /** * @return void */ public function testSave() { $cartId = 13; + $buyRequest = $this->getMock('Magento\Framework\DataObject', [], [], '', false); + $buyRequest->expects($this->once()) + ->method('setData') + ->with('qty', '12'); $this->dataMock->expects($this->exactly(2))->method('getQty')->will($this->returnValue(12)); $this->dataMock->expects($this->once())->method('getQuoteId')->willReturn($cartId); $this->quoteRepositoryMock->expects($this->once()) @@ -187,7 +219,7 @@ class RepositoryTest extends \PHPUnit_Framework_TestCase $this->quoteMock ->expects($this->once()) ->method('addProduct') - ->with($this->productMock, 12) + ->with($this->productMock, $buyRequest) ->willReturn($this->productMock); $this->quoteMock->expects($this->never())->method('getItemById'); $this->quoteMock->expects($this->once())->method('collectTotals')->will($this->returnValue($this->quoteMock)); @@ -198,6 +230,41 @@ class RepositoryTest extends \PHPUnit_Framework_TestCase ->method('getAllItems') ->willReturn([$this->quoteItemMock]); $this->quoteItemMock->expects($this->any())->method('getId'); + $this->customOptionProcessor->expects($this->once()) + ->method('convertToBuyRequest') + ->with($this->dataMock) + ->willReturn($buyRequest); + $this->assertEquals($this->quoteItemMock, $this->repository->save($this->dataMock)); + } + + public function testSaveWithCustomOption() + { + $cartId = 13; + $buyRequest = $this->getMock('Magento\Framework\DataObject', [], [], '', false); + $this->dataMock->expects($this->exactly(2))->method('getQty')->will($this->returnValue(12)); + $this->dataMock->expects($this->once())->method('getQuoteId')->willReturn($cartId); + $this->quoteRepositoryMock->expects($this->once()) + ->method('getActive')->with($cartId)->will($this->returnValue($this->quoteMock)); + $this->productRepositoryMock->expects($this->once()) + ->method('get') + ->will($this->returnValue($this->productMock)); + $this->dataMock->expects($this->once())->method('getSku'); + $this->quoteMock->expects($this->once()) + ->method('addProduct') + ->with($this->productMock, $buyRequest) + ->willReturn($this->productMock); + $this->quoteMock->expects($this->never())->method('getItemById'); + $this->quoteMock->expects($this->once())->method('collectTotals')->will($this->returnValue($this->quoteMock)); + $this->quoteRepositoryMock->expects($this->once())->method('save')->with($this->quoteMock); + $this->dataMock->expects($this->once())->method('getItemId')->will($this->returnValue(null)); + $this->quoteMock->expects($this->once()) + ->method('getAllItems') + ->willReturn([$this->quoteItemMock]); + $this->quoteItemMock->expects($this->any())->method('getId'); + $this->customOptionProcessor->expects($this->once()) + ->method('convertToBuyRequest') + ->with($this->dataMock) + ->willReturn($buyRequest); $this->assertEquals($this->quoteItemMock, $this->repository->save($this->dataMock)); } @@ -232,6 +299,7 @@ class RepositoryTest extends \PHPUnit_Framework_TestCase { $cartId = 11; $itemId = 5; + $buyRequest = $this->getMock('Magento\Framework\DataObject', [], [], '', false); $this->dataMock->expects($this->exactly(2))->method('getQty')->will($this->returnValue(12)); $this->dataMock->expects($this->once())->method('getItemId')->will($this->returnValue($itemId)); $this->dataMock->expects($this->once())->method('getQuoteId')->willReturn($cartId); @@ -241,7 +309,7 @@ class RepositoryTest extends \PHPUnit_Framework_TestCase ->method('getItemById')->with($itemId)->will($this->returnValue($this->quoteItemMock)); $this->quoteItemMock->expects($this->any())->method('getProduct')->willReturn($this->productMock); $this->productMock->expects($this->once())->method('getTypeId')->willReturn('simple'); - $this->quoteItemMock->expects($this->once())->method('setData')->with('qty', 12); + $this->quoteItemMock->expects($this->never())->method('setData'); $this->productRepositoryMock ->expects($this->never())->method('get'); $this->quoteItemMock->expects($this->never())->method('addProduct'); @@ -256,7 +324,13 @@ class RepositoryTest extends \PHPUnit_Framework_TestCase ->method('save') ->with($this->quoteMock) ->willThrowException($exception); - + $this->customOptionProcessor->expects($this->once()) + ->method('convertToBuyRequest') + ->with($this->dataMock) + ->willReturn($buyRequest); + $buyRequest->expects($this->once()) + ->method('setData') + ->with('qty', '12'); $this->repository->save($this->dataMock); } @@ -267,6 +341,7 @@ class RepositoryTest extends \PHPUnit_Framework_TestCase { $cartId = 11; $itemId = 5; + $buyRequest = $this->getMock('Magento\Framework\DataObject', [], [], '', false); $this->dataMock->expects($this->exactly(2))->method('getQty')->will($this->returnValue(12)); $this->dataMock->expects($this->once())->method('getItemId')->will($this->returnValue($itemId)); $this->dataMock->expects($this->once())->method('getQuoteId')->willReturn($cartId); @@ -277,7 +352,7 @@ class RepositoryTest extends \PHPUnit_Framework_TestCase ->method('getItemById')->with($itemId)->will($this->returnValue($this->quoteItemMock)); $this->quoteItemMock->expects($this->once())->method('getProduct')->willReturn($this->productMock); $this->productMock->expects($this->once())->method('getTypeId')->willReturn('simple'); - $this->quoteItemMock->expects($this->once())->method('setData')->with('qty', 12); + $this->quoteItemMock->expects($this->never())->method('setData'); $this->productRepositoryMock ->expects($this->never())->method('get'); $this->quoteItemMock->expects($this->never())->method('addProduct'); @@ -288,6 +363,17 @@ class RepositoryTest extends \PHPUnit_Framework_TestCase ->method('getAllItems') ->willReturn([$this->quoteItemMock]); $this->quoteItemMock->expects($this->any())->method('getId')->willReturn($itemId); + $this->customOptionProcessor->expects($this->once()) + ->method('convertToBuyRequest') + ->with($this->dataMock) + ->willReturn($buyRequest); + $buyRequest->expects($this->once()) + ->method('setData') + ->with('qty', '12'); + $this->quoteMock->expects($this->once()) + ->method('updateItem') + ->with($itemId, $buyRequest) + ->willReturn($this->dataMock); $this->assertEquals($this->quoteItemMock, $this->repository->save($this->dataMock)); } @@ -298,24 +384,28 @@ class RepositoryTest extends \PHPUnit_Framework_TestCase { $cartId = 11; $itemId = 5; + $buyRequest = $this->getMock('Magento\Framework\DataObject', [], [], '', false); $cartItemProcessorMock = $this->getMock('\Magento\Quote\Model\Quote\Item\CartItemProcessorInterface'); $this->repository = new Repository( $this->quoteRepositoryMock, $this->productRepositoryMock, $this->itemDataFactoryMock, - ['simple' => $cartItemProcessorMock] + ['simple' => $cartItemProcessorMock, 'custom_options' => $this->customOptionProcessor] ); - $requestMock = $this->getMock('\Magento\Framework\DataObject', ['setQty'], [], '', false); + $requestMock = $this->getMock('\Magento\Framework\DataObject', ['setQty', 'getData'], [], '', false); $cartItemProcessorMock->expects($this->once())->method('convertToBuyRequest')->willReturn($requestMock); $cartItemProcessorMock ->expects($this->once()) - ->method('processProductOptions') + ->method('processOptions') ->willReturn($this->quoteItemMock); $requestMock->expects($this->once())->method('setQty')->with(12)->willReturnSelf(); + $requestMock->expects($this->once()) + ->method('getData') + ->willReturn([]); $this->quoteMock ->expects($this->once()) ->method('updateItem') - ->with($itemId, $requestMock) + ->with($itemId, $buyRequest) ->willReturn($this->quoteItemMock); $this->dataMock->expects($this->any())->method('getQty')->will($this->returnValue(12)); $this->dataMock->expects($this->once())->method('getItemId')->will($this->returnValue($itemId)); @@ -336,6 +426,10 @@ class RepositoryTest extends \PHPUnit_Framework_TestCase ->willReturn([$this->quoteItemMock]); $this->quoteItemMock->expects($this->any())->method('getId')->willReturn($itemId); $this->quoteItemMock->expects($this->any())->method('getQty')->willReturn(12); + $this->customOptionProcessor->expects($this->once()) + ->method('convertToBuyRequest') + ->with($this->dataMock) + ->willReturn($buyRequest); $this->assertEquals($this->quoteItemMock, $this->repository->save($this->dataMock)); } diff --git a/app/code/Magento/Quote/composer.json b/app/code/Magento/Quote/composer.json index 679e089c77a808663f2623573eddf891e8e772e4..98c932935dc1f5c0cf58c15f39f0684a69b50ac5 100644 --- a/app/code/Magento/Quote/composer.json +++ b/app/code/Magento/Quote/composer.json @@ -18,8 +18,7 @@ "magento/module-eav": "1.0.0-beta", "magento/module-tax": "1.0.0-beta", "magento/module-catalog-inventory": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -27,12 +26,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Quote" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Quote\\": "" + } } } diff --git a/app/code/Magento/Quote/etc/acl.xml b/app/code/Magento/Quote/etc/acl.xml index 14792adfa7170110bfc1da6dd6c6c6c347686f87..f0a2f1ff04dd88ee4cf5a6e3c5b8fc5c3ad91b5d 100644 --- a/app/code/Magento/Quote/etc/acl.xml +++ b/app/code/Magento/Quote/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/app/code/Magento/Quote/etc/adminhtml/events.xml b/app/code/Magento/Quote/etc/adminhtml/events.xml index 02eec1aefb67182a2a1c8e681ef1b2187589829f..02753fc7ca5a3bc9fd40489d4767738dee4dbe91 100644 --- a/app/code/Magento/Quote/etc/adminhtml/events.xml +++ b/app/code/Magento/Quote/etc/adminhtml/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="customer_save_after_data_object"> <observer name="customer" instance="Magento\Quote\Observer\Backend\CustomerQuoteObserver" method="execute" /> </event> diff --git a/app/code/Magento/Quote/etc/di.xml b/app/code/Magento/Quote/etc/di.xml index 278663b7f0ff04b08d5a1bb60309adc92c0b6b81..ee019938630cd07de12addcf812a0f856a038ddf 100644 --- a/app/code/Magento/Quote/etc/di.xml +++ b/app/code/Magento/Quote/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Quote\Api\ShippingMethodManagementInterface" type="Magento\Quote\Model\ShippingMethodManagement" /> <preference for="Magento\Quote\Api\Data\ShippingMethodInterface" type="Magento\Quote\Model\Cart\ShippingMethod" /> <preference for="Magento\Quote\Api\BillingAddressManagementInterface" type="Magento\Quote\Model\BillingAddressManagement" /> diff --git a/app/code/Magento/Quote/etc/events.xml b/app/code/Magento/Quote/etc/events.xml index 5a3fc46e9856847636c5ad5c054ef140ffe52fab..a7f860139cb3efa6fbdecaeeb31068f1b1232f95 100644 --- a/app/code/Magento/Quote/etc/events.xml +++ b/app/code/Magento/Quote/etc/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="sales_quote_address_collect_totals_before"> <observer name="sales_customer_validate_vat_number" instance="Magento\Quote\Observer\Frontend\Quote\Address\CollectTotalsObserver" method="execute" /> </event> diff --git a/app/code/Magento/Quote/etc/fieldset.xml b/app/code/Magento/Quote/etc/fieldset.xml index aa695aadc4214d3f89f454ee00385157fa212a88..663514a0f477dfd491ca424e2e0943e47f9686f6 100644 --- a/app/code/Magento/Quote/etc/fieldset.xml +++ b/app/code/Magento/Quote/etc/fieldset.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/DataObject/etc/fieldset.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:framework:DataObject/etc/fieldset.xsd"> <scope id="global"> <fieldset id="quote_convert_address"> <field name="weight"> diff --git a/app/code/Magento/Quote/etc/module.xml b/app/code/Magento/Quote/etc/module.xml index 81d8176a9ba36c4d062f692f88460e6098d5fd8a..4959497fc2c815b0d6d693d12c3d23e95f0474b5 100644 --- a/app/code/Magento/Quote/etc/module.xml +++ b/app/code/Magento/Quote/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Quote" setup_version="2.0.0"> </module> </config> diff --git a/app/code/Magento/Quote/etc/sales.xml b/app/code/Magento/Quote/etc/sales.xml index 83aab3259f7886b13caf6a04f16080e40173a6a9..593c1bf0aad3abcd405eb2f7c016223181fbef2a 100644 --- a/app/code/Magento/Quote/etc/sales.xml +++ b/app/code/Magento/Quote/etc/sales.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Sales/etc/sales.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Sales:etc/sales.xsd"> <section name="quote"> <group name="totals"> <item name="subtotal" instance="Magento\Quote\Model\Quote\Address\Total\Subtotal" sort_order="100"/> diff --git a/app/code/Magento/Quote/etc/webapi.xml b/app/code/Magento/Quote/etc/webapi.xml index 0f47d472beeebb6fca12f391ef94a6a0ae416fb5..51edb6dc074a6afe71303e627128ba2470302f1d 100644 --- a/app/code/Magento/Quote/etc/webapi.xml +++ b/app/code/Magento/Quote/etc/webapi.xml @@ -6,7 +6,7 @@ */ --> <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../app/code/Magento/Webapi/etc/webapi.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd"> <!-- Managing Cart --> <route url="/V1/carts/:cartId" method="GET"> diff --git a/app/code/Magento/Quote/etc/webapi_rest/events.xml b/app/code/Magento/Quote/etc/webapi_rest/events.xml index debc4afda41176b87d49df136d46300ff2d8bbe7..a0406c95e24e74a29f37b5864ba1c5e734a08206 100644 --- a/app/code/Magento/Quote/etc/webapi_rest/events.xml +++ b/app/code/Magento/Quote/etc/webapi_rest/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="sales_model_service_quote_submit_success"> <observer name="sendEmail" instance="Magento\Quote\Observer\Webapi\SubmitObserver" method="execute" /> </event> diff --git a/app/code/Magento/Quote/etc/webapi_soap/events.xml b/app/code/Magento/Quote/etc/webapi_soap/events.xml index debc4afda41176b87d49df136d46300ff2d8bbe7..a0406c95e24e74a29f37b5864ba1c5e734a08206 100644 --- a/app/code/Magento/Quote/etc/webapi_soap/events.xml +++ b/app/code/Magento/Quote/etc/webapi_soap/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="sales_model_service_quote_submit_success"> <observer name="sendEmail" instance="Magento\Quote\Observer\Webapi\SubmitObserver" method="execute" /> </event> diff --git a/app/code/Magento/Quote/registration.php b/app/code/Magento/Quote/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..b8005a355dc2d1c8619c53465ae368f7e02b94f7 --- /dev/null +++ b/app/code/Magento/Quote/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Quote', + __DIR__ +); diff --git a/app/code/Magento/Reports/Model/Config.php b/app/code/Magento/Reports/Model/Config.php index 6de1405b5bbeb9c3394e51de8ec53e49cb3ae284..d43ad57fe0c427d2fa997a61332720730ef5a790 100644 --- a/app/code/Magento/Reports/Model/Config.php +++ b/app/code/Magento/Reports/Model/Config.php @@ -5,6 +5,8 @@ */ namespace Magento\Reports\Model; +use Magento\Framework\Module\Dir; + /** * Configuration for reports */ @@ -43,7 +45,7 @@ class Config extends \Magento\Framework\DataObject public function getGlobalConfig() { $dom = new \DOMDocument(); - $dom->load($this->_moduleReader->getModuleDir('etc', 'Magento_Reports') . '/flexConfig.xml'); + $dom->load($this->_moduleReader->getModuleDir(Dir::MODULE_ETC_DIR, 'Magento_Reports') . '/flexConfig.xml'); $baseUrl = $dom->createElement('baseUrl'); $baseUrl->nodeValue = $this->_storeManager->getBaseUrl(); @@ -60,7 +62,9 @@ class Config extends \Magento\Framework\DataObject */ public function getLanguage() { - return file_get_contents($this->_moduleReader->getModuleDir('etc', 'Magento_Reports') . '/flexLanguage.xml'); + return file_get_contents( + $this->_moduleReader->getModuleDir(Dir::MODULE_ETC_DIR, 'Magento_Reports') . '/flexLanguage.xml' + ); } /** @@ -70,6 +74,8 @@ class Config extends \Magento\Framework\DataObject */ public function getDashboard() { - return file_get_contents($this->_moduleReader->getModuleDir('etc', 'Magento_Reports') . '/flexDashboard.xml'); + return file_get_contents( + $this->_moduleReader->getModuleDir(Dir::MODULE_ETC_DIR, 'Magento_Reports') . '/flexDashboard.xml' + ); } } diff --git a/app/code/Magento/Reports/composer.json b/app/code/Magento/Reports/composer.json index 38a4d54f9e7ade220063dd39584897db5078febd..4b800c5641eff879478a01dc27b5df3dc8e88650 100644 --- a/app/code/Magento/Reports/composer.json +++ b/app/code/Magento/Reports/composer.json @@ -19,8 +19,7 @@ "magento/module-downloadable": "1.0.0-beta", "magento/module-sales-rule": "1.0.0-beta", "magento/module-quote": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -28,12 +27,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Reports" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Reports\\": "" + } } } diff --git a/app/code/Magento/Reports/etc/acl.xml b/app/code/Magento/Reports/etc/acl.xml index ae98c5498e2e8a0f334e6f0eb415cb7ed250b1a3..834fcdc528545f48bf118741349507b57b99a3a2 100644 --- a/app/code/Magento/Reports/etc/acl.xml +++ b/app/code/Magento/Reports/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/app/code/Magento/Reports/etc/adminhtml/di.xml b/app/code/Magento/Reports/etc/adminhtml/di.xml index 501cf4af2be2841f221c9cd7cb238c8326ed296c..95597b3b46e0176e9112c67e2d5ca11c362bca7e 100644 --- a/app/code/Magento/Reports/etc/adminhtml/di.xml +++ b/app/code/Magento/Reports/etc/adminhtml/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Reports\Model\Resource\Customer\Collection"> <arguments> <argument name="modelName" xsi:type="string">Magento\Customer\Model\Backend\Customer</argument> diff --git a/app/code/Magento/Reports/etc/adminhtml/menu.xml b/app/code/Magento/Reports/etc/adminhtml/menu.xml index 6d503e8d1e15c2117220f45829308c101f398684..7cdfecfab1b490e9648bb73c468d1915d7358f9a 100644 --- a/app/code/Magento/Reports/etc/adminhtml/menu.xml +++ b/app/code/Magento/Reports/etc/adminhtml/menu.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Backend/etc/menu.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd"> <menu> <add id="Magento_Reports::report" title="Reports" module="Magento_Reports" sortOrder="60" resource="Magento_Reports::report"/> <add id="Magento_Reports::report_marketing" title="Marketing" module="Magento_Backend" sortOrder="10" parent="Magento_Reports::report" resource="Magento_Reports::report_marketing"/> diff --git a/app/code/Magento/Reports/etc/adminhtml/routes.xml b/app/code/Magento/Reports/etc/adminhtml/routes.xml index 825af0ae0bcdd6dcf56b1c50dfdc59dd68f7cc2e..a4c9d30ba116df8e699ed87323c2c14f07e61d7e 100644 --- a/app/code/Magento/Reports/etc/adminhtml/routes.xml +++ b/app/code/Magento/Reports/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="admin"> <route id="reports" frontName="reports"> <module name="Magento_Reports" before="Magento_Reports" /> diff --git a/app/code/Magento/Reports/etc/adminhtml/system.xml b/app/code/Magento/Reports/etc/adminhtml/system.xml index 90cd03ad1114fad560438969a3f0521b1290fff7..ecda91c5ef1422c39dc748bb402e6b863cb6a217 100644 --- a/app/code/Magento/Reports/etc/adminhtml/system.xml +++ b/app/code/Magento/Reports/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="catalog"> <group id="recently_products" translate="label" type="text" sortOrder="350" showInDefault="1" showInWebsite="1" showInStore="0"> diff --git a/app/code/Magento/Reports/etc/config.xml b/app/code/Magento/Reports/etc/config.xml index d17146e739d84bf0c22e62bfc25178beec63eac4..cffc66fba72a4c0319052829b0e61571997edeb0 100644 --- a/app/code/Magento/Reports/etc/config.xml +++ b/app/code/Magento/Reports/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <catalog> <recently_products> diff --git a/app/code/Magento/Reports/etc/di.xml b/app/code/Magento/Reports/etc/di.xml index 723c2485c54e08ce288b10d24c2f4f182ddd5742..d530c6c6ec0ad2645dc699d17f619814a3249bbd 100644 --- a/app/code/Magento/Reports/etc/di.xml +++ b/app/code/Magento/Reports/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Customer\Model\Resource\Visitor"> <plugin name="reportLog" type="Magento\Reports\Model\Plugin\Log" /> </type> diff --git a/app/code/Magento/Reports/etc/frontend/events.xml b/app/code/Magento/Reports/etc/frontend/events.xml index 09b1e9f9e89a5b086e1f0b682fb336f862761f42..f50b48b357b11238333c246bf432d25f3e55ec6d 100644 --- a/app/code/Magento/Reports/etc/frontend/events.xml +++ b/app/code/Magento/Reports/etc/frontend/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="catalog_product_compare_remove_product"> <observer name="reports" instance="Magento\Reports\Observer\CatalogProductCompareClearObserver" method="execute" /> </event> diff --git a/app/code/Magento/Reports/etc/module.xml b/app/code/Magento/Reports/etc/module.xml index 1d5b4daa529753a5917318352fc1414d0aa1e11a..d73e9c6d6d4fb0351a9f098c6e04e7895ec2ed67 100644 --- a/app/code/Magento/Reports/etc/module.xml +++ b/app/code/Magento/Reports/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Reports" setup_version="2.0.0"> <sequence> <module name="Magento_Customer"/> diff --git a/app/code/Magento/Reports/etc/webapi_rest/events.xml b/app/code/Magento/Reports/etc/webapi_rest/events.xml index fbe74e5d074321434aff3a4c74ebe3916fcf965b..d9ad2ef3d6ee3266774223844c332332b8278b15 100644 --- a/app/code/Magento/Reports/etc/webapi_rest/events.xml +++ b/app/code/Magento/Reports/etc/webapi_rest/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="sales_quote_item_save_before"> <observer name="reports" instance="Magento\Reports\Observer\CheckoutCartAddProductObserver" method="execute" /> </event> diff --git a/app/code/Magento/Reports/etc/webapi_soap/events.xml b/app/code/Magento/Reports/etc/webapi_soap/events.xml index fbe74e5d074321434aff3a4c74ebe3916fcf965b..d9ad2ef3d6ee3266774223844c332332b8278b15 100644 --- a/app/code/Magento/Reports/etc/webapi_soap/events.xml +++ b/app/code/Magento/Reports/etc/webapi_soap/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="sales_quote_item_save_before"> <observer name="reports" instance="Magento\Reports\Observer\CheckoutCartAddProductObserver" method="execute" /> </event> diff --git a/app/code/Magento/Reports/etc/widget.xml b/app/code/Magento/Reports/etc/widget.xml index ebc4e0365ed26b566eab48f835b5961019fccbdf..8ee4bda2665028e37a8ba462d7e09665b5e96692 100644 --- a/app/code/Magento/Reports/etc/widget.xml +++ b/app/code/Magento/Reports/etc/widget.xml @@ -6,7 +6,7 @@ */ --> <widgets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../Magento/Widget/etc/widget.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Widget:etc/widget.xsd"> <widget id="recently_viewed" class="Magento\Reports\Block\Product\Widget\Viewed" placeholder_image="Magento_Reports::images/product_widget_viewed.gif"> <label translate="true">Recently Viewed Products</label> diff --git a/app/code/Magento/Reports/registration.php b/app/code/Magento/Reports/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..c14d60ba8f79d6233878e4e8829b1f3203eaad8e --- /dev/null +++ b/app/code/Magento/Reports/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Reports', + __DIR__ +); diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_accounts.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_accounts.xml index 065660e111adc2f894ab4cb3f8875245b7a9fb6f..637fe0d8d5b467be712a9717edb72bb51e8a6055 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_accounts.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_accounts.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="reports_report_customer_accounts_grid"/> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_accounts_grid.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_accounts_grid.xml index 114944fadb3cbbbc0cb34a110cad2d55d5af9d50..5bd5c677ca4ee3521b909d8f250c2cf545eddc41 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_accounts_grid.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_accounts_grid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="reports_report_grid"/> <body> <referenceBlock name="adminhtml.report.grid"> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exportaccountscsv.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exportaccountscsv.xml index b670f19feca039bb03eb35d530830854c629141e..899f51066eb82dc8e491200d02faf82ee982180a 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exportaccountscsv.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exportaccountscsv.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="reports_report_customer_accounts_grid"/> <body> <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.report.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exportaccountsexcel.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exportaccountsexcel.xml index b670f19feca039bb03eb35d530830854c629141e..899f51066eb82dc8e491200d02faf82ee982180a 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exportaccountsexcel.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exportaccountsexcel.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="reports_report_customer_accounts_grid"/> <body> <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.report.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exportorderscsv.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exportorderscsv.xml index 01a4f1cd6d3f7da597a235b5f1241bb35f956b98..c45990951fa3d15ab0dc42b0dfa9ca297414ba9b 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exportorderscsv.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exportorderscsv.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="reports_report_customer_orders_grid"/> <body> <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.report.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exportordersexcel.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exportordersexcel.xml index 01a4f1cd6d3f7da597a235b5f1241bb35f956b98..c45990951fa3d15ab0dc42b0dfa9ca297414ba9b 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exportordersexcel.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exportordersexcel.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="reports_report_customer_orders_grid"/> <body> <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.report.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exporttotalscsv.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exporttotalscsv.xml index 26959326b12a12f5313a9e2a31421f8df3b1b153..b67d620d5b202c4264af3c429c519cb2490b3176 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exporttotalscsv.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exporttotalscsv.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="reports_report_customer_totals_grid"/> <body> <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.report.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exporttotalsexcel.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exporttotalsexcel.xml index 26959326b12a12f5313a9e2a31421f8df3b1b153..b67d620d5b202c4264af3c429c519cb2490b3176 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exporttotalsexcel.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_exporttotalsexcel.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="reports_report_customer_totals_grid"/> <body> <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.report.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_orders.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_orders.xml index 5b167f8e6e69f2bef83a3e4cd1d1f2e164674607..dce54adee37e4e411dedefc2f9480b61f84b0d29 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_orders.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_orders.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="reports_report_customer_orders_grid"/> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_orders_grid.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_orders_grid.xml index f85e42526c301e30ad6e552c6adbe4abbec6e5aa..1f3c900ec8d9a25478e048aa421b1f4202eafa68 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_orders_grid.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_orders_grid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="reports_report_grid"/> <body> <referenceBlock name="adminhtml.report.grid"> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_totals.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_totals.xml index 01cbad2b935fc96f1f3a0e171f3f194228c6fcc5..7798671f35c909481d1ead38ab2d3337fd7b875b 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_totals.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_totals.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="reports_report_customer_totals_grid"/> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_totals_grid.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_totals_grid.xml index a014bd1f78c5069283da497102e2aa96c26ac23f..c8f03174d76f88e7966671c7257f3c13ec36932c 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_totals_grid.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_customer_totals_grid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="reports_report_customer_orders_grid"/> <body> <referenceBlock name="adminhtml.report.grid"> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_grid.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_grid.xml index 54e6a1f160b832aeaccbb69bc532f8ad31e7a676..315acc1db5fe902c02ffd377f301a25bf7af0b86 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_grid.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_grid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="page.main.actions"> <block class="Magento\Backend\Block\Store\Switcher" name="adminhtml.report.grid.store_switcher" as="store_switcher"> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_downloads.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_downloads.xml index b52ce88d9258b836f6486857ab3ed3c80cb026a9..859908a14a247522da0d8a53d688e946642b0adc 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_downloads.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_downloads.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="page.main.actions"> <block class="Magento\Backend\Block\Store\Switcher" name="adminhtml.report.product.downloads.store_switcher" template="Magento_Backend::store/switcher.phtml"> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_exportlowstockcsv.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_exportlowstockcsv.xml index 68d488978b641f075ca71611c33dac75eec928c6..a2a52a2706fdc3da0adb141860ed261ca434ca6a 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_exportlowstockcsv.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_exportlowstockcsv.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="reports_report_product_lowstock_grid"/> <body> <container name="adminhtml.block.report.product.lowstock.grid.container" label="Export CSV"/> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_exportlowstockexcel.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_exportlowstockexcel.xml index a701edd0874586926e34466cd554bfddf50783fd..64c601c2dc89738147164d0c33a8a89f41013af7 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_exportlowstockexcel.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_exportlowstockexcel.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="reports_report_product_lowstock_grid"/> <body> <container name="adminhtml.block.report.product.lowstock.grid.container" label="Excel XML"/> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_exportsoldcsv.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_exportsoldcsv.xml index c8782ad6d24e40609bf2094ade9020705c3cb9ef..973199309c9520f2c42f05b9e61384a31dfac5ca 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_exportsoldcsv.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_exportsoldcsv.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="reports_report_product_sold_grid"/> <body> <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.report.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_exportsoldexcel.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_exportsoldexcel.xml index c8782ad6d24e40609bf2094ade9020705c3cb9ef..973199309c9520f2c42f05b9e61384a31dfac5ca 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_exportsoldexcel.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_exportsoldexcel.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="reports_report_product_sold_grid"/> <body> <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.report.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_lowstock.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_lowstock.xml index f700673424b2fa012765e75609c6b5c010c2bcdb..73a2cba554685e426445b39b717032c911cc4fe7 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_lowstock.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_lowstock.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="reports_report_product_lowstock_grid"/> <body> <referenceContainer name="page.main.actions"> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_lowstock_grid.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_lowstock_grid.xml index 50567be0c60d53e1586f6d161fad18c3449652c9..c7602138497dae2ae5d49cda459ccccc6569da02 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_lowstock_grid.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_lowstock_grid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="adminhtml.report.grid.container"> <block class="Magento\Reports\Block\Adminhtml\Product\Lowstock\Grid" name="adminhtml.block.report.product.lowstock.grid" as="grid"> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_sold.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_sold.xml index cb8c0ad1367a8e8e46a00e7ee40f2b79d0f5802c..af43ed74a36f438772d2171f65a52df57087267c 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_sold.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_sold.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="reports_report_product_sold_grid"/> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_sold_grid.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_sold_grid.xml index 20ffd02c9c6dc4be28fc68003f4652e0d7f35c41..cc68c8561851d134b87df8fb827a33ac9c0bc409 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_sold_grid.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_sold_grid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="reports_report_grid"/> <body> <referenceBlock name="adminhtml.report.grid"> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_viewed.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_viewed.xml index fd28a5b1e15edbb99f804fc5fb295e6e5561f881..4f2b211797627e3e07c74752e30ef9d1d2442e7b 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_viewed.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_viewed.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="messages"> <action method="addNotice"> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_customer.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_customer.xml index 8a372f499f8b5524d9fd3d98d60501002d9c09dd..96eee6691b57a4dbf379c0757d359b2292175c81 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_customer.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_customer.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="reports_report_review_customer_grid"/> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_customer_grid.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_customer_grid.xml index ac62783f3aa1a48d5026b919f51838c502099a22..7aefd09f745624bf630bd1ed48f571ad77b5107d 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_customer_grid.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_customer_grid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="adminhtml.report.grid.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.block.report.review.customer.grid" as="grid"> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_exportcustomercsv.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_exportcustomercsv.xml index 38f7da4aada308c5cd897965215d400912d4fe32..13077233a6ac55fe5724103c474e2ef026a037f6 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_exportcustomercsv.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_exportcustomercsv.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="reports_report_review_customer_grid"/> <body> <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.report.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_exportcustomerexcel.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_exportcustomerexcel.xml index 38f7da4aada308c5cd897965215d400912d4fe32..13077233a6ac55fe5724103c474e2ef026a037f6 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_exportcustomerexcel.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_exportcustomerexcel.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="reports_report_review_customer_grid"/> <body> <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.report.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_exportproductcsv.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_exportproductcsv.xml index 1d10ab64b12cd5d495d33740818dcb56d14f1cae..4e775529ccabc441c7685b2402a9267e4e3532e7 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_exportproductcsv.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_exportproductcsv.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="reports_report_review_product_grid"/> <body> <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.report.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_exportproductexcel.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_exportproductexcel.xml index 1d10ab64b12cd5d495d33740818dcb56d14f1cae..4e775529ccabc441c7685b2402a9267e4e3532e7 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_exportproductexcel.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_exportproductexcel.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="reports_report_review_product_grid"/> <body> <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.report.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_product.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_product.xml index 3489353c383dbcf5408c538309758db868883a89..4ccda0840a60aa3ae19dbf3ebc2a9688c2086799 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_product.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_product.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="reports_report_review_product_grid"/> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_product_grid.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_product_grid.xml index 63ecc20aa28b8893acb6f195add2bef33fe07b77..428f1df4fc5b78d0f16497cf1bc9afba537940c6 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_product_grid.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_product_grid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="adminhtml.report.grid.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.block.report.review.product.grid" as="grid"> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_bestsellers.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_bestsellers.xml index c24e5927f0a934dce7e49f9ba614f7b87875fe96..7160664703fa36831a0a589f15718e67438e4618 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_bestsellers.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_bestsellers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="reports_sales"/> <body> <referenceContainer name="page.main.actions"> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_coupons.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_coupons.xml index d9492bf13287413446c5899ed87af1ac5cc55b4a..1fb14b8be19c953631d53eaa12a137236fe64f4a 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_coupons.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_coupons.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="reports_sales"/> <body> <referenceContainer name="page.main.actions"> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_invoiced.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_invoiced.xml index ad48c082cfe6e21b3e2153275c89cd26485b4a64..545e216ba80407c4b952aab658aef9449284afa2 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_invoiced.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_invoiced.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="reports_sales"/> <body> <referenceContainer name="page.main.actions"> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_refunded.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_refunded.xml index 174cbb1960dafa5ff32176c6c219fd85875d628a..f4f4b5ea1bbefbdd816af71826cd2570c7fef7dc 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_refunded.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_refunded.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="reports_sales"/> <body> <referenceContainer name="page.main.actions"> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_sales.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_sales.xml index b4ce0c4f80af034e0358c518e358e5ac15099e89..e1a4a05b2c0f318733f46cf9aeb9d97a58f88ead 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_sales.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_sales.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="reports_sales"/> <body> <referenceContainer name="page.main.actions"> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_shipping.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_shipping.xml index c959aef4d9c7cd9a6f671fd4321b15273d81a7cc..bf1827769e454ce0de1fc1692b0f40cf5760c4b7 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_shipping.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_shipping.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="reports_sales"/> <body> <referenceContainer name="page.main.actions"> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_tax.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_tax.xml index 09b29d402578de8d016e0b708da8855f3fbbcb69..3f040258ef7c0453ecdb0f2434349cef97ddeae0 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_tax.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_sales_tax.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="reports_sales"/> <body> <referenceContainer name="page.main.actions"> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_shopcart_abandoned.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_shopcart_abandoned.xml index 57c9e984f397db3f004e11ac93138b5e183ae8b4..edbbdab894e056df964c236d02144f63268f1d9b 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_shopcart_abandoned.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_shopcart_abandoned.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="page.main.actions"> <block class="Magento\Backend\Block\Store\Switcher" name="adminhtml.report.shopcart.abandoned.store_switcher"> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_statistics_index.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_statistics_index.xml index 23ae6eece72ea06a4f257280f5db6eafdac92a7b..3a3be1ebae5c172a690ceb93e46d17bc62c9f020 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_statistics_index.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_statistics_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Reports\Block\Adminhtml\Refresh\Statistics" name="adminhtml.block.report.refresh.statistics"> diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_sales.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_sales.xml index e0f2f895b510d22d78394c19ae11545268fb25cd..64fec87e18550052ab1fb5dbfc646a3c8ade990f 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_sales.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_sales.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="messages"> <action method="addNotice"> diff --git a/app/code/Magento/Reports/view/frontend/layout/default.xml b/app/code/Magento/Reports/view/frontend/layout/default.xml index 48ae8662050a1328ec3e6c7902116354e24875bf..0674460be8b31ea86d5d05fdb76dee9a5601d4d0 100644 --- a/app/code/Magento/Reports/view/frontend/layout/default.xml +++ b/app/code/Magento/Reports/view/frontend/layout/default.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="head.components"> <block class="Magento\Framework\View\Element\Js\Components" name="reports_page_head_components" template="Magento_Reports::js/components.phtml"/> diff --git a/app/code/Magento/Reports/view/frontend/layout/print.xml b/app/code/Magento/Reports/view/frontend/layout/print.xml index a024d6e563cb581c15476d71430b89f2dd05ea36..44eec0b583d14104b76b334e2395d72d5b2bf778 100644 --- a/app/code/Magento/Reports/view/frontend/layout/print.xml +++ b/app/code/Magento/Reports/view/frontend/layout/print.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body/> </page> diff --git a/app/code/Magento/RequireJs/composer.json b/app/code/Magento/RequireJs/composer.json index cbc078086ee4fe231d52a2ec43c47ba63ea30bb8..1546985c9bf76990d7f5a3eb0fb722a32209af80 100644 --- a/app/code/Magento/RequireJs/composer.json +++ b/app/code/Magento/RequireJs/composer.json @@ -3,8 +3,7 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0|~7.0.0", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -12,12 +11,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/RequireJs" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\RequireJs\\": "" + } } } diff --git a/app/code/Magento/RequireJs/etc/di.xml b/app/code/Magento/RequireJs/etc/di.xml index 305fa59d47e1840a5ee3cc1c60751d35f86ba781..56b3efab550ce027b911bdef12a8733c2a0c2ad0 100644 --- a/app/code/Magento/RequireJs/etc/di.xml +++ b/app/code/Magento/RequireJs/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <virtualType name="requirejsConfigFileSourceBaseFiltered" type="Magento\Framework\View\File\Collector\Decorator\ModuleOutput"> <arguments> <argument name="subject" xsi:type="object">Magento\Framework\View\File\Collector\Base</argument> diff --git a/app/code/Magento/RequireJs/etc/module.xml b/app/code/Magento/RequireJs/etc/module.xml index e9545774fa3ab06e7872fa04fce409941126efda..b3ff66b486a583e6dd0fec412746b79f4f6cdeae 100644 --- a/app/code/Magento/RequireJs/etc/module.xml +++ b/app/code/Magento/RequireJs/etc/module.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_RequireJs" setup_version="2.0.0"/> </config> diff --git a/app/code/Magento/RequireJs/registration.php b/app/code/Magento/RequireJs/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..26b2e8a0ce72fd93139646ae439bc5ddafcabda7 --- /dev/null +++ b/app/code/Magento/RequireJs/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_RequireJs', + __DIR__ +); diff --git a/app/code/Magento/Review/composer.json b/app/code/Magento/Review/composer.json index 85b75d6253018b018eaf29f752a57ae11c81eccb..e5c9d935201561f33f3425a3683fba183a3021ff 100644 --- a/app/code/Magento/Review/composer.json +++ b/app/code/Magento/Review/composer.json @@ -11,8 +11,7 @@ "magento/module-backend": "1.0.0-beta", "magento/module-newsletter": "1.0.0-beta", "magento/framework": "1.0.0-beta", - "magento/module-ui": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/module-ui": "1.0.0-beta" }, "suggest": { "magento/module-cookie": "1.0.0-beta" @@ -23,12 +22,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Review" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Review\\": "" + } } } diff --git a/app/code/Magento/Review/etc/acl.xml b/app/code/Magento/Review/etc/acl.xml index cee078f9e9bac481dc10ed1f5411b41f4326cd91..ed1e37e4a53256d3cbe582b751b65ea614dfe53c 100644 --- a/app/code/Magento/Review/etc/acl.xml +++ b/app/code/Magento/Review/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/app/code/Magento/Review/etc/adminhtml/di.xml b/app/code/Magento/Review/etc/adminhtml/di.xml index 1c7aa113dc89b3a5a417e72dc22205a8b497a395..a5009cd8f6fdf1ac884722c16894ae1f34286ec4 100644 --- a/app/code/Magento/Review/etc/adminhtml/di.xml +++ b/app/code/Magento/Review/etc/adminhtml/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Review\Block\Adminhtml\Rating\Edit\Tab\Form"> <arguments> <argument name="session" xsi:type="object">Magento\Backend\Model\Session</argument> diff --git a/app/code/Magento/Review/etc/adminhtml/events.xml b/app/code/Magento/Review/etc/adminhtml/events.xml index 2e071126f6c8c353ad280c30421b3ab59c401ca8..8208e69e447ae104f9e028d6431309b8b1bd0878 100644 --- a/app/code/Magento/Review/etc/adminhtml/events.xml +++ b/app/code/Magento/Review/etc/adminhtml/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="catalog_product_delete_after_done"> <observer name="review" instance="Magento\Review\Observer\ProcessProductAfterDeleteEventObserver" method="execute" /> </event> diff --git a/app/code/Magento/Review/etc/adminhtml/menu.xml b/app/code/Magento/Review/etc/adminhtml/menu.xml index 6866ec5b6cd89bc58eed37889e915a8e7f261090..efe0000761a348d29232a3953404fe047c613544 100644 --- a/app/code/Magento/Review/etc/adminhtml/menu.xml +++ b/app/code/Magento/Review/etc/adminhtml/menu.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Backend/etc/menu.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd"> <menu> <add id="Magento_Review::catalog_reviews_ratings_ratings" title="Rating" module="Magento_Review" sortOrder="60" parent="Magento_Backend::stores_attributes" action="review/rating/" resource="Magento_Review::ratings"/> <add id="Magento_Review::catalog_reviews_ratings_reviews_all" title="Reviews" module="Magento_Review" parent="Magento_Backend::marketing_user_content" sortOrder="10" action="review/product/index" resource="Magento_Review::reviews_all"/> diff --git a/app/code/Magento/Review/etc/adminhtml/routes.xml b/app/code/Magento/Review/etc/adminhtml/routes.xml index 315fc496873873cc8a0767cdd259e32f86bb63f8..26403ba8f973cfd621ff640c4032996ba4b3d483 100644 --- a/app/code/Magento/Review/etc/adminhtml/routes.xml +++ b/app/code/Magento/Review/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn: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/adminhtml/system.xml b/app/code/Magento/Review/etc/adminhtml/system.xml index af23099813e3649c93b6f862659969173cd0a420..e424011a30cb5dac168bff7409d75d35dc9216ac 100644 --- a/app/code/Magento/Review/etc/adminhtml/system.xml +++ b/app/code/Magento/Review/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="catalog"> <group id="review" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="0"> diff --git a/app/code/Magento/Review/etc/config.xml b/app/code/Magento/Review/etc/config.xml index 1e46875b6f3d5b5d7039771ee813f121bacbc029..83faf996f4b7aaef0eaaf2abe9b0066c865e623c 100644 --- a/app/code/Magento/Review/etc/config.xml +++ b/app/code/Magento/Review/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <catalog> <review> diff --git a/app/code/Magento/Review/etc/di.xml b/app/code/Magento/Review/etc/di.xml index 5e8227126a3581dfa21a02aa1ae9bc56873fd03e..371c7e47b6926445b2fd87d9f9603247e23ed473 100644 --- a/app/code/Magento/Review/etc/di.xml +++ b/app/code/Magento/Review/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Catalog\Block\Product\ReviewRendererInterface" type="Magento\Review\Block\Product\ReviewRenderer" /> <type name="Magento\Framework\Model\ActionValidator\RemoveAction"> <arguments> diff --git a/app/code/Magento/Review/etc/frontend/di.xml b/app/code/Magento/Review/etc/frontend/di.xml index b444231bbdb87b2798e2f9cd80b88e5a767a9d7d..f06873aade7d601375072d9f14282f91c8bf4a3c 100644 --- a/app/code/Magento/Review/etc/frontend/di.xml +++ b/app/code/Magento/Review/etc/frontend/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <virtualType name="Magento\Review\Model\Session\Storage" type="Magento\Framework\Session\Storage"> <arguments> <argument name="namespace" xsi:type="string">review</argument> diff --git a/app/code/Magento/Review/etc/frontend/events.xml b/app/code/Magento/Review/etc/frontend/events.xml index f2a73f7b262aeced56996f1b3a9f35ce010eb7c4..3a048b5c5092125ee152087374e95aabc22083d5 100644 --- a/app/code/Magento/Review/etc/frontend/events.xml +++ b/app/code/Magento/Review/etc/frontend/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="tag_tag_product_collection_load_after"> <observer name="review" instance="Magento\Review\Observer\TagProductCollectionLoadAfterObserver" method="execute" shared="false" /> </event> diff --git a/app/code/Magento/Review/etc/frontend/page_types.xml b/app/code/Magento/Review/etc/frontend/page_types.xml index 63fc47b5e2400951e22f07e860cd19cabb7dc541..0fdfc45f9eb90dee228c0c25422f53014590cf7f 100644 --- a/app/code/Magento/Review/etc/frontend/page_types.xml +++ b/app/code/Magento/Review/etc/frontend/page_types.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page_types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_types.xsd"> +<page_types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_types.xsd"> <type id="review_customer_index" label="Customer My Account Product Reviews"/> <type id="review_customer_view" label="Customer My Account Review Details"/> <type id="review_product_list" label="Catalog Product Reviews List"/> diff --git a/app/code/Magento/Review/etc/frontend/routes.xml b/app/code/Magento/Review/etc/frontend/routes.xml index 52ea860b272f8a34998b477fb3a3eb58ffd88095..36871bb382d38932b140458b18229508212aa84d 100644 --- a/app/code/Magento/Review/etc/frontend/routes.xml +++ b/app/code/Magento/Review/etc/frontend/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn: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/etc/frontend/sections.xml b/app/code/Magento/Review/etc/frontend/sections.xml index b012be172efd3d2ea5d731a1f8f7185f935bfe10..e0ba8e8d229668458aaed64164b373f7acc484f9 100644 --- a/app/code/Magento/Review/etc/frontend/sections.xml +++ b/app/code/Magento/Review/etc/frontend/sections.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../Magento/Customer/etc/sections.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd"> <action name="review/product/post"> <section name="review"/> </action> diff --git a/app/code/Magento/Review/etc/module.xml b/app/code/Magento/Review/etc/module.xml index 226eb11213df86f11563660935e6075c5767608c..4d2c6d02d62d172dcd17252bec10cb6cf8d2373c 100644 --- a/app/code/Magento/Review/etc/module.xml +++ b/app/code/Magento/Review/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Review" setup_version="2.0.0"> <sequence> <module name="Magento_Catalog"/> diff --git a/app/code/Magento/Review/registration.php b/app/code/Magento/Review/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..cedf01574e13c0b174d0074b3647b3ac70862f0e --- /dev/null +++ b/app/code/Magento/Review/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Review', + __DIR__ +); diff --git a/app/code/Magento/Review/view/adminhtml/layout/catalog_product_new.xml b/app/code/Magento/Review/view/adminhtml/layout/catalog_product_new.xml index f72ea0c0b0171470c7c496b2f3acc59f9e76c657..f611d437f4360ff0207eefcbd3fa13fc9b127c83 100644 --- a/app/code/Magento/Review/view/adminhtml/layout/catalog_product_new.xml +++ b/app/code/Magento/Review/view/adminhtml/layout/catalog_product_new.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="product_tabs"> <block class="Magento\Review\Block\Adminhtml\Product\Edit\Tab" name="product.reviews"> diff --git a/app/code/Magento/Review/view/adminhtml/layout/customer_index_edit.xml b/app/code/Magento/Review/view/adminhtml/layout/customer_index_edit.xml index a6fe4a094eb0f1425af6a7dcf876f619ce58d1c1..d449711dd1449e17c8d37d3d5f338c1f94408ea1 100644 --- a/app/code/Magento/Review/view/adminhtml/layout/customer_index_edit.xml +++ b/app/code/Magento/Review/view/adminhtml/layout/customer_index_edit.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="customer_form"> <block acl="Magento_Review::reviews_all" class="Magento\Review\Block\Adminhtml\ReviewTab" name="reviews" /> 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 2579220766fdd3747f3607af59a77215d5777e53..5cd89d58feedf232d1b25d5f2b96f15fa8fb2f4b 100644 --- a/app/code/Magento/Review/view/adminhtml/layout/rating_block.xml +++ b/app/code/Magento/Review/view/adminhtml/layout/rating_block.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="adminhtml.rating.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.rating.grid" as="grid"> diff --git a/app/code/Magento/Review/view/adminhtml/layout/review_product_edit.xml b/app/code/Magento/Review/view/adminhtml/layout/review_product_edit.xml index a6fcdd47c60833ccb33d5b11e64b84a6e4fe02d2..72925e2b67ed663ad7f3da5b7b1d528bc636a763 100644 --- a/app/code/Magento/Review/view/adminhtml/layout/review_product_edit.xml +++ b/app/code/Magento/Review/view/adminhtml/layout/review_product_edit.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="review_product_new"/> <body/> </page> diff --git a/app/code/Magento/Review/view/adminhtml/layout/review_product_index.xml b/app/code/Magento/Review/view/adminhtml/layout/review_product_index.xml index ebdd38cabfc28651f087b6a361cbf7ee3afd3515..eb9a2e24a687d79c4af6c48d9b726e68c9a1d30c 100644 --- a/app/code/Magento/Review/view/adminhtml/layout/review_product_index.xml +++ b/app/code/Magento/Review/view/adminhtml/layout/review_product_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="adminhtml.grid"> <block class="Magento\Framework\View\Element\Text\ListText" name="grid.bottom.links"> diff --git a/app/code/Magento/Review/view/adminhtml/layout/review_product_reviews_grid.xml b/app/code/Magento/Review/view/adminhtml/layout/review_product_reviews_grid.xml index b24b455bfeeaab7f471c5a0abfb173cf52f6ee30..b18c3f370916499c26b6a92ffa8602bfcec37219 100644 --- a/app/code/Magento/Review/view/adminhtml/layout/review_product_reviews_grid.xml +++ b/app/code/Magento/Review/view/adminhtml/layout/review_product_reviews_grid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root" label="Root"> <block class="Magento\Review\Block\Adminhtml\Product\Edit\Tab\Reviews" name="admin.product.reviews"/> </container> diff --git a/app/code/Magento/Review/view/adminhtml/layout/review_rating_edit.xml b/app/code/Magento/Review/view/adminhtml/layout/review_rating_edit.xml index 0ad93985a539b13718a6e59974de103ef9dbdb7c..b10a3d99d806a9f51cf2d6dff57b4ff63cbfeed2 100644 --- a/app/code/Magento/Review/view/adminhtml/layout/review_rating_edit.xml +++ b/app/code/Magento/Review/view/adminhtml/layout/review_rating_edit.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body/> </page> diff --git a/app/code/Magento/Review/view/adminhtml/layout/review_rating_index.xml b/app/code/Magento/Review/view/adminhtml/layout/review_rating_index.xml index cc094bb71c6a5f044a042c8f8aeec96fd14db175..a7176a73472c869b8c775335922439f79baa15df 100644 --- a/app/code/Magento/Review/view/adminhtml/layout/review_rating_index.xml +++ b/app/code/Magento/Review/view/adminhtml/layout/review_rating_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="formkey"/> <update handle="rating_block"/> <body> diff --git a/app/code/Magento/Review/view/frontend/layout/catalog_product_view.xml b/app/code/Magento/Review/view/frontend/layout/catalog_product_view.xml index b93a6ed208516b87f7c701e7fd740fd3ebbb9cde..9d61a57735ffee172f0a2c5428b33497fe9c0abd 100644 --- a/app/code/Magento/Review/view/frontend/layout/catalog_product_view.xml +++ b/app/code/Magento/Review/view/frontend/layout/catalog_product_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="review_product_form_component"/> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/Review/view/frontend/layout/checkout_cart_configure.xml b/app/code/Magento/Review/view/frontend/layout/checkout_cart_configure.xml index 43629e6e94da8cf7c3168e390ab9e7427ea7d39e..1403455e9661ad81f435af6386ac3e59f9c14aac 100644 --- a/app/code/Magento/Review/view/frontend/layout/checkout_cart_configure.xml +++ b/app/code/Magento/Review/view/frontend/layout/checkout_cart_configure.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="catalog_product_view"/> <body> <referenceBlock name="reviews.tab"> diff --git a/app/code/Magento/Review/view/frontend/layout/customer_account.xml b/app/code/Magento/Review/view/frontend/layout/customer_account.xml index aea26a160b85ee2196e64e9b3c0ebfaa0a5c7962..fcc7ce35bad97c27c45837fecf60129c2715b9bb 100644 --- a/app/code/Magento/Review/view/frontend/layout/customer_account.xml +++ b/app/code/Magento/Review/view/frontend/layout/customer_account.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="customer_account_navigation"> <block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-navigation-product-reviews-link"> diff --git a/app/code/Magento/Review/view/frontend/layout/customer_account_index.xml b/app/code/Magento/Review/view/frontend/layout/customer_account_index.xml index 799a455f7e0f463ec93837c756085fbd45cfb0f8..9d82c9563bc60e34ba4e7aad3b99c86cf6f0a3ae 100644 --- a/app/code/Magento/Review/view/frontend/layout/customer_account_index.xml +++ b/app/code/Magento/Review/view/frontend/layout/customer_account_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Review\Block\Customer\Recent" name="customer_account_dashboard_info1" template="customer/recent.phtml" after="customer_account_dashboard_address" cacheable="false"/> diff --git a/app/code/Magento/Review/view/frontend/layout/review_customer_index.xml b/app/code/Magento/Review/view/frontend/layout/review_customer_index.xml index 01a6340b9f2bc125783abc69f20482a0abae4b59..33b07f4352d73caac469f4e3c292e25816e471bd 100644 --- a/app/code/Magento/Review/view/frontend/layout/review_customer_index.xml +++ b/app/code/Magento/Review/view/frontend/layout/review_customer_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="customer_account"/> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/Review/view/frontend/layout/review_customer_view.xml b/app/code/Magento/Review/view/frontend/layout/review_customer_view.xml index 43e7ba2afa619b3219ee10e1a3d447dd0259ee13..70e3f1543ae5360c9aae0a2526c14c85278b1eb6 100644 --- a/app/code/Magento/Review/view/frontend/layout/review_customer_view.xml +++ b/app/code/Magento/Review/view/frontend/layout/review_customer_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="customer_account"/> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/Review/view/frontend/layout/review_product_form_component.xml b/app/code/Magento/Review/view/frontend/layout/review_product_form_component.xml index 48416d9b9d85bb6ac1aa6f9b766c66c6c0bfd960..b6284199d0ecfb7f6d58802dd11410ea288a5133 100644 --- a/app/code/Magento/Review/view/frontend/layout/review_product_form_component.xml +++ b/app/code/Magento/Review/view/frontend/layout/review_product_form_component.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="product.review.form"> <arguments> diff --git a/app/code/Magento/Review/view/frontend/layout/review_product_list.xml b/app/code/Magento/Review/view/frontend/layout/review_product_list.xml index f42130d5249553cc33cd9dacdd85a439c53c1078..0ca0bbdfe1abcc3e08940eefc137638bbda5b00a 100644 --- a/app/code/Magento/Review/view/frontend/layout/review_product_list.xml +++ b/app/code/Magento/Review/view/frontend/layout/review_product_list.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="catalog_product_view"/> <body> <referenceContainer name="product.info.main"> diff --git a/app/code/Magento/Review/view/frontend/layout/review_product_listajax.xml b/app/code/Magento/Review/view/frontend/layout/review_product_listajax.xml index 0f950489f8aae9dc1c8c8405a6c1c7a5adbf076a..dc9e7a6dd96580f9c3e51f73a514cdc3fd6aaeda 100644 --- a/app/code/Magento/Review/view/frontend/layout/review_product_listajax.xml +++ b/app/code/Magento/Review/view/frontend/layout/review_product_listajax.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root"> <block class="Magento\Review\Block\Product\View\ListView" name="product.info.product_additional_data" as="product_additional_data" template="product/view/list.phtml" /> <block class="Magento\Theme\Block\Html\Pager" name="product_review_list.toolbar"> diff --git a/app/code/Magento/Review/view/frontend/layout/review_product_view.xml b/app/code/Magento/Review/view/frontend/layout/review_product_view.xml index 6290f4f9943f3e9ec578f337007d794ddb30cbad..7c7109ed41ffe0f32d5dbcb904b78192228de7d4 100644 --- a/app/code/Magento/Review/view/frontend/layout/review_product_view.xml +++ b/app/code/Magento/Review/view/frontend/layout/review_product_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Review\Block\View" name="review_view"/> diff --git a/app/code/Magento/Review/view/frontend/layout/wishlist_index_configure.xml b/app/code/Magento/Review/view/frontend/layout/wishlist_index_configure.xml index 43629e6e94da8cf7c3168e390ab9e7427ea7d39e..1403455e9661ad81f435af6386ac3e59f9c14aac 100644 --- a/app/code/Magento/Review/view/frontend/layout/wishlist_index_configure.xml +++ b/app/code/Magento/Review/view/frontend/layout/wishlist_index_configure.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="catalog_product_view"/> <body> <referenceBlock name="reviews.tab"> diff --git a/app/code/Magento/Rss/composer.json b/app/code/Magento/Rss/composer.json index cecfb00adba6000901f8e4394983e660ca5d15f8..9448ca35196a394b5ad124b4ab6b7e26fc08feff 100644 --- a/app/code/Magento/Rss/composer.json +++ b/app/code/Magento/Rss/composer.json @@ -6,8 +6,7 @@ "magento/module-store": "1.0.0-beta", "magento/module-backend": "1.0.0-beta", "magento/framework": "1.0.0-beta", - "magento/module-customer": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/module-customer": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -15,12 +14,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Rss" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Rss\\": "" + } } } diff --git a/app/code/Magento/Rss/etc/acl.xml b/app/code/Magento/Rss/etc/acl.xml index 1f34377c1550c509a64f6950ef72d1ef11cdc99c..99402b2743e565794781f2bdc78a29b3ecfebd96 100644 --- a/app/code/Magento/Rss/etc/acl.xml +++ b/app/code/Magento/Rss/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/app/code/Magento/Rss/etc/adminhtml/di.xml b/app/code/Magento/Rss/etc/adminhtml/di.xml index fb913f91fb8f9417326aa3714384ec4e75a22f7a..3943720f7f5e6740f190342b0474a544c68f70df 100644 --- a/app/code/Magento/Rss/etc/adminhtml/di.xml +++ b/app/code/Magento/Rss/etc/adminhtml/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Rss\Controller\Adminhtml\Feed\Index"> <plugin name="adminAuthentication" type="Magento\Rss\App\Action\Plugin\BackendAuthentication"/> </type> diff --git a/app/code/Magento/Rss/etc/adminhtml/routes.xml b/app/code/Magento/Rss/etc/adminhtml/routes.xml index ccb2f2ebc18e03f8f623d9eb1fda5b889d4cbe4c..87449528dec01c97fad5030e8eff5b0b5409c47c 100644 --- a/app/code/Magento/Rss/etc/adminhtml/routes.xml +++ b/app/code/Magento/Rss/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="admin"> <route id="rss" frontName="rss"> <module name="Magento_Rss" before="Magento_Backend" /> diff --git a/app/code/Magento/Rss/etc/adminhtml/system.xml b/app/code/Magento/Rss/etc/adminhtml/system.xml index 327e88f8a13c5481297858746e61fd08d01bcaa2..ac11ee067906485590f321e3c5e356775a322c5c 100644 --- a/app/code/Magento/Rss/etc/adminhtml/system.xml +++ b/app/code/Magento/Rss/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="rss" translate="label" type="text" sortOrder="80" showInDefault="1" showInWebsite="1" showInStore="1"> <label>RSS Feeds</label> diff --git a/app/code/Magento/Rss/etc/di.xml b/app/code/Magento/Rss/etc/di.xml index fbc78c7c649e998103f5106b1dbbaac6c051aec7..8da2fb038f49c39a4a8352f1b839c6ca2e840413 100644 --- a/app/code/Magento/Rss/etc/di.xml +++ b/app/code/Magento/Rss/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Framework\App\Rss\RssManagerInterface" type="Magento\Rss\Model\RssManager"/> <preference for="Magento\Framework\App\Rss\UrlBuilderInterface" type="Magento\Rss\Model\UrlBuilder"/> </config> diff --git a/app/code/Magento/Rss/etc/frontend/page_types.xml b/app/code/Magento/Rss/etc/frontend/page_types.xml index f834bd2faf9f9ccd1fa13abd01929bccde29db45..0461c884073cd12b551977f35540c29507ffad96 100644 --- a/app/code/Magento/Rss/etc/frontend/page_types.xml +++ b/app/code/Magento/Rss/etc/frontend/page_types.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<page_types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_types.xsd"> +<page_types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_types.xsd"> <type id="rss_index_index" label="RSS Feeds List"/> </page_types> diff --git a/app/code/Magento/Rss/etc/frontend/routes.xml b/app/code/Magento/Rss/etc/frontend/routes.xml index e4bf3864d77a5c7314f0efbdce31d41276fecd7c..7a339ad7d5a8fc007da79ec10e2414fbbfe3322e 100644 --- a/app/code/Magento/Rss/etc/frontend/routes.xml +++ b/app/code/Magento/Rss/etc/frontend/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn: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/etc/module.xml b/app/code/Magento/Rss/etc/module.xml index 4122071f8b9d342b87e6f409879913234e311f0d..e53e1d67a4c8f6a21c9d7083a97e739354f095cb 100644 --- a/app/code/Magento/Rss/etc/module.xml +++ b/app/code/Magento/Rss/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Rss" setup_version="2.0.0"> </module> </config> diff --git a/app/code/Magento/Rss/registration.php b/app/code/Magento/Rss/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..d3483620b6924b90fdca7840587d217cfedd2c2b --- /dev/null +++ b/app/code/Magento/Rss/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Rss', + __DIR__ +); diff --git a/app/code/Magento/Rss/view/frontend/layout/default.xml b/app/code/Magento/Rss/view/frontend/layout/default.xml index f72e484c79b3336d69776718f8a15d0cf74b9e35..db3967345cb526eb5930de7634554d43d80d618c 100644 --- a/app/code/Magento/Rss/view/frontend/layout/default.xml +++ b/app/code/Magento/Rss/view/frontend/layout/default.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="footer_links"> <block class="Magento\Framework\View\Element\Html\Link\Current" name="rss-link" ifconfig="rss/config/active"> diff --git a/app/code/Magento/Rss/view/frontend/layout/rss_index_index.xml b/app/code/Magento/Rss/view/frontend/layout/rss_index_index.xml index 00a54a15f520f090b831f121b78039a18f56b5a3..92c022a45e7d30aef2c8b7b323a65598a44680b2 100644 --- a/app/code/Magento/Rss/view/frontend/layout/rss_index_index.xml +++ b/app/code/Magento/Rss/view/frontend/layout/rss_index_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-right" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-right" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="page.main.title"> <action method="setPageTitle"> diff --git a/app/code/Magento/Rule/composer.json b/app/code/Magento/Rule/composer.json index 43af9eae68214c0bca3512f44507295a06b7311b..5b96d76f30ce589ef4f40d92cd7f7f239e7e0128 100644 --- a/app/code/Magento/Rule/composer.json +++ b/app/code/Magento/Rule/composer.json @@ -8,8 +8,7 @@ "magento/module-catalog": "1.0.0-beta", "magento/module-backend": "1.0.0-beta", "magento/framework": "1.0.0-beta", - "lib-libxml": "*", - "magento/magento-composer-installer": "*" + "lib-libxml": "*" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -17,12 +16,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Rule" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Rule\\": "" + } } } diff --git a/app/code/Magento/Rule/etc/module.xml b/app/code/Magento/Rule/etc/module.xml index 3a3987c2fb25336a2a7d1e174c36bfd051e7f9ce..757cb4964da25786c2e0f5392ecec7b158ef90ce 100644 --- a/app/code/Magento/Rule/etc/module.xml +++ b/app/code/Magento/Rule/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Rule" setup_version="2.0.0"> <sequence> <module name="Magento_Store"/> diff --git a/app/code/Magento/Rule/registration.php b/app/code/Magento/Rule/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..8f05b4bc0724b5859feea8bd7129d2a7e3ae0ae8 --- /dev/null +++ b/app/code/Magento/Rule/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Rule', + __DIR__ +); diff --git a/app/code/Magento/Sales/Api/Data/OrderItemInterface.php b/app/code/Magento/Sales/Api/Data/OrderItemInterface.php index f049f0b8273d3ffb5c8136f18b89e3da8317198c..75c6d90b61bb2d6b0a34d4481ed8816ac14efa1f 100644 --- a/app/code/Magento/Sales/Api/Data/OrderItemInterface.php +++ b/app/code/Magento/Sales/Api/Data/OrderItemInterface.php @@ -54,10 +54,6 @@ interface OrderItemInterface extends \Magento\Framework\Api\ExtensibleDataInterf * Product type. */ const PRODUCT_TYPE = 'product_type'; - /* - * Product options. - */ - const PRODUCT_OPTIONS = 'product_options'; /* * Weight. */ @@ -396,6 +392,11 @@ interface OrderItemInterface extends \Magento\Framework\Api\ExtensibleDataInterf */ const PARENT_ITEM = 'parent_item'; + /** + * Product Option + */ + const KEY_PRODUCT_OPTION = 'product_option'; + /** * Gets the additional data for the order item. @@ -853,21 +854,6 @@ interface OrderItemInterface extends \Magento\Framework\Api\ExtensibleDataInterf */ public function getProductId(); - /** - * Gets the product options for the order item. - * - * @return string[] Array of product options. - */ - public function getProductOptions(); - - /** - * Sets the product options for the order item. - * - * @param string[] $productOptions - * @return $this - */ - public function setProductOptions(array $productOptions = null); - /** * Gets the product type for the order item. * @@ -1807,6 +1793,21 @@ interface OrderItemInterface extends \Magento\Framework\Api\ExtensibleDataInterf */ public function setBaseWeeeTaxRowDisposition($baseWeeeTaxRowDisposition); + /** + * Returns product option + * + * @return \Magento\Catalog\Api\Data\ProductOptionInterface|null + */ + public function getProductOption(); + + /** + * Sets product option + * + * @param \Magento\Catalog\Api\Data\ProductOptionInterface $productOption + * @return $this + */ + public function setProductOption(\Magento\Catalog\Api\Data\ProductOptionInterface $productOption); + /** * Retrieve existing extension attributes object or create a new one. * diff --git a/app/code/Magento/Sales/Controller/Download/DownloadCustomOption.php b/app/code/Magento/Sales/Controller/Download/DownloadCustomOption.php index de556cb7ebf21884aad8570bae246277e60e8014..991ac197d784a71ab6f5c636987293bcefd5a4f6 100644 --- a/app/code/Magento/Sales/Controller/Download/DownloadCustomOption.php +++ b/app/code/Magento/Sales/Controller/Download/DownloadCustomOption.php @@ -10,6 +10,7 @@ use Magento\Sales\Model\Download; use Magento\Framework\App\Action\Context; use Magento\Catalog\Model\Product\Type\AbstractType; use Magento\Framework\Controller\Result\ForwardFactory; +use \Magento\Framework\Unserialize\Unserialize; class DownloadCustomOption extends \Magento\Framework\App\Action\Action { @@ -23,19 +24,27 @@ class DownloadCustomOption extends \Magento\Framework\App\Action\Action */ protected $download; + /** + * @var Unserialize + */ + protected $unserialize; + /** * @param Context $context * @param ForwardFactory $resultForwardFactory * @param Download $download + * @param Unserialize $unserialize */ public function __construct( Context $context, ForwardFactory $resultForwardFactory, - Download $download + Download $download, + Unserialize $unserialize ) { parent::__construct($context); $this->resultForwardFactory = $resultForwardFactory; $this->download = $download; + $this->unserialize = $unserialize; } /** @@ -44,7 +53,6 @@ class DownloadCustomOption extends \Magento\Framework\App\Action\Action * @return void|\Magento\Framework\Controller\Result\Forward * * @SuppressWarnings(PHPMD.CyclomaticComplexity) - * @SuppressWarnings(PHPMD.ExitExpression) */ public function execute() { @@ -79,7 +87,7 @@ class DownloadCustomOption extends \Magento\Framework\App\Action\Action } try { - $info = unserialize($option->getValue()); + $info = $this->unserialize->unserialize($option->getValue()); if ($this->getRequest()->getParam('key') != $info['secret_key']) { return $resultForward->forward('noroute'); } @@ -87,6 +95,17 @@ class DownloadCustomOption extends \Magento\Framework\App\Action\Action } catch (\Exception $e) { return $resultForward->forward('noroute'); } + $this->endExecute(); + } + + /** + * Ends execution process + * + * @return void + * @SuppressWarnings(PHPMD.ExitExpression) + */ + protected function endExecute() + { exit(0); } } diff --git a/app/code/Magento/Sales/Model/Config/SchemaLocator.php b/app/code/Magento/Sales/Model/Config/SchemaLocator.php index fac8ee6309437e6ba82c92e82c2bbe68643e809e..6edef15478dca7b8b93eb206087621226b1e425c 100644 --- a/app/code/Magento/Sales/Model/Config/SchemaLocator.php +++ b/app/code/Magento/Sales/Model/Config/SchemaLocator.php @@ -9,6 +9,8 @@ */ namespace Magento\Sales\Model\Config; +use Magento\Framework\Module\Dir; + class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface { /** @@ -30,7 +32,7 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface */ public function __construct(\Magento\Framework\Module\Dir\Reader $moduleReader) { - $this->_schema = $moduleReader->getModuleDir('etc', 'Magento_Sales') . '/' . 'sales.xsd'; + $this->_schema = $moduleReader->getModuleDir(Dir::MODULE_ETC_DIR, 'Magento_Sales') . '/' . 'sales.xsd'; } /** diff --git a/app/code/Magento/Sales/Model/Order.php b/app/code/Magento/Sales/Model/Order.php index 9ff69f759527ce6bb41640180f03533235900455..777c89667d447efc5413da51c69805cec77aa2f5 100644 --- a/app/code/Magento/Sales/Model/Order.php +++ b/app/code/Magento/Sales/Model/Order.php @@ -427,7 +427,6 @@ class Order extends AbstractModel implements EntityInterface, OrderInterface /** * Load order by system increment identifier * - * @deprecated * @param string $incrementId * @return \Magento\Sales\Model\Order */ diff --git a/app/code/Magento/Sales/Model/Order/Item.php b/app/code/Magento/Sales/Model/Order/Item.php index 8285f46d0aaffe3e23db227e8f9cda53801ba720..2f21d80513cde2835d13d43f18ec4b9b5e2467e0 100644 --- a/app/code/Magento/Sales/Model/Order/Item.php +++ b/app/code/Magento/Sales/Model/Order/Item.php @@ -465,7 +465,7 @@ class Item extends AbstractModel implements OrderItemInterface */ public function getProductOptions() { - $data = $this->_getData(OrderItemInterface::PRODUCT_OPTIONS); + $data = $this->_getData('product_options'); return is_string($data) ? unserialize($data) : $data; } @@ -2341,6 +2341,22 @@ class Item extends AbstractModel implements OrderItemInterface return $this->setData(OrderItemInterface::BASE_WEEE_TAX_ROW_DISPOSITION, $baseWeeeTaxRowDisposition); } + /** + * {@inheritdoc} + */ + public function getProductOption() + { + return $this->getData(self::KEY_PRODUCT_OPTION); + } + + /** + * {@inheritdoc} + */ + public function setProductOption(\Magento\Catalog\Api\Data\ProductOptionInterface $productOption) + { + return $this->setData(self::KEY_PRODUCT_OPTION, $productOption); + } + /** * {@inheritdoc} * diff --git a/app/code/Magento/Sales/Model/Order/ItemRepository.php b/app/code/Magento/Sales/Model/Order/ItemRepository.php new file mode 100644 index 0000000000000000000000000000000000000000..178e5bc48965bb33298eecb8cec20d1217a92023 --- /dev/null +++ b/app/code/Magento/Sales/Model/Order/ItemRepository.php @@ -0,0 +1,272 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Sales\Model\Order; + +use Magento\Catalog\Api\Data\ProductOptionExtensionFactory; +use Magento\Catalog\Model\ProductOptionFactory; +use Magento\Catalog\Model\ProductOptionProcessorInterface; +use Magento\Framework\Api\SearchCriteria; +use Magento\Framework\DataObject; +use Magento\Framework\DataObject\Factory as DataObjectFactory; +use Magento\Framework\Exception\InputException; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Sales\Api\Data\OrderItemInterface; +use Magento\Sales\Api\Data\OrderItemSearchResultInterface; +use Magento\Sales\Api\Data\OrderItemSearchResultInterfaceFactory; +use Magento\Sales\Api\OrderItemRepositoryInterface; +use Magento\Sales\Model\Resource\Metadata; + +/** + * Repository class for @see OrderItemInterface + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ +class ItemRepository implements OrderItemRepositoryInterface +{ + /** + * @var DataObjectFactory + */ + protected $objectFactory; + + /** + * @var Metadata + */ + protected $metadata; + + /** + * @var OrderItemSearchResultInterfaceFactory + */ + protected $searchResultFactory; + + /** + * @var ProductOptionFactory + */ + protected $productOptionFactory; + + /** + * @var ProductOptionExtensionFactory + */ + protected $extensionFactory; + + /** + * @var ProductOptionProcessorInterface[] + */ + protected $processorPool; + + /** + * @var OrderItemInterface[] + */ + protected $registry = []; + + /** + * @param DataObjectFactory $objectFactory + * @param Metadata $metadata + * @param OrderItemSearchResultInterfaceFactory $searchResultFactory + * @param ProductOptionFactory $productOptionFactory + * @param ProductOptionExtensionFactory $extensionFactory + * @param array $processorPool + */ + public function __construct( + DataObjectFactory $objectFactory, + Metadata $metadata, + OrderItemSearchResultInterfaceFactory $searchResultFactory, + ProductOptionFactory $productOptionFactory, + ProductOptionExtensionFactory $extensionFactory, + array $processorPool = [] + ) { + $this->objectFactory = $objectFactory; + $this->metadata = $metadata; + $this->searchResultFactory = $searchResultFactory; + $this->productOptionFactory = $productOptionFactory; + $this->extensionFactory = $extensionFactory; + $this->processorPool = $processorPool; + } + + /** + * load entity + * + * @param int $id + * @return OrderItemInterface + * @throws InputException + * @throws NoSuchEntityException + */ + public function get($id) + { + if (!$id) { + throw new InputException(__('ID required')); + } + if (!isset($this->registry[$id])) { + /** @var OrderItemInterface $orderItem */ + $orderItem = $this->metadata->getNewInstance(); + $this->metadata->getMapper()->load($orderItem, $id); + if (!$orderItem->getItemId()) { + throw new NoSuchEntityException(__('Requested entity doesn\'t exist')); + } + + $this->addProductOption($orderItem); + $this->registry[$id] = $orderItem; + } + return $this->registry[$id]; + } + + /** + * Find entities by criteria + * + * @param SearchCriteria $criteria + * @return OrderItemInterface[] + */ + public function getList(SearchCriteria $criteria) + { + /** @var OrderItemSearchResultInterface $searchResult */ + $searchResult = $this->searchResultFactory->create(); + $searchResult->setSearchCriteria($criteria); + + foreach ($criteria->getFilterGroups() as $filterGroup) { + foreach ($filterGroup->getFilters() as $filter) { + $condition = $filter->getConditionType() ? $filter->getConditionType() : 'eq'; + $searchResult->addFieldToFilter($filter->getField(), [$condition => $filter->getValue()]); + } + } + + /** @var OrderItemInterface $orderItem */ + foreach ($searchResult->getItems() as $orderItem) { + $this->addProductOption($orderItem); + } + + return $searchResult; + } + + /** + * Register entity to delete + * + * @param OrderItemInterface $entity + * @return bool + */ + public function delete(OrderItemInterface $entity) + { + $this->metadata->getMapper()->delete($entity); + unset($this->registry[$entity->getEntityId()]); + return true; + } + + /** + * Delete entity by Id + * + * @param int $id + * @return bool + */ + public function deleteById($id) + { + $entity = $this->get($id); + return $this->delete($entity); + } + + /** + * Perform persist operations for one entity + * + * @param OrderItemInterface $entity + * @return OrderItemInterface + */ + public function save(OrderItemInterface $entity) + { + if ($entity->getProductOption()) { + $request = $this->getBuyRequest($entity); + $entity->setProductOptions(['info_buyRequest' => $request->toArray()]); + } + + $this->metadata->getMapper()->save($entity); + $this->registry[$entity->getEntityId()] = $entity; + return $this->registry[$entity->getEntityId()]; + } + + /** + * Add product option data + * + * @param OrderItemInterface $orderItem + * @return $this + */ + protected function addProductOption(OrderItemInterface $orderItem) + { + /** @var DataObject $request */ + $request = $orderItem->getBuyRequest(); + + $productType = $orderItem->getProductType(); + if (isset($this->processorPool[$productType]) + && !$orderItem->getParentItemId()) { + $data = $this->processorPool[$productType]->convertToProductOption($request); + if ($data) { + $this->setProductOption($orderItem, $data); + } + } + + if (isset($this->processorPool['custom_options']) + && !$orderItem->getParentItemId()) { + $data = $this->processorPool['custom_options']->convertToProductOption($request); + if ($data) { + $this->setProductOption($orderItem, $data); + } + } + + return $this; + } + + /** + * Set product options data + * + * @param OrderItemInterface $orderItem + * @param array $data + * @return $this + */ + protected function setProductOption(OrderItemInterface $orderItem, array $data) + { + $productOption = $orderItem->getProductOption(); + if (!$productOption) { + $productOption = $this->productOptionFactory->create(); + $orderItem->setProductOption($productOption); + } + + $extensionAttributes = $productOption->getExtensionAttributes(); + if (!$extensionAttributes) { + $extensionAttributes = $this->extensionFactory->create(); + $productOption->setExtensionAttributes($extensionAttributes); + } + + $extensionAttributes->setData(key($data), current($data)); + + return $this; + } + + /** + * Retrieve order item's buy request + * + * @param OrderItemInterface $entity + * @return DataObject + */ + protected function getBuyRequest(OrderItemInterface $entity) + { + $request = $this->objectFactory->create(['qty' => $entity->getQtyOrdered()]); + + $productType = $entity->getProductType(); + if (isset($this->processorPool[$productType]) + && !$entity->getParentItemId()) { + $productOption = $entity->getProductOption(); + if ($productOption) { + $requestUpdate = $this->processorPool[$productType]->convertToBuyRequest($productOption); + $request->addData($requestUpdate->getData()); + } + } + + if (isset($this->processorPool['custom_options']) + && !$entity->getParentItemId()) { + $productOption = $entity->getProductOption(); + if ($productOption) { + $requestUpdate = $this->processorPool['custom_options']->convertToBuyRequest($productOption); + $request->addData($requestUpdate->getData()); + } + } + + return $request; + } +} diff --git a/app/code/Magento/Sales/Model/Order/Payment.php b/app/code/Magento/Sales/Model/Order/Payment.php index a99674102d75c5dea35b94d8d3d0f09935227675..cc805b19a1331ebd6e7202bbae66e33a11b61dea 100644 --- a/app/code/Magento/Sales/Model/Order/Payment.php +++ b/app/code/Magento/Sales/Model/Order/Payment.php @@ -188,8 +188,6 @@ class Payment extends Info implements OrderPaymentInterface * Retrieve order model object * * @codeCoverageIgnore - * @deprecated - * * @return Order */ public function getOrder() diff --git a/app/code/Magento/Sales/Model/Order/Pdf/Config/SchemaLocator.php b/app/code/Magento/Sales/Model/Order/Pdf/Config/SchemaLocator.php index 5efbe12f12a80a4846ce10c2426eb3fd03c55381..8745a51075112cd154158f2837ea1fcd7a3a7fb6 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/Config/SchemaLocator.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/Config/SchemaLocator.php @@ -7,6 +7,8 @@ */ namespace Magento\Sales\Model\Order\Pdf\Config; +use Magento\Framework\Module\Dir; + class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface { /** @@ -28,7 +30,7 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface */ public function __construct(\Magento\Framework\Module\Dir\Reader $moduleReader) { - $dir = $moduleReader->getModuleDir('etc', 'Magento_Sales'); + $dir = $moduleReader->getModuleDir(Dir::MODULE_ETC_DIR, 'Magento_Sales'); $this->_schema = $dir . '/pdf.xsd'; $this->_schemaFile = $dir . '/pdf_file.xsd'; } diff --git a/app/code/Magento/Sales/Model/Resource/Order/Relation.php b/app/code/Magento/Sales/Model/Resource/Order/Relation.php index 95891b5e462ca025dc807d1ce289cd4f169cdb10..467aa0014701f4653f4eb2c7e1192da01ec241e1 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Relation.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Relation.php @@ -8,9 +8,9 @@ namespace Magento\Sales\Model\Resource\Order; use Magento\Sales\Model\Resource\Order\Handler\Address as AddressHandler; use Magento\Framework\Model\Resource\Db\VersionControl\RelationInterface; -use Magento\Sales\Model\Resource\Order\Item as OrderItemResource; use Magento\Sales\Model\Resource\Order\Payment as OrderPaymentResource; use Magento\Sales\Model\Resource\Order\Status\History as OrderStatusHistoryResource; +use Magento\Sales\Api\OrderItemRepositoryInterface; /** * Class Relation @@ -23,9 +23,9 @@ class Relation implements RelationInterface protected $addressHandler; /** - * @var OrderItemResource + * @var OrderItemRepositoryInterface */ - protected $orderItemResource; + protected $orderItemRepository; /** * @var OrderPaymentResource @@ -39,18 +39,18 @@ class Relation implements RelationInterface /** * @param AddressHandler $addressHandler - * @param OrderItemResource $orderItemResource + * @param OrderItemRepositoryInterface $orderItemRepository * @param OrderPaymentResource $orderPaymentResource * @param OrderStatusHistoryResource $orderStatusHistoryResource */ public function __construct( AddressHandler $addressHandler, - OrderItemResource $orderItemResource, + OrderItemRepositoryInterface $orderItemRepository, OrderPaymentResource $orderPaymentResource, OrderStatusHistoryResource $orderStatusHistoryResource ) { $this->addressHandler = $addressHandler; - $this->orderItemResource = $orderItemResource; + $this->orderItemRepository = $orderItemRepository; $this->orderPaymentResource = $orderPaymentResource; $this->orderStatusHistoryResource = $orderStatusHistoryResource; } @@ -71,7 +71,7 @@ class Relation implements RelationInterface foreach ($object->getItems() as $item) { $item->setOrderId($object->getId()); $item->setOrder($object); - $this->orderItemResource->save($item); + $this->orderItemRepository->save($item); } } if (null !== $object->getPayments()) { diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Download/DownloadCustomOptionTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Download/DownloadCustomOptionTest.php new file mode 100644 index 0000000000000000000000000000000000000000..629cb0ce5eb719d426c721cffb640af8a6d9059e --- /dev/null +++ b/app/code/Magento/Sales/Test/Unit/Controller/Download/DownloadCustomOptionTest.php @@ -0,0 +1,334 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Sales\Test\Unit\Controller\Download; + +/** + * Class DownloadCustomOptionTest + * @package Magento\Sales\Controller\Adminhtml\Order + */ +class DownloadCustomOptionTest extends \PHPUnit_Framework_TestCase +{ + /** + * Option ID Test Value + */ + const OPTION_ID = '123456'; + + /** + * Option Code Test Value + */ + const OPTION_CODE = 'option_123456'; + + /** + * Option Product ID Value + */ + const OPTION_PRODUCT_ID = 'option_test_product_id'; + + /** + * Option Type Value + */ + const OPTION_TYPE = 'file'; + + /** + * Option Value Test Value + */ + const OPTION_VALUE = 'option_test_value'; + + /** + * Option Value Test Value + */ + const SECRET_KEY = 'secret_key'; + + /** + * @var \Magento\Quote\Model\Quote\Item\Option|\PHPUnit_Framework_MockObject_MockObject + */ + protected $itemOptionMock; + + /** + * @var \Magento\Catalog\Model\Product\Option|\PHPUnit_Framework_MockObject_MockObject + */ + protected $productOptionMock; + + /** + * @var \Magento\Framework\Unserialize\Unserialize|\PHPUnit_Framework_MockObject_MockObject + */ + protected $unserializeMock; + + /** + * @var \Magento\Framework\Controller\Result\Forward|\PHPUnit_Framework_MockObject_MockObject + */ + protected $resultForwardMock; + + /** + * @var \Magento\Sales\Model\Download|\PHPUnit_Framework_MockObject_MockObject + */ + protected $downloadMock; + + /** + * @var \Magento\Sales\Controller\Download\DownloadCustomOption|\PHPUnit_Framework_MockObject_MockObject + */ + protected $objectMock; + + public function setUp() + { + $resultForwardFactoryMock = $this->getMockBuilder('Magento\Framework\Controller\Result\ForwardFactory') + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $this->resultForwardMock = $this->getMockBuilder('\Magento\Framework\Controller\Result\Forward') + ->disableOriginalConstructor() + ->setMethods(['forward']) + ->getMock(); + $resultForwardFactoryMock->expects($this->any())->method('create')->willReturn($this->resultForwardMock); + + $this->downloadMock = $this->getMockBuilder('Magento\Sales\Model\Download') + ->disableOriginalConstructor() + ->setMethods(['downloadFile']) + ->getMock(); + + $this->unserializeMock = $this->getMockBuilder('Magento\Framework\Unserialize\Unserialize') + ->disableOriginalConstructor() + ->setMethods(['unserialize']) + ->getMock(); + + $requestMock = $this->getMockBuilder('Magento\Framework\App\Request\Http') + ->disableOriginalConstructor() + ->setMethods(['getParam']) + ->getMock(); + $requestMock->expects($this->any())->method('getParam') + ->will( + $this->returnValueMap( + [ + ['id', null, self::OPTION_ID], + ['key', null, self::SECRET_KEY], + ] + ) + ); + + $this->itemOptionMock = $this->getMockBuilder('Magento\Quote\Model\Quote\Item\Option') + ->disableOriginalConstructor() + ->setMethods(['load', 'getId', 'getCode', 'getProductId', 'getValue']) + ->getMock(); + + $this->productOptionMock = $this->getMockBuilder('Magento\Catalog\Model\Product\Option') + ->disableOriginalConstructor() + ->setMethods(['load', 'getId', 'getProductId', 'getType']) + ->getMock(); + + $objectManagerMock = $this->getMockBuilder('Magento\Sales\Model\Download') + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $objectManagerMock->expects($this->any())->method('create') + ->will( + $this->returnValueMap( + [ + ['Magento\Quote\Model\Quote\Item\Option', $this->itemOptionMock], + ['Magento\Catalog\Model\Product\Option', $this->productOptionMock], + ] + ) + ); + + $contextMock = $this->getMockBuilder('Magento\Backend\App\Action\Context') + ->disableOriginalConstructor() + ->setMethods( + [ + 'getRequest', + 'getObjectManager', + ] + ) + ->getMock(); + $contextMock->expects($this->once())->method('getObjectManager')->willReturn($objectManagerMock); + $contextMock->expects($this->once())->method('getRequest')->willReturn($requestMock); + + $this->objectMock = $this->getMockBuilder('Magento\Sales\Controller\Download\DownloadCustomOption') + ->setMethods(['endExecute']) + ->setConstructorArgs( + [ + 'context' => $contextMock, + 'resultForwardFactory' => $resultForwardFactoryMock, + 'download' => $this->downloadMock, + 'unserialize' => $this->unserializeMock + ] + ) + ->getMock(); + } + + /** + * @param array $itemOptionValues + * @param array $productOptionValues + * @param bool $noRouteOccurs + * @dataProvider executeDataProvider + */ + public function testExecute($itemOptionValues, $productOptionValues, $noRouteOccurs) + { + if (!empty($itemOptionValues)) { + $this->itemOptionMock->expects($this->once())->method('load')->willReturnSelf(); + $this->itemOptionMock->expects($this->once()) + ->method('getId') + ->willReturn($itemOptionValues[self::OPTION_ID]); + $this->itemOptionMock->expects($this->any()) + ->method('getCode') + ->willReturn($itemOptionValues[self::OPTION_CODE]); + $this->itemOptionMock->expects($this->any()) + ->method('getProductId') + ->willReturn($itemOptionValues[self::OPTION_PRODUCT_ID]); + $this->itemOptionMock->expects($this->any()) + ->method('getValue') + ->willReturn($itemOptionValues[self::OPTION_VALUE]); + } + if (!empty($productOptionValues)) { + $this->productOptionMock->expects($this->once())->method('load')->willReturnSelf(); + $this->productOptionMock->expects($this->any()) + ->method('getId') + ->willReturn($productOptionValues[self::OPTION_ID]); + $this->productOptionMock->expects($this->any()) + ->method('getProductId') + ->willReturn($productOptionValues[self::OPTION_PRODUCT_ID]); + $this->productOptionMock->expects($this->any()) + ->method('getType') + ->willReturn($productOptionValues[self::OPTION_TYPE]); + } + if ($noRouteOccurs) { + $this->resultForwardMock->expects($this->once())->method('forward')->with('noroute')->willReturn(true); + } else { + $unserializeResult = [self::SECRET_KEY => self::SECRET_KEY]; + + $this->unserializeMock->expects($this->once()) + ->method('unserialize') + ->with($itemOptionValues[self::OPTION_VALUE]) + ->willReturn($unserializeResult); + + $this->downloadMock->expects($this->once()) + ->method('downloadFile') + ->with($unserializeResult) + ->willReturn(true); + + $this->objectMock->expects($this->once())->method('endExecute')->willReturn(true); + } + $this->objectMock->execute(); + } + + public function executeDataProvider() + { + return [ + [ //Good + [ + self::OPTION_ID => self::OPTION_ID, + self::OPTION_CODE => self::OPTION_CODE, + self::OPTION_PRODUCT_ID => self::OPTION_PRODUCT_ID, + self::OPTION_VALUE => self::OPTION_VALUE + ], + [ + self::OPTION_ID => self::OPTION_ID, + self::OPTION_PRODUCT_ID => self::OPTION_PRODUCT_ID, + self::OPTION_TYPE => self::OPTION_TYPE, + ], + false + ], + [ //No Option ID + [ + self::OPTION_ID => false, + self::OPTION_CODE => self::OPTION_CODE, + self::OPTION_PRODUCT_ID => self::OPTION_PRODUCT_ID, + self::OPTION_VALUE => self::OPTION_VALUE + ], + [], + true + ], + [ //No Product Option + [ + self::OPTION_ID => self::OPTION_ID, + self::OPTION_CODE => self::OPTION_CODE, + self::OPTION_PRODUCT_ID => self::OPTION_PRODUCT_ID, + self::OPTION_VALUE => self::OPTION_VALUE + ], + [], + true + ], + [ //No Product Option ID + [ + self::OPTION_ID => self::OPTION_ID, + self::OPTION_CODE => self::OPTION_CODE, + self::OPTION_PRODUCT_ID => self::OPTION_PRODUCT_ID, + self::OPTION_VALUE => self::OPTION_VALUE + ], + [ + self::OPTION_ID => null, + self::OPTION_PRODUCT_ID => self::OPTION_PRODUCT_ID, + self::OPTION_TYPE => self::OPTION_TYPE, + ], + true + ], + [ //Not Matching Product IDs in Inventory Option + [ + self::OPTION_ID => self::OPTION_ID, + self::OPTION_CODE => self::OPTION_CODE, + self::OPTION_PRODUCT_ID => 'bad_test_product_ID', + self::OPTION_VALUE => self::OPTION_VALUE + ], + [ + self::OPTION_ID => self::OPTION_ID, + self::OPTION_PRODUCT_ID => self::OPTION_PRODUCT_ID, + self::OPTION_TYPE => self::OPTION_TYPE, + ], + true + ], + [ //Not Matching Product IDs in Product Option + [ + self::OPTION_ID => self::OPTION_ID, + self::OPTION_CODE => self::OPTION_CODE, + self::OPTION_PRODUCT_ID => self::OPTION_PRODUCT_ID, + self::OPTION_VALUE => self::OPTION_VALUE + ], + [ + self::OPTION_ID => self::OPTION_ID, + self::OPTION_PRODUCT_ID => 'bad_test_product_ID', + self::OPTION_TYPE => self::OPTION_TYPE, + ], + true + ], + [ //Incorrect Option Type + [ + self::OPTION_ID => self::OPTION_ID, + self::OPTION_CODE => self::OPTION_CODE, + self::OPTION_PRODUCT_ID => self::OPTION_PRODUCT_ID, + self::OPTION_VALUE => self::OPTION_VALUE + ], + [ + self::OPTION_ID => self::OPTION_ID, + self::OPTION_PRODUCT_ID => self::OPTION_PRODUCT_ID, + self::OPTION_TYPE => 'bad_test_option_type', + ], + true + ], + ]; + } + + + public function testExecuteBadSecretKey() + { + $this->itemOptionMock->expects($this->once())->method('load')->willReturnSelf(); + $this->itemOptionMock->expects($this->once())->method('getId')->willReturn(self::OPTION_ID); + $this->itemOptionMock->expects($this->any())->method('getCode')->willReturn(self::OPTION_CODE); + $this->itemOptionMock->expects($this->any())->method('getProductId')->willReturn(self::OPTION_PRODUCT_ID); + $this->itemOptionMock->expects($this->any())->method('getValue')->willReturn(self::OPTION_VALUE); + + $this->productOptionMock->expects($this->once())->method('load')->willReturnSelf(); + $this->productOptionMock->expects($this->any())->method('getId')->willReturn(self::OPTION_ID); + $this->productOptionMock->expects($this->any())->method('getProductId')->willReturn(self::OPTION_PRODUCT_ID); + $this->productOptionMock->expects($this->any())->method('getType')->willReturn(self::OPTION_TYPE); + + $this->unserializeMock->expects($this->once()) + ->method('unserialize') + ->with(self::OPTION_VALUE) + ->willReturn([self::SECRET_KEY => 'bad_test_secret_key']); + + $this->resultForwardMock->expects($this->once())->method('forward')->with('noroute')->willReturn(true); + + $this->objectMock->execute(); + } +} diff --git a/app/code/Magento/Sales/Test/Unit/Model/Config/XsdTest.php b/app/code/Magento/Sales/Test/Unit/Model/Config/XsdTest.php index e4e8c69a031a033f80721407f7b377ef3a324565..43d9f7b6883674c39740d324f9b3b493b09c2afb 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Config/XsdTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Config/XsdTest.php @@ -7,11 +7,14 @@ namespace Magento\Sales\Test\Unit\Model\Config; class XsdTest extends \PHPUnit_Framework_TestCase { + /** + * @var string + */ protected $_xsdFile; public function setUp() { - $this->_xsdFile = __DIR__ . "/../../../../../../../../app/code/Magento/Sales/etc/sales.xsd"; + $this->_xsdFile = "urn:magento:module:Magento_Sales:etc/sales.xsd"; } /** @@ -23,9 +26,9 @@ class XsdTest extends \PHPUnit_Framework_TestCase $dom = new \DOMDocument(); $dom->load(__DIR__ . "/_files/{$xmlFile}"); libxml_use_internal_errors(true); - $result = $dom->schemaValidate($this->_xsdFile); + $result = \Magento\Framework\Config\Dom::validateDomDocument($dom, $this->_xsdFile); libxml_use_internal_errors(false); - $this->assertTrue($result); + $this->assertEmpty($result, 'Validation failed with errors: ' . join(', ', $result)); } /** @@ -46,15 +49,11 @@ class XsdTest extends \PHPUnit_Framework_TestCase $dom = new \DOMDocument(); $dom->load(__DIR__ . "/_files/{$xmlFile}"); libxml_use_internal_errors(true); - $dom->schemaValidate($this->_xsdFile); - $errors = libxml_get_errors(); - $actualErrors = []; - foreach ($errors as $error) { - $actualErrors[] = $error->message; - } + $result = \Magento\Framework\Config\Dom::validateDomDocument($dom, $this->_xsdFile); + libxml_use_internal_errors(false); - $this->assertEquals($expectedErrors, $actualErrors); + $this->assertEquals($expectedErrors, $result); } /** @@ -66,38 +65,40 @@ class XsdTest extends \PHPUnit_Framework_TestCase [ 'sales_invalid.xml', [ - "Element 'section', attribute 'wrongName': The attribute 'wrongName' is not allowed.\n", - "Element 'section': The attribute 'name' is required but missing.\n", - "Element 'wrongGroup': This element is not expected. Expected is ( group ).\n" + "Element 'section', attribute 'wrongName': The attribute 'wrongName' is not allowed.\nLine: 9\n", + "Element 'section': The attribute 'name' is required but missing.\nLine: 9\n", + "Element 'wrongGroup': This element is not expected. Expected is ( group ).\nLine: 10\n" ], ], [ 'sales_invalid_duplicates.xml', [ "Element 'renderer': Duplicate key-sequence ['r1']" . - " in unique identity-constraint 'uniqueRendererName'.\n", - "Element 'item': Duplicate key-sequence ['i1'] in unique identity-constraint 'uniqueItemName'.\n", - "Element 'group': Duplicate key-sequence ['g1'] in unique identity-constraint 'uniqueGroupName'.\n", + " in unique identity-constraint 'uniqueRendererName'.\nLine: 13\n", + "Element 'item': Duplicate key-sequence ['i1']" . + " in unique identity-constraint 'uniqueItemName'.\nLine: 15\n", + "Element 'group': Duplicate key-sequence ['g1']" . + " in unique identity-constraint 'uniqueGroupName'.\nLine: 17\n", "Element 'section': Duplicate key-sequence ['s1']" . - " in unique identity-constraint 'uniqueSectionName'.\n", + " in unique identity-constraint 'uniqueSectionName'.\nLine: 21\n", "Element 'available_product_type': Duplicate key-sequence ['a1']" . - " in unique identity-constraint 'uniqueProductTypeName'.\n" + " in unique identity-constraint 'uniqueProductTypeName'.\nLine: 28\n" ] ], [ 'sales_invalid_without_attributes.xml', [ - "Element 'section': The attribute 'name' is required but missing.\n", - "Element 'group': The attribute 'name' is required but missing.\n", - "Element 'item': The attribute 'name' is required but missing.\n", - "Element 'renderer': The attribute 'name' is required but missing.\n", - "Element 'renderer': The attribute 'instance' is required but missing.\n", - "Element 'available_product_type': The attribute 'name' is required but missing.\n" + "Element 'section': The attribute 'name' is required but missing.\nLine: 9\n", + "Element 'group': The attribute 'name' is required but missing.\nLine: 10\n", + "Element 'item': The attribute 'name' is required but missing.\nLine: 11\n", + "Element 'renderer': The attribute 'name' is required but missing.\nLine: 12\n", + "Element 'renderer': The attribute 'instance' is required but missing.\nLine: 12\n", + "Element 'available_product_type': The attribute 'name' is required but missing.\nLine: 17\n" ] ], [ 'sales_invalid_root_node.xml', - ["Element 'wrong': This element is not expected. Expected is one of ( section, order ).\n"] + ["Element 'wrong': This element is not expected. Expected is one of ( section, order ).\nLine: 9\n"] ] ]; } diff --git a/app/code/Magento/Sales/Test/Unit/Model/Config/_files/sales_invalid.xml b/app/code/Magento/Sales/Test/Unit/Model/Config/_files/sales_invalid.xml index 65655791fc22045bec627f238e04e62be9f5b5b4..778f9061c5bd7f5d4f6712f3f10c680d36ab343d 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Config/_files/sales_invalid.xml +++ b/app/code/Magento/Sales/Test/Unit/Model/Config/_files/sales_invalid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../app/code/Magento/Sales/etc/sales.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Sales:etc/sales.xsd"> <section wrongName="section1"> <wrongGroup wrongName="group1" /> </section> diff --git a/app/code/Magento/Sales/Test/Unit/Model/Config/_files/sales_invalid_duplicates.xml b/app/code/Magento/Sales/Test/Unit/Model/Config/_files/sales_invalid_duplicates.xml index 959ceb33e217a8c3e5c38330cb9903bc49220fc7..78fb9a039f345d912e84859b24c2cf37b69595db 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Config/_files/sales_invalid_duplicates.xml +++ b/app/code/Magento/Sales/Test/Unit/Model/Config/_files/sales_invalid_duplicates.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../app/code/Magento/Sales/etc/sales.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Sales:etc/sales.xsd"> <section name="s1"> <group name="g1"> <item name="i1" instance="instance1" sort_order="1"> diff --git a/app/code/Magento/Sales/Test/Unit/Model/Config/_files/sales_invalid_root_node.xml b/app/code/Magento/Sales/Test/Unit/Model/Config/_files/sales_invalid_root_node.xml index 76ce3a50ae60bdaf2ca52c95f4c5f7000af53e3a..48472d4a6a69d054d57587780cb2491f8d5fb89d 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Config/_files/sales_invalid_root_node.xml +++ b/app/code/Magento/Sales/Test/Unit/Model/Config/_files/sales_invalid_root_node.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../app/code/Magento/Sales/etc/sales.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Sales:etc/sales.xsd"> <wrong /> </config> diff --git a/app/code/Magento/Sales/Test/Unit/Model/Config/_files/sales_invalid_scope.xml b/app/code/Magento/Sales/Test/Unit/Model/Config/_files/sales_invalid_scope.xml index 479a06053b6a50cba51b74e031b9b0c17fb8ca5a..394a16b8eef3ac99c01e97c0ad3744ff490e75e4 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Config/_files/sales_invalid_scope.xml +++ b/app/code/Magento/Sales/Test/Unit/Model/Config/_files/sales_invalid_scope.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../app/code/Magento/Sales/etc/sales.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Sales:etc/sales.xsd"> <section name="section1"> <group name="group1"> <item name="item1" instance="instance1" sort_order="1"> diff --git a/app/code/Magento/Sales/Test/Unit/Model/Config/_files/sales_invalid_without_attributes.xml b/app/code/Magento/Sales/Test/Unit/Model/Config/_files/sales_invalid_without_attributes.xml index 17b4462ad39638d98ea73374fe499f7b90677231..e8be817a21b76810d9b970da9810fef8ce12876b 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Config/_files/sales_invalid_without_attributes.xml +++ b/app/code/Magento/Sales/Test/Unit/Model/Config/_files/sales_invalid_without_attributes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../app/code/Magento/Sales/etc/sales.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Sales:etc/sales.xsd"> <section> <group> <item> diff --git a/app/code/Magento/Sales/Test/Unit/Model/Config/_files/sales_valid.xml b/app/code/Magento/Sales/Test/Unit/Model/Config/_files/sales_valid.xml index 479a06053b6a50cba51b74e031b9b0c17fb8ca5a..394a16b8eef3ac99c01e97c0ad3744ff490e75e4 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Config/_files/sales_valid.xml +++ b/app/code/Magento/Sales/Test/Unit/Model/Config/_files/sales_valid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../app/code/Magento/Sales/etc/sales.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Sales:etc/sales.xsd"> <section name="section1"> <group name="group1"> <item name="item1" instance="instance1" sort_order="1"> diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/ItemRepositoryTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/ItemRepositoryTest.php new file mode 100644 index 0000000000000000000000000000000000000000..0da34e42feee6f55593dddea98f46e5f3aeff3a1 --- /dev/null +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/ItemRepositoryTest.php @@ -0,0 +1,395 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Sales\Test\Unit\Model\Order; + +use Magento\Sales\Model\Order\ItemRepository; + +class ItemRepositoryTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Framework\DataObject\Factory | \PHPUnit_Framework_MockObject_MockObject + */ + protected $objectFactory; + + /** + * @var \Magento\Sales\Model\Resource\Metadata | \PHPUnit_Framework_MockObject_MockObject + */ + protected $metadata; + + /** + * @var \Magento\Sales\Api\Data\OrderItemSearchResultInterfaceFactory | \PHPUnit_Framework_MockObject_MockObject + */ + protected $searchResultFactory; + + /** + * @var \Magento\Catalog\Model\ProductOptionProcessorInterface | \PHPUnit_Framework_MockObject_MockObject + */ + protected $productOptionProcessorMock; + + /** + * @var \Magento\Catalog\Model\ProductOptionFactory | \PHPUnit_Framework_MockObject_MockObject + */ + protected $productOptionFactory; + + /** + * @var \Magento\Catalog\Api\Data\ProductOptionExtensionFactory | \PHPUnit_Framework_MockObject_MockObject + */ + protected $extensionFactory; + + /** + * @var array + */ + protected $productOptionData = []; + + protected function setUp() + { + $this->objectFactory = $this->getMockBuilder('Magento\Framework\DataObject\Factory') + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + + $this->metadata = $this->getMockBuilder('Magento\Sales\Model\Resource\Metadata') + ->disableOriginalConstructor() + ->getMock(); + + $this->searchResultFactory = $this->getMockBuilder( + 'Magento\Sales\Api\Data\OrderItemSearchResultInterfaceFactory' + ) + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + + $this->productOptionFactory = $this->getMockBuilder('Magento\Catalog\Model\ProductOptionFactory') + ->setMethods([ + 'create', + ]) + ->disableOriginalConstructor() + ->getMock(); + + $this->extensionFactory = $this->getMockBuilder('Magento\Catalog\Api\Data\ProductOptionExtensionFactory') + ->setMethods([ + 'create', + ]) + ->disableOriginalConstructor() + ->getMock(); + } + + /** + * @expectedException \Magento\Framework\Exception\InputException + * @expectedExceptionMessage ID required + */ + public function testGetWithNoId() + { + $model = new ItemRepository( + $this->objectFactory, + $this->metadata, + $this->searchResultFactory, + $this->productOptionFactory, + $this->extensionFactory + ); + + $model->get(null); + } + + /** + * @expectedException \Magento\Framework\Exception\NoSuchEntityException + * @expectedExceptionMessage Requested entity doesn't exist + */ + public function testGetEmptyEntity() + { + $orderItemId = 1; + + $orderItemMock = $this->getMockBuilder('Magento\Sales\Model\Order\Item') + ->disableOriginalConstructor() + ->getMock(); + $orderItemMock->expects($this->once()) + ->method('getItemId') + ->willReturn(null); + + $orderItemResourceMock = $this->getMockBuilder('Magento\Framework\Model\Resource\Db\AbstractDb') + ->disableOriginalConstructor() + ->getMock(); + $orderItemResourceMock->expects($this->once()) + ->method('load') + ->with($orderItemMock, $orderItemId) + ->willReturnSelf(); + + $this->metadata->expects($this->once()) + ->method('getNewInstance') + ->willReturn($orderItemMock); + $this->metadata->expects($this->once()) + ->method('getMapper') + ->willReturn($orderItemResourceMock); + + $model = new ItemRepository( + $this->objectFactory, + $this->metadata, + $this->searchResultFactory, + $this->productOptionFactory, + $this->extensionFactory + ); + + $model->get($orderItemId); + } + + public function testGet() + { + $orderItemId = 1; + $productType = 'configurable'; + + $this->productOptionData = ['option1' => 'value1']; + + $this->getProductOptionExtensionMock(); + $productOption = $this->getProductOptionMock(); + $orderItemMock = $this->getOrderMock($productType, $productOption); + + $orderItemMock->expects($this->once()) + ->method('getItemId') + ->willReturn($orderItemId); + + $orderItemResourceMock = $this->getMockBuilder('Magento\Framework\Model\Resource\Db\AbstractDb') + ->disableOriginalConstructor() + ->getMock(); + $orderItemResourceMock->expects($this->once()) + ->method('load') + ->with($orderItemMock, $orderItemId) + ->willReturnSelf(); + + $this->metadata->expects($this->once()) + ->method('getNewInstance') + ->willReturn($orderItemMock); + $this->metadata->expects($this->once()) + ->method('getMapper') + ->willReturn($orderItemResourceMock); + + $model = $this->getModel($orderItemMock, $productType); + $this->assertSame($orderItemMock, $model->get($orderItemId)); + + // Assert already registered + $this->assertSame($orderItemMock, $model->get($orderItemId)); + } + + public function testGetList() + { + $productType = 'configurable'; + $field = 'field'; + $value = 'value'; + + $this->productOptionData = ['option1' => 'value1']; + + $filterMock = $this->getMockBuilder('Magento\Framework\Api\Filter') + ->disableOriginalConstructor() + ->getMock(); + $filterMock->expects($this->once()) + ->method('getConditionType') + ->willReturn(null); + $filterMock->expects($this->once()) + ->method('getField') + ->willReturn($field); + $filterMock->expects($this->once()) + ->method('getValue') + ->willReturn($value); + + $filterGroupMock = $this->getMockBuilder('Magento\Framework\Api\Search\FilterGroup') + ->disableOriginalConstructor() + ->getMock(); + $filterGroupMock->expects($this->once()) + ->method('getFilters') + ->willReturn([$filterMock]); + + $criteriaMock = $this->getMockBuilder('Magento\Framework\Api\SearchCriteria') + ->disableOriginalConstructor() + ->getMock(); + $criteriaMock->expects($this->once()) + ->method('getFilterGroups') + ->willReturn([$filterGroupMock]); + + $this->getProductOptionExtensionMock(); + $productOption = $this->getProductOptionMock(); + $orderItemMock = $this->getOrderMock($productType, $productOption); + + $searchResultMock = $this->getMockBuilder('Magento\Sales\Api\Data\OrderItemSearchResultInterface') + ->setMethods([ + 'addFieldToFilter', + 'getItems', + ]) + ->getMockForAbstractClass(); + $searchResultMock->expects($this->once()) + ->method('addFieldToFilter') + ->with($field, ['eq' => $value]) + ->willReturnSelf(); + $searchResultMock->expects($this->once()) + ->method('getItems') + ->willReturn([$orderItemMock]); + + $this->searchResultFactory->expects($this->once()) + ->method('create') + ->willReturn($searchResultMock); + + $model = $this->getModel($orderItemMock, $productType); + $this->assertSame($searchResultMock, $model->getList($criteriaMock)); + } + + public function testDeleteById() + { + $orderItemId = 1; + $productType = 'configurable'; + + $requestMock = $this->getMockBuilder('Magento\Framework\DataObject') + ->disableOriginalConstructor() + ->getMock(); + + $orderItemMock = $this->getMockBuilder('Magento\Sales\Model\Order\Item') + ->disableOriginalConstructor() + ->getMock(); + $orderItemMock->expects($this->once()) + ->method('getItemId') + ->willReturn($orderItemId); + $orderItemMock->expects($this->once()) + ->method('getProductType') + ->willReturn($productType); + $orderItemMock->expects($this->once()) + ->method('getBuyRequest') + ->willReturn($requestMock); + + $orderItemResourceMock = $this->getMockBuilder('Magento\Framework\Model\Resource\Db\AbstractDb') + ->disableOriginalConstructor() + ->getMock(); + $orderItemResourceMock->expects($this->once()) + ->method('delete') + ->with($orderItemMock) + ->willReturnSelf(); + $orderItemResourceMock->expects($this->once()) + ->method('load') + ->with($orderItemMock, $orderItemId) + ->willReturnSelf(); + + $this->metadata->expects($this->once()) + ->method('getNewInstance') + ->willReturn($orderItemMock); + $this->metadata->expects($this->exactly(2)) + ->method('getMapper') + ->willReturn($orderItemResourceMock); + + $model = $this->getModel($orderItemMock, $productType); + $this->assertTrue($model->deleteById($orderItemId)); + } + + /** + * @param \PHPUnit_Framework_MockObject_MockObject $orderItemMock + * @param string $productType + * @param array $data + * @return ItemRepository + */ + protected function getModel( + \PHPUnit_Framework_MockObject_MockObject $orderItemMock, + $productType, + array $data = [] + ) { + $requestMock = $this->getMockBuilder('Magento\Framework\DataObject') + ->disableOriginalConstructor() + ->getMock(); + + $requestUpdateMock = $this->getMockBuilder('Magento\Framework\DataObject') + ->disableOriginalConstructor() + ->getMock(); + $requestUpdateMock->expects($this->any()) + ->method('getData') + ->willReturn($data); + + $this->productOptionProcessorMock = $this->getMockBuilder( + 'Magento\Catalog\Model\ProductOptionProcessorInterface' + ) + ->getMockForAbstractClass(); + $this->productOptionProcessorMock->expects($this->any()) + ->method('convertToProductOption') + ->with($requestMock) + ->willReturn($this->productOptionData); + $this->productOptionProcessorMock->expects($this->any()) + ->method('convertToBuyRequest') + ->with($orderItemMock) + ->willReturn($requestUpdateMock); + + $model = new ItemRepository( + $this->objectFactory, + $this->metadata, + $this->searchResultFactory, + $this->productOptionFactory, + $this->extensionFactory, + [ + $productType => $this->productOptionProcessorMock, + 'custom_options' => $this->productOptionProcessorMock, + ] + ); + return $model; + } + + /** + * @param string $productType + * @param \PHPUnit_Framework_MockObject_MockObject $productOption + * @return \PHPUnit_Framework_MockObject_MockObject + */ + protected function getOrderMock($productType, $productOption) + { + $requestMock = $this->getMockBuilder('Magento\Framework\DataObject') + ->disableOriginalConstructor() + ->getMock(); + + $orderItemMock = $this->getMockBuilder('Magento\Sales\Model\Order\Item') + ->disableOriginalConstructor() + ->getMock(); + $orderItemMock->expects($this->once()) + ->method('getProductType') + ->willReturn($productType); + $orderItemMock->expects($this->once()) + ->method('getBuyRequest') + ->willReturn($requestMock); + $orderItemMock->expects($this->any()) + ->method('getProductOption') + ->willReturn(null); + $orderItemMock->expects($this->any()) + ->method('setProductOption') + ->with($productOption) + ->willReturnSelf(); + + return $orderItemMock; + } + + /** + * @return \PHPUnit_Framework_MockObject_MockObject + */ + protected function getProductOptionMock() + { + $productOption = $this->getMockBuilder('Magento\Catalog\Api\Data\ProductOptionInterface') + ->getMockForAbstractClass(); + $productOption->expects($this->any()) + ->method('getExtensionAttributes') + ->willReturn(null); + + $this->productOptionFactory->expects($this->any()) + ->method('create') + ->willReturn($productOption); + + return $productOption; + } + + protected function getProductOptionExtensionMock() + { + $productOptionExtension = $this->getMockBuilder('Magento\Catalog\Api\Data\ProductOptionExtensionInterface') + ->setMethods([ + 'setData', + ]) + ->getMockForAbstractClass(); + $productOptionExtension->expects($this->any()) + ->method('setData') + ->with(key($this->productOptionData), current($this->productOptionData)) + ->willReturnSelf(); + + $this->extensionFactory->expects($this->any()) + ->method('create') + ->willReturn($productOptionExtension); + } +} diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/Config/XsdTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/Config/XsdTest.php index 587a138afaa4f18147fedd61e003d688c3baff87..df9683026fa7b298b8f7628cf1b8e4619e3957bc 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/Config/XsdTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/Config/XsdTest.php @@ -21,8 +21,9 @@ class XsdTest extends \PHPUnit_Framework_TestCase public static function setUpBeforeClass() { - self::$_schemaPath = BP . '/app/code/Magento/Sales/etc/pdf.xsd'; - self::$_schemaFilePath = BP . '/app/code/Magento/Sales/etc/pdf_file.xsd'; + $urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + self::$_schemaPath = $urnResolver->getRealPath('urn:magento:module:Magento_Sales:etc/pdf.xsd'); + self::$_schemaFilePath = $urnResolver->getRealPath('urn:magento:module:Magento_Sales:etc/pdf_file.xsd'); } /** diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/Config/_files/pdf_merged.xml b/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/Config/_files/pdf_merged.xml index e05d9e0262ff97687f466c85948e37edffa736e0..2a0b3264d1471c45bd6222bf83cecaa27f2b9cc8 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/Config/_files/pdf_merged.xml +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/Config/_files/pdf_merged.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../app/code/Magento/Sales/etc/pdf_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Sales:etc/pdf_file.xsd"> <renderers> <page type="type_one"> <renderer product_type="product_type_one">Renderer\Type\One\Product\One</renderer> diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/Config/_files/pdf_one.xml b/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/Config/_files/pdf_one.xml index 5e5a7124bc7d09d19a57ee2ee5ae91f2f3625d69..03c78fc0bc84b41e4bd1914578d4d9c7e13bd2cc 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/Config/_files/pdf_one.xml +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/Config/_files/pdf_one.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../app/code/Magento/Sales/etc/pdf_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Sales:etc/pdf_file.xsd"> <renderers> <page type="type_one"> <renderer product_type="product_type_one">Renderer\Type\One\Product\One</renderer> diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/Config/_files/pdf_two.xml b/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/Config/_files/pdf_two.xml index 7ba6fe367169a0999fbabbe895640fbe66c607b5..a13392937ce65c18b0b53cd044546f17e033536a 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/Config/_files/pdf_two.xml +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/Config/_files/pdf_two.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../app/code/Magento/Sales/etc/pdf_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Sales:etc/pdf_file.xsd"> <renderers> <page type="type_one"> <renderer product_type="product_type_two">Renderer\Type\One\Product\Two</renderer> diff --git a/app/code/Magento/Sales/Test/Unit/Model/Resource/Order/RelationTest.php b/app/code/Magento/Sales/Test/Unit/Model/Resource/Order/RelationTest.php index be73d50dff71f3d61e2e7f3af41fc4e352420517..260d75f12467ab523bfef212daa9220073d25230 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Resource/Order/RelationTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Resource/Order/RelationTest.php @@ -21,9 +21,9 @@ class RelationTest extends \PHPUnit_Framework_TestCase protected $addressHandlerMock; /** - * @var \Magento\Sales\Model\Resource\Order\Item|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Sales\Api\OrderItemRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject */ - protected $orderItemResourceMock; + protected $orderItemRepositoryMock; /** * @var \Magento\Sales\Model\Resource\Order\Payment|\PHPUnit_Framework_MockObject_MockObject @@ -71,14 +71,14 @@ class RelationTest extends \PHPUnit_Framework_TestCase ] ) ->getMock(); - $this->orderItemResourceMock = $this->getMockBuilder('Magento\Sales\Model\Resource\Order\Item') + $this->orderItemRepositoryMock = $this->getMockBuilder('Magento\Sales\Api\OrderItemRepositoryInterface') ->disableOriginalConstructor() ->setMethods( [ 'save' ] ) - ->getMock(); + ->getMockForAbstractClass(); $this->orderPaymentResourceMock = $this->getMockBuilder('Magento\Sales\Model\Resource\Order\Payment') ->disableOriginalConstructor() ->setMethods( @@ -154,7 +154,7 @@ class RelationTest extends \PHPUnit_Framework_TestCase ->getMock(); $this->relationProcessor = new \Magento\Sales\Model\Resource\Order\Relation( $this->addressHandlerMock, - $this->orderItemResourceMock, + $this->orderItemRepositoryMock, $this->orderPaymentResourceMock, $this->statusHistoryResource ); @@ -184,7 +184,7 @@ class RelationTest extends \PHPUnit_Framework_TestCase ->method('setOrder') ->with($this->orderMock) ->willReturnSelf(); - $this->orderItemResourceMock->expects($this->once()) + $this->orderItemRepositoryMock->expects($this->once()) ->method('save') ->with($this->orderItemMock) ->willReturnSelf(); diff --git a/app/code/Magento/Sales/composer.json b/app/code/Magento/Sales/composer.json index 003e0261f37776db2079f76bbb13128a497f2a7f..077a1ef5590d84199bb0e11a02db4895b5369629 100644 --- a/app/code/Magento/Sales/composer.json +++ b/app/code/Magento/Sales/composer.json @@ -26,8 +26,7 @@ "magento/module-media-storage": "1.0.0-beta", "magento/framework": "1.0.0-beta", "magento/module-ui": "1.0.0-beta", - "magento/module-quote": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/module-quote": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -35,12 +34,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Sales" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Sales\\": "" + } } } diff --git a/app/code/Magento/Sales/etc/acl.xml b/app/code/Magento/Sales/etc/acl.xml index d9f770e7ddca3452babbd99f42c99fad876081b5..2f233ff8ecb8266d56e3532fa9444c36204c322d 100644 --- a/app/code/Magento/Sales/etc/acl.xml +++ b/app/code/Magento/Sales/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/app/code/Magento/Sales/etc/adminhtml/di.xml b/app/code/Magento/Sales/etc/adminhtml/di.xml index 528c437df8381bd17133e7bcd1b863dd6216c92d..29b68eb5c4726f3d7c241ea2bc56f96497648c9a 100644 --- a/app/code/Magento/Sales/etc/adminhtml/di.xml +++ b/app/code/Magento/Sales/etc/adminhtml/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Framework\App\Rss\RssManagerInterface"> <arguments> <argument name="dataProviders" xsi:type="array"> diff --git a/app/code/Magento/Sales/etc/adminhtml/events.xml b/app/code/Magento/Sales/etc/adminhtml/events.xml index ed270305f3d86e05b883062349d31e7324df19e7..10a8f3a457bcd9ab8b3d8edf53d03fde90730849 100644 --- a/app/code/Magento/Sales/etc/adminhtml/events.xml +++ b/app/code/Magento/Sales/etc/adminhtml/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="catalog_product_delete_before"> <observer name="sales_quote_observer" instance="Magento\Sales\Model\Observer\Backend\CatalogProductQuote" method="subtractQtyFromQuotes" /> </event> diff --git a/app/code/Magento/Sales/etc/adminhtml/menu.xml b/app/code/Magento/Sales/etc/adminhtml/menu.xml index 5ac5692d92c3dc51a9748f6b53687f462ef05726..2865c6d5cbd956f602327221f44db498003bff94 100644 --- a/app/code/Magento/Sales/etc/adminhtml/menu.xml +++ b/app/code/Magento/Sales/etc/adminhtml/menu.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Backend/etc/menu.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd"> <menu> <add id="Magento_Sales::sales" title="Sales" module="Magento_Sales" sortOrder="15" dependsOnModule="Magento_Sales" resource="Magento_Sales::sales"/> <add id="Magento_Sales::sales_operation" title="Operations" module="Magento_Sales" sortOrder="10" parent="Magento_Sales::sales" resource="Magento_Sales::sales_operation" /> diff --git a/app/code/Magento/Sales/etc/adminhtml/routes.xml b/app/code/Magento/Sales/etc/adminhtml/routes.xml index 8e9b6be88593dcee9f16eea91fad636a3c59b515..7ff830d0814f2d38e8211cea203083106f983c1c 100644 --- a/app/code/Magento/Sales/etc/adminhtml/routes.xml +++ b/app/code/Magento/Sales/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="admin"> <route id="sales" frontName="sales"> <module name="Magento_Sales" before="Magento_Backend" /> diff --git a/app/code/Magento/Sales/etc/adminhtml/system.xml b/app/code/Magento/Sales/etc/adminhtml/system.xml index 1938482966e4fd0d94fc70a0211fec6f147deff5..2d242a4f2dc111a2440ec25a0a13c5daf16f908e 100644 --- a/app/code/Magento/Sales/etc/adminhtml/system.xml +++ b/app/code/Magento/Sales/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <tab id="sales" translate="label" sortOrder="400"> <label>Sales</label> diff --git a/app/code/Magento/Sales/etc/catalog_attributes.xml b/app/code/Magento/Sales/etc/catalog_attributes.xml index 5d5be045cb9a1c1444e75e7cbd0543181574167a..5fb99d05e9f67f010c54b317f1c39dccd0574e64 100644 --- a/app/code/Magento/Sales/etc/catalog_attributes.xml +++ b/app/code/Magento/Sales/etc/catalog_attributes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Catalog/etc/catalog_attributes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/catalog_attributes.xsd"> <group name="quote_item"> <attribute name="sku"/> <attribute name="type_id"/> diff --git a/app/code/Magento/Sales/etc/config.xml b/app/code/Magento/Sales/etc/config.xml index 989b0b8b46844380e53ef66b929f2963e6823f01..e4cab0446f937559d9fc5d383011f0959b4d91ed 100644 --- a/app/code/Magento/Sales/etc/config.xml +++ b/app/code/Magento/Sales/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <sales> <totals_sort> diff --git a/app/code/Magento/Sales/etc/crontab.xml b/app/code/Magento/Sales/etc/crontab.xml index 92ae163b63b3022ce99759786b7bc9717509be8c..177ac5afa4c2e6bc4389be22a3ce0ab84778e517 100644 --- a/app/code/Magento/Sales/etc/crontab.xml +++ b/app/code/Magento/Sales/etc/crontab.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Cron/etc/crontab.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd"> <group id="default"> <job name="sales_clean_quotes" instance="Magento\Sales\Model\Observer\CleanExpiredQuotes" method="execute"> <schedule>0 0 * * *</schedule> diff --git a/app/code/Magento/Sales/etc/di.xml b/app/code/Magento/Sales/etc/di.xml index 68bba9acc8f9b133300025ff2aa12fc04b7a0157..91ee4095b571ef5269f368410f011055fb6b5cea 100644 --- a/app/code/Magento/Sales/etc/di.xml +++ b/app/code/Magento/Sales/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Sales\Api\Data\CreditmemoCommentInterface" type="Magento\Sales\Model\Order\Creditmemo\Comment"/> <preference for="Magento\Sales\Api\Data\CreditmemoCommentSearchResultInterface" type="Magento\Sales\Model\Resource\Order\Creditmemo\Comment\Collection"/> <preference for="Magento\Sales\Api\Data\CreditmemoInterface" type="Magento\Sales\Model\Order\Creditmemo"/> @@ -47,7 +47,7 @@ <preference for="Magento\Sales\Api\InvoiceRepositoryInterface" type="Magento\Sales\Model\Order\InvoiceRepository"/> <preference for="Magento\Sales\Api\InvoiceManagementInterface" type="Magento\Sales\Model\Service\InvoiceService"/> <preference for="Magento\Sales\Api\OrderAddressRepositoryInterface" type="Magento\Sales\Model\Order\AddressRepository"/> - <preference for="Magento\Sales\Api\OrderItemRepositoryInterface" type="Magento\Sales\Api\Data\OrderItem\Repository"/> + <preference for="Magento\Sales\Api\OrderItemRepositoryInterface" type="Magento\Sales\Model\Order\ItemRepository"/> <preference for="Magento\Sales\Api\OrderPaymentRepositoryInterface" type="Magento\Sales\Model\Order\Payment\Repository"/> <preference for="Magento\Sales\Api\OrderRepositoryInterface" type="Magento\Sales\Model\OrderRepository"/> <preference for="Magento\Sales\Api\OrderManagementInterface" type="Magento\Sales\Model\Service\OrderService"/> @@ -670,6 +670,12 @@ <argument name="modelClassName" xsi:type="string">Magento\Sales\Model\Order</argument> </arguments> </virtualType> + <virtualType name="orderItemMetadata" type="Magento\Sales\Model\Resource\Metadata"> + <arguments> + <argument name="resourceClassName" xsi:type="string">Magento\Sales\Model\Resource\Order\Item</argument> + <argument name="modelClassName" xsi:type="string">Magento\Sales\Model\Order\Item</argument> + </arguments> + </virtualType> <virtualType name="invoiceMetadata" type="Magento\Sales\Model\Resource\Metadata"> <arguments> <argument name="resourceClassName" xsi:type="string">Magento\Sales\Model\Resource\Order\Invoice</argument> @@ -711,6 +717,11 @@ <argument name="metadata" xsi:type="object">orderMetadata</argument> </arguments> </type> + <type name="Magento\Sales\Model\Order\ItemRepository"> + <arguments> + <argument name="metadata" xsi:type="object">orderItemMetadata</argument> + </arguments> + </type> <type name="Magento\Sales\Model\Order\InvoiceRepository"> <arguments> <argument name="invoiceMetadata" xsi:type="object">invoiceMetadata</argument> diff --git a/app/code/Magento/Sales/etc/email_templates.xml b/app/code/Magento/Sales/etc/email_templates.xml index d95211657aa2d8779b19240f09b0187898bba872..3d8f9c2a590949716951e4351969e7a43ca0d254 100644 --- a/app/code/Magento/Sales/etc/email_templates.xml +++ b/app/code/Magento/Sales/etc/email_templates.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Email/etc/email_templates.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Email:etc/email_templates.xsd"> <template id="sales_email_order_template" label="New Order" file="order_new.html" type="html" module="Magento_Sales" area="frontend"/> <template id="sales_email_order_guest_template" label="New Order for Guest" file="order_new_guest.html" type="html" module="Magento_Sales" area="frontend"/> <template id="sales_email_order_comment_template" label="Order Update" file="order_update.html" type="html" module="Magento_Sales" area="frontend"/> diff --git a/app/code/Magento/Sales/etc/events.xml b/app/code/Magento/Sales/etc/events.xml index e00667c4b00b6bce3b75ee0b7ce933961c16b74d..3650bd768afda158e9003f93932cb3eb06d834fe 100644 --- a/app/code/Magento/Sales/etc/events.xml +++ b/app/code/Magento/Sales/etc/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="sales_order_place_after"> <observer name="sales_vat_request_params_order_comment" instance="Magento\Sales\Model\Observer\Frontend\Quote\AddVatRequestParamsOrderComment" method="execute" /> </event> diff --git a/app/code/Magento/Sales/etc/fieldset.xml b/app/code/Magento/Sales/etc/fieldset.xml index 1720b5f3c1138eb450cc016dc91c35857c6a6445..ec8fa9affb9e2c9fc8c3a880fc581f65da286366 100644 --- a/app/code/Magento/Sales/etc/fieldset.xml +++ b/app/code/Magento/Sales/etc/fieldset.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/DataObject/etc/fieldset.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:framework:DataObject/etc/fieldset.xsd"> <scope id="global"> <fieldset id="sales_copy_order"> <field name="customer_email"> diff --git a/app/code/Magento/Sales/etc/frontend/di.xml b/app/code/Magento/Sales/etc/frontend/di.xml index aaa767fae649ce7ebb7300541c491dbd15216dd4..bc8e0dcbdbb47c477e8fd7e156be100b3a9b0c47 100644 --- a/app/code/Magento/Sales/etc/frontend/di.xml +++ b/app/code/Magento/Sales/etc/frontend/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Sales\Controller\AbstractController\OrderLoaderInterface" type="\Magento\Sales\Controller\AbstractController\OrderLoader" /> <preference for="Magento\Sales\Controller\AbstractController\OrderViewAuthorizationInterface" type="\Magento\Sales\Controller\AbstractController\OrderViewAuthorization" /> <type name="Magento\Framework\Url\SecurityInfo"> diff --git a/app/code/Magento/Sales/etc/frontend/events.xml b/app/code/Magento/Sales/etc/frontend/events.xml index 763c0dcd5bc94cdd50da178debad4dc3146dd207..85c7449ce2dd685413f9a927d7043f1a2b0cae25 100644 --- a/app/code/Magento/Sales/etc/frontend/events.xml +++ b/app/code/Magento/Sales/etc/frontend/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="sales_quote_address_collect_totals_after"> <observer name="sales_customer_validate_vat_number" instance="Magento\Sales\Model\Observer\Frontend\Quote\RestoreCustomerGroupId" method="execute" /> </event> diff --git a/app/code/Magento/Sales/etc/frontend/page_types.xml b/app/code/Magento/Sales/etc/frontend/page_types.xml index 701945902468273674ca3f9b0b4a271794232380..3d671cdd553c6fb8c1dad38f63e2dfd6b437c653 100644 --- a/app/code/Magento/Sales/etc/frontend/page_types.xml +++ b/app/code/Magento/Sales/etc/frontend/page_types.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page_types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_types.xsd"> +<page_types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_types.xsd"> <type id="sales_guest_creditmemo" label="Guest Order Creditmemo View"/> <type id="sales_guest_form" label="Returns"/> <type id="sales_guest_invoice" label="Guest Order Invoice View"/> diff --git a/app/code/Magento/Sales/etc/frontend/routes.xml b/app/code/Magento/Sales/etc/frontend/routes.xml index db3e86e5273264fc987522d810ea7868ec3280c2..94ddb1c272d945599da5152fc473871562aafa44 100644 --- a/app/code/Magento/Sales/etc/frontend/routes.xml +++ b/app/code/Magento/Sales/etc/frontend/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn: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/etc/frontend/sections.xml b/app/code/Magento/Sales/etc/frontend/sections.xml index 3f35aec9e8e3061fc2230378bc3dca4a2a95ce86..647b5d9a4fcead09ac7a28f8135bd696f7508b17 100644 --- a/app/code/Magento/Sales/etc/frontend/sections.xml +++ b/app/code/Magento/Sales/etc/frontend/sections.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../Magento/Customer/etc/sections.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd"> <action name="sales/guest/reorder"> <section name="cart"/> </action> diff --git a/app/code/Magento/Sales/etc/module.xml b/app/code/Magento/Sales/etc/module.xml index 294eb87cb25482a436b551daaa0adf30639299b8..6ad917d859b9b403b2c2120aeb42deff3518130d 100644 --- a/app/code/Magento/Sales/etc/module.xml +++ b/app/code/Magento/Sales/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Sales" setup_version="2.0.0"> <sequence> <module name="Magento_Rule"/> diff --git a/app/code/Magento/Sales/etc/pdf.xml b/app/code/Magento/Sales/etc/pdf.xml index cfcf7f9226c2baec842a74d6ee6d7be657791c22..1e2d52d49d9087f91e139da722be14fb2e4356e0 100644 --- a/app/code/Magento/Sales/etc/pdf.xml +++ b/app/code/Magento/Sales/etc/pdf.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Sales/etc/pdf_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Sales:etc/pdf_file.xsd"> <renderers> <page type="invoice"> <renderer product_type="default">Magento\Sales\Model\Order\Pdf\Items\Invoice\DefaultInvoice</renderer> diff --git a/app/code/Magento/Sales/etc/resources.xml b/app/code/Magento/Sales/etc/resources.xml index 14e3ed4378b17c6c81f8463e0c9410ce657fca0a..6f8225b07927ffb59567cecd8b456816dc30180b 100644 --- a/app/code/Magento/Sales/etc/resources.xml +++ b/app/code/Magento/Sales/etc/resources.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/App/etc/resources.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/resources.xsd"> <resource name="sales_setup" extends="core_setup" /> <resource name="sales" extends="core" /> </config> diff --git a/app/code/Magento/Sales/etc/sales.xml b/app/code/Magento/Sales/etc/sales.xml index eece169179b8589f1849f8813cfac238ed2778e8..8671f73a7236e8ff641eb554a0657f33bc72463a 100644 --- a/app/code/Magento/Sales/etc/sales.xml +++ b/app/code/Magento/Sales/etc/sales.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Sales/etc/sales.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Sales:etc/sales.xsd"> <section name="order_invoice"> <group name="totals"> <item name="subtotal" instance="Magento\Sales\Model\Order\Invoice\Total\Subtotal" sort_order="50"/> diff --git a/app/code/Magento/Sales/etc/webapi.xml b/app/code/Magento/Sales/etc/webapi.xml index 3acea225b21ec3373d305834fc84f60332f8d39e..ea4366f9dfd29de782d44d793b73dcbae68cd711 100644 --- a/app/code/Magento/Sales/etc/webapi.xml +++ b/app/code/Magento/Sales/etc/webapi.xml @@ -6,7 +6,7 @@ */ --> <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../app/code/Magento/Webapi/etc/webapi.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd"> <route url="/V1/orders/:id" method="GET"> <service class="Magento\Sales\Api\OrderRepositoryInterface" method="get"/> <resources> @@ -73,6 +73,18 @@ <resource ref="Magento_Sales::sales" /> </resources> </route> + <route url="/V1/orders/items/:id" method="GET"> + <service class="Magento\Sales\Api\OrderItemRepositoryInterface" method="get"/> + <resources> + <resource ref="Magento_Sales::sales" /> + </resources> + </route> + <route url="/V1/orders/items" method="GET"> + <service class="Magento\Sales\Api\OrderItemRepositoryInterface" method="getList"/> + <resources> + <resource ref="Magento_Sales::sales" /> + </resources> + </route> <route url="/V1/invoices/:id" method="GET"> <service class="Magento\Sales\Api\InvoiceRepositoryInterface" method="get"/> <resources> diff --git a/app/code/Magento/Sales/etc/webapi_rest/di.xml b/app/code/Magento/Sales/etc/webapi_rest/di.xml index 2c7c118bd147a2b945da1efccd1bad6d25c2360d..756c0aa11178c86cb1c831b021aa357f70b022d0 100644 --- a/app/code/Magento/Sales/etc/webapi_rest/di.xml +++ b/app/code/Magento/Sales/etc/webapi_rest/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Quote\Model\QuoteRepository"> <plugin name="authorization" type="Magento\Quote\Model\QuoteRepository\Plugin\Authorization" /> </type> diff --git a/app/code/Magento/Sales/etc/webapi_rest/events.xml b/app/code/Magento/Sales/etc/webapi_rest/events.xml index 763c0dcd5bc94cdd50da178debad4dc3146dd207..85c7449ce2dd685413f9a927d7043f1a2b0cae25 100644 --- a/app/code/Magento/Sales/etc/webapi_rest/events.xml +++ b/app/code/Magento/Sales/etc/webapi_rest/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="sales_quote_address_collect_totals_after"> <observer name="sales_customer_validate_vat_number" instance="Magento\Sales\Model\Observer\Frontend\Quote\RestoreCustomerGroupId" method="execute" /> </event> diff --git a/app/code/Magento/Sales/etc/webapi_soap/di.xml b/app/code/Magento/Sales/etc/webapi_soap/di.xml index 2c7c118bd147a2b945da1efccd1bad6d25c2360d..756c0aa11178c86cb1c831b021aa357f70b022d0 100644 --- a/app/code/Magento/Sales/etc/webapi_soap/di.xml +++ b/app/code/Magento/Sales/etc/webapi_soap/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Quote\Model\QuoteRepository"> <plugin name="authorization" type="Magento\Quote\Model\QuoteRepository\Plugin\Authorization" /> </type> diff --git a/app/code/Magento/Sales/etc/webapi_soap/events.xml b/app/code/Magento/Sales/etc/webapi_soap/events.xml index 763c0dcd5bc94cdd50da178debad4dc3146dd207..85c7449ce2dd685413f9a927d7043f1a2b0cae25 100644 --- a/app/code/Magento/Sales/etc/webapi_soap/events.xml +++ b/app/code/Magento/Sales/etc/webapi_soap/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="sales_quote_address_collect_totals_after"> <observer name="sales_customer_validate_vat_number" instance="Magento\Sales\Model\Observer\Frontend\Quote\RestoreCustomerGroupId" method="execute" /> </event> diff --git a/app/code/Magento/Sales/etc/widget.xml b/app/code/Magento/Sales/etc/widget.xml index e9a34ab4cec7a1a0f157396273e0bff2d0a74e44..d7fe7ae6165d3feb0455c397648758ab378e2cce 100644 --- a/app/code/Magento/Sales/etc/widget.xml +++ b/app/code/Magento/Sales/etc/widget.xml @@ -6,7 +6,7 @@ */ --> <widgets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../Magento/Widget/etc/widget.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Widget:etc/widget.xsd"> <widget id="sales_widget_guestfrom" class="Magento\Sales\Block\Widget\Guest\Form" is_email_compatible="true"> <label translate="true">Orders and Returns</label> <description translate="true">Orders and Returns Search Form</description> diff --git a/app/code/Magento/Sales/registration.php b/app/code/Magento/Sales/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..36ed3ebc3652e25a36abfb0da2b0cdd34e83d6a7 --- /dev/null +++ b/app/code/Magento/Sales/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Sales', + __DIR__ +); diff --git a/app/code/Magento/Sales/view/adminhtml/layout/customer_index_edit.xml b/app/code/Magento/Sales/view/adminhtml/layout/customer_index_edit.xml index b5de5df96a33838f520c890d682404ba1cc4e096..0e746f6b67a35e449400d43a8ba23c883fbd079a 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/customer_index_edit.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/customer_index_edit.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="customer_form"> <block acl="Magento_Sales::actions_view" class="Magento\Sales\Block\Adminhtml\CustomerOrdersTab" name="orders" /> 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 index 7ce11ea953bc4d0309f241150fa148018f05f164..a89d8723f26fce3e17e580ba86b6ecd2e749c3fe 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_exportcsv.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_exportcsv.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="sales_creditmemo_grid_block"/> <body> <block class="Magento\Backend\Block\Widget\Grid\Container" name="sales_creditmemo.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> 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 index 7ce11ea953bc4d0309f241150fa148018f05f164..a89d8723f26fce3e17e580ba86b6ecd2e749c3fe 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_exportexcel.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_exportexcel.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="sales_creditmemo_grid_block"/> <body> <block class="Magento\Backend\Block\Widget\Grid\Container" name="sales_creditmemo.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> 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 index 79e7978b2afd789a0a675fbca5d2fda14711d760..d3ea5770232d805e5424dcd355de02cc36cd0729 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_grid.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_grid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <update handle="formkey"/> <update handle="sales_creditmemo_grid_block"/> <container name="root"> 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 index 6b970cc8cf956b40389db5876903f3c307cd8aca..d06a77ba3bea8809226b62c141d9cd6ed2b9390a 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_index.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="styles"/> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_item_price.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_item_price.xml index 3c8f2795c11ab347de5c747f86c59fecf9a900c0..2b8c76d9ac8b467ae9bc585c56c7f76ad639253e 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_item_price.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_item_price.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="creditmemo_items"> <block class="Magento\Sales\Block\Adminhtml\Items\Column\DefaultColumn" name="column_price" template="items/price/unit.phtml" group="column"/> 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 index 8bc2d4fa67d0567d621db9552b1a5de9d65c5c4d..4915273a95732beebc13cadcdb3a1d6b6f4ce10b 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_exportcsv.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_exportcsv.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="sales_invoice_grid_block"/> <body> <block class="Magento\Backend\Block\Widget\Grid\Container" name="sales_invoice.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> 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 index 8bc2d4fa67d0567d621db9552b1a5de9d65c5c4d..4915273a95732beebc13cadcdb3a1d6b6f4ce10b 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_exportexcel.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_exportexcel.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="sales_invoice_grid_block"/> <body> <block class="Magento\Backend\Block\Widget\Grid\Container" name="sales_invoice.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> 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 index cb46fdc733de7722bc6eba59ad172756a9aa74f4..cede96df77f02001a03ba077d5aceb2d48cb56ec 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_grid.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_grid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <update handle="formkey"/> <update handle="sales_invoice_grid_block"/> <container name="root"> 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 index fd5defa33f9fc9a9aca2c79ebd83dcfaef4ab200..b04ec2b108a0f4e4c1afb42e5c5fe6e06ac2e3a3 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_index.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="styles"/> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_item_price.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_item_price.xml index e6cbc46e2738e124bcac01da54cc5a4380ef29e5..2658089b926a691cee6dc712bda52c1394fb05fd 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_item_price.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_item_price.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="invoice_items"> <block class="Magento\Sales\Block\Adminhtml\Items\Column\DefaultColumn" name="column_price" template="items/price/unit.phtml" group="column"/> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_addcomment.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_addcomment.xml index ec89dd89af8c52206179cc23581ba45176e31b5b..97afd919addff7ad2a3869e201b4517d0c072752 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_addcomment.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_addcomment.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root"> <block class="Magento\Sales\Block\Adminhtml\Order\View\History" name="order_history" template="order/view/history.phtml"/> </container> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_address.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_address.xml index bb63c8b255e7071eaa9c7fba327cdd9012cd4807..5467f591cc4d7002284ce7a9ce186ee3cb3957fb 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_address.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_address.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Address" name="sales_order_address.form.container"/> 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 10f39ea6e94a09d42795c932bf3c761014a4c101..cae60f1a945f464dbdad708cb16ab73ac54998e4 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 @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="customer.grid.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.customer.grid.container" as="grid"> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_index.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_index.xml index edb3ca36ad8887aa4beb1962b3558795a645b29f..f53fb06fe00f4ee3f8961d55c252593eb7e9f997 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_index.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="sales_order_create_customer_block"/> <head> <link src="Magento_Sales::js/bootstrap/order-create-index.js"/> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_item_price.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_item_price.xml index 29fb429c0111f8b160f65cf6e40c329c10c9e238..92428d299515312a8a13d98a0fa0746d1091aaf0 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_item_price.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_item_price.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Items\Grid" name="item_unit_price" template="order/create/items/price/unit.phtml"/> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Items\Grid" name="item_row_total" template="order/create/items/price/row.phtml"/> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_billing_address.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_billing_address.xml index 95752b101a6522d9d12ce03ed6c36f2d8ccf731c..577b7591b9a7a2fb5a44205a7593347e5f68e8fd 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_billing_address.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_billing_address.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Billing\Address" template="order/create/form/address.phtml" name="billing_address"/> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_billing_method.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_billing_method.xml index fa025920c66ed1121f62bfccd05d79842c9a9b1c..1fd4e9bf622cbe7ae3de7a903ae835bfb9002049 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_billing_method.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_billing_method.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Billing\Method" template="order/create/abstract.phtml" name="billing_method"> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_comment.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_comment.xml index f6152fb6a90a8c2bfb2269b32c9cab1010398a18..4fdca4dfbc4c1f498ad4983d2e483b5718f2650d 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_comment.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_comment.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Comment" template="order/create/comment.phtml" name="comment"/> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_customer_grid.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_customer_grid.xml index e7ae8551ce774e35913b24bbaeae0caba7e9e7ae..63453a607e365dd3d05153052c7b57f74d794d3a 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_customer_grid.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_customer_grid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <update handle="sales_order_create_customer_block"/> <referenceContainer name="content"> <block class="Magento\Backend\Block\Widget\Grid\Container" name="customer.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_data.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_data.xml index a103ac8550b572a6a53af60ff1e82d21303199f6..80e48a0b0645bf57e2fde9bd8298b7ba903869df 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_data.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_data.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="sales_order_create_item_price"/> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_form_account.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_form_account.xml index 567223a811fb30a81e07202bc2b8ee83b7e49418..42cc95a76983f03ebf57be3a65cc07713c400de1 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_form_account.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_form_account.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Form\Account" template="order/create/form/account.phtml" name="form_account"/> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_giftmessage.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_giftmessage.xml index 7b33b24325b7173d98763a027f0ee9078e7edf54..89dc3d282df08c2943d644452aa0df18265bb5e0 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_giftmessage.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_giftmessage.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Giftmessage" template="order/create/giftmessage.phtml" name="giftmessage"/> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_header.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_header.xml index 35f28ec04a16db8488784681f79676d899c76cb0..224f72c7f963a3f09a7968805e3d5dedebb2a4e9 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_header.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_header.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Header" name="header"/> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_items.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_items.xml index 41daae5a2f93007eeef85e32436aaea8b6bced4d..9003cb33b027153ee34ded795232cd42ae8a6068 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_items.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_items.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="sales_order_create_item_price"/> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_json.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_json.xml index 2b153d1598b2ef9fbdda55add57db97e0a4ebada..039551a33b1ee90407be84c1b3146aa3cbbde7bf 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_json.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_json.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="backend.page"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Load" name="content"/> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_message.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_message.xml index ae8ba5ece717c692439aa0e656a144cb3cfb0fd4..e9d5c88bd9d1503c117413a4be29c98cb68f63b8 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_message.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_message.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Messages" name="message"/> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_newsletter.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_newsletter.xml index 2dfa9eec75041c44f8e40c28d922e229253a861d..e72e635afe624fafc227713bd3760ebdd0a4bb2e 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_newsletter.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_newsletter.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Newsletter" template="order/create/abstract.phtml" name="newsletter"> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_plain.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_plain.xml index dd51732cc6e3002e804834b002dbea7867a96cbe..74eae88d8ccbb75b0051e3974b5ac19d3349684b 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_plain.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_plain.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="backend.page"> <container name="content" label="Content"/> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_search.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_search.xml index 548f70e50b93e92936e21d91d5a45d4424b6b5a1..8696c320fbc3c3290d71ed0dc263cd8bac221a46 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_search.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_search.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Search" template="order/create/abstract.phtml" name="search"> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_search_grid.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_search_grid.xml index d4d8979487da7f9e0cb5495bfceb5c6c5fff5e38..8afe49b9a6e821824d446af29d33f6334f50e01e 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_search_grid.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_search_grid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Search\Grid" name="serach.grid" as="grid"/> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_shipping_address.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_shipping_address.xml index f7cb9efbf072a2970903fbc7dd312dcd76ddb8c8..95e6dcbf9b1d07e343f008658e61f33d5b49cbd9 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_shipping_address.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_shipping_address.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Shipping\Address" template="order/create/form/address.phtml" name="shipping_address"/> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_shipping_method.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_shipping_method.xml index 2833a30433910953ae67eae4a366dfd6522ef740..bcf67741ae5e501c721cbd203c81635f2f607b2d 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_shipping_method.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_shipping_method.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Shipping\Method" template="order/create/abstract.phtml" name="shipping_method"> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar.xml index 4c729208a7150e990d8581e95c78c95601f15a91..a1cfa430722da1d9c4823d5c295464dbc9ba2e3c 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Sidebar" template="order/create/sidebar.phtml" name="sidebar"> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_cart.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_cart.xml index b08d26b6104f75f97bac2d83c759c57dee4440cc..f92dfc2c94b1eddbf9616338882e596bacad3390 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_cart.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_cart.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Sidebar\Cart" template="order/create/sidebar/items.phtml" name="sidebar_cart"/> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_compared.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_compared.xml index b6e262d930fbd9b4c46d66fd94b74b2a8b439d43..f73d977b90b09ac61e02fc5dacb48414998ba2f5 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_compared.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_compared.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Sidebar\Compared" template="order/create/sidebar/items.phtml" name="sidebar_compared"/> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_pcompared.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_pcompared.xml index 3d3df16d36874233305243fac50509073dccb434..58f19589881765691d998ff2f86d6c48ff4ccabc 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_pcompared.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_pcompared.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Sidebar\Pcompared" template="order/create/sidebar/items.phtml" name="sidebar_pcompared"/> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_pviewed.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_pviewed.xml index a099a6f1bc33c478d5f3d95164098f9f10bc6e77..23de687f5dd1f8509d56004a249788d770f9ca93 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_pviewed.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_pviewed.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Sidebar\Pviewed" template="order/create/sidebar/items.phtml" name="sidebar_pviewed"/> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_reorder.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_reorder.xml index 8078d149f897526eadea88dd92cb529b2cab0b06..57eac07dbe6d73974885c6a7311d0daa313ac410 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_reorder.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_reorder.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Sidebar\Reorder" template="order/create/sidebar/items.phtml" name="sidebar_reorder"/> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_viewed.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_viewed.xml index efcda4251778cea3e9a0a3c0e3590b072055ea6d..902733fbc9c4c8fcd6a5cf27e7bf1dbe09fa3cad 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_viewed.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_viewed.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Sidebar\Viewed" template="order/create/sidebar/items.phtml" name="sidebar_viewed"/> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_wishlist.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_wishlist.xml index ac5417ef0ec48a072535b3808dda629ac30f75c2..cb3973d3bf8dacf45590af23ae4e762c7598b69e 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_wishlist.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_sidebar_wishlist.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Sidebar\Wishlist" template="order/create/sidebar/items.phtml" name="sidebar_wishlist"/> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_totals.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_totals.xml index 0a2cc77acf40583c687e7bf20853473e2f5ac029..829d87ca694633e2e10922f527b02c3395ba9496 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_totals.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_totals.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Totals" template="order/create/totals.phtml" name="totals"/> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_addcomment.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_addcomment.xml index 0861dd7618639768332f4a46c2a19efeb708a9ba..93a97065988c97cbbed9c6da0149c5df34c0c64c 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_addcomment.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_addcomment.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <block class="Magento\Sales\Block\Adminhtml\Order\Creditmemo\View\Comments" name="creditmemo_comments"> <block class="Magento\Sales\Block\Adminhtml\Order\Comments\View" name="order_comments" template="order/comments/view.phtml"/> 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 index bdd87e5b84707f48e9c1513713819993e82664df..4ac176cf7c529829eb19dea3c10967aece8ff3fb 100644 --- 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 @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="sales_order_creditmemo.grid.container"> <block class="Magento\Backend\Block\Widget\Grid" name="sales.order_creditmemo.grid" as="grid"> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_new.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_new.xml index a4ee30150b13a4236deca813f902e2be14da5d38..a8e7c5d52e999734a9caed831f71a795cd12408b 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_new.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_new.xml @@ -1,35 +1,35 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> - <update handle="sales_order_item_price"/> - <body> - <referenceContainer name="admin.scope.col.wrap" htmlClass="admin__old" /> <!-- ToDo UI: remove this wrapper with old styles removal. The class name "admin__old" is for tests only, we shouldn't use it in any way --> - - <referenceContainer name="content"> - <block class="Magento\Sales\Block\Adminhtml\Order\Creditmemo\Create" name="sales_creditmemo_create"> - <block class="Magento\Sales\Block\Adminhtml\Order\Creditmemo\Create\Form" name="form" template="order/creditmemo/create/form.phtml"> - <block class="Magento\Sales\Block\Adminhtml\Order\View\Info" name="order_info" template="order/view/info.phtml"/> - <block class="Magento\Sales\Block\Adminhtml\Order\Payment" name="order_payment"/> - <block class="Magento\Sales\Block\Adminhtml\Order\Creditmemo\Create\Items" name="order_items" template="order/creditmemo/create/items.phtml"> - <block class="Magento\Sales\Block\Adminhtml\Items\Renderer\DefaultRenderer" as="default" template="order/creditmemo/create/items/renderer/default.phtml"/> - <block class="Magento\Sales\Block\Adminhtml\Items\Column\Qty" name="column_qty" template="items/column/qty.phtml" group="column"/> - <block class="Magento\Sales\Block\Adminhtml\Items\Column\Name" name="column_name" template="items/column/name.phtml" group="column"/> - <block class="Magento\Framework\View\Element\Text\ListText" name="order_item_extra_info"/> - <block class="Magento\Sales\Block\Adminhtml\Order\Totalbar" name="order_totalbar" template="order/totalbar.phtml"/> - <block class="Magento\Sales\Block\Adminhtml\Order\Creditmemo\Totals" name="creditmemo_totals" template="order/totals.phtml"> - <block class="Magento\Sales\Block\Adminhtml\Order\Creditmemo\Create\Adjustments" name="adjustments" template="order/creditmemo/create/totals/adjustments.phtml"/> - <block class="Magento\Sales\Block\Adminhtml\Order\Totals\Tax" name="tax" template="order/totals/tax.phtml"/> - </block> - <container name="submit_before" label="Submit Before"/> - <container name="submit_after" label="Submit After"/> - </block> - </block> - </block> - </referenceContainer> - </body> -</page> +<?xml version="1.0"?> +<!-- +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> + <update handle="sales_order_item_price"/> + <body> + <referenceContainer name="admin.scope.col.wrap" htmlClass="admin__old" /> <!-- ToDo UI: remove this wrapper with old styles removal. The class name "admin__old" is for tests only, we shouldn't use it in any way --> + + <referenceContainer name="content"> + <block class="Magento\Sales\Block\Adminhtml\Order\Creditmemo\Create" name="sales_creditmemo_create"> + <block class="Magento\Sales\Block\Adminhtml\Order\Creditmemo\Create\Form" name="form" template="order/creditmemo/create/form.phtml"> + <block class="Magento\Sales\Block\Adminhtml\Order\View\Info" name="order_info" template="order/view/info.phtml"/> + <block class="Magento\Sales\Block\Adminhtml\Order\Payment" name="order_payment"/> + <block class="Magento\Sales\Block\Adminhtml\Order\Creditmemo\Create\Items" name="order_items" template="order/creditmemo/create/items.phtml"> + <block class="Magento\Sales\Block\Adminhtml\Items\Renderer\DefaultRenderer" as="default" template="order/creditmemo/create/items/renderer/default.phtml"/> + <block class="Magento\Sales\Block\Adminhtml\Items\Column\Qty" name="column_qty" template="items/column/qty.phtml" group="column"/> + <block class="Magento\Sales\Block\Adminhtml\Items\Column\Name" name="column_name" template="items/column/name.phtml" group="column"/> + <block class="Magento\Framework\View\Element\Text\ListText" name="order_item_extra_info"/> + <block class="Magento\Sales\Block\Adminhtml\Order\Totalbar" name="order_totalbar" template="order/totalbar.phtml"/> + <block class="Magento\Sales\Block\Adminhtml\Order\Creditmemo\Totals" name="creditmemo_totals" template="order/totals.phtml"> + <block class="Magento\Sales\Block\Adminhtml\Order\Creditmemo\Create\Adjustments" name="adjustments" template="order/creditmemo/create/totals/adjustments.phtml"/> + <block class="Magento\Sales\Block\Adminhtml\Order\Totals\Tax" name="tax" template="order/totals/tax.phtml"/> + </block> + <container name="submit_before" label="Submit Before"/> + <container name="submit_after" label="Submit After"/> + </block> + </block> + </block> + </referenceContainer> + </body> +</page> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_updateqty.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_updateqty.xml index a8066d894fb7537f5f390c0de6049ddbc3dd89b7..04eaeac59b86d639b953926ce31951fa0724ffbd 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_updateqty.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_updateqty.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="sales_order_item_price"/> <body> <block class="Magento\Sales\Block\Adminhtml\Order\Creditmemo\Create\Items" name="order_items" template="order/creditmemo/create/items.phtml"> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_view.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_view.xml index 7208039683c8dbf06f7a60bfd8db9e311aa8cfed..29c769085752e1f233fb7d98fca55abcdd6da3d8 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_view.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="sales_creditmemo_item_price"/> <body> <referenceContainer name="admin.scope.col.wrap" htmlClass="admin__old" /> <!-- ToDo UI: remove this wrapper with old styles removal. The class name "admin__old" is for tests only, we shouldn't use it in any way --> 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 index 0653b3183548176dd52c7778b825f0d516902998..f8c2c80c5c7dfe45894b814695111841d0cbd305 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemos.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemos.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <update handle="sales_order_creditmemo_grid_block"/> <container name="root"> <block class="Magento\Sales\Block\Adminhtml\Order\View\Tab\Creditmemos" name="sales_order_creditmemo.grid.container"/> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_edit_index.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_edit_index.xml index 5966970282ad3de0827c93588575ed84424029ff..60799ab769e4c39d9aae9821b6f5ce3456cc31df 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_edit_index.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_edit_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="sales_order_create_index"/> <body/> </page> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_exportcsv.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_exportcsv.xml index eb358b8e7cf8058f4140dd525739f0d336d78471..59dd63965d3b69f8f6f513c00c0295dac9aeaf18 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_exportcsv.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_exportcsv.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="sales_order_grid_block"/> <body> <block class="Magento\Backend\Block\Widget\Grid\Container" name="sales_order.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_exportexcel.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_exportexcel.xml index eb358b8e7cf8058f4140dd525739f0d336d78471..59dd63965d3b69f8f6f513c00c0295dac9aeaf18 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_exportexcel.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_exportexcel.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="sales_order_grid_block"/> <body> <block class="Magento\Backend\Block\Widget\Grid\Container" name="sales_order.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_grid.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_grid.xml index f2a3d2b6bfdc46628371f42c5c7efa38197165a5..45f2f206df55194b9fbde9316858aa5b41de4cb4 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_grid.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_grid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <update handle="formkey"/> <update handle="sales_order_grid_block"/> <container name="root"> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_index.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_index.xml index 5fd11e69602d1e91a6e46058613a7958660e0749..0695a37c15bfd308bf3be1981a129eeeeff5dbee 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_index.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="styles"/> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_addcomment.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_addcomment.xml index 6618d1eac734a654403b3cc36a09bbd865c12515..0646077ea8a07d323b6c24f8159325ee51022314 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_addcomment.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_addcomment.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <block class="Magento\Sales\Block\Adminhtml\Order\Invoice\View\Comments" name="invoice_comments"> <block class="Magento\Sales\Block\Adminhtml\Order\Comments\View" name="order_comments" template="order/comments/view.phtml"/> 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 index 89365d27a1124b0abc5c3d2baf51421731a9a2b8..98d6852a2d776c0c205950e66528eb70abff15a9 100644 --- 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 @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="sales_order_invoice.grid.container"> <block class="Magento\Backend\Block\Widget\Grid" name="sales.order_invoice.grid" as="grid"> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_new.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_new.xml index f11eaee813d295cb9a82272df34d467c41cb1e5e..195ee56afc7faa9ec32d8901a462e4e67c9f7fb0 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_new.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_new.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="sales_order_item_price"/> <body> <referenceContainer name="admin.scope.col.wrap" htmlClass="admin__old" /> <!-- ToDo UI: remove this wrapper with old styles removal. The class name "admin__old" is for tests only, we shouldn't use it in any way --> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_updateqty.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_updateqty.xml index 12e856dfed6027fe0c7d6f71b9cff5a039a50e35..4422963a4b6744eeb6353c7f944dc279893b0b02 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_updateqty.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_updateqty.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="sales_order_item_price"/> <body> <block class="Magento\Sales\Block\Adminhtml\Order\Invoice\Create\Items" name="order_items" template="order/invoice/create/items.phtml"> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_view.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_view.xml index e22eaae5cd8f4092cd672c407b0c521c6b129b3c..40235fb402583dfa929a94d47d4bc8e4dd6c30fa 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_view.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="sales_invoice_item_price"/> <body> <referenceContainer name="admin.scope.col.wrap" htmlClass="admin__old" /> <!-- ToDo UI: remove this wrapper with old styles removal. The class name "admin__old" is for tests only, we shouldn't use it in any way --> 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 index 8685167820d61ce5ed4a6ed51e56a6bdd1cb37e8..eb2545b2d1ee8df7d21475db0c7f75aab3f93b69 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoices.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoices.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <update handle="sales_order_invoice_grid_block"/> <container name="root"> <block class="Magento\Sales\Block\Adminhtml\Order\View\Tab\Invoices" name="sales_order_invoice.grid.container"/> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_item_price.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_item_price.xml index de8135254943a15948ca7f4e435341cf43fdd696..2ae2edc379d4a3fdeb49b2f06117393b297dfdd0 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_item_price.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_item_price.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="order_items"> <block class="Magento\Sales\Block\Adminhtml\Items\Column\DefaultColumn" name="column_price" template="items/price/unit.phtml" group="column"/> 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 index 3f2dda617e55156bb63fa5b418166b86a4f1ed41..be7fdc5df41979e9731e2f850848695c0375a437 100644 --- 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 @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="sales_order_shipment.grid.container"> <block class="Magento\Backend\Block\Widget\Grid" name="sales.order_shipment.grid" as="grid"> 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 index 2b77bf453e761172eb6f9287e98477884c9d0f84..a47a36e8ba4655216fbdd80ca2dbb9ec53654bce 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_shipments.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_shipments.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <update handle="sales_order_shipment_grid_block"/> <container name="root"> <block class="Magento\Sales\Block\Adminhtml\Order\View\Tab\Shipments" name="sales_order_shipment.grid.container"/> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_status_assign.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_status_assign.xml index d48564c039f2d028a674714dd253b145f297e15b..435a38ad078cd98be49cfae49dc2912282fa9ddd 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_status_assign.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_status_assign.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Status\Assign" name="sales_order_status.assign.container"/> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_status_edit.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_status_edit.xml index 77092c08e082b85519f676d93fa1275c55229a31..a396a50563a04a2d7a88ee539ee8b203dfe3a42f 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_status_edit.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_status_edit.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Status\Edit" name="sales_order_status.edit.container"/> 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 5ea17f70a37f38060af91b969fd31ae1e24045da..da6092e8c2de16512977c2841ad232288a03cf2e 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 @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Status" name="sales_order_status.grid.container"> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_status_new.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_status_new.xml index 5d62df64525950ef49996a58ab68818bc012ebad..e4bbe2b3ab6204d4f4c96b1e0c5cf1d0073006c3 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_status_new.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_status_new.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\Status\NewStatus" name="sales_order_status.new.container"/> 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 b353e96a78a7ac2d8541d3f81f571a73afd30da2..17365b67aba172183a9c507ebaf96c355db013b6 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 @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <update handle="sales_order_transactions_grid_block"/> <container name="root"> <block class="Magento\Sales\Block\Adminhtml\Order\View\Tab\Transactions" name="sales_transactions.grid.container"/> 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 index 36e653b728b26412248d6286a1a0c936b4e59918..23b52be5a7ac451189c720b9eeaf5f5ae11d0b68 100644 --- 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 @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="sales_transactions_grid_block"/> <body> <referenceContainer name="admin.scope.col.wrap" htmlClass="admin__old" /> <!-- ToDo UI: remove this wrapper with old styles removal. The class name "admin__old" is for tests only, we shouldn't use it in any way --> 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 8702286537943dc30a7d56d01e515e6cafd226d1..aed7140464333d8293e45c77a8c80540ef59e224 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 @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="sales_order_transactions_grid_block"/> <head> <link src="Magento_Sales::js/bootstrap/order-create-index.js"/> 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 index e5bb7ed046562e79c63747436bf10f012bea9cde..7c31879ec33c525e7fd40987fba9955f33eacf24 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_exportcsv.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_exportcsv.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="sales_shipment_grid_block"/> <body> <block class="Magento\Backend\Block\Widget\Grid\Container" name="sales_shipment.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> 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 index e5bb7ed046562e79c63747436bf10f012bea9cde..7c31879ec33c525e7fd40987fba9955f33eacf24 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_exportexcel.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_exportexcel.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="sales_shipment_grid_block"/> <body> <block class="Magento\Backend\Block\Widget\Grid\Container" name="sales_shipment.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> 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 index 8e8a70348b360b45563968bab7bde600d61fe95c..843f78f7bb554429dd12fd7b1e2ebf5dc48543d9 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_index.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="styles"/> <body> <referenceContainer name="content"> 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 index f937a16420e78bfe78ac53c25eec0d40442d479a..c5dc45f141f32c6b8e1b389b1f735336a5f3fd52 100644 --- 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 @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="sales_transactions_grid_block"/> <body> <referenceBlock name="sales.transactions.grid"> 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 d555bc975b0396375df4512498eea76575de6f51..bc14bf2e5999d89280943a1828b876a3af0fea0b 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 @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <update handle="formkey"/> <update handle="sales_transactions_grid_block"/> <container name="root"> 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 index 861df9be441bad19815ee6ea856131326766270d..e0f801b1af431cb3a526ec68d7b0067d808cab29 100644 --- 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 @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="sales_transactions.grid.container"> <block class="Magento\Backend\Block\Widget\Grid" name="sales.transactions.grid" as="grid"> 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 01b0c4ce9401973a6c9608bceab86d6d4e37c9be..8a55591b2b67ca263327be90b6b17d65bcc6f5c1 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 @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="sales_transactions_grid_block"/> <body> <referenceContainer name="content"> 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 0f7144004b45285aa108bfc37999b6596e48240f..1fe10a752acaee8834d93c91a1d8b7be98f1616a 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 @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="sales_transaction_child_block"/> <body> <referenceContainer name="admin.scope.col.wrap" htmlClass="admin__old" /> <!-- ToDo UI: remove this wrapper with old styles removal. The class name "admin__old" is for tests only, we shouldn't use it in any way --> diff --git a/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_creditmemo_grid.xml b/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_creditmemo_grid.xml index 06ae40bf7ee11ad34b9d9eef8026907ae55e68ec..4978e771c151aacefb017501d8a388a0a86e0400 100644 --- a/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_creditmemo_grid.xml +++ b/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_creditmemo_grid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Ui/etc/ui_configuration.xsd"> +<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Ui/etc/ui_configuration.xsd"> <argument name="data" xsi:type="array"> <item name="js_config" xsi:type="array"> <item name="provider" xsi:type="string">sales_order_creditmemo_grid.sales_order_creditmemo_grid_data_source</item> diff --git a/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_grid.xml b/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_grid.xml index f8bc243e145ec3d31a3b5b1c6da3c01f1a09d6a4..7a1af6d531cc547532c7c758599a398ccfb18421 100644 --- a/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_grid.xml +++ b/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_grid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Ui/etc/ui_configuration.xsd"> +<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Ui/etc/ui_configuration.xsd"> <argument name="data" xsi:type="array"> <item name="js_config" xsi:type="array"> <item name="provider" xsi:type="string">sales_order_grid.sales_order_grid_data_source</item> diff --git a/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_invoice_grid.xml b/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_invoice_grid.xml index ea34c1977aff4edb4364c4713835e296aa4ba168..a64f53bf8a8054d456bc104da68334e5ef19b902 100644 --- a/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_invoice_grid.xml +++ b/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_invoice_grid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Ui/etc/ui_configuration.xsd"> +<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Ui/etc/ui_configuration.xsd"> <argument name="data" xsi:type="array"> <item name="js_config" xsi:type="array"> <item name="provider" xsi:type="string">sales_order_invoice_grid.sales_order_invoice_grid_data_source</item> diff --git a/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_shipment_grid.xml b/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_shipment_grid.xml index 2acd9d47332be37d5506895d10ec15f929d91293..17af032838e21d16fcda7b863c369ed3dd01ee5e 100644 --- a/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_shipment_grid.xml +++ b/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_shipment_grid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Ui/etc/ui_configuration.xsd"> +<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Ui/etc/ui_configuration.xsd"> <argument name="data" xsi:type="array"> <item name="js_config" xsi:type="array"> <item name="provider" xsi:type="string">sales_order_shipment_grid.sales_order_shipment_grid_data_source</item> diff --git a/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_view_creditmemo_grid.xml b/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_view_creditmemo_grid.xml index adbc33a18c26de3979cd9b94dfcc1cef746003f0..d48507f8beac9ecdc6b0125dd0c08a1433794b5c 100644 --- a/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_view_creditmemo_grid.xml +++ b/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_view_creditmemo_grid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Ui/etc/ui_configuration.xsd"> +<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Ui/etc/ui_configuration.xsd"> <argument name="data" xsi:type="array"> <item name="js_config" xsi:type="array"> <item name="provider" xsi:type="string">sales_order_view_creditmemo_grid.sales_order_view_creditmemo_grid_data_source</item> diff --git a/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_view_invoice_grid.xml b/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_view_invoice_grid.xml index 2f66916ee8f03fe1738c8000d6f56018718806a1..9b5fe06dcac634070dc3d618a8f99f8cad876647 100644 --- a/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_view_invoice_grid.xml +++ b/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_view_invoice_grid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Ui/etc/ui_configuration.xsd"> +<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Ui/etc/ui_configuration.xsd"> <argument name="data" xsi:type="array"> <item name="js_config" xsi:type="array"> <item name="provider" xsi:type="string">sales_order_view_invoice_grid.sales_order_view_invoice_grid_data_source</item> diff --git a/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_view_shipment_grid.xml b/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_view_shipment_grid.xml index 5d668bea391a1a73979b994480f7571a3d060740..399b0827be9d5b4ea7fb7a64b1b562c9a6959ee6 100644 --- a/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_view_shipment_grid.xml +++ b/app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_view_shipment_grid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Ui/etc/ui_configuration.xsd"> +<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Ui/etc/ui_configuration.xsd"> <argument name="data" xsi:type="array"> <item name="js_config" xsi:type="array"> <item name="provider" xsi:type="string">sales_order_view_shipment_grid.sales_order_view_shipment_grid_data_source</item> diff --git a/app/code/Magento/Sales/view/frontend/layout/checkout_index_index.xml b/app/code/Magento/Sales/view/frontend/layout/checkout_index_index.xml index a61c83d274f161b66394c29d911eaf1de75fb092..ffc91e3d2d56eeb01927025ccb6c42f1250d2dc7 100644 --- a/app/code/Magento/Sales/view/frontend/layout/checkout_index_index.xml +++ b/app/code/Magento/Sales/view/frontend/layout/checkout_index_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="sale.reorder.sidebar" remove="true"/> </body> diff --git a/app/code/Magento/Sales/view/frontend/layout/customer_account.xml b/app/code/Magento/Sales/view/frontend/layout/customer_account.xml index ad424d3af644dd6cf083429c833870856828f20b..b1039f8160b2658d4db67d5bb38920952c2116bb 100644 --- a/app/code/Magento/Sales/view/frontend/layout/customer_account.xml +++ b/app/code/Magento/Sales/view/frontend/layout/customer_account.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="customer_account_navigation"> <block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-navigation-orders-link"> diff --git a/app/code/Magento/Sales/view/frontend/layout/customer_account_index.xml b/app/code/Magento/Sales/view/frontend/layout/customer_account_index.xml index 0bdf0c8d2061a6d78872dbefc128c5c294dfd570..0ded844ff4286926934bba93c7909a62789198b2 100644 --- a/app/code/Magento/Sales/view/frontend/layout/customer_account_index.xml +++ b/app/code/Magento/Sales/view/frontend/layout/customer_account_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Sales\Block\Order\Recent" name="customer_account_dashboard_top" after="customer_account_dashboard_hello" template="order/recent.phtml"/> diff --git a/app/code/Magento/Sales/view/frontend/layout/default.xml b/app/code/Magento/Sales/view/frontend/layout/default.xml index 30f45cc567132d2feecd48fd0be5ddfa8ec7d25c..1302ed3e281cae3bca9601532729abb179c93ad5 100644 --- a/app/code/Magento/Sales/view/frontend/layout/default.xml +++ b/app/code/Magento/Sales/view/frontend/layout/default.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="head.components"> <block class="Magento\Framework\View\Element\Js\Components" name="sales_page_head_components" template="Magento_Sales::js/components.phtml"/> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_email_item_price.xml b/app/code/Magento/Sales/view/frontend/layout/sales_email_item_price.xml index fad5cbe2be6124007b4b395376d3a1e0f28ee54c..3094fdda87e67a47a754ee1eb47d57695584a3f5 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_email_item_price.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_email_item_price.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="items"> <block class="Magento\Sales\Block\Order\Email\Items\DefaultItems" name="item_price" template="email/items/price/row.phtml"/> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_creditmemo_items.xml b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_creditmemo_items.xml index 497bf8984986403dcfbf457d2613434bb4833661..d96f19fca9854de7cba4e1f4bc925ac26ca57c17 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_creditmemo_items.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_creditmemo_items.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd" label="Email Creditmemo Items List" design_abstraction="custom"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="Email Creditmemo Items List" design_abstraction="custom"> <update handle="sales_email_order_creditmemo_renderers"/> <update handle="sales_email_item_price"/> <body> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_creditmemo_renderers.xml b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_creditmemo_renderers.xml index 9166912cce70e7bd9371384ed1af9b0ed211fed7..f3f902150813f3d17dffedaa6642aa677c66bd68 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_creditmemo_renderers.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_creditmemo_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd" label="Email Creditmemo Items List" design_abstraction="custom"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="Email Creditmemo Items List" design_abstraction="custom"> <body> <referenceBlock name="sales.email.order.creditmemo.renderers"> <block class="Magento\Sales\Block\Order\Email\Items\DefaultItems" as="default" template="email/items/creditmemo/default.phtml"/> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_invoice_items.xml b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_invoice_items.xml index 68c4265a6f2c00407c4f229d9cbb1025c0ab09d0..8562f50e819a401c2fd53d905b7e9b71f63346ff 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_invoice_items.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_invoice_items.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd" label="Email Invoice Items List" design_abstraction="custom"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="Email Invoice Items List" design_abstraction="custom"> <update handle="sales_email_order_invoice_renderers"/> <update handle="sales_email_item_price"/> <body> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_invoice_renderers.xml b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_invoice_renderers.xml index df458e4abeb30e98645475c3ccf70cf1f6920f67..d6fcb9c1013256bc3fd5f62a0908a5a6742b1c01 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_invoice_renderers.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_invoice_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd" label="Email Creditmemo Items List" design_abstraction="custom"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="Email Creditmemo Items List" design_abstraction="custom"> <body> <referenceBlock name="sales.email.order.invoice.renderers"> <block class="Magento\Sales\Block\Order\Email\Items\DefaultItems" as="default" template="email/items/invoice/default.phtml"/> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_items.xml b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_items.xml index 95d97a20061fec23b289e5fe082ba4a99380886a..6ad8fb0fb2084c042c73422c33eed79ab84ec842 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_items.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_items.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd" label="Email Order Items List" design_abstraction="custom"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="Email Order Items List" design_abstraction="custom"> <update handle="sales_email_order_renderers"/> <update handle="sales_email_item_price"/> <body> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_renderers.xml b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_renderers.xml index 4693b83aa6d733d3c0cde38e15b311a0e80ff0e9..6fa6ca50be625eed73de17706addb1fe7e01d47a 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_renderers.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd" label="Email Creditmemo Items List" design_abstraction="custom"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="Email Creditmemo Items List" design_abstraction="custom"> <body> <referenceBlock name="sales.email.order.renderers"> <block class="Magento\Sales\Block\Order\Email\Items\Order\DefaultOrder" as="default" template="email/items/order/default.phtml"/> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_shipment_items.xml b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_shipment_items.xml index 37738d058f564b27cc657d9bb269edad86c80c37..5b6ebdd7e80f0c21fb519dad1ffa4457e3111a98 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_shipment_items.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_shipment_items.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd" label="Email Shipment Items List" design_abstraction="custom"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="Email Shipment Items List" design_abstraction="custom"> <update handle="sales_email_order_shipment_renderers"/> <body> <block class="Magento\Sales\Block\Order\Email\Shipment\Items" name="items" template="email/shipment/items.phtml"> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_shipment_renderers.xml b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_shipment_renderers.xml index ec667e91d952230a22187fccda84f718409a29e5..e87b56b8fa5ac09d2b16f2dedddaf51b26588340 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_shipment_renderers.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_shipment_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd" label="Email Creditmemo Items List" design_abstraction="custom"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="Email Creditmemo Items List" design_abstraction="custom"> <body> <referenceBlock name="sales.email.order.shipment.renderers"> <block class="Magento\Sales\Block\Order\Email\Items\DefaultItems" as="default" template="email/items/shipment/default.phtml"/> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_guest_creditmemo.xml b/app/code/Magento/Sales/view/frontend/layout/sales_guest_creditmemo.xml index 1afc292f2071b2e0b9105e8503015ae5d1f61775..954dc45e83e07ae38b288a61aeaa62deec41c48e 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_guest_creditmemo.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_guest_creditmemo.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="sales_order_creditmemo_renderers"/> <update handle="sales_order_item_price"/> <update handle="sales_order_guest_info_links"/> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_guest_form.xml b/app/code/Magento/Sales/view/frontend/layout/sales_guest_form.xml index 6d9cce0d35b9ffc89957957a502935baf0721082..fac389c53ed87ab50e8a1eef8379b87aeafb1eaa 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_guest_form.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_guest_form.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Sales\Block\Widget\Guest\Form" name="guest.form" template="guest/form.phtml"/> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_guest_invoice.xml b/app/code/Magento/Sales/view/frontend/layout/sales_guest_invoice.xml index 20bb1d376590ac7c12e61b5b83816de53a97e8fd..c95739c9dba4ed3bc4dddebc1d5f1d13710a9e19 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_guest_invoice.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_guest_invoice.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="sales_order_invoice_renderers"/> <update handle="sales_order_item_price"/> <update handle="sales_order_guest_info_links"/> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_guest_print.xml b/app/code/Magento/Sales/view/frontend/layout/sales_guest_print.xml index a80e230b2c9009f08d8206ddea91a2785c9c1e54..f5b837d83ef21a7ab8ef24bb83b2985e07a83d21 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_guest_print.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_guest_print.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="sales_order_print_renderers" /> <update handle="sales_order_item_price"/> <update handle="print" /> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_guest_printcreditmemo.xml b/app/code/Magento/Sales/view/frontend/layout/sales_guest_printcreditmemo.xml index 0c771be9ae662007770a242ed88a0717f7bde4b8..4359ef561933a97e31fcf212f9d2027adbd9fa4d 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_guest_printcreditmemo.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_guest_printcreditmemo.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="sales_order_print_creditmemo_renderers" /> <update handle="sales_order_item_price"/> <update handle="print" /> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_guest_printinvoice.xml b/app/code/Magento/Sales/view/frontend/layout/sales_guest_printinvoice.xml index 0cdca0581f11c5ca71b03bacc2e6bbe371ed0162..001295b7f85656addb000a844a8e0d89a79817f0 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_guest_printinvoice.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_guest_printinvoice.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="sales_order_print_invoice_renderers" /> <update handle="sales_order_item_price"/> <update handle="print" /> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_guest_printshipment.xml b/app/code/Magento/Sales/view/frontend/layout/sales_guest_printshipment.xml index 3450b294ae0d51028ed1cf1d9f8c5772e7f2d60c..848b8b4c6a7d9af88f1b58a757fb4da2f3d432b2 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_guest_printshipment.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_guest_printshipment.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="sales_order_print_shipment_renderers" /> <update handle="print" /> <body> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_guest_reorder.xml b/app/code/Magento/Sales/view/frontend/layout/sales_guest_reorder.xml index 1d28e03653ccd7fa53dd7cc654e4ef8bd36e57e9..2279dd3199d275586dc9ecd477eaf729793e2743 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_guest_reorder.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_guest_reorder.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Sales\Block\Order\View" name="sales.order.view" cacheable="false"/> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_guest_shipment.xml b/app/code/Magento/Sales/view/frontend/layout/sales_guest_shipment.xml index cfdf3104f7cc65aeedceee8ac15c114e06fd8556..d69532382dfe533ba49818b6cb7f435ad546cf25 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_guest_shipment.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_guest_shipment.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="sales_order_guest_info_links"/> <body> <referenceContainer name="page.main.title"> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_guest_view.xml b/app/code/Magento/Sales/view/frontend/layout/sales_guest_view.xml index 564a1f790f8c23abd53bd4bb92ad33b2072e14e1..a54ac87ffe3d9f06140ce25b3beb3ecaa357f5ed 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_guest_view.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_guest_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="sales_order_item_renderers"/> <update handle="sales_order_item_price"/> <update handle="sales_order_guest_info_links"/> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_creditmemo.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_creditmemo.xml index 7937d5af75729835f6ca73d41a972bd414e7dca7..0e6caa49473757db89762e3f84367752682ee62e 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_creditmemo.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_creditmemo.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="sales_order_creditmemo_renderers"/> <update handle="customer_account"/> <update handle="sales_order_item_price"/> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_creditmemo_renderers.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_creditmemo_renderers.xml index 6e00916110f294b4092c880ab289d72de4cae900..1a52002f5d830caa7c84296054a65c35e1edbb03 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_creditmemo_renderers.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_creditmemo_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="sales.order.creditmemo.renderers"> <block class="Magento\Sales\Block\Order\Item\Renderer\DefaultRenderer" as="default" template="order/creditmemo/items/renderer/default.phtml"/> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_guest_info_links.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_guest_info_links.xml index 4d06e989f448826b1c1980fc4196933f125e33fc..24a508d9b2a48291a6f41b2f0d82a2d14d6afbb2 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_guest_info_links.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_guest_info_links.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Framework\View\Element\Html\Links" as="links" name="sales.order.info.links" before="-"> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_history.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_history.xml index 7210c1c06163c6209b5819fa01c9332ab032d16e..58b73b7de1b9ea3769c671d0f492cfd1b50726d8 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_history.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_history.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="customer_account"/> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_info_links.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_info_links.xml index 5e948a9df7ce05af44fa3f6375a1ff7ff993b635..269a51aa869b528e75a824919ba996d2a4fa80bc 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_info_links.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_info_links.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Framework\View\Element\Html\Links" as="links" name="sales.order.info.links" before="-"> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_invoice.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_invoice.xml index 8e8e25bebbdfe7309ba7e2190b43ec9e33e85459..714d7ee54564d0c133ab8b9ae5693982283535c6 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_invoice.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_invoice.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="customer_account"/> <update handle="sales_order_invoice_renderers"/> <update handle="sales_order_item_price"/> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_invoice_renderers.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_invoice_renderers.xml index b15078ce1a0b62ea8d0261018563a8c2f451960c..0aa8057e872f778ce09d0125c198c7d34b9a026b 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_invoice_renderers.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_invoice_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="sales.order.invoice.renderers"> <block class="Magento\Sales\Block\Order\Item\Renderer\DefaultRenderer" as="default" template="order/invoice/items/renderer/default.phtml"/> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_item_price.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_item_price.xml index c454ee0474ba09b8685e03fdb1cbdb3e9fe41d0a..a20be972f89dbca62ff8bf8ff8f4d3c6949d4b53 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_item_price.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_item_price.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <block class="Magento\Sales\Block\Order\Item\Renderer\DefaultRenderer" name="item_unit_price" template="items/price/unit.phtml"/> <block class="Magento\Sales\Block\Order\Item\Renderer\DefaultRenderer" name="item_row_total" template="items/price/row.phtml"/> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_item_renderers.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_item_renderers.xml index 52c0cdc598951b55b41da510eec9a8ab10bf308a..b88fcc41e61ba35eb427efe4667a971da81e04f3 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_item_renderers.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_item_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="sales.order.items.renderers"> <block class="Magento\Sales\Block\Order\Item\Renderer\DefaultRenderer" as="default" template="order/items/renderer/default.phtml"/> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_print.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_print.xml index ef7f10aaacd09d308f802c733ad728880d3919b3..518e127382acdec59c9451ab6c5a627f0fbe0956 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_print.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_print.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="sales_order_print_renderers" /> <update handle="sales_order_item_price"/> <update handle="print" /> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_print_creditmemo_renderers.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_print_creditmemo_renderers.xml index 7cf852c9af140ec7b2b23656f1e32ec2dae447cb..3e2e238a6df6bd1f7a0205ea23882b6fe17783a4 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_print_creditmemo_renderers.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_print_creditmemo_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="sales.order.print.creditmemo.renderers"> <block class="Magento\Sales\Block\Order\Item\Renderer\DefaultRenderer" as="default" template="order/creditmemo/items/renderer/default.phtml"/> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_print_invoice_renderers.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_print_invoice_renderers.xml index e09c8c102bb69416e18afdca6ac46b08a7362186..790bd9f796fdf41fc83b5acced9cc0f8bbc19af1 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_print_invoice_renderers.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_print_invoice_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="sales.order.print.invoice.renderers"> <block class="Magento\Sales\Block\Order\Item\Renderer\DefaultRenderer" as="default" template="order/invoice/items/renderer/default.phtml"/> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_print_renderers.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_print_renderers.xml index 6b54dff0470ec704aad845c689b5ae756ebf9266..d0558d6469311dee60d29a388bf8fcbcc3442d50 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_print_renderers.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_print_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="sales.order.print.renderers"> <block class="Magento\Sales\Block\Order\Item\Renderer\DefaultRenderer" as="default" template="order/items/renderer/default.phtml"/> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_print_shipment_renderers.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_print_shipment_renderers.xml index 6b3bca2fceb6a8f5c68246e3da8325181925faed..9db5c40034480df3a2be1d87cab96784ef40c773 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_print_shipment_renderers.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_print_shipment_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="sales.order.print.shipment.renderers"> <block class="Magento\Sales\Block\Order\Item\Renderer\DefaultRenderer" as="default" template="order/shipment/items/renderer/default.phtml"/> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_printcreditmemo.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_printcreditmemo.xml index 1f2c3f089151f2f8b56d217e60bff65b30c104e1..c3cd5dc95ace63fee6c6e9c0c57ae28c5d90ae2e 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_printcreditmemo.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_printcreditmemo.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="sales_order_print_creditmemo_renderers" /> <update handle="sales_order_item_price"/> <update handle="print" /> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_printinvoice.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_printinvoice.xml index f9d0eaa07265365b6d96bce00d8636318e2ff4d3..85078e32d40c58f96eff51947c7571303152deca 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_printinvoice.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_printinvoice.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="sales_order_print_invoice_renderers" /> <update handle="sales_order_item_price"/> <update handle="print" /> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_printshipment.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_printshipment.xml index 5851807afa72f6303f20a06a70379ecd846f08fc..676ab2d5805e46dfd1ccafd9746fc91d599da7eb 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_printshipment.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_printshipment.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="sales_order_print_shipment_renderers" /> <update handle="print" /> <body> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_reorder.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_reorder.xml index c4a771b23720c18da691553c15a23fa775e85764..724afd67f2e98b3e360b518d9571a1806060f2ca 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_reorder.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_reorder.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="customer_account"/> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_shipment.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_shipment.xml index 9876d1e42a5d87507d0e38f439dfd41cd7c49331..674b5e1ca0357c242b443aca53cf17b0703068d4 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_shipment.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_shipment.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="customer_account"/> <update handle="sales_order_info_links"/> <body> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_shipment_renderers.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_shipment_renderers.xml index 5f6cdaff8e7ad2848da2ac184b719a06f6024ed8..4b1719ed43ab73c8e1f26d963c6c4103d6ec742e 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_shipment_renderers.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_shipment_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="sales.order.shipment.renderers"> <block class="Magento\Sales\Block\Order\Item\Renderer\DefaultRenderer" as="default" template="order/shipment/items/renderer/default.phtml"/> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_view.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_view.xml index 11fdcef7991ef94ccc8be84ca95711dc40719380..1d4c3442b4fd11d7715d37997449fb0e35f20bd5 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_view.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="customer_account"/> <update handle="sales_order_item_renderers"/> <update handle="sales_order_item_price"/> diff --git a/app/code/Magento/SalesRule/Test/Unit/Model/Converter/ToModelTest.php b/app/code/Magento/SalesRule/Test/Unit/Model/Converter/ToModelTest.php index abc38969b5281bcd86d5d276945f4f7eac92ca36..6256f4a04aadaad83686291786d216f4710eb792 100644 --- a/app/code/Magento/SalesRule/Test/Unit/Model/Converter/ToModelTest.php +++ b/app/code/Magento/SalesRule/Test/Unit/Model/Converter/ToModelTest.php @@ -26,7 +26,7 @@ class ToModelTest extends \PHPUnit_Framework_TestCase { $this->ruleFactory = $this->getMockBuilder('Magento\SalesRule\Model\RuleFactory') ->disableOriginalConstructor() - ->setMethods([]) + ->setMethods(['create']) ->getMock(); $this->dataObjectProcessor = $this->getMockBuilder('\Magento\Framework\Reflection\DataObjectProcessor') diff --git a/app/code/Magento/SalesRule/composer.json b/app/code/Magento/SalesRule/composer.json index 8aab3f2a98dc617501bf2b0182d90c709614ae38..681974c676cdc424cdaa1533fd0c693aad03c9ff 100644 --- a/app/code/Magento/SalesRule/composer.json +++ b/app/code/Magento/SalesRule/composer.json @@ -18,8 +18,7 @@ "magento/module-catalog-rule": "1.0.0-beta", "magento/module-widget": "1.0.0-beta", "magento/module-quote": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -27,12 +26,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/SalesRule" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\SalesRule\\": "" + } } } diff --git a/app/code/Magento/SalesRule/etc/acl.xml b/app/code/Magento/SalesRule/etc/acl.xml index fa8a2e0f53a7a88dd4ddc37adafb4d149e0b7b1a..12465ff88680ad6a1e0fb85c22c4ca1c9dafb956 100644 --- a/app/code/Magento/SalesRule/etc/acl.xml +++ b/app/code/Magento/SalesRule/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/app/code/Magento/SalesRule/etc/adminhtml/di.xml b/app/code/Magento/SalesRule/etc/adminhtml/di.xml index 339a4d98ae75823621f4bf9dd55516a9e9577f87..2b921c10548753357ae7aa88469fc0dd9727afab 100644 --- a/app/code/Magento/SalesRule/etc/adminhtml/di.xml +++ b/app/code/Magento/SalesRule/etc/adminhtml/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\SalesRule\Helper\Coupon"> <arguments> <argument name="couponParameters" xsi:type="array"> diff --git a/app/code/Magento/SalesRule/etc/adminhtml/events.xml b/app/code/Magento/SalesRule/etc/adminhtml/events.xml index 3522d521399af8e42a81f624d4576c2dc63e5663..e1437b91da7525bfcfc23c9b82f500f0a29470cf 100644 --- a/app/code/Magento/SalesRule/etc/adminhtml/events.xml +++ b/app/code/Magento/SalesRule/etc/adminhtml/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="catalog_entity_attribute_delete_after"> <observer name="salesrule" instance="Magento\SalesRule\Observer\CatalogAttributeDeleteAfterObserver" method="execute" /> </event> diff --git a/app/code/Magento/SalesRule/etc/adminhtml/menu.xml b/app/code/Magento/SalesRule/etc/adminhtml/menu.xml index c3693e9d741e3e613e21d3d804ba62d76c6b43ce..4436cd819f5d45fc2c4f7a62af8ea3a0763694d5 100644 --- a/app/code/Magento/SalesRule/etc/adminhtml/menu.xml +++ b/app/code/Magento/SalesRule/etc/adminhtml/menu.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Backend/etc/menu.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd"> <menu> <add id="Magento_SalesRule::promo_quote" title="Cart Price Rules" module="Magento_SalesRule" parent="Magento_CatalogRule::promo" sortOrder="30" action="sales_rule/promo_quote/" dependsOnModule="Magento_Sales" resource="Magento_SalesRule::quote"/> </menu> diff --git a/app/code/Magento/SalesRule/etc/adminhtml/routes.xml b/app/code/Magento/SalesRule/etc/adminhtml/routes.xml index 6de4f577cd2d9a38e77f686aeb2202f8171ef743..53ad271e233e34badcf16521c5820f9920d916f7 100644 --- a/app/code/Magento/SalesRule/etc/adminhtml/routes.xml +++ b/app/code/Magento/SalesRule/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="admin"> <route id="sales_rule" frontName="sales_rule"> <module name="Magento_SalesRule" before="Magento_Backend" /> diff --git a/app/code/Magento/SalesRule/etc/adminhtml/system.xml b/app/code/Magento/SalesRule/etc/adminhtml/system.xml index 90a0ed61da190c0ca7ca214ace1dd58da843c47b..e6c46716400ba7d39f31ab7d365f0992fd5ce52f 100644 --- a/app/code/Magento/SalesRule/etc/adminhtml/system.xml +++ b/app/code/Magento/SalesRule/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="promo" translate="label" type="text" sortOrder="400" showInDefault="1" showInWebsite="0" showInStore="0"> <class>separator-top</class> diff --git a/app/code/Magento/SalesRule/etc/config.xml b/app/code/Magento/SalesRule/etc/config.xml index 486f8e4073ce85fef4a2b482b0a3e09e27a618c4..63e0679369fd60961dff7dbe7d876cab3c8acf1e 100644 --- a/app/code/Magento/SalesRule/etc/config.xml +++ b/app/code/Magento/SalesRule/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <promo> <auto_generated_coupon_codes> diff --git a/app/code/Magento/SalesRule/etc/crontab.xml b/app/code/Magento/SalesRule/etc/crontab.xml index 82dad61bfebe1fd00f29c124221a93446ab0d1f1..d0492c8e08d79698305468298bcabaea2583f511 100644 --- a/app/code/Magento/SalesRule/etc/crontab.xml +++ b/app/code/Magento/SalesRule/etc/crontab.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Cron/etc/crontab.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd"> <group id="default"> <job name="aggregate_sales_report_coupons_data" instance="Magento\SalesRule\Crone\AggregateSalesReportCouponsData" method="execute"> <schedule>0 0 * * *</schedule> diff --git a/app/code/Magento/SalesRule/etc/di.xml b/app/code/Magento/SalesRule/etc/di.xml index 91b8d4aab83212f5047c40ea5fffcff541670117..a80e3e7257d3f8aef071576119c7f9c1f7351891 100644 --- a/app/code/Magento/SalesRule/etc/di.xml +++ b/app/code/Magento/SalesRule/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\SalesRule\Api\RuleRepositoryInterface" type="Magento\SalesRule\Model\RuleRepository" /> <preference for="Magento\SalesRule\Api\Data\RuleInterface" diff --git a/app/code/Magento/SalesRule/etc/events.xml b/app/code/Magento/SalesRule/etc/events.xml index c066ff91034e3d75a63bc5dafcd42843c9e7d178..ccba6b27b1b31aa57a769e9741f3188548b22710 100644 --- a/app/code/Magento/SalesRule/etc/events.xml +++ b/app/code/Magento/SalesRule/etc/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="sales_order_place_after"> <observer name="salesrule" instance="Magento\SalesRule\Observer\SalesOrderAfterPlaceObserver" method="execute" /> </event> diff --git a/app/code/Magento/SalesRule/etc/fieldset.xml b/app/code/Magento/SalesRule/etc/fieldset.xml index 43b3c2474506b4c5e01ca76d5c34acc09b9ff326..db2ddd4a4ac94682b50f2378b7c01e7d43c7aa92 100644 --- a/app/code/Magento/SalesRule/etc/fieldset.xml +++ b/app/code/Magento/SalesRule/etc/fieldset.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/DataObject/etc/fieldset.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:framework:DataObject/etc/fieldset.xsd"> <scope id="global"> <fieldset id="sales_convert_quote_address"> <field name="discount_description"> diff --git a/app/code/Magento/SalesRule/etc/frontend/di.xml b/app/code/Magento/SalesRule/etc/frontend/di.xml index 4d1d7c56e730f0a107ee0ce1010d1971e1a1f44f..3b980e3cb0661fc3573c1b3be3369a033f0175a4 100644 --- a/app/code/Magento/SalesRule/etc/frontend/di.xml +++ b/app/code/Magento/SalesRule/etc/frontend/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\SalesRule\Model\Resource\Rule"> <plugin name="catalog_rule_resource_rule_after_loader" type="Magento\SalesRule\Model\Plugin\Resource\Rule"/> </type> diff --git a/app/code/Magento/SalesRule/etc/module.xml b/app/code/Magento/SalesRule/etc/module.xml index 3d3f8c47b2b26d6cdd81f1f89fd8f64b2b010154..2683d0bf64f36e65d895f5ae63ec895a5c17e259 100644 --- a/app/code/Magento/SalesRule/etc/module.xml +++ b/app/code/Magento/SalesRule/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_SalesRule" setup_version="2.0.0"> <sequence> <module name="Magento_Rule"/> diff --git a/app/code/Magento/SalesRule/etc/sales.xml b/app/code/Magento/SalesRule/etc/sales.xml index 7c9005f1e6ba5b5bae8a1be83cf21558b132150f..2a8bf1ad15a0c29cced785eff7cedaad6fdde671 100644 --- a/app/code/Magento/SalesRule/etc/sales.xml +++ b/app/code/Magento/SalesRule/etc/sales.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Sales/etc/sales.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Sales:etc/sales.xsd"> <section name="quote"> <group name="totals"> <item name="discount" instance="Magento\SalesRule\Model\Quote\Discount" sort_order="400"/> diff --git a/app/code/Magento/SalesRule/etc/webapi.xml b/app/code/Magento/SalesRule/etc/webapi.xml index 6650039e80ea1ccbf6ef0b46e95dc1c0e1b18f34..5776e81042eff81ecfd473ad7e0579ff3be281d0 100644 --- a/app/code/Magento/SalesRule/etc/webapi.xml +++ b/app/code/Magento/SalesRule/etc/webapi.xml @@ -6,7 +6,7 @@ */ --> <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../app/code/Magento/Webapi/etc/webapi.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd"> <!-- Sale Rule CRUD --> <route url="/V1/salesRules/:ruleId" method="GET"> <service class="Magento\SalesRule\Api\RuleRepositoryInterface" method="getById"/> diff --git a/app/code/Magento/SalesRule/registration.php b/app/code/Magento/SalesRule/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..499709f1f8dbd7aec1d27478f5e932c0d156dae7 --- /dev/null +++ b/app/code/Magento/SalesRule/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_SalesRule', + __DIR__ +); diff --git a/app/code/Magento/SalesRule/view/adminhtml/layout/sales_rule_promo_quote_couponsgrid.xml b/app/code/Magento/SalesRule/view/adminhtml/layout/sales_rule_promo_quote_couponsgrid.xml index 94c278a2628db76e332bf1b436df23d01d04eca0..c49d9b5ed297093a3861363b95f052d3e77714df 100644 --- a/app/code/Magento/SalesRule/view/adminhtml/layout/sales_rule_promo_quote_couponsgrid.xml +++ b/app/code/Magento/SalesRule/view/adminhtml/layout/sales_rule_promo_quote_couponsgrid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root" label="Root"> <block class="Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tab\Coupons\Grid" name="sales_rule_quote_edit_tab_coupons_grid"/> </container> diff --git a/app/code/Magento/SalesRule/view/adminhtml/layout/sales_rule_promo_quote_edit.xml b/app/code/Magento/SalesRule/view/adminhtml/layout/sales_rule_promo_quote_edit.xml index 9a16fece4fa7b5bbf9ef3d49000c106abe123f24..24aa531f906c40976c006f45c8c40cf5024b437b 100644 --- a/app/code/Magento/SalesRule/view/adminhtml/layout/sales_rule_promo_quote_edit.xml +++ b/app/code/Magento/SalesRule/view/adminhtml/layout/sales_rule_promo_quote_edit.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="left"> <block class="Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tabs" name="promo_quote_edit_tabs"> 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 5fe9807df3c54f3db0116439010ea3c4f6d12a3f..f1b4a15f17c19af213864c213f766d80fd1c61be 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 @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\SalesRule\Block\Adminhtml\Promo\Quote" name="adminhtml.block.promo.quote.grid.container"> diff --git a/app/code/Magento/SalesRule/view/frontend/layout/checkout_cart_index.xml b/app/code/Magento/SalesRule/view/frontend/layout/checkout_cart_index.xml index 40b16fe06dd92293624f74865f851201318790c3..43f5d46028d6dcaee1b2ae8975bf0618b81cd02d 100644 --- a/app/code/Magento/SalesRule/view/frontend/layout/checkout_cart_index.xml +++ b/app/code/Magento/SalesRule/view/frontend/layout/checkout_cart_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout.cart.totals"> <arguments> diff --git a/app/code/Magento/SalesRule/view/frontend/layout/checkout_index_index.xml b/app/code/Magento/SalesRule/view/frontend/layout/checkout_index_index.xml index e25f472ef7e8fee641bf85e6b2bf471624573d7c..2aa493560772a114bc60f5b96eec30668849f25c 100644 --- a/app/code/Magento/SalesRule/view/frontend/layout/checkout_index_index.xml +++ b/app/code/Magento/SalesRule/view/frontend/layout/checkout_index_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout.root"> <arguments> diff --git a/app/code/Magento/SalesRule/view/frontend/web/js/model/payment/discount-messages.js b/app/code/Magento/SalesRule/view/frontend/web/js/model/payment/discount-messages.js index 1c2c1b2eaf2f6f6b17fb95e027832d97d97f0e4e..b70d2d0d9544d49f918bb360e627a2717e5070b0 100644 --- a/app/code/Magento/SalesRule/view/frontend/web/js/model/payment/discount-messages.js +++ b/app/code/Magento/SalesRule/view/frontend/web/js/model/payment/discount-messages.js @@ -8,6 +8,7 @@ define( ], function (Messages) { 'use strict'; + return new Messages(); } ); diff --git a/app/code/Magento/SalesRule/view/frontend/web/js/view/payment/discount-messages.js b/app/code/Magento/SalesRule/view/frontend/web/js/view/payment/discount-messages.js index 1e8e3cc0fbb8b0d00d1c8f52723ce2007a53166a..66f7dba1969fcd775e93efa0e4185f55ade54c33 100644 --- a/app/code/Magento/SalesRule/view/frontend/web/js/view/payment/discount-messages.js +++ b/app/code/Magento/SalesRule/view/frontend/web/js/view/payment/discount-messages.js @@ -9,6 +9,8 @@ define([ 'use strict'; return Component.extend({ + + initialize: function (config) { return this._super(config, messageContainer); } diff --git a/app/code/Magento/SalesSequence/composer.json b/app/code/Magento/SalesSequence/composer.json index c119f55b7eb852001bd698e74cf7de887452bf8c..4337aa0d787841d1ad2623ac3d2925348054331c 100644 --- a/app/code/Magento/SalesSequence/composer.json +++ b/app/code/Magento/SalesSequence/composer.json @@ -3,8 +3,7 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0|~7.0.0", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -12,12 +11,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/SalesSequence" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\SalesSequence\\": "" + } } } diff --git a/app/code/Magento/SalesSequence/etc/module.xml b/app/code/Magento/SalesSequence/etc/module.xml index 77c87265e8f427f66210447f4de96c2b443ef476..f332448395f46493f3dd4fce7048e3baa2b607bc 100644 --- a/app/code/Magento/SalesSequence/etc/module.xml +++ b/app/code/Magento/SalesSequence/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_SalesSequence" setup_version="2.0.0"> </module> </config> diff --git a/app/code/Magento/SalesSequence/registration.php b/app/code/Magento/SalesSequence/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..a2140fe647f093bb476da8209323f25bd082c7ff --- /dev/null +++ b/app/code/Magento/SalesSequence/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_SalesSequence', + __DIR__ +); diff --git a/app/code/Magento/Search/composer.json b/app/code/Magento/Search/composer.json index 4707ac886ee02f284dbd402a5d8f3636dbddd317..567aa8a182832c9d2f76268e4f0aae96e1c515a5 100644 --- a/app/code/Magento/Search/composer.json +++ b/app/code/Magento/Search/composer.json @@ -7,8 +7,7 @@ "magento/module-backend": "1.0.0-beta", "magento/module-catalog-search": "1.0.0-beta", "magento/module-store": "1.0.0-beta", - "magento/module-reports": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/module-reports": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -16,12 +15,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Search" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Search\\": "" + } } } diff --git a/app/code/Magento/Search/etc/acl.xml b/app/code/Magento/Search/etc/acl.xml index 6280c716af0a3375da7f4b6de399b5a5c758fa81..2834800292b9a3d7bb9fe855a87d6b4b5e5c21dc 100644 --- a/app/code/Magento/Search/etc/acl.xml +++ b/app/code/Magento/Search/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/app/code/Magento/Search/etc/adminhtml/menu.xml b/app/code/Magento/Search/etc/adminhtml/menu.xml index 9727b886387ace0792ac1c6a3b3842462082b086..1ddceb0bcd0cea4418ca2577e65938c0c91631a8 100644 --- a/app/code/Magento/Search/etc/adminhtml/menu.xml +++ b/app/code/Magento/Search/etc/adminhtml/menu.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Backend/etc/menu.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd"> <menu> <add id="Magento_Search::search_terms" title="Search Terms" module="Magento_Search" sortOrder="40" parent="Magento_Backend::marketing_seo" action="search/term/index" resource="Magento_Search::search" /> </menu> diff --git a/app/code/Magento/Search/etc/adminhtml/routes.xml b/app/code/Magento/Search/etc/adminhtml/routes.xml index bdeee326f35c5f2453c8f9edaca1ceb53a93d131..1eff4c9ce62ff42ca4f94f60d0d7d89326b945ac 100644 --- a/app/code/Magento/Search/etc/adminhtml/routes.xml +++ b/app/code/Magento/Search/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="admin"> <route id="search" frontName="search"> <module name="Magento_Search" before="Magento_Backend" /> diff --git a/app/code/Magento/Search/etc/adminhtml/system.xml b/app/code/Magento/Search/etc/adminhtml/system.xml index e13489ef12965eb4410f965b93578adb5a7e519a..90d9943dd9f4380c39f4f504488f75be75da33b8 100644 --- a/app/code/Magento/Search/etc/adminhtml/system.xml +++ b/app/code/Magento/Search/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="catalog"> <group id="search"> diff --git a/app/code/Magento/Search/etc/di.xml b/app/code/Magento/Search/etc/di.xml index 26f8d94c1a502521dd3787da8069527f823471cd..763e5cfe268eb242ea6915287de70093b0bbba32 100644 --- a/app/code/Magento/Search/etc/di.xml +++ b/app/code/Magento/Search/etc/di.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Search\Api\SearchInterface" type="Magento\Search\Model\Search"/> <type name="Magento\Framework\Module\Setup\Migration"> <arguments> diff --git a/app/code/Magento/Search/etc/frontend/page_types.xml b/app/code/Magento/Search/etc/frontend/page_types.xml index 2c563ca5c0d1b97fcf9960c34a3656b70bbb13df..31bd18b4073e6078f849babf8762d44c81487c1e 100644 --- a/app/code/Magento/Search/etc/frontend/page_types.xml +++ b/app/code/Magento/Search/etc/frontend/page_types.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<page_types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_types.xsd"> +<page_types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_types.xsd"> <type id="search_term_popular" label="Popular Search Terms"/> </page_types> diff --git a/app/code/Magento/Search/etc/frontend/routes.xml b/app/code/Magento/Search/etc/frontend/routes.xml index 15c18a27260d960bbcd8f30e83a28a7e2d32fd21..f4043fba77be8184d401c32773c4246e159ceefe 100644 --- a/app/code/Magento/Search/etc/frontend/routes.xml +++ b/app/code/Magento/Search/etc/frontend/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="standard"> <route id="search" frontName="search"> <module name="Magento_Search" /> diff --git a/app/code/Magento/Search/etc/module.xml b/app/code/Magento/Search/etc/module.xml index dfe66f74c508efcd906726c3a1abfaf022b0efa0..0ec900964420c3242f7937eb941b94d9606790c3 100644 --- a/app/code/Magento/Search/etc/module.xml +++ b/app/code/Magento/Search/etc/module.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Search" setup_version="2.0.1"> <sequence> <module name="Magento_Backend" /> diff --git a/app/code/Magento/Search/etc/webapi.xml b/app/code/Magento/Search/etc/webapi.xml index d06beccfa8d80ad2d498bbbaaaa41047d800e3a5..df528080958b749c6247fd6e9b155a353da65e41 100644 --- a/app/code/Magento/Search/etc/webapi.xml +++ b/app/code/Magento/Search/etc/webapi.xml @@ -6,7 +6,7 @@ */ --> <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../app/code/Magento/Webapi/etc/webapi.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd"> <route url="/V1/search" method="GET"> <service class="Magento\Search\Api\SearchInterface" method="search"/> diff --git a/app/code/Magento/Search/registration.php b/app/code/Magento/Search/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..bab0ed127040e76777eba49eebeceb567876a50b --- /dev/null +++ b/app/code/Magento/Search/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Search', + __DIR__ +); diff --git a/app/code/Magento/Search/view/adminhtml/layout/adminhtml_dashboard_index.xml b/app/code/Magento/Search/view/adminhtml/layout/adminhtml_dashboard_index.xml index 59134842fbeed3e8f7d020b18c2a1c83b6472e94..c05cb7e1453e0423f0675cc60afc0f08c3ecfba6 100644 --- a/app/code/Magento/Search/view/adminhtml/layout/adminhtml_dashboard_index.xml +++ b/app/code/Magento/Search/view/adminhtml/layout/adminhtml_dashboard_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="dashboard"> <block class="Magento\Search\Block\Adminhtml\Dashboard\Last" as="lastSearches" /> diff --git a/app/code/Magento/Search/view/adminhtml/layout/search_term_block.xml b/app/code/Magento/Search/view/adminhtml/layout/search_term_block.xml index bf70c7696cccf92d5f2b40387db8be207f0092be..964c2e3663d0680e913e46b5bf43f0fa9dc7427b 100644 --- a/app/code/Magento/Search/view/adminhtml/layout/search_term_block.xml +++ b/app/code/Magento/Search/view/adminhtml/layout/search_term_block.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="search.term.grid.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.report.search.grid" as="grid"> diff --git a/app/code/Magento/Search/view/adminhtml/layout/search_term_edit.xml b/app/code/Magento/Search/view/adminhtml/layout/search_term_edit.xml index ea66fc5c0379d9c1903005b73c14c5fc54b7e11d..40d20db58725caaf1f02d48f05cbc68caf05448e 100644 --- a/app/code/Magento/Search/view/adminhtml/layout/search_term_edit.xml +++ b/app/code/Magento/Search/view/adminhtml/layout/search_term_edit.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Search\Block\Adminhtml\Term\Edit" name="adminhtml.search.term.edit"/> diff --git a/app/code/Magento/Search/view/adminhtml/layout/search_term_exportsearchcsv.xml b/app/code/Magento/Search/view/adminhtml/layout/search_term_exportsearchcsv.xml index 4e2f87be2780643da9087f59a54da6ebc5843727..2b4cfc3894d1d0a6168ffdaef5363f5a8e9f04b5 100644 --- a/app/code/Magento/Search/view/adminhtml/layout/search_term_exportsearchcsv.xml +++ b/app/code/Magento/Search/view/adminhtml/layout/search_term_exportsearchcsv.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="formkey"/> <update handle="search_term_report_block"/> <body> diff --git a/app/code/Magento/Search/view/adminhtml/layout/search_term_exportsearchexcel.xml b/app/code/Magento/Search/view/adminhtml/layout/search_term_exportsearchexcel.xml index 4e2f87be2780643da9087f59a54da6ebc5843727..2b4cfc3894d1d0a6168ffdaef5363f5a8e9f04b5 100644 --- a/app/code/Magento/Search/view/adminhtml/layout/search_term_exportsearchexcel.xml +++ b/app/code/Magento/Search/view/adminhtml/layout/search_term_exportsearchexcel.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="formkey"/> <update handle="search_term_report_block"/> <body> diff --git a/app/code/Magento/Search/view/adminhtml/layout/search_term_grid_block.xml b/app/code/Magento/Search/view/adminhtml/layout/search_term_grid_block.xml index 481266977bcab3937df6c48bbee609ebc288c153..dc5ab12de3b94c38b975a858f28f19591def8752 100644 --- a/app/code/Magento/Search/view/adminhtml/layout/search_term_grid_block.xml +++ b/app/code/Magento/Search/view/adminhtml/layout/search_term_grid_block.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="adminhtml.search.term.grid.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.catalog.search.grid" as="grid"> diff --git a/app/code/Magento/Search/view/adminhtml/layout/search_term_index.xml b/app/code/Magento/Search/view/adminhtml/layout/search_term_index.xml index 127ffd1a126a58cbd97b0a3aa23f73a20fcd1038..eff8dc5fd91b6a208c59ff34bb035670c144639f 100644 --- a/app/code/Magento/Search/view/adminhtml/layout/search_term_index.xml +++ b/app/code/Magento/Search/view/adminhtml/layout/search_term_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="search_term_grid_block"/> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/Search/view/adminhtml/layout/search_term_report.xml b/app/code/Magento/Search/view/adminhtml/layout/search_term_report.xml index 030946d4477c90d36c5e950206dfa772ecde3ee4..332f2a728e567a95c557f3e14381c8e201b20383 100644 --- a/app/code/Magento/Search/view/adminhtml/layout/search_term_report.xml +++ b/app/code/Magento/Search/view/adminhtml/layout/search_term_report.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="search_term_report_block"/> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/Search/view/adminhtml/layout/search_term_report_block.xml b/app/code/Magento/Search/view/adminhtml/layout/search_term_report_block.xml index 2d7e8b822d9aa1581ae3e830ace11b187cb96f62..b942297986385478e18e40663aabf2bfe1dced1c 100644 --- a/app/code/Magento/Search/view/adminhtml/layout/search_term_report_block.xml +++ b/app/code/Magento/Search/view/adminhtml/layout/search_term_report_block.xml @@ -6,7 +6,7 @@ */ --> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="report.search.grid.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.report.search.grid" as="grid"> diff --git a/app/code/Magento/Search/view/frontend/layout/default.xml b/app/code/Magento/Search/view/frontend/layout/default.xml index de5dcfc0ae215bea76b22197071f58d6f24fdcbe..54dc8bf147ec6202cbb8b45dc9685e4b77644587 100644 --- a/app/code/Magento/Search/view/frontend/layout/default.xml +++ b/app/code/Magento/Search/view/frontend/layout/default.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="header-wrapper"> <block class="Magento\Framework\View\Element\Template" name="top.search" as="topSearch" template="Magento_Search::form.mini.phtml" /> diff --git a/app/code/Magento/Search/view/frontend/layout/search_term_popular.xml b/app/code/Magento/Search/view/frontend/layout/search_term_popular.xml index 036191564b43b7d9b92659a2a053776b3b69c6f3..a97d0ebf33c6c28a63c74f67ded2868845f6944f 100644 --- a/app/code/Magento/Search/view/frontend/layout/search_term_popular.xml +++ b/app/code/Magento/Search/view/frontend/layout/search_term_popular.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <title>Popular Search Terms</title> </head> diff --git a/app/code/Magento/SendFriend/composer.json b/app/code/Magento/SendFriend/composer.json index c6eb6033babb5a6521040380bd99fa53d4610023..7ba2a05a751485e9770070d89863d358e7f709c1 100644 --- a/app/code/Magento/SendFriend/composer.json +++ b/app/code/Magento/SendFriend/composer.json @@ -7,8 +7,7 @@ "magento/module-catalog": "1.0.0-beta", "magento/module-customer": "1.0.0-beta", "magento/module-theme": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -16,12 +15,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/SendFriend" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\SendFriend\\": "" + } } } diff --git a/app/code/Magento/SendFriend/etc/adminhtml/system.xml b/app/code/Magento/SendFriend/etc/adminhtml/system.xml index a893f9650a33b3e4c4650ad4df917eb9f77600c5..d75ff42c4c56eefc272265cf137130a7d2561726 100644 --- a/app/code/Magento/SendFriend/etc/adminhtml/system.xml +++ b/app/code/Magento/SendFriend/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="sendfriend" translate="label" type="text" sortOrder="120" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Email to a Friend</label> diff --git a/app/code/Magento/SendFriend/etc/config.xml b/app/code/Magento/SendFriend/etc/config.xml index 6a63fb0eb3be102a68ca6cd2f40ef898c2db8f0e..9b3429dcff389c8cff3cdcffabf0ae22687bd5d7 100644 --- a/app/code/Magento/SendFriend/etc/config.xml +++ b/app/code/Magento/SendFriend/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <sendfriend> <email> diff --git a/app/code/Magento/SendFriend/etc/email_templates.xml b/app/code/Magento/SendFriend/etc/email_templates.xml index 379e2d3020029c1d7ddb2a6c3b28696391e73ab7..d8f92260d8642b1e20f0710e97ab645703438373 100644 --- a/app/code/Magento/SendFriend/etc/email_templates.xml +++ b/app/code/Magento/SendFriend/etc/email_templates.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Email/etc/email_templates.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Email:etc/email_templates.xsd"> <template id="sendfriend_email_template" label="Send Product Link to Friend" file="product_share.html" type="html" module="Magento_SendFriend" area="frontend"/> </config> diff --git a/app/code/Magento/SendFriend/etc/frontend/di.xml b/app/code/Magento/SendFriend/etc/frontend/di.xml index fa898654a5ae59e3a2ada1d261222d83d606298b..536b8f96e705c5fe617f86da61a59fd62844a1d8 100644 --- a/app/code/Magento/SendFriend/etc/frontend/di.xml +++ b/app/code/Magento/SendFriend/etc/frontend/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Catalog\Block\Product\View"> <plugin name="catalogProductViewCanEmailToFriend" type="Magento\SendFriend\Block\Plugin\Catalog\Product\View" /> </type> diff --git a/app/code/Magento/SendFriend/etc/frontend/page_types.xml b/app/code/Magento/SendFriend/etc/frontend/page_types.xml index c4396bfb90b7c9b1338f9a7ba38e9f2093afb414..63f906fc65369c8cda7c1e94dcc3057e788cc94c 100644 --- a/app/code/Magento/SendFriend/etc/frontend/page_types.xml +++ b/app/code/Magento/SendFriend/etc/frontend/page_types.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<page_types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_types.xsd"> +<page_types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_types.xsd"> <type id="sendfriend_product_send" label="Catalog Product Email to a Friend"/> </page_types> diff --git a/app/code/Magento/SendFriend/etc/frontend/routes.xml b/app/code/Magento/SendFriend/etc/frontend/routes.xml index c483794631b23fbfdb8af789e8414877b103494d..0e7f24eb628494ec76726a3ff4805fa0c11e9341 100644 --- a/app/code/Magento/SendFriend/etc/frontend/routes.xml +++ b/app/code/Magento/SendFriend/etc/frontend/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="standard"> <route id="sendfriend" frontName="sendfriend"> <module name="Magento_SendFriend" /> diff --git a/app/code/Magento/SendFriend/etc/module.xml b/app/code/Magento/SendFriend/etc/module.xml index ed8d08f3e7dd430358ff81531ca5f7a481255776..406c9e6f629efb137836d1099c27bf937d9f5ab4 100644 --- a/app/code/Magento/SendFriend/etc/module.xml +++ b/app/code/Magento/SendFriend/etc/module.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_SendFriend" setup_version="2.0.0"> <sequence> <module name="Magento_Catalog"/> diff --git a/app/code/Magento/SendFriend/registration.php b/app/code/Magento/SendFriend/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..6fc0fecfa206bd6a5648ffa0b36b141dfc4b5135 --- /dev/null +++ b/app/code/Magento/SendFriend/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_SendFriend', + __DIR__ +); diff --git a/app/code/Magento/SendFriend/view/frontend/layout/sendfriend_product_send.xml b/app/code/Magento/SendFriend/view/frontend/layout/sendfriend_product_send.xml index 6923f0561d2c7b8529d58bd94dd1909b31e67976..4d13b72961275d052edda692ef6e991636681eb4 100644 --- a/app/code/Magento/SendFriend/view/frontend/layout/sendfriend_product_send.xml +++ b/app/code/Magento/SendFriend/view/frontend/layout/sendfriend_product_send.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="page.main.title"> <action method="setPageTitle"> diff --git a/app/code/Magento/Shipping/composer.json b/app/code/Magento/Shipping/composer.json index 521db1f364afe38b8939941cd59141ab4674b312..0fed9c118485459c96e091119def6ffbdf437a3d 100644 --- a/app/code/Magento/Shipping/composer.json +++ b/app/code/Magento/Shipping/composer.json @@ -17,8 +17,7 @@ "magento/module-ui": "1.0.0-beta", "magento/framework": "1.0.0-beta", "magento/module-user": "1.0.0-beta", - "ext-gd": "*", - "magento/magento-composer-installer": "*" + "ext-gd": "*" }, "suggest": { "magento/module-fedex": "1.0.0-beta", @@ -30,12 +29,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Shipping" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Shipping\\": "" + } } } diff --git a/app/code/Magento/Shipping/etc/acl.xml b/app/code/Magento/Shipping/etc/acl.xml index feacd4d501dc3da36c629f277754c456eb7f6762..fc1d7770fc71eb732558ad09e34cea3f2b46aa61 100644 --- a/app/code/Magento/Shipping/etc/acl.xml +++ b/app/code/Magento/Shipping/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/app/code/Magento/Shipping/etc/adminhtml/di.xml b/app/code/Magento/Shipping/etc/adminhtml/di.xml index f3770d42bc2c4a296605e8c7955720c8dcbb260a..2771466ce64ba8ac28ee97f752b3afdfef44fdd5 100644 --- a/app/code/Magento/Shipping/etc/adminhtml/di.xml +++ b/app/code/Magento/Shipping/etc/adminhtml/di.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Shipping\Model\Shipping" type="Magento\Shipping\Model\Shipping\Labels" /> </config> diff --git a/app/code/Magento/Shipping/etc/adminhtml/routes.xml b/app/code/Magento/Shipping/etc/adminhtml/routes.xml index 84ec0473a9dd43d4119edfa21ea0d264e56671fb..98b1ac922a3092a491212ff024b43a01861f9187 100644 --- a/app/code/Magento/Shipping/etc/adminhtml/routes.xml +++ b/app/code/Magento/Shipping/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="admin"> <route id="adminhtml"> <module name="Magento_Shipping" before="Magento_Backend" /> diff --git a/app/code/Magento/Shipping/etc/adminhtml/system.xml b/app/code/Magento/Shipping/etc/adminhtml/system.xml index 5b56b96f719b7fbd3270e7b253dab0b1f862205d..6016522621fa0807312ea21cd34b1f12a5ce8bc2 100644 --- a/app/code/Magento/Shipping/etc/adminhtml/system.xml +++ b/app/code/Magento/Shipping/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="shipping" translate="label" type="text" sortOrder="310" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Shipping Settings</label> diff --git a/app/code/Magento/Shipping/etc/config.xml b/app/code/Magento/Shipping/etc/config.xml index 181805b665d283099c954844413036032d8e50fd..f5fbae36a3af4b5a504c815f21b628db040b347e 100644 --- a/app/code/Magento/Shipping/etc/config.xml +++ b/app/code/Magento/Shipping/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <shipping> <origin> diff --git a/app/code/Magento/Shipping/etc/crontab.xml b/app/code/Magento/Shipping/etc/crontab.xml index ad954fab25ccf2e1923eee3bcf45ce785ce8fe16..8de5b79ba78f0194a8cb37bbb766efcd5a836c6e 100644 --- a/app/code/Magento/Shipping/etc/crontab.xml +++ b/app/code/Magento/Shipping/etc/crontab.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Cron/etc/crontab.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd"> <group id="default"> <job name="aggregate_sales_report_shipment_data" instance="Magento\Shipping\Model\Observer" method="aggregateSalesReportShipmentData"> <schedule>0 0 * * *</schedule> diff --git a/app/code/Magento/Shipping/etc/di.xml b/app/code/Magento/Shipping/etc/di.xml index 9b785dac596f1f2a0bf2addc690fa8ca8cec1799..d8d6b9c7fb6a262c3f6e2c124118e21c2a2c9613 100644 --- a/app/code/Magento/Shipping/etc/di.xml +++ b/app/code/Magento/Shipping/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Quote\Model\Quote\Address\RateCollectorInterface" type="Magento\Shipping\Model\Shipping" /> <preference for="Magento\Shipping\Model\CarrierFactoryInterface" type="Magento\Shipping\Model\CarrierFactory" /> <preference for="Magento\Shipping\Model\Carrier\Source\GenericInterface" type="\Magento\Shipping\Model\Carrier\Source\GenericDefault" /> diff --git a/app/code/Magento/Shipping/etc/frontend/page_types.xml b/app/code/Magento/Shipping/etc/frontend/page_types.xml index 2b2d3f2c617a3dd0b22785a5b57ac7128180e2f5..ed72fc24fd09a0eaa7595d53ea88dfb7b4454edc 100644 --- a/app/code/Magento/Shipping/etc/frontend/page_types.xml +++ b/app/code/Magento/Shipping/etc/frontend/page_types.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<page_types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_types.xsd"> +<page_types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_types.xsd"> <type id="shipping_tracking_popup" label="Shipment Tracking Popup"/> </page_types> diff --git a/app/code/Magento/Shipping/etc/frontend/routes.xml b/app/code/Magento/Shipping/etc/frontend/routes.xml index 47205c8569075d64fd848898639d5640e8acc81c..741a0295df9ae58aeb89aff93b17f6679eff9d97 100644 --- a/app/code/Magento/Shipping/etc/frontend/routes.xml +++ b/app/code/Magento/Shipping/etc/frontend/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn: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/etc/module.xml b/app/code/Magento/Shipping/etc/module.xml index 3d9bf51a6b6b17aee455d4314a50e3f65e5b9e23..5f17de9dbf23d517270155b65102b61f9bed8da7 100644 --- a/app/code/Magento/Shipping/etc/module.xml +++ b/app/code/Magento/Shipping/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Shipping" setup_version="2.0.0"> <sequence> <module name="Magento_Store"/> diff --git a/app/code/Magento/Shipping/registration.php b/app/code/Magento/Shipping/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..df871bf1c922b0ac32a12d0885ba0e6ab6eb1e19 --- /dev/null +++ b/app/code/Magento/Shipping/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Shipping', + __DIR__ +); diff --git a/app/code/Magento/Shipping/view/adminhtml/layout/adminhtml_order_shipment_addcomment.xml b/app/code/Magento/Shipping/view/adminhtml/layout/adminhtml_order_shipment_addcomment.xml index 0ae30ac66a5a60dc36fe8a36dc7b4e011be866d1..3c75d670a2d91b1415e7d841a9e7ea1a6edeff1d 100644 --- a/app/code/Magento/Shipping/view/adminhtml/layout/adminhtml_order_shipment_addcomment.xml +++ b/app/code/Magento/Shipping/view/adminhtml/layout/adminhtml_order_shipment_addcomment.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <block class="Magento\Shipping\Block\Adminhtml\View\Comments" name="shipment_comments"> <block class="Magento\Sales\Block\Adminhtml\Order\Comments\View" name="order_comments" template="order/comments/view.phtml"/> diff --git a/app/code/Magento/Shipping/view/adminhtml/layout/adminhtml_order_shipment_addtrack.xml b/app/code/Magento/Shipping/view/adminhtml/layout/adminhtml_order_shipment_addtrack.xml index bfbb5f980fb3f8a6e2d13512d9e2ac438039233b..22f8b92f5ab5f67d96a83607d611ce0d1c5ccc00 100644 --- a/app/code/Magento/Shipping/view/adminhtml/layout/adminhtml_order_shipment_addtrack.xml +++ b/app/code/Magento/Shipping/view/adminhtml/layout/adminhtml_order_shipment_addtrack.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <block class="Magento\Shipping\Block\Adminhtml\Order\Tracking\View" name="shipment_tracking" template="order/tracking/view.phtml"/> </body> diff --git a/app/code/Magento/Shipping/view/adminhtml/layout/adminhtml_order_shipment_new.xml b/app/code/Magento/Shipping/view/adminhtml/layout/adminhtml_order_shipment_new.xml index 30b7eb8ccfa825aa519412eca3e35e498173315f..39a6a3bf80e9b35f47a521e03ce0612418bf0ff5 100644 --- a/app/code/Magento/Shipping/view/adminhtml/layout/adminhtml_order_shipment_new.xml +++ b/app/code/Magento/Shipping/view/adminhtml/layout/adminhtml_order_shipment_new.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="admin.scope.col.wrap" htmlClass="admin__old" /> <!-- ToDo UI: remove this wrapper with old styles removal. The class name "admin__old" is for tests only, we shouldn't use it in any way --> <referenceContainer name="content"> diff --git a/app/code/Magento/Shipping/view/adminhtml/layout/adminhtml_order_shipment_removetrack.xml b/app/code/Magento/Shipping/view/adminhtml/layout/adminhtml_order_shipment_removetrack.xml index bfbb5f980fb3f8a6e2d13512d9e2ac438039233b..22f8b92f5ab5f67d96a83607d611ce0d1c5ccc00 100644 --- a/app/code/Magento/Shipping/view/adminhtml/layout/adminhtml_order_shipment_removetrack.xml +++ b/app/code/Magento/Shipping/view/adminhtml/layout/adminhtml_order_shipment_removetrack.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <block class="Magento\Shipping\Block\Adminhtml\Order\Tracking\View" name="shipment_tracking" template="order/tracking/view.phtml"/> </body> diff --git a/app/code/Magento/Shipping/view/adminhtml/layout/adminhtml_order_shipment_view.xml b/app/code/Magento/Shipping/view/adminhtml/layout/adminhtml_order_shipment_view.xml index 049654bf03a97ff760d1b1f2b80ac9fd48a05512..4fb432fd4b467cd12fd51b5e5b0e9f67cbdd8cbd 100644 --- a/app/code/Magento/Shipping/view/adminhtml/layout/adminhtml_order_shipment_view.xml +++ b/app/code/Magento/Shipping/view/adminhtml/layout/adminhtml_order_shipment_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="admin.scope.col.wrap" htmlClass="admin__old" /> <!-- ToDo UI: remove this wrapper with old styles removal. The class name "admin__old" is for tests only, we shouldn't use it in any way --> <referenceContainer name="content"> diff --git a/app/code/Magento/Shipping/view/adminhtml/layout/sales_order_invoice_new.xml b/app/code/Magento/Shipping/view/adminhtml/layout/sales_order_invoice_new.xml index 3a952f6cfdd0ee262f8510bde801ca3711a7892c..bfdbd2b1c9c2e51f34ed332b5e194b4d3713e07b 100644 --- a/app/code/Magento/Shipping/view/adminhtml/layout/sales_order_invoice_new.xml +++ b/app/code/Magento/Shipping/view/adminhtml/layout/sales_order_invoice_new.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="form"> <block class="Magento\Shipping\Block\Adminhtml\Order\Tracking\Invoice" name="tracking" template="order/tracking.phtml"/> diff --git a/app/code/Magento/Shipping/view/adminhtml/layout/sales_order_view.xml b/app/code/Magento/Shipping/view/adminhtml/layout/sales_order_view.xml index d5dc1e632260e39f3d76231c81fa275f2c211f12..3e196cad9f371309e87449eca0be200d6a824ca2 100644 --- a/app/code/Magento/Shipping/view/adminhtml/layout/sales_order_view.xml +++ b/app/code/Magento/Shipping/view/adminhtml/layout/sales_order_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="order_tab_info"> <block class="Magento\Sales\Block\Adminhtml\Order\AbstractOrder" name="order_shipping_view" template="Magento_Shipping::order/view/info.phtml"/> diff --git a/app/code/Magento/Shipping/view/frontend/layout/checkout_index_index.xml b/app/code/Magento/Shipping/view/frontend/layout/checkout_index_index.xml index 14a25393667d7b7bfe54cce7ba0b750f65b0cfd6..963b2258013a87c70afb01a96b0022c208457e3d 100644 --- a/app/code/Magento/Shipping/view/frontend/layout/checkout_index_index.xml +++ b/app/code/Magento/Shipping/view/frontend/layout/checkout_index_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout.root"> <arguments> diff --git a/app/code/Magento/Shipping/view/frontend/layout/sales_guest_reorder.xml b/app/code/Magento/Shipping/view/frontend/layout/sales_guest_reorder.xml index 68df386bbeba508941237612cef8246cfd82cb00..fe79e023ec2bd855b216e10fc6672695ba6aa9be 100644 --- a/app/code/Magento/Shipping/view/frontend/layout/sales_guest_reorder.xml +++ b/app/code/Magento/Shipping/view/frontend/layout/sales_guest_reorder.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="sales.order.view"> <block class="Magento\Shipping\Block\Tracking\Link" name="tracking-info-link" template="tracking/link.phtml"> diff --git a/app/code/Magento/Shipping/view/frontend/layout/sales_guest_shipment.xml b/app/code/Magento/Shipping/view/frontend/layout/sales_guest_shipment.xml index 451b436da101d7df9ad0b052fa244278e92e7950..2fa94624ce9560f71f8c4e6300d9cc1f8faedd6e 100644 --- a/app/code/Magento/Shipping/view/frontend/layout/sales_guest_shipment.xml +++ b/app/code/Magento/Shipping/view/frontend/layout/sales_guest_shipment.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="sales_order_shipment_renderers"/> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/Shipping/view/frontend/layout/sales_guest_view.xml b/app/code/Magento/Shipping/view/frontend/layout/sales_guest_view.xml index 68df386bbeba508941237612cef8246cfd82cb00..fe79e023ec2bd855b216e10fc6672695ba6aa9be 100644 --- a/app/code/Magento/Shipping/view/frontend/layout/sales_guest_view.xml +++ b/app/code/Magento/Shipping/view/frontend/layout/sales_guest_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="sales.order.view"> <block class="Magento\Shipping\Block\Tracking\Link" name="tracking-info-link" template="tracking/link.phtml"> diff --git a/app/code/Magento/Shipping/view/frontend/layout/sales_order_reorder.xml b/app/code/Magento/Shipping/view/frontend/layout/sales_order_reorder.xml index 68df386bbeba508941237612cef8246cfd82cb00..fe79e023ec2bd855b216e10fc6672695ba6aa9be 100644 --- a/app/code/Magento/Shipping/view/frontend/layout/sales_order_reorder.xml +++ b/app/code/Magento/Shipping/view/frontend/layout/sales_order_reorder.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="sales.order.view"> <block class="Magento\Shipping\Block\Tracking\Link" name="tracking-info-link" template="tracking/link.phtml"> diff --git a/app/code/Magento/Shipping/view/frontend/layout/sales_order_shipment.xml b/app/code/Magento/Shipping/view/frontend/layout/sales_order_shipment.xml index b956396c73c56d5526e85b22729cd78127be90ae..0fc24b37af8584d818fe9d54d5e76da10688b992 100644 --- a/app/code/Magento/Shipping/view/frontend/layout/sales_order_shipment.xml +++ b/app/code/Magento/Shipping/view/frontend/layout/sales_order_shipment.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="sales_order_shipment_renderers"/> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/Shipping/view/frontend/layout/sales_order_view.xml b/app/code/Magento/Shipping/view/frontend/layout/sales_order_view.xml index 68df386bbeba508941237612cef8246cfd82cb00..fe79e023ec2bd855b216e10fc6672695ba6aa9be 100644 --- a/app/code/Magento/Shipping/view/frontend/layout/sales_order_view.xml +++ b/app/code/Magento/Shipping/view/frontend/layout/sales_order_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="sales.order.view"> <block class="Magento\Shipping\Block\Tracking\Link" name="tracking-info-link" template="tracking/link.phtml"> diff --git a/app/code/Magento/Shipping/view/frontend/layout/shipping_tracking_popup.xml b/app/code/Magento/Shipping/view/frontend/layout/shipping_tracking_popup.xml index 9e86eb3d64ebd9d62d7adb2848db317ec412d5fa..ae7227b3d265b99e3878db5ffb761030c6a8a958 100644 --- a/app/code/Magento/Shipping/view/frontend/layout/shipping_tracking_popup.xml +++ b/app/code/Magento/Shipping/view/frontend/layout/shipping_tracking_popup.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="empty" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="empty" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Shipping\Block\Tracking\Popup" name="shipping.tracking.popup" template="tracking/popup.phtml"/> diff --git a/app/code/Magento/Sitemap/composer.json b/app/code/Magento/Sitemap/composer.json index 6c5e0ebb9fcd5f07c750baaebbd9906c52f4d572..62598f6ed506c6f560b0f4a76bd7cb6df5978be0 100644 --- a/app/code/Magento/Sitemap/composer.json +++ b/app/code/Magento/Sitemap/composer.json @@ -10,8 +10,7 @@ "magento/module-backend": "1.0.0-beta", "magento/module-catalog-url-rewrite": "1.0.0-beta", "magento/module-media-storage": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -19,12 +18,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Sitemap" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Sitemap\\": "" + } } } diff --git a/app/code/Magento/Sitemap/etc/acl.xml b/app/code/Magento/Sitemap/etc/acl.xml index f8c3fe3299c7caaee63dba5b2a1818d3fe39c023..f9dbac4905edfa4461dd4e257b40a29c55324120 100644 --- a/app/code/Magento/Sitemap/etc/acl.xml +++ b/app/code/Magento/Sitemap/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/app/code/Magento/Sitemap/etc/adminhtml/menu.xml b/app/code/Magento/Sitemap/etc/adminhtml/menu.xml index e4b77e3ebc51f451e324a9433d1c9a56cc75d875..e697734564279128c8faff12d8d482cd97e47d6f 100644 --- a/app/code/Magento/Sitemap/etc/adminhtml/menu.xml +++ b/app/code/Magento/Sitemap/etc/adminhtml/menu.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Backend/etc/menu.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd"> <menu> <add id="Magento_Sitemap::catalog_sitemap" title="Site Map" module="Magento_Sitemap" sortOrder="40" parent="Magento_Backend::marketing_seo" action="adminhtml/sitemap/" resource="Magento_Sitemap::sitemap"/> </menu> diff --git a/app/code/Magento/Sitemap/etc/adminhtml/routes.xml b/app/code/Magento/Sitemap/etc/adminhtml/routes.xml index 1ed96642095991b7195ef8658f86956bb7ff349a..96413c04d33e48aa6be578d4d317e511179069f8 100644 --- a/app/code/Magento/Sitemap/etc/adminhtml/routes.xml +++ b/app/code/Magento/Sitemap/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="admin"> <route id="adminhtml"> <module name="Magento_Sitemap" before="Magento_Backend" /> diff --git a/app/code/Magento/Sitemap/etc/adminhtml/system.xml b/app/code/Magento/Sitemap/etc/adminhtml/system.xml index e3484e071adff8e7d97ab8680b356d47d70e251f..c8b0b37f6590e36ed03a177df1a7e5be057cc398 100644 --- a/app/code/Magento/Sitemap/etc/adminhtml/system.xml +++ b/app/code/Magento/Sitemap/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="sitemap" translate="label" type="text" sortOrder="70" showInDefault="1" showInWebsite="1" showInStore="1"> <label>XML Sitemap</label> diff --git a/app/code/Magento/Sitemap/etc/config.xml b/app/code/Magento/Sitemap/etc/config.xml index 03e72e315546683a613d9212ecf1032f46d3c3a2..0b3400ae7c487da4b1a62f54c4ce6543d6e42759 100644 --- a/app/code/Magento/Sitemap/etc/config.xml +++ b/app/code/Magento/Sitemap/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <sitemap> <limit> diff --git a/app/code/Magento/Sitemap/etc/crontab.xml b/app/code/Magento/Sitemap/etc/crontab.xml index 7a8ba5dd738872dd63925d104897c4d1b8068e91..145776542c50b0d70ac959b32908807ce5bf6bd1 100644 --- a/app/code/Magento/Sitemap/etc/crontab.xml +++ b/app/code/Magento/Sitemap/etc/crontab.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Cron/etc/crontab.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd"> <group id="default"> <job name="sitemap_generate" instance="Magento\Sitemap\Model\Observer" method="scheduledGenerateSitemaps" /> </group> diff --git a/app/code/Magento/Sitemap/etc/di.xml b/app/code/Magento/Sitemap/etc/di.xml index cec2b966a27a9b7b1c6989dbf296ad954a850469..ce96f8645f2388b12240cd3befddb6d6445853ef 100644 --- a/app/code/Magento/Sitemap/etc/di.xml +++ b/app/code/Magento/Sitemap/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Sitemap\Model\Sitemap"> <arguments> <argument name="resource" xsi:type="object">Magento\Sitemap\Model\Resource\Sitemap</argument> diff --git a/app/code/Magento/Sitemap/etc/email_templates.xml b/app/code/Magento/Sitemap/etc/email_templates.xml index a3d0fd0c9fda6fb81c9f367a554b3b81f89cde6b..a2840d1f8e1e1f4b3f1b6fb1965952aa2c1143d2 100644 --- a/app/code/Magento/Sitemap/etc/email_templates.xml +++ b/app/code/Magento/Sitemap/etc/email_templates.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Email/etc/email_templates.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Email:etc/email_templates.xsd"> <template id="sitemap_generate_error_email_template" label="Sitemap Generation Warnings" file="generate_warnings.html" type="text" module="Magento_Sitemap" area="adminhtml"/> </config> diff --git a/app/code/Magento/Sitemap/etc/module.xml b/app/code/Magento/Sitemap/etc/module.xml index c43776ead682c80b0cf307efc32dc5ea8ef89c6d..e32f1d1c36d2800fb4b6698c582d6d133b2ca8c2 100644 --- a/app/code/Magento/Sitemap/etc/module.xml +++ b/app/code/Magento/Sitemap/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Sitemap" setup_version="2.0.0"> <sequence> <module name="Magento_Catalog"/> diff --git a/app/code/Magento/Sitemap/registration.php b/app/code/Magento/Sitemap/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..aa9335c9f529fe41a96d7f9c77dd33b1f281f018 --- /dev/null +++ b/app/code/Magento/Sitemap/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Sitemap', + __DIR__ +); diff --git a/app/code/Magento/Sitemap/view/adminhtml/layout/adminhtml_sitemap_index.xml b/app/code/Magento/Sitemap/view/adminhtml/layout/adminhtml_sitemap_index.xml index 8153c730c0f4e0274ed681665d640acef1c08126..4562fa708ec288fa50a39a5d839f07bcf4761587 100644 --- a/app/code/Magento/Sitemap/view/adminhtml/layout/adminhtml_sitemap_index.xml +++ b/app/code/Magento/Sitemap/view/adminhtml/layout/adminhtml_sitemap_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="adminhtml_sitemap_index_grid_block"/> <body> <referenceContainer name="content"> 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 f7e9e099293170d5278c11f256af209f36980636..aac8b8a34de8e84ced11860eb910b7bd2257ae7c 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 @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="adminhtml.sitemap.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.sitemap.container.grid" as="grid"> diff --git a/app/code/Magento/Store/composer.json b/app/code/Magento/Store/composer.json index 477a12b21de1ce5593a172df3d601d52183a0808..9bae2901d7259f268d121a2cb57eee935f5caffd 100644 --- a/app/code/Magento/Store/composer.json +++ b/app/code/Magento/Store/composer.json @@ -8,8 +8,7 @@ "magento/module-ui": "1.0.0-beta", "magento/module-config": "1.0.0-beta", "magento/module-media-storage": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -17,12 +16,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Store" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Store\\": "" + } } } diff --git a/app/code/Magento/Store/etc/cache.xml b/app/code/Magento/Store/etc/cache.xml index 715a5a12e55b2534294eb688907d3522cbfa5e5e..aa98a30bf62b7d0d9354598c207d609b9f727b2f 100644 --- a/app/code/Magento/Store/etc/cache.xml +++ b/app/code/Magento/Store/etc/cache.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Cache/etc/cache.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Cache/etc/cache.xsd"> <type name="config" translate="label,description" instance="Magento\Framework\App\Cache\Type\Config"> <label>Configuration</label> <description>Various XML configurations that were collected across modules and merged.</description> diff --git a/app/code/Magento/Store/etc/config.xml b/app/code/Magento/Store/etc/config.xml index 131a73e7abba3a4b2f9423a92f0a56313e93a4e2..c233c235a5a3312666a7a78f5745b089efa71d1b 100644 --- a/app/code/Magento/Store/etc/config.xml +++ b/app/code/Magento/Store/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <design> <pagination> diff --git a/app/code/Magento/Store/etc/data_source/website.xml b/app/code/Magento/Store/etc/data_source/website.xml index 3e922ba9c5ac52327f132c8628288c7548aab444..7e08efedffd0ad50cd57b1bf2921b6d5933e3acc 100644 --- a/app/code/Magento/Store/etc/data_source/website.xml +++ b/app/code/Magento/Store/etc/data_source/website.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Ui/etc/data_source.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/data_source.xsd"> <dataSource name="website" label="Website" dataSet="Magento\Store\Model\Resource\Website\Collection"> <fields> <field name="website_id" dataType="number" visible="false"/> diff --git a/app/code/Magento/Store/etc/di.xml b/app/code/Magento/Store/etc/di.xml index 3440b16c414579544affe9e8afae0ebf6bac01bf..58539845dd65c03350af20782b4863226f85d4a7 100644 --- a/app/code/Magento/Store/etc/di.xml +++ b/app/code/Magento/Store/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Store\Api\StoreRepositoryInterface" type="Magento\Store\Model\StoreRepository"/> <preference for="Magento\Store\Api\GroupRepositoryInterface" type="Magento\Store\Model\GroupRepository"/> <preference for="Magento\Store\Api\WebsiteRepositoryInterface" type="Magento\Store\Model\WebsiteRepository"/> diff --git a/app/code/Magento/Store/etc/frontend/di.xml b/app/code/Magento/Store/etc/frontend/di.xml index f530d25289441a2a3452d0fd916aa3d4e0564aeb..cbd64af61b58612bcf2b992a3b3d36926b2c6f03 100644 --- a/app/code/Magento/Store/etc/frontend/di.xml +++ b/app/code/Magento/Store/etc/frontend/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Framework\App\FrontController"> <plugin name="requestPreprocessor" type="Magento\Store\App\FrontController\Plugin\RequestPreprocessor" sortOrder="50"/> </type> diff --git a/app/code/Magento/Store/etc/frontend/routes.xml b/app/code/Magento/Store/etc/frontend/routes.xml index 2c118f7a8786e32cb162da2831e33e4b055ecc2f..92d7b151cd5c7389e011218204387a132c65c1b3 100644 --- a/app/code/Magento/Store/etc/frontend/routes.xml +++ b/app/code/Magento/Store/etc/frontend/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="standard"> <route id="stores" frontName="stores"> <module name="Magento_Store" /> diff --git a/app/code/Magento/Store/etc/frontend/sections.xml b/app/code/Magento/Store/etc/frontend/sections.xml index 97683ac6f435711285674064b28c0c679535d187..e7cad6ac913d678004670375abc1c9f32dcaa0bc 100644 --- a/app/code/Magento/Store/etc/frontend/sections.xml +++ b/app/code/Magento/Store/etc/frontend/sections.xml @@ -6,6 +6,6 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../Magento/Customer/etc/sections.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd"> <action name="stores/store/switch"/> </config> diff --git a/app/code/Magento/Store/etc/module.xml b/app/code/Magento/Store/etc/module.xml index b01976513381612bc4bafddd9463531ee54ea72e..7dc5f5f81b6b15e515d9a9e580d29aad103ccd95 100644 --- a/app/code/Magento/Store/etc/module.xml +++ b/app/code/Magento/Store/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Store" setup_version="2.0.0"> </module> </config> diff --git a/app/code/Magento/Store/etc/webapi.xml b/app/code/Magento/Store/etc/webapi.xml index f8d4160c5baf8e4482495c74c23e8ffe8588c2f4..b8964872af2875f4e4dddfc832b42d04c0427229 100644 --- a/app/code/Magento/Store/etc/webapi.xml +++ b/app/code/Magento/Store/etc/webapi.xml @@ -6,7 +6,7 @@ */ --> <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../app/code/Magento/Webapi/etc/webapi.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd"> <!-- StoreView --> <route url="/V1/store/storeViews" method="GET"> <service class="Magento\Store\Api\StoreRepositoryInterface" method="getList"/> diff --git a/app/code/Magento/Store/registration.php b/app/code/Magento/Store/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..0be50f910a0ea07ef77de43da71971b70fb287f1 --- /dev/null +++ b/app/code/Magento/Store/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Store', + __DIR__ +); diff --git a/app/code/Magento/Swagger/composer.json b/app/code/Magento/Swagger/composer.json index 1e0f8840199d432dc4ba508a3c82039c33445d93..878f5c8dfefd02d7623023db544e2c8f52ac8d38 100644 --- a/app/code/Magento/Swagger/composer.json +++ b/app/code/Magento/Swagger/composer.json @@ -3,8 +3,7 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -12,12 +11,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Swagger" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Swagger\\": "" + } } } diff --git a/app/code/Magento/Swagger/etc/frontend/routes.xml b/app/code/Magento/Swagger/etc/frontend/routes.xml index 02b9256427512049c25c88a1f32286b25ecd007e..98e4c61e4ecd8995bfcd1667ca721aff90d92958 100644 --- a/app/code/Magento/Swagger/etc/frontend/routes.xml +++ b/app/code/Magento/Swagger/etc/frontend/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="standard"> <route id="swagger" frontName="swagger"> <module name="Magento_Swagger" /> diff --git a/app/code/Magento/Swagger/etc/module.xml b/app/code/Magento/Swagger/etc/module.xml index 06e6a83b6b213b8e502e240d362aace11062169b..f64e5ef3f1fb1c2720cd42301e8b656eb5813d6b 100644 --- a/app/code/Magento/Swagger/etc/module.xml +++ b/app/code/Magento/Swagger/etc/module.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Swagger" setup_version="2.0.0" /> </config> diff --git a/app/code/Magento/Swagger/registration.php b/app/code/Magento/Swagger/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..414fe9481e117d025721dae0a5c2116c9a7b07f7 --- /dev/null +++ b/app/code/Magento/Swagger/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Swagger', + __DIR__ +); diff --git a/app/code/Magento/Swagger/view/frontend/layout/swagger_index_index.xml b/app/code/Magento/Swagger/view/frontend/layout/swagger_index_index.xml index 8ce4c95f94275746b0df6182cbf15052c4ff1934..7d0df45fd2914b6d7b23e5838edd02bd96883b46 100644 --- a/app/code/Magento/Swagger/view/frontend/layout/swagger_index_index.xml +++ b/app/code/Magento/Swagger/view/frontend/layout/swagger_index_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd" label="qwerty"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="qwerty"> <head> <title>Swagger UI</title> diff --git a/app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/lib/marked.js b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/lib/marked.js index c2a678d5504aa3a1c204342fb832637ab2eeec51..9403e31f3c8796597d1764b72c321999227ac767 100644 --- a/app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/lib/marked.js +++ b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/lib/marked.js @@ -2,6 +2,8 @@ * marked - a markdown parser * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) * https://github.com/chjj/marked + * + * Modified by X.Commerce, Inc. d/b/a/ Magento, Inc., Modifications © 2015 X.Commerce, Inc. d/b/a/ Magento, Inc */ ;(function() { @@ -712,17 +714,17 @@ InlineLexer.prototype.smartypants = function(text) { if (!this.options.smartypants) return text; return text // em-dashes - .replace(/--/g, '\u2014') + .replace('/--/g', '\u2014') // opening singles - .replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018') + .replace('/(^|[-\u2014/(\[{"\s])\'/g', '$1\u2018') // closing singles & apostrophes - .replace(/'/g, '\u2019') + .replace('/\'/g', '\u2019') // opening doubles - .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c') + .replace('/(^|[-\u2014/(\[{\u2018\s])"/g', '$1\u201c') // closing doubles - .replace(/"/g, '\u201d') + .replace('/"/g', '\u201d') // ellipses - .replace(/\.{3}/g, '\u2026'); + .replace('/\.{3}/g', '\u2026'); }; /** @@ -1269,4 +1271,4 @@ if (typeof module !== 'undefined' && typeof exports === 'object') { }).call(function() { return this || (typeof window !== 'undefined' ? window : global); -}()); \ No newline at end of file +}()); diff --git a/app/code/Magento/Swatches/composer.json b/app/code/Magento/Swatches/composer.json index 6cc94c567d3e8195cf6e7ded5d1d162b3fc193dc..6a2c1e87ada811548efc050aee3412bc197f49d6 100644 --- a/app/code/Magento/Swatches/composer.json +++ b/app/code/Magento/Swatches/composer.json @@ -12,8 +12,7 @@ "magento/module-media-storage": "1.0.0-beta", "magento/module-config": "1.0.0-beta", "magento/module-theme": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "suggest": { "magento/module-layered-navigation": "1.0.0-beta" @@ -23,12 +22,10 @@ "license": [ "proprietary" ], - "extra": { - "map": [ - [ - "*", - "Magento/Swatches" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Swatches\\": "" + } } } diff --git a/app/code/Magento/Swatches/etc/adminhtml/di.xml b/app/code/Magento/Swatches/etc/adminhtml/di.xml index 14daf1a6acf7acdd4052a917f2d6f80a8057cca5..a798efe331a0c50859e625afbfe5cca2e2c20273 100644 --- a/app/code/Magento/Swatches/etc/adminhtml/di.xml +++ b/app/code/Magento/Swatches/etc/adminhtml/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Catalog\Controller\Adminhtml\Product\Attribute\Save"> <plugin name="save_swatches_frontend_input" type="Magento\Swatches\Controller\Adminhtml\Product\Attribute\Plugin\Save"/> </type> diff --git a/app/code/Magento/Swatches/etc/adminhtml/events.xml b/app/code/Magento/Swatches/etc/adminhtml/events.xml index 1565e8c53ed0206e151a44808de0946e5d0ca265..d75d2fa360d80d7433c561ba793f9d077ce4fbba 100644 --- a/app/code/Magento/Swatches/etc/adminhtml/events.xml +++ b/app/code/Magento/Swatches/etc/adminhtml/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="product_attribute_form_build_main_tab"> <observer name="add_swatch_fields_to_attribute" instance="Magento\Swatches\Observer\AddFieldsToAttributeObserver" method="execute" /> </event> diff --git a/app/code/Magento/Swatches/etc/adminhtml/routes.xml b/app/code/Magento/Swatches/etc/adminhtml/routes.xml index 1a88a1c67a8ce66433ed414342fd656dd113308e..e6467da08821aef9517fe14834670d4e9c0f5624 100644 --- a/app/code/Magento/Swatches/etc/adminhtml/routes.xml +++ b/app/code/Magento/Swatches/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="admin"> <route id="swatches" frontName="swatches"> <module name="Magento_Swatches" before="Magento_Backend" /> diff --git a/app/code/Magento/Swatches/etc/adminhtml/system.xml b/app/code/Magento/Swatches/etc/adminhtml/system.xml index a746dfe6aaf59a663284a561e388dcfc1c6ae10e..4a2bdae0031796a1631130507e71ec49f87d074f 100644 --- a/app/code/Magento/Swatches/etc/adminhtml/system.xml +++ b/app/code/Magento/Swatches/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="catalog" translate="label" type="text" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1"> <group id="frontend" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="1"> diff --git a/app/code/Magento/Swatches/etc/config.xml b/app/code/Magento/Swatches/etc/config.xml index 5dafcc26c457b5971f1d67ef39eb91d7ea61320b..6f4c9b55091ea105338728a254605e7ea691051f 100644 --- a/app/code/Magento/Swatches/etc/config.xml +++ b/app/code/Magento/Swatches/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <catalog> <frontend> diff --git a/app/code/Magento/Swatches/etc/di.xml b/app/code/Magento/Swatches/etc/di.xml index 1030cd4af02aa77efd225e21313f69f8b7008d0b..ac62a22502c2c036bcfca8b724c296654c64da43 100644 --- a/app/code/Magento/Swatches/etc/di.xml +++ b/app/code/Magento/Swatches/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Catalog\Model\Resource\Eav\Attribute"> <plugin name="save_swatches_option_params" type="Magento\Swatches\Model\Plugin\EavAttribute"/> </type> diff --git a/app/code/Magento/Swatches/etc/frontend/routes.xml b/app/code/Magento/Swatches/etc/frontend/routes.xml index c500b345386916a213096bf1d662913e68f8cb92..ff2535b2523b80b3b7b74382f2ec9010b77849e9 100644 --- a/app/code/Magento/Swatches/etc/frontend/routes.xml +++ b/app/code/Magento/Swatches/etc/frontend/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="standard"> <route id="swatches" frontName="swatches"> <module name="Magento_Swatches" /> diff --git a/app/code/Magento/Swatches/etc/module.xml b/app/code/Magento/Swatches/etc/module.xml index 7b6fd41325d6b5db2793148b6f310f6b2c3f36bc..e47acbe32bdb32538dae33ddc0bcee3e59cfb737 100644 --- a/app/code/Magento/Swatches/etc/module.xml +++ b/app/code/Magento/Swatches/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Swatches" setup_version="2.0.0"> <sequence> <module name="Magento_Catalog"/> diff --git a/app/code/Magento/Swatches/etc/view.xml b/app/code/Magento/Swatches/etc/view.xml index df7164736d7008f5f1d4660f96d7439b05d186b3..b880f30786d5d02f127575babf1da0178c567405 100644 --- a/app/code/Magento/Swatches/etc/view.xml +++ b/app/code/Magento/Swatches/etc/view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Catalog/etc/view.xsd"> +<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Catalog/etc/view.xsd"> <media> <images module="Magento_Catalog"> <image id="swatch_image" type="swatch_image"> diff --git a/app/code/Magento/Swatches/registration.php b/app/code/Magento/Swatches/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..b40ed4aca738767bc0d1465b0e90f8ff2632b975 --- /dev/null +++ b/app/code/Magento/Swatches/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Swatches', + __DIR__ +); diff --git a/app/code/Magento/Swatches/view/adminhtml/layout/catalog_product_attribute_edit.xml b/app/code/Magento/Swatches/view/adminhtml/layout/catalog_product_attribute_edit.xml index 8013313e6ec9563fb3037ce41600bbff9d759390..8146ba08643270020c01180aeeb0e116e0af1f5c 100644 --- a/app/code/Magento/Swatches/view/adminhtml/layout/catalog_product_attribute_edit.xml +++ b/app/code/Magento/Swatches/view/adminhtml/layout/catalog_product_attribute_edit.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <css src="Magento_Swatches::css/swatches.css"/> <css src="jquery/colorpicker/css/colorpicker.css"/> diff --git a/app/code/Magento/Swatches/view/adminhtml/layout/catalog_product_attribute_edit_popup.xml b/app/code/Magento/Swatches/view/adminhtml/layout/catalog_product_attribute_edit_popup.xml index 3f9bfe640b8f1be53f0c0c8a80a00f822205bc23..1fdbd5d6b367032ee2b51e8382c13f7cb8a722ac 100755 --- a/app/code/Magento/Swatches/view/adminhtml/layout/catalog_product_attribute_edit_popup.xml +++ b/app/code/Magento/Swatches/view/adminhtml/layout/catalog_product_attribute_edit_popup.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page layout="admin-1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page layout="admin-1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <css src="Magento_Swatches::css/swatches.css"/> <css src="jquery/colorpicker/css/colorpicker.css"/> diff --git a/app/code/Magento/Swatches/view/frontend/layout/catalog_category_view.xml b/app/code/Magento/Swatches/view/frontend/layout/catalog_category_view.xml index 9652aa434319ef48a2caaa95f9656d16e8f29da6..b572f2819b09d052b755054c86a1078cd357f398 100644 --- a/app/code/Magento/Swatches/view/frontend/layout/catalog_category_view.xml +++ b/app/code/Magento/Swatches/view/frontend/layout/catalog_category_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <css src="Magento_Swatches::css/swatches.css"/> </head> diff --git a/app/code/Magento/Swatches/view/frontend/layout/catalog_product_view_type_configurable.xml b/app/code/Magento/Swatches/view/frontend/layout/catalog_product_view_type_configurable.xml index 278270a42d0c85df3dada0974b85bc95a9854e57..4ca9aedeae78b3f5ab21e390b7e329fc5e745937 100755 --- a/app/code/Magento/Swatches/view/frontend/layout/catalog_product_view_type_configurable.xml +++ b/app/code/Magento/Swatches/view/frontend/layout/catalog_product_view_type_configurable.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <css src="Magento_Swatches::css/swatches.css"/> </head> diff --git a/app/code/Magento/Tax/Model/Calculation/AbstractAggregateCalculator.php b/app/code/Magento/Tax/Model/Calculation/AbstractAggregateCalculator.php index 02487bd7cd5ab8aa0526bf43f29ef3237a87638e..05bd7fd103dbf27124974334778fe7cc9b429b8b 100644 --- a/app/code/Magento/Tax/Model/Calculation/AbstractAggregateCalculator.php +++ b/app/code/Magento/Tax/Model/Calculation/AbstractAggregateCalculator.php @@ -36,7 +36,7 @@ abstract class AbstractAggregateCalculator extends AbstractCalculator if ($applyTaxAfterDiscount) { $deltaRoundingType = self::KEY_TAX_BEFORE_DISCOUNT_DELTA_ROUNDING; } - $rowTax = $this->roundAmount($rowTaxExact, $rate, true, $deltaRoundingType, $round); + $rowTax = $this->roundAmount($rowTaxExact, $rate, true, $deltaRoundingType, $round, $item); $rowTotal = $rowTotalInclTax - $rowTax; $price = $rowTotal / $quantity; if ($round) { @@ -58,7 +58,8 @@ abstract class AbstractAggregateCalculator extends AbstractCalculator $rate, true, self::KEY_REGULAR_DELTA_ROUNDING, - $round + $round, + $item ); // Set discount tax compensation $discountTaxCompensationAmount = $rowTax - $rowTaxAfterDiscount; @@ -67,7 +68,6 @@ abstract class AbstractAggregateCalculator extends AbstractCalculator // Calculate applied taxes /** @var \Magento\Tax\Api\Data\AppliedTaxInterface[] $appliedTaxes */ - $appliedTaxes = []; $appliedRates = $this->calculationTool->getAppliedRates($taxRateRequest); $appliedTaxes = $this->getAppliedTaxes($rowTax, $rate, $appliedRates); @@ -115,7 +115,7 @@ abstract class AbstractAggregateCalculator extends AbstractCalculator if ($applyTaxAfterDiscount) { $deltaRoundingType = self::KEY_TAX_BEFORE_DISCOUNT_DELTA_ROUNDING; } - $rowTaxPerRate = $this->roundAmount($rowTaxPerRate, $taxId, false, $deltaRoundingType, $round); + $rowTaxPerRate = $this->roundAmount($rowTaxPerRate, $taxId, false, $deltaRoundingType, $round, $item); $rowTaxAfterDiscount = $rowTaxPerRate; //Handle discount @@ -133,7 +133,8 @@ abstract class AbstractAggregateCalculator extends AbstractCalculator $taxId, false, self::KEY_REGULAR_DELTA_ROUNDING, - $round + $round, + $item ); } $appliedTaxes[$taxId] = $this->getAppliedTax( @@ -174,6 +175,7 @@ abstract class AbstractAggregateCalculator extends AbstractCalculator * @param null|bool $direction * @param string $type * @param bool $round + * @param QuoteDetailsItemInterface $item * @return float */ abstract protected function roundAmount( @@ -181,6 +183,7 @@ abstract class AbstractAggregateCalculator extends AbstractCalculator $rate = null, $direction = null, $type = self::KEY_REGULAR_DELTA_ROUNDING, - $round = true + $round = true, + $item = null ); } diff --git a/app/code/Magento/Tax/Model/Calculation/RowBaseCalculator.php b/app/code/Magento/Tax/Model/Calculation/RowBaseCalculator.php index fed7f4901c59cdf922bf5ea9ec926789b3791277..fca6e449dadb27c1b969b817cc65217635cc1dcd 100644 --- a/app/code/Magento/Tax/Model/Calculation/RowBaseCalculator.php +++ b/app/code/Magento/Tax/Model/Calculation/RowBaseCalculator.php @@ -16,11 +16,17 @@ class RowBaseCalculator extends AbstractAggregateCalculator $rate = null, $direction = null, $type = self::KEY_REGULAR_DELTA_ROUNDING, - $round = true + $round = true, + $item = null ) { - if ($round) { - $amount = $this->calculationTool->round($amount); + + if ($item->getAssociatedItemCode()) { + // Use delta rounding of the product's instead of the weee's + $type = $type . $item->getAssociatedItemCode(); + } else { + $type = $type . $item->getCode(); } - return $amount; + + return $this->deltaRound($amount, $rate, $direction, $type, $round); } } diff --git a/app/code/Magento/Tax/Model/Calculation/TotalBaseCalculator.php b/app/code/Magento/Tax/Model/Calculation/TotalBaseCalculator.php index d34122105e8c7f0c06daf7194227608618964c5f..d50257a0a5371be805dba42b8c1e5daa3259e463 100644 --- a/app/code/Magento/Tax/Model/Calculation/TotalBaseCalculator.php +++ b/app/code/Magento/Tax/Model/Calculation/TotalBaseCalculator.php @@ -16,7 +16,8 @@ class TotalBaseCalculator extends AbstractAggregateCalculator $rate = null, $direction = null, $type = self::KEY_REGULAR_DELTA_ROUNDING, - $round = true + $round = true, + $item = null ) { return $this->deltaRound($amount, $rate, $direction, $type, $round); } diff --git a/app/code/Magento/Tax/Model/Calculation/UnitBaseCalculator.php b/app/code/Magento/Tax/Model/Calculation/UnitBaseCalculator.php index b42fbed6d5bbf8bcf488164cbbfadfa5a23d31bb..37c22cf5e147c4d4c7a01420650dd39a71d3e7da 100644 --- a/app/code/Magento/Tax/Model/Calculation/UnitBaseCalculator.php +++ b/app/code/Magento/Tax/Model/Calculation/UnitBaseCalculator.php @@ -9,6 +9,27 @@ use Magento\Tax\Api\Data\QuoteDetailsItemInterface; class UnitBaseCalculator extends AbstractCalculator { + /** + * {@inheritdoc} + */ + protected function roundAmount( + $amount, + $rate = null, + $direction = null, + $type = self::KEY_REGULAR_DELTA_ROUNDING, + $round = true, + $item = null + ) { + if ($item->getAssociatedItemCode()) { + // Use delta rounding of the product's instead of the weee's + $type = $type . $item->getAssociatedItemCode(); + } else { + $type = $type . $item->getCode(); + } + + return $this->deltaRound($amount, $rate, $direction, $type, $round); + } + /** * {@inheritdoc} */ @@ -21,18 +42,23 @@ class UnitBaseCalculator extends AbstractCalculator $storeRate = $storeRate = $this->calculationTool->getStoreRate($taxRateRequest, $this->storeId); // Calculate $priceInclTax + $applyTaxAfterDiscount = $this->config->applyTaxAfterDiscount($this->storeId); $priceInclTax = $this->calculationTool->round($item->getUnitPrice()); if (!$this->isSameRateAsStore($rate, $storeRate)) { $priceInclTax = $this->calculatePriceInclTax($priceInclTax, $storeRate, $rate); } - $uniTax = $this->calculationTool->calcTaxAmount($priceInclTax, $rate, true, true); + $uniTax = $this->calculationTool->calcTaxAmount($priceInclTax, $rate, true, false); + $deltaRoundingType = self::KEY_REGULAR_DELTA_ROUNDING; + if ($applyTaxAfterDiscount) { + $deltaRoundingType = self::KEY_TAX_BEFORE_DISCOUNT_DELTA_ROUNDING; + } + $uniTax = $this->roundAmount($uniTax, $rate, true, $deltaRoundingType, $round, $item); $price = $priceInclTax - $uniTax; //Handle discount $discountTaxCompensationAmount = 0; - $applyTaxAfterDiscount = $this->config->applyTaxAfterDiscount($this->storeId); $discountAmount = $item->getDiscountAmount(); - if ($discountAmount && $applyTaxAfterDiscount) { + if ($applyTaxAfterDiscount) { //TODO: handle originalDiscountAmount $unitDiscountAmount = $discountAmount / $quantity; $taxableAmount = max($priceInclTax - $unitDiscountAmount, 0); @@ -40,7 +66,15 @@ class UnitBaseCalculator extends AbstractCalculator $taxableAmount, $rate, true, - true + false + ); + $unitTaxAfterDiscount = $this->roundAmount( + $unitTaxAfterDiscount, + $rate, + true, + self::KEY_REGULAR_DELTA_ROUNDING, + $round, + $item ); // Set discount tax compensation @@ -93,11 +127,16 @@ class UnitBaseCalculator extends AbstractCalculator foreach ($appliedRates as $appliedRate) { $taxId = $appliedRate['id']; $taxRate = $appliedRate['percent']; - $unitTaxPerRate = $this->calculationTool->calcTaxAmount($price, $taxRate, false); + $unitTaxPerRate = $this->calculationTool->calcTaxAmount($price, $taxRate, false, false); + $deltaRoundingType = self::KEY_REGULAR_DELTA_ROUNDING; + if ($applyTaxAfterDiscount) { + $deltaRoundingType = self::KEY_TAX_BEFORE_DISCOUNT_DELTA_ROUNDING; + } + $unitTaxPerRate = $this->roundAmount($unitTaxPerRate, $taxId, false, $deltaRoundingType, $round, $item); $unitTaxAfterDiscount = $unitTaxPerRate; //Handle discount - if ($discountAmount && $applyTaxAfterDiscount) { + if ($applyTaxAfterDiscount) { //TODO: handle originalDiscountAmount $unitDiscountAmount = $discountAmount / $quantity; $taxableAmount = max($price - $unitDiscountAmount, 0); @@ -105,7 +144,15 @@ class UnitBaseCalculator extends AbstractCalculator $taxableAmount, $taxRate, false, - true + false + ); + $unitTaxAfterDiscount = $this->roundAmount( + $unitTaxAfterDiscount, + $taxId, + false, + self::KEY_REGULAR_DELTA_ROUNDING, + $round, + $item ); } $appliedTaxes[$taxId] = $this->getAppliedTax( diff --git a/app/code/Magento/Tax/Model/Config.php b/app/code/Magento/Tax/Model/Config.php index 116529a13b55162195607487539b4400fd1f29ff..1ae217fa92e3e9a346b5f6e4763346f887d6ec34 100644 --- a/app/code/Magento/Tax/Model/Config.php +++ b/app/code/Magento/Tax/Model/Config.php @@ -787,12 +787,11 @@ class Config * Return the notification info url * * @param null|string|bool|int|Store $store - * @return bool - * @SuppressWarnings(PHPMD.BooleanGetMethodName) + * @return string */ public function getInfoUrl($store = null) { - return (bool)$this->_scopeConfig->getValue( + return (string)$this->_scopeConfig->getValue( self::XML_PATH_TAX_NOTIFICATION_INFO_URL, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $store diff --git a/app/code/Magento/Tax/Test/Unit/App/Action/ContextPluginTest.php b/app/code/Magento/Tax/Test/Unit/App/Action/ContextPluginTest.php index bbc28ed6b00880d4f24317f37b58072dc3bf1863..f8ab3eb71e9bc3ecb28705641ce93a335dd997d1 100644 --- a/app/code/Magento/Tax/Test/Unit/App/Action/ContextPluginTest.php +++ b/app/code/Magento/Tax/Test/Unit/App/Action/ContextPluginTest.php @@ -73,6 +73,7 @@ class ContextPluginTest extends \PHPUnit_Framework_TestCase $this->taxCalculationMock = $this->getMockBuilder('Magento\Tax\Model\Calculation\Proxy') ->disableOriginalConstructor() + ->setMethods(['getTaxRates']) ->getMock(); $this->customerSessionMock = $this->getMockBuilder('Magento\Customer\Model\Session') diff --git a/app/code/Magento/Tax/Test/Unit/Model/Calculation/RowBaseAndTotalBaseCalculatorTestCase.php b/app/code/Magento/Tax/Test/Unit/Model/Calculation/RowBaseAndTotalBaseCalculatorTestCase.php index 39323015b6c5b048e94c301781fc378b899e782b..c4c271aef036101adb3366f5ab3588f7f65b2ed6 100644 --- a/app/code/Magento/Tax/Test/Unit/Model/Calculation/RowBaseAndTotalBaseCalculatorTestCase.php +++ b/app/code/Magento/Tax/Test/Unit/Model/Calculation/RowBaseAndTotalBaseCalculatorTestCase.php @@ -152,7 +152,7 @@ class RowBaseAndTotalBaseCalculatorTestCase extends \PHPUnit_Framework_TestCase self::MOCK_VALUE => 1, ], [ - self::ONCE => true, + self::ONCE => false, self::MOCK_METHOD_NAME => 'getCode', self::MOCK_VALUE => self::CODE ], diff --git a/app/code/Magento/Tax/Test/Unit/Model/Calculation/RowBaseCalculatorTest.php b/app/code/Magento/Tax/Test/Unit/Model/Calculation/RowBaseCalculatorTest.php index 85a2778696c9312a54aa2668a41200e1d188760e..3de3c4b10ea28f0805e3598ad8bd581288339c88 100644 --- a/app/code/Magento/Tax/Test/Unit/Model/Calculation/RowBaseCalculatorTest.php +++ b/app/code/Magento/Tax/Test/Unit/Model/Calculation/RowBaseCalculatorTest.php @@ -21,7 +21,7 @@ class RowBaseCalculatorTest extends RowBaseAndTotalBaseCalculatorTestCase { $this->initMocks(true); $this->initRowBaseCalculator(); - $this->rowBaseCalculator->expects($this->once()) + $this->rowBaseCalculator->expects($this->atLeastOnce()) ->method('deltaRound')->will($this->returnValue(0)); $this->assertSame( @@ -34,7 +34,7 @@ class RowBaseCalculatorTest extends RowBaseAndTotalBaseCalculatorTestCase { $this->initMocks(false); $this->initRowBaseCalculator(); - $this->rowBaseCalculator->expects($this->never()) + $this->rowBaseCalculator->expects($this->atLeastOnce()) ->method('deltaRound'); $this->assertSame( diff --git a/app/code/Magento/Tax/Test/Unit/Model/Calculation/UnitBaseCalculatorTest.php b/app/code/Magento/Tax/Test/Unit/Model/Calculation/UnitBaseCalculatorTest.php index c9c7b354493cbcb64eda954fa7af85db8725c472..9f69f1a2035bf1f8bd629490d795f0f64c1007c3 100644 --- a/app/code/Magento/Tax/Test/Unit/Model/Calculation/UnitBaseCalculatorTest.php +++ b/app/code/Magento/Tax/Test/Unit/Model/Calculation/UnitBaseCalculatorTest.php @@ -18,7 +18,7 @@ class UnitBaseCalculatorTest extends \PHPUnit_Framework_TestCase const CODE = 'CODE'; const TYPE = 'TYPE'; - const ROW_TAX = 44.954135954136; + const ROW_TAX = 44.954136954136; /** @var \PHPUnit_Framework_MockObject_MockObject */ protected $taxDetailsItemDataObjectFactoryMock; @@ -181,7 +181,7 @@ class UnitBaseCalculatorTest extends \PHPUnit_Framework_TestCase $mockItem->expects($this->once()) ->method('getDiscountAmount') ->will($this->returnValue(1)); - $mockItem->expects($this->once()) + $mockItem->expects($this->atLeastOnce()) ->method('getCode') ->will($this->returnValue(self::CODE)); $mockItem->expects($this->once()) diff --git a/app/code/Magento/Tax/Test/Unit/Model/ConfigTest.php b/app/code/Magento/Tax/Test/Unit/Model/ConfigTest.php index 3df9ccfdab8e2b1b47acc1241cda5ae39176b18d..6241cc02192dfbbb82d3ac11e9558683cab45379 100644 --- a/app/code/Magento/Tax/Test/Unit/Model/ConfigTest.php +++ b/app/code/Magento/Tax/Test/Unit/Model/ConfigTest.php @@ -363,8 +363,8 @@ class ConfigTest extends \PHPUnit_Framework_TestCase [ 'getInfoUrl', Config::XML_PATH_TAX_NOTIFICATION_INFO_URL, - true, - true + 'http:\\kiwis.rule.com', + 'http:\\kiwis.rule.com' ] ]; } diff --git a/app/code/Magento/Tax/composer.json b/app/code/Magento/Tax/composer.json index 7c407ca65a7727fa36164d7e6035b3925eb087e9..7645004662e006e63dd1382ec3b98d6e7068c900 100644 --- a/app/code/Magento/Tax/composer.json +++ b/app/code/Magento/Tax/composer.json @@ -16,8 +16,7 @@ "magento/module-reports": "1.0.0-beta", "magento/module-page-cache": "1.0.0-beta", "magento/module-quote": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -25,12 +24,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Tax" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Tax\\": "" + } } } diff --git a/app/code/Magento/Tax/etc/acl.xml b/app/code/Magento/Tax/etc/acl.xml index 2b9bae2e5e830a592f118863ca9112d6b4030b47..3096b19afc9dec03fb03fb3ef3575405f15ad686 100644 --- a/app/code/Magento/Tax/etc/acl.xml +++ b/app/code/Magento/Tax/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/app/code/Magento/Tax/etc/adminhtml/di.xml b/app/code/Magento/Tax/etc/adminhtml/di.xml index 0c9ea16d8277bc160a8cd91f1540e3118756fea6..99f3ef04b1fce2edf74ffc8abf15e68482491aa9 100644 --- a/app/code/Magento/Tax/etc/adminhtml/di.xml +++ b/app/code/Magento/Tax/etc/adminhtml/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Framework\Notification\MessageList"> <arguments> <argument name="messages" xsi:type="array"> diff --git a/app/code/Magento/Tax/etc/adminhtml/menu.xml b/app/code/Magento/Tax/etc/adminhtml/menu.xml index 92035a380cec065108e11f17cd64286f736fc937..8b866075e2b77c5d3dc5ea46d5dd765120d7e3d2 100644 --- a/app/code/Magento/Tax/etc/adminhtml/menu.xml +++ b/app/code/Magento/Tax/etc/adminhtml/menu.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Backend/etc/menu.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd"> <menu> <add id="Magento_Tax::sales_tax" title="Taxes" module="Magento_Tax" sortOrder="20" parent="Magento_Backend::stores" resource="Magento_Tax::manage_tax"/> <add id="Magento_Tax::sales_tax_rules" title="Tax Rules" module="Magento_Tax" sortOrder="10" parent="Magento_Tax::sales_tax" action="tax/rule" resource="Magento_Tax::manage_tax"/> diff --git a/app/code/Magento/Tax/etc/adminhtml/routes.xml b/app/code/Magento/Tax/etc/adminhtml/routes.xml index 226f13afeb407b8fb9f2a438afffd36e91603762..17f1e9ce66c2129ef779080e4915a546d6f80459 100644 --- a/app/code/Magento/Tax/etc/adminhtml/routes.xml +++ b/app/code/Magento/Tax/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn: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/adminhtml/system.xml b/app/code/Magento/Tax/etc/adminhtml/system.xml index 33a83ffb1c5a02f67bb91a59b5ada6e27c98be32..a50f6d239d77253801642a4eefdf85b75963cfc3 100644 --- a/app/code/Magento/Tax/etc/adminhtml/system.xml +++ b/app/code/Magento/Tax/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="tax" translate="label" sortOrder="303" showInDefault="1" showInWebsite="1" showInStore="1"> <class>separator-top</class> diff --git a/app/code/Magento/Tax/etc/catalog_attributes.xml b/app/code/Magento/Tax/etc/catalog_attributes.xml index dce770eccb079e97b3ee4c31bfb8e6b71cbda2d0..64135262627d1c21ed9fd99a1b4c45bf26e928c4 100644 --- a/app/code/Magento/Tax/etc/catalog_attributes.xml +++ b/app/code/Magento/Tax/etc/catalog_attributes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Catalog/etc/catalog_attributes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/catalog_attributes.xsd"> <group name="unassignable"> <attribute name="tax_class_id" /> </group> diff --git a/app/code/Magento/Tax/etc/config.xml b/app/code/Magento/Tax/etc/config.xml index 7e44459eda420838364a8c5a5b263fb61c527f04..5931c038ec278d15e79bec146a8cf1562fd39473 100644 --- a/app/code/Magento/Tax/etc/config.xml +++ b/app/code/Magento/Tax/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <tax> <classes> @@ -51,7 +51,7 @@ <zero_tax>0</zero_tax> </sales_display> <notification> - <url>http://www.magentocommerce.com/knowledge-base/entry/magento-ce-18-ee-113-tax-calc</url> + <info_url>http://docs.magento.com/m2/ce/user_guide/tax/warning-messages.html</info_url> </notification> </tax> </default> diff --git a/app/code/Magento/Tax/etc/crontab.xml b/app/code/Magento/Tax/etc/crontab.xml index b9dbc96141823d1689785bf51c2476eca5b853e3..e957b5e7ccbd53e5233371beaf35706afcd4042f 100644 --- a/app/code/Magento/Tax/etc/crontab.xml +++ b/app/code/Magento/Tax/etc/crontab.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Cron/etc/crontab.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd"> <group id="default"> <job name="aggregate_sales_report_tax_data" instance="Magento\Tax\Observer\AggregateSalesReportTaxData" method="invoke"> <schedule>0 0 * * *</schedule> diff --git a/app/code/Magento/Tax/etc/di.xml b/app/code/Magento/Tax/etc/di.xml index d2ba3241bf5997149c2e645ed887b8c94f7773d0..a4e826128ef2d545b3039353ae84cb33e790ee4b 100644 --- a/app/code/Magento/Tax/etc/di.xml +++ b/app/code/Magento/Tax/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Tax\Api\TaxRuleRepositoryInterface" type="Magento\Tax\Model\TaxRuleRepository"/> <preference for="Magento\Tax\Api\TaxCalculationInterface" diff --git a/app/code/Magento/Tax/etc/events.xml b/app/code/Magento/Tax/etc/events.xml index d9fc66fb1edbd7136377a5a9da558b17581f788a..8db5024ff15eded86c52b7ad08b8051b775d4e04 100644 --- a/app/code/Magento/Tax/etc/events.xml +++ b/app/code/Magento/Tax/etc/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="catalog_product_view_config"> <observer name="tax" instance="\Magento\Tax\Observer\UpdateProductOptions" method="execute" /> </event> diff --git a/app/code/Magento/Tax/etc/extension_attributes.xml b/app/code/Magento/Tax/etc/extension_attributes.xml index b00c7862c2f1d2dba4e4c5a0b0c223c70dfb7fb9..8fcd328aa8ded4fa4cc597589c7a6ba68211dbd0 100644 --- a/app/code/Magento/Tax/etc/extension_attributes.xml +++ b/app/code/Magento/Tax/etc/extension_attributes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Api/etc/extension_attributes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> <extension_attributes for="Magento\Quote\Api\Data\TotalSegmentInterface"> <attribute code="tax_grandtotal_details" type="Magento\Tax\Api\Data\GrandTotalDetailsInterface[]" /> </extension_attributes> diff --git a/app/code/Magento/Tax/etc/fieldset.xml b/app/code/Magento/Tax/etc/fieldset.xml index 0433e85a3cfa31d63be5cf4f2da88545b334457d..26fbc051c0fcf85ba4fe6b1da5bbf9cf1bde822b 100644 --- a/app/code/Magento/Tax/etc/fieldset.xml +++ b/app/code/Magento/Tax/etc/fieldset.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/DataObject/etc/fieldset.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:framework:DataObject/etc/fieldset.xsd"> <scope id="global"> <fieldset id="quote_convert_address"> <field name="subtotal_incl_tax"> diff --git a/app/code/Magento/Tax/etc/frontend/di.xml b/app/code/Magento/Tax/etc/frontend/di.xml index cae538c6f5e58ca9d94c367a255a29e0511d7460..7a98c2209d58913f1903830a836705975561c1d9 100644 --- a/app/code/Magento/Tax/etc/frontend/di.xml +++ b/app/code/Magento/Tax/etc/frontend/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Tax\Model\Calculation"> <arguments> <argument name="customerAccountManagement" xsi:type="object">Magento\Customer\Api\AccountManagementInterface\Proxy</argument> diff --git a/app/code/Magento/Tax/etc/frontend/events.xml b/app/code/Magento/Tax/etc/frontend/events.xml index ddd394efa1ae20fc6b62d10bff10556532574016..d0e946198bb2c95d2f1f15aa8c9afc5f276348de 100644 --- a/app/code/Magento/Tax/etc/frontend/events.xml +++ b/app/code/Magento/Tax/etc/frontend/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="customer_data_object_login"> <observer name="customer_tax_logged_in" instance="Magento\Tax\Observer\CustomerLoggedIn" method="execute" /> </event> diff --git a/app/code/Magento/Tax/etc/module.xml b/app/code/Magento/Tax/etc/module.xml index 4e7d0511fc04f8ffca219912076791b2ecc31d1f..2b540a01e156f783878e721552b0db4e93a4c9d3 100644 --- a/app/code/Magento/Tax/etc/module.xml +++ b/app/code/Magento/Tax/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Tax" setup_version="2.0.1"> <sequence> <module name="Magento_Catalog"/> diff --git a/app/code/Magento/Tax/etc/pdf.xml b/app/code/Magento/Tax/etc/pdf.xml index a61ad7c685fdd58caa746765cb29bbe0e65d0c5f..42303af9658b18dea55afa044ef46c29fafbe286 100644 --- a/app/code/Magento/Tax/etc/pdf.xml +++ b/app/code/Magento/Tax/etc/pdf.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Sales/etc/pdf_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Sales:etc/pdf_file.xsd"> <totals> <total name="subtotal"> <model>Magento\Tax\Model\Sales\Pdf\Subtotal</model> diff --git a/app/code/Magento/Tax/etc/sales.xml b/app/code/Magento/Tax/etc/sales.xml index c1e211e9c4f182ba44cb53dbd0ea7bc6a484d102..b5a6bb9c11e44fc3b647576163460f26ebaa3319 100644 --- a/app/code/Magento/Tax/etc/sales.xml +++ b/app/code/Magento/Tax/etc/sales.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Sales/etc/sales.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Sales:etc/sales.xsd"> <section name="quote"> <group name="totals"> <item name="tax_subtotal" instance="Magento\Tax\Model\Sales\Total\Quote\Subtotal" sort_order="200"/> diff --git a/app/code/Magento/Tax/etc/webapi.xml b/app/code/Magento/Tax/etc/webapi.xml index 760734bc02b8245010faca0f050c1fb06d52deaf..2c4b19afa798f48a35f74f269efcbd627cae21a1 100644 --- a/app/code/Magento/Tax/etc/webapi.xml +++ b/app/code/Magento/Tax/etc/webapi.xml @@ -6,7 +6,7 @@ */ --> <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../app/code/Magento/Webapi/etc/webapi.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd"> <route url="/V1/taxRates" method="POST"> <service class="Magento\Tax\Api\TaxRateRepositoryInterface" method="save"/> <resources> diff --git a/app/code/Magento/Tax/registration.php b/app/code/Magento/Tax/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..5b38947a205443250431066ef2de6c35f76ea80f --- /dev/null +++ b/app/code/Magento/Tax/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Tax', + __DIR__ +); diff --git a/app/code/Magento/Tax/view/adminhtml/layout/sales_creditmemo_item_price.xml b/app/code/Magento/Tax/view/adminhtml/layout/sales_creditmemo_item_price.xml index 7f21362ee8a128981c668fb9548d62ac56a03b0c..88248f44db01d147164e44b4f6eba75f0e0005ab 100644 --- a/app/code/Magento/Tax/view/adminhtml/layout/sales_creditmemo_item_price.xml +++ b/app/code/Magento/Tax/view/adminhtml/layout/sales_creditmemo_item_price.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="creditmemo_items"> <block class="Magento\Tax\Block\Adminhtml\Items\Price\Renderer" name="column_price" template="items/price/unit.phtml" group="column"/> diff --git a/app/code/Magento/Tax/view/adminhtml/layout/sales_invoice_item_price.xml b/app/code/Magento/Tax/view/adminhtml/layout/sales_invoice_item_price.xml index 35b4965f864442e6c138ad009f9e35e97893722c..a363726046cf2d0159dcd68537fdec83267cb5da 100644 --- a/app/code/Magento/Tax/view/adminhtml/layout/sales_invoice_item_price.xml +++ b/app/code/Magento/Tax/view/adminhtml/layout/sales_invoice_item_price.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="invoice_items"> <block class="Magento\Tax\Block\Adminhtml\Items\Price\Renderer" name="column_price" template="items/price/unit.phtml" group="column"/> diff --git a/app/code/Magento/Tax/view/adminhtml/layout/sales_order_create_item_price.xml b/app/code/Magento/Tax/view/adminhtml/layout/sales_order_create_item_price.xml index 906897f577e07e2af39711e410b53dce110afee0..b30cf063236287e6e01d567462d23dd7ba7adc6f 100644 --- a/app/code/Magento/Tax/view/adminhtml/layout/sales_order_create_item_price.xml +++ b/app/code/Magento/Tax/view/adminhtml/layout/sales_order_create_item_price.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <block class="Magento\Tax\Block\Item\Price\Renderer" name="item_unit_price" template="order/create/items/price/unit.phtml"> <arguments> diff --git a/app/code/Magento/Tax/view/adminhtml/layout/sales_order_item_price.xml b/app/code/Magento/Tax/view/adminhtml/layout/sales_order_item_price.xml index 3f9ace314c39f15fb4b6544c69b72c3030e5553a..9b6247b7352e4c22ced36cb4d63bc8786b99683d 100644 --- a/app/code/Magento/Tax/view/adminhtml/layout/sales_order_item_price.xml +++ b/app/code/Magento/Tax/view/adminhtml/layout/sales_order_item_price.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="order_items"> <block class="Magento\Tax\Block\Adminhtml\Items\Price\Renderer" name="column_price" template="items/price/unit.phtml" group="column"/> 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 ac7233caa1dc6e6d4ba0e179333a02ab50b43a42..bdb9b4d5378d9ec1080d246238eb47deeedbec93 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 @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="adminhtml.tax.rate.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.tax.rate.grid" as="grid"> diff --git a/app/code/Magento/Tax/view/adminhtml/layout/tax_rate_exportcsv.xml b/app/code/Magento/Tax/view/adminhtml/layout/tax_rate_exportcsv.xml index 420da2a47415e7260b619eb6bf0df419f768c745..3f94cb5d182c471dbb50ac7fa3b047f50adc67b3 100644 --- a/app/code/Magento/Tax/view/adminhtml/layout/tax_rate_exportcsv.xml +++ b/app/code/Magento/Tax/view/adminhtml/layout/tax_rate_exportcsv.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="tax_rate_block"/> <body> <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.tax.rate.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> diff --git a/app/code/Magento/Tax/view/adminhtml/layout/tax_rate_exportxml.xml b/app/code/Magento/Tax/view/adminhtml/layout/tax_rate_exportxml.xml index 420da2a47415e7260b619eb6bf0df419f768c745..3f94cb5d182c471dbb50ac7fa3b047f50adc67b3 100644 --- a/app/code/Magento/Tax/view/adminhtml/layout/tax_rate_exportxml.xml +++ b/app/code/Magento/Tax/view/adminhtml/layout/tax_rate_exportxml.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="tax_rate_block"/> <body> <block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.tax.rate.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> diff --git a/app/code/Magento/Tax/view/adminhtml/layout/tax_rate_index.xml b/app/code/Magento/Tax/view/adminhtml/layout/tax_rate_index.xml index 4d91313785ee7166e2c74475f466a6ce7f566444..8254581a37d85fb956d5faf3275cbd9be0a0cedb 100644 --- a/app/code/Magento/Tax/view/adminhtml/layout/tax_rate_index.xml +++ b/app/code/Magento/Tax/view/adminhtml/layout/tax_rate_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="formkey"/> <update handle="tax_rate_block"/> <body> 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 65734d42b0091101f9f775be6ca1fd6372c7375a..dbcbe6b08837c28a86eec0662587e914f1559392 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 @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="adminhtml.block.tax.rule.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.block.tax.rule.grid" as="grid"> diff --git a/app/code/Magento/Tax/view/adminhtml/layout/tax_rule_edit.xml b/app/code/Magento/Tax/view/adminhtml/layout/tax_rule_edit.xml index a0710e8fa63ca9bb31ed8e6294a7f2ebe2f040ae..767f5acb0dea8a8c78fb4a77e413fa91181151ee 100644 --- a/app/code/Magento/Tax/view/adminhtml/layout/tax_rule_edit.xml +++ b/app/code/Magento/Tax/view/adminhtml/layout/tax_rule_edit.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <link src="Magento_Tax::js/bootstrap.js"/> <css src="jquery/editableMultiselect/css/jquery.multiselect.css"/> diff --git a/app/code/Magento/Tax/view/adminhtml/layout/tax_rule_index.xml b/app/code/Magento/Tax/view/adminhtml/layout/tax_rule_index.xml index 33c866cb75dcd001650799b5027921ecbf6e385e..a969b7325aa6778782f048f84179b90cdb5d3760 100644 --- a/app/code/Magento/Tax/view/adminhtml/layout/tax_rule_index.xml +++ b/app/code/Magento/Tax/view/adminhtml/layout/tax_rule_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="tax_rule_block"/> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/Tax/view/base/layout/catalog_product_prices.xml b/app/code/Magento/Tax/view/base/layout/catalog_product_prices.xml index c7067686d98d6bbcad439dd7fb2941a8057028d2..0f1dcb032e8b0f6c552a5fc644aaa79db7e76ac0 100644 --- a/app/code/Magento/Tax/view/base/layout/catalog_product_prices.xml +++ b/app/code/Magento/Tax/view/base/layout/catalog_product_prices.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <referenceBlock name="render.product.prices"> <arguments> <argument name="default" xsi:type="array"> diff --git a/app/code/Magento/Tax/view/frontend/layout/checkout_cart_index.xml b/app/code/Magento/Tax/view/frontend/layout/checkout_cart_index.xml index b7bb9e2b2ec8badfac515d1468762612cb334262..4c0a5feb01fbedf119955a9e61eb84c3478572f9 100644 --- a/app/code/Magento/Tax/view/frontend/layout/checkout_cart_index.xml +++ b/app/code/Magento/Tax/view/frontend/layout/checkout_cart_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout.cart.totals"> <arguments> diff --git a/app/code/Magento/Tax/view/frontend/layout/checkout_cart_sidebar_total_renderers.xml b/app/code/Magento/Tax/view/frontend/layout/checkout_cart_sidebar_total_renderers.xml index b41c99ae84062d01d701b6acd084cc47b4ef4cff..3a0ff84ece060f9202f19ab7e80172eaf47c96da 100644 --- a/app/code/Magento/Tax/view/frontend/layout/checkout_cart_sidebar_total_renderers.xml +++ b/app/code/Magento/Tax/view/frontend/layout/checkout_cart_sidebar_total_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="minicart"> <arguments> diff --git a/app/code/Magento/Tax/view/frontend/layout/checkout_index_index.xml b/app/code/Magento/Tax/view/frontend/layout/checkout_index_index.xml index 62de4a52b69254de101b989cda35db372172aefe..cd1d07d44dd7d195b4cc182537ac8c1476eb1d71 100644 --- a/app/code/Magento/Tax/view/frontend/layout/checkout_index_index.xml +++ b/app/code/Magento/Tax/view/frontend/layout/checkout_index_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout.root"> <arguments> diff --git a/app/code/Magento/Tax/view/frontend/layout/checkout_item_price_renderers.xml b/app/code/Magento/Tax/view/frontend/layout/checkout_item_price_renderers.xml index a918452fbc85745f65fd5ab9e7a43b5f42bec923..d8d765dfadee362b630664382207ee42d8d3fada 100644 --- a/app/code/Magento/Tax/view/frontend/layout/checkout_item_price_renderers.xml +++ b/app/code/Magento/Tax/view/frontend/layout/checkout_item_price_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <block class="Magento\Tax\Block\Item\Price\Renderer" name="checkout.item.price.unit" template="Magento_Tax::item/price/unit.phtml"/> <block class="Magento\Tax\Block\Item\Price\Renderer" name="checkout.item.price.row" template="Magento_Tax::item/price/row.phtml"/> diff --git a/app/code/Magento/Tax/view/frontend/layout/checkout_shipping_price_renderer.xml b/app/code/Magento/Tax/view/frontend/layout/checkout_shipping_price_renderer.xml index 983be250f4e0d34a86a9001f9ed4f73df7f2b617..66c2e2139d4ec9db2f1b0aadefc097ba8c166705 100644 --- a/app/code/Magento/Tax/view/frontend/layout/checkout_shipping_price_renderer.xml +++ b/app/code/Magento/Tax/view/frontend/layout/checkout_shipping_price_renderer.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <block class="Magento\Tax\Block\Checkout\Shipping\Price" name="checkout.shipping.price" as="shipping.price" template="Magento_Tax::checkout/shipping/price.phtml"/> </body> diff --git a/app/code/Magento/Tax/view/frontend/layout/sales_email_item_price.xml b/app/code/Magento/Tax/view/frontend/layout/sales_email_item_price.xml index 751e2e9b6df594a9f43ff00a231e5bcb63e1faf4..63ca3364238c650e76ffe5b0158b7b1d9cac8a07 100644 --- a/app/code/Magento/Tax/view/frontend/layout/sales_email_item_price.xml +++ b/app/code/Magento/Tax/view/frontend/layout/sales_email_item_price.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="items"> <block class="Magento\Tax\Block\Item\Price\Renderer" name="item_price" template="email/items/price/row.phtml"> diff --git a/app/code/Magento/Tax/view/frontend/layout/sales_order_item_price.xml b/app/code/Magento/Tax/view/frontend/layout/sales_order_item_price.xml index 1bedf25a7586230e87de903009bb5044537d5d15..6791741583c7ca3f4b604f2cbcdad61b0b020de6 100644 --- a/app/code/Magento/Tax/view/frontend/layout/sales_order_item_price.xml +++ b/app/code/Magento/Tax/view/frontend/layout/sales_order_item_price.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <block class="Magento\Tax\Block\Item\Price\Renderer" name="item_unit_price" template="item/price/unit.phtml"> <arguments> diff --git a/app/code/Magento/TaxImportExport/composer.json b/app/code/Magento/TaxImportExport/composer.json index 656d80cc8a9d4d80782410ed8c6d8fb8eadaf8c9..97a2edc4c1db99b961773e2bba5c3b085d3b2c65 100644 --- a/app/code/Magento/TaxImportExport/composer.json +++ b/app/code/Magento/TaxImportExport/composer.json @@ -7,8 +7,7 @@ "magento/module-backend": "1.0.0-beta", "magento/module-directory": "1.0.0-beta", "magento/module-store": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -16,12 +15,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/TaxImportExport" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\TaxImportExport\\": "" + } } } diff --git a/app/code/Magento/TaxImportExport/etc/acl.xml b/app/code/Magento/TaxImportExport/etc/acl.xml index 6a5ea83cbcb198a765d13d85473712702ad7919b..6fe63d98693b85d333873fb0ce27c76d136f0b68 100644 --- a/app/code/Magento/TaxImportExport/etc/acl.xml +++ b/app/code/Magento/TaxImportExport/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/app/code/Magento/TaxImportExport/etc/adminhtml/menu.xml b/app/code/Magento/TaxImportExport/etc/adminhtml/menu.xml index 7bc6c01759cf99c90852ff772801a5da850916ca..73c79da9dea5c73744f8c638f264945261f0126d 100644 --- a/app/code/Magento/TaxImportExport/etc/adminhtml/menu.xml +++ b/app/code/Magento/TaxImportExport/etc/adminhtml/menu.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Backend/etc/menu.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd"> <menu> <add id="Magento_TaxImportExport::system_convert_tax" title="Import/Export Tax Rates" sortOrder="30" module="Magento_TaxImportExport" parent="Magento_Backend::system_convert" action="tax/rate/importExport" resource="Magento_TaxImportExport::import_export"/> </menu> diff --git a/app/code/Magento/TaxImportExport/etc/adminhtml/routes.xml b/app/code/Magento/TaxImportExport/etc/adminhtml/routes.xml index 72169d45297d7348506f8752230b65bb74f0667c..16760403bd41c05f59d3ec0c37e7d6faa69770a3 100644 --- a/app/code/Magento/TaxImportExport/etc/adminhtml/routes.xml +++ b/app/code/Magento/TaxImportExport/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="admin"> <route id="tax"> <module name="Magento_TaxImportExport" /> diff --git a/app/code/Magento/TaxImportExport/etc/module.xml b/app/code/Magento/TaxImportExport/etc/module.xml index 3fc38c0ae9612818050f6dde3d40dce046c24407..52ba9def96c645255084052496c41404e7b521d4 100644 --- a/app/code/Magento/TaxImportExport/etc/module.xml +++ b/app/code/Magento/TaxImportExport/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_TaxImportExport" setup_version="2.0.0"> <sequence> <module name="Magento_Tax"/> diff --git a/app/code/Magento/TaxImportExport/registration.php b/app/code/Magento/TaxImportExport/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..9d6ba649267f72b22b9077b385c3a2e6a6f743c1 --- /dev/null +++ b/app/code/Magento/TaxImportExport/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_TaxImportExport', + __DIR__ +); diff --git a/app/code/Magento/TaxImportExport/view/adminhtml/layout/tax_rate_block.xml b/app/code/Magento/TaxImportExport/view/adminhtml/layout/tax_rate_block.xml index 6bb785f49da0e65a36ef499581eeddded963b1ee..c429f49df352d2427a233f70e587745285f1ea70 100644 --- a/app/code/Magento/TaxImportExport/view/adminhtml/layout/tax_rate_block.xml +++ b/app/code/Magento/TaxImportExport/view/adminhtml/layout/tax_rate_block.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="adminhtml.tax.rate.grid"> <block class="Magento\Backend\Block\Widget\Grid\Export" name="adminhtml.tax.rate.grid.export" as="grid.export"> diff --git a/app/code/Magento/TaxImportExport/view/adminhtml/layout/tax_rule_edit.xml b/app/code/Magento/TaxImportExport/view/adminhtml/layout/tax_rule_edit.xml index 6b0bbca11e606756fb244361530d0b2d4b7356f0..aadabaa3b6af0fb6095faac49731972c0d78bb5d 100644 --- a/app/code/Magento/TaxImportExport/view/adminhtml/layout/tax_rule_edit.xml +++ b/app/code/Magento/TaxImportExport/view/adminhtml/layout/tax_rule_edit.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="content"> <block class="Magento\TaxImportExport\Block\Adminhtml\Rate\ImportExport" name="tax-rate-importExport" template="importExport.phtml"/> diff --git a/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/General.php b/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/General.php index a27a9db7712187b34e71c28df5c93a5efffaed14..f18879fc396ea6efa7faa41c5b682100d0ba3f77 100644 --- a/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/General.php +++ b/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/General.php @@ -5,7 +5,9 @@ */ namespace Magento\Theme\Block\Adminhtml\System\Design\Theme\Edit\Tab; +use Magento\Framework\App\Area; use Magento\Framework\View\Design\ThemeInterface; +use Magento\Theme\Model\Theme\Collection; /** * Theme form, general tab @@ -99,18 +101,19 @@ class General extends \Magento\Theme\Block\Adminhtml\System\Design\Theme\Edit\Ab $themeFieldset->addField('theme_id', 'hidden', ['name' => 'theme_id']); } - /** @var \Magento\Theme\Model\Theme\Collection $themesCollections */ + /** @var Collection $themesCollections */ $themesCollections = $this->_objectManager->create('Magento\Theme\Model\Theme\Collection'); /** @var \Magento\Framework\Json\Helper\Data $helper */ $helper = $this->_objectManager->get('Magento\Framework\Json\Helper\Data'); + $themesCollections->addConstraint(Collection::CONSTRAINT_AREA, Area::AREA_FRONTEND); $onChangeScript = sprintf( 'parentThemeOnChange(this.value, %s)', str_replace( '"', '\'', - $helper->jsonEncode($this->_getDefaultsInherited($themesCollections->addDefaultPattern())) + $helper->jsonEncode($this->_getDefaultsInherited($themesCollections)) ) ); diff --git a/app/code/Magento/Theme/Model/Layout/Config/SchemaLocator.php b/app/code/Magento/Theme/Model/Layout/Config/SchemaLocator.php index 7517335215bf8507ac4863554890475ef490a135..da9bf7f2c9bf7cb9efa69aa7a052ef107bd87b9f 100644 --- a/app/code/Magento/Theme/Model/Layout/Config/SchemaLocator.php +++ b/app/code/Magento/Theme/Model/Layout/Config/SchemaLocator.php @@ -7,8 +7,7 @@ */ namespace Magento\Theme\Model\Layout\Config; -use Magento\Framework\App\Filesystem\DirectoryList; -use Magento\Framework\Filesystem; +use Magento\Framework\Config\Dom\UrnResolver; class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface { @@ -20,12 +19,11 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface protected $_schema; /** - * @param Filesystem $appFilesystem + * @param UrnResolver $urnResolver */ - public function __construct(Filesystem $appFilesystem) + public function __construct(UrnResolver $urnResolver) { - $this->_schema = $appFilesystem->getDirectoryRead(DirectoryList::LIB_INTERNAL)->getAbsolutePath() - . '/Magento/Framework/View/PageLayout/etc/layouts.xsd'; + $this->_schema = $urnResolver->getRealPath('urn:magento:framework:View/PageLayout/etc/layouts.xsd'); } /** diff --git a/app/code/Magento/Theme/Model/Theme/Collection.php b/app/code/Magento/Theme/Model/Theme/Collection.php index 0fea3c7d8d7b875e71b4562a6e956ad9c97a5c13..c2f4cde8ead429c9a20d3f7f815e3861ba8ce028 100644 --- a/app/code/Magento/Theme/Model/Theme/Collection.php +++ b/app/code/Magento/Theme/Model/Theme/Collection.php @@ -5,7 +5,9 @@ */ namespace Magento\Theme\Model\Theme; -use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Filesystem\Directory\ReadFactory; +use Magento\Framework\View\Design\Theme\ThemePackage; +use Magento\Framework\View\Design\Theme\ThemePackageList; use Magento\Framework\View\Design\Theme\ListInterface; use Magento\Framework\View\Design\ThemeInterface; @@ -15,9 +17,23 @@ use Magento\Framework\View\Design\ThemeInterface; class Collection extends \Magento\Framework\Data\Collection implements ListInterface { /** - * @var \Magento\Framework\Filesystem\Directory\Read + * Area constraint type */ - protected $_directory; + const CONSTRAINT_AREA = 'area'; + + /** + * Vendor constraint type + * + * For example, "Magento" part for theme "frontend/Magento/blank" + */ + const CONSTRAINT_VENDOR = 'vendor'; + + /** + * Theme name constraint type + * + * For example, "blank" part for theme "frontend/Magento/blank" + */ + const CONSTRAINT_THEME_NAME = 'theme_name'; /** * Model of collection item @@ -27,84 +43,98 @@ class Collection extends \Magento\Framework\Data\Collection implements ListInter protected $_itemObjectClass = 'Magento\Theme\Model\Theme'; /** - * Target directory + * @var \Magento\Framework\Config\ThemeFactory $themeConfigFactory + */ + protected $themeConfigFactory; + + /** + * Constraints for the collection loading * * @var array */ - protected $_targetDirs = []; + private $constraints = [ + self::CONSTRAINT_AREA => [], + self::CONSTRAINT_VENDOR => [], + self::CONSTRAINT_THEME_NAME => [], + ]; /** - * @var \Magento\Framework\Config\ThemeFactory $themeConfigFactory + * Theme package list + * + * @var ThemePackageList */ - protected $themeConfigFactory; + private $themePackageList; + + /** + * Factory for read directory + * + * @var ReadFactory + */ + private $dirReadFactory; /** + * Constructor + * * @param \Magento\Framework\Data\Collection\EntityFactory $entityFactory - * @param \Magento\Framework\Filesystem $filesystem * @param \Magento\Framework\Config\ThemeFactory $themeConfigFactory + * @param ThemePackageList $themePackageList + * @param ReadFactory $dirReadFactory */ public function __construct( \Magento\Framework\Data\Collection\EntityFactory $entityFactory, - \Magento\Framework\Filesystem $filesystem, - \Magento\Framework\Config\ThemeFactory $themeConfigFactory + \Magento\Framework\Config\ThemeFactory $themeConfigFactory, + ThemePackageList $themePackageList, + ReadFactory $dirReadFactory ) { parent::__construct($entityFactory); - $this->_directory = $filesystem->getDirectoryRead(DirectoryList::THEMES); $this->themeConfigFactory = $themeConfigFactory; + $this->themePackageList = $themePackageList; + $this->dirReadFactory = $dirReadFactory; } /** - * Add default pattern to themes configuration + * Add constraint for the collection loading * - * @param string $area - * @return $this - */ - public function addDefaultPattern($area = \Magento\Framework\App\Area::AREA_FRONTEND) - { - $this->addTargetPattern(implode('/', [$area, '{*/*,*/}', 'theme.xml'])); - return $this; - } - - /** - * Target directory setter. Adds directory to be scanned + * See CONSTRAINT_* constants for supported types * - * @param string $relativeTarget - * @return $this + * @param string $type + * @param string $value + * @return void */ - public function addTargetPattern($relativeTarget) + public function addConstraint($type, $value) { + if (!isset($this->constraints[$type])) { + throw new \UnexpectedValueException("Constraint '$type' is not supported"); + } if ($this->isLoaded()) { $this->clear(); } - $this->_targetDirs[] = $relativeTarget; - return $this; + $this->constraints[$type][] = $value; + $this->constraints[$type] = array_unique($this->constraints[$type]); } /** - * Clear target patterns + * Reset constraints for the collection loading * - * @return $this + * @return void */ - public function clearTargetPatterns() + public function resetConstraints() { - $this->_targetDirs = []; - return $this; + foreach (array_keys($this->constraints) as $key) { + $this->constraints[$key] = []; + } } /** - * Return target dir for themes with theme configuration file + * Check value against constraint * - * @throws \Magento\Framework\Exception\LocalizedException - * @return array|string + * @param string $constraintType + * @param string $value + * @return bool */ - public function getTargetPatterns() + private function isAcceptable($constraintType, $value) { - if (empty($this->_targetDirs)) { - throw new \Magento\Framework\Exception\LocalizedException( - __('Please specify at least one target pattern to theme config file.') - ); - } - return $this->_targetDirs; + return empty($this->constraints[$constraintType]) || in_array($value, $this->constraints[$constraintType]); } /** @@ -121,18 +151,21 @@ class Collection extends \Magento\Framework\Data\Collection implements ListInter return $this; } - $pathsToThemeConfig = []; - foreach ($this->getTargetPatterns() as $directoryPath) { - $themeConfigs = $this->_directory->search($directoryPath); - foreach ($themeConfigs as &$relPathToTheme) { - $relPathToTheme = $this->_directory->getAbsolutePath($relPathToTheme); + $themes = []; + foreach ($this->themePackageList->getThemes() as $themePackage) { + if ($this->isAcceptable(self::CONSTRAINT_AREA, $themePackage->getArea()) + && $this->isAcceptable(self::CONSTRAINT_VENDOR, $themePackage->getVendor()) + && $this->isAcceptable(self::CONSTRAINT_THEME_NAME, $themePackage->getName()) + ) { + $themes[] = $themePackage; } - $pathsToThemeConfig = array_merge($pathsToThemeConfig, $themeConfigs); } - $this->_loadFromFilesystem( - $pathsToThemeConfig - )->clearTargetPatterns()->_updateRelations()->_renderFilters()->_clearFilters(); + $this->_loadFromFilesystem($themes); + $this->resetConstraints(); + $this->_updateRelations() + ->_renderFilters() + ->_clearFilters(); return $this; } @@ -159,15 +192,15 @@ class Collection extends \Magento\Framework\Data\Collection implements ListInter } /** - * Load themes collection from file system by file list + * Load themes collection from file system * - * @param array $themeConfigPaths + * @param ThemePackage[] $themes * @return $this */ - protected function _loadFromFilesystem(array $themeConfigPaths) + protected function _loadFromFilesystem(array $themes) { - foreach ($themeConfigPaths as $themeConfigPath) { - $theme = $this->getNewEmptyItem()->addData($this->_prepareConfigurationData($themeConfigPath)); + foreach ($themes as $themePackage) { + $theme = $this->getNewEmptyItem()->addData($this->_prepareConfigurationData($themePackage)); $this->addItem($theme); } $this->_setIsLoaded(); @@ -178,28 +211,29 @@ class Collection extends \Magento\Framework\Data\Collection implements ListInter /** * Return default path related data * - * @param string $configPath + * @param ThemePackage $themePackage * @return array */ - protected function _preparePathData($configPath) + protected function _preparePathData($themePackage) { - $themeDirectory = dirname($configPath); - $fullPath = trim(substr($themeDirectory, strlen($this->_directory->getAbsolutePath())), '/'); - $pathPieces = explode('/', $fullPath); - $area = array_shift($pathPieces); - return ['area' => $area, 'theme_path_pieces' => $pathPieces]; + return [ + 'theme_path_pieces' => [ + $themePackage->getVendor(), + $themePackage->getName(), + ] + ]; } /** * Return default configuration data * - * @param string $configPath + * @param ThemePackage $themePackage * @return array */ - public function _prepareConfigurationData($configPath) + protected function _prepareConfigurationData($themePackage) { - $themeConfig = $this->_getConfigModel($configPath); - $pathData = $this->_preparePathData($configPath); + $themeConfig = $this->_getConfigModel($themePackage); + $pathData = $this->_preparePathData($themePackage); $media = $themeConfig->getMedia(); $parentPathPieces = $themeConfig->getParentTheme(); @@ -216,7 +250,7 @@ class Collection extends \Magento\Framework\Data\Collection implements ListInter return [ 'parent_id' => null, 'type' => ThemeInterface::TYPE_PHYSICAL, - 'area' => $pathData['area'], + 'area' => $themePackage->getArea(), 'theme_path' => $themePath, 'code' => $themeCode, 'theme_title' => $themeConfig->getThemeTitle(), @@ -260,16 +294,19 @@ class Collection extends \Magento\Framework\Data\Collection implements ListInter } /** - * Return configuration model for themes + * Return configuration model for the theme * - * @param string $configPath + * @param ThemePackage $themePackage * @return \Magento\Framework\Config\Theme */ - protected function _getConfigModel($configPath) + protected function _getConfigModel($themePackage) { - $relativeConfigPath = $this->_directory->getRelativePath($configPath); - $configContent = $this->_directory->isExist($relativeConfigPath) ? - $this->_directory->readFile($relativeConfigPath) : null; + $themeDir = $this->dirReadFactory->create($themePackage->getPath()); + if ($themeDir->isExist('theme.xml')) { + $configContent = $themeDir->readFile('theme.xml'); + } else { + $configContent = ''; + } return $this->themeConfigFactory->create(['configContent' => $configContent]); } @@ -317,7 +354,8 @@ class Collection extends \Magento\Framework\Data\Collection implements ListInter public function getThemeByFullPath($fullPath) { list($area, $themePath) = explode('/', $fullPath, 2); - $this->addDefaultPattern($area)->addFilter('theme_path', $themePath); + $this->addConstraint(self::CONSTRAINT_AREA, $area); + $this->addFilter('theme_path', $themePath); return $this->getFirstItem(); } diff --git a/app/code/Magento/Theme/Model/Theme/Registration.php b/app/code/Magento/Theme/Model/Theme/Registration.php index f781dbb960e3abc0aa9dbb5d62ea06c844ca524a..47dcc24c104c2ed03f2faedd9d9f8b8ead222a10 100644 --- a/app/code/Magento/Theme/Model/Theme/Registration.php +++ b/app/code/Magento/Theme/Model/Theme/Registration.php @@ -5,7 +5,6 @@ */ namespace Magento\Theme\Model\Theme; -use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\Filesystem; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\View\Design\ThemeInterface; @@ -47,42 +46,28 @@ class Registration [ThemeInterface::TYPE_PHYSICAL, ThemeInterface::TYPE_STAGING], ]; - /** - * @var \Magento\Framework\Filesystem\Directory\Read - */ - protected $directoryRead; - /** * Initialize dependencies * * @param \Magento\Theme\Model\Resource\Theme\Data\CollectionFactory $collectionFactory * @param \Magento\Theme\Model\Theme\Data\Collection $filesystemCollection - * @param Filesystem $filesystem */ public function __construct( \Magento\Theme\Model\Resource\Theme\Data\CollectionFactory $collectionFactory, - \Magento\Theme\Model\Theme\Data\Collection $filesystemCollection, - Filesystem $filesystem + \Magento\Theme\Model\Theme\Data\Collection $filesystemCollection ) { $this->_collectionFactory = $collectionFactory; $this->_themeCollection = $filesystemCollection; - $this->directoryRead = $filesystem->getDirectoryRead(DirectoryList::MEDIA); } /** * Theme registration * - * @param string $pathPattern * @return $this */ - public function register($pathPattern = '') + public function register() { - if (empty($pathPattern)) { - $this->_themeCollection->addDefaultPattern('*'); - } else { - $this->_themeCollection->addTargetPattern($pathPattern); - } - + $this->_themeCollection->clear(); foreach ($this->_themeCollection as $theme) { $this->_registerThemeRecursively($theme); } diff --git a/app/code/Magento/Theme/Model/Theme/ThemeDependencyChecker.php b/app/code/Magento/Theme/Model/Theme/ThemeDependencyChecker.php index 05209e7fd84dc7359697f1e478d08083cb14044e..8e4aa6f6a7a61cc8dfb91dab49a09c5efc3afd8a 100644 --- a/app/code/Magento/Theme/Model/Theme/ThemeDependencyChecker.php +++ b/app/code/Magento/Theme/Model/Theme/ThemeDependencyChecker.php @@ -115,7 +115,6 @@ class ThemeDependencyChecker private function getParentChildThemeMap() { $map = []; - $this->themeCollection->addDefaultPattern('*'); /** @var \Magento\Theme\Model\Theme\Data $theme */ foreach ($this->themeCollection as $theme) { if ($theme->getParentTheme()) { diff --git a/app/code/Magento/Theme/Model/Theme/ThemePackageInfo.php b/app/code/Magento/Theme/Model/Theme/ThemePackageInfo.php index 744621da2da7b9a525007dfb5c2b68cac03786f7..6ab65a363c5ad76949042f3a734b00624c6c2c3f 100644 --- a/app/code/Magento/Theme/Model/Theme/ThemePackageInfo.php +++ b/app/code/Magento/Theme/Model/Theme/ThemePackageInfo.php @@ -5,9 +5,8 @@ */ namespace Magento\Theme\Model\Theme; -use Magento\Framework\App\Filesystem\DirectoryList; -use Magento\Framework\Filesystem; -use Magento\Theme\Model\Theme\Data\Collection as DataCollection; +use Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Filesystem\Directory\ReadFactory; /** * Maps package name to full theme path, and vice versa @@ -15,14 +14,14 @@ use Magento\Theme\Model\Theme\Data\Collection as DataCollection; class ThemePackageInfo { /** - * @var DataCollection + * @var ComponentRegistrar */ - private $collection; + private $componentRegistrar; /** - * @var Filesystem + * @var ReadFactory */ - private $filesystem; + private $readDirFactory; /** * @var array @@ -32,13 +31,15 @@ class ThemePackageInfo /** * Constructor * - * @param DataCollection $collection - * @param Filesystem $filesystem + * @param ComponentRegistrar $componentRegistrar + * @param ReadFactory $readDirFactory */ - public function __construct(DataCollection $collection, Filesystem $filesystem) - { - $this->collection = $collection; - $this->filesystem = $filesystem; + public function __construct( + ComponentRegistrar $componentRegistrar, + ReadFactory $readDirFactory + ) { + $this->componentRegistrar = $componentRegistrar; + $this->readDirFactory = $readDirFactory; } /** @@ -50,10 +51,11 @@ class ThemePackageInfo */ public function getPackageName($themePath) { - $themesDirRead = $this->filesystem->getDirectoryRead(DirectoryList::THEMES); - if ($themesDirRead->isExist($themePath . '/composer.json')) { + $themePath = $this->componentRegistrar->getPath(ComponentRegistrar::THEME, $themePath); + $themeDir = $this->readDirFactory->create($themePath); + if ($themeDir->isExist('composer.json')) { $rawData = []; - $themeFile = $themesDirRead->readFile($themePath . '/composer.json'); + $themeFile = $themeDir->readFile('composer.json'); if ($themeFile) { $rawData = \Zend_Json::decode($themeFile); } @@ -85,13 +87,12 @@ class ThemePackageInfo */ private function initializeMap() { - $themesDirRead = $this->filesystem->getDirectoryRead(DirectoryList::THEMES); - $this->collection->addDefaultPattern('*'); + $themePaths = $this->componentRegistrar->getPaths(ComponentRegistrar::THEME); /** @var \Magento\Theme\Model\Theme $theme */ - foreach ($this->collection->getIterator() as $theme) { - $fullThemePath = $theme->getFullPath(); - if ($themesDirRead->isExist($fullThemePath . '/composer.json')) { - $rawData = \Zend_Json::decode($themesDirRead->readFile($fullThemePath . '/composer.json')); + foreach ($themePaths as $fullThemePath => $themeDir) { + $themeDirRead = $this->readDirFactory->create($themeDir); + if ($themeDirRead->isExist('composer.json')) { + $rawData = \Zend_Json::decode($themeDirRead->readFile('composer.json')); if (isset($rawData['name'])) { $this->packageNameToFullPathMap[$rawData['name']] = $fullThemePath; } diff --git a/app/code/Magento/Theme/Model/View/Design.php b/app/code/Magento/Theme/Model/View/Design.php index 321ed683d3c3691b00f41b11ede7d14dbc863376..3f6040221d29a4e23ef979c34b992a3a835482a8 100644 --- a/app/code/Magento/Theme/Model/View/Design.php +++ b/app/code/Magento/Theme/Model/View/Design.php @@ -104,7 +104,6 @@ class Design implements \Magento\Framework\View\DesignInterface * * @param string $area * @return $this - * @deprecated */ public function setArea($area) { diff --git a/app/code/Magento/Theme/Setup/InstallData.php b/app/code/Magento/Theme/Setup/InstallData.php index 29af89055b89942e7b1c959eb79adc2d8736e89f..f0854bea9c241f031034355be092f732ec37cd30 100644 --- a/app/code/Magento/Theme/Setup/InstallData.php +++ b/app/code/Magento/Theme/Setup/InstallData.php @@ -48,8 +48,6 @@ class InstallData implements InstallDataInterface */ public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context) { - $setup->startSetup(); - /* * Register themes */ @@ -59,7 +57,6 @@ class InstallData implements InstallDataInterface * Update theme's data */ $fileCollection = $this->createTheme(); - $fileCollection->addDefaultPattern('*'); $fileCollection->setItemObjectClass('Magento\Theme\Model\Theme\Data'); $resourceCollection = $this->createThemeResource(); @@ -74,7 +71,6 @@ class InstallData implements InstallDataInterface } $fileCollection = $this->createTheme(); - $fileCollection->addDefaultPattern('*'); $fileCollection->setItemObjectClass('Magento\Theme\Model\Theme\Data'); $themeDbCollection = $this->createThemeResource(); @@ -95,8 +91,6 @@ class InstallData implements InstallDataInterface ['area' => 'frontend'], ['area = ?' => ''] ); - - $setup->endSetup(); } /** diff --git a/app/code/Magento/Theme/Test/Unit/Console/Command/ThemeUninstallCommandTest.php b/app/code/Magento/Theme/Test/Unit/Console/Command/ThemeUninstallCommandTest.php index f5e71684d972ed8c9ec7bc682a08e6b4c799347b..b98fdf4e53b64c105f17dbe9ac1c6261bfe5c144 100644 --- a/app/code/Magento/Theme/Test/Unit/Console/Command/ThemeUninstallCommandTest.php +++ b/app/code/Magento/Theme/Test/Unit/Console/Command/ThemeUninstallCommandTest.php @@ -165,27 +165,6 @@ class ThemeUninstallCommandTest extends \PHPUnit_Framework_TestCase public function testExecuteFailedValidationMixed() { - $dirRead = $this->getMock('Magento\Framework\Filesystem\Directory\Read', [], [], '', false); - // package name "dummy" is not in root composer.json file - $dirRead->expects($this->any()) - ->method('readFile') - ->will($this->returnValueMap( - [ - ['test1/composer.json', null, null, '{"name": "dummy1"}'], - ['test2/composer.json', null, null, '{"name": "magento/theme-b"}'], - ['test4/composer.json', null, null, '{"name": "dummy2"}'] - ] - )); - $dirRead->expects($this->any()) - ->method('isExist') - ->will($this->returnValueMap( - [ - ['test1/composer.json', true], - ['test2/composer.json', true], - ['test3/composer.json', false], - ['test4/composer.json', true] - ] - )); $this->themePackageInfo->expects($this->exactly(4)) ->method('getPackageName') ->will($this->returnValueMap([ diff --git a/app/code/Magento/Theme/Test/Unit/Model/Layout/Config/SchemaLocatorTest.php b/app/code/Magento/Theme/Test/Unit/Model/Layout/Config/SchemaLocatorTest.php index 387c06500a42b1aa0e600090920269963c38e6f9..6b8dec35a83bbb67117fa1497fcc7a9261bb3c37 100644 --- a/app/code/Magento/Theme/Test/Unit/Model/Layout/Config/SchemaLocatorTest.php +++ b/app/code/Magento/Theme/Test/Unit/Model/Layout/Config/SchemaLocatorTest.php @@ -5,51 +5,44 @@ */ namespace Magento\Theme\Test\Unit\Model\Layout\Config; -use \Magento\Theme\Model\Layout\Config\SchemaLocator; - -use Magento\Framework\App\Filesystem\DirectoryList; - class SchemaLocatorTest extends \PHPUnit_Framework_TestCase { /** - * @var SchemaLocator + * @var \Magento\Theme\Model\Layout\Config\SchemaLocator */ protected $object; /** * @var string */ - protected $scheme; + protected $schema = 'framework_dir/Magento/Framework/View/PageLayout/etc/layouts.xsd'; /** * Initialize testable object */ public function setUp() { - $path = '/root/path/lib'; - $filesystem = $this->getMockBuilder('Magento\Framework\Filesystem')->disableOriginalConstructor()->getMock(); - $read = $this->getMockBuilder('Magento\Framework\Filesystem\Directory\ReadInterface')->getMock(); - - $filesystem->expects($this->once()) - ->method('getDirectoryRead') - ->with(DirectoryList::LIB_INTERNAL) - ->willReturn($read); - $read->expects($this->once()) - ->method('getAbsolutePath') - ->willReturn($path); - - $this->scheme = $path . '/Magento/Framework/View/PageLayout/etc/layouts.xsd'; - - /** @var $filesystem \Magento\Framework\Filesystem */ - $this->object = new SchemaLocator($filesystem); + /** + * @var \Magento\Framework\Config\Dom\UrnResolver $urnResolverMock | \PHPUnit_Framework_MockObject_MockObject + */ + $urnResolverMock = $this->getMock('Magento\Framework\Config\Dom\UrnResolver', [], [], '', false); + $urnResolverMock->expects($this->once()) + ->method('getRealPath') + ->with('urn:magento:framework:View/PageLayout/etc/layouts.xsd') + ->willReturn($this->schema); + $this->object = new \Magento\Theme\Model\Layout\Config\SchemaLocator($urnResolverMock); } /** - * cover getPerFileSchema and getSchema + * Cover getSchema */ - public function testGetScheme() + public function testGetSchema() + { + $this->assertEquals($this->schema, $this->object->getSchema()); + } + + public function testGetPerFileSchema() { - $this->assertEquals($this->scheme, $this->object->getPerFileSchema()); - $this->assertEquals($this->scheme, $this->object->getSchema()); + $this->assertEquals($this->schema, $this->object->getPerFileSchema()); } } diff --git a/app/code/Magento/Theme/Test/Unit/Model/Layout/Config/_files/page_layouts.xml b/app/code/Magento/Theme/Test/Unit/Model/Layout/Config/_files/page_layouts.xml index 20ac9116e97a0060d49a844fadb33be4034fd2ea..6e66d26c99af10ec2e91b33255988a0ea2db87cd 100644 --- a/app/code/Magento/Theme/Test/Unit/Model/Layout/Config/_files/page_layouts.xml +++ b/app/code/Magento/Theme/Test/Unit/Model/Layout/Config/_files/page_layouts.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/View/PageLayout/etc/layouts.xsd"> +<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/PageLayout/etc/layouts.xsd"> <layout id="empty"> <label translate="true">Empty</label> </layout> diff --git a/app/code/Magento/Theme/Test/Unit/Model/Theme/CollectionTest.php b/app/code/Magento/Theme/Test/Unit/Model/Theme/CollectionTest.php index e2997b0cc62dcc8511015a87cd7596ddcf0f2a1b..4bb14d31655818069fc22a6ef4f6cfe986e97225 100644 --- a/app/code/Magento/Theme/Test/Unit/Model/Theme/CollectionTest.php +++ b/app/code/Magento/Theme/Test/Unit/Model/Theme/CollectionTest.php @@ -13,27 +13,32 @@ class CollectionTest extends \PHPUnit_Framework_TestCase /** * @var Collection */ - protected $model; - - /** - * @var \Magento\Framework\Filesystem|\PHPUnit_Framework_MockObject_MockObject - */ - protected $filesystem; + private $model; /** * @var \Magento\Framework\Config\ThemeFactory|\PHPUnit_Framework_MockObject_MockObject */ - protected $themeConfigFactory; + private $themeConfigFactory; /** * @var \Magento\Framework\Filesystem\Directory\ReadInterface|\PHPUnit_Framework_MockObject_MockObject */ - protected $directory; + private $directory; /** * @var \Magento\Framework\Data\Collection\EntityFactory|\PHPUnit_Framework_MockObject_MockObject */ - protected $entityFactory; + private $entityFactory; + + /** + * @var \Magento\Framework\View\Design\Theme\ThemePackageList|\PHPUnit_Framework_MockObject_MockObject + */ + private $themePackageList; + + /** + * @var \Magento\Framework\Filesystem\Directory\ReadFactory|\PHPUnit_Framework_MockObject_MockObject + */ + private $readDirFactory; protected function setUp() { @@ -41,9 +46,6 @@ class CollectionTest extends \PHPUnit_Framework_TestCase ->disableOriginalConstructor() ->setMethods(['create']) ->getMock(); - $this->filesystem = $this->getMockBuilder('Magento\Framework\Filesystem') - ->disableOriginalConstructor() - ->getMock(); $this->themeConfigFactory = $this->getMockBuilder('Magento\Framework\Config\ThemeFactory') ->setMethods(['create']) ->disableOriginalConstructor() @@ -52,14 +54,23 @@ class CollectionTest extends \PHPUnit_Framework_TestCase ->disableOriginalConstructor() ->getMock(); - $this->filesystem->expects($this->once()) - ->method('getDirectoryRead') - ->willReturn($this->directory); + $this->themePackageList = $this->getMock( + '\Magento\Framework\View\Design\Theme\ThemePackageList', + [], + [], + '', + false + ); + $this->readDirFactory = $this->getMock('Magento\Framework\Filesystem\Directory\ReadFactory', [], [], '', false); + $this->readDirFactory->expects($this->any()) + ->method('create') + ->will($this->returnValue($this->directory)); $this->model = new Collection( $this->entityFactory, - $this->filesystem, - $this->themeConfigFactory + $this->themeConfigFactory, + $this->themePackageList, + $this->readDirFactory ); } @@ -69,47 +80,40 @@ class CollectionTest extends \PHPUnit_Framework_TestCase */ public function testLoadData() { - $relativeDir = 'dir'; $fileContent = 'content file'; $media = ['preview_image' => 'preview.jpg']; $themeTitle = 'Theme title'; - $themeConfigs = ['frontend/theme/code']; + $themeConfigFile = 'theme.xml'; $themeConfig = $this->getMockBuilder('Magento\Framework\Config\Theme')->disableOriginalConstructor()->getMock(); $theme = $this->getMockBuilder('Magento\Theme\Model\Theme')->disableOriginalConstructor()->getMock(); $parentTheme = ['parentThemeCode']; $parentThemePath = 'frontend/parent/theme'; + $themePackage = $this->getMock('\Magento\Framework\View\Design\Theme\ThemePackage', [], [], '', false); + $themePackage->expects($this->any()) + ->method('getArea') + ->will($this->returnValue('frontend')); + $themePackage->expects($this->any()) + ->method('getVendor') + ->will($this->returnValue('theme')); + $themePackage->expects($this->any()) + ->method('getName') + ->will($this->returnValue('code')); + $this->themePackageList->expects($this->once()) + ->method('getThemes') + ->will($this->returnValue([$themePackage])); $this->directory->expects($this->once()) - ->method('search') - ->with($relativeDir) - ->willReturn($themeConfigs); - $this->directory->expects($this->any()) ->method('isExist') - ->with($themeConfigs[0]) + ->with($themeConfigFile) ->willReturn(true); - $this->directory->expects($this->any()) + $this->directory->expects($this->once()) ->method('readFile') - ->with($themeConfigs[0]) + ->with($themeConfigFile) ->willReturn($fileContent); - $this->directory->expects($this->any()) - ->method('getRelativePath') - ->with($themeConfigs[0]) - ->willReturn($themeConfigs[0]); - $this->directory->expects($this->any()) - ->method('getAbsolutePath') - ->willReturnMap( - [ - [$themeConfigs[0], $themeConfigs[0]], - [null, ''], - ] - ); $this->themeConfigFactory->expects($this->once()) ->method('create') ->with(['configContent' => $fileContent]) ->willReturn($themeConfig); - $this->directory->expects($this->at(1)) - ->method('getAbsolutePath') - ->willReturn(''); $this->entityFactory->expects($this->any()) ->method('create') ->with('Magento\Theme\Model\Theme') @@ -130,11 +134,11 @@ class CollectionTest extends \PHPUnit_Framework_TestCase 'parent_id' => null, 'type' => ThemeInterface::TYPE_PHYSICAL, 'area' => 'frontend', - 'theme_path' => 'theme', - 'code' => 'theme', + 'theme_path' => 'theme/code', + 'code' => 'theme/code', 'theme_title' => $themeTitle, 'preview_image' => $media['preview_image'], - 'parent_theme_path' => $parentTheme[0] + 'parent_theme_path' => 'theme/parentThemeCode' ] ) ->willReturnSelf(); @@ -146,18 +150,72 @@ class CollectionTest extends \PHPUnit_Framework_TestCase ->method('getArea') ->willReturn('frontend'); - $this->model->addTargetPattern($relativeDir); $this->assertInstanceOf(get_class($this->model), $this->model->loadData()); } /** - * @test - * @return void - * @expectedException \Magento\Framework\Exception\LocalizedException - * @expectedExceptionMessage Please specify at least one target pattern to theme config file. + * @expectedException \UnexpectedValueException + * @expectedExceptionMessage Constraint 'unsupported_type' is not supported + */ + public function testAddConstraintUnsupportedType() + { + $this->model->addConstraint('unsupported_type', 'value'); + } + + /** + * @param array $inputValues + * @param array $expected + * + * @dataProvider addConstraintDataProvider */ - public function testGetTargetPatternsException() + public function testAddConstraint(array $inputValues, array $expected) { - $this->model->getTargetPatterns(); + foreach ($inputValues as $data) { + $type = $data[0]; + $value = $data[1]; + $this->model->addConstraint($type, $value); + } + $default = [ + Collection::CONSTRAINT_AREA => [], + Collection::CONSTRAINT_VENDOR => [], + Collection::CONSTRAINT_THEME_NAME => [] + ]; + $expected = array_merge($default, $expected); + $this->assertAttributeSame($expected, 'constraints', $this->model); + } + + /** + * @return array + */ + public function addConstraintDataProvider() + { + return [ + 'area' => [ + [[Collection::CONSTRAINT_AREA, 'area']], + [Collection::CONSTRAINT_AREA => ['area']] + ], + 'vendor' => [ + [[Collection::CONSTRAINT_VENDOR, 'Vendor']], + [Collection::CONSTRAINT_VENDOR => ['Vendor']] + ], + 'theme name' => [ + [[Collection::CONSTRAINT_THEME_NAME, 'theme_name']], + [Collection::CONSTRAINT_THEME_NAME => ['theme_name']] + ], + 'area, vendor and theme name' => [ + [ + [Collection::CONSTRAINT_AREA, 'area_one'], + [Collection::CONSTRAINT_AREA, 'area_two'], + [Collection::CONSTRAINT_VENDOR, 'Vendor'], + [Collection::CONSTRAINT_VENDOR, 'Vendor'], + [Collection::CONSTRAINT_THEME_NAME, 'theme_name'] + ], + [ + Collection::CONSTRAINT_AREA => ['area_one', 'area_two'], + Collection::CONSTRAINT_VENDOR => ['Vendor'], + Collection::CONSTRAINT_THEME_NAME => ['theme_name'] + ] + ], + ]; } } diff --git a/app/code/Magento/Theme/Test/Unit/Model/Theme/RegistrationTest.php b/app/code/Magento/Theme/Test/Unit/Model/Theme/RegistrationTest.php index 94c7f74e8b2897d3e1f7adb85556322eec809f83..8bf530f6a12b202efb9827e2589f1ddc918705c7 100644 --- a/app/code/Magento/Theme/Test/Unit/Model/Theme/RegistrationTest.php +++ b/app/code/Magento/Theme/Test/Unit/Model/Theme/RegistrationTest.php @@ -25,11 +25,6 @@ class RegistrationTest extends \PHPUnit_Framework_TestCase */ protected $filesystemCollection; - /** - * @var \Magento\Framework\Filesystem|\PHPUnit_Framework_MockObject_MockObject - */ - protected $filesystem; - public function setUp() { $this->collectionFactory = $this->getMockBuilder('Magento\Theme\Model\Resource\Theme\Data\CollectionFactory') @@ -39,14 +34,10 @@ class RegistrationTest extends \PHPUnit_Framework_TestCase $this->filesystemCollection = $this->getMockBuilder('Magento\Theme\Model\Theme\Data\Collection') ->disableOriginalConstructor() ->getMock(); - $this->filesystem = $this->getMockBuilder('Magento\Framework\Filesystem') - ->disableOriginalConstructor() - ->getMock(); $this->model = new Registration( $this->collectionFactory, - $this->filesystemCollection, - $this->filesystem + $this->filesystemCollection ); } @@ -58,7 +49,7 @@ class RegistrationTest extends \PHPUnit_Framework_TestCase public function testRegister() { $image = 'preview.jpg'; - $themeFilePath = 'app/design'; + $themeFilePath = 'any/path'; $parentId = 1; $fullPath = '/full/path'; $theme = $this->getMockBuilder('Magento\Framework\View\Design\ThemeInterface') @@ -115,8 +106,7 @@ class RegistrationTest extends \PHPUnit_Framework_TestCase ->method('create') ->willReturn($collection); $this->filesystemCollection->expects($this->once()) - ->method('addDefaultPattern') - ->with('*'); + ->method('clear'); $this->filesystemCollection->expects($this->once()) ->method('hasTheme') ->with($themeFromCollection) diff --git a/app/code/Magento/Theme/Test/Unit/Model/Theme/ThemePackageInfoTest.php b/app/code/Magento/Theme/Test/Unit/Model/Theme/ThemePackageInfoTest.php index ac82c517cc33dd54670ff5483d94a03489aa39bf..23bb769519f02cc5f6f2f6b1f9e972a3ecdbea07 100644 --- a/app/code/Magento/Theme/Test/Unit/Model/Theme/ThemePackageInfoTest.php +++ b/app/code/Magento/Theme/Test/Unit/Model/Theme/ThemePackageInfoTest.php @@ -15,59 +15,67 @@ class ThemePackageInfoTest extends \PHPUnit_Framework_TestCase private $dirRead; /** - * @var \Magento\Theme\Model\Theme\Data\Collection|\PHPUnit_Framework_MockObject_MockObject + * @var ThemePackageInfo */ - private $collection; + private $themePackageInfo; /** - * @var ThemePackageInfo + * @var \Magento\Framework\Component\ComponentRegistrar|\PHPUnit_Framework_MockObject_MockObject */ - private $themePackageInfo; + private $componentRegistrar; + + /** + * @var \Magento\Framework\Filesystem\Directory\ReadFactory|\PHPUnit_Framework_MockObject_MockObject + */ + private $dirReadFactory; public function setUp() { - $filesystem = $this->getMock('Magento\Framework\Filesystem', [], [], '', false); + $this->componentRegistrar = $this->getMock('Magento\Framework\Component\ComponentRegistrar', [], [], '', false); $this->dirRead = $this->getMock('Magento\Framework\Filesystem\Directory\Read', [], [], '', false); - $this->collection = $this->getMock('Magento\Theme\Model\Theme\Data\Collection', [], [], '', false); - $filesystem->expects($this->once())->method('getDirectoryRead')->willReturn($this->dirRead); - $this->themePackageInfo = new ThemePackageInfo($this->collection, $filesystem); + $this->dirReadFactory = $this->getMock('Magento\Framework\Filesystem\Directory\ReadFactory', [], [], '', false); + $this->dirReadFactory->expects($this->any())->method('create')->willReturn($this->dirRead); + $this->themePackageInfo = new ThemePackageInfo( + $this->componentRegistrar, + $this->dirReadFactory + ); } public function testGetPackageName() { - $this->dirRead->expects($this->once())->method('isExist')->with('themeA/composer.json')->willReturn(true); + $this->componentRegistrar->expects($this->once())->method('getPath')->willReturn('path/to/A'); + $this->dirRead->expects($this->once())->method('isExist')->with('composer.json')->willReturn(true); $this->dirRead->expects($this->once()) ->method('readFile') - ->with('themeA/composer.json') + ->with('composer.json') ->willReturn('{"name": "package"}'); $this->assertEquals('package', $this->themePackageInfo->getPackageName('themeA')); } public function testGetPackageNameNonExist() { - $this->dirRead->expects($this->once())->method('isExist')->with('themeA/composer.json')->willReturn(false); - $this->dirRead->expects($this->never())->method('readFile')->with('themeA/composer.json'); + $this->componentRegistrar->expects($this->once())->method('getPath')->willReturn('path/to/A'); + $this->dirRead->expects($this->once())->method('isExist')->with('composer.json')->willReturn(false); + $this->dirRead->expects($this->never())->method('readFile')->with('composer.json'); $this->assertEquals('', $this->themePackageInfo->getPackageName('themeA')); } public function testGetFullThemePath() { - $this->collection->expects($this->once())->method('addDefaultPattern')->with('*'); - $theme = $this->getMock('Magento\Theme\Model\Theme', [], [], '', false); - $theme->expects($this->once())->method('getFullPath')->willReturn('fullPath'); - $this->collection->expects($this->once())->method('getIterator')->willReturn([$theme]); + $this->componentRegistrar->expects($this->once())->method('getPaths')->willReturn(['themeA' => 'path/to/A']); $this->dirRead->expects($this->once())->method('isExist')->willReturn(true); $this->dirRead->expects($this->once())->method('readFile')->willReturn('{"name": "package"}'); - $this->assertEquals('fullPath', $this->themePackageInfo->getFullThemePath('package')); + $this->assertEquals('themeA', $this->themePackageInfo->getFullThemePath('package')); // call one more time to make sure only initialize once - $this->assertEquals('fullPath', $this->themePackageInfo->getFullThemePath('package')); + $this->assertEquals('themeA', $this->themePackageInfo->getFullThemePath('package')); } public function testGetFullThemePathNonExist() { - $this->collection->expects($this->once())->method('addDefaultPattern')->with('*'); - $this->collection->expects($this->once())->method('getIterator')->willReturn([]); - $this->assertEquals('', $this->themePackageInfo->getFullThemePath('package')); + $this->componentRegistrar->expects($this->once())->method('getPaths')->willReturn(['themeA' => 'path/to/A']); + $this->dirRead->expects($this->once())->method('isExist')->willReturn(true); + $this->dirRead->expects($this->once())->method('readFile')->willReturn('{"name": "package"}'); + $this->assertEquals('', $this->themePackageInfo->getFullThemePath('package-other')); } /** @@ -75,8 +83,9 @@ class ThemePackageInfoTest extends \PHPUnit_Framework_TestCase */ public function testGetPackageNameInvalidJson() { + $this->componentRegistrar->expects($this->once())->method('getPath')->willReturn('path/to/A'); $this->dirRead->expects($this->once())->method('isExist')->willReturn(true); $this->dirRead->expects($this->once())->method('readFile')->willReturn('{"name": }'); - $this->assertEquals('package', $this->themePackageInfo->getPackageName('themeA')); + $this->themePackageInfo->getPackageName('themeA'); } } diff --git a/app/code/Magento/Theme/Test/Unit/Model/_files/frontend/magento_iphone/theme.xml b/app/code/Magento/Theme/Test/Unit/Model/_files/frontend/magento_iphone/theme.xml index c9f12e29fc660b43b7d2c28f3fa57d6dd1d17243..d914ad5bdd87cf9019286c3eb85369c4a0e1c8fe 100644 --- a/app/code/Magento/Theme/Test/Unit/Model/_files/frontend/magento_iphone/theme.xml +++ b/app/code/Magento/Theme/Test/Unit/Model/_files/frontend/magento_iphone/theme.xml @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ --> -<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> +<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> <title>Iphone</title> <media> <preview_image>images/preview.png</preview_image> diff --git a/app/code/Magento/Theme/Test/Unit/Model/_files/frontend/magento_iphone/theme_invalid.xml b/app/code/Magento/Theme/Test/Unit/Model/_files/frontend/magento_iphone/theme_invalid.xml index 2d836a4788e025cc0f70a9a9215fd3e443de8edc..f8bac9a100a2e6b4318b60d9f32636b91a831634 100644 --- a/app/code/Magento/Theme/Test/Unit/Model/_files/frontend/magento_iphone/theme_invalid.xml +++ b/app/code/Magento/Theme/Test/Unit/Model/_files/frontend/magento_iphone/theme_invalid.xml @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ --> -<design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> +<design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> <package code="default"> <title>Default</title> <theme version="2.0.0.1" code="iphone"> diff --git a/app/code/Magento/Theme/composer.json b/app/code/Magento/Theme/composer.json index c6992cc9802e343ad340b30e5df7cb5d1b341d0c..ef001d016fb952d571db213a7f85d9f922a43cb0 100644 --- a/app/code/Magento/Theme/composer.json +++ b/app/code/Magento/Theme/composer.json @@ -12,8 +12,7 @@ "magento/module-config": "1.0.0-beta", "magento/module-media-storage": "1.0.0-beta", "magento/framework": "1.0.0-beta", - "magento/module-require-js": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/module-require-js": "1.0.0-beta" }, "suggest": { "magento/module-translation": "1.0.0-beta" @@ -24,12 +23,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Theme" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Theme\\": "" + } } } diff --git a/app/code/Magento/Theme/etc/acl.xml b/app/code/Magento/Theme/etc/acl.xml index d2f3368a23312458f8eee39a3a7da4873812e09c..53b6cfce875915b4190a633741f34c3962f38011 100644 --- a/app/code/Magento/Theme/etc/acl.xml +++ b/app/code/Magento/Theme/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/app/code/Magento/Theme/etc/adminhtml/di.xml b/app/code/Magento/Theme/etc/adminhtml/di.xml index d0a5a9c35409bbf54b132ad06724ef46dbfcad7c..ecd36bd35172c03c7a17e9b899a6e0ae99c117fb 100644 --- a/app/code/Magento/Theme/etc/adminhtml/di.xml +++ b/app/code/Magento/Theme/etc/adminhtml/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Theme\Block\Adminhtml\Wysiwyg\Files\Content"> <arguments> <argument name="storageHelper" xsi:type="object">Magento\Theme\Helper\Storage\Proxy</argument> diff --git a/app/code/Magento/Theme/etc/adminhtml/menu.xml b/app/code/Magento/Theme/etc/adminhtml/menu.xml index 327caea7ac166b9bb30e318c5871b77f38d1ba6d..69dc22be1ee144a23d70df707908aec858b63e97 100644 --- a/app/code/Magento/Theme/etc/adminhtml/menu.xml +++ b/app/code/Magento/Theme/etc/adminhtml/menu.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Backend/etc/menu.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd"> <menu> <add id="Magento_Theme::system_design_theme" title="Themes" module="Magento_Theme" sortOrder="20" parent="Magento_Backend::system_design" action="adminhtml/system_design_theme" resource="Magento_Theme::theme"/> </menu> diff --git a/app/code/Magento/Theme/etc/adminhtml/routes.xml b/app/code/Magento/Theme/etc/adminhtml/routes.xml index 2884fdbdfe28b6f4a75934469e92b243fae22474..a1078f6a3669afafa9bd0c8d82b70ffcba8ab9f8 100644 --- a/app/code/Magento/Theme/etc/adminhtml/routes.xml +++ b/app/code/Magento/Theme/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="admin"> <route id="adminhtml"> <module name="Magento_Theme" /> diff --git a/app/code/Magento/Theme/etc/adminhtml/system.xml b/app/code/Magento/Theme/etc/adminhtml/system.xml index 241a28a7d828e5296815fd84bab21e59fedb719b..58746c75d620f40e3cba9c05fddcad923c471479 100644 --- a/app/code/Magento/Theme/etc/adminhtml/system.xml +++ b/app/code/Magento/Theme/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="design" translate="label"> <group id="head" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1"> diff --git a/app/code/Magento/Theme/etc/config.xml b/app/code/Magento/Theme/etc/config.xml index b019db19d35c1f03716316131cb5cd4a23bbb19c..332043e56df8729c080d1e849df05b786e8b4cff 100644 --- a/app/code/Magento/Theme/etc/config.xml +++ b/app/code/Magento/Theme/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <design> <head translate="default_description"> diff --git a/app/code/Magento/Theme/etc/di.xml b/app/code/Magento/Theme/etc/di.xml index 6b32e65b7ec19a9caa7b1af6ae4029b3b4ca9f11..e9c41c1798399fc1714dbd6e88ee872981550e53 100644 --- a/app/code/Magento/Theme/etc/di.xml +++ b/app/code/Magento/Theme/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Framework\View\Design\Theme\FileInterface" type="Magento\Theme\Model\Theme\File" /> <preference for="Magento\Framework\View\Design\Theme\ThemeProviderInterface" type="Magento\Theme\Model\Theme\ThemeProvider" /> <preference for="Magento\Framework\View\Design\Theme\FileProviderInterface" type="Magento\Theme\Model\Theme\FileProvider" /> diff --git a/app/code/Magento/Theme/etc/events.xml b/app/code/Magento/Theme/etc/events.xml index 9a11885504c89416db6893eec77f8f0ae08bf007..1d4fb79dcf8275006a9b011bd048a7fa1169b0eb 100644 --- a/app/code/Magento/Theme/etc/events.xml +++ b/app/code/Magento/Theme/etc/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="theme_delete_before"> <observer name="clean_theme_related_content" instance="Magento\Theme\Observer\CleanThemeRelatedContentObserver" method="execute" /> </event> diff --git a/app/code/Magento/Theme/etc/frontend/di.xml b/app/code/Magento/Theme/etc/frontend/di.xml index 2720be8b57e7d315c05fbb3ac9047fd15f771a14..b76942a7fadbed5e385ed2de55ac229f66041503 100644 --- a/app/code/Magento/Theme/etc/frontend/di.xml +++ b/app/code/Magento/Theme/etc/frontend/di.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Customer\CustomerData\SectionPoolInterface"> <arguments> <argument name="sectionSourceMap" xsi:type="array"> diff --git a/app/code/Magento/Theme/etc/frontend/events.xml b/app/code/Magento/Theme/etc/frontend/events.xml index 0cb1460ec6f34698ad247a27ad4d95a8bf618ac9..747cf783f4dbb53b9e8c3d9593a945c626b003f3 100644 --- a/app/code/Magento/Theme/etc/frontend/events.xml +++ b/app/code/Magento/Theme/etc/frontend/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="controller_action_layout_render_before"> <observer name="theme" instance="Magento\Theme\Observer\ApplyThemeCustomizationObserver" method="execute" /> </event> diff --git a/app/code/Magento/Theme/etc/frontend/sections.xml b/app/code/Magento/Theme/etc/frontend/sections.xml index af6139443ffc7e373c533b10a9091b1f520f1c15..d096d8ab692e894157947f9c45695aa55a60c548 100644 --- a/app/code/Magento/Theme/etc/frontend/sections.xml +++ b/app/code/Magento/Theme/etc/frontend/sections.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../Magento/Customer/etc/sections.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd"> <action name="*"> <section name="messages"/> </action> diff --git a/app/code/Magento/Theme/etc/module.xml b/app/code/Magento/Theme/etc/module.xml index 742926c80c22477e93836c45364b0e203898f3a7..9b530da59f09cee2a795a14c7306f8885d9041ba 100644 --- a/app/code/Magento/Theme/etc/module.xml +++ b/app/code/Magento/Theme/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Theme" setup_version="2.0.0"> <sequence> <module name="Magento_Store"/> diff --git a/app/code/Magento/Theme/registration.php b/app/code/Magento/Theme/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..e39fbb02c21206016c9fd37a79a44d36e52496ff --- /dev/null +++ b/app/code/Magento/Theme/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Theme', + __DIR__ +); diff --git a/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_theme_block.xml b/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_theme_block.xml index d11386b2cc0e4f718cf2c5d2e1e6932095d2bc6f..667d0b881623fbb524fda78015ecc2a808b962f8 100644 --- a/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_theme_block.xml +++ b/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_theme_block.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="design_theme"> <block class="Magento\Backend\Block\Widget\Grid" name="theme.grid" as="grid"> diff --git a/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_theme_edit.xml b/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_theme_edit.xml index 605ae047411a1585f7971b0153fea30739bb7f7b..05b0f79d33ab89196689cf7eec4c091dadcc25d7 100644 --- a/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_theme_edit.xml +++ b/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_theme_edit.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <css src="jquery/fileUploader/css/jquery.fileupload-ui.css"/> <css src="Magento_Theme::css/theme.css"/> diff --git a/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_theme_grid.xml b/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_theme_grid.xml index 3e9a36acaf81a034c3b6398e402c2c6895b6f189..b17e67b276318db6581b66c6e3d7e7fd6408104d 100644 --- a/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_theme_grid.xml +++ b/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_theme_grid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <update handle="formkey"/> <update handle="adminhtml_system_design_theme_block"/> <container name="root"> diff --git a/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_theme_index.xml b/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_theme_index.xml index 65527316522fc1590f8e00a09554a5a1cdbf1825..94e7e297b6cd5761aea2b32af85bbe3c162460b8 100644 --- a/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_theme_index.xml +++ b/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_theme_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="formkey"/> <update handle="adminhtml_system_design_theme_block"/> <body> diff --git a/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_wysiwyg_files_contents.xml b/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_wysiwyg_files_contents.xml index fb433932aceebb52c8b3c7a0df3837c7638a4571..756b780a38b3a3d28ebd5c6f9da106a2f5b9c7f9 100644 --- a/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_wysiwyg_files_contents.xml +++ b/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_wysiwyg_files_contents.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root"> <block class="Magento\Theme\Block\Adminhtml\Wysiwyg\Files\Content\Files" name="wysiwyg_files.files" template="browser/content/files.phtml"/> </container> diff --git a/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_wysiwyg_files_index.xml b/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_wysiwyg_files_index.xml index 5f50ce5eb338d05baade6bd68cd69fe4dce2c1ae..63340facb3e4bf7839322731a9b052638528237f 100644 --- a/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_wysiwyg_files_index.xml +++ b/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_wysiwyg_files_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="footer" remove="true"/> <referenceContainer name="left"> diff --git a/app/code/Magento/Theme/view/adminhtml/layouts.xml b/app/code/Magento/Theme/view/adminhtml/layouts.xml index 519894690c4421b2d283b588e6c856e6a3eaf02f..e1433eec25f566c3ea23073b41e84d0fe5a7d831 100644 --- a/app/code/Magento/Theme/view/adminhtml/layouts.xml +++ b/app/code/Magento/Theme/view/adminhtml/layouts.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/View/PageLayout/etc/layouts.xsd"> +<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/PageLayout/etc/layouts.xsd"> <layout id="admin-empty"> <label translate="true">Admin empty</label> </layout> diff --git a/app/code/Magento/Theme/view/adminhtml/page_layout/admin-1column.xml b/app/code/Magento/Theme/view/adminhtml/page_layout/admin-1column.xml index f71333df72624bd5873e5bc03d60be900a360c73..4ae1ed9265e6d484ef271e6a443003852cb9354b 100644 --- a/app/code/Magento/Theme/view/adminhtml/page_layout/admin-1column.xml +++ b/app/code/Magento/Theme/view/adminhtml/page_layout/admin-1column.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_layout.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"> <container name="root"> <container name="backend.page"> <container name="after.body.start" as="after.body.start" label="Page Top" before="-"/> diff --git a/app/code/Magento/Theme/view/adminhtml/page_layout/admin-2columns-left.xml b/app/code/Magento/Theme/view/adminhtml/page_layout/admin-2columns-left.xml index 2ed568752348917c53393bcd6a40d0ea332b601d..ef28540cf5d03413f3abcc3c8f514bfe765f3b51 100644 --- a/app/code/Magento/Theme/view/adminhtml/page_layout/admin-2columns-left.xml +++ b/app/code/Magento/Theme/view/adminhtml/page_layout/admin-2columns-left.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_layout.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"> <container name="root"> <container name="backend.page"> <container name="after.body.start" as="after.body.start" label="Page Top" before="-"/> diff --git a/app/code/Magento/Theme/view/adminhtml/page_layout/admin-empty.xml b/app/code/Magento/Theme/view/adminhtml/page_layout/admin-empty.xml index e547bbaedaa5daf65e8aa9a971177bd4335f31e7..3f7841f8e56d406e5db13152ce743ccdb551306d 100644 --- a/app/code/Magento/Theme/view/adminhtml/page_layout/admin-empty.xml +++ b/app/code/Magento/Theme/view/adminhtml/page_layout/admin-empty.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_layout.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"> <container name="root"> <container name="page.formkey" as="page.formkey"/> <container name="content" as="content"/> diff --git a/app/code/Magento/Theme/view/adminhtml/page_layout/admin-login.xml b/app/code/Magento/Theme/view/adminhtml/page_layout/admin-login.xml index bba3e8c3cc482d1c4bd6975edc579ed3714a1571..43279b5da87fcf31209dade134a3319b2aeb8244 100644 --- a/app/code/Magento/Theme/view/adminhtml/page_layout/admin-login.xml +++ b/app/code/Magento/Theme/view/adminhtml/page_layout/admin-login.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_layout.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"> <container name="root" htmlTag="section" htmlClass="page-wrapper"> <container name="after.body.start" as="after.body.start" label="Page Top" before="-"/> <container name="login.header" htmlTag="header" htmlClass="login-header"/> diff --git a/app/code/Magento/Theme/view/base/layouts.xml b/app/code/Magento/Theme/view/base/layouts.xml index 709a8b582342cecb08484faf348d32a8329c0b03..2fdcd003fb923555a703d1fb57c8424057dfd6e4 100644 --- a/app/code/Magento/Theme/view/base/layouts.xml +++ b/app/code/Magento/Theme/view/base/layouts.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/View/PageLayout/etc/layouts.xsd"> +<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/PageLayout/etc/layouts.xsd"> <layout id="empty"> <label translate="true">Empty</label> </layout> diff --git a/app/code/Magento/Theme/view/base/page_layout/empty.xml b/app/code/Magento/Theme/view/base/page_layout/empty.xml index 0ad11fe7e9de7dadbcac37bea86ccc98671fecb7..09d5658a86c4b9e38d7d2b8c83646555b2a97c10 100644 --- a/app/code/Magento/Theme/view/base/page_layout/empty.xml +++ b/app/code/Magento/Theme/view/base/page_layout/empty.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_layout.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"> <container name="root"> <container name="after.body.start" as="after.body.start" before="-" label="Page Top"/> <container name="page.wrapper" as="page_wrapper" htmlTag="div" htmlClass="page-wrapper"> diff --git a/app/code/Magento/Theme/view/frontend/layout/default.xml b/app/code/Magento/Theme/view/frontend/layout/default.xml index b706894a17142b6b2f08c16e7403cc797544245b..e34fc0ad52988befb69e5ce5c1dce0d9673741b5 100644 --- a/app/code/Magento/Theme/view/frontend/layout/default.xml +++ b/app/code/Magento/Theme/view/frontend/layout/default.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page layout="3columns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page layout="3columns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="default_head_blocks"/> <body> <referenceContainer name="after.body.start"> diff --git a/app/code/Magento/Theme/view/frontend/layout/default_head_blocks.xml b/app/code/Magento/Theme/view/frontend/layout/default_head_blocks.xml index 7006497a59f3e455342c76ca9aa8bc040dc619fc..1aa2c7e3cc96a627ed69ebc9e128c1575bafa00b 100644 --- a/app/code/Magento/Theme/view/frontend/layout/default_head_blocks.xml +++ b/app/code/Magento/Theme/view/frontend/layout/default_head_blocks.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <meta name="x_ua_compatible" content="IE=edge,chrome=1"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> diff --git a/app/code/Magento/Theme/view/frontend/layout/page_calendar.xml b/app/code/Magento/Theme/view/frontend/layout/page_calendar.xml index 64af954277f3c5f29d9f057485b9b6ef7255df65..af35d85fdfd13d5d6eacaa53c9b81fcd77294463 100644 --- a/app/code/Magento/Theme/view/frontend/layout/page_calendar.xml +++ b/app/code/Magento/Theme/view/frontend/layout/page_calendar.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Framework\View\Element\Html\Calendar" name="html_calendar" as="html_calendar" template="Magento_Theme::js/calendar.phtml"/> diff --git a/app/code/Magento/Theme/view/frontend/layout/print.xml b/app/code/Magento/Theme/view/frontend/layout/print.xml index a007ffbb9b20625fb73ec8bba03b71f4a1a2ef63..f568749f73b3a7ac7c1689cebcaa8fd852e47516 100644 --- a/app/code/Magento/Theme/view/frontend/layout/print.xml +++ b/app/code/Magento/Theme/view/frontend/layout/print.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <attribute name="class" value="page-print"/> <referenceContainer name="header.container" remove="true"/> diff --git a/app/code/Magento/Theme/view/frontend/layouts.xml b/app/code/Magento/Theme/view/frontend/layouts.xml index 059b530f54df03fd842a41b6a23ef96c96997c6a..37c33f91151d4a0209f8b7c2ebbdfc229ade3477 100644 --- a/app/code/Magento/Theme/view/frontend/layouts.xml +++ b/app/code/Magento/Theme/view/frontend/layouts.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/View/PageLayout/etc/layouts.xsd"> +<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/PageLayout/etc/layouts.xsd"> <layout id="1column"> <label translate="true">1 column</label> </layout> diff --git a/app/code/Magento/Theme/view/frontend/page_layout/1column.xml b/app/code/Magento/Theme/view/frontend/page_layout/1column.xml index 68b1a6091766b331476e934a02bc018651ac31d9..39bf5ee4737ec4a81732c9a4537a4c14ecbb11e1 100644 --- a/app/code/Magento/Theme/view/frontend/page_layout/1column.xml +++ b/app/code/Magento/Theme/view/frontend/page_layout/1column.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_layout.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"> <update handle="empty"/> <referenceContainer name="page.wrapper"> <container name="header.container" as="header_container" label="Page Header Container" htmlTag="header" htmlClass="page-header" before="main.content"/> diff --git a/app/code/Magento/Theme/view/frontend/page_layout/2columns-left.xml b/app/code/Magento/Theme/view/frontend/page_layout/2columns-left.xml index b045fb1da065f60010e90b776b2604dba868b3a7..d6acf60dfc46a12920f3b1c4ebab9b3d3b22bdfc 100644 --- a/app/code/Magento/Theme/view/frontend/page_layout/2columns-left.xml +++ b/app/code/Magento/Theme/view/frontend/page_layout/2columns-left.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_layout.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"> <update handle="1column"/> <referenceContainer name="columns"> <container name="div.sidebar.main" htmlTag="div" htmlClass="sidebar sidebar-main" after="main"> diff --git a/app/code/Magento/Theme/view/frontend/page_layout/2columns-right.xml b/app/code/Magento/Theme/view/frontend/page_layout/2columns-right.xml index d4cd02bd0d40efb0d4b4137cb773f3c2af15a688..8091dc5717c043700bf7687e6a7a57ee082f92f9 100644 --- a/app/code/Magento/Theme/view/frontend/page_layout/2columns-right.xml +++ b/app/code/Magento/Theme/view/frontend/page_layout/2columns-right.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_layout.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"> <update handle="2columns-left"/> </layout> diff --git a/app/code/Magento/Theme/view/frontend/page_layout/3columns.xml b/app/code/Magento/Theme/view/frontend/page_layout/3columns.xml index d4cd02bd0d40efb0d4b4137cb773f3c2af15a688..8091dc5717c043700bf7687e6a7a57ee082f92f9 100644 --- a/app/code/Magento/Theme/view/frontend/page_layout/3columns.xml +++ b/app/code/Magento/Theme/view/frontend/page_layout/3columns.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_layout.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"> <update handle="2columns-left"/> </layout> diff --git a/app/code/Magento/Translation/Model/Js/DataProvider.php b/app/code/Magento/Translation/Model/Js/DataProvider.php index dad8e6b2f8dfc43623f4b5effb8e2f3f4b9eb4d5..ee6d8b3f5df193ae8444ba3c4e1ca9a87d61f617 100644 --- a/app/code/Magento/Translation/Model/Js/DataProvider.php +++ b/app/code/Magento/Translation/Model/Js/DataProvider.php @@ -6,23 +6,15 @@ namespace Magento\Translation\Model\Js; -use Magento\Framework\Phrase\Renderer\Translate; -use Magento\Framework\App\Utility\Files; -use Magento\Framework\App\State; -use Magento\Framework\Filesystem; -use Magento\Framework\Filesystem\Directory\ReadInterface; -use Magento\Framework\App\Filesystem\DirectoryList; - /** * DataProvider for js translation - * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class DataProvider implements DataProviderInterface { /** * Application state * - * @var State + * @var \Magento\Framework\App\State */ protected $appState; @@ -36,43 +28,54 @@ class DataProvider implements DataProviderInterface /** * Files utility * - * @var Files + * @var \Magento\Framework\App\Utility\Files */ protected $filesUtility; /** * Filesystem * - * @var ReadInterface + * @var \Magento\Framework\Filesystem\File\ReadFactory */ - protected $rootDirectory; + protected $fileReadFactory; /** * Basic translate renderer * - * @var Translate + * @var \Magento\Framework\Phrase\Renderer\Translate */ protected $translate; /** - * @param State $appState + * @param \Magento\Framework\App\State $appState * @param Config $config - * @param Filesystem $filesystem - * @param Translate $translate - * @param Files $filesUtility + * @param \Magento\Framework\Filesystem\File\ReadFactory $fileReadFactory + * @param \Magento\Framework\Phrase\Renderer\Translate $translate + * @param \Magento\Framework\Component\ComponentRegistrar $componentRegistrar + * @param \Magento\Framework\Component\DirSearch $dirSearch + * @param \Magento\Framework\View\Design\Theme\ThemePackageList $themePackageList + * @param \Magento\Framework\App\Utility\Files|null $filesUtility */ public function __construct( - State $appState, + \Magento\Framework\App\State $appState, Config $config, - Filesystem $filesystem, - Translate $translate, - Files $filesUtility = null + \Magento\Framework\Filesystem\File\ReadFactory $fileReadFactory, + \Magento\Framework\Phrase\Renderer\Translate $translate, + \Magento\Framework\Component\ComponentRegistrar $componentRegistrar, + \Magento\Framework\Component\DirSearch $dirSearch, + \Magento\Framework\View\Design\Theme\ThemePackageList $themePackageList, + \Magento\Framework\App\Utility\Files $filesUtility = null ) { $this->appState = $appState; $this->config = $config; - $this->rootDirectory = $filesystem->getDirectoryRead(DirectoryList::ROOT); + $this->fileReadFactory = $fileReadFactory; $this->translate = $translate; - $this->filesUtility = (null !== $filesUtility) ? $filesUtility : new Files(BP); + $this->filesUtility = (null !== $filesUtility) ? + $filesUtility : new \Magento\Framework\App\Utility\Files( + $componentRegistrar, + $dirSearch, + $themePackageList + ); } /** @@ -96,7 +99,9 @@ class DataProvider implements DataProviderInterface $dictionary = []; foreach ($files as $filePath) { - $content = $this->rootDirectory->readFile($this->rootDirectory->getRelativePath($filePath[0])); + /** @var \Magento\Framework\Filesystem\File\Read $read */ + $read = $this->fileReadFactory->create($filePath[0], \Magento\Framework\Filesystem\DriverPool::FILE); + $content = $read->readAll(); foreach ($this->getPhrases($content) as $phrase) { $translatedPhrase = $this->translate->render([$phrase], []); if ($phrase != $translatedPhrase) { diff --git a/app/code/Magento/Translation/Test/Unit/Model/Js/DataProviderTest.php b/app/code/Magento/Translation/Test/Unit/Model/Js/DataProviderTest.php index 376f19d35f7d3df6ec75ea1eaaa2528957c1253d..b850e5c5f95f15ae857849d0e56ad078d1747b38 100644 --- a/app/code/Magento/Translation/Test/Unit/Model/Js/DataProviderTest.php +++ b/app/code/Magento/Translation/Test/Unit/Model/Js/DataProviderTest.php @@ -8,8 +8,7 @@ namespace Magento\Translation\Test\Unit\Model\Js; use Magento\Framework\App\State; use Magento\Framework\App\Utility\Files; use Magento\Framework\Filesystem; -use Magento\Framework\Filesystem\Directory\ReadInterface; -use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Filesystem\File\ReadInterface; use Magento\Translation\Model\Js\DataProvider; use Magento\Translation\Model\Js\Config; use Magento\Framework\Phrase\Renderer\Translate; @@ -42,7 +41,7 @@ class DataProviderTest extends \PHPUnit_Framework_TestCase /** * @var ReadInterface|\PHPUnit_Framework_MockObject_MockObject */ - protected $rootDirectoryMock; + protected $fileReadMock; /** * @var Translate|\PHPUnit_Framework_MockObject_MockObject @@ -57,22 +56,25 @@ class DataProviderTest extends \PHPUnit_Framework_TestCase $this->appStateMock = $this->getMock('Magento\Framework\App\State', [], [], '', false); $this->configMock = $this->getMock('Magento\Translation\Model\Js\Config', [], [], '', false); $this->filesUtilityMock = $this->getMock('Magento\Framework\App\Utility\Files', [], [], '', false); - $filesystem = $this->getMock('Magento\Framework\Filesystem', [], [], '', false); - $this->rootDirectoryMock = $this->getMock('Magento\Framework\Filesystem\Directory\Read', [], [], '', false); + $fileReadFactory = $this->getMock('Magento\Framework\Filesystem\File\ReadFactory', [], [], '', false); + $this->fileReadMock = $this->getMock('Magento\Framework\Filesystem\File\Read', [], [], '', false); $this->translateMock = $this->getMock('Magento\Framework\Phrase\Renderer\Translate', [], [], '', false); - $filesystem->expects($this->once()) - ->method('getDirectoryRead') - ->with(DirectoryList::ROOT) - ->willReturn($this->rootDirectoryMock); + $fileReadFactory->expects($this->atLeastOnce()) + ->method('create') + ->willReturn($this->fileReadMock); + $dirSearch = $this->getMock('\Magento\Framework\Component\DirSearch', [], [], '', false); $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->model = $objectManager->getObject( 'Magento\Translation\Model\Js\DataProvider', [ 'appState' => $this->appStateMock, 'config' => $this->configMock, - 'filesystem' => $filesystem, + 'fileReadFactory' => $fileReadFactory, + 'translate' => $this->translateMock, + 'dirSearch' => $dirSearch, 'filesUtility' => $this->filesUtilityMock, - 'translate' => $this->translateMock + 'componentRegistrar' => + $this->getMock('Magento\Framework\Component\ComponentRegistrar', [], [], '', false) ] ); } @@ -96,13 +98,6 @@ class DataProviderTest extends \PHPUnit_Framework_TestCase [$areaCode, $themePath, '*', '*', [$filePaths[3]]] ]; - $relativePathMap = [ - ['path1', 'relativePath1'], - ['path2', 'relativePath2'], - ['path3', 'relativePath3'], - ['path4', 'relativePath4'] - ]; - $expectedResult = [ 'hello1' => 'hello1translated', 'hello2' => 'hello2translated', @@ -111,10 +106,10 @@ class DataProviderTest extends \PHPUnit_Framework_TestCase ]; $contentsMap = [ - ['relativePath1', null, null, 'content1$.mage.__("hello1")content1'], - ['relativePath2', null, null, 'content2$.mage.__("hello2")content2'], - ['relativePath3', null, null, 'content2$.mage.__("hello3")content3'], - ['relativePath4', null, null, 'content2$.mage.__("hello4")content4'] + 'content1$.mage.__("hello1")content1', + 'content2$.mage.__("hello2")content2', + 'content2$.mage.__("hello3")content3', + 'content2$.mage.__("hello4")content4' ]; $translateMap = [ @@ -136,12 +131,12 @@ class DataProviderTest extends \PHPUnit_Framework_TestCase ->method('getStaticHtmlFiles') ->willReturnMap($staticFilesMap); - $this->rootDirectoryMock->expects($this->any()) - ->method('getRelativePath') - ->willReturnMap($relativePathMap); - $this->rootDirectoryMock->expects($this->any()) - ->method('readFile') - ->willReturnMap($contentsMap); + foreach ($contentsMap as $index => $content) { + $this->fileReadMock->expects($this->at($index)) + ->method('readAll') + ->willReturn($content); + } + $this->configMock->expects($this->any()) ->method('getPatterns') ->willReturn($patterns); diff --git a/app/code/Magento/Translation/composer.json b/app/code/Magento/Translation/composer.json index 36cb1c576200e2fc0f466a7aab6dea8d66937a3e..00e0c8426715d692f0e9b7676be05884dd9839f7 100644 --- a/app/code/Magento/Translation/composer.json +++ b/app/code/Magento/Translation/composer.json @@ -7,8 +7,7 @@ "magento/module-developer": "1.0.0-beta", "magento/module-store": "1.0.0-beta", "magento/module-theme": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -16,12 +15,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Translation" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Translation\\": "" + } } } diff --git a/app/code/Magento/Translation/etc/adminhtml/di.xml b/app/code/Magento/Translation/etc/adminhtml/di.xml index 0070de836a98d872962d57284351bafe80ce1709..c5f664fd48c65cf3a2861b780db81f033f29719e 100644 --- a/app/code/Magento/Translation/etc/adminhtml/di.xml +++ b/app/code/Magento/Translation/etc/adminhtml/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Framework\Translate\Inline\ConfigInterface" type="Magento\Backend\Model\Translate\Inline\Config" /> <type name="Magento\Translation\Model\Resource\Translate"> <arguments> diff --git a/app/code/Magento/Translation/etc/adminhtml/routes.xml b/app/code/Magento/Translation/etc/adminhtml/routes.xml index 16145943b2813972e62c3f071ed08356c0a2674c..f6d618f0768042fb166aac801f151601742786e2 100644 --- a/app/code/Magento/Translation/etc/adminhtml/routes.xml +++ b/app/code/Magento/Translation/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn: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/adminhtml/system.xml b/app/code/Magento/Translation/etc/adminhtml/system.xml index 90d70e824ced6cd42cef19b0d51c39e32e5e08eb..c82fce4c4518305a2c9a101934e7b71694b1ae61 100644 --- a/app/code/Magento/Translation/etc/adminhtml/system.xml +++ b/app/code/Magento/Translation/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="dev"> <group id="js"> diff --git a/app/code/Magento/Translation/etc/cache.xml b/app/code/Magento/Translation/etc/cache.xml index ce213a65c3b21d43569f1191e2b8b88b4e5b2c6c..5bfbe3a6da11b81bdf74548af6778811c3f72f8c 100644 --- a/app/code/Magento/Translation/etc/cache.xml +++ b/app/code/Magento/Translation/etc/cache.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Cache/etc/cache.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Cache/etc/cache.xsd"> <type name="translate" translate="label,description" instance="Magento\Framework\App\Cache\Type\Translate"> <label>Translations</label> <description>Translation files.</description> diff --git a/app/code/Magento/Translation/etc/config.xml b/app/code/Magento/Translation/etc/config.xml index b81c59ae5724358d32f71ed7f2350e64eb9953a3..a778449875886b44dcc2143eae530daf949cf625 100644 --- a/app/code/Magento/Translation/etc/config.xml +++ b/app/code/Magento/Translation/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <dev> <translate_inline> diff --git a/app/code/Magento/Translation/etc/di.xml b/app/code/Magento/Translation/etc/di.xml index 9741db0c208e19264d1b929370f211223a01cd29..6faaeb58a0336626d44a4e0062902b92ec5d1346 100644 --- a/app/code/Magento/Translation/etc/di.xml +++ b/app/code/Magento/Translation/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Framework\Translate\InlineInterface" type="Magento\Framework\Translate\Inline" /> <preference for="Magento\Framework\Translate\Inline\ConfigInterface" type="Magento\Translation\Model\Inline\Config" /> <preference for="Magento\Framework\Translate\Inline\ProviderInterface" type="Magento\Framework\Translate\Inline\Provider" /> diff --git a/app/code/Magento/Translation/etc/frontend/routes.xml b/app/code/Magento/Translation/etc/frontend/routes.xml index 4cd2205c76c489e61b332fdcf9661249c3c11066..c6055a7a0257ef56aa319e5a01672a14abd6c8a7 100644 --- a/app/code/Magento/Translation/etc/frontend/routes.xml +++ b/app/code/Magento/Translation/etc/frontend/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="standard"> <route id="translation" frontName="translation"> <module name="Magento_Translation" /> diff --git a/app/code/Magento/Translation/etc/module.xml b/app/code/Magento/Translation/etc/module.xml index 669f8ae935645323723a5ea9e3732458e497f8dc..4d4d700a9af08fc7ceccabedd3402570d97eff34 100644 --- a/app/code/Magento/Translation/etc/module.xml +++ b/app/code/Magento/Translation/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Translation" setup_version="2.0.0"> </module> </config> diff --git a/app/code/Magento/Translation/registration.php b/app/code/Magento/Translation/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..a521173713c1a269e8b19b783c6813d5d024ae58 --- /dev/null +++ b/app/code/Magento/Translation/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Translation', + __DIR__ +); diff --git a/app/code/Magento/Ui/composer.json b/app/code/Magento/Ui/composer.json index f8ac37f6f283f6a8a2e1bd221835d3c33d4523f3..8be593ebc7acecfafe50424f90a0fa76fec2ec22 100644 --- a/app/code/Magento/Ui/composer.json +++ b/app/code/Magento/Ui/composer.json @@ -6,8 +6,7 @@ "magento/module-backend": "1.0.0-beta", "magento/framework": "1.0.0-beta", "magento/module-eav": "1.0.0-beta", - "magento/module-authorization": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/module-authorization": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -15,12 +14,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Ui" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Ui\\": "" + } } } diff --git a/app/code/Magento/Ui/etc/adminhtml/routes.xml b/app/code/Magento/Ui/etc/adminhtml/routes.xml index 5bf72e1b3a1f6e64c0c4d06d7d393270282505ca..17867cf86db854008f91073e3fbcdfddbbfd224b 100644 --- a/app/code/Magento/Ui/etc/adminhtml/routes.xml +++ b/app/code/Magento/Ui/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="admin"> <route id="mui" frontName="mui"> <module name="Magento_Ui" before="Magento_Backend" /> diff --git a/app/code/Magento/Ui/etc/adminhtml/system.xml b/app/code/Magento/Ui/etc/adminhtml/system.xml index bbc5f91b6b7e1d885255dcd0335b81e6d570e896..9084efaa64c2d525b74be47f52b70e2fccb502fc 100644 --- a/app/code/Magento/Ui/etc/adminhtml/system.xml +++ b/app/code/Magento/Ui/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="dev"> <group id="js"> diff --git a/app/code/Magento/Ui/etc/config.xml b/app/code/Magento/Ui/etc/config.xml index 6b151155bdfcac97f1bb9d21db1d423a7eb4c126..72db67cb4e6e5e0b1561695ea4c74c2b4e2e2a8b 100644 --- a/app/code/Magento/Ui/etc/config.xml +++ b/app/code/Magento/Ui/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <dev> <js> diff --git a/app/code/Magento/Ui/etc/di.xml b/app/code/Magento/Ui/etc/di.xml index a96eecf8ad05e1481ee9a7e1313809f7a2ffa3a4..255e77ba16bc5174524c194d462a05b708d9417c 100644 --- a/app/code/Magento/Ui/etc/di.xml +++ b/app/code/Magento/Ui/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Framework\View\Element\UiComponent\ContainerInterface" type="Magento\Ui\Component\Wrapper\UiComponent" /> <preference for="Magento\Framework\View\Element\UiComponent\Control\ActionPoolInterface" type="Magento\Ui\Component\Control\ActionPool" /> <preference for="Magento\Framework\Data\Argument\InterpreterInterface" type="Magento\Framework\Data\Argument\Interpreter\Composite" /> @@ -78,9 +78,7 @@ </virtualType> <virtualType name="uiConfigurationDomMerger" type="Magento\Framework\View\Element\UiComponent\Config\DomMerger"> <arguments> - <argument name="schemaFileType" xsi:type="string">etc</argument> - <argument name="schemaFileModule" xsi:type="string">Magento_Ui</argument> - <argument name="schemaFileName" xsi:type="string">ui_configuration.xsd</argument> + <argument name="schema" xsi:type="string">urn:magento:framework:Ui/etc/ui_configuration.xsd</argument> <argument name="contextXPath" xsi:type="array"> <item name="ui_context" xsi:type="string">/</item> </argument> @@ -96,9 +94,7 @@ </type> <virtualType name="uiTemplateDomMerger" type="Magento\Framework\View\Element\UiComponent\Config\DomMerger"> <arguments> - <argument name="schemaFileType" xsi:type="string">etc</argument> - <argument name="schemaFileModule" xsi:type="string">Magento_Ui</argument> - <argument name="schemaFileName" xsi:type="string">ui_template.xsd</argument> + <argument name="schema" xsi:type="string">urn:magento:module:Magento_Ui:etc/ui_template.xsd</argument> <argument name="contextXPath" xsi:type="array"> <item name="ui_context" xsi:type="string">/</item> </argument> @@ -115,9 +111,7 @@ </type> <virtualType name="uiDefinitionDomMerger" type="Magento\Framework\View\Element\UiComponent\Config\DomMerger"> <arguments> - <argument name="schemaFileType" xsi:type="string">etc</argument> - <argument name="schemaFileModule" xsi:type="string">Magento_Ui</argument> - <argument name="schemaFileName" xsi:type="string">ui_definition.xsd</argument> + <argument name="schema" xsi:type="string">urn:magento:framework:Ui/etc/ui_definition.xsd</argument> <argument name="contextXPath" xsi:type="array"> <item name="ui_context" xsi:type="string">/components</item> </argument> diff --git a/app/code/Magento/Ui/etc/module.xml b/app/code/Magento/Ui/etc/module.xml index cd21706e0b7d29a364d540c4b554ac13b37d0b18..dc1354bc276e39c2066acf5775bde31b46255808 100644 --- a/app/code/Magento/Ui/etc/module.xml +++ b/app/code/Magento/Ui/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Ui" setup_version="2.0.0"> <sequence> <module name="Magento_Backend"/> diff --git a/app/code/Magento/Ui/registration.php b/app/code/Magento/Ui/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..32fdab913ffe361b4636add765915eec0f1b5d7b --- /dev/null +++ b/app/code/Magento/Ui/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Ui', + __DIR__ +); diff --git a/app/code/Magento/Ui/view/base/layout/default.xml b/app/code/Magento/Ui/view/base/layout/default.xml index 253e9cc582237225b25b0e6047ee62d4be43cbdd..cfe763bba322d3d583c4c313fbd407ee8558d950 100644 --- a/app/code/Magento/Ui/view/base/layout/default.xml +++ b/app/code/Magento/Ui/view/base/layout/default.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="after.body.start"> <block class="Magento\Ui\Block\Logger" name="logger" template="Magento_Ui::logger.phtml"/> diff --git a/app/code/Magento/Ui/view/base/ui_component/etc/definition.xml b/app/code/Magento/Ui/view/base/ui_component/etc/definition.xml index a3a7bd17d6502084fff29b21d5770e785e9cb7b2..edb853da11302f136131afa172f139bcc815a43a 100755 --- a/app/code/Magento/Ui/view/base/ui_component/etc/definition.xml +++ b/app/code/Magento/Ui/view/base/ui_component/etc/definition.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<components xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../etc/ui_definition.xsd"> +<components xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Ui/etc/ui_definition.xsd"> <dataSource class="Magento\Ui\Component\DataSource"/> <listing sorting="true" class="Magento\Ui\Component\Listing"> <argument name="data" xsi:type="array"> diff --git a/app/code/Magento/Ui/view/frontend/web/js/model/messages.js b/app/code/Magento/Ui/view/frontend/web/js/model/messages.js index bedbf2a6f7171a3b395425b8b91696c75f8d930a..a2ac541848b0c968f0be4158af1eb9797125fba5 100644 --- a/app/code/Magento/Ui/view/frontend/web/js/model/messages.js +++ b/app/code/Magento/Ui/view/frontend/web/js/model/messages.js @@ -9,6 +9,8 @@ define([ 'use strict'; return Class.extend({ + + initialize: function () { this._super() .initObservable(); @@ -16,6 +18,7 @@ define([ return this; }, + initObservable: function () { this.errorMessages = ko.observableArray([]); this.successMessages = ko.observableArray([]); @@ -54,26 +57,32 @@ define([ return true; }, + addSuccessMessage: function (message) { - return this.add(message, this.successMessages) + return this.add(message, this.successMessages); }, + addErrorMessage: function (message) { - return this.add(message, this.errorMessages) + return this.add(message, this.errorMessages); }, + getErrorMessages: function () { return this.errorMessages; }, + getSuccessMessages: function () { return this.successMessages; }, - hasMessages: function() { - return (this.errorMessages().length > 0) || (this.successMessages().length > 0); + + hasMessages: function () { + return this.errorMessages().length > 0 || this.successMessages().length > 0; }, + clear: function () { this.errorMessages.removeAll(); this.successMessages.removeAll(); diff --git a/app/code/Magento/Ups/composer.json b/app/code/Magento/Ups/composer.json index 1d6540385ae340f006a11a41c2312e67d1206c25..ca25824879815c19cc367ee6f0116220c20dabda 100644 --- a/app/code/Magento/Ups/composer.json +++ b/app/code/Magento/Ups/composer.json @@ -10,8 +10,7 @@ "magento/module-directory": "1.0.0-beta", "magento/module-catalog-inventory": "1.0.0-beta", "magento/module-quote": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -19,12 +18,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Ups" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Ups\\": "" + } } } diff --git a/app/code/Magento/Ups/etc/adminhtml/system.xml b/app/code/Magento/Ups/etc/adminhtml/system.xml index 58b9c19ee7297cddff75a6809d6f7c50469aa40c..8b58410b857fa4a3428aa155b9571a42feb5a413 100644 --- a/app/code/Magento/Ups/etc/adminhtml/system.xml +++ b/app/code/Magento/Ups/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="carriers"> <group id="ups" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="1"> diff --git a/app/code/Magento/Ups/etc/config.xml b/app/code/Magento/Ups/etc/config.xml index b3df7eabdde155e4811c5ae26695b7afdd28e2b5..c90c02d414f7ac72cbcb9c10688bd40721f727e3 100644 --- a/app/code/Magento/Ups/etc/config.xml +++ b/app/code/Magento/Ups/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <carriers> <ups> diff --git a/app/code/Magento/Ups/etc/module.xml b/app/code/Magento/Ups/etc/module.xml index d823746a1d93187a88e9e7658657694ef6650329..056c383e0a213e245fc256511901b048fb0ac3e5 100644 --- a/app/code/Magento/Ups/etc/module.xml +++ b/app/code/Magento/Ups/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Ups" setup_version="2.0.0"> </module> </config> diff --git a/app/code/Magento/Ups/registration.php b/app/code/Magento/Ups/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..4093849996e4e502acc10576311bb90544fc085e --- /dev/null +++ b/app/code/Magento/Ups/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Ups', + __DIR__ +); diff --git a/app/code/Magento/Ups/view/adminhtml/layout/adminhtml_system_config_edit.xml b/app/code/Magento/Ups/view/adminhtml/layout/adminhtml_system_config_edit.xml index d9b704465b737b7dd9ad957ff24f53f579b4770d..45623e2f6ce8d854632e17aba4aa5e0372e5cb4e 100644 --- a/app/code/Magento/Ups/view/adminhtml/layout/adminhtml_system_config_edit.xml +++ b/app/code/Magento/Ups/view/adminhtml/layout/adminhtml_system_config_edit.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="js"> <block class="Magento\Ups\Block\Backend\System\CarrierConfig" template="system/shipping/carrier_config.phtml"/> diff --git a/app/code/Magento/Ups/view/frontend/layout/checkout_cart_index.xml b/app/code/Magento/Ups/view/frontend/layout/checkout_cart_index.xml index efd0bde6a03f8c733708316ecb555b45b14548b7..ff721f563879d2162470974d6bc2b9642c9517c7 100644 --- a/app/code/Magento/Ups/view/frontend/layout/checkout_cart_index.xml +++ b/app/code/Magento/Ups/view/frontend/layout/checkout_cart_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout.cart.shipping"> <arguments> diff --git a/app/code/Magento/Ups/view/frontend/layout/checkout_index_index.xml b/app/code/Magento/Ups/view/frontend/layout/checkout_index_index.xml index 50df5c58c00ce7af4c6dc661ad541bcdcad91ad4..6f5a4864345a36a889de1707349605da7cceb7cb 100644 --- a/app/code/Magento/Ups/view/frontend/layout/checkout_index_index.xml +++ b/app/code/Magento/Ups/view/frontend/layout/checkout_index_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout.root"> <arguments> diff --git a/app/code/Magento/UrlRewrite/composer.json b/app/code/Magento/UrlRewrite/composer.json index ecbf9fa43c8c7691ac067ccf6cd67ff6d2708cea..e539a07b2c69e38d63393889340f19bd6a2733c7 100644 --- a/app/code/Magento/UrlRewrite/composer.json +++ b/app/code/Magento/UrlRewrite/composer.json @@ -9,8 +9,7 @@ "magento/module-backend": "1.0.0-beta", "magento/module-catalog-url-rewrite": "1.0.0-beta", "magento/module-cms": "1.0.0-beta", - "magento/module-cms-url-rewrite": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/module-cms-url-rewrite": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -18,12 +17,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/UrlRewrite" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\UrlRewrite\\": "" + } } } diff --git a/app/code/Magento/UrlRewrite/etc/adminhtml/acl.xml b/app/code/Magento/UrlRewrite/etc/adminhtml/acl.xml index 89c9f80c44cddbf09dc1a5e46f83570399e954cb..61cf6d3e6873b14e9e3116a99ad1beb8d63b91f9 100644 --- a/app/code/Magento/UrlRewrite/etc/adminhtml/acl.xml +++ b/app/code/Magento/UrlRewrite/etc/adminhtml/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/app/code/Magento/UrlRewrite/etc/adminhtml/menu.xml b/app/code/Magento/UrlRewrite/etc/adminhtml/menu.xml index eecdeac53f95f928c7c418fb9724a46537ff1cc0..17a614b1c25f4c2ffe8f41cab7878697e9dd6ff9 100644 --- a/app/code/Magento/UrlRewrite/etc/adminhtml/menu.xml +++ b/app/code/Magento/UrlRewrite/etc/adminhtml/menu.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Backend/etc/menu.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd"> <menu> <add id="Magento_UrlRewrite::urlrewrite" title="URL Rewrites" module="Magento_UrlRewrite" sortOrder="20" parent="Magento_Backend::marketing_seo" diff --git a/app/code/Magento/UrlRewrite/etc/adminhtml/routes.xml b/app/code/Magento/UrlRewrite/etc/adminhtml/routes.xml index 848ef0869d9e8e6f095926c1ddfd2e7729b4c103..8a81f4b8e9574fe05555b5f14beead5c07244aea 100644 --- a/app/code/Magento/UrlRewrite/etc/adminhtml/routes.xml +++ b/app/code/Magento/UrlRewrite/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="admin"> <route id="adminhtml"> <module name="Magento_UrlRewrite" before="Magento_Backend" /> diff --git a/app/code/Magento/UrlRewrite/etc/config.xml b/app/code/Magento/UrlRewrite/etc/config.xml index 7ba6a643b33c65fe4e2ec5132108b9d626dab248..00f0b61ab524b753e98b5ff55d930034c1d4cb46 100644 --- a/app/code/Magento/UrlRewrite/etc/config.xml +++ b/app/code/Magento/UrlRewrite/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <url_rewrite> <entity_types> diff --git a/app/code/Magento/UrlRewrite/etc/di.xml b/app/code/Magento/UrlRewrite/etc/di.xml index 44bf482995e8103e9acfde28cf6ef5911ad92cd7..b1be6e53dac1369cb71a8efef62fad709f355780 100644 --- a/app/code/Magento/UrlRewrite/etc/di.xml +++ b/app/code/Magento/UrlRewrite/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\UrlRewrite\Model\StorageInterface" type="Magento\UrlRewrite\Model\Storage\DbStorage"/> <preference for="Magento\UrlRewrite\Model\UrlFinderInterface" type="Magento\UrlRewrite\Model\Storage\DbStorage"/> <preference for="Magento\UrlRewrite\Model\UrlPersistInterface" type="Magento\UrlRewrite\Model\Storage\DbStorage"/> diff --git a/app/code/Magento/UrlRewrite/etc/frontend/di.xml b/app/code/Magento/UrlRewrite/etc/frontend/di.xml index 2c6bca377c84355b11aa1c14990c1d5cae4e4bf5..e210a7fa4f93daaf444e02cff073475b1fc1959e 100644 --- a/app/code/Magento/UrlRewrite/etc/frontend/di.xml +++ b/app/code/Magento/UrlRewrite/etc/frontend/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Framework\App\RouterList"> <arguments> <argument name="routerList" xsi:type="array"> diff --git a/app/code/Magento/UrlRewrite/etc/module.xml b/app/code/Magento/UrlRewrite/etc/module.xml index 5e0c8f0b5d078547513301ba31dff2ad5b0560ca..0d819dbd82066800a4a634d46d20731850178801 100644 --- a/app/code/Magento/UrlRewrite/etc/module.xml +++ b/app/code/Magento/UrlRewrite/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_UrlRewrite" setup_version="2.0.0"> </module> </config> diff --git a/app/code/Magento/UrlRewrite/registration.php b/app/code/Magento/UrlRewrite/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..8a6a136df051f88789eafc614980c50670e1580c --- /dev/null +++ b/app/code/Magento/UrlRewrite/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_UrlRewrite', + __DIR__ +); diff --git a/app/code/Magento/UrlRewrite/view/adminhtml/layout/adminhtml_url_rewrite_index.xml b/app/code/Magento/UrlRewrite/view/adminhtml/layout/adminhtml_url_rewrite_index.xml index e6bbcb863db8382c4f2f68660ce80252cd31a536..994a3eb20215a2e20c72e9c008020761ef64106b 100644 --- a/app/code/Magento/UrlRewrite/view/adminhtml/layout/adminhtml_url_rewrite_index.xml +++ b/app/code/Magento/UrlRewrite/view/adminhtml/layout/adminhtml_url_rewrite_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\UrlRewrite\Block\GridContainer" name="adminhtml.block.url_rewrite.grid.container"> diff --git a/app/code/Magento/User/composer.json b/app/code/Magento/User/composer.json index c5803bec5be66de4b79cfc18de58cebf949412b6..f5d2a7c3c39262b0b44f9ef5dd8df36b4a1e5be7 100644 --- a/app/code/Magento/User/composer.json +++ b/app/code/Magento/User/composer.json @@ -7,8 +7,7 @@ "magento/module-authorization": "1.0.0-beta", "magento/module-backend": "1.0.0-beta", "magento/module-integration": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -16,12 +15,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/User" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\User\\": "" + } } } diff --git a/app/code/Magento/User/etc/acl.xml b/app/code/Magento/User/etc/acl.xml index 261a998abc757e9e2e1f002a2a1a96b57e489a9f..03a14efa959fb1bbee283c4500621b90f0c41c76 100644 --- a/app/code/Magento/User/etc/acl.xml +++ b/app/code/Magento/User/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/app/code/Magento/User/etc/adminhtml/di.xml b/app/code/Magento/User/etc/adminhtml/di.xml index 4278e618075fa3b873af383689163f65378c36e5..339eeb86be6118ed655bdb44084fee3aa254ad7b 100755 --- a/app/code/Magento/User/etc/adminhtml/di.xml +++ b/app/code/Magento/User/etc/adminhtml/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Backend\Model\Auth\Credential\StorageInterface" type="Magento\User\Model\User" /> <type name="Magento\User\Model\Backend\Observer\AuthObserver"> <arguments> diff --git a/app/code/Magento/User/etc/adminhtml/events.xml b/app/code/Magento/User/etc/adminhtml/events.xml index 3bdfe2f33f7e6ae17732feec72e3be5e98158400..fe4042e64a2a80f5533d53263bb2983b42d1d636 100755 --- a/app/code/Magento/User/etc/adminhtml/events.xml +++ b/app/code/Magento/User/etc/adminhtml/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="admin_user_authenticate_after"> <observer name="magento_user" instance="Magento\User\Model\Backend\Observer\AuthObserver" method="adminAuthenticate" /> </event> diff --git a/app/code/Magento/User/etc/adminhtml/menu.xml b/app/code/Magento/User/etc/adminhtml/menu.xml index 9e9d9ded06c0c043162090395c6e50cbb6762c67..a07c1a7b28343023f6b258867eb8ddad1a371d3a 100644 --- a/app/code/Magento/User/etc/adminhtml/menu.xml +++ b/app/code/Magento/User/etc/adminhtml/menu.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Backend/etc/menu.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd"> <menu> <add id="Magento_User::system_acl" title="Permissions" module="Magento_User" sortOrder="60" parent="Magento_Backend::system" resource="Magento_User::acl"/> <add id="Magento_User::system_acl_users" title="All Users" module="Magento_User" sortOrder="10" parent="Magento_User::system_acl" action="adminhtml/user" resource="Magento_User::acl_users"/> diff --git a/app/code/Magento/User/etc/adminhtml/routes.xml b/app/code/Magento/User/etc/adminhtml/routes.xml index 7e6d84d7f15bd49bafc637b2b998e5b3336249e1..e7af6686c8882533a06d09a102ab91a978a4b3cb 100644 --- a/app/code/Magento/User/etc/adminhtml/routes.xml +++ b/app/code/Magento/User/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn: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/etc/adminhtml/system.xml b/app/code/Magento/User/etc/adminhtml/system.xml index 8fecae6a8f95b938fef25e046600f2d8f330e762..e909e386ebc3aa23574719c68d683d65a82b2c94 100644 --- a/app/code/Magento/User/etc/adminhtml/system.xml +++ b/app/code/Magento/User/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="admin"> <group id="emails"> diff --git a/app/code/Magento/User/etc/config.xml b/app/code/Magento/User/etc/config.xml index d8736de1b56ecc3d04ce18abafbfa30eb075896e..8cd6fce664677edb4746edb1c08ae2d84cedf7f9 100644 --- a/app/code/Magento/User/etc/config.xml +++ b/app/code/Magento/User/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <admin> <emails> diff --git a/app/code/Magento/User/etc/di.xml b/app/code/Magento/User/etc/di.xml index 1973befe228e65126102eff7a899f010d904797a..7faba5d4025cc1b96d732858514ff709c3f8e87f 100644 --- a/app/code/Magento/User/etc/di.xml +++ b/app/code/Magento/User/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\User\Model\Resource\User"> <arguments> <argument name="aclCache" xsi:type="object">Magento\Framework\Acl\Cache\Proxy</argument> diff --git a/app/code/Magento/User/etc/email_templates.xml b/app/code/Magento/User/etc/email_templates.xml index b6b5e239c63e91ea65a339637d71bff398500ff8..5511894c4df50b05077dfa1865bf68ddba68b1f1 100644 --- a/app/code/Magento/User/etc/email_templates.xml +++ b/app/code/Magento/User/etc/email_templates.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Email/etc/email_templates.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Email:etc/email_templates.xsd"> <template id="admin_emails_forgot_email_template" label="Forgot Admin Password" file="password_reset_confirmation.html" type="text" module="Magento_User" area="adminhtml"/> <template id="admin_emails_reset_password_template" label="Reset Password" file="password_reset.html" type="text" module="Magento_User" area="adminhtml"/> </config> diff --git a/app/code/Magento/User/etc/module.xml b/app/code/Magento/User/etc/module.xml index 8bb2b470ccf553f51f260f94097338440af5a64b..f1f8867ca86507398bbac9a89a717a771927d6c9 100644 --- a/app/code/Magento/User/etc/module.xml +++ b/app/code/Magento/User/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_User" setup_version="2.0.1"> <sequence> <module name="Magento_Backend"/> diff --git a/app/code/Magento/User/etc/webapi_rest/di.xml b/app/code/Magento/User/etc/webapi_rest/di.xml index 811eecf946ec68954d563963c8f2bd0b7c53af43..440487538508caf8a5195e6a85e3864a8837abb1 100644 --- a/app/code/Magento/User/etc/webapi_rest/di.xml +++ b/app/code/Magento/User/etc/webapi_rest/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Authorization\Model\CompositeUserContext"> <arguments> <argument name="userContexts" xsi:type="array"> diff --git a/app/code/Magento/User/registration.php b/app/code/Magento/User/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..b05166ceea58b090e65da42de30d7d292059e45d --- /dev/null +++ b/app/code/Magento/User/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_User', + __DIR__ +); diff --git a/app/code/Magento/User/view/adminhtml/layout/adminhtml_auth_forgotpassword.xml b/app/code/Magento/User/view/adminhtml/layout/adminhtml_auth_forgotpassword.xml index c9b4dcf6eab108018b0b15c096fd2a86a909b7fa..c875c1f9b7536a006749552ef387e8336b0db06b 100644 --- a/app/code/Magento/User/view/adminhtml/layout/adminhtml_auth_forgotpassword.xml +++ b/app/code/Magento/User/view/adminhtml/layout/adminhtml_auth_forgotpassword.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="admin_login" /> <body> <referenceContainer name="login.content"> diff --git a/app/code/Magento/User/view/adminhtml/layout/adminhtml_auth_login.xml b/app/code/Magento/User/view/adminhtml/layout/adminhtml_auth_login.xml index 22496d0f0ce27deb6e6c391f995aa48fdd45b2dc..404bd4b35c3986993669faeba4325d8454efceab 100644 --- a/app/code/Magento/User/view/adminhtml/layout/adminhtml_auth_login.xml +++ b/app/code/Magento/User/view/adminhtml/layout/adminhtml_auth_login.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="form.buttons"> <block class="Magento\Backend\Block\Template" name="adminhtml_auth_login_forgotpassword" template="Magento_User::admin/forgotpassword_url.phtml"/> diff --git a/app/code/Magento/User/view/adminhtml/layout/adminhtml_auth_resetpassword.xml b/app/code/Magento/User/view/adminhtml/layout/adminhtml_auth_resetpassword.xml index 5c13d12f6b207ef9032f83089a7329458c4f0d10..3b0773d1f741abe77d4cd12f35df7abe8473530b 100644 --- a/app/code/Magento/User/view/adminhtml/layout/adminhtml_auth_resetpassword.xml +++ b/app/code/Magento/User/view/adminhtml/layout/adminhtml_auth_resetpassword.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="admin_login" /> <body> <referenceContainer name="login.content"> diff --git a/app/code/Magento/User/view/adminhtml/layout/adminhtml_locks_block.xml b/app/code/Magento/User/view/adminhtml/layout/adminhtml_locks_block.xml index 2098d0a7e77603a83177bb26373ae413da9b3ef1..abfc5273167801f155c99e00493579cea77eb488 100644 --- a/app/code/Magento/User/view/adminhtml/layout/adminhtml_locks_block.xml +++ b/app/code/Magento/User/view/adminhtml/layout/adminhtml_locks_block.xml @@ -5,7 +5,8 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="user.locks.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.block.locks.grid" as="grid"> diff --git a/app/code/Magento/User/view/adminhtml/layout/adminhtml_locks_grid.xml b/app/code/Magento/User/view/adminhtml/layout/adminhtml_locks_grid.xml index bce6ee8a55c66396831bb7401fd286aecca48711..2ee4ce1234f5293ff865c8f940fcbea2e833d3e0 100644 --- a/app/code/Magento/User/view/adminhtml/layout/adminhtml_locks_grid.xml +++ b/app/code/Magento/User/view/adminhtml/layout/adminhtml_locks_grid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <update handle="formkey"/> <update handle="adminhtml_locks_block"/> <container name="root"> diff --git a/app/code/Magento/User/view/adminhtml/layout/adminhtml_locks_index.xml b/app/code/Magento/User/view/adminhtml/layout/adminhtml_locks_index.xml index ac9e34a19610d3c86d5193d50ba966f39f7507bc..1b1a5ab273fe2ac1cac45bd821dfa099ce013a34 100644 --- a/app/code/Magento/User/view/adminhtml/layout/adminhtml_locks_index.xml +++ b/app/code/Magento/User/view/adminhtml/layout/adminhtml_locks_index.xml @@ -5,7 +5,8 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="formkey"/> <update handle="adminhtml_locks_block"/> <body> diff --git a/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_edit.xml b/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_edit.xml index e80abebec2f919bc1ec6e17fc8ab9e54c82fab5b..27d8997e63f9d65743c4b4a9c3f1228f366420ff 100644 --- a/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_edit.xml +++ b/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_edit.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="left"> <block class="Magento\User\Block\User\Edit\Tabs" name="adminhtml.user.edit.tabs"/> 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 abeafdcfa6a958a0d6f96a8edec6c9f4f68573b9..3a88a2aa8ebc914871fc9f4aae220fcbc6acfe35 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 @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="adminhtml.user.grid.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.user.grid" as="grid"> diff --git a/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_index.xml b/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_index.xml index c2b2557fe68b46a89e970ad6368ba9993df60121..2868d1e501c2d1be5fbe7c3907910a6538ca1958 100644 --- a/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_index.xml +++ b/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="adminhtml_user_grid_block"/> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_role_editrole.xml b/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_role_editrole.xml index 089f4639065d2ddf0a122bb8ab66677035ca2f86..00ef96643f5ba753729f5ac7e5d63688e4c74e18 100644 --- a/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_role_editrole.xml +++ b/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_role_editrole.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="left"> <block class="Magento\User\Block\Role\Edit" name="adminhtml.user.editroles"> diff --git a/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_role_editrolegrid.xml b/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_role_editrolegrid.xml index adc2bb6b945d7b0d34ce624672e571508a3b8c35..7eacbcffb452f37653b77e738c44a148a7e60bd9 100644 --- a/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_role_editrolegrid.xml +++ b/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_role_editrolegrid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root" label="Root"> <block class="Magento\User\Block\Role\Grid\User" name="adminhtml.user.role.grid.user"/> </container> 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 90ac1bfe1339b4c715392bd8db9159eac2fd1417..18b13dc49cd33d4b85f1038fb791d1f0d87b3b6a 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 @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="adminhtml.user.role.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.role.grid" as="grid"> diff --git a/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_role_index.xml b/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_role_index.xml index f875473c90316c54362fb87bf6f7f9b83c9291f2..d4f704b70c7ddc52db899b2de5c8f148321d404c 100644 --- a/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_role_index.xml +++ b/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_role_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="formkey"/> <update handle="adminhtml_user_role_grid_block"/> <body> diff --git a/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_role_rolegrid.xml b/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_role_rolegrid.xml index 8e580630060b660271c381c90623cef4e5a7c21b..770f0b473b1cc7fd7cdbb5ef332b7df8eb96781a 100644 --- a/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_role_rolegrid.xml +++ b/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_role_rolegrid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <update handle="formkey"/> <update handle="adminhtml_user_role_grid_block"/> <container name="root"> diff --git a/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_rolegrid.xml b/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_rolegrid.xml index 74fd5d97312d97cf5aadd4389d78dbd01270c5cb..bad24e9a00349a7ea31e1f46f71c049804c657f9 100644 --- a/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_rolegrid.xml +++ b/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_rolegrid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <update handle="formkey"/> <update handle="adminhtml_user_grid_block"/> <container name="root"> diff --git a/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_rolesgrid.xml b/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_rolesgrid.xml index c56e526e03ef09fb4b7be06dc04c9d8268bd4106..cf1fc7f6786c076173f0bc5b8deb8846dcfe0c9d 100644 --- a/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_rolesgrid.xml +++ b/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_rolesgrid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root" label="Root"> <block class="Magento\User\Block\User\Edit\Tab\Roles" name="adminhtml.user.rolesgrid"/> </container> diff --git a/app/code/Magento/Usps/composer.json b/app/code/Magento/Usps/composer.json index 2942add5853205a5be23275fc48f65718357bedb..3cde9c1796e55177c71d8a291291e23700024a41 100644 --- a/app/code/Magento/Usps/composer.json +++ b/app/code/Magento/Usps/composer.json @@ -12,8 +12,7 @@ "magento/module-quote": "1.0.0-beta", "magento/module-config": "1.0.0-beta", "magento/framework": "1.0.0-beta", - "lib-libxml": "*", - "magento/magento-composer-installer": "*" + "lib-libxml": "*" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -21,12 +20,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Usps" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Usps\\": "" + } } } diff --git a/app/code/Magento/Usps/etc/adminhtml/di.xml b/app/code/Magento/Usps/etc/adminhtml/di.xml index ea1b92fc003f270207043ff1625a1753d31c6e19..adfc60158925199019d97881523590908cd04afd 100644 --- a/app/code/Magento/Usps/etc/adminhtml/di.xml +++ b/app/code/Magento/Usps/etc/adminhtml/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Rma\Block\Adminhtml\Rma\Edit\Tab\General\Shipping\Packaging"> <arguments> <argument name="sourceSizeModel" xsi:type="object">Magento\Usps\Model\Source\Size</argument> diff --git a/app/code/Magento/Usps/etc/adminhtml/system.xml b/app/code/Magento/Usps/etc/adminhtml/system.xml index f7e98060dac19c121b760522f6fd97c506877c88..f856eb1ca4eaf1083e2dac424c9e6abb473c8b7a 100644 --- a/app/code/Magento/Usps/etc/adminhtml/system.xml +++ b/app/code/Magento/Usps/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="carriers"> <group id="usps" translate="label" type="text" sortOrder="110" showInDefault="1" showInWebsite="1" showInStore="1"> diff --git a/app/code/Magento/Usps/etc/config.xml b/app/code/Magento/Usps/etc/config.xml index 972c58188197743a4a1791eed981dafaea4b953c..ee1a691560dbac98d12d198c7747da1377d37c95 100644 --- a/app/code/Magento/Usps/etc/config.xml +++ b/app/code/Magento/Usps/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <carriers> <usps> diff --git a/app/code/Magento/Usps/etc/module.xml b/app/code/Magento/Usps/etc/module.xml index 8cd9e5a58b74ee611325a925e6eed2ed97b3d2c0..1a91916c578a6799cf244691685b755902b89fe2 100644 --- a/app/code/Magento/Usps/etc/module.xml +++ b/app/code/Magento/Usps/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Usps" setup_version="2.0.0"> </module> </config> diff --git a/app/code/Magento/Usps/registration.php b/app/code/Magento/Usps/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..7125a0bce83fe2f203a542502f32bc78862d4536 --- /dev/null +++ b/app/code/Magento/Usps/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Usps', + __DIR__ +); diff --git a/app/code/Magento/Usps/view/frontend/layout/checkout_cart_index.xml b/app/code/Magento/Usps/view/frontend/layout/checkout_cart_index.xml index 5fad98dea8d889590b41df88467a226f76c413b6..83148d67da2ba875cc0c21b4b548a269bd33c568 100644 --- a/app/code/Magento/Usps/view/frontend/layout/checkout_cart_index.xml +++ b/app/code/Magento/Usps/view/frontend/layout/checkout_cart_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout.cart.shipping"> <arguments> diff --git a/app/code/Magento/Usps/view/frontend/layout/checkout_index_index.xml b/app/code/Magento/Usps/view/frontend/layout/checkout_index_index.xml index ed6d123a6e4dfc7c7f443a2339a0f5cbfbac3d2f..f3fe611cd1a9778e5264e602d86ee92bc9a61142 100644 --- a/app/code/Magento/Usps/view/frontend/layout/checkout_index_index.xml +++ b/app/code/Magento/Usps/view/frontend/layout/checkout_index_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout.root"> <arguments> diff --git a/app/code/Magento/Variable/composer.json b/app/code/Magento/Variable/composer.json index 9fb62e545a03d4aafb6c63e889fa5a1a09cf739d..c0543d01623a4f261d9db5e34c532b4bb3c106f4 100644 --- a/app/code/Magento/Variable/composer.json +++ b/app/code/Magento/Variable/composer.json @@ -6,8 +6,7 @@ "magento/module-backend": "1.0.0-beta", "magento/module-email": "1.0.0-beta", "magento/module-store": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -15,12 +14,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Variable" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Variable\\": "" + } } } diff --git a/app/code/Magento/Variable/etc/acl.xml b/app/code/Magento/Variable/etc/acl.xml index adc3685950ebed3719ae5b8d1823fc78e95857ed..145f32d0eb66a76d5bc46e0ad613cd81243bedc7 100644 --- a/app/code/Magento/Variable/etc/acl.xml +++ b/app/code/Magento/Variable/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/app/code/Magento/Variable/etc/adminhtml/menu.xml b/app/code/Magento/Variable/etc/adminhtml/menu.xml index 3ceb558f73a2120e062f9bd03d929578c80691c9..1b455c7d218d8fd43f1f1941e37fa1518aa81fdb 100644 --- a/app/code/Magento/Variable/etc/adminhtml/menu.xml +++ b/app/code/Magento/Variable/etc/adminhtml/menu.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Backend/etc/menu.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd"> <menu> <add id="Magento_Variable::system_variable" title="Custom Variables" module="Magento_Variable" sortOrder="20" parent="Magento_Backend::system_other_settings" action="adminhtml/system_variable" resource="Magento_Variable::variable"/> </menu> diff --git a/app/code/Magento/Variable/etc/adminhtml/routes.xml b/app/code/Magento/Variable/etc/adminhtml/routes.xml index 2dc0ac5d5c552f759023d7e0e567bb5ad4257083..99116667f372a898675bad509e0d5ceae41f492d 100644 --- a/app/code/Magento/Variable/etc/adminhtml/routes.xml +++ b/app/code/Magento/Variable/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="admin"> <route id="adminhtml"> <module name="Magento_Variable" before="Magento_Backend" /> diff --git a/app/code/Magento/Variable/etc/module.xml b/app/code/Magento/Variable/etc/module.xml index 6fc2c021fdc88abe5d883ff57e313b683284ca73..0be19dd4e34dc34d0ce8271de9e111ee2b70abd6 100644 --- a/app/code/Magento/Variable/etc/module.xml +++ b/app/code/Magento/Variable/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Variable" setup_version="2.0.0"> </module> </config> diff --git a/app/code/Magento/Variable/registration.php b/app/code/Magento/Variable/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..ad9d49341068dcaaa26ac5c8d8628a2f54db7de9 --- /dev/null +++ b/app/code/Magento/Variable/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Variable', + __DIR__ +); diff --git a/app/code/Magento/Variable/view/adminhtml/layout/adminhtml_system_variable_edit.xml b/app/code/Magento/Variable/view/adminhtml/layout/adminhtml_system_variable_edit.xml index d677a25648cbfa0cf205eacb331abddba3e1c2f7..aec5cc59817392514a83152363d79790198885d1 100644 --- a/app/code/Magento/Variable/view/adminhtml/layout/adminhtml_system_variable_edit.xml +++ b/app/code/Magento/Variable/view/adminhtml/layout/adminhtml_system_variable_edit.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="page.main.actions"> <block class="Magento\Backend\Block\Store\Switcher" name="store_switcher"/> diff --git a/app/code/Magento/Variable/view/adminhtml/layout/adminhtml_system_variable_grid_block.xml b/app/code/Magento/Variable/view/adminhtml/layout/adminhtml_system_variable_grid_block.xml index fded167aba1843c4715f50144c4b89408bfe9d88..4140dd0eaf95d81c801f26edd501e6a16c133027 100644 --- a/app/code/Magento/Variable/view/adminhtml/layout/adminhtml_system_variable_grid_block.xml +++ b/app/code/Magento/Variable/view/adminhtml/layout/adminhtml_system_variable_grid_block.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="adminhtml.system.variable.grid.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.system.variable.grid" as="grid"> diff --git a/app/code/Magento/Variable/view/adminhtml/layout/adminhtml_system_variable_index.xml b/app/code/Magento/Variable/view/adminhtml/layout/adminhtml_system_variable_index.xml index f56ffdeedb3e30f3580dc013277f9e9ebed59005..22b34dad0824f6b88dfb19ce0b3223651eb692b1 100644 --- a/app/code/Magento/Variable/view/adminhtml/layout/adminhtml_system_variable_index.xml +++ b/app/code/Magento/Variable/view/adminhtml/layout/adminhtml_system_variable_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="adminhtml_system_variable_grid_block"/> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/Version/composer.json b/app/code/Magento/Version/composer.json index c2419707c2d1b8a03cd1e5cbaa5e01832e8c26b8..af26a9d835f2092cabf8785639d931d8948f392a 100644 --- a/app/code/Magento/Version/composer.json +++ b/app/code/Magento/Version/composer.json @@ -3,8 +3,7 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0|~7.0.0", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -12,12 +11,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Version" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Version\\": "" + } } } diff --git a/app/code/Magento/Version/etc/frontend/routes.xml b/app/code/Magento/Version/etc/frontend/routes.xml index f9a5753198040d1704bdcc920a6e345a327bd7c1..36ec0ed721100ca9e802611bcbc137779bdda872 100644 --- a/app/code/Magento/Version/etc/frontend/routes.xml +++ b/app/code/Magento/Version/etc/frontend/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="standard"> <route id="magento_version" frontName="magento_version"> <module name="Magento_Version" /> diff --git a/app/code/Magento/Version/etc/module.xml b/app/code/Magento/Version/etc/module.xml index 688f7349711f939ab7ce09d7031f4f6ab76d7346..86ba06b67f2b68d3b953ed8a9df7153c45940c26 100644 --- a/app/code/Magento/Version/etc/module.xml +++ b/app/code/Magento/Version/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Version" setup_version="2.0.0"> </module> </config> diff --git a/app/code/Magento/Version/registration.php b/app/code/Magento/Version/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..8350c459844125113dab4e0e433d814ca99296ac --- /dev/null +++ b/app/code/Magento/Version/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Version', + __DIR__ +); diff --git a/app/code/Magento/Webapi/Controller/PathProcessor.php b/app/code/Magento/Webapi/Controller/PathProcessor.php index 6142cebf5536910133eede9a4f1b9a3feb7f48e2..78eaec1b71066c17fe3c2b6a0281b7b733aad0b6 100644 --- a/app/code/Magento/Webapi/Controller/PathProcessor.php +++ b/app/code/Magento/Webapi/Controller/PathProcessor.php @@ -10,9 +10,10 @@ use Magento\Framework\Exception\NoSuchEntityException; class PathProcessor { - /** - * @var \Magento\Store\Model\StoreManagerInterface - */ + /** Store code alias to indicate that all stores should be affected by action */ + const ALL_STORE_CODE = 'all'; + + /** @var \Magento\Store\Model\StoreManagerInterface */ private $storeManager; /** @@ -52,6 +53,9 @@ class PathProcessor if (isset($stores[$storeCode])) { $this->storeManager->setCurrentStore($storeCode); $path = '/' . (isset($pathParts[1]) ? $pathParts[1] : ''); + } else if ($storeCode === self::ALL_STORE_CODE) { + $this->storeManager->setCurrentStore(\Magento\Store\Model\Store::ADMIN_CODE); + $path = '/' . (isset($pathParts[1]) ? $pathParts[1] : ''); } else { $path = '/' . implode('/', $pathParts); } diff --git a/app/code/Magento/Webapi/Controller/Rest.php b/app/code/Magento/Webapi/Controller/Rest.php index fec22c852698b1dcfb0e01f940c67f25f700b7a4..ad6e85eb6ec5747405d205d5c73c026c6850d649 100644 --- a/app/code/Magento/Webapi/Controller/Rest.php +++ b/app/code/Magento/Webapi/Controller/Rest.php @@ -14,9 +14,12 @@ use Magento\Framework\Webapi\ServiceOutputProcessor; use Magento\Framework\Webapi\Rest\Request as RestRequest; use Magento\Framework\Webapi\Rest\Response as RestResponse; use Magento\Framework\Webapi\Rest\Response\FieldsFilter; +use Magento\Store\Model\Store; +use Magento\Store\Model\StoreManagerInterface; use Magento\Webapi\Controller\Rest\ParamsOverrider; use Magento\Webapi\Controller\Rest\Router; use Magento\Webapi\Controller\Rest\Router\Route; +use Magento\Webapi\Model\Rest\Swagger\Generator; /** * Front controller for WebAPI REST area. @@ -28,91 +31,60 @@ use Magento\Webapi\Controller\Rest\Router\Route; */ class Rest implements \Magento\Framework\App\FrontControllerInterface { - /** - * Path for accessing REST API schema - */ + /** Path for accessing REST API schema */ const SCHEMA_PATH = '/schema'; - /** - * @var Router - */ + /** @var Router */ protected $_router; - /** - * @var Route - */ + /** @var Route */ protected $_route; - /** - * @var RestRequest - */ + /** @var RestRequest */ protected $_request; - /** - * @var RestResponse - */ + /** @var RestResponse */ protected $_response; - /** - * @var \Magento\Framework\ObjectManagerInterface - */ + /** @var \Magento\Framework\ObjectManagerInterface */ protected $_objectManager; - /** - * @var \Magento\Framework\App\State - */ + /** @var \Magento\Framework\App\State */ protected $_appState; - /** - * @var AuthorizationInterface - */ + /** @var AuthorizationInterface */ protected $_authorization; - /** - * @var ServiceInputProcessor - */ + /** @var ServiceInputProcessor */ protected $serviceInputProcessor; - /** - * @var ErrorProcessor - */ + /** @var ErrorProcessor */ protected $_errorProcessor; - /** - * @var PathProcessor - */ + /** @var PathProcessor */ protected $_pathProcessor; - /** - * @var \Magento\Framework\App\AreaList - */ + /** @var \Magento\Framework\App\AreaList */ protected $areaList; - /** - * @var FieldsFilter - */ + /** @var FieldsFilter */ protected $fieldsFilter; - /** - * @var \Magento\Framework\Session\Generic - */ + /** @var \Magento\Framework\Session\Generic */ protected $session; - /** - * @var ParamsOverrider - */ + /** @var ParamsOverrider */ protected $paramsOverrider; - /** - * @var ServiceOutputProcessor $serviceOutputProcessor - */ + /** @var ServiceOutputProcessor $serviceOutputProcessor */ protected $serviceOutputProcessor; - /** - * @var \Magento\Webapi\Model\Rest\Swagger\Generator - */ + /** @var Generator */ protected $swaggerGenerator; + /** @var StoreManagerInterface */ + private $storeManager; + /** * Initialize dependencies * @@ -129,7 +101,8 @@ class Rest implements \Magento\Framework\App\FrontControllerInterface * @param FieldsFilter $fieldsFilter * @param ParamsOverrider $paramsOverrider * @param ServiceOutputProcessor $serviceOutputProcessor - * @param \Magento\Webapi\Model\Rest\Swagger\Generator $swaggerGenerator, + * @param Generator $swaggerGenerator , + * @param StoreManagerInterface $storeManager * * TODO: Consider removal of warning suppression * @SuppressWarnings(PHPMD.ExcessiveParameterList) @@ -148,7 +121,8 @@ class Rest implements \Magento\Framework\App\FrontControllerInterface FieldsFilter $fieldsFilter, ParamsOverrider $paramsOverrider, ServiceOutputProcessor $serviceOutputProcessor, - \Magento\Webapi\Model\Rest\Swagger\Generator $swaggerGenerator + Generator $swaggerGenerator, + StoreManagerInterface $storeManager ) { $this->_router = $router; $this->_request = $request; @@ -164,6 +138,7 @@ class Rest implements \Magento\Framework\App\FrontControllerInterface $this->paramsOverrider = $paramsOverrider; $this->serviceOutputProcessor = $serviceOutputProcessor; $this->swaggerGenerator = $swaggerGenerator; + $this->storeManager = $storeManager; } /** @@ -277,13 +252,10 @@ class Rest implements \Magento\Framework\App\FrontControllerInterface */ protected function processApiRequest() { - $this->checkPermissions(); - $route = $this->getCurrentRoute(); - if ($route->isSecure() && !$this->_request->isSecure()) { - throw new \Magento\Framework\Webapi\Exception(__('Operation allowed only in HTTPS')); - } + $this->validateRequest(); /** @var array $inputData */ $inputData = $this->_request->getRequestData(); + $route = $this->getCurrentRoute(); $serviceMethodName = $route->getServiceMethod(); $serviceClassName = $route->getServiceClass(); $inputData = $this->paramsOverrider->override($inputData, $route->getParameters()); @@ -301,4 +273,24 @@ class Rest implements \Magento\Framework\App\FrontControllerInterface } $this->_response->prepareResponse($outputData); } + + /** + * Validate request + * + * @throws AuthorizationException + * @throws \Magento\Framework\Webapi\Exception + * @return void + */ + protected function validateRequest() + { + $this->checkPermissions(); + if ($this->getCurrentRoute()->isSecure() && !$this->_request->isSecure()) { + throw new \Magento\Framework\Webapi\Exception(__('Operation allowed only in HTTPS')); + } + if ($this->storeManager->getStore()->getCode() === Store::ADMIN_CODE + && strtoupper($this->_request->getMethod()) === RestRequest::HTTP_METHOD_GET + ) { + throw new \Magento\Framework\Webapi\Exception(__('Cannot perform GET operation with store code \'all\'')); + } + } } diff --git a/app/code/Magento/Webapi/Model/Config/SchemaLocator.php b/app/code/Magento/Webapi/Model/Config/SchemaLocator.php index 9144e585d648ff1dd79964922e07e5a0e910b702..1a0ccb6e5d42eea0afbe1de9793bd491dc0de919 100644 --- a/app/code/Magento/Webapi/Model/Config/SchemaLocator.php +++ b/app/code/Magento/Webapi/Model/Config/SchemaLocator.php @@ -5,6 +5,8 @@ */ namespace Magento\Webapi\Model\Config; +use Magento\Framework\Module\Dir; + /** * Web API config schema locator. */ @@ -29,7 +31,7 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface */ public function __construct(\Magento\Framework\Module\Dir\Reader $moduleReader) { - $this->_schema = $moduleReader->getModuleDir('etc', 'Magento_Webapi') . '/webapi.xsd'; + $this->_schema = $moduleReader->getModuleDir(Dir::MODULE_ETC_DIR, 'Magento_Webapi') . '/webapi.xsd'; } /** diff --git a/app/code/Magento/Webapi/Model/Soap/Config.php b/app/code/Magento/Webapi/Model/Soap/Config.php index 5fca8bf5d654a40e6603607a9d53559a1c466b38..d3fa8b4bb0247d44ae1dcba472fcaba67b1b1ec4 100644 --- a/app/code/Magento/Webapi/Model/Soap/Config.php +++ b/app/code/Magento/Webapi/Model/Soap/Config.php @@ -5,8 +5,6 @@ */ namespace Magento\Webapi\Model\Soap; -use Magento\Framework\App\Filesystem\DirectoryList; -use Magento\Framework\Filesystem\Directory\ReadInterface; use Magento\Webapi\Model\ServiceMetadata; /** @@ -16,9 +14,6 @@ use Magento\Webapi\Model\ServiceMetadata; */ class Config { - /** @var ReadInterface */ - protected $modulesDirectory; - /** @var \Magento\Framework\ObjectManagerInterface */ protected $objectManager; @@ -39,17 +34,14 @@ class Config * Initialize dependencies. * * @param \Magento\Framework\ObjectManagerInterface $objectManager - * @param \Magento\Framework\Filesystem $filesystem * @param \Magento\Framework\Registry $registry * @param \Magento\Webapi\Model\ServiceMetadata $serviceMetadata */ public function __construct( \Magento\Framework\ObjectManagerInterface $objectManager, - \Magento\Framework\Filesystem $filesystem, \Magento\Framework\Registry $registry, \Magento\Webapi\Model\ServiceMetadata $serviceMetadata ) { - $this->modulesDirectory = $filesystem->getDirectoryRead(DirectoryList::MODULES); $this->objectManager = $objectManager; $this->registry = $registry; $this->serviceMetadata = $serviceMetadata; diff --git a/app/code/Magento/Webapi/Test/Unit/Controller/PathProcessorTest.php b/app/code/Magento/Webapi/Test/Unit/Controller/PathProcessorTest.php new file mode 100644 index 0000000000000000000000000000000000000000..9acbb53441d2df6199c67c02a4678722ed6c6f36 --- /dev/null +++ b/app/code/Magento/Webapi/Test/Unit/Controller/PathProcessorTest.php @@ -0,0 +1,63 @@ +<?php +/*** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Webapi\Test\Unit\Controller; + +use Magento\Store\Model\Store; + +class PathProcessorTest extends \PHPUnit_Framework_TestCase +{ + /** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Store\Model\StoreManagerInterface */ + private $storeManagerMock; + + /** @var \Magento\Webapi\Controller\PathProcessor */ + private $model; + + /** @var string */ + private $arbitraryStoreCode = 'myStoreCode'; + + /** @var string */ + private $endpointPath = '/V1/path/of/endpoint'; + + public function setUp() + { + $this->storeManagerMock = $this->getMockBuilder('Magento\Store\Model\StoreManagerInterface') + ->disableOriginalConstructor() + ->getMock(); + $this->storeManagerMock->expects($this->once()) + ->method('getStores') + ->willReturn([$this->arbitraryStoreCode => 'store object', 'default' => 'default store object']); + $this->model = new \Magento\Webapi\Controller\PathProcessor($this->storeManagerMock); + } + + /** + * @dataProvider processPathDataProvider + * + * @param string $storeCodeInPath + * @param string $storeCodeSet + * @param int $setCurrentStoreCallCtr + */ + public function testAllStoreCode($storeCodeInPath, $storeCodeSet, $setCurrentStoreCallCtr = 1) + { + $storeCodeInPath = !$storeCodeInPath ?: '/' . $storeCodeInPath; // add leading slash if store code not empty + $inPath = 'rest' . $storeCodeInPath . $this->endpointPath; + $this->storeManagerMock->expects($this->exactly($setCurrentStoreCallCtr)) + ->method('setCurrentStore') + ->with($storeCodeSet); + $result = $this->model->process($inPath); + $this->assertSame($this->endpointPath, $result); + } + + public function processPathDataProvider() + { + return [ + 'All store code' => ['all', Store::ADMIN_CODE], + 'Default store code' => ['', 'default', 0], + 'Arbitrary store code' => [$this->arbitraryStoreCode, $this->arbitraryStoreCode], + 'Explicit default store code' => ['default', 'default'] + ]; + } +} diff --git a/app/code/Magento/Webapi/Test/Unit/Controller/RestTest.php b/app/code/Magento/Webapi/Test/Unit/Controller/RestTest.php index 3ab85ce88f5210149151e14ea36a5425295b5869..bb2d538a5b73e89b877516ac64dec60a2e028db1 100644 --- a/app/code/Magento/Webapi/Test/Unit/Controller/RestTest.php +++ b/app/code/Magento/Webapi/Test/Unit/Controller/RestTest.php @@ -64,6 +64,12 @@ class RestTest extends \PHPUnit_Framework_TestCase */ protected $swaggerGeneratorMock; + /** @var \Magento\Store\Model\StoreManagerInterface | \PHPUnit_Framework_MockObject_MockObject */ + private $storeManagerMock; + + /** @var \Magento\Store\Api\Data\StoreInterface | \PHPUnit_Framework_MockObject_MockObject*/ + private $storeMock; + const SERVICE_METHOD = 'testMethod'; const SERVICE_ID = 'Magento\Webapi\Controller\TestService'; @@ -73,8 +79,8 @@ class RestTest extends \PHPUnit_Framework_TestCase $this->_requestMock = $this->getMockBuilder('Magento\Framework\Webapi\Rest\Request') ->setMethods( [ - 'isSecure', 'getRequestData', 'getParams', 'getParam', - 'getRequestedServices', 'getPathInfo', 'getHttpHost', + 'isSecure', 'getRequestData', 'getParams', 'getParam', 'getRequestedServices', 'getPathInfo', + 'getHttpHost', 'getMethod', ] )->disableOriginalConstructor()->getMock(); $this->_requestMock->expects($this->any()) @@ -114,6 +120,10 @@ class RestTest extends \PHPUnit_Framework_TestCase $areaListMock = $this->getMock('\Magento\Framework\App\AreaList', [], [], '', false); $areaMock = $this->getMock('Magento\Framework\App\AreaInterface'); $areaListMock->expects($this->any())->method('getArea')->will($this->returnValue($areaMock)); + $this->storeMock = $this->getMock('\Magento\Store\Api\Data\StoreInterface'); + $this->storeManagerMock = $this->getMock('\Magento\Store\Model\StoreManagerInterface'); + $this->storeManagerMock->expects($this->any())->method('getStore')->willReturn($this->storeMock); + /** Init SUT. */ $this->_restController = $objectManager->getObject('Magento\Webapi\Controller\Rest', @@ -130,7 +140,8 @@ class RestTest extends \PHPUnit_Framework_TestCase 'areaList' => $areaListMock, 'paramsOverrider' => $paramsOverriderMock, 'dataObjectProcessor' => $dataObjectProcessorMock, - 'swaggerGenerator' => $this->swaggerGeneratorMock + 'swaggerGenerator' => $this->swaggerGeneratorMock, + 'storeManager' => $this->storeManagerMock ] ); // Set default expectations used by all tests @@ -145,6 +156,7 @@ class RestTest extends \PHPUnit_Framework_TestCase ->with(self::SERVICE_ID, self::SERVICE_METHOD) ->will($this->returnValue('null')); $paramsOverriderMock->expects($this->any())->method('overrideParams')->will($this->returnValue([])); + parent::setUp(); } @@ -266,6 +278,22 @@ class RestTest extends \PHPUnit_Framework_TestCase $exceptionArray = $this->_responseMock->getException(); $this->assertEquals($expectedMsg, $exceptionArray[0]->getMessage()); } + + public function testGetMethodAllStoresInvalid() + { + $this->_routeMock->expects($this->any())->method('getAclResources')->will($this->returnValue(['1'])); + $this->_authorizationMock->expects($this->any())->method('isAllowed')->will($this->returnValue(true)); + $this->storeMock->expects($this->once())->method('getCode')->willReturn('admin'); + $this->_requestMock->expects($this->once())->method('getMethod')->willReturn('get'); + + $this->_restController->dispatch($this->_requestMock); + + $this->assertTrue($this->_responseMock->isException()); + $this->assertSame( + "Cannot perform GET operation with store code 'all'", + $this->_responseMock->getException()[0]->getMessage() + ); + } } class TestService diff --git a/app/code/Magento/Webapi/Test/Unit/Model/Config/_files/webapi.xml b/app/code/Magento/Webapi/Test/Unit/Model/Config/_files/webapi.xml index 2c42d9c8e6aeb65f4b8b61a7d0ab0a0350679d21..fa13caba8306a4235810e86d5b663b43d468e8d9 100644 --- a/app/code/Magento/Webapi/Test/Unit/Model/Config/_files/webapi.xml +++ b/app/code/Magento/Webapi/Test/Unit/Model/Config/_files/webapi.xml @@ -6,7 +6,7 @@ */ --> <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../../app/code/Magento/Webapi/etc/webapi.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd"> <route url="/V1/customers/me" method="GET"> <service class="Magento\Customer\Api\CustomerRepositoryInterface" method="getById" /> <resources> diff --git a/app/code/Magento/Webapi/Test/Unit/Model/Soap/ConfigTest.php b/app/code/Magento/Webapi/Test/Unit/Model/Soap/ConfigTest.php index ce79ee5e85be6effdf9233c5c54bb8ac280a0bba..3cc9aa706e7879797456011e22e63109c355ea39 100644 --- a/app/code/Magento/Webapi/Test/Unit/Model/Soap/ConfigTest.php +++ b/app/code/Magento/Webapi/Test/Unit/Model/Soap/ConfigTest.php @@ -34,9 +34,6 @@ class ConfigTest extends \PHPUnit_Framework_TestCase 'Magento\Framework\App\ObjectManager' )->disableOriginalConstructor()->getMock(); - $fileSystemMock = $this->getMockBuilder('Magento\Framework\Filesystem') - ->disableOriginalConstructor() - ->getMock(); $classReflection = $this->getMock( 'Magento\Webapi\Model\Config\ClassReflector', ['reflectClassMethods'], @@ -112,7 +109,6 @@ class ConfigTest extends \PHPUnit_Framework_TestCase 'Magento\Webapi\Model\Soap\Config', [ 'objectManager' => $objectManagerMock, - 'filesystem' => $fileSystemMock, 'registry' => $registryMock, 'serviceMetadata' => $serviceMetadata, ] diff --git a/app/code/Magento/Webapi/Test/Unit/Model/_files/acl.xml b/app/code/Magento/Webapi/Test/Unit/Model/_files/acl.xml index 7becb38d8fb70a9bbba20e17495ac6931212b3d1..f6858884676114668e9d5fbdd52cf6e58b397056 100644 --- a/app/code/Magento/Webapi/Test/Unit/Model/_files/acl.xml +++ b/app/code/Magento/Webapi/Test/Unit/Model/_files/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Webapi::all"> diff --git a/app/code/Magento/Webapi/composer.json b/app/code/Magento/Webapi/composer.json index 011aef8c48a683be051f404f3713abd7bc6e9e1b..6442c3186c00bd04e1ebe8bf7c909e956fdbf28b 100644 --- a/app/code/Magento/Webapi/composer.json +++ b/app/code/Magento/Webapi/composer.json @@ -7,8 +7,7 @@ "magento/module-authorization": "1.0.0-beta", "magento/module-integration": "1.0.0-beta", "magento/module-backend": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "suggest": { "magento/module-user": "1.0.0-beta" @@ -19,12 +18,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Webapi" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Webapi\\": "" + } } } diff --git a/app/code/Magento/Webapi/etc/adminhtml/system.xml b/app/code/Magento/Webapi/etc/adminhtml/system.xml index 12671fe2ba7793f4c17a7fd970d573b56c7c223f..2cb737b0956adec4cf68085e7f96279a7e11157e 100644 --- a/app/code/Magento/Webapi/etc/adminhtml/system.xml +++ b/app/code/Magento/Webapi/etc/adminhtml/system.xml @@ -7,7 +7,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="webapi" translate="label" type="text" sortOrder="102" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Magento Web API</label> diff --git a/app/code/Magento/Webapi/etc/cache.xml b/app/code/Magento/Webapi/etc/cache.xml index 89563f1c5d34c7bd5b60917c0e23695c451d65e5..f1b854a0a7b89c7b001469c68a3375c1407ec0dc 100644 --- a/app/code/Magento/Webapi/etc/cache.xml +++ b/app/code/Magento/Webapi/etc/cache.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Cache/etc/cache.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Cache/etc/cache.xsd"> <type name="config_webservice" translate="label,description" instance="Magento\Framework\App\Cache\Type\Webapi"> <label>Web Services Configuration</label> <description>REST and SOAP configurations, generated WSDL file.</description> diff --git a/app/code/Magento/Webapi/etc/di.xml b/app/code/Magento/Webapi/etc/di.xml index 593ef6427082d1d149c84a4d761567e28a7594e4..107507bfc1a6a382762ea24aefacebe1dc459ccb 100644 --- a/app/code/Magento/Webapi/etc/di.xml +++ b/app/code/Magento/Webapi/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Framework\App\AreaList"> <arguments> <argument name="areas" xsi:type="array"> diff --git a/app/code/Magento/Webapi/etc/frontend/routes.xml b/app/code/Magento/Webapi/etc/frontend/routes.xml index 36ba7b8d88ae52ca1acb40d5db0a25dfbd1b100e..f15e145a78ef3abe67c3e1924cb8cdcccc7acd8a 100644 --- a/app/code/Magento/Webapi/etc/frontend/routes.xml +++ b/app/code/Magento/Webapi/etc/frontend/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="standard"> <route id="api" frontName="api"> <module name="Magento_Webapi" /> diff --git a/app/code/Magento/Webapi/etc/module.xml b/app/code/Magento/Webapi/etc/module.xml index 8c2bea029aa1e377584bd572af05d01bab529c58..72775bec0ff047ecb9ae9f09a099ef0aaa84c783 100644 --- a/app/code/Magento/Webapi/etc/module.xml +++ b/app/code/Magento/Webapi/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Webapi" setup_version="2.0.0"> <sequence> <module name="Magento_Store"/> diff --git a/app/code/Magento/Webapi/etc/webapi_rest/di.xml b/app/code/Magento/Webapi/etc/webapi_rest/di.xml index 5e409281a9c666a4fb1608e538e3575f3589543e..9bf71ecf0925096e10603491ee9a27be514d91dd 100644 --- a/app/code/Magento/Webapi/etc/webapi_rest/di.xml +++ b/app/code/Magento/Webapi/etc/webapi_rest/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Authorization\Model\UserContextInterface" type="Magento\Authorization\Model\CompositeUserContext"/> <type name="Magento\Webapi\Model\Authorization\OauthUserContext"> <arguments> diff --git a/app/code/Magento/Webapi/etc/webapi_soap/di.xml b/app/code/Magento/Webapi/etc/webapi_soap/di.xml index c8cabfba0ac2529cb3365da99ae129086bee75fe..eb65155deb3488e8b7dda8160539b1bade50ad57 100644 --- a/app/code/Magento/Webapi/etc/webapi_soap/di.xml +++ b/app/code/Magento/Webapi/etc/webapi_soap/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Authorization\Model\UserContextInterface" type="Magento\Authorization\Model\CompositeUserContext"/> <type name="Magento\Webapi\Model\Authorization\OauthUserContext"> <arguments> diff --git a/app/code/Magento/Webapi/registration.php b/app/code/Magento/Webapi/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..41f7965c1c275141f9c402769828fb69b2b01024 --- /dev/null +++ b/app/code/Magento/Webapi/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Webapi', + __DIR__ +); diff --git a/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_integration_edit.xml b/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_integration_edit.xml index 0229c7f939919654bb768846b7cbb608b90b6b20..15650c1407e7ca9cbc7876e243dd071a7d9fc352 100644 --- a/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_integration_edit.xml +++ b/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_integration_edit.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="editor"/> <body> <referenceBlock name="integration_edit_tabs"> diff --git a/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_integration_permissionsdialog.xml b/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_integration_permissionsdialog.xml index a314c0da39f26adf5d4bc8680c65999d558707c6..70b8dc301d9db1652e42accb36e0707aebad1013 100644 --- a/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_integration_permissionsdialog.xml +++ b/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_integration_permissionsdialog.xml @@ -7,7 +7,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="integration.activate.permissions.tabs"> <block class="Magento\Integration\Block\Adminhtml\Integration\Activate\Permissions\Tab\Webapi" name="integration_activate_permissions_tabs_webapi" template="Magento_Integration::integration/activate/permissions/tab/webapi.phtml"/> diff --git a/app/code/Magento/Weee/Model/Tax.php b/app/code/Magento/Weee/Model/Tax.php index 046edb7e166b29600c6ce9eaed06258c4cb20156..8d51045a88eab1befe4fe749fb67ecd9727376b2 100644 --- a/app/code/Magento/Weee/Model/Tax.php +++ b/app/code/Magento/Weee/Model/Tax.php @@ -226,11 +226,12 @@ class Tax extends \Magento\Framework\Model\AbstractModel /** @var \Magento\Tax\Model\Calculation $calculator */ $calculator = $this->_calculationFactory->create(); + $customerId = $this->_customerSession->getCustomerId(); if ($shipping && $shipping->getCountryId()) { $customerTaxClass = $shipping->getQuote()->getCustomerTaxClassId(); } else { // if customer logged use it default shipping and billing address - if ($customerId = $this->_customerSession->getCustomerId()) { + if ($customerId) { $shipping = $this->accountManagement->getDefaultShippingAddress($customerId); $billing = $this->accountManagement->getDefaultBillingAddress($customerId); $customerTaxClass = null; @@ -251,7 +252,8 @@ class Tax extends \Magento\Framework\Model\AbstractModel $shipping, $billing, $customerTaxClass, - $store + $store, + $customerId ); $defaultRateRequest = $calculator->getDefaultRateRequest($store); diff --git a/app/code/Magento/Weee/Observer/GetPriceConfigurationObserver.php b/app/code/Magento/Weee/Observer/GetPriceConfigurationObserver.php index b27951e653735123f299b70389998268a13c33fb..96effbb8545bfb5b54ec2fffa3e15481afd871c8 100644 --- a/app/code/Magento/Weee/Observer/GetPriceConfigurationObserver.php +++ b/app/code/Magento/Weee/Observer/GetPriceConfigurationObserver.php @@ -53,20 +53,13 @@ class GetPriceConfigurationObserver implements ObserverInterface if ($this->weeeData->isEnabled()) { $priceConfigObj = $observer->getData('configObj'); try { + /** @var \Magento\Catalog\Model\Product $product */ $product = $this->registry->registry('current_product'); - $weeeAttributes = $this->weeeData->getWeeeAttributesForBundle($product); - - $calcPrice = 'finalPrice'; - if ($this->taxData->priceIncludesTax() && - $this->taxData->displayPriceExcludingTax() - ) { - $calcPrice = 'basePrice'; - } $priceConfig = $this->recurConfigAndInsertWeeePrice( $priceConfigObj->getConfig(), 'prices', - $calcPrice, + $this->getWhichCalcPriceToUse($product->getStoreId()), $weeeAttributes ); $priceConfigObj->setConfig($priceConfig); @@ -78,7 +71,7 @@ class GetPriceConfigurationObserver implements ObserverInterface } /** - * Recur through the config array and insert the weee price + * Recurse through the config array and insert the weee price * * @param array $input * @param string $searchKey @@ -131,10 +124,30 @@ class GetPriceConfigurationObserver implements ObserverInterface ['amount' => (float)$weeeAttribute->getAmount()]; $weeeSum += (float)$weeeAttribute->getAmount(); } - $holder[$key]['weeePrice']['amount'] += (float)$weeeSum; + } else { + //there were no Weee attributes for this option + unset($holder[$key]['weeePrice']); } } return $holder; } + + /** + * Returns which product price to use as a basis for the Weee's final price + * + * @param int|null $storeId + * @return string + */ + protected function getWhichCalcPriceToUse($storeId = null) + { + $calcPrice = 'finalPrice'; + if ($this->weeeData->geDisplayExcl($storeId) || + $this->weeeData->geDisplayExlDescIncl($storeId) || + ($this->taxData->priceIncludesTax() && $this->taxData->displayPriceExcludingTax()) + ) { + $calcPrice = 'basePrice'; + } + return $calcPrice; + } } diff --git a/app/code/Magento/Weee/Observer/UpdateProductOptionsObserver.php b/app/code/Magento/Weee/Observer/UpdateProductOptionsObserver.php index 4d5a7e95916ae7a497da72d705c7ac7b750bc23f..77d022811702a4fb2ab58bb76dc1a4fe760a79dd 100644 --- a/app/code/Magento/Weee/Observer/UpdateProductOptionsObserver.php +++ b/app/code/Magento/Weee/Observer/UpdateProductOptionsObserver.php @@ -19,16 +19,26 @@ class UpdateProductOptionsObserver implements ObserverInterface /** @var \Magento\Framework\Registry */ protected $registry; + /** + * Tax data + * + * @var \Magento\Tax\Helper\Data + */ + protected $taxData; + /** * @param \Magento\Framework\Registry $registry * @param \Magento\Weee\Helper\Data $weeeData + * @param \Magento\Tax\Helper\Data $taxData */ public function __construct( \Magento\Framework\Registry $registry, - \Magento\Weee\Helper\Data $weeeData + \Magento\Weee\Helper\Data $weeeData, + \Magento\Tax\Helper\Data $taxData ) { $this->weeeData = $weeeData; $this->registry = $registry; + $this->taxData = $taxData; } /** @@ -56,9 +66,10 @@ class UpdateProductOptionsObserver implements ObserverInterface // only do processing on bundle product if ($product->getTypeId() == \Magento\Catalog\Model\Product\Type::TYPE_BUNDLE) { if (!array_key_exists('optionTemplate', $options)) { + $calcPrice = $this->getWhichCalcPriceToUse($product->getStoreId()); $options['optionTemplate'] = '<%- data.label %>' - . '<% if (data.finalPrice.value) { %>' - . ' +<%- data.finalPrice.formatted %>' + . '<% if (data.' . $calcPrice . '.value) { %>' + . ' +<%- data.' . $calcPrice . '.formatted %>' . '<% } %>'; } @@ -68,7 +79,7 @@ class UpdateProductOptionsObserver implements ObserverInterface $options['optionTemplate'] .= sprintf( ' <%% if (data.weeePrice' . $weeeAttribute->getCode() . ') { %%>' . ' (' . $weeeAttribute->getName() - . ':<%%= data.weeePrice' . $weeeAttribute->getCode() + . ': <%%- data.weeePrice' . $weeeAttribute->getCode() . '.formatted %%>)' . '<%% } %%>' ); @@ -79,7 +90,7 @@ class UpdateProductOptionsObserver implements ObserverInterface if ($this->weeeData->geDisplayExlDescIncl($product->getStoreId())) { $options['optionTemplate'] .= sprintf( ' <%% if (data.weeePrice) { %%>' - . '<%%= data.weeePrice.formatted %%>' + . '<%%- data.weeePrice.formatted %%>' . '<%% } %%>' ); } @@ -89,4 +100,22 @@ class UpdateProductOptionsObserver implements ObserverInterface $response->setAdditionalOptions($options); return $this; } + + /** + * Returns which product price to use as a basis for the Weee's final price + * + * @param int|null $storeId + * @return string + */ + protected function getWhichCalcPriceToUse($storeId = null) + { + $calcPrice = 'finalPrice'; + if ($this->weeeData->geDisplayExcl($storeId) || + $this->weeeData->geDisplayExlDescIncl($storeId) || + ($this->taxData->priceIncludesTax() && $this->taxData->displayPriceExcludingTax()) + ) { + $calcPrice = 'basePrice'; + } + return $calcPrice; + } } diff --git a/app/code/Magento/Weee/Test/Unit/Model/TaxTest.php b/app/code/Magento/Weee/Test/Unit/Model/TaxTest.php index d8c94339b2550c0d5fafdb48349f29032729f08d..55c1171a515fcad4eb350a975e046ae0f5be1a8f 100644 --- a/app/code/Magento/Weee/Test/Unit/Model/TaxTest.php +++ b/app/code/Magento/Weee/Test/Unit/Model/TaxTest.php @@ -110,7 +110,17 @@ class TaxTest extends \PHPUnit_Framework_TestCase $this->calculationFactory = $this->getMock($className, ['create'], [], '', false); $className = '\Magento\Customer\Model\Session'; - $this->customerSession = $this->getMock($className, [], [], '', false); + $this->customerSession = $this->getMock( + $className, + ['getCustomerId', 'getDefaultTaxShippingAddress', 'getDefaultTaxBillingAddress', 'getCustomerTaxClassId'], + [], + '', + false + ); + $this->customerSession->expects($this->any())->method('getCustomerId')->willReturn(null); + $this->customerSession->expects($this->any())->method('getDefaultTaxShippingAddress')->willReturn(null); + $this->customerSession->expects($this->any())->method('getDefaultTaxBillingAddress')->willReturn(null); + $this->customerSession->expects($this->any())->method('getCustomerTaxClassId')->willReturn(null); $className = '\Magento\Customer\Api\AccountManagementInterface'; $this->accountManagement = $this->getMock($className, [], [], '', false); @@ -165,11 +175,9 @@ class TaxTest extends \PHPUnit_Framework_TestCase $calculation->expects($this->once()) ->method('getRateRequest') ->willReturn($obj); - $calculation->expects($this->once()) ->method('getDefaultRateRequest') ->willReturn($obj); - $calculation->expects($this->any()) ->method('getRate') ->willReturn('10'); @@ -178,10 +186,6 @@ class TaxTest extends \PHPUnit_Framework_TestCase ->method('getAttributeCodesByFrontendType') ->willReturn(['0'=>'fpt']); - $website->expects($this->any()) - ->method('getId') - ->willReturn(1); - $store->expects($this->any()) ->method('getId') ->willReturn(1); @@ -190,6 +194,9 @@ class TaxTest extends \PHPUnit_Framework_TestCase ->method('getId') ->willReturn(1); + $website->expects($this->any()) + ->method('getId') + ->willReturn(1); $website->expects($this->any()) ->method('getDefaultGroup') ->willReturn($group); diff --git a/app/code/Magento/Weee/Test/Unit/Observer/GetPriceConfigurationObserverTest.php b/app/code/Magento/Weee/Test/Unit/Observer/GetPriceConfigurationObserverTest.php index 467577cc5245bd823771c01e084e147b26c1345e..ca33e2eca6cccef3af3af69a1e8c41f53d5c4d53 100644 --- a/app/code/Magento/Weee/Test/Unit/Observer/GetPriceConfigurationObserverTest.php +++ b/app/code/Magento/Weee/Test/Unit/Observer/GetPriceConfigurationObserverTest.php @@ -51,14 +51,22 @@ class GetPriceConfigurationObserverTest extends \PHPUnit_Framework_TestCase $productInstance=$this->getMock('\Magento\Catalog\Model\Product\Type\Simple', [], [], '', false); - $product=$this->getMock('\Magento\Bundle\Model\Product\Type', ['getTypeInstance', 'getTypeId'], [], '', false); + $product=$this->getMock( + '\Magento\Bundle\Model\Product\Type', + ['getTypeInstance', 'getTypeId', 'getStoreId'], + [], + '', + false + ); $product->expects($this->any()) ->method('getTypeInstance') ->will($this->returnValue($productInstance)); - $product->expects($this->any()) ->method('getTypeId') ->will($this->returnValue('simple')); + $product->expects($this->any()) + ->method('getStoreId') + ->will($this->returnValue(null)); $registry=$this->getMock('Magento\Framework\Registry', [], [], '', false); $registry->expects($this->any()) @@ -69,8 +77,8 @@ class GetPriceConfigurationObserverTest extends \PHPUnit_Framework_TestCase $weeeHelper->expects($this->any()) ->method('getWeeeAttributesForBundle') ->will($this->returnValue([ - 1=> ['fpt1' => $weeeObject1], - 2 =>[ + 1 => ['fpt1' => $weeeObject1], + 2 => [ 'fpt1'=>$weeeObject1, 'fpt2'=> $weeeObject2 ] diff --git a/app/code/Magento/Weee/Test/Unit/Observer/UpdateProductOptionsObserverTest.php b/app/code/Magento/Weee/Test/Unit/Observer/UpdateProductOptionsObserverTest.php index 436fcb9df917b7ce6f48aca54003f92c2d583967..8725a62d837be15e68989b1fb1eab050ab0f4968 100644 --- a/app/code/Magento/Weee/Test/Unit/Observer/UpdateProductOptionsObserverTest.php +++ b/app/code/Magento/Weee/Test/Unit/Observer/UpdateProductOptionsObserverTest.php @@ -12,13 +12,15 @@ class UpdateProductOptionsObserverTest extends \PHPUnit_Framework_TestCase { /** * Tests the methods that rely on the ScopeConfigInterface object to provide their return values + * + * @param array $testArray The initial array that specifies the set of additional options + * @param bool $weeeEnabled Whether the Weee module is assumed to be enabled + * @param bool $weeeDisplayExclDescIncl Is this Weee display setting assumed to be set + * @param array $expectedArray The revised array of the additional options + * * @dataProvider updateProductOptionsProvider - * @param array $testArray - * @param bool $weeeDisplay - * @param bool $weeeEnabled - * @param array $expectedArray */ - public function testUpdateProductOptions($testArray, $weeeDisplay, $weeeEnabled, $expectedArray) + public function testUpdateProductOptions($testArray, $weeeEnabled, $weeeDisplayExclDescIncl, $expectedArray) { $configObj = new \Magento\Framework\DataObject( [ @@ -36,7 +38,7 @@ class UpdateProductOptionsObserverTest extends \PHPUnit_Framework_TestCase $weeeObject2 = new \Magento\Framework\DataObject( [ 'code' => 'fpt2', - 'amount' => '15.0000', + 'amount' => '7.0000', ] ); @@ -44,11 +46,9 @@ class UpdateProductOptionsObserverTest extends \PHPUnit_Framework_TestCase $weeeHelper->expects($this->any()) ->method('isEnabled') ->will($this->returnValue($weeeEnabled)); - $weeeHelper->expects($this->any()) ->method('geDisplayExlDescIncl') - ->will($this->returnValue($weeeDisplay)); - + ->will($this->returnValue($weeeDisplayExclDescIncl)); $weeeHelper->expects($this->any()) ->method('getWeeeAttributesForBundle') ->will($this->returnValue([['fpt1' => $weeeObject1], ['fpt1'=>$weeeObject1, 'fpt2'=>$weeeObject2]])); @@ -63,17 +63,10 @@ class UpdateProductOptionsObserverTest extends \PHPUnit_Framework_TestCase ->method('getEvent') ->will($this->returnValue($responseObject)); - $product = $this->getMock( - '\Magento\Bundle\Model\Product\Type', - ['getTypeId', 'getStoreId'], - [], - '', - false - ); + $product = $this->getMock('\Magento\Bundle\Model\Product\Type', ['getTypeId', 'getStoreId'], [], '', false); $product->expects($this->any()) ->method('getStoreId') ->will($this->returnValue(1)); - $product->expects($this->any()) ->method('getTypeId') ->will($this->returnValue('bundle')); @@ -84,7 +77,6 @@ class UpdateProductOptionsObserverTest extends \PHPUnit_Framework_TestCase ->with('current_product') ->will($this->returnValue($product)); - $objectManager = new ObjectManager($this); /** @var \Magento\Weee\Observer\UpdateProductOptionsObserver $weeeObserverObject */ $weeeObserverObject = $objectManager->getObject( @@ -106,51 +98,53 @@ class UpdateProductOptionsObserverTest extends \PHPUnit_Framework_TestCase public function updateProductOptionsProvider() { return [ - [ + 'weee not enabled' => [ 'testArray' => [ 'TOTAL_BASE_CALCULATION' => 'TOTAL_BASE_CALCULATION', 'optionTemplate' => '<%= data.label %><% if (data.basePrice.value) ' - . '{ %> +<%= data.basePrice.formatted %><% } %>', + . '{ %> +<%- data.basePrice.formatted %><% } %>', ], - 'weeeDisplay' => true, - 'weeeEnabled' => false, + 'weeeEnabled' => false, + 'weeeDisplayExclDescIncl' => true, 'expectedArray' => [ 'TOTAL_BASE_CALCULATION' => 'TOTAL_BASE_CALCULATION', 'optionTemplate' => '<%= data.label %><% if (data.basePrice.value) ' - . '{ %> +<%= data.basePrice.formatted %><% } %>', + . '{ %> +<%- data.basePrice.formatted %><% } %>', ], ], - [ + + 'weee enabled, but not displaying ExclDescIncl' => [ 'testArray' => [ 'TOTAL_BASE_CALCULATION' => 'TOTAL_BASE_CALCULATION', 'optionTemplate' => '<%= data.label %><% if (data.basePrice.value) ' - . '{ %> +<%= data.basePrice.formatted %><% } %>', + . '{ %> +<%- data.basePrice.formatted %><% } %>', ], - 'weeeDisplay' => false, - 'weeeEnabled' => true, + 'weeeEnabled' => true, + 'weeeDisplayExclDescIncl' => false, 'expectedArray' => [ 'TOTAL_BASE_CALCULATION' => 'TOTAL_BASE_CALCULATION', 'optionTemplate' => '<%= data.label %><% if (data.basePrice.value) ' - . '{ %> +<%= data.basePrice.formatted %><% } %> <% if (data.weeePricefpt1) ' - . '{ %> (:<%= data.weeePricefpt1.formatted %>)<% } %>' - . ' <% if (data.weeePricefpt2) { %> (:<%= data.weeePricefpt2.formatted %>)<% } %>', + . '{ %> +<%- data.basePrice.formatted %><% } %> <% if (data.weeePricefpt1) ' + . '{ %> (: <%- data.weeePricefpt1.formatted %>)<% } %>' + . ' <% if (data.weeePricefpt2) { %> (: <%- data.weeePricefpt2.formatted %>)<% } %>', ], ], - [ + + 'weee enabled, and display with ExclDescIncl' => [ 'testArray' => [ 'TOTAL_BASE_CALCULATION' => 'TOTAL_BASE_CALCULATION', 'optionTemplate' => '<%= data.label %><% if (data.basePrice.value) ' - . '{ %> +<%= data.basePrice.formatted %><% } %>', + . '{ %> +<%- data.basePrice.formatted %><% } %>', ], - 'weeeDisplay' => true, - 'weeeEnabled' => true, + 'weeeEnabled' => true, + 'weeeDisplayExclDescIncl' => true, 'expectedArray' => [ 'TOTAL_BASE_CALCULATION' => 'TOTAL_BASE_CALCULATION', 'optionTemplate' => '<%= data.label %><% if (data.basePrice.value) ' - . '{ %> +<%= data.basePrice.formatted %><% } %> <% if (data.weeePricefpt1) ' - . '{ %> (:<%= data.weeePricefpt1.formatted %>)<% } %> ' - . '<% if (data.weeePricefpt2) { %> (:<%= data.weeePricefpt2.formatted %>)<% } %> ' - . '<% if (data.weeePrice) { %><%= data.weeePrice.formatted %><% } %>', + . '{ %> +<%- data.basePrice.formatted %><% } %> <% if (data.weeePricefpt1) ' + . '{ %> (: <%- data.weeePricefpt1.formatted %>)<% } %> ' + . '<% if (data.weeePricefpt2) { %> (: <%- data.weeePricefpt2.formatted %>)<% } %> ' + . '<% if (data.weeePrice) { %><%- data.weeePrice.formatted %><% } %>', ], ], ]; diff --git a/app/code/Magento/Weee/composer.json b/app/code/Magento/Weee/composer.json index 6f1566f203264872221a91a3cf661e41f54a6e64..522a2a2fff967b22d094b996620206a7faf9e1a4 100644 --- a/app/code/Magento/Weee/composer.json +++ b/app/code/Magento/Weee/composer.json @@ -14,8 +14,7 @@ "magento/module-page-cache": "1.0.0-beta", "magento/module-quote": "1.0.0-beta", "magento/module-checkout": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -23,12 +22,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Weee" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Weee\\": "" + } } } diff --git a/app/code/Magento/Weee/etc/adminhtml/events.xml b/app/code/Magento/Weee/etc/adminhtml/events.xml index e8fa6630516282443df2f082065ab6c0959d607a..abc20a96a75915690203bf6dbde5f46a7ee620d6 100644 --- a/app/code/Magento/Weee/etc/adminhtml/events.xml +++ b/app/code/Magento/Weee/etc/adminhtml/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="adminhtml_catalog_product_edit_prepare_form"> <observer name="weee" instance="Magento\Weee\Observer\SetWeeeRendererInFormObserver" method="execute" /> </event> diff --git a/app/code/Magento/Weee/etc/adminhtml/system.xml b/app/code/Magento/Weee/etc/adminhtml/system.xml index d1291a38f70fed30a91a2daf8f04ef6d0eda98b7..1172ba5abbc063e1699e98eac4b9780824f9c96a 100644 --- a/app/code/Magento/Weee/etc/adminhtml/system.xml +++ b/app/code/Magento/Weee/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="tax"> <group id="weee" translate="label" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="1"> diff --git a/app/code/Magento/Weee/etc/config.xml b/app/code/Magento/Weee/etc/config.xml index 164097b1280fa003f1c8d62ed9db74efb31ee6cb..6016fda2b07a495fc830eac20d1c2bae9083e07e 100644 --- a/app/code/Magento/Weee/etc/config.xml +++ b/app/code/Magento/Weee/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <sales> <totals_sort> diff --git a/app/code/Magento/Weee/etc/di.xml b/app/code/Magento/Weee/etc/di.xml index 30c23c664979615a7cab6edb56cfdf1ff6c7922e..d89285642f86800bd98b790db068217b1364bfa0 100644 --- a/app/code/Magento/Weee/etc/di.xml +++ b/app/code/Magento/Weee/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Weee\Helper\Data"> <arguments> <argument name="weeeTax" xsi:type="object">Magento\Weee\Model\Tax\Proxy</argument> diff --git a/app/code/Magento/Weee/etc/events.xml b/app/code/Magento/Weee/etc/events.xml index 688e3ff2d83e589754d0000b4491e3ccb6dc5188..8fb0c3e6226f31121cbaed6ea458b8dfab59431c 100644 --- a/app/code/Magento/Weee/etc/events.xml +++ b/app/code/Magento/Weee/etc/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="catalog_entity_attribute_save_before"> <observer name="weee" instance="Magento\Weee\Observer\AssignBackendModelToAttributeObserver" method="execute" /> </event> diff --git a/app/code/Magento/Weee/etc/fieldset.xml b/app/code/Magento/Weee/etc/fieldset.xml index b61556e67589b1781de7ee0bf8414a1cdc85da6d..2243b9d2aeb6ddd4b451e40294c9c86223d019c8 100644 --- a/app/code/Magento/Weee/etc/fieldset.xml +++ b/app/code/Magento/Weee/etc/fieldset.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/DataObject/etc/fieldset.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:framework:DataObject/etc/fieldset.xsd"> <scope id="global"> <fieldset id="quote_convert_item"> <field name="weee_tax_applied"> diff --git a/app/code/Magento/Weee/etc/frontend/di.xml b/app/code/Magento/Weee/etc/frontend/di.xml index c6b2d5df96898faedc268547db4e63592693a28b..32fe6bb603b385882811895fc1419ccd5853d75c 100644 --- a/app/code/Magento/Weee/etc/frontend/di.xml +++ b/app/code/Magento/Weee/etc/frontend/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Checkout\Model\CompositeConfigProvider"> <arguments> <argument name="configProviders" xsi:type="array"> diff --git a/app/code/Magento/Weee/etc/frontend/events.xml b/app/code/Magento/Weee/etc/frontend/events.xml index 8bcefec033e48e2abe07d2f347c35f2b9d6fd359..535266b2e23829da958b895b49e868907737d48d 100644 --- a/app/code/Magento/Weee/etc/frontend/events.xml +++ b/app/code/Magento/Weee/etc/frontend/events.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="customer_data_object_login"> <observer name="customer_weee_logged_in" instance="Magento\Weee\Observer\CustomerLoggedIn" method="execute" /> </event> diff --git a/app/code/Magento/Weee/etc/module.xml b/app/code/Magento/Weee/etc/module.xml index 48f7754d1356e9533b7339da4bcc25102d3f3fb9..00866d87a559706c644fe6ddb7a6737a0cca8565 100644 --- a/app/code/Magento/Weee/etc/module.xml +++ b/app/code/Magento/Weee/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Weee" setup_version="2.0.0"> <sequence> <module name="Magento_Catalog"/> diff --git a/app/code/Magento/Weee/etc/pdf.xml b/app/code/Magento/Weee/etc/pdf.xml index 8be3279047840252d1b237b84aa438b44b5a12f4..1052384db1df887e43c77283a653d27c261231a9 100644 --- a/app/code/Magento/Weee/etc/pdf.xml +++ b/app/code/Magento/Weee/etc/pdf.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Sales/etc/pdf_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Sales:etc/pdf_file.xsd"> <totals> <total name="weee"> <title translate="true">FPT</title> diff --git a/app/code/Magento/Weee/etc/sales.xml b/app/code/Magento/Weee/etc/sales.xml index 586c3588ed7a41f7d1a8867176dde90906f72d17..905c7c10c3bc2afac28b0f115faeff2eb64d89ca 100644 --- a/app/code/Magento/Weee/etc/sales.xml +++ b/app/code/Magento/Weee/etc/sales.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Sales/etc/sales.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Sales:etc/sales.xsd"> <section name="quote"> <group name="totals"> <item name="weee" instance="Magento\Weee\Model\Total\Quote\Weee" sort_order="225"/> diff --git a/app/code/Magento/Weee/etc/webapi_rest/events.xml b/app/code/Magento/Weee/etc/webapi_rest/events.xml index a24d6527050c47b74b04353e262ef2292b20685c..6e8e13ba37ad070807fe9a7a07e95dd1bcc8256e 100644 --- a/app/code/Magento/Weee/etc/webapi_rest/events.xml +++ b/app/code/Magento/Weee/etc/webapi_rest/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="items_additional_data"> <observer name="processTaxData" instance="Magento\Weee\Observer\Total\Webapi\ItemObserver" method="execute" /> </event> diff --git a/app/code/Magento/Weee/etc/webapi_soap/events.xml b/app/code/Magento/Weee/etc/webapi_soap/events.xml index a24d6527050c47b74b04353e262ef2292b20685c..6e8e13ba37ad070807fe9a7a07e95dd1bcc8256e 100644 --- a/app/code/Magento/Weee/etc/webapi_soap/events.xml +++ b/app/code/Magento/Weee/etc/webapi_soap/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="items_additional_data"> <observer name="processTaxData" instance="Magento\Weee\Observer\Total\Webapi\ItemObserver" method="execute" /> </event> diff --git a/app/code/Magento/Weee/registration.php b/app/code/Magento/Weee/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..5dff27bb7eb3ac142642ebe6fb4856866c7b1b13 --- /dev/null +++ b/app/code/Magento/Weee/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Weee', + __DIR__ +); diff --git a/app/code/Magento/Weee/view/adminhtml/layout/sales_creditmemo_item_price.xml b/app/code/Magento/Weee/view/adminhtml/layout/sales_creditmemo_item_price.xml index ba982fc1b9326dc50011050d32263425763ee11f..948ee0b10ce387a0318043bac87e51eb34fb62c8 100644 --- a/app/code/Magento/Weee/view/adminhtml/layout/sales_creditmemo_item_price.xml +++ b/app/code/Magento/Weee/view/adminhtml/layout/sales_creditmemo_item_price.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="creditmemo_items"> <block class="Magento\Weee\Block\Adminhtml\Items\Price\Renderer" name="column_price" template="items/price/unit.phtml" group="column"/> diff --git a/app/code/Magento/Weee/view/adminhtml/layout/sales_invoice_item_price.xml b/app/code/Magento/Weee/view/adminhtml/layout/sales_invoice_item_price.xml index c53aa5528f525282590fbc197227f356bf793fbf..b0f6f8f2851d4beeb8700e3406d87c6a4ed04f61 100644 --- a/app/code/Magento/Weee/view/adminhtml/layout/sales_invoice_item_price.xml +++ b/app/code/Magento/Weee/view/adminhtml/layout/sales_invoice_item_price.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="invoice_items"> <block class="Magento\Weee\Block\Adminhtml\Items\Price\Renderer" name="column_price" template="items/price/unit.phtml" group="column"/> diff --git a/app/code/Magento/Weee/view/adminhtml/layout/sales_order_create_item_price.xml b/app/code/Magento/Weee/view/adminhtml/layout/sales_order_create_item_price.xml index 642705f59981c9c13d4e7c63062a61f7d9964b49..c9c4063f66dae31342917de4a5846a392f4b960c 100644 --- a/app/code/Magento/Weee/view/adminhtml/layout/sales_order_create_item_price.xml +++ b/app/code/Magento/Weee/view/adminhtml/layout/sales_order_create_item_price.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <block class="Magento\Weee\Block\Item\Price\Renderer" name="item_unit_price" template="order/create/items/price/unit.phtml"> <arguments> diff --git a/app/code/Magento/Weee/view/adminhtml/layout/sales_order_creditmemo_new.xml b/app/code/Magento/Weee/view/adminhtml/layout/sales_order_creditmemo_new.xml index e977649a727977190c8a8482dbc20f2f5ded55f7..4aeee18f1f78a5ab85af9283827704a6b9dc4d5d 100644 --- a/app/code/Magento/Weee/view/adminhtml/layout/sales_order_creditmemo_new.xml +++ b/app/code/Magento/Weee/view/adminhtml/layout/sales_order_creditmemo_new.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="creditmemo_totals"> <block class="Magento\Weee\Block\Sales\Order\Totals" name="weee_cm_totals"> diff --git a/app/code/Magento/Weee/view/adminhtml/layout/sales_order_creditmemo_updateqty.xml b/app/code/Magento/Weee/view/adminhtml/layout/sales_order_creditmemo_updateqty.xml index e977649a727977190c8a8482dbc20f2f5ded55f7..4aeee18f1f78a5ab85af9283827704a6b9dc4d5d 100644 --- a/app/code/Magento/Weee/view/adminhtml/layout/sales_order_creditmemo_updateqty.xml +++ b/app/code/Magento/Weee/view/adminhtml/layout/sales_order_creditmemo_updateqty.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="creditmemo_totals"> <block class="Magento\Weee\Block\Sales\Order\Totals" name="weee_cm_totals"> diff --git a/app/code/Magento/Weee/view/adminhtml/layout/sales_order_creditmemo_view.xml b/app/code/Magento/Weee/view/adminhtml/layout/sales_order_creditmemo_view.xml index e977649a727977190c8a8482dbc20f2f5ded55f7..4aeee18f1f78a5ab85af9283827704a6b9dc4d5d 100644 --- a/app/code/Magento/Weee/view/adminhtml/layout/sales_order_creditmemo_view.xml +++ b/app/code/Magento/Weee/view/adminhtml/layout/sales_order_creditmemo_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="creditmemo_totals"> <block class="Magento\Weee\Block\Sales\Order\Totals" name="weee_cm_totals"> diff --git a/app/code/Magento/Weee/view/adminhtml/layout/sales_order_invoice_new.xml b/app/code/Magento/Weee/view/adminhtml/layout/sales_order_invoice_new.xml index d3f11f6703a9bf4d9a079895d16a11a8cb9df6d1..d5700be6680763c54608ec7b58453a170337606d 100644 --- a/app/code/Magento/Weee/view/adminhtml/layout/sales_order_invoice_new.xml +++ b/app/code/Magento/Weee/view/adminhtml/layout/sales_order_invoice_new.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="invoice_totals"> <block class="Magento\Weee\Block\Sales\Order\Totals" name="weee_inv_totals"> diff --git a/app/code/Magento/Weee/view/adminhtml/layout/sales_order_invoice_updateqty.xml b/app/code/Magento/Weee/view/adminhtml/layout/sales_order_invoice_updateqty.xml index d3f11f6703a9bf4d9a079895d16a11a8cb9df6d1..d5700be6680763c54608ec7b58453a170337606d 100644 --- a/app/code/Magento/Weee/view/adminhtml/layout/sales_order_invoice_updateqty.xml +++ b/app/code/Magento/Weee/view/adminhtml/layout/sales_order_invoice_updateqty.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="invoice_totals"> <block class="Magento\Weee\Block\Sales\Order\Totals" name="weee_inv_totals"> diff --git a/app/code/Magento/Weee/view/adminhtml/layout/sales_order_invoice_view.xml b/app/code/Magento/Weee/view/adminhtml/layout/sales_order_invoice_view.xml index d3f11f6703a9bf4d9a079895d16a11a8cb9df6d1..d5700be6680763c54608ec7b58453a170337606d 100644 --- a/app/code/Magento/Weee/view/adminhtml/layout/sales_order_invoice_view.xml +++ b/app/code/Magento/Weee/view/adminhtml/layout/sales_order_invoice_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="invoice_totals"> <block class="Magento\Weee\Block\Sales\Order\Totals" name="weee_inv_totals"> diff --git a/app/code/Magento/Weee/view/adminhtml/layout/sales_order_item_price.xml b/app/code/Magento/Weee/view/adminhtml/layout/sales_order_item_price.xml index 57a37c6e07c9119633ba1e6caa0a3e66c6d2b792..e4c159257f2adfa718ee8df736992484be827c0d 100644 --- a/app/code/Magento/Weee/view/adminhtml/layout/sales_order_item_price.xml +++ b/app/code/Magento/Weee/view/adminhtml/layout/sales_order_item_price.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="order_items"> <block class="Magento\Weee\Block\Adminhtml\Items\Price\Renderer" name="column_price" template="items/price/unit.phtml" group="column"/> diff --git a/app/code/Magento/Weee/view/adminhtml/layout/sales_order_view.xml b/app/code/Magento/Weee/view/adminhtml/layout/sales_order_view.xml index 60540401cec8e978bf9f4fefc2c71dc904ac4c78..83b8e73fc12eed9e0825d4a4879c2c719abf1153 100644 --- a/app/code/Magento/Weee/view/adminhtml/layout/sales_order_view.xml +++ b/app/code/Magento/Weee/view/adminhtml/layout/sales_order_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="order_totals"> <block class="Magento\Weee\Block\Sales\Order\Totals" name="weee_ord_totals"> diff --git a/app/code/Magento/Weee/view/base/layout/catalog_product_prices.xml b/app/code/Magento/Weee/view/base/layout/catalog_product_prices.xml index 073fd52cd2afd1a88fd7d336d058e775f8d44d8b..8943c4d276c339bbdb69c1319315546dae76164b 100644 --- a/app/code/Magento/Weee/view/base/layout/catalog_product_prices.xml +++ b/app/code/Magento/Weee/view/base/layout/catalog_product_prices.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <referenceBlock name="render.product.prices"> <arguments> <argument name="default" xsi:type="array"> diff --git a/app/code/Magento/Weee/view/frontend/layout/checkout_cart_index.xml b/app/code/Magento/Weee/view/frontend/layout/checkout_cart_index.xml index b6d282ab73f36e8e6ff23d792111489fe2bef8a8..a55038f296cfc3966d4199b6716e0cf51a36ef01 100644 --- a/app/code/Magento/Weee/view/frontend/layout/checkout_cart_index.xml +++ b/app/code/Magento/Weee/view/frontend/layout/checkout_cart_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout.cart.totals"> diff --git a/app/code/Magento/Weee/view/frontend/layout/checkout_index_index.xml b/app/code/Magento/Weee/view/frontend/layout/checkout_index_index.xml index 78799c18cc5193b19c6ea61603d46859c7e4a1bf..13e841612ada68b9e2cd5587ed57929ff8686114 100644 --- a/app/code/Magento/Weee/view/frontend/layout/checkout_index_index.xml +++ b/app/code/Magento/Weee/view/frontend/layout/checkout_index_index.xml @@ -6,7 +6,7 @@ */ --> <!-- TODO remove this file as soon as enhanced checkout is implemented --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout.root"> <arguments> diff --git a/app/code/Magento/Weee/view/frontend/layout/checkout_item_price_renderers.xml b/app/code/Magento/Weee/view/frontend/layout/checkout_item_price_renderers.xml index 6bb9c3ed72ac7f587e24d9049b2b4c34868a8442..8646e2cbeff75f65d42a230a425650bffb3fa868 100644 --- a/app/code/Magento/Weee/view/frontend/layout/checkout_item_price_renderers.xml +++ b/app/code/Magento/Weee/view/frontend/layout/checkout_item_price_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <block class="Magento\Weee\Block\Item\Price\Renderer" name="checkout.onepage.review.item.price.unit.excl" template="checkout/onepage/review/item/price/unit_excl_tax.phtml"> <arguments> diff --git a/app/code/Magento/Weee/view/frontend/layout/default.xml b/app/code/Magento/Weee/view/frontend/layout/default.xml index a024d6e563cb581c15476d71430b89f2dd05ea36..44eec0b583d14104b76b334e2395d72d5b2bf778 100644 --- a/app/code/Magento/Weee/view/frontend/layout/default.xml +++ b/app/code/Magento/Weee/view/frontend/layout/default.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body/> </page> diff --git a/app/code/Magento/Weee/view/frontend/layout/sales_email_item_price.xml b/app/code/Magento/Weee/view/frontend/layout/sales_email_item_price.xml index 9fc40b2076b44ce65d85bd71c0b6ed4038db34dd..9478199fce49717811baaf889faf02eafc6ba045 100644 --- a/app/code/Magento/Weee/view/frontend/layout/sales_email_item_price.xml +++ b/app/code/Magento/Weee/view/frontend/layout/sales_email_item_price.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="items"> <block class="Magento\Weee\Block\Item\Price\Renderer" name="item_price" template="email/items/price/row.phtml"> diff --git a/app/code/Magento/Weee/view/frontend/layout/sales_email_order_creditmemo_items.xml b/app/code/Magento/Weee/view/frontend/layout/sales_email_order_creditmemo_items.xml index e977649a727977190c8a8482dbc20f2f5ded55f7..4aeee18f1f78a5ab85af9283827704a6b9dc4d5d 100644 --- a/app/code/Magento/Weee/view/frontend/layout/sales_email_order_creditmemo_items.xml +++ b/app/code/Magento/Weee/view/frontend/layout/sales_email_order_creditmemo_items.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="creditmemo_totals"> <block class="Magento\Weee\Block\Sales\Order\Totals" name="weee_cm_totals"> diff --git a/app/code/Magento/Weee/view/frontend/layout/sales_email_order_invoice_items.xml b/app/code/Magento/Weee/view/frontend/layout/sales_email_order_invoice_items.xml index d3f11f6703a9bf4d9a079895d16a11a8cb9df6d1..d5700be6680763c54608ec7b58453a170337606d 100644 --- a/app/code/Magento/Weee/view/frontend/layout/sales_email_order_invoice_items.xml +++ b/app/code/Magento/Weee/view/frontend/layout/sales_email_order_invoice_items.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="invoice_totals"> <block class="Magento\Weee\Block\Sales\Order\Totals" name="weee_inv_totals"> diff --git a/app/code/Magento/Weee/view/frontend/layout/sales_email_order_items.xml b/app/code/Magento/Weee/view/frontend/layout/sales_email_order_items.xml index 60540401cec8e978bf9f4fefc2c71dc904ac4c78..83b8e73fc12eed9e0825d4a4879c2c719abf1153 100644 --- a/app/code/Magento/Weee/view/frontend/layout/sales_email_order_items.xml +++ b/app/code/Magento/Weee/view/frontend/layout/sales_email_order_items.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="order_totals"> <block class="Magento\Weee\Block\Sales\Order\Totals" name="weee_ord_totals"> diff --git a/app/code/Magento/Weee/view/frontend/layout/sales_guest_creditmemo.xml b/app/code/Magento/Weee/view/frontend/layout/sales_guest_creditmemo.xml index e977649a727977190c8a8482dbc20f2f5ded55f7..4aeee18f1f78a5ab85af9283827704a6b9dc4d5d 100644 --- a/app/code/Magento/Weee/view/frontend/layout/sales_guest_creditmemo.xml +++ b/app/code/Magento/Weee/view/frontend/layout/sales_guest_creditmemo.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="creditmemo_totals"> <block class="Magento\Weee\Block\Sales\Order\Totals" name="weee_cm_totals"> diff --git a/app/code/Magento/Weee/view/frontend/layout/sales_guest_invoice.xml b/app/code/Magento/Weee/view/frontend/layout/sales_guest_invoice.xml index d3f11f6703a9bf4d9a079895d16a11a8cb9df6d1..d5700be6680763c54608ec7b58453a170337606d 100644 --- a/app/code/Magento/Weee/view/frontend/layout/sales_guest_invoice.xml +++ b/app/code/Magento/Weee/view/frontend/layout/sales_guest_invoice.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="invoice_totals"> <block class="Magento\Weee\Block\Sales\Order\Totals" name="weee_inv_totals"> diff --git a/app/code/Magento/Weee/view/frontend/layout/sales_guest_print.xml b/app/code/Magento/Weee/view/frontend/layout/sales_guest_print.xml index 60540401cec8e978bf9f4fefc2c71dc904ac4c78..83b8e73fc12eed9e0825d4a4879c2c719abf1153 100644 --- a/app/code/Magento/Weee/view/frontend/layout/sales_guest_print.xml +++ b/app/code/Magento/Weee/view/frontend/layout/sales_guest_print.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="order_totals"> <block class="Magento\Weee\Block\Sales\Order\Totals" name="weee_ord_totals"> diff --git a/app/code/Magento/Weee/view/frontend/layout/sales_guest_printcreditmemo.xml b/app/code/Magento/Weee/view/frontend/layout/sales_guest_printcreditmemo.xml index e977649a727977190c8a8482dbc20f2f5ded55f7..4aeee18f1f78a5ab85af9283827704a6b9dc4d5d 100644 --- a/app/code/Magento/Weee/view/frontend/layout/sales_guest_printcreditmemo.xml +++ b/app/code/Magento/Weee/view/frontend/layout/sales_guest_printcreditmemo.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="creditmemo_totals"> <block class="Magento\Weee\Block\Sales\Order\Totals" name="weee_cm_totals"> diff --git a/app/code/Magento/Weee/view/frontend/layout/sales_guest_printinvoice.xml b/app/code/Magento/Weee/view/frontend/layout/sales_guest_printinvoice.xml index d3f11f6703a9bf4d9a079895d16a11a8cb9df6d1..d5700be6680763c54608ec7b58453a170337606d 100644 --- a/app/code/Magento/Weee/view/frontend/layout/sales_guest_printinvoice.xml +++ b/app/code/Magento/Weee/view/frontend/layout/sales_guest_printinvoice.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="invoice_totals"> <block class="Magento\Weee\Block\Sales\Order\Totals" name="weee_inv_totals"> diff --git a/app/code/Magento/Weee/view/frontend/layout/sales_guest_view.xml b/app/code/Magento/Weee/view/frontend/layout/sales_guest_view.xml index 60540401cec8e978bf9f4fefc2c71dc904ac4c78..83b8e73fc12eed9e0825d4a4879c2c719abf1153 100644 --- a/app/code/Magento/Weee/view/frontend/layout/sales_guest_view.xml +++ b/app/code/Magento/Weee/view/frontend/layout/sales_guest_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="order_totals"> <block class="Magento\Weee\Block\Sales\Order\Totals" name="weee_ord_totals"> diff --git a/app/code/Magento/Weee/view/frontend/layout/sales_order_creditmemo.xml b/app/code/Magento/Weee/view/frontend/layout/sales_order_creditmemo.xml index e977649a727977190c8a8482dbc20f2f5ded55f7..4aeee18f1f78a5ab85af9283827704a6b9dc4d5d 100644 --- a/app/code/Magento/Weee/view/frontend/layout/sales_order_creditmemo.xml +++ b/app/code/Magento/Weee/view/frontend/layout/sales_order_creditmemo.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="creditmemo_totals"> <block class="Magento\Weee\Block\Sales\Order\Totals" name="weee_cm_totals"> diff --git a/app/code/Magento/Weee/view/frontend/layout/sales_order_invoice.xml b/app/code/Magento/Weee/view/frontend/layout/sales_order_invoice.xml index d3f11f6703a9bf4d9a079895d16a11a8cb9df6d1..d5700be6680763c54608ec7b58453a170337606d 100644 --- a/app/code/Magento/Weee/view/frontend/layout/sales_order_invoice.xml +++ b/app/code/Magento/Weee/view/frontend/layout/sales_order_invoice.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="invoice_totals"> <block class="Magento\Weee\Block\Sales\Order\Totals" name="weee_inv_totals"> diff --git a/app/code/Magento/Weee/view/frontend/layout/sales_order_item_price.xml b/app/code/Magento/Weee/view/frontend/layout/sales_order_item_price.xml index 9db18d64315e2f220e61e51420518a60857ba18e..2f9f94f2685c362da1aa519d119e68ed635c491e 100644 --- a/app/code/Magento/Weee/view/frontend/layout/sales_order_item_price.xml +++ b/app/code/Magento/Weee/view/frontend/layout/sales_order_item_price.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <block class="Magento\Weee\Block\Item\Price\Renderer" name="item_unit_price" template="item/price/unit.phtml"> <arguments> diff --git a/app/code/Magento/Weee/view/frontend/layout/sales_order_print.xml b/app/code/Magento/Weee/view/frontend/layout/sales_order_print.xml index 60540401cec8e978bf9f4fefc2c71dc904ac4c78..83b8e73fc12eed9e0825d4a4879c2c719abf1153 100644 --- a/app/code/Magento/Weee/view/frontend/layout/sales_order_print.xml +++ b/app/code/Magento/Weee/view/frontend/layout/sales_order_print.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="order_totals"> <block class="Magento\Weee\Block\Sales\Order\Totals" name="weee_ord_totals"> diff --git a/app/code/Magento/Weee/view/frontend/layout/sales_order_printcreditmemo.xml b/app/code/Magento/Weee/view/frontend/layout/sales_order_printcreditmemo.xml index e977649a727977190c8a8482dbc20f2f5ded55f7..4aeee18f1f78a5ab85af9283827704a6b9dc4d5d 100644 --- a/app/code/Magento/Weee/view/frontend/layout/sales_order_printcreditmemo.xml +++ b/app/code/Magento/Weee/view/frontend/layout/sales_order_printcreditmemo.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="creditmemo_totals"> <block class="Magento\Weee\Block\Sales\Order\Totals" name="weee_cm_totals"> diff --git a/app/code/Magento/Weee/view/frontend/layout/sales_order_printinvoice.xml b/app/code/Magento/Weee/view/frontend/layout/sales_order_printinvoice.xml index d3f11f6703a9bf4d9a079895d16a11a8cb9df6d1..d5700be6680763c54608ec7b58453a170337606d 100644 --- a/app/code/Magento/Weee/view/frontend/layout/sales_order_printinvoice.xml +++ b/app/code/Magento/Weee/view/frontend/layout/sales_order_printinvoice.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="invoice_totals"> <block class="Magento\Weee\Block\Sales\Order\Totals" name="weee_inv_totals"> diff --git a/app/code/Magento/Weee/view/frontend/layout/sales_order_view.xml b/app/code/Magento/Weee/view/frontend/layout/sales_order_view.xml index 60540401cec8e978bf9f4fefc2c71dc904ac4c78..83b8e73fc12eed9e0825d4a4879c2c719abf1153 100644 --- a/app/code/Magento/Weee/view/frontend/layout/sales_order_view.xml +++ b/app/code/Magento/Weee/view/frontend/layout/sales_order_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="order_totals"> <block class="Magento\Weee\Block\Sales\Order\Totals" name="weee_ord_totals"> diff --git a/app/code/Magento/Widget/Model/Config/FileResolver.php b/app/code/Magento/Widget/Model/Config/FileResolver.php index 5ef017f3cc8d453a38591d31ad424f16d83a9bde..20ac5314aae5578420e6e94d5aab575ff6c3dcd9 100644 --- a/app/code/Magento/Widget/Model/Config/FileResolver.php +++ b/app/code/Magento/Widget/Model/Config/FileResolver.php @@ -7,7 +7,8 @@ */ namespace Magento\Widget\Model\Config; -use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Component\DirSearch; +use Magento\Framework\Component\ComponentRegistrar; class FileResolver implements \Magento\Framework\Config\FileResolverInterface { @@ -19,28 +20,28 @@ class FileResolver implements \Magento\Framework\Config\FileResolverInterface protected $_moduleReader; /** - * @var \Magento\Framework\Filesystem\Directory\ReadInterface + * @var \Magento\Framework\Config\FileIteratorFactory */ - protected $themesDirectory; + protected $iteratorFactory; /** - * @var \Magento\Framework\Config\FileIteratorFactory + * @var DirSearch */ - protected $iteratorFactory; + private $componentDirSearch; /** - * @param \Magento\Framework\Filesystem $filesystem - * @param \Magento\Framework\Module\Dir\Reader $moduleReader - * @param \Magento\Framework\Config\FileIteratorFactory $iteratorFactory + * @param \Magento\Framework\Module\Dir\Reader $moduleReader + * @param \Magento\Framework\Config\FileIteratorFactory $iteratorFactory + * @param DirSearch $componentDirSearch */ public function __construct( - \Magento\Framework\Filesystem $filesystem, \Magento\Framework\Module\Dir\Reader $moduleReader, - \Magento\Framework\Config\FileIteratorFactory $iteratorFactory + \Magento\Framework\Config\FileIteratorFactory $iteratorFactory, + DirSearch $componentDirSearch ) { - $this->themesDirectory = $filesystem->getDirectoryRead(DirectoryList::THEMES); $this->iteratorFactory = $iteratorFactory; $this->_moduleReader = $moduleReader; + $this->componentDirSearch = $componentDirSearch; } /** @@ -53,13 +54,11 @@ class FileResolver implements \Magento\Framework\Config\FileResolverInterface $iterator = $this->_moduleReader->getConfigurationFiles($filename); break; case 'design': - $iterator = $this->iteratorFactory->create( - $this->themesDirectory, - $this->themesDirectory->search('/*/*/etc/' . $filename) - ); + $themePaths = $this->componentDirSearch->collectFiles(ComponentRegistrar::THEME, 'etc/' . $filename); + $iterator = $this->iteratorFactory->create($themePaths); break; default: - $iterator = $this->iteratorFactory->create($this->themesDirectory, []); + $iterator = $this->iteratorFactory->create([]); break; } return $iterator; diff --git a/app/code/Magento/Widget/Model/Config/SchemaLocator.php b/app/code/Magento/Widget/Model/Config/SchemaLocator.php index 5dc380539d65df81cac5bb989021a2579f069d85..2331ac3c121486b9e3ca34ed91fc1f838b1f1664 100644 --- a/app/code/Magento/Widget/Model/Config/SchemaLocator.php +++ b/app/code/Magento/Widget/Model/Config/SchemaLocator.php @@ -7,6 +7,8 @@ */ namespace Magento\Widget\Model\Config; +use Magento\Framework\Module\Dir; + class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface { /** @@ -28,8 +30,9 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface */ public function __construct(\Magento\Framework\Module\Dir\Reader $moduleReader) { - $this->_schema = $moduleReader->getModuleDir('etc', 'Magento_Widget') . '/widget.xsd'; - $this->_perFileSchema = $moduleReader->getModuleDir('etc', 'Magento_Widget') . '/widget_file.xsd'; + $etcDir = $moduleReader->getModuleDir(\Magento\Framework\Module\Dir::MODULE_ETC_DIR, 'Magento_Widget'); + $this->_schema = $etcDir . '/widget.xsd'; + $this->_perFileSchema = $etcDir . '/widget_file.xsd'; } /** diff --git a/app/code/Magento/Widget/Test/Unit/Model/Config/FileResolverTest.php b/app/code/Magento/Widget/Test/Unit/Model/Config/FileResolverTest.php index af2f6d97f7870ae2eec0a1e6de0cb41f1f18d4b5..bc2b642d79909ebddef5e39a16981a7d9939b826 100644 --- a/app/code/Magento/Widget/Test/Unit/Model/Config/FileResolverTest.php +++ b/app/code/Magento/Widget/Test/Unit/Model/Config/FileResolverTest.php @@ -6,10 +6,9 @@ namespace Magento\Widget\Test\Unit\Model\Config; +use Magento\Framework\Component\ComponentRegistrar; use \Magento\Widget\Model\Config\FileResolver; -use Magento\Framework\App\Filesystem\DirectoryList; - class FileResolverTest extends \PHPUnit_Framework_TestCase { /** @@ -18,31 +17,26 @@ class FileResolverTest extends \PHPUnit_Framework_TestCase private $object; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\Module\Dir\Reader|\PHPUnit_Framework_MockObject_MockObject */ - private $themesDir; + private $moduleReader; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\Config\FileIteratorFactory|\PHPUnit_Framework_MockObject_MockObject */ - private $moduleReader; + private $factory; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\Component\DirSearch|\PHPUnit_Framework_MockObject_MockObject */ - private $factory; + private $componentDirSearch; protected function setUp() { - $this->themesDir = $this->getMockForAbstractClass('Magento\Framework\Filesystem\Directory\ReadInterface'); - $filesystem = $this->getMock('Magento\Framework\Filesystem', [], [], '', false); - $filesystem->expects($this->once()) - ->method('getDirectoryRead') - ->with(DirectoryList::THEMES) - ->willReturn($this->themesDir); $this->moduleReader = $this->getMock('Magento\Framework\Module\Dir\Reader', [], [], '', false); $this->factory = $this->getMock('Magento\Framework\Config\FileIteratorFactory', [], [], '', false); - $this->object = new FileResolver($filesystem, $this->moduleReader, $this->factory); + $this->componentDirSearch = $this->getMock('\Magento\Framework\Component\DirSearch', [], [], '', false); + $this->object = new FileResolver($this->moduleReader, $this->factory, $this->componentDirSearch); } public function testGetGlobal() @@ -59,15 +53,18 @@ class FileResolverTest extends \PHPUnit_Framework_TestCase public function testGetDesign() { $expected = new \StdClass(); - $this->themesDir->expects($this->once())->method('search')->with('/*/*/etc/file')->willReturn('test'); - $this->factory->expects($this->once())->method('create')->with($this->themesDir, 'test')->willReturn($expected); + $this->componentDirSearch->expects($this->once()) + ->method('collectFiles') + ->with(ComponentRegistrar::THEME, 'etc/file') + ->will($this->returnValue(['test'])); + $this->factory->expects($this->once())->method('create')->with(['test'])->willReturn($expected); $this->assertSame($expected, $this->object->get('file', 'design')); } public function testGetDefault() { $expected = new \StdClass(); - $this->factory->expects($this->once())->method('create')->with($this->themesDir, [])->willReturn($expected); + $this->factory->expects($this->once())->method('create')->with([])->willReturn($expected); $this->assertSame($expected, $this->object->get('file', 'unknown')); } } diff --git a/app/code/Magento/Widget/Test/Unit/Model/_files/widget.xml b/app/code/Magento/Widget/Test/Unit/Model/_files/widget.xml index 45cd61dd12b159db32c7c3c655c31dfbce20e795..c9920757160e4c1bfc086586dd4c0d9eb3ac20a0 100644 --- a/app/code/Magento/Widget/Test/Unit/Model/_files/widget.xml +++ b/app/code/Magento/Widget/Test/Unit/Model/_files/widget.xml @@ -6,7 +6,7 @@ */ --> <widgets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../app/code/Magento/Widget/etc/widget.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Widget:etc/widget.xsd"> <widget id="sales_widget_guestform" class="Magento\Sales\Block\Widget\Guest\Form" is_email_compatible="true"> <label translate="true">Orders and Returns</label> <description translate="true">Orders and Returns Search Form</description> diff --git a/app/code/Magento/Widget/composer.json b/app/code/Magento/Widget/composer.json index 936d461a2a7f861683f72f12eb013380e05298f8..e828ca94217d89fc7d8743ece591a194f8300e94 100644 --- a/app/code/Magento/Widget/composer.json +++ b/app/code/Magento/Widget/composer.json @@ -10,8 +10,7 @@ "magento/module-email": "1.0.0-beta", "magento/module-theme": "1.0.0-beta", "magento/framework": "1.0.0-beta", - "magento/module-variable": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/module-variable": "1.0.0-beta" }, "type": "magento2-module", "version": "1.0.0-beta", @@ -19,12 +18,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Widget" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Widget\\": "" + } } } diff --git a/app/code/Magento/Widget/etc/acl.xml b/app/code/Magento/Widget/etc/acl.xml index 25ca84c0203c26d007fd0d935608cbcb833b6c76..b87c71763fabb63e6d23f4a8d35e1c7397190f35 100644 --- a/app/code/Magento/Widget/etc/acl.xml +++ b/app/code/Magento/Widget/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/app/code/Magento/Widget/etc/adminhtml/di.xml b/app/code/Magento/Widget/etc/adminhtml/di.xml index 52d47c1c9391e6358a929ddb2c66ad0be61527ed..60b425c3c771a32c1c676f685a7b6fe9f17c7977 100644 --- a/app/code/Magento/Widget/etc/adminhtml/di.xml +++ b/app/code/Magento/Widget/etc/adminhtml/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Widget\Model\Widget\Instance"> <arguments> <argument name="relatedCacheTypes" xsi:type="array"> diff --git a/app/code/Magento/Widget/etc/adminhtml/menu.xml b/app/code/Magento/Widget/etc/adminhtml/menu.xml index 78af84f558039bbb901c7a4b2ad687a6a9002046..0b19d0ceab9d9526e368d23cd71c3d08870c9332 100644 --- a/app/code/Magento/Widget/etc/adminhtml/menu.xml +++ b/app/code/Magento/Widget/etc/adminhtml/menu.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Backend/etc/menu.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd"> <menu> <add id="Magento_Widget::cms_widget_instance" title="Frontend Apps" module="Magento_Widget" sortOrder="50" parent="Magento_Backend::content_elements" action="adminhtml/widget_instance" resource="Magento_Widget::widget_instance"/> </menu> diff --git a/app/code/Magento/Widget/etc/adminhtml/routes.xml b/app/code/Magento/Widget/etc/adminhtml/routes.xml index 4c9134c0803663183be4aecdbee350403b712435..c1122b955b8b2aa060cabfa3a1a23e3505ab59e9 100644 --- a/app/code/Magento/Widget/etc/adminhtml/routes.xml +++ b/app/code/Magento/Widget/etc/adminhtml/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="admin"> <route id="adminhtml"> <module name="Magento_Widget" before="Magento_Backend" /> diff --git a/app/code/Magento/Widget/etc/di.xml b/app/code/Magento/Widget/etc/di.xml index a6fa351baaba7c4300e068866be469389cb17ed9..8bec6e99044f0359118bc1193f6125d407a85095 100644 --- a/app/code/Magento/Widget/etc/di.xml +++ b/app/code/Magento/Widget/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Widget\Model\Config\Reader"> <arguments> <argument name="fileName" xsi:type="string">widget.xml</argument> diff --git a/app/code/Magento/Widget/etc/module.xml b/app/code/Magento/Widget/etc/module.xml index 602d520a715c183e0c23a2c02badab43fcefefaf..ee4760dfad308fbda602caa4d3a793b96ce5e09e 100644 --- a/app/code/Magento/Widget/etc/module.xml +++ b/app/code/Magento/Widget/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Widget" setup_version="2.0.0"> <sequence> <module name="Magento_Cms"/> diff --git a/app/code/Magento/Widget/registration.php b/app/code/Magento/Widget/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..dfac30b3b8cef22b4dc2085a0f364de4ead7683e --- /dev/null +++ b/app/code/Magento/Widget/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Widget', + __DIR__ +); diff --git a/app/code/Magento/Widget/view/adminhtml/layout/adminhtml_widget_index.xml b/app/code/Magento/Widget/view/adminhtml/layout/adminhtml_widget_index.xml index ee3782fa747e9df8fd41fdf48815e209e8b6da18..a9f05a0bdea8763cc7fa508b34591154cd173238 100644 --- a/app/code/Magento/Widget/view/adminhtml/layout/adminhtml_widget_index.xml +++ b/app/code/Magento/Widget/view/adminhtml/layout/adminhtml_widget_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root"> <block class="Magento\Widget\Block\Adminhtml\Widget" name="wysiwyg_widget"/> </container> 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 c786e0479e21f8ca562ee7f3c0f2ebad6d7282c4..39375288e695d9103e08a7bc166ca3840392017e 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 @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="adminhtml.widget.instance.grid.container"> <block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.widget.instance.grid" as="grid"> diff --git a/app/code/Magento/Widget/view/adminhtml/layout/adminhtml_widget_instance_edit.xml b/app/code/Magento/Widget/view/adminhtml/layout/adminhtml_widget_instance_edit.xml index 85e56f73713425f126be4cfddba3951b5d83985b..bd88dbf2632a3999a0fae859f54fe759c6f8f5cc 100644 --- a/app/code/Magento/Widget/view/adminhtml/layout/adminhtml_widget_instance_edit.xml +++ b/app/code/Magento/Widget/view/adminhtml/layout/adminhtml_widget_instance_edit.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <css src="prototype/windows/themes/default.css"/> </head> diff --git a/app/code/Magento/Widget/view/adminhtml/layout/adminhtml_widget_instance_index.xml b/app/code/Magento/Widget/view/adminhtml/layout/adminhtml_widget_instance_index.xml index 5782b9212da0160af5549034c793aaf1bd5e02e8..6c340ac51c8b5a9a7bcd9ae73a8d5566a30ac8e4 100644 --- a/app/code/Magento/Widget/view/adminhtml/layout/adminhtml_widget_instance_index.xml +++ b/app/code/Magento/Widget/view/adminhtml/layout/adminhtml_widget_instance_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="adminhtml_widget_instance_block"/> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/Widget/view/adminhtml/layout/adminhtml_widget_loadoptions.xml b/app/code/Magento/Widget/view/adminhtml/layout/adminhtml_widget_loadoptions.xml index b905ef50282bc06dadaf8a00f07b34529e70f410..ca4af0a080413d2d61e9ce3d38c2c4ca2322c79d 100644 --- a/app/code/Magento/Widget/view/adminhtml/layout/adminhtml_widget_loadoptions.xml +++ b/app/code/Magento/Widget/view/adminhtml/layout/adminhtml_widget_loadoptions.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root"> <block class="Magento\Widget\Block\Adminhtml\Widget\Options" name="wysiwyg_widget.options"/> </container> diff --git a/app/code/Magento/Widget/view/frontend/layout/default.xml b/app/code/Magento/Widget/view/frontend/layout/default.xml index a024d6e563cb581c15476d71430b89f2dd05ea36..44eec0b583d14104b76b334e2395d72d5b2bf778 100644 --- a/app/code/Magento/Widget/view/frontend/layout/default.xml +++ b/app/code/Magento/Widget/view/frontend/layout/default.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body/> </page> diff --git a/app/code/Magento/Widget/view/frontend/layout/print.xml b/app/code/Magento/Widget/view/frontend/layout/print.xml index a024d6e563cb581c15476d71430b89f2dd05ea36..44eec0b583d14104b76b334e2395d72d5b2bf778 100644 --- a/app/code/Magento/Widget/view/frontend/layout/print.xml +++ b/app/code/Magento/Widget/view/frontend/layout/print.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body/> </page> diff --git a/app/code/Magento/Wishlist/Block/Customer/Wishlist.php b/app/code/Magento/Wishlist/Block/Customer/Wishlist.php index 3a5e76a0d7b98483d60e22c48ce718ecf8b0f2dc..9dba10c236f9f3c77d883c3c556a5d14786fc6c2 100644 --- a/app/code/Magento/Wishlist/Block/Customer/Wishlist.php +++ b/app/code/Magento/Wishlist/Block/Customer/Wishlist.php @@ -97,8 +97,6 @@ class Wishlist extends \Magento\Wishlist\Block\AbstractBlock * * @param null|array $optionCfg * @return $this - * - * @deprecated after 1.6.2.0 */ public function setOptionsRenderCfgs($optionCfg) { @@ -109,7 +107,6 @@ class Wishlist extends \Magento\Wishlist\Block\AbstractBlock /** * Returns all options render configurations * - * @deprecated after 1.6.2.0 * @return array */ public function getOptionsRenderCfgs() @@ -124,8 +121,6 @@ class Wishlist extends \Magento\Wishlist\Block\AbstractBlock * @param string $helperName * @param null|string $template * @return $this - * - * @deprecated after 1.6.2.0 */ public function addOptionsRenderCfg($productType, $helperName, $template = null) { @@ -138,8 +133,6 @@ class Wishlist extends \Magento\Wishlist\Block\AbstractBlock * * @param string $productType * @return array|null - * - * @deprecated after 1.6.2.0 */ public function getOptionsRenderCfg($productType) { @@ -157,8 +150,6 @@ class Wishlist extends \Magento\Wishlist\Block\AbstractBlock * * @param \Magento\Wishlist\Model\Item $item * @return string - * - * @deprecated after 1.6.2.0 */ public function getDetailsHtml(\Magento\Wishlist\Model\Item $item) { @@ -192,8 +183,6 @@ class Wishlist extends \Magento\Wishlist\Block\AbstractBlock * * @param \Magento\Wishlist\Model\Item $item * @return float - * - * @deprecated after 1.6.2.0 */ public function getAddToCartQty(\Magento\Wishlist\Model\Item $item) { diff --git a/app/code/Magento/Wishlist/composer.json b/app/code/Magento/Wishlist/composer.json index 11242e8314982578ff69deb7f25554e126c125fa..0531ad4cc0b0b980d732566666438e89ec7d56c6 100644 --- a/app/code/Magento/Wishlist/composer.json +++ b/app/code/Magento/Wishlist/composer.json @@ -14,8 +14,7 @@ "magento/module-sales": "1.0.0-beta", "magento/module-grouped-product": "1.0.0-beta", "magento/framework": "1.0.0-beta", - "magento/module-ui": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/module-ui": "1.0.0-beta" }, "suggest": { "magento/module-configurable-product": "1.0.0-beta", @@ -29,12 +28,10 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "Magento/Wishlist" - ] - ] + "autoload": { + "files": [ "registration.php" ], + "psr-4": { + "Magento\\Wishlist\\": "" + } } } diff --git a/app/code/Magento/Wishlist/etc/acl.xml b/app/code/Magento/Wishlist/etc/acl.xml index c2a327afb912340ad3271019560cd2a00ece1e01..06c9725f281a62de442fbbb15172da049f50406a 100644 --- a/app/code/Magento/Wishlist/etc/acl.xml +++ b/app/code/Magento/Wishlist/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/app/code/Magento/Wishlist/etc/adminhtml/di.xml b/app/code/Magento/Wishlist/etc/adminhtml/di.xml index c63737fc470c63d364763f3ab47c2833a1d1eb9f..42a3911a72177c2802fcf8848d13bd0af05800d8 100644 --- a/app/code/Magento/Wishlist/etc/adminhtml/di.xml +++ b/app/code/Magento/Wishlist/etc/adminhtml/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Wishlist\Model\Wishlist"> <arguments> <argument name="useCurrentWebsite" xsi:type="boolean">false</argument> diff --git a/app/code/Magento/Wishlist/etc/adminhtml/system.xml b/app/code/Magento/Wishlist/etc/adminhtml/system.xml index fa7009173707087c3138a60289ff2d9b0a924edc..e24701711731a4a3551fabe930832abe72dd53c8 100644 --- a/app/code/Magento/Wishlist/etc/adminhtml/system.xml +++ b/app/code/Magento/Wishlist/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="wishlist" translate="label" type="text" sortOrder="140" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Wish List</label> diff --git a/app/code/Magento/Wishlist/etc/catalog_attributes.xml b/app/code/Magento/Wishlist/etc/catalog_attributes.xml index dc5abcf2e581259abbdac54870ed8ad18fcade2d..8ec98e4f7da27d11c457ccf89419775e2344181e 100644 --- a/app/code/Magento/Wishlist/etc/catalog_attributes.xml +++ b/app/code/Magento/Wishlist/etc/catalog_attributes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Catalog/etc/catalog_attributes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/catalog_attributes.xsd"> <group name="wishlist_item"> <attribute name="visibility"/> <attribute name="url_path"/> diff --git a/app/code/Magento/Wishlist/etc/config.xml b/app/code/Magento/Wishlist/etc/config.xml index 77c070c2b505b4679a54b7dfbd36e5295955be49..2ad857b632bbb048f105feb75bb5888c4410b3b0 100644 --- a/app/code/Magento/Wishlist/etc/config.xml +++ b/app/code/Magento/Wishlist/etc/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <wishlist> <general> diff --git a/app/code/Magento/Wishlist/etc/di.xml b/app/code/Magento/Wishlist/etc/di.xml index ce481e6bbd7054d155d65668565157ee4a62d9e2..c4932716e617e61732533cbe18a5a6e8b06d2752 100644 --- a/app/code/Magento/Wishlist/etc/di.xml +++ b/app/code/Magento/Wishlist/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="\Magento\Wishlist\Model\AuthenticationStateInterface" type="\Magento\Wishlist\Model\AuthenticationState" /> <preference for="\Magento\Wishlist\Controller\WishlistProviderInterface" type="\Magento\Wishlist\Controller\WishlistProvider" /> <type name="Magento\Wishlist\Model\Resource\Item\Collection\Grid"> diff --git a/app/code/Magento/Wishlist/etc/email_templates.xml b/app/code/Magento/Wishlist/etc/email_templates.xml index 7d867f9454ab8bf430357e8fc271300f13c182cd..236f6e47154b8328ffdd5f49759784c96f74a1c3 100644 --- a/app/code/Magento/Wishlist/etc/email_templates.xml +++ b/app/code/Magento/Wishlist/etc/email_templates.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Email/etc/email_templates.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Email:etc/email_templates.xsd"> <template id="wishlist_email_email_template" label="Wish List Sharing" file="share_notification.html" type="html" module="Magento_Wishlist" area="frontend"/> </config> diff --git a/app/code/Magento/Wishlist/etc/events.xml b/app/code/Magento/Wishlist/etc/events.xml index b65a9cc3b8f870faf3b87dee682ae8d4a4d9cb3e..0746916d8b5212a1107495dd49d84b254a078b78 100644 --- a/app/code/Magento/Wishlist/etc/events.xml +++ b/app/code/Magento/Wishlist/etc/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="checkout_cart_update_items_before"> <observer name="wishlist" instance="Magento\Wishlist\Observer\CartUpdateBefore" method="execute" /> </event> diff --git a/app/code/Magento/Wishlist/etc/frontend/di.xml b/app/code/Magento/Wishlist/etc/frontend/di.xml index 6095f6cef1b365b9c3cc35ee1905c39b8b67ba2d..b177f9b77944882f8484b49acb12520c99e29245 100644 --- a/app/code/Magento/Wishlist/etc/frontend/di.xml +++ b/app/code/Magento/Wishlist/etc/frontend/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <virtualType name="Magento\Wishlist\Model\Session\Storage" type="Magento\Framework\Session\Storage"> <arguments> <argument name="namespace" xsi:type="string">wishlist</argument> diff --git a/app/code/Magento/Wishlist/etc/frontend/events.xml b/app/code/Magento/Wishlist/etc/frontend/events.xml index a69ee25e5045085b4c8fcf659e17446bcf7812e5..ec0728b0d199f7e703b270628b2d0faf84c2987f 100644 --- a/app/code/Magento/Wishlist/etc/frontend/events.xml +++ b/app/code/Magento/Wishlist/etc/frontend/events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="customer_login"> <observer name="wishlist" instance="Magento\Wishlist\Observer\CustomerLogin" method="execute" /> </event> diff --git a/app/code/Magento/Wishlist/etc/frontend/page_types.xml b/app/code/Magento/Wishlist/etc/frontend/page_types.xml index 3e6d27eb292a2d868dd7e0ffe3187b02f5b1cccd..4f9c1643a6fe2aa63ccb094e7d30acac2b9191a4 100644 --- a/app/code/Magento/Wishlist/etc/frontend/page_types.xml +++ b/app/code/Magento/Wishlist/etc/frontend/page_types.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page_types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_types.xsd"> +<page_types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_types.xsd"> <type id="wishlist_index_index" label="Customer My Account My Wish List"/> <type id="wishlist_index_share" label="Customer My Account Wish List Sharing Form"/> <type id="wishlist_shared_index" label="Customer Shared Wish List View"/> diff --git a/app/code/Magento/Wishlist/etc/frontend/routes.xml b/app/code/Magento/Wishlist/etc/frontend/routes.xml index 98de219bc7695cb21bf55ba09e1f94e4ddbaacd2..a4a77af41ac94940cc6fd33ba7fa85c171d7a121 100644 --- a/app/code/Magento/Wishlist/etc/frontend/routes.xml +++ b/app/code/Magento/Wishlist/etc/frontend/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn: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/etc/frontend/sections.xml b/app/code/Magento/Wishlist/etc/frontend/sections.xml index 90aabf9ab1a0bb5c5727faafe14244a85d0d969e..f5288513dbf113806e0073eadf2eead549d19cea 100644 --- a/app/code/Magento/Wishlist/etc/frontend/sections.xml +++ b/app/code/Magento/Wishlist/etc/frontend/sections.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../Magento/Customer/etc/sections.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd"> <action name="wishlist/index/add"> <section name="wishlist"/> </action> diff --git a/app/code/Magento/Wishlist/etc/module.xml b/app/code/Magento/Wishlist/etc/module.xml index 0edf7b7b8d207b84b33d231c920568f66e939c25..b5231aecd568569a1b22f657a36e14cf94a12e40 100644 --- a/app/code/Magento/Wishlist/etc/module.xml +++ b/app/code/Magento/Wishlist/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Wishlist" setup_version="2.0.0"> <sequence> <module name="Magento_Customer"/> diff --git a/app/code/Magento/Wishlist/etc/view.xml b/app/code/Magento/Wishlist/etc/view.xml index 2b8573155b8a6564e272369574706631abf5bd09..d67f56d1fbd3fc2bb9f0c38205fd55b34ba8848f 100644 --- a/app/code/Magento/Wishlist/etc/view.xml +++ b/app/code/Magento/Wishlist/etc/view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Config/etc/view.xsd"> +<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/view.xsd"> <vars module="Magento_Wishlist"> <var name="product_image_size">113</var> <!-- Product image size used in wishlist --> </vars> diff --git a/app/code/Magento/Wishlist/registration.php b/app/code/Magento/Wishlist/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..ae9b8f371ccf3c6f8bac2b8875ab17a23e22dc48 --- /dev/null +++ b/app/code/Magento/Wishlist/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Wishlist', + __DIR__ +); diff --git a/app/code/Magento/Wishlist/view/adminhtml/layout/customer_index_edit.xml b/app/code/Magento/Wishlist/view/adminhtml/layout/customer_index_edit.xml index c2caa32651b3797fb91742ea16f9dc1e57eda4dc..a4b61fbacebcd18c5f916118c35ac649532b2c6d 100644 --- a/app/code/Magento/Wishlist/view/adminhtml/layout/customer_index_edit.xml +++ b/app/code/Magento/Wishlist/view/adminhtml/layout/customer_index_edit.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="customer_form"> <block class="Magento\Wishlist\Block\Adminhtml\WishlistTab" name="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 599991c00bccd6551091ddd1aae37db7e45f2971..12fd177cc24a06a822b6f81bce518adf014f3cb2 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 @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <container name="root"> <block class="Magento\Backend\Block\Widget\Grid" name="customer.wishlist.edit.tab"> <arguments> diff --git a/app/code/Magento/Wishlist/view/frontend/layout/catalog_category_view.xml b/app/code/Magento/Wishlist/view/frontend/layout/catalog_category_view.xml index 54d65005c7a6056635d2b283b35fcb7382e8a820..907e418b935d5d5ae5ba9b3e9a6b69b403f02410 100644 --- a/app/code/Magento/Wishlist/view/frontend/layout/catalog_category_view.xml +++ b/app/code/Magento/Wishlist/view/frontend/layout/catalog_category_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Cookie\Block\RequireCookie" name="require-cookie" template="Magento_Cookie::require_cookie.phtml"> diff --git a/app/code/Magento/Wishlist/view/frontend/layout/catalog_product_view.xml b/app/code/Magento/Wishlist/view/frontend/layout/catalog_product_view.xml index 54d65005c7a6056635d2b283b35fcb7382e8a820..907e418b935d5d5ae5ba9b3e9a6b69b403f02410 100644 --- a/app/code/Magento/Wishlist/view/frontend/layout/catalog_product_view.xml +++ b/app/code/Magento/Wishlist/view/frontend/layout/catalog_product_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Cookie\Block\RequireCookie" name="require-cookie" template="Magento_Cookie::require_cookie.phtml"> diff --git a/app/code/Magento/Wishlist/view/frontend/layout/checkout_cart_item_renderers.xml b/app/code/Magento/Wishlist/view/frontend/layout/checkout_cart_item_renderers.xml index 6318b605dd52b13999b0337d28905768f4162d14..6b9db23e7892351afb1eab9f49ade019b25fda3a 100644 --- a/app/code/Magento/Wishlist/view/frontend/layout/checkout_cart_item_renderers.xml +++ b/app/code/Magento/Wishlist/view/frontend/layout/checkout_cart_item_renderers.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout.cart.item.renderers.default.actions"> <block class="Magento\Wishlist\Block\Cart\Item\Renderer\Actions\MoveToWishlist" name="checkout.cart.item.renderers.default.actions.move_to_wishlist" template="cart/item/renderer/actions/move_to_wishlist.phtml" before="checkout.cart.item.renderers.default.actions.edit"/> diff --git a/app/code/Magento/Wishlist/view/frontend/layout/customer_account.xml b/app/code/Magento/Wishlist/view/frontend/layout/customer_account.xml index d24143bd9246da92c69a47f4ccbcde2453840790..413f77f1c0bbac971581328e968592f3b776e38d 100644 --- a/app/code/Magento/Wishlist/view/frontend/layout/customer_account.xml +++ b/app/code/Magento/Wishlist/view/frontend/layout/customer_account.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="customer_account_navigation"> <block class="Magento\Framework\View\Element\Html\Link\Current" ifconfig="wishlist/general/active" name="customer-account-navigation-wish-list-link"> diff --git a/app/code/Magento/Wishlist/view/frontend/layout/default.xml b/app/code/Magento/Wishlist/view/frontend/layout/default.xml index 5f495fd665c155937faa90cc979e331616572ddd..873dfda08b6f67ca9c21b1e7f9b7d5789380617b 100644 --- a/app/code/Magento/Wishlist/view/frontend/layout/default.xml +++ b/app/code/Magento/Wishlist/view/frontend/layout/default.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="head.components"> <block class="Magento\Framework\View\Element\Js\Components" name="wishlist_page_head_components" template="Magento_Wishlist::js/components.phtml"/> diff --git a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_email_items.xml b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_email_items.xml index 6931eaa1ce0adff76800cfe774e58db8d1e9773e..0c364c99019d75f5045b6eb20f2beb1889e3e1e5 100644 --- a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_email_items.xml +++ b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_email_items.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <block class="Magento\Wishlist\Block\Share\Email\Items" name="wishlist.email.items" cacheable="false"/> </body> diff --git a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_email_rss.xml b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_email_rss.xml index c0ff4b0df42d7c3cfecd0c1447fe10bc1f226183..3b176a483e26156aefce08ec10d88898f9775979 100644 --- a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_email_rss.xml +++ b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_email_rss.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="root"> <block class="Magento\Wishlist\Block\Rss\EmailLink" name="wishlist.email.rss" cacheable="false"/> diff --git a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure.xml b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure.xml index b67ab0352d844cb2edd890d8b2b00b2593cdac7f..564eb22c98be2f8d7214fdb299d609dd2c133026 100644 --- a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure.xml +++ b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="catalog_product_view"/> <body> <referenceContainer name="product.info.social"> diff --git a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_bundle.xml b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_bundle.xml index 2c401d8277750341806a8c68e316b5be13100afb..d825da61107cba2fb8f2a74f79360d9bb6150f15 100644 --- a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_bundle.xml +++ b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_bundle.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <attribute name="class" value="page-product-bundle"/> <referenceBlock name="product.info"> diff --git a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_configurable.xml b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_configurable.xml index ca597a405dcbaee56e039751f17605a11ea3e011..fa5766d3a0ceba711f14d8d0ca5d72cb8ec8822d 100644 --- a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_configurable.xml +++ b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_configurable.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <attribute name="class" value="page-product-configurable"/> <referenceBlock name="head.components"> diff --git a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_downloadable.xml b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_downloadable.xml index 6f29a08ace4b9b05baa3efe8b89378b16097731c..e35743ca17a1be058099102dd7843a9a4ffbe49a 100644 --- a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_downloadable.xml +++ b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_downloadable.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <attribute name="class" value="page-product-downloadable"/> <referenceBlock name="head.components"> diff --git a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_grouped.xml b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_grouped.xml index 4423c524772d12f4f63acd2df31cae25df0abe8a..2438e15b7ab865b71bfbe94b0c7218a9cc70c737 100644 --- a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_grouped.xml +++ b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_grouped.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <attribute name="class" value="page-product-grouped"/> <referenceContainer name="product.info.form.content"> diff --git a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_simple.xml b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_simple.xml index a024d6e563cb581c15476d71430b89f2dd05ea36..44eec0b583d14104b76b334e2395d72d5b2bf778 100644 --- a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_simple.xml +++ b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_simple.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body/> </page> 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 5f000a79c1859578ac853abd49df7f58ad7d65e1..53ed5b35c44a5c52db06bbaf9a5f0bcc4fd0218e 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 @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="customer_account"/> <body> <referenceBlock name="head.components"> diff --git a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_share.xml b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_share.xml index 3b79ac989a0eaf9507c31e38407a416850e53387..9e7619512dd6496ebf9af5bd476d4ec2cddfc634 100644 --- a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_share.xml +++ b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_share.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="customer_account"/> <body> <referenceContainer name="content"> diff --git a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_shared_index.xml b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_shared_index.xml index 3ee4e012f66be7c2d0e0dce1f4e308e7c78a5f2f..cb6dd4cb73cbe84c92f21a799cae4b53b07c0f34 100644 --- a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_shared_index.xml +++ b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_shared_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Wishlist\Block\Share\Wishlist" name="customer.wishlist" template="shared.phtml" cacheable="false"/> diff --git a/app/design/adminhtml/Magento/backend/Magento_Backend/layout/default.xml b/app/design/adminhtml/Magento/backend/Magento_Backend/layout/default.xml index e7b337a7ec11b7ff523b3d031405404cc07f7361..343ba0d978f89f35c711058f45ae7498e63a8cfc 100644 --- a/app/design/adminhtml/Magento/backend/Magento_Backend/layout/default.xml +++ b/app/design/adminhtml/Magento/backend/Magento_Backend/layout/default.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <css src="css/styles-old.css"/> <css src="css/styles.css"/> diff --git a/app/design/adminhtml/Magento/backend/Magento_Backend/layout/styles.xml b/app/design/adminhtml/Magento/backend/Magento_Backend/layout/styles.xml index 561ada3af36cfed1046efb8b05080c0257900b3c..5494c3579211e0534d2248dab5ed79df2b2acc74 100644 --- a/app/design/adminhtml/Magento/backend/Magento_Backend/layout/styles.xml +++ b/app/design/adminhtml/Magento/backend/Magento_Backend/layout/styles.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <remove src="css/styles-old.css"/> <remove src="jquery/farbtastic/css/farbtastic.css"/> diff --git a/app/design/adminhtml/Magento/backend/composer.json b/app/design/adminhtml/Magento/backend/composer.json index 79feacbdd1778c4127d2027aac7ed3b7a84adb69..08f2ee5d4c984fc65dcb7b606fb7743a89f969d9 100644 --- a/app/design/adminhtml/Magento/backend/composer.json +++ b/app/design/adminhtml/Magento/backend/composer.json @@ -3,8 +3,7 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0|~7.0.0", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-theme", "version": "1.0.0-beta", @@ -12,12 +11,7 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "adminhtml/Magento/backend" - ] - ] + "autoload": { + "files": [ "registration.php" ] } } diff --git a/app/design/adminhtml/Magento/backend/etc/view.xml b/app/design/adminhtml/Magento/backend/etc/view.xml index 353ee529c4b11d87303c483619c1f53466019c08..a846813648e5dc8f413a7185cbc17cabf6482808 100644 --- a/app/design/adminhtml/Magento/backend/etc/view.xml +++ b/app/design/adminhtml/Magento/backend/etc/view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../code/Magento/Catalog/etc/view.xsd"> +<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Catalog/etc/view.xsd"> <vars module="Js_Bundle"> <var name="bundle_size">1MB</var> </vars> diff --git a/app/design/adminhtml/Magento/backend/etc/view.xsd b/app/design/adminhtml/Magento/backend/etc/view.xsd index baf53e022669dbfbe3bace01a31e4a4e4cd36ed1..a695016f03565dc6ecf2f654c57d6c44c7eae906 100644 --- a/app/design/adminhtml/Magento/backend/etc/view.xsd +++ b/app/design/adminhtml/Magento/backend/etc/view.xsd @@ -6,7 +6,7 @@ */ --> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> - <xs:redefine schemaLocation="../../../../../../lib/internal/Magento/Framework/Config/etc/view.xsd"> + <xs:redefine schemaLocation="urn:magento:framework:Config/etc/view.xsd"> <xs:complexType name="mediaType" mixed="true"> <xs:complexContent> <xs:extension base="mediaType"> diff --git a/app/design/adminhtml/Magento/backend/registration.php b/app/design/adminhtml/Magento/backend/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..fe7ecf22478d894bbf33a3cec52ea4ece2331f8b --- /dev/null +++ b/app/design/adminhtml/Magento/backend/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::THEME, + 'adminhtml/Magento/backend', + __DIR__ +); diff --git a/app/design/adminhtml/Magento/backend/theme.xml b/app/design/adminhtml/Magento/backend/theme.xml index 64ebbfbdf481f9385f3aa0cb66036010e5679fa4..1fef499c9d0ffb478aa4e68abd67f919ed0a1028 100644 --- a/app/design/adminhtml/Magento/backend/theme.xml +++ b/app/design/adminhtml/Magento/backend/theme.xml @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ --> -<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> +<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> <title>Magento 2 backend</title> </theme> diff --git a/app/design/frontend/Magento/blank/Magento_Catalog/layout/catalog_product_view.xml b/app/design/frontend/Magento/blank/Magento_Catalog/layout/catalog_product_view.xml index 5af790eba08e5f4d9249fcead660cf012ec2db11..fd51b47bd8f0c4aa375ca178b4e0606792954f60 100644 --- a/app/design/frontend/Magento/blank/Magento_Catalog/layout/catalog_product_view.xml +++ b/app/design/frontend/Magento/blank/Magento_Catalog/layout/catalog_product_view.xml @@ -6,7 +6,7 @@ */ --> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <move element="page.main.title" destination="product.info.main" before="-"/> </body> diff --git a/app/design/frontend/Magento/blank/Magento_Checkout/layout/checkout_cart_index.xml b/app/design/frontend/Magento/blank/Magento_Checkout/layout/checkout_cart_index.xml index dd89b55736f90ac540d65b0f98f468823f29a914..3a5c6923432b2dada99d6671e61c456983731e08 100644 --- a/app/design/frontend/Magento/blank/Magento_Checkout/layout/checkout_cart_index.xml +++ b/app/design/frontend/Magento/blank/Magento_Checkout/layout/checkout_cart_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="checkout.cart.items"> <container name="checkout.cart.container" htmlTag="div" htmlClass="cart-container" before="-"> diff --git a/app/design/frontend/Magento/blank/Magento_Checkout/layout/checkout_index_index.xml b/app/design/frontend/Magento/blank/Magento_Checkout/layout/checkout_index_index.xml index 6bd1e12ef841726a4ad5f99edb10ab232ddffb58..0831f581e34ae29356c244a9d2578403aa008932 100644 --- a/app/design/frontend/Magento/blank/Magento_Checkout/layout/checkout_index_index.xml +++ b/app/design/frontend/Magento/blank/Magento_Checkout/layout/checkout_index_index.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="minicart" remove="true"/> <referenceContainer name="header.panel" remove="true"/> diff --git a/app/design/frontend/Magento/blank/Magento_Customer/layout/customer_account.xml b/app/design/frontend/Magento/blank/Magento_Customer/layout/customer_account.xml index 306808aabdd7058b75de55ee62a2bbc40ec67d4b..5423f41c4d2f3a91c387e5ba6a176f4ade9856d9 100644 --- a/app/design/frontend/Magento/blank/Magento_Customer/layout/customer_account.xml +++ b/app/design/frontend/Magento/blank/Magento_Customer/layout/customer_account.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page layout="2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page layout="2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="sidebar.main"> <block class="Magento\Framework\View\Element\Template" name="customer_account_navigation_block" template="Magento_Theme::html/collapsible.phtml" before="-"> diff --git a/app/design/frontend/Magento/blank/Magento_Multishipping/layout/multishipping_checkout.xml b/app/design/frontend/Magento/blank/Magento_Multishipping/layout/multishipping_checkout.xml index e2bf3a44381625172ded871875458e81dd68245d..a78fe9d6d5b06ce862533f0e5aa6ef6479976846 100644 --- a/app/design/frontend/Magento/blank/Magento_Multishipping/layout/multishipping_checkout.xml +++ b/app/design/frontend/Magento/blank/Magento_Multishipping/layout/multishipping_checkout.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd" label="Multishipping Checkout" design_abstraction="custom"> +<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="Multishipping Checkout" design_abstraction="custom"> <body> <referenceBlock name="minicart" remove="true"/> <referenceContainer name="header.panel" remove="true"/> diff --git a/app/design/frontend/Magento/blank/Magento_Multishipping/layout/multishipping_checkout_success.xml b/app/design/frontend/Magento/blank/Magento_Multishipping/layout/multishipping_checkout_success.xml index 550f7b96434b1cb5862371aa4247b084d7f77c69..ab9fde3f4a52bb9d874595c03f76d10138275c4c 100644 --- a/app/design/frontend/Magento/blank/Magento_Multishipping/layout/multishipping_checkout_success.xml +++ b/app/design/frontend/Magento/blank/Magento_Multishipping/layout/multishipping_checkout_success.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body/> </page> diff --git a/app/design/frontend/Magento/blank/Magento_Theme/layout/default.xml b/app/design/frontend/Magento/blank/Magento_Theme/layout/default.xml index 4dc4b59e9230f171df930c02a5c8e2bfa14f9e73..e41c9083adf62d35c60fcf1922dc96094fc73471 100644 --- a/app/design/frontend/Magento/blank/Magento_Theme/layout/default.xml +++ b/app/design/frontend/Magento/blank/Magento_Theme/layout/default.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="header.container"> <container name="header.panel.wrapper" htmlClass="panel wrapper" htmlTag="div" before="-"/> diff --git a/app/design/frontend/Magento/blank/Magento_Theme/layout/default_head_blocks.xml b/app/design/frontend/Magento/blank/Magento_Theme/layout/default_head_blocks.xml index f2c55478a36392c5af398bee70e6070cfe271782..6e89d680ef8690b8050e252ddc24f8c0497b715d 100644 --- a/app/design/frontend/Magento/blank/Magento_Theme/layout/default_head_blocks.xml +++ b/app/design/frontend/Magento/blank/Magento_Theme/layout/default_head_blocks.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <css src="css/styles-m.css" /> <css src="css/styles-l.css" media="screen and (min-width: 768px)"/> diff --git a/app/design/frontend/Magento/blank/composer.json b/app/design/frontend/Magento/blank/composer.json index c42c8396d2cd9493390cde9940f778e14336af9d..47a3b138969503bdf61c770b5665ec733936020c 100644 --- a/app/design/frontend/Magento/blank/composer.json +++ b/app/design/frontend/Magento/blank/composer.json @@ -3,8 +3,7 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0|~7.0.0", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-theme", "version": "1.0.0-beta", @@ -12,12 +11,7 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "frontend/Magento/blank" - ] - ] + "autoload": { + "files": [ "registration.php" ] } } diff --git a/app/design/frontend/Magento/blank/etc/view.xml b/app/design/frontend/Magento/blank/etc/view.xml index 60b9de5784b07e5195d77fb1c17aa734a0b76db4..6020a6ad025f5519fc84d2a112f08a6e75ffbadc 100644 --- a/app/design/frontend/Magento/blank/etc/view.xml +++ b/app/design/frontend/Magento/blank/etc/view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../code/Magento/Catalog/etc/view.xsd"> +<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Catalog/etc/view.xsd"> <media> <images module="Magento_Catalog"> <image id="bundled_product_customization_page" type="thumbnail"> diff --git a/app/design/frontend/Magento/blank/etc/view.xsd b/app/design/frontend/Magento/blank/etc/view.xsd index baf53e022669dbfbe3bace01a31e4a4e4cd36ed1..a695016f03565dc6ecf2f654c57d6c44c7eae906 100644 --- a/app/design/frontend/Magento/blank/etc/view.xsd +++ b/app/design/frontend/Magento/blank/etc/view.xsd @@ -6,7 +6,7 @@ */ --> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> - <xs:redefine schemaLocation="../../../../../../lib/internal/Magento/Framework/Config/etc/view.xsd"> + <xs:redefine schemaLocation="urn:magento:framework:Config/etc/view.xsd"> <xs:complexType name="mediaType" mixed="true"> <xs:complexContent> <xs:extension base="mediaType"> diff --git a/app/design/frontend/Magento/blank/registration.php b/app/design/frontend/Magento/blank/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..cdcf4b7b89ced75fa68d6227b71dbb6200af39b4 --- /dev/null +++ b/app/design/frontend/Magento/blank/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::THEME, + 'frontend/Magento/blank', + __DIR__ +); diff --git a/app/design/frontend/Magento/blank/theme.xml b/app/design/frontend/Magento/blank/theme.xml index 5389a03c7220e2e0a4a128842308a66076d9be1a..9aab168017880082e280bd33d9ba8fb62301d89c 100644 --- a/app/design/frontend/Magento/blank/theme.xml +++ b/app/design/frontend/Magento/blank/theme.xml @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ --> -<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> +<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> <title>Magento Blank</title> <media> <preview_image>media/preview.jpg</preview_image> diff --git a/app/design/frontend/Magento/luma/Magento_Catalog/layout/catalog_product_view.xml b/app/design/frontend/Magento/luma/Magento_Catalog/layout/catalog_product_view.xml index 1b49c0229ca50a63ef8fc3dc854c099af8253f21..a66a3bef0975aae1c340817ed08fdb501f266c15 100644 --- a/app/design/frontend/Magento/luma/Magento_Catalog/layout/catalog_product_view.xml +++ b/app/design/frontend/Magento/luma/Magento_Catalog/layout/catalog_product_view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <move element="product.info.stock.sku" destination="product.info.price" after="product.price.final"/> <move element="product.info.review" destination="product.info.main" before="product.info.price"/> diff --git a/app/design/frontend/Magento/luma/Magento_Catalog/layout/default.xml b/app/design/frontend/Magento/luma/Magento_Catalog/layout/default.xml index f74ec11e615e2dc3a4907aed2be29c4e7b892ea7..83aae3318fa53fc84ace9a19d2e7c4aa857c574d 100644 --- a/app/design/frontend/Magento/luma/Magento_Catalog/layout/default.xml +++ b/app/design/frontend/Magento/luma/Magento_Catalog/layout/default.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="header-wrapper"> <container name="compare-link-wrapper" label="Compare Link Wrapper" as="compare-link-wrapper" after="top.search" htmlTag="ul" htmlClass="compare wrapper"> diff --git a/app/design/frontend/Magento/luma/Magento_Checkout/layout/checkout_cart_index.xml b/app/design/frontend/Magento/luma/Magento_Checkout/layout/checkout_cart_index.xml index d4ec73647de9b250f572ce71131c7c2a728dffb5..cd0c318298740a798718532fc0ee3ef707b1df16 100644 --- a/app/design/frontend/Magento/luma/Magento_Checkout/layout/checkout_cart_index.xml +++ b/app/design/frontend/Magento/luma/Magento_Checkout/layout/checkout_cart_index.xml @@ -6,7 +6,7 @@ */ --> <page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="checkout.cart.container"> <container name="cart.discount" label="Cart Discount Container" htmlTag="div" htmlClass="cart-discount" after="-" /> diff --git a/app/design/frontend/Magento/luma/Magento_Customer/layout/default.xml b/app/design/frontend/Magento/luma/Magento_Customer/layout/default.xml index 66085190c1f20a31d4476e4c0de3bf5708d8f561..1fe8120b5d39adf13fb611c0d7dca5768b57a44e 100644 --- a/app/design/frontend/Magento/luma/Magento_Customer/layout/default.xml +++ b/app/design/frontend/Magento/luma/Magento_Customer/layout/default.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="header.links"> <block class="Magento\Customer\Block\Account\Customer" name="customer" template="account/customer.phtml" before="-"/> diff --git a/app/design/frontend/Magento/luma/Magento_Theme/layout/default.xml b/app/design/frontend/Magento/luma/Magento_Theme/layout/default.xml index f1033dfd490a49d4806be994eb3c84fa8eb8b854..07235454198f6d1f5c3c999f0ee54f84bb9b34b8 100644 --- a/app/design/frontend/Magento/luma/Magento_Theme/layout/default.xml +++ b/app/design/frontend/Magento/luma/Magento_Theme/layout/default.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="header.panel"> <block class="Magento\Framework\View\Element\Html\Links" name="header.links"> diff --git a/app/design/frontend/Magento/luma/Magento_Theme/layout/default_head_blocks.xml b/app/design/frontend/Magento/luma/Magento_Theme/layout/default_head_blocks.xml index b182e0495b8c00aa0a3cd150eb0c940e66680140..23ffff8e9ccaf2bc78876fe79e272a27fe04463a 100644 --- a/app/design/frontend/Magento/luma/Magento_Theme/layout/default_head_blocks.xml +++ b/app/design/frontend/Magento/luma/Magento_Theme/layout/default_head_blocks.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/> </head> diff --git a/app/design/frontend/Magento/luma/composer.json b/app/design/frontend/Magento/luma/composer.json index 88b2414a0c1003602a3d3a9bb98e241aa12ac8e0..1937d940839869646ccc69925c98754334fcbd6a 100644 --- a/app/design/frontend/Magento/luma/composer.json +++ b/app/design/frontend/Magento/luma/composer.json @@ -4,8 +4,7 @@ "require": { "php": "~5.5.0|~5.6.0|~7.0.0", "magento/theme-frontend-blank": "1.0.0-beta", - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-theme", "version": "1.0.0-beta", @@ -13,12 +12,7 @@ "OSL-3.0", "AFL-3.0" ], - "extra": { - "map": [ - [ - "*", - "frontend/Magento/luma" - ] - ] + "autoload": { + "files": [ "registration.php" ] } } diff --git a/app/design/frontend/Magento/luma/etc/view.xml b/app/design/frontend/Magento/luma/etc/view.xml index 577e93526ff533397c63a4edfe581e83a8682b9c..60da26b47742434de38f549d7626c556a26211e0 100644 --- a/app/design/frontend/Magento/luma/etc/view.xml +++ b/app/design/frontend/Magento/luma/etc/view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../code/Magento/Catalog/etc/view.xsd"> +<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Catalog/etc/view.xsd"> <media> <images module="Magento_Catalog"> <image id="bundled_product_customization_page" type="thumbnail"> diff --git a/app/design/frontend/Magento/luma/etc/view.xsd b/app/design/frontend/Magento/luma/etc/view.xsd index baf53e022669dbfbe3bace01a31e4a4e4cd36ed1..a695016f03565dc6ecf2f654c57d6c44c7eae906 100644 --- a/app/design/frontend/Magento/luma/etc/view.xsd +++ b/app/design/frontend/Magento/luma/etc/view.xsd @@ -6,7 +6,7 @@ */ --> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> - <xs:redefine schemaLocation="../../../../../../lib/internal/Magento/Framework/Config/etc/view.xsd"> + <xs:redefine schemaLocation="urn:magento:framework:Config/etc/view.xsd"> <xs:complexType name="mediaType" mixed="true"> <xs:complexContent> <xs:extension base="mediaType"> diff --git a/app/design/frontend/Magento/luma/registration.php b/app/design/frontend/Magento/luma/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..9ff22252bc851db3961e93bc07e7732bfa159b3d --- /dev/null +++ b/app/design/frontend/Magento/luma/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::THEME, + 'frontend/Magento/luma', + __DIR__ +); diff --git a/app/design/frontend/Magento/luma/theme.xml b/app/design/frontend/Magento/luma/theme.xml index a076b74818636816aae0330636603324c3d94b9d..b2ba5e630b77a63abeed995b9cc5c3936921942d 100644 --- a/app/design/frontend/Magento/luma/theme.xml +++ b/app/design/frontend/Magento/luma/theme.xml @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ --> -<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> +<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> <title>Magento Luma</title> <parent>Magento/blank</parent> <media> diff --git a/app/etc/NonComposerComponentRegistration.php b/app/etc/NonComposerComponentRegistration.php new file mode 100755 index 0000000000000000000000000000000000000000..c5cf9fb8ce413be42d328feb169509e3c12417fa --- /dev/null +++ b/app/etc/NonComposerComponentRegistration.php @@ -0,0 +1,21 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +$pathList[] = dirname(__DIR__) . '/code/*/*/registration.php'; +$pathList[] = dirname(__DIR__) . '/design/*/*/*/registration.php'; +$pathList[] = dirname(__DIR__) . '/i18n/*/*/registration.php'; +$pathList[] = dirname(dirname(__DIR__)) . '/lib/internal/*/*/registration.php'; +$pathList[] = dirname(dirname(__DIR__)) . '/lib/internal/*/*/*/registration.php'; +foreach ($pathList as $path) { + // Sorting is disabled intentionally for performance improvement + $files = glob($path, GLOB_NOSORT); + if ($files === false) { + throw new \RuntimeException('glob() returned error while searching in \'' . $path . '\''); + } + foreach ($files as $file) { + include $file; + } +} diff --git a/app/etc/di.xml b/app/etc/di.xml index 38acd07ff6b778902ebc984325251c21f21998ad..9c107cf5cee12770a1388a2179a14baa3a91c119 100755 --- a/app/etc/di.xml +++ b/app/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Psr\Log\LoggerInterface" type="Magento\Framework\Logger\Monolog" /> <preference for="Magento\Framework\View\Template\Html\MinifierInterface" type="Magento\Framework\View\Template\Html\Minifier" /> <preference for="Magento\Framework\ObjectManager\FactoryInterface" type="Magento\Framework\ObjectManager\Factory\Dynamic\Developer" /> @@ -51,7 +51,7 @@ <preference for="Magento\Framework\Config\CacheInterface" type="Magento\Framework\App\Cache\Type\Config" /> <preference for="Magento\Framework\Config\ValidationStateInterface" type="Magento\Framework\App\Arguments\ValidationState" /> <preference for="Magento\Framework\Module\ModuleListInterface" type="Magento\Framework\Module\ModuleList" /> - <preference for="Magento\Framework\Module\ModuleRegistryInterface" type="Magento\Framework\Module\Registrar" /> + <preference for="Magento\Framework\Component\ComponentRegistrarInterface" type="Magento\Framework\Component\ComponentRegistrar"/> <preference for="Magento\Framework\Event\ConfigInterface" type="Magento\Framework\Event\Config" /> <preference for="Magento\Framework\Event\InvokerInterface" type="Magento\Framework\Event\Invoker\InvokerDefault" /> <preference for="Magento\Framework\Interception\PluginListInterface" type="Magento\Framework\Interception\PluginList\PluginList" /> @@ -961,8 +961,8 @@ </type> <type name="Magento\Framework\DataObject\Copy\Config\SchemaLocator"> <arguments> - <argument name="schema" xsi:type="string">lib/internal/Magento/Framework/DataObject/etc/fieldset.xsd</argument> - <argument name="perFileSchema" xsi:type="string">lib/internal/Magento/Framework/DataObject/etc/fieldset_file.xsd</argument> + <argument name="schema" xsi:type="string">urn:magento:framework:DataObject/etc/fieldset.xsd</argument> + <argument name="perFileSchema" xsi:type="string">urn:magento:framework:DataObject/etc/fieldset_file.xsd</argument> </arguments> </type> <type name="Magento\Framework\DataObject\Copy\Config\Data"> @@ -1066,8 +1066,7 @@ <arguments> <argument name="fileName" xsi:type="string">view.xsd</argument> <argument name="defaultScope" xsi:type="string">global</argument> - <argument name="searchPattern" xsi:type="string">/*/*/etc/</argument> - <argument name="searchFilesPattern" xsi:type="string">/../..//Config/etc/</argument> + <argument name="searchFilesPattern" xsi:type="string">urn:magento:framework:Config/etc/</argument> </arguments> </type> </config> diff --git a/app/i18n/magento/de_de/composer.json b/app/i18n/magento/de_de/composer.json index fb11b26155287e77d38800d492646de55bc94ba1..c3c550a88f5428ed58f6b14f223df2a4915cd8d3 100644 --- a/app/i18n/magento/de_de/composer.json +++ b/app/i18n/magento/de_de/composer.json @@ -7,16 +7,10 @@ "AFL-3.0" ], "require": { - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-language", - "extra": { - "map": [ - [ - "*", - "magento/de_de" - ] - ] + "autoload": { + "files": [ "registration.php" ] } } diff --git a/app/i18n/magento/de_de/language.xml b/app/i18n/magento/de_de/language.xml index 66ee92d6953510f633db0fa32c87b4cfb68d7161..cd2064951a20ac0f09b4d67c3497fe25b23a396d 100644 --- a/app/i18n/magento/de_de/language.xml +++ b/app/i18n/magento/de_de/language.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../lib/internal/Magento/Framework/App/Language/package.xsd"> +<language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/Language/package.xsd"> <code>de_DE</code> <vendor>magento</vendor> <package>de_de</package> diff --git a/app/i18n/magento/de_de/registration.php b/app/i18n/magento/de_de/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..044091926dab6d91f1dac425d1030d60b4c77c73 --- /dev/null +++ b/app/i18n/magento/de_de/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::LANGUAGE, + 'magento_de_de', + __DIR__ +); diff --git a/app/i18n/magento/en_us/composer.json b/app/i18n/magento/en_us/composer.json index 5fc4bb057cefafd05c7b6e399070a7e35b3107b4..a0d4453d94af505110f360cb9b4281d8090bf2ba 100644 --- a/app/i18n/magento/en_us/composer.json +++ b/app/i18n/magento/en_us/composer.json @@ -7,16 +7,10 @@ "AFL-3.0" ], "require": { - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-language", - "extra": { - "map": [ - [ - "*", - "magento/en_us" - ] - ] + "autoload": { + "files": [ "registration.php" ] } } diff --git a/app/i18n/magento/en_us/language.xml b/app/i18n/magento/en_us/language.xml index df66bdc9a5c33ad8e318cab63fb7d3120f06cff6..2e972271be60d371c7791b7053dd4e68d54df1eb 100644 --- a/app/i18n/magento/en_us/language.xml +++ b/app/i18n/magento/en_us/language.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../lib/internal/Magento/Framework/App/Language/package.xsd"> +<language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/Language/package.xsd"> <code>en_US</code> <vendor>magento</vendor> <package>en_us</package> diff --git a/app/i18n/magento/en_us/registration.php b/app/i18n/magento/en_us/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..5a2a809085fed76b1283a3561ae57f0cab8de1c4 --- /dev/null +++ b/app/i18n/magento/en_us/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::LANGUAGE, + 'magento_en_us', + __DIR__ +); diff --git a/app/i18n/magento/es_es/composer.json b/app/i18n/magento/es_es/composer.json index d1ecd9fe949442601d45e708866b4256dee66365..6ccc2667cecda2677d57bbc51055a2ff4af28a8d 100644 --- a/app/i18n/magento/es_es/composer.json +++ b/app/i18n/magento/es_es/composer.json @@ -7,16 +7,10 @@ "AFL-3.0" ], "require": { - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-language", - "extra": { - "map": [ - [ - "*", - "magento/es_es" - ] - ] + "autoload": { + "files": [ "registration.php" ] } } diff --git a/app/i18n/magento/es_es/language.xml b/app/i18n/magento/es_es/language.xml index d6c7c513c5e5b897ece9a4f98ccc36c93c7b0b30..900c00b8eb94e6c449b84e5b37650045fab1a408 100644 --- a/app/i18n/magento/es_es/language.xml +++ b/app/i18n/magento/es_es/language.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../lib/internal/Magento/Framework/App/Language/package.xsd"> +<language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/Language/package.xsd"> <code>es_ES</code> <vendor>magento</vendor> <package>es_es</package> diff --git a/app/i18n/magento/es_es/registration.php b/app/i18n/magento/es_es/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..303cd1f1b37964828c9a577c0b9c3b5533249104 --- /dev/null +++ b/app/i18n/magento/es_es/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::LANGUAGE, + 'magento_es_es', + __DIR__ +); diff --git a/app/i18n/magento/fr_fr/composer.json b/app/i18n/magento/fr_fr/composer.json index 86de0ef28f9694a355e794418eb10fdbf57c9462..f4c368b78cd9ea9c8d4a8a197b37c5cf698651fd 100644 --- a/app/i18n/magento/fr_fr/composer.json +++ b/app/i18n/magento/fr_fr/composer.json @@ -7,16 +7,10 @@ "AFL-3.0" ], "require": { - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-language", - "extra": { - "map": [ - [ - "*", - "magento/fr_fr" - ] - ] + "autoload": { + "files": [ "registration.php" ] } } diff --git a/app/i18n/magento/fr_fr/language.xml b/app/i18n/magento/fr_fr/language.xml index db7b6b2fa396c9419a3fe33202b387253e6eda33..bf9efc5171311c9e0209f7d405080284758cffa7 100644 --- a/app/i18n/magento/fr_fr/language.xml +++ b/app/i18n/magento/fr_fr/language.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../lib/internal/Magento/Framework/App/Language/package.xsd"> +<language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/Language/package.xsd"> <code>fr_FR</code> <vendor>magento</vendor> <package>fr_fr</package> diff --git a/app/i18n/magento/fr_fr/registration.php b/app/i18n/magento/fr_fr/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..fb876534299fab324a5c40381f8a55ab29f36813 --- /dev/null +++ b/app/i18n/magento/fr_fr/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::LANGUAGE, + 'magento_fr_fr', + __DIR__ +); diff --git a/app/i18n/magento/nl_nl/composer.json b/app/i18n/magento/nl_nl/composer.json index 36de3d71115f81f0fdc54c749de513659db331af..cbd0b7970409d92f5ebc239b7ce0853a3fabf972 100644 --- a/app/i18n/magento/nl_nl/composer.json +++ b/app/i18n/magento/nl_nl/composer.json @@ -7,16 +7,10 @@ "AFL-3.0" ], "require": { - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-language", - "extra": { - "map": [ - [ - "*", - "magento/nl_nl" - ] - ] + "autoload": { + "files": [ "registration.php" ] } } diff --git a/app/i18n/magento/nl_nl/language.xml b/app/i18n/magento/nl_nl/language.xml index 4c0be32dccaaf130783033bc9d464fa1cfaa1ef3..6928b7fa994f7a3425a0dab47e4fc8525503f6f2 100644 --- a/app/i18n/magento/nl_nl/language.xml +++ b/app/i18n/magento/nl_nl/language.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../lib/internal/Magento/Framework/App/Language/package.xsd"> +<language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/Language/package.xsd"> <code>nl_NL</code> <vendor>magento</vendor> <package>nl_nl</package> diff --git a/app/i18n/magento/nl_nl/registration.php b/app/i18n/magento/nl_nl/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..120aa707c60514717bfcb64807aa99ec77b82720 --- /dev/null +++ b/app/i18n/magento/nl_nl/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::LANGUAGE, + 'magento_nl_nl', + __DIR__ +); diff --git a/app/i18n/magento/pt_br/composer.json b/app/i18n/magento/pt_br/composer.json index a59956dcba3dd27fa761024cafb89f61fcceef1b..52006cc21d8bd49509ffbe52c73d145784c799e8 100644 --- a/app/i18n/magento/pt_br/composer.json +++ b/app/i18n/magento/pt_br/composer.json @@ -7,16 +7,10 @@ "AFL-3.0" ], "require": { - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-language", - "extra": { - "map": [ - [ - "*", - "magento/pt_br" - ] - ] + "autoload": { + "files": [ "registration.php" ] } } diff --git a/app/i18n/magento/pt_br/language.xml b/app/i18n/magento/pt_br/language.xml index 39b1623b9a1c8bf34c3a3d3b0006c28f1c7031f9..8fd675a6a51797a44029e90ca09fce956511b648 100644 --- a/app/i18n/magento/pt_br/language.xml +++ b/app/i18n/magento/pt_br/language.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../lib/internal/Magento/Framework/App/Language/package.xsd"> +<language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/Language/package.xsd"> <code>pt_BR</code> <vendor>magento</vendor> <package>pt_br</package> diff --git a/app/i18n/magento/pt_br/registration.php b/app/i18n/magento/pt_br/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..dfddce390eca9e85d046d4ec3d800221fc6a71fa --- /dev/null +++ b/app/i18n/magento/pt_br/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::LANGUAGE, + 'magento_pt_br', + __DIR__ +); diff --git a/app/i18n/magento/zh_hans_cn/composer.json b/app/i18n/magento/zh_hans_cn/composer.json index 5c76f9158a0d3d801216b76665b5dff7e04bffa6..39faa0480663e563a28fe38bafab6bfa0e5ae2a7 100644 --- a/app/i18n/magento/zh_hans_cn/composer.json +++ b/app/i18n/magento/zh_hans_cn/composer.json @@ -7,16 +7,10 @@ "AFL-3.0" ], "require": { - "magento/framework": "1.0.0-beta", - "magento/magento-composer-installer": "*" + "magento/framework": "1.0.0-beta" }, "type": "magento2-language", - "extra": { - "map": [ - [ - "*", - "magento/zh_hans_cn" - ] - ] + "autoload": { + "files": [ "registration.php" ] } } diff --git a/app/i18n/magento/zh_hans_cn/language.xml b/app/i18n/magento/zh_hans_cn/language.xml index ac3f2d97ac99929af6bf4aa0d8348de7689ce876..e3d04aae392233a8ec1b64de479f60a48fa903b9 100644 --- a/app/i18n/magento/zh_hans_cn/language.xml +++ b/app/i18n/magento/zh_hans_cn/language.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../lib/internal/Magento/Framework/App/Language/package.xsd"> +<language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/Language/package.xsd"> <code>zh_Hans_CN</code> <vendor>magento</vendor> <package>zh_hans_cn</package> diff --git a/app/i18n/magento/zh_hans_cn/registration.php b/app/i18n/magento/zh_hans_cn/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..18d028f3d0dfa05a1c4009aa6b050964e2a84cb3 --- /dev/null +++ b/app/i18n/magento/zh_hans_cn/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::LANGUAGE, + 'magento_zh_hans_cn', + __DIR__ +); diff --git a/composer.json b/composer.json index 83bf61ef7e1d8c93e6eff83536ffd8d2680fc670..b9bfa65c39a8c33ee1b4322a16dda9098045833b 100644 --- a/composer.json +++ b/composer.json @@ -37,7 +37,7 @@ "zendframework/zend-serializer": "~2.4.6", "zendframework/zend-log": "~2.4.6", "zendframework/zend-http": "~2.4.6", - "magento/zendframework1": "1.12.13", + "magento/zendframework1": "1.12.16", "composer/composer": "1.0.0-alpha10", "monolog/monolog": "1.16.0", "oyejorge/less.php": "1.7.0.3", @@ -217,8 +217,13 @@ "autoload": { "psr-4": { "Magento\\Framework\\": "lib/internal/Magento/Framework/", - "Magento\\Setup\\": "setup/src/Magento/Setup/" - } + "Magento\\Setup\\": "setup/src/Magento/Setup/", + "Magento\\": "app/code/Magento/" + }, + "psr-0": { + "": "app/code/" + }, + "files": ["app/etc/NonComposerComponentRegistration.php"] }, "autoload-dev": { "psr-4": { diff --git a/composer.lock b/composer.lock index 6c2735456299bd993d10081ed4e758e2176ea31c..cfa0e8c41d9439507ae4bf9ac2c968cccce49f14 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "f3de00214a95a86e8eca7b4064f330e4", - "content-hash": "34ada96789d428b1a34fcbde33f2a85c", + "hash": "25a5ae0bdd6b3ea879ab1140483c493e", + "content-hash": "05d5894f85b00df1148fd6ca99e33b82", "packages": [ { "name": "braintree/braintree_php", @@ -293,16 +293,16 @@ }, { "name": "magento/zendframework1", - "version": "1.12.13", + "version": "1.12.16", "source": { "type": "git", "url": "https://github.com/magento/zf1.git", - "reference": "07ce4e9fba448f4aa48acbb1605c68897dac595f" + "reference": "dbdf178992bfa52d6e978e62131162301ff6b76f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/magento/zf1/zipball/07ce4e9fba448f4aa48acbb1605c68897dac595f", - "reference": "07ce4e9fba448f4aa48acbb1605c68897dac595f", + "url": "https://api.github.com/repos/magento/zf1/zipball/dbdf178992bfa52d6e978e62131162301ff6b76f", + "reference": "dbdf178992bfa52d6e978e62131162301ff6b76f", "shasum": "" }, "require": { @@ -336,7 +336,7 @@ "ZF1", "framework" ], - "time": "2015-06-02 08:04:41" + "time": "2015-09-30 13:04:03" }, { "name": "monolog/monolog", @@ -2674,16 +2674,16 @@ }, { "name": "lusitanian/oauth", - "version": "v0.6.1", + "version": "v0.7.0", "source": { "type": "git", "url": "https://github.com/Lusitanian/PHPoAuthLib.git", - "reference": "4e710c294f41857752b370f16aeff52ba76d48b9" + "reference": "a48f63ce1a636c86f901b9bdbdadcdbf473bb07b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Lusitanian/PHPoAuthLib/zipball/4e710c294f41857752b370f16aeff52ba76d48b9", - "reference": "4e710c294f41857752b370f16aeff52ba76d48b9", + "url": "https://api.github.com/repos/Lusitanian/PHPoAuthLib/zipball/a48f63ce1a636c86f901b9bdbdadcdbf473bb07b", + "reference": "a48f63ce1a636c86f901b9bdbdadcdbf473bb07b", "shasum": "" }, "require": { @@ -2737,7 +2737,7 @@ "oauth", "security" ], - "time": "2015-09-30 23:32:37" + "time": "2015-10-07 00:20:04" }, { "name": "pdepend/pdepend", diff --git a/dev/shell/dependency.php b/dev/shell/dependency.php deleted file mode 100644 index bd6fd8de21af01a3fd46f45efb75b3d090e1a30a..0000000000000000000000000000000000000000 --- a/dev/shell/dependency.php +++ /dev/null @@ -1,380 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -const KEY_COMPOSER_COMPONENT_TYPE = 'type'; -const KEY_COMPOSER_MAGENTO2_MODULE = 'magento2-module'; -const KEY_COMPOSER_REQUIRE = 'require'; -const KEY_COMPOSER_COMPONENT_NAME = 'name'; - -const KEY_MODULE_DIRECTORY_NAME = 'module_directory_name'; -const KEY_MODULE_DEPENDENT_MODULES = 'dependent_modules'; -const KEY_MODULE_NAME = 'name'; -const KEY_MODULE_COMPONENT = 'component'; - -const KEY_COMPONENT_MODULES = 'modules'; -const KEY_COMPONENT_NAME = 'name'; -const KEY_COMPONENT_DEPENDENCIES = 'dependencies'; -const KEY_COMPONENT_DEPENDENTS = 'dependents'; - -$modules = []; -$componentsByName = []; - -define( - 'USAGE', - "Usage: php -f dependency.php -- [--list-modules] [--list-components][--list-component-dependencies component_name] - [--list-component-dependents component_name] [--list-module-dependencies module-name] - [--list module-dependents module-name] [--direct-dependency-only] - --help - print usage message - --list-modules - list all modules in order of module dependency - --list-components - list all components consisting of circularly dependent modules - --list-component-dependencies - list components that the specified component depends on - --list-component-dependents - list components that depends on the specified components - --list-module-dependencies - list modules that the specified module depends on - --list-module-dependents - list modules that depends on the specified module - --direct-dependency-only - only return direct dependencies - \n" -); -$opt = getopt( - '', - [ - 'help', - 'list-modules', - 'list-components', - 'list-component-dependencies:', - 'list-component-dependents:', - 'list-module-dependencies:', - 'list-module-dependents:', - 'direct-dependency-only', - ] -); - -if (empty($opt) || isset($opt['help'])) { - echo USAGE; -} - -initialize(); -$directDependenciesOnly = isset($opt['direct-dependency-only']) ? true : false; - -if (isset($opt['list-modules'])) { - $sortedComponents = topologicalSort($componentsByName); - $result = []; - foreach ($sortedComponents as $component) { - foreach ($componentsByName[$component][KEY_COMPONENT_MODULES] as $module) { - $result[] = $module; - } - } - echo json_encode($result, JSON_PRETTY_PRINT); -} elseif (isset($opt['list-components'])) { - $sortedComponents = topologicalSort($componentsByName); - $result = []; - foreach ($sortedComponents as $componentName) { - $component = ['name' => $componentName]; - foreach ($componentsByName[$componentName][KEY_COMPONENT_MODULES] as $module) { - $component['modules'][] = $module; - } - $result[] = $component; - } - echo json_encode($result, JSON_PRETTY_PRINT); -} elseif (isset($opt['list-component-dependencies'])) { - //Get components that the specified component depends on, directly or indirectly - $targetComponent = $opt['list-component-dependencies']; - if (!isset($componentsByName[$targetComponent])) { - die("Can't find specified component: " . $targetComponent . "\n"); - } - if ($directDependenciesOnly) { - $dependencies = $componentsByName[$targetComponent][KEY_COMPONENT_DEPENDENCIES]; - } else { - $dependencies = getComponentDependency($targetComponent, KEY_COMPONENT_DEPENDENCIES); - } - echo json_encode($dependencies, JSON_PRETTY_PRINT); -} elseif (isset($opt['list-component-dependents'])) { - //Get components that depends on the specified component, directly or indirectly - $targetComponent = $opt['list-component-dependents']; - if (!isset($componentsByName[$targetComponent])) { - die("Can't find specified component: " . $targetComponent . "\n"); - } - if ($directDependenciesOnly) { - $dependencies = $componentsByName[$targetComponent][KEY_COMPONENT_DEPENDENTS]; - } else { - $dependencies = getComponentDependency($targetComponent, KEY_COMPONENT_DEPENDENTS); - } - echo json_encode($dependencies, JSON_PRETTY_PRINT); -} elseif (isset($opt['list-module-dependents'])) { - //Get modules that depends on the specified module, directly or indirectly - $targetModule = $opt['list-module-dependents']; - $dependencies = []; - if (!isset($modules[$targetModule])) { - die("Can't find specified module: " . $targetModule . "\n"); - } - - if ($directDependenciesOnly) { - foreach ($modules as $module) { - if (in_array($targetModule, $module[KEY_MODULE_DEPENDENT_MODULES])) { - $dependencies[] = $module[KEY_MODULE_NAME]; - } - } - } else { - $selfComponentName = $modules[$targetModule][KEY_MODULE_COMPONENT]; - foreach ($componentsByName[$selfComponentName][KEY_COMPONENT_MODULES] as $module) { - if ($module != $targetModule) { - $dependencies[] = $module; - } - } - - $componentDependencies = getComponentDependency( - $selfComponentName, - KEY_COMPONENT_DEPENDENTS - ); - foreach ($componentDependencies as $component) { - foreach ($componentsByName[$component][KEY_COMPONENT_MODULES] as $module) { - if (!in_array($module, $dependencies)) { - $dependencies[] = $module; - } - } - } - } - echo json_encode($dependencies, JSON_PRETTY_PRINT); -} elseif (isset($opt['list-module-dependencies'])) { - //Get modules that depends on the specified module, directly or indirectly - $targetModule = $opt['list-module-dependencies']; - $dependencies = []; - if (!isset($modules[$targetModule])) { - die("Can't find specified module: " . $targetModule . "\n"); - } - - if ($directDependenciesOnly) { - $module = $modules[$targetModule]; - $dependencies = $module[KEY_MODULE_DEPENDENT_MODULES]; - } else { - $selfComponentName = $modules[$targetModule][KEY_MODULE_COMPONENT]; - foreach ($componentsByName[$selfComponentName][KEY_COMPONENT_MODULES] as $module) { - if ($module != $targetModule) { - $dependencies[] = $module; - } - } - - $componentDependencies = getComponentDependency( - $selfComponentName, - KEY_COMPONENT_DEPENDENCIES - ); - foreach ($componentDependencies as $component) { - foreach ($componentsByName[$component][KEY_COMPONENT_MODULES] as $module) { - if (!in_array($module, $dependencies)) { - $dependencies[] = $module; - } - } - } - } - echo json_encode($dependencies, JSON_PRETTY_PRINT); -} - -/** - * For a given component, return a list of components that depend on the component or a list of components - * that the given component depends on - * - * @param string $component - * @param string $direction - * @return array - */ -function getComponentDependency($component, $direction) -{ - global $componentsByName; - $dependencies = []; - $queue = []; - - foreach ($componentsByName[$component][$direction] as $componentName) { - $dependencies[] = $componentName; - $queue[] = $componentName; - } - - while (!empty($queue)) { - $head = array_shift($queue); - $headComponent = $componentsByName[$head]; - foreach ($headComponent[$direction] as $componentName) { - if (!in_array($componentName, $dependencies)) { - $dependencies[] = $componentName; - $queue[] = $componentName; - } - } - } - - return $dependencies; -} - -/** - * initialize the component and module dependency - * - * @SuppressWarnings(PHPMD.CyclomaticComplexity) - * @SuppressWarnings(PHPMD.NPathComplexity) - * @return void - */ -function initialize() -{ - global $modules, $componentsByName; - $baseDir = "../../"; - $fileNames = glob($baseDir . "app/code/Magento/*/composer.json"); - - foreach ($fileNames as $fileName) { - $moduleDirectoryName = basename(dirname($fileName)); - $content = json_decode(file_get_contents($fileName), true); - if ($content[KEY_COMPOSER_COMPONENT_TYPE] != KEY_COMPOSER_MAGENTO2_MODULE) { - continue; - } - $dependentModules = []; - $dependencies = $content[KEY_COMPOSER_REQUIRE]; - foreach (array_keys($dependencies) as $name) { - $dependentModules[$name] = $name; - } - $moduleName = $content[KEY_COMPOSER_COMPONENT_NAME]; - $modules[$moduleName] = [ - KEY_MODULE_DIRECTORY_NAME => $moduleDirectoryName, - KEY_MODULE_DEPENDENT_MODULES => $dependentModules, - KEY_MODULE_NAME => $moduleName, - ]; - } - - //going through the array one more time to clean up the content, remove the dependencies that are not module - foreach ($modules as &$module) { - $dependentModules = []; - foreach ($module[KEY_MODULE_DEPENDENT_MODULES] as $dependentModuleName) { - if (isset($modules[$dependentModuleName])) { - $dependentModules[$dependentModuleName] = $dependentModuleName; - } - } - $module[KEY_MODULE_DEPENDENT_MODULES] = $dependentModules; - } - - //Group strongly connected modules as components - $components = identifyComponents($modules); - - foreach ($components as &$component) { - if (count($component[KEY_COMPONENT_MODULES]) == 1) { - $component[KEY_COMPONENT_NAME] = $component[KEY_COMPONENT_MODULES][0]; - $modules[$component[KEY_COMPONENT_MODULES][0]][KEY_MODULE_COMPONENT] = $component[KEY_COMPONENT_NAME]; - } else { - $component[KEY_COMPONENT_NAME] = implode(':', $component[KEY_COMPONENT_MODULES]); - } - foreach ($component[KEY_COMPONENT_MODULES] as $moduleName) { - $modules[$moduleName][KEY_MODULE_COMPONENT] = $component[KEY_COMPONENT_NAME]; - } - $componentsByName[$component[KEY_COMPONENT_NAME]] = $component; - } - - //Process dependency between components - foreach ($componentsByName as $name => &$component) { - foreach ($component[KEY_COMPONENT_MODULES] as $moduleName) { - foreach ($modules[$moduleName][KEY_MODULE_DEPENDENT_MODULES] as $dependentModule) { - $dependentComponent = $modules[$dependentModule][KEY_MODULE_COMPONENT]; - - if ($dependentComponent != $component[KEY_COMPONENT_NAME]) { - $component[KEY_COMPONENT_DEPENDENCIES][$dependentComponent] = - $dependentComponent; - $componentsByName[$dependentComponent][KEY_COMPONENT_DEPENDENTS][$component[KEY_COMPONENT_NAME]] = - $component[KEY_COMPONENT_NAME]; - } - } - } - } - foreach ($componentsByName as &$component) { - if (!isset($component[KEY_COMPONENT_DEPENDENTS])) { - $component[KEY_COMPONENT_DEPENDENTS] = []; - } - if (!isset($component[KEY_COMPONENT_DEPENDENCIES])) { - $component[KEY_COMPONENT_DEPENDENCIES] = []; - } - } -} - -/** - * For a given acyclic graph of components, sort the components according to the dependencies so that components - * can only depend on components with lower index - * - * @param array $components - * @return array - */ -function topologicalSort($components) -{ - $sortedComponents = []; - $rootComponents = []; - foreach ($components as $component) { - if (empty($component[KEY_COMPONENT_DEPENDENCIES])) { - $rootComponents[] = $component; - } - } - - while (!empty($rootComponents)) { - $rootComponent = array_shift($rootComponents); - $sortedComponents[] = $rootComponent[KEY_COMPONENT_NAME]; - - foreach ($rootComponent[KEY_COMPONENT_DEPENDENTS] as $componentName) { - unset($components[$componentName][KEY_COMPONENT_DEPENDENCIES][$rootComponent[KEY_COMPONENT_NAME]]); - if (empty($components[$componentName][KEY_COMPONENT_DEPENDENCIES])) { - $rootComponents[] = $components[$componentName]; - } - } - } - - return $sortedComponents; -} - -/** - * Identify components in the dependency graph using Tarjan algorithm. Modules that circularly depend on each other - * are grouped into components. Modules that are not in a cyclic graph are grouped into component of its own - * - * @param array $modules - * @return array - */ -function identifyComponents($modules) -{ - $index = 0; - $stack = []; - $components = []; - - foreach ($modules as &$module) { - if (!isset($module['index'])) { - identifyComponent($modules, $module, $stack, $index, $components); - } - } - - return $components; -} - -/** - * Recursive function to identify one component - * - * @param array $modules - * @param array $module - * @param array $stack - * @param int $index - * @param array $components - * @return void - */ -function identifyComponent(&$modules, &$module, &$stack, &$index, &$components) -{ - $module['index'] = $index; - $module['lowlink'] = $index; - $index++; - $stack[] = $module[KEY_MODULE_NAME]; - - foreach ($module[KEY_MODULE_DEPENDENT_MODULES] as $dependentModuleName) { - $dependentModule = &$modules[$dependentModuleName]; - if (!isset($dependentModule['index'])) { - identifyComponent($modules, $dependentModule, $stack, $index, $components); - $module['lowlink'] = min($module['lowlink'], $dependentModule['lowlink']); - } elseif (in_array($dependentModuleName, $stack)) { - $module['lowlink'] = min($module['lowlink'], $dependentModule['index']); - } - } - - if ($module['lowlink'] == $module['index']) { - $component = []; - do { - $moduleName = array_pop($stack); - $component[KEY_COMPONENT_MODULES][] = $moduleName; - } while ($moduleName != $module[KEY_MODULE_NAME]); - $components[] = $component; - } -} diff --git a/dev/tests/api-functional/_files/Magento/TestModule1/etc/acl.xml b/dev/tests/api-functional/_files/Magento/TestModule1/etc/acl.xml index 848e3a8f36a28b9bb427da914b3046dbd2781d85..20012843a933fa46b847bcf71fe5b896cbf1e045 100644 --- a/dev/tests/api-functional/_files/Magento/TestModule1/etc/acl.xml +++ b/dev/tests/api-functional/_files/Magento/TestModule1/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/dev/tests/api-functional/_files/Magento/TestModule1/etc/di.xml b/dev/tests/api-functional/_files/Magento/TestModule1/etc/di.xml index 2a25820907ce76892f606fbbbca53fcf7c19292a..0587a45cd652737c7d537773f450225030a1dddc 100644 --- a/dev/tests/api-functional/_files/Magento/TestModule1/etc/di.xml +++ b/dev/tests/api-functional/_files/Magento/TestModule1/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\TestModule1\Service\V1\AllSoapAndRestInterface" type="Magento\TestModule1\Service\V1\AllSoapAndRest" /> <preference for="Magento\TestModule1\Service\V2\AllSoapAndRestInterface" type="Magento\TestModule1\Service\V2\AllSoapAndRest" /> diff --git a/dev/tests/api-functional/_files/Magento/TestModule1/etc/extension_attributes.xml b/dev/tests/api-functional/_files/Magento/TestModule1/etc/extension_attributes.xml index befcd3199564e3753dbf4394d2e4824b87812a32..0c60255952bb35a3652942b78187d726c12ba6b2 100644 --- a/dev/tests/api-functional/_files/Magento/TestModule1/etc/extension_attributes.xml +++ b/dev/tests/api-functional/_files/Magento/TestModule1/etc/extension_attributes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/Api/etc/extension_attributes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> <extension_attributes for="Magento\TestModule1\Service\V1\Entity\Item"> <attribute code="custom_attribute_data_object" type="Magento\TestModuleMSC\Model\Data\CustomAttributeDataObject" /> <attribute code="custom_attribute_string" type="string" /> diff --git a/dev/tests/api-functional/_files/Magento/TestModule1/etc/frontend/routes.xml b/dev/tests/api-functional/_files/Magento/TestModule1/etc/frontend/routes.xml index 236d338e66ea8a7a9a68f23e0af8e6cc61c4c95e..0f4de0e42c4e34490b2192b5663c7473839678d7 100644 --- a/dev/tests/api-functional/_files/Magento/TestModule1/etc/frontend/routes.xml +++ b/dev/tests/api-functional/_files/Magento/TestModule1/etc/frontend/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="standard"> <route id="testmoduleone" frontName="testmoduleone"> <module name="Magento_TestModule1" /> diff --git a/dev/tests/api-functional/_files/Magento/TestModule1/etc/module.xml b/dev/tests/api-functional/_files/Magento/TestModule1/etc/module.xml index f7337b30e486f457ca1c2a66f37626d955a1b061..334a63fd9377265716f6448024a43bc0d07525e8 100644 --- a/dev/tests/api-functional/_files/Magento/TestModule1/etc/module.xml +++ b/dev/tests/api-functional/_files/Magento/TestModule1/etc/module.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_TestModule1" setup_version="1.0"/> </config> diff --git a/dev/tests/api-functional/_files/Magento/TestModule1/etc/webapi.xml b/dev/tests/api-functional/_files/Magento/TestModule1/etc/webapi.xml index c73e035fdac1598b306ed592c62d6fc7e3510d98..1404ec8f68a2b57f9c09035cbc1a45f418da4451 100644 --- a/dev/tests/api-functional/_files/Magento/TestModule1/etc/webapi.xml +++ b/dev/tests/api-functional/_files/Magento/TestModule1/etc/webapi.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../app/code/Magento/Webapi/etc/webapi.xsd"> +<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd"> <route method="GET" url="/V1/testmodule1/overwritten"> <service class="Magento\TestModule1\Service\V1\AllSoapAndRestInterface" method="item" /> diff --git a/dev/tests/api-functional/_files/Magento/TestModule1/registration.php b/dev/tests/api-functional/_files/Magento/TestModule1/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..d6ad9e7ff3a5737131744b4c0bb429ee7db4576d --- /dev/null +++ b/dev/tests/api-functional/_files/Magento/TestModule1/registration.php @@ -0,0 +1,12 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +use Magento\Framework\Component\ComponentRegistrar; + +$registrar = new ComponentRegistrar(); +if ($registrar->getPath(ComponentRegistrar::MODULE, 'Magento_TestModule1') === null) { + ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_TestModule1', __DIR__); +} diff --git a/dev/tests/api-functional/_files/Magento/TestModule2/etc/acl.xml b/dev/tests/api-functional/_files/Magento/TestModule2/etc/acl.xml index 5b34b73575eb5afccd717a4815daffb21989f57d..35f401689f77c6793ae828b3e0cf2f8e6623f684 100644 --- a/dev/tests/api-functional/_files/Magento/TestModule2/etc/acl.xml +++ b/dev/tests/api-functional/_files/Magento/TestModule2/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/dev/tests/api-functional/_files/Magento/TestModule2/etc/di.xml b/dev/tests/api-functional/_files/Magento/TestModule2/etc/di.xml index b7965561af072b6993aed627cc372e54d6433ea7..a52201069599ccfbb33cfd10c48288776b66940d 100644 --- a/dev/tests/api-functional/_files/Magento/TestModule2/etc/di.xml +++ b/dev/tests/api-functional/_files/Magento/TestModule2/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\TestModule2\Service\V1\SubsetRestInterface" type="Magento\TestModule2\Service\V1\SubsetRest" /> <preference for="Magento\TestModule2\Service\V1\NoWebApiXmlInterface" type="Magento\TestModule2\Service\V1\NoWebApiXml" /> </config> diff --git a/dev/tests/api-functional/_files/Magento/TestModule2/etc/module.xml b/dev/tests/api-functional/_files/Magento/TestModule2/etc/module.xml index fb8a06e73af89ae41789158dcef34817dc49b1dc..05b078211b14b6316520e4824db1532b299c79c7 100644 --- a/dev/tests/api-functional/_files/Magento/TestModule2/etc/module.xml +++ b/dev/tests/api-functional/_files/Magento/TestModule2/etc/module.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_TestModule2" setup_version="1.0"/> </config> diff --git a/dev/tests/api-functional/_files/Magento/TestModule2/etc/webapi.xml b/dev/tests/api-functional/_files/Magento/TestModule2/etc/webapi.xml index a12e7cc5dc5ba86c77808365997fcde663869b1a..3e51725bf512fc47fa4ffedf0f5fdf1bb08ac996 100644 --- a/dev/tests/api-functional/_files/Magento/TestModule2/etc/webapi.xml +++ b/dev/tests/api-functional/_files/Magento/TestModule2/etc/webapi.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../app/code/Magento/Webapi/etc/webapi.xsd"> +<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd"> <route method="GET" url="/V1/testModule2SubsetRest/:id"> <service class="Magento\TestModule2\Service\V1\SubsetRestInterface" method="item" /> <resources> diff --git a/dev/tests/api-functional/_files/Magento/TestModule2/registration.php b/dev/tests/api-functional/_files/Magento/TestModule2/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..1f3800422d637a6965cb63a5401f1fd0c42defb4 --- /dev/null +++ b/dev/tests/api-functional/_files/Magento/TestModule2/registration.php @@ -0,0 +1,12 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +use Magento\Framework\Component\ComponentRegistrar; + +$registrar = new ComponentRegistrar(); +if ($registrar->getPath(ComponentRegistrar::MODULE, 'Magento_TestModule2') === null) { + ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_TestModule2', __DIR__); +} diff --git a/dev/tests/api-functional/_files/Magento/TestModule3/etc/acl.xml b/dev/tests/api-functional/_files/Magento/TestModule3/etc/acl.xml index 18b20140d5d66614b77cfe4090358025085f642a..82b6196ab1730ee248e44bcdd95b43eeb92a7e1d 100644 --- a/dev/tests/api-functional/_files/Magento/TestModule3/etc/acl.xml +++ b/dev/tests/api-functional/_files/Magento/TestModule3/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/dev/tests/api-functional/_files/Magento/TestModule3/etc/di.xml b/dev/tests/api-functional/_files/Magento/TestModule3/etc/di.xml index 1a2d4e553221c715a3cb1c8ba753e07fc4f062e6..9650701fda7875638b669a8080741845e32837ed 100644 --- a/dev/tests/api-functional/_files/Magento/TestModule3/etc/di.xml +++ b/dev/tests/api-functional/_files/Magento/TestModule3/etc/di.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\TestModule3\Service\V1\ErrorInterface" type="Magento\TestModule3\Service\V1\Error" /> </config> diff --git a/dev/tests/api-functional/_files/Magento/TestModule3/etc/module.xml b/dev/tests/api-functional/_files/Magento/TestModule3/etc/module.xml index b38cbe026846a7435f5ff84ad8d606fe2e51f367..c39724853466102b034b83b23d3b02f62646cfec 100644 --- a/dev/tests/api-functional/_files/Magento/TestModule3/etc/module.xml +++ b/dev/tests/api-functional/_files/Magento/TestModule3/etc/module.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_TestModule3" setup_version="1.0"/> </config> diff --git a/dev/tests/api-functional/_files/Magento/TestModule3/etc/webapi.xml b/dev/tests/api-functional/_files/Magento/TestModule3/etc/webapi.xml index 0a5fa58cfd31f82aa44c77ddd3c5c60d2e24176d..58d2755ec45abc9ccf7b8aa90eb69e9dad33f0c7 100644 --- a/dev/tests/api-functional/_files/Magento/TestModule3/etc/webapi.xml +++ b/dev/tests/api-functional/_files/Magento/TestModule3/etc/webapi.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../app/code/Magento/Webapi/etc/webapi.xsd"> +<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd"> <route method="GET" url="/V1/errortest/success"> <service class="Magento\TestModule3\Service\V1\ErrorInterface" method="success" /> <resources> diff --git a/dev/tests/api-functional/_files/Magento/TestModule3/registration.php b/dev/tests/api-functional/_files/Magento/TestModule3/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..386fb02ddcde3b9e479cb4f5367a8b5177d3154f --- /dev/null +++ b/dev/tests/api-functional/_files/Magento/TestModule3/registration.php @@ -0,0 +1,12 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +use Magento\Framework\Component\ComponentRegistrar; + +$registrar = new ComponentRegistrar(); +if ($registrar->getPath(ComponentRegistrar::MODULE, 'Magento_TestModule3') === null) { + ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_TestModule3', __DIR__); +} diff --git a/dev/tests/api-functional/_files/Magento/TestModule4/etc/acl.xml b/dev/tests/api-functional/_files/Magento/TestModule4/etc/acl.xml index a33f6a119464d114971946268bc702fd391b515a..3983719b923781b79aee596ebd9e4d00d75fff14 100644 --- a/dev/tests/api-functional/_files/Magento/TestModule4/etc/acl.xml +++ b/dev/tests/api-functional/_files/Magento/TestModule4/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/dev/tests/api-functional/_files/Magento/TestModule4/etc/di.xml b/dev/tests/api-functional/_files/Magento/TestModule4/etc/di.xml index 49583f07e682419714394820679cf524226df87a..ed0bc2a38b35fe51687d59094fa3a038af126b99 100644 --- a/dev/tests/api-functional/_files/Magento/TestModule4/etc/di.xml +++ b/dev/tests/api-functional/_files/Magento/TestModule4/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\TestModule4\Service\V1\DataObjectServiceInterface" type="Magento\TestModule4\Service\V1\DataObjectService" /> <preference for="Magento\TestModule4\Service\V1\Entity\ExtensibleRequestInterface" type="Magento\TestModule4\Service\V1\Entity\ExtensibleRequest" /> <type name="Magento\TestModule4\Service\V1\Entity\ExtensibleRequest"> diff --git a/dev/tests/api-functional/_files/Magento/TestModule4/etc/module.xml b/dev/tests/api-functional/_files/Magento/TestModule4/etc/module.xml index c5f567f999afe64d6783aa50bcc616408fc6f7ab..da26afb898ef71421f2608ae9c8a3de58638fdca 100644 --- a/dev/tests/api-functional/_files/Magento/TestModule4/etc/module.xml +++ b/dev/tests/api-functional/_files/Magento/TestModule4/etc/module.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_TestModule4" setup_version="1.0"/> </config> diff --git a/dev/tests/api-functional/_files/Magento/TestModule4/etc/webapi.xml b/dev/tests/api-functional/_files/Magento/TestModule4/etc/webapi.xml index 4bca1a4f2e27cc2689b818ac6caa14801167ae61..856fa0512c4a43426bb9f1cee7d76fc59bc377e1 100644 --- a/dev/tests/api-functional/_files/Magento/TestModule4/etc/webapi.xml +++ b/dev/tests/api-functional/_files/Magento/TestModule4/etc/webapi.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../app/code/Magento/Webapi/etc/webapi.xsd"> +<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd"> <route method="GET" url="/V1/testmodule4/:id"> <service class="Magento\TestModule4\Service\V1\DataObjectServiceInterface" method="getData" /> <resources> diff --git a/dev/tests/api-functional/_files/Magento/TestModule4/registration.php b/dev/tests/api-functional/_files/Magento/TestModule4/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..f34d5f6b94c1b48d3c7d116d4909297f2a84d0ae --- /dev/null +++ b/dev/tests/api-functional/_files/Magento/TestModule4/registration.php @@ -0,0 +1,12 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +use Magento\Framework\Component\ComponentRegistrar; + +$registrar = new ComponentRegistrar(); +if ($registrar->getPath(ComponentRegistrar::MODULE, 'Magento_TestModule4') === null) { + ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_TestModule4', __DIR__); +} diff --git a/dev/tests/api-functional/_files/Magento/TestModule5/etc/acl.xml b/dev/tests/api-functional/_files/Magento/TestModule5/etc/acl.xml index 13985075d96f2a739b404c482d5c0a5e53d4d6fb..9e333331f109d111709ccc24aa1551b8b94a0742 100644 --- a/dev/tests/api-functional/_files/Magento/TestModule5/etc/acl.xml +++ b/dev/tests/api-functional/_files/Magento/TestModule5/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/dev/tests/api-functional/_files/Magento/TestModule5/etc/di.xml b/dev/tests/api-functional/_files/Magento/TestModule5/etc/di.xml index a4c2c72802362aefda36e478e02d28b55769b9a4..378ccdd0a91497f2cbd2a4fb5202fb3f4b9f95aa 100644 --- a/dev/tests/api-functional/_files/Magento/TestModule5/etc/di.xml +++ b/dev/tests/api-functional/_files/Magento/TestModule5/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\TestModule5\Service\V1\AllSoapAndRestInterface" type="Magento\TestModule5\Service\V1\AllSoapAndRest" /> <preference for="Magento\TestModule5\Service\V2\AllSoapAndRestInterface" type="Magento\TestModule5\Service\V2\AllSoapAndRest" /> <preference for="Magento\TestModule5\Service\V1\OverrideServiceInterface" type="Magento\TestModule5\Service\V1\OverrideService" /> diff --git a/dev/tests/api-functional/_files/Magento/TestModule5/etc/module.xml b/dev/tests/api-functional/_files/Magento/TestModule5/etc/module.xml index c1acfbb9925e58098fc953530a5145ae4f5ebb4b..fce2148a6a4e3a48b284af30b0aef90a10f7f850 100644 --- a/dev/tests/api-functional/_files/Magento/TestModule5/etc/module.xml +++ b/dev/tests/api-functional/_files/Magento/TestModule5/etc/module.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_TestModule5" setup_version="1.0"/> </config> diff --git a/dev/tests/api-functional/_files/Magento/TestModule5/etc/webapi.xml b/dev/tests/api-functional/_files/Magento/TestModule5/etc/webapi.xml index 646669601cd1180842ca6ed4cc3a669b7a90d78d..ed872d53f4cdb4ffcf42961ea7a3a1ac49078766 100644 --- a/dev/tests/api-functional/_files/Magento/TestModule5/etc/webapi.xml +++ b/dev/tests/api-functional/_files/Magento/TestModule5/etc/webapi.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../app/code/Magento/Webapi/etc/webapi.xsd"> +<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd"> <route method="GET" url="/V1/TestModule5/:entityId"> <service class="Magento\TestModule5\Service\V1\AllSoapAndRestInterface" method="item" /> <resources> diff --git a/dev/tests/api-functional/_files/Magento/TestModule5/registration.php b/dev/tests/api-functional/_files/Magento/TestModule5/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..38d8aead790c892d5bdde6868885adc2d286e990 --- /dev/null +++ b/dev/tests/api-functional/_files/Magento/TestModule5/registration.php @@ -0,0 +1,12 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +use Magento\Framework\Component\ComponentRegistrar; + +$registrar = new ComponentRegistrar(); +if ($registrar->getPath(ComponentRegistrar::MODULE, 'Magento_TestModule5') === null) { + ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_TestModule5', __DIR__); +} diff --git a/dev/tests/api-functional/_files/Magento/TestModuleIntegrationFromConfig/composer.json b/dev/tests/api-functional/_files/Magento/TestModuleIntegrationFromConfig/composer.json index 94e22b8ce34f7121c55f6841ac7d966710845df8..b468d7a34d117ba96e2b91b448eb808d5f5a4fd7 100644 --- a/dev/tests/api-functional/_files/Magento/TestModuleIntegrationFromConfig/composer.json +++ b/dev/tests/api-functional/_files/Magento/TestModuleIntegrationFromConfig/composer.json @@ -4,8 +4,7 @@ "require": { "php": "~5.5.0|~5.6.0|~7.0.0", "magento/framework": "0.42.0-beta8", - "magento/module-integration": "0.42.0-beta8", - "magento/magento-composer-installer": "*" + "magento/module-integration": "0.42.0-beta8" }, "type": "magento2-module", "version": "1.0", diff --git a/dev/tests/api-functional/_files/Magento/TestModuleIntegrationFromConfig/etc/module.xml b/dev/tests/api-functional/_files/Magento/TestModuleIntegrationFromConfig/etc/module.xml index 4f181b662e4301ed84f602aebd744d6d2aa7eb5b..edcf2feae75aee6931c8e31708fc46e74b15113d 100644 --- a/dev/tests/api-functional/_files/Magento/TestModuleIntegrationFromConfig/etc/module.xml +++ b/dev/tests/api-functional/_files/Magento/TestModuleIntegrationFromConfig/etc/module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_TestModuleIntegrationFromConfig" setup_version="0.0.1" active="true"> </module> </config> diff --git a/dev/tests/api-functional/_files/Magento/TestModuleIntegrationFromConfig/registration.php b/dev/tests/api-functional/_files/Magento/TestModuleIntegrationFromConfig/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..bc738c90452e2918015d0eb20c786c009bf684a4 --- /dev/null +++ b/dev/tests/api-functional/_files/Magento/TestModuleIntegrationFromConfig/registration.php @@ -0,0 +1,12 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +use Magento\Framework\Component\ComponentRegistrar; + +$registrar = new ComponentRegistrar(); +if ($registrar->getPath(ComponentRegistrar::MODULE, 'Magento_TestModuleIntegrationFromConfig') === null) { + ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_TestModuleIntegrationFromConfig', __DIR__); +} diff --git a/dev/tests/api-functional/_files/Magento/TestModuleJoinDirectives/composer.json b/dev/tests/api-functional/_files/Magento/TestModuleJoinDirectives/composer.json index 79f495c955a1699d215de201bfacb9d1e29a1e79..87d1e31c894dfa58e51fc4f7bee2ccfbe05f3708 100644 --- a/dev/tests/api-functional/_files/Magento/TestModuleJoinDirectives/composer.json +++ b/dev/tests/api-functional/_files/Magento/TestModuleJoinDirectives/composer.json @@ -4,8 +4,7 @@ "require": { "php": "~5.5.0|~5.6.0|~7.0.0", "magento/framework": "0.42.0-beta8", - "magento/module-sales": "0.42.0-beta8", - "magento/magento-composer-installer": "*" + "magento/module-sales": "0.42.0-beta8" }, "type": "magento2-module", "version": "1.0", diff --git a/dev/tests/api-functional/_files/Magento/TestModuleJoinDirectives/etc/acl.xml b/dev/tests/api-functional/_files/Magento/TestModuleJoinDirectives/etc/acl.xml index 6f0216da051a41b041223165ab6afb8ff4801314..bcdf568265190ce3d17e9ad695660977e40c54df 100644 --- a/dev/tests/api-functional/_files/Magento/TestModuleJoinDirectives/etc/acl.xml +++ b/dev/tests/api-functional/_files/Magento/TestModuleJoinDirectives/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/dev/tests/api-functional/_files/Magento/TestModuleJoinDirectives/etc/di.xml b/dev/tests/api-functional/_files/Magento/TestModuleJoinDirectives/etc/di.xml index 8dfb257cc66be47c49b85fbe103ac435f100dc03..60c779000a7eb7315c098386c52b184f52d4327f 100644 --- a/dev/tests/api-functional/_files/Magento/TestModuleJoinDirectives/etc/di.xml +++ b/dev/tests/api-functional/_files/Magento/TestModuleJoinDirectives/etc/di.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\TestModuleJoinDirectives\Api\TestRepositoryInterface" type="Magento\TestModuleJoinDirectives\Model\TestRepository" /> </config> diff --git a/dev/tests/api-functional/_files/Magento/TestModuleJoinDirectives/etc/extension_attributes.xml b/dev/tests/api-functional/_files/Magento/TestModuleJoinDirectives/etc/extension_attributes.xml index e20f73c0d237f691ad9717431637d4388abc218c..0173532921c451aaf17bdabc294dcfbc0a26d1ed 100644 --- a/dev/tests/api-functional/_files/Magento/TestModuleJoinDirectives/etc/extension_attributes.xml +++ b/dev/tests/api-functional/_files/Magento/TestModuleJoinDirectives/etc/extension_attributes.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../lib/internal/Magento/Framework/Api/etc/extension_attributes.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> <extension_attributes for="Magento\Quote\Api\Data\CartInterface"> <attribute code="quoteApiTestAttribute" type="Magento\User\Api\Data\UserInterface"> <join reference_table="admin_user" diff --git a/dev/tests/api-functional/_files/Magento/TestModuleJoinDirectives/etc/module.xml b/dev/tests/api-functional/_files/Magento/TestModuleJoinDirectives/etc/module.xml index b17690769cddce26ddd664451bc659eaae79ad07..09e879995421b2d8c5784dbc76fe8aa54f660d42 100644 --- a/dev/tests/api-functional/_files/Magento/TestModuleJoinDirectives/etc/module.xml +++ b/dev/tests/api-functional/_files/Magento/TestModuleJoinDirectives/etc/module.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_TestModuleJoinDirectives" setup_version="1.0"/> </config> diff --git a/dev/tests/api-functional/_files/Magento/TestModuleJoinDirectives/etc/webapi.xml b/dev/tests/api-functional/_files/Magento/TestModuleJoinDirectives/etc/webapi.xml index 8e47fcbe525b2d663487458b1fb66b60c8b730c3..84783e8a3268c27a0004a33f6d97623d2c6b789b 100644 --- a/dev/tests/api-functional/_files/Magento/TestModuleJoinDirectives/etc/webapi.xml +++ b/dev/tests/api-functional/_files/Magento/TestModuleJoinDirectives/etc/webapi.xml @@ -6,7 +6,7 @@ */ --> <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../app/code/Magento/Webapi/etc/webapi.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd"> <route url="/V1/TestModuleJoinDirectives" method="GET"> <service class="Magento\TestModuleJoinDirectives\Api\TestRepositoryInterface" method="getList"/> diff --git a/dev/tests/api-functional/_files/Magento/TestModuleJoinDirectives/registration.php b/dev/tests/api-functional/_files/Magento/TestModuleJoinDirectives/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..e994c8163c5f667a8d67dfc4ab1011204408d576 --- /dev/null +++ b/dev/tests/api-functional/_files/Magento/TestModuleJoinDirectives/registration.php @@ -0,0 +1,12 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +use Magento\Framework\Component\ComponentRegistrar; + +$registrar = new ComponentRegistrar(); +if ($registrar->getPath(ComponentRegistrar::MODULE, 'Magento_TestModuleJoinDirectives') === null) { + ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_TestModuleJoinDirectives', __DIR__); +} diff --git a/dev/tests/api-functional/_files/Magento/TestModuleMSC/etc/acl.xml b/dev/tests/api-functional/_files/Magento/TestModuleMSC/etc/acl.xml index 556e568f1a61ca0118ce47707882422b74c822b1..240a5dc90d85fea97a955006c91e31084480376e 100644 --- a/dev/tests/api-functional/_files/Magento/TestModuleMSC/etc/acl.xml +++ b/dev/tests/api-functional/_files/Magento/TestModuleMSC/etc/acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Magento_Backend::admin"> diff --git a/dev/tests/api-functional/_files/Magento/TestModuleMSC/etc/di.xml b/dev/tests/api-functional/_files/Magento/TestModuleMSC/etc/di.xml index 161068bca3d284f35327f2b9d59e61830979416f..737a9f3b1092461726f79e515e7cbf8638eb0f59 100644 --- a/dev/tests/api-functional/_files/Magento/TestModuleMSC/etc/di.xml +++ b/dev/tests/api-functional/_files/Magento/TestModuleMSC/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\TestModuleMSC\Api\AllSoapAndRestInterface" type="Magento\TestModuleMSC\Model\AllSoapAndRest" /> diff --git a/dev/tests/api-functional/_files/Magento/TestModuleMSC/etc/extension_attributes.xml b/dev/tests/api-functional/_files/Magento/TestModuleMSC/etc/extension_attributes.xml index 7682e3bed03be597c899c14b919d65ce572e29ce..3d511d7cea54a3806ffee276b73dad1619cf8b9e 100644 --- a/dev/tests/api-functional/_files/Magento/TestModuleMSC/etc/extension_attributes.xml +++ b/dev/tests/api-functional/_files/Magento/TestModuleMSC/etc/extension_attributes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/Api/etc/extension_attributes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> <extension_attributes for="Magento\TestModuleMSC\Api\Data\ItemInterface"> <attribute code="custom_attribute_data_object" type="Magento\TestModuleMSC\Api\Data\CustomAttributeDataObjectInterface" /> <attribute code="custom_attribute_string" type="string" /> diff --git a/dev/tests/api-functional/_files/Magento/TestModuleMSC/etc/module.xml b/dev/tests/api-functional/_files/Magento/TestModuleMSC/etc/module.xml index 138ae61a91b281c8432928b2c9253087f0f44f73..eb33ef4bfffbab95e9047529c12e7fe75bd7900f 100644 --- a/dev/tests/api-functional/_files/Magento/TestModuleMSC/etc/module.xml +++ b/dev/tests/api-functional/_files/Magento/TestModuleMSC/etc/module.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_TestModuleMSC" setup_version="1.0"/> </config> diff --git a/dev/tests/api-functional/_files/Magento/TestModuleMSC/etc/webapi.xml b/dev/tests/api-functional/_files/Magento/TestModuleMSC/etc/webapi.xml index 022aca4ab88578cfc4adb6647f830216bf125d25..81aa06f3ca9c092faf04946983865efc3c39b904 100644 --- a/dev/tests/api-functional/_files/Magento/TestModuleMSC/etc/webapi.xml +++ b/dev/tests/api-functional/_files/Magento/TestModuleMSC/etc/webapi.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../app/code/Magento/Webapi/etc/webapi.xsd"> +<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd"> <route method="GET" url="/V1/testmoduleMSC/overwritten"> <service class="Magento\TestModuleMSC\Api\AllSoapAndRestInterface" method="item" /> diff --git a/dev/tests/api-functional/_files/Magento/TestModuleMSC/registration.php b/dev/tests/api-functional/_files/Magento/TestModuleMSC/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..4f61cb92ff5f14223dcf5418a37a3e7037ca6f6e --- /dev/null +++ b/dev/tests/api-functional/_files/Magento/TestModuleMSC/registration.php @@ -0,0 +1,12 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +use Magento\Framework\Component\ComponentRegistrar; + +$registrar = new ComponentRegistrar(); +if ($registrar->getPath(ComponentRegistrar::MODULE, 'Magento_TestModuleMSC') === null) { + ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_TestModuleMSC', __DIR__); +} diff --git a/dev/tests/api-functional/framework/Magento/TestFramework/TestCase/Webapi/Adapter/Soap.php b/dev/tests/api-functional/framework/Magento/TestFramework/TestCase/Webapi/Adapter/Soap.php index 0a6125fd5fbf923b783d1b77ba86455419279c24..80e9cebd7c585d30c66a9a32f9e301795cc6eddc 100644 --- a/dev/tests/api-functional/framework/Magento/TestFramework/TestCase/Webapi/Adapter/Soap.php +++ b/dev/tests/api-functional/framework/Magento/TestFramework/TestCase/Webapi/Adapter/Soap.php @@ -122,13 +122,14 @@ class Soap implements \Magento\TestFramework\TestCase\Webapi\AdapterInterface /** Sort list of services to avoid having different WSDL URLs for the identical lists of services. */ //TODO: This may change since same resource of multiple versions may be allowed after namespace changes ksort($services); - /** @var \Magento\Store\Model\StoreManagerInterface $storeManager */ - $storeCode = $storeCode !== null - ? (string)$storeCode - : Bootstrap::getObjectManager() + if ($storeCode == null) { + $storeCode = Bootstrap::getObjectManager() ->get('Magento\Store\Model\StoreManagerInterface') ->getStore() ->getCode(); + } elseif ($storeCode === \Magento\Webapi\Controller\PathProcessor::ALL_STORE_CODE) { + $storeCode = \Magento\Store\Model\Store::ADMIN_CODE; + } /** TESTS_BASE_URL is initialized in PHPUnit configuration */ $wsdlUrl = rtrim(TESTS_BASE_URL, '/') . self::WSDL_BASE_PATH . '/' . $storeCode . '?wsdl=1&services='; diff --git a/dev/tests/api-functional/framework/autoload.php b/dev/tests/api-functional/framework/autoload.php index 63ab601cb8cc7775802280a3f9d5423846b8fa28..f75e626e050a7cdca54c2b99f8bf1c6d5bca41b7 100644 --- a/dev/tests/api-functional/framework/autoload.php +++ b/dev/tests/api-functional/framework/autoload.php @@ -13,3 +13,6 @@ $autoloadWrapper = \Magento\Framework\Autoload\AutoloaderRegistry::getAutoloader $autoloadWrapper->addPsr4('Magento\\TestFramework\\', "{$testsBaseDir}/framework/Magento/TestFramework/"); $autoloadWrapper->addPsr4('Magento\\TestFramework\\', "{$integrationTestsDir}/framework/Magento/TestFramework/"); $autoloadWrapper->addPsr4('Magento\\', "{$testsBaseDir}/testsuite/Magento/"); + +// registration of classes under '../_files' +$autoloadWrapper->addPsr4('Magento\\', "{$testsBaseDir}/_files/"); diff --git a/dev/tests/api-functional/framework/bootstrap.php b/dev/tests/api-functional/framework/bootstrap.php index 0544be7705c0018ecdba878f9ac75a4dfc8d0ec9..20987b36e540034058a61f40637241ec41836706 100644 --- a/dev/tests/api-functional/framework/bootstrap.php +++ b/dev/tests/api-functional/framework/bootstrap.php @@ -37,6 +37,16 @@ foreach ($iterator as $file) { } unset($iterator, $file); +// Register the modules under '_files/' +$pathPattern = $pathToInstalledMagentoInstanceModules . '/TestModule*/registration.php'; +$files = glob($pathPattern, GLOB_NOSORT); +if ($files === false) { + throw new \RuntimeException('glob() returned error while searching in \'' . $pathPattern . '\''); +} +foreach ($files as $file) { + include $file; +} + /* Bootstrap the application */ $settings = new \Magento\TestFramework\Bootstrap\Settings($testsBaseDir, get_defined_constants()); $shell = new \Magento\Framework\Shell(new \Magento\Framework\Shell\CommandRenderer(), $logger); @@ -80,5 +90,15 @@ $bootstrap->runBootstrap(); $application->initialize(); \Magento\TestFramework\Helper\Bootstrap::setInstance(new \Magento\TestFramework\Helper\Bootstrap($bootstrap)); -\Magento\Framework\App\Utility\Files::setInstance(new \Magento\Framework\App\Utility\Files(BP)); +$dirSearch = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create('Magento\Framework\Component\DirSearch'); +$themePackageList = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create('Magento\Framework\View\Design\Theme\ThemePackageList'); +\Magento\Framework\App\Utility\Files::setInstance( + new \Magento\Framework\App\Utility\Files( + new \Magento\Framework\Component\ComponentRegistrar(), + $dirSearch, + $themePackageList + ) +); unset($bootstrap, $application, $settings, $shell); diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/CartItemRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/CartItemRepositoryTest.php new file mode 100644 index 0000000000000000000000000000000000000000..dbd5c8b3d2eeb6e72499a855bba0de053f446ca3 --- /dev/null +++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/CartItemRepositoryTest.php @@ -0,0 +1,182 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Catalog\Api; + +use Magento\TestFramework\TestCase\WebapiAbstract; +use Magento\Catalog\Api\Data\ProductCustomOptionInterface; +use Magento\ConfigurableProduct\Model\Product\Type\Configurable; + +class CartItemRepositoryTest extends WebapiAbstract +{ + const SERVICE_NAME = 'quoteCartItemRepositoryV1'; + const SERVICE_VERSION = 'V1'; + const RESOURCE_PATH = '/V1/carts/items'; + const SIMPLE_PRODUCT_SKU = 'simple'; + + /** + * @var \Magento\TestFramework\ObjectManager + */ + protected $objectManager; + + protected function setUp() + { + $this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + } + + /** + * @magentoApiDataFixture Magento/Checkout/_files/active_quote.php + * @magentoApiDataFixture Magento/Catalog/_files/product_simple.php + */ + public function testAddProductToCartWithCustomOptions() + { + $productRepository = $this->objectManager->create('Magento\Catalog\Api\ProductRepositoryInterface'); + /** @var \Magento\Catalog\Api\Data\ProductInterface $product */ + $product = $productRepository->get(self::SIMPLE_PRODUCT_SKU); + + /** @var \Magento\Quote\Model\Quote $quote */ + $quote = $this->objectManager->create('Magento\Quote\Model\Quote'); + $quote->load('test_order_1', 'reserved_order_id'); + $cartId = $quote->getId(); + + $serviceInfo = [ + 'rest' => [ + 'resourcePath' => self::RESOURCE_PATH, + 'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_POST + ], + 'soap' => [ + 'service' => self::SERVICE_NAME, + 'serviceVersion' => self::SERVICE_VERSION, + 'operation' => self::SERVICE_NAME . 'Save', + ], + ]; + $response = $this->_webApiCall($serviceInfo, $this->getRequestData($cartId)); + $this->assertTrue($quote->hasProductId($product->getId())); + $this->assertEquals(1, count($quote->getAllItems())); + /** @var \Magento\Quote\Api\Data\CartItemInterface $item */ + $item = $quote->getAllItems()[0]; + $this->assertEquals( + [ + 'item_id' => $item->getItemId(), + 'sku' => $item->getSku(), + 'qty' => $item->getQty(), + 'name' => $item->getName(), + + 'product_type' => $item->getProductType(), + 'quote_id' => $item->getQuoteId(), + 'product_option' => [ + 'extension_attributes' => [ + 'custom_options' => $this->getOptions(), + ], + ], + ], + $response + ); + } + + /** + * @magentoApiDataFixture Magento/Catalog/_files/quote_with_product_and_custom_options.php + */ + public function testGetList() + { + /** @var \Magento\Quote\Model\Quote $quote */ + $quote = $this->objectManager->create('Magento\Quote\Model\Quote'); + $quote->load('test_order_1', 'reserved_order_id'); + $cartId = $quote->getId(); + + $serviceInfo = [ + 'rest' => [ + 'resourcePath' => '/V1/carts/' . $cartId . '/items', + 'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_GET + ], + 'soap' => [ + 'service' => self::SERVICE_NAME, + 'serviceVersion' => self::SERVICE_VERSION, + 'operation' => self::SERVICE_NAME . 'GetList', + ], + ]; + $response = $this->_webApiCall($serviceInfo, ['cartId' => $cartId]); + + $this->assertGreaterThan(0, count($response)); + $item = $response[0]; + + $this->assertNotNull($item['item_id']); + $this->assertArrayHasKey('product_option', $item); + $this->assertArrayHasKey('extension_attributes', $item['product_option']); + $this->assertArrayHasKey('custom_options', $item['product_option']['extension_attributes']); + $this->assertGreaterThan(3, count($item['product_option']['extension_attributes']['custom_options'])); + $option = reset($item['product_option']['extension_attributes']['custom_options']); + $this->assertArrayHasKey('option_id', $option); + $this->assertArrayHasKey('option_value', $option); + } + + /** + * Receive product options with values + * + * @return array + */ + protected function getOptions() + { + /** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */ + $productRepository = $this->objectManager->create('Magento\Catalog\Api\ProductRepositoryInterface'); + $product = $productRepository->get(self::SIMPLE_PRODUCT_SKU); + $options = []; + /** @var ProductCustomOptionInterface $option */ + foreach ($product->getOptions() as $option) { + $options[] = [ + 'option_id' => $option->getId(), + 'option_value' => $this->getOptionRequestValue($option), + ]; + } + + return $options; + } + + /** + * @param $cartId + * @return array + */ + protected function getRequestData($cartId) + { + return [ + 'cartItem' => [ + 'sku' => self::SIMPLE_PRODUCT_SKU, + 'qty' => 1, + 'quote_id' => $cartId, + 'product_option' => [ + 'extension_attributes' => [ + 'custom_options' => $this->getOptions(), + ], + ], + ], + ]; + } + + /** + * Receive option value based on option type + * + * @param ProductCustomOptionInterface $option + * @return null|string + */ + protected function getOptionRequestValue(ProductCustomOptionInterface $option) + { + $returnValue = null; + switch ($option->getType()) { + case 'field': + $returnValue = 'Test value'; + break; + case 'date_time': + $returnValue = '2015-09-09 07:16:00'; + break; + case 'drop_down': + $returnValue = '3-1-select'; + break; + case 'radio': + $returnValue = '4-1-radio'; + break; + } + return $returnValue; + } +} diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRepositoryInterfaceTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRepositoryInterfaceTest.php index 9389a8de506f0088eeea6e1a5f32a9bd501c4e3d..a4e575526562a01fa40e60cec7a47c1e7ead4d2a 100644 --- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRepositoryInterfaceTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRepositoryInterfaceTest.php @@ -6,6 +6,7 @@ namespace Magento\Catalog\Api; use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Store\Model\Store; use Magento\CatalogInventory\Api\Data\StockItemInterface; use Magento\TestFramework\TestCase\WebapiAbstract; use Magento\Framework\Webapi\Exception as HTTPExceptionCodes; @@ -52,7 +53,12 @@ class ProductRepositoryInterfaceTest extends WebapiAbstract } } - protected function getProduct($sku) + /** + * @param string $sku + * @param string|null $storeCode + * @return array|bool|float|int|string + */ + protected function getProduct($sku, $storeCode = null) { $serviceInfo = [ 'rest' => [ @@ -66,7 +72,7 @@ class ProductRepositoryInterfaceTest extends WebapiAbstract ], ]; - $response = $this->_webApiCall($serviceInfo, ['sku' => $sku]); + $response = $this->_webApiCall($serviceInfo, ['sku' => $sku], null, $storeCode); return $response; } @@ -130,10 +136,56 @@ class ProductRepositoryInterfaceTest extends WebapiAbstract $this->deleteProduct($product[ProductInterface::SKU]); } + /** + * @param array $fixtureProduct + * + * @dataProvider productCreationProvider + * @magentoApiDataFixture Magento/Store/_files/core_fixturestore.php + */ + public function testCreateAllStoreCode($fixtureProduct) + { + $response = $this->saveProduct($fixtureProduct, 'all'); + $this->assertArrayHasKey(ProductInterface::SKU, $response); + + /** @var \Magento\Store\Model\StoreManagerInterface $storeManager */ + $storeManager = \Magento\TestFramework\ObjectManager::getInstance()->get( + 'Magento\Store\Model\StoreManagerInterface' + ); + + foreach ($storeManager->getStores(true) as $store) { + $code = $store->getCode(); + if ($code === Store::ADMIN_CODE) { + continue; + } + $this->assertArrayHasKey( + ProductInterface::SKU, + $this->getProduct($fixtureProduct[ProductInterface::SKU], $code) + ); + } + $this->deleteProduct($fixtureProduct[ProductInterface::SKU]); + } + + /** + * @param array $fixtureProduct + * + * @dataProvider productCreationProvider + * @magentoApiDataFixture Magento/Store/_files/core_fixturestore.php + */ + public function testDeleteAllStoreCode($fixtureProduct) + { + $sku = $fixtureProduct[ProductInterface::SKU]; + $this->saveProduct($fixtureProduct); + $this->setExpectedException('Exception', 'Requested product doesn\'t exist'); + + // Delete all with 'all' store code + $this->deleteProduct($sku, 'all'); + $this->getProduct($sku); + } + public function testProductLinks() { // Create simple product - $productData = [ + $productData = [ ProductInterface::SKU => "product_simple_500", ProductInterface::NAME => "Product Simple 500", ProductInterface::VISIBILITY => 4, @@ -217,6 +269,9 @@ class ProductRepositoryInterfaceTest extends WebapiAbstract $this->deleteProduct("product_simple_with_related_500"); } + /** + * @return array + */ protected function getOptionsData() { return [ @@ -436,6 +491,10 @@ class ProductRepositoryInterfaceTest extends WebapiAbstract $this->assertEquals($productData[ProductInterface::SKU], $response[ProductInterface::SKU]); } + /** + * @param array $product + * @return array|bool|float|int|string + */ protected function updateProduct($product) { $sku = $product[ProductInterface::SKU]; @@ -517,6 +576,10 @@ class ProductRepositoryInterfaceTest extends WebapiAbstract $this->assertEquals('simple', $response['items'][0]['sku']); } + /** + * @param $customAttributes + * @return array + */ protected function convertCustomAttributesToAssociativeArray($customAttributes) { $converted = []; @@ -526,6 +589,10 @@ class ProductRepositoryInterfaceTest extends WebapiAbstract return $converted; } + /** + * @param $data + * @return array + */ protected function convertAssociativeArrayToCustomAttributes($data) { $customAttributes = []; @@ -590,9 +657,10 @@ class ProductRepositoryInterfaceTest extends WebapiAbstract /** * @param $product + * @param string|null $storeCode * @return mixed */ - protected function saveProduct($product) + protected function saveProduct($product, $storeCode = null) { $serviceInfo = [ 'rest' => [ @@ -606,7 +674,7 @@ class ProductRepositoryInterfaceTest extends WebapiAbstract ], ]; $requestData = ['product' => $product]; - return $this->_webApiCall($serviceInfo, $requestData); + return $this->_webApiCall($serviceInfo, $requestData, null, $storeCode); } /** diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderCreateTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderCreateTest.php index 6adfff3a65a3c829758654af1681bce6a590aedb..62fdaf56265463d61b210b1c6b66e2fb3e726177 100644 --- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderCreateTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderCreateTest.php @@ -5,8 +5,8 @@ */ namespace Magento\Sales\Service\V1; -use Magento\Sales\Api\Data\OrderInterface; use Magento\TestFramework\TestCase\WebapiAbstract; +use Magento\Catalog\Api\Data\ProductCustomOptionInterface; class OrderCreateTest extends WebapiAbstract { @@ -57,6 +57,7 @@ class OrderCreateTest extends WebapiAbstract } else { $orderItem->setData('parent_item', ['weight' => 1]); } + $orderPayment->setCcLast4('4444'); $orderPayment->setMethod('checkmo'); $orderPayment->setAccountStatus('ok'); @@ -64,6 +65,9 @@ class OrderCreateTest extends WebapiAbstract $order->setCustomerEmail($email); $order->setBaseGrandTotal(100); $order->setGrandTotal(100); + + $this->addProductOption($orderItem); + $order->setItems([$orderItem->getData()]); $order->setPayments([$orderPayment->getData()]); @@ -106,6 +110,55 @@ class OrderCreateTest extends WebapiAbstract return $data; } + /** + * @param array $orderItem + * @return array + */ + protected function addProductOption($orderItem) + { + /** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */ + $productRepository = $this->objectManager->create('Magento\Catalog\Api\ProductRepositoryInterface'); + $product = $productRepository->get('simple'); + $options = []; + foreach ($product->getOptions() as $option) { + $options[] = [ + 'option_id' => $option->getId(), + 'option_value' => $this->getOptionRequestValue($option), + ]; + } + $data['extension_attributes']['custom_options'] = $options; + $orderItem->setData('product_option', $data); + $orderItem->setPrice(10); + $orderItem->setBasePrice(10); + } + + /** + * @param ProductCustomOptionInterface $option + * @return null|string + */ + protected function getOptionRequestValue(ProductCustomOptionInterface $option) + { + $returnValue = null; + switch ($option->getType()) { + case 'field': + $returnValue = 'Test value'; + break; + case 'date_time': + $returnValue = '2015-09-09 07:16:00'; + break; + case 'drop_down': + $returnValue = '3-1-select'; + break; + case 'radio': + $returnValue = '4-1-radio'; + break; + } + return $returnValue; + } + + /** + * @magentoApiDataFixture Magento/Catalog/_files/product_simple.php + */ public function testOrderCreate() { $order = $this->prepareOrder(); diff --git a/dev/tests/functional/etc/di.xml b/dev/tests/functional/etc/di.xml index f5c0c4c6c8d986c924d178f0322f478277d3c4c8..6032848a021533f6c0196320cb746625caf565f5 100644 --- a/dev/tests/functional/etc/di.xml +++ b/dev/tests/functional/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <virtualType name="Magento\Mtf\Config\SchemaLocator\Config" type="Magento\Mtf\Config\SchemaLocator"> <arguments> <argument name="schemaPath" xsi:type="string">etc/config.xsd</argument> diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/etc/di.xml b/dev/tests/functional/tests/app/Magento/Backend/Test/etc/di.xml index ba16bc1f7220b03ccf0a2efacf445d9ff9dab6bc..3a01bc0a3641b29ad1dd1a4f8e755dfceab557b7 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/etc/di.xml +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"> <arguments> <argument name="severity" xsi:type="string">high</argument> diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Magento/Bundle/Test/etc/curl/di.xml index 6b3cc2054d4b9c6ea04bf36666e5e80dc7656c74..7cf3829b1de5ebaf06c1bdcc0c999de75606966e 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/etc/curl/di.xml +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/etc/curl/di.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Bundle\Test\Handler\BundleProduct\BundleProductInterface" type="Magento\Bundle\Test\Handler\BundleProduct\Curl" /> </config> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/curl/di.xml index d8489abb27011af32e334f82e0240c0f64d357a3..784b55b1539d2f0407bfaa9950b60e3eb35aa61b 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/curl/di.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/curl/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Catalog\Test\Handler\CatalogProductSimple\CatalogProductSimpleInterface" type="\Magento\Catalog\Test\Handler\CatalogProductSimple\Curl" /> <preference for="Magento\Catalog\Test\Handler\CatalogProductAttribute\CatalogProductAttributeInterface" type="\Magento\Catalog\Test\Handler\CatalogProductAttribute\Curl" /> <preference for="Magento\Catalog\Test\Handler\CatalogAttributeSet\CatalogAttributeSetInterface" type="\Magento\Catalog\Test\Handler\CatalogAttributeSet\Curl" /> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/di.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/di.xml index 943aeda7e34236b6988914177b7d026e4e20ddc1..c02f461a875785a48b4312fcd154f2ac302b6e85 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/di.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Catalog\Test\Constraint\AssertProductInGrid"> <arguments> <argument name="severity" xsi:type="string">high</argument> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/ui/di.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/ui/di.xml index cac864ebd98722d53080f7c83258171bbdba5b7d..cbe57e9132efe3981eeda3ffc43d1e801ddb7c8b 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/ui/di.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/ui/di.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Catalog\Test\Handler\CatalogProductSimple\CatalogProductSimpleInterface" type="\Magento\Catalog\Test\Handler\CatalogProductSimple\Ui" /> </config> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/webapi/di.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/webapi/di.xml index c00228515bf0d866ee0b7e64ecd7f3d047d62fa4..c743863586b67e7c421bd03cbdd16d21c810d34a 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/webapi/di.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/webapi/di.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Catalog\Test\Handler\Category\CategoryInterface" type="\Magento\Catalog\Test\Handler\Category\Webapi" /> </config> diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/etc/curl/di.xml index 15f9108d3cd87e545ba79d7ed995b39957bd1936..7f08f9d7479e925d43f517a362148da57bb49183 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/etc/curl/di.xml +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/etc/curl/di.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/Magento/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\CatalogRule\Test\Handler\CatalogRule\CatalogRuleInterface" type="\Magento\CatalogRule\Test\Handler\CatalogRule\Curl" /> </config> diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/etc/di.xml b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/etc/di.xml index c2ed9d59e946a726eda03531b9320ba350e8f3b0..71083714d1992b7d47edd8538f95e987ab3827d2 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/etc/di.xml +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\CatalogRule\Test\Constraint\AssertCatalogPriceRuleAppliedProductPage"> <arguments> <argument name="severity" xsi:type="string">high</argument> diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/etc/ui/di.xml b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/etc/ui/di.xml index 53a0f5712500343c1de476c73416391d3628a714..8506f35c6d27b9adb6a48a0878ad0f984b73953a 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/etc/ui/di.xml +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/etc/ui/di.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\CatalogRule\Test\Handler\CatalogRule\CatalogRuleInterface" type="\Magento\CatalogRule\Test\Handler\CatalogRule\Ui" /> </config> diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/etc/curl/di.xml index 22be4044260f20a400620b6bf208575c681b1868..507d531a3b34a311d09a1b614cf318c5e98566ea 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/etc/curl/di.xml +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/etc/curl/di.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\CatalogSearch\Test\Handler\CatalogSearchQuery\CatalogSearchQueryInterface" type="\Magento\CatalogSearch\Test\Handler\CatalogSearchQuery\Curl" /> </config> diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/etc/di.xml b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/etc/di.xml index 66de584a1e52390abae29f3977358bb2319f5808..beffc1bab00bb5170cfc32aa5ec5fe509da6b3d1 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/etc/di.xml +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/etc/di.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\CatalogSearch\Test\Constraint\AssertSuggestSearchingResult"> <arguments> <argument name="severity" xsi:type="string">high</argument> diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/etc/di.xml b/dev/tests/functional/tests/app/Magento/Checkout/Test/etc/di.xml index 9ae4a4104da72d7a4a746f5112e1cff78e9d3f4c..529554a449ec5791b7ad429587c92b6945153365 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/etc/di.xml +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Checkout\Test\Constraint\AssertCartIsEmpty"> <arguments> <argument name="severity" xsi:type="string">middle</argument> diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/etc/curl/di.xml index aeedca9be3ee10e71e2e01ec54bbf363f0d50785..477ecc2ab85141401d0ace8ac9a31c439241ac04 100644 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/etc/curl/di.xml +++ b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/etc/curl/di.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="\Magento\CheckoutAgreements\Test\Handler\CheckoutAgreement\CheckoutAgreementInterface" type="\Magento\CheckoutAgreements\Test\Handler\CheckoutAgreement\Curl" /> </config> diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/etc/di.xml b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/etc/di.xml index 35306626020e50945ee50c136b1d09043c32d1c9..e5e0abc7fef8e109554d9e056532d78e5c6e0e56 100644 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/etc/di.xml +++ b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\CheckoutAgreements\Test\Constraint\AssertTermRequireMessageOnMultishippingCheckout"> <arguments> <argument name="severity" xsi:type="string">high</argument> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/etc/curl/di.xml index 1827e66341e7b0e3aa9d47e1464576a79e3010ee..9cd1091df82c0a36ec52b04e0786625222ad4555 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/etc/curl/di.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/etc/curl/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="\Magento\Cms\Test\Handler\CmsPage\CmsPageInterface" type="\Magento\Cms\Test\Handler\CmsPage\Curl" /> <preference for="\Magento\Cms\Test\Handler\CmsBlock\CmsBlockInterface" type="\Magento\Cms\Test\Handler\CmsBlock\Curl" /> </config> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/etc/di.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/etc/di.xml index 8b297f22903f1ff3ba003043921d6e77f160dc4c..2a57331606293e7e6c38e0267cd7ca524375d13f 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/etc/di.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Cms\Test\Constraint\AssertCmsBlockSuccessSaveMessage"> <arguments> <argument name="severity" xsi:type="string">high</argument> diff --git a/dev/tests/functional/tests/app/Magento/Config/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Magento/Config/Test/etc/curl/di.xml index e965d7cd8e3849d956382799614a0abb97b8c409..2094efcb0babc79202658f38b94b88939d17cdcc 100644 --- a/dev/tests/functional/tests/app/Magento/Config/Test/etc/curl/di.xml +++ b/dev/tests/functional/tests/app/Magento/Config/Test/etc/curl/di.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="\Magento\Config\Test\Handler\ConfigData\ConfigDataInterface" type="\Magento\Config\Test\Handler\ConfigData\Curl" /> </config> diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/etc/curl/di.xml index 21d79c446c3146f2fa80e8d0fb8f13c2604d356a..de180c9e1d90e42581f2fe87571c0a93663912bb 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/etc/curl/di.xml +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/etc/curl/di.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\ConfigurableProduct\Test\Handler\ConfigurableProduct\ConfigurableProductInterface" type="\Magento\ConfigurableProduct\Test\Handler\ConfigurableProduct\Curl" /> </config> diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/etc/di.xml b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/etc/di.xml index fa0df04101e3a2fb4f430bdf917855473588a473..e91c9a2f00796b9e2c1ec40cce39b18a37e849dd 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/etc/di.xml +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductDuplicateForm"> <arguments> <argument name="severity" xsi:type="string">high</argument> diff --git a/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/etc/curl/di.xml index 76bdc279015aec6bcda7177301adf373c955b210..2e82b80d02d574ed6b601fb202e51f1ac136ec7e 100644 --- a/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/etc/curl/di.xml +++ b/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/etc/curl/di.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\CurrencySymbol\Test\Handler\CurrencySymbolEntity\CurrencySymbolEntityInterface" type="\Magento\CurrencySymbol\Test\Handler\CurrencySymbolEntity\Curl" /> </config> diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/etc/curl/di.xml index a4bfc8b95f1d9006d0fc3dfd2e6ba8f36e92303b..8cb2ef46ade797a65790c3cdb8e8272b701ba166 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/etc/curl/di.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/etc/curl/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Customer\Test\Handler\Customer\CustomerInterface" type="\Magento\Customer\Test\Handler\Customer\Curl" /> <preference for="Magento\Customer\Test\Handler\CustomerGroup\CustomerGroupInterface" type="\Magento\Customer\Test\Handler\CustomerGroup\Curl" /> </config> diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/etc/di.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/etc/di.xml index 2c077cd9213c7067a23d0b2813f9bb40585cbe43..f314e6315e00d2c643046da954f22f16fc76719f 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/etc/di.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Customer\Test\Constraint\AssertCustomerInGrid"> <arguments> <argument name="severity" xsi:type="string">middle</argument> diff --git a/dev/tests/functional/tests/app/Magento/Directory/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Magento/Directory/Test/etc/curl/di.xml index 0962d9ed807d9206fb6e31b641e4fa133588097c..c2f7f10b419138b2671e1d0a37816b76c8215a3b 100644 --- a/dev/tests/functional/tests/app/Magento/Directory/Test/etc/curl/di.xml +++ b/dev/tests/functional/tests/app/Magento/Directory/Test/etc/curl/di.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="\Magento\Directory\Test\Handler\CurrencyRate\CurrencyRateInterface" type="\Magento\Directory\Test\Handler\CurrencyRate\Curl" /> </config> diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Magento/Downloadable/Test/etc/curl/di.xml index b5ca90d139bce61748451388bd86049161f497cf..276496dbd53263405c7a313ecb20c542b056221c 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/etc/curl/di.xml +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/etc/curl/di.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Downloadable\Test\Handler\DownloadableProduct\DownloadableProductInterface" type="\Magento\Downloadable\Test\Handler\DownloadableProduct\Curl" /> </config> diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/etc/di.xml b/dev/tests/functional/tests/app/Magento/Downloadable/Test/etc/di.xml index 9b5318e41f044e2ecb242c61a75d8efc534fd7c7..f6a3d72417f137a09cc800fc79743ccd6090af06 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/etc/di.xml +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Downloadable\Test\Constraint\AssertDownloadableDuplicateForm"> <arguments> <argument name="severity" xsi:type="string">high</argument> diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/etc/di.xml b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/etc/di.xml index cab3495f839e76b10b4c65dab842443c0d649add..dd33eccc596019724eea31b2965a5c81e78e0e73 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/etc/di.xml +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\GiftMessage\Test\Constraint\AssertGiftMessageInFrontendOrderItems"> <arguments> <argument name="severity" xsi:type="string">high</argument> diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/etc/curl/di.xml index 9618f07622f4ae9573d8b15b2b78cbe62addc745..3435383b749038ebc2a9cc613b424c5c2c547008 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/etc/curl/di.xml +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/etc/curl/di.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\GroupedProduct\Test\Handler\GroupedProduct\GroupedProductInterface" type="\Magento\GroupedProduct\Test\Handler\GroupedProduct\Curl" /> </config> diff --git a/dev/tests/functional/tests/app/Magento/ImportExport/Test/etc/di.xml b/dev/tests/functional/tests/app/Magento/ImportExport/Test/etc/di.xml index a158ec36c24c875d6a5d3312ed888c27f9e3304d..9b616e741841da08bbd471b2ce9d7c036fc83107 100644 --- a/dev/tests/functional/tests/app/Magento/ImportExport/Test/etc/di.xml +++ b/dev/tests/functional/tests/app/Magento/ImportExport/Test/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\ImportExport\Test\Constraint\AssertProductAttributeAbsenceForExport"> <arguments> <argument name="severity" xsi:type="string">high</argument> diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Magento/Integration/Test/etc/curl/di.xml index 5940556e6ce399ecc9d8801e2ce2805293690dd8..2edf2c6d885601b5890acfb122997ce082a0db4b 100644 --- a/dev/tests/functional/tests/app/Magento/Integration/Test/etc/curl/di.xml +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/etc/curl/di.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="\Magento\Integration\Test\Handler\Integration\IntegrationInterface" type="\Magento\Integration\Test\Handler\Integration\Curl" /> </config> diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/etc/di.xml b/dev/tests/functional/tests/app/Magento/Integration/Test/etc/di.xml index 3dccb56f367d2eea78be9e536c427bb200f856de..db4dfc9649f6d4ce149bdbee13a8847e5ee52e39 100644 --- a/dev/tests/functional/tests/app/Magento/Integration/Test/etc/di.xml +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Integration\Test\Constraint\AssertIntegrationSuccessSaveMessage"> <arguments> <argument name="severity" xsi:type="string">high</argument> diff --git a/dev/tests/functional/tests/app/Magento/Multishipping/Test/etc/di.xml b/dev/tests/functional/tests/app/Magento/Multishipping/Test/etc/di.xml index 02a13ae60a851ff412780b58099cee1a4c8a2437..1d45a2fc03138f387f3f63f97cd200fe1dd5fc7e 100644 --- a/dev/tests/functional/tests/app/Magento/Multishipping/Test/etc/di.xml +++ b/dev/tests/functional/tests/app/Magento/Multishipping/Test/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Multishipping\Test\Constraint\AssertMultishippingOrderSuccessPlacedMessage"> <arguments> <argument name="severity" xsi:type="string">high</argument> diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Magento/Newsletter/Test/etc/curl/di.xml index 9e1a179802c1640d5134d59b1a3c4b2884a7bf03..dbca1eb9511922efce583d0bd0bd7c7e4fa774f4 100644 --- a/dev/tests/functional/tests/app/Magento/Newsletter/Test/etc/curl/di.xml +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/etc/curl/di.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="\Magento\Newsletter\Test\Handler\Template\TemplateInterface" type="\Magento\Newsletter\Test\Handler\Template\Curl" /> </config> diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Magento/Review/Test/etc/curl/di.xml index e82d710374cdaba5feb3fd86e4e171bb2e518b87..5a0d869938400db0a3843d517323d98be1a7cbd5 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/etc/curl/di.xml +++ b/dev/tests/functional/tests/app/Magento/Review/Test/etc/curl/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Review\Test\Handler\Rating\RatingInterface" type="\Magento\Review\Test\Handler\Rating\Curl" /> <preference for="Magento\Review\Test\Handler\Review\ReviewInterface" type="\Magento\Review\Test\Handler\Review\Curl" /> </config> diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/etc/di.xml b/dev/tests/functional/tests/app/Magento/Review/Test/etc/di.xml index 842711c36a35f016e3998944196f98d523b24704..aacfe95cb64bbfc37acddec5f63bcf6d8d03c825 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/etc/di.xml +++ b/dev/tests/functional/tests/app/Magento/Review/Test/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Review\Test\Constraint\AssertProductRatingSuccessSaveMessage"> <arguments> <argument name="severity" xsi:type="string">high</argument> diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/etc/curl/di.xml index 91474944d5ed5891c3fa512b7cd6128f5c65d7fd..28b503367e5af4106142276414a65c40c3dd66eb 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/etc/curl/di.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/etc/curl/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="\Magento\Sales\Test\Handler\OrderInjectable\OrderInjectableInterface" type="\Magento\Sales\Test\Handler\OrderInjectable\Curl" /> <preference for="\Magento\Sales\Test\Handler\OrderStatus\OrderStatusInterface" type="\Magento\Sales\Test\Handler\OrderStatus\Curl" /> </config> diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/etc/di.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/etc/di.xml index c7f026085fd80fb5d5595b0084d1ffd636aeca97..502ef8488167a417ff774378489bb6a5ecf1aed8 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/etc/di.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Sales\Test\Constraint\AssertOrderStatusInGrid"> <arguments> <argument name="severity" xsi:type="string">high</argument> diff --git a/dev/tests/functional/tests/app/Magento/SalesRule/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Magento/SalesRule/Test/etc/curl/di.xml index 3416929d0ab44031cbb7bef4b0d3ac7628cf9139..ec15901a1714b6d677e9be5e28263ac3865d9d6c 100644 --- a/dev/tests/functional/tests/app/Magento/SalesRule/Test/etc/curl/di.xml +++ b/dev/tests/functional/tests/app/Magento/SalesRule/Test/etc/curl/di.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\SalesRule\Test\Handler\SalesRule\SalesRuleInterface" type="\Magento\SalesRule\Test\Handler\SalesRule\Curl" /> </config> diff --git a/dev/tests/functional/tests/app/Magento/Sitemap/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Magento/Sitemap/Test/etc/curl/di.xml index 19d1f590be5875a0b475d3e73833b8824e23ecd8..dbd3da3aed58efca579ada80676d612ca9ea752e 100644 --- a/dev/tests/functional/tests/app/Magento/Sitemap/Test/etc/curl/di.xml +++ b/dev/tests/functional/tests/app/Magento/Sitemap/Test/etc/curl/di.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Sitemap\Test\Handler\Sitemap\SitemapInterface" type="\Magento\Sitemap\Test\Handler\Sitemap\Curl" /> </config> \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Magento/Store/Test/etc/curl/di.xml index 8470849c1b1232f73a91a47ea01e04cb1938bb30..f8e59b8a2fd544cfde5ac45586ecfb7dbcd8e71d 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/etc/curl/di.xml +++ b/dev/tests/functional/tests/app/Magento/Store/Test/etc/curl/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Store\Test\Handler\Store\StoreInterface" type="\Magento\Store\Test\Handler\Store\Curl" /> <preference for="Magento\Store\Test\Handler\StoreGroup\StoreGroupInterface" type="\Magento\Store\Test\Handler\StoreGroup\Curl" /> <preference for="Magento\Store\Test\Handler\Website\WebsiteInterface" type="\Magento\Store\Test\Handler\Website\Curl" /> diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Magento/Tax/Test/etc/curl/di.xml index e700df89f3792f8141733820e2e142c71819fa2a..abbf3847d3707e91e9c4b79c665da51dd04b7bb7 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/etc/curl/di.xml +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/etc/curl/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="\Magento\Tax\Test\Handler\TaxRule\TaxRuleInterface" type="\Magento\Tax\Test\Handler\TaxRule\Curl" /> <preference for="\Magento\Tax\Test\Handler\TaxRate\TaxRateInterface" type="\Magento\Tax\Test\Handler\TaxRate\Curl" /> <preference for="\Magento\Tax\Test\Handler\TaxClass\TaxClassInterface" type="\Magento\Tax\Test\Handler\TaxClass\Curl" /> diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/etc/di.xml b/dev/tests/functional/tests/app/Magento/Tax/Test/etc/di.xml index 00eb021110e48ef82bffbac63bb7ced5555e3a59..4da59d35c161076044a31445d4b1a3b9ee7db225 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/etc/di.xml +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Tax\Test\Constraint\AssertTaxRuleInGrid"> <arguments> <argument name="severity" xsi:type="string">high</argument> diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/etc/curl/di.xml index 70aebb60adf8606c40a323510f95a5ab35409978..48c3ae8fcd1c72ac1bcd553aa31aa27c70289a8e 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/etc/curl/di.xml +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/etc/curl/di.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="\Magento\UrlRewrite\Test\Handler\UrlRewrite\UrlRewriteInterface" type="\Magento\UrlRewrite\Test\Handler\UrlRewrite\Curl" /> </config> diff --git a/dev/tests/functional/tests/app/Magento/User/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Magento/User/Test/etc/curl/di.xml index 7801b2d8fc637c445e6071545c3ef2bd81912d66..0e0a13ecf924e771f45150669c38b34d9563fe67 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/etc/curl/di.xml +++ b/dev/tests/functional/tests/app/Magento/User/Test/etc/curl/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\User\Test\Handler\Role\RoleInterface" type="\Magento\User\Test\Handler\Role\Curl" /> <preference for="Magento\User\Test\Handler\User\UserInterface" type="\Magento\User\Test\Handler\User\Curl" /> </config> \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Magento/Variable/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Magento/Variable/Test/etc/curl/di.xml index b34ba436a54196b1b09b8735b82139b34c744b9e..ab9d0f375024a5b2ccfe27915d068a43338163b2 100644 --- a/dev/tests/functional/tests/app/Magento/Variable/Test/etc/curl/di.xml +++ b/dev/tests/functional/tests/app/Magento/Variable/Test/etc/curl/di.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="\Magento\Variable\Test\Handler\SystemVariable\SystemVariableInterface" type="\Magento\Variable\Test\Handler\SystemVariable\Curl" /> </config> diff --git a/dev/tests/functional/tests/app/Magento/Weee/Test/etc/di.xml b/dev/tests/functional/tests/app/Magento/Weee/Test/etc/di.xml index d8b258e3e689ec554ee475eaf10f07ef1ca47352..c2977101e9d889faee74e9e834a78bb2454c7541 100644 --- a/dev/tests/functional/tests/app/Magento/Weee/Test/etc/di.xml +++ b/dev/tests/functional/tests/app/Magento/Weee/Test/etc/di.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Weee\Test\Constraint\AssertFptApplied"> <arguments> <argument name="severity" xsi:type="string">high</argument> diff --git a/dev/tests/functional/tests/app/Magento/Widget/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Magento/Widget/Test/etc/curl/di.xml index b6ac433250abe74e91e839cc5d93fd0664e04a82..78a68668bbab46384c7ded1ba74aaa84a296d39d 100644 --- a/dev/tests/functional/tests/app/Magento/Widget/Test/etc/curl/di.xml +++ b/dev/tests/functional/tests/app/Magento/Widget/Test/etc/curl/di.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Widget\Test\Handler\Widget\WidgetInterface" type="\Magento\Widget\Test\Handler\Widget\Curl" /> </config> diff --git a/dev/tests/integration/framework/Magento/TestFramework/Annotation/ComponentRegistrarFixture.php b/dev/tests/integration/framework/Magento/TestFramework/Annotation/ComponentRegistrarFixture.php new file mode 100644 index 0000000000000000000000000000000000000000..31a1a302b57a17639daa39d343ab10ffd5507f49 --- /dev/null +++ b/dev/tests/integration/framework/Magento/TestFramework/Annotation/ComponentRegistrarFixture.php @@ -0,0 +1,138 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\TestFramework\Annotation; + +use RecursiveDirectoryIterator; +use RecursiveIteratorIterator; +use RegexIterator; + +/** + * Implementation of the @magentoComponentsDir DocBlock annotation + */ +class ComponentRegistrarFixture +{ + /** + * Annotation name + */ + const ANNOTATION_NAME = 'magentoComponentsDir'; + + /**#@+ + * Properties of components registrar + */ + const REGISTRAR_CLASS = 'Magento\Framework\Component\ComponentRegistrar'; + const PATHS_FIELD = 'paths'; + /**#@-*/ + + /** + * Fixtures base dir + * + * @var string + */ + private $fixtureBaseDir; + + /** + * Original values of registered components + * + * @var array + */ + private $origComponents = null; + + /** + * Constructor + * + * @param string $fixtureBaseDir + */ + public function __construct($fixtureBaseDir) + { + $this->fixtureBaseDir = $fixtureBaseDir; + } + + /** + * Handler for 'startTest' event + * + * @param \PHPUnit_Framework_TestCase $test + * @return void + */ + public function startTest(\PHPUnit_Framework_TestCase $test) + { + $this->registerComponents($test); + } + + /** + * Handler for 'endTest' event + * + * @param \PHPUnit_Framework_TestCase $test + * @return void + * + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function endTest(\PHPUnit_Framework_TestCase $test) + { + $this->restoreComponents(); + } + + /** + * Register fixture components + * + * @param \PHPUnit_Framework_TestCase $test + */ + private function registerComponents(\PHPUnit_Framework_TestCase $test) + { + $annotations = $test->getAnnotations(); + $componentAnnotations = []; + if (isset($annotations['class'][self::ANNOTATION_NAME])) { + $componentAnnotations = array_merge($componentAnnotations, $annotations['class'][self::ANNOTATION_NAME]); + } + if (isset($annotations['method'][self::ANNOTATION_NAME])) { + $componentAnnotations = array_merge($componentAnnotations, $annotations['method'][self::ANNOTATION_NAME]); + } + if (empty($componentAnnotations)) { + return; + } + $componentAnnotations = array_unique($componentAnnotations); + $reflection = new \ReflectionClass(self::REGISTRAR_CLASS); + $paths = $reflection->getProperty(self::PATHS_FIELD); + $paths->setAccessible(true); + $this->origComponents = $paths->getValue(); + $paths->setAccessible(false); + foreach ($componentAnnotations as $fixturePath) { + $fixturesDir = $this->fixtureBaseDir . '/' . $fixturePath; + if (!file_exists($fixturesDir)) { + throw new \InvalidArgumentException( + self::ANNOTATION_NAME . " fixture '$fixturePath' does not exist" + ); + } + $iterator = new RegexIterator( + new RecursiveIteratorIterator( + new RecursiveDirectoryIterator($fixturesDir, \FilesystemIterator::SKIP_DOTS) + ), + '/^.+\/registration\.php$/' + ); + /** + * @var \SplFileInfo $registrationFile + */ + foreach ($iterator as $registrationFile) { + require $registrationFile->getRealPath(); + } + } + } + + /** + * Restore registered components list to the original + */ + private function restoreComponents() + { + if (null !== $this->origComponents) { + $reflection = new \ReflectionClass(self::REGISTRAR_CLASS); + $paths = $reflection->getProperty(self::PATHS_FIELD); + $paths->setAccessible(true); + $paths->setValue($this->origComponents); + $paths->setAccessible(false); + $this->origComponents = null; + } + } +} diff --git a/dev/tests/integration/framework/Magento/TestFramework/Application.php b/dev/tests/integration/framework/Magento/TestFramework/Application.php index 18024e723b34d1362889658ed09ae383801da979..cddc60e12b3313098902441a995703641c3c79ce 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/Application.php +++ b/dev/tests/integration/framework/Magento/TestFramework/Application.php @@ -164,7 +164,10 @@ class Application $customDirs = $this->getCustomDirs(); $this->dirList = new \Magento\Framework\App\Filesystem\DirectoryList(BP, $customDirs); - \Magento\Framework\Autoload\Populator::populateMappings($autoloadWrapper, $this->dirList); + \Magento\Framework\Autoload\Populator::populateMappings( + $autoloadWrapper, + $this->dirList + ); $this->_initParams = [ \Magento\Framework\App\Bootstrap::INIT_PARAM_FILESYSTEM_DIR_PATHS => $customDirs, \Magento\Framework\App\State::PARAM_MODE => $appMode @@ -627,7 +630,6 @@ class Application DirectoryList::GENERATION => [$path => "{$var}/generation"], DirectoryList::CACHE => [$path => "{$var}/cache"], DirectoryList::LOG => [$path => "{$var}/log"], - DirectoryList::THEMES => [$path => BP . '/app/design'], DirectoryList::SESSION => [$path => "{$var}/session"], DirectoryList::TMP => [$path => "{$var}/tmp"], DirectoryList::UPLOAD => [$path => "{$var}/upload"], diff --git a/dev/tests/integration/framework/Magento/TestFramework/Bootstrap/DocBlock.php b/dev/tests/integration/framework/Magento/TestFramework/Bootstrap/DocBlock.php index 270a6b9486a4752ccb8d788f3c2215125bf9110c..50b56e0d08ac2215ba668e92aa37a27b61dfd374 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/Bootstrap/DocBlock.php +++ b/dev/tests/integration/framework/Magento/TestFramework/Bootstrap/DocBlock.php @@ -63,6 +63,7 @@ class DocBlock ] ) ), + new \Magento\TestFramework\Annotation\ComponentRegistrarFixture($this->_fixturesBaseDir), new \Magento\TestFramework\Annotation\AppArea($application), new \Magento\TestFramework\Annotation\Cache($application), new \Magento\TestFramework\Annotation\AdminConfigFixture() diff --git a/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractConfigFiles.php b/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractConfigFiles.php index 086b8dd952a1adfd5be6a22f9c05047f9546029b..b6accb73fb6620a9124e58ba6ad939ca749be4ea 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractConfigFiles.php +++ b/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractConfigFiles.php @@ -8,7 +8,7 @@ */ namespace Magento\TestFramework\TestCase; -use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Component\ComponentRegistrar; abstract class AbstractConfigFiles extends \PHPUnit_Framework_TestCase { @@ -32,8 +32,14 @@ abstract class AbstractConfigFiles extends \PHPUnit_Framework_TestCase */ protected $_objectManager; + /** + * @var ComponentRegistrar + */ + protected $componentRegistrar; + public function setUp() { + $this->componentRegistrar = new ComponentRegistrar(); $this->_objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $xmlFiles = $this->getXmlConfigFiles(); if (!empty($xmlFiles)) { @@ -56,10 +62,7 @@ abstract class AbstractConfigFiles extends \PHPUnit_Framework_TestCase ] ); - /** @var \Magento\Framework\Filesystem $filesystem */ - $filesystem = $this->_objectManager->get('Magento\Framework\Filesystem'); - $this->_schemaFile = $filesystem->getDirectoryRead($this->getDirectoryConstant()) - ->getAbsolutePath($this->_getXsdPath()); + $this->_schemaFile = $this->_getXsdPath(); } } @@ -131,21 +134,11 @@ abstract class AbstractConfigFiles extends \PHPUnit_Framework_TestCase public function getXmlConfigFiles() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $directory = $objectManager->get('Magento\Framework\Filesystem') - ->getDirectoryRead(DirectoryList::MODULES); + /** @var $moduleDirSearch \Magento\Framework\Component\DirSearch */ + $moduleDirSearch = $objectManager->get('Magento\Framework\Component\DirSearch'); return $objectManager->get('Magento\Framework\Config\FileIteratorFactory') - ->create($directory, $directory->search($this->_getConfigFilePathGlob())); - } - - /** - * Returns directory (modules, library internal stc.) constant which contains XSD file - * - * @return string - */ - protected function getDirectoryConstant() - { - return DirectoryList::MODULES; + ->create($moduleDirSearch->collectFiles(ComponentRegistrar::MODULE, $this->_getConfigFilePathGlob())); } /** @@ -165,7 +158,7 @@ abstract class AbstractConfigFiles extends \PHPUnit_Framework_TestCase abstract protected function _getConfigFilePathGlob(); /** - * Returns a path to the per file XSD file, relative to the modules directory. + * Returns an absolute path to the XSD file corresponding to the XML files specified in _getConfigFilePathGlob * * @return string */ 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 368a4fb47c0341a8651e69e38fbf9d6eccc00703..d458fd6087577b6bee01f40352334c86a71a8499 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/Workaround/Cleanup/StaticProperties.php +++ b/dev/tests/integration/framework/Magento/TestFramework/Workaround/Cleanup/StaticProperties.php @@ -9,6 +9,9 @@ */ namespace Magento\TestFramework\Workaround\Cleanup; +use Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\App\Utility\Files; + class StaticProperties { /** @@ -19,9 +22,7 @@ class StaticProperties * @var array */ protected static $_cleanableFolders = [ - '/app/code/' => ['/app/code/*/*/Test/Unit/'], '/dev/tests/integration/framework' => [], - '/lib/internal/' => ['/lib/internal/*/*/Test/Unit/', '/lib/internal/Magento/Framework/*/Test/Unit/'] ]; protected static $backupStaticVariables = []; @@ -42,6 +43,26 @@ class StaticProperties 'Magento\Framework\Phrase', ]; + /** + * Constructor + */ + public function __construct() + { + $componentRegistrar = new ComponentRegistrar(); + /** @var \Magento\Framework\Filesystem $filesystem */ + foreach ($componentRegistrar->getPaths(ComponentRegistrar::MODULE) as $moduleDir) { + $key = $moduleDir . '/'; + $value = $key . 'Test/Unit/'; + self::$_cleanableFolders[$key] = [$value]; + } + foreach ($componentRegistrar->getPaths(ComponentRegistrar::LIBRARY) as $libraryDir) { + $key = $libraryDir . '/'; + $valueRootFolder = $key . '/Test/Unit/'; + $valueSubFolder = $key . '/*/Test/Unit/'; + self::$_cleanableFolders[$key] = [$valueSubFolder, $valueRootFolder]; + } + } + /** * Check whether it is allowed to clean given class static variables * @@ -109,7 +130,11 @@ class StaticProperties */ public static function backupStaticVariables() { - $classFiles = \Magento\Framework\App\Utility\Files::init()->getClassFiles(true, true, false, true, false); + $classFiles = Files::init()->getPhpFiles( + Files::INCLUDE_APP_CODE + | Files::INCLUDE_LIBS + | Files::INCLUDE_TESTS + ); $namespacePattern = '/namespace [a-zA-Z0-9\\\\]+;/'; $classPattern = '/\nclass [a-zA-Z0-9_]+/'; foreach ($classFiles as $classFile) { diff --git a/dev/tests/integration/framework/bootstrap.php b/dev/tests/integration/framework/bootstrap.php index c30c59c22146fcb85df32218043b60eb30c269a0..c0bd8dc4d7cc499e3545dd72588c56541fdc5eff 100644 --- a/dev/tests/integration/framework/bootstrap.php +++ b/dev/tests/integration/framework/bootstrap.php @@ -14,7 +14,6 @@ if (file_exists($updateAppBootstrap)) { } $testsBaseDir = dirname(__DIR__); -$magentoBaseDir = realpath("{$testsBaseDir}/../../../"); $fixtureBaseDir = $testsBaseDir. '/testsuite'; if (!defined('TESTS_TEMP_DIR')) { @@ -77,10 +76,20 @@ try { \Magento\TestFramework\Helper\Bootstrap::setInstance(new \Magento\TestFramework\Helper\Bootstrap($bootstrap)); - \Magento\Framework\App\Utility\Files::setInstance(new Magento\Framework\App\Utility\Files($magentoBaseDir)); + $dirSearch = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create('Magento\Framework\Component\DirSearch'); + $themePackageList = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create('Magento\Framework\View\Design\Theme\ThemePackageList'); + \Magento\Framework\App\Utility\Files::setInstance( + new Magento\Framework\App\Utility\Files( + new \Magento\Framework\Component\ComponentRegistrar(), + $dirSearch, + $themePackageList + ) + ); /* Unset declared global variables to release the PHPUnit from maintaining their values between tests */ - unset($testsBaseDir, $magentoBaseDir, $logWriter, $settings, $shell, $application, $bootstrap); + unset($testsBaseDir, $logWriter, $settings, $shell, $application, $bootstrap); } catch (\Exception $e) { echo $e . PHP_EOL; exit(1); diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/ComponentRegistrarFixtureTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/ComponentRegistrarFixtureTest.php new file mode 100644 index 0000000000000000000000000000000000000000..b15f1d918576e7e8879fb731e6f82560dbde97ee --- /dev/null +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/ComponentRegistrarFixtureTest.php @@ -0,0 +1,69 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Test\Annotation; + +use Magento\Framework\Component\ComponentRegistrar; +use Magento\TestFramework\Annotation\ComponentRegistrarFixture; + +class ComponentRegistrarFixtureTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var ComponentRegistrar + */ + private $componentRegistrar; + + const LIBRARY_NAME = 'magento/library'; + const MODULE_NAME = 'Magento_ModuleOne'; + const THEME_NAME = 'frontend/Magento/theme'; + const LANGUAGE_NAME = 'magento_language'; + + protected function setUp() + { + $this->componentRegistrar = new ComponentRegistrar(); + } + + /** + * @magentoComponentsDir components + */ + public function testStartEndTest() + { + $this->assertFixturesNotRegistered(); + $object = new ComponentRegistrarFixture(__DIR__ . '/_files'); + $object->startTest($this); + $this->assertFixturesRegistered(); + $object->endTest($this); + $this->assertFixturesNotRegistered(); + } + + private function assertFixturesNotRegistered() + { + $this->assertEmpty($this->componentRegistrar->getPath(ComponentRegistrar::LIBRARY, self::LIBRARY_NAME)); + $this->assertEmpty($this->componentRegistrar->getPath(ComponentRegistrar::MODULE, self::MODULE_NAME)); + $this->assertEmpty($this->componentRegistrar->getPath(ComponentRegistrar::THEME, self::THEME_NAME)); + $this->assertEmpty($this->componentRegistrar->getPath(ComponentRegistrar::LANGUAGE, self::LANGUAGE_NAME)); + } + + private function assertFixturesRegistered() + { + $this->assertSame( + __DIR__ . '/_files/components/b', + $this->componentRegistrar->getPath(ComponentRegistrar::LIBRARY, self::LIBRARY_NAME) + ); + $this->assertSame( + __DIR__ . '/_files/components', + $this->componentRegistrar->getPath(ComponentRegistrar::MODULE, self::MODULE_NAME) + ); + $this->assertSame( + __DIR__ . '/_files/components/a/aa/aaa', + $this->componentRegistrar->getPath(ComponentRegistrar::THEME, self::THEME_NAME) + ); + $this->assertSame( + __DIR__ . '/_files/components/a/aa', + $this->componentRegistrar->getPath(ComponentRegistrar::LANGUAGE, self::LANGUAGE_NAME) + ); + } +} diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/_files/components/a/aa/aaa/registration.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/_files/components/a/aa/aaa/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..e6e5057b6e1b9f1d39cceacc656836de8ff5b9ab --- /dev/null +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/_files/components/a/aa/aaa/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::THEME, + 'frontend/Magento/theme', + __DIR__ +); diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/_files/components/a/aa/registration.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/_files/components/a/aa/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..c51d8d31764af60e26178bd819e3c99cd4193bf9 --- /dev/null +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/_files/components/a/aa/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::LANGUAGE, + 'magento_language', + __DIR__ +); diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/_files/components/b/registration.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/_files/components/b/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..111996c5cbcebc7fdf110e802173571df2791c42 --- /dev/null +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/_files/components/b/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::LIBRARY, + 'magento/library', + __DIR__ +); diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/_files/components/registration.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/_files/components/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..0ec16ca5d4caa114af497e6a8de6c47d1e7de91b --- /dev/null +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/_files/components/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_ModuleOne', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Backend/Block/MenuTest.php b/dev/tests/integration/testsuite/Magento/Backend/Block/MenuTest.php index 98a99f979a4f21d2f232e329b05fbc6bf0cd3b09..fbdddd6bd533b53789dfccb045f6df84f167b9c7 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/Block/MenuTest.php +++ b/dev/tests/integration/testsuite/Magento/Backend/Block/MenuTest.php @@ -5,9 +5,8 @@ */ namespace Magento\Backend\Block; -use Magento\Framework\App\Bootstrap; -use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\App\State; +use Magento\Framework\Component\ComponentRegistrar; /** * Test class for \Magento\Backend\Block\Menu @@ -22,6 +21,11 @@ class MenuTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Framework\App\Cache\Type\Config $configCacheType */ protected $configCacheType; + /** + * @var array + */ + protected $backupRegistrar; + protected function setUp() { $this->configCacheType = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( @@ -32,6 +36,12 @@ class MenuTest extends \PHPUnit_Framework_TestCase $this->blockMenu = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( 'Magento\Backend\Block\Menu' ); + + $reflection = new \ReflectionClass('Magento\Framework\Component\ComponentRegistrar'); + $paths = $reflection->getProperty('paths'); + $paths->setAccessible(true); + $this->backupRegistrar = $paths->getValue(); + $paths->setAccessible(false); } /** @@ -70,12 +80,18 @@ class MenuTest extends \PHPUnit_Framework_TestCase { $this->loginAdminUser(); - \Magento\TestFramework\Helper\Bootstrap::getInstance()->reinitialize( - [ - Bootstrap::INIT_PARAM_FILESYSTEM_DIR_PATHS => [ - DirectoryList::MODULES => ['path' => __DIR__ . '/_files/menu'], - ], - ] + $reflection = new \ReflectionClass('Magento\Framework\Component\ComponentRegistrar'); + $paths = $reflection->getProperty('paths'); + $paths->setAccessible(true); + $paths->setValue( + [ComponentRegistrar::MODULE => [], ComponentRegistrar::THEME => [], ComponentRegistrar::LANGUAGE => []] + ); + $paths->setAccessible(false); + + ComponentRegistrar::register( + ComponentRegistrar::MODULE, + 'Magento_Backend', + __DIR__ . '/_files/menu/Magento/Backend' ); /* @var $validationState \Magento\Framework\App\Arguments\ValidationState */ @@ -118,5 +134,10 @@ class MenuTest extends \PHPUnit_Framework_TestCase protected function tearDown() { $this->configCacheType->save('', \Magento\Backend\Model\Menu\Config::CACHE_MENU_OBJECT); + $reflection = new \ReflectionClass('Magento\Framework\Component\ComponentRegistrar'); + $paths = $reflection->getProperty('paths'); + $paths->setAccessible(true); + $paths->setValue($this->backupRegistrar); + $paths->setAccessible(false); } } 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 713b6e42e32ab4462db340588139aebe52b43b1c..8289144a82cb5a43c7a21614d3018f390944c9c4 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 @@ -8,13 +8,10 @@ namespace Magento\Backend\Block\Widget\Grid; -use Magento\Framework\App\Bootstrap; -use Magento\Framework\App\Filesystem\DirectoryList; -use Magento\Store\Model\StoreManager; /** - * @magentoDataFixture Magento/Backend/Block/_files/backend_theme.php - * * @magentoAppArea adminhtml + * @magentoComponentsDir Magento/Backend/Block/_files/design + * @magentoDbIsolation enabled */ class MassactionTest extends \PHPUnit_Framework_TestCase { @@ -34,9 +31,12 @@ class MassactionTest extends \PHPUnit_Framework_TestCase parent::setUp(); - $this->_setFixtureTheme(); - - $this->_layout = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + /** @var \Magento\Theme\Model\Theme\Registration $registration */ + $registration = $objectManager->get('Magento\Theme\Model\Theme\Registration'); + $registration->register(); + $objectManager->get('Magento\Framework\View\DesignInterface')->setDesignTheme('BackendTest/test_default'); + $this->_layout = $objectManager->create( 'Magento\Framework\View\LayoutInterface', ['area' => 'adminhtml'] ); @@ -45,20 +45,7 @@ class MassactionTest extends \PHPUnit_Framework_TestCase $this->_layout->generateElements(); $this->_block = $this->_layout->getBlock('admin.test.grid.massaction'); - } - - /** - * Set fixture theme for admin backend area - */ - protected function _setFixtureTheme() - { - \Magento\TestFramework\Helper\Bootstrap::getInstance()->reinitialize([ - StoreManager::PARAM_RUN_CODE => 'admin', - StoreManager::PARAM_RUN_TYPE => 'store', - Bootstrap::INIT_PARAM_FILESYSTEM_DIR_PATHS => [ - DirectoryList::THEMES => ['path' => __DIR__ . '/../../_files/design'], - ], - ]); + $this->assertNotFalse($this->_block, 'Could not load the block for testing'); } /** 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 deleted file mode 100644 index 57dd7ae14910798a474ab0fd55b7c9cfaaa371c2..0000000000000000000000000000000000000000 --- a/dev/tests/integration/testsuite/Magento/Backend/Block/_files/backend_theme.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -/** @var $registration \Magento\Theme\Model\Theme\Registration */ -\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\AreaList') - ->getArea(\Magento\Backend\App\Area\FrontNameResolver::AREA_CODE) - ->load(\Magento\Framework\App\Area::PART_CONFIG); -$registration = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Theme\Model\Theme\Registration'); -$registration->register('*/*/theme.xml'); diff --git a/dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/Magento/test_default/Magento_Backend/layout/layout_test_grid_handle.xml b/dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/Magento/test_default/Magento_Backend/layout/layout_test_grid_handle.xml new file mode 100644 index 0000000000000000000000000000000000000000..cdb15bdf3f0d20de8c33dc1cc459d9c2fc9c1838 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/Magento/test_default/Magento_Backend/layout/layout_test_grid_handle.xml @@ -0,0 +1,66 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <block class="Magento\Backend\Block\Widget\Grid" name="admin.test.grid" Output="1"> + <arguments> + <dataSource type="object">Magento\Framework\Data\Collection</dataSource> + </arguments> + <block class="Magento\Backend\Block\Widget\Grid\ColumnSet" as="grid.columnSet" name="admin.test.grid.columnSet" Output="1"> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="product_name" Output="1"> + <arguments> + <header>Product name 1</header> + <index>product_name</index> + <type>text</type> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="description" output="1"> + <arguments> + <header>User Description</header> + <index>description</index> + <type>text</type> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="qty" output="1"> + <arguments> + <header>Qty</header> + <index>qty</index> + <type>number</type> + <width>60px</width> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="added_at" output="1"> + <arguments> + <header>Date Added</header> + <index>added_at</index> + <gmtoffset>1</gmtoffset> + <type>date</type> + </arguments> + </block> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Massaction" as="grid.massaction" name='admin.test.grid.massaction' output="1"> + <arguments> + <massaction_id_field>test_id</massaction_id_field> + <massaction_id_filter>test_id</massaction_id_filter> + <form_field_name>test</form_field_name> + <use_select_all>1</use_select_all> + <options> + <option_id1> + <label>Option One</label> + <url>*/*/option1</url> + <complete>Test</complete> + </option_id1> + <option_id2> + <label>Option Two</label> + <url>*/*/option2</url> + <confirm>Are you sure?</confirm> + </option_id2> + </options> + </arguments> + </block> + </block> +</layout> diff --git a/dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/Magento/test_default/registration.php b/dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/Magento/test_default/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..2c1e7e76f848fe4426dfaa0107e10611c91ad8ed --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/Magento/test_default/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::THEME, + 'adminhtml/BackendTest/test_default', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/Magento/test_default/theme.xml b/dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/Magento/test_default/theme.xml new file mode 100644 index 0000000000000000000000000000000000000000..4b52fe7d7b4876de5b74fc58a506c374c03f736e --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/Magento/test_default/theme.xml @@ -0,0 +1,9 @@ +<!-- +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> + <title>Magento Test backend</title> +</theme> diff --git a/dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/test_default/web/images/grid_sort_asc.gif b/dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/Magento/test_default/web/images/grid_sort_asc.gif similarity index 100% rename from dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/test_default/web/images/grid_sort_asc.gif rename to dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/Magento/test_default/web/images/grid_sort_asc.gif diff --git a/dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/test_default/web/images/grid_sort_desc.gif b/dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/Magento/test_default/web/images/grid_sort_desc.gif similarity index 100% rename from dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/test_default/web/images/grid_sort_desc.gif rename to dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/Magento/test_default/web/images/grid_sort_desc.gif diff --git a/dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/test_default/web/images/grid_th_bg.gif b/dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/Magento/test_default/web/images/grid_th_bg.gif similarity index 100% rename from dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/test_default/web/images/grid_th_bg.gif rename to dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/Magento/test_default/web/images/grid_th_bg.gif diff --git a/dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/test_default/web/images/grid_th_onclick_bg.gif b/dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/Magento/test_default/web/images/grid_th_onclick_bg.gif similarity index 100% rename from dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/test_default/web/images/grid_th_onclick_bg.gif rename to dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/Magento/test_default/web/images/grid_th_onclick_bg.gif diff --git a/dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/test_default/web/images/pager_arrow_left.gif b/dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/Magento/test_default/web/images/pager_arrow_left.gif similarity index 100% rename from dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/test_default/web/images/pager_arrow_left.gif rename to dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/Magento/test_default/web/images/pager_arrow_left.gif diff --git a/dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/test_default/web/images/pager_arrow_left_off.gif b/dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/Magento/test_default/web/images/pager_arrow_left_off.gif similarity index 100% rename from dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/test_default/web/images/pager_arrow_left_off.gif rename to dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/Magento/test_default/web/images/pager_arrow_left_off.gif diff --git a/dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/test_default/web/images/pager_arrow_right.gif b/dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/Magento/test_default/web/images/pager_arrow_right.gif similarity index 100% rename from dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/test_default/web/images/pager_arrow_right.gif rename to dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/Magento/test_default/web/images/pager_arrow_right.gif diff --git a/dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/test_default/web/images/pager_arrow_right_off.gif b/dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/Magento/test_default/web/images/pager_arrow_right_off.gif similarity index 100% rename from dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/test_default/web/images/pager_arrow_right_off.gif rename to dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/Magento/test_default/web/images/pager_arrow_right_off.gif diff --git a/dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/test_default/Magento_Backend/layout_test_grid_handle.xml b/dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/test_default/Magento_Backend/layout_test_grid_handle.xml deleted file mode 100644 index aeac3057672ae1af9547fa748fa65cfd0034b0f2..0000000000000000000000000000000000000000 --- a/dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/test_default/Magento_Backend/layout_test_grid_handle.xml +++ /dev/null @@ -1,68 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > - <referenceContainer name="content"> - <block class="Magento\Backend\Block\Widget\Grid" name="admin.test.grid" Output="1"> - <arguments> - <dataSource type="object">Magento\Framework\Data\Collection</dataSource> - </arguments> - <block class="Magento\Backend\Block\Widget\Grid\ColumnSet" as="grid.columnSet" name="admin.test.grid.columnSet" Output="1"> - <block class="Magento\Backend\Block\Widget\Grid\Column" as="product_name" Output="1"> - <arguments> - <header>Product name 1</header> - <index>product_name</index> - <type>text</type> - </arguments> - </block> - <block class="Magento\Backend\Block\Widget\Grid\Column" as="description" output="1"> - <arguments> - <header>User Description</header> - <index>description</index> - <type>text</type> - </arguments> - </block> - <block class="Magento\Backend\Block\Widget\Grid\Column" as="qty" output="1"> - <arguments> - <header>Qty</header> - <index>qty</index> - <type>number</type> - <width>60px</width> - </arguments> - </block> - <block class="Magento\Backend\Block\Widget\Grid\Column" as="added_at" output="1"> - <arguments> - <header>Date Added</header> - <index>added_at</index> - <gmtoffset>1</gmtoffset> - <type>date</type> - </arguments> - </block> - </block> - <block class="Magento\Backend\Block\Widget\Grid\Massaction" as="grid.massaction" name='admin.test.grid.massaction' output="1"> - <arguments> - <massaction_id_field>test_id</massaction_id_field> - <massaction_id_filter>test_id</massaction_id_filter> - <form_field_name>test</form_field_name> - <use_select_all>1</use_select_all> - <options> - <option_id1> - <label>Option One</label> - <url>*/*/option1</url> - <complete>Test</complete> - </option_id1> - <option_id2> - <label>Option Two</label> - <url>*/*/option2</url> - <confirm>Are you sure?</confirm> - </option_id2> - </options> - </arguments> - </block> - </block> - </referenceContainer> -</layout> diff --git a/dev/tests/integration/testsuite/Magento/Bundle/_files/product_rollback.php b/dev/tests/integration/testsuite/Magento/Bundle/_files/product_rollback.php index 691cc75f5675c1838b0d01e57333385ecf357303..cfbf528c6edecfc94fc28b44e3d7f52b28d00625 100644 --- a/dev/tests/integration/testsuite/Magento/Bundle/_files/product_rollback.php +++ b/dev/tests/integration/testsuite/Magento/Bundle/_files/product_rollback.php @@ -13,7 +13,6 @@ require __DIR__ . '/../../../Magento/Catalog/_files/products_rollback.php'; /** @var \Magento\Framework\Registry $registry */ $registry = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\Registry'); - $registry->unregister('isSecureArea'); $registry->register('isSecureArea', true); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/etc/extension_attributes.xml b/dev/tests/integration/testsuite/Magento/Catalog/_files/etc/extension_attributes.xml index eb77caf25a42e1734cecebec596ff8150ed36e6a..7e5301db7600d81719803168e0cfe57262ac46cb 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/_files/etc/extension_attributes.xml +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/etc/extension_attributes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../lib/internal/Magento/Framework/Api/etc/extension_attributes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> <extension_attributes for="Magento\Tax\Api\Data\TaxRateInterface"> </extension_attributes> <extension_attributes for="Magento\Catalog\Api\Data\ProductInterface"> diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/quote_with_product_and_custom_options.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/quote_with_product_and_custom_options.php new file mode 100644 index 0000000000000000000000000000000000000000..1f78762dab688ee589bab2d01986223489463555 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/quote_with_product_and_custom_options.php @@ -0,0 +1,61 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +require __DIR__ . '/product_simple.php'; +require __DIR__ . '/../../../Magento/Checkout/_files/active_quote.php'; + +$optionValue = [ + 'field' => 'Test value', + 'date_time' => [ + 'year' => '2015', + 'month' => '9', + 'day' => '9', + 'hour' => '2', + 'minute' => '2', + 'day_part' => 'am', + 'date_internal' => '', + ], + 'drop_down' => '3-1-select', + 'radio' => '4-1-radio', +]; + +$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + +$productRepository = $objectManager->create('Magento\Catalog\Api\ProductRepositoryInterface'); +/** @var \Magento\Catalog\Api\Data\ProductInterface $product */ +$product = $productRepository->get('simple'); + +/** @var \Magento\Quote\Model\Quote $quote */ +$quote = $objectManager->create('Magento\Quote\Model\Quote'); +/** @var \Magento\Quote\Model\Quote\Item\Repository $quoteItemRepository */ +$quoteItemRepository = $objectManager->create('Magento\Quote\Model\Quote\Item\Repository'); +/** @var \Magento\Quote\Api\Data\CartItemInterface $cartItem */ +$cartItem = $objectManager->create('Magento\Quote\Api\Data\CartItemInterface'); +/** @var \Magento\Quote\Model\Quote\ProductOption $productOption */ +$productOption = $objectManager->create('Magento\Quote\Model\Quote\ProductOptionFactory')->create(); +/** @var \Magento\Quote\Api\Data\ProductOptionExtensionInterface $extensionAttributes */ +$extensionAttributes = $objectManager->create('Magento\Quote\Api\Data\ProductOptionExtensionFactory')->create(); +$customOptionFactory = $objectManager->create('Magento\Catalog\Model\CustomOptions\CustomOptionFactory'); +$options = []; +/** @var \Magento\Catalog\Api\Data\ProductCustomOptionInterface $option */ +foreach ($product->getOptions() as $option) { + /** @var \Magento\Catalog\Api\Data\CustomOptionInterface $customOption */ + $customOption = $customOptionFactory->create(); + $customOption->setOptionId($option->getId()); + $customOption->setOptionValue($optionValue[$option->getType()]); + $options[] = $customOption; +} + + +$quote->load('test_order_1', 'reserved_order_id'); +$cartItem->setQty(1); +$cartItem->setSku('simple'); +$cartItem->setQuoteId($quote->getId()); + +$extensionAttributes->setCustomOptions($options); +$productOption->setExtensionAttributes($extensionAttributes); +$cartItem->setProductOption($productOption); + +$quoteItemRepository->save($cartItem); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/quote_with_product_and_custom_options_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/quote_with_product_and_custom_options_rollback.php new file mode 100644 index 0000000000000000000000000000000000000000..134a316ca47bd84e255d844e936c137394283975 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/quote_with_product_and_custom_options_rollback.php @@ -0,0 +1,7 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +require __DIR__ . '/product_simple_rollback.php'; +require __DIR__ . '/../../../Magento/Checkout/_files/active_quote_rollback.php'; diff --git a/dev/tests/integration/testsuite/Magento/Checkout/_files/active_quote.php b/dev/tests/integration/testsuite/Magento/Checkout/_files/active_quote.php new file mode 100644 index 0000000000000000000000000000000000000000..1039e78d6a28f51f3140ad3aa486eb777a173108 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Checkout/_files/active_quote.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +$quote = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Quote\Model\Quote'); +$quote->setStoreId(1) + ->setIsActive(true) + ->setIsMultiShipping(false) + ->setReservedOrderId('test_order_1') + ->save(); diff --git a/dev/tests/integration/testsuite/Magento/Checkout/_files/active_quote_rollback.php b/dev/tests/integration/testsuite/Magento/Checkout/_files/active_quote_rollback.php new file mode 100644 index 0000000000000000000000000000000000000000..e94e1b54fcc530730fe0c02c9c89c3349c878fbc --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Checkout/_files/active_quote_rollback.php @@ -0,0 +1,8 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); +$quote = $objectManager->create('Magento\Quote\Model\Quote'); +$quote->load('test_order_1', 'reserved_order_id')->delete(); diff --git a/dev/tests/integration/testsuite/Magento/Config/Block/System/Config/FormTest.php b/dev/tests/integration/testsuite/Magento/Config/Block/System/Config/FormTest.php index 5c2bc41c29260b6d91535bb7dd2ff15885bdec8b..cc545e0b5537bd4025c7fa2aba8f0113d49cb51b 100644 --- a/dev/tests/integration/testsuite/Magento/Config/Block/System/Config/FormTest.php +++ b/dev/tests/integration/testsuite/Magento/Config/Block/System/Config/FormTest.php @@ -6,7 +6,6 @@ namespace Magento\Config\Block\System\Config; use Magento\Framework\App\Cache\State; -use Magento\Framework\App\Filesystem\DirectoryList; /** * @magentoAppArea adminhtml @@ -246,16 +245,11 @@ class FormTest extends \PHPUnit_Framework_TestCase $fileResolverMock = $this->getMockBuilder( 'Magento\Framework\App\Config\FileResolver' )->disableOriginalConstructor()->getMock(); - $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->get('Magento\Framework\Filesystem'); - /** @var $directory \Magento\Framework\Filesystem\Directory\Read */ - $directory = $filesystem->getDirectoryRead(DirectoryList::ROOT); $fileIteratorFactory = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( 'Magento\Framework\Config\FileIteratorFactory' ); $fileIterator = $fileIteratorFactory->create( - $directory, - [$directory->getRelativePath(__DIR__ . '/_files/test_section_config.xml')] + [__DIR__ . '/_files/test_section_config.xml'] ); $fileResolverMock->expects($this->any())->method('get')->will($this->returnValue($fileIterator)); diff --git a/dev/tests/integration/testsuite/Magento/Config/Block/System/Config/_files/test_section_config.xml b/dev/tests/integration/testsuite/Magento/Config/Block/System/Config/_files/test_section_config.xml index b51ed0b76d5ac2eb71e9d5353cc8e9f284783e58..072e1921a23e5b855d183235bf5192b5e3531b64 100644 --- a/dev/tests/integration/testsuite/Magento/Config/Block/System/Config/_files/test_section_config.xml +++ b/dev/tests/integration/testsuite/Magento/Config/Block/System/Config/_files/test_section_config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <tab id="Test"> <label>Test</label> diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/etc/extension_attributes.xml b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/etc/extension_attributes.xml index dbf00dbc8c5b037eced4bcfb499ff5ea15fd6c1a..021e806fc4d8c83e1b708f58ad43d3105e300cb4 100644 --- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/etc/extension_attributes.xml +++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/etc/extension_attributes.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/Api/etc/extension_attributes.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> <extension_attributes for="Magento\ConfigurableProduct\Api\Data\OptionInterface"> <attribute code="test_dummy_attribute" type="string"> <join reference_table="eav_attribute" diff --git a/dev/tests/integration/testsuite/Magento/Customer/Model/FileResolverStub.php b/dev/tests/integration/testsuite/Magento/Customer/Model/FileResolverStub.php index 7a288246a4881030b04b0664c13a2ed2875e2e9e..c373521541018f4a02d1bcd27e06b510fede850e 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Model/FileResolverStub.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Model/FileResolverStub.php @@ -14,14 +14,8 @@ class FileResolverStub implements \Magento\Framework\Config\FileResolverInterfac public function get($filename, $scope) { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $readDirectory = $objectManager->create( - 'Magento\Framework\Filesystem\Directory\Read', - [ - 'driver' => $objectManager->create('Magento\Framework\Filesystem\Driver\File'), - 'path' => realpath(__DIR__ . '/../_files/etc'), - ] - ); - $paths = ['extension_attributes.xml']; - return new \Magento\Framework\Config\FileIterator($readDirectory, $paths); + $fileReadFactory = $objectManager->create('Magento\Framework\Filesystem\File\ReadFactory'); + $paths = [realpath(__DIR__ . '/../_files/etc/') . '/extension_attributes.xml']; + return new \Magento\Framework\Config\FileIterator($fileReadFactory, $paths); } } diff --git a/dev/tests/integration/testsuite/Magento/Customer/_files/etc/extension_attributes.xml b/dev/tests/integration/testsuite/Magento/Customer/_files/etc/extension_attributes.xml index 507e8fe20afc2d073bc459946acb829093699e78..67be668713800d6917e3e973005a38ae11214d56 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/_files/etc/extension_attributes.xml +++ b/dev/tests/integration/testsuite/Magento/Customer/_files/etc/extension_attributes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../lib/internal/Magento/Framework/Api/etc/extension_attributes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> <extension_attributes for="Magento\Tax\Api\Data\TaxRateInterface"> </extension_attributes> <extension_attributes for="Magento\Catalog\Api\Data\ProductInterface"> diff --git a/dev/tests/integration/testsuite/Magento/Customer/etc/extension_attributes.xml b/dev/tests/integration/testsuite/Magento/Customer/etc/extension_attributes.xml index 6c210f6f4125f5cfe513f4fb5c81f9c4da540cfd..d25f087e67561a17cb0d0fa4060a57bcf4d8fa19 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/etc/extension_attributes.xml +++ b/dev/tests/integration/testsuite/Magento/Customer/etc/extension_attributes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/Api/etc/extension_attributes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> <extension_attributes for="Magento\Customer\Api\Data\AddressInterface"> <attribute code="test_customer_group_id" type="int"> <join reference_table="customer_entity" diff --git a/dev/tests/integration/testsuite/Magento/Downloadable/etc/extension_attributes.xml b/dev/tests/integration/testsuite/Magento/Downloadable/etc/extension_attributes.xml index e120bbea99bcf355d3a3adce99925d13a40fd19c..0dfd9e6887d09b48e040bb70e8e535d5789b0ec4 100644 --- a/dev/tests/integration/testsuite/Magento/Downloadable/etc/extension_attributes.xml +++ b/dev/tests/integration/testsuite/Magento/Downloadable/etc/extension_attributes.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/Api/etc/extension_attributes.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> <extension_attributes for="Magento\Downloadable\Api\Data\LinkInterface"> <attribute code="testAttribute" type="Magento\User\Api\Data\UserInterface"> <join reference_table="admin_user" 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 731836d648132a54cfc331c66abc0876be42df44..fbc90ac30f4c6da05143fd0391520237c2aaf580 100644 --- a/dev/tests/integration/testsuite/Magento/Email/Model/Template/FilterTest.php +++ b/dev/tests/integration/testsuite/Magento/Email/Model/Template/FilterTest.php @@ -6,15 +6,10 @@ namespace Magento\Email\Model\Template; use Magento\Framework\App\Area; -use Magento\Framework\App\Bootstrap; -use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\App\State; use Magento\Framework\App\TemplateTypesInterface; -use Magento\Framework\Css\PreProcessor\Adapter\Oyejorge; use Magento\Framework\Phrase; -use Magento\Framework\View\DesignInterface; use Magento\Setup\Module\I18n\Locale; -use Magento\Store\Model\ScopeInterface; /** * @SuppressWarnings(PHPMD.CouplingBetweenObjects) @@ -96,8 +91,9 @@ class FilterTest extends \PHPUnit_Framework_TestCase } /** - * @magentoDataFixture Magento/Email/Model/_files/design/themes.php + * @magentoComponentsDir Magento/Email/Model/_files/design * @magentoAppIsolation enabled + * @magentoDbIsolation enabled * @dataProvider layoutDirectiveDataProvider * * @param string $area @@ -106,32 +102,16 @@ class FilterTest extends \PHPUnit_Framework_TestCase */ public function testLayoutDirective($area, $directiveParams, $expectedOutput) { - \Magento\TestFramework\Helper\Bootstrap::getInstance()->reinitialize( - [ - Bootstrap::INIT_PARAM_FILESYSTEM_DIR_PATHS => [ - DirectoryList::THEMES => [ - 'path' => dirname(__DIR__) . '/_files/design', - ], - ], - ] - ); + /** @var \Magento\Theme\Model\Theme\Registration $registration */ + $registration = $this->objectManager->get('Magento\Theme\Model\Theme\Registration'); + $registration->register(); $this->model = $this->objectManager->create('Magento\Email\Model\Template\Filter'); - - $themes = ['frontend' => 'Magento/default', 'adminhtml' => 'Magento/default']; - $design = $this->objectManager->create('Magento\Theme\Model\View\Design', ['themes' => $themes]); - $this->objectManager->addSharedInstance($design, 'Magento\Theme\Model\View\Design'); - \Magento\TestFramework\Helper\Bootstrap::getInstance()->loadArea($area); - - $collection = $this->objectManager->create('Magento\Theme\Model\Resource\Theme\Collection'); - $themeId = $collection->getThemeByFullPath('frontend/Magento/default')->getId(); - $this->objectManager->get('Magento\Framework\App\Config\MutableScopeConfigInterface') - ->setValue(DesignInterface::XML_PATH_THEME_ID, $themeId, ScopeInterface::SCOPE_STORE); - /** @var $layout \Magento\Framework\View\LayoutInterface */ $layout = $this->objectManager->create('Magento\Framework\View\Layout'); $this->objectManager->addSharedInstance($layout, 'Magento\Framework\View\Layout'); - $this->objectManager->get('Magento\Framework\View\DesignInterface')->setDesignTheme('Magento/default'); + $this->objectManager->get('Magento\Framework\View\DesignInterface') + ->setDesignTheme('Magento_EmailTest/default'); $actualOutput = $this->model->layoutDirective( ['{{layout ' . $directiveParams . '}}', 'layout', ' ' . $directiveParams] @@ -222,8 +202,9 @@ class FilterTest extends \PHPUnit_Framework_TestCase * as well as supporting loading files from a theme fallback structure. * * @magentoDataFixture Magento/Store/_files/core_fixturestore.php - * @magentoDataFixture Magento/Email/Model/_files/design/themes.php + * @magentoComponentsDir Magento/Email/Model/_files/design * @magentoAppIsolation enabled + * @magentoDbIsolation enabled * @dataProvider cssDirectiveDataProvider * * @param int $templateType @@ -232,6 +213,11 @@ class FilterTest extends \PHPUnit_Framework_TestCase */ public function testCssDirective($templateType, $directiveParams, $expectedOutput) { + /** @var \Magento\Theme\Model\Theme\Registration $registration */ + $registration = $this->objectManager->get( + 'Magento\Theme\Model\Theme\Registration' + ); + $registration->register(); $this->setUpDesignParams(); $this->model->setStoreId('fixturestore') ->setPlainTemplateMode($templateType == TemplateTypesInterface::TYPE_TEXT); @@ -294,8 +280,9 @@ class FilterTest extends \PHPUnit_Framework_TestCase * as well as supporting loading files from a theme fallback structure. * * @magentoDataFixture Magento/Store/_files/core_fixturestore.php - * @magentoDataFixture Magento/Email/Model/_files/design/themes.php + * @magentoComponentsDir Magento/Email/Model/_files/design * @magentoAppIsolation enabled + * @magentoDbIsolation enabled * @dataProvider inlinecssDirectiveDataProvider * * @param string $templateText @@ -311,6 +298,11 @@ class FilterTest extends \PHPUnit_Framework_TestCase $plainTemplateMode = false, $isChildTemplateMode = false ) { + /** @var \Magento\Theme\Model\Theme\Registration $registration */ + $registration = $this->objectManager->get( + 'Magento\Theme\Model\Theme\Registration' + ); + $registration->register(); $this->setUpDesignParams(); $this->model->setPlainTemplateMode($plainTemplateMode); @@ -372,14 +364,20 @@ class FilterTest extends \PHPUnit_Framework_TestCase /** * @magentoDataFixture Magento/Store/_files/core_fixturestore.php - * @magentoDataFixture Magento/Email/Model/_files/design/themes.php + * @magentoComponentsDir Magento/Email/Model/_files/design * @magentoAppIsolation enabled + * @magentoDbIsolation enabled * @dataProvider inlinecssDirectiveThrowsExceptionWhenMissingParameterDataProvider * * @param string $templateText */ public function testInlinecssDirectiveThrowsExceptionWhenMissingParameter($templateText) { + /** @var \Magento\Theme\Model\Theme\Registration $registration */ + $registration = $this->objectManager->get( + 'Magento\Theme\Model\Theme\Registration' + ); + $registration->register(); $this->setUpDesignParams(); $this->model->filter($templateText); @@ -405,7 +403,7 @@ class FilterTest extends \PHPUnit_Framework_TestCase */ protected function setUpDesignParams() { - $themeCode = 'Vendor/custom_theme'; + $themeCode = 'Vendor_EmailTest/custom_theme'; $this->model->setDesignParams([ 'area' => Area::AREA_FRONTEND, 'theme' => $themeCode, diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/TemplateTest.php b/dev/tests/integration/testsuite/Magento/Email/Model/TemplateTest.php index d66a3ebcc0a64a6c134987f2bc8ea6f751671b26..a63bbacc8bd6ac04ccf15e4dca6cec54ec4df671 100644 --- a/dev/tests/integration/testsuite/Magento/Email/Model/TemplateTest.php +++ b/dev/tests/integration/testsuite/Magento/Email/Model/TemplateTest.php @@ -139,15 +139,16 @@ class TemplateTest extends \PHPUnit_Framework_TestCase /** * Test template directive to ensure that templates can be loaded from modules * + * @param string $area + * @param string $templateId + * @param string $expectedOutput + * @param bool $mockThemeFallback + * * @magentoDataFixture Magento/Store/_files/core_fixturestore.php - * @magentoDataFixture Magento/Email/Model/_files/design/themes.php + * @magentoComponentsDir Magento/Email/Model/_files/design * @magentoAppIsolation enabled + * @magentoDbIsolation enabled * @dataProvider templateFallbackDataProvider - * - * @param $area - * @param $templateId - * @param $expectedOutput - * @param bool $mockThemeFallback */ public function testTemplateFallback($area, $templateId, $expectedOutput, $mockThemeFallback = false) { @@ -213,8 +214,9 @@ class TemplateTest extends \PHPUnit_Framework_TestCase * overridden in themes * * @magentoDataFixture Magento/Store/_files/core_fixturestore.php - * @magentoDataFixture Magento/Email/Model/_files/design/themes.php + * @magentoComponentsDir Magento/Email/Model/_files/design * @magentoAppIsolation enabled + * @magentoDbIsolation enabled * @dataProvider templateDirectiveDataProvider * * @param string $area @@ -343,8 +345,9 @@ class TemplateTest extends \PHPUnit_Framework_TestCase * textarea in backend, depending on whether template was loaded from filesystem or DB. * * @magentoDataFixture Magento/Store/_files/core_fixturestore.php - * @magentoDataFixture Magento/Email/Model/_files/design/themes.php + * @magentoComponentsDir Magento/Email/Model/_files/design * @magentoAppIsolation enabled + * @magentoDbIsolation enabled * @dataProvider templateStylesVariableDataProvider * * @param string $area @@ -450,11 +453,21 @@ class TemplateTest extends \PHPUnit_Framework_TestCase } /** - * Setup the theme fallback structure and set the Vendor/custom_theme as the current theme for 'fixturestore' store + * Setup the theme fallback structure and set the Vendor_EmailTest/custom_theme as the current theme for + * 'fixturestore' store */ protected function setUpAdminThemeFallback() { - // The Vendor/custom_theme adminhtml theme is set in the + $themes = [BackendFrontNameResolver::AREA_CODE => 'Vendor_EmailTest/custom_theme']; + $design = $this->objectManager->create('Magento\Theme\Model\View\Design', ['themes' => $themes]); + $this->objectManager->addSharedInstance($design, 'Magento\Theme\Model\View\Design'); + /** @var \Magento\Theme\Model\Theme\Registration $registration */ + $registration = $this->objectManager->get( + 'Magento\Theme\Model\Theme\Registration' + ); + $registration->register(); + + // The Vendor_EmailTest/custom_theme adminhtml theme is set in the // dev/tests/integration/testsuite/Magento/Email/Model/_files/design/themes.php file, as it must be set // before the adminhtml area is loaded below. @@ -471,15 +484,18 @@ class TemplateTest extends \PHPUnit_Framework_TestCase } /** - * Setup the theme fallback structure and set the Vendor/custom_theme as the current theme for 'fixturestore' store + * Setup the theme fallback structure and set the Vendor_EmailTest/custom_theme as the current theme + * for 'fixturestore' store * * @param $area */ protected function setUpThemeFallback($area) { - $themes = ['frontend' => 'Vendor/custom_theme']; - $design = $this->objectManager->create('Magento\Theme\Model\View\Design', ['themes' => $themes]); - $this->objectManager->addSharedInstance($design, 'Magento\Theme\Model\View\Design'); + /** @var \Magento\Theme\Model\Theme\Registration $registration */ + $registration = $this->objectManager->get( + 'Magento\Theme\Model\Theme\Registration' + ); + $registration->register(); // It is important to test from both areas, as emails will get sent from both, so we need to ensure that the // inline CSS files get loaded properly from both areas. @@ -488,8 +504,8 @@ class TemplateTest extends \PHPUnit_Framework_TestCase $collection = $this->objectManager->create('Magento\Theme\Model\Resource\Theme\Collection'); // Hard-coding theme as we want to test the fallback structure to ensure that the parent/grandparent themes of - // Vendor/custom_theme will be checked for CSS files - $themeId = $collection->getThemeByFullPath('frontend/Vendor/custom_theme')->getId(); + // Vendor_EmailTest/custom_theme will be checked for CSS files + $themeId = $collection->getThemeByFullPath('frontend/Vendor_EmailTest/custom_theme')->getId(); $this->objectManager->get('Magento\Framework\App\Config\MutableScopeConfigInterface') ->setValue( diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/adminhtml/Magento/default/registration.php b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/adminhtml/Magento/default/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..56cd0e58c31007a4b632ae7a25d3e8a8141146bc --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/adminhtml/Magento/default/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::THEME, + 'adminhtml/Magento_EmailTest/default', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/adminhtml/Magento/default/theme.xml b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/adminhtml/Magento/default/theme.xml index 3c7b7acc35d47e45f9efbe578dc54b4b5cddbdec..3ad97270adc0ed4f708db326b1706a458df05b37 100644 --- a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/adminhtml/Magento/default/theme.xml +++ b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/adminhtml/Magento/default/theme.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> - <title>Adminhtml - Magento/default</title> +<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> + <title>Adminhtml - Magento_EmailTest/default</title> </theme> diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/adminhtml/Vendor/custom_theme/registration.php b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/adminhtml/Vendor/custom_theme/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..3999c26bffd9b131744a0d66f2fa656c46236329 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/adminhtml/Vendor/custom_theme/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::THEME, + 'adminhtml/Vendor_EmailTest/custom_theme', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/adminhtml/Vendor/custom_theme/theme.xml b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/adminhtml/Vendor/custom_theme/theme.xml index 3a01223590af913f372c2d5441142927799c3f4b..b6e55effc53e7eeefef455c4072a0cd445f96859 100644 --- a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/adminhtml/Vendor/custom_theme/theme.xml +++ b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/adminhtml/Vendor/custom_theme/theme.xml @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ --> -<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> - <title>Adminhtml - Vendor/custom_theme</title> - <parent>Vendor/default</parent> +<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> + <title>Adminhtml - Vendor_EmailTest/custom_theme</title> + <parent>Vendor_EmailTest/default</parent> </theme> diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/adminhtml/Vendor/default/registration.php b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/adminhtml/Vendor/default/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..c991e8c966f61fcc7f5e745eb57faba250ba4cea --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/adminhtml/Vendor/default/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::THEME, + 'adminhtml/Vendor_EmailTest/default', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/adminhtml/Vendor/default/theme.xml b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/adminhtml/Vendor/default/theme.xml index af2167146429d544d1840574ec99ff77886d8b9a..7c9576ab9743389c60701291445348eda29fb195 100644 --- a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/adminhtml/Vendor/default/theme.xml +++ b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/adminhtml/Vendor/default/theme.xml @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ --> -<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> - <title>Adminhtml - Vendor/default</title> - <parent>Magento/default</parent> +<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> + <title>Adminhtml - Vendor_EmailTest/default</title> + <parent>Magento_EmailTest/default</parent> </theme> diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Magento/default/registration.php b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Magento/default/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..cbf77ed0582a5dc68f4cf1a6828003cc2db61e9e --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Magento/default/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::THEME, + 'frontend/Magento_EmailTest/default', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Magento/default/theme.xml b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Magento/default/theme.xml index 1fe27ff452dce946ee923900ef8ce041ba4fba1d..be4364263f7e61cb8dfa3476f2fba4b562da8247 100644 --- a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Magento/default/theme.xml +++ b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Magento/default/theme.xml @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ --> -<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> - <title>Frontend - Magento/default</title> +<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> + <title>Frontend - Magento_EmailTest/default</title> </theme> diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Vendor/custom_theme/registration.php b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Vendor/custom_theme/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..333b5468659a4d567f471539b29e28074b471cdf --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Vendor/custom_theme/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::THEME, + 'frontend/Vendor_EmailTest/custom_theme', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Vendor/custom_theme/theme.xml b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Vendor/custom_theme/theme.xml index 33d79eeb76f602ab5e9359357c6c9ee1d7d4b7df..06520a6af63d12dcc581430a384191ce2be2608c 100644 --- a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Vendor/custom_theme/theme.xml +++ b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Vendor/custom_theme/theme.xml @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ --> -<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> - <title>Frontend - Vendor/custom_theme</title> - <parent>Vendor/default</parent> +<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> + <title>Frontend - Vendor_EmailTest/custom_theme</title> + <parent>Vendor_EmailTest/default</parent> </theme> diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Vendor/default/registration.php b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Vendor/default/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..7ad272f658b7a8bf219ee742d32acfcb2e62d332 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Vendor/default/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::THEME, + 'frontend/Vendor_EmailTest/default', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Vendor/default/theme.xml b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Vendor/default/theme.xml index edd1f837ceb76fdac5f9faa62375bd2a2a65b18c..99abb499f6bed7a4eb2ed367c89581e6c8b0144e 100644 --- a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Vendor/default/theme.xml +++ b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Vendor/default/theme.xml @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ --> -<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> - <title>Frontend - Vendor/default</title> - <parent>Magento/default</parent> +<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> + <title>Frontend - Vendor_EmailTest/default</title> + <parent>Magento_EmailTest/default</parent> </theme> diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/themes.php b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/themes.php deleted file mode 100644 index 23fe9964fab17d61c88ce981fc3db02db37f18a9..0000000000000000000000000000000000000000 --- a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/themes.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -use Magento\Framework\App\Bootstrap; -use Magento\Framework\App\Filesystem\DirectoryList; - -$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - -$objectManager->get('Magento\Framework\App\AreaList') - ->getArea(\Magento\Backend\App\Area\FrontNameResolver::AREA_CODE) - ->load(\Magento\Framework\App\Area::PART_CONFIG); -\Magento\TestFramework\Helper\Bootstrap::getInstance()->reinitialize([ - Bootstrap::INIT_PARAM_FILESYSTEM_DIR_PATHS => [ - DirectoryList::THEMES => ['path' => realpath(__DIR__)], - ], -]); -$objectManager->configure( - ['preferences' => ['Magento\Theme\Model\Theme' => 'Magento\Theme\Model\Theme\Data']] -); -/** @var $registration \Magento\Theme\Model\Theme\Registration */ -$registration = $objectManager->create( - 'Magento\Theme\Model\Theme\Registration' -); - -// It is not possible to set custom admin theme via store config, as the default adminhtml theme is set in -// app/code/Magento/Theme/etc/di.xml. To modify the adminhtml theme, we must change the injected "theme" argument here. -$objectManager->configure([ - 'Magento\Theme\Model\View\Design' => [ - 'arguments' => [ - 'themes' => [ - 'frontend' => 'Magento/blank', - 'adminhtml' => 'Vendor/custom_theme', - ], - ] - ], -]); - -$registration->register(implode('/', ['*', '*', '*', 'theme.xml'])); diff --git a/dev/tests/integration/testsuite/Magento/Framework/Api/ExtensionAttribute/Config/ReaderTest.php b/dev/tests/integration/testsuite/Magento/Framework/Api/ExtensionAttribute/Config/ReaderTest.php index e5fb4c8794a8e72807094e03c1676c598eb5cc8a..4514cbd627efe4e2cf6089a81a8fd378a46bc825 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Api/ExtensionAttribute/Config/ReaderTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Api/ExtensionAttribute/Config/ReaderTest.php @@ -61,7 +61,9 @@ class ReaderTest extends \PHPUnit_Framework_TestCase $this->_validationState = new \Magento\Framework\App\Arguments\ValidationState( \Magento\Framework\App\State::MODE_DEFAULT ); - $this->_schemaLocator = new \Magento\Framework\Api\ExtensionAttribute\Config\SchemaLocator(); + $this->_schemaLocator = new \Magento\Framework\Api\ExtensionAttribute\Config\SchemaLocator( + new \Magento\Framework\Config\Dom\UrnResolver() + ); } public function testMerge() diff --git a/dev/tests/integration/testsuite/Magento/Framework/Api/ExtensionAttribute/Config/_files/config_one.xml b/dev/tests/integration/testsuite/Magento/Framework/Api/ExtensionAttribute/Config/_files/config_one.xml index 3be36f43ab35694ce758d2d9461e194d0e355daf..73a4477737da7e6bb954404fa4b3edd949ce5ab9 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Api/ExtensionAttribute/Config/_files/config_one.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/Api/ExtensionAttribute/Config/_files/config_one.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/Api/etc/extension_attributes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> <extension_attributes for="Magento\Tax\Api\Data\TaxRateInterface"> </extension_attributes> <extension_attributes for="Magento\Catalog\Api\Data\Product"> diff --git a/dev/tests/integration/testsuite/Magento/Framework/Api/ExtensionAttribute/Config/_files/config_two.xml b/dev/tests/integration/testsuite/Magento/Framework/Api/ExtensionAttribute/Config/_files/config_two.xml index f85a1a4d69efbe616970388f6e8de8f2e305fcd3..1f57ef8b1cb11cd18e5eb5f47593120c527fbd57 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Api/ExtensionAttribute/Config/_files/config_two.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/Api/ExtensionAttribute/Config/_files/config_two.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/Api/etc/extension_attributes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> <extension_attributes for="Magento\Customer\Api\Data\CustomerInterface"> <attribute code="custom_2" type="Magento\CustomerExtra\Api\Data\CustomerCustom22" /> <attribute code="custom_3" type="Magento\Customer\Api\Data\CustomerCustom3" /> diff --git a/dev/tests/integration/testsuite/Magento/Framework/Api/_files/extension_attributes.xml b/dev/tests/integration/testsuite/Magento/Framework/Api/_files/extension_attributes.xml index 6b79d122ab83670e6d5e2e47294d1ceef395d61d..6f53069b6ba7554f13b1861b9c00680dcedc5dcc 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Api/_files/extension_attributes.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/Api/_files/extension_attributes.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../lib/internal/Magento/Framework/Api/etc/extension_attributes.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> <extension_attributes for="Magento\Catalog\Api\Data\ProductInterface"> <attribute code="stock_item" type="Magento\CatalogInventory\Api\Data\StockItemInterface"> <resources> diff --git a/dev/tests/integration/testsuite/Magento/Framework/Api/etc/extension_attributes.xml b/dev/tests/integration/testsuite/Magento/Framework/Api/etc/extension_attributes.xml index 303986fbcefff8940e1bb67d801b6e715afbeeb0..cf6103243950e5a6f840284b62d5a182a4da5c1f 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Api/etc/extension_attributes.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/Api/etc/extension_attributes.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../lib/internal/Magento/Framework/Api/etc/extension_attributes.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> <extension_attributes for="Magento\Catalog\Api\Data\ProductInterface"> <attribute code="test_stock_item" type="Magento\CatalogInventory\Api\Data\StockItemInterface"> <resources> diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Language/DictionaryTest.php b/dev/tests/integration/testsuite/Magento/Framework/App/Language/DictionaryTest.php new file mode 100644 index 0000000000000000000000000000000000000000..212c507bb6cd8ef37be29fcdb273b760b4694a4c --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Language/DictionaryTest.php @@ -0,0 +1,124 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Framework\App\Language; + +use Magento\TestFramework\Helper\Bootstrap; + +class DictionaryTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Framework\ObjectManagerInterface + */ + private $objectManager; + + /** + * @var \Magento\Framework\App\Language\Dictionary + */ + private $model; + + /** + * @var \Magento\Framework\Filesystem\Directory\ReadFactory + */ + private $directoryFactory; + + /** + * @var \Magento\Framework\App\Language\ConfigFactory + */ + private $configFactory; + + protected function setUp() + { + $this->objectManager = Bootstrap::getObjectManager(); + $this->directoryFactory = $this->objectManager->create('Magento\Framework\Filesystem\Directory\ReadFactory'); + $this->configFactory = $this->objectManager->create('Magento\Framework\App\Language\ConfigFactory'); + } + + /** + * @param string $languageCode + * @param array $expectation + * @dataProvider dictionaryDataProvider + * @magentoComponentsDir Magento/Framework/App/Language/_files + */ + public function testDictionaryGetter($languageCode, $expectation) + { + $this->model = $this->objectManager->create( + 'Magento\Framework\App\Language\Dictionary', + ['directoryReadFactory' => $this->directoryFactory, 'configFactory' => $this->configFactory] + ); + $result = $this->model->getDictionary($languageCode); + $this->assertSame($expectation, $result); + } + + public function dictionaryDataProvider() + { + return [ + // First case with multiple inheritance, the obtained dictionary is en_AU + 'a case with multiple inheritance' => $this->getDataMultipleInheritance(), + // Second case with inheritance of package with the same language code + 'a case with inheritance similar language code' => $this->getDataInheritanceWitSimilarCode(), + // Third case with circular inheritance, when two packages depend on each other + 'a case with circular inheritance' => $this->getDataCircularInheritance() + ]; + } + + /** + * @return array + */ + private function getDataMultipleInheritance() + { + return [ + // Dictionary that will be requested + 'language_code' => 'en_AU', + // Expected merged dictionary data + 'expectation' => [ + 'one' => '1.0', + 'two' => '2', + 'three' => '3', + 'four' => '4', + 'four and 5/10' => '4.50', + 'four and 75/100' => '4.75', + 'five' => '5.0', + 'six' => '6.0', + ] + ]; + } + + /** + * @return array + */ + private function getDataInheritanceWitSimilarCode() + { + return [ + // Dictionary that will be requested + 'language_code' => 'ru_RU', + // Expected merged dictionary data + 'expectation' => [ + 'one' => '1.0', + 'two' => '2', + 'three' => '3', + ] + ]; + } + + /** + * @return array + */ + private function getDataCircularInheritance() + { + return [ + // Dictionary that will be requested + 'language_code' => 'en_US', + // Expected merged dictionary data + 'expectation' => [ + 'one' => '1.0', + 'two' => '2', + 'three' => '3', + 'four' => '4', + ] + ]; + } +} diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/bar/en_gb/1.csv b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/bar/en_gb/1.csv new file mode 100644 index 0000000000000000000000000000000000000000..0c13b51b5528733fff43daef08e61c27247d7135 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/bar/en_gb/1.csv @@ -0,0 +1,2 @@ +four and 75/100,4.75 +four and 5/10,4.50 \ No newline at end of file diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/bar/en_gb/language.xml b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/bar/en_gb/language.xml new file mode 100644 index 0000000000000000000000000000000000000000..470e5d5ebe24c80ffe483bca8bda15d2f6acd19c --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/bar/en_gb/language.xml @@ -0,0 +1,14 @@ +<?xml version="1.0"?> +<!-- +/** +* Copyright © 2015 Magento. All rights reserved. +* See COPYING.txt for license details. +*/ +--> +<language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/Language/package.xsd"> + <code>en_GB</code> + <vendor>bar</vendor> + <package>en_gb</package> + <sort_order>100</sort_order> + <use package="en_us" vendor="bar"/> +</language> diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/bar/en_gb/registration.php b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/bar/en_gb/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..e85db36508fe1c0faedf91f8230d3b43923d969d --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/bar/en_gb/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::LANGUAGE, + 'bar_en_gb', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/bar/en_us/a.csv b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/bar/en_us/a.csv new file mode 100644 index 0000000000000000000000000000000000000000..6d0ebd419aa83a43deedba4d1c5e8a47d1fb1fbb --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/bar/en_us/a.csv @@ -0,0 +1,2 @@ +one,1 +two,2 \ No newline at end of file diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/bar/en_us/b.csv b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/bar/en_us/b.csv new file mode 100644 index 0000000000000000000000000000000000000000..5f95deb28214b339eea5b7826fbfd2f7bacbf692 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/bar/en_us/b.csv @@ -0,0 +1,2 @@ +three,3 +four,4 \ No newline at end of file diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/bar/en_us/language.xml b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/bar/en_us/language.xml new file mode 100644 index 0000000000000000000000000000000000000000..facd910cf618fd8b1ba0d8bc125cbbc6602d6e09 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/bar/en_us/language.xml @@ -0,0 +1,13 @@ +<?xml version="1.0"?> +<!-- +/** +* Copyright © 2015 Magento. All rights reserved. +* See COPYING.txt for license details. +*/ +--> +<language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/Language/package.xsd"> + <code>en_US</code> + <vendor>bar</vendor> + <package>en_us</package> + <sort_order>0</sort_order> +</language> diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/bar/en_us/registration.php b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/bar/en_us/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..139f3bf40893be158c8ec875c6bd7c2e808c96cc --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/bar/en_us/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::LANGUAGE, + 'bar_en_us', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/baz/en_gb/1.csv b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/baz/en_gb/1.csv new file mode 100644 index 0000000000000000000000000000000000000000..ea501f9d969445577c077f1520bbe3d35518de38 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/baz/en_gb/1.csv @@ -0,0 +1 @@ +four and 5/10,4.5 \ No newline at end of file diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/baz/en_gb/language.xml b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/baz/en_gb/language.xml new file mode 100644 index 0000000000000000000000000000000000000000..5a8afb9be01d3f19882b1b40f38c61a6a4bc2e4a --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/baz/en_gb/language.xml @@ -0,0 +1,13 @@ +<?xml version="1.0"?> +<!-- +/** +* Copyright © 2015 Magento. All rights reserved. +* See COPYING.txt for license details. +*/ +--> +<language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/Language/package.xsd"> + <code>en_GB</code> + <vendor>baz</vendor> + <package>en_gb</package> + <sort_order>50</sort_order> +</language> diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/baz/en_gb/registration.php b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/baz/en_gb/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..61656d3140cd5be3819630229699f054a918e720 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/baz/en_gb/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::LANGUAGE, + 'baz_en_gb', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/first/en_us/1.csv b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/first/en_us/1.csv new file mode 100644 index 0000000000000000000000000000000000000000..c060ee4adee4887c8cea98333f2476934d6117fd --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/first/en_us/1.csv @@ -0,0 +1,2 @@ +three,3 +one,1.0 \ No newline at end of file diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/first/en_us/language.xml b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/first/en_us/language.xml new file mode 100644 index 0000000000000000000000000000000000000000..ff9a72e347b5b1c94dfe256df1cad8fb14df88ca --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/first/en_us/language.xml @@ -0,0 +1,14 @@ +<?xml version="1.0"?> +<!-- +/** +* Copyright © 2015 Magento. All rights reserved. +* See COPYING.txt for license details. +*/ +--> +<language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/Language/package.xsd"> + <code>en_US</code> + <vendor>first</vendor> + <package>en_us</package> + <sort_order>0</sort_order> + <use package="en_gb" vendor="second"/> +</language> diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/first/en_us/registration.php b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/first/en_us/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..c15a7d120cb2c4d11c8051d8287b395d97b89a72 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/first/en_us/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::LANGUAGE, + 'first_en_us', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/foo/en_au/1.csv b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/foo/en_au/1.csv new file mode 100644 index 0000000000000000000000000000000000000000..78c71636f6a85fcc65380803b8a44c61654f4a23 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/foo/en_au/1.csv @@ -0,0 +1,2 @@ +one,1.0 +five,5.0 \ No newline at end of file diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/foo/en_au/2.csv b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/foo/en_au/2.csv new file mode 100644 index 0000000000000000000000000000000000000000..51d11abe2bd663792b711be6bff08b7cd7ca5a78 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/foo/en_au/2.csv @@ -0,0 +1 @@ +six,6.0 \ No newline at end of file diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/foo/en_au/language.xml b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/foo/en_au/language.xml new file mode 100644 index 0000000000000000000000000000000000000000..9b5d83e20339b67198da29873e8f11f8fe191dbe --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/foo/en_au/language.xml @@ -0,0 +1,15 @@ +<?xml version="1.0"?> +<!-- +/** +* Copyright © 2015 Magento. All rights reserved. +* See COPYING.txt for license details. +*/ +--> +<language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/Language/package.xsd"> + <code>en_AU</code> + <vendor>foo</vendor> + <package>en_au</package> + <sort_order>0</sort_order> + <use package="en_gb" vendor="bar"/> + <use package="en_gb" vendor="baz"/> +</language> diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/foo/en_au/registration.php b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/foo/en_au/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..7bb873eef492063fea3dc8f38737fedcc97f5254 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/foo/en_au/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::LANGUAGE, + 'foo_en_au', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/my/ru_ru/1.csv b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/my/ru_ru/1.csv new file mode 100644 index 0000000000000000000000000000000000000000..c060ee4adee4887c8cea98333f2476934d6117fd --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/my/ru_ru/1.csv @@ -0,0 +1,2 @@ +three,3 +one,1.0 \ No newline at end of file diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/my/ru_ru/language.xml b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/my/ru_ru/language.xml new file mode 100644 index 0000000000000000000000000000000000000000..8a1d0f71644d5704f32994deea03b599bb97c249 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/my/ru_ru/language.xml @@ -0,0 +1,14 @@ +<?xml version="1.0"?> +<!-- +/** +* Copyright © 2015 Magento. All rights reserved. +* See COPYING.txt for license details. +*/ +--> +<language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/Language/package.xsd"> + <code>ru_RU</code> + <vendor>my</vendor> + <package>ru_ru</package> + <sort_order>0</sort_order> + <use package="ru_ru" vendor="theirs"/> +</language> diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/my/ru_ru/registration.php b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/my/ru_ru/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..82b5867e23d68972f10d6a07d9a81723b3ee3fd3 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/my/ru_ru/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::LANGUAGE, + 'my_ru_ru', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/second/en_gb/1.csv b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/second/en_gb/1.csv new file mode 100644 index 0000000000000000000000000000000000000000..6d0ebd419aa83a43deedba4d1c5e8a47d1fb1fbb --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/second/en_gb/1.csv @@ -0,0 +1,2 @@ +one,1 +two,2 \ No newline at end of file diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/second/en_gb/language.xml b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/second/en_gb/language.xml new file mode 100644 index 0000000000000000000000000000000000000000..2954430d58e15f1aecbdaae8342772cf7923fd81 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/second/en_gb/language.xml @@ -0,0 +1,14 @@ +<?xml version="1.0"?> +<!-- +/** +* Copyright © 2015 Magento. All rights reserved. +* See COPYING.txt for license details. +*/ +--> +<language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/Language/package.xsd"> + <code>en_GB</code> + <vendor>second</vendor> + <package>en_gb</package> + <sort_order>0</sort_order> + <use package="en_us" vendor="first"/> +</language> diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/second/en_gb/registration.php b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/second/en_gb/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..94b6a39da0242cf9fcef34b3eb5bc00ac648c618 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/second/en_gb/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::LANGUAGE, + 'second_en_gb', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/theirs/ru_ru/1.csv b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/theirs/ru_ru/1.csv new file mode 100644 index 0000000000000000000000000000000000000000..6d0ebd419aa83a43deedba4d1c5e8a47d1fb1fbb --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/theirs/ru_ru/1.csv @@ -0,0 +1,2 @@ +one,1 +two,2 \ No newline at end of file diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/theirs/ru_ru/language.xml b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/theirs/ru_ru/language.xml new file mode 100644 index 0000000000000000000000000000000000000000..37c9ca9484405736904bad1f3891af0472d7af76 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/theirs/ru_ru/language.xml @@ -0,0 +1,13 @@ +<?xml version="1.0"?> +<!-- +/** +* Copyright © 2015 Magento. All rights reserved. +* See COPYING.txt for license details. +*/ +--> +<language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/Language/package.xsd"> + <code>ru_RU</code> + <vendor>theirs</vendor> + <package>ru_ru</package> + <sort_order>0</sort_order> +</language> diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/theirs/ru_ru/registration.php b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/theirs/ru_ru/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..207d2238e81e2a43250e0df75370fd5717f2ca6b --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Language/_files/theirs/ru_ru/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::LANGUAGE, + 'theirs_ru_ru', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Utility/FilesTest.php b/dev/tests/integration/testsuite/Magento/Framework/App/Utility/FilesTest.php index a26bf661ebbe62de87bbfb0fa0da99a719999155..2ca967abca40e8238166a75dc7ff18302b9b25cb 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/App/Utility/FilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Utility/FilesTest.php @@ -7,23 +7,21 @@ namespace Magento\Framework\App\Utility; use Magento\Framework\App\Utility\Files; +use Magento\Framework\Component\ComponentRegistrar; class FilesTest extends \PHPUnit_Framework_TestCase { /** @var \Magento\Framework\App\Utility\Files */ protected $model; - /** @var string */ - protected $moduleTests = '#app/code/[\\w]+/[\\w]+/Test#'; - - /** @var string */ - protected $toolsTests = '#dev/tools/Magento/Tools/[\\w]+/Test#'; + /** @var array */ + protected $moduleTests = []; - /** @var string */ - protected $frameworkTests = '#lib/internal/Magento/Framework/[\\w]+/Test#'; + /** @var array */ + protected $frameworkTests = []; - /** @var string */ - protected $libTests = '#lib/internal/[\\w]+/[\\w]+/Test#'; + /** @var array */ + protected $libTests = []; /** @var string */ protected $rootTestsDir = '#dev/tests/#'; @@ -33,44 +31,80 @@ class FilesTest extends \PHPUnit_Framework_TestCase public function setUp() { - $this->model = new Files(BP); + $componentRegistrar = new ComponentRegistrar(); + $dirSearch = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create('Magento\Framework\Component\DirSearch'); + $themePackageList = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create('Magento\Framework\View\Design\Theme\ThemePackageList'); + $this->model = new Files($componentRegistrar, $dirSearch, $themePackageList); + foreach ($componentRegistrar->getPaths(ComponentRegistrar::MODULE) as $moduleDir) { + $this->moduleTests[] = '#' . $moduleDir . '/Test#'; + } + foreach ($componentRegistrar->getPaths(ComponentRegistrar::LIBRARY) as $libraryDir) { + $this->libTests[] = '#' . $libraryDir . '/Test#'; + $this->frameworkTests[] = '#' . $libraryDir . '/[\\w]+/Test#'; + } } public function testGetPhpFilesExcludeTests() { $this->assertNoTestDirs( - $this->model->getPhpFiles(true, true, true, false) + $this->model->getPhpFiles( + Files::INCLUDE_APP_CODE + | Files::INCLUDE_PUB_CODE + | Files::INCLUDE_DEV_TOOLS + | Files::INCLUDE_LIBS + | Files::INCLUDE_TEMPLATES + | Files::INCLUDE_NON_CLASSES + ) ); } public function testGetComposerExcludeTests() { $this->assertNoTestDirs( - $this->model->getComposerFiles('code', false) + $this->model->getComposerFiles(ComponentRegistrar::MODULE, false) ); } - public function testGetClassFilesExcludeTests() + public function testGetPhpFilesOnlyTests() { - $this->assertNoTestDirs( - $this->model->getClassFiles(true, false, true, true, false) - ); - } + $classFiles = $this->model->getPhpFiles(Files::INCLUDE_TESTS); + + foreach ($this->moduleTests as $moduleTest) { + $classFiles = preg_grep($moduleTest, $classFiles, PREG_GREP_INVERT); + } + foreach ($this->libTests as $libraryTest) { + $classFiles = preg_grep($libraryTest, $classFiles, PREG_GREP_INVERT); + } + foreach ($this->frameworkTests as $frameworkTest) { + $classFiles = preg_grep($frameworkTest, $classFiles, PREG_GREP_INVERT); + } - public function testGetClassFilesOnlyTests() - { - $classFiles = $this->model->getClassFiles(false, true, false, false, false); - - $classFiles = preg_grep($this->moduleTests, $classFiles, PREG_GREP_INVERT); - $classFiles = preg_grep($this->libTests, $classFiles, PREG_GREP_INVERT); - $classFiles = preg_grep($this->frameworkTests, $classFiles, PREG_GREP_INVERT); - $classFiles = preg_grep($this->toolsTests, $classFiles, PREG_GREP_INVERT); $classFiles = preg_grep($this->rootTestsDir, $classFiles, PREG_GREP_INVERT); $classFiles = preg_grep($this->setupTestsDir, $classFiles, PREG_GREP_INVERT); $this->assertEmpty($classFiles); } + public function testGetConfigFiles() + { + $actual = $this->model->getConfigFiles('*.xml'); + $this->assertNotEmpty($actual); + foreach ($actual as $file) { + $this->assertStringEndsWith('.xml', $file[0]); + } + } + + public function testGetLayoutConfigFiles() + { + $actual = $this->model->getLayoutConfigFiles('*.xml'); + $this->assertNotEmpty($actual); + foreach ($actual as $file) { + $this->assertStringEndsWith('.xml', $file[0]); + } + } + /** * Verify that the given array of files does not contain anything in test directories * @@ -78,9 +112,36 @@ class FilesTest extends \PHPUnit_Framework_TestCase */ protected function assertNoTestDirs($files) { - $this->assertEmpty(preg_grep($this->moduleTests, $files)); - $this->assertEmpty(preg_grep($this->frameworkTests, $files)); - $this->assertEmpty(preg_grep($this->libTests, $files)); - $this->assertEmpty(preg_grep($this->toolsTests, $files)); + foreach ($this->moduleTests as $moduleTest) { + $this->assertEmpty(preg_grep($moduleTest, $files)); + } + foreach ($this->frameworkTests as $frameworkTest) { + $this->assertEmpty(preg_grep($frameworkTest, $files)); + } + foreach ($this->libTests as $libTest) { + $this->assertEmpty(preg_grep($libTest, $files)); + } + } + + /** + * @magentoComponentsDir Magento/Framework/App/Utility/_files/fixtures + */ + public function testReadLists() + { + $fixtureDir = str_replace('\\', '/', __DIR__) . '/_files/fixtures/'; + $expected = [ + $fixtureDir . 'language/One.php', + $fixtureDir . 'language/registration.php', + $fixtureDir . 'library/One.php', + $fixtureDir . 'module/One.php', + $fixtureDir . 'module/registration.php', + $fixtureDir . 'theme/One.php', + ]; + $actual = $this->model->readLists(__DIR__ . '/_files/patterns/paths*.txt'); + sort($actual); + foreach ($actual as &$file) { + $file = str_replace('\\', '/', $file); + } + $this->assertSame($expected, $actual); } } diff --git a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/design/frontend/Test/default/Magento_Module/web/1.file b/dev/tests/integration/testsuite/Magento/Framework/App/Utility/_files/fixtures/language/One.php similarity index 100% rename from dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/design/frontend/Test/default/Magento_Module/web/1.file rename to dev/tests/integration/testsuite/Magento/Framework/App/Utility/_files/fixtures/language/One.php diff --git a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/design/frontend/Test/parent/Magento_Module/web/1.file b/dev/tests/integration/testsuite/Magento/Framework/App/Utility/_files/fixtures/language/one.csv similarity index 100% rename from dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/design/frontend/Test/parent/Magento_Module/web/1.file rename to dev/tests/integration/testsuite/Magento/Framework/App/Utility/_files/fixtures/language/one.csv diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Utility/_files/fixtures/language/registration.php b/dev/tests/integration/testsuite/Magento/Framework/App/Utility/_files/fixtures/language/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..a0975883ef23ca476ddea24f55cd9a50c2b50981 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Utility/_files/fixtures/language/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::LANGUAGE, + 'magento_test_lang', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/design/frontend/Test/parent/Magento_Second/web/1.file b/dev/tests/integration/testsuite/Magento/Framework/App/Utility/_files/fixtures/library/One.php similarity index 100% rename from dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/design/frontend/Test/parent/Magento_Second/web/1.file rename to dev/tests/integration/testsuite/Magento/Framework/App/Utility/_files/fixtures/library/One.php diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Utility/_files/fixtures/library/registration.php b/dev/tests/integration/testsuite/Magento/Framework/App/Utility/_files/fixtures/library/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..4b2df6f818d946bfb984d35c106168c6c9db9456 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Utility/_files/fixtures/library/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::LIBRARY, + 'magento/test', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Utility/_files/fixtures/module/One.php b/dev/tests/integration/testsuite/Magento/Framework/App/Utility/_files/fixtures/module/One.php new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Utility/_files/fixtures/module/registration.php b/dev/tests/integration/testsuite/Magento/Framework/App/Utility/_files/fixtures/module/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..7b4dcf888a0cd33934def4f664ed54f798152c74 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Utility/_files/fixtures/module/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_Module', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Utility/_files/fixtures/theme/One.php b/dev/tests/integration/testsuite/Magento/Framework/App/Utility/_files/fixtures/theme/One.php new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Utility/_files/fixtures/theme/registration.php b/dev/tests/integration/testsuite/Magento/Framework/App/Utility/_files/fixtures/theme/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..51e6874c5dfafc5a0fa98a223ebd26bf1d966a74 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Utility/_files/fixtures/theme/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::THEME, + 'frontent/Test/theme', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Utility/_files/patterns/paths_one.txt b/dev/tests/integration/testsuite/Magento/Framework/App/Utility/_files/patterns/paths_one.txt new file mode 100644 index 0000000000000000000000000000000000000000..8f2df480aabc5ede65a692558387b351a2ba5919 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Utility/_files/patterns/paths_one.txt @@ -0,0 +1,2 @@ +module Magento_Module * +theme frontent/Test/theme One* diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Utility/_files/patterns/paths_two.txt b/dev/tests/integration/testsuite/Magento/Framework/App/Utility/_files/patterns/paths_two.txt new file mode 100644 index 0000000000000000000000000000000000000000..a540949fd0d2d5e68908f5ab891f0f7f2b441259 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Utility/_files/patterns/paths_two.txt @@ -0,0 +1,2 @@ +library magento/test One* +language magento_test_lang *.php diff --git a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/Adapter/Less/OyejorgeTest.php b/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/Adapter/Less/OyejorgeTest.php index 1172c44a84e402582c4d7f63f06d009b783580dc..399f0b7a44bfda7cde4a3623a6042edc372d3c71 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/Adapter/Less/OyejorgeTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/Adapter/Less/OyejorgeTest.php @@ -37,8 +37,6 @@ class OyejorgeTest extends \PHPUnit_Framework_TestCase : file_get_contents(__DIR__ . '/_files/oyejorge.css'); $actualCss = ($this->model->process($sourceFilePath)); - file_put_contents(__DIR__ . '/_files/actual.css', $actualCss); - file_put_contents(__DIR__ . '/_files/expected.css', $expectedCss); $this->assertEquals($this->cutCopyrights($expectedCss), $actualCss); } diff --git a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/File/Collector/AggregatedTest.php b/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/File/Collector/AggregatedTest.php index 3d38f3ac0eeaf53c6a1010d1c086eff5d4cc6415..1fe35b400583d59d8d01c79bec5b39527821630e 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/File/Collector/AggregatedTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/File/Collector/AggregatedTest.php @@ -11,6 +11,10 @@ namespace Magento\Framework\Css\PreProcessor\File\Collector; use Magento\Framework\App\Bootstrap; use Magento\Framework\App\Filesystem\DirectoryList; +/** + * @magentoComponentsDir Magento/Framework/Css/PreProcessor/_files/code/Magento + * @magentoDbIsolation enabled + */ class AggregatedTest extends \PHPUnit_Framework_TestCase { /** @@ -31,13 +35,15 @@ class AggregatedTest extends \PHPUnit_Framework_TestCase DirectoryList::LIB_WEB => [ DirectoryList::PATH => dirname(dirname(__DIR__)) . '/_files/lib/web', ], - DirectoryList::THEMES => [ - DirectoryList::PATH => dirname(dirname(__DIR__)) . '/_files/design', - ], ], ] ); $this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + /** @var \Magento\Theme\Model\Theme\Registration $registration */ + $registration = $this->objectManager->get( + 'Magento\Theme\Model\Theme\Registration' + ); + $registration->register(); $this->objectManager->get('Magento\Framework\App\State')->setAreaCode('frontend'); /** @var \Magento\Framework\Filesystem $filesystem */ @@ -48,14 +54,6 @@ class AggregatedTest extends \PHPUnit_Framework_TestCase 'Magento\Framework\App\Filesystem\DirectoryList', [ 'root' => BP, - 'config' => [ - DirectoryList::MODULES => [ - DirectoryList::PATH => dirname(dirname(__DIR__)) . '/_files/code', - ], - DirectoryList::THEMES => [ - DirectoryList::PATH => dirname(dirname(__DIR__)) . '/_files/design', - ], - ] ] ) ] @@ -76,13 +74,13 @@ class AggregatedTest extends \PHPUnit_Framework_TestCase } /** - * @magentoDataFixture Magento/Framework/Css/PreProcessor/_files/themes.php * @magentoAppIsolation enabled * @magentoAppArea frontend * @param string $path * @param string $themeName * @param string[] $expectedFiles * @dataProvider getFilesDataProvider + * @magentoComponentsDir Magento/Framework/Css/PreProcessor/_files/design */ public function testGetFiles($path, $themeName, array $expectedFiles) { @@ -113,7 +111,7 @@ class AggregatedTest extends \PHPUnit_Framework_TestCase return [ 'file in theme and parent theme' => [ '1.file', - 'Test/default', + 'FrameworkCssTest/default', [ str_replace( '\\', @@ -123,18 +121,18 @@ class AggregatedTest extends \PHPUnit_Framework_TestCase str_replace( '\\', '/', - "$fixtureDir/_files/design/frontend/Test/parent/Magento_Second/web/1.file" + "$fixtureDir/_files/design/frontend/Test/parent/MagentoFrameworkCssTest_Second/web/1.file" ), str_replace( '\\', '/', - "$fixtureDir/_files/design/frontend/Test/default/Magento_Module/web/1.file" + "$fixtureDir/_files/design/frontend/Test/default/MagentoFrameworkCssTest_Module/web/1.file" ), ], ], 'file in library' => [ '2.file', - 'Test/default', + 'FrameworkCssTest/default', [ str_replace( '\\', @@ -145,12 +143,12 @@ class AggregatedTest extends \PHPUnit_Framework_TestCase ], 'non-existing file' => [ 'doesNotExist', - 'Test/default', + 'FrameworkCssTest/default', [], ], 'file in library, module, and theme' => [ '3.less', - 'Test/default', + 'FrameworkCssTest/default', [ str_replace( '\\', @@ -165,7 +163,7 @@ class AggregatedTest extends \PHPUnit_Framework_TestCase str_replace( '\\', '/', - "$fixtureDir/_files/design/frontend/Test/default/Magento_Third/web/3.less" + "$fixtureDir/_files/design/frontend/Test/default/MagentoFrameworkCssTest_Third/web/3.less" ) ], ], diff --git a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/code/Magento/Other/registration.php b/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/code/Magento/Other/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..de4863ba94ca7d32370ce294f25c6c80b2f1e443 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/code/Magento/Other/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'MagentoFrameworkCssTest_Other', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/code/Magento/Third/registration.php b/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/code/Magento/Third/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..634d8a467d2fd5e064715fc695ec712831a5771c --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/code/Magento/Third/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'MagentoFrameworkCssTest_Third', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/design/frontend/Test/default/MagentoFrameworkCssTest_Module/web/1.file b/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/design/frontend/Test/default/MagentoFrameworkCssTest_Module/web/1.file new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/design/frontend/Test/default/Magento_Third/web/3.less b/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/design/frontend/Test/default/MagentoFrameworkCssTest_Third/web/3.less similarity index 100% rename from dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/design/frontend/Test/default/Magento_Third/web/3.less rename to dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/design/frontend/Test/default/MagentoFrameworkCssTest_Third/web/3.less diff --git a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/design/frontend/Test/default/registration.php b/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/design/frontend/Test/default/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..d6ee757711949122db1711431bef44ed0368b047 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/design/frontend/Test/default/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::THEME, + 'frontend/FrameworkCssTest/default', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/design/frontend/Test/default/theme.xml b/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/design/frontend/Test/default/theme.xml index 43bfd325c120fd39337ceca81ff83e5455568145..0dd14faf936259207269a6d01b5e6ccf8f808726 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/design/frontend/Test/default/theme.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/design/frontend/Test/default/theme.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> +<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> <title>Test Default</title> - <parent>Test/parent</parent> + <parent>FrameworkCssTest/parent</parent> </theme> diff --git a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/design/frontend/Test/parent/MagentoFrameworkCssTest_Module/web/1.file b/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/design/frontend/Test/parent/MagentoFrameworkCssTest_Module/web/1.file new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/design/frontend/Test/parent/MagentoFrameworkCssTest_Second/web/1.file b/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/design/frontend/Test/parent/MagentoFrameworkCssTest_Second/web/1.file new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/design/frontend/Test/parent/registration.php b/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/design/frontend/Test/parent/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..c14fdc49c621ce8682bf39790f1064773164a92f --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/design/frontend/Test/parent/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::THEME, + 'frontend/FrameworkCssTest/parent', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/design/frontend/Test/parent/theme.xml b/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/design/frontend/Test/parent/theme.xml index 3b0de54fbeca9419b7c08edfa042bebcb5df5264..262b17f87cdc2b59ab3947ce25d25264affc2062 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/design/frontend/Test/parent/theme.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/design/frontend/Test/parent/theme.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> +<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> <title>Test Parent</title> </theme> diff --git a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/themes.php b/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/themes.php deleted file mode 100644 index d22b22213d88508bd6b873dcf337b29842fc9cb6..0000000000000000000000000000000000000000 --- a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/_files/themes.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -use Magento\Framework\App\Bootstrap; -use Magento\Framework\App\Filesystem\DirectoryList; - -\Magento\TestFramework\Helper\Bootstrap::getInstance()->reinitialize( - [ - Bootstrap::INIT_PARAM_FILESYSTEM_DIR_PATHS => [ - DirectoryList::THEMES => ['path' => __DIR__ . '/design'], - ], - ] -); -$objectManger = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); -$objectManger->get('Magento\Framework\App\State') - ->setAreaCode(\Magento\Framework\View\DesignInterface::DEFAULT_AREA); - -/** @var $registration \Magento\Theme\Model\Theme\Registration */ -$registration = $objectManger->create('Magento\Theme\Model\Theme\Registration'); -$registration->register('*/*/*/theme.xml'); diff --git a/dev/tests/integration/testsuite/Magento/Framework/DataObject/Copy/Config/_files/fieldset.xml b/dev/tests/integration/testsuite/Magento/Framework/DataObject/Copy/Config/_files/fieldset.xml index 0fbf1769ddd8bf618287154205f3f349c0d7db99..532648084e3cf5e96bf068f8ff2626b86f08db18 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/DataObject/Copy/Config/_files/fieldset.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/DataObject/Copy/Config/_files/fieldset.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/DataObject/etc/fieldset.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:framework:DataObject/etc/fieldset.xsd"> <scope id="global"> <fieldset id="sales_convert_quote_address"> <field name="company"> diff --git a/dev/tests/integration/testsuite/Magento/Framework/DataObject/Copy/Config/_files/partialFieldsetFirst.xml b/dev/tests/integration/testsuite/Magento/Framework/DataObject/Copy/Config/_files/partialFieldsetFirst.xml index 456c284f87ba29018dd2d04b2ea404c09460a3ea..f94fb76d0e3bb2451e0f5def259fb8bd26e526e8 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/DataObject/Copy/Config/_files/partialFieldsetFirst.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/DataObject/Copy/Config/_files/partialFieldsetFirst.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/DataObject/etc/fieldset.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:framework:DataObject/etc/fieldset.xsd"> <scope id="global"> <fieldset id="quote_convert_item"> <field name="event_id"> diff --git a/dev/tests/integration/testsuite/Magento/Framework/DataObject/Copy/Config/_files/partialFieldsetSecond.xml b/dev/tests/integration/testsuite/Magento/Framework/DataObject/Copy/Config/_files/partialFieldsetSecond.xml index db53d0ce7256652c7668baa672600e82a478d10f..8b7dc5620aec2fe8513c0bacc70b437aa0036bb3 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/DataObject/Copy/Config/_files/partialFieldsetSecond.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/DataObject/Copy/Config/_files/partialFieldsetSecond.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/DataObject/etc/fieldset_file.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:framework:DataObject/etc/fieldset_file.xsd"> <scope id="global"> <fieldset id="quote_convert_item"> <field name="event_id"> diff --git a/dev/tests/integration/testsuite/Magento/Framework/Image/Adapter/InterfaceTest.php b/dev/tests/integration/testsuite/Magento/Framework/Image/Adapter/InterfaceTest.php index 248c90684a529a95cba9717392663360e6ed2a5f..fbe618a286e6b319319167a08a3af8ff3a65d587 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Image/Adapter/InterfaceTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Image/Adapter/InterfaceTest.php @@ -548,12 +548,13 @@ class InterfaceTest extends \PHPUnit_Framework_TestCase public function testCreatePngFromString($pixel1, $expectedColor1, $pixel2, $expectedColor2, $adapterType) { $adapter = $this->_getAdapter($adapterType); - /** @var \Magento\Framework\Filesystem $filesystem */ - $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\Framework\Filesystem' + + /** @var \Magento\Framework\Filesystem\Directory\ReadFactory readFactory */ + $readFactory = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( + 'Magento\Framework\Filesystem\Directory\ReadFactory' ); - $path = $filesystem->getDirectoryRead(DirectoryList::LIB_INTERNAL) - ->getAbsolutePath('LinLibertineFont/LinLibertine_Re-4.4.1.ttf'); + $reader = $readFactory->create(BP); + $path = $reader->getAbsolutePath('lib/internal/LinLibertineFont/LinLibertine_Re-4.4.1.ttf'); $adapter->createPngFromString('T', $path); $adapter->refreshImageDimensions(); diff --git a/dev/tests/integration/testsuite/Magento/Framework/ObjectManager/_files/config_merged.xml b/dev/tests/integration/testsuite/Magento/Framework/ObjectManager/_files/config_merged.xml index 4610d188855706ad6f218c5bf44632ec9f05cd11..ac1ce6ac359548fc93fe51fe8e1e7da5e1e86582 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/ObjectManager/_files/config_merged.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/ObjectManager/_files/config_merged.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Framework\Module\SomeInterface" type="Magento\Framework\Module\ClassOne" /> <preference for="Magento\Framework\Module\SomeInterfaceTwo" type="Magento\Framework\Module\ClassTwo" /> <type name="Magento\Framework\Data\Collection\Db\FetchStrategy\Cache"> diff --git a/dev/tests/integration/testsuite/Magento/Framework/ObjectManager/_files/config_one.xml b/dev/tests/integration/testsuite/Magento/Framework/ObjectManager/_files/config_one.xml index 453a101d77396e9eee2cc191c28527f6760ec880..f75d7d05f4b6cd1d791cf91ced84c4b5aa13f1f4 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/ObjectManager/_files/config_one.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/ObjectManager/_files/config_one.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Framework\Module\SomeInterface" type="Magento\Framework\Module\ClassOne" /> <type name="Magento\Framework\Data\Collection\Db\FetchStrategy\Cache"> <arguments> diff --git a/dev/tests/integration/testsuite/Magento/Framework/ObjectManager/_files/config_two.xml b/dev/tests/integration/testsuite/Magento/Framework/ObjectManager/_files/config_two.xml index aac517c5b78579818767c8304503a55345e10544..dcc2a57671a973d915b2b9fea2f76d0e9d0570b3 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/ObjectManager/_files/config_two.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/ObjectManager/_files/config_two.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Framework\Module\SomeInterface" type="Magento\Framework\Module\ClassOne" /> <preference for="Magento\Framework\Module\SomeInterfaceTwo" type="Magento\Framework\Module\ClassTwo" /> <type name="Magento\Framework\Data\Collection\Db\FetchStrategy\Cache"> diff --git a/dev/tests/integration/testsuite/Magento/Framework/Search/Request/Config/FileResolverStub.php b/dev/tests/integration/testsuite/Magento/Framework/Search/Request/Config/FileResolverStub.php index 68a30311d4ae6f1f58ffa74dcf32d211eb9c6d39..7af408c73d09562f26e65f72949c9b995f9342bf 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Search/Request/Config/FileResolverStub.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Search/Request/Config/FileResolverStub.php @@ -14,15 +14,11 @@ class FileResolverStub implements \Magento\Framework\Config\FileResolverInterfac */ public function get($filename, $scope) { - $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $readDirectory = $objectManager->create( - 'Magento\Framework\Filesystem\Directory\Read', - [ - 'driver' => $objectManager->create('Magento\Framework\Filesystem\Driver\File'), - 'path' => realpath(__DIR__ . '/../../_files/etc'), - ] + $path = realpath(__DIR__ . '/../../_files/etc'); + $paths = [$path . '/search_request_1.xml', $path . '/search_request_2.xml']; + return new \Magento\Framework\Config\FileIterator( + new \Magento\Framework\Filesystem\File\ReadFactory(new \Magento\Framework\Filesystem\DriverPool), + $paths ); - $paths = ['search_request_1.xml', 'search_request_2.xml']; - return new \Magento\Framework\Config\FileIterator($readDirectory, $paths); } } diff --git a/dev/tests/integration/testsuite/Magento/Framework/Search/_files/etc/search_request_1.xml b/dev/tests/integration/testsuite/Magento/Framework/Search/_files/etc/search_request_1.xml index da9c5d232397a062645c644e226172e7b5daeb6a..cbaec4d0b76c1a7ec027461f1a8e503efcc82710 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Search/_files/etc/search_request_1.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/Search/_files/etc/search_request_1.xml @@ -6,7 +6,7 @@ */ --> <requests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/Search/etc/search_request.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:framework:Search/etc/search_request.xsd"> <request query="bool_query" index="bool_query_index"> <dimensions> <dimension name="scope" value="default"/> diff --git a/dev/tests/integration/testsuite/Magento/Framework/Search/_files/etc/search_request_2.xml b/dev/tests/integration/testsuite/Magento/Framework/Search/_files/etc/search_request_2.xml index 164f0c91bfad0774029d0d0ed57610f2243efb91..d5e833569833da73a6d89461d171b710dc99ff00 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Search/_files/etc/search_request_2.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/Search/_files/etc/search_request_2.xml @@ -6,7 +6,7 @@ */ --> <requests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/Search/etc/search_request.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:framework:Search/etc/search_request.xsd"> <request query="bool_query" index="bool_query_index_override"> <dimensions> <dimension name="scope" value="default_override"/> diff --git a/dev/tests/integration/testsuite/Magento/Framework/Search/_files/requests.xml b/dev/tests/integration/testsuite/Magento/Framework/Search/_files/requests.xml index df76e90d9d56accd8a237a6e6e74f8d7d0f6cfaa..fac25a1b7266b93d8b4562647bd0eaadabb870de 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Search/_files/requests.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/Search/_files/requests.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<requests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../lib/internal/Magento/Framework/Search/etc/search_request_merged.xsd"> +<requests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Search/etc/search_request_merged.xsd"> <request query="one_match" index="catalogsearch_fulltext"> <dimensions> <dimension name="scope" value="default"/> diff --git a/dev/tests/integration/testsuite/Magento/Framework/Search/_files/search_request.xml b/dev/tests/integration/testsuite/Magento/Framework/Search/_files/search_request.xml index 21f3d14cb543ba7c3640f88ee5f7eb365dd0046b..d2475022d0f5dddf9d3249248cc621cf78c9cc12 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Search/_files/search_request.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/Search/_files/search_request.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<requests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../lib/internal/Magento/Framework/Search/etc/search_request_merged.xsd"> +<requests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Search/etc/search_request_merged.xsd"> <request query="suggested_search_container" index="product"> <dimensions> <dimension name="scope" value="default" /> diff --git a/dev/tests/integration/testsuite/Magento/Framework/Session/ConfigTest.php b/dev/tests/integration/testsuite/Magento/Framework/Session/ConfigTest.php index 9962b27826a785f1a29388d735b8e67bc5497757..d45a1d3e31fc7278cdf8c351d534c2381b2a2358 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Session/ConfigTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Session/ConfigTest.php @@ -12,29 +12,19 @@ use Magento\Framework\App\Filesystem\DirectoryList; */ class ConfigTest extends \PHPUnit_Framework_TestCase { - /** - * @var \Magento\Framework\Session\Config - */ + /** @var \Magento\Framework\Session\Config */ protected $_model; - /** - * @var string - */ + /** @var string */ protected $_cacheLimiter = 'private_no_expire'; - /** - * @var \Magento\TestFramework\ObjectManager - */ + /** @var \Magento\TestFramework\ObjectManager */ protected $_objectManager; - /** - * @var string Default value for session.save_path setting - */ + /** @var string Default value for session.save_path setting */ protected $defaultSavePath; - /** - * @var \Magento\Framework\App\DeploymentConfig | \PHPUnit_Framework_MockObject_MockObject - */ + /** @var \Magento\Framework\App\DeploymentConfig | \PHPUnit_Framework_MockObject_MockObject */ protected $deploymentConfigMock; protected function setUp() @@ -48,7 +38,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase $this->deploymentConfigMock = $this->getMock('Magento\Framework\App\DeploymentConfig', [], [], '', false); $this->deploymentConfigMock->expects($this->at(0)) ->method('get') - ->with(Config::PARAM_SESSION_SAVE_METHOD, 'files') + ->with($this->equalTo(Config::PARAM_SESSION_SAVE_METHOD), $this->anything()) ->will($this->returnValue('files')); $this->deploymentConfigMock->expects($this->at(1)) ->method('get') @@ -67,12 +57,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase ->get('Magento\Framework\Filesystem\DirectoryList') ->getPath(DirectoryList::SESSION); } - - protected function tearDown() - { - $this->_objectManager->removeSharedInstance('Magento\Framework\Session\Config'); - } - + /** * @magentoAppIsolation enabled */ diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/Asset/MinifierTest.php b/dev/tests/integration/testsuite/Magento/Framework/View/Asset/MinifierTest.php index 28f0428388c4b3b20bf5e3025926b173abbf0340..95747ff5626dbfe316e19c679c43959f4df1ad7b 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/Asset/MinifierTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/View/Asset/MinifierTest.php @@ -5,19 +5,33 @@ */ namespace Magento\Framework\View\Asset; +use Magento\Framework\App\Filesystem\DirectoryList; use Magento\TestFramework\Helper\Bootstrap; use Magento\Framework\App\State as AppState; /** * Tests for minifier + * + * @magentoComponentsDir Magento/Framework/View/_files/static/theme + * @magentoDbIsolation enabled */ class MinifierTest extends \PHPUnit_Framework_TestCase { + /** + * @var \Magento\Framework\Filesystem\Directory\WriteInterface + */ + private $staticDir; + /** * @var \Magento\TestFramework\ObjectManager */ protected $objectManager; + /** + * @var string + */ + private $origMode; + /** * {@inheritDoc} */ @@ -25,9 +39,18 @@ class MinifierTest extends \PHPUnit_Framework_TestCase { parent::setUp(); $this->objectManager = Bootstrap::getInstance()->getObjectManager(); + /** @var \Magento\Theme\Model\Theme\Registration $registration */ + $registration = $this->objectManager->get( + 'Magento\Theme\Model\Theme\Registration' + ); + $registration->register(); /** @var \Magento\TestFramework\App\State $appState */ $appState = $this->objectManager->get('Magento\TestFramework\App\State'); + $this->origMode = $appState->getMode(); $appState->setMode(AppState::MODE_DEFAULT); + /** @var \Magento\Framework\Filesystem $filesystem */ + $filesystem = Bootstrap::getObjectManager()->get('Magento\Framework\Filesystem'); + $this->staticDir = $filesystem->getDirectoryWrite(DirectoryList::STATIC_VIEW); } /** @@ -37,7 +60,10 @@ class MinifierTest extends \PHPUnit_Framework_TestCase { /** @var \Magento\TestFramework\App\State $appState */ $appState = $this->objectManager->get('Magento\TestFramework\App\State'); - $appState->setMode(AppState::MODE_DEVELOPER); + $appState->setMode($this->origMode); + if ($this->staticDir->isExist('frontend/FrameworkViewMinifier')) { + $this->staticDir->delete('frontend/FrameworkViewMinifier'); + } parent::tearDown(); } @@ -56,8 +82,8 @@ class MinifierTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Framework\Code\Minifier\AdapterInterface $adapter */ $adapter = $this->objectManager->get('cssMinificationAdapter'); $this->assertEquals( - file_get_contents(dirname(__DIR__) . '/_files/static/css/styles.magento.min.css'), - $adapter->minify(file_get_contents(dirname(__DIR__) . '/_files/static/css/styles.css')), + file_get_contents(dirname(__DIR__) . '/_files/static/expected/styles.magento.min.css'), + $adapter->minify(file_get_contents(dirname(__DIR__) . '/_files/static/theme/web/css/styles.css')), 'Minified CSS differs from initial minified CSS snapshot. ' . 'Ensure that new CSS is fully valid for all supported browsers ' . 'and replace old minified snapshot with new one.' @@ -74,8 +100,8 @@ class MinifierTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Framework\Code\Minifier\AdapterInterface $adapter */ $adapter = $this->objectManager->get('jsMinificationAdapter'); $this->assertEquals( - file_get_contents(dirname(__DIR__) . '/_files/static/js/test.min.js'), - $adapter->minify(file_get_contents(dirname(__DIR__) . '/_files/static/js/test.js')), + file_get_contents(dirname(__DIR__) . '/_files/static/expected/test.min.js'), + $adapter->minify(file_get_contents(dirname(__DIR__) . '/_files/static/theme/web/js/test.js')), 'Minified JS differs from initial minified JS snapshot. ' . 'Ensure that new JS is fully valid for all supported browsers ' . 'and replace old minified snapshot with new one.' @@ -86,12 +112,10 @@ class MinifierTest extends \PHPUnit_Framework_TestCase * Test CSS minification * * @param string $requestedUri - * @param string $requestedFilePath - * @param string $testFile * @param callable $assertionCallback * @throws \Magento\Framework\Exception\LocalizedException */ - protected function _testCssMinification($requestedUri, $requestedFilePath, $testFile, $assertionCallback) + protected function _testCssMinification($requestedUri, $assertionCallback) { /** @var \Magento\Framework\App\Request\Http $request */ $request = $this->objectManager->get('Magento\Framework\App\Request\Http'); @@ -111,19 +135,7 @@ class MinifierTest extends \PHPUnit_Framework_TestCase 'Magento\Framework\App\StaticResource', ['response' => $response] ); - $initParams = Bootstrap::getInstance()->getAppInitParams(); - $designPath = $initParams[\Magento\Framework\App\Bootstrap::INIT_PARAM_FILESYSTEM_DIR_PATHS]['design']['path']; - $destFile = $designPath . $requestedFilePath; - - if (!is_readable(dirname($destFile))) { - mkdir(dirname($destFile), 777, true); - } - - copy($testFile, $destFile); - $staticResourceApp->launch(); - - unlink($destFile); } /** @@ -132,12 +144,13 @@ class MinifierTest extends \PHPUnit_Framework_TestCase public function testCssMinification() { $this->_testCssMinification( - '/frontend/Magento/blank/en_US/css/styles.min.css', - '/frontend/Magento/blank/web/css/styles.css', - dirname(__DIR__) . '/_files/static/css/styles.css', + '/frontend/FrameworkViewMinifier/default/en_US/css/styles.min.css', function ($path) { $this->assertEquals( - file_get_contents(dirname(__DIR__) . '/_files/static/css/styles.magento.min.css'), + file_get_contents( + dirname(__DIR__) + . '/_files/static/expected/styles.magento.min.css' + ), file_get_contents($path), 'Minified files are not equal or minification did not work for requested CSS' ); @@ -151,15 +164,16 @@ class MinifierTest extends \PHPUnit_Framework_TestCase public function testCssMinificationOff() { $this->_testCssMinification( - '/frontend/Magento/blank/en_US/css/styles.css', - '/frontend/Magento/blank/web/css/styles.css', - dirname(__DIR__) . '/_files/static/css/styles.css', + '/frontend/FrameworkViewMinifier/default/en_US/css/styles.css', function ($path) { $content = file_get_contents($path); $this->assertNotEmpty($content); - $this->assertContains('Magento/backend', $content); + $this->assertContains('FrameworkViewMinifier/frontend', $content); $this->assertNotEquals( - file_get_contents(dirname(__DIR__) . '/_files/static/css/styles.magento.min.css'), + file_get_contents( + dirname(__DIR__) + . '/_files/static/expected/styles.magento.min.css' + ), $content, 'CSS is minified when minification turned off' ); @@ -173,9 +187,7 @@ class MinifierTest extends \PHPUnit_Framework_TestCase public function testCssMinificationForMinifiedFiles() { $this->_testCssMinification( - '/frontend/Magento/blank/en_US/css/preminified-styles.min.css', - '/frontend/Magento/blank/web/css/preminified-styles.min.css', - dirname(__DIR__) . '/_files/static/css/preminified-styles.min.css', + '/frontend/FrameworkViewMinifier/default/en_US/css/preminified-styles.min.css', function ($path) { $content = file_get_contents($path); $this->assertNotEmpty($content); @@ -190,22 +202,10 @@ class MinifierTest extends \PHPUnit_Framework_TestCase */ public function testDeploymentWithMinifierEnabled() { - $initDirectories = Bootstrap::getInstance() - ->getAppInitParams()[\Magento\Framework\App\Bootstrap::INIT_PARAM_FILESYSTEM_DIR_PATHS]; - - $designPath = $initDirectories['design']['path']; + $staticPath = $this->staticDir->getAbsolutePath(); - $staticPath = $initDirectories['static']['path']; - - $fileToBePublished = $staticPath . '/frontend/Magento/blank/en_US/css/styles.min.css'; - $destFile = $designPath . '/frontend/Magento/blank/web/css/styles.css'; - $fileToTestPublishing = dirname(__DIR__) . '/_files/static/css/styles.css'; - - if (!is_readable(dirname($destFile))) { - mkdir(dirname($destFile), 777, true); - } - - copy($fileToTestPublishing, $destFile); + $fileToBePublished = $staticPath . '/frontend/FrameworkViewMinifier/default/en_US/css/styles.min.css'; + $fileToTestPublishing = dirname(__DIR__) . '/_files/static/theme/web/css/styles.css'; $omFactory = $this->getMock('\Magento\Framework\App\ObjectManagerFactory', ['create'], [], '', false); $omFactory->expects($this->any()) @@ -229,7 +229,7 @@ class MinifierTest extends \PHPUnit_Framework_TestCase ->method('getStaticPreProcessingFiles') ->will($this->returnValue( [ - ['frontend', 'Magento/blank', '', '', 'css/styles.css', $destFile] + ['frontend', 'FrameworkViewMinifier/default', '', '', 'css/styles.css', $fileToTestPublishing] ] )); @@ -243,12 +243,9 @@ class MinifierTest extends \PHPUnit_Framework_TestCase $this->assertFileExists($fileToBePublished); $this->assertEquals( - file_get_contents(dirname(__DIR__) . '/_files/static/css/styles.magento.min.css'), + file_get_contents(dirname(__DIR__) . '/_files/static/expected/styles.magento.min.css'), file_get_contents($fileToBePublished), 'Minified file is not equal or minification did not work for deployed CSS' ); - - unlink($destFile); - unlink($fileToBePublished); } } diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/Design/Fallback/RulePoolTest.php b/dev/tests/integration/testsuite/Magento/Framework/View/Design/Fallback/RulePoolTest.php new file mode 100644 index 0000000000000000000000000000000000000000..cb144a7c2d95654901a2e492eafe831e16e11396 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/View/Design/Fallback/RulePoolTest.php @@ -0,0 +1,273 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Framework\View\Design\Fallback; + +use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Filesystem; +use Magento\TestFramework\Helper\Bootstrap; + +/** + * Factory Test + * @magentoComponentsDir Magento/Framework/View/_files/fallback + * @magentoDbIsolation enabled + */ +class RulePoolTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var RulePool + */ + protected $model; + + /** + * @var array + */ + protected $defaultParams; + + protected function setUp() + { + $objectManager = Bootstrap::getObjectManager(); + /** @var \Magento\Theme\Model\Theme\Registration $registration */ + $registration = $objectManager->get( + 'Magento\Theme\Model\Theme\Registration' + ); + $registration->register(); + $this->model = $objectManager->create('Magento\Framework\View\Design\Fallback\RulePool'); + /** @var \Magento\Theme\Model\Resource\Theme\Collection $collection */ + $collection = $objectManager->create('Magento\Theme\Model\Resource\Theme\Collection'); + /** @var \Magento\Theme\Model\Theme $theme */ + $theme = $collection->getThemeByFullPath('frontend/Vendor_ViewTest/custom_theme'); + + $this->defaultParams = [ + 'area' => 'area', + 'theme' => $theme, + 'module_name' => 'ViewTest_Module', + 'locale' => 'en_US', + ]; + } + + protected function tearDown() + { + $this->model = null; + $this->defaultParams = []; + } + + /** + * @expectedException \InvalidArgumentException + * @expectedException Fallback rule 'unsupported_type' is not supported + */ + public function testGetRuleUnsupportedType() + { + $this->model->getRule('unsupported_type'); + } + + /** + * @param string $type + * @param array $overriddenParams + * @param string $expectedErrorMessage + * + * @dataProvider getPatternDirsExceptionDataProvider + */ + public function testGetPatternDirsException($type, array $overriddenParams, $expectedErrorMessage) + { + $this->setExpectedException('InvalidArgumentException', $expectedErrorMessage); + $params = $overriddenParams + $this->defaultParams; + $this->model->getRule($type)->getPatternDirs($params); + } + + /** + * @return array + */ + public function getPatternDirsExceptionDataProvider() + { + $exceptions = [ + 'no theme' => [ + ['theme' => null], + 'Parameter "theme" should be specified and should implement the theme interface', + ], + 'no area' => [ + ['area' => null], + "Required parameter 'area' was not passed", + ], + ]; + $exceptionsPerTypes = [ + \Magento\Framework\View\Design\Fallback\RulePool::TYPE_LOCALE_FILE => [ + 'no theme', + ], + \Magento\Framework\View\Design\Fallback\RulePool::TYPE_FILE => [ + 'no theme', 'no area', + ], + \Magento\Framework\View\Design\Fallback\RulePool::TYPE_TEMPLATE_FILE => [ + 'no theme', 'no area', + ], + \Magento\Framework\View\Design\Fallback\RulePool::TYPE_STATIC_FILE => [ + 'no theme', 'no area', + ], + ]; + + $data = []; + foreach ($exceptionsPerTypes as $type => $exceptionKeys) { + foreach ($exceptionKeys as $key) { + $data[$type . ', ' . $key] = [$type, $exceptions[$key][0], $exceptions[$key][1]]; + } + } + + return $data; + } + + /** + * @param string $type + * @param array $overriddenParams + * @param array $expectedResult + * + * @dataProvider getPatternDirsDataProvider + */ + public function testGetPatternDirs($type, array $overriddenParams, array $expectedResult) + { + $actualResult = $this->model->getRule($type) + ->getPatternDirs($overriddenParams + $this->defaultParams); + $this->assertEquals($expectedResult, $actualResult); + } + + /** + * @return array + * + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + */ + public function getPatternDirsDataProvider() + { + $objectManager = Bootstrap::getObjectManager(); + /** @var \Magento\Framework\Component\ComponentRegistrarInterface $componentRegistrar */ + $componentRegistrar = $objectManager->get( + '\Magento\Framework\Component\ComponentRegistrarInterface' + ); + $coreModulePath = $componentRegistrar->getPath(ComponentRegistrar::MODULE, 'Magento_Theme'); + /** @var \Magento\Framework\Filesystem $filesystem */ + $filesystem = $objectManager->get('\Magento\Framework\Filesystem'); + $libPath = rtrim($filesystem->getDirectoryRead(DirectoryList::LIB_WEB)->getAbsolutePath(), '/'); + + $themeOnePath = BP . '/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/' + . 'Vendor/custom_theme'; + $themeTwoPath = BP . '/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/' + . 'Vendor/default'; + $modulePath = BP . '/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/app/code/' + . 'ViewTest_Module'; + + return [ + 'locale' => [ + \Magento\Framework\View\Design\Fallback\RulePool::TYPE_LOCALE_FILE, + [], + [ + $themeOnePath, + $themeTwoPath, + ], + ], + 'file, modular' => [ + \Magento\Framework\View\Design\Fallback\RulePool::TYPE_FILE, + [], + [ + $themeOnePath . '/ViewTest_Module', + $themeTwoPath . '/ViewTest_Module', + $modulePath . '/view/area', + $modulePath . '/view/base', + ], + ], + 'file, non-modular' => [ + \Magento\Framework\View\Design\Fallback\RulePool::TYPE_FILE, + ['namespace' => null, 'module_name' => null], + [ + $themeOnePath, + $themeTwoPath, + ], + ], + + 'template, modular' => [ + \Magento\Framework\View\Design\Fallback\RulePool::TYPE_TEMPLATE_FILE, + [], + [ + $themeOnePath . '/ViewTest_Module/templates', + $themeTwoPath . '/ViewTest_Module/templates', + $modulePath . '/view/area/templates', + $modulePath . '/view/base/templates', + ], + ], + 'template, non-modular' => [ + \Magento\Framework\View\Design\Fallback\RulePool::TYPE_TEMPLATE_FILE, + ['namespace' => null, 'module_name' => null], + [ + $themeOnePath . '/templates', + $themeTwoPath . '/templates', + ], + ], + 'template, non-modular-magento-core' => [ + \Magento\Framework\View\Design\Fallback\RulePool::TYPE_TEMPLATE_FILE, + ['module_name' => 'Magento_Theme'], + [ + $themeOnePath . '/Magento_Theme/templates', + $themeTwoPath . '/Magento_Theme/templates', + $coreModulePath . '/view/area/templates', + $coreModulePath . '/view/base/templates', + ], + ], + + 'view, modular localized' => [ + \Magento\Framework\View\Design\Fallback\RulePool::TYPE_STATIC_FILE, + [], + [ + $themeOnePath . '/ViewTest_Module/web/i18n/en_US', + $themeOnePath . '/ViewTest_Module/web', + $themeTwoPath . '/ViewTest_Module/web/i18n/en_US', + $themeTwoPath . '/ViewTest_Module/web', + $modulePath . '/view/area/web/i18n/en_US', + $modulePath . '/view/base/web/i18n/en_US', + $modulePath . '/view/area/web', + $modulePath . '/view/base/web', + ], + ], + 'view, modular non-localized' => [ + \Magento\Framework\View\Design\Fallback\RulePool::TYPE_STATIC_FILE, + ['locale' => null], + [ + $themeOnePath . '/ViewTest_Module/web', + $themeTwoPath . '/ViewTest_Module/web', + $modulePath . '/view/area/web', + $modulePath . '/view/base/web', + ], + ], + 'view, non-modular localized' => [ + \Magento\Framework\View\Design\Fallback\RulePool::TYPE_STATIC_FILE, + ['module_name' => null], + [ + $themeOnePath . '/web/i18n/en_US', + $themeOnePath . '/web', + $themeTwoPath . '/web/i18n/en_US', + $themeTwoPath . '/web', + $libPath, + ], + ], + 'view, non-modular non-localized' => [ + \Magento\Framework\View\Design\Fallback\RulePool::TYPE_STATIC_FILE, + ['module_name' => null, 'locale' => null], + [ + $themeOnePath . '/web', + $themeTwoPath . '/web', + $libPath, + ], + ], + // Single test, as emails will always be loaded in a modular context with no locale specificity + 'email' => [ + \Magento\Framework\View\Design\Fallback\RulePool::TYPE_EMAIL_TEMPLATE, + [], + [ + $themeOnePath . '/ViewTest_Module/email', + $themeTwoPath . '/ViewTest_Module/email', + $modulePath . '/view/area/email', + ], + ], + ]; + } +} diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/Design/FileResolution/FallbackTest.php b/dev/tests/integration/testsuite/Magento/Framework/View/Design/FileResolution/FallbackTest.php index ca9e76fb3664bc35074b5aedfe0ad8084d378ef3..061da8cdb6131cff1165a88df698d20037107a8f 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/Design/FileResolution/FallbackTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/View/Design/FileResolution/FallbackTest.php @@ -11,10 +11,8 @@ use Magento\Framework\App\Filesystem\DirectoryList; use Magento\TestFramework\Helper\Bootstrap; /** - * Fallback Test - * - * @package Magento\View - * @magentoDataFixture Magento/Framework/View/_files/fallback/themes_registration.php + * @magentoComponentsDir Magento/Framework/View/_files/fallback + * @magentoDbIsolation enabled */ class FallbackTest extends \PHPUnit_Framework_TestCase { @@ -25,8 +23,14 @@ class FallbackTest extends \PHPUnit_Framework_TestCase protected function setUp() { + $objectManager = Bootstrap::getObjectManager(); + /** @var \Magento\Theme\Model\Theme\Registration $registration */ + $registration = $objectManager->get( + 'Magento\Theme\Model\Theme\Registration' + ); + $registration->register(); /** @var \Magento\Framework\View\Design\Theme\FlyweightFactory $themeFactory */ - $this->themeFactory = Bootstrap::getObjectManager() + $this->themeFactory = $objectManager ->get('Magento\Framework\View\Design\Theme\FlyweightFactory'); } @@ -42,9 +46,6 @@ class FallbackTest extends \PHPUnit_Framework_TestCase { Bootstrap::getInstance()->reinitialize([ AppBootstrap::INIT_PARAM_FILESYSTEM_DIR_PATHS => [ - DirectoryList::THEMES => [ - 'path' => __DIR__ . '/../../_files/fallback/design', - ], DirectoryList::LIB_WEB => [ 'path' => __DIR__ . '/../../_files/fallback/lib/web', ], @@ -68,6 +69,7 @@ class FallbackTest extends \PHPUnit_Framework_TestCase ->create('Magento\Framework\View\Design\FileResolution\Fallback\TemplateFile'); $themeModel = $this->themeFactory->create($themePath); + $actualFilename = $model->getFile('frontend', $themeModel, $file, $module); if ($expectedFilename) { $this->assertInternalType('string', $actualFilename); @@ -85,32 +87,32 @@ class FallbackTest extends \PHPUnit_Framework_TestCase { return [ 'non-modular: no default inheritance' => [ - 'fixture_template.phtml', 'Vendor/standalone_theme', null, + 'fixture_template.phtml', 'Vendor_ViewTest/standalone_theme', null, null, ], 'non-modular: inherit parent theme' => [ - 'fixture_template.phtml', 'Vendor/custom_theme', null, + 'fixture_template.phtml', 'Vendor_ViewTest/custom_theme', null, '%s/frontend/Vendor/default/templates/fixture_template.phtml', ], 'non-modular: inherit grandparent theme' => [ - 'fixture_template.phtml', 'Vendor/custom_theme2', null, + 'fixture_template.phtml', 'Vendor_ViewTest/custom_theme2', null, '%s/frontend/Vendor/default/templates/fixture_template.phtml', ], 'modular: no default inheritance' => [ - 'fixture_template.phtml', 'Vendor/standalone_theme', 'Fixture_Module', + 'fixture_template.phtml', 'Vendor_ViewTest/standalone_theme', 'ViewTest_Module', null, ], 'modular: no fallback to non-modular file' => [ - 'fixture_template.phtml', 'Vendor/default', 'NonExisting_Module', + 'nonexistent_fixture_script.phtml', 'Vendor_ViewTest/default', 'ViewTest_Module', null, ], 'modular: inherit parent theme' => [ - 'fixture_template.phtml', 'Vendor/custom_theme', 'Fixture_Module', - '%s/frontend/Vendor/default/Fixture_Module/templates/fixture_template.phtml', + 'fixture_template.phtml', 'Vendor_ViewTest/custom_theme', 'ViewTest_Module', + '%s/frontend/Vendor/default/ViewTest_Module/templates/fixture_template.phtml', ], 'modular: inherit grandparent theme' => [ - 'fixture_template.phtml', 'Vendor/custom_theme2', 'Fixture_Module', - '%s/frontend/Vendor/default/Fixture_Module/templates/fixture_template.phtml', + 'fixture_template.phtml', 'Vendor_ViewTest/custom_theme2', 'ViewTest_Module', + '%s/frontend/Vendor/default/ViewTest_Module/templates/fixture_template.phtml', ], ]; } @@ -144,15 +146,15 @@ class FallbackTest extends \PHPUnit_Framework_TestCase { return [ 'no default inheritance' => [ - 'Vendor/standalone_theme', 'en_US', + 'Vendor_ViewTest/standalone_theme', 'en_US', null, ], 'inherit parent theme' => [ - 'Vendor/custom_theme', 'en_US', + 'Vendor_ViewTest/custom_theme', 'en_US', '%s/frontend/Vendor/custom_theme/i18n/en_US.csv', ], 'inherit grandparent theme' => [ - 'Vendor/custom_theme2', 'en_US', + 'Vendor_ViewTest/custom_theme2', 'en_US', '%s/frontend/Vendor/custom_theme/i18n/en_US.csv', ], ]; @@ -191,64 +193,64 @@ class FallbackTest extends \PHPUnit_Framework_TestCase { return [ 'non-modular: no default inheritance' => [ - 'fixture_script.js', 'Vendor/standalone_theme', null, null, + 'fixture_script.js', 'Vendor_ViewTest/standalone_theme', null, null, null, ], 'non-modular: inherit same package & parent theme' => [ - 'fixture_script.js', 'Vendor/custom_theme', null, null, + 'fixture_script.js', 'Vendor_ViewTest/custom_theme', null, null, '%s/frontend/Vendor/default/web/fixture_script.js', ], 'non-modular: inherit same package & grandparent theme' => [ - 'fixture_script.js', 'Vendor/custom_theme2', null, null, + 'fixture_script.js', 'Vendor_ViewTest/custom_theme2', null, null, '%s/frontend/Vendor/default/web/fixture_script.js', ], 'non-modular: fallback to non-localized file' => [ - 'fixture_script.js', 'Vendor/default', 'en_US', null, + 'fixture_script.js', 'Vendor_ViewTest/default', 'en_US', null, '%s/frontend/Vendor/default/web/fixture_script.js', ], 'non-modular: localized file' => [ - 'fixture_script.js', 'Vendor/default', 'ru_RU', null, + 'fixture_script.js', 'Vendor_ViewTest/default', 'ru_RU', null, '%s/frontend/Vendor/default/web/i18n/ru_RU/fixture_script.js', ], 'non-modular: override js lib file' => [ - 'mage/script.js', 'Vendor/custom_theme', null, null, + 'mage/script.js', 'Vendor_ViewTest/custom_theme', null, null, '%s/frontend/Vendor/custom_theme/web/mage/script.js', ], 'non-modular: inherit js lib file' => [ - 'mage/script.js', 'Vendor/default', null, null, + 'mage/script.js', 'Vendor_ViewTest/default', null, null, '%s/lib/web/mage/script.js', ], 'modular: no default inheritance' => [ - 'fixture_script.js', 'Vendor/standalone_theme', null, 'Fixture_Module', + 'fixture_script.js', 'Vendor_ViewTest/standalone_theme', null, 'ViewTest_Module', null, ], 'modular: no fallback to non-modular file' => [ - 'fixture_script.js', 'Vendor/default', null, 'NonExisting_Module', + 'nonexistent_fixture_script.js', 'Vendor_ViewTest/default', null, 'ViewTest_Module', null, ], 'modular: no fallback to js lib file' => [ - 'mage/script.js', 'Vendor/default', null, 'Fixture_Module', + 'mage/script.js', 'Vendor_ViewTest/default', null, 'ViewTest_Module', null, ], 'modular: no fallback to non-modular localized file' => [ - 'fixture_script.js', 'Vendor/default', 'ru_RU', 'NonExisting_Module', + 'nonexistent_fixture_script.js', 'Vendor_ViewTest/default', 'ru_RU', 'ViewTest_Module', null, ], 'modular: inherit same package & parent theme' => [ - 'fixture_script.js', 'Vendor/custom_theme', null, 'Fixture_Module', - '%s/frontend/Vendor/default/Fixture_Module/web/fixture_script.js', + 'fixture_script.js', 'Vendor_ViewTest/custom_theme', null, 'ViewTest_Module', + '%s/frontend/Vendor/default/ViewTest_Module/web/fixture_script.js', ], 'modular: inherit same package & grandparent theme' => [ - 'fixture_script.js', 'Vendor/custom_theme2', null, 'Fixture_Module', - '%s/frontend/Vendor/default/Fixture_Module/web/fixture_script.js', + 'fixture_script.js', 'Vendor_ViewTest/custom_theme2', null, 'ViewTest_Module', + '%s/frontend/Vendor/default/ViewTest_Module/web/fixture_script.js', ], 'modular: fallback to non-localized file' => [ - 'fixture_script.js', 'Vendor/default', 'en_US', 'Fixture_Module', - '%s/frontend/Vendor/default/Fixture_Module/web/fixture_script.js', + 'fixture_script.js', 'Vendor_ViewTest/default', 'en_US', 'ViewTest_Module', + '%s/frontend/Vendor/default/ViewTest_Module/web/fixture_script.js', ], 'modular: localized file' => [ - 'fixture_script.js', 'Vendor/custom_theme2', 'ru_RU', 'Fixture_Module', - '%s/frontend/Vendor/default/Fixture_Module/web/i18n/ru_RU/fixture_script.js', + 'fixture_script.js', 'Vendor_ViewTest/custom_theme2', 'ru_RU', 'ViewTest_Module', + '%s/frontend/Vendor/default/ViewTest_Module/web/i18n/ru_RU/fixture_script.js', ], ]; } @@ -257,7 +259,7 @@ class FallbackTest extends \PHPUnit_Framework_TestCase * Test for the email template files fallback according to the themes inheritance * * @magentoDataFixture Magento/Store/_files/core_fixturestore.php - * @magentoDataFixture Magento/Email/Model/_files/design/themes.php + * @magentoComponentsDir Magento/Email/Model/_files/design * * @param string $file * @param string $themePath @@ -295,19 +297,19 @@ class FallbackTest extends \PHPUnit_Framework_TestCase return [ 'no fallback' => [ 'account_new.html', - 'Vendor/custom_theme', + 'Vendor_EmailTest/custom_theme', 'Magento_Customer', '%s/frontend/Vendor/custom_theme/Magento_Customer/email/account_new.html', ], 'inherit same package & parent theme' => [ 'account_new_confirmation.html', - 'Vendor/custom_theme', + 'Vendor_EmailTest/custom_theme', 'Magento_Customer', '%s/frontend/Vendor/default/Magento_Customer/email/account_new_confirmation.html', ], 'inherit parent package & grandparent theme' => [ 'account_new_confirmed.html', - 'Vendor/custom_theme', + 'Vendor_EmailTest/custom_theme', 'Magento_Customer', '%s/frontend/Magento/default/Magento_Customer/email/account_new_confirmed.html', ], diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/Element/AbstractBlockTest.php b/dev/tests/integration/testsuite/Magento/Framework/View/Element/AbstractBlockTest.php index 54eda95642f8dcf3419a4c5e60b5ce0b1c2a8022..ef1ea1fd983ee4a8e1d3b61af04b6c9fa0b42aa2 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/Element/AbstractBlockTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/View/Element/AbstractBlockTest.php @@ -278,9 +278,6 @@ class AbstractBlockTest extends \PHPUnit_Framework_TestCase $this->assertEquals('one', $parent->getChildHtml('block1')); $this->assertEquals('two', $parent->getChildHtml('block2')); - // Sorted will render in the designated order - $this->assertEquals('onetwo', $parent->getChildHtml('', true, true)); - // GetChildChildHtml $blockTwo->setChild('block11', $blockOne); $this->assertEquals('one', $parent->getChildChildHtml('block2')); diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/Element/TemplateTest.php b/dev/tests/integration/testsuite/Magento/Framework/View/Element/TemplateTest.php index 6171974e20c7451cf72671b10f2d320d96949ea8..5b5f312b0ecbef3f4ab51993eaf29dc707d96c5a 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/Element/TemplateTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/View/Element/TemplateTest.php @@ -22,7 +22,7 @@ class TemplateTest extends \PHPUnit_Framework_TestCase )->createBlock( 'Magento\Framework\View\Element\Template', '', - ['context' => $context, 'data' => ['module_name' => 'Magento_View']] + ['context' => $context] ); } diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/FileSystemTest.php b/dev/tests/integration/testsuite/Magento/Framework/View/FileSystemTest.php index bf43171989191edbd0280c6ae878f5fa6da3cd42..6c5a243a36275e3defc1cb465527b024aba6b4e0 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/FileSystemTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/View/FileSystemTest.php @@ -5,12 +5,12 @@ */ namespace Magento\Framework\View; -use Magento\Framework\App\Bootstrap; -use Magento\Framework\App\Filesystem\DirectoryList; +use \Magento\TestFramework\Helper\Bootstrap; /** * Tests for the view layer fallback mechanism - * @magentoDataFixture Magento/Theme/Model/_files/design/themes.php + * @magentoComponentsDir Magento/Theme/Model/_files/design + * @magentoDbIsolation enabled */ class FileSystemTest extends \PHPUnit_Framework_TestCase { @@ -21,24 +21,21 @@ class FileSystemTest extends \PHPUnit_Framework_TestCase protected function setUp() { - \Magento\TestFramework\Helper\Bootstrap::getInstance()->reinitialize( - [ - Bootstrap::INIT_PARAM_FILESYSTEM_DIR_PATHS => [ - DirectoryList::THEMES => [ - 'path' => dirname(dirname(__DIR__)) . '/Theme/Model/_files/design', - ], - ], - ] + $objectManager = Bootstrap::getObjectManager(); + /** @var \Magento\Theme\Model\Theme\Registration $registration */ + $registration = $objectManager->get( + 'Magento\Theme\Model\Theme\Registration' ); - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\State') + $registration->register(); + $objectManager->get('Magento\Framework\App\State') ->setAreaCode('frontend'); - $this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + $this->_model = $objectManager->create( 'Magento\Framework\View\FileSystem' ); - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( + $objectManager->get( 'Magento\Framework\View\DesignInterface' )->setDesignTheme( - 'Test/default' + 'Test_FrameworkThemeTest/default' ); } @@ -56,10 +53,13 @@ class FileSystemTest extends \PHPUnit_Framework_TestCase $this->_testExpectedVersusActualFilename($expected, $actual); } + /** + * @magentoComponentsDir Magento/Framework/View/_files/Fixture_Module + */ public function testGetViewFile() { $expected = '%s/frontend/Vendor/custom_theme/Fixture_Module/web/fixture_script.js'; - $params = ['theme' => 'Vendor/custom_theme']; + $params = ['theme' => 'Vendor_FrameworkThemeTest/custom_theme']; $actual = $this->_model->getStaticFileName('Fixture_Module::fixture_script.js', $params); $this->_testExpectedVersusActualFilename($expected, $actual); } diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/MergeTest.php b/dev/tests/integration/testsuite/Magento/Framework/View/Layout/MergeTest.php similarity index 94% rename from lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/MergeTest.php rename to dev/tests/integration/testsuite/Magento/Framework/View/Layout/MergeTest.php index 119fd12fdfc488f09e63d09098ecd16ced7d9dee..f92b10661e48ac13dd0cebf5b9f2f8b66f1e70a7 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/MergeTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/View/Layout/MergeTest.php @@ -3,7 +3,7 @@ * Copyright © 2015 Magento. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\Framework\View\Test\Unit\Model\Layout; +namespace Magento\Framework\View\Layout; use Magento\Framework\Phrase; @@ -64,7 +64,7 @@ class MergeTest extends \PHPUnit_Framework_TestCase protected function setUp() { $files = []; - foreach (glob(__DIR__ . '/_files/layout/*.xml') as $filename) { + foreach (glob(__DIR__ . '/_mergeFiles/layout/*.xml') as $filename) { $files[] = new \Magento\Framework\View\File($filename, 'Magento_Widget'); } $fileSource = $this->getMockForAbstractClass('Magento\Framework\View\File\CollectorInterface'); @@ -103,23 +103,23 @@ class MergeTest extends \PHPUnit_Framework_TestCase $objectHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); - $filesystem = $this->getMock('Magento\Framework\Filesystem', [], [], '', false, false); - $directory = $this->getMock('Magento\Framework\Filesystem\Directory\Read', [], [], '', false, false); - $directory->expects($this->any())->method('getRelativePath')->will($this->returnArgument(0)); + $this->pageConfig = $this->getMockBuilder('Magento\Framework\View\Page\Config') + ->disableOriginalConstructor() + ->getMock(); + + $readFactory = $this->getMock('Magento\Framework\Filesystem\File\ReadFactory', [], [], '', false, false); + $fileReader = $this->getMock('Magento\Framework\Filesystem\File\Read', [], [], '', false, false); + $readFactory->expects($this->any())->method('create')->willReturn($fileReader); $fileDriver = $objectHelper->getObject('Magento\Framework\Filesystem\Driver\File'); - $directory->expects($this->any())->method('readFile')->will( + + $fileReader->expects($this->any())->method('readAll')->will( $this->returnCallback( function ($filename) use ($fileDriver) { - return $fileDriver->fileGetContents($filename); + return $fileDriver->fileGetContents(__DIR__ . '/_mergeFiles/layout/'. $filename); } ) ); - $filesystem->expects($this->any())->method('getDirectoryRead')->will($this->returnValue($directory)); - - $this->pageConfig = $this->getMockBuilder('Magento\Framework\View\Page\Config') - ->disableOriginalConstructor() - ->getMock(); $this->_model = $objectHelper->getObject( 'Magento\Framework\View\Model\Layout\Merge', @@ -134,7 +134,7 @@ class MergeTest extends \PHPUnit_Framework_TestCase 'theme' => $this->_theme, 'validator' => $this->_layoutValidator, 'logger' => $this->_logger, - 'filesystem' => $filesystem, + 'readFactory' => $readFactory, 'pageConfig' => $this->pageConfig ] ); @@ -301,12 +301,12 @@ class MergeTest extends \PHPUnit_Framework_TestCase public function testGetFileLayoutUpdatesXml() { - $errorString = "Theme layout update file '" . __DIR__ . "/_files/layout/file_wrong.xml' is not valid."; + $errorString = "Theme layout update file '" . __DIR__ . "/_mergeFiles/layout/file_wrong.xml' is not valid."; $this->_logger->expects($this->atLeastOnce())->method('info') ->with($this->stringStartsWith($errorString)); $actualXml = $this->_model->getFileLayoutUpdatesXml(); - $this->assertXmlStringEqualsXmlFile(__DIR__ . '/_files/merged.xml', $actualXml->asNiceXml()); + $this->assertXmlStringEqualsXmlFile(__DIR__ . '/_mergeFiles/merged.xml', $actualXml->asNiceXml()); } public function testGetContainers() diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/Layout/Reader/_files/_layout_update_block.xml b/dev/tests/integration/testsuite/Magento/Framework/View/Layout/Reader/_files/_layout_update_block.xml index 01cf6bf5dd2b399be978afe15cbcf1888e7d1581..f99424ba93894144e07e4649865a4e459c1772d0 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/Layout/Reader/_files/_layout_update_block.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/View/Layout/Reader/_files/_layout_update_block.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <block class="Dummy\Class" name="test.block" group="test.group" template="test.phtml" ttl="3"> <arguments> diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/Layout/Reader/_files/_layout_update_reference.xml b/dev/tests/integration/testsuite/Magento/Framework/View/Layout/Reader/_files/_layout_update_reference.xml index f25d5cecda8a3d9a3a57f3876eda8dc28c77c686..2913aa72b75d381dedec238165c87ce4736c45ab 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/Layout/Reader/_files/_layout_update_reference.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/View/Layout/Reader/_files/_layout_update_reference.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <block class="Dummy\Class" name="test.block"/> <referenceBlock name="test.block"> diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/Layout/_files/_layout_update.xml b/dev/tests/integration/testsuite/Magento/Framework/View/Layout/_files/_layout_update.xml index 51150b0fe56c8fdacce21a44622562a644529bd8..c2ec95fed9681e58d7064b6e7b4389edc7ced435 100755 --- a/dev/tests/integration/testsuite/Magento/Framework/View/Layout/_files/_layout_update.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/View/Layout/_files/_layout_update.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <title>Magento Admin</title> <script src="prototype/prototype.js"/> diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/_files/layout/catalog_category_default.xml b/dev/tests/integration/testsuite/Magento/Framework/View/Layout/_mergeFiles/layout/catalog_category_default.xml similarity index 100% rename from lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/_files/layout/catalog_category_default.xml rename to dev/tests/integration/testsuite/Magento/Framework/View/Layout/_mergeFiles/layout/catalog_category_default.xml diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/_files/layout/catalog_category_layered.xml b/dev/tests/integration/testsuite/Magento/Framework/View/Layout/_mergeFiles/layout/catalog_category_layered.xml similarity index 100% rename from lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/_files/layout/catalog_category_layered.xml rename to dev/tests/integration/testsuite/Magento/Framework/View/Layout/_mergeFiles/layout/catalog_category_layered.xml diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/_files/layout/catalog_product_view.xml b/dev/tests/integration/testsuite/Magento/Framework/View/Layout/_mergeFiles/layout/catalog_product_view.xml similarity index 100% rename from lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/_files/layout/catalog_product_view.xml rename to dev/tests/integration/testsuite/Magento/Framework/View/Layout/_mergeFiles/layout/catalog_product_view.xml diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/_files/layout/catalog_product_view_type_configurable.xml b/dev/tests/integration/testsuite/Magento/Framework/View/Layout/_mergeFiles/layout/catalog_product_view_type_configurable.xml similarity index 100% rename from lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/_files/layout/catalog_product_view_type_configurable.xml rename to dev/tests/integration/testsuite/Magento/Framework/View/Layout/_mergeFiles/layout/catalog_product_view_type_configurable.xml diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/_files/layout/catalog_product_view_type_simple.xml b/dev/tests/integration/testsuite/Magento/Framework/View/Layout/_mergeFiles/layout/catalog_product_view_type_simple.xml similarity index 100% rename from lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/_files/layout/catalog_product_view_type_simple.xml rename to dev/tests/integration/testsuite/Magento/Framework/View/Layout/_mergeFiles/layout/catalog_product_view_type_simple.xml diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/_files/layout/checkout_index_index.xml b/dev/tests/integration/testsuite/Magento/Framework/View/Layout/_mergeFiles/layout/checkout_index_index.xml similarity index 100% rename from lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/_files/layout/checkout_index_index.xml rename to dev/tests/integration/testsuite/Magento/Framework/View/Layout/_mergeFiles/layout/checkout_index_index.xml diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/_files/layout/customer_account.xml b/dev/tests/integration/testsuite/Magento/Framework/View/Layout/_mergeFiles/layout/customer_account.xml similarity index 100% rename from lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/_files/layout/customer_account.xml rename to dev/tests/integration/testsuite/Magento/Framework/View/Layout/_mergeFiles/layout/customer_account.xml diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/_files/layout/default.xml b/dev/tests/integration/testsuite/Magento/Framework/View/Layout/_mergeFiles/layout/default.xml similarity index 100% rename from lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/_files/layout/default.xml rename to dev/tests/integration/testsuite/Magento/Framework/View/Layout/_mergeFiles/layout/default.xml diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/_files/layout/file_wrong.xml b/dev/tests/integration/testsuite/Magento/Framework/View/Layout/_mergeFiles/layout/file_wrong.xml similarity index 100% rename from lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/_files/layout/file_wrong.xml rename to dev/tests/integration/testsuite/Magento/Framework/View/Layout/_mergeFiles/layout/file_wrong.xml diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/_files/layout/fixture_handle_one.xml b/dev/tests/integration/testsuite/Magento/Framework/View/Layout/_mergeFiles/layout/fixture_handle_one.xml similarity index 100% rename from lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/_files/layout/fixture_handle_one.xml rename to dev/tests/integration/testsuite/Magento/Framework/View/Layout/_mergeFiles/layout/fixture_handle_one.xml diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/_files/layout/fixture_handle_page_layout.xml b/dev/tests/integration/testsuite/Magento/Framework/View/Layout/_mergeFiles/layout/fixture_handle_page_layout.xml similarity index 100% rename from lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/_files/layout/fixture_handle_page_layout.xml rename to dev/tests/integration/testsuite/Magento/Framework/View/Layout/_mergeFiles/layout/fixture_handle_page_layout.xml diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/_files/layout/fixture_handle_two.xml b/dev/tests/integration/testsuite/Magento/Framework/View/Layout/_mergeFiles/layout/fixture_handle_two.xml similarity index 100% rename from lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/_files/layout/fixture_handle_two.xml rename to dev/tests/integration/testsuite/Magento/Framework/View/Layout/_mergeFiles/layout/fixture_handle_two.xml diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/_files/layout/fixture_handle_with_page_layout.xml b/dev/tests/integration/testsuite/Magento/Framework/View/Layout/_mergeFiles/layout/fixture_handle_with_page_layout.xml similarity index 100% rename from lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/_files/layout/fixture_handle_with_page_layout.xml rename to dev/tests/integration/testsuite/Magento/Framework/View/Layout/_mergeFiles/layout/fixture_handle_with_page_layout.xml diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/_files/layout/not_a_page_type.xml b/dev/tests/integration/testsuite/Magento/Framework/View/Layout/_mergeFiles/layout/not_a_page_type.xml similarity index 100% rename from lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/_files/layout/not_a_page_type.xml rename to dev/tests/integration/testsuite/Magento/Framework/View/Layout/_mergeFiles/layout/not_a_page_type.xml diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/_files/layout/page_empty.xml b/dev/tests/integration/testsuite/Magento/Framework/View/Layout/_mergeFiles/layout/page_empty.xml similarity index 100% rename from lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/_files/layout/page_empty.xml rename to dev/tests/integration/testsuite/Magento/Framework/View/Layout/_mergeFiles/layout/page_empty.xml diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/_files/layout/print.xml b/dev/tests/integration/testsuite/Magento/Framework/View/Layout/_mergeFiles/layout/print.xml similarity index 100% rename from lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/_files/layout/print.xml rename to dev/tests/integration/testsuite/Magento/Framework/View/Layout/_mergeFiles/layout/print.xml diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/_files/layout/sales_guest_print.xml b/dev/tests/integration/testsuite/Magento/Framework/View/Layout/_mergeFiles/layout/sales_guest_print.xml similarity index 100% rename from lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/_files/layout/sales_guest_print.xml rename to dev/tests/integration/testsuite/Magento/Framework/View/Layout/_mergeFiles/layout/sales_guest_print.xml diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/_files/layout/sales_order_print.xml b/dev/tests/integration/testsuite/Magento/Framework/View/Layout/_mergeFiles/layout/sales_order_print.xml similarity index 100% rename from lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/_files/layout/sales_order_print.xml rename to dev/tests/integration/testsuite/Magento/Framework/View/Layout/_mergeFiles/layout/sales_order_print.xml diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/_files/merged.xml b/dev/tests/integration/testsuite/Magento/Framework/View/Layout/_mergeFiles/merged.xml similarity index 100% rename from lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/_files/merged.xml rename to dev/tests/integration/testsuite/Magento/Framework/View/Layout/_mergeFiles/merged.xml diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/Page/Config/Reader/_files/_layout_update.xml b/dev/tests/integration/testsuite/Magento/Framework/View/Page/Config/Reader/_files/_layout_update.xml index 797bffb7161d960e5a558b0cfaa7707f08757394..a87b020bc09a318b7bb2e67ad1c0e71108f37981 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/Page/Config/Reader/_files/_layout_update.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/View/Page/Config/Reader/_files/_layout_update.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <html> <attribute name="test-name" value="test-value"/> </html> diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/Utility/_files/layout/handle_one.xml b/dev/tests/integration/testsuite/Magento/Framework/View/Utility/_files/layout/handle_one.xml index ba18c2c32b9ffd95e1c2c74e38baff0fc8a3ebee..896135f959d9e8ed9bab006a926a0979e7a2a5c3 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/Utility/_files/layout/handle_one.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/View/Utility/_files/layout/handle_one.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <block class="Magento\Framework\View\Element\Text" name="some_text_block"> <action method="setText"> <text>Some Default Text</text> diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/Utility/_files/layout/handle_three.xml b/dev/tests/integration/testsuite/Magento/Framework/View/Utility/_files/layout/handle_three.xml index d64f1110f9cf6e35f4127c014a4f5cb1702a71b2..309f957ef3ea2d7d3190f375ab38cca2c5bc9062 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/Utility/_files/layout/handle_three.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/View/Utility/_files/layout/handle_three.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<page label="Handle Three" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page label="Handle Three" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="handle_one"/> </page> diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/Utility/_files/layout/handle_two.xml b/dev/tests/integration/testsuite/Magento/Framework/View/Utility/_files/layout/handle_two.xml index 8fd06a6cd0d5be0aa7ff18ca4de41a78902c6a82..9328a9593cb636cb6c16e03c0c95e94b7c09c0d7 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/Utility/_files/layout/handle_two.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/View/Utility/_files/layout/handle_two.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page label="Handle Two" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page label="Handle Two" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="handle_one"/> <referenceBlock name="some_text_block"> <action method="setText"> diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/Fixture_Module/registration.php b/dev/tests/integration/testsuite/Magento/Framework/View/_files/Fixture_Module/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..72beab35378859bd131f6eb03f2bbb10f49976f6 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/View/_files/Fixture_Module/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Fixture_Module', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/app/code/ViewTest_Module/registration.php b/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/app/code/ViewTest_Module/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..8522481ea3b6b95a3f1c252efee673aca58a6ef4 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/app/code/ViewTest_Module/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'ViewTest_Module', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/custom_theme/Fixture_Module/templates/fixture_template_two.phtml b/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/custom_theme/ViewTest_Module/templates/fixture_template_two.phtml similarity index 100% rename from dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/custom_theme/Fixture_Module/templates/fixture_template_two.phtml rename to dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/custom_theme/ViewTest_Module/templates/fixture_template_two.phtml diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/custom_theme/Fixture_Module/web/fixture_script_two.js b/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/custom_theme/ViewTest_Module/web/fixture_script_two.js similarity index 100% rename from dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/custom_theme/Fixture_Module/web/fixture_script_two.js rename to dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/custom_theme/ViewTest_Module/web/fixture_script_two.js diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/custom_theme/registration.php b/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/custom_theme/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..49ed5412d7d8bb40e1b28dd1605b58bff484167a --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/custom_theme/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::THEME, + 'frontend/Vendor_ViewTest/custom_theme', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/custom_theme/theme.xml b/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/custom_theme/theme.xml index 5b5a234395f58f498587aa66219379b4b063ad62..993629b73659174360f125e1ab8cd10b1672f41e 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/custom_theme/theme.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/custom_theme/theme.xml @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ --> -<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> +<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> <title>Custom Theme</title> - <parent>Vendor/default</parent> + <parent>Vendor_ViewTest/default</parent> </theme> diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/custom_theme2/registration.php b/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/custom_theme2/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..ab97f9711e8aac9beaabda8e7ca2764b01aaa647 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/custom_theme2/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::THEME, + 'frontend/Vendor_ViewTest/custom_theme2', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/custom_theme2/theme.xml b/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/custom_theme2/theme.xml index 1963666ae0d495d2c3f32126f75261e388222513..effafdb907b0556fba5574f3fcb45966e47fdacc 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/custom_theme2/theme.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/custom_theme2/theme.xml @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ --> -<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> +<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> <title>Custom Theme 2</title> - <parent>Vendor/custom_theme</parent> + <parent>Vendor_ViewTest/custom_theme</parent> </theme> diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/default/Fixture_Module/templates/fixture_template.phtml b/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/default/ViewTest_Module/templates/fixture_template.phtml similarity index 100% rename from dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/default/Fixture_Module/templates/fixture_template.phtml rename to dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/default/ViewTest_Module/templates/fixture_template.phtml diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/default/Fixture_Module/web/fixture_script.js b/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/default/ViewTest_Module/web/fixture_script.js similarity index 100% rename from dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/default/Fixture_Module/web/fixture_script.js rename to dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/default/ViewTest_Module/web/fixture_script.js diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/default/Fixture_Module/web/i18n/ru_RU/fixture_script.js b/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/default/ViewTest_Module/web/i18n/ru_RU/fixture_script.js similarity index 100% rename from dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/default/Fixture_Module/web/i18n/ru_RU/fixture_script.js rename to dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/default/ViewTest_Module/web/i18n/ru_RU/fixture_script.js diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/default/registration.php b/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/default/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..7e382a17578bf4bcbcc66d28ccbae374886db5f7 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/default/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::THEME, + 'frontend/Vendor_ViewTest/default', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/default/theme.xml b/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/default/theme.xml index 3e4dddafa133abadf9114081b3b20737379eba5b..e1a369b1dc411bb3df0713b8fc116935fbddeaa0 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/default/theme.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/default/theme.xml @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ --> -<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> +<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> <title>Default</title> </theme> diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/standalone_theme/registration.php b/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/standalone_theme/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..e561eaa2172c324e6df51ec351d02bc7301f72c1 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/standalone_theme/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::THEME, + 'frontend/Vendor_ViewTest/standalone_theme', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/standalone_theme/theme.xml b/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/standalone_theme/theme.xml index 00c7823f191eb403845daf04499a741362819bb8..c0fcec66df1fff91cf4fb0fb2469a2671e5a2387 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/standalone_theme/theme.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/design/frontend/Vendor/standalone_theme/theme.xml @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ --> -<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> +<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> <title>Standalone Theme</title> </theme> diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/themes_registration.php b/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/themes_registration.php deleted file mode 100644 index 9021a36b63a9132fe6f3cc3fa065c536b6c70ee3..0000000000000000000000000000000000000000 --- a/dev/tests/integration/testsuite/Magento/Framework/View/_files/fallback/themes_registration.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -use Magento\Framework\App\Bootstrap; -use Magento\Framework\App\Filesystem\DirectoryList; - -\Magento\TestFramework\Helper\Bootstrap::getInstance()->reinitialize([ - Bootstrap::INIT_PARAM_FILESYSTEM_DIR_PATHS => [ - DirectoryList::THEMES => ['path' => __DIR__ . '/design'], - ], -]); -$objectManger = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - -/** @var $registration \Magento\Theme\Model\Theme\Registration */ -$registration = $objectManger->create('Magento\Theme\Model\Theme\Registration'); -$registration->register('*/*/*/theme.xml'); diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout/cacheable.xml b/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout/cacheable.xml index e59de2633089013234a37cd2892782ff7e05f50a..5d7e6db65e60ba77a7d95a3126e58b24c259d3da 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout/cacheable.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout/cacheable.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_layout.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"> <container name="cachable_container1-1" label="test1" htmlTag="div" htmlId="cachable_container11" htmlClass="class11"> <block class="Magento\Framework\View\Element\Text" name="block-1-in-cacheable-container1"> <action method="setText"> diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout/container_attributes.xml b/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout/container_attributes.xml index bf496ea484684743b41ef55a0dc699a5b9822dee..4fd61f5b50931f6e357f3a07d767def9a2a6b116 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout/container_attributes.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout/container_attributes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_layout.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"> <container name="container1" label="test1" htmlTag="div" htmlId="container1-1" htmlClass="class11"> <block class="Magento\Framework\View\Element\Text" name="block11"> <action method="setText"> diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout/non_cacheable.xml b/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout/non_cacheable.xml index 5ecf96769cf41e827fa312488c3c73d3f6ca01ba..b5121436603f230fd95aa4af07a7199f32300d6b 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout/non_cacheable.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout/non_cacheable.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_layout.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"> <container name="non_cachable_container1-1" label="test1" htmlTag="div" htmlId="non_cachable_container11" htmlClass="class11"> <block class="Magento\Framework\View\Element\Text" name="block-1-in-non-cacheable-container1" cacheable="false"> <action method="setText"> diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/action_for_anonymous_parent_block.xml b/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/action_for_anonymous_parent_block.xml index 0beb4e1ce9395b3cc91b1abc72cca1c4238343d2..04a68844d0f3bdf80eaefbea77a405f98d2339c8 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/action_for_anonymous_parent_block.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/action_for_anonymous_parent_block.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_layout.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"> <block name="test.block.insert" class="Magento\Framework\View\Element\Text"/> <block class="Magento\Framework\View\Element\Template"> <action method="insert"> diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/arguments.xml b/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/arguments.xml index 198fee60f4791ae5fcda40b9a6dd06ec8024caf9..bebb18064e3de944377b86774a34c55587cf14b0 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/arguments.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/arguments.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_layout.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"> <block class="Magento\Framework\View\Element\Text" name="block_with_args"> <arguments> <argument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="one" xsi:type="string">1</argument> diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/arguments_complex_values.xml b/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/arguments_complex_values.xml index 75133cf498072f746e7975452a5f434de0f1332a..b309bf8abdfdb3275be963702a4ae4eef59adfca 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/arguments_complex_values.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/arguments_complex_values.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <block class="Magento\Framework\View\Element\Text" name="block_with_args_complex_values"> <arguments> <argument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="one" xsi:type="array"> diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/arguments_object_type.xml b/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/arguments_object_type.xml index c27321edacda146f6428e8c4ac3c1aca2dc668b5..72769c0c57c422618212db7ad3fe509431cb8c1e 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/arguments_object_type.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/arguments_object_type.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_layout.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"> <block class="Magento\Framework\View\Element\Text" name="block_with_object_args"> <arguments> <argument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="one" xsi:type="object">Magento\Framework\Data\Collection</argument> diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/arguments_object_type_updaters.xml b/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/arguments_object_type_updaters.xml index f713bfb8bbfada6a5ead86f955e09bd99196eafb..d5f9c935eae12c1cda5c9f667c01fa51fd93fed8 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/arguments_object_type_updaters.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/arguments_object_type_updaters.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_layout.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"> <block class="Magento\Framework\View\Element\Text" name="block_with_object_updater_args"> <arguments> <argument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="one" xsi:type="object">Magento\Store\Model\DataSource</argument> diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/arguments_url_type.xml b/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/arguments_url_type.xml index dc6e8059ce67a81a957d963c5f9a2f128147c675..26b0d52b0f0e8f7dcf972dd8bd8f5606d5033e0e 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/arguments_url_type.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/arguments_url_type.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_layout.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"> <block class="Magento\Framework\View\Element\Text" name="block_with_url_args"> <arguments> <argument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="one" xsi:type="url" path="customer/account/login"> diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/get_block.xml b/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/get_block.xml index 31d8e176bfb26a618e41711bf927824b1af0bf2e..fd7ac7b19114166c90519a8bedb82957751bc1a2 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/get_block.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/get_block.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <block name="block_first" class="Magento\Framework\View\Element\Text"> <action method="getChildBlock"> <argument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="value" xsi:type="string">block_second</argument> diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/group.xml b/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/group.xml index 03b61f20b68f785e4ac40935858dbe07159309a4..d983f3d2a471f7c697976767860870d063a4fc4e 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/group.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/group.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_layout.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"> <block class="Magento\Framework\View\Element\Text" name="block1"> <block class="Magento\Framework\View\Element\Text" name="block2" group="group1"> <arguments> diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/ifconfig.xml b/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/ifconfig.xml index 465103b6cdfd176c4142a02cd936aac0dcc41405..7c245b4db4b1db4a11162d7b0d3d2a290279dacf 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/ifconfig.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/ifconfig.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <block class="Magento\Framework\View\Element\Text" name="block1" ifconfig="not_exists"> <block class="Magento\Framework\View\Element\Text" name="block2"/> </block> diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/remove_broken.xml b/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/remove_broken.xml index 5cffdd38799cdbc8cc4a94272830686ab43fd72a..adb895ff6f0757d61c27b4005991000fd3c7dc69 100755 --- a/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/remove_broken.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/remove_broken.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_layout.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"> <block name="test.broken.block" type="Magento\Framework\View\Element\Text"/> <referenceBlock name="test.broken.block" remove="true"/> <block class="Magento\Framework\View\Element\Template" name="bug.without.name.action.is.ignored"> diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/render.xml b/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/render.xml index f0d91cd3875051cd16c1a799ad7aabf27475bd09..db988b3ee2bcd999a73f1c1f91a8c60eee8ce193 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/render.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/render.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <!-- Despite reference element is not declared yet, it will "save this action for later" --> <referenceBlock name="block_one"> <action method="addText"> diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/sort_after_after.xml b/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/sort_after_after.xml index 4d7b8efe6aef4c0a325462e8aa51436e39796f45..0cc9dab32b686ce69f17072bc4140621f2564d93 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/sort_after_after.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/sort_after_after.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_layout.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"> <container name="root" label="Root"> <block class="Magento\Framework\View\Element\Text" name="element1" after="element3"> <action method="setText"> diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/sort_after_previous.xml b/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/sort_after_previous.xml index 072a05b707009d7067f0be42fb8b8ca16aaff121..d25e9a34c889ee081afa60dcf20a23af8d77eec5 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/sort_after_previous.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/sort_after_previous.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_layout.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"> <container name="root" label="Root"> <block class="Magento\Framework\View\Element\Text" name="element1" after="element2"> <action method="setText"> diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/sort_before_after.xml b/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/sort_before_after.xml index 8a5f49770d3e3696590c74a5c41d53d4a1953402..8978f4c291638e6ea091bf9612fd891f906b2345 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/sort_before_after.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/sort_before_after.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_layout.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"> <container name="root" label="Root"> <block class="Magento\Framework\View\Element\Text" name="element1" before="element2"> <action method="setText"> diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/sort_before_before.xml b/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/sort_before_before.xml index 267030c16038ced99d69be6ee821d7669a053066..9986d4f9fce0272650f6d2a26bb0fe04f3b3dc7f 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/sort_before_before.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_directives_test/sort_before_before.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_layout.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"> <container name="root" label="Root"> <block class="Magento\Framework\View\Element\Text" name="element1" before="element3"> <action method="setText"> diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_with_exceptions/layout.xml b/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_with_exceptions/layout.xml index a52c0a6645cf38171cec6ded52f867f5ce5e5d37..25bb6c73547c2e88c245573a9e8bdc5dd315832b 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_with_exceptions/layout.xml +++ b/dev/tests/integration/testsuite/Magento/Framework/View/_files/layout_with_exceptions/layout.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="root"> <block class="Magento\Framework\View\Fixture\Block\BrokenConstructor" name="block.with.broken.constructor"/> diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/static/css/styles.magento.min.css b/dev/tests/integration/testsuite/Magento/Framework/View/_files/static/expected/styles.magento.min.css similarity index 100% rename from dev/tests/integration/testsuite/Magento/Framework/View/_files/static/css/styles.magento.min.css rename to dev/tests/integration/testsuite/Magento/Framework/View/_files/static/expected/styles.magento.min.css diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/static/js/test.min.js b/dev/tests/integration/testsuite/Magento/Framework/View/_files/static/expected/test.min.js similarity index 100% rename from dev/tests/integration/testsuite/Magento/Framework/View/_files/static/js/test.min.js rename to dev/tests/integration/testsuite/Magento/Framework/View/_files/static/expected/test.min.js diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/static/theme/registration.php b/dev/tests/integration/testsuite/Magento/Framework/View/_files/static/theme/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..259484077e40153e18598e1279bb7544f34b9dcd --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/View/_files/static/theme/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::THEME, + 'frontend/FrameworkViewMinifier/default', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/static/theme/theme.xml b/dev/tests/integration/testsuite/Magento/Framework/View/_files/static/theme/theme.xml new file mode 100644 index 0000000000000000000000000000000000000000..bbe7895c9e1c76053f56052a88a5b152e5264ffb --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/View/_files/static/theme/theme.xml @@ -0,0 +1,9 @@ +<!-- +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> + <title>Test theme</title> +</theme> diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/static/css/preminified-styles.min.css b/dev/tests/integration/testsuite/Magento/Framework/View/_files/static/theme/web/css/preminified-styles.min.css similarity index 100% rename from dev/tests/integration/testsuite/Magento/Framework/View/_files/static/css/preminified-styles.min.css rename to dev/tests/integration/testsuite/Magento/Framework/View/_files/static/theme/web/css/preminified-styles.min.css diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/static/css/styles.css b/dev/tests/integration/testsuite/Magento/Framework/View/_files/static/theme/web/css/styles.css similarity index 99% rename from dev/tests/integration/testsuite/Magento/Framework/View/_files/static/css/styles.css rename to dev/tests/integration/testsuite/Magento/Framework/View/_files/static/theme/web/css/styles.css index 10fde1eb126030da7739c91005e740319c440ad9..7243c218bbe295fca592fc0f4446dd8a7148ede8 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/_files/static/css/styles.css +++ b/dev/tests/integration/testsuite/Magento/Framework/View/_files/static/theme/web/css/styles.css @@ -2,7 +2,7 @@ * Copyright © 2015 Magento. All rights reserved. * See COPYING.txt for license details. */ -/* Magento/backend */ +/* FrameworkViewMinifier/frontend */ table > caption { margin-bottom: 5px; } diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/static/js/test.js b/dev/tests/integration/testsuite/Magento/Framework/View/_files/static/theme/web/js/test.js similarity index 100% rename from dev/tests/integration/testsuite/Magento/Framework/View/_files/static/js/test.js rename to dev/tests/integration/testsuite/Magento/Framework/View/_files/static/theme/web/js/test.js diff --git a/dev/tests/integration/testsuite/Magento/Indexer/Model/Config/_files/indexer.xml b/dev/tests/integration/testsuite/Magento/Indexer/Model/Config/_files/indexer.xml index 35b252ec984c9bd26f0152db0b5173a773f21c01..6ec37d616cfb4a38ae7bef97d8904bf033d0f8b7 100644 --- a/dev/tests/integration/testsuite/Magento/Indexer/Model/Config/_files/indexer.xml +++ b/dev/tests/integration/testsuite/Magento/Indexer/Model/Config/_files/indexer.xml @@ -1,34 +1,34 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/Indexer/etc/indexer.xsd"> - <indexer id="catalogsearch_fulltext" view_id="catalogsearch_fulltext" - class="Magento\CatalogSearch\Model\Indexer\Fulltext" - primary="first"> - - <title translate="true">Catalog Search</title> - <description translate="true">Rebuild Catalog product fulltext search index</description> - - <fieldset name="first" source="MagentoModule\ServiceClassOrRepositoryClass" - provider="Magento\Indexer\Model\Fieldset\ProductFieldset"> - <field name="title_alias" origin="title" xsi:type="searchable" dataType="text"> - <filter class="Magento\Framework\Search\Index\Filter\LowercaseFilter"/> - </field> - <field name="identifier" xsi:type="filterable" handler="Magento\Framework\Search\Index\Handler"/> - </fieldset> - - <fieldset name="second" source="MagentoModule\ServiceClassOrRepositoryClass"> - <reference fieldset="first" from="id_field" to="second_entity_id"/> - <field name="title" xsi:type="searchable"/> - </fieldset> - - <saveHandler class="Magento\Cms\Model\Indexer\StoreResource"/> - <structure class="Magento\Cms\Model\Indexer\IndexStructure"/> - - </indexer> -</config> +<?xml version="1.0"?> +<!-- +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:framework:Indexer/etc/indexer.xsd"> + <indexer id="catalogsearch_fulltext" view_id="catalogsearch_fulltext" + class="Magento\CatalogSearch\Model\Indexer\Fulltext" + primary="first"> + + <title translate="true">Catalog Search</title> + <description translate="true">Rebuild Catalog product fulltext search index</description> + + <fieldset name="first" source="MagentoModule\ServiceClassOrRepositoryClass" + provider="Magento\Indexer\Model\Fieldset\ProductFieldset"> + <field name="title_alias" origin="title" xsi:type="searchable" dataType="text"> + <filter class="Magento\Framework\Search\Index\Filter\LowercaseFilter"/> + </field> + <field name="identifier" xsi:type="filterable" handler="Magento\Framework\Search\Index\Handler"/> + </fieldset> + + <fieldset name="second" source="MagentoModule\ServiceClassOrRepositoryClass"> + <reference fieldset="first" from="id_field" to="second_entity_id"/> + <field name="title" xsi:type="searchable"/> + </fieldset> + + <saveHandler class="Magento\Cms\Model\Indexer\StoreResource"/> + <structure class="Magento\Cms\Model\Indexer\IndexStructure"/> + + </indexer> +</config> diff --git a/dev/tests/integration/testsuite/Magento/Payment/Model/_files/payment.xml b/dev/tests/integration/testsuite/Magento/Payment/Model/_files/payment.xml index 0b6abf4ceaf28a814a859d05112a3b7442e6cb50..ce0e8d333975123a33d3d054d685c9f5514c6308 100644 --- a/dev/tests/integration/testsuite/Magento/Payment/Model/_files/payment.xml +++ b/dev/tests/integration/testsuite/Magento/Payment/Model/_files/payment.xml @@ -6,7 +6,7 @@ */ --> <payment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../app/code/Magento/Payment/etc/payment.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Payment:etc/payment.xsd"> <credit_cards> <type id="SM" order="60"> <label>Switch/Maestro</label> diff --git a/dev/tests/integration/testsuite/Magento/Payment/Model/_files/payment2.xml b/dev/tests/integration/testsuite/Magento/Payment/Model/_files/payment2.xml index 9903ce76e2844cb0a3cbe8582b6b29eca5a069ac..d423982cc153a4b9d55e743ce073de1e2f6838ed 100644 --- a/dev/tests/integration/testsuite/Magento/Payment/Model/_files/payment2.xml +++ b/dev/tests/integration/testsuite/Magento/Payment/Model/_files/payment2.xml @@ -6,7 +6,7 @@ */ --> <payment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../app/code/Magento/Payment/etc/payment.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Payment:etc/payment.xsd"> <credit_cards> <type id="AE" order="0"> <label>American Express</label> diff --git a/dev/tests/integration/testsuite/Magento/Paypal/Model/Config/Structure/Reader/_files/actual/config.xml b/dev/tests/integration/testsuite/Magento/Paypal/Model/Config/Structure/Reader/_files/actual/config.xml index 60a7d934e47a5843b307338c8e40f2317fa8a000..60538b76f92349456e1d58ca0bc258784794fef0 100644 --- a/dev/tests/integration/testsuite/Magento/Paypal/Model/Config/Structure/Reader/_files/actual/config.xml +++ b/dev/tests/integration/testsuite/Magento/Paypal/Model/Config/Structure/Reader/_files/actual/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config/etc/system_file.xsd"> <system> <section id="payment"> <group id="paypal_notice" translate="label" sortOrder="0" showInDefault="1" showInWebsite="1" showInStore="1"> diff --git a/dev/tests/integration/testsuite/Magento/Paypal/Model/Config/Structure/Reader/_files/expected/config.xml b/dev/tests/integration/testsuite/Magento/Paypal/Model/Config/Structure/Reader/_files/expected/config.xml index 6411bb94c46d8885a7096b9e62db38bb9599754d..814a75cd06a4d9fa2be3f37f7aafd45f4db9eccd 100644 --- a/dev/tests/integration/testsuite/Magento/Paypal/Model/Config/Structure/Reader/_files/expected/config.xml +++ b/dev/tests/integration/testsuite/Magento/Paypal/Model/Config/Structure/Reader/_files/expected/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config/etc/system_file.xsd"> <system> <section id="payment"> <group id="paypal_notice" translate="label" sortOrder="0" showInDefault="1" showInWebsite="1" showInStore="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 a676cc8b3d2a31946fc3a00c8549b38479e8be36..a28633e05c0c5cbaadfec1a2272e1d5c03478ebb 100644 --- a/dev/tests/integration/testsuite/Magento/Persistent/Model/Persistent/ConfigTest.php +++ b/dev/tests/integration/testsuite/Magento/Persistent/Model/Persistent/ConfigTest.php @@ -23,12 +23,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase { $directoryList = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( 'Magento\Framework\App\Filesystem\DirectoryList', - [ - 'root' => DirectoryList::ROOT, - 'config' => [ - DirectoryList::MODULES => [DirectoryList::PATH => dirname(__DIR__)], - ] - ] + ['root' => DirectoryList::ROOT] ); $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( 'Magento\Framework\Filesystem', diff --git a/dev/tests/integration/testsuite/Magento/Persistent/Model/Persistent/_files/persistent.xml b/dev/tests/integration/testsuite/Magento/Persistent/Model/Persistent/_files/persistent.xml index b68f16b9631a488ee57acce0f2966aa4d510a7ba..c4889da2e4eeaaa1ddc5b71630685692f16ddcb1 100644 --- a/dev/tests/integration/testsuite/Magento/Persistent/Model/Persistent/_files/persistent.xml +++ b/dev/tests/integration/testsuite/Magento/Persistent/Model/Persistent/_files/persistent.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../Persistent/etc/persistent.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Persistent/etc/persistent.xsd"> <instances> <blocks> <reference id="reorder_sidebar"> diff --git a/dev/tests/integration/testsuite/Magento/Quote/etc/extension_attributes.xml b/dev/tests/integration/testsuite/Magento/Quote/etc/extension_attributes.xml index b71757a71adde3e42c6f2aa1ef22b3b439bb4807..9820731aa5056b1350a0cbdc5c64df07d3a1d27c 100644 --- a/dev/tests/integration/testsuite/Magento/Quote/etc/extension_attributes.xml +++ b/dev/tests/integration/testsuite/Magento/Quote/etc/extension_attributes.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/Api/etc/extension_attributes.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> <extension_attributes for="Magento\Quote\Api\Data\CartInterface"> <attribute code="quoteTestAttribute" type="Magento\User\Api\Data\UserInterface"> <join reference_table="admin_user" diff --git a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/DependenciesShowFrameworkCommandTest.php b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/DependenciesShowFrameworkCommandTest.php index 88d9d50f01eaf622988405668e0af77c8e5e1fa6..97abfdd0f856b6e91c0a724f2dbc70096f8e1a4d 100644 --- a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/DependenciesShowFrameworkCommandTest.php +++ b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/DependenciesShowFrameworkCommandTest.php @@ -21,9 +21,37 @@ class DependenciesShowFrameworkCommandTest extends \PHPUnit_Framework_TestCase public function setUp() { - $directoryList = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Framework\App\Filesystem\DirectoryList', ['root' => BP]); - $this->command = new DependenciesShowFrameworkCommand($directoryList); + $modules = [ + 'Magento_A' => __DIR__ . '/_files/root/app/code/Magento/A', + 'Magento_B' => __DIR__ . '/_files/root/app/code/Magento/B' + ]; + $objectManagerProvider = $this->getMock('Magento\Setup\Model\ObjectManagerProvider', [], [], '', false); + $objectManager = $this->getMock('\Magento\Framework\App\ObjectManager', [], [], '', false); + $objectManagerProvider->expects($this->once())->method('get')->willReturn($objectManager); + + $themePackageListMock = $this->getMock( + 'Magento\Framework\View\Design\Theme\ThemePackageList', + [], + [], + '', + false + ); + $componentRegistrarMock = $this->getMock('Magento\Framework\Component\ComponentRegistrar', [], [], '', false); + $componentRegistrarMock->expects($this->any())->method('getPaths')->will($this->returnValue($modules)); + $dirSearchMock = $this->getMock('Magento\Framework\Component\DirSearch', [], [], '', false); + $dirSearchMock->expects($this->once())->method('collectFiles')->willReturn( + [ + __DIR__ . '/_files/root/app/code/Magento/A/etc/module.xml', + __DIR__ . '/_files/root/app/code/Magento/B/etc/module.xml' + ] + ); + $objectManager->expects($this->any())->method('get')->will($this->returnValueMap([ + ['Magento\Framework\View\Design\Theme\ThemePackageList', $themePackageListMock], + ['Magento\Framework\Component\ComponentRegistrar', $componentRegistrarMock], + ['Magento\Framework\Component\DirSearch', $dirSearchMock] + ])); + + $this->command = new DependenciesShowFrameworkCommand($componentRegistrarMock, $objectManagerProvider); $this->commandTester = new CommandTester($this->command); } @@ -37,7 +65,7 @@ class DependenciesShowFrameworkCommandTest extends \PHPUnit_Framework_TestCase public function testExecute() { $this->commandTester->execute( - ['--directory' => __DIR__ . '/_files/root', '--output' => __DIR__ . '/_files/output/framework.csv'] + ['--output' => __DIR__ . '/_files/output/framework.csv'] ); $this->assertEquals('Report successfully processed.' . PHP_EOL, $this->commandTester->getDisplay()); $fileContents = file_get_contents(__DIR__ . '/_files/output/framework.csv'); @@ -46,17 +74,8 @@ class DependenciesShowFrameworkCommandTest extends \PHPUnit_Framework_TestCase $fileContents ); $this->assertContains('"Dependencies for each module:",' . PHP_EOL, $fileContents); - $this->assertContains('"Magento\A",1' . PHP_EOL . '" -- Magento\Framework",1' . PHP_EOL, $fileContents); - $this->assertContains('"Magento\B",1' . PHP_EOL . '" -- Magento\Framework",1' . PHP_EOL, $fileContents); + $this->assertContains('"Magento\A",1' . PHP_EOL . '" -- Magento\Framework",3' . PHP_EOL, $fileContents); + $this->assertContains('"Magento\B",1' . PHP_EOL . '" -- Magento\Framework",3' . PHP_EOL, $fileContents); } - - public function testExecuteInvalidDirectory() - { - $this->commandTester->execute(['--directory' => '/invalid/path']); - $this->assertContains( - 'Please check the path you provided. Dependencies report generator failed with error:', - $this->commandTester->getDisplay() - ); - } } diff --git a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/DependenciesShowModulesCircularCommandTest.php b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/DependenciesShowModulesCircularCommandTest.php index 06595efdf8fda0de98920d55749e3548e7f25c29..23a6a74c08272e507295a44e0e8b60d851d11b78 100644 --- a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/DependenciesShowModulesCircularCommandTest.php +++ b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/DependenciesShowModulesCircularCommandTest.php @@ -5,6 +5,7 @@ */ namespace Magento\Setup\Console\Command; +use Magento\Framework\Component\ComponentRegistrar; use Symfony\Component\Console\Tester\CommandTester; class DependenciesShowModulesCircularCommandTest extends \PHPUnit_Framework_TestCase @@ -21,7 +22,32 @@ class DependenciesShowModulesCircularCommandTest extends \PHPUnit_Framework_Test public function setUp() { - $this->command = new DependenciesShowModulesCircularCommand(); + $modules = [ + 'Magento_A' => __DIR__ . '/_files/root/app/code/Magento/A', + 'Magento_B' => __DIR__ . '/_files/root/app/code/Magento/B' + ]; + + $objectManagerProvider = $this->getMock('Magento\Setup\Model\ObjectManagerProvider', [], [], '', false); + $objectManager = $this->getMock('\Magento\Framework\App\ObjectManager', [], [], '', false); + $objectManagerProvider->expects($this->once())->method('get')->willReturn($objectManager); + + $themePackageListMock = $this->getMock( + 'Magento\Framework\View\Design\Theme\ThemePackageList', + [], + [], + '', + false + ); + $componentRegistrarMock = $this->getMock('Magento\Framework\Component\ComponentRegistrar', [], [], '', false); + $componentRegistrarMock->expects($this->any())->method('getPaths')->will($this->returnValue($modules)); + $dirSearchMock = $this->getMock('Magento\Framework\Component\DirSearch', [], [], '', false); + $objectManager->expects($this->any())->method('get')->will($this->returnValueMap([ + ['Magento\Framework\View\Design\Theme\ThemePackageList', $themePackageListMock], + ['Magento\Framework\Component\ComponentRegistrar', $componentRegistrarMock], + ['Magento\Framework\Component\DirSearch', $dirSearchMock] + ])); + + $this->command = new DependenciesShowModulesCircularCommand($objectManagerProvider); $this->commandTester = new CommandTester($this->command); } @@ -35,7 +61,7 @@ class DependenciesShowModulesCircularCommandTest extends \PHPUnit_Framework_Test public function testExecute() { $this->commandTester->execute( - ['--directory' => __DIR__ . '/_files/root', '--output' => __DIR__ . '/_files/output/circular.csv'] + ['--output' => __DIR__ . '/_files/output/circular.csv'] ); $this->assertEquals('Report successfully processed.' . PHP_EOL, $this->commandTester->getDisplay()); $fileContents = file_get_contents(__DIR__ . '/_files/output/circular.csv'); @@ -53,13 +79,4 @@ class DependenciesShowModulesCircularCommandTest extends \PHPUnit_Framework_Test $fileContents ); } - - public function testExecuteInvalidDirectory() - { - $this->commandTester->execute(['--directory' => '/invalid/path']); - $this->assertContains( - 'Please check the path you provided. Dependencies report generator failed with error:', - $this->commandTester->getDisplay() - ); - } } diff --git a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/DependenciesShowModulesCommandTest.php b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/DependenciesShowModulesCommandTest.php index 24926ddd50be9e686a17129ad3f0b59ecde00fbd..b9a297673f2c26e9674f7fc5ab7eed14e31c028a 100644 --- a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/DependenciesShowModulesCommandTest.php +++ b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/DependenciesShowModulesCommandTest.php @@ -5,6 +5,7 @@ */ namespace Magento\Setup\Console\Command; +use Magento\Framework\Component\ComponentRegistrar; use Symfony\Component\Console\Tester\CommandTester; class DependenciesShowModulesCommandTest extends \PHPUnit_Framework_TestCase @@ -21,7 +22,33 @@ class DependenciesShowModulesCommandTest extends \PHPUnit_Framework_TestCase public function setUp() { - $this->command = new DependenciesShowModulesCommand(); + + $modules = [ + 'Magento_A' => __DIR__ . '/_files/root/app/code/Magento/A', + 'Magento_B' => __DIR__ . '/_files/root/app/code/Magento/B' + ]; + + $objectManagerProvider = $this->getMock('Magento\Setup\Model\ObjectManagerProvider', [], [], '', false); + $objectManager = $this->getMock('\Magento\Framework\App\ObjectManager', [], [], '', false); + $objectManagerProvider->expects($this->once())->method('get')->willReturn($objectManager); + + $themePackageListMock = $this->getMock( + 'Magento\Framework\View\Design\Theme\ThemePackageList', + [], + [], + '', + false + ); + $componentRegistrarMock = $this->getMock('Magento\Framework\Component\ComponentRegistrar', [], [], '', false); + $componentRegistrarMock->expects($this->any())->method('getPaths')->will($this->returnValue($modules)); + $dirSearchMock = $this->getMock('Magento\Framework\Component\DirSearch', [], [], '', false); + $objectManager->expects($this->any())->method('get')->will($this->returnValueMap([ + ['Magento\Framework\View\Design\Theme\ThemePackageList', $themePackageListMock], + ['Magento\Framework\Component\ComponentRegistrar', $componentRegistrarMock], + ['Magento\Framework\Component\DirSearch', $dirSearchMock] + ])); + + $this->command = new DependenciesShowModulesCommand($objectManagerProvider); $this->commandTester = new CommandTester($this->command); } @@ -35,7 +62,7 @@ class DependenciesShowModulesCommandTest extends \PHPUnit_Framework_TestCase public function testExecute() { $this->commandTester->execute( - ['--directory' => __DIR__ . '/_files/root', '--output' => __DIR__ . '/_files/output/modules.csv'] + ['--output' => __DIR__ . '/_files/output/modules.csv'] ); $this->assertEquals('Report successfully processed.' . PHP_EOL, $this->commandTester->getDisplay()); $fileContents = file_get_contents(__DIR__ . '/_files/output/modules.csv'); @@ -53,13 +80,4 @@ class DependenciesShowModulesCommandTest extends \PHPUnit_Framework_TestCase $fileContents ); } - - public function testExecuteInvalidDirectory() - { - $this->commandTester->execute(['--directory' => '/invalid/path']); - $this->assertContains( - 'Please check the path you provided. Dependencies report generator failed with error:', - $this->commandTester->getDisplay() - ); - } } diff --git a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/I18nPackCommandTest.php b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/I18nPackCommandTest.php index 0185b06a5376b5b20884e28a241ca9d5a76854f4..6833e447bc13ee0665642d08d9f9d88ba715e532 100644 --- a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/I18nPackCommandTest.php +++ b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/I18nPackCommandTest.php @@ -7,6 +7,9 @@ namespace Magento\Setup\Console\Command; use Symfony\Component\Console\Tester\CommandTester; +/** + * @magentoComponentsDir Magento/Setup/Console/Command/_files/root/app/code + */ class I18nPackCommandTest extends \PHPUnit_Framework_TestCase { /** @@ -25,6 +28,14 @@ class I18nPackCommandTest extends \PHPUnit_Framework_TestCase $this->tester = new CommandTester($this->command); } + public function tearDown() + { + if (file_exists(__DIR__ . '/_files/output/pack')) { + $helper = new \Magento\Framework\Backup\Filesystem\Helper(); + $helper->rm(__DIR__ . '/_files/output/pack', [], true); + } + } + public function testExecute() { $this->tester->execute( @@ -37,16 +48,12 @@ class I18nPackCommandTest extends \PHPUnit_Framework_TestCase ); $this->assertEquals('Successfully saved de_DE language package.' . PHP_EOL, $this->tester->getDisplay()); - $basePath = BP . '/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/output/pack/app/code'; + $basePath = BP . '/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/output/pack/' + . 'dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code'; $this->assertFileExists($basePath . '/Magento/A/i18n/de_DE.csv'); $this->assertFileExists($basePath . '/Magento/B/i18n/de_DE.csv'); $this->assertFileExists($basePath . '/Magento/C/i18n/de_DE.csv'); $this->assertFileExists($basePath . '/Magento/D/i18n/de_DE.csv'); - unlink($basePath . '/Magento/A/i18n/de_DE.csv'); - unlink($basePath . '/Magento/B/i18n/de_DE.csv'); - unlink($basePath . '/Magento/C/i18n/de_DE.csv'); - unlink($basePath . '/Magento/D/i18n/de_DE.csv'); - $this->recursiveRmdir(BP . '/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/output/pack'); } @@ -83,23 +90,4 @@ class I18nPackCommandTest extends \PHPUnit_Framework_TestCase ] ); } - - /** - * Removes directories recursively - * - * @param string $dir - * @return void - */ - private function recursiveRmdir($dir) - { - if (is_dir($dir)) { - $subdirs = scandir($dir); - foreach ($subdirs as $subdir) { - if ($subdir !== '.' && $subdir !== '..' && filetype($dir . '/' . $subdir) === 'dir') { - $this->recursiveRmdir($dir . '/' . $subdir); - } - } - rmdir($dir); - } - } } diff --git a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/A/composer.json b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/A/composer.json index ca88c921fd2c95ba974da8973df0d4ffd151010e..5f3e97e9940552871903031cc90d7bec75ec7f7b 100644 --- a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/A/composer.json +++ b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/A/composer.json @@ -3,7 +3,6 @@ "require": { "php": "~5.5.0|~5.6.0|~7.0.0", "magento/framework": "0.1", - "magento/magento-composer-installer": "*", "magento/module-b": "0.1" }, "version": "0.1" diff --git a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/A/etc/module.xml b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/A/etc/module.xml index 00ea68c891a2ad9fa4192935322de5083e6d83d4..2f0e977084f8571fe330f04692b7f953ad18b045 100644 --- a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/A/etc/module.xml +++ b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/A/etc/module.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_A" setup_version="2.0.0" /> </config> diff --git a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/A/registration.php b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/A/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..d46179cca6325f8b9bc64f7b5bd6d30ef01c7f92 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/A/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_A', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/B/composer.json b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/B/composer.json index 91ae0a0977ab2d7c1da717b521169ac8f368c3f2..a18e8067ae6c67b5e562d84cdb2e66fbfff9203a 100644 --- a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/B/composer.json +++ b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/B/composer.json @@ -3,7 +3,6 @@ "require": { "php": "~5.5.0|~5.6.0|~7.0.0", "magento/framework": "0.74.0-beta6", - "magento/magento-composer-installer": "*", "magento/module-a": "0.1" }, "version": "0.1" diff --git a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/B/etc/module.xml b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/B/etc/module.xml index 8d5f746d8ec6474c6d226ef5e353bde341540da8..9cf34aad969d7241a95bfc7067370e37a30ddec6 100644 --- a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/B/etc/module.xml +++ b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/B/etc/module.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_B" setup_version="2.0.0" /> </config> diff --git a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/B/registration.php b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/B/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..25dc25281473652e93ff8437b2c901bbee61afaa --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/B/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_B', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/C/registration.php b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/C/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..a90284a15071d9eb830c8df5fafeeb311239dbc8 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/C/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_C', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/D/registration.php b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/D/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..c3801c34a7002054172498b25120ea01683072eb --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/D/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::MODULE, + 'Magento_D', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Setup/Controller/ComponentGridTest.php b/dev/tests/integration/testsuite/Magento/Setup/Controller/ComponentGridTest.php index ab1c84cacce318d4dbbf4a92ff29de648247d6d9..6ef1ef48c7f9abcd89461e505ab77f32807c6863 100644 --- a/dev/tests/integration/testsuite/Magento/Setup/Controller/ComponentGridTest.php +++ b/dev/tests/integration/testsuite/Magento/Setup/Controller/ComponentGridTest.php @@ -8,7 +8,10 @@ namespace Magento\Setup\Controller; use Magento\Framework\Composer\ComposerInformation; use Magento\Framework\Module\PackageInfo; +use Magento\Framework\Module\PackageInfoFactory; use Magento\Setup\Model\UpdatePackagesCache; +use Magento\Framework\Module\FullModuleList; +use Magento\Framework\Module\ModuleList; use Magento\Setup\Model\ConnectManager; class ComponentGridTest extends \PHPUnit_Framework_TestCase @@ -23,6 +26,21 @@ class ComponentGridTest extends \PHPUnit_Framework_TestCase */ private $updatePackagesCacheMock; + /** + * @var FullModuleList|\PHPUnit_Framework_MockObject_MockObject + */ + private $fullModuleListMock; + + /** + * @var ModuleList|\PHPUnit_Framework_MockObject_MockObject + */ + private $enabledModuleListMock; + + /** + * @var PackageInfoFactory|\PHPUnit_Framework_MockObject_MockObject + */ + private $packageInfoFactoryMock; + /** * Module package info * @@ -62,9 +80,10 @@ class ComponentGridTest extends \PHPUnit_Framework_TestCase 'type' => 'magento2-module', 'version' => '1.0.0' ] - ] + ], + 'countOfInstall' => 0, + 'countOfUpdate' => 1 ]; - $this->componentData = [ 'magento/sample-module1' => [ 'name' => 'magento/sample-module1', @@ -72,6 +91,7 @@ class ComponentGridTest extends \PHPUnit_Framework_TestCase 'version' => '1.0.0' ] ]; + $this->composerInformationMock = $this->getMock( 'Magento\Framework\Composer\ComposerInformation', [], @@ -79,47 +99,29 @@ class ComponentGridTest extends \PHPUnit_Framework_TestCase '', false ); - $objectManagerProvider = $this->getMock( - 'Magento\Setup\Model\ObjectManagerProvider', - [], - [], - '', - false - ); - $objectManager = $this->getMock( - 'Magento\Framework\ObjectManagerInterface', - [], - [], - '', - false - ); - $objectManagerProvider->expects($this->once()) - ->method('get') - ->willReturn($objectManager); - $packageInfoFactory = $this->getMock( + $objectManagerProvider = $this->getMock('Magento\Setup\Model\ObjectManagerProvider', [], [], '', false); + $objectManager = $this->getMock('Magento\Framework\ObjectManagerInterface', [], [], '', false); + $this->enabledModuleListMock = $this->getMock('Magento\Framework\Module\ModuleList', [], [], '', false); + $this->fullModuleListMock = $this->getMock('Magento\Framework\Module\FullModuleList', [], [], '', false); + $this->packageInfoFactoryMock = $this->getMock( 'Magento\Framework\Module\PackageInfoFactory', [], [], '', false ); - $objectManager->expects($this->once()) - ->method('get') - ->willReturn($packageInfoFactory); - $this->packageInfo = $this->getMock( - 'Magento\Framework\Module\PackageInfo', - [], - [], - '', - false - ); - $this->updatePackagesCacheMock = $this->getMock( - 'Magento\Setup\Model\UpdatePackagesCache', - [], - [], - '', - false - ); + $this->packageInfo = $this->getMock('Magento\Framework\Module\PackageInfo', [], [], '', false); + $this->updatePackagesCacheMock = $this->getMock('Magento\Setup\Model\UpdatePackagesCache', [], [], '', false); + + $objectManagerProvider->expects($this->any())->method('get')->willReturn($objectManager); + + $objectManager->expects($this->at(0))->method('get')->willReturn($this->enabledModuleListMock); + + $objectManager->expects($this->at(1))->method('get')->willReturn($this->fullModuleListMock); + + $objectManager->expects($this->at(2))->method('get')->willReturn($this->packageInfoFactoryMock); + + $this->packageInfoFactoryMock->expects($this->once())->method('create')->willReturn($this->packageInfo); $this->connectManagerMock = $this->getMock( 'Magento\Setup\Model\ConnectManager', @@ -129,9 +131,6 @@ class ComponentGridTest extends \PHPUnit_Framework_TestCase false ); - $packageInfoFactory->expects($this->once()) - ->method('create') - ->willReturn($this->packageInfo); $this->controller = new ComponentGrid( $this->composerInformationMock, $objectManagerProvider, @@ -149,9 +148,21 @@ class ComponentGridTest extends \PHPUnit_Framework_TestCase public function testComponentsAction() { + $this->fullModuleListMock->expects($this->once()) + ->method('getNames') + ->willReturn(['magento/sample-module1']); $this->packageInfo->expects($this->once()) ->method('getModuleName') ->willReturn('Sample_Module'); + $this->packageInfo->expects($this->once()) + ->method('getPackageName') + ->willReturn('magento/sample-module1'); + $this->packageInfo->expects($this->once()) + ->method('getVersion') + ->willReturn('1.0.0'); + $this->enabledModuleListMock->expects($this->once()) + ->method('has') + ->willReturn(true); $this->composerInformationMock->expects($this->once()) ->method('getInstalledMagentoPackages') ->willReturn($this->componentData); @@ -173,7 +184,9 @@ class ComponentGridTest extends \PHPUnit_Framework_TestCase 'update' => false, 'uninstall' => true, 'vendor' => 'magento', - 'moduleName' => 'Sample_Module' + 'moduleName' => 'Sample_Module', + 'enable' => true, + 'disable' => false ]]; $this->assertEquals($expected, $variables['components']); $this->assertArrayHasKey('total', $variables); diff --git a/dev/tests/integration/testsuite/Magento/Setup/Module/Dependency/_files/code/Magento/FirstModule/etc/module.xml b/dev/tests/integration/testsuite/Magento/Setup/Module/Dependency/_files/code/Magento/FirstModule/etc/module.xml index 9249aafd13da961ed7c1998aab8a392375bb266e..0148cd11cead66e89ca378e7495d511f48c5412d 100644 --- a/dev/tests/integration/testsuite/Magento/Setup/Module/Dependency/_files/code/Magento/FirstModule/etc/module.xml +++ b/dev/tests/integration/testsuite/Magento/Setup/Module/Dependency/_files/code/Magento/FirstModule/etc/module.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_FirstModule"/> </config> diff --git a/dev/tests/integration/testsuite/Magento/Setup/Module/Dependency/_files/module1.xml b/dev/tests/integration/testsuite/Magento/Setup/Module/Dependency/_files/module1.xml index 4277473661787b1dea429dd8afc01bd84377b0b9..6a87e5a153c8cf7dc4e84a83f0f3a9c982d49633 100644 --- a/dev/tests/integration/testsuite/Magento/Setup/Module/Dependency/_files/module1.xml +++ b/dev/tests/integration/testsuite/Magento/Setup/Module/Dependency/_files/module1.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Module1"> </module> </config> diff --git a/dev/tests/integration/testsuite/Magento/Setup/Module/Dependency/_files/module2.xml b/dev/tests/integration/testsuite/Magento/Setup/Module/Dependency/_files/module2.xml index 0ff76f75cee294d7c55a9f1b0501e703b7a38dc7..9f08cfb048fee8adc2758ed9bdae55260500b3c9 100644 --- a/dev/tests/integration/testsuite/Magento/Setup/Module/Dependency/_files/module2.xml +++ b/dev/tests/integration/testsuite/Magento/Setup/Module/Dependency/_files/module2.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magento_Module2"> </module> </config> diff --git a/dev/tests/integration/testsuite/Magento/Setup/Module/I18n/Dictionary/GeneratorTest.php b/dev/tests/integration/testsuite/Magento/Setup/Module/I18n/Dictionary/GeneratorTest.php index 7f879a81daeffc30fad8346e7ad980789d1bb5bb..5b467bf37a88a04bae0fae04e10f4ab9f0c4049c 100644 --- a/dev/tests/integration/testsuite/Magento/Setup/Module/I18n/Dictionary/GeneratorTest.php +++ b/dev/tests/integration/testsuite/Magento/Setup/Module/I18n/Dictionary/GeneratorTest.php @@ -5,6 +5,7 @@ */ namespace Magento\Setup\Module\I18n\Dictionary; +use Magento\Framework\Component\ComponentRegistrar; use Magento\Setup\Module\I18n\ServiceLocator; class GeneratorTest extends \PHPUnit_Framework_TestCase @@ -34,12 +35,43 @@ class GeneratorTest extends \PHPUnit_Framework_TestCase */ protected $generator; + /** + * @var array + */ + protected $backupRegistrar; + protected function setUp() { + $reflection = new \ReflectionClass('Magento\Framework\Component\ComponentRegistrar'); + $paths = $reflection->getProperty('paths'); + $paths->setAccessible(true); + $this->backupRegistrar = $paths->getValue(); + $paths->setAccessible(false); + $this->testDir = realpath(__DIR__ . '/_files'); $this->expectedDir = $this->testDir . '/expected'; $this->source = $this->testDir . '/source'; $this->outputFileName = $this->testDir . '/translate.csv'; + + // Register the test modules + ComponentRegistrar::register( + ComponentRegistrar::MODULE, + 'Magento_FirstModule', + $this->source . '/app/code/Magento/FirstModule' + ); + ComponentRegistrar::register( + ComponentRegistrar::MODULE, + 'Magento_SecondModule', + $this->source . '/app/code/Magento/SecondModule' + ); + + // Register the test theme + ComponentRegistrar::register( + ComponentRegistrar::THEME, + 'adminhtml/default/backend', + $this->source . '/app/design/adminhtml/default/backend' + ); + $this->generator = ServiceLocator::getDictionaryGenerator(); } @@ -53,6 +85,12 @@ class GeneratorTest extends \PHPUnit_Framework_TestCase $property->setAccessible(true); $property->setValue(null); $property->setAccessible(false); + + $reflection = new \ReflectionClass('Magento\Framework\Component\ComponentRegistrar'); + $paths = $reflection->getProperty('paths'); + $paths->setAccessible(true); + $paths->setValue($this->backupRegistrar); + $paths->setAccessible(false); } public function testGenerationWithoutContext() diff --git a/dev/tests/integration/testsuite/Magento/Setup/Module/I18n/Pack/GeneratorTest.php b/dev/tests/integration/testsuite/Magento/Setup/Module/I18n/Pack/GeneratorTest.php index ff28ebe4eda12bc1a7555365424326188eefff0e..b9905d27bf4cbfaa9d7e4a1dbadfb70f89e6bb49 100644 --- a/dev/tests/integration/testsuite/Magento/Setup/Module/I18n/Pack/GeneratorTest.php +++ b/dev/tests/integration/testsuite/Magento/Setup/Module/I18n/Pack/GeneratorTest.php @@ -5,6 +5,7 @@ */ namespace Magento\Setup\Module\I18n\Pack; +use Magento\Framework\Component\ComponentRegistrar; use Magento\Setup\Module\I18n\ServiceLocator; class GeneratorTest extends \PHPUnit_Framework_TestCase @@ -44,6 +45,11 @@ class GeneratorTest extends \PHPUnit_Framework_TestCase */ protected $_generator; + /** + * @var array + */ + protected $backupRegistrar; + protected function setUp() { $this->_testDir = realpath(__DIR__ . '/_files'); @@ -61,17 +67,43 @@ class GeneratorTest extends \PHPUnit_Framework_TestCase $this->_generator = ServiceLocator::getPackGenerator(); \Magento\Framework\System\Dirs::rm($this->_packPath); + + $reflection = new \ReflectionClass('Magento\Framework\Component\ComponentRegistrar'); + $paths = $reflection->getProperty('paths'); + $paths->setAccessible(true); + $this->backupRegistrar = $paths->getValue(); + $paths->setAccessible(false); } protected function tearDown() { \Magento\Framework\System\Dirs::rm($this->_packPath); + $reflection = new \ReflectionClass('Magento\Framework\Component\ComponentRegistrar'); + $paths = $reflection->getProperty('paths'); + $paths->setAccessible(true); + $paths->setValue($this->backupRegistrar); + $paths->setAccessible(false); } public function testGeneration() { $this->assertFileNotExists($this->_packPath); + ComponentRegistrar::register( + ComponentRegistrar::MODULE, + 'Magento_FirstModule', + BP . '/app/code/Magento/FirstModule' + ); + ComponentRegistrar::register( + ComponentRegistrar::MODULE, + 'Magento_SecondModule', + BP. '/app/code/Magento/SecondModule' + ); + ComponentRegistrar::register( + ComponentRegistrar::THEME, + 'adminhtml/default', + BP. '/app/design/adminhtml/default' + ); $this->_generator->generate($this->_dictionaryPath, $this->_packPath, $this->_locale); foreach ($this->_expectedFiles as $file) { diff --git a/dev/tests/integration/testsuite/Magento/Tax/Model/TaxCalculationTest.php b/dev/tests/integration/testsuite/Magento/Tax/Model/TaxCalculationTest.php index e96bca26a9865f65c51578bde0c872cbb1e5849d..485ae393790c5452ecbc032e62600c3cf0521dc8 100644 --- a/dev/tests/integration/testsuite/Magento/Tax/Model/TaxCalculationTest.php +++ b/dev/tests/integration/testsuite/Magento/Tax/Model/TaxCalculationTest.php @@ -173,6 +173,343 @@ class TaxCalculationTest extends \PHPUnit_Framework_TestCase ], ]; + $weeeProduct = $baseQuote; + $weeeProduct['items'][] = [ + 'code' => 'sequence-1', + 'type' => 'product', + 'quantity' => 1, + 'unit_price' => 10, + 'tax_class_key' => 'WeeeProductClass', + ]; + $weeeProduct['items'][] = [ + 'code' => 'weee1-Recycling Fee', + 'type' => 'weee', + 'quantity' => 1, + 'unit_price' => 7, + 'tax_class_key' => 'WeeeProductClass', + 'associated_item_code' => 'sequence-1' + ]; + $weeeProductResults = [ + 'subtotal' => 17, + 'tax_amount' => 1.4, + 'discount_tax_compensation_amount' => 0, + 'applied_taxes' => [ + [ + 'amount' => 1.4, + 'percent' => 8.25, + 'rates' => [ + [ + 'code' => 'US - 42 - 8.25', + 'title' => 'US - 42 - 8.25', + 'percent' => 8.25, + ], + ], + 'tax_rate_key' => 'US - 42 - 8.25', + ], + ], + 'items' => [ + 'sequence-1' => [ + 'code' => 'sequence-1', + 'row_tax' => 0.83, + 'price' => 10, + 'price_incl_tax' => 10.83, + 'row_total' => 10, + 'row_total_incl_tax' => 10.83, + 'type' => 'product', + 'tax_percent' => 8.25, + 'discount_tax_compensation_amount' => 0, + 'associated_item_code' => null, + 'applied_taxes' => [ + 'US - 42 - 8.25' => [ + 'amount' => 0.83, + 'percent' => 8.25, + 'tax_rate_key' => 'US - 42 - 8.25', + 'rates' => [ + 'US - 42 - 8.25' => [ + 'percent' => 8.25, + 'code' => 'US - 42 - 8.25', + 'title' => 'US - 42 - 8.25', + ], + ], + ], + ], + ], + 'weee1-Recycling Fee' => [ + 'code' => 'weee1-Recycling Fee', + 'row_tax' => 0.57, + 'price' => 7, + 'price_incl_tax' => 7.57, + 'row_total' => 7, + 'row_total_incl_tax' => 7.57, + 'type' => 'weee', + 'tax_percent' => 8.25, + 'discount_tax_compensation_amount' => 0, + 'associated_item_code' => 'sequence-1', + 'applied_taxes' => [ + 'US - 42 - 8.25' => [ + 'amount' => 0.57, + 'percent' => 8.25, + 'tax_rate_key' => 'US - 42 - 8.25', + 'rates' => [ + 'US - 42 - 8.25' => [ + 'percent' => 8.25, + 'code' => 'US - 42 - 8.25', + 'title' => 'US - 42 - 8.25', + ], + ], + ], + ], + ] + ], + ]; + + $weeeProducts = $baseQuote; + $weeeProducts['items'][] = [ + 'code' => 'sequence-1', + 'type' => 'product', + 'quantity' => 2, + 'unit_price' => 10, + 'tax_class_key' => 'WeeeProductClass', + ]; + $weeeProducts['items'][] = [ + 'code' => 'weee1-Recycling Fee', + 'type' => 'weee', + 'quantity' => 2, + 'unit_price' => 7, + 'tax_class_key' => 'WeeeProductClass', + 'associated_item_code' => 'sequence-1' + ]; + $weeeProductsResults = [ + 'subtotal' => 34, + 'tax_amount' => 2.80, + 'discount_tax_compensation_amount' => 0, + 'applied_taxes' => [ + [ + 'amount' => 2.80, + 'percent' => 8.25, + 'rates' => [ + [ + 'code' => 'US - 42 - 8.25', + 'title' => 'US - 42 - 8.25', + 'percent' => 8.25, + ], + ], + 'tax_rate_key' => 'US - 42 - 8.25', + ], + ], + 'items' => [ + 'sequence-1' => [ + 'code' => 'sequence-1', + 'row_tax' => 1.66, + 'price' => 10, + 'price_incl_tax' => 10.83, + 'row_total' => 20, + 'row_total_incl_tax' => 21.66, + 'type' => 'product', + 'tax_percent' => 8.25, + 'discount_tax_compensation_amount' => 0, + 'associated_item_code' => null, + 'applied_taxes' => [ + 'US - 42 - 8.25' => [ + 'amount' => 1.66, + 'percent' => 8.25, + 'tax_rate_key' => 'US - 42 - 8.25', + 'rates' => [ + 'US - 42 - 8.25' => [ + 'percent' => 8.25, + 'code' => 'US - 42 - 8.25', + 'title' => 'US - 42 - 8.25', + ], + ], + ], + ], + ], + 'weee1-Recycling Fee' => [ + 'code' => 'weee1-Recycling Fee', + 'row_tax' => 1.14, + 'price' => 7, + 'price_incl_tax' => 7.57, + 'row_total' => 14, + 'row_total_incl_tax' => 15.14, + 'type' => 'weee', + 'tax_percent' => 8.25, + 'discount_tax_compensation_amount' => 0, + 'associated_item_code' => 'sequence-1', + 'applied_taxes' => [ + 'US - 42 - 8.25' => [ + 'amount' => 1.14, + 'percent' => 8.25, + 'tax_rate_key' => 'US - 42 - 8.25', + 'rates' => [ + 'US - 42 - 8.25' => [ + 'percent' => 8.25, + 'code' => 'US - 42 - 8.25', + 'title' => 'US - 42 - 8.25', + ], + ], + ], + ], + ] + ], + ]; + + $multiWeeeProducts = $baseQuote; + $multiWeeeProducts['items'][] = [ + 'code' => 'sequence-1', + 'type' => 'product', + 'quantity' => 2, + 'unit_price' => 10, + 'tax_class_key' => 'WeeeProductClass', + ]; + $multiWeeeProducts['items'][] = [ + 'code' => 'weee1-Recycling Fee', + 'type' => 'weee', + 'quantity' => 2, + 'unit_price' => 7, + 'tax_class_key' => 'WeeeProductClass', + 'associated_item_code' => 'sequence-1' + ]; + $multiWeeeProducts['items'][] = [ + 'code' => 'sequence-2', + 'type' => 'product', + 'quantity' => 2, + 'unit_price' => 10, + 'tax_class_key' => 'WeeeProductClass', + ]; + $multiWeeeProducts['items'][] = [ + 'code' => 'weee2-Recycling Fee', + 'type' => 'weee', + 'quantity' => 2, + 'unit_price' => 7, + 'tax_class_key' => 'WeeeProductClass', + 'associated_item_code' => 'sequence-2' + ]; + $multiWeeeProductsResults = [ + 'subtotal' => 68, + 'tax_amount' => 5.60, + 'discount_tax_compensation_amount' => 0, + 'applied_taxes' => [ + [ + 'amount' => 5.60, + 'percent' => 8.25, + 'rates' => [ + [ + 'code' => 'US - 42 - 8.25', + 'title' => 'US - 42 - 8.25', + 'percent' => 8.25, + ], + ], + 'tax_rate_key' => 'US - 42 - 8.25', + ], + ], + 'items' => [ + 'sequence-1' => [ + 'code' => 'sequence-1', + 'row_tax' => 1.66, + 'price' => 10, + 'price_incl_tax' => 10.83, + 'row_total' => 20, + 'row_total_incl_tax' => 21.66, + 'type' => 'product', + 'tax_percent' => 8.25, + 'discount_tax_compensation_amount' => 0, + 'associated_item_code' => null, + 'applied_taxes' => [ + 'US - 42 - 8.25' => [ + 'amount' => 1.66, + 'percent' => 8.25, + 'tax_rate_key' => 'US - 42 - 8.25', + 'rates' => [ + 'US - 42 - 8.25' => [ + 'percent' => 8.25, + 'code' => 'US - 42 - 8.25', + 'title' => 'US - 42 - 8.25', + ], + ], + ], + ], + ], + 'weee1-Recycling Fee' => [ + 'code' => 'weee1-Recycling Fee', + 'row_tax' => 1.14, + 'price' => 7, + 'price_incl_tax' => 7.57, + 'row_total' => 14, + 'row_total_incl_tax' => 15.14, + 'type' => 'weee', + 'tax_percent' => 8.25, + 'discount_tax_compensation_amount' => 0, + 'associated_item_code' => 'sequence-1', + 'applied_taxes' => [ + 'US - 42 - 8.25' => [ + 'amount' => 1.14, + 'percent' => 8.25, + 'tax_rate_key' => 'US - 42 - 8.25', + 'rates' => [ + 'US - 42 - 8.25' => [ + 'percent' => 8.25, + 'code' => 'US - 42 - 8.25', + 'title' => 'US - 42 - 8.25', + ], + ], + ], + ], + ], + 'sequence-2' => [ + 'code' => 'sequence-2', + 'row_tax' => 1.66, + 'price' => 10, + 'price_incl_tax' => 10.83, + 'row_total' => 20, + 'row_total_incl_tax' => 21.66, + 'type' => 'product', + 'tax_percent' => 8.25, + 'discount_tax_compensation_amount' => 0, + 'associated_item_code' => null, + 'applied_taxes' => [ + 'US - 42 - 8.25' => [ + 'amount' => 1.66, + 'percent' => 8.25, + 'tax_rate_key' => 'US - 42 - 8.25', + 'rates' => [ + 'US - 42 - 8.25' => [ + 'percent' => 8.25, + 'code' => 'US - 42 - 8.25', + 'title' => 'US - 42 - 8.25', + ], + ], + ], + ], + ], + 'weee2-Recycling Fee' => [ + 'code' => 'weee2-Recycling Fee', + 'row_tax' => 1.14, + 'price' => 7, + 'price_incl_tax' => 7.57, + 'row_total' => 14, + 'row_total_incl_tax' => 15.14, + 'type' => 'weee', + 'tax_percent' => 8.25, + 'discount_tax_compensation_amount' => 0, + 'associated_item_code' => 'sequence-2', + 'applied_taxes' => [ + 'US - 42 - 8.25' => [ + 'amount' => 1.14, + 'percent' => 8.25, + 'tax_rate_key' => 'US - 42 - 8.25', + 'rates' => [ + 'US - 42 - 8.25' => [ + 'percent' => 8.25, + 'code' => 'US - 42 - 8.25', + 'title' => 'US - 42 - 8.25', + ], + ], + ], + ], + ] + ], + ]; + $oneProductInclTax = $baseQuote; $oneProductInclTax['items'][] = [ 'code' => 'sku_1', @@ -433,6 +770,18 @@ class TaxCalculationTest extends \PHPUnit_Framework_TestCase 'quote_details' => $oneProduct, 'expected_tax_details' => $oneProductResults, ], + 'weee product' => [ + 'quote_details' => $weeeProduct, + 'expected_tax_details' => $weeeProductResults, + ], + 'weee products' => [ + 'quote_details' => $weeeProducts, + 'expected_tax_details' => $weeeProductsResults, + ], + 'multi weee products' => [ + 'quote_details' => $multiWeeeProducts, + 'expected_tax_details' => $multiWeeeProductsResults, + ], 'one product, tax included' => [ 'quote_details' => $oneProductInclTax, 'expected_tax_details' => $oneProductInclTaxResults, @@ -935,7 +1284,6 @@ class TaxCalculationTest extends \PHPUnit_Framework_TestCase $taxDetails = $this->taxCalculationService->calculateTax($quoteDetails); $this->assertEquals($expectedTaxDetails, $this->convertObjectToArray($taxDetails)); - $this->assertEquals($expectedTaxDetails, $this->convertObjectToArray($taxDetails)); } /** @@ -944,6 +1292,7 @@ class TaxCalculationTest extends \PHPUnit_Framework_TestCase public function calculateTaxRowBasedDataProvider() { $baseQuote = $this->getBaseQuoteData(); + $oneProduct = $baseQuote; $oneProduct['items'][] = [ 'code' => 'sku_1', @@ -1000,6 +1349,343 @@ class TaxCalculationTest extends \PHPUnit_Framework_TestCase ], ]; + $weeeProduct = $baseQuote; + $weeeProduct['items'][] = [ + 'code' => 'sequence-1', + 'type' => 'product', + 'quantity' => 1, + 'unit_price' => 10, + 'tax_class_key' => 'WeeeProductClass', + ]; + $weeeProduct['items'][] = [ + 'code' => 'weee1-Recycling Fee', + 'type' => 'weee', + 'quantity' => 1, + 'unit_price' => 7, + 'tax_class_key' => 'WeeeProductClass', + 'associated_item_code' => 'sequence-1' + ]; + $weeeProductResults = [ + 'subtotal' => 17, + 'tax_amount' => 1.4, + 'discount_tax_compensation_amount' => 0, + 'applied_taxes' => [ + [ + 'amount' => 1.4, + 'percent' => 8.25, + 'rates' => [ + [ + 'code' => 'US - 42 - 8.25', + 'title' => 'US - 42 - 8.25', + 'percent' => 8.25, + ], + ], + 'tax_rate_key' => 'US - 42 - 8.25', + ], + ], + 'items' => [ + 'sequence-1' => [ + 'code' => 'sequence-1', + 'row_tax' => 0.83, + 'price' => 10, + 'price_incl_tax' => 10.83, + 'row_total' => 10, + 'row_total_incl_tax' => 10.83, + 'type' => 'product', + 'tax_percent' => 8.25, + 'discount_tax_compensation_amount' => 0, + 'associated_item_code' => null, + 'applied_taxes' => [ + 'US - 42 - 8.25' => [ + 'amount' => 0.83, + 'percent' => 8.25, + 'tax_rate_key' => 'US - 42 - 8.25', + 'rates' => [ + 'US - 42 - 8.25' => [ + 'percent' => 8.25, + 'code' => 'US - 42 - 8.25', + 'title' => 'US - 42 - 8.25', + ], + ], + ], + ], + ], + 'weee1-Recycling Fee' => [ + 'code' => 'weee1-Recycling Fee', + 'row_tax' => 0.57, + 'price' => 7, + 'price_incl_tax' => 7.57, + 'row_total' => 7, + 'row_total_incl_tax' => 7.57, + 'type' => 'weee', + 'tax_percent' => 8.25, + 'discount_tax_compensation_amount' => 0, + 'associated_item_code' => 'sequence-1', + 'applied_taxes' => [ + 'US - 42 - 8.25' => [ + 'amount' => 0.57, + 'percent' => 8.25, + 'tax_rate_key' => 'US - 42 - 8.25', + 'rates' => [ + 'US - 42 - 8.25' => [ + 'percent' => 8.25, + 'code' => 'US - 42 - 8.25', + 'title' => 'US - 42 - 8.25', + ], + ], + ], + ], + ] + ], + ]; + + $weeeProducts = $baseQuote; + $weeeProducts['items'][] = [ + 'code' => 'sequence-1', + 'type' => 'product', + 'quantity' => 2, + 'unit_price' => 10, + 'tax_class_key' => 'WeeeProductClass', + ]; + $weeeProducts['items'][] = [ + 'code' => 'weee1-Recycling Fee', + 'type' => 'weee', + 'quantity' => 2, + 'unit_price' => 7, + 'tax_class_key' => 'WeeeProductClass', + 'associated_item_code' => 'sequence-1' + ]; + $weeeProductsResults = [ + 'subtotal' => 34, + 'tax_amount' => 2.81, + 'discount_tax_compensation_amount' => 0, + 'applied_taxes' => [ + [ + 'amount' => 2.81, + 'percent' => 8.25, + 'rates' => [ + [ + 'code' => 'US - 42 - 8.25', + 'title' => 'US - 42 - 8.25', + 'percent' => 8.25, + ], + ], + 'tax_rate_key' => 'US - 42 - 8.25', + ], + ], + 'items' => [ + 'sequence-1' => [ + 'code' => 'sequence-1', + 'row_tax' => 1.65, + 'price' => 10, + 'price_incl_tax' => 10.83, + 'row_total' => 20, + 'row_total_incl_tax' => 21.65, + 'type' => 'product', + 'tax_percent' => 8.25, + 'discount_tax_compensation_amount' => 0, + 'associated_item_code' => null, + 'applied_taxes' => [ + 'US - 42 - 8.25' => [ + 'amount' => 1.65, + 'percent' => 8.25, + 'tax_rate_key' => 'US - 42 - 8.25', + 'rates' => [ + 'US - 42 - 8.25' => [ + 'percent' => 8.25, + 'code' => 'US - 42 - 8.25', + 'title' => 'US - 42 - 8.25', + ], + ], + ], + ], + ], + 'weee1-Recycling Fee' => [ + 'code' => 'weee1-Recycling Fee', + 'row_tax' => 1.16, + 'price' => 7, + 'price_incl_tax' => 7.58, + 'row_total' => 14, + 'row_total_incl_tax' => 15.16, + 'type' => 'weee', + 'tax_percent' => 8.25, + 'discount_tax_compensation_amount' => 0, + 'associated_item_code' => 'sequence-1', + 'applied_taxes' => [ + 'US - 42 - 8.25' => [ + 'amount' => 1.16, + 'percent' => 8.25, + 'tax_rate_key' => 'US - 42 - 8.25', + 'rates' => [ + 'US - 42 - 8.25' => [ + 'percent' => 8.25, + 'code' => 'US - 42 - 8.25', + 'title' => 'US - 42 - 8.25', + ], + ], + ], + ], + ] + ], + ]; + + $multiWeeeProducts = $baseQuote; + $multiWeeeProducts['items'][] = [ + 'code' => 'sequence-1', + 'type' => 'product', + 'quantity' => 2, + 'unit_price' => 10, + 'tax_class_key' => 'WeeeProductClass', + ]; + $multiWeeeProducts['items'][] = [ + 'code' => 'weee1-Recycling Fee', + 'type' => 'weee', + 'quantity' => 2, + 'unit_price' => 7, + 'tax_class_key' => 'WeeeProductClass', + 'associated_item_code' => 'sequence-1' + ]; + $multiWeeeProducts['items'][] = [ + 'code' => 'sequence-2', + 'type' => 'product', + 'quantity' => 2, + 'unit_price' => 10, + 'tax_class_key' => 'WeeeProductClass', + ]; + $multiWeeeProducts['items'][] = [ + 'code' => 'weee2-Recycling Fee', + 'type' => 'weee', + 'quantity' => 2, + 'unit_price' => 7, + 'tax_class_key' => 'WeeeProductClass', + 'associated_item_code' => 'sequence-2' + ]; + $multiWeeeProductsResults = [ + 'subtotal' => 68, + 'tax_amount' => 5.62, + 'discount_tax_compensation_amount' => 0, + 'applied_taxes' => [ + [ + 'amount' => 5.62, + 'percent' => 8.25, + 'rates' => [ + [ + 'code' => 'US - 42 - 8.25', + 'title' => 'US - 42 - 8.25', + 'percent' => 8.25, + ], + ], + 'tax_rate_key' => 'US - 42 - 8.25', + ], + ], + 'items' => [ + 'sequence-1' => [ + 'code' => 'sequence-1', + 'row_tax' => 1.65, + 'price' => 10, + 'price_incl_tax' => 10.83, + 'row_total' => 20, + 'row_total_incl_tax' => 21.65, + 'type' => 'product', + 'tax_percent' => 8.25, + 'discount_tax_compensation_amount' => 0, + 'associated_item_code' => null, + 'applied_taxes' => [ + 'US - 42 - 8.25' => [ + 'amount' => 1.65, + 'percent' => 8.25, + 'tax_rate_key' => 'US - 42 - 8.25', + 'rates' => [ + 'US - 42 - 8.25' => [ + 'percent' => 8.25, + 'code' => 'US - 42 - 8.25', + 'title' => 'US - 42 - 8.25', + ], + ], + ], + ], + ], + 'weee1-Recycling Fee' => [ + 'code' => 'weee1-Recycling Fee', + 'row_tax' => 1.16, + 'price' => 7, + 'price_incl_tax' => 7.58, + 'row_total' => 14, + 'row_total_incl_tax' => 15.16, + 'type' => 'weee', + 'tax_percent' => 8.25, + 'discount_tax_compensation_amount' => 0, + 'associated_item_code' => 'sequence-1', + 'applied_taxes' => [ + 'US - 42 - 8.25' => [ + 'amount' => 1.16, + 'percent' => 8.25, + 'tax_rate_key' => 'US - 42 - 8.25', + 'rates' => [ + 'US - 42 - 8.25' => [ + 'percent' => 8.25, + 'code' => 'US - 42 - 8.25', + 'title' => 'US - 42 - 8.25', + ], + ], + ], + ], + ], + 'sequence-2' => [ + 'code' => 'sequence-2', + 'row_tax' => 1.65, + 'price' => 10, + 'price_incl_tax' => 10.83, + 'row_total' => 20, + 'row_total_incl_tax' => 21.65, + 'type' => 'product', + 'tax_percent' => 8.25, + 'discount_tax_compensation_amount' => 0, + 'associated_item_code' => null, + 'applied_taxes' => [ + 'US - 42 - 8.25' => [ + 'amount' => 1.65, + 'percent' => 8.25, + 'tax_rate_key' => 'US - 42 - 8.25', + 'rates' => [ + 'US - 42 - 8.25' => [ + 'percent' => 8.25, + 'code' => 'US - 42 - 8.25', + 'title' => 'US - 42 - 8.25', + ], + ], + ], + ], + ], + 'weee2-Recycling Fee' => [ + 'code' => 'weee2-Recycling Fee', + 'row_tax' => 1.16, + 'price' => 7, + 'price_incl_tax' => 7.58, + 'row_total' => 14, + 'row_total_incl_tax' => 15.16, + 'type' => 'weee', + 'tax_percent' => 8.25, + 'discount_tax_compensation_amount' => 0, + 'associated_item_code' => 'sequence-2', + 'applied_taxes' => [ + 'US - 42 - 8.25' => [ + 'amount' => 1.16, + 'percent' => 8.25, + 'tax_rate_key' => 'US - 42 - 8.25', + 'rates' => [ + 'US - 42 - 8.25' => [ + 'percent' => 8.25, + 'code' => 'US - 42 - 8.25', + 'title' => 'US - 42 - 8.25', + ], + ], + ], + ], + ] + ], + ]; + $oneProductInclTax = $baseQuote; $oneProductInclTax['items'][] = [ 'code' => 'sku_1', @@ -1427,6 +2113,18 @@ class TaxCalculationTest extends \PHPUnit_Framework_TestCase 'quote_details' => $oneProduct, 'expected_tax_details' => $oneProductResults, ], + 'weee_product' => [ + 'quote_details' => $weeeProduct, + 'expected_tax_details' => $weeeProductResults, + ], + 'weee_products' => [ + 'quote_details' => $weeeProducts, + 'expected_tax_details' => $weeeProductsResults, + ], + 'multi weee_products' => [ + 'quote_details' => $multiWeeeProducts, + 'expected_tax_details' => $multiWeeeProductsResults, + ], 'one product, tax included' => [ 'quote_details' => $oneProductInclTax, 'expected_tax_details' => $oneProductInclTaxResults, @@ -1837,6 +2535,7 @@ class TaxCalculationTest extends \PHPUnit_Framework_TestCase ['name' => 'DefaultProductClass', 'type' => ClassModel::TAX_CLASS_TYPE_PRODUCT], ['name' => 'HigherProductClass', 'type' => ClassModel::TAX_CLASS_TYPE_PRODUCT], ['name' => 'MultipleRulesProductClass', 'type' => ClassModel::TAX_CLASS_TYPE_PRODUCT], + ['name' => 'WeeeProductClass', 'type' => ClassModel::TAX_CLASS_TYPE_PRODUCT], ]); $this->taxRates = $this->taxRuleFixtureFactory->createTaxRates([ @@ -1844,6 +2543,10 @@ class TaxCalculationTest extends \PHPUnit_Framework_TestCase ['percentage' => 7.5, 'country' => 'US', 'region' => 12], // Default store rate ]); + $weeeTaxRates = $this->taxRuleFixtureFactory->createTaxRates([ + ['percentage' => 8.25, 'country' => 'US', 'region' => 12] // Default store rate + ]); + $multiTaxRates1 = $this->taxRuleFixtureFactory->createTaxRates([ ['percentage' => 8.25, 'country' => 'US', 'region' => 42], ['percentage' => 12, 'country' => 'US', 'region' => 12], // Default store rate @@ -1860,7 +2563,7 @@ class TaxCalculationTest extends \PHPUnit_Framework_TestCase $higherRates = $this->taxRuleFixtureFactory->createTaxRates([ ['percentage' => 22, 'country' => 'US', 'region' => 42], ['percentage' => 10, 'country' => 'US', 'region' => 12], // Default store rate - ]); + ]); $this->taxRules = $this->taxRuleFixtureFactory->createTaxRules([ [ @@ -1871,6 +2574,14 @@ class TaxCalculationTest extends \PHPUnit_Framework_TestCase 'sort_order' => 0, 'priority' => 0, ], + [ + 'code' => 'Weee Rule', + 'customer_tax_class_ids' => [$this->taxClassIds['DefaultCustomerClass'], 3], + 'product_tax_class_ids' => [$this->taxClassIds['WeeeProductClass']], + 'tax_rate_ids' => array_values($weeeTaxRates), + 'sort_order' => 0, + 'priority' => 0, + ], [ 'code' => 'Higher Rate Rule', 'customer_tax_class_ids' => [$this->taxClassIds['DefaultCustomerClass'], 3], @@ -1882,7 +2593,10 @@ class TaxCalculationTest extends \PHPUnit_Framework_TestCase [ 'code' => 'MultiRule-1', 'customer_tax_class_ids' => [$this->taxClassIds['DefaultCustomerClass'], 3], - 'product_tax_class_ids' => [$this->taxClassIds['MultipleRulesProductClass']], + 'product_tax_class_ids' => [ + $this->taxClassIds['MultipleRulesProductClass'], + $this->taxClassIds['WeeeProductClass'] + ], 'tax_rate_ids' => array_values($multiTaxRates1), 'sort_order' => 0, 'priority' => 0, @@ -1906,6 +2620,7 @@ class TaxCalculationTest extends \PHPUnit_Framework_TestCase ]); // For cleanup + $this->taxRates = array_merge($this->taxRates, $weeeTaxRates); $this->taxRates = array_merge($this->taxRates, $higherRates); $this->taxRates = array_merge($this->taxRates, $multiTaxRates1); $this->taxRates = array_merge($this->taxRates, $multiTaxRatesSamePriority); diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/LayoutTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/LayoutTest.php index 2477af729b98a6e985207350067e7eff6b423f9b..df59293bc23e75ac6e99721e05cb0b0fb0ba5c32 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/LayoutTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/LayoutTest.php @@ -166,7 +166,6 @@ class LayoutTest extends \PHPUnit_Framework_TestCase $themeCollection = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( 'Magento\Theme\Model\Theme\Collection' ); - $themeCollection->addDefaultPattern('*'); /** @var $themeLayouts \Magento\Framework\View\File[] */ $themeLayouts = []; /** @var $theme \Magento\Framework\View\Design\ThemeInterface */ @@ -323,7 +322,6 @@ class LayoutTest extends \PHPUnit_Framework_TestCase $themeCollection = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( 'Magento\Theme\Model\Theme\Collection' ); - $themeCollection->addDefaultPattern('*'); /** @var $theme \Magento\Framework\View\Design\ThemeInterface */ foreach ($themeCollection as $theme) { foreach ($filesRetriever->getFiles($theme, '*.xml') as $file) { 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 1f8e5195dad169b3596f673f19e595495503f53d..7863c4201bd73d77dc7ab1ff4bbc1eb3cefb2c12 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/AclConfigFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/AclConfigFilesTest.php @@ -25,12 +25,8 @@ class AclConfigFilesTest extends \PHPUnit_Framework_TestCase protected function setUp() { - /** @var \Magento\Framework\Filesystem $filesystem */ - $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\Framework\Filesystem' - ); - $this->_schemeFile = $filesystem->getDirectoryRead(DirectoryList::LIB_INTERNAL) - ->getAbsolutePath('Magento/Framework/Acl/etc/acl.xsd'); + $urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + $this->_schemeFile = $urnResolver->getRealPath('urn:magento:framework:Acl/etc/acl.xsd'); } /** diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/CarrierConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/CarrierConfigFilesTest.php index 36737060f44decb075a3e647f64ef8821fecb8c1..9d0b23232bbe98e3008b5af1b180893982a7b0c6 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/CarrierConfigFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/CarrierConfigFilesTest.php @@ -7,6 +7,8 @@ */ namespace Magento\Test\Integrity\Modular; +use Magento\Framework\Module\Dir; + class CarrierConfigFilesTest extends \PHPUnit_Framework_TestCase { /** @@ -16,10 +18,8 @@ class CarrierConfigFilesTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $moduleReader = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Framework\Module\Dir\Reader' - ); - $schemaFile = $moduleReader->getModuleDir('etc', 'Magento_Config') . '/system.xsd'; + $urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + $schemaFile = $urnResolver->getRealPath('urn:magento:module:Magento_Config:etc/system.xsd'); $this->_reader = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( 'Magento\Config\Model\Config\Structure\Reader', ['perFileSchema' => $schemaFile, 'isValidated' => true] 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 dc9ae801d287d7f1458dc637cfecd979f196290c..79b69588428780b553ff4bc8513e573aacc7bc81 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/DiConfigFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/DiConfigFilesTest.php @@ -35,10 +35,11 @@ class DiConfigFilesTest extends \PHPUnit_Framework_TestCase $filesystem = $objectManager->get('Magento\Framework\Filesystem'); $configDirectory = $filesystem->getDirectoryRead(DirectoryList::CONFIG); $fileIteratorFactory = $objectManager->get('Magento\Framework\Config\FileIteratorFactory'); - self::$_primaryFiles = $fileIteratorFactory->create( - $configDirectory, - $configDirectory->search('{*/di.xml,di.xml}') - ); + $search = []; + foreach ($configDirectory->search('{*/di.xml,di.xml}') as $path) { + $search[] = $configDirectory->getAbsolutePath($path); + } + self::$_primaryFiles = $fileIteratorFactory->create($search); //init module global configs /** @var $modulesReader \Magento\Framework\Module\Dir\Reader */ $modulesReader = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() @@ -67,7 +68,12 @@ class DiConfigFilesTest extends \PHPUnit_Framework_TestCase $dom = new \DOMDocument(); $dom->loadXML($xml); - if (!@$dom->schemaValidate($schemaLocator->getSchema())) { + + libxml_use_internal_errors(true); + $result = \Magento\Framework\Config\Dom::validateDomDocument($dom, $schemaLocator->getSchema()); + libxml_use_internal_errors(false); + + if (!empty($result)) { $this->fail('File ' . $xml . ' has invalid xml structure.'); } } 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 53692472d96235d9d4cbef4e727e3764bcd094e0..03111c820d6eddb6c7d44a423eebc730675b98ab 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/EavAttributesConfigFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/EavAttributesConfigFilesTest.php @@ -5,7 +5,7 @@ */ namespace Magento\Test\Integrity\Modular; -use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Component\ComponentRegistrar; class EavAttributesConfigFilesTest extends \PHPUnit_Framework_TestCase { @@ -17,13 +17,11 @@ class EavAttributesConfigFilesTest extends \PHPUnit_Framework_TestCase public function setUp() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - /** @var $filesystem \Magento\Framework\Filesystem */ - $filesystem = $objectManager->get('Magento\Framework\Filesystem'); - $modulesDirectory = $filesystem->getDirectoryRead(DirectoryList::MODULES); + /** @var $moduleDirSearch \Magento\Framework\Component\DirSearch */ + $moduleDirSearch = $objectManager->get('Magento\Framework\Component\DirSearch'); $fileIteratorFactory = $objectManager->get('Magento\Framework\Config\FileIteratorFactory'); $xmlFiles = $fileIteratorFactory->create( - $modulesDirectory, - $modulesDirectory->search('/*/*/etc/{*/eav_attributes.xml,eav_attributes.xml}') + $moduleDirSearch->collectFiles(ComponentRegistrar::MODULE, 'etc/{*/eav_attributes.xml,eav_attributes.xml}') ); $validationStateMock = $this->getMock('Magento\Framework\Config\ValidationStateInterface'); 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 c5e64963b264dcd105045202ef5edb6c760c191f..6229b7d06c013bc7ea2964d76b658e6b69fb665a 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ExportConfigFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ExportConfigFilesTest.php @@ -5,7 +5,7 @@ */ namespace Magento\Test\Integrity\Modular; -use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Component\ComponentRegistrar; class ExportConfigFilesTest extends \PHPUnit_Framework_TestCase { @@ -17,13 +17,11 @@ class ExportConfigFilesTest extends \PHPUnit_Framework_TestCase public function setUp() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - /** @var $filesystem \Magento\Framework\Filesystem */ - $filesystem = $objectManager->get('Magento\Framework\Filesystem'); - $modulesDirectory = $filesystem->getDirectoryRead(DirectoryList::MODULES); + /** @var $moduleDirSearch \Magento\Framework\Component\DirSearch */ + $moduleDirSearch = $objectManager->get('Magento\Framework\Component\DirSearch'); $fileIteratorFactory = $objectManager->get('Magento\Framework\Config\FileIteratorFactory'); $xmlFiles = $fileIteratorFactory->create( - $modulesDirectory, - $modulesDirectory->search('/*/*/etc/{*/export.xml,export.xml}') + $moduleDirSearch->collectFiles(ComponentRegistrar::MODULE, 'etc/{*/export.xml,export.xml}') ); $validationStateMock = $this->getMock('Magento\Framework\Config\ValidationStateInterface'); diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/FieldsetConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/FieldsetConfigFilesTest.php index 64241595c147c4ad0cf8b52baec2c6ecb9f08f32..d1e719595da494ceb6b43cc4e54acb8f86b7d447 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/FieldsetConfigFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/FieldsetConfigFilesTest.php @@ -7,6 +7,8 @@ */ namespace Magento\Test\Integrity\Modular; +use Magento\Framework\Component\ComponentRegistrar; + class FieldsetConfigFilesTest extends \Magento\TestFramework\TestCase\AbstractConfigFiles { /** @@ -20,24 +22,23 @@ class FieldsetConfigFilesTest extends \Magento\TestFramework\TestCase\AbstractCo } /** - * Returns a string that represents the path to the config file, starting in the app directory. - * - * Format is glob, so * is allowed. + * Returns a string that represents the path to the config file * * @return string */ protected function _getConfigFilePathGlob() { - return '/*/*/etc/fieldset.xml'; + return 'etc/fieldset.xml'; } /** - * Returns a path to the per file XSD file, relative to the modules directory. + * Returns an absolute path to the XSD file corresponding to the XML files specified in _getConfigFilePathGlob * * @return string */ protected function _getXsdPath() { - return '/../../lib/internal/Magento/Framework/DataObject/etc/fieldset_file.xsd'; + return $this->componentRegistrar->getPath(ComponentRegistrar::LIBRARY, 'magento/framework') + . '/DataObject/etc/fieldset_file.xsd'; } } 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 1d9b31cdf4e4fe6bca0d583c8e5a3bec6f6fa821..dd31a3287fce1622f0bfd9574e603e75fe3f51dc 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ImportConfigFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ImportConfigFilesTest.php @@ -5,7 +5,7 @@ */ namespace Magento\Test\Integrity\Modular; -use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Component\ComponentRegistrar; class ImportConfigFilesTest extends \PHPUnit_Framework_TestCase { @@ -17,13 +17,11 @@ class ImportConfigFilesTest extends \PHPUnit_Framework_TestCase public function setUp() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - /** @var $filesystem \Magento\Framework\Filesystem */ - $filesystem = $objectManager->get('Magento\Framework\Filesystem'); - $modulesDirectory = $filesystem->getDirectoryRead(DirectoryList::MODULES); + /** @var $moduleDirSearch \Magento\Framework\Component\DirSearch */ + $moduleDirSearch = $objectManager->get('Magento\Framework\Component\DirSearch'); $fileIteratorFactory = $objectManager->get('Magento\Framework\Config\FileIteratorFactory'); $xmlFiles = $fileIteratorFactory->create( - $modulesDirectory, - $modulesDirectory->search('/*/*/etc/{*/import.xml,import.xml}') + $moduleDirSearch->collectFiles(ComponentRegistrar::MODULE, 'etc/{*/import.xml,import.xml}') ); $validationStateMock = $this->getMock('Magento\Framework\Config\ValidationStateInterface'); 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 ad2a353cf3f32a5b09af597474ca1c363788836d..5a330a83dbe836640ece9461625fc7b04f26792e 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/IndexerConfigFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/IndexerConfigFilesTest.php @@ -22,16 +22,12 @@ class IndexerConfigFilesTest extends \PHPUnit_Framework_TestCase * * @var string */ - protected $schemeFile; + protected $schemaFile; protected function setUp() { - /** @var Filesystem $filesystem */ - $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\Framework\Filesystem' - ); - $this->schemeFile = $filesystem->getDirectoryRead(DirectoryList::ROOT) - ->getAbsolutePath('lib/internal/Magento/Framework/Indexer/etc/indexer.xsd'); + $urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + $this->schemaFile = $urnResolver->getRealPath('urn:magento:framework:Indexer/etc/indexer.xsd'); } /** @@ -42,7 +38,7 @@ class IndexerConfigFilesTest extends \PHPUnit_Framework_TestCase public function testIndexerConfigFile($file) { $domConfig = new \Magento\Framework\Config\Dom(file_get_contents($file)); - $result = $domConfig->validate($this->schemeFile, $errors); + $result = $domConfig->validate($this->schemaFile, $errors); $message = "Invalid XML-file: {$file}\n"; foreach ($errors as $error) { $message .= "{$error}\n"; @@ -55,6 +51,13 @@ class IndexerConfigFilesTest extends \PHPUnit_Framework_TestCase */ public function indexerConfigFileDataProvider() { - return \Magento\Framework\App\Utility\Files::init()->getConfigFiles('indexer.xml'); + /** @var Filesystem $filesystem */ + $utilityFiles = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->get('\Magento\Framework\App\Utility\Files'); + + $utilityFiles->getConfigFiles('indexer.xml'); + + $dataProviderResult = $utilityFiles->getConfigFiles('indexer.xml'); + return $dataProviderResult; } } diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/Magento/Email/EmailTemplateConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/Magento/Email/EmailTemplateConfigFilesTest.php index 01d7e57e0e6d566cc26c6667df9a2bb267ed927b..8c667e6d38c4916f1f8fc9086f10cbd8283fe0b1 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/Magento/Email/EmailTemplateConfigFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/Magento/Email/EmailTemplateConfigFilesTest.php @@ -15,7 +15,8 @@ class EmailTemplateConfigFilesTest extends \PHPUnit_Framework_TestCase */ public function testFileFormat($file) { - $schemaFile = BP . '/app/code/Magento/Email/etc/email_templates.xsd'; + $urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + $schemaFile = $urnResolver->getRealPath('urn:magento:module:Magento_Email:etc/email_templates.xsd'); $dom = new \Magento\Framework\Config\Dom(file_get_contents($file)); $result = $dom->validate($schemaFile, $errors); $this->assertTrue($result, print_r($errors, true)); diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/MenuConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/MenuConfigFilesTest.php index 37d77f49dee623babd845a41e5af4b53fbc9a061..e6759874198f5d32ba42fd6250d23a0c8862fa50 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/MenuConfigFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/MenuConfigFilesTest.php @@ -5,6 +5,8 @@ */ namespace Magento\Test\Integrity\Modular; +use Magento\Framework\Module\Dir; + class MenuConfigFilesTest extends \PHPUnit_Framework_TestCase { /** @@ -14,10 +16,8 @@ class MenuConfigFilesTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $moduleReader = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Framework\Module\Dir\Reader' - ); - $schemaFile = $moduleReader->getModuleDir('etc', 'Magento_Backend') . '/menu.xsd'; + $urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + $schemaFile = $urnResolver->getRealPath('urn:magento:module:Magento_Backend:etc/menu.xsd'); $this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( 'Magento\Backend\Model\Menu\Config\Reader', ['perFileSchema' => $schemaFile, 'isValidated' => true] 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 604c6ba4b2bc4ac1da7bb60e05078397fa14d961..d112c6d50d389c334a3c5f2ce20d900374357b58 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/MviewConfigFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/MviewConfigFilesTest.php @@ -21,16 +21,12 @@ class MviewConfigFilesTest extends \PHPUnit_Framework_TestCase * * @var string */ - protected $schemeFile; + protected $schemaFile; protected function setUp() { - /** @var \Magento\Framework\Filesystem $filesystem */ - $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\Framework\Filesystem' - ); - $this->schemeFile = $filesystem->getDirectoryRead(DirectoryList::LIB_INTERNAL) - ->getAbsolutePath('Magento/Framework/Mview/etc/mview.xsd'); + $urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + $this->schemaFile = $urnResolver->getRealPath('urn:magento:framework:Mview/etc/mview.xsd'); } /** @@ -41,7 +37,7 @@ class MviewConfigFilesTest extends \PHPUnit_Framework_TestCase public function testIndexerConfigFile($file) { $domConfig = new \Magento\Framework\Config\Dom(file_get_contents($file)); - $result = $domConfig->validate($this->schemeFile, $errors); + $result = $domConfig->validate($this->schemaFile, $errors); $message = "Invalid XML-file: {$file}\n"; foreach ($errors as $error) { $message .= "{$error}\n"; diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/PaymentConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/PaymentConfigFilesTest.php index 6ae6c79ce61dd4994eca63f57e449999ec8491c8..3f62b3a3cfc49174d1dac62c95ad2fdc523f6352 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/PaymentConfigFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/PaymentConfigFilesTest.php @@ -7,6 +7,8 @@ */ namespace Magento\Test\Integrity\Modular; +use Magento\Framework\Component\ComponentRegistrar; + class PaymentConfigFilesTest extends \Magento\TestFramework\TestCase\AbstractConfigFiles { /** @@ -20,24 +22,23 @@ class PaymentConfigFilesTest extends \Magento\TestFramework\TestCase\AbstractCon } /** - * Returns a string that represents the path to the config file, starting in the app directory. - * - * Format is glob, so * is allowed. + * Returns a string that represents the path to the config file * * @return string */ protected function _getConfigFilePathGlob() { - return '/*/*/etc/payment.xml'; + return 'etc/payment.xml'; } /** - * Returns a path to the per file XSD file, relative to the modules directory. + * Returns an absolute path to the XSD file corresponding to the XML files specified in _getConfigFilePathGlob * * @return string */ protected function _getXsdPath() { - return '/Magento/Payment/etc/payment_file.xsd'; + return $this->componentRegistrar->getPath(ComponentRegistrar::MODULE, 'Magento_Payment') + . '/etc/payment_file.xsd'; } } 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 390eb4e43ff6abffcc2973fc3b469158d2b659f4..17b6e7dab791e858310dd42433fc325a13bfceb9 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ProductOptionsConfigFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ProductOptionsConfigFilesTest.php @@ -5,7 +5,7 @@ */ namespace Magento\Test\Integrity\Modular; -use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Component\ComponentRegistrar; class ProductOptionsConfigFilesTest extends \PHPUnit_Framework_TestCase { @@ -18,13 +18,14 @@ class ProductOptionsConfigFilesTest extends \PHPUnit_Framework_TestCase { //init primary configs $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - /** @var $filesystem \Magento\Framework\Filesystem */ - $filesystem = $objectManager->get('Magento\Framework\Filesystem'); - $modulesDirectory = $filesystem->getDirectoryRead(DirectoryList::MODULES); + /** @var $moduleDirSearch \Magento\Framework\Component\DirSearch */ + $moduleDirSearch = $objectManager->get('Magento\Framework\Component\DirSearch'); $fileIteratorFactory = $objectManager->get('Magento\Framework\Config\FileIteratorFactory'); $xmlFiles = $fileIteratorFactory->create( - $modulesDirectory, - $modulesDirectory->search('/*/*/etc/{*/product_options.xml,product_options.xml}') + $moduleDirSearch->collectFiles( + ComponentRegistrar::MODULE, + 'etc/{*/product_options.xml,product_options.xml}' + ) ); $fileResolverMock = $this->getMock('Magento\Framework\Config\FileResolverInterface'); 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 a9f2a21d0dc3d31f22a98679b0f8ffa35c8e2644..cf19b7a61da22136222deaffc88a2fc383c785fa 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ProductTypesConfigFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ProductTypesConfigFilesTest.php @@ -5,7 +5,7 @@ */ namespace Magento\Test\Integrity\Modular; -use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Component\ComponentRegistrar; class ProductTypesConfigFilesTest extends \PHPUnit_Framework_TestCase { @@ -17,13 +17,11 @@ class ProductTypesConfigFilesTest extends \PHPUnit_Framework_TestCase protected function setUp() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - /** @var $filesystem \Magento\Framework\Filesystem */ - $filesystem = $objectManager->get('Magento\Framework\Filesystem'); - $modulesDirectory = $filesystem->getDirectoryRead(DirectoryList::MODULES); + /** @var $moduleDirSearch \Magento\Framework\Component\DirSearch */ + $moduleDirSearch = $objectManager->get('Magento\Framework\Component\DirSearch'); $fileIteratorFactory = $objectManager->get('Magento\Framework\Config\FileIteratorFactory'); $xmlFiles = $fileIteratorFactory->create( - $modulesDirectory, - $modulesDirectory->search('/*/*/etc/{*/product_types.xml,product_types.xml}') + $moduleDirSearch->collectFiles(ComponentRegistrar::MODULE, 'etc/{*/product_types.xml,product_types.xml}') ); $fileResolverMock = $this->getMock('Magento\Framework\Config\FileResolverInterface'); 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 ffb51d950fcf7f91784d998dea69345baaebb50d..b687b6a9207d9637926c0753386eb52ef8b0feb5 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ResourcesConfigFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ResourcesConfigFilesTest.php @@ -5,7 +5,7 @@ */ namespace Magento\Test\Integrity\Modular; -use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Component\ComponentRegistrar; class ResourcesConfigFilesTest extends \PHPUnit_Framework_TestCase { @@ -17,13 +17,11 @@ class ResourcesConfigFilesTest extends \PHPUnit_Framework_TestCase protected function setUp() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - /** @var $filesystem \Magento\Framework\Filesystem */ - $filesystem = $objectManager->get('Magento\Framework\Filesystem'); - $modulesDirectory = $filesystem->getDirectoryRead(DirectoryList::MODULES); + /** @var $moduleDirSearch \Magento\Framework\Component\DirSearch */ + $moduleDirSearch = $objectManager->get('Magento\Framework\Component\DirSearch'); $fileIteratorFactory = $objectManager->get('Magento\Framework\Config\FileIteratorFactory'); $xmlFiles = $fileIteratorFactory->create( - $modulesDirectory, - $modulesDirectory->search('/*/*/etc/{*/resources.xml,resources.xml}') + $moduleDirSearch->collectFiles(ComponentRegistrar::MODULE, 'etc/{*/resources.xml,resources.xml}') ); $fileResolverMock = $this->getMock('Magento\Framework\Config\FileResolverInterface'); 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 87f8a618b2b994799e91523d5d54e43b9249dcda..16bc451c47c220be92bd57194a0bc542730bcbed 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/RouteConfigFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/RouteConfigFilesTest.php @@ -5,6 +5,8 @@ */ namespace Magento\Test\Integrity\Modular; +use Magento\Framework\Component\ComponentRegistrar; + class RouteConfigFilesTest extends \PHPUnit_Framework_TestCase { /** @@ -23,33 +25,38 @@ class RouteConfigFilesTest extends \PHPUnit_Framework_TestCase * * @var string */ - protected $_schemaFile; + protected $schemaFile; /** * Path to tough XSD for merged file validation * * @var string */ - protected $_mergedSchemaFile; + protected $mergedSchemaFile; protected function setUp() { - $this->_schemaFile = BP . '/lib/internal/Magento/Framework/App/etc/routes.xsd'; - $this->_mergedSchemaFile = BP . '/lib/internal/Magento/Framework/App/etc/routes_merged.xsd'; + $urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + $this->schemaFile = $urnResolver->getRealPath('urn:magento:framework:App/etc/routes.xsd'); + $this->mergedSchemaFile = $urnResolver->getRealPath('urn:magento:framework:App/etc/routes_merged.xsd'); } public function testRouteConfigsValidation() { $invalidFiles = []; - $mask = BP . '/app/code/*/*/etc/*/routes.xml'; - $files = glob($mask); + $componentRegistrar = new ComponentRegistrar(); + $files = []; + foreach ($componentRegistrar->getPaths(ComponentRegistrar::MODULE) as $moduleDir) { + $mask = $moduleDir . '/etc/*/routes.xml'; + $files = array_merge($files, glob($mask)); + } $mergedConfig = new \Magento\Framework\Config\Dom('<config></config>', $this->_idAttributes); foreach ($files as $file) { $content = file_get_contents($file); try { - new \Magento\Framework\Config\Dom($content, $this->_idAttributes, null, $this->_schemaFile); + new \Magento\Framework\Config\Dom($content, $this->_idAttributes, null, $this->schemaFile); //merge won't be performed if file is invalid because of exception thrown $mergedConfig->merge($content); @@ -64,7 +71,7 @@ class RouteConfigFilesTest extends \PHPUnit_Framework_TestCase try { $errors = []; - $mergedConfig->validate($this->_mergedSchemaFile, $errors); + $mergedConfig->validate($this->mergedSchemaFile, $errors); } catch (\Exception $e) { $this->fail('Merged routes config is invalid: ' . "\n" . implode("\n", $errors)); } 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 b942425f6fd48fe83537eeb5c277fe402aa2135f..c906e20801c3915ad66f0155b84a4db3089bf0db 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/SystemConfigFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/SystemConfigFilesTest.php @@ -6,6 +6,7 @@ namespace Magento\Test\Integrity\Modular; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Component\ComponentRegistrar; class SystemConfigFilesTest extends \PHPUnit_Framework_TestCase { @@ -20,10 +21,10 @@ class SystemConfigFilesTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Framework\Filesystem $filesystem */ $filesystem = $objectManager->get('Magento\Framework\Filesystem'); - $modulesDir = $filesystem->getDirectoryRead(DirectoryList::MODULES)->getAbsolutePath(); - - $fileList = glob($modulesDir . '/*/*/etc/adminhtml/system.xml'); - + $modulesDir = $filesystem->getDirectoryRead(DirectoryList::ROOT); + /** @var $moduleDirSearch \Magento\Framework\Component\DirSearch */ + $moduleDirSearch = $objectManager->get('Magento\Framework\Component\DirSearch'); + $fileList = $moduleDirSearch->collectFiles(ComponentRegistrar::MODULE, 'etc/adminhtml/system.xml'); $configMock = $this->getMock( 'Magento\Framework\Module\Dir\Reader', ['getConfigurationFiles', 'getModuleDir'], @@ -40,7 +41,7 @@ class SystemConfigFilesTest extends \PHPUnit_Framework_TestCase 'etc', 'Magento_Backend' )->will( - $this->returnValue($modulesDir . '/Magento/Backend/etc') + $this->returnValue($modulesDir->getAbsolutePath() . '/app/code/Magento/Backend/etc') ); try { $objectManager->create( diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ThemeConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ThemeConfigFilesTest.php index 2fdd0b7a2ca4324e4f951b3fc9af25c57351efc6..cd5e5bbef1c374582f01f18ef48b174c9446b151 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ThemeConfigFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ThemeConfigFilesTest.php @@ -7,20 +7,10 @@ */ namespace Magento\Test\Integrity\Modular; -use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Component\ComponentRegistrar; class ThemeConfigFilesTest extends \Magento\TestFramework\TestCase\AbstractConfigFiles { - /** - * Returns directory (modules, library internal stc.) constant which contains XSD file - * - * @return string - */ - protected function getDirectoryConstant() - { - return DirectoryList::LIB_INTERNAL; - } - /** * Returns the reader class name that will be instantiated via ObjectManager * @@ -32,24 +22,23 @@ class ThemeConfigFilesTest extends \Magento\TestFramework\TestCase\AbstractConfi } /** - * Returns a string that represents the path to the config file, starting in the app directory. - * - * Format is glob, so * is allowed. + * Returns a string that represents the path to the config file * * @return string */ protected function _getConfigFilePathGlob() { - return '/*/*/view/*/layouts.xml'; + return 'view/*/layouts.xml'; } /** - * Returns a path to the per file XSD file, relative to the library directory. + * Returns an absolute path to the XSD file corresponding to the XML files specified in _getConfigFilePathGlob * * @return string */ protected function _getXsdPath() { - return '/Magento/Framework/View/PageLayout/etc/layouts.xsd'; + return $this->componentRegistrar->getPath(ComponentRegistrar::LIBRARY, 'magento/framework') + . '/View/PageLayout/etc/layouts.xsd'; } } 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 b7b14a05ed6639f4ba8f8a627a7b0ea715359330..d65b3fa9d7c8deda509f1a62808decc0f6197d24 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ViewConfigFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ViewConfigFilesTest.php @@ -5,8 +5,6 @@ */ namespace Magento\Test\Integrity\Modular; -use Magento\Framework\App\Filesystem\DirectoryList; - class ViewConfigFilesTest extends \PHPUnit_Framework_TestCase { /** @@ -15,6 +13,7 @@ class ViewConfigFilesTest extends \PHPUnit_Framework_TestCase */ public function testViewConfigFile($file) { + /** @var \Magento\Framework\View\Xsd\Reader $reader */ $reader = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( 'Magento\Framework\View\Xsd\Reader' ); @@ -24,11 +23,7 @@ class ViewConfigFilesTest extends \PHPUnit_Framework_TestCase $mergeXsd, $errors ); - $message = "Invalid XML-file: {$file}\n"; - foreach ($errors as $error) { - $message .= "{$error->message} Line: {$error->line}\n"; - } - $this->assertTrue($result, $message); + $this->assertTrue($result, "Invalid XML-file: {$file}\n" . join("\n", $errors)); } /** diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/WidgetConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/WidgetConfigFilesTest.php index ba3c4649cde5c5d763f81e665b4927ac68db6502..a192de469e0df819e39653ebaffc106d6bd51f25 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/WidgetConfigFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/WidgetConfigFilesTest.php @@ -7,6 +7,8 @@ */ namespace Magento\Test\Integrity\Modular; +use Magento\Framework\Component\ComponentRegistrar; + class WidgetConfigFilesTest extends \Magento\TestFramework\TestCase\AbstractConfigFiles { /** @@ -20,24 +22,23 @@ class WidgetConfigFilesTest extends \Magento\TestFramework\TestCase\AbstractConf } /** - * Returns a string that represents the path to the config file, starting in the app directory. - * - * Format is glob, so * is allowed. + * Returns a string that represents the path to the config file * * @return string */ protected function _getConfigFilePathGlob() { - return '/*/*/etc/widget.xml'; + return 'etc/widget.xml'; } /** - * Returns a path to the per file XSD file, relative to the modules directory. + * Returns an absolute path to the XSD file corresponding to the XML files specified in _getConfigFilePathGlob * * @return string */ protected function _getXsdPath() { - return '/Magento/Widget/etc/widget_file.xsd'; + return $this->componentRegistrar->getPath(ComponentRegistrar::MODULE, 'Magento_Widget') + . '/etc/widget_file.xsd'; } } 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 27fe0b840326fda2f8448546bac0f255cf6ae2df..ca81ea4973a098eadb1bc87d8bbcb0eca2fa70e1 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Theme/XmlFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Theme/XmlFilesTest.php @@ -5,25 +5,24 @@ */ namespace Magento\Test\Integrity\Theme; -use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Component\ComponentRegistrar; class XmlFilesTest extends \PHPUnit_Framework_TestCase { - const NO_VIEW_XML_FILES_MARKER = 'no-view-xml'; - /** * @param string $file * @dataProvider viewConfigFileDataProvider */ public function testViewConfigFile($file) { - if ($file === self::NO_VIEW_XML_FILES_MARKER) { - $this->markTestSkipped('No view.xml files in themes.'); - } - $this->_validateConfigFile( - $file, - $this->getPath(DirectoryList::LIB_INTERNAL) . '/Magento/Framework/Config/etc/view.xsd' + $reader = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( + 'Magento\Framework\View\Xsd\Reader' ); + $mergeXsd = $reader->read(); + $domConfig = new \Magento\Framework\Config\Dom(file_get_contents($file)); + $errors = []; + $result = $domConfig->validate($mergeXsd, $errors); + $this->assertTrue($result, "Invalid XML-file: {$file}\n" . join("\n", $errors)); } /** @@ -32,11 +31,14 @@ class XmlFilesTest extends \PHPUnit_Framework_TestCase public function viewConfigFileDataProvider() { $result = []; - $files = glob($this->getPath(DirectoryList::THEMES) . '/*/*/view.xml'); + /** @var \Magento\Framework\Component\DirSearch $componentDirSearch */ + $componentDirSearch = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->get('Magento\Framework\Component\DirSearch'); + $files = $componentDirSearch->collectFiles(ComponentRegistrar::THEME, 'etc/view.xml'); foreach ($files as $file) { - $result[substr($file, strlen(BP))] = [$file]; + $result[$file] = [$file]; } - return $result === [] ? [[self::NO_VIEW_XML_FILES_MARKER]] : $result; + return $result; } /** @@ -54,9 +56,11 @@ class XmlFilesTest extends \PHPUnit_Framework_TestCase public function themeConfigFileExistsDataProvider() { $result = []; - $files = glob($this->getPath(DirectoryList::THEMES) . '/*/*/*', GLOB_ONLYDIR); - foreach ($files as $themeDir) { - $result[substr($themeDir, strlen(BP))] = [$themeDir]; + /** @var \Magento\Framework\Component\ComponentRegistrar $componentRegistrar */ + $componentRegistrar = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->get('\Magento\Framework\Component\ComponentRegistrar'); + foreach ($componentRegistrar->getPaths(ComponentRegistrar::THEME) as $themeDir) { + $result[$themeDir] = [$themeDir]; } return $result; } @@ -67,10 +71,10 @@ class XmlFilesTest extends \PHPUnit_Framework_TestCase */ public function testThemeConfigFileSchema($file) { - $this->_validateConfigFile( - $file, - $this->getPath(DirectoryList::LIB_INTERNAL) . '/Magento/Framework/Config/etc/theme.xsd' - ); + $domConfig = new \Magento\Framework\Config\Dom(file_get_contents($file)); + $errors = []; + $result = $domConfig->validate('urn:magento:framework:Config/etc/theme.xsd', $errors); + $this->assertTrue($result, "Invalid XML-file: {$file}\n" . join("\n", $errors)); } /** @@ -93,44 +97,13 @@ class XmlFilesTest extends \PHPUnit_Framework_TestCase public function themeConfigFileDataProvider() { $result = []; - $files = glob($this->getPath(DirectoryList::THEMES) . '/*/*/*/theme.xml'); + /** @var \Magento\Framework\Component\DirSearch $componentDirSearch */ + $componentDirSearch = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->get('Magento\Framework\Component\DirSearch'); + $files = $componentDirSearch->collectFiles(ComponentRegistrar::THEME, 'theme.xml'); foreach ($files as $file) { - $result[substr($file, strlen(BP))] = [$file]; + $result[$file] = [$file]; } return $result; } - - /** - * Perform test whether a configuration file is valid - * - * @param string $file - * @param string $schemaFile - * @throws \PHPUnit_Framework_AssertionFailedError if file is invalid - */ - protected function _validateConfigFile($file, $schemaFile) - { - $domConfig = new \Magento\Framework\Config\Dom(file_get_contents($file)); - $errors = []; - $result = $domConfig->validate($schemaFile, $errors); - $message = "Invalid XML-file: {$file}\n"; - foreach ($errors as $error) { - $message .= "{$error->message} Line: {$error->line}\n"; - } - $this->assertTrue($result, $message); - } - - /** - * Get directory path by code - * - * @param string $code - * @return string - */ - protected function getPath($code) - { - /** @var \Magento\Framework\Filesystem $filesystem */ - $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\Framework\Filesystem' - ); - return $filesystem->getDirectoryRead($code)->getAbsolutePath(); - } } diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/ViewFileReferenceTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/ViewFileReferenceTest.php index 9213416e3f5e383c18dd5bc16edc28c6afc832c9..4d4c4c51f49b6e8a98530aa314e79cc3af8f9c0c 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/ViewFileReferenceTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/ViewFileReferenceTest.php @@ -20,6 +20,8 @@ */ namespace Magento\Test\Integrity; +use Magento\Framework\Component\ComponentRegistrar; + class ViewFileReferenceTest extends \PHPUnit_Framework_TestCase { /** @@ -47,6 +49,11 @@ class ViewFileReferenceTest extends \PHPUnit_Framework_TestCase */ protected static $_themeCollection; + /** + * @var \Magento\Framework\Component\ComponentRegistrar + */ + protected static $_componentRegistrar; + public static function setUpBeforeClass() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); @@ -54,10 +61,12 @@ class ViewFileReferenceTest extends \PHPUnit_Framework_TestCase ['preferences' => ['Magento\Theme\Model\Theme' => 'Magento\Theme\Model\Theme\Data']] ); + self::$_componentRegistrar = $objectManager->get('Magento\Framework\Component\ComponentRegistrar'); + /** @var $fallbackPool \Magento\Framework\View\Design\Fallback\RulePool */ $fallbackPool = $objectManager->get('Magento\Framework\View\Design\Fallback\RulePool'); self::$_fallbackRule = $fallbackPool->getRule( - \Magento\Framework\View\Design\Fallback\RulePool::TYPE_STATIC_FILE + $fallbackPool::TYPE_STATIC_FILE ); self::$_viewFilesFallback = $objectManager->get( @@ -67,7 +76,6 @@ class ViewFileReferenceTest extends \PHPUnit_Framework_TestCase // Themes to be checked self::$_themeCollection = $objectManager->get('Magento\Theme\Model\Theme\Collection'); - self::$_themeCollection->addDefaultPattern('*'); // Compose list of locales, needed to be checked for themes self::$_checkThemeLocales = []; @@ -110,7 +118,10 @@ class ViewFileReferenceTest extends \PHPUnit_Framework_TestCase $localePlaceholder = '<locale_placeholder>'; $params = ['area' => $theme->getArea(), 'theme' => $theme, 'locale' => $localePlaceholder]; $patternDirs = self::$_fallbackRule->getPatternDirs($params); - $themePath = '/' . $theme->getFullPath() . '/'; + $themePath = self::$_componentRegistrar->getPath( + \Magento\Framework\Component\ComponentRegistrar::THEME, + $theme->getFullPath() + ); foreach ($patternDirs as $patternDir) { $patternPath = $patternDir . '/'; if ((strpos($patternPath, $themePath) !== false) // It is theme's directory @@ -218,10 +229,14 @@ class ViewFileReferenceTest extends \PHPUnit_Framework_TestCase protected static function _getFilesToProcess() { $result = []; - $rootDir = self::_getRootDir(); - foreach (['app/code', 'app/design'] as $subDir) { + $componentRegistrar = new \Magento\Framework\Component\ComponentRegistrar(); + $dirs = array_merge( + $componentRegistrar->getPaths(ComponentRegistrar::MODULE), + $componentRegistrar->getPaths(ComponentRegistrar::THEME) + ); + foreach ($dirs as $dir) { $iterator = new \RecursiveIteratorIterator( - new \RecursiveDirectoryIterator($rootDir . "/{$subDir}", \RecursiveDirectoryIterator::SKIP_DOTS) + new \RecursiveDirectoryIterator($dir, \RecursiveDirectoryIterator::SKIP_DOTS) ); $result = array_merge($result, iterator_to_array($iterator)); } @@ -229,16 +244,6 @@ class ViewFileReferenceTest extends \PHPUnit_Framework_TestCase return $result; } - /** - * Return application root directory - * - * @return string - */ - protected static function _getRootDir() - { - return realpath(__DIR__ . '/../../../../../../../'); - } - /** * Get the area, where file is located. * @@ -250,7 +255,14 @@ class ViewFileReferenceTest extends \PHPUnit_Framework_TestCase protected static function _getArea($file) { $file = str_replace('\\', '/', $file); - $areaPatterns = ['#app/code/[^/]+/[^/]+/view/([^/]+)/#S', '#app/design/([^/]+)/#S']; + $areaPatterns = []; + $componentRegistrar = new ComponentRegistrar(); + foreach ($componentRegistrar->getPaths(ComponentRegistrar::THEME) as $themeDir) { + $areaPatterns[] = '#' . $themeDir . '/([^/]+)/#S'; + } + foreach ($componentRegistrar->getPaths(ComponentRegistrar::MODULE) as $moduleDir) { + $areaPatterns[] = '#' . $moduleDir . '/view/([^/]+)/#S'; + } foreach ($areaPatterns as $pattern) { if (preg_match($pattern, $file, $matches)) { return $matches[1]; diff --git a/dev/tests/integration/testsuite/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/GeneralTest.php b/dev/tests/integration/testsuite/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/GeneralTest.php index 258f92b9a71b1065899e59831a95ec1cb30459c4..4d39cc3b2ebc9da758cc18f5db4ef345d1efac46 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/GeneralTest.php +++ b/dev/tests/integration/testsuite/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/GeneralTest.php @@ -5,9 +5,6 @@ */ namespace Magento\Theme\Block\Adminhtml\System\Design\Theme\Edit\Tab; -use Magento\Framework\App\Filesystem\DirectoryList; -use Magento\Store\Model\StoreManager; - /** * @magentoAppArea adminhtml */ diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/Layout/_files/page_layouts.xml b/dev/tests/integration/testsuite/Magento/Theme/Model/Layout/_files/page_layouts.xml index 68b80fc20ccd65978a08e0f21cb38f34c6331958..6e66d26c99af10ec2e91b33255988a0ea2db87cd 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/Layout/_files/page_layouts.xml +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/Layout/_files/page_layouts.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/View/PageLayout/etc/layouts.xsd"> +<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/PageLayout/etc/layouts.xsd"> <layout id="empty"> <label translate="true">Empty</label> </layout> diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/Layout/_files/page_layouts2.xml b/dev/tests/integration/testsuite/Magento/Theme/Model/Layout/_files/page_layouts2.xml index 4bdd1374811c7b268c4df9836327d1fdd7ba1a5d..61d2fad161325465d568c00d8cdde629db431538 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/Layout/_files/page_layouts2.xml +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/Layout/_files/page_layouts2.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/View/PageLayout/etc/layouts.xsd"> +<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/PageLayout/etc/layouts.xsd"> <layout id="1column"> <label translate="true">1 column modified</label> </layout> diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/Theme/CollectionTest.php b/dev/tests/integration/testsuite/Magento/Theme/Model/Theme/CollectionTest.php index 5cebc86af62c7bb196906dd5f1a008d8c1945af3..b793ff858dba451dc45279f7d97a7d688a00e65e 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/Theme/CollectionTest.php +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/Theme/CollectionTest.php @@ -9,8 +9,12 @@ */ namespace Magento\Theme\Model\Theme; +use Magento\Framework\App\Area; use Magento\Framework\App\Filesystem\DirectoryList; +/** + * @magentoComponentsDir Magento/Theme/Model/_files/design + */ class CollectionTest extends \PHPUnit_Framework_TestCase { /** @@ -24,11 +28,6 @@ class CollectionTest extends \PHPUnit_Framework_TestCase 'Magento\Framework\App\Filesystem\DirectoryList', [ 'root' => DirectoryList::ROOT, - 'config' => [ - DirectoryList::THEMES => [ - DirectoryList::PATH => dirname(__DIR__) . '/_files/design', - ], - ] ] ); $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( @@ -48,9 +47,9 @@ class CollectionTest extends \PHPUnit_Framework_TestCase */ public function testLoadThemesFromFileSystem() { - $pathPattern = implode('/', ['frontend', '*', '*', 'theme.xml']); - $this->_model->addTargetPattern($pathPattern); - $this->assertEquals(8, count($this->_model)); + $this->_model->addConstraint(\Magento\Theme\Model\Theme\Collection::CONSTRAINT_AREA, 'frontend'); + $this->assertNotEmpty($this->_model->getItemById('frontend/Magento_FrameworkThemeTest/default')); + $this->assertEmpty($this->_model->getItemById('adminhtml/FrameworkThemeTest/test')); } /** @@ -58,9 +57,12 @@ class CollectionTest extends \PHPUnit_Framework_TestCase * * @dataProvider expectedThemeDataFromConfiguration */ - public function testLoadFromConfiguration($themePath, $expectedData) + public function testLoadFromConfiguration($area, $vendor, $themeName, $expectedData) { - $theme = $this->_model->addTargetPattern($themePath)->getFirstItem(); + $this->_model->addConstraint(\Magento\Theme\Model\Theme\Collection::CONSTRAINT_AREA, $area); + $this->_model->addConstraint(\Magento\Theme\Model\Theme\Collection::CONSTRAINT_VENDOR, $vendor); + $this->_model->addConstraint(\Magento\Theme\Model\Theme\Collection::CONSTRAINT_THEME_NAME, $themeName); + $theme = $this->_model->getFirstItem(); $this->assertEquals($expectedData, $theme->getData()); } @@ -73,14 +75,14 @@ class CollectionTest extends \PHPUnit_Framework_TestCase { return [ [ - 'themePath' => implode('/', ['frontend', 'Magento', 'default', 'theme.xml']), - 'expectedData' => [ + 'frontend', 'Magento_FrameworkThemeTest', 'default', + [ 'area' => 'frontend', 'theme_title' => 'Default', 'parent_id' => null, 'parent_theme_path' => null, - 'theme_path' => 'Magento/default', - 'code' => 'Magento/default', + 'theme_path' => 'Magento_FrameworkThemeTest/default', + 'code' => 'Magento_FrameworkThemeTest/default', 'preview_image' => null, 'type' => \Magento\Framework\View\Design\ThemeInterface::TYPE_PHYSICAL, ], @@ -112,7 +114,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase ] ); - $this->_model->addDefaultPattern(); + $this->_model->addConstraint(Collection::CONSTRAINT_AREA, Area::AREA_FRONTEND); $this->assertFalse($this->_model->hasTheme($themeModel)); } } diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/Theme/RegistrationTest.php b/dev/tests/integration/testsuite/Magento/Theme/Model/Theme/RegistrationTest.php index 2e4b7dec86632bf2ad5b2db76cd9a60de1230925..f446d408562e0d030816e9e3fee2d2627e83fca4 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/Theme/RegistrationTest.php +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/Theme/RegistrationTest.php @@ -5,8 +5,7 @@ */ namespace Magento\Theme\Model\Theme; -use Magento\Framework\App\Bootstrap; -use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Component\ComponentRegistrar; class RegistrationTest extends \PHPUnit_Framework_TestCase { @@ -20,20 +19,20 @@ class RegistrationTest extends \PHPUnit_Framework_TestCase */ protected $_theme; + public static function setUpBeforeClass() + { + ComponentRegistrar::register( + ComponentRegistrar::THEME, + 'frontend/Test/test_theme', + dirname(__DIR__) . '/_files/design/frontend/Test/test_theme' + ); + } + /** * Initialize base models */ protected function setUp() { - \Magento\TestFramework\Helper\Bootstrap::getInstance()->reinitialize( - [ - Bootstrap::INIT_PARAM_FILESYSTEM_DIR_PATHS => [ - DirectoryList::THEMES => [ - 'path' => dirname(__DIR__) . '/_files/design', - ], - ], - ] - ); $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $objectManager->get('Magento\Framework\App\AreaList') ->getArea(\Magento\Backend\App\Area\FrontNameResolver::AREA_CODE) @@ -48,15 +47,14 @@ class RegistrationTest extends \PHPUnit_Framework_TestCase } /** - * Register themes by pattern + * Register themes * Use this method only with database isolation * * @return \Magento\Theme\Model\Theme\RegistrationTest */ protected function registerThemes() { - $pathPattern = 'frontend/*/*/theme.xml'; - $this->_model->register($pathPattern); + $this->_model->register(); return $this; } diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/Theme/Source/_files/design/frontend/a_d/theme.xml b/dev/tests/integration/testsuite/Magento/Theme/Model/Theme/Source/_files/design/frontend/a_d/theme.xml index b0efe23298f9f2426615c9e1651dcb4570d7e348..313090600cb3d3c239eaf46cc2d2d385d517214a 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/Theme/Source/_files/design/frontend/a_d/theme.xml +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/Theme/Source/_files/design/frontend/a_d/theme.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> +<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> <title>Theme D</title> </theme> diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/Theme/Source/_files/design/frontend/b_e/theme.xml b/dev/tests/integration/testsuite/Magento/Theme/Model/Theme/Source/_files/design/frontend/b_e/theme.xml index 9e73fae4aae6bdf53c66e8ae768e8c11c2b8ad3a..fd4c8f2c3220889396f63224788b6f15fcaa6c04 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/Theme/Source/_files/design/frontend/b_e/theme.xml +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/Theme/Source/_files/design/frontend/b_e/theme.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> +<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> <title>Theme E</title> </theme> diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/Theme/Source/_files/design/frontend/magento_default/theme.xml b/dev/tests/integration/testsuite/Magento/Theme/Model/Theme/Source/_files/design/frontend/magento_default/theme.xml index 35bf2705b1475337b92fdbefd21eed34ef3c2a44..1cee6f77c27ed65c8a5127844eb92efd17ab2726 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/Theme/Source/_files/design/frontend/magento_default/theme.xml +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/Theme/Source/_files/design/frontend/magento_default/theme.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> +<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> <title>Default</title> </theme> diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/Theme/Source/_files/design/frontend/magento_g/theme.xml b/dev/tests/integration/testsuite/Magento/Theme/Model/Theme/Source/_files/design/frontend/magento_g/theme.xml index 58305eec6c911fd792fd423de2e1f72ac8c7790d..712232dc74489e28edb338fb12ab89fba66659e8 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/Theme/Source/_files/design/frontend/magento_g/theme.xml +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/Theme/Source/_files/design/frontend/magento_g/theme.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> +<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> <title>Theme G</title> <parent>Magento/default</parent> </theme> diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/ThemeTest.php b/dev/tests/integration/testsuite/Magento/Theme/Model/ThemeTest.php index c2f78e3065fd89996a241aeb506abaa6eaa7aabc..ae532a1df14a4a9617146410f5d6c395a1e71e92 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/ThemeTest.php +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/ThemeTest.php @@ -63,22 +63,32 @@ class ThemeTest extends \PHPUnit_Framework_TestCase } /** - * @magentoDataFixture Magento/Theme/Model/_files/design/themes.php + * @magentoComponentsDir Magento/Theme/Model/_files/design * @magentoAppIsolation enabled + * @magentoDbIsolation enabled * @magentoAppArea frontend */ public function testGetInheritedThemes() { + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + /** @var \Magento\Theme\Model\Theme\Registration $registration */ + $registration = $objectManager->get( + 'Magento\Theme\Model\Theme\Registration' + ); + $registration->register(); /** @var \Magento\Framework\View\Design\Theme\FlyweightFactory $themeFactory */ - $themeFactory = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( + $themeFactory = $objectManager->get( 'Magento\Framework\View\Design\Theme\FlyweightFactory' ); - $theme = $themeFactory->create('Vendor/custom_theme'); + $theme = $themeFactory->create('Vendor_FrameworkThemeTest/custom_theme'); $this->assertCount(2, $theme->getInheritedThemes()); $expected = []; foreach ($theme->getInheritedThemes() as $someTheme) { $expected[] = $someTheme->getFullPath(); } - $this->assertEquals(['frontend/Vendor/default', 'frontend/Vendor/custom_theme'], $expected); + $this->assertEquals( + ['frontend/Vendor_FrameworkThemeTest/default', 'frontend/Vendor_FrameworkThemeTest/custom_theme'], + $expected + ); } } diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/View/DesignTest.php b/dev/tests/integration/testsuite/Magento/Theme/Model/View/DesignTest.php index bc9a6bb4109b606dd693a35236e0ef635fcd0322..0f4262953b9ec499bb8b365c29de1e812e448de4 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/View/DesignTest.php +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/View/DesignTest.php @@ -5,12 +5,12 @@ */ namespace Magento\Theme\Model\View; -use Magento\Framework\App\Bootstrap; use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Store\Model\ScopeInterface; /** - * @magentoDataFixture Magento/Theme/Model/_files/design/themes.php + * @magentoComponentsDir Magento/Theme/Model/_files/design + * @magentoDbIsolation enabled */ class DesignTest extends \PHPUnit_Framework_TestCase { @@ -54,6 +54,11 @@ class DesignTest extends \PHPUnit_Framework_TestCase protected function setUp() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + /** @var \Magento\Theme\Model\Theme\Registration $registration */ + $registration = $objectManager->get( + 'Magento\Theme\Model\Theme\Registration' + ); + $registration->register(); $this->_model = $objectManager->create('Magento\\Framework\View\DesignInterface'); $this->_viewFileSystem = $objectManager->create('Magento\Framework\View\FileSystem'); $this->_viewConfig = $objectManager->create('Magento\Framework\View\ConfigInterface'); @@ -65,17 +70,8 @@ class DesignTest extends \PHPUnit_Framework_TestCase * * @param string $themePath */ - protected function _emulateFixtureTheme($themePath = 'Test/default') + protected function _emulateFixtureTheme($themePath = 'Test_FrameworkThemeTest/default') { - \Magento\TestFramework\Helper\Bootstrap::getInstance()->reinitialize( - [ - Bootstrap::INIT_PARAM_FILESYSTEM_DIR_PATHS => [ - DirectoryList::THEMES => [ - 'path' => realpath(__DIR__ . '/../_files/design'), - ], - ], - ] - ); \Magento\TestFramework\Helper\Bootstrap::getInstance()->loadArea('frontend'); $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $objectManager->get('Magento\Framework\View\DesignInterface')->setDesignTheme($themePath); diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/adminhtml/Vendor/test/registration.php b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/adminhtml/Vendor/test/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..b13df2d236b5c738fe44ee5a3c0f5966551f7909 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/adminhtml/Vendor/test/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::THEME, + 'adminhtml/FrameworkThemeTest/test', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/adminhtml/Vendor/test/theme.xml b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/adminhtml/Vendor/test/theme.xml index 8eec1253605812e3706d2577533c50cebe7e39cf..e1a369b1dc411bb3df0713b8fc116935fbddeaa0 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/adminhtml/Vendor/test/theme.xml +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/adminhtml/Vendor/test/theme.xml @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ --> -<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> +<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> <title>Default</title> </theme> diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/area_two/Vendor/theme_one/registration.php b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/area_two/Vendor/theme_one/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..e3fcdf6dff8f1d73e56103747e7cb274a3074bd1 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/area_two/Vendor/theme_one/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::THEME, + 'area_two/FrameworkThemeTest/theme_one', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/area_two/Vendor/theme_one/theme.xml b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/area_two/Vendor/theme_one/theme.xml index bb0a63a6dad43d7e47eba0fbe316f6677bef377f..16f284cb238033a0cecf017fae78d941d0cff2d5 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/area_two/Vendor/theme_one/theme.xml +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/area_two/Vendor/theme_one/theme.xml @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ --> -<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> +<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> <title>Theme One</title> </theme> diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/design_area/Vendor/theme_one/registration.php b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/design_area/Vendor/theme_one/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..dd9d9d6db2b22a70aeba8ee8d560344f819d112f --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/design_area/Vendor/theme_one/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::THEME, + 'design_area/FrameworkThemeTest/theme_one', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/design_area/Vendor/theme_one/theme.xml b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/design_area/Vendor/theme_one/theme.xml index bb0a63a6dad43d7e47eba0fbe316f6677bef377f..16f284cb238033a0cecf017fae78d941d0cff2d5 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/design_area/Vendor/theme_one/theme.xml +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/design_area/Vendor/theme_one/theme.xml @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ --> -<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> +<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> <title>Theme One</title> </theme> diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Magento/default/registration.php b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Magento/default/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..1b162158734e10596bbc14117d8937b9d71d1988 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Magento/default/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::THEME, + 'frontend/Magento_FrameworkThemeTest/default', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Magento/default/theme.xml b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Magento/default/theme.xml index 49e2a0830a3a453ac9b5eb1ec0c8b71925ea88d8..21ae22a42a66d22f9e8abc460b206de64e2d51ed 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Magento/default/theme.xml +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Magento/default/theme.xml @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ --> -<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> +<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> <title>Default</title> <version>0.1.0</version> </theme> diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Magento/default_iphone/registration.php b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Magento/default_iphone/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..9f9679873d2d921eab0fd00e68b6d3647ee22790 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Magento/default_iphone/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::THEME, + 'frontend/Magento_FrameworkThemeTest/default_iphone', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Magento/default_iphone/theme.xml b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Magento/default_iphone/theme.xml index c01058ce1edc6c38426ba1eabc6dbb5774976c86..3f2f8cb1cbad77768ac562ffb8d08d095fd06214 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Magento/default_iphone/theme.xml +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Magento/default_iphone/theme.xml @@ -4,11 +4,11 @@ * See COPYING.txt for license details. */ --> -<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> +<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> <title>Iphone</title> <media> <preview_image>images/preview_image.jpg</preview_image> </media> <version>0.1.0</version> - <parent>Magento/default</parent> + <parent>Magento_FrameworkThemeTest/default</parent> </theme> diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/cache_test_theme/registration.php b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/cache_test_theme/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..afb83b7bd63a474ab30d604c40c01b639727cc30 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/cache_test_theme/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::THEME, + 'frontend/Test_FrameworkThemeTest/cache_test_theme', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/cache_test_theme/theme.xml b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/cache_test_theme/theme.xml index 1db1b557740c39b1a6f18eca29b70cd9be14af53..3e69e6eb2fe91abaa32ebf4c6bf7236ec81ae1ea 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/cache_test_theme/theme.xml +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/cache_test_theme/theme.xml @@ -4,8 +4,8 @@ * See COPYING.txt for license details. */ --> -<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> +<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> <title>Cache Test Theme</title> <version>0.1.0</version> - <parent>Test/default</parent> + <parent>Test_FrameworkThemeTest/default</parent> </theme> diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/default/Magento_Catalog/catalog_category_view.xml b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/default/Magento_Catalog/catalog_category_view.xml index fb318b42793410ad85fcb0cbec26ca22dfd56bf8..6b084e14ff441a8451944c9aa2835de67624c76f 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/default/Magento_Catalog/catalog_category_view.xml +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/default/Magento_Catalog/catalog_category_view.xml @@ -5,4 +5,4 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_layout.xsd"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"/> diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/default/Magento_Catalog/catalog_category_view_type_default.xml b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/default/Magento_Catalog/catalog_category_view_type_default.xml index fb318b42793410ad85fcb0cbec26ca22dfd56bf8..6b084e14ff441a8451944c9aa2835de67624c76f 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/default/Magento_Catalog/catalog_category_view_type_default.xml +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/default/Magento_Catalog/catalog_category_view_type_default.xml @@ -5,4 +5,4 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_layout.xsd"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"/> diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/default/Magento_Catalog/catalog_product_view.xml b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/default/Magento_Catalog/catalog_product_view.xml index fb318b42793410ad85fcb0cbec26ca22dfd56bf8..6b084e14ff441a8451944c9aa2835de67624c76f 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/default/Magento_Catalog/catalog_product_view.xml +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/default/Magento_Catalog/catalog_product_view.xml @@ -5,4 +5,4 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_layout.xsd"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"/> diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/default/Magento_Catalog/catalog_product_view_type_simple.xml b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/default/Magento_Catalog/catalog_product_view_type_simple.xml index fb318b42793410ad85fcb0cbec26ca22dfd56bf8..6b084e14ff441a8451944c9aa2835de67624c76f 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/default/Magento_Catalog/catalog_product_view_type_simple.xml +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/default/Magento_Catalog/catalog_product_view_type_simple.xml @@ -5,4 +5,4 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_layout.xsd"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"/> diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/default/Magento_Cms/layout_test_handle_extra.xml b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/default/Magento_Cms/layout_test_handle_extra.xml index fb318b42793410ad85fcb0cbec26ca22dfd56bf8..6b084e14ff441a8451944c9aa2835de67624c76f 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/default/Magento_Cms/layout_test_handle_extra.xml +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/default/Magento_Cms/layout_test_handle_extra.xml @@ -5,4 +5,4 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_layout.xsd"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"/> diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/default/Magento_Core/layout_test_handle_main.xml b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/default/Magento_Core/layout_test_handle_main.xml index 4e9b9587ed67ae8e46c4632e2f07d04b7b3850a0..44997bf14d355adf4d24b53d1c23a560075853a2 100755 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/default/Magento_Core/layout_test_handle_main.xml +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/default/Magento_Core/layout_test_handle_main.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_layout.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"> <update handle="layout_test_handle_sample"/> <referenceBlock name="header" remove="true"/> <referenceBlock name="menu" remove="true"/> diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/default/Magento_Core/layout_test_handle_sample.xml b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/default/Magento_Core/layout_test_handle_sample.xml index b0c80f33f880da7193374014d229fbc54c9e2999..2cbac96ac92e80a550c5639e156d43529f0dfe30 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/default/Magento_Core/layout_test_handle_sample.xml +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/default/Magento_Core/layout_test_handle_sample.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <title>Magento Admin</title> <script src="prototype/prototype.js"/> diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/default/etc/view.xml b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/default/etc/view.xml index 61d0514d8ae95c2aecbffd5df1445d98ab869c70..4c5a4effc4de2749d7a1eb6b3cadf5fdffde7332 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/default/etc/view.xml +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/default/etc/view.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../lib/internal/Magento/Framework/Config/etc/view.xsd"> +<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/view.xsd"> <vars module="Magento_Store"> <var name="var1">Store Value1</var> </vars> diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/default/registration.php b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/default/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..c3153b6148a464f114b76ccdd3561559152e7fc9 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/default/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::THEME, + 'frontend/Test_FrameworkThemeTest/default', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/default/theme.xml b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/default/theme.xml index 49e2a0830a3a453ac9b5eb1ec0c8b71925ea88d8..21ae22a42a66d22f9e8abc460b206de64e2d51ed 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/default/theme.xml +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/default/theme.xml @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ --> -<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> +<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> <title>Default</title> <version>0.1.0</version> </theme> diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/publication/registration.php b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/publication/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..32e6637fce0a0e2d0391cf651df95c1d6121a3f4 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/publication/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::THEME, + 'frontend/Test_FrameworkThemeTest/publication', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/publication/theme.xml b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/publication/theme.xml index 49e2a0830a3a453ac9b5eb1ec0c8b71925ea88d8..21ae22a42a66d22f9e8abc460b206de64e2d51ed 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/publication/theme.xml +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/publication/theme.xml @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ --> -<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> +<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> <title>Default</title> <version>0.1.0</version> </theme> diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/test_theme/registration.php b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/test_theme/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..0dd30036d829feb519cdd9ab9018a4fd6aef8463 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/test_theme/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::THEME, + 'frontend/Test_FrameworkThemeTest/test_theme', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/test_theme/theme.xml b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/test_theme/theme.xml index 108e4a8742502dff3124229d9848af1febb40c3e..66d7d7d64a3699dd3c9fca34061aeb72c5300a6a 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/test_theme/theme.xml +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Test/test_theme/theme.xml @@ -4,8 +4,8 @@ * See COPYING.txt for license details. */ --> -<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> +<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> <title>Test Theme</title> <version>0.1.0</version> - <parent>Test/default</parent> + <parent>Test_FrameworkThemeTest/default</parent> </theme> diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Vendor/custom_theme/registration.php b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Vendor/custom_theme/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..7c2c11bfff98a3540101d6af2b9a71a065266ea2 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Vendor/custom_theme/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::THEME, + 'frontend/Vendor_FrameworkThemeTest/custom_theme', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Vendor/custom_theme/theme.xml b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Vendor/custom_theme/theme.xml index 2dfa014452f3d21fd55fe8f3e4f6461f31a61c6d..0c2785fa6d063701d814b2a4fe8a06f9bd0026c8 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Vendor/custom_theme/theme.xml +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Vendor/custom_theme/theme.xml @@ -4,8 +4,8 @@ * See COPYING.txt for license details. */ --> -<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> +<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> <title>Custom Theme</title> <version>0.1.0</version> - <parent>Vendor/default</parent> + <parent>Vendor_FrameworkThemeTest/default</parent> </theme> diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Vendor/default/registration.php b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Vendor/default/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..fb6f91a1c7949611af792bc3aceb693591c02c13 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Vendor/default/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::THEME, + 'frontend/Vendor_FrameworkThemeTest/default', + __DIR__ +); diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Vendor/default/theme.xml b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Vendor/default/theme.xml index 49e2a0830a3a453ac9b5eb1ec0c8b71925ea88d8..21ae22a42a66d22f9e8abc460b206de64e2d51ed 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Vendor/default/theme.xml +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/frontend/Vendor/default/theme.xml @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ --> -<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> +<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> <title>Default</title> <version>0.1.0</version> </theme> diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/themes.php b/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/themes.php deleted file mode 100644 index 4ce7fa807ac8b199bc686c9d7badaa867d8fbec4..0000000000000000000000000000000000000000 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/_files/design/themes.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -use Magento\Framework\App\Bootstrap; -use Magento\Framework\App\Filesystem\DirectoryList; - -\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\AreaList') - ->getArea(\Magento\Backend\App\Area\FrontNameResolver::AREA_CODE) - ->load(\Magento\Framework\App\Area::PART_CONFIG); -\Magento\TestFramework\Helper\Bootstrap::getInstance()->reinitialize([ - Bootstrap::INIT_PARAM_FILESYSTEM_DIR_PATHS => [ - DirectoryList::THEMES => ['path' => realpath(__DIR__)], - ], -]); -\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->configure( - ['preferences' => ['Magento\Theme\Model\Theme' => 'Magento\Theme\Model\Theme\Data']] -); -/** @var $registration \Magento\Theme\Model\Theme\Registration */ -$registration = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Theme\Model\Theme\Registration' -); -$registration->register(implode('/', ['*', '*', '*', 'theme.xml'])); diff --git a/dev/tests/integration/testsuite/Magento/Theme/Observer/ThemeRegistrationObserverTest.php b/dev/tests/integration/testsuite/Magento/Theme/Observer/ThemeRegistrationObserverTest.php index 62d7dd1432082b5403285c2ead9c4157767d666c..7598cfb6b2d7082921a817e190440d5952cc6ee0 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Observer/ThemeRegistrationObserverTest.php +++ b/dev/tests/integration/testsuite/Magento/Theme/Observer/ThemeRegistrationObserverTest.php @@ -35,10 +35,6 @@ class ThemeRegistrationObserverTest extends \PHPUnit_Framework_TestCase */ public function testThemeRegistration() { - $pattern = 'path_pattern'; - - $this->_eventObserver->getEvent()->setPathPattern($pattern); - $themeRegistration = $this->getMock( 'Magento\Theme\Model\Theme\Registration', ['register'], @@ -48,7 +44,7 @@ class ThemeRegistrationObserverTest extends \PHPUnit_Framework_TestCase $this->_objectManager->create('Magento\Framework\Filesystem') ] ); - $themeRegistration->expects($this->once())->method('register')->with($this->equalTo($pattern)); + $themeRegistration->expects($this->once())->method('register'); $this->_objectManager->addSharedInstance($themeRegistration, 'Magento\Theme\Model\Theme\Registration'); /** @var $observer \Magento\Theme\Observer\ThemeRegistrationObserver */ diff --git a/dev/tests/integration/testsuite/Magento/Translation/Model/_files/locale/en_AU/config.xml b/dev/tests/integration/testsuite/Magento/Translation/Model/_files/locale/en_AU/config.xml index 97d3c799a4ee00613bab6e86f08c9c80d6c69a7f..d331475b16d3efbdc799d220b50d852928e52f37 100644 --- a/dev/tests/integration/testsuite/Magento/Translation/Model/_files/locale/en_AU/config.xml +++ b/dev/tests/integration/testsuite/Magento/Translation/Model/_files/locale/en_AU/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <locale> <inheritance> diff --git a/dev/tests/integration/testsuite/Magento/Webapi/Controller/PathProcessorTest.php b/dev/tests/integration/testsuite/Magento/Webapi/Controller/PathProcessorTest.php index d2d01e2e0e9d3b980c943e3a53c757e531486679..81e41df2dc95086261895c3c528811909e3c14ea 100644 --- a/dev/tests/integration/testsuite/Magento/Webapi/Controller/PathProcessorTest.php +++ b/dev/tests/integration/testsuite/Magento/Webapi/Controller/PathProcessorTest.php @@ -6,6 +6,8 @@ namespace Magento\Webapi\Controller; +use Magento\Store\Model\Store; + class PathProcessorTest extends \PHPUnit_Framework_TestCase { /** @@ -39,11 +41,23 @@ class PathProcessorTest extends \PHPUnit_Framework_TestCase $this->assertEquals($storeCode, $this->storeManager->getStore()->getCode()); } + public function testProcessWithAllStoreCode() + { + $storeCode = 'all'; + $path = '/V1/customerAccounts/createCustomer'; + $uri = 'rest/' . $storeCode . $path; + $result = $this->pathProcessor->process($uri); + $this->assertEquals($path, $result); + $this->assertEquals(Store::ADMIN_CODE, $this->storeManager->getStore()->getCode()); + } + + public function testProcessWithoutStoreCode() { - $path = 'rest/V1/customerAccounts/createCustomer'; - $result = $this->pathProcessor->process($path); - $this->assertEquals('/V1/customerAccounts/createCustomer', $result); + $path = '/V1/customerAccounts/createCustomer'; + $uri = 'rest' . $path; + $result = $this->pathProcessor->process($uri); + $this->assertEquals($path, $result); $this->assertEquals('default', $this->storeManager->getStore()->getCode()); } } 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 f3e03397766b885725a1f8bd1c1ff1e524659952..4669d756cac35fd25a16cce00437595bcf1b9607 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 @@ -6,7 +6,7 @@ */ --> <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../../app/code/Magento/Webapi/etc/webapi.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd"> <route url="/V1/testmodule1/:id" method="GET"> <service class="Magento\TestModule1\Service\V1\AllSoapAndRestInterface" method="item"/> <resources> 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 7bfefda3c2d439303a77e838dfe52bc13adc886a..bea91722c45b3dcfb9b55438f3f7c48b5aec63ac 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 @@ -6,7 +6,7 @@ */ --> <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../../app/code/Magento/Webapi/etc/webapi.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd"> <route url="/V1/testmodule1" method="POST"> <service class="Magento\TestModule1\Service\V1\AllSoapAndRestInterface" method="create"/> <resources> diff --git a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/ContainerTest.php b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/ContainerTest.php index 5b8e110b28ecf72d05343ff7c71e5ea0d1617f24..09566294c059949adb5bd45b827c88f8ab6b1f0a 100644 --- a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/ContainerTest.php +++ b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/ContainerTest.php @@ -39,7 +39,11 @@ class ContainerTest extends \PHPUnit_Framework_TestCase */ public function testAvailableContainers() { - $themeId = '3'; + $themeToTest = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( + '\Magento\Theme\Model\Theme' + ); + $themeId = $themeToTest->load('Magento/blank', 'code') + ->getId(); $this->block->setTheme($themeId); $this->assertContains('<option value="before.body.end" >', $this->block->toHtml()); } diff --git a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/child_page_with_inherited_containers.xml b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/child_page_with_inherited_containers.xml index 9f9bf262f83bece044ea3540b9b3d9eb84bb0878..6b084e14ff441a8451944c9aa2835de67624c76f 100644 --- a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/child_page_with_inherited_containers.xml +++ b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/child_page_with_inherited_containers.xml @@ -5,4 +5,4 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_layout.xsd"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"/> diff --git a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/child_page_with_inherited_imported_containers.xml b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/child_page_with_inherited_imported_containers.xml index 9f9bf262f83bece044ea3540b9b3d9eb84bb0878..6b084e14ff441a8451944c9aa2835de67624c76f 100644 --- a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/child_page_with_inherited_imported_containers.xml +++ b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/child_page_with_inherited_imported_containers.xml @@ -5,4 +5,4 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_layout.xsd"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"/> diff --git a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/child_page_with_own_containers.xml b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/child_page_with_own_containers.xml index 4ef0c5f03c79d5e1e6736fb276b21cb11194cfd7..2b77b892d8682a160d7e2874e864c28702c55d15 100644 --- a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/child_page_with_own_containers.xml +++ b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/child_page_with_own_containers.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_layout.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"> <container name="container_three" label="Container Three"/> </layout> diff --git a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/child_page_without_containers.xml b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/child_page_without_containers.xml index 9f9bf262f83bece044ea3540b9b3d9eb84bb0878..6b084e14ff441a8451944c9aa2835de67624c76f 100644 --- a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/child_page_without_containers.xml +++ b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/child_page_without_containers.xml @@ -5,4 +5,4 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_layout.xsd"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"/> diff --git a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/root_page_with_imported_containers.xml b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/root_page_with_imported_containers.xml index 74b5f464efc2b1bfdb8dea6f1f2781a73e01d835..73dd3d0cbb6a762e248b13f7de120a0b4fe98ff2 100644 --- a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/root_page_with_imported_containers.xml +++ b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/root_page_with_imported_containers.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_layout.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"> <update handle="non_page_handle_with_own_containers"/> </layout> diff --git a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/root_page_with_own_containers.xml b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/root_page_with_own_containers.xml index ef2db194bf6f01e89a0bed1f2470c64f37891416..55cd4d9098a4bd6e526c2c69da1c7d5035586e01 100644 --- a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/root_page_with_own_containers.xml +++ b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/root_page_with_own_containers.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_layout.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"> <container name="container_two" label="Container Two"/> </layout> diff --git a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/root_page_without_containers.xml b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/root_page_without_containers.xml index 9f9bf262f83bece044ea3540b9b3d9eb84bb0878..6b084e14ff441a8451944c9aa2835de67624c76f 100644 --- a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/root_page_without_containers.xml +++ b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/root_page_without_containers.xml @@ -5,4 +5,4 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_layout.xsd"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"/> diff --git a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/root_page_without_own_containers.xml b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/root_page_without_own_containers.xml index 9f9bf262f83bece044ea3540b9b3d9eb84bb0878..6b084e14ff441a8451944c9aa2835de67624c76f 100644 --- a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/root_page_without_own_containers.xml +++ b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/_files/layout/root_page_without_own_containers.xml @@ -5,4 +5,4 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_layout.xsd"/> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"/> diff --git a/dev/tests/integration/testsuite/Magento/Widget/Controller/Adminhtml/Widget/InstanceTest.php b/dev/tests/integration/testsuite/Magento/Widget/Controller/Adminhtml/Widget/InstanceTest.php index 30dbf0cf1816b31252c76fb8936fff6084d1f9c4..fe97b3d30b38d5c9a9eee1c90b42837d7943fd08 100644 --- a/dev/tests/integration/testsuite/Magento/Widget/Controller/Adminhtml/Widget/InstanceTest.php +++ b/dev/tests/integration/testsuite/Magento/Widget/Controller/Adminhtml/Widget/InstanceTest.php @@ -14,6 +14,9 @@ class InstanceTest extends \Magento\TestFramework\TestCase\AbstractBackendContro { parent::setUp(); + \Magento\TestFramework\Helper\Bootstrap::getInstance() + ->loadArea(\Magento\Backend\App\Area\FrontNameResolver::AREA_CODE); + $theme = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( 'Magento\Framework\View\DesignInterface' )->setDefaultDesignTheme()->getDesignTheme(); diff --git a/dev/tests/integration/testsuite/Magento/Widget/Model/Config/_files/catalog_new_products_list.xml b/dev/tests/integration/testsuite/Magento/Widget/Model/Config/_files/catalog_new_products_list.xml index 11c591d6c909452261494a830feff731b3ea140a..1fe8384c912e4b4502d82682d791ed17e847c536 100644 --- a/dev/tests/integration/testsuite/Magento/Widget/Model/Config/_files/catalog_new_products_list.xml +++ b/dev/tests/integration/testsuite/Magento/Widget/Model/Config/_files/catalog_new_products_list.xml @@ -6,7 +6,7 @@ */ --> <widgets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../../app/code/Magento/Widget/etc/widget.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Widget:etc/widget.xsd"> <widget id="new_products" class="Magento\Catalog\Block\Product\Widget\NewWidget" is_email_compatible="true" placeholder_image="Magento_Catalog::images/product_widget_new.png"> <label translate="true">Catalog New Products List</label> diff --git a/dev/tests/integration/testsuite/Magento/Widget/Model/Config/_files/orders_and_returns.xml b/dev/tests/integration/testsuite/Magento/Widget/Model/Config/_files/orders_and_returns.xml index 76d4ffb06fe1ff8464593ce34a0c1b28a87a0d38..98fc576176c139999fcb3b7354636042721a3be3 100644 --- a/dev/tests/integration/testsuite/Magento/Widget/Model/Config/_files/orders_and_returns.xml +++ b/dev/tests/integration/testsuite/Magento/Widget/Model/Config/_files/orders_and_returns.xml @@ -6,7 +6,7 @@ */ --> <widgets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../../app/code/Magento/Widget/etc/widget.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Widget:etc/widget.xsd"> <widget id="sales_widget_guestform" class="Magento\Sales\Block\Widget\Guest\Form" is_email_compatible="true" > <label translate="true">Orders and Returns</label> <description translate="true">Orders and Returns Search Form</description> diff --git a/dev/tests/integration/testsuite/Magento/Widget/Model/Config/_files/orders_and_returns_customized.xml b/dev/tests/integration/testsuite/Magento/Widget/Model/Config/_files/orders_and_returns_customized.xml index da309c6c36441b73baeb2117efe189de406bcfda..d2af36a19701909a6319837abcb02667eb90d201 100644 --- a/dev/tests/integration/testsuite/Magento/Widget/Model/Config/_files/orders_and_returns_customized.xml +++ b/dev/tests/integration/testsuite/Magento/Widget/Model/Config/_files/orders_and_returns_customized.xml @@ -6,7 +6,7 @@ */ --> <widgets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../../app/code/Magento/Widget/etc/widget.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Widget:etc/widget.xsd"> <widget id="new_products" class="Magento\Sales\Block\Widget\Guest\Form" is_email_compatible="true" > <label translate="true">Orders and Returns</label> <description translate="true">Orders and Returns Search Form</description> diff --git a/dev/tests/integration/testsuite/Magento/Widget/_files/design/adminhtml/magento_basic/composer.json b/dev/tests/integration/testsuite/Magento/Widget/_files/design/adminhtml/magento_basic/composer.json index 8e308d323de888fa454d1df30a175bd8a9ea38f1..2a5eeb481a06fdf01cd2f9bfb96e94dd48ba4d8f 100644 --- a/dev/tests/integration/testsuite/Magento/Widget/_files/design/adminhtml/magento_basic/composer.json +++ b/dev/tests/integration/testsuite/Magento/Widget/_files/design/adminhtml/magento_basic/composer.json @@ -3,8 +3,7 @@ "description": "N/A", "require": { "php": "~5.5.0|~5.6.0|~7.0.0", - "magento/framework": "0.1.0-alpha103", - "magento/magento-composer-installer": "*" + "magento/framework": "0.1.0-alpha103" }, "type": "magento2-theme", "version": "0.1.0" diff --git a/dev/tests/integration/testsuite/Magento/Widget/_files/design/adminhtml/magento_basic/theme.xml b/dev/tests/integration/testsuite/Magento/Widget/_files/design/adminhtml/magento_basic/theme.xml index 6a4ffb332a4a4038f343f6f4845aec842644f18d..480efcb09f933ac2cbe382d5d7411a7da5d90e7d 100644 --- a/dev/tests/integration/testsuite/Magento/Widget/_files/design/adminhtml/magento_basic/theme.xml +++ b/dev/tests/integration/testsuite/Magento/Widget/_files/design/adminhtml/magento_basic/theme.xml @@ -4,6 +4,6 @@ * See COPYING.txt for license details. */ --> -<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> +<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> <title>Basic</title> </theme> diff --git a/dev/tests/static/framework/Magento/TestFramework/Dependency/DbRule.php b/dev/tests/static/framework/Magento/TestFramework/Dependency/DbRule.php index a520926354d70cf39ddb513d0d63003a6a92b2d1..709250e62e6359417c96847cc10ec6e02bdf2487 100644 --- a/dev/tests/static/framework/Magento/TestFramework/Dependency/DbRule.php +++ b/dev/tests/static/framework/Magento/TestFramework/Dependency/DbRule.php @@ -37,7 +37,7 @@ class DbRule implements \Magento\TestFramework\Dependency\RuleInterface */ public function getDependencyInfo($currentModule, $fileType, $file, &$contents) { - if ('php' != $fileType || !preg_match('#/app/.*/(Setup|Resource)/.*\.php$#', $file)) { + if ('php' != $fileType || !preg_match('#.*/(Setup|Resource)/.*\.php$#', $file)) { return []; } diff --git a/dev/tests/static/framework/Magento/TestFramework/Dependency/LayoutRule.php b/dev/tests/static/framework/Magento/TestFramework/Dependency/LayoutRule.php index 604ab3fd2c6117e4349faaaab4bb0b497f9d0937..e42615c1b67e658fd94d7fe0a986101b44156b57 100644 --- a/dev/tests/static/framework/Magento/TestFramework/Dependency/LayoutRule.php +++ b/dev/tests/static/framework/Magento/TestFramework/Dependency/LayoutRule.php @@ -371,10 +371,12 @@ class LayoutRule implements \Magento\TestFramework\Dependency\RuleInterface protected function _checkDependenciesByRegexp($currentModule, &$contents, $patterns = []) { $result = []; + foreach ($patterns as $pattern => $type) { if (preg_match_all($pattern, $contents, $matches, PREG_SET_ORDER)) { foreach ($matches as $match) { $module = $match['namespace'] . '\\' . $match['module']; + if ($currentModule != $module) { $result[$module] = ['type' => $type, 'source' => $match['source']]; } diff --git a/dev/tests/static/framework/Magento/TestFramework/Inspection/WordsFinder.php b/dev/tests/static/framework/Magento/TestFramework/Inspection/WordsFinder.php index 9c13e8ef8bce9db5141f762b0697e520b719371c..9ee716602a8f6b6a34a93b437e1ef1647e0a457a 100644 --- a/dev/tests/static/framework/Magento/TestFramework/Inspection/WordsFinder.php +++ b/dev/tests/static/framework/Magento/TestFramework/Inspection/WordsFinder.php @@ -101,14 +101,9 @@ class WordsFinder } // Add config files to whitelist, as they surely contain banned words - $basePath = $this->_baseDir . '/'; - $basePathLen = strlen($basePath); foreach ($configFiles as $configFile) { $configFile = str_replace('\\', '/', realpath($configFile)); - if (strncmp($basePath, $configFile, $basePathLen) === 0) { - // File is inside base dir - $this->_whitelist[$this->_getRelPath($configFile)] = []; - } + $this->_whitelist[$configFile] = []; } $this->_normalizeWhitelistPaths(); @@ -181,7 +176,7 @@ class WordsFinder 'A "path" must be defined for the whitelisted item' ); } - $path = (string)$path[0]; + $path = $this->_baseDir . '/' . (string)$path[0]; // Words $words = []; @@ -233,8 +228,7 @@ class WordsFinder return []; } - $relPath = substr($file, strlen($this->_baseDir) + 1); - return self::_removeWhitelistedWords($relPath, $foundWords); + return self::_removeWhitelistedWords($file, $foundWords); } /** diff --git a/dev/tests/static/framework/Magento/TestFramework/Integrity/AbstractConfig.php b/dev/tests/static/framework/Magento/TestFramework/Integrity/AbstractConfig.php index 7cede7ed89b0f09a38bb8848aed6e932f407d1da..df0f8b578784d89277f473598bd91cb639cfdb9c 100644 --- a/dev/tests/static/framework/Magento/TestFramework/Integrity/AbstractConfig.php +++ b/dev/tests/static/framework/Magento/TestFramework/Integrity/AbstractConfig.php @@ -20,9 +20,7 @@ abstract class AbstractConfig extends \PHPUnit_Framework_TestCase * @param string $configFile */ function ($configFile) { - $schema = \Magento\Framework\App\Utility\Files::init()->getPathToSource() . $this->_getXsd(); - $fileSchema = \Magento\Framework\App\Utility\Files::init()->getPathToSource() . $this->_getFileXsd(); - $this->_validateFileExpectSuccess($configFile, $schema, $fileSchema); + $this->_validateFileExpectSuccess($configFile, $this->_getXsd(), $this->_getFileXsd()); }, \Magento\Framework\App\Utility\Files::init()->getConfigFiles($this->_getXmlName()) ); @@ -31,14 +29,14 @@ abstract class AbstractConfig extends \PHPUnit_Framework_TestCase public function testSchemaUsingValidXml() { $xmlFile = $this->_getKnownValidXml(); - $schema = \Magento\Framework\App\Utility\Files::init()->getPathToSource() . $this->_getXsd(); + $schema = $this->_getXsd(); $this->_validateFileExpectSuccess($xmlFile, $schema); } public function testSchemaUsingInvalidXml($expectedErrors = null) { $xmlFile = $this->_getKnownInvalidXml(); - $schema = \Magento\Framework\App\Utility\Files::init()->getPathToSource() . $this->_getXsd(); + $schema = $this->_getXsd(); $this->_validateFileExpectFailure($xmlFile, $schema, $expectedErrors); } @@ -49,7 +47,7 @@ abstract class AbstractConfig extends \PHPUnit_Framework_TestCase $this->markTestSkipped('No Partial File'); return; } - $schema = \Magento\Framework\App\Utility\Files::init()->getPathToSource() . $this->_getFileXsd(); + $schema = $this->_getFileXsd(); $this->_validateFileExpectSuccess($xmlFile, $schema); } @@ -60,7 +58,7 @@ abstract class AbstractConfig extends \PHPUnit_Framework_TestCase $this->markTestSkipped('No Partial File'); return; } - $schema = \Magento\Framework\App\Utility\Files::init()->getPathToSource() . $this->_getFileXsd(); + $schema = $this->_getFileXsd(); $this->_validateFileExpectFailure($xmlFile, $schema, $expectedErrors); } @@ -71,7 +69,7 @@ abstract class AbstractConfig extends \PHPUnit_Framework_TestCase $this->markTestSkipped('No Partial File'); return; } - $schema = \Magento\Framework\App\Utility\Files::init()->getPathToSource() . $this->_getXsd(); + $schema = $this->_getXsd(); $this->_validateFileExpectFailure($xmlFile, $schema, $expectedErrors); } diff --git a/dev/tests/static/framework/Magento/TestFramework/Utility/ChangedFiles.php b/dev/tests/static/framework/Magento/TestFramework/Utility/ChangedFiles.php index 692297e05f4c014cfa577fb7dd51eb3828348641..b736be8554f372cb5c891648b5b1af9729f45e6d 100644 --- a/dev/tests/static/framework/Magento/TestFramework/Utility/ChangedFiles.php +++ b/dev/tests/static/framework/Magento/TestFramework/Utility/ChangedFiles.php @@ -25,13 +25,38 @@ class ChangedFiles { $fileHelper = \Magento\Framework\App\Utility\Files::init(); if (isset($_ENV['INCREMENTAL_BUILD'])) { - $phpFiles = Files::readLists($changedFilesList); + $phpFiles = []; + foreach (glob($changedFilesList) as $listFile) { + $phpFiles = array_merge($phpFiles, file($listFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES)); + } + array_walk( + $phpFiles, + function (&$file) { + $file = BP . '/' . $file; + } + ); if (!empty($phpFiles)) { $phpFiles = \Magento\Framework\App\Utility\Files::composeDataSets($phpFiles); - $phpFiles = array_intersect_key($phpFiles, $fileHelper->getPhpFiles()); + $phpFiles = array_intersect_key($phpFiles, $fileHelper->getPhpFiles( + Files::INCLUDE_APP_CODE + | Files::INCLUDE_PUB_CODE + | Files::INCLUDE_LIBS + | Files::INCLUDE_TEMPLATES + | Files::INCLUDE_TESTS + | Files::AS_DATA_SET + | Files::INCLUDE_NON_CLASSES + )); } } else { - $phpFiles = $fileHelper->getPhpFiles(); + $phpFiles = $fileHelper->getPhpFiles( + Files::INCLUDE_APP_CODE + | Files::INCLUDE_PUB_CODE + | Files::INCLUDE_LIBS + | Files::INCLUDE_TEMPLATES + | Files::INCLUDE_TESTS + | Files::AS_DATA_SET + | Files::INCLUDE_NON_CLASSES + ); } return $phpFiles; diff --git a/dev/tests/static/framework/Magento/TestFramework/Utility/Validator.php b/dev/tests/static/framework/Magento/TestFramework/Utility/Validator.php deleted file mode 100644 index 3c21a334bfed2d5f5f648947d65422a8c741c8ac..0000000000000000000000000000000000000000 --- a/dev/tests/static/framework/Magento/TestFramework/Utility/Validator.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php -/** - * A helper to validate items such as xml against xsd - * - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\TestFramework\Utility; - -class Validator -{ - /** - * @param \DOMDocument $dom - * @param $schemaFileName - * @return array - */ - public static function validateXml(\DOMDocument $dom, $schemaFileName) - { - libxml_use_internal_errors(true); - $result = $dom->schemaValidate($schemaFileName); - $errors = []; - if (!$result) { - $validationErrors = libxml_get_errors(); - if (count($validationErrors)) { - foreach ($validationErrors as $error) { - $errors[] = "{$error->message} Line: {$error->line}\n"; - } - } else { - $errors[] = 'Unknown validation error'; - } - } - libxml_use_internal_errors(false); - return $errors; - } -} diff --git a/dev/tests/static/framework/bootstrap.php b/dev/tests/static/framework/bootstrap.php index bcd470430b23569007ce42d64e74e08fb031f006..441ed0a79ea25c0815f11fad74bc30d11bae16eb 100644 --- a/dev/tests/static/framework/bootstrap.php +++ b/dev/tests/static/framework/bootstrap.php @@ -4,6 +4,19 @@ * See COPYING.txt for license details. */ +use Magento\Framework\App\Utility\Files; +use Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\DirSearch; +use Magento\Framework\Filesystem\Directory\ReadFactory; +use Magento\Framework\Filesystem\DriverPool; +use Magento\Framework\View\Design\Theme\ThemePackageList; +use Magento\Framework\View\Design\Theme\ThemePackageFactory; + require __DIR__ . '/autoload.php'; -\Magento\Framework\App\Utility\Files::setInstance(new \Magento\Framework\App\Utility\Files(BP)); +$componentRegistrar = new ComponentRegistrar(); +$dirSearch = new DirSearch($componentRegistrar, new ReadFactory(new DriverPool())); +$themePackageList = new ThemePackageList($componentRegistrar, new ThemePackageFactory()); +\Magento\Framework\App\Utility\Files::setInstance( + new Files($componentRegistrar, $dirSearch, $themePackageList) +); diff --git a/dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/Dependency/_files/layout_handle.xml b/dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/Dependency/_files/layout_handle.xml index f9a4f2d874588ed875d1fc29034dcc318d623876..44c4074c9f204d43de44e3d061206f1902d3168a 100644 --- a/dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/Dependency/_files/layout_handle.xml +++ b/dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/Dependency/_files/layout_handle.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_layout.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"> <any_handle_name /> <singlechunk /> <router_name_action /> diff --git a/dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/Dependency/_files/layout_handle_parent.xml b/dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/Dependency/_files/layout_handle_parent.xml index 26f0fb84dc660f2675f697c588b99b66f350c15a..47dc70fba10763aa6a055245ffddb69e1b7b0b55 100644 --- a/dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/Dependency/_files/layout_handle_parent.xml +++ b/dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/Dependency/_files/layout_handle_parent.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_layout.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"> <any_node1 parent="any_handle_name" /> <any_node2 parent="singlechunk" /> <any_node3 parent="router_name_action" /> diff --git a/dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/Dependency/_files/layout_handle_update.xml b/dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/Dependency/_files/layout_handle_update.xml index 9a92eb9dbe08f0d2dfaafda0f28cafafe5aa4302..599c8e9e2b5743a3394d8e1911a79df7233bc698 100644 --- a/dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/Dependency/_files/layout_handle_update.xml +++ b/dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/Dependency/_files/layout_handle_update.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_layout.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"> <update handle="any_handle_name" /> <any_node> <update handle="singlechunk"> diff --git a/dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/Dependency/_files/layout_reference.xml b/dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/Dependency/_files/layout_reference.xml index b9c21290a2a82e96c1e1c38e8f3171bf1301b0e1..562a42f268c52ec9df5a8c34ec77974c9c82dd4c 100644 --- a/dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/Dependency/_files/layout_reference.xml +++ b/dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/Dependency/_files/layout_reference.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_layout.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"> <reference name="any_handle_name" /> <any_node> <reference name="singlechunk" /> diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/App/Language/CircularDependencyTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/App/Language/CircularDependencyTest.php index 088f33221624dc1a738f21102f4e76c1bcba5639..d6e27c159ece816b152d878bc901d7795d4e8f42 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/App/Language/CircularDependencyTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/App/Language/CircularDependencyTest.php @@ -7,6 +7,8 @@ namespace Magento\Test\Integrity\App\Language; use Magento\Framework\App\Language\Config; +use Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Config\Dom\UrnResolver; class CircularDependencyTest extends \PHPUnit_Framework_TestCase { @@ -20,13 +22,12 @@ class CircularDependencyTest extends \PHPUnit_Framework_TestCase */ public function testCircularDependencies() { - $package = new Package(); - $rootDirectory = \Magento\Framework\App\Utility\Files::init()->getPathToSource(); - $declaredLanguages = $package->readDeclarationFiles($rootDirectory); + $componentRegistrar = new ComponentRegistrar(); + $declaredLanguages = $componentRegistrar->getPaths(ComponentRegistrar::LANGUAGE); + $urnResolver = new UrnResolver(); $packs = []; foreach ($declaredLanguages as $language) { - $filePath = reset($language); - $languageConfig = new Config(file_get_contents($filePath)); + $languageConfig = new Config(file_get_contents($language . '/language.xml'), $urnResolver); $this->packs[$languageConfig->getVendor()][$languageConfig->getPackage()] = $languageConfig; $packs[] = $languageConfig; } diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/App/Language/ConfigTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/App/Language/ConfigTest.php index 386ff7df1f2bd8688232f2e73936861c5c7087f2..92b03596d4b3598e350b5669fb7cd25f7e8099f3 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/App/Language/ConfigTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/App/Language/ConfigTest.php @@ -27,7 +27,8 @@ class ConfigTest extends \Magento\TestFramework\Integrity\AbstractConfig */ protected function _getXsd() { - return '/lib/internal/Magento/Framework/App/Language/package.xsd'; + $urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + return $urnResolver->getRealPath('urn:magento:framework:App/Language/package.xsd'); } /** diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/App/Language/Package.php b/dev/tests/static/testsuite/Magento/Test/Integrity/App/Language/Package.php deleted file mode 100644 index 2abde43d1f365e51191c59307250b616102dc59e..0000000000000000000000000000000000000000 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/App/Language/Package.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Test\Integrity\App\Language; - -class Package extends \PHPUnit_Framework_TestCase -{ - /** - * Read all lamguage.xml files and figure out the vendor and language code according from the file structure - * - * @param string $rootDir - * @return array - */ - public static function readDeclarationFiles($rootDir) - { - $result = []; - foreach (glob("{$rootDir}/app/i18n/*/*/language.xml") as $file) { - preg_match('/.+\/(.*)\/(.*)\/language.xml$/', $file, $matches); - $matches[0] = $file; - $result[] = $matches; - } - return $result; - } -} diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/App/Language/PackageTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/App/Language/PackageTest.php deleted file mode 100644 index 1d32fa755a0efc94cd67f10410016aecb7243bc5..0000000000000000000000000000000000000000 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/App/Language/PackageTest.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Test\Integrity\App\Language; - -/** - * A test for language package declaration - */ -class PackageTest extends \PHPUnit_Framework_TestCase -{ - /** - * @param string $file - * @param string $expectedVendor - * @param string $expectedPackage - * @dataProvider declaredConsistentlyDataProvider - */ - public function testDeclaredConsistently($file, $expectedVendor, $expectedPackage) - { - $languageConfig = new \Magento\Framework\App\Language\Config(file_get_contents($file)); - $this->assertEquals($expectedVendor, $languageConfig->getVendor()); - $this->assertEquals($expectedPackage, $languageConfig->getPackage()); - } - - /** - * @return array - */ - public function declaredConsistentlyDataProvider() - { - $result = []; - $root = \Magento\Framework\App\Utility\Files::init()->getPathToSource(); - foreach (Package::readDeclarationFiles($root) as $row) { - $result[] = $row; - } - return $result; - } -} diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/App/Language/TranslationFiles.php b/dev/tests/static/testsuite/Magento/Test/Integrity/App/Language/TranslationFiles.php index 2f1f90d6a22f6794ff7bff88a9628185d8fd0dc2..5d2b0626b4b4b5486b77a6bda0461b43d74c7c3c 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/App/Language/TranslationFiles.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/App/Language/TranslationFiles.php @@ -5,6 +5,7 @@ */ namespace Magento\Test\Integrity\App\Language; +use Magento\Framework\Component\ComponentRegistrar; use Magento\Framework\Filesystem\Driver\File; class TranslationFiles extends \PHPUnit_Framework_TestCase @@ -26,10 +27,11 @@ class TranslationFiles extends \PHPUnit_Framework_TestCase { $pathToSource = \Magento\Framework\App\Utility\Files::init()->getPathToSource(); $places = []; - foreach (glob("{$pathToSource}/app/code/*/*", GLOB_ONLYDIR) as $modulePath) { + $componentRegistrar = new ComponentRegistrar(); + foreach ($componentRegistrar->getPaths(ComponentRegistrar::MODULE) as $modulePath) { $places[basename($modulePath)] = ['placePath' => $modulePath]; } - foreach (glob("{$pathToSource}/app/design/*/*/*", GLOB_ONLYDIR) as $themePath) { + foreach ($componentRegistrar->getPaths(ComponentRegistrar::THEME) as $themePath) { $placeName = basename(dirname(dirname($themePath))) . '_' . basename($themePath); $places[$placeName] = ['placePath' => $themePath]; } diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/App/Language/TranslationFilesTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/App/Language/TranslationFilesTest.php index 241dbc1ca02848e19b0bcb3044aca7d37c35f2e1..b5409544a60cd86f1fe8d0c970ca6ae468ec34c1 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/App/Language/TranslationFilesTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/App/Language/TranslationFilesTest.php @@ -6,6 +6,7 @@ namespace Magento\Test\Integrity\App\Language; use Magento\Framework\App\Utility\Files; +use Magento\Framework\Component\ComponentRegistrar; use Magento\Setup\Module\I18n\Dictionary\Options\ResolverFactory; use Magento\Setup\Module\I18n\Locale; use Magento\Setup\Module\I18n\Pack\Writer\File\Csv; @@ -89,7 +90,7 @@ class TranslationFilesTest extends TranslationFiles protected function getContext() { if ($this->context === null) { - $this->context = new \Magento\Setup\Module\I18n\Context(); + $this->context = new \Magento\Setup\Module\I18n\Context(new ComponentRegistrar()); } return $this->context; } @@ -114,7 +115,7 @@ class TranslationFilesTest extends TranslationFiles $parserContextual = new \Magento\Setup\Module\I18n\Parser\Contextual( $filesCollector, new \Magento\Setup\Module\I18n\Factory(), - new \Magento\Setup\Module\I18n\Context() + new \Magento\Setup\Module\I18n\Context(new ComponentRegistrar()) ); foreach ($adapters as $type => $adapter) { $parserContextual->addAdapter($type, $adapter); diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/App/Language/_files/known_invalid.xml b/dev/tests/static/testsuite/Magento/Test/Integrity/App/Language/_files/known_invalid.xml index 8b20ea388e8a98488979664ec58fd877322ce8cd..be5388b2959259ebe40a82442a6d39a49c7561b2 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/App/Language/_files/known_invalid.xml +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/App/Language/_files/known_invalid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/App/Language/package.xsd"> +<language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/Language/package.xsd"> <code>e_GB</code> <vendor>Magento</vendor> <sort_odrer>100</sort_odrer> diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/App/Language/_files/known_valid.xml b/dev/tests/static/testsuite/Magento/Test/Integrity/App/Language/_files/known_valid.xml index 54dc3c167fffbf118dfcf0bdf45bd634a171926f..d57e77e60a93ce20d9e3b5ea9dd10921dc9b27fa 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/App/Language/_files/known_valid.xml +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/App/Language/_files/known_valid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/App/Language/package.xsd"> +<language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/Language/package.xsd"> <code>en_GB</code> <vendor>magento</vendor> <package>en_gb</package> diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/ClassesTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/ClassesTest.php index 4d71213a26c984e3610af55945bc4bc8ec827a01..9142d815ab7d2dde502bdfe78958155efa3a9737 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/ClassesTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/ClassesTest.php @@ -8,6 +8,8 @@ namespace Magento\Test\Integrity; use Magento\Framework\App\Utility\Classes; +use Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\App\Utility\Files; class ClassesTest extends \PHPUnit_Framework_TestCase { @@ -71,7 +73,14 @@ class ClassesTest extends \PHPUnit_Framework_TestCase $this->_assertClassesExist($classes, $file); }, - \Magento\Framework\App\Utility\Files::init()->getPhpFiles(true, true, true, true, false) + Files::init()->getPhpFiles( + Files::INCLUDE_APP_CODE + | Files::INCLUDE_PUB_CODE + | Files::INCLUDE_LIBS + | Files::INCLUDE_TEMPLATES + | Files::AS_DATA_SET + | Files::INCLUDE_NON_CLASSES + ) ); } @@ -101,7 +110,7 @@ class ClassesTest extends \PHPUnit_Framework_TestCase $classes = Classes::collectClassesInConfig(simplexml_load_file($path)); $this->_assertClassesExist($classes, $path); }, - \Magento\Framework\App\Utility\Files::init()->getMainConfigFiles() + Files::init()->getMainConfigFiles() ); } @@ -138,7 +147,7 @@ class ClassesTest extends \PHPUnit_Framework_TestCase $this->_assertClassesExist(array_unique($classes), $path); }, - \Magento\Framework\App\Utility\Files::init()->getLayoutFiles() + Files::init()->getLayoutFiles() ); } @@ -168,7 +177,7 @@ class ClassesTest extends \PHPUnit_Framework_TestCase $this->assertTrue( isset( self::$_existingClasses[$class] - ) || \Magento\Framework\App\Utility\Files::init()->classFileExists( + ) || Files::init()->classFileExists( $class ) || Classes::isVirtual( $class @@ -201,13 +210,12 @@ class ClassesTest extends \PHPUnit_Framework_TestCase */ function ($file) { $relativePath = str_replace( - \Magento\Framework\App\Utility\Files::init()->getPathToSource() . "/", + Files::init()->getPathToSource() . "/", "", $file ); - // exceptions made for the files from the blacklist - self::_setNamespaceBlackList(); - if (in_array($relativePath, self::$_namespaceBlacklist)) { + // exceptions made for fixture files from tests + if (strpos($relativePath, '/_files/') !== false) { return; } @@ -227,36 +235,10 @@ class ClassesTest extends \PHPUnit_Framework_TestCase $className = array_pop($classParts); $this->_assertClassNamespace($file, $relativePath, $contents, $className); }, - \Magento\Framework\App\Utility\Files::init()->getClassFiles() + Files::init()->getPhpFiles() ); } - protected function _setNamespaceBlackList() - { - if (!isset(self::$_namespaceBlacklist)) { - $blackList = []; - foreach (glob(__DIR__ . '/_files/blacklist/namespace.txt') as $list) { - $fileList = file($list, FILE_IGNORE_NEW_LINES); - foreach ($fileList as $currentFile) { - $absolutePath = \Magento\Framework\App\Utility\Files::init()->getPathToSource() . - '/' . - $currentFile; - if (is_dir($absolutePath)) { - $recursiveFiles = \Magento\Framework\App\Utility\Files::getFiles( - [$absolutePath], - '*.php', - true - ); - $blackList = array_merge($blackList, $recursiveFiles); - } else { - array_push($blackList, $currentFile); - } - } - } - self::$_namespaceBlacklist = $blackList; - } - } - /** * Assert PHP classes have valid formal namespaces according to file locations * @@ -310,7 +292,7 @@ class ClassesTest extends \PHPUnit_Framework_TestCase */ function ($file) { $relativePath = str_replace( - \Magento\Framework\App\Utility\Files::init()->getPathToSource(), + Files::init()->getPathToSource(), "", $file ); @@ -392,7 +374,7 @@ class ClassesTest extends \PHPUnit_Framework_TestCase $badClasses = $this->removeSpecialCases($badClasses, $file, $contents, $namespacePath); $this->_assertClassReferences($badClasses, $file); }, - \Magento\Framework\App\Utility\Files::init()->getClassFiles() + Files::init()->getPhpFiles() ); } @@ -441,9 +423,11 @@ class ClassesTest extends \PHPUnit_Framework_TestCase /** * This function is to remove special cases (if any) from the list of found bad classes + * * @param array $badClasses * @param string $file * @param string $contents + * @param string $namespacePath * @return array */ protected function removeSpecialCases($badClasses, $file, $contents, $namespacePath) @@ -453,11 +437,13 @@ class ClassesTest extends \PHPUnit_Framework_TestCase // for example: 'Magento_Sales::actions_edit' if (preg_match('/Magento_[A-Z0-9][a-z0-9]*/', $badClass)) { unset($badClasses[array_search($badClass, $badClasses)]); + continue; } // Remove usage of key words such as "Array", "String", and "Boolean" if (in_array($badClass, self::$_keywordsBlacklist)) { unset($badClasses[array_search($badClass, $badClasses)]); + continue; } $classParts = explode('/', $file); @@ -465,42 +451,17 @@ class ClassesTest extends \PHPUnit_Framework_TestCase // Remove usage of the class itself from the list if ($badClass . '.php' == $className) { unset($badClasses[array_search($badClass, $badClasses)]); + continue; } - // Remove usage of classes that do NOT using fully-qualified class names (possibly under same namespace) - $directories = [ - '/app/code/', - '/lib/internal/', - '/dev/tools/', - '/dev/tests/api-functional/framework/', - '/dev/tests/functional/', - '/dev/tests/integration/framework/', - '/dev/tests/integration/framework/tests/unit/testsuite/', - '/dev/tests/integration/testsuite/', - '/dev/tests/integration/testsuite/Magento/Test/Integrity/', - '/dev/tests/static/framework/', - '/dev/tests/static/testsuite/', - '/setup/src/', - ]; - // Full list of directories where there may be namespace classes - foreach ($directories as $directory) { - $fullPath = \Magento\Framework\App\Utility\Files::init()->getPathToSource() . - $directory . - $namespacePath . - '/' . - str_replace( - '\\', - '/', - $badClass - ) . '.php'; - if (file_exists($fullPath)) { - unset($badClasses[array_search($badClass, $badClasses)]); - break; - } + if ($this->removeSpecialCasesNonFullyQualifiedClassNames($namespacePath, $badClasses, $badClass)) { + continue; } + $referenceFile = implode('/', $classParts) . '/' . str_replace('\\', '/', $badClass) . '.php'; if (file_exists($referenceFile)) { unset($badClasses[array_search($badClass, $badClasses)]); + continue; } // Remove usage of classes that have been declared as "use" or "include" @@ -508,11 +469,142 @@ class ClassesTest extends \PHPUnit_Framework_TestCase // (continued) where there is a comma separating two different classes. if (preg_match('/use\s.*[\\n]?.*' . str_replace('\\', '\\\\', $badClass) . '[\,\;]/', $contents)) { unset($badClasses[array_search($badClass, $badClasses)]); + continue; } } return $badClasses; } + /** + * Helper class for removeSpecialCases to remove classes that do not use fully-qualified class names + * + * @param string $namespacePath + * @param array $badClasses + * @param string $badClass + * @return bool + * @throws \Exception + */ + private function removeSpecialCasesNonFullyQualifiedClassNames($namespacePath, &$badClasses, $badClass) + { + $componentRegistrar = new ComponentRegistrar(); + $namespaceParts = explode('/', $namespacePath); + $moduleDir = null; + if (isset($namespaceParts[1])) { + $moduleName = array_shift($namespaceParts) . '_' . array_shift($namespaceParts); + $moduleDir = $componentRegistrar->getPath(ComponentRegistrar::MODULE, $moduleName); + } + if ($moduleDir) { + $fullPath = $moduleDir . '/' . implode('/', $namespaceParts) . '/' . + str_replace('\\', '/', $badClass) . '.php'; + + if (file_exists($fullPath)) { + unset($badClasses[array_search($badClass, $badClasses)]); + return true; + } + } + + $fullPath = $this->getLibraryDirByPath($namespacePath, $badClass); + + if ($fullPath && file_exists($fullPath)) { + unset($badClasses[array_search($badClass, $badClasses)]); + return true; + } else { + return $this->removeSpecialCasesForAllOthers($componentRegistrar, $namespacePath, $badClass, $badClasses); + } + } + + /** + * Get path to the file in the library based on namespace path + * + * @param string $namespacePath + * @param string $badClass + * @return null|string + */ + protected function getLibraryDirByPath($namespacePath, $badClass) + { + $libraryDir = null; + $fullPath = null; + $componentRegistrar = new ComponentRegistrar(); + $namespaceParts = explode('/', $namespacePath); + if (isset($namespaceParts[1]) && $namespaceParts[1]) { + $vendor = array_shift($namespaceParts); + $lib = array_shift($namespaceParts); + if ($lib == 'framework') { + $subLib = $namespaceParts[0]; + $subLib = strtolower(preg_replace('/(.)([A-Z])/', "$1-$2", $subLib)); + $libraryName = $vendor . '/' . $lib . '-' . $subLib; + $libraryDir = $componentRegistrar->getPath(ComponentRegistrar::LIBRARY, strtolower($libraryName)); + if ($libraryDir) { + array_shift($namespaceParts); + } else { + $libraryName = $vendor . '/' . $lib; + $libraryDir = $componentRegistrar->getPath(ComponentRegistrar::LIBRARY, strtolower($libraryName)); + } + } else { + $lib = strtolower(preg_replace('/(.)([A-Z])/', "$1-$2", $lib)); + $libraryName = $vendor . '/' . $lib; + $libraryDir = $componentRegistrar->getPath(ComponentRegistrar::LIBRARY, strtolower($libraryName)); + } + } + if ($libraryDir) { + $fullPath = $libraryDir . '/' . implode('/', $namespaceParts) . '/' . + str_replace('\\', '/', $badClass) . '.php'; + } + return $fullPath; + } + + /** + * @param ComponentRegistrar $componentRegistrar + * @param string $namespacePath + * @param string $badClass + * @param array $badClasses + * @return bool + */ + private function removeSpecialCasesForAllOthers($componentRegistrar, $namespacePath, $badClass, &$badClasses) + { + // Remove usage of classes that do NOT using fully-qualified class names (possibly under same namespace) + $directories = [ + '/dev/tools/', + '/dev/tests/api-functional/framework/', + '/dev/tests/functional/', + '/dev/tests/integration/framework/', + '/dev/tests/integration/framework/tests/unit/testsuite/', + '/dev/tests/integration/testsuite/', + '/dev/tests/integration/testsuite/Magento/Test/Integrity/', + '/dev/tests/static/framework/', + '/dev/tests/static/testsuite/', + '/setup/src/', + ]; + $pathToSource = Files::init()->getPathToSource(); + $libraryPaths = $this->getLibraryPaths($componentRegistrar, $pathToSource); + $directories = array_merge($directories, $libraryPaths); + // Full list of directories where there may be namespace classes + foreach ($directories as $directory) { + $fullPath = $pathToSource . $directory . $namespacePath . '/' . str_replace('\\', '/', $badClass) . '.php'; + if (file_exists($fullPath)) { + unset($badClasses[array_search($badClass, $badClasses)]); + return true; + } + } + } + + /** + * @param ComponentRegistrar $componentRegistrar + * @param string $pathToSource + * @return array + */ + private function getLibraryPaths($componentRegistrar, $pathToSource) + { + $libraryPaths = $componentRegistrar->getPaths(ComponentRegistrar::LIBRARY); + foreach ($libraryPaths as $key => $libraryPath) { + $libraryPath = str_replace($pathToSource, '', $libraryPath); + $partsOfLibraryPath = explode('/', $libraryPath); + $libraryPaths[$key] = implode('/', array_slice($partsOfLibraryPath, 0, sizeof($partsOfLibraryPath)-2)); + $libraryPaths[$key] .= '/'; + } + return $libraryPaths; + } + /** * Assert any found class name resolves into a file name and corresponds to an existing file * @@ -529,7 +621,7 @@ class ClassesTest extends \PHPUnit_Framework_TestCase public function testCoversAnnotation() { - $files = \Magento\Framework\App\Utility\Files::init(); + $files = Files::init(); $errors = []; foreach ($files->getFiles([BP . '/dev/tests/{integration,unit}'], '*') as $file) { $code = file_get_contents($file); diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/ComposerTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/ComposerTest.php index 3172567568e0e3c45cb6bfbfbfe02d1455c3f8d7..815ce953c3176818c24dfd27314e49d5e8e497de 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/ComposerTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/ComposerTest.php @@ -5,6 +5,7 @@ */ namespace Magento\Test\Integrity; +use Magento\Framework\Component\ComponentRegistrar; use Magento\Framework\Composer\MagentoComponent; use Magento\Framework\App\Utility\Files; use Magento\Framework\Shell; @@ -66,10 +67,9 @@ class ComposerTest extends \PHPUnit_Framework_TestCase * @param string $packageType */ function ($dir, $packageType) { - $this->assertComposerAvailable(); $file = $dir . '/composer.json'; $this->assertFileExists($file); - self::$shell->execute(self::$composerPath . ' validate --working-dir=%s', [$dir]); + $this->validateComposerJsonFile($dir); $contents = file_get_contents($file); $json = json_decode($contents); $this->assertCodingStyle($contents); @@ -85,20 +85,18 @@ class ComposerTest extends \PHPUnit_Framework_TestCase public function validateComposerJsonDataProvider() { $root = \Magento\Framework\App\Utility\Files::init()->getPathToSource(); + $componentRegistrar = new ComponentRegistrar(); $result = []; - foreach (glob("{$root}/app/code/Magento/*", GLOB_ONLYDIR) as $dir) { + foreach ($componentRegistrar->getPaths(ComponentRegistrar::MODULE) as $dir) { $result[$dir] = [$dir, 'magento2-module']; } - foreach (glob("{$root}/app/i18n/magento/*", GLOB_ONLYDIR) as $dir) { + foreach ($componentRegistrar->getPaths(ComponentRegistrar::LANGUAGE) as $dir) { $result[$dir] = [$dir, 'magento2-language']; } - foreach (glob("{$root}/app/design/adminhtml/Magento/*", GLOB_ONLYDIR) as $dir) { + foreach ($componentRegistrar->getPaths(ComponentRegistrar::THEME) as $dir) { $result[$dir] = [$dir, 'magento2-theme']; } - foreach (glob("{$root}/app/design/frontend/Magento/*", GLOB_ONLYDIR) as $dir) { - $result[$dir] = [$dir, 'magento2-theme']; - } - foreach (glob("{$root}/lib/internal/Magento/*", GLOB_ONLYDIR) as $dir) { + foreach ($componentRegistrar->getPaths(ComponentRegistrar::LIBRARY) as $dir) { $result[$dir] = [$dir, 'magento2-library']; } $result[$root] = [$root, 'project']; @@ -106,6 +104,18 @@ class ComposerTest extends \PHPUnit_Framework_TestCase return $result; } + /** + * Validate a composer.json under the given path + * + * @param string $path path to composer.json + */ + private function validateComposerJsonFile($path) + { + if (self::$isComposerAvailable) { + self::$shell->execute(self::$composerPath . ' validate --working-dir=%s', [$path]); + } + } + /** * Some of coding style conventions * @@ -136,8 +146,8 @@ class ComposerTest extends \PHPUnit_Framework_TestCase $this->assertEquals($packageType, $json->type); if ($packageType !== 'project') { self::$dependencies[] = $json->name; - $this->assertHasMap($json); - $this->assertMapConsistent($dir, $json); + $this->assertAutoloadRegistrar($json, $dir); + $this->assertNoMap($json); } switch ($packageType) { case 'magento2-module': @@ -145,49 +155,28 @@ class ComposerTest extends \PHPUnit_Framework_TestCase $this->assertConsistentModuleName($xml, $json->name); $this->assertDependsOnPhp($json->require); $this->assertDependsOnFramework($json->require); - $this->assertDependsOnInstaller($json->require); $this->assertRequireInSync($json); + $this->assertAutoload($json); break; case 'magento2-language': $this->assertRegExp('/^magento\/language\-[a-z]{2}_([a-z]{4}_)?[a-z]{2}$/', $json->name); $this->assertDependsOnFramework($json->require); - $this->assertDependsOnInstaller($json->require); $this->assertRequireInSync($json); break; case 'magento2-theme': $this->assertRegExp('/^magento\/theme-(?:adminhtml|frontend)(\-[a-z0-9_]+)+$/', $json->name); $this->assertDependsOnPhp($json->require); $this->assertDependsOnFramework($json->require); - $this->assertDependsOnInstaller($json->require); $this->assertRequireInSync($json); break; case 'magento2-library': $this->assertDependsOnPhp($json->require); - $this->assertRegExp('/^magento\/framework$/', $json->name); - $this->assertDependsOnInstaller($json->require); + $this->assertRegExp('/^magento\/framework*/', $json->name); $this->assertRequireInSync($json); + $this->assertAutoload($json); break; case 'project': - sort(self::$dependencies); - $dependenciesListed = []; - foreach (array_keys((array)self::$rootJson['replace']) as $key) { - if (MagentoComponent::matchMagentoComponent($key)) { - $dependenciesListed[] = $key; - } - } - sort($dependenciesListed); - $nonDeclaredDependencies = array_diff(self::$dependencies, $dependenciesListed); - $nonexistentDependencies = array_diff($dependenciesListed, self::$dependencies); - $this->assertEmpty( - $nonDeclaredDependencies, - 'Following dependencies are not declared in the root composer.json: ' - . join(', ', $nonDeclaredDependencies) - ); - $this->assertEmpty( - $nonexistentDependencies, - 'Following dependencies declared in the root composer.json do not exist: ' - . join(', ', $nonexistentDependencies) - ); + $this->checkProject(); break; default: throw new \InvalidArgumentException("Unknown package type {$packageType}"); @@ -195,36 +184,41 @@ class ComposerTest extends \PHPUnit_Framework_TestCase } /** - * Assert that there is map in specified composer json + * Assert that component registrar is autoloaded in composer json * * @param \StdClass $json + * @param string $dir */ - private function assertHasMap(\StdClass $json) + private function assertAutoloadRegistrar(\StdClass $json, $dir) { - $error = 'There must be an "extra->map" node in composer.json of each Magento component.'; - $this->assertObjectHasAttribute('extra', $json, $error); - $this->assertObjectHasAttribute('map', $json->extra, $error); - $this->assertInternalType('array', $json->extra->map, $error); + $error = 'There must be an "autoload->files" node in composer.json of each Magento component.'; + $this->assertObjectHasAttribute('autoload', $json, $error); + $this->assertObjectHasAttribute('files', $json->autoload, $error); + $this->assertEquals([ "registration.php" ], $json->autoload->files, $error); + $this->assertFileExists("$dir/registration.php"); } /** - * Assert that component directory name and mapping information are consistent + * Assert that there is PSR-4 autoload in composer json * - * @param string $dir * @param \StdClass $json */ - private function assertMapConsistent($dir, $json) + private function assertAutoload(\StdClass $json) { - preg_match('/^.+\/(.+)\/(.+)$/', $dir, $matches); - list(, $vendor, $name) = $matches; - $map = $json->extra->map; - $this->assertArrayHasKey(0, $map); - $this->assertArrayHasKey(1, $map[0]); - $this->assertRegExp( - "/{$vendor}\\/{$name}$/", - $map[0][1], - 'Mapping info is inconsistent with the directory structure' - ); + $errorMessage = 'There must be an "autoload->psr-4" section in composer.json of each Magento component.'; + $this->assertObjectHasAttribute('autoload', $json, $errorMessage); + $this->assertObjectHasAttribute('psr-4', $json->autoload, $errorMessage); + } + + /** + * Assert that there is map in specified composer json + * + * @param \StdClass $json + */ + private function assertNoMap(\StdClass $json) + { + $error = 'There is no "extra->map" node in composer.json of each Magento component.'; + $this->assertObjectNotHasAttribute('extra', $json, $error); } /** @@ -267,20 +261,6 @@ class ComposerTest extends \PHPUnit_Framework_TestCase ); } - /** - * Make sure a component depends on Magento Composer Installer component - * - * @param \StdClass $json - */ - private function assertDependsOnInstaller(\StdClass $json) - { - $this->assertObjectHasAttribute( - 'magento/magento-composer-installer', - $json, - 'This component is expected to depend on magento/magento-composer-installer' - ); - } - /** * Assert that versions in root composer.json and Magento component's composer.json are not out of sync * @@ -305,6 +285,9 @@ class ComposerTest extends \PHPUnit_Framework_TestCase private function assertRequireInSync(\StdClass $json) { $name = $json->name; + if (preg_match('/magento\/project-*/', self::$rootJson['name']) == 1) { + return; + } if (isset($json->require)) { $errors = []; foreach (array_keys((array)$json->require) as $depName) { @@ -371,16 +354,6 @@ class ComposerTest extends \PHPUnit_Framework_TestCase return true; } - /** - * Skip the test if composer is unavailable - */ - private function assertComposerAvailable() - { - if (!self::$isComposerAvailable) { - $this->markTestSkipped(); - } - } - public function testComponentPathsInRoot() { if (!isset(self::$rootJson['extra']) || !isset(self::$rootJson['extra']['component_paths'])) { @@ -436,4 +409,38 @@ class ComposerTest extends \PHPUnit_Framework_TestCase return $flat; } + + /** + * @return void + */ + private function checkProject() + { + sort(self::$dependencies); + $dependenciesListed = []; + if (strpos(self::$rootJson['name'], 'magento/project-') !== 0) { + $this->assertArrayHasKey( + 'replace', + (array)self::$rootJson, + 'No "replace" section found in root composer.json' + ); + foreach (array_keys((array)self::$rootJson['replace']) as $key) { + if (MagentoComponent::matchMagentoComponent($key)) { + $dependenciesListed[] = $key; + } + } + sort($dependenciesListed); + $nonDeclaredDependencies = array_diff(self::$dependencies, $dependenciesListed); + $nonexistentDependencies = array_diff($dependenciesListed, self::$dependencies); + $this->assertEmpty( + $nonDeclaredDependencies, + 'Following dependencies are not declared in the root composer.json: ' + . join(', ', $nonDeclaredDependencies) + ); + $this->assertEmpty( + $nonexistentDependencies, + 'Following dependencies declared in the root composer.json do not exist: ' + . join(', ', $nonexistentDependencies) + ); + } + } } diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/ConfigTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/ConfigTest.php index 6b439124a3238ac31ad21fa1e2b341c3c0be460a..95633cbf9d75d37ec08a8d2ba921e1f7593a3a9d 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/ConfigTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/ConfigTest.php @@ -51,12 +51,14 @@ class ConfigTest extends \PHPUnit_Framework_TestCase */ protected function _getConfigFilesPerModule() { - $configFiles = \Magento\Framework\App\Utility\Files::init()->getConfigFiles('config.xml', [], false); $data = []; - foreach ($configFiles as $configFile) { - preg_match('#/([^/]+?/[^/]+?)/etc/config\.xml$#', $configFile, $moduleName); - $moduleName = str_replace('/', '_', $moduleName[1]); - $data[$configFile] = $moduleName; + $componentRegistrar = new \Magento\Framework\Component\ComponentRegistrar(); + $modulesPaths = $componentRegistrar->getPaths(\Magento\Framework\Component\ComponentRegistrar::MODULE); + + foreach ($modulesPaths as $moduleName => $path) { + if (file_exists($configFile = $path . '/etc/config.xml')) { + $data[$configFile] = $moduleName; + } } return $data; } diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/DependencyTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/DependencyTest.php index 834e90911948bcba3d3ecc1a6dd945fbd9ef8988..673a6ffe87b94e742e42efb28053e690fffae348 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/DependencyTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/DependencyTest.php @@ -8,6 +8,9 @@ */ namespace Magento\Test\Integrity; +use Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\App\Utility\Files; + /** * @SuppressWarnings(PHPMD.ExcessiveClassComplexity) */ @@ -128,12 +131,29 @@ class DependencyTest extends \PHPUnit_Framework_TestCase */ protected static $_rulesInstances = []; + /** + * White list for libraries + * + * @var array + */ + private static $whiteList = []; + /** * Sets up data */ public static function setUpBeforeClass() { - self::$_namespaces = implode('|', \Magento\Framework\App\Utility\Files::init()->getNamespaces()); + $root = Files::init()->getPathToSource(); + $rootJson = json_decode(file_get_contents($root . '/composer.json'), true); + if (preg_match('/magento\/project-*/', $rootJson['name']) == 1) { + + // The Dependency test is skipped for vendor/magento build + self::markTestSkipped( + 'MAGETWO-43654: The build is running from vendor/magento. DependencyTest is skipped.' + ); + } + + self::$_namespaces = implode('|', Files::init()->getNamespaces()); self::_prepareListConfigXml(); self::_prepareListRoutesXml(); @@ -142,11 +162,28 @@ class DependencyTest extends \PHPUnit_Framework_TestCase self::_prepareMapLayoutBlocks(); self::_prepareMapLayoutHandles(); + self::getLibraryWhiteLists(); + self::_initDependencies(); self::_initThemes(); self::_initRules(); } + /** + * Initialize library white list + */ + private static function getLibraryWhiteLists() + { + $componentRegistrar = new ComponentRegistrar(); + foreach ($componentRegistrar->getPaths(ComponentRegistrar::LIBRARY) as $library) { + $library = str_replace('\\', '/', $library); + if (strpos($library, 'Framework/')) { + $partOfLibraryPath = explode('/', $library); + self::$whiteList[] = implode('\\', array_slice($partOfLibraryPath, -3)); + } + } + } + /** * Initialize default themes */ @@ -240,20 +277,24 @@ class DependencyTest extends \PHPUnit_Framework_TestCase $filename = self::_getRelativeFilename($file); $isThemeFile = (bool)preg_match(self::$_defaultThemes, $filename); - if (strpos($file, 'app/code') === false && !$isThemeFile) { - return; + $componentRegistrar = new ComponentRegistrar(); + $foundModuleName = ''; + if (!$isThemeFile) { + foreach ($componentRegistrar->getPaths(ComponentRegistrar::MODULE) as $moduleName => $moduleDir) { + if (strpos($file, $moduleDir . '/') !== false) { + $foundModuleName = str_replace('_', '\\', $moduleName); + break; + } + } + if (empty($foundModuleName)) { + return; + } } - $module = $this->_getModuleName($file); + $module = $foundModuleName; $contents = $this->_getCleanedFileContents($fileType, $file); - // Apply rules - $dependencies = []; - foreach (self::$_rulesInstances as $rule) { - /** @var \Magento\TestFramework\Dependency\RuleInterface $rule */ - $newDependencies = $rule->getDependencyInfo($module, $fileType, $file, $contents); - $dependencies = array_merge($dependencies, $newDependencies); - } + $dependencies = $this->getDependenciesFromFiles($module, $fileType, $file, $contents); // Collect dependencies $undeclaredDependency = $this->_collectDependencies($module, $dependencies); @@ -275,6 +316,35 @@ class DependencyTest extends \PHPUnit_Framework_TestCase ); } + /** + * Retrieve dependencies from files + * + * @param string $module + * @param string $fileType + * @param string $file + * @param string $contents + * @return string[] + */ + protected function getDependenciesFromFiles($module, $fileType, $file, $contents) + { + // Apply rules + $dependencies = []; + foreach (self::$_rulesInstances as $rule) { + /** @var \Magento\TestFramework\Dependency\RuleInterface $rule */ + $newDependencies = $rule->getDependencyInfo($module, $fileType, $file, $contents); + $dependencies = array_merge($dependencies, $newDependencies); + } + foreach ($dependencies as $key => $dependency) { + foreach (self::$whiteList as $namespace) { + if (strpos($dependency['source'], $namespace) !== false) { + $dependency['module'] = $namespace; + $dependencies[$key] = $dependency; + } + } + } + return $dependencies; + } + /** * Collect dependencies * @@ -373,26 +443,11 @@ class DependencyTest extends \PHPUnit_Framework_TestCase */ protected static function _getRelativeFilename($absoluteFilename) { - $pathToSource = \Magento\Framework\App\Utility\Files::init()->getPathToSource(); + $pathToSource = Files::init()->getPathToSource(); $relativeFileName = str_replace($pathToSource, '', $absoluteFilename); return trim(str_replace('\\', '/', $relativeFileName), '/'); } - /** - * Extract module name from file path - * - * @param $absoluteFilename - * @return string - */ - protected function _getModuleName($absoluteFilename) - { - $file = self::_getRelativeFilename($absoluteFilename); - if (preg_match('/\/(?<namespace>' . self::$_namespaces . ')[\/_\\\\]?(?<module>[^\/]+)\//', $file, $matches)) { - return $matches['namespace'] . '\\' . $matches['module']; - } - return ''; - } - /** * Convert file list to data provider structure * @@ -428,7 +483,7 @@ class DependencyTest extends \PHPUnit_Framework_TestCase $files, $this->_prepareFiles( 'php', - \Magento\Framework\App\Utility\Files::init()->getPhpFiles(true, false, false, true, false), + Files::init()->getPhpFiles(Files::INCLUDE_APP_CODE | Files::AS_DATA_SET | Files::INCLUDE_NON_CLASSES), true ) ); @@ -436,19 +491,19 @@ class DependencyTest extends \PHPUnit_Framework_TestCase // Get all configuration files $files = array_merge( $files, - $this->_prepareFiles('config', \Magento\Framework\App\Utility\Files::init()->getConfigFiles()) + $this->_prepareFiles('config', Files::init()->getConfigFiles()) ); //Get all layout updates files $files = array_merge( $files, - $this->_prepareFiles('layout', \Magento\Framework\App\Utility\Files::init()->getLayoutFiles()) + $this->_prepareFiles('layout', Files::init()->getLayoutFiles()) ); // Get all template files $files = array_merge( $files, - $this->_prepareFiles('template', \Magento\Framework\App\Utility\Files::init()->getPhtmlFiles()) + $this->_prepareFiles('template', Files::init()->getPhtmlFiles()) ); return $files; @@ -459,7 +514,7 @@ class DependencyTest extends \PHPUnit_Framework_TestCase */ protected static function _prepareListConfigXml() { - $files = \Magento\Framework\App\Utility\Files::init()->getConfigFiles('config.xml', [], false); + $files = Files::init()->getConfigFiles('config.xml', [], false); foreach ($files as $file) { if (preg_match('/(?<namespace>[A-Z][a-z]+)[_\/\\\\](?<module>[A-Z][a-zA-Z]+)/', $file, $matches)) { $module = $matches['namespace'] . '\\' . $matches['module']; @@ -473,7 +528,7 @@ class DependencyTest extends \PHPUnit_Framework_TestCase */ protected static function _prepareListRoutesXml() { - $files = \Magento\Framework\App\Utility\Files::init()->getConfigFiles('*/routes.xml', [], false); + $files = Files::init()->getConfigFiles('*/routes.xml', [], false); foreach ($files as $file) { if (preg_match('/(?<namespace>[A-Z][a-z]+)[_\/\\\\](?<module>[A-Z][a-zA-Z]+)/', $file, $matches)) { $module = $matches['namespace'] . '\\' . $matches['module']; @@ -490,7 +545,7 @@ class DependencyTest extends \PHPUnit_Framework_TestCase $pattern = '/(?<namespace>[A-Z][a-z]+)[_\/\\\\](?<module>[A-Z][a-zA-Z]+)\/Controller\/' . '(?<path>[\/\w]*).php/'; - $files = \Magento\Framework\App\Utility\Files::init()->getPhpFiles(true, false, false, false, false); + $files = Files::init()->getPhpFiles(Files::INCLUDE_APP_CODE | Files::INCLUDE_NON_CLASSES); foreach ($files as $file) { if (preg_match($pattern, $file, $matches)) { $module = $matches['namespace'] . '\\' . $matches['module']; @@ -536,7 +591,7 @@ class DependencyTest extends \PHPUnit_Framework_TestCase */ protected static function _prepareMapLayoutBlocks() { - $files = \Magento\Framework\App\Utility\Files::init()->getLayoutFiles([], false); + $files = Files::init()->getLayoutFiles([], false); foreach ($files as $file) { $area = 'default'; if (preg_match('/[\/](?<area>adminhtml|frontend)[\/]/', $file, $matches)) { @@ -564,7 +619,7 @@ class DependencyTest extends \PHPUnit_Framework_TestCase */ protected static function _prepareMapLayoutHandles() { - $files = \Magento\Framework\App\Utility\Files::init()->getLayoutFiles([], false); + $files = Files::init()->getLayoutFiles([], false); foreach ($files as $file) { $area = 'default'; if (preg_match('/\/(?<area>adminhtml|frontend)\//', $file, $matches)) { @@ -612,6 +667,7 @@ class DependencyTest extends \PHPUnit_Framework_TestCase return $moduleName; } elseif (strpos($jsonName, 'magento/magento') !== false || strpos($jsonName, 'magento/framework') !== false) { $moduleName = str_replace('/', "\t", $jsonName); + $moduleName = str_replace('framework-', "Framework\t", $moduleName); $moduleName = str_replace('-', ' ', $moduleName); $moduleName = ucwords($moduleName); $moduleName = str_replace("\t", '\\', $moduleName); @@ -629,7 +685,7 @@ class DependencyTest extends \PHPUnit_Framework_TestCase */ protected static function _initDependencies() { - $jsonFiles = \Magento\Framework\App\Utility\Files::init()->getComposerFiles('code/Magento/*/', false); + $jsonFiles = Files::init()->getComposerFiles(ComponentRegistrar::MODULE, false); foreach ($jsonFiles as $file) { $contents = file_get_contents($file); $decodedJson = json_decode($contents); 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 273295098e3af99db4043f7559d9c0ba4432f5e1..3678497fafab1ed0dac8d01cfe5ac0058c2425da 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Di/CompilerTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Di/CompilerTest.php @@ -14,6 +14,7 @@ use Magento\Framework\ObjectManager\Code\Generator\Factory; use Magento\Framework\ObjectManager\Code\Generator\Repository; use Magento\Framework\Api\Code\Generator\ExtensionAttributesInterfaceGenerator; use Magento\Framework\Api\Code\Generator\ExtensionAttributesGenerator; +use Magento\Framework\App\Utility\Files; /** * @SuppressWarnings(PHPMD.CouplingBetweenObjects) @@ -65,7 +66,7 @@ class CompilerTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_shell = new \Magento\Framework\Shell(new \Magento\Framework\Shell\CommandRenderer()); - $basePath = \Magento\Framework\App\Utility\Files::init()->getPathToSource(); + $basePath = Files::init()->getPathToSource(); $basePath = str_replace('\\', '/', $basePath); @@ -194,19 +195,13 @@ class CompilerTest extends \PHPUnit_Framework_TestCase */ protected function _phpClassesDataProvider() { - $basePath = \Magento\Framework\App\Utility\Files::init()->getPathToSource(); + $basePath = Files::init()->getPathToSource(); $libPath = 'lib\\internal'; $appPath = 'app\\code'; $generationPathPath = str_replace('/', '\\', str_replace($basePath . '/', '', $this->_generationDir)); - $files = \Magento\Framework\App\Utility\Files::init()->getClassFiles( - true, - false, - false, - true, - false - ); + $files = Files::init()->getPhpFiles(Files::INCLUDE_APP_CODE | Files::INCLUDE_LIBS); $patterns = [ '/' . preg_quote($libPath) . '/', @@ -222,7 +217,7 @@ class CompilerTest extends \PHPUnit_Framework_TestCase $file = str_replace('/', '\\', $file); $filePath = preg_replace($patterns, $replacements, $file); $className = substr($filePath, 0, -4); - if (class_exists($className)) { + if (class_exists($className, false)) { $file = str_replace('\\', DIRECTORY_SEPARATOR, $file); $classes[$file] = $className; } @@ -263,7 +258,7 @@ class CompilerTest extends \PHPUnit_Framework_TestCase $parent = $class->getParentClass(); $file = false; if ($parent) { - $basePath = \Magento\Framework\App\Utility\Files::init()->getPathToSource(); + $basePath = Files::init()->getPathToSource(); $file = str_replace('\\', DIRECTORY_SEPARATOR, $parent->getFileName()); $basePath = str_replace('\\', DIRECTORY_SEPARATOR, $basePath); $file = str_replace($basePath . DIRECTORY_SEPARATOR, '', $file); @@ -307,7 +302,7 @@ class CompilerTest extends \PHPUnit_Framework_TestCase function ($file) { $this->_validateFile($file); }, - \Magento\Framework\App\Utility\Files::init()->getDiConfigs(true) + Files::init()->getDiConfigs(true) ); } @@ -371,7 +366,7 @@ class CompilerTest extends \PHPUnit_Framework_TestCase { try { $module = \Magento\Framework\App\Utility\Classes::getClassModuleName($type); - if (\Magento\Framework\App\Utility\Files::init()->isModuleExists($module)) { + if (Files::init()->isModuleExists($module)) { $this->pluginValidator->validate($plugin, $type); } } catch (\Magento\Framework\Exception\ValidatorException $exception) { @@ -386,7 +381,7 @@ class CompilerTest extends \PHPUnit_Framework_TestCase */ protected function pluginDataProvider() { - $files = \Magento\Framework\App\Utility\Files::init()->getDiConfigs(); + $files = Files::init()->getDiConfigs(); $plugins = []; foreach ($files as $file) { $dom = new \DOMDocument(); diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/ExceptionHierarchyTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/ExceptionHierarchyTest.php index b7fb0b8ae7a94fac791f68ba00a147f6bf138776..ca7588563b0579eb3c857d19eecca644a8f4e063 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/ExceptionHierarchyTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/ExceptionHierarchyTest.php @@ -29,7 +29,7 @@ class ExceptionHierarchyTest extends \PHPUnit_Framework_TestCase */ public function isInheritedLocalizedExceptionDataProvider() { - $files = UtilityFiles::init()->getClassFiles(true, false, false, true, false); + $files = UtilityFiles::init()->getPhpFiles(UtilityFiles::INCLUDE_APP_CODE | UtilityFiles::INCLUDE_LIBS); $blacklistExceptions = $this->getBlacklistExceptions(); $data = []; @@ -53,8 +53,48 @@ class ExceptionHierarchyTest extends \PHPUnit_Framework_TestCase */ protected function convertPathToClassName($filePath) { - $className = str_replace('.php', "", substr($filePath, strpos($filePath, '/Magento'))); - $className = implode("\\", explode("/", $className)); + $componentRegistrar = new \Magento\Framework\Component\ComponentRegistrar(); + $foundItems = null; + $moduleNamespace = null; + $foundItems = array_filter( + $componentRegistrar->getPaths(\Magento\Framework\Component\ComponentRegistrar::MODULE), + function ($item) use ($filePath) { + if (strpos($filePath, $item . '/') !== false) { + return true; + } else { + return false; + } + } + ); + if ($foundItems) { + $moduleNamespace = str_replace('_', '\\', array_keys($foundItems)[0]); + $classPath = str_replace('/', '\\', str_replace(array_shift($foundItems), '', $filePath)); + } else { + $foundItems = array_filter( + $componentRegistrar->getPaths(\Magento\Framework\Component\ComponentRegistrar::LIBRARY), + function ($item) use ($filePath) { + if (strpos($filePath, $item . '/') !== false) { + return true; + } else { + return false; + } + } + ); + $libName = array_keys($foundItems)[0]; + $libName = str_replace('framework-', 'framework/', $libName); + $namespaceParts = explode('/', $libName); + $namespaceParts = array_map( + function ($item) { + return str_replace(' ', '', ucwords(str_replace('-', ' ', $item))); + }, + $namespaceParts + ); + $moduleNamespace = implode('\\', $namespaceParts); + $classPath = str_replace('/', '\\', str_replace(array_shift($foundItems), '', $filePath)); + } + + $className = '\\' . $moduleNamespace . $classPath; + $className = str_replace('.php', '', $className); return $className; } diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/HhvmCompatibilityTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/HhvmCompatibilityTest.php index b7c342c1fd4ecdc410a7558a1a3131d76193c125..0fade8a1962fea8cc719c880c29e2d66dc5ee7c3 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/HhvmCompatibilityTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/HhvmCompatibilityTest.php @@ -62,7 +62,14 @@ class HhvmCompatibilityTest extends \PHPUnit_Framework_TestCase protected function getFiles() { return \array_merge( - Files::init()->getPhpFiles(true, true, true, false), + Files::init()->getPhpFiles( + Files::INCLUDE_APP_CODE + | Files::INCLUDE_PUB_CODE + | Files::INCLUDE_LIBS + | Files::INCLUDE_TEMPLATES + | Files::INCLUDE_TESTS + | Files::INCLUDE_NON_CLASSES + ), Files::init()->getPhtmlFiles(false, false), Files::init()->getFiles([Files::init()->getPathToSource() . '/dev/'], '*.php') ); diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Layout/BlocksTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/Layout/BlocksTest.php index 16c026a76a57eba3b88e91c1acac28b2bdf85d39..de1eaa74bd82a20e462d71ffc1b5f2f6c15d1372 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Layout/BlocksTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Layout/BlocksTest.php @@ -96,7 +96,12 @@ class BlocksTest extends \PHPUnit_Framework_TestCase public function getChildBlockDataProvider() { $result = []; - foreach (Files::init()->getPhpFiles(true, false, true, false, false) as $file) { + $collectedFiles = Files::init()->getPhpFiles( + Files::INCLUDE_APP_CODE + | Files::INCLUDE_TEMPLATES + | Files::INCLUDE_NON_CLASSES + ); + foreach ($collectedFiles as $file) { $aliases = \Magento\Framework\App\Utility\Classes::getAllMatches( file_get_contents($file), '/\->getChildBlock\(\'([^\']+)\'\)/x' diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Layout/FilesLocationTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/Layout/FilesLocationTest.php deleted file mode 100644 index e385ecb0eeb8f62da6ba7111edc004967051324b..0000000000000000000000000000000000000000 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Layout/FilesLocationTest.php +++ /dev/null @@ -1,78 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Test\Integrity\Layout; - -class FilesLocationTest extends \PHPUnit_Framework_TestCase -{ - /** - * Verifying that in page_layout directory contains only page layout xml files - * - * @param string $filename - * @dataProvider pageLayoutFilesDataProvider - */ - public function testPageLayoutFiles($filename) - { - $validSchema = 'Magento/Framework/View/Layout/etc/page_layout.xsd'; - $xmlFile = file_get_contents($filename); - $schemaLocations = []; - preg_match('/xsi:noNamespaceSchemaLocation=\s*"([^"]+)"/s', $xmlFile, $schemaLocations); - $this->assertEquals( - 2, - count($schemaLocations), - 'The XML file at ' . $filename . ' does not have a schema defined.' - ); - - $schemaFile = dirname($filename).'/'.$schemaLocations[1]; - $this->assertFileExists($schemaFile, "$filename refers to an invalid schema $schemaFile."); - - $schemaFile = realpath($schemaFile); - $this->assertNotFalse( - strpos($schemaFile, $validSchema), - '"page_layout" directory should contain only page layout xml files' - ); - } - - public function pageLayoutFilesDataProvider() - { - return \Magento\Framework\App\Utility\Files::init()->getPageLayoutFiles(); - } - - /** - * Verifying that in layout directory contains only page page configuration and generic layout xml files - * - * @param string $filename - * @dataProvider pageConfigurationAndGenericLayoutFilesDataProvider - */ - public function testPageConfigurationAndGenericLayoutFiles($filename) - { - $validSchema = [ - 'Magento/Framework/View/Layout/etc/page_configuration.xsd', - 'Magento/Framework/View/Layout/etc/layout_generic.xsd' - ]; - $xmlFile = file_get_contents($filename); - $schemaLocations = []; - preg_match('/xsi:noNamespaceSchemaLocation=\s*"([^"]+)"/s', $xmlFile, $schemaLocations); - $this->assertEquals( - 2, - count($schemaLocations), - 'The XML file at ' . $filename . ' does not have a schema defined.' - ); - - $schemaFile = dirname($filename).'/'.$schemaLocations[1]; - $this->assertFileExists($schemaFile, "$filename refers to an invalid schema $schemaFile."); - - $schemaFile = realpath($schemaFile); - $this->assertTrue( - false !== strpos($schemaFile, $validSchema[0]) || false !== strpos($schemaFile, $validSchema[1]), - '"layout" directory should contain only page configuration and generic layout xml files' - ); - } - - public function pageConfigurationAndGenericLayoutFilesDataProvider() - { - return \Magento\Framework\App\Utility\Files::init()->getLayoutFiles(); - } -} diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Library/DependencyTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/Library/DependencyTest.php index 8d6cfb9d34ced8af8e26a9f4dfab7a415ab610fa..7cc87d570344cf3173e6ba4aa71ab3ece340d19c 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Library/DependencyTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Library/DependencyTest.php @@ -7,6 +7,7 @@ namespace Magento\Test\Integrity\Library; use Magento\Framework\App\Utility\Files; use Magento\Framework\App\Utility\AggregateInvoker; +use Magento\Framework\Component\ComponentRegistrar; use Magento\TestFramework\Integrity\Library\Injectable; use Magento\TestFramework\Integrity\Library\PhpParser\ParserFactory; use Magento\TestFramework\Integrity\Library\PhpParser\Tokens; @@ -43,6 +44,7 @@ class DependencyTest extends \PHPUnit_Framework_TestCase * @param string $file */ function ($file) { + $componentRegistrar = new ComponentRegistrar(); $fileReflection = new FileReflection($file); $tokens = new Tokens($fileReflection->getContents(), new ParserFactory()); $tokens->parseContent(); @@ -54,9 +56,15 @@ class DependencyTest extends \PHPUnit_Framework_TestCase $pattern = '#^(\\\\|)' . implode('|', $this->getForbiddenNamespaces()) . '\\\\#'; foreach ($dependencies as $dependency) { - $filePath = BP . '/lib/internal/' . str_replace('\\', '/', $dependency) . '.php'; - if (preg_match($pattern, $dependency) && !file_exists($filePath)) { - $this->errors[$fileReflection->getFileName()][] = $dependency; + $dependencyPaths = explode('/', $dependency); + $dependencyPaths = array_slice($dependencyPaths, 2); + $dependency = implode('\\', $dependencyPaths); + $libraryPaths = $componentRegistrar->getPaths(ComponentRegistrar::LIBRARY); + foreach ($libraryPaths as $libraryPath) { + $filePath = str_replace('\\', '/', $libraryPath . '/' . $dependency . '.php'); + if (preg_match($pattern, $dependency) && !file_exists($filePath)) { + $this->errors[$fileReflection->getFileName()][] = $dependency; + } } } @@ -85,7 +93,12 @@ class DependencyTest extends \PHPUnit_Framework_TestCase ); } }, - $files->getPhpFiles(false, true, false, true, false) + $files->getPhpFiles( + Files::INCLUDE_PUB_CODE | + Files::INCLUDE_LIBS | + Files::AS_DATA_SET | + Files::INCLUDE_NON_CLASSES + ) ); } @@ -123,9 +136,11 @@ class DependencyTest extends \PHPUnit_Framework_TestCase public function libraryDataProvider() { // @TODO: remove this code when class Magento\Framework\Data\Collection will fixed - include_once BP . '/lib/internal/Magento/Framework/Option/ArrayInterface.php'; - $blackList = file(__DIR__ . '/_files/blacklist.txt', FILE_IGNORE_NEW_LINES); - $dataProvider = Files::init()->getClassFiles(false, false, false, true, true); + $componentRegistrar = new ComponentRegistrar(); + include_once $componentRegistrar->getPath(ComponentRegistrar::LIBRARY, 'magento/framework') + . '/Option/ArrayInterface.php'; + $blackList = Files::init()->readLists(__DIR__ . '/_files/blacklist.txt'); + $dataProvider = Files::init()->getPhpFiles(Files::INCLUDE_LIBS | Files::AS_DATA_SET); foreach ($dataProvider as $key => $data) { $file = str_replace(BP . '/', '', $data[0]); 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 0c24996b5c4c39705497da428ba2eb850d0a9974..53bfd9dc2a9037fc4d1ef82abb05c314625ccedc 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 @@ -1,82 +1,74 @@ -lib/internal/Magento/Framework/Data/Collection/Filesystem.php -lib/internal/Magento/Framework/Data/Collection/Db.php -lib/internal/Magento/Framework/Data/Form/Element/Radio.php -lib/internal/Magento/Framework/Data/Form/Element/Label.php -lib/internal/Magento/Framework/Data/Form/Element/AbstractElement.php -lib/internal/Magento/Framework/Data/Form/Element/File.php -lib/internal/Magento/Framework/Data/Form/Element/Checkbox.php -lib/internal/Magento/Framework/Data/Form/Element/Checkboxes.php -lib/internal/Magento/Framework/Data/Form/Element/Password.php -lib/internal/Magento/Framework/Data/Form/Element/Column.php -lib/internal/Magento/Framework/Data/Form/Element/Gallery.php -lib/internal/Magento/Framework/Data/Form/Element/Obscure.php -lib/internal/Magento/Framework/Data/Form/Element/Data.php -lib/internal/Magento/Framework/Data/Form/Element/Multiline.php -lib/internal/Magento/Framework/Data/Form/Element/Radios.php -lib/internal/Magento/Framework/Data/Form/Element/Submit.php -lib/internal/Magento/Framework/Data/Form/Element/Note.php -lib/internal/Magento/Framework/Data/Form/Element/Image.php -lib/internal/Magento/Framework/Data/Form/Element/Text.php -lib/internal/Magento/Framework/Data/Form/Element/Time.php -lib/internal/Magento/Framework/Data/Form/Element/Button.php -lib/internal/Magento/Framework/Data/Form/Element/Editor.php -lib/internal/Magento/Framework/Data/Form/Element/Hidden.php -lib/internal/Magento/Framework/Data/Form/Element/Reset.php -lib/internal/Magento/Framework/Data/Form/Element/Link.php -lib/internal/Magento/Framework/Data/Form/Element/Editablemultiselect.php -lib/internal/Magento/Framework/Data/Form/Element/Multiselect.php -lib/internal/Magento/Framework/Data/Form/Element/Fieldset.php -lib/internal/Magento/Framework/Data/Form/Element/Select.php -lib/internal/Magento/Framework/Data/Form/Element/Textarea.php -lib/internal/Magento/Framework/Data/Form/Element/Imagefile.php -lib/internal/Magento/Framework/Data/Form/Element/Imagefile.php -lib/internal/Magento/Framework/Data/Form/Element/Date.php -lib/internal/Magento/Framework/Data/Form/AbstractForm.php -lib/internal/Magento/Framework/Data/Form/Factory.php -lib/internal/Magento/Framework/Data/Collection.php -lib/internal/Magento/Framework/Data/Form.php -lib/internal/Magento/Framework/Data/Form/FormKey.php +library magento/framework Data/Collection/Filesystem.php +library magento/framework Data/Form/Element/Radio.php +library magento/framework Data/Form/Element/Label.php +library magento/framework Data/Form/Element/AbstractElement.php +library magento/framework Data/Form/Element/File.php +library magento/framework Data/Form/Element/Checkbox.php +library magento/framework Data/Form/Element/Checkboxes.php +library magento/framework Data/Form/Element/Password.php +library magento/framework Data/Form/Element/Column.php +library magento/framework Data/Form/Element/Gallery.php +library magento/framework Data/Form/Element/Obscure.php +library magento/framework Data/Form/Element/Multiline.php +library magento/framework Data/Form/Element/Radios.php +library magento/framework Data/Form/Element/Submit.php +library magento/framework Data/Form/Element/Note.php +library magento/framework Data/Form/Element/Image.php +library magento/framework Data/Form/Element/Text.php +library magento/framework Data/Form/Element/Time.php +library magento/framework Data/Form/Element/Button.php +library magento/framework Data/Form/Element/Editor.php +library magento/framework Data/Form/Element/Hidden.php +library magento/framework Data/Form/Element/Reset.php +library magento/framework Data/Form/Element/Link.php +library magento/framework Data/Form/Element/Editablemultiselect.php +library magento/framework Data/Form/Element/Multiselect.php +library magento/framework Data/Form/Element/Fieldset.php +library magento/framework Data/Form/Element/Select.php +library magento/framework Data/Form/Element/Textarea.php +library magento/framework Data/Form/Element/Imagefile.php +library magento/framework Data/Form/Element/Imagefile.php +library magento/framework Data/Form/Element/Date.php +library magento/framework Data/Form/AbstractForm.php +library magento/framework Data/Collection.php +library magento/framework Data/Form.php +library magento/framework Data/Form/FormKey.php -lib/internal/Magento/Framework/Exception/AuthenticationException.php -lib/internal/Magento/Framework/Exception/AuthorizationException.php -lib/internal/Magento/Framework/Exception/Exception.php -lib/internal/Magento/Framework/Exception/InputException.php -lib/internal/Magento/Framework/Exception/NoSuchEntityException.php +library magento/framework Exception/AuthenticationException.php +library magento/framework Exception/AuthorizationException.php +library magento/framework Exception/InputException.php +library magento/framework Exception/NoSuchEntityException.php -lib/internal/Magento/Framework/Filter/Object/Grid.php -lib/internal/Magento/Framework/Filter/Object.php +library magento/framework View/Context.php +library magento/framework View/Element/Js/Cookie.php +library magento/framework View/Element/Html/Calendar.php +library magento/framework View/Element/Html/Link/Current.php +library magento/framework View/Element/Messages.php +library magento/framework View/Element/AbstractBlock.php +library magento/framework View/Element/Template.php +library magento/framework View/Element/Context.php +library magento/framework View/Element/Template/Context.php +library magento/framework View/Element/Redirect.php -lib/internal/Magento/Framework/View/Context.php -lib/internal/Magento/Framework/View/Element/Js/Cookie.php -lib/internal/Magento/Framework/View/Element/Html/Calendar.php -lib/internal/Magento/Framework/View/Element/Html/Link/Current.php -lib/internal/Magento/Framework/View/Element/Messages.php -lib/internal/Magento/Framework/View/Element/AbstractBlock.php -lib/internal/Magento/Framework/View/Element/Template.php -lib/internal/Magento/Framework/View/Element/Context.php -lib/internal/Magento/Framework/View/Element/Template/Context.php -lib/internal/Magento/Framework/View/Element/Redirect.php +library magento/framework Event/Invoker/InvokerDefault.php +library magento/framework Phrase/Renderer/Translate.php +library magento/framework Backup/Snapshot.php +library magento/framework Oauth/Exception.php -lib/internal/Magento/Framework/Event/Invoker/InvokerDefault.php -lib/internal/Magento/Framework/Phrase/Renderer/Translate.php -lib/internal/Magento/Framework/Backup/Snapshot.php -lib/internal/Magento/Framework/Oauth/Exception.php +library magento/framework App/Helper/AbstractHelper.php +library magento/framework App/Helper/Context.php -lib/internal/Magento/Framework/App/Helper/AbstractHelper.php -lib/internal/Magento/Framework/App/Helper/Context.php +library magento/framework View/DesignLoader.php +library magento/framework View/Page/Config.php +library magento/framework View/Page/Title.php +library magento/framework Session/SidResolverInterface.php -lib/internal/Magento/Framework/View/DesignLoader.php -lib/internal/Magento/Framework/View/Page/Config.php -lib/internal/Magento/Framework/View/Page/Title.php -lib/internal/Magento/Framework/Session/SidResolverInterface.php +library magento/framework Filesystem/Driver/Http.php -lib/internal/Magento/Framework/App/Filesystem/DirectoryList/Configuration.php -lib/internal/Magento/Framework/Filesystem/Driver/Http.php +library magento/framework Url/ScopeResolver.php +library magento/framework Url/SecurityInfo.php +library magento/framework Url/RouteParamsResolver.php +library magento/framework View/Url/Config.php +library magento/framework View/Asset/Config.php -lib/internal/Magento/Framework/Url/ScopeResolver.php -lib/internal/Magento/Framework/Url/SecurityInfo.php -lib/internal/Magento/Framework/Url/RouteParamsResolver.php -lib/internal/Magento/Framework/View/Url/Config.php -lib/internal/Magento/Framework/View/Asset/Config.php - -lib/internal/Magento/Framework/Locale/Format.php +library magento/framework Locale/Format.php diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Backend/SystemConfigTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Backend/SystemConfigTest.php index 667ab551ba15310446751f915719cefcb1954584..d0854d6db3348268b1c5e6f467133cd4b233bd42 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Backend/SystemConfigTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Backend/SystemConfigTest.php @@ -19,8 +19,8 @@ class SystemConfigTest extends \PHPUnit_Framework_TestCase function ($configFile) { $dom = new \DOMDocument(); $dom->loadXML(file_get_contents($configFile)); - $schema = \Magento\Framework\App\Utility\Files::init()->getPathToSource() . - '/app/code/Magento/Config/etc/system_file.xsd'; + $urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + $schema = $urnResolver->getRealPath('urn:magento:module:Magento_Config:etc/system_file.xsd'); $errors = \Magento\Framework\Config\Dom::validateDomDocument($dom, $schema); if ($errors) { $this->fail('XML-file has validation errors:' . PHP_EOL . implode(PHP_EOL . PHP_EOL, $errors)); diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Core/Model/Fieldset/FieldsetConfigTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Core/Model/Fieldset/FieldsetConfigTest.php index 7fa617249d6c7b7223e823bda0ca3f158039469e..210b46a99f0fbf5dfac9debf55ec6170b7f51351 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Core/Model/Fieldset/FieldsetConfigTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Core/Model/Fieldset/FieldsetConfigTest.php @@ -9,6 +9,14 @@ namespace Magento\Test\Integrity\Magento\Core\Model\Fieldset; class FieldsetConfigTest extends \PHPUnit_Framework_TestCase { + /** @var \Magento\Framework\Config\Dom\UrnResolver */ + protected $urnResolver; + + protected function setUp() + { + $this->urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + } + public function testXmlFiles() { $invoker = new \Magento\Framework\App\Utility\AggregateInvoker($this); @@ -19,8 +27,9 @@ class FieldsetConfigTest extends \PHPUnit_Framework_TestCase function ($configFile) { $dom = new \DOMDocument(); $dom->loadXML(file_get_contents($configFile)); - $schema = \Magento\Framework\App\Utility\Files::init()->getPathToSource() . - '/lib/internal/Magento/Framework/DataObject/etc/fieldset_file.xsd'; + $schema = $this->urnResolver->getRealPath( + 'urn:magento:framework:DataObject/etc/fieldset_file.xsd' + ); $errors = \Magento\Framework\Config\Dom::validateDomDocument($dom, $schema); if ($errors) { $this->fail( @@ -40,8 +49,7 @@ class FieldsetConfigTest extends \PHPUnit_Framework_TestCase $xmlFile = __DIR__ . '/_files/fieldset.xml'; $dom = new \DOMDocument(); $dom->loadXML(file_get_contents($xmlFile)); - $schema = \Magento\Framework\App\Utility\Files::init()->getPathToSource() . - '/lib/internal/Magento/Framework/DataObject/etc/fieldset.xsd'; + $schema = $this->urnResolver->getRealPath('urn:magento:framework:DataObject/etc/fieldset.xsd'); $errors = \Magento\Framework\Config\Dom::validateDomDocument($dom, $schema); if ($errors) { $this->fail( @@ -58,8 +66,7 @@ class FieldsetConfigTest extends \PHPUnit_Framework_TestCase $xmlFile = __DIR__ . '/_files/invalid_fieldset.xml'; $dom = new \DOMDocument(); $dom->loadXML(file_get_contents($xmlFile)); - $schema = \Magento\Framework\App\Utility\Files::init()->getPathToSource() . - '/lib/internal/Magento/Framework/DataObject/etc/fieldset.xsd'; + $schema = $this->urnResolver->getRealPath('urn:magento:framework:DataObject/etc/fieldset.xsd'); $errors = \Magento\Framework\Config\Dom::validateDomDocument($dom, $schema); if (!$errors) { $this->fail('There is a problem with the schema. A known bad XML file passed validation'); @@ -71,8 +78,7 @@ class FieldsetConfigTest extends \PHPUnit_Framework_TestCase $xmlFile = __DIR__ . '/_files/fieldset_file.xml'; $dom = new \DOMDocument(); $dom->loadXML(file_get_contents($xmlFile)); - $schema = \Magento\Framework\App\Utility\Files::init()->getPathToSource() . - '/lib/internal/Magento/Framework/DataObject/etc/fieldset_file.xsd'; + $schema = $this->urnResolver->getRealPath('urn:magento:framework:DataObject/etc/fieldset_file.xsd'); $errors = \Magento\Framework\Config\Dom::validateDomDocument($dom, $schema); if ($errors) { $this->fail( @@ -89,8 +95,7 @@ class FieldsetConfigTest extends \PHPUnit_Framework_TestCase $xmlFile = __DIR__ . '/_files/invalid_fieldset.xml'; $dom = new \DOMDocument(); $dom->loadXML(file_get_contents($xmlFile)); - $schema = \Magento\Framework\App\Utility\Files::init()->getPathToSource() . - '/lib/internal/Magento/Framework/DataObject/etc/fieldset_file.xsd'; + $schema = $this->urnResolver->getRealPath('urn:magento:framework:DataObject/etc/fieldset_file.xsd'); $errors = \Magento\Framework\Config\Dom::validateDomDocument($dom, $schema); if (!$errors) { $this->fail('There is a problem with the schema. A known bad XML file passed validation'); diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Core/Model/Fieldset/_files/fieldset.xml b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Core/Model/Fieldset/_files/fieldset.xml index 7d4d901a2f1c85ec311936c37a1a472e9907d395..823df04dcce8c1da6f2a3691c48c3686ead0ca03 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Core/Model/Fieldset/_files/fieldset.xml +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Core/Model/Fieldset/_files/fieldset.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../lib/internal/Magento/Framework/DataObject/etc/fieldset.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:framework:DataObject/etc/fieldset.xsd"> <scope id="global"> <fieldset id="sales_copy_order"> <field name="customer_email"> diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Core/Model/Fieldset/_files/fieldset_file.xml b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Core/Model/Fieldset/_files/fieldset_file.xml index b504bfca1bb980c45c805519d2d4611a33388c71..69f85df3e5a7aad59ee448be5fb6ad778cc25697 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Core/Model/Fieldset/_files/fieldset_file.xml +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Core/Model/Fieldset/_files/fieldset_file.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../lib/internal/Magento/Framework/DataObject/etc/fieldset_file.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:framework:DataObject/etc/fieldset_file.xsd"> <scope id="global"> <fieldset id="sales_copy_order"> <field name="customer_email"> diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Core/Model/Fieldset/_files/invalid_fieldset.xml b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Core/Model/Fieldset/_files/invalid_fieldset.xml index 72d7f977e187aade6cfa6b03f8eba9a24437bc66..8c2d361c6701a4b487620773218d91b0f2a52e7e 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Core/Model/Fieldset/_files/invalid_fieldset.xml +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Core/Model/Fieldset/_files/invalid_fieldset.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../lib/internal/Magento/Framework/DataObject/etc/fieldset_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:DataObject/etc/fieldset_file.xsd"> <global> <fieldsets> <sales_copy_order> diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Framework/Api/ExtensibleInterfacesTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Framework/Api/ExtensibleInterfacesTest.php index e25f22a20e9d192e6c44c34b1d31402204c439a8..52cad33035b46006ed32f6902d413c6b2b85e390 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Framework/Api/ExtensibleInterfacesTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Framework/Api/ExtensibleInterfacesTest.php @@ -254,7 +254,7 @@ class ExtensibleInterfacesTest extends \PHPUnit_Framework_TestCase protected function blacklistFilter($preFilter) { $postFilter = []; - $blacklist = Files::readLists(__DIR__ . '/_files/ExtensibleInterfacesTest/blacklist*'); + $blacklist = Files::init()->readLists(__DIR__ . '/_files/ExtensibleInterfacesTest/blacklist*'); foreach ($preFilter as $file) { if (!in_array($file, $blacklist)) { $postFilter[] = $file; diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Framework/Api/_files/ExtensibleInterfacesTest/blacklist_ce.txt b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Framework/Api/_files/ExtensibleInterfacesTest/blacklist_ce.txt index b43e1551c9e9d4b216df0fc88e525e0c8a1609dc..1563abcaf8bd1366277a8387fcb9a797bdd439fd 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Framework/Api/_files/ExtensibleInterfacesTest/blacklist_ce.txt +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Framework/Api/_files/ExtensibleInterfacesTest/blacklist_ce.txt @@ -1,2 +1,2 @@ -app/code/Magento/Payment/Model/Info.php -app/code/Magento/Customer/Model/Address/AbstractAddress.php \ No newline at end of file +module Magento_Payment Model/Info.php +module Magento_Customer Model/Address/AbstractAddress.php \ No newline at end of file diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Framework/Search/ConfigTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Framework/Search/ConfigTest.php index 04896b2ae16e94143124915c1c1fadad48c0fbfd..21d35b9e428e20fca7fd86c4a0d2bab68deaa721 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Framework/Search/ConfigTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Framework/Search/ConfigTest.php @@ -9,6 +9,14 @@ namespace Magento\Test\Integrity\Magento\Framework\Search; class ConfigTest extends \Magento\TestFramework\Integrity\AbstractConfig { + /** @var \Magento\Framework\Config\Dom\UrnResolver */ + protected $urnResolver; + + protected function setUp() + { + $this->urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + } + /** * Returns the name of the XSD file to be used to validate the XML * @@ -16,7 +24,7 @@ class ConfigTest extends \Magento\TestFramework\Integrity\AbstractConfig */ protected function _getXsd() { - return '/lib/internal/Magento/Framework/Search/etc/search_request_merged.xsd'; + return $this->urnResolver->getRealPath('urn:magento:framework:Search/etc/search_request_merged.xsd'); } /** @@ -26,7 +34,7 @@ class ConfigTest extends \Magento\TestFramework\Integrity\AbstractConfig */ protected function _getFileXsd() { - return '/lib/internal/Magento/Framework/Search/etc/search_request.xsd'; + return $this->urnResolver->getRealPath('urn:magento:framework:Search/etc/search_request.xsd'); } /** diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Framework/Search/_files/invalid.xml b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Framework/Search/_files/invalid.xml index 5d18ca8adb7bde9f1e61e564fd4d87ba20823b44..9abe310f942b64b9633996dde5ad1cdff130e51e 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Framework/Search/_files/invalid.xml +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Framework/Search/_files/invalid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<requests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../lib/internal/Magento/Framework/Search/etc/search_request.xsd"> +<requests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Search/etc/search_request.xsd"> <request query="sugegsted_search_container" index="product"> <queries> <query xsi:type="boolQuery" name="suggested_search_container_dd" boost="2"> diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Framework/Search/_files/invalid_partial.xml b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Framework/Search/_files/invalid_partial.xml index 78d6ffb916f429b64c599160dcfc85586833b50b..d64b21909bafc0f5324a7e692591236ee8229acb 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Framework/Search/_files/invalid_partial.xml +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Framework/Search/_files/invalid_partial.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<requests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../lib/internal/Magento/Framework/Search/etc/search_request.xsd"> +<requests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Search/etc/search_request.xsd"> <request query="sugested_search_container" index="product"> <dimensions> </dimensions> diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Framework/Search/_files/valid.xml b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Framework/Search/_files/valid.xml index 62fd4c97098b254e88b537aacd489232198610a3..d59a6e772d39106cefb403db4f5096a2dccb25cc 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Framework/Search/_files/valid.xml +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Framework/Search/_files/valid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<requests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../lib/internal/Magento/Framework/Search/etc/search_request.xsd"> +<requests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Search/etc/search_request.xsd"> <request query="sugegsted_search_container_1" index="product_1"> <dimensions> <dimension name="scope" value="default"/> diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Framework/Search/_files/valid_partial.xml b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Framework/Search/_files/valid_partial.xml index 55b05fa416e0cfd40e3d9c941c4bf4a3644d6a80..d21682bd9aab22a9d09f2528ad40a3e22c6df6fb 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Framework/Search/_files/valid_partial.xml +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Framework/Search/_files/valid_partial.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<requests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../lib/internal/Magento/Framework/Search/etc/search_request.xsd"> +<requests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Search/etc/search_request.xsd"> <request query="sugested_search_container_1" index="product_1"> <queries> <query xsi:type="boolQuery" name="sugested_search_container" boost="2"> diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Indexer/ConfigTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Indexer/ConfigTest.php index 7b8c37e437e2f18b607a42a4bc25610b32d4b93d..3b2efe9aba924c88c7bd03ead3be6804f66a11b8 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Indexer/ConfigTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Indexer/ConfigTest.php @@ -12,6 +12,14 @@ namespace Magento\Test\Integrity\Magento\Indexer; class ConfigTest extends \Magento\TestFramework\Integrity\AbstractConfig { + /** @var \Magento\Framework\Config\Dom\UrnResolver */ + protected $urnResolver; + + protected function setUp() + { + $this->urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + } + /** * Returns the name of the XSD file to be used to validate the XML * @@ -19,7 +27,7 @@ class ConfigTest extends \Magento\TestFramework\Integrity\AbstractConfig */ protected function _getXsd() { - return '/lib/internal/Magento/Framework/Indexer/etc/indexer_merged.xsd'; + return $this->urnResolver->getRealPath('urn:magento:framework:Indexer/etc/indexer_merged.xsd'); } /** @@ -69,7 +77,8 @@ class ConfigTest extends \Magento\TestFramework\Integrity\AbstractConfig */ protected function _getFileXsd() { - return '/lib/internal/Magento/Framework/Indexer/etc/indexer.xsd'; + return $this->urnResolver->getRealPath('urn:magento:framework:Indexer/etc/indexer.xsd'); + } /** diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Indexer/_files/invalid.xml b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Indexer/_files/invalid.xml index 5479440317f6fb7778275e3bd2173d7c650b75ad..18fe24549c5b4a784ed1493a3d2c7422120fb45b 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Indexer/_files/invalid.xml +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Indexer/_files/invalid.xml @@ -7,7 +7,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/Indexer/etc/indexer_merged.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Indexer/etc/indexer_merged.xsd"> <indexer id="indexer_0" view_id="catalogsearch_fulltext" class="NotAClass"> <title translate="true">Test Indexer Declaration</title> <description translate="true">Invalid provider attribute value</description> diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Indexer/_files/valid.xml b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Indexer/_files/valid.xml index 0bd5f82c64f2345de3804728f057461f97c5775f..d231f80bec2456386eed2679dc2cf38d0a1c7099 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Indexer/_files/valid.xml +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Indexer/_files/valid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/Indexer/etc/indexer_merged.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Indexer/etc/indexer_merged.xsd"> <indexer id="indexer_1" view_id="catalogsearch_fulltext" class="Magento\CatalogSearch\Model\Indexer\Fulltext"> <title translate="true">Test Indexer Declaration 1</title> <description translate="true">Test Indexer Declaration 1</description> diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Indexer/_files/valid_partial.xml b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Indexer/_files/valid_partial.xml index 3945fb13a058bf40a27bfb604c9cdd4d5371bbb6..f85595937442d2eb8ac59438a0fd8768476bbd42 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Indexer/_files/valid_partial.xml +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Indexer/_files/valid_partial.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/Indexer/etc/indexer.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Indexer/etc/indexer.xsd"> <indexer id="indexer_1" view_id="catalogsearch_fulltext" class="Magento\CatalogSearch\Model\Indexer\Fulltext"> <title translate="true">Test Indexer Declaration 1</title> <description translate="true">Test Indexer Declaration 1</description> diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Payment/Model/ConfigTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Payment/Model/ConfigTest.php index 31adfa057ae4e4b244e1f5725ee8852cb3916917..da7921a91dbd05b06514364e986a06d2d3a8fd5c 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Payment/Model/ConfigTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Payment/Model/ConfigTest.php @@ -9,6 +9,14 @@ namespace Magento\Test\Integrity\Magento\Payment\Model; class ConfigTest extends \Magento\TestFramework\Integrity\AbstractConfig { + /** @var \Magento\Framework\Config\Dom\UrnResolver */ + protected $urnResolver; + + protected function setUp() + { + $this->urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + } + public function testSchemaUsingInvalidXml($expectedErrors = null) { $expectedErrors = [ @@ -96,7 +104,7 @@ class ConfigTest extends \Magento\TestFramework\Integrity\AbstractConfig */ protected function _getXsd() { - return '/app/code/Magento/Payment/etc/payment.xsd'; + return $this->urnResolver->getRealPath('urn:magento:module:Magento_Payment:etc/payment.xsd'); } /** @@ -106,6 +114,6 @@ class ConfigTest extends \Magento\TestFramework\Integrity\AbstractConfig */ protected function _getFileXsd() { - return '/app/code/Magento/Payment/etc/payment_file.xsd'; + return $this->urnResolver->getRealPath('urn:magento:module:Magento_Payment:etc/payment_file.xsd'); } } diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Persistent/ConfigTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Persistent/ConfigTest.php index 6322b4c6923dda58f402898d1e322d425fdfc897..13d737a2bf9a088ff92ed833b11281e0028b6c3a 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Persistent/ConfigTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Persistent/ConfigTest.php @@ -19,7 +19,8 @@ class ConfigTest extends \Magento\TestFramework\Integrity\AbstractConfig */ protected function _getXsd() { - return '/app/code/Magento/Persistent/etc/persistent.xsd'; + $urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + return $urnResolver->getRealPath('urn:magento:module:Magento_Persistent:etc/persistent.xsd'); } /** diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Persistent/_files/invalid_persistent.xml b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Persistent/_files/invalid_persistent.xml index 5b1b17090c782c0680b6f897b69355d3d5718905..a2c37a02e0432b05937ef6b96e32e52773ca66ee 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Persistent/_files/invalid_persistent.xml +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Persistent/_files/invalid_persistent.xml @@ -9,7 +9,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/Persistent/etc/persistent.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Persistent:etc/persistent.xsd"> <instances> <blocks> <welcome> diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Persistent/_files/valid_persistent.xml b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Persistent/_files/valid_persistent.xml index 4a7b2b118de29322cf751eef30a47459d7f62395..c33e9e123ffe85af832ea9015d39f5f278f3df0c 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Persistent/_files/valid_persistent.xml +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Persistent/_files/valid_persistent.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/Persistent/etc/persistent.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Persistent:etc/persistent.xsd"> <instances> <blocks> <reference id="welcome"> 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 index 8fc74611c45d612c05d6ca4dfe503f62e6a5d489..c9bd4fd254ef12b8b7523567e5a117c72baab470 100644 --- 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 @@ -84,7 +84,8 @@ class ConfigTest extends AbstractConfig */ protected function _getXsd() { - return '/app/code/Magento/Webapi/etc/webapi.xsd'; + $urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + return $urnResolver->getRealPath('urn:magento:module:Magento_Webapi:etc/webapi.xsd'); } /** 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 index 8aeab01a6d4a7ad5cbcfe461b1af4167495376c8..5223655f2db22bcd808c11b3f2502664c7e73a54 100644 --- 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 @@ -6,7 +6,7 @@ */ --> <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../../../../app/code/Magento/Webapi/etc/webapi.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd"> <route url="/V1/customer/me" method="PATCH"> <service class="Magento\Customer\Api\CustomerRepositoryInterface" /> <resources> 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 index 05bce01ea3a01c8c989e0c796cf4a0ecfc6941cc..a791bca9bf0475daa06981e7790d6e0141851a6e 100644 --- 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 @@ -6,7 +6,7 @@ */ --> <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../../../../app/code/Magento/Webapi/etc/webapi.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd"> <route url="/V1/customers/me" method="GET"> <service class="Magento\Customer\Api\CustomerRepositoryInterface" method="getById" /> <resources> diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Widget/WidgetConfigTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Widget/WidgetConfigTest.php index 98e1d430ac38af9bccf798143a83c913f09d8dd6..84532e1d2423764b91f2da292c13fd3dafc9dc08 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Widget/WidgetConfigTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Widget/WidgetConfigTest.php @@ -9,6 +9,14 @@ namespace Magento\Test\Integrity\Magento\Widget; class WidgetConfigTest extends \PHPUnit_Framework_TestCase { + /** @var \Magento\Framework\Config\Dom\UrnResolver */ + protected $urnResolver; + + protected function setUp() + { + $this->urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + } + public function testXmlFiles() { $invoker = new \Magento\Framework\App\Utility\AggregateInvoker($this); @@ -17,8 +25,7 @@ class WidgetConfigTest extends \PHPUnit_Framework_TestCase * @param string $configFile */ function ($configFile) { - $schema = \Magento\Framework\App\Utility\Files::init()->getPathToSource() . - '/app/code/Magento/Widget/etc/widget.xsd'; + $schema = $this->urnResolver->getRealPath('urn:magento:module:Magento_Widget:etc/widget.xsd'); $this->_validateFileExpectSuccess($configFile, $schema); }, array_merge( @@ -31,32 +38,28 @@ class WidgetConfigTest extends \PHPUnit_Framework_TestCase public function testSchemaUsingValidXml() { $xmlFile = __DIR__ . '/_files/widget.xml'; - $schema = \Magento\Framework\App\Utility\Files::init()->getPathToSource() . - '/app/code/Magento/Widget/etc/widget.xsd'; + $schema = $this->urnResolver->getRealPath('urn:magento:module:Magento_Widget:etc/widget.xsd'); $this->_validateFileExpectSuccess($xmlFile, $schema); } public function testSchemaUsingInvalidXml() { $xmlFile = __DIR__ . '/_files/invalid_widget.xml'; - $schema = \Magento\Framework\App\Utility\Files::init()->getPathToSource() . - '/app/code/Magento/Widget/etc/widget.xsd'; + $schema = $this->urnResolver->getRealPath('urn:magento:module:Magento_Widget:etc/widget.xsd'); $this->_validateFileExpectFailure($xmlFile, $schema); } public function testFileSchemaUsingXml() { $xmlFile = __DIR__ . '/_files/widget_file.xml'; - $schema = \Magento\Framework\App\Utility\Files::init()->getPathToSource() . - '/app/code/Magento/Widget/etc/widget_file.xsd'; + $schema = $this->urnResolver->getRealPath('urn:magento:module:Magento_Widget:etc/widget_file.xsd'); $this->_validateFileExpectSuccess($xmlFile, $schema); } public function testFileSchemaUsingInvalidXml() { $xmlFile = __DIR__ . '/_files/invalid_widget.xml'; - $schema = \Magento\Framework\App\Utility\Files::init()->getPathToSource() . - '/app/code/Magento/Widget/etc/widget_file.xsd'; + $schema = $this->urnResolver->getRealPath('urn:magento:module:Magento_Widget:etc/widget_file.xsd'); $this->_validateFileExpectFailure($xmlFile, $schema); } diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Widget/_files/invalid_widget.xml b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Widget/_files/invalid_widget.xml index 98ee95ccfa0e3a2e46d2c3f94623ea08053d4768..1e8948d586c14ed6fd20663066749391401c2a6d 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Widget/_files/invalid_widget.xml +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Widget/_files/invalid_widget.xml @@ -6,7 +6,7 @@ */ --> <widgets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/Widget/etc/widget.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Widget:etc/widget.xsd"> <widget id="new_products" class="Magento\Catalog\Block\Product\Widget\NewWidget" module="Magento_Catalog" is_email_compatible="true" placeholder_image="Magento_Catalog::images/product_widget_new.png" translate="label description"> <label>Catalog New Products List</label> diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Widget/_files/widget.xml b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Widget/_files/widget.xml index 2d53e0adc65b96195c51726b0980a8bbb8976ac3..32c6cb6b598112cf180014820a65de0e4bbfd545 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Widget/_files/widget.xml +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Widget/_files/widget.xml @@ -6,7 +6,7 @@ */ --> <widgets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/Widget/etc/widget.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Widget:etc/widget.xsd"> <widget id="sales_widget_guestform" class="Magento\Sales\Block\Widget\Guest\Form" is_email_compatible="true" > <label translate="true">Orders and Returns</label> <description translate="true">Orders and Returns Search Form</description> diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Widget/_files/widget_file.xml b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Widget/_files/widget_file.xml index f8e2a9b5d1cbe526c86dd1d662c5c09a02ff87bb..4936ec75bb168b136533d5da3d1d80b99e4622ce 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Widget/_files/widget_file.xml +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Widget/_files/widget_file.xml @@ -6,7 +6,7 @@ */ --> <widgets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/Widget/etc/widget_file.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Widget:etc/widget_file.xsd"> <widget id="sales_widget_guestform"> <parameters> <parameter name="test" xsi:type="select"> 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 514f39e7180c4dcec384f6cf3cc15bce62e1f466..cd17f1ec7baf4d90bafcc9eb73cb1004de2e8503 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Phrase/ArgumentsTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Phrase/ArgumentsTest.php @@ -10,6 +10,7 @@ */ namespace Magento\Test\Integrity\Phrase; +use Magento\Framework\Component\ComponentRegistrar; use Magento\Setup\Module\I18n\Parser\Adapter\Php\Tokenizer; class ArgumentsTest extends \Magento\Test\Integrity\Phrase\AbstractTestCase @@ -33,10 +34,11 @@ class ArgumentsTest extends \Magento\Test\Integrity\Phrase\AbstractTestCase new \Magento\Setup\Module\I18n\Parser\Adapter\Php\Tokenizer() ); - $rootDir = \Magento\Framework\App\Utility\Files::init()->getPathToSource(); + $componentRegistrar = new ComponentRegistrar(); $this->blackList = [ // the file below is the only file where strings are translated without corresponding arguments - $rootDir . '/app/code/Magento/Translation/Model/Js/DataProvider.php', + $componentRegistrar->getPath(ComponentRegistrar::MODULE, 'Magento_Translation') + . '/Model/Js/DataProvider.php', ]; } diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Readme/ReadmeTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/Readme/ReadmeTest.php index 002bb5c2a91d304d1c3bbc06237ec7de512b84f2..3602bf60ccf443586f98249bd6a0b1e962d947c2 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Readme/ReadmeTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Readme/ReadmeTest.php @@ -25,16 +25,10 @@ class ReadmeTest extends \PHPUnit_Framework_TestCase /** @var array */ private $scanList = []; - /** - * @var string Path to project root - */ - private $root; - protected function setUp() { - $this->root = Files::init()->getPathToSource(); - $this->blacklist = $this->getBlacklistFromFile(); - $this->scanList = $this->getScanListFromFile(); + $this->blacklist = $this->getPaths(__DIR__ . '/' . self::BLACKLIST_FILES_PATTERN); + $this->scanList = $this->getPaths(__DIR__ . '/' . self::SCAN_LIST_FILE); } public function testReadmeFiles() @@ -60,13 +54,10 @@ class ReadmeTest extends \PHPUnit_Framework_TestCase */ private function getDirectories() { - $root = $this->root; $directories = []; - foreach ($this->scanList as $pattern) { - foreach (glob("{$root}/{$pattern}", GLOB_ONLYDIR) as $dir) { - if (!$this->isInBlacklist($dir)) { - $directories[][$dir] = $dir; - } + foreach ($this->scanList as $dir) { + if (!$this->isInBlacklist($dir)) { + $directories[][$dir] = $dir; } } @@ -74,38 +65,29 @@ class ReadmeTest extends \PHPUnit_Framework_TestCase } /** - * @return array + * @param $path + * @return bool */ - private function getBlacklistFromFile() + private function isInBlacklist($path) { - $blacklist = []; - foreach (glob(__DIR__ . DIRECTORY_SEPARATOR . self::BLACKLIST_FILES_PATTERN) as $file) { - foreach (file($file) as $path) { - $blacklist[] = $this->root . trim(($path[0] === '/' ? $path : '/' . $path)); - } - } - return $blacklist; + return in_array($path, $this->blacklist); } /** + * Get paths basing on the file with patterns + * + * @param string $patternsFile * @return array */ - private function getScanListFromFile() + private function getPaths($patternsFile) { - $patterns = []; - $filename = __DIR__ . DIRECTORY_SEPARATOR . self::SCAN_LIST_FILE; - foreach (file($filename) as $pattern) { - $patterns[] = trim($pattern); + $result = []; + $files = Files::init()->readLists($patternsFile); + foreach ($files as $file) { + if (is_dir($file)) { + $result[] = rtrim($file, '/'); + } } - return $patterns; - } - - /** - * @param $path - * @return bool - */ - private function isInBlacklist($path) - { - return in_array($path, $this->blacklist); + return $result; } } diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Readme/_files/blacklist/ce.txt b/dev/tests/static/testsuite/Magento/Test/Integrity/Readme/_files/blacklist/ce.txt index 3166dba750ba6b8d2b1e580def707ffc3192e851..1e5d4c93d9e77ab462b38f6a0458ead35165c5a4 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Readme/_files/blacklist/ce.txt +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Readme/_files/blacklist/ce.txt @@ -1,41 +1,36 @@ -app/code/Magento/CatalogImportExport -app/code/Magento/CatalogUrlRewrite -app/code/Magento/CmsUrlRewrite -app/code/Magento/ConfigurableImportExport -app/code/Magento/Doc -app/code/Magento/GroupedImportExport -app/code/Magento/Msrp -app/code/Magento/TaxImportExport -app/code/Magento/Translation -lib/internal/Magento/Framework/Acl -lib/internal/Magento/Framework/Api -lib/internal/Magento/Framework/Authorization -lib/internal/Magento/Framework/Cache -lib/internal/Magento/Framework/Config -lib/internal/Magento/Framework/DB -lib/internal/Magento/Framework/DomDocument -lib/internal/Magento/Framework/Filter -lib/internal/Magento/Framework/Gdata -lib/internal/Magento/Framework/HTTP -lib/internal/Magento/Framework/Interception -lib/internal/Magento/Framework/Io -lib/internal/Magento/Framework/Json -lib/internal/Magento/Framework/Mail -lib/internal/Magento/Framework/Mview -lib/internal/Magento/Framework/Notification -lib/internal/Magento/Framework/Oauth -lib/internal/Magento/Framework/Parse -lib/internal/Magento/Framework/Pricing -lib/internal/Magento/Framework/Reflection -lib/internal/Magento/Framework/RequireJs -lib/internal/Magento/Framework/Search -lib/internal/Magento/Framework/Serialization -lib/internal/Magento/Framework/Simplexml -lib/internal/Magento/Framework/System -lib/internal/Magento/Framework/Test -lib/internal/Magento/Framework/App/Utility -lib/internal/Magento/Framework/Url -lib/internal/Magento/Framework/UrlInterface -lib/internal/Magento/Framework/Xml -lib/internal/Magento/Framework/XsltProcessor -lib/internal/Magento/Framework +module Magento_CatalogImportExport / +module Magento_CatalogUrlRewrite / +module Magento_CmsUrlRewrite / +module Magento_ConfigurableImportExport / +module Magento_GroupedImportExport / +module Magento_Msrp / +module Magento_TaxImportExport / +module Magento_Translation / +library magento/framework Acl +library magento/framework Api +library magento/framework Authorization +library magento/framework Cache +library magento/framework Config +library magento/framework DB +library magento/framework DomDocument +library magento/framework Filter +library magento/framework HTTP +library magento/framework Interception +library magento/framework Json +library magento/framework Mail +library magento/framework Mview +library magento/framework Notification +library magento/framework Oauth +library magento/framework Parse +library magento/framework Pricing +library magento/framework Reflection +library magento/framework RequireJs +library magento/framework Search +library magento/framework Simplexml +library magento/framework System +library magento/framework Test +library magento/framework App/Utility +library magento/framework Url +library magento/framework Xml +library magento/framework XsltProcessor +library magento/framework / diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Readme/_files/scan_list.txt b/dev/tests/static/testsuite/Magento/Test/Integrity/Readme/_files/scan_list.txt index 2a650ec6b02c4220fbe5fc0a3811892baa1ed8a7..64cc6a84183b932f07cdb6f5772eb50d963746dc 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Readme/_files/scan_list.txt +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Readme/_files/scan_list.txt @@ -1,3 +1,3 @@ -app/code/Magento/* -lib/internal/Magento/*/* -lib/internal/Magento/* +module * / +library * / +library magento/framework */ diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Xml/SchemaTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/Xml/SchemaTest.php index f5b2290f5c72b79aab952f305155c633ea2be959..3490a781c25c6eb901f0574b710f9fc6c1e92bf0 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Xml/SchemaTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Xml/SchemaTest.php @@ -6,15 +6,17 @@ namespace Magento\Test\Integrity\Xml; +use Magento\Framework\Component\ComponentRegistrar; + class SchemaTest extends \PHPUnit_Framework_TestCase { public function testXmlFiles() { $invoker = new \Magento\Framework\App\Utility\AggregateInvoker($this); $invoker( - /** - * @param string $filename - */ + /** + * @param string $filename + */ function ($filename) { $dom = new \DOMDocument(); $xmlFile = file_get_contents($filename); @@ -24,23 +26,19 @@ class SchemaTest extends \PHPUnit_Framework_TestCase $this->assertEmpty($errors, print_r($errors, true)); $schemaLocations = []; - preg_match('/xsi:noNamespaceSchemaLocation=\s*"([^"]+)"/s', $xmlFile, $schemaLocations); + preg_match('/xsi:noNamespaceSchemaLocation=\s*"(urn:[^"]+)"/s', $xmlFile, $schemaLocations); $this->assertEquals( 2, count($schemaLocations), 'The XML file at ' . $filename . ' does not have a schema properly defined. It should ' - . 'have a xsi:noNamespaceSchemaLocation attribute defined with a relative path. E.g. ' - . 'xsi:noNamespaceSchemaLocation="../../../lib/internal/Magento/Framework/etc/something.xsd"' + . 'have a xsi:noNamespaceSchemaLocation attribute defined with a URN path. E.g. ' + . 'xsi:noNamespaceSchemaLocation="urn:magento:framework:Relative_Path/something.xsd"' ); - $schemaFile = dirname($filename) . '/' . $schemaLocations[1]; - - $this->assertFileExists($schemaFile, "$filename refers to an invalid schema $schemaFile."); - - $errors = \Magento\TestFramework\Utility\Validator::validateXml($dom, $schemaFile); + $errors = \Magento\Framework\Config\Dom::validateDomDocument($dom, $schemaLocations[1]); $this->assertEmpty( $errors, - "Error validating $filename against $schemaFile\n" . print_r($errors, true) + "Error validating $filename against {$schemaLocations[1]}\n" . print_r($errors, true) ); }, $this->getXmlFiles() @@ -49,17 +47,34 @@ class SchemaTest extends \PHPUnit_Framework_TestCase public function getSchemas() { - $codeSchemas = $this->_getFiles(BP . '/app/code/Magento', '*.xsd'); - $libSchemas = $this->_getFiles(BP . '/lib/Magento', '*.xsd'); + $componentRegistrar = new ComponentRegistrar(); + $codeSchemas = []; + foreach ($componentRegistrar->getPaths(ComponentRegistrar::MODULE) as $modulePath) { + $codeSchemas = array_merge($codeSchemas, $this->_getFiles($modulePath, '*.xsd')); + } + $libSchemas = []; + foreach ($componentRegistrar->getPaths(ComponentRegistrar::LIBRARY) as $libraryPath) { + $libSchemas = array_merge($libSchemas, $this->_getFiles($libraryPath, '*.xsd')); + } return $this->_dataSet(array_merge($codeSchemas, $libSchemas)); } public function getXmlFiles() { - $codeXml = $this->_getFiles(BP . '/app', '*.xml', '/.\/Test\/Unit\/./'); + $componentRegistrar = new ComponentRegistrar(); + $codeXml = []; + foreach ($componentRegistrar->getPaths(ComponentRegistrar::MODULE) as $modulePath) { + $codeXml = array_merge($codeXml, $this->_getFiles($modulePath, '*.xml', '/.\/Test\/Unit\/./')); + } $this->_filterSpecialCases($codeXml); - $designXml = $this->_getFiles(BP . '/app/design', '*.xml'); - $libXml = $this->_getFiles(BP . '/lib/Magento', '*.xml'); + $designXml = []; + foreach ($componentRegistrar->getPaths(ComponentRegistrar::THEME) as $themePath) { + $designXml = array_merge($designXml, $this->_getFiles($themePath, '*.xml')); + } + $libXml = []; + foreach ($componentRegistrar->getPaths(ComponentRegistrar::LIBRARY) as $libraryPath) { + $libXml = array_merge($libXml, $this->_getFiles($libraryPath, '*.xml', '/.\/Test\/./')); + } return $this->_dataSet(array_merge($codeXml, $designXml, $libXml)); } @@ -84,10 +99,11 @@ class SchemaTest extends \PHPUnit_Framework_TestCase private function _filterSpecialCases(&$files) { $list = [ - '#Dhl/etc/countries.xml$#', + '#etc/countries.xml$#', '#conf/schema.xml$#', '#conf/solrconfig.xml$#', - '#layout/swagger_index_index.xml$#' + '#layout/swagger_index_index.xml$#', + '#Doc/etc/doc/vars.xml$#' ]; foreach ($list as $pattern) { foreach ($files as $key => $value) { diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/_files/blacklist/composer.txt b/dev/tests/static/testsuite/Magento/Test/Integrity/_files/blacklist/composer.txt deleted file mode 100644 index e1aebd12715b2b8cc7b413dbcbdf90de063e21c1..0000000000000000000000000000000000000000 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/_files/blacklist/composer.txt +++ /dev/null @@ -1 +0,0 @@ -/app/code/Magento/RequireJs diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/_files/blacklist/namespace.txt b/dev/tests/static/testsuite/Magento/Test/Integrity/_files/blacklist/namespace.txt deleted file mode 100644 index 7d7e41695b4a9af66dfec7baf7457320463d2bc0..0000000000000000000000000000000000000000 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/_files/blacklist/namespace.txt +++ /dev/null @@ -1,70 +0,0 @@ -lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/Proxy.php -lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/ElementFactory.php -lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/One/Test.php -lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/Two/Test.php -lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/Three/Test.php -lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/Five/Test.php -lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/Four/Test.php -lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/Six/Test.php -lib/internal/Magento/Framework/ObjectManager/Test/Unit/Config/Reader/_files/ConfigDomMock.php -lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/_files/Sample.php -lib/internal/Magento/Framework/ObjectManager/Test/Unit/_files/DiParent.php -lib/internal/Magento/Framework/ObjectManager/Test/Unit/_files/Child.php -lib/internal/Magento/Framework/ObjectManager/Test/Unit/_files/Child/Circular.php -lib/internal/Magento/Framework/ObjectManager/Test/Unit/_files/Child/Interceptor.php -lib/internal/Magento/Framework/ObjectManager/Test/Unit/_files/Aggregate/WithOptional.php -lib/internal/Magento/Framework/ObjectManager/Test/Unit/_files/Aggregate/AggregateParent.php -lib/internal/Magento/Framework/ObjectManager/Test/Unit/_files/Aggregate/Child.php -lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/_files/Sample.php -lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/_files/ExtensibleSample.php -setup/src/Magento/Setup/Module/I18n/Zend/Exception.php -setup/src/Magento/Setup/Module/I18n/Zend/Console/Getopt/Exception.php -setup/src/Magento/Setup/Module/I18n/Zend/Console/Getopt.php -dev/tests/integration/testsuite/Magento/Setup/Module/I18n/Dictionary/_files/source/app/code/Magento/FirstModule/Model/Model.php -dev/tests/integration/testsuite/Magento/Setup/Module/I18n/Dictionary/_files/source/app/code/Magento/SecondModule/Model/Model.php -dev/tests/integration/testsuite/Magento/Setup/Module/I18n/Dictionary/_files/source/not_magento_dir/Model.php -dev/tests/integration/testsuite/Magento/Setup/Module/I18n/Dictionary/_files/source/app/code/Magento/FirstModule/Helper/Helper.php -dev/tests/integration/testsuite/Magento/Framework/Api/_files/Magento/Wonderland/Api/Data/FakeAddressInterface.php -dev/tests/integration/testsuite/Magento/Framework/Api/_files/Magento/Wonderland/Api/Data/FakeExtensibleOneInterface.php -dev/tests/integration/testsuite/Magento/Framework/Api/_files/Magento/Wonderland/Api/Data/FakeExtensibleTwoInterface.php -dev/tests/integration/testsuite/Magento/Framework/Api/_files/Magento/Wonderland/Api/Data/FakeRegionInterface.php -dev/tests/integration/testsuite/Magento/Framework/Api/_files/Magento/Wonderland/Api/Data/FakeExtensibleOneInterface.php -dev/tests/integration/testsuite/Magento/Framework/Api/_files/Magento/Wonderland/Api/Data/FakeExtensibleTwoInterface.php -dev/tests/integration/testsuite/Magento/Framework/Api/_files/Magento/Wonderland/Model/FakeAddress.php -dev/tests/integration/testsuite/Magento/Framework/Api/_files/Magento/Wonderland/Model/FakeExtensibleOne.php -dev/tests/integration/testsuite/Magento/Framework/Api/_files/Magento/Wonderland/Model/FakeExtensibleTwo.php -dev/tests/integration/testsuite/Magento/Framework/Api/_files/Magento/Wonderland/Model/FakeRegion.php -dev/tests/integration/testsuite/Magento/Framework/Api/_files/Magento/Wonderland/Model/Data/FakeAddress.php -dev/tests/integration/testsuite/Magento/Framework/Api/_files/Magento/Wonderland/Model/Data/FakeRegion.php -dev/tests/integration/testsuite/Magento/Framework/Api/_files/Magento/Wonderland/Model/Data/FakeExtensibleOne.php -dev/tests/integration/testsuite/Magento/Framework/Api/_files/Magento/Wonderland/Model/Data/FakeExtensibleTwo.php -dev/tests/integration/testsuite/Magento/Framework/DataObject/_files/Magento/Wonderland/Api/Data/FakeAttributeMetadataInterface.php -dev/tests/integration/testsuite/Magento/Framework/DataObject/_files/Magento/Wonderland/Api/Data/FakeCustomerInterface.php -dev/tests/integration/testsuite/Magento/Framework/DataObject/_files/Magento/Wonderland/Model/Data/FakeAttributeMetadata.php -dev/tests/integration/testsuite/Magento/Framework/DataObject/_files/Magento/Wonderland/Model/Data/FakeCustomer.php -dev/tests/integration/testsuite/Magento/Framework/DataObject/_files/Magento/Wonderland/Model/FakeAttributeMetadata.php -dev/tests/integration/testsuite/Magento/Framework/DataObject/_files/Magento/Wonderland/Model/FakeCustomer.php -lib/internal/Magento/Framework/Backup/Test/Unit/_files/Fs.php -lib/internal/Magento/Framework/Backup/Test/Unit/_files/Ftp.php -lib/internal/Magento/Framework/Backup/Test/Unit/_files/Gz.php -lib/internal/Magento/Framework/Backup/Test/Unit/_files/Helper.php -lib/internal/Magento/Framework/Backup/Test/Unit/_files/Tar.php -lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForConstructorIntegrity.php -lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForContextAggregation.php -lib/internal/Magento/Framework/Code/Test/Unit/Reader/_files/ClassesForArgumentsReader.php -lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForArgumentSequence.php -lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForTypeDuplication.php -dev/tests/static/testsuite/Magento/Test/Php/_files/phpcs/Magento/Sniffs/Annotations/RequireAnnotatedMethodsSniff.php -dev/tests/integration/testsuite/Magento/Setup/Module/Dependency/_files/code/Magento/FirstModule/Helper/Helper.php -dev/tests/integration/testsuite/Magento/Setup/Module/Dependency/_files/code/Magento/FirstModule/Model/Model.php -dev/tests/integration/testsuite/Magento/Setup/Module/Dependency/_files/code/Magento/FirstModule/Model/WithoutDependencies.php -dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/A/Model/Foo.php -dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/B/Model/Foo.php -dev/tests/integration/testsuite/Magento/Framework/Code/_expected/SourceClassWithNamespaceFactory.php -dev/tests/integration/testsuite/Magento/Framework/Code/_expected/SourceClassWithNamespaceInterceptor.php -dev/tests/integration/testsuite/Magento/Framework/Code/_expected/SourceClassWithNamespaceProxy.php -setup/src/Magento/Setup/Test/Unit/Module/Di/_files/app/code/Magento/SomeModule/Model/Test.php -setup/src/Magento/Setup/Test/Unit/Module/Di/_files/app/code/Magento/SomeModule/Helper/Test.php -setup/src/Magento/Setup/Test/Unit/Module/Di/_files/app/code/Magento/SomeModule/Element.php -setup/src/Magento/Setup/Test/Unit/Module/Di/_files/app/code/Magento/SomeModule/ElementFactory.php -setup/src/Magento/Setup/Test/Unit/Module/Di/_files/app/code/Magento/SomeModule/Model/DoubleColon.php diff --git a/dev/tests/static/testsuite/Magento/Test/Js/LiveCodeTest.php b/dev/tests/static/testsuite/Magento/Test/Js/LiveCodeTest.php index f51c544a10996f58d24608aa7f5a678de929ed2e..94913c98be5adc97bbfccaf5fbde13c9d32dcb7f 100644 --- a/dev/tests/static/testsuite/Magento/Test/Js/LiveCodeTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Js/LiveCodeTest.php @@ -64,8 +64,8 @@ class LiveCodeTest extends \PHPUnit_Framework_TestCase } self::$_reportFile = $reportDir . '/js_report.txt'; @unlink(self::$_reportFile); - $whiteList = Files::readLists(__DIR__ . '/_files/jshint/whitelist/*.txt'); - $blackList = Files::readLists(__DIR__ . '/_files/jshint/blacklist/*.txt'); + $whiteList = Files::init()->readLists(__DIR__ . '/_files/jshint/whitelist/*.txt'); + $blackList = Files::init()->readLists(__DIR__ . '/_files/jshint/blacklist/*.txt'); foreach ($blackList as $listFiles) { self::$_blackListJsFiles = array_merge(self::$_blackListJsFiles, self::_scanJsFile($listFiles)); } diff --git a/dev/tests/static/testsuite/Magento/Test/Js/_files/blacklist/magento.txt b/dev/tests/static/testsuite/Magento/Test/Js/_files/blacklist/magento.txt index 596f370dcd13defcdd7332b3b70466bc80670578..30b6cb91bf29ad8b67664146a90f519880cbf892 100644 --- a/dev/tests/static/testsuite/Magento/Test/Js/_files/blacklist/magento.txt +++ b/dev/tests/static/testsuite/Magento/Test/Js/_files/blacklist/magento.txt @@ -652,3 +652,505 @@ lib/web/mage/validation/validation.js lib/web/mage/view/composite.js lib/web/mage/webapi.js lib/web/mage/zoom.js +vendor/magento/module-admin-notification/view/adminhtml/requirejs-config.js +vendor/magento/module-admin-notification/view/adminhtml/web/system/notification.js +vendor/magento/module-admin-notification/view/adminhtml/web/toolbar_entry.js +vendor/magento/module-authorizenet/view/adminhtml/web/js/direct-post.js +vendor/magento/module-authorizenet/view/frontend/requirejs-config.js +vendor/magento/module-authorizenet/view/frontend/web/js/view/payment/authorizenet.js +vendor/magento/module-authorizenet/view/frontend/web/js/view/payment/method-renderer/authorizenet-directpost.js +vendor/magento/module-backend/view/adminhtml/web/js/bootstrap/editor.js +vendor/magento/module-braintree/view/adminhtml/requirejs-config.js +vendor/magento/module-braintree/view/adminhtml/web/js/cc-data.js +vendor/magento/module-braintree/view/adminhtml/web/js/cc-form.js +vendor/magento/module-braintree/view/frontend/requirejs-config.js +vendor/magento/module-braintree/view/frontend/web/js/braintree-paypal-shortcut.js +vendor/magento/module-braintree/view/frontend/web/js/cc-data.js +vendor/magento/module-braintree/view/frontend/web/js/cc-edit-form.js +vendor/magento/module-braintree/view/frontend/web/js/cc-form.js +vendor/magento/module-braintree/view/frontend/web/js/view/payment/braintree-methods.js +vendor/magento/module-braintree/view/frontend/web/js/view/payment/method-renderer/braintree-paypal.js +vendor/magento/module-braintree/view/frontend/web/js/view/payment/method-renderer/cc-form.js +vendor/magento/module-bundle/view/adminhtml/web/js/bundle-product.js +vendor/magento/module-bundle/view/base/web/js/price-bundle.js +vendor/magento/module-bundle/view/frontend/requirejs-config.js +vendor/magento/module-bundle/view/frontend/web/js/float.js +vendor/magento/module-bundle/view/frontend/web/js/product-summary.js +vendor/magento/module-bundle/view/frontend/web/js/slide.js +vendor/magento/module-captcha/view/frontend/requirejs-config.js +vendor/magento/module-captcha/view/frontend/web/captcha.js +vendor/magento/module-captcha/view/frontend/web/js/action/refresh.js +vendor/magento/module-captcha/view/frontend/web/js/model/captcha.js +vendor/magento/module-captcha/view/frontend/web/js/model/captcha-list.js +vendor/magento/module-captcha/view/frontend/web/js/view/checkout/default-captcha.js +vendor/magento/module-captcha/view/frontend/web/js/view/checkout/login-captcha.js +vendor/magento/module-captcha/view/frontend/web/onepage.js +vendor/magento/module-catalog/view/adminhtml/requirejs-config.js +vendor/magento/module-catalog/view/adminhtml/web/catalog/base-image-uploader.js +vendor/magento/module-catalog/view/adminhtml/web/catalog/category/edit.js +vendor/magento/module-catalog/view/adminhtml/web/catalog/category/form.js +vendor/magento/module-catalog/view/adminhtml/web/catalog/product-attributes.js +vendor/magento/module-catalog/view/adminhtml/web/catalog/product.js +vendor/magento/module-catalog/view/adminhtml/web/catalog/product/composite/configure.js +vendor/magento/module-catalog/view/adminhtml/web/catalog/type-switcher.js +vendor/magento/module-catalog/view/adminhtml/web/js/category-tree.js +vendor/magento/module-catalog/view/adminhtml/web/js/custom-options.js +vendor/magento/module-catalog/view/adminhtml/web/js/new-category-dialog.js +vendor/magento/module-catalog/view/adminhtml/web/js/product-gallery.js +vendor/magento/module-catalog/view/base/web/js/price-box.js +vendor/magento/module-catalog/view/base/web/js/price-option-date.js +vendor/magento/module-catalog/view/base/web/js/price-option-file.js +vendor/magento/module-catalog/view/base/web/js/price-options.js +vendor/magento/module-catalog/view/base/web/js/price-utils.js +vendor/magento/module-catalog/view/base/web/js/tier-price.js +vendor/magento/module-catalog/view/frontend/requirejs-config.js +vendor/magento/module-catalog/view/frontend/web/js/catalog-add-to-cart.js +vendor/magento/module-catalog/view/frontend/web/js/compare.js +vendor/magento/module-catalog/view/frontend/web/js/gallery.js +vendor/magento/module-catalog/view/frontend/web/js/list.js +vendor/magento/module-catalog/view/frontend/web/js/product/list/toolbar.js +vendor/magento/module-catalog/view/frontend/web/js/related-products.js +vendor/magento/module-catalog/view/frontend/web/js/upsell-products.js +vendor/magento/module-catalog/view/frontend/web/js/view/compare-products.js +vendor/magento/module-catalog/view/frontend/web/js/view/image.js +vendor/magento/module-catalog/view/frontend/web/js/zoom.js +vendor/magento/module-catalog/view/frontend/web/product/view/validation.js +vendor/magento/module-catalog-search/view/frontend/requirejs-config.js +vendor/magento/module-checkout/view/frontend/requirejs-config.js +vendor/magento/module-checkout/view/frontend/web/js/action/create-billing-address.js +vendor/magento/module-checkout/view/frontend/web/js/action/create-shipping-address.js +vendor/magento/module-checkout/view/frontend/web/js/action/get-payment-information.js +vendor/magento/module-checkout/view/frontend/web/js/action/get-totals.js +vendor/magento/module-checkout/view/frontend/web/js/action/place-order.js +vendor/magento/module-checkout/view/frontend/web/js/action/select-billing-address.js +vendor/magento/module-checkout/view/frontend/web/js/action/select-payment-method.js +vendor/magento/module-checkout/view/frontend/web/js/action/select-shipping-address.js +vendor/magento/module-checkout/view/frontend/web/js/action/select-shipping-method.js +vendor/magento/module-checkout/view/frontend/web/js/action/set-payment-information.js +vendor/magento/module-checkout/view/frontend/web/js/action/set-shipping-information.js +vendor/magento/module-checkout/view/frontend/web/js/checkout-data.js +vendor/magento/module-checkout/view/frontend/web/js/discount-codes.js +vendor/magento/module-checkout/view/frontend/web/js/model/address-converter.js +vendor/magento/module-checkout/view/frontend/web/js/model/cart/estimate-service.js +vendor/magento/module-checkout/view/frontend/web/js/model/cart/totals-processor/default.js +vendor/magento/module-checkout/view/frontend/web/js/model/checkout-data-resolver.js +vendor/magento/module-checkout/view/frontend/web/js/model/error-processor.js +vendor/magento/module-checkout/view/frontend/web/js/model/new-customer-address.js +vendor/magento/module-checkout/view/frontend/web/js/model/payment-service.js +vendor/magento/module-checkout/view/frontend/web/js/model/payment/additional-validators.js +vendor/magento/module-checkout/view/frontend/web/js/model/payment/method-converter.js +vendor/magento/module-checkout/view/frontend/web/js/model/payment/method-list.js +vendor/magento/module-checkout/view/frontend/web/js/model/payment/renderer-list.js +vendor/magento/module-checkout/view/frontend/web/js/model/postcode-validator.js +vendor/magento/module-checkout/view/frontend/web/js/model/quote.js +vendor/magento/module-checkout/view/frontend/web/js/model/resource-url-manager.js +vendor/magento/module-checkout/view/frontend/web/js/model/shipping-address/form-popup-state.js +vendor/magento/module-checkout/view/frontend/web/js/model/shipping-rate-processor/customer-address.js +vendor/magento/module-checkout/view/frontend/web/js/model/shipping-rate-processor/new-address.js +vendor/magento/module-checkout/view/frontend/web/js/model/shipping-rate-registry.js +vendor/magento/module-checkout/view/frontend/web/js/model/shipping-rate-service.js +vendor/magento/module-checkout/view/frontend/web/js/model/shipping-rates-validation-rules.js +vendor/magento/module-checkout/view/frontend/web/js/model/shipping-rates-validator.js +vendor/magento/module-checkout/view/frontend/web/js/model/shipping-save-processor.js +vendor/magento/module-checkout/view/frontend/web/js/model/shipping-save-processor/default.js +vendor/magento/module-checkout/view/frontend/web/js/model/shipping-service.js +vendor/magento/module-checkout/view/frontend/web/js/model/sidebar.js +vendor/magento/module-checkout/view/frontend/web/js/model/step-loader.js +vendor/magento/module-checkout/view/frontend/web/js/model/step-navigator.js +vendor/magento/module-checkout/view/frontend/web/js/model/totals.js +vendor/magento/module-checkout/view/frontend/web/js/model/url-builder.js +vendor/magento/module-checkout/view/frontend/web/js/opc-billing-info.js +vendor/magento/module-checkout/view/frontend/web/js/opc-checkout-method.js +vendor/magento/module-checkout/view/frontend/web/js/opc-order-review.js +vendor/magento/module-checkout/view/frontend/web/js/opc-payment-info.js +vendor/magento/module-checkout/view/frontend/web/js/opc-shipping-info.js +vendor/magento/module-checkout/view/frontend/web/js/opc-shipping-method.js +vendor/magento/module-checkout/view/frontend/web/js/opcheckout.js +vendor/magento/module-checkout/view/frontend/web/js/payment-authentication.js +vendor/magento/module-checkout/view/frontend/web/js/payment.js +vendor/magento/module-checkout/view/frontend/web/js/proceed-to-checkout.js +vendor/magento/module-checkout/view/frontend/web/js/region-updater.js +vendor/magento/module-checkout/view/frontend/web/js/shopping-cart.js +vendor/magento/module-checkout/view/frontend/web/js/sidebar.js +vendor/magento/module-checkout/view/frontend/web/js/view/authentication.js +vendor/magento/module-checkout/view/frontend/web/js/view/before-place-order.js +vendor/magento/module-checkout/view/frontend/web/js/view/billing-address.js +vendor/magento/module-checkout/view/frontend/web/js/view/cart/shipping-estimation.js +vendor/magento/module-checkout/view/frontend/web/js/view/cart/shipping-rates.js +vendor/magento/module-checkout/view/frontend/web/js/view/cart/totals.js +vendor/magento/module-checkout/view/frontend/web/js/view/cart/totals/shipping.js +vendor/magento/module-checkout/view/frontend/web/js/view/estimation.js +vendor/magento/module-checkout/view/frontend/web/js/view/form/element/email.js +vendor/magento/module-checkout/view/frontend/web/js/view/minicart.js +vendor/magento/module-checkout/view/frontend/web/js/view/payment.js +vendor/magento/module-checkout/view/frontend/web/js/view/payment/default.js +vendor/magento/module-checkout/view/frontend/web/js/view/payment/list.js +vendor/magento/module-checkout/view/frontend/web/js/view/progress-bar.js +vendor/magento/module-checkout/view/frontend/web/js/view/registration.js +vendor/magento/module-checkout/view/frontend/web/js/view/review/actions.js +vendor/magento/module-checkout/view/frontend/web/js/view/review/actions/default.js +vendor/magento/module-checkout/view/frontend/web/js/view/shipping-address/address-renderer/default.js +vendor/magento/module-checkout/view/frontend/web/js/view/shipping-address/list.js +vendor/magento/module-checkout/view/frontend/web/js/view/shipping-information.js +vendor/magento/module-checkout/view/frontend/web/js/view/shipping-information/address-renderer/default.js +vendor/magento/module-checkout/view/frontend/web/js/view/shipping-information/list.js +vendor/magento/module-checkout/view/frontend/web/js/view/shipping.js +vendor/magento/module-checkout/view/frontend/web/js/view/sidebar.js +vendor/magento/module-checkout/view/frontend/web/js/view/summary.js +vendor/magento/module-checkout/view/frontend/web/js/view/summary/abstract-total.js +vendor/magento/module-checkout/view/frontend/web/js/view/summary/cart-items.js +vendor/magento/module-checkout/view/frontend/web/js/view/summary/grand-total.js +vendor/magento/module-checkout/view/frontend/web/js/view/summary/item/details.js +vendor/magento/module-checkout/view/frontend/web/js/view/summary/item/details/subtotal.js +vendor/magento/module-checkout/view/frontend/web/js/view/summary/item/details/thumbnail.js +vendor/magento/module-checkout/view/frontend/web/js/view/summary/shipping.js +vendor/magento/module-checkout/view/frontend/web/js/view/summary/subtotal.js +vendor/magento/module-checkout-agreements/view/frontend/requirejs-config.js +vendor/magento/module-checkout-agreements/view/frontend/web/js/model/agreement-validator.js +vendor/magento/module-checkout-agreements/view/frontend/web/js/model/agreements-modal.js +vendor/magento/module-checkout-agreements/view/frontend/web/js/model/place-order-mixin.js +vendor/magento/module-checkout-agreements/view/frontend/web/js/view/agreement-validation.js +vendor/magento/module-checkout-agreements/view/frontend/web/js/view/checkout-agreements.js +vendor/magento/module-cms/view/adminhtml/requirejs-config.js +vendor/magento/module-cms/view/adminhtml/web/js/folder-tree.js +vendor/magento/module-configurable-product/view/adminhtml/requirejs-config.js +vendor/magento/module-configurable-product/view/adminhtml/web/catalog/product/attribute.js +vendor/magento/module-configurable-product/view/adminhtml/web/js/configurable.js +vendor/magento/module-configurable-product/view/adminhtml/web/js/variations/steps/attributes_values.js +vendor/magento/module-configurable-product/view/adminhtml/web/js/variations/steps/bulk.js +vendor/magento/module-configurable-product/view/adminhtml/web/js/variations/steps/select_attributes.js +vendor/magento/module-configurable-product/view/adminhtml/web/js/variations/steps/summary.js +vendor/magento/module-configurable-product/view/adminhtml/web/js/variations/variations.js +vendor/magento/module-configurable-product/view/frontend/requirejs-config.js +vendor/magento/module-configurable-product/view/frontend/web/js/configurable.js +vendor/magento/module-cookie/-view/adminhtml/requirejs-config.js +vendor/magento/module-cookie/-view/frontend/requirejs-config.js +vendor/magento/module-cookie/-view/frontend/web/js/notices.js +vendor/magento/module-cookie/-view/frontend/web/js/require-cookie.js +vendor/magento/module-customer/view/adminhtml/requirejs-config.js +vendor/magento/module-customer/view/adminhtml/web/edit/tab/js/addresses.js +vendor/magento/module-customer/view/frontend/requirejs-config.js +vendor/magento/module-customer/view/frontend/web/address.js +vendor/magento/module-customer/view/frontend/web/js/action/check-email-availability.js +vendor/magento/module-customer/view/frontend/web/js/action/login.js +vendor/magento/module-customer/view/frontend/web/js/checkout-balance.js +vendor/magento/module-customer/view/frontend/web/js/customer-data.js +vendor/magento/module-customer/view/frontend/web/js/model/address-list.js +vendor/magento/module-customer/view/frontend/web/js/model/authentication-popup.js +vendor/magento/module-customer/view/frontend/web/js/model/customer-addresses.js +vendor/magento/module-customer/view/frontend/web/js/model/customer.js +vendor/magento/module-customer/view/frontend/web/js/model/customer/address.js +vendor/magento/module-customer/view/frontend/web/js/section-config.js +vendor/magento/module-customer/view/frontend/web/js/view/authentication-popup.js +vendor/magento/module-customer/view/frontend/web/js/view/customer.js +vendor/magento/module-customer/view/frontend/web/set-password.js +vendor/magento/module-dhl/view/frontend/web/js/model/shipping-rates-validation-rules.js +vendor/magento/module-dhl/view/frontend/web/js/model/shipping-rates-validator.js +vendor/magento/module-dhl/view/frontend/web/js/view/shipping-rates-validation.js +vendor/magento/module-downloadable/view/frontend/requirejs-config.js +vendor/magento/module-downloadable/view/frontend/web/downloadable.js +vendor/magento/module-fedex/view/frontend/web/js/model/shipping-rates-validation-rules.js +vendor/magento/module-fedex/view/frontend/web/js/model/shipping-rates-validator.js +vendor/magento/module-fedex/view/frontend/web/js/view/shipping-rates-validation.js +vendor/magento/module-gift-message/view/frontend/requirejs-config.js +vendor/magento/module-gift-message/view/frontend/web/extra-options.js +vendor/magento/module-gift-message/view/frontend/web/gift-options.js +vendor/magento/module-gift-message/view/frontend/web/js/action/gift-options.js +vendor/magento/module-gift-message/view/frontend/web/js/model/gift-message.js +vendor/magento/module-gift-message/view/frontend/web/js/model/gift-options.js +vendor/magento/module-gift-message/view/frontend/web/js/model/url-builder.js +vendor/magento/module-gift-message/view/frontend/web/js/view/gift-message.js +vendor/magento/module-grouped-product/view/adminhtml/requirejs-config.js +vendor/magento/module-grouped-product/view/adminhtml/web/js/grouped-product.js +vendor/magento/module-integration/view/adminhtml/requirejs-config.js +vendor/magento/module-integration/view/adminhtml/web/js/integration.js +vendor/magento/module-msrp/view/base/web/js/msrp.js +vendor/magento/module-msrp/view/frontend/requirejs-config.js +vendor/magento/module-multishipping/view/frontend/requirejs-config.js +vendor/magento/module-multishipping/view/frontend/web/js/multi-shipping.js +vendor/magento/module-multishipping/view/frontend/web/js/overview.js +vendor/magento/module-offline-payments/view/frontend/web/js/view/payment/method-renderer/banktransfer-method.js +vendor/magento/module-offline-payments/view/frontend/web/js/view/payment/method-renderer/cashondelivery-method.js +vendor/magento/module-offline-payments/view/frontend/web/js/view/payment/method-renderer/checkmo-method.js +vendor/magento/module-offline-payments/view/frontend/web/js/view/payment/method-renderer/purchaseorder-method.js +vendor/magento/module-offline-payments/view/frontend/web/js/view/payment/offline-payments.js +vendor/magento/module-offline-shipping/view/frontend/web/js/model/shipping-rates-validation-rules/flatrate.js +vendor/magento/module-offline-shipping/view/frontend/web/js/model/shipping-rates-validation-rules/freeshipping.js +vendor/magento/module-offline-shipping/view/frontend/web/js/model/shipping-rates-validation-rules/tablerate.js +vendor/magento/module-offline-shipping/view/frontend/web/js/model/shipping-rates-validator/flatrate.js +vendor/magento/module-offline-shipping/view/frontend/web/js/model/shipping-rates-validator/freeshipping.js +vendor/magento/module-offline-shipping/view/frontend/web/js/model/shipping-rates-validator/tablerate.js +vendor/magento/module-offline-shipping/view/frontend/web/js/view/shipping-rates-validation/flatrate.js +vendor/magento/module-offline-shipping/view/frontend/web/js/view/shipping-rates-validation/freeshipping.js +vendor/magento/module-offline-shipping/view/frontend/web/js/view/shipping-rates-validation/tablerate.js +vendor/magento/module-page-cache/view/frontend/requirejs-config.js +vendor/magento/module-page-cache/view/frontend/web/js/page-cache.js +vendor/magento/module-payment/view/adminhtml/web/transparent.js +vendor/magento/module-payment/view/frontend/requirejs-config.js +vendor/magento/module-payment/view/frontend/web/cc-type.js +vendor/magento/module-payment/view/frontend/web/js/model/credit-card-validation/credit-card-data.js +vendor/magento/module-payment/view/frontend/web/js/model/credit-card-validation/credit-card-number-validator.js +vendor/magento/module-payment/view/frontend/web/js/model/credit-card-validation/credit-card-number-validator/credit-card-type.js +vendor/magento/module-payment/view/frontend/web/js/model/credit-card-validation/credit-card-number-validator/luhn10-validator.js +vendor/magento/module-payment/view/frontend/web/js/model/credit-card-validation/cvv-validator.js +vendor/magento/module-payment/view/frontend/web/js/model/credit-card-validation/expiration-date-validator.js +vendor/magento/module-payment/view/frontend/web/js/model/credit-card-validation/expiration-date-validator/expiration-month-validator.js +vendor/magento/module-payment/view/frontend/web/js/model/credit-card-validation/expiration-date-validator/expiration-year-validator.js +vendor/magento/module-payment/view/frontend/web/js/model/credit-card-validation/expiration-date-validator/parse-date.js +vendor/magento/module-payment/view/frontend/web/js/model/credit-card-validation/validator.js +vendor/magento/module-payment/view/frontend/web/js/view/payment/cc-form.js +vendor/magento/module-payment/view/frontend/web/js/view/payment/iframe.js +vendor/magento/module-payment/view/frontend/web/js/view/payment/method-renderer/free-method.js +vendor/magento/module-payment/view/frontend/web/js/view/payment/payments.js +vendor/magento/module-payment/view/frontend/web/transparent.js +vendor/magento/module-paypal/view/adminhtml/web/js/predicate/confirm.js +vendor/magento/module-paypal/view/adminhtml/web/js/rule.js +vendor/magento/module-paypal/view/adminhtml/web/js/rules/conflict.js +vendor/magento/module-paypal/view/adminhtml/web/js/rules/disable.js +vendor/magento/module-paypal/view/adminhtml/web/js/rules/payflow/bml/disable-conditional-express.js +vendor/magento/module-paypal/view/adminhtml/web/js/rules/payflow/bml/disable-conditional.js +vendor/magento/module-paypal/view/adminhtml/web/js/rules/payflow/bml/disable.js +vendor/magento/module-paypal/view/adminhtml/web/js/rules/payflow/bml/enable-conditional.js +vendor/magento/module-paypal/view/adminhtml/web/js/rules/payflow/bml/enable.js +vendor/magento/module-paypal/view/adminhtml/web/js/rules/payflow/bml/lock-conditional.js +vendor/magento/module-paypal/view/adminhtml/web/js/rules/payflow/express/disable-conditional.js +vendor/magento/module-paypal/view/adminhtml/web/js/rules/payflow/express/disable.js +vendor/magento/module-paypal/view/adminhtml/web/js/rules/payflow/express/enable-conditional.js +vendor/magento/module-paypal/view/adminhtml/web/js/rules/payflow/express/enable.js +vendor/magento/module-paypal/view/adminhtml/web/js/rules/payflow/express/lock-conditional.js +vendor/magento/module-paypal/view/adminhtml/web/js/rules/paypal/bml/disable-conditional.js +vendor/magento/module-paypal/view/adminhtml/web/js/rules/paypal/bml/disable.js +vendor/magento/module-paypal/view/adminhtml/web/js/rules/paypal/bml/enable.js +vendor/magento/module-paypal/view/adminhtml/web/js/rules/paypal/express/disable.js +vendor/magento/module-paypal/view/adminhtml/web/js/rules/paypal/express/lock-configuration-conditional.js +vendor/magento/module-paypal/view/adminhtml/web/js/rules/paypal/express/lock-configuration.js +vendor/magento/module-paypal/view/adminhtml/web/js/rules/paypal/express/mark-disable.js +vendor/magento/module-paypal/view/adminhtml/web/js/rules/paypal/express/unlock-configuration.js +vendor/magento/module-paypal/view/adminhtml/web/js/rules/simple/disable.js +vendor/magento/module-paypal/view/adminhtml/web/js/rules/simple/mark-enable.js +vendor/magento/module-paypal/view/adminhtml/web/js/solution.js +vendor/magento/module-paypal/view/adminhtml/web/js/solutions.js +vendor/magento/module-paypal/view/base/requirejs-config.js +vendor/magento/module-paypal/view/frontend/requirejs-config.js +vendor/magento/module-paypal/view/frontend/web/js/action/set-payment-method.js +vendor/magento/module-paypal/view/frontend/web/js/model/iframe-redirect.js +vendor/magento/module-paypal/view/frontend/web/js/model/iframe.js +vendor/magento/module-paypal/view/frontend/web/js/opcheckout.js +vendor/magento/module-paypal/view/frontend/web/js/paypal-checkout.js +vendor/magento/module-paypal/view/frontend/web/js/view/payment/method-renderer/iframe-methods.js +vendor/magento/module-paypal/view/frontend/web/js/view/payment/method-renderer/payflow-express-bml.js +vendor/magento/module-paypal/view/frontend/web/js/view/payment/method-renderer/payflow-express.js +vendor/magento/module-paypal/view/frontend/web/js/view/payment/method-renderer/payflowpro-method.js +vendor/magento/module-paypal/view/frontend/web/js/view/payment/method-renderer/paypal-billing-agreement.js +vendor/magento/module-paypal/view/frontend/web/js/view/payment/method-renderer/paypal-express-abstract.js +vendor/magento/module-paypal/view/frontend/web/js/view/payment/method-renderer/paypal-express-bml.js +vendor/magento/module-paypal/view/frontend/web/js/view/payment/method-renderer/paypal-express.js +vendor/magento/module-paypal/view/frontend/web/js/view/payment/paypal-payments.js +vendor/magento/module-paypal/view/frontend/web/js/view/review/actions/iframe.js +vendor/magento/module-paypal/view/frontend/web/order-review.js +vendor/magento/module-persistent/view/frontend/web/js/view/remember-me.js +vendor/magento/module-reports/view/frontend/requirejs-config.js +vendor/magento/module-reports/view/frontend/web/js/recently-viewed.js +vendor/magento/module-review/view/adminhtml/web/js/rating.js +vendor/magento/module-review/view/frontend/web/js/error-placement.js +vendor/magento/module-review/view/frontend/web/js/process-reviews.js +vendor/magento/module-review/view/frontend/web/js/view/review.js +vendor/magento/module-rule/view/adminhtml/web/rules.js +vendor/magento/module-sales/view/adminhtml/requirejs-config.js +vendor/magento/module-sales/view/adminhtml/web/js/bootstrap/order-create-index.js +vendor/magento/module-sales/view/adminhtml/web/order/create/form.js +vendor/magento/module-sales/view/adminhtml/web/order/create/giftmessage.js +vendor/magento/module-sales/view/adminhtml/web/order/create/scripts.js +vendor/magento/module-sales/view/adminhtml/web/order/edit/message.js +vendor/magento/module-sales/view/adminhtml/web/order/giftoptions_tooltip.js +vendor/magento/module-sales/view/frontend/requirejs-config.js +vendor/magento/module-sales/view/frontend/web/gift-message.js +vendor/magento/module-sales/view/frontend/web/js/view/last-ordered-items.js +vendor/magento/module-sales/view/frontend/web/orders-returns.js +vendor/magento/module-sales-rule/view/frontend/web/js/action/cancel-coupon.js +vendor/magento/module-sales-rule/view/frontend/web/js/action/set-coupon-code.js +vendor/magento/module-sales-rule/view/frontend/web/js/view/cart/totals/discount.js +vendor/magento/module-sales-rule/view/frontend/web/js/view/payment/discount.js +vendor/magento/module-sales-rule/view/frontend/web/js/view/summary/discount.js +vendor/magento/module-search/view/frontend/requirejs-config.js +vendor/magento/module-search/view/frontend/web/form-mini.js +vendor/magento/module-send-friend/view/frontend/web/back-event.js +vendor/magento/module-shipping/view/adminhtml/web/order/packaging.js +vendor/magento/module-shipping/view/frontend/web/js/model/config.js +vendor/magento/module-shipping/view/frontend/web/js/view/checkout/shipping/shipping-policy.js +vendor/magento/module-store/view/base/requirejs-config.js +vendor/magento/module-store/view/base/web/js/listing/filter/store.js +vendor/magento/module-swagger/view/frontend/web/swagger-ui/js/lang/en.js +vendor/magento/module-swagger/view/frontend/web/swagger-ui/js/lang/es.js +vendor/magento/module-swagger/view/frontend/web/swagger-ui/js/lang/pt.js +vendor/magento/module-swagger/view/frontend/web/swagger-ui/js/lang/ru.js +vendor/magento/module-swagger/view/frontend/web/swagger-ui/js/lang/translator.js +vendor/magento/module-swagger/view/frontend/web/swagger-ui/js/lib/backbone-min.js +vendor/magento/module-swagger/view/frontend/web/swagger-ui/js/lib/handlebars-2.0.0.js +vendor/magento/module-swagger/view/frontend/web/swagger-ui/js/lib/highlight.7.3.pack.js +vendor/magento/module-swagger/view/frontend/web/swagger-ui/js/lib/jquery-1.8.0.min.js +vendor/magento/module-swagger/view/frontend/web/swagger-ui/js/lib/jquery.ba-bbq.min.js +vendor/magento/module-swagger/view/frontend/web/swagger-ui/js/lib/jquery.slideto.min.js +vendor/magento/module-swagger/view/frontend/web/swagger-ui/js/lib/jquery.wiggle.min.js +vendor/magento/module-swagger/view/frontend/web/swagger-ui/js/lib/marked.js +vendor/magento/module-swagger/view/frontend/web/swagger-ui/js/lib/swagger-oauth.js +vendor/magento/module-swagger/view/frontend/web/swagger-ui/js/lib/underscore-min.js +vendor/magento/module-swagger/view/frontend/web/swagger-ui/js/swagger-ui.js +vendor/magento/module-swatches/view/adminhtml/web/js/-type-changer.js +vendor/magento/module-swatches/view/frontend/requirejs-config.js +vendor/magento/module-swatches/view/frontend/web/js/-swatch-renderer.js +vendor/magento/module-tax/view/adminhtml/web/js/bootstrap.js +vendor/magento/module-tax/view/frontend/web/js/view/checkout/cart/totals/grand-total.js +vendor/magento/module-tax/view/frontend/web/js/view/checkout/cart/totals/shipping.js +vendor/magento/module-tax/view/frontend/web/js/view/checkout/cart/totals/tax.js +vendor/magento/module-tax/view/frontend/web/js/view/checkout/minicart/subtotal/totals.js +vendor/magento/module-tax/view/frontend/web/js/view/checkout/shipping_method/price.js +vendor/magento/module-tax/view/frontend/web/js/view/checkout/summary/grand-total.js +vendor/magento/module-tax/view/frontend/web/js/view/checkout/summary/item/details/subtotal.js +vendor/magento/module-tax/view/frontend/web/js/view/checkout/summary/shipping.js +vendor/magento/module-tax/view/frontend/web/js/view/checkout/summary/subtotal.js +vendor/magento/module-tax/view/frontend/web/js/view/checkout/summary/tax.js +vendor/magento/module-theme/view/adminhtml/requirejs-config.js +vendor/magento/module-theme/view/adminhtml/web/js/bootstrap.js +vendor/magento/module-theme/view/adminhtml/web/js/custom-js-list.js +vendor/magento/module-theme/view/adminhtml/web/js/form.js +vendor/magento/module-theme/view/adminhtml/web/js/sortable.js +vendor/magento/module-theme/view/base/requirejs-config.js +vendor/magento/module-theme/view/frontend/requirejs-config.js +vendor/magento/module-theme/view/frontend/web/js/row-builder.js +vendor/magento/module-theme/view/frontend/web/js/truncate.js +vendor/magento/module-theme/view/frontend/web/js/view/messages.js +vendor/magento/module-theme/view/frontend/web/menu.js +vendor/magento/module-translation/view/base/web/js/add-to-translate.js +vendor/magento/module-translation/view/base/web/js/i18n-config.js +vendor/magento/module-translation/view/frontend/requirejs-config.js +vendor/magento/module-translation/view/frontend/web/add-class.js +vendor/magento/module-ui/view/base/requirejs-config.js +vendor/magento/module-ui/view/base/web/js/block-loader.js +vendor/magento/module-ui/view/base/web/js/core/app.js +vendor/magento/module-ui/view/base/web/js/core/renderer/layout.js +vendor/magento/module-ui/view/base/web/js/core/renderer/types.js +vendor/magento/module-ui/view/base/web/js/form/adapter.js +vendor/magento/module-ui/view/base/web/js/form/client.js +vendor/magento/module-ui/view/base/web/js/form/components/area.js +vendor/magento/module-ui/view/base/web/js/form/components/collection.js +vendor/magento/module-ui/view/base/web/js/form/components/collection/item.js +vendor/magento/module-ui/view/base/web/js/form/components/fieldset.js +vendor/magento/module-ui/view/base/web/js/form/components/group.js +vendor/magento/module-ui/view/base/web/js/form/components/html.js +vendor/magento/module-ui/view/base/web/js/form/components/tab_group.js +vendor/magento/module-ui/view/base/web/js/form/components/tab.js +vendor/magento/module-ui/view/base/web/js/form/element/abstract.js +vendor/magento/module-ui/view/base/web/js/form/element/boolean.js +vendor/magento/module-ui/view/base/web/js/form/element/date.js +vendor/magento/module-ui/view/base/web/js/form/element/helpers/options.js +vendor/magento/module-ui/view/base/web/js/form/element/multiselect.js +vendor/magento/module-ui/view/base/web/js/form/element/post-code.js +vendor/magento/module-ui/view/base/web/js/form/element/region.js +vendor/magento/module-ui/view/base/web/js/form/element/select.js +vendor/magento/module-ui/view/base/web/js/form/element/textarea.js +vendor/magento/module-ui/view/base/web/js/form/element/ui-select.js +vendor/magento/module-ui/view/base/web/js/form/form.js +vendor/magento/module-ui/view/base/web/js/form/provider.js +vendor/magento/module-ui/view/base/web/js/grid/columns/actions.js +vendor/magento/module-ui/view/base/web/js/grid/columns/column.js +vendor/magento/module-ui/view/base/web/js/grid/columns/date.js +vendor/magento/module-ui/view/base/web/js/grid/columns/multiselect.js +vendor/magento/module-ui/view/base/web/js/grid/columns/select.js +vendor/magento/module-ui/view/base/web/js/grid/columns/thumbnail.js +vendor/magento/module-ui/view/base/web/js/grid/controls/bookmarks/bookmarks.js +vendor/magento/module-ui/view/base/web/js/grid/controls/bookmarks/storage.js +vendor/magento/module-ui/view/base/web/js/grid/controls/bookmarks/view.js +vendor/magento/module-ui/view/base/web/js/grid/controls/columns.js +vendor/magento/module-ui/view/base/web/js/grid/dnd.js +vendor/magento/module-ui/view/base/web/js/grid/editing/bulk.js +vendor/magento/module-ui/view/base/web/js/grid/editing/client.js +vendor/magento/module-ui/view/base/web/js/grid/editing/editor-view.js +vendor/magento/module-ui/view/base/web/js/grid/editing/editor.js +vendor/magento/module-ui/view/base/web/js/grid/editing/record.js +vendor/magento/module-ui/view/base/web/js/grid/export.js +vendor/magento/module-ui/view/base/web/js/grid/filters/chips.js +vendor/magento/module-ui/view/base/web/js/grid/filters/filters.js +vendor/magento/module-ui/view/base/web/js/grid/filters/group.js +vendor/magento/module-ui/view/base/web/js/grid/listing.js +vendor/magento/module-ui/view/base/web/js/grid/massactions.js +vendor/magento/module-ui/view/base/web/js/grid/paging/paging.js +vendor/magento/module-ui/view/base/web/js/grid/paging/sizes.js +vendor/magento/module-ui/view/base/web/js/grid/provider.js +vendor/magento/module-ui/view/base/web/js/grid/resize.js +vendor/magento/module-ui/view/base/web/js/grid/search/search.js +vendor/magento/module-ui/view/base/web/js/grid/tree-massactions.js +vendor/magento/module-ui/view/base/web/js/lib/class.js +vendor/magento/module-ui/view/base/web/js/lib/collapsible.js +vendor/magento/module-ui/view/base/web/js/lib/component/core.js +vendor/magento/module-ui/view/base/web/js/lib/component/links.js +vendor/magento/module-ui/view/base/web/js/lib/component/main.js +vendor/magento/module-ui/view/base/web/js/lib/component/manip.js +vendor/magento/module-ui/view/base/web/js/lib/component/provider.js +vendor/magento/module-ui/view/base/web/js/lib/component/traversal.js +vendor/magento/module-ui/view/base/web/js/lib/events.js +vendor/magento/module-ui/view/base/web/js/lib/key-codes.js +vendor/magento/module-ui/view/base/web/js/lib/ko/bind/after-render.js +vendor/magento/module-ui/view/base/web/js/lib/ko/bind/class.js +vendor/magento/module-ui/view/base/web/js/lib/ko/bind/datepicker.js +vendor/magento/module-ui/view/base/web/js/lib/ko/bind/fade-visible.js +vendor/magento/module-ui/view/base/web/js/lib/ko/bind/i18n.js +vendor/magento/module-ui/view/base/web/js/lib/ko/bind/keyboard.js +vendor/magento/module-ui/view/base/web/js/lib/ko/bind/mage-init.js +vendor/magento/module-ui/view/base/web/js/lib/ko/bind/optgroup.js +vendor/magento/module-ui/view/base/web/js/lib/ko/bind/outer_click.js +vendor/magento/module-ui/view/base/web/js/lib/ko/bind/scope.js +vendor/magento/module-ui/view/base/web/js/lib/ko/bind/stop_propagation.js +vendor/magento/module-ui/view/base/web/js/lib/ko/extender/bound-nodes.js +vendor/magento/module-ui/view/base/web/js/lib/ko/extender/observable_array.js +vendor/magento/module-ui/view/base/web/js/lib/ko/initialize.js +vendor/magento/module-ui/view/base/web/js/lib/ko/template/engine.js +vendor/magento/module-ui/view/base/web/js/lib/ko/template/observable_source.js +vendor/magento/module-ui/view/base/web/js/lib/loader.js +vendor/magento/module-ui/view/base/web/js/lib/registry/events.js +vendor/magento/module-ui/view/base/web/js/lib/registry/registry.js +vendor/magento/module-ui/view/base/web/js/lib/registry/storage.js +vendor/magento/module-ui/view/base/web/js/lib/renderer/renderer.js +vendor/magento/module-ui/view/base/web/js/lib/spinner.js +vendor/magento/module-ui/view/base/web/js/lib/step-wizard.js +vendor/magento/module-ui/view/base/web/js/lib/storage.js +vendor/magento/module-ui/view/base/web/js/lib/validation/rules.js +vendor/magento/module-ui/view/base/web/js/lib/validation/utils.js +vendor/magento/module-ui/view/base/web/js/lib/validation/validator.js +vendor/magento/module-ui/view/base/web/js/lib/view/utils/async.js +vendor/magento/module-ui/view/base/web/js/lib/view/utils/bindings.js +vendor/magento/module-ui/view/base/web/js/lib/view/utils/dom-observer.js +vendor/magento/module-ui/view/base/web/js/modal/alert.js +vendor/magento/module-ui/view/base/web/js/modal/confirm.js +vendor/magento/module-ui/view/base/web/js/modal/modal.js +vendor/magento/module-ui/view/base/web/js/modal/modal-toggle.js +vendor/magento/module-ui/view/frontend/web/js/model/message-list.js +vendor/magento/module-ui/view/frontend/web/js/view/messages.js +vendor/magento/module-ups/view/frontend/web/js/model/shipping-rates-validation-rules.js +vendor/magento/module-ups/view/frontend/web/js/model/shipping-rates-validator.js +vendor/magento/module-ups/view/frontend/web/js/view/shipping-rates-validation.js +vendor/magento/module-user/view/adminhtml/requirejs-config.js +vendor/magento/module-user/view/adminhtml/web/app-config.js +vendor/magento/module-user/view/adminhtml/web/js/roles-tree.js +vendor/magento/module-usps/view/frontend/web/js/model/shipping-rates-validation-rules.js +vendor/magento/module-usps/view/frontend/web/js/model/shipping-rates-validator.js +vendor/magento/module-usps/view/frontend/web/js/view/shipping-rates-validation.js +vendor/magento/module-variable/view/adminhtml/web/variables.js +vendor/magento/module-weee/view/adminhtml/requirejs-config.js +vendor/magento/module-weee/view/adminhtml/web/js/fpt-attribute.js +vendor/magento/module-weee/view/frontend/requirejs-config.js +vendor/magento/module-weee/view/frontend/web/js/view/cart/totals/weee.js +vendor/magento/module-weee/view/frontend/web/js/view/checkout/summary/item/price/row_excl_tax.js +vendor/magento/module-weee/view/frontend/web/js/view/checkout/summary/item/price/row_incl_tax.js +vendor/magento/module-weee/view/frontend/web/js/view/checkout/summary/item/price/weee.js +vendor/magento/module-weee/view/frontend/web/js/view/checkout/summary/weee.js +vendor/magento/module-weee/view/frontend/web/tax-toggle.js +vendor/magento/module-wishlist/view/frontend/requirejs-config.js +vendor/magento/module-wishlist/view/frontend/web/js/add-to-wishlist.js +vendor/magento/module-wishlist/view/frontend/web/js/search.js +vendor/magento/module-wishlist/view/frontend/web/js/view/wishlist.js +vendor/magento/module-wishlist/view/frontend/web/wishlist.js +vendor/magento/theme-adminhtml-backend/web/js/theme.js +vendor/magento/theme-frontend-blank/web/js/navigation-menu.js +vendor/magento/theme-frontend-blank/web/js/responsive.js +vendor/magento/theme-frontend-blank/web/js/theme.js \ No newline at end of file diff --git a/dev/tests/static/testsuite/Magento/Test/Js/_files/jshint/blacklist/core.txt b/dev/tests/static/testsuite/Magento/Test/Js/_files/jshint/blacklist/core.txt index 15ba997298fe0f932500ae2134a029295007691a..9699f47c4bcccc9dd1009437092117fae86c0f25 100644 --- a/dev/tests/static/testsuite/Magento/Test/Js/_files/jshint/blacklist/core.txt +++ b/dev/tests/static/testsuite/Magento/Test/Js/_files/jshint/blacklist/core.txt @@ -1,18 +1,17 @@ -app/code/Magento/Authorizenet/view/adminhtml/web/js/direct-post.js -app/code/Magento/Captcha/view/frontend/web/onepage.js -app/code/Magento/Catalog/view/adminhtml/web/catalog/category/edit.js -app/code/Magento/Catalog/view/adminhtml/web/catalog/product.js -app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js -app/code/Magento/Checkout/view/frontend/web/js/accordion.js -app/code/Magento/Checkout/view/frontend/web/js/opcheckout.js -app/code/Magento/Checkout/view/frontend/web/js/payment.js -app/code/Magento/Rule/view/adminhtml/web/rules.js -app/code/Magento/Sales/view/adminhtml/web/order/create/giftmessage.js -app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js -app/code/Magento/Sales/view/adminhtml/web/order/giftoptions_tooltip.js -app/code/Magento/Shipping/view/adminhtml/web/order/packaging.js -app/code/Magento/Theme/view/frontend/web/menu.js -app/code/Magento/Variable/view/adminhtml/web/variables.js +module Magento_Authorizenet view/adminhtml/web/js/direct-post.js +module Magento_Captcha view/frontend/web/onepage.js +module Magento_Catalog view/adminhtml/web/catalog/category/edit.js +module Magento_Catalog view/adminhtml/web/catalog/product.js +module Magento_Catalog view/adminhtml/web/catalog/product/composite/configure.js +module Magento_Checkout view/frontend/web/js/opcheckout.js +module Magento_Checkout view/frontend/web/js/payment.js +module Magento_Rule view/adminhtml/web/rules.js +module Magento_Sales view/adminhtml/web/order/create/giftmessage.js +module Magento_Sales view/adminhtml/web/order/create/scripts.js +module Magento_Sales view/adminhtml/web/order/giftoptions_tooltip.js +module Magento_Shipping view/adminhtml/web/order/packaging.js +module Magento_Theme view/frontend/web/menu.js +module Magento_Variable view/adminhtml/web/variables.js dev/tests/js/JsTestDriver/testsuite/mage/translate_inline_vde/translate-inline-vde-test.js dev/tests/js/JsTestDriver/framework/qunit lib/web/mage/adminhtml diff --git a/dev/tests/static/testsuite/Magento/Test/Js/_files/jshint/whitelist/core.txt b/dev/tests/static/testsuite/Magento/Test/Js/_files/jshint/whitelist/core.txt index 1476776c1ebbc3bf19e14ffc2a9dd930ba2c17c6..1244c97856e1aa1ccf7eb925522d5f7aedf9764c 100644 --- a/dev/tests/static/testsuite/Magento/Test/Js/_files/jshint/whitelist/core.txt +++ b/dev/tests/static/testsuite/Magento/Test/Js/_files/jshint/whitelist/core.txt @@ -1,18 +1,18 @@ -app/code/Magento/Authorizenet -app/code/Magento/Bundle -app/code/Magento/Captcha -app/code/Magento/Catalog -app/code/Magento/CatalogSearch -app/code/Magento/Checkout -app/code/Magento/Customer -app/code/Magento/Downloadable -app/code/Magento/GiftMessage -app/code/Magento/Newsletter -app/code/Magento/OfflinePayments -app/code/Magento/Payment -app/code/Magento/Persistent -app/code/Magento/Sales -app/code/Magento/Theme -app/code/Magento/Wishlist +module Magento_Authorizenet / +module Magento_Bundle / +module Magento_Captcha / +module Magento_Catalog / +module Magento_CatalogSearch / +module Magento_Checkout / +module Magento_Customer / +module Magento_Downloadable / +module Magento_GiftMessage / +module Magento_Newsletter / +module Magento_OfflinePayments / +module Magento_Payment / +module Magento_Persistent / +module Magento_Sales / +module Magento_Theme / +module Magento_Wishlist / dev/tests/js lib/web/mage diff --git a/dev/tests/static/testsuite/Magento/Test/Js/_files/whitelist/magento.txt b/dev/tests/static/testsuite/Magento/Test/Js/_files/whitelist/magento.txt index 19aab504018b3ec043fc1fff5a28d6eb23391f89..159b91df0b4fef37889c287dc64bb0eebf77d602 100644 --- a/dev/tests/static/testsuite/Magento/Test/Js/_files/whitelist/magento.txt +++ b/dev/tests/static/testsuite/Magento/Test/Js/_files/whitelist/magento.txt @@ -2,3 +2,4 @@ app/code/**/*.js app/design/**/*.js dev/tests/js/jasmine/tests/**/*.js lib/web/mage/**/*.js +vendor/magento/**/*.js \ No newline at end of file diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/ClassesTest.php b/dev/tests/static/testsuite/Magento/Test/Legacy/ClassesTest.php index 593dd9d1c16bc91581c77c4362c4f384e970e8f6..bfbb940e61a5f28f123578952c02ec5339c87867 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/ClassesTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/ClassesTest.php @@ -9,6 +9,8 @@ */ namespace Magento\Test\Legacy; +use Magento\Framework\App\Utility\Files; + class ClassesTest extends \PHPUnit_Framework_TestCase { public function testPhpCode() @@ -22,7 +24,14 @@ class ClassesTest extends \PHPUnit_Framework_TestCase $classes = \Magento\Framework\App\Utility\Classes::collectPhpCodeClasses(file_get_contents($file)); $this->_assertNonFactoryName($classes, $file); }, - \Magento\Framework\App\Utility\Files::init()->getPhpFiles(true, true, true, true, false) + Files::init()->getPhpFiles( + Files::INCLUDE_APP_CODE + | Files::INCLUDE_PUB_CODE + | Files::INCLUDE_LIBS + | Files::INCLUDE_TEMPLATES + | Files::AS_DATA_SET + | Files::INCLUDE_NON_CLASSES + ) ); } @@ -42,7 +51,7 @@ class ClassesTest extends \PHPUnit_Framework_TestCase $modules = \Magento\Framework\App\Utility\Classes::getXmlAttributeValues($xml, '//@module', 'module'); $this->_assertNonFactoryName(array_unique($modules), $path, false, true); }, - \Magento\Framework\App\Utility\Files::init()->getConfigFiles() + Files::init()->getConfigFiles() ); } @@ -75,7 +84,7 @@ class ClassesTest extends \PHPUnit_Framework_TestCase ); $this->_assertNonFactoryName(array_unique($tabs), $path, true); }, - \Magento\Framework\App\Utility\Files::init()->getLayoutFiles() + Files::init()->getLayoutFiles() ); } diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/FilesystemTest.php b/dev/tests/static/testsuite/Magento/Test/Legacy/FilesystemTest.php index 46c34263203156c5813603a0defa9aa44b4da704..d3fe7736e7f60216380a45ed631b53936be86da3 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/FilesystemTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/FilesystemTest.php @@ -7,6 +7,8 @@ */ namespace Magento\Test\Legacy; +use Magento\Framework\Component\ComponentRegistrar; + class FilesystemTest extends \PHPUnit_Framework_TestCase { public function testRelocations() @@ -90,24 +92,27 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase $ns = '*'; $mod = '*'; $pathsToCheck = [ - "app/code/{$ns}/{$mod}/view/{$areas}/*" => [ - 'allowed_files' => $allowedFiles, - 'allowed_dirs' => ['layout', 'page_layout', 'templates', 'web'], - ], - "app/design/{$areas}/{$ns}/{$mod}/*" => [ + BP . "/app/design/{$areas}/{$ns}/{$mod}/*" => [ 'allowed_files' => $allowedThemeFiles, 'allowed_dirs' => ['layout', 'page_layout', 'templates', 'web', 'etc', 'i18n', 'media', '\w+_\w+'], ], - "app/design/{$areas}/{$ns}/{$mod}/{$ns}_{$mod}/*" => [ + BP . "app/design/{$areas}/{$ns}/{$mod}/{$ns}_{$mod}/*" => [ 'allowed_files' => $allowedThemeFiles, 'allowed_dirs' => ['layout', 'page_layout', 'templates', 'web'], ], ]; + $componentRegistrar = new ComponentRegistrar(); + foreach ($componentRegistrar->getPaths(ComponentRegistrar::MODULE) as $moduleDir) { + $pathsToCheck[$moduleDir . "/view/{$areas}/*"] = [ + 'allowed_files' => $allowedFiles, + 'allowed_dirs' => ['layout', 'page_layout', 'templates', 'web'] + ]; + } $errors = []; foreach ($pathsToCheck as $path => $allowed) { $allowedFiles = $allowed['allowed_files']; $allowedDirs = $allowed['allowed_dirs']; - $foundFiles = glob(BP . '/' . $path, GLOB_BRACE); + $foundFiles = glob($path, GLOB_BRACE); if (!$foundFiles) { $this->fail("Glob pattern returned empty result: {$path}"); } diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/InstallUpgradeTest.php b/dev/tests/static/testsuite/Magento/Test/Legacy/InstallUpgradeTest.php index 06de76ebf7b39e58f322067acbdc0badbc4991a4..9141e807157cabec8b162d502a448260431afbfe 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/InstallUpgradeTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/InstallUpgradeTest.php @@ -8,6 +8,7 @@ namespace Magento\Test\Legacy; use Magento\Framework\App\Utility\Files; use Magento\Framework\App\Utility\AggregateInvoker; +use Magento\Framework\Component\ComponentRegistrar; /** * Tests to find obsolete install/upgrade schema/data scripts @@ -16,6 +17,12 @@ class InstallUpgradeTest extends \PHPUnit_Framework_TestCase { public function testForOldInstallUpgradeScripts() { + $scriptPattern = []; + $componentRegistrar = new ComponentRegistrar(); + foreach ($componentRegistrar->getPaths(ComponentRegistrar::MODULE) as $moduleDir) { + $scriptPattern[] = $moduleDir . '/sql'; + $scriptPattern[] = $moduleDir . '/data'; + } $invoker = new AggregateInvoker($this); $invoker( /** @@ -52,7 +59,7 @@ class InstallUpgradeTest extends \PHPUnit_Framework_TestCase ); }, $this->convertArray( - Files::init()->getFiles([BP . '/app/code/*/*/sql', BP . '/app/code/*/*/data'], '*.php') + Files::init()->getFiles($scriptPattern, '*.php') ) ); } diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/LayoutTest.php b/dev/tests/static/testsuite/Magento/Test/Legacy/LayoutTest.php index 751ffc6cb8c6f0c2ce01289c788d22b66a110588..63802d2065d557a06c7b15d3beb7f18b5caa871e 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/LayoutTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/LayoutTest.php @@ -9,6 +9,8 @@ */ namespace Magento\Test\Legacy; +use Magento\Framework\Component\ComponentRegistrar; + class LayoutTest extends \PHPUnit_Framework_TestCase { /** @@ -129,12 +131,15 @@ class LayoutTest extends \PHPUnit_Framework_TestCase $this->assertContains('::', $action->getAttribute('helper')); } + $componentRegistrar = new ComponentRegistrar(); if (false !== strpos( $layoutFile, - 'app/code/Magento/Sales/view/adminhtml/layout/sales_order' + $componentRegistrar->getPath(ComponentRegistrar::MODULE, 'Magento_Sales') + . '/view/adminhtml/layout/sales_order' ) || false !== strpos( $layoutFile, - 'app/code/Magento/Shipping/view/adminhtml/layout/adminhtml_order' + $componentRegistrar->getPath(ComponentRegistrar::MODULE, 'Magento_Shipping') + . '/view/adminhtml/layout/adminhtml_order' ) ) { $this->markTestIncomplete( diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/Magento/Core/Block/AbstractBlockTest.php b/dev/tests/static/testsuite/Magento/Test/Legacy/Magento/Core/Block/AbstractBlockTest.php index 3b2f8eb33c2355b8011932b574e789f2cda78368..db0cb3464ba285d9de998b93ec5da381b02c48a6 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/Magento/Core/Block/AbstractBlockTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/Magento/Core/Block/AbstractBlockTest.php @@ -9,6 +9,8 @@ */ namespace Magento\Test\Legacy\Magento\Core\Block; +use Magento\Framework\App\Utility\Files; + class AbstractBlockTest extends \PHPUnit_Framework_TestCase { public function testGetChildHtml() @@ -41,7 +43,15 @@ class AbstractBlockTest extends \PHPUnit_Framework_TestCase ) ); }, - \Magento\Framework\App\Utility\Files::init()->getPhpFiles() + Files::init()->getPhpFiles( + Files::INCLUDE_APP_CODE + | Files::INCLUDE_PUB_CODE + | Files::INCLUDE_LIBS + | Files::INCLUDE_TEMPLATES + | Files::INCLUDE_TESTS + | Files::AS_DATA_SET + | Files::INCLUDE_NON_CLASSES + ) ); } } diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/ObsoleteCodeTest.php b/dev/tests/static/testsuite/Magento/Test/Legacy/ObsoleteCodeTest.php index 091472e472f40a36f2440f86d44898fb0d08070b..de26ad30530193f0d3b0c830297e4885a1f9d94b 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/ObsoleteCodeTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/ObsoleteCodeTest.php @@ -10,6 +10,10 @@ */ namespace Magento\Test\Legacy; +use Magento\Framework\App\Utility\Files; +use Magento\Framework\App\Utility\AggregateInvoker; +use Magento\TestFramework\Utility\ChangedFiles; + class ObsoleteCodeTest extends \PHPUnit_Framework_TestCase { /**@#+ @@ -69,7 +73,8 @@ class ObsoleteCodeTest extends \PHPUnit_Framework_TestCase protected static function _populateList(array &$list, array &$errors, $filePattern, $hasScope = true) { foreach (glob(__DIR__ . '/_files/' . $filePattern) as $file) { - foreach (self::_readList($file) as $row) { + $readList = include $file; + foreach ($readList as $row) { list($item, $scope, $replacement, $isDeprecated) = self::_padRow($row, $hasScope); $key = "{$item}|{$scope}"; if (isset($list[$key])) { @@ -97,20 +102,14 @@ class ObsoleteCodeTest extends \PHPUnit_Framework_TestCase return [$item, '', $replacement, '']; } - /** - * Isolate including a file into a method to reduce scope - * - * @param string $file - * @return array - */ - protected static function _readList($file) - { - return include $file; - } - public function testPhpFiles() { - $invoker = new \Magento\Framework\App\Utility\AggregateInvoker($this); + $invoker = new AggregateInvoker($this); + $changedFiles = ChangedFiles::getPhpFiles(__DIR__ . '/_files/changed_files*'); + $blacklistFiles = $this->getBlacklistFiles(); + foreach ($blacklistFiles as $blacklistFile) { + unset($changedFiles[$blacklistFile]); + } $invoker( function ($file) { $content = file_get_contents($file); @@ -125,24 +124,24 @@ class ObsoleteCodeTest extends \PHPUnit_Framework_TestCase $this->_testObsoleteConstants($content); $this->_testObsoletePropertySkipCalculate($content); }, - \Magento\TestFramework\Utility\ChangedFiles::getPhpFiles(__DIR__ . '/_files/changed_files*') + $changedFiles ); } public function testClassFiles() { - $invoker = new \Magento\Framework\App\Utility\AggregateInvoker($this); + $invoker = new AggregateInvoker($this); $invoker( function ($file) { $this->_testObsoletePaths($file); }, - \Magento\Framework\App\Utility\Files::init()->getClassFiles() + Files::init()->getPhpFiles() ); } public function testTemplateMageCalls() { - $invoker = new \Magento\Framework\App\Utility\AggregateInvoker($this); + $invoker = new AggregateInvoker($this); $invoker( function ($file) { $content = file_get_contents($file); @@ -152,13 +151,17 @@ class ObsoleteCodeTest extends \PHPUnit_Framework_TestCase "Static Method of 'Mage' class is obsolete." ); }, - \Magento\Framework\App\Utility\Files::init()->getPhpFiles(false, false, true) + Files::init()->getPhpFiles( + Files::INCLUDE_TEMPLATES + | Files::INCLUDE_TESTS + | Files::AS_DATA_SET + ) ); } public function testXmlFiles() { - $invoker = new \Magento\Framework\App\Utility\AggregateInvoker($this); + $invoker = new AggregateInvoker($this); $invoker( function ($file) { $content = file_get_contents($file); @@ -166,19 +169,19 @@ class ObsoleteCodeTest extends \PHPUnit_Framework_TestCase $this->_testObsoleteNamespaces($content); $this->_testObsoletePaths($file); }, - \Magento\Framework\App\Utility\Files::init()->getXmlFiles() + Files::init()->getXmlFiles() ); } public function testJsFiles() { - $invoker = new \Magento\Framework\App\Utility\AggregateInvoker($this); + $invoker = new AggregateInvoker($this); $invoker( function ($file) { $content = file_get_contents($file); $this->_testObsoletePropertySkipCalculate($content); }, - \Magento\Framework\App\Utility\Files::init()->getJsFiles() + Files::init()->getJsFiles() ); } @@ -294,7 +297,7 @@ class ObsoleteCodeTest extends \PHPUnit_Framework_TestCase { foreach (self::$_paths as $row) { list($obsoletePath, , $replacementPath) = $row; - $relativePath = str_replace(\Magento\Framework\App\Utility\Files::init()->getPathToSource(), "", $file); + $relativePath = str_replace(Files::init()->getPathToSource(), "", $file); $message = $this->_suggestReplacement( "Path '{$obsoletePath}' is obsolete.", $replacementPath @@ -318,7 +321,7 @@ class ObsoleteCodeTest extends \PHPUnit_Framework_TestCase */ protected function _testGetChildSpecialCase($content, $file) { - if (0 === strpos($file, \Magento\Framework\App\Utility\Files::init()->getPathToSource() . '/app/')) { + if (0 === strpos($file, Files::init()->getPathToSource() . '/app/')) { $this->_assertNotRegexp( '/[^a-z\d_]getChild\s*\(/iS', $content, @@ -868,7 +871,18 @@ class ObsoleteCodeTest extends \PHPUnit_Framework_TestCase public function testMageMethodsObsolete() { - $invoker = new \Magento\Framework\App\Utility\AggregateInvoker($this); + $ignored = $this->getBlacklistFiles(); + $files = Files::init()->getPhpFiles( + Files::INCLUDE_APP_CODE + | Files::INCLUDE_TESTS + | Files::INCLUDE_DEV_TOOLS + | Files::INCLUDE_LIBS + ); + $files = array_map('realpath', $files); + $files = array_diff($files, $ignored); + $files = Files::composeDataSets($files); + + $invoker = new AggregateInvoker($this); $invoker( /** * Check absence of obsolete Mage class usages @@ -882,30 +896,23 @@ class ObsoleteCodeTest extends \PHPUnit_Framework_TestCase '"Mage" class methods are obsolete' ); }, - $this->mageObsoleteDataProvider() + $files ); } /** + * Reads list of blacklisted files + * * @return array */ - public function mageObsoleteDataProvider() + private function getBlacklistFiles() { $blackList = include __DIR__ . '/_files/blacklist/obsolete_mage.php'; $ignored = []; - $appPath = \Magento\Framework\App\Utility\Files::init()->getPathToSource(); + $appPath = Files::init()->getPathToSource(); foreach ($blackList as $file) { - $ignored[] = realpath($appPath . '/' . $file); + $ignored = array_merge($ignored, glob($appPath . '/' . $file, GLOB_NOSORT)); } - $files = \Magento\Framework\App\Utility\Files::init()->getClassFiles( - true, - true, - true, - true, - false - ); - $files = array_map('realpath', $files); - $files = array_diff($files, $ignored); - return \Magento\Framework\App\Utility\Files::composeDataSets($files); + return $ignored; } } diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/ObsoleteThemeLocalXmlTest.php b/dev/tests/static/testsuite/Magento/Test/Legacy/ObsoleteThemeLocalXmlTest.php index e09d88e9ff05a78724fbb37a6e07ff8dd11957b0..bd1b303bb3d50f5ebc287691786db9cc6bf4260b 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/ObsoleteThemeLocalXmlTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/ObsoleteThemeLocalXmlTest.php @@ -9,18 +9,15 @@ */ namespace Magento\Test\Legacy; +use Magento\Framework\Component\ComponentRegistrar; + class ObsoleteThemeLocalXmlTest extends \PHPUnit_Framework_TestCase { public function testLocalXmlFilesAbsent() { - $area = '*'; - $package = '*'; - $theme = '*'; - $this->assertEmpty( - glob( - \Magento\Framework\App\Utility\Files::init()->getPathToSource() . - "/app/design/{$area}/{$package}/{$theme}/local.xml" - ) - ); + $componentRegistrar = new ComponentRegistrar(); + foreach ($componentRegistrar->getPaths(ComponentRegistrar::THEME) as $themeDir) { + $this->assertEmpty(glob($themeDir . '/local.xml')); + } } } diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/TableTest.php b/dev/tests/static/testsuite/Magento/Test/Legacy/TableTest.php index 6e99ef361a84dc2a1d2818e7f1a015f77d951639..8afc821f1b3c8865d7bdc12f3e4a2b3ddfb96ecd 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/TableTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/TableTest.php @@ -9,6 +9,8 @@ */ namespace Magento\Test\Legacy; +use Magento\Framework\App\Utility\Files; + class TableTest extends \PHPUnit_Framework_TestCase { public function testTableName() @@ -32,7 +34,14 @@ class TableTest extends \PHPUnit_Framework_TestCase $message = $this->_composeFoundsMessage($legacyTables); $this->assertEmpty($message, $message); }, - \Magento\Framework\App\Utility\Files::init()->getPhpFiles(true, true, true, true, false) + Files::init()->getPhpFiles( + Files::INCLUDE_APP_CODE + | Files::INCLUDE_PUB_CODE + | Files::INCLUDE_LIBS + | Files::INCLUDE_TEMPLATES + | Files::AS_DATA_SET + | Files::INCLUDE_NON_CLASSES + ) ); } diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/blacklist/obsolete_mage.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/blacklist/obsolete_mage.php index 3c8f1fbd1ac0429c8a6e28b2e200d8fe68ce12b1..4bfc7cbc6875f5de581db61160f76bfb753080f0 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/blacklist/obsolete_mage.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/blacklist/obsolete_mage.php @@ -4,14 +4,7 @@ * See COPYING.txt for license details. */ return [ - 'downloader/app/Magento/Downloader/Controller.php', - 'dev/tools/Magento/Tools/Translate/TranslateTool.php', - 'dev/tools/Magento/Tools/Translate/generate.php', 'dev/tests/static/testsuite/Magento/Test/Legacy/ObsoleteCodeTest.php', - 'dev/tests/static/framework/Magento/TestFramework/Dependency/TemplateRule.php', - 'downloader/app/Magento/Downloader/Model/Session.php', - 'downloader/lib/Magento/Framework/Backup/Db.php', - 'downloader/lib/Magento/Framework/Backup/Snapshot.php', 'dev/tests/static/testsuite/Magento/Test/Integrity/ClassesTest.php', - 'app/code/Magento/CatalogImportExport/Model/Import/Product/Validator/Category.php' + 'dev/tests/static/testsuite/Magento/Test/Legacy/_files/*obsolete*.php' ]; 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 a7503917b860364eced768d66c42b74f28213ec4..c1f0aa745785498d148afb7b7105f4df4b270ffa 100755 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php @@ -3138,7 +3138,6 @@ return [ ['Magento\Setup\Module\SetupModule'], ['Magento\Setup\Module\Setup\FileResolver'], ['Magento\Framework\Module\Updater'], - ['Magento\Setup\Module\SetupFactory'], ['Magento\Framework\Module\Updater\SetupFactory'], ['Magento\Log\Block\Adminhtml\Customer\Edit\Tab\View\Status'], ['Magento\Backend\Model\Config\Source\Yesno', 'Magento\Config\Model\Config\Source\Yesno'], @@ -3180,7 +3179,6 @@ return [ ['Magento\Framework\Module\Exception'], ['Magento\Framework\Data\Argument\MissingOptionalValueException'], ['Magento\Framework\Session\SaveHandlerException'], - ['Magento\Framework\ForeignKey\Exception'], ['Magento\CatalogInventory\Exception'], ['Magento\CatalogRule\CatalogRuleException'], ['Magento\Payment\Exception'], @@ -3847,6 +3845,75 @@ return [ ['Magento\Setup\Model\SampleData', 'Magento\SampleData\Model\SampleData'], ['Magento\Customer\Controller\Account\ResetPassword'], ['Magento\Customer\Controller\Account'], + [ + 'Magento\Framework\Module\ModuleRegistryInterface', + 'Magento\Framework\Component\ComponentRegistrarInterface' + ], + [ + 'Magento\Framework\Module\ModuleRegistry', + 'Magento\Framework\Component\ComponentRegistrar' + ], + ['Magento\Framework\App\Router\ActionList\Reader'], + ['Magento\Framework\View\File\AbstractCollector'], + ['Magento\Tools\Migration\Acl\FileManager'], + ['Magento\Tools\Migration\Acl\Formatter'], + ['Magento\Tools\Migration\Acl\Generator'], + ['Magento\Tools\Migration\System\FileManager'], + ['Magento\Tools\Migration\System\FileReader'], + ['Magento\Tools\Migration\Acl\Db\AbstractLogger'], + ['Magento\Tools\Migration\Acl\Db\FileReader'], + ['Magento\Tools\Migration\Acl\Db\Reader'], + ['Magento\Tools\Migration\Acl\Db\Updater'], + ['Magento\Tools\Migration\Acl\Db\Writer'], + ['Magento\Tools\Migration\Acl\Menu\Generator'], + ['Magento\Tools\Migration\System\Configuration\AbstractLogger'], + ['Magento\Tools\Migration\System\Configuration\Formatter'], + ['Magento\Tools\Migration\System\Configuration\Generator'], + ['Magento\Tools\Migration\System\Configuration\Mapper'], + ['Magento\Tools\Migration\System\Configuration\Parser'], + ['Magento\Tools\Migration\System\Configuration\Reader'], + ['Magento\Tools\Migration\System\Writer\Factory'], + ['Magento\Tools\Migration\System\Writer\FileSystem'], + ['Magento\Tools\Migration\System\Writer\Memory'], + ['Magento\Tools\Migration\Acl\Db\Adapter\Factory'], + ['Magento\Tools\Migration\Acl\Db\Logger\Console'], + ['Magento\Tools\Migration\Acl\Db\Logger\Factory'], + ['Magento\Tools\Migration\Acl\Db\Logger\File'], + ['Magento\Tools\Migration\System\Configuration\Logger\Console'], + ['Magento\Tools\Migration\System\Configuration\Logger\Factory'], + ['Magento\Tools\Migration\System\Configuration\Logger\File'], + ['Magento\Tools\Migration\System\Configuration\Mapper\AbstractMapper'], + ['Magento\Tools\Migration\System\Configuration\Mapper\Field'], + ['Magento\Tools\Migration\System\Configuration\Mapper\Group'], + ['Magento\Tools\Migration\System\Configuration\Mapper\Section'], + ['Magento\Tools\Migration\System\Configuration\Mapper\Tab'], + ['Magento\Tools\Migration\Test\Unit\Acl\GeneratorRemoveTest'], + ['Magento\Tools\Migration\Test\Unit\Acl\GeneratorSaveTest'], + ['Magento\Tools\Migration\Test\Unit\Acl\GeneratorTest'], + ['Magento\Tools\Migration\Test\Unit\System\FileManagerTest'], + ['Magento\Tools\Migration\Test\Unit\Acl\Db\FileReaderTest'], + ['Magento\Tools\Migration\Test\Unit\Acl\Db\LoggerAbstractTest'], + ['Magento\Tools\Migration\Test\Unit\Acl\Db\ReaderTest'], + ['Magento\Tools\Migration\Test\Unit\Acl\Db\UpdaterTest'], + ['Magento\Tools\Migration\Test\Unit\Acl\Db\WriterTest'], + ['Magento\Tools\Migration\Test\Unit\Acl\Menu\GeneratorTest'], + ['Magento\Tools\Migration\Test\Unit\System\Configuration\GeneratorTest'], + ['Magento\Tools\Migration\Test\Unit\System\Configuration\LoggerAbstractTest'], + ['Magento\Tools\Migration\Test\Unit\System\Configuration\MapperTest'], + ['Magento\Tools\Migration\Test\Unit\System\Configuration\ParserTest'], + ['Magento\Tools\Migration\Test\Unit\System\Configuration\ReaderTest'], + ['Magento\Tools\Migration\Test\Unit\System\Writer\FactoryTest'], + ['Magento\Tools\Migration\Test\Unit\Acl\Db\Adapter\FactoryTest'], + ['Magento\Tools\Migration\Test\Unit\Acl\Db\Logger\ConsoleTest'], + ['Magento\Tools\Migration\Test\Unit\Acl\Db\Logger\FactoryTest'], + ['Magento\Tools\Migration\Test\Unit\Acl\Db\Logger\FileTest'], + ['Magento\Tools\Migration\Test\Unit\System\Configuration\Logger\ConsoleTest'], + ['Magento\Tools\Migration\Test\Unit\System\Configuration\Logger\FactoryTest'], + ['Magento\Tools\Migration\Test\Unit\System\Configuration\Logger\FileTest'], + ['Magento\Tools\Migration\Test\Unit\System\Configuration\Mapper\FieldTest'], + ['Magento\Tools\Migration\Test\Unit\System\Configuration\Mapper\GroupTest'], + ['Magento\Tools\Migration\Test\Unit\System\Configuration\Mapper\SectionTest'], + ['Magento\Tools\Migration\Test\Unit\System\Configuration\Mapper\TabTest'], ['Magento\Quote\Model\Quote\Address\Total\Discount'], ['Magento\Quote\Model\Quote\Address\Total\Custbalance'], ['Magento\Quote\Model\Quote\Address\Total\Tax'], 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 fa4ee8e1c8825fe8f62bf1d774f654f9aa7139b5..4d236fa739eadb0203e69d41ac1c5204de49b7ec 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 @@ -935,4 +935,21 @@ return [ 'Magento\Setup\Model\ConfigOptionsList', 'Magento\Framework\Config\ConfigOptionsListConstants::KEY_MODULES' ], + [ + 'SAMPLE_FILES_DIRECTORY', + 'Magento\ImportExport\Controller\Adminhtml\Import\Download', + 'Magento\ImportExport\Controller\Adminhtml\Import\Download::SAMPLE_FILES_MODULE' + ], + [ + 'MODULES', + 'Magento\Framework\App\Filesystem\DirectoryList' + ], + [ + 'LOCALE', + 'Magento\Framework\App\Filesystem\DirectoryList' + ], + [ + 'THEMES', + 'Magento\Framework\App\Filesystem\DirectoryList' + ], ]; 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 bdb2ccf51437ca9ad0fe315865302ab215101866..ccc3f8fb9641b47b6c3ad36d257c56d526197005 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 @@ -2460,6 +2460,15 @@ return [ 'Magento\ConfigurableProduct\Model\Product\VariationHandler::fillSimpleProductData' ], ['mergeBookmarkConfig', 'Magento\Ui\Model\Manager'], + ['addDefaultPattern', 'Magento\Theme\Model\Theme\Collection', 'addConstraint'], + ['addTargetPattern', 'Magento\Theme\Model\Theme\Collection', 'addConstraint'], + ['clearTargetPatterns', 'Magento\Theme\Model\Theme\Collection', 'resetConstraints'], + ['getTargetPatterns', 'Magento\Theme\Model\Theme\Collection'], + ['getScopeDirectory', 'Magento\Framework\View\File\Collector\Override\Base'], + ['getScopeDirectory', 'Magento\Framework\View\File\Collector\Override\ThemeModular'], + ['getScopeDirectory', 'Magento\Framework\View\File\Collector\Theme'], + ['getScopeDirectory', 'Magento\Framework\View\File\Collector\ThemeModular'], + ['_getConfigFilesList', 'Magento\Framework\App\Utility\Files'], ['getTitle', 'Magento\Quote\Api\Data\PaymentInterface'], ['setTitle', 'Magento\Quote\Api\Data\PaymentInterface'], ['getTitle', 'Magento\Quote\Model\Quote\Payment'], diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_paths.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_paths.php index 75755bc71829f75cda0c889a0b360ea02cdbf103..19af8dbdb232ecea305d1a8b14191397cde8c6a6 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_paths.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_paths.php @@ -258,5 +258,7 @@ return [ ['/dev/tests/unit/testsuite'], ['/app/code/Magento/Log'], ['/app/code/Magento/DesignEditor'], + ['/dev/tools/Magento/Tools/Migration'], + ['/dev/shell/dependency.php'], ['/dev/tests/performance'], ]; 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 91f98db5ade68a777d756e11d90173a5e3b34338..1cce36c0dcb7ac49c28bf59dedf75d810dd8a4f3 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 @@ -414,4 +414,10 @@ return [ ['_origData', 'Magento\Framework\DataObject', 'Moved to Magento\Framework\Model\AbstractModel'], ['_idFieldName', 'Magento\Framework\DataObject', 'Moved to Magento\Framework\Model\AbstractModel'], ['_isDeleted', 'Magento\Framework\DataObject', 'Moved to Magento\Framework\Model\AbstractModel'], + ['themesDirectory', 'Magento\Email\Model\Template\Config'], + ['_directory', 'Magento\Theme\Model\Theme\Collection'], + ['_targetDirs', 'Magento\Theme\Model\Theme\Collection'], + ['directoryRead', 'Magento\Theme\Model\Theme\Registration'], + ['themesDirectory', 'Magento\Widget\Model\Config\FileResolver'], + ['themeDirectoryRead', 'Magento\Framework\View\Design\Theme\Customization\Path'], ]; diff --git a/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php b/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php index b7ee29706dcbf162c9578c3bc6b964c4a3c57809..4a2aef8eaac43b5e2e237569120aa5a4b7619af9 100644 --- a/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php @@ -54,13 +54,31 @@ class LiveCodeTest extends PHPUnit_Framework_TestCase */ public static function getWhitelist($fileTypes = ['php']) { - $directoriesToCheck = file(__DIR__ . '/_files/whitelist/common.txt', FILE_IGNORE_NEW_LINES); + $directoriesToCheck = Files::init()->readLists(__DIR__ . '/_files/whitelist/common.txt'); + $changedFiles = []; + foreach (glob(__DIR__ . '/_files/changed_files*') as $listFile) { + $changedFiles = array_merge($changedFiles, file($listFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES)); + } + array_walk( + $changedFiles, + function (&$file) { + $file = BP . '/' . $file; + } + ); $changedFiles = array_filter( - Utility\Files::readLists(__DIR__ . '/_files/changed_files*'), - function ($path) use ($directoriesToCheck) { + $changedFiles, + function ($path) use ($directoriesToCheck, $fileTypes) { + if (!file_exists($path)) { + return false; + } + $path = realpath($path); foreach ($directoriesToCheck as $directory) { - if (strpos($path, BP . '/' . $directory) === 0) { + $directory = realpath($directory); + if (strpos($path, $directory) === 0) { + if (!empty($fileTypes)) { + return in_array(pathinfo($path, PATHINFO_EXTENSION), $fileTypes); + } return true; } } @@ -68,15 +86,6 @@ class LiveCodeTest extends PHPUnit_Framework_TestCase } ); - if (!empty($fileTypes)) { - $changedFiles = array_filter( - $changedFiles, - function ($path) use ($fileTypes) { - return in_array(pathinfo($path, PATHINFO_EXTENSION), $fileTypes); - } - ); - } - return $changedFiles; } @@ -217,7 +226,16 @@ class LiveCodeTest extends PHPUnit_Framework_TestCase $analyser = new \SebastianBergmann\PHPDCD\Analyser(); $declared = []; $called = []; - foreach (Files::init()->getPhpFiles() as $file) { + $collectedFiles = Files::init()->getPhpFiles( + Files::INCLUDE_APP_CODE + | Files::INCLUDE_PUB_CODE + | Files::INCLUDE_LIBS + | Files::INCLUDE_TEMPLATES + | Files::INCLUDE_TESTS + | Files::AS_DATA_SET + | Files::INCLUDE_NON_CLASSES + ); + foreach ($collectedFiles as $file) { $file = array_pop($file); $analyser->analyseFile($file); foreach ($analyser->getFunctionDeclarations() as $function => $declaration) { 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 c682a1f5eff32ddb92c19cadd82af0c638940727..e5c31e5afcb0c757f47fea92734909611fbda864 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 @@ -1,9 +1,8 @@ -app/code/Magento -lib/internal/Magento/Framework +module * / +library * / dev/tools/Magento dev/tests/api-functional dev/tests/functional dev/tests/integration -dev/tests/performance dev/tests/static setup \ No newline at end of file diff --git a/dev/tests/unit/phpunit.xml.dist b/dev/tests/unit/phpunit.xml.dist index 1d371bc5414fba43767cc2571af675ab74941c9d..e28aacb584d21ccee90f1b4803362e901d17843e 100644 --- a/dev/tests/unit/phpunit.xml.dist +++ b/dev/tests/unit/phpunit.xml.dist @@ -18,6 +18,9 @@ <directory suffix="Test.php">../../../lib/internal/*/*/*/Test/Unit</directory> <directory suffix="Test.php">../../../setup/src/*/*/Test/Unit</directory> <directory suffix="Test.php">../../../update/app/code/*/*/Test/Unit</directory> + <directory suffix="Test.php">../../../vendor/*/module-*/Test/Unit</directory> + <directory suffix="Test.php">../../../vendor/*/framework/Test/Unit</directory> + <directory suffix="Test.php">../../../vendor/*/framework/*/Test/Unit</directory> </testsuite> <php> <ini name="date.timezone" value="America/Los_Angeles"/> diff --git a/dev/tools/Magento/Tools/Migration/Acl/Db/AbstractLogger.php b/dev/tools/Magento/Tools/Migration/Acl/Db/AbstractLogger.php deleted file mode 100644 index 7d24a86140842348f621db4c8d1288427fddeca0..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Acl/Db/AbstractLogger.php +++ /dev/null @@ -1,97 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -/** - * DB migration logger - */ -namespace Magento\Tools\Migration\Acl\Db; - -abstract class AbstractLogger -{ - /** - * List of logs - * - * @var array - */ - protected $_logs = []; - - /** - * Convert list of logs to nice text block - * - * @param string $message block header text - * @param array $list list of logs - * @return string - */ - protected function _logsListToString($message, $list) - { - $outputString = $message . ':' . PHP_EOL; - $outputString .= implode(PHP_EOL, $list); - $outputString .= PHP_EOL . str_repeat('-', 30) . PHP_EOL; - - return $outputString; - } - - /** - * Add log data - * - * @param string $oldKey - * @param string $newKey - * @param int|null $updateResult - * @return \Magento\Tools\Migration\Acl\Db\AbstractLogger - */ - public function add($oldKey, $newKey, $updateResult) - { - if (empty($oldKey)) { - $oldKey = $newKey; - } - $this->_logs[$oldKey]['newKey'] = $newKey; - $this->_logs[$oldKey]['updateResult'] = $updateResult; - return $this; - } - - /** - * Convert logger object to string - * - * @return string - */ - public function __toString() - { - $output = ['Mapped items' => [], 'Not mapped items' => [], 'Items in actual format' => []]; - foreach ($this->_logs as $oldKey => $data) { - $newKey = $data['newKey']; - $countItems = $data['updateResult']; - - if ($oldKey == $newKey) { - $output['Items in actual format'][$oldKey] = $oldKey; - } elseif (empty($newKey)) { - $output['Not mapped items'][$oldKey] = $oldKey; - } else { - $output['Mapped items'][$oldKey] = $oldKey . - ' => ' . - $newKey . - ' :: Count updated rules: ' . - $countItems; - } - } - - $generalBlock = $detailsBlock = ''; - foreach ($output as $key => $data) { - $generalBlock .= $key . ' count: ' . count($data) . PHP_EOL; - if (count($data)) { - $detailsBlock .= $this->_logsListToString($key, $data); - } - } - return $generalBlock . str_repeat('-', 30) . PHP_EOL . $detailsBlock; - } - - /** - * Generate report - * - * @abstract - * @return mixed - */ - abstract public function report(); -} diff --git a/dev/tools/Magento/Tools/Migration/Acl/Db/Adapter/Factory.php b/dev/tools/Magento/Tools/Migration/Acl/Db/Adapter/Factory.php deleted file mode 100644 index 387afae48f617180e2cfbc4612e33af27656c453..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Acl/Db/Adapter/Factory.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -/** - * Db adapters factory - */ -namespace Magento\Tools\Migration\Acl\Db\Adapter; - -class Factory -{ - /** - * @param \Magento\Framework\ObjectManagerInterface $objectManager - */ - public function __construct(\Magento\Framework\ObjectManagerInterface $objectManager) - { - $this->_objectManager = $objectManager; - } - - /** - * Get db adapter - * - * @param array $config - * @param string $type - * @throws \InvalidArgumentException - * @return \Magento\Framework\DB\Adapter\Pdo\Mysql - */ - public function getConnection(array $config, $type = null) - { - $connectionClassName = 'Magento\Framework\DB\Adapter\Pdo\Mysql'; - - if (false == empty($type)) { - $connectionClassName = $type; - } - - if (false == class_exists($connectionClassName, true)) { - throw new \InvalidArgumentException('Specified adapter not exists: ' . $connectionClassName); - } - - $connection = $this->_objectManager->create($connectionClassName, ['config' => $config]); - if (false == $connection instanceof \Magento\Framework\DB\Adapter\Pdo\Mysql) { - unset($connection); - throw new \InvalidArgumentException( - 'Specified adapter is not instance of \Magento\Framework\DB\Adapter\Pdo\Mysql' - ); - } - return $connection; - } -} diff --git a/dev/tools/Magento/Tools/Migration/Acl/Db/FileReader.php b/dev/tools/Magento/Tools/Migration/Acl/Db/FileReader.php deleted file mode 100644 index 2fdaa727d230ccd67fa78194f44a6590ae570ea2..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Acl/Db/FileReader.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\Acl\Db; - -class FileReader -{ - /** - * Extract resource id map from provided file - * - * @param string $fileName - * @return array - * @throws \InvalidArgumentException - */ - public function extractData($fileName) - { - if (empty($fileName)) { - throw new \InvalidArgumentException('Please specify correct name of a file that contains identifier map'); - } - if (false == file_exists($fileName)) { - throw new \InvalidArgumentException('Provided identifier map file (' . $fileName . ') doesn\'t exist'); - } - $data = json_decode(file_get_contents($fileName), true); - - $output = []; - foreach ($data as $key => $value) { - $newKey = str_replace('config/acl/resources/', '', $key); - $output[$newKey] = $value; - } - return $output; - } -} diff --git a/dev/tools/Magento/Tools/Migration/Acl/Db/Logger/Console.php b/dev/tools/Magento/Tools/Migration/Acl/Db/Logger/Console.php deleted file mode 100644 index 52457170b2d902760a716ea2805a962dd0fd9222..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Acl/Db/Logger/Console.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\Acl\Db\Logger; - -/** - * Db migration logger. Output result print to console - */ -class Console extends \Magento\Tools\Migration\Acl\Db\AbstractLogger -{ - /** - * Print logs to console - * - * @return void - */ - public function report() - { - echo $this; - } -} diff --git a/dev/tools/Magento/Tools/Migration/Acl/Db/Logger/Factory.php b/dev/tools/Magento/Tools/Migration/Acl/Db/Logger/Factory.php deleted file mode 100644 index 827b92f6a6bab55c3397586ea218888b3a3349eb..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Acl/Db/Logger/Factory.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\Acl\Db\Logger; - -class Factory -{ - /** - * List of allowed logger types - * - * @var array - */ - protected $_allowedLoggerTypes = []; - - /** - * Constructor for Db\Logger\Factory - */ - public function __construct() - { - $this->_allowedLoggerTypes = ['console', 'file']; - } - - /** - * @param string $loggerType - * @param string $filePath - * @return \Magento\Tools\Migration\Acl\Db\AbstractLogger - * @throws \InvalidArgumentException - */ - public function getLogger($loggerType, $filePath = null) - { - $loggerType = empty($loggerType) ? 'console' : $loggerType; - if (false == in_array($loggerType, $this->_allowedLoggerTypes)) { - throw new \InvalidArgumentException('Invalid logger type: ' . $loggerType); - } - - $loggerClassName = null; - switch ($loggerType) { - case 'file': - $loggerClassName = 'Magento\Tools\Migration\Acl\Db\Logger\File'; - break; - default: - $loggerClassName = 'Magento\Tools\Migration\Acl\Db\Logger\Console'; - break; - } - - return new $loggerClassName($filePath); - } -} diff --git a/dev/tools/Magento/Tools/Migration/Acl/Db/Logger/File.php b/dev/tools/Magento/Tools/Migration/Acl/Db/Logger/File.php deleted file mode 100644 index 77761c7a1dfb965e901d1d3a3812008dc0b61156..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Acl/Db/Logger/File.php +++ /dev/null @@ -1,52 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\Acl\Db\Logger; - -use InvalidArgumentException; -use Magento\Framework\Filesystem\DriverInterface; - -/** - * Db migration logger. Output result put to file - */ -class File extends \Magento\Tools\Migration\Acl\Db\AbstractLogger -{ - /** - * Path to log file - * - * @var string - */ - protected $_file = null; - - /** - * @param string $file - * @throws InvalidArgumentException - */ - public function __construct($file) - { - $logDir = realpath(__DIR__ . '/../../') . '/log/'; - if (false == is_dir($logDir)) { - mkdir($logDir, DriverInterface::WRITEABLE_DIRECTORY_MODE, true); - } - if (false == is_writeable($logDir)) { - throw new InvalidArgumentException('Directory ' . dirname($logDir) . ' is not writeable'); - } - - if (empty($file)) { - throw new InvalidArgumentException('Log file name is required'); - } - $this->_file = $logDir . $file; - } - - /** - * Put report to file - * - * @return void - */ - public function report() - { - file_put_contents($this->_file, (string)$this); - } -} diff --git a/dev/tools/Magento/Tools/Migration/Acl/Db/Reader.php b/dev/tools/Magento/Tools/Migration/Acl/Db/Reader.php deleted file mode 100644 index 6602cd2867faa1160359a14fb591dbb8ecfad491..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Acl/Db/Reader.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -/** - * Db adapter. Reader. - * Get unique acl resource identifiers from source table - */ -namespace Magento\Tools\Migration\Acl\Db; - -class Reader -{ - /** - * Source table name - * - * @var string - */ - protected $_tableName; - - /** - * DB adapter - * - * @var \Magento\Framework\DB\Adapter\Pdo\Mysql - */ - protected $_adapter; - - /** - * @param \Magento\Framework\DB\Adapter\AdapterInterface $adapter - * @param string $tableName source table - */ - public function __construct(\Magento\Framework\DB\Adapter\AdapterInterface $adapter, $tableName) - { - $this->_tableName = $tableName; - $this->_adapter = $adapter; - } - - /** - * Get list of unique resource identifiers - * Format: [resource] => [count items] - * @return array - */ - public function fetchAll() - { - $select = $this->_adapter->select(); - $select->from( - $this->_tableName, - [] - )->columns( - ['resource_id' => 'resource_id', 'itemsCount' => new \Zend_Db_Expr('count(*)')] - )->group( - 'resource_id' - ); - return $this->_adapter->fetchPairs($select); - } -} diff --git a/dev/tools/Magento/Tools/Migration/Acl/Db/Updater.php b/dev/tools/Magento/Tools/Migration/Acl/Db/Updater.php deleted file mode 100644 index 58b10ecd0a3a911a6ef314ca8be481e779daa60e..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Acl/Db/Updater.php +++ /dev/null @@ -1,78 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\Acl\Db; - -class Updater -{ - const WRITE_MODE = 'write'; - - /** - * Resource id reader - * - * @var \Magento\Tools\Migration\Acl\Db\Reader - */ - protected $_reader; - - /** - * Resource id writer - * - * @var \Magento\Tools\Migration\Acl\Db\Writer - */ - protected $_writer; - - /** - * Operation logger - * - * @var \Magento\Tools\Migration\Acl\Db\AbstractLogger - */ - protected $_logger; - - /** - * Migration mode - * - * @var string - */ - protected $_mode; - - /** - * @param \Magento\Tools\Migration\Acl\Db\Reader $reader - * @param \Magento\Tools\Migration\Acl\Db\Writer $writer - * @param \Magento\Tools\Migration\Acl\Db\AbstractLogger $logger - * @param string $mode - if value is "preview" migration does not happen - */ - public function __construct( - \Magento\Tools\Migration\Acl\Db\Reader $reader, - \Magento\Tools\Migration\Acl\Db\Writer $writer, - \Magento\Tools\Migration\Acl\Db\AbstractLogger $logger, - $mode - ) { - $this->_reader = $reader; - $this->_writer = $writer; - $this->_logger = $logger; - $this->_mode = $mode; - } - - /** - * Migrate old keys to new - * - * @param array $map - * @return void - */ - public function migrate($map) - { - foreach ($this->_reader->fetchAll() as $oldKey => $count) { - $newKey = isset($map[$oldKey]) ? $map[$oldKey] : null; - if (in_array($oldKey, $map)) { - $newKey = $oldKey; - $oldKey = null; - } - if ($newKey && $oldKey && $this->_mode == self::WRITE_MODE) { - $this->_writer->update($oldKey, $newKey); - } - $this->_logger->add($oldKey, $newKey, $count); - } - } -} diff --git a/dev/tools/Magento/Tools/Migration/Acl/Db/Writer.php b/dev/tools/Magento/Tools/Migration/Acl/Db/Writer.php deleted file mode 100644 index 5cda15c5b08d1d4d69887a8427a6820ae57b5e70..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Acl/Db/Writer.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\Acl\Db; - -class Writer -{ - /** - * DB adapter - * - * @var \Magento\Framework\DB\Adapter\Pdo\Mysql - */ - protected $_adapter; - - /** - * Source table name - * - * @var string - */ - protected $_tableName; - - /** - * @param \Magento\Framework\DB\Adapter\AdapterInterface $adapter - * @param string $tableName source table - */ - public function __construct(\Magento\Framework\DB\Adapter\AdapterInterface $adapter, $tableName) - { - $this->_tableName = $tableName; - $this->_adapter = $adapter; - } - - /** - * Update records in database - * - * @param string $oldKey - * @param string $newKey - * @return void - */ - public function update($oldKey, $newKey) - { - $this->_adapter->update( - $this->_tableName, - ['resource_id' => $newKey], - ['resource_id = ?' => $oldKey] - ); - } -} diff --git a/dev/tools/Magento/Tools/Migration/Acl/FileManager.php b/dev/tools/Magento/Tools/Migration/Acl/FileManager.php deleted file mode 100644 index 25c7403a9b5668a3992b062254c39962b907accd..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Acl/FileManager.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\Acl; - -use Magento\Framework\Filesystem\DriverInterface; - -class FileManager -{ - /** - * @param string $fileName - * @param string $contents - * @return void - */ - public function write($fileName, $contents) - { - if (false == is_dir(dirname($fileName))) { - mkdir(dirname($fileName), DriverInterface::WRITEABLE_DIRECTORY_MODE, true); - } - file_put_contents($fileName, $contents); - } - - /** - * Remove file - * - * @param string $fileName - * @return void - */ - public function remove($fileName) - { - unlink($fileName); - } - - /** - * Retrieve contents of a file - * - * @param string $fileName - * @return string - */ - public function getContents($fileName) - { - return file_get_contents($fileName); - } -} diff --git a/dev/tools/Magento/Tools/Migration/Acl/Formatter.php b/dev/tools/Magento/Tools/Migration/Acl/Formatter.php deleted file mode 100644 index 494ea8b0d1a8c01a307e1d189efaed6be7b0e4bb..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Acl/Formatter.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\Acl; - -class Formatter -{ - /** - * @param string $string - * @param string $paramenters - * @return string - */ - public function parseString($string, $paramenters) - { - $tidy = tidy_parse_string($string, $paramenters); - return $tidy->value; - } -} diff --git a/dev/tools/Magento/Tools/Migration/Acl/Generator.php b/dev/tools/Magento/Tools/Migration/Acl/Generator.php deleted file mode 100644 index 26f1cf09eb5782502de1f8215bdc58ec8b3958b5..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Acl/Generator.php +++ /dev/null @@ -1,734 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\Acl; - -require_once __DIR__ . '/Menu/Generator.php'; -require_once __DIR__ . '/FileManager.php'; -class Generator -{ - /** - * @var bool - */ - protected $_printHelp = false; - - /** - * Meta node names - * - * @var array - */ - protected $_metaNodeNames = []; - - /** - * Adminhtml files - * - * @var array|null - */ - protected $_adminhtmlFiles = null; - - /** - * Parsed dom list - * - * @var array - */ - protected $_parsedDomList = []; - - /** - * Map ACL resource xpath to id - * @var array - */ - protected $_aclResourceMaps = []; - - /** - * Map Menu ids - * - * @var array - */ - protected $_menuIdMaps = []; - - /** - * Base application path - * - * @var string|null - */ - protected $_basePath = null; - - /** - * Adminhtml \DOMDocument list - * - * @var array - */ - protected $_adminhtmlDomList = []; - - /** - * @var string - */ - protected $_artifactsPath; - - /** - * Is preview mode - * - * @var bool - */ - protected $_isPreviewMode = false; - - /** - * List of unique ACL ids - * - * @var array - */ - protected $_uniqueName = []; - - /** - * @var \Magento\Tools\Migration\Acl\Formatter - */ - protected $_xmlFormatter; - - /** - * @var \Magento\Tools\Migration\Acl\FileManager - */ - protected $_fileManager; - - /** - * @param \Magento\Tools\Migration\Acl\Formatter $xmlFormatter - * @param \Magento\Tools\Migration\Acl\FileManager $fileManager - * @param array $options configuration options - */ - public function __construct( - \Magento\Tools\Migration\Acl\Formatter $xmlFormatter, - \Magento\Tools\Migration\Acl\FileManager $fileManager, - $options = [] - ) { - $this->_xmlFormatter = $xmlFormatter; - $this->_fileManager = $fileManager; - $this->_printHelp = array_key_exists('h', $options); - $this->_isPreviewMode = array_key_exists('p', $options); - - $this->_metaNodeNames = ['sort_order' => 'sortOrder', 'title' => 'title']; - - $this->_basePath = realpath(__DIR__ . '/../../../../../..'); - - $this->_artifactsPath = realpath(__DIR__) . '/log/'; - } - - /** - * Get module name from file name - * - * @param string $fileName - * @return string - */ - public function getModuleName($fileName) - { - $parts = array_reverse(explode('/', $fileName)); - $module = $parts[3] . '_' . $parts[2]; - return $module; - } - - /** - * Get is forward node - * - * @param string $nodeName - * @return bool - */ - public function isForwardNode($nodeName) - { - return in_array($nodeName, $this->getForwardNodeNames()); - } - - /** - * Get is meta-info node - * - * @param string $nodeName - * @return bool - */ - public function isMetaNode($nodeName) - { - return isset($this->_metaNodeNames[$nodeName]); - } - - /** - * @return string[] - */ - public function getForwardNodeNames() - { - return ['children']; - } - - /** - * @param array $metaNodeNames - * @return void - */ - public function setMetaNodeNames($metaNodeNames) - { - $this->_metaNodeNames = $metaNodeNames; - } - - /** - * @return array - */ - public function getMetaNodeNames() - { - return $this->_metaNodeNames; - } - - /** - * Get is valid node type - * - * @param int $nodeType - * @return bool - */ - public function isValidNodeType($nodeType) - { - return in_array($nodeType, $this->getValidNodeTypes()); - } - - /** - * Get valid node types - * - * @return int[] - */ - public function getValidNodeTypes() - { - return [1]; //DOMElement - } - - /** - * Get etc directory pattern - * - * @param string $codePool - * @param string $namespace - * @return string - */ - public function getEtcDirPattern($codePool = '*', $namespace = '*') - { - return $this->getBasePath() . '/app/code/' . $codePool . '/' . $namespace . '/*/etc/'; - } - - /** - * @param string $basePath - * @return void - */ - public function setBasePath($basePath) - { - $this->_basePath = $basePath; - } - - /** - * @return string - */ - public function getBasePath() - { - return $this->_basePath; - } - - /** - * Create node - * - * @param \DOMDocument $resultDom - * @param string $nodeName - * @param \DOMNode $parent - * @return \DOMNode - */ - public function createNode(\DOMDocument $resultDom, $nodeName, \DOMNode $parent) - { - $newNode = $resultDom->createElement('resource'); - $xpath = $parent->getAttribute('xpath'); - $newNode->setAttribute('xpath', $xpath . '/' . $nodeName); - $parent->appendChild($newNode); - $newNode->setAttribute('id', $this->generateId($newNode, $xpath, $nodeName)); - return $newNode; - } - - /** - * Generate unique id for ACL item - * - * @param \DOMNode $node - * @param string $xpath - * @param string $resourceId - * @return string - */ - public function generateId(\DOMNode $node, $xpath, $resourceId) - { - if (isset($this->_uniqueName[$resourceId]) && $this->_uniqueName[$resourceId] != $xpath) { - $parts = explode('/', $node->parentNode->getAttribute('xpath')); - $suffix = end($parts); - $resourceId = $this->generateId($node->parentNode, $xpath, $suffix . '_' . $resourceId); - } - $this->_uniqueName[$resourceId] = $xpath; - return $resourceId; - } - - /** - * Set meta node - * - * @param \DOMNode $node - * @param \DOMNode $dataNode - * @param string $module - * @return void - */ - public function setMetaInfo(\DOMNode $node, \DOMNode $dataNode, $module) - { - $node->setAttribute($this->_metaNodeNames[$dataNode->nodeName], $dataNode->nodeValue); - if ($dataNode->nodeName == 'title') { - $node->setAttribute('moduleOwner', $module); - $resourceId = $node->getAttribute('moduleOwner') . '::' . $node->getAttribute('id'); - $xpath = $node->getAttribute('xpath'); - $this->_aclResourceMaps[$xpath] = $resourceId; - } - } - - /** - * @return array - */ - public function getAclResourceMaps() - { - return $this->_aclResourceMaps; - } - - /** - * @return array - */ - public function getAdminhtmlFiles() - { - if (null === $this->_adminhtmlFiles) { - $localFiles = glob($this->getEtcDirPattern('local') . 'adminhtml.xml'); - $communityFiles = glob($this->getEtcDirPattern('community') . 'adminhtml.xml'); - $coreFiles = glob($this->getEtcDirPattern('core') . 'adminhtml.xml'); - $this->_adminhtmlFiles = array_merge($localFiles, $communityFiles, $coreFiles); - } - return $this->_adminhtmlFiles; - } - - /** - * @param array $adminhtmlFiles - * @return void - */ - public function setAdminhtmlFiles($adminhtmlFiles) - { - $this->_adminhtmlFiles = $adminhtmlFiles; - } - - /** - * @return array - */ - public function getParsedDomList() - { - return $this->_parsedDomList; - } - - /** - * Parse node - * - * @param \DOMNode $node - data source - * @param \DOMDocument $dom - result \DOMDocument - * @param \DOMNode $parentNode - parent node from result document - * @param string $moduleName - * @return void - */ - public function parseNode(\DOMNode $node, \DOMDocument $dom, \DOMNode $parentNode, $moduleName) - { - if ($this->isRestrictedNode($node->nodeName)) { - return; - } - - foreach ($node->childNodes as $item) { - if (false == $this->isValidNodeType($item->nodeType) || $this->isRestrictedNode($item->nodeName)) { - continue; - } - - if ($this->isForwardNode($item->nodeName)) { - $this->parseNode($item, $dom, $parentNode, $moduleName); - } elseif ($this->isMetaNode($item->nodeName)) { - $this->setMetaInfo($parentNode, $item, $moduleName); - } else { - $newNode = $this->createNode($dom, $item->nodeName, $parentNode); - if ($item->childNodes->length > 0) { - $this->parseNode($item, $dom, $newNode, $moduleName); - } - } - } - } - - /** - * Check if node is restricted - * - * @param string $nodeName - * @return bool - */ - public function isRestrictedNode($nodeName) - { - return in_array($nodeName, $this->getRestrictedNodeNames()); - } - - /** - * Print help message - * - * @return void - */ - public function printHelpMessage() - { - $output = './acl.php -- [-hp]' . PHP_EOL; - $output .= 'additional parameters:' . PHP_EOL; - $output .= ' -h print usage' . PHP_EOL; - $output .= ' -p preview result' . PHP_EOL; - echo $output; - } - - /** - * Get template for result \DOMDocument - * - * @return \DOMDocument - */ - public function getResultDomDocument() - { - $resultDom = new \DOMDocument(); - $resultDom->formatOutput = true; - - $config = $resultDom->createElement('config'); - $resultDom->appendChild($config); - - $acl = $resultDom->createElement('acl'); - $config->appendChild($acl); - - $parent = $resultDom->createElement('resources'); - $parent->setAttribute('xpath', 'config/acl/resources'); - $acl->appendChild($parent); - return $resultDom; - } - - /** - * Parse adminhtml.xml files - * - * @return void - */ - public function parseAdminhtmlFiles() - { - foreach ($this->getAdminhtmlFiles() as $file) { - $module = $this->getModuleName($file); - $resultDom = $this->getResultDomDocument(); - - $adminhtmlDom = new \DOMDocument(); - $adminhtmlDom->load($file); - $this->_adminhtmlDomList[$file] = $adminhtmlDom; - - $xpath = new \DOMXPath($adminhtmlDom); - $resourcesList = $xpath->query('//config/acl/*'); - /** @var $aclNode \DOMNode **/ - foreach ($resourcesList as $aclNode) { - $this->parseNode( - $aclNode, - $resultDom, - $resultDom->getElementsByTagName('resources')->item(0), - $module - ); - } - $this->_parsedDomList[$file] = $resultDom; - } - } - - /** - * Update ACL resource id - * - * @return void - */ - public function updateAclResourceIds() - { - /** @var $dom \DOMDocument **/ - foreach ($this->_parsedDomList as $dom) { - $list = $dom->getElementsByTagName('resources'); - /** @var $node \DOMNode **/ - foreach ($list as $node) { - $node->removeAttribute('xpath'); - if ($node->childNodes->length > 0) { - $this->updateChildAclNodes($node); - } - } - } - } - - /** - * @param \DOMNode $node - * @return void - */ - public function updateChildAclNodes($node) - { - /** @var $item \DOMNode **/ - foreach ($node->childNodes as $item) { - if (false == $this->isValidNodeType($item->nodeType)) { - continue; - } - $xpath = $item->getAttribute('xpath'); - $resourceId = $item->getAttribute('moduleOwner') . '::' . $item->getAttribute('id'); - if (isset($this->_aclResourceMaps[$xpath])) { - $resourceId = $this->_aclResourceMaps[$xpath]; - } - $item->setAttribute('id', $resourceId); - $item->removeAttribute('xpath'); - $item->removeAttribute('moduleOwner'); - - if ($item->childNodes->length > 0) { - $this->updateChildAclNodes($item); - } - } - } - - /** - * @param array $aclResourceMaps - * @return void - */ - public function setAclResourceMaps($aclResourceMaps) - { - $this->_aclResourceMaps = $aclResourceMaps; - } - - /** - * Save ACL files - * - * @return void - * @throws \Exception If tidy extension is not installed - */ - public function saveAclFiles() - { - if ($this->_isPreviewMode) { - return; - } - - /** @var $dom \DOMDocument **/ - foreach ($this->_parsedDomList as $originFile => $dom) { - $file = str_replace('adminhtml.xml', 'adminhtml' . '/acl.xml', $originFile); - $dom->preserveWhiteSpace = false; - $dom->formatOutput = true; - - $output = $this->_xmlFormatter->parseString( - $dom->saveXml(), - [ - 'indent' => true, - 'input-xml' => true, - 'output-xml' => true, - 'add-xml-space' => false, - 'indent-spaces' => 4, - 'wrap' => 1000 - ] - ); - $this->_fileManager->write($file, $output); - } - } - - /** - * @param array $parsedDomList - * @return void - */ - public function setParsedDomList($parsedDomList) - { - $this->_parsedDomList = $parsedDomList; - } - - /** - * @param array $adminhtmlDomList - * @return void - */ - public function setAdminhtmlDomList($adminhtmlDomList) - { - $this->_adminhtmlDomList = $adminhtmlDomList; - } - - /** - * @return array - */ - public function getAdminhtmlDomList() - { - return $this->_adminhtmlDomList; - } - - /** - * Remove empty files - * - * @return array - */ - public function removeAdminhtmlFiles() - { - $output = ['removed' => [], 'not_removed' => []]; - - /** @var $dom \DOMDocument **/ - foreach ($this->_adminhtmlDomList as $file => $dom) { - $xpath = new \DOMXPath($dom); - $nodeList = $xpath->query('/config/acl'); - if ($nodeList->length == 0) { - continue; - } - $acl = $nodeList->item(0); - $countNodes = $acl->childNodes->length - 1; - for ($i = $countNodes; $i >= 0; $i--) { - $node = $acl->childNodes->item($i); - if (in_array($node->nodeName, $this->getNodeToRemove())) { - $acl->removeChild($node); - } - } - if ($this->isNodeEmpty($acl)) { - if (false == $this->_isPreviewMode) { - $this->_fileManager->remove($file); - } - $output['removed'][] = $file; - } else { - $output['not_removed'][] = $file; - } - } - - $output['artifacts']['AclXPathToAclId.log'] = json_encode($this->_aclResourceMaps); - return $output; - } - - /** - * Check if node is empty - * - * @param \DOMNode $node - * @return bool - */ - public function isNodeEmpty(\DOMNode $node) - { - $output = true; - foreach ($node->childNodes as $item) { - if ($this->isValidNodeType($item->nodeType)) { - $output = false; - break; - } - } - return $output; - } - - /** - * @param string $artifactsPath - * @return void - */ - public function setArtifactsPath($artifactsPath) - { - $this->_artifactsPath = $artifactsPath; - } - - /** - * Run migration process - * - * @return void - */ - public function run() - { - if ($this->_printHelp) { - $this->printHelpMessage(); - return; - } - $this->parseAdminhtmlFiles(); - - $this->updateAclResourceIds(); - - $this->saveAclFiles(); - - $result = $this->removeAdminhtmlFiles(); - - $menuResult = $this->processMenu(); - - $artifacts = array_merge($result['artifacts'], $menuResult['artifacts']); - - $this->saveArtifacts($artifacts); - - $this->printStatistic($result, $menuResult, $artifacts); - } - - /** - * Print statistic - * - * @param array $result - * @param array $menuResult - * @param array $artifacts - * @return void - */ - public function printStatistic($result, $menuResult, $artifacts) - { - $output = PHP_EOL; - if (true == $this->_isPreviewMode) { - $output .= '!!! PREVIEW MODE. ORIGIN DATA NOT CHANGED!!!' . PHP_EOL; - } - - $output .= PHP_EOL; - - $output .= 'Removed adminhtml.xml: ' . count($result['removed']) . ' files ' . PHP_EOL; - $output .= 'Not Removed adminhtml.xml: ' . count($result['not_removed']) . ' files ' . PHP_EOL; - if (count($result['not_removed'])) { - foreach ($result['not_removed'] as $fileName) { - $output .= ' - ' . $fileName . PHP_EOL; - } - } - - $output .= PHP_EOL; - $output .= 'Mapped Menu Items: ' . count($menuResult['mapped']) . PHP_EOL; - $output .= 'Not Mapped Menu Items: ' . count($menuResult['not_mapped']) . PHP_EOL; - - if (count($menuResult['not_mapped'])) { - foreach ($menuResult['not_mapped'] as $menuId) { - $output .= ' - ' . $menuId . PHP_EOL; - } - } - - $output .= 'Menu Update Errors: ' . count($menuResult['menu_update_errors']) . PHP_EOL; - if (count($menuResult['menu_update_errors'])) { - foreach ($menuResult['menu_update_errors'] as $errorText) { - $output .= ' - ' . $errorText . PHP_EOL; - } - } - - $output .= PHP_EOL; - $output .= 'Artifacts: ' . PHP_EOL; - foreach (array_keys($artifacts) as $file) { - $output .= ' - ' . $this->_artifactsPath . $file . PHP_EOL; - } - - echo $output; - } - - /** - * Save artifacts files - * - * @param array $artifacts - * @return void - */ - public function saveArtifacts($artifacts) - { - foreach ($artifacts as $file => $data) { - $this->_fileManager->write($this->_artifactsPath . $file, $data); - } - } - - /** - * Run process of menu updating - * - * @return array - */ - public function processMenu() - { - $menu = new \Magento\Tools\Migration\Acl\Menu\Generator( - $this->getBasePath(), - $this->getValidNodeTypes(), - $this->_aclResourceMaps, - $this->_fileManager, - $this->_isPreviewMode - ); - return $menu->run(); - } - - /** - * @return array - */ - public function getRestrictedNodeNames() - { - return ['privilegeSets']; - } - - /** - * @return array - */ - public function getNodeToRemove() - { - return ['resources', 'privilegeSets']; - } -} diff --git a/dev/tools/Magento/Tools/Migration/Acl/Menu/Generator.php b/dev/tools/Magento/Tools/Migration/Acl/Menu/Generator.php deleted file mode 100644 index 7b23712b7b9bd05fa0edaca4974b099fdd414856..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Acl/Menu/Generator.php +++ /dev/null @@ -1,410 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\Acl\Menu; - -class Generator -{ - /** - * @var array - */ - protected $_menuFiles; - - /** - * @var string - */ - protected $_basePath; - - /** - * @var string - */ - protected $_validNodeTypes; - - /** - * @var array - */ - protected $_menuIdMaps = []; - - /** - * @var array - */ - protected $_idToXPath = []; - - /** - * @var array - */ - protected $_aclXPathToId = []; - - /** - * @var array - */ - protected $_menuIdToAclId = []; - - /** - * @var array - */ - protected $_menuDomList = []; - - /** - * @var array - */ - protected $_updateNodes = []; - - /** - * Is preview mode - * - * @var bool - */ - protected $_isPreviewMode; - - /** - * @var \Magento\Tools\Migration\Acl\FileManager - */ - protected $_fileManager; - - /** - * @param string $basePath - * @param string $validNodeTypes - * @param array $aclXPathToId - * @param \Magento\Tools\Migration\Acl\FileManager $fileManager - * @param bool $preview - */ - public function __construct( - $basePath, - $validNodeTypes, - $aclXPathToId, - \Magento\Tools\Migration\Acl\FileManager $fileManager, - $preview = true - ) { - $this->_fileManager = $fileManager; - $this->_basePath = $basePath; - $this->_validNodeTypes = $validNodeTypes; - $this->_aclXPathToId = $aclXPathToId; - $this->_updateNodes = [ - 'add' => ['required' => true, 'attribute' => 'resource'], - 'update' => ['required' => false, 'attribute' => 'resource'], - ]; - - $this->_isPreviewMode = $preview; - } - - /** - * Get etc directory pattern - * - * @return null|string - */ - public function getEtcDirPattern() - { - return $this->_basePath . '/app/code/*/*/*/etc/'; - } - - /** - * @return array|null - */ - public function getMenuFiles() - { - if (null === $this->_menuFiles) { - $pattern = $this->getEtcDirPattern() . 'adminhtml/menu.xml'; - $this->_menuFiles = glob($pattern); - } - return $this->_menuFiles; - } - - /** - * Parse menu item node - * - * @param \DOMNode $node - * @return void - */ - public function parseMenuNode(\DOMNode $node) - { - /** @var $childNode \DOMNode **/ - foreach ($node->childNodes as $childNode) { - if (false == in_array($childNode->nodeType, $this->_validNodeTypes) || 'add' != $childNode->nodeName) { - continue; - } - $this->_menuIdMaps[$childNode->getAttribute('id')]['parent'] = $childNode->getAttribute('parent'); - $this->_menuIdMaps[$childNode->getAttribute('id')]['resource'] = $childNode->getAttribute('resource'); - } - } - - /** - * @return array - */ - public function getMenuIdMaps() - { - return $this->_menuIdMaps; - } - - /** - * Parse menu files - * - * @return void - */ - public function parseMenuFiles() - { - foreach ($this->getMenuFiles() as $file) { - $dom = new \DOMDocument(); - $dom->load($file); - $this->_menuDomList[$file] = $dom; - $menus = $dom->getElementsByTagName('menu'); - - /** @var $menuNode \DOMNode **/ - foreach ($menus as $menuNode) { - $this->parseMenuNode($menuNode); - } - } - } - - /** - * @return array - */ - public function getMenuDomList() - { - return $this->_menuDomList; - } - - /** - * @param string $menuId - * @return void - */ - public function initParentItems($menuId) - { - $this->_menuIdMaps[$menuId]['parents'] = []; - $parentId = $this->_menuIdMaps[$menuId]['parent']; - while ($parentId) { - $this->_menuIdMaps[$menuId]['parents'][] = $parentId; - if (false == isset($this->_menuIdMaps[$parentId])) { - return; - } - $parentId = $this->_menuIdMaps[$parentId]['parent']; - } - } - - /** - * Build xpath elements - * - * @param string $menuId - * @return void - */ - public function buildXPath($menuId) - { - $parents = $this->_menuIdMaps[$menuId]['parents'] ? $this->_menuIdMaps[$menuId]['parents'] : []; - $resource = $this->_menuIdMaps[$menuId]['resource']; - if (!$resource) { - $parts = []; - $parents = array_reverse($parents); - $parents[] = $menuId; - - foreach ($parents as $parent) { - $parentParts = explode('::', $parent); - $idPart = $parentParts[1]; - $prevParts = implode('_', $parts); - $start = strpos($prevParts, $idPart) + strlen($prevParts); - $id = substr($idPart, $start); - $parts[] = trim($id, '_'); - } - $resource = implode('/', $parts); - } - - $this->_idToXPath[$menuId] = $resource; - } - - /** - * @return array - */ - public function getIdToXPath() - { - return $this->_idToXPath; - } - - /** - * Initialize menu items XPath - * - * @return void - */ - public function buildMenuItemsXPath() - { - foreach (array_keys($this->_menuIdMaps) as $menuId) { - $this->initParentItems($menuId); - $this->buildXPath($menuId); - } - } - - /** - * Map menu item id to ACL resource id - * - * @return array - */ - public function mapMenuToAcl() - { - $output = ['mapped' => [], 'not_mapped' => []]; - $aclPrefix = 'config/acl/resources/admin/'; - foreach ($this->_idToXPath as $menuId => $menuXPath) { - $key = $aclPrefix . $menuXPath; - if (isset($this->_aclXPathToId[$key])) { - $this->_menuIdToAclId[$menuId] = $this->_aclXPathToId[$key]; - $output['mapped'][] = $menuId; - } else { - $output['not_mapped'][] = $menuId; - } - } - - $output['artifacts']['MenuIdToAclId.log'] = json_encode($this->_menuIdToAclId); - return $output; - } - - /** - * @return array - */ - public function getMenuIdToAclId() - { - return $this->_menuIdToAclId; - } - - /** - * @param array $idToXPath - * @return void - */ - public function setIdToXPath($idToXPath) - { - $this->_idToXPath = $idToXPath; - } - - /** - * Update attributes of menu items to set ACL resource id - * - * @return string[] - */ - public function updateMenuAttributes() - { - $errors = []; - $aclPrefix = 'config/acl/resources/admin/'; - /** @var $dom \DOMDocument **/ - foreach ($this->_menuDomList as $file => $dom) { - $menu = $dom->getElementsByTagName('menu')->item(0); - /** @var $childNode \DOMNode **/ - foreach ($menu->childNodes as $childNode) { - if (!$this->_isNodeValidToUpdate($childNode)) { - continue; - } - - $attributeName = $this->_updateNodes[$childNode->nodeName]['attribute']; - $required = $this->_updateNodes[$childNode->nodeName]['required']; - $resource = $childNode->getAttribute($attributeName); - $menuId = $childNode->getAttribute('id'); - - if (false == array_key_exists($menuId, $this->_menuIdToAclId)) { - $errors[] = 'File: ' . $file . ' :: Menu: ' . $menuId . ' is not mapped to ACL id'; - continue; - } - $aclId = $this->_menuIdToAclId[$menuId]; - - if ($resource) { - $aclXPath = $aclPrefix . $resource; - if (false == array_key_exists($aclXPath, $this->_aclXPathToId)) { - $errors[] = 'File: ' . - $file . - ' :: Menu: ' . - $menuId . - '. There is no ACL resource with XPath ' . - $aclXPath; - continue; - } - $aclId = $this->_aclXPathToId[$aclXPath]; - } - if ($required || $resource) { - $childNode->setAttribute($attributeName, $aclId); - } - } - } - - return $errors; - } - - /** - * Check if node has to be updated - * - * @param \DOMNode $node - * @return bool - */ - protected function _isNodeValidToUpdate(\DOMNode $node) - { - if (false == in_array( - $node->nodeType, - $this->_validNodeTypes - ) || false == array_key_exists( - $node->nodeName, - $this->_updateNodes - ) - ) { - return false; - } - - return true; - } - - /** - * @param array $menuIdToAclId - * @return void - */ - public function setMenuIdToAclId($menuIdToAclId) - { - $this->_menuIdToAclId = $menuIdToAclId; - } - - /** - * @param array $aclXPathToId - * @return void - */ - public function setAclXPathToId($aclXPathToId) - { - $this->_aclXPathToId = $aclXPathToId; - } - - /** - * @param array $menuDomList - * @return void - */ - public function setMenuDomList($menuDomList) - { - $this->_menuDomList = $menuDomList; - } - - /** - * Save menu XML files - * - * @return void - */ - public function saveMenuFiles() - { - if (true == $this->_isPreviewMode) { - return; - } - /** @var $dom \DOMDocument **/ - foreach ($this->_menuDomList as $file => $dom) { - $dom->formatOutput = true; - $this->_fileManager->write($file, $dom->saveXML()); - } - } - - /** - * @return array - */ - public function run() - { - $this->parseMenuFiles(); - - $this->buildMenuItemsXPath(); - - $result = $this->mapMenuToAcl(); - - $result['menu_update_errors'] = $this->updateMenuAttributes(); - - $this->saveMenuFiles(); - - return $result; - } -} diff --git a/dev/tools/Magento/Tools/Migration/Acl/db.php b/dev/tools/Magento/Tools/Migration/Acl/db.php deleted file mode 100644 index c0d9fb611d63e35ecbf7e61f8654986ffa54e25f..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Acl/db.php +++ /dev/null @@ -1,61 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -$rootDir = realpath(__DIR__ . '/../../../..'); -require $rootDir . '/app/autoload.php'; -\Magento\Framework\Filesystem\FileResolver::addIncludePath([$rootDir . '/lib', $rootDir . '/dev']); -$defaultReportFile = 'report.log'; - -try { - $options = new \Zend_Console_Getopt( - [ - 'file=s' => "File containing json encoded acl identifier map (old => new)", - 'mode|w' => "Application mode. Preview mode is default. If set to 'write' - database is updated.", - 'output|f-w' => "Report output type. Report is flushed to console by default." . - "If set to 'file', report is written to file /log/report.log", - 'dbprovider=w' => "Database adapter class name. Default: \Magento\Framework\DB\Adapter\Pdo\Mysql", - 'dbhost=s' => "Database server host", - 'dbuser=s' => "Database server user", - 'dbpassword=s' => "Database server password", - 'dbname=s' => "Database name", - 'dbtable=s' => "Table containing resource ids", - ] - ); - - $fileReader = new \Magento\Tools\Migration\Acl\Db\FileReader(); - - $map = $fileReader->extractData($options->getOption('file')); - - $dbAdapterFactory = new \Magento\Tools\Migration\Acl\Db\Adapter\Factory(); - - $dbAdapter = $dbAdapterFactory->getConnection( - $dbConfig = [ - 'host' => $options->getOption('dbhost'), - 'username' => $options->getOption('dbuser'), - 'password' => $options->getOption('dbpassword'), - 'dbname' => $options->getOption('dbname'), - ], - $options->getOption('dbprovider') - ); - - $loggerFactory = new \Magento\Tools\Migration\Acl\Db\Logger\Factory(); - $logger = $loggerFactory->getLogger($options->getOption('output'), $defaultReportFile); - - $writer = new \Magento\Tools\Migration\Acl\Db\Writer($dbAdapter, $options->getOption('dbtable')); - $reader = new \Magento\Tools\Migration\Acl\Db\Reader($dbAdapter, $options->getOption('dbtable')); - - $updater = new \Magento\Tools\Migration\Acl\Db\Updater($reader, $writer, $logger, $options->getOption('mode')); - $updater->migrate($map); - - $logger->report(); -} catch (\Zend_Console_Getopt_Exception $e) { - echo $e->getUsageMessage(); - exit; -} catch (\InvalidArgumentException $exp) { - echo $exp->getMessage(); -} catch (\Exception $exp) { - echo $exp->getMessage(); -} diff --git a/dev/tools/Magento/Tools/Migration/System/Configuration/AbstractLogger.php b/dev/tools/Magento/Tools/Migration/System/Configuration/AbstractLogger.php deleted file mode 100644 index eae8c30cd609a99d9febe4a2154d8104bd75dfb0..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/System/Configuration/AbstractLogger.php +++ /dev/null @@ -1,73 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\System\Configuration; - -/** - * System configuration migration logger - */ -abstract class AbstractLogger -{ - const FILE_KEY_VALID = 'valid'; - - const FILE_KEY_INVALID = 'invalid'; - - /** - * List of logs - * - * @var array - */ - protected $_logs = [self::FILE_KEY_VALID => [], self::FILE_KEY_INVALID => []]; - - /** - * Add log data - * - * @param string $fileName - * @param string $type - * @return \Magento\Tools\Migration\System\Configuration\AbstractLogger - */ - public function add($fileName, $type) - { - $this->_logs[$type][] = $fileName; - return $this; - } - - /** - * Convert logger object to string - * - * @return string - */ - public function __toString() - { - $result = []; - $totalCount = 0; - foreach ($this->_logs as $type => $data) { - $countElements = count($data); - $totalCount += $countElements; - $total[] = $type . ': ' . $countElements; - - if (!$countElements) { - continue; - } - - $result[] = '------------------------------'; - $result[] = $type . ':'; - foreach ($data as $fileName) { - $result[] = $fileName; - } - } - - $total[] = 'Total: ' . $totalCount; - $result = array_merge($total, $result); - return implode(PHP_EOL, $result); - } - - /** - * Generate report - * - * @return void - */ - abstract public function report(); -} diff --git a/dev/tools/Magento/Tools/Migration/System/Configuration/Formatter.php b/dev/tools/Magento/Tools/Migration/System/Configuration/Formatter.php deleted file mode 100644 index 098f0199ed92d64fc7b4adfd2ce4aa62e1ab216f..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/System/Configuration/Formatter.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\System\Configuration; - -class Formatter -{ - /** - * @param string $string - * @param string $parameters - * @return string - */ - public function parseString($string, $parameters) - { - $tidy = tidy_parse_string($string, $parameters); - return $tidy->value; - } -} diff --git a/dev/tools/Magento/Tools/Migration/System/Configuration/Generator.php b/dev/tools/Magento/Tools/Migration/System/Configuration/Generator.php deleted file mode 100644 index 0fad06e937f3815c91a90a460b788dcc6a4b080f..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/System/Configuration/Generator.php +++ /dev/null @@ -1,190 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\System\Configuration; - -use Magento\Tools\Migration\System\FileManager; - -class Generator -{ - /** - * @var FileManager - */ - protected $_fileManager; - - /** - * @var Formatter - */ - protected $_xmlFormatter; - - /** - * @var AbstractLogger - */ - protected $_logger; - - /** - * Base directory path - * - * @var string - */ - protected $_basePath; - - /** - * @var AbstractLogger - */ - protected $_fileSchemaPath; - - /** - * @param Formatter $xmlFormatter - * @param FileManager $fileManager - * @param AbstractLogger $logger - */ - public function __construct(Formatter $xmlFormatter, FileManager $fileManager, AbstractLogger $logger) - { - $this->_fileManager = $fileManager; - $this->_xmlFormatter = $xmlFormatter; - $this->_logger = $logger; - - $this->_basePath = realpath(__DIR__ . '/../../../../../../../'); - $this->_fileSchemaPath = $this->_basePath . '/app/code/Mage/Config/etc/system_file.xsd'; - } - - /** - * Create configuration array from xml file - * - * @param string $fileName - * @param array $configuration - * @return void - */ - public function createConfiguration($fileName, array $configuration) - { - $domDocument = $this->_createDOMDocument($configuration); - if (@(!$domDocument->schemaValidate($this->_fileSchemaPath))) { - $this->_logger->add($this->_removeBasePath($fileName), AbstractLogger::FILE_KEY_INVALID); - } else { - $this->_logger->add($this->_removeBasePath($fileName), AbstractLogger::FILE_KEY_VALID); - } - - $output = $this->_xmlFormatter->parseString( - $domDocument->saveXml(), - [ - 'indent' => true, - 'input-xml' => true, - 'output-xml' => true, - 'add-xml-space' => false, - 'indent-spaces' => 4, - 'wrap' => 1000 - ] - ); - $newFileName = $this->_getPathToSave($fileName); - $this->_fileManager->write($newFileName, $output); - } - - /** - * Create DOM document based on configuration - * - * @param array $configuration - * @return \DOMDocument - */ - protected function _createDOMDocument(array $configuration) - { - $dom = new \DOMDocument(); - $configElement = $dom->createElement('config'); - $systemElement = $dom->createElement('system'); - $configElement->appendChild($systemElement); - $dom->appendChild($configElement); - - foreach ($configuration['nodes'] as $config) { - $element = $this->_createElement($config, $dom); - $systemElement->appendChild($element); - } - return $dom; - } - - /** - * Create element - * - * @param array $config - * @param \DOMDocument $dom - * @return \DOMElement - */ - protected function _createElement($config, \DOMDocument $dom) - { - $element = $dom->createElement($this->_getValue($config, 'nodeName'), $this->_getValue($config, '#text', '')); - if ($this->_getValue($config, '#cdata-section')) { - $cdataSection = $dom->createCDATASection($this->_getValue($config, '#cdata-section', '')); - $element->appendChild($cdataSection); - } - - foreach ($this->_getValue($config, '@attributes', []) as $attributeName => $attributeValue) { - $element->setAttribute($attributeName, $attributeValue); - } - - foreach ($this->_getValue($config, 'parameters', []) as $paramConfig) { - if ($this->_getValue($paramConfig, 'name') == '#text') { - $element->nodeValue = $this->_getValue($paramConfig, 'value', ''); - continue; - } - - $childElement = $dom->createElement($paramConfig['name'], $this->_getValue($paramConfig, '#text', '')); - - if ($this->_getValue($paramConfig, '#cdata-section')) { - $childCDataSection = $dom->createCDATASection($this->_getValue($paramConfig, '#cdata-section')); - $childElement->appendChild($childCDataSection); - } - - foreach ($this->_getValue($paramConfig, '@attributes', []) as $attributeName => $attributeValue) { - $childElement->setAttribute($attributeName, $attributeValue); - } - - foreach ($this->_getValue($paramConfig, 'subConfig', []) as $subConfig) { - $childElement->appendChild($this->_createElement($subConfig, $dom)); - } - - $element->appendChild($childElement); - } - - foreach ($this->_getValue($config, 'subConfig', []) as $subConfig) { - $element->appendChild($this->_createElement($subConfig, $dom)); - } - - return $element; - } - - /** - * Get value from array by key - * - * @param array $source - * @param string $key - * @param mixed $default - * @return mixed - */ - protected function _getValue($source, $key, $default = null) - { - return array_key_exists($key, $source) ? $source[$key] : $default; - } - - /** - * Get new path to system configuration file - * - * @param string $fileName - * @return string - */ - protected function _getPathToSave($fileName) - { - return dirname($fileName) . '/adminhtml/system.xml'; - } - - /** - * Remove path to magento application - * - * @param string $filename - * @return string - */ - protected function _removeBasePath($filename) - { - return str_replace($this->_basePath . '/', '', $filename); - } -} diff --git a/dev/tools/Magento/Tools/Migration/System/Configuration/Logger/Console.php b/dev/tools/Magento/Tools/Migration/System/Configuration/Logger/Console.php deleted file mode 100644 index 62df82f9d8a19fc46a598cb6587d6a28a88c6b3e..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/System/Configuration/Logger/Console.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\System\Configuration\Logger; - -/** - * Migration logger. Output result print to console - */ -class Console extends \Magento\Tools\Migration\System\Configuration\AbstractLogger -{ - /** - * Print logs to console - * - * @return void - */ - public function report() - { - echo $this; - } -} diff --git a/dev/tools/Magento/Tools/Migration/System/Configuration/Logger/Factory.php b/dev/tools/Magento/Tools/Migration/System/Configuration/Logger/Factory.php deleted file mode 100644 index 87ecb9d9306d3ec3325145f1b53b6d28b0c1672e..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/System/Configuration/Logger/Factory.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\System\Configuration\Logger; - -class Factory -{ - /** - * Get logger instance - * - * @param string $loggerType - * @param string $filePath - * @param \Magento\Tools\Migration\System\FileManager $fileManager - * @return \Magento\Tools\Migration\System\Configuration\AbstractLogger - */ - public function getLogger($loggerType, $filePath, \Magento\Tools\Migration\System\FileManager $fileManager) - { - /** @var \Magento\Tools\Migration\System\Configuration\AbstractLogger $loggerInstance */ - $loggerInstance = null; - switch ($loggerType) { - case 'file': - $loggerInstance = new \Magento\Tools\Migration\System\Configuration\Logger\File( - $filePath, - $fileManager - ); - break; - default: - $loggerInstance = new \Magento\Tools\Migration\System\Configuration\Logger\Console(); - break; - } - - return $loggerInstance; - } -} diff --git a/dev/tools/Magento/Tools/Migration/System/Configuration/Logger/File.php b/dev/tools/Magento/Tools/Migration/System/Configuration/Logger/File.php deleted file mode 100644 index 58549c50fe49ee8b8b73ddcd53ce701dd2186a05..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/System/Configuration/Logger/File.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\System\Configuration\Logger; - -/** - * Migration logger. Output result put to file - */ -class File extends \Magento\Tools\Migration\System\Configuration\AbstractLogger -{ - /** - * Path to log file - * - * @var string - */ - protected $_file = null; - - /** - * @var \Magento\Tools\Migration\System\FileManager - */ - protected $_fileManager; - - /** - * @param string $file - * @param \Magento\Tools\Migration\System\FileManager $fileManger - * @throws \InvalidArgumentException - */ - public function __construct($file, \Magento\Tools\Migration\System\FileManager $fileManger) - { - $this->_fileManager = $fileManger; - - $logDir = realpath(__DIR__ . '/../../') . '/log/'; - - if (empty($file)) { - throw new \InvalidArgumentException('Log file name is required'); - } - $this->_file = $logDir . $file; - } - - /** - * Put report to file - * - * @return void - */ - public function report() - { - $this->_fileManager->write($this->_file, (string)$this); - } -} diff --git a/dev/tools/Magento/Tools/Migration/System/Configuration/Mapper.php b/dev/tools/Magento/Tools/Migration/System/Configuration/Mapper.php deleted file mode 100644 index 4955147661c5b61bdf58a5d7ebbd513d66ba103a..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/System/Configuration/Mapper.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\System\Configuration; - -class Mapper -{ - /** - * @var \Magento\Tools\Migration\System\Configuration\Mapper\Tab - */ - protected $_tabMapper; - - /** - * @var \Magento\Tools\Migration\System\Configuration\Mapper\Section - */ - protected $_sectionMapper; - - /** - * @param \Magento\Tools\Migration\System\Configuration\Mapper\Tab $tabMapper - * @param \Magento\Tools\Migration\System\Configuration\Mapper\Section $sectionMapper - */ - public function __construct( - \Magento\Tools\Migration\System\Configuration\Mapper\Tab $tabMapper, - \Magento\Tools\Migration\System\Configuration\Mapper\Section $sectionMapper - ) { - $this->_tabMapper = $tabMapper; - $this->_sectionMapper = $sectionMapper; - } - - /** - * Transform configuration - * - * @param array $config - * @return array - */ - public function transform(array $config) - { - $output = []; - $output['comment'] = isset($config['comment']) ? $config['comment'] : ''; - - $tabsConfig = isset($config['tabs']) ? $config['tabs'] : []; - $sectionsConfig = isset($config['sections']) ? $config['sections'] : []; - - /** @var array $nodes */ - $nodes = $this->_tabMapper->transform($tabsConfig); - - $transformedSections = $this->_sectionMapper->transform($sectionsConfig); - - $nodes = array_merge($nodes, $transformedSections); - - $output['nodes'] = $nodes; - - return $output; - } -} diff --git a/dev/tools/Magento/Tools/Migration/System/Configuration/Mapper/AbstractMapper.php b/dev/tools/Magento/Tools/Migration/System/Configuration/Mapper/AbstractMapper.php deleted file mode 100644 index c18a4cb0445c7de272da3b2f87a06fa76603764d..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/System/Configuration/Mapper/AbstractMapper.php +++ /dev/null @@ -1,211 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\System\Configuration\Mapper; - -abstract class AbstractMapper -{ - /** - * Attribute maps - * oldName => newName - * @var array - */ - protected $_attributeMaps = [ - 'sort_order' => 'sortOrder', - 'show_in_default' => 'showInDefault', - 'show_in_store' => 'showInStore', - 'show_in_website' => 'showInWebsite', - 'frontend_type' => 'type', - ]; - - /** - * List of allowed field names - * - * @var array - */ - protected $_allowedFieldNames = []; - - /** - * Transform configuration - * - * @param array $config - * @return array - */ - abstract public function transform(array $config); - - /** - * Transform sub configuration - * - * @param array $config - * @param array $parentNode - * @param array $element - * @return mixed - */ - abstract protected function _transformSubConfig(array $config, $parentNode, $element); - - /** - * Transform element configuration - * - * @param string $nodeId - * @param array $config - * @param string $nodeName - * @param array $allowedNames - * @return array - */ - protected function _transformElement($nodeId, $config, $nodeName, $allowedNames = []) - { - $element = []; - $element['nodeName'] = $nodeName; - if (false === empty($nodeId)) { - $element['@attributes']['id'] = $nodeId; - } - $attributes = $this->_getValue($config, '@attributes', []); - $element = $this->_transformAttributes($attributes, $element); - - if (false === empty($attributes)) { - unset($config['@attributes']); - } - - $element = $this->_transformNodes($config, $element, $allowedNames); - return $element; - } - - /** - * Transform attributes - * - * @param array $attributes - * @param array $element - * @return array - */ - protected function _transformAttributes($attributes, $element) - { - foreach ($attributes as $attributeName => $attributeValue) { - $element['@attributes'][$this->_getAttributeName($attributeName)] = $attributeValue; - } - return $element; - } - - /** - * Get attribute name - * - * @param string $key - * @return string - */ - protected function _getAttributeName($key) - { - return $this->_getValue($this->_attributeMaps, $key, $key); - } - - /** - * Check if node must be moved to attribute - * - * @param string $key - * @return bool - */ - protected function _needMoveToAttribute($key) - { - return $this->_getValue($this->_attributeMaps, $key, false); - } - - /** - * Transform nodes configuration - * - * @param array $config - * @param array $element - * @param array $allowedNames - * @return array - */ - protected function _transformNodes($config, $element, $allowedNames = []) - { - $element['parameters'] = []; - foreach ($config as $nodeName => $nodeValue) { - if ($this->_needMoveToAttribute($nodeName)) { - $element['@attributes'][$this->_getAttributeName($nodeName)] = $nodeValue['#text']; - unset($config[$nodeName]); - continue; - } - - $node = []; - if ($this->_isNotAllowedNodeName($allowedNames, $nodeName)) { - $node['@attributes'] = ['type' => $nodeName]; - $nodeName = 'attribute'; - } - - $node['name'] = $nodeName; - if ($this->_isSubConfigValue($nodeValue)) { - $element = $this->_transformSubConfig($nodeValue, $node, $element); - continue; - } else { - if ($this->_getValue($nodeValue, '@attributes', false)) { - if ($this->_getValue($node, '@attributes', false)) { - $node['@attributes'] = array_merge( - $this->_getValue($node, '@attributes', []), - $this->_getValue($nodeValue, '@attributes', []) - ); - } else { - $node['@attributes'] = $this->_getValue($nodeValue, '@attributes', []); - } - } - - if ($this->_getValue($nodeValue, '#text', false)) { - $node['#text'] = $this->_getValue($nodeValue, '#text'); - } - if ($this->_getValue($nodeValue, '#cdata-section', false)) { - $node['#cdata-section'] = $this->_getValue($nodeValue, '#cdata-section'); - } - } - - $element['parameters'][] = $node; - } - - return $element; - } - - /** - * Check if node value must be converted as sub config - * - * @param mixed $nodeValue - * @return bool - */ - protected function _isSubConfigValue($nodeValue) - { - return is_array( - $nodeValue - ) && !($this->_getValue( - $nodeValue, - '#text', - false - ) || $this->_getValue( - $nodeValue, - '#cdata-section', - false - )); - } - - /** - * Check if specified node name is not allowed - * - * @param array $allowedNames - * @param string $nodeName - * @return bool - */ - protected function _isNotAllowedNodeName($allowedNames, $nodeName) - { - return false === empty($allowedNames) && false == in_array($nodeName, $allowedNames); - } - - /** - * Get value from array by key - * - * @param array $source - * @param string $key - * @param mixed $default - * @return mixed - */ - protected function _getValue($source, $key, $default = null) - { - return array_key_exists($key, $source) ? $source[$key] : $default; - } -} diff --git a/dev/tools/Magento/Tools/Migration/System/Configuration/Mapper/Field.php b/dev/tools/Magento/Tools/Migration/System/Configuration/Mapper/Field.php deleted file mode 100644 index 2ca53fb09dc320fbcb944f5e8608eda1b995ccc3..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/System/Configuration/Mapper/Field.php +++ /dev/null @@ -1,138 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\System\Configuration\Mapper; - -class Field extends \Magento\Tools\Migration\System\Configuration\Mapper\AbstractMapper -{ - /** - * List of allowed node names - * - * @var string[] - */ - protected $_allowedFieldNames = [ - 'label', - 'comment', - 'tooltip', - 'frontend_class', - 'validate', - 'can_be_empty', - 'if_module_enabled', - 'frontend_model', - 'backend_model', - 'source_model', - 'config_path', - 'base_url', - 'upload_dir', - 'button_url', - 'button_label', - 'depends', - 'more_url', - 'demo_url', - 'hide_in_single_store_mode', - ]; - - /** - * Transform field config - * - * @param array $config - * @return array - */ - public function transform(array $config) - { - $output = []; - foreach ($config as $fieldName => $fieldConfig) { - $output[] = $this->_transformElement($fieldName, $fieldConfig, 'field', $this->_allowedFieldNames); - } - return $output; - } - - /** - * Transform sub configuration - * - * @param array $config - * @param array $parentNode - * @param array $element - * @return array - */ - public function _transformSubConfig(array $config, $parentNode, $element) - { - switch ($parentNode['name']) { - case 'depends': - $parentNode['subConfig'] = $this->_transformElementDepends($config); - break; - - case 'attribute': - $parentNode['subConfig'] = $this->_transformElementAttribute($config); - break; - } - - $element['parameters'][] = $parentNode; - - return $element; - } - - /** - * Transform depends configuration - * - * @param array $config - * @return array - */ - protected function _transformElementDepends(array $config) - { - $result = []; - foreach ($config as $nodeName => $nodeValue) { - $element = []; - $element['nodeName'] = 'field'; - $element['@attributes']['id'] = $nodeName; - $attributes = $this->_getValue($nodeValue, '@attributes', []); - $element = $this->_transformAttributes($attributes, $element); - - if (false === empty($attributes)) { - unset($nodeValue['@attributes']); - } - - $element['#text'] = $nodeValue['#text']; - $result[] = $element; - } - - return $result; - } - - /** - * Transform element configuration - * - * @param array $config - * @return array - */ - protected function _transformElementAttribute(array $config) - { - $result = []; - foreach ($config as $nodeName => $nodeValue) { - $element = []; - $element['nodeName'] = $nodeName; - $attributes = $this->_getValue($nodeValue, '@attributes', []); - $element = $this->_transformAttributes($attributes, $element); - - if (false === empty($attributes)) { - unset($nodeValue['@attributes']); - } - if ($this->_isSubConfigValue($nodeValue)) { - $element['subConfig'] = $this->_transformElementAttribute($nodeValue); - } else { - if ($this->_getValue($nodeValue, '#text', false)) { - $element['#text'] = $this->_getValue($nodeValue, '#text'); - } - if ($this->_getValue($nodeValue, '#cdata-section', false)) { - $element['#cdata-section'] = $this->_getValue($nodeValue, '#cdata-section'); - } - } - - $result[] = $element; - } - - return $result; - } -} diff --git a/dev/tools/Magento/Tools/Migration/System/Configuration/Mapper/Group.php b/dev/tools/Magento/Tools/Migration/System/Configuration/Mapper/Group.php deleted file mode 100644 index 0394730ab1d50a9d2a6ca6970e2e3758a1e34341..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/System/Configuration/Mapper/Group.php +++ /dev/null @@ -1,70 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\System\Configuration\Mapper; - -class Group extends \Magento\Tools\Migration\System\Configuration\Mapper\AbstractMapper -{ - /** - * @var Tools_Migration_System_Configuration_Mapper_Field - */ - protected $_fieldMapper; - - /** - * List of allowed field names for group - * @var array - */ - protected $_allowedFieldNames = [ - 'label', - 'frontend_model', - 'clone_fields', - 'clone_model', - 'fieldset_css', - 'help_url', - 'comment', - 'hide_in_single_store_mode', - 'expanded', - ]; - - /** - * @param Tools_Migration_System_Configuration_Mapper_Field $fieldMapper - */ - public function __construct(\Magento\Tools\Migration\System\Configuration\Mapper\Field $fieldMapper) - { - $this->_fieldMapper = $fieldMapper; - } - - /** - * Transform group configuration - * - * @param array $config - * @return array - */ - public function transform(array $config) - { - $output = []; - foreach ($config as $groupName => $groupConfig) { - $output[] = $this->_transformElement($groupName, $groupConfig, 'group'); - } - return $output; - } - - /** - * @param array $config - * @param array $parentNode - * @param array $element - * @return array - */ - protected function _transformSubConfig(array $config, $parentNode, $element) - { - if ($parentNode['name'] == 'fields') { - $subConfig = $this->_fieldMapper->transform($config); - if (null !== $subConfig) { - $element['subConfig'] = $subConfig; - } - } - return $element; - } -} diff --git a/dev/tools/Magento/Tools/Migration/System/Configuration/Mapper/Section.php b/dev/tools/Magento/Tools/Migration/System/Configuration/Mapper/Section.php deleted file mode 100644 index d5963b24bd27b1703b122c91bd6a9c681adc329d..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/System/Configuration/Mapper/Section.php +++ /dev/null @@ -1,63 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\System\Configuration\Mapper; - -class Section extends \Magento\Tools\Migration\System\Configuration\Mapper\AbstractMapper -{ - /** - * @var \Magento\Tools\Migration\System\Configuration\Mapper\Group - */ - protected $_groupMapper; - - /** - * List of allowed filed names for section - * - * @var array - */ - protected $_allowedFieldNames = ['label', 'class', 'resource', 'header_css', 'tab']; - - /** - * @param \Magento\Tools\Migration\System\Configuration\Mapper\Group $groupMapper - */ - public function __construct(\Magento\Tools\Migration\System\Configuration\Mapper\Group $groupMapper) - { - $this->_groupMapper = $groupMapper; - } - - /** - * Transform section config - * - * @param array $config - * @return array - */ - public function transform(array $config) - { - $output = []; - foreach ($config as $sectionName => $sectionConfig) { - $output[] = $this->_transformElement($sectionName, $sectionConfig, 'section'); - } - return $output; - } - - /** - * Transform section sub configuration - * - * @param array $config - * @param array $parentNode - * @param array $element - * @return array - */ - protected function _transformSubConfig(array $config, $parentNode, $element) - { - if ($parentNode['name'] == 'groups') { - $subConfig = $this->_groupMapper->transform($config); - if (null !== $subConfig) { - $element['subConfig'] = $subConfig; - } - } - return $element; - } -} diff --git a/dev/tools/Magento/Tools/Migration/System/Configuration/Mapper/Tab.php b/dev/tools/Magento/Tools/Migration/System/Configuration/Mapper/Tab.php deleted file mode 100644 index 1375c671eb3b3cbc9863fd9cf217946b4664f947..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/System/Configuration/Mapper/Tab.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\System\Configuration\Mapper; - -class Tab extends \Magento\Tools\Migration\System\Configuration\Mapper\AbstractMapper -{ - /** - * Attribute maps - * oldName => newName - * @var array - */ - protected $_attributeMaps = ['sort_order' => 'sortOrder', 'frontend_type' => 'type', 'class' => 'class']; - - /** - * List of allowed filed names for tab - * - * @var array - */ - protected $_allowedFieldNames = ['label']; - - /** - * Transform tabs configuration - * - * @param array $config - * @return array - */ - public function transform(array $config) - { - $output = []; - foreach ($config as $tabName => $tabConfig) { - $output[] = $this->_transformElement($tabName, $tabConfig, 'tab'); - } - return $output; - } - - /** - * Transform sub configuration - * - * @param array $config - * @param array $parentNode - * @param array $element - * @return array - */ - protected function _transformSubConfig(array $config, $parentNode, $element) - { - return $element; - } -} diff --git a/dev/tools/Magento/Tools/Migration/System/Configuration/Parser.php b/dev/tools/Magento/Tools/Migration/System/Configuration/Parser.php deleted file mode 100644 index 8d0c93da7155810d81f10a2036befd88adbb5f72..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/System/Configuration/Parser.php +++ /dev/null @@ -1,146 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -/** - * System configuration migration parser - */ -namespace Magento\Tools\Migration\System\Configuration; - -class Parser -{ - /** - * Parse dom document - * - * @param \DOMDocument $dom - * @return array - */ - public function parse(\DOMDocument $dom) - { - $result = []; - if ($dom->hasChildNodes()) { - foreach ($dom->childNodes as $child) { - if (XML_COMMENT_NODE == $child->nodeType) { - $result['comment'] = $child->nodeValue; - } elseif (XML_ELEMENT_NODE == $child->nodeType && 'config' == $child->nodeName) { - $result = array_merge($result, $this->_parseNode($child)); - } - } - } - return $result; - } - - /** - * Parse dom node - * - * @param \DOMNode $node - * @return array - */ - protected function _parseNode(\DOMNode $node) - { - $result = []; - if (false === $node->hasChildNodes()) { - $result = $this->_getSimpleNodeValue($node); - } else { - foreach ($node->childNodes as $childNode) { - $sameNodesCount = $this->_getSameNodesCount( - $node->getElementsByTagName($childNode->nodeName), - $childNode - ); - /** @var array $nodeValue */ - $nodeValue = $this->_parseNode($childNode); - - $siblingKey = $this->_getSiblingKey($childNode); - - if ($siblingKey !== 0) { - $nodeValue = isset( - $nodeValue[$childNode->nodeName] - ) ? $nodeValue[$childNode->nodeName] : $nodeValue; - } elseif (empty($nodeValue)) { - continue; - } - - // how many of these child nodes do we have? - if ($sameNodesCount > 1) { - // more than 1 child - make numeric array - $result[$siblingKey][] = $nodeValue; - } else { - $result[$siblingKey] = $nodeValue; - } - } - // if the child is <foo>bar</foo>, the result will be array(bar) - // make the result just 'bar' - if (count($result) == 1 && isset($result[0])) { - $result = current($result); - } - } - - $attributes = $this->_parseNodeAttributes($node); - $result = array_merge($result, $attributes); - return $result; - } - - /** - * Get sibling key - * - * @param \DOMNode $childNode - * @return int|string - */ - protected function _getSiblingKey($childNode) - { - return $childNode->nodeName[0] == '#' ? 0 : $childNode->nodeName; - } - - /** - * Get count of the same nodes - * - * @param \DOMNodeList $childNodeList - * @param \DOMNode $childNode - * @return int - */ - protected function _getSameNodesCount(\DOMNodeList $childNodeList, \DOMNode $childNode) - { - $childCount = 0; - foreach ($childNodeList as $oNode) { - if ($oNode->parentNode->isSameNode($childNode->parentNode)) { - $childCount++; - } - } - return $childCount; - } - - /** - * Get value of node without child nodes - * - * @param \DOMNode $node - * @return array - */ - protected function _getSimpleNodeValue(\DOMNode $node) - { - return trim($node->nodeValue) !== '' ? [$node->nodeName => $node->nodeValue] : []; - } - - /** - * Parse node attributes - * - * @param \DOMNode $node - * @return array - */ - protected function _parseNodeAttributes(\DOMNode $node) - { - $result = []; - $attributes = []; - if ($node->hasAttributes()) { - foreach ($node->attributes as $oAttrNode) { - $attributes[$oAttrNode->nodeName] = $oAttrNode->nodeValue; - } - } - - if (count($attributes)) { - $result = ['@attributes' => $attributes]; - } - return $result; - } -} diff --git a/dev/tools/Magento/Tools/Migration/System/Configuration/Reader.php b/dev/tools/Magento/Tools/Migration/System/Configuration/Reader.php deleted file mode 100644 index 52d1e67f1efe6e837e5eb2810dc8040969506728..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/System/Configuration/Reader.php +++ /dev/null @@ -1,87 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\System\Configuration; - -/** - * System configuration migration reader - */ -class Reader -{ - /** - * @var \Magento\Tools\Migration\System\FileManager - */ - protected $_fileManager; - - /** - * @var \Magento\Tools\Migration\System\Configuration\Parser - */ - protected $_parser; - - /** - * @var \Magento\Tools\Migration\System\Configuration\Mapper - */ - protected $_mapper; - - /** - * @var string base application path - */ - protected $_basePath; - - /** - * pattern to find all system.xml files - */ - const SYSTEM_CONFIG_PATH_PATTERN = 'app/code/*/*/*/etc/system.xml'; - - /** - * @param \Magento\Tools\Migration\System\FileManager $fileManager - * @param \Magento\Tools\Migration\System\Configuration\Parser $parser - * @param \Magento\Tools\Migration\System\Configuration\Mapper $mapper Tools_Migration_System_Configuration_Mapper - */ - public function __construct( - \Magento\Tools\Migration\System\FileManager $fileManager, - \Magento\Tools\Migration\System\Configuration\Parser $parser, - \Magento\Tools\Migration\System\Configuration\Mapper $mapper - ) { - $this->_fileManager = $fileManager; - $this->_parser = $parser; - $this->_mapper = $mapper; - - $this->_basePath = realpath(__DIR__ . '/../../../../../../..'); - } - - /** - * Get configuration per file - * - * @return array - */ - public function getConfiguration() - { - $files = $this->_fileManager->getFileList( - $this->_basePath . '/' . \Magento\Tools\Migration\System\Configuration\Reader::SYSTEM_CONFIG_PATH_PATTERN - ); - $result = []; - foreach ($files as $fileName) { - $result[$fileName] = $this->_mapper->transform( - $this->_parser->parse($this->_getDOMDocument($this->_fileManager->getContents($fileName))) - ); - } - - return $result; - } - - /** - * Create Dom document from xml string - * - * @param string $xml - * @return \DOMDocument - */ - protected function _getDOMDocument($xml) - { - $dom = new \DOMDocument(); - $dom->loadXML($xml); - return $dom; - } -} diff --git a/dev/tools/Magento/Tools/Migration/System/FileManager.php b/dev/tools/Magento/Tools/Migration/System/FileManager.php deleted file mode 100644 index 169231d7a2f0f434b7c0eb8677fa83ed8bfd38f5..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/System/FileManager.php +++ /dev/null @@ -1,74 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\System; - -class FileManager -{ - /** - * @var \Magento\Tools\Migration\System\FileReader - */ - protected $_reader; - - /** - * @var \Magento\Tools\Migration\System\WriterInterface - */ - protected $_writer; - - /** - * @param \Magento\Tools\Migration\System\FileReader $reader - * @param \Magento\Tools\Migration\System\WriterInterface $writer - */ - public function __construct( - \Magento\Tools\Migration\System\FileReader $reader, - \Magento\Tools\Migration\System\WriterInterface $writer - ) { - $this->_reader = $reader; - $this->_writer = $writer; - } - - /** - * @param string $fileName - * @param string $contents - * @return void - */ - public function write($fileName, $contents) - { - $this->_writer->write($fileName, $contents); - } - - /** - * Remove file - * - * @param string $fileName - * @return void - */ - public function remove($fileName) - { - $this->_writer->remove($fileName); - } - - /** - * Retrieve contents of a file - * - * @param string $fileName - * @return string - */ - public function getContents($fileName) - { - return $this->_reader->getContents($fileName); - } - - /** - * Get file list - * - * @param string $pattern - * @return string[] - */ - public function getFileList($pattern) - { - return $this->_reader->getFileList($pattern); - } -} diff --git a/dev/tools/Magento/Tools/Migration/System/FileReader.php b/dev/tools/Magento/Tools/Migration/System/FileReader.php deleted file mode 100644 index b4d9510b43b39a9bf402e0ee8d0aa41a763244c0..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/System/FileReader.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\System; - -class FileReader -{ - /** - * Retrieve contents of a file - * - * @param string $fileName - * @return string - * @throws \InvalidArgumentException - */ - public function getContents($fileName) - { - if (false === file_exists($fileName)) { - throw new \InvalidArgumentException($fileName . ' does not exist'); - } - return file_get_contents($fileName); - } - - /** - * Get file list - * - * @param string $pattern - * @return string[] - */ - public function getFileList($pattern) - { - return glob($pattern); - } -} diff --git a/dev/tools/Magento/Tools/Migration/System/Writer/Factory.php b/dev/tools/Magento/Tools/Migration/System/Writer/Factory.php deleted file mode 100644 index 81a8414d49dad0c1f66dade9d366a7adf41e18be..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/System/Writer/Factory.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\System\Writer; - -class Factory -{ - /** - * @param string $type - * @return \Magento\Tools\Migration\System\WriterInterface - */ - public function getWriter($type) - { - $writerClassName = null; - switch ($type) { - case 'write': - $writerClassName = 'Magento\Tools\Migration\System\Writer\FileSystem'; - break; - default: - $writerClassName = 'Magento\Tools\Migration\System\Writer\Memory'; - break; - } - return new $writerClassName(); - } -} diff --git a/dev/tools/Magento/Tools/Migration/System/Writer/FileSystem.php b/dev/tools/Magento/Tools/Migration/System/Writer/FileSystem.php deleted file mode 100644 index 9d13f68a94f2dd3fb63ed3a9a3e7a9106c03f8be..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/System/Writer/FileSystem.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\System\Writer; - -use Magento\Framework\Filesystem\DriverInterface; - -class FileSystem implements \Magento\Tools\Migration\System\WriterInterface -{ - /** - * @param string $fileName - * @param string $contents - * @return void - */ - public function write($fileName, $contents) - { - if (false == is_dir(dirname($fileName))) { - mkdir(dirname($fileName), DriverInterface::WRITEABLE_DIRECTORY_MODE, true); - } - file_put_contents($fileName, $contents); - } - - /** - * Remove file - * - * @param string $fileName - * @return void - */ - public function remove($fileName) - { - unlink($fileName); - } -} diff --git a/dev/tools/Magento/Tools/Migration/System/Writer/Memory.php b/dev/tools/Magento/Tools/Migration/System/Writer/Memory.php deleted file mode 100644 index fd2f05d8064052e1de3ba07db7a547ec5684a796..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/System/Writer/Memory.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\System\Writer; - -class Memory implements \Magento\Tools\Migration\System\WriterInterface -{ - /** - * @param string $fileName - * @param string $contents - * @return void - */ - public function write($fileName, $contents) - { - } - - /** - * Remove file - * - * @param string $fileName - * @return void - */ - public function remove($fileName) - { - } -} diff --git a/dev/tools/Magento/Tools/Migration/System/WriterInterface.php b/dev/tools/Magento/Tools/Migration/System/WriterInterface.php deleted file mode 100644 index 694c16e18da74988820c953be88d275ce36e1c12..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/System/WriterInterface.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\System; - -interface WriterInterface -{ - /** - * @param string $fileName - * @param string $contents - * @return void - */ - public function write($fileName, $contents); - - /** - * Remove file - * - * @param string $fileName - * @return void - */ - public function remove($fileName); -} diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/Db/Adapter/FactoryTest.php b/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/Db/Adapter/FactoryTest.php deleted file mode 100644 index dd3f85923d2118a3d711124daf320534ed0001fe..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/Db/Adapter/FactoryTest.php +++ /dev/null @@ -1,79 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\Test\Unit\Acl\Db\Adapter; - -require_once realpath( - __DIR__ . '/../../../../../../../../../' -) . '/tools/Magento/Tools/Migration/Acl/Db/Adapter/Factory.php'; -class FactoryTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var array - */ - protected $_config; - - protected function setUp() - { - $this->_config = ['dbname' => 'some_db_name', 'password' => '', 'username' => '']; - } - - /** - * @return array - */ - public function getConnectionDataProvider() - { - return [['Magento\Framework\DB\Adapter\Pdo\Mysql'], [''], [null]]; - } - - /** - * @param $adapterType - * @dataProvider getConnectionDataProvider - */ - public function testGetConnection($adapterType) - { - $connectionMock = $this->getMock('Magento\Framework\DB\Adapter\Pdo\Mysql', [], [], '', false); - - $objectManager = $this->getMock('Magento\Framework\ObjectManagerInterface'); - $objectManager->expects( - $this->any() - )->method( - 'create' - )->with( - $this->equalTo('Magento\Framework\DB\Adapter\Pdo\Mysql') - )->will( - $this->returnValue($connectionMock) - ); - - $factory = new \Magento\Tools\Migration\Acl\Db\Adapter\Factory($objectManager); - $adapter = $factory->getConnection($this->_config, $adapterType); - - $this->assertInstanceOf('Magento\Framework\DB\Adapter\Pdo\Mysql', $adapter); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testGetConnectionWithInvalidType() - { - $adapterType = 'Magento\Framework\DataObject'; - $adapterMock = $this->getMock($adapterType, [], [], '', false); - - $objectManager = $this->getMock('Magento\Framework\ObjectManagerInterface'); - $objectManager->expects( - $this->once() - )->method( - 'create' - )->with( - $this->equalTo($adapterType), - $this->equalTo(['config' => $this->_config]) - )->will( - $this->returnValue($adapterMock) - ); - - $factory = new \Magento\Tools\Migration\Acl\Db\Adapter\Factory($objectManager); - $factory->getConnection($this->_config, $adapterType); - } -} diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/Db/FileReaderTest.php b/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/Db/FileReaderTest.php deleted file mode 100644 index 3bb3da30ba3a8cba3081faca02de2629637e9654..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/Db/FileReaderTest.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\Test\Unit\Acl\Db; - -require_once realpath( - __DIR__ . '/../../../../../../../../' -) . '/tools/Magento/Tools/Migration/Acl/Db/FileReader.php'; -class FileReaderTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var \Magento\Tools\Migration\Acl\Db\FileReader - */ - protected $_model; - - protected function setUp() - { - $this->_model = new \Magento\Tools\Migration\Acl\Db\FileReader(); - } - - public function testExtractData() - { - $filePath = __DIR__ . '/../_files/log/AclXPathToAclId.log'; - $expectedMap = [ - "admin/test1/test2" => "Test1_Test2::all", - "admin/test1/test2/test3" => "Test1_Test2::test3", - "admin/test1/test2/test4" => "Test1_Test2::test4", - "admin/test1/test2/test5" => "Test1_Test2::test5", - "admin/test6" => "Test6_Test6::all", - ]; - $this->assertEquals($expectedMap, $this->_model->extractData($filePath)); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testExtractDataThrowsExceptionIfInvalidFileProvided() - { - $this->_model->extractData('invalidFile.log'); - } -} diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/Db/Logger/ConsoleTest.php b/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/Db/Logger/ConsoleTest.php deleted file mode 100644 index 671e11cdc971e6c7bff74945001d7d42895b2e6c..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/Db/Logger/ConsoleTest.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\Test\Unit\Acl\Db\Logger; - -require_once realpath( - __DIR__ . '/../../../../../../../../../' -) . '/tools/Magento/Tools/Migration/Acl/Db/AbstractLogger.php'; - -require_once realpath( - __DIR__ . '/../../../../../../../../../' -) . '/tools/Magento/Tools/Migration/Acl/Db/Logger/Console.php'; -class ConsoleTest extends \PHPUnit_Framework_TestCase -{ - public function testReport() - { - $this->expectOutputRegex('/^Mapped items count: 0(.)*/'); - $model = new \Magento\Tools\Migration\Acl\Db\Logger\Console(); - $model->report(); - } -} diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/Db/Logger/FactoryTest.php b/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/Db/Logger/FactoryTest.php deleted file mode 100644 index 7395130233e4104345bafc9c359718cbc8f0d151..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/Db/Logger/FactoryTest.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\Test\Unit\Acl\Db\Logger; - -require_once realpath( - __DIR__ . '/../../../../../../../../../' -) . '/tools/Magento/Tools/Migration/Acl/Db/AbstractLogger.php'; -require_once realpath( - __DIR__ . '/../../../../../../../../../' -) . '/tools/Magento/Tools/Migration/Acl/Db/Logger/Factory.php'; -require_once realpath( - __DIR__ . '/../../../../../../../../../' -) . '/tools/Magento/Tools/Migration/Acl/Db/Logger/Console.php'; -require_once realpath( - __DIR__ . '/../../../../../../../../../' -) . '/tools/Magento/Tools/Migration/Acl/Db/Logger/File.php'; -class FactoryTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var \Magento\Tools\Migration\Acl\Db\Logger\Factory - */ - protected $_model; - - protected function setUp() - { - $this->_model = new \Magento\Tools\Migration\Acl\Db\Logger\Factory(); - } - - protected function tearDown() - { - unset($this->_model); - } - - /** - * @return array - */ - public function getLoggerDataProvider() - { - return [['console', null], ['file', realpath(__DIR__ . '/../../../../../') . '/tmp']]; - } - - /** - * @param string $loggerType - * @param string $file - * @dataProvider getLoggerDataProvider - */ - public function testGetLogger($loggerType, $file) - { - $this->assertInstanceOf( - 'Magento\Tools\Migration\Acl\Db\AbstractLogger', - $this->_model->getLogger($loggerType, $file) - ); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testGetLoggerWithInvalidType() - { - $this->_model->getLogger('invalid type'); - } -} diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/Db/Logger/FileTest.php b/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/Db/Logger/FileTest.php deleted file mode 100644 index 85853f77dead9c0727f6ae38c0c0dff819b6b567..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/Db/Logger/FileTest.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\Test\Unit\Acl\Db\Logger; - -require_once realpath( - __DIR__ . '/../../../../../../../../../' -) . '/tools/Magento/Tools/Migration/Acl/Db/AbstractLogger.php'; -require_once realpath( - __DIR__ . '/../../../../../../../../../' -) . '/tools/Magento/Tools/Migration/Acl/Db/Logger/File.php'; -class FileTest extends \PHPUnit_Framework_TestCase -{ - public function testConstructWithValidFile() - { - new \Magento\Tools\Migration\Acl\Db\Logger\File(realpath(__DIR__ . '/../../../../../') . '/tmp/'); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testConstructWithInValidFile() - { - new \Magento\Tools\Migration\Acl\Db\Logger\File(null); - } -} diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/Db/LoggerAbstractTest.php b/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/Db/LoggerAbstractTest.php deleted file mode 100644 index fa35157631c5ed6db7d8af63471808c7406f8144..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/Db/LoggerAbstractTest.php +++ /dev/null @@ -1,70 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\Test\Unit\Acl\Db; - -require_once realpath( - __DIR__ . '/../../../../../../../../' -) . '/tools/Magento/Tools/Migration/Acl/Db/AbstractLogger.php'; -class LoggerAbstractTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var \Magento\Tools\Migration\Acl\Db\AbstractLogger - */ - protected $_model; - - protected function setUp() - { - $this->_model = $this->getMockForAbstractClass('Magento\Tools\Migration\Acl\Db\AbstractLogger'); - } - - protected function tearDown() - { - unset($this->_model); - } - - /** - * @covers \Magento\Tools\Migration\Acl\Db\AbstractLogger::add() - * @covers \Magento\Tools\Migration\Acl\Db\AbstractLogger::__toString() - */ - public function testToString() - { - $this->_model->add('key1', 'key2', 3); - // mapped item - $this->_model->add('key2', null, false); - // not mapped item - $this->_model->add(null, 'Some_Module::acl_resource', false); - //item in actual format - - $expected = 'Mapped items count: 1' . - PHP_EOL . - 'Not mapped items count: 1' . - PHP_EOL . - 'Items in actual format count: 1' . - PHP_EOL . - '------------------------------' . - PHP_EOL . - 'Mapped items:' . - PHP_EOL . - 'key1 => key2 :: Count updated rules: 3' . - PHP_EOL . - '------------------------------' . - PHP_EOL . - 'Not mapped items:' . - PHP_EOL . - 'key2' . - PHP_EOL . - '------------------------------' . - PHP_EOL . - 'Items in actual format:' . - PHP_EOL . - 'Some_Module::acl_resource' . - PHP_EOL . - '------------------------------' . - PHP_EOL; - - $this->assertEquals($expected, (string)$this->_model); - } -} diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/Db/ReaderTest.php b/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/Db/ReaderTest.php deleted file mode 100644 index 4e4a711681a22841e7b81403a3b812843579ed11..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/Db/ReaderTest.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\Test\Unit\Acl\Db; - -use Magento\Framework\DB\Select; - -require_once realpath(__DIR__ . '/../../../../../../../../') . '/tools/Magento/Tools/Migration/Acl/Db/Reader.php'; -class ReaderTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var \Magento\Tools\Migration\Acl\Db\Reader - */ - protected $_model; - - /** - * DB adapter - * - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $_adapterMock; - - protected function setUp() - { - $this->_adapterMock = $this->getMock( - 'Magento\Framework\DB\Adapter\Pdo\Mysql', - ['select', 'fetchPairs'], - [], - '', - false - ); - $this->_model = new \Magento\Tools\Migration\Acl\Db\Reader($this->_adapterMock, 'dummy'); - } - - protected function tearDown() - { - unset($this->_model); - unset($this->_adapterMock); - } - - public function testFetchAll() - { - $expected = ['all' => 10, 'catalog' => 100]; - $selectMock = $this->getMock(Select::class, [], [], '', false); - $this->_adapterMock->expects($this->once())->method('select')->will($this->returnValue($selectMock)); - $selectMock->expects($this->once())->method('from')->will($this->returnSelf()); - $selectMock->expects($this->once())->method('columns')->will($this->returnSelf()); - $selectMock->expects($this->once())->method('group')->will($this->returnSelf()); - $this->_adapterMock->expects($this->once())->method('fetchPairs')->will($this->returnValue($expected)); - $actual = $this->_model->fetchAll(); - $this->assertEquals($expected, $actual); - } -} diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/Db/UpdaterTest.php b/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/Db/UpdaterTest.php deleted file mode 100644 index a5f626ecc341354c605e7142c38bfd3b3118a722..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/Db/UpdaterTest.php +++ /dev/null @@ -1,102 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\Test\Unit\Acl\Db; - -require_once realpath(__DIR__ . '/../../../../../../../../') . '/tools/Magento/Tools/Migration/Acl/Db/Updater.php'; -class UpdaterTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $_readerMock; - - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $_writerMock; - - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $_loggerMock; - - /** - * @var array - */ - protected $_map = []; - - protected function setUp() - { - $this->_readerMock = $this->getMock('Magento\Tools\Migration\Acl\Db\Reader', [], [], '', false); - $this->_readerMock->expects( - $this->once() - )->method( - 'fetchAll' - )->will( - $this->returnValue( - ['oldResource1' => 1, 'oldResource2' => 2, 'Test::newResource3' => 3, 'additionalResource' => 4] - ) - ); - - $this->_map = [ - "oldResource1" => "Test::newResource1", - "oldResource2" => "Test::newResource2", - "oldResource3" => "Test::newResource3", - "oldResource4" => "Test::newResource4", - "oldResource5" => "Test::newResource5", - ]; - - $this->_writerMock = $this->getMock('Magento\Tools\Migration\Acl\Db\Writer', [], [], '', false); - $this->_loggerMock = $this->getMockForAbstractClass( - 'Magento\Tools\Migration\Acl\Db\AbstractLogger', - [], - '', - false, - false, - false, - ['add'] - ); - } - - public function testMigrateInPreviewModeDoesntWriteToDb() - { - $model = new \Magento\Tools\Migration\Acl\Db\Updater( - $this->_readerMock, - $this->_writerMock, - $this->_loggerMock, - null - ); - - $this->_writerMock->expects($this->never())->method('update'); - - $this->_loggerMock->expects($this->at(0))->method('add')->with('oldResource1', 'Test::newResource1', 1); - $this->_loggerMock->expects($this->at(1))->method('add')->with('oldResource2', 'Test::newResource2', 2); - $this->_loggerMock->expects($this->at(2))->method('add')->with(null, 'Test::newResource3', 3); - $this->_loggerMock->expects($this->at(3))->method('add')->with('additionalResource', null, 4); - - $model->migrate($this->_map); - } - - public function testMigrateInRealModeWritesToDb() - { - $model = new \Magento\Tools\Migration\Acl\Db\Updater( - $this->_readerMock, - $this->_writerMock, - $this->_loggerMock, - \Magento\Tools\Migration\Acl\Db\Updater::WRITE_MODE - ); - - $this->_writerMock->expects($this->at(0))->method('update')->with('oldResource1', 'Test::newResource1'); - $this->_writerMock->expects($this->at(1))->method('update')->with('oldResource2', 'Test::newResource2'); - - $this->_loggerMock->expects($this->at(0))->method('add')->with('oldResource1', 'Test::newResource1', 1); - $this->_loggerMock->expects($this->at(1))->method('add')->with('oldResource2', 'Test::newResource2', 2); - $this->_loggerMock->expects($this->at(2))->method('add')->with(null, 'Test::newResource3', 3); - $this->_loggerMock->expects($this->at(3))->method('add')->with('additionalResource', null, 4); - - $model->migrate($this->_map); - } -} diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/Db/WriterTest.php b/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/Db/WriterTest.php deleted file mode 100644 index 2af08d9c32b2b2998fd0e65ef317126d1c1c8927..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/Db/WriterTest.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\Test\Unit\Acl\Db; - -require_once realpath(__DIR__ . '/../../../../../../../../') . '/tools/Magento/Tools/Migration/Acl/Db/Writer.php'; -class WriterTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var \Magento\Tools\Migration\Acl\Db\Writer - */ - protected $_model; - - /** - * DB adapter - * - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $_adapterMock; - - protected function setUp() - { - $this->_adapterMock = $this->getMock('Magento\Framework\DB\Adapter\Pdo\Mysql', ['update'], [], '', false); - $this->_model = new \Magento\Tools\Migration\Acl\Db\Writer($this->_adapterMock, 'dummy'); - } - - protected function tearDown() - { - unset($this->_model); - unset($this->_adapterMock); - } - - public function testUpdate() - { - $this->_adapterMock->expects( - $this->once() - )->method( - 'update' - )->with( - 'dummy', - ['resource_id' => 'new'], - ['resource_id = ?' => 'old'] - ); - $this->_model->update('old', 'new'); - } -} diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/GeneratorRemoveTest.php b/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/GeneratorRemoveTest.php deleted file mode 100644 index 0a03d23ab951ef30c3070b49f7c9eee6cad87a7d..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/GeneratorRemoveTest.php +++ /dev/null @@ -1,80 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\Test\Unit\Acl; - -require_once realpath(__DIR__ . '/../../../../../../../') . '/tools/Magento/Tools/Migration/Acl/Generator.php'; -require_once realpath(__DIR__ . '/../../../../../../../') . '/tools/Magento/Tools/Migration/Acl/FileManager.php'; -require_once realpath(__DIR__ . '/../../../../../../../') . '/tools/Magento/Tools/Migration/Acl/Formatter.php'; -/** - * Tools_Migration_Acl_Generator remove test case - */ -class GeneratorRemoveTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var $model \Magento\Tools\Migration\Acl\Generator - */ - protected $_model; - - /** - * @var string - */ - protected $_emptyFile; - - /** - * @var string - */ - protected $_notEmptyFile; - - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $_xmlFormatterMock; - - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $_fileManagerMock; - - protected function setUp() - { - $fixturePath = realpath(__DIR__) . '/_files'; - $path = $fixturePath . '/remove/'; - - $this->_emptyFile = $path . 'empty.xml'; - $this->_notEmptyFile = $path . 'not_empty.xml'; - - $this->_xmlFormatterMock = $this->getMock('Magento\Tools\Migration\Acl\Formatter'); - $this->_fileManagerMock = $this->getMock('Magento\Tools\Migration\Acl\FileManager'); - $this->_fileManagerMock->expects($this->once())->method('remove')->with($this->equalTo($this->_emptyFile)); - $this->_model = new \Magento\Tools\Migration\Acl\Generator($this->_xmlFormatterMock, $this->_fileManagerMock); - } - - protected function tearDown() - { - unset($this->_model); - } - - public function testRemoveAdminhtmlFiles() - { - $domEmpty = new \DOMDocument(); - $domEmpty->load($this->_emptyFile); - - $domNotEmpty = new \DOMDocument(); - $domNotEmpty->load($this->_notEmptyFile); - - $adminhtmlDomList = [$this->_emptyFile => $domEmpty, $this->_notEmptyFile => $domNotEmpty]; - - $this->_model->setAdminhtmlDomList($adminhtmlDomList); - $expected = [ - 'removed' => [$this->_emptyFile], - 'not_removed' => [$this->_notEmptyFile], - 'artifacts' => ['AclXPathToAclId.log' => json_encode([])], - ]; - - $result = $this->_model->removeAdminhtmlFiles(); - $this->assertEquals($expected, $result); - } -} diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/GeneratorSaveTest.php b/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/GeneratorSaveTest.php deleted file mode 100644 index a921bd7b3c94b8b8c7e6ad8c5682769b53172c1a..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/GeneratorSaveTest.php +++ /dev/null @@ -1,132 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\Test\Unit\Acl; - -require_once realpath(__DIR__ . '/../../../../../../../') . '/tools/Magento/Tools/Migration/Acl/Generator.php'; -require_once realpath(__DIR__ . '/../../../../../../../') . '/tools/Magento/Tools/Migration/Acl/FileManager.php'; -require_once realpath(__DIR__ . '/../../../../../../../') . '/tools/Magento/Tools/Migration/Acl/Formatter.php'; -/** - * Tools_Migration_Acl test case - */ -class GeneratorSaveTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var $model \Magento\Tools\Migration\Acl\Generator - */ - protected $_model; - - /** - * @var string - */ - protected $_fixturePath; - - /** - * @var string - */ - protected $_originFile; - - /** - * @var string - */ - protected $_aclFile; - - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $_xmlFormatterMock; - - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $_fileManagerMock; - - protected function setUp() - { - $this->_xmlFormatterMock = $this->getMock('Magento\Tools\Migration\Acl\Formatter'); - $this->_fileManagerMock = $this->getMock('Magento\Tools\Migration\Acl\FileManager'); - $this->_model = new \Magento\Tools\Migration\Acl\Generator($this->_xmlFormatterMock, $this->_fileManagerMock); - - $this->_fixturePath = realpath(__DIR__) . '/_files'; - $path = $this->_fixturePath . '/save/'; - - $this->_originFile = $path . 'adminhtml.xml'; - $this->_aclFile = $path . 'adminhtml/acl.xml'; - - $dom = new \DOMDocument(); - $config = $dom->createElement('config'); - $dom->appendChild($config); - $acl = $dom->createElement('acl'); - $config->appendChild($acl); - $resources = $dom->createElement('resources'); - $acl->appendChild($resources); - - $resource1 = $dom->createElement('resource'); - $resource1->setAttribute('id', 'Map_Module::admin'); - $resources->appendChild($resource1); - - $resource2 = $dom->createElement('resource'); - $resource2->setAttribute('id', 'Module_One::customer'); - $resource2->setAttribute('title', 'Customers'); - $resource2->setAttribute('sortOrder', '40'); - $resource1->appendChild($resource2); - - $resource3 = $dom->createElement('resource'); - $resource3->setAttribute('id', 'Module_Two::group'); - $resource3->setAttribute('title', 'Customer Groups'); - $resource3->setAttribute('sortOrder', '10'); - $resource2->appendChild($resource3); - - $this->_model->setParsedDomList([$this->_originFile => $dom]); - } - - protected function tearDown() - { - unset($this->_model); - unset($this->_xmlFormatterMock); - unset($this->_fileManagerMock); - } - - public function testSaveAclFiles() - { - $domList = $this->_model->getParsedDomList(); - $dom = clone $domList[$this->_originFile]; - $dom->preserveWhiteSpace = false; - $dom->formatOutput = true; - - $this->_xmlFormatterMock->expects( - $this->once() - )->method( - 'parseString' - )->with( - $dom->saveXml(), - [ - 'indent' => true, - 'input-xml' => true, - 'output-xml' => true, - 'add-xml-space' => false, - 'indent-spaces' => 4, - 'wrap' => 1000 - ] - )->will( - $this->returnCallback( - function ($string) { - return 'formatted' . $string; - } - ) - ); - - $this->_fileManagerMock->expects( - $this->once() - )->method( - 'write' - )->with( - $this->equalTo($this->_aclFile), - $this->stringStartsWith('formatted') - ); - - $this->_model->saveAclFiles(); - } -} diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/GeneratorTest.php b/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/GeneratorTest.php deleted file mode 100644 index a72bead91ea7ce4e6774a1141faa4f003bbe3af2..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/GeneratorTest.php +++ /dev/null @@ -1,303 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\Test\Unit\Acl; - -require_once realpath(__DIR__ . '/../../../../../../../') . '/tools/Magento/Tools/Migration/Acl/Generator.php'; -require_once realpath(__DIR__ . '/../../../../../../../') . '/tools/Magento/Tools/Migration/Acl/FileManager.php'; -require_once realpath(__DIR__ . '/../../../../../../../') . '/tools/Magento/Tools/Migration/Acl/Formatter.php'; -/** - * \Magento\Tools\Migration\Acl\Generator test case - */ -class GeneratorTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var $model \Magento\Tools\Migration\Acl\Generator - */ - protected $_model; - - /** - * @var string - */ - protected $_fixturePath; - - /** - * Adminhtml file list - * - * @var array - */ - protected $_adminhtmlFiles = []; - - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $_xmlFormatterMock; - - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $_fileManagerMock; - - protected function setUp() - { - $this->_xmlFormatterMock = $this->getMock('Magento\Tools\Migration\Acl\Formatter'); - $this->_fileManagerMock = $this->getMock('Magento\Tools\Migration\Acl\FileManager'); - $this->_model = new \Magento\Tools\Migration\Acl\Generator($this->_xmlFormatterMock, $this->_fileManagerMock); - - $this->_fixturePath = realpath(__DIR__) . '/_files'; - - $prefix = $this->_fixturePath . '/app/code/'; - $suffix = '/etc/adminhtml.xml'; - - $this->_adminhtmlFiles = [ - $prefix . 'local/Namespace/Module' . $suffix, - $prefix . 'community/Namespace/Module' . $suffix, - $prefix . 'core/ANamespace/Module' . $suffix, - $prefix . 'core/BNamespace/Module' . $suffix, - ]; - - $this->_model->setAdminhtmlFiles($this->_adminhtmlFiles); - - $this->_model->setBasePath($this->_fixturePath); - } - - /** - * @param $filePath - * @param $expectedModuleName - * - * @dataProvider getModuleNameDataProvider - */ - public function testGetModuleName($filePath, $expectedModuleName) - { - $this->assertEquals($expectedModuleName, $this->_model->getModuleName($filePath), 'Incorrect Module Name'); - } - - /** - * @return array - */ - public function getModuleNameDataProvider() - { - return [ - [ - 'filePath' => '/app/code/core/ANamespace/ModuleOne/etc/adminhtml.xml', - 'moduleName' => 'ANamespace_ModuleOne', - ], - [ - 'filePath' => '/app/code/core/BNamespace/ModuleOne/etc/adminhtml.xml', - 'moduleName' => 'BNamespace_ModuleOne' - ] - ]; - } - - public function testIsForwardedNode() - { - $this->assertTrue($this->_model->isForwardNode('children')); - $this->assertFalse($this->_model->isForwardNode('admin')); - } - - public function testIsMetaNode() - { - $metaNodes = ['meta_one' => 'MetaOne', 'meta_two' => 'MetaTwo']; - $this->_model->setMetaNodeNames($metaNodes); - $this->assertEquals($metaNodes, $this->_model->getMetaNodeNames()); - - $this->assertTrue($this->_model->isMetaNode('meta_one')); - $this->assertTrue($this->_model->isMetaNode('meta_two')); - $this->assertFalse($this->_model->isMetaNode('meta_three')); - } - - public function testIsValidNodeType() - { - $this->assertFalse($this->_model->isValidNodeType(0)); - $this->assertFalse($this->_model->isValidNodeType(null)); - $this->assertTrue($this->_model->isValidNodeType(1)); - } - - /** - * @param $expectedPath - * @param $codePool - * @param $namespace - * @dataProvider getEtcPatternDataProvider - */ - public function testGetEtcPattern($expectedPath, $codePool, $namespace) - { - $this->assertStringEndsWith($expectedPath, $this->_model->getEtcDirPattern($codePool, $namespace)); - } - - /** - * @return array - */ - public function getEtcPatternDataProvider() - { - return [ - ['expectedPath' => '/app/code/*/*/*/etc/', 'codePool' => '*', 'namespace' => '*'], - ['expectedPath' => '/app/code/core/Magento/*/etc/', 'codePool' => 'core', 'namespace' => 'Magento'] - ]; - } - - public function testCreateNode() - { - $dom = new \DOMDocument(); - $parent = $dom->createElement('parent'); - $parent->setAttribute('xpath', 'root'); - $dom->appendChild($parent); - $nodeName = 'testNode'; - $newNode = $this->_model->createNode($dom, $nodeName, $parent, 'Some_Module'); - - $this->assertEquals(1, $parent->childNodes->length); - $this->assertEquals($newNode, $parent->childNodes->item(0)); - $this->assertEquals($nodeName, $newNode->getAttribute('id')); - $this->assertEquals('root/testNode', $newNode->getAttribute('xpath')); - } - - public function testSetMetaInfo() - { - $metaNodeName = ['sort_order' => 'test_SortOrder', 'title' => 'test_Title']; - $this->_model->setMetaNodeNames($metaNodeName); - - $dom = new \DOMDocument(); - $parent = $dom->createElement('parent'); - $parent->setAttribute('xpath', 'root'); - $parent->setAttribute('id', 'root_id'); - $dom->appendChild($parent); - - $dataNodeSortOrder = $dom->createElement('sort_order', '100'); - $dataNodeTitle = $dom->createElement('title', 'TestTitle'); - - $this->_model->setMetaInfo($parent, $dataNodeSortOrder, 'Module_Name'); - $this->assertEmpty($this->_model->getAclResourceMaps()); - $this->_model->setMetaInfo($parent, $dataNodeTitle, 'Module_Name'); - - $this->assertEquals(100, $parent->getAttribute('test_SortOrder'), 'Incorrect set of sort order'); - $this->assertEquals('TestTitle', $parent->getAttribute('test_Title'), 'Incorrect set of title'); - $maps = ['root' => 'Module_Name::root_id']; - $this->assertEquals($maps, $this->_model->getAclResourceMaps()); //test setting of id maps - } - - public function testGetAdminhtmlFiles() - { - $this->_model->setAdminhtmlFiles(null); - $this->assertEquals( - $this->_adminhtmlFiles, - $this->_model->getAdminhtmlFiles(), - 'Incorrect file adminhtml file searching' - ); - } - - /** - * @covers \Magento\Tools\Migration\Acl\Generator::parseNode - * @covers \Magento\Tools\Migration\Acl\Generator::generateId - */ - public function testParseNode() - { - $dom = new \DOMDocument(); - $dom->formatOutput = true; - $parentNode = $dom->createElement('root'); - $dom->appendChild($parentNode); - $moduleName = 'Module_Name'; - - $sourceDom = new \DOMDocument(); - $sourceDom->load($this->_fixturePath . '/parse_node_source.xml'); - $nodeList = $sourceDom->getElementsByTagName('resources'); - $this->_model->parseNode($nodeList->item(0), $dom, $parentNode, $moduleName); - $expectedDom = new \DOMDocument(); - $expectedDom->load($this->_fixturePath . '/parse_node_result.xml'); - $this->assertEquals( - $expectedDom->saveXML($expectedDom->documentElement), - $dom->saveXML($dom->documentElement) - ); - } - - public function testGetResultDomDocument() - { - $expectedDocument = <<<TEMPLATE -<config> - <acl> - <resources xpath="config/acl/resources"/> - </acl> -</config> -TEMPLATE; - $dom = $this->_model->getResultDomDocument(); - $expectedDom = new \DOMDocument(); - $expectedDom->formatOutput = true; - $this->assertEquals($expectedDocument, $dom->saveXML($dom->documentElement)); - } - - public function testParseAdminhtmlFiles() - { - $this->_model->parseAdminhtmlFiles(); - $this->assertCount(4, $this->_model->getParsedDomList()); - $this->assertCount(4, $this->_model->getAdminhtmlDomList()); - } - - /** - * @covers \Magento\Tools\Migration\Acl\Generator::updateAclResourceIds() - * @covers \Magento\Tools\Migration\Acl\Generator::updateChildAclNodes() (removing of xpath attribute) - */ - public function testUpdateAclResourceIds() - { - $this->_model->parseAdminhtmlFiles(); - - $domList = $this->_model->getParsedDomList(); - - /** @var $dom \DOMDocument **/ - foreach ($domList as $dom) { - $xpath = new \DOMXPath($dom); - $resources = $xpath->query('//resources[@xpath]'); - $this->assertEquals(1, $resources->length); - } - $this->_model->updateAclResourceIds(); - /** - * check that all xpath attributes are removed - */ - /** @var $dom \DOMDocument **/ - foreach ($domList as $dom) { - $xpath = new \DOMXPath($dom); - $resources = $xpath->query('//*[@xpath]'); - $this->assertEquals(0, $resources->length); - } - } - - public function testUpdateChildAclNodes() - { - $dom = new \DOMDocument(); - $fileActual = $this->_fixturePath . '/update_child_acl_nodes_source.xml'; - $fileExpected = $this->_fixturePath . '/update_child_acl_nodes_result.xml'; - $dom->load($fileActual); - $rootNode = $dom->getElementsByTagName('resources')->item(0); - - $aclResourcesMaps = [ - '/admin' => 'Map_Module::admin', - '/admin/customer/manage' => 'Map_Module::manage', - '/admin/system' => 'Map_Module::system', - '/admin/system/config' => 'Map_Module::config', - ]; - - $this->_model->setAclResourceMaps($aclResourcesMaps); - $this->_model->updateChildAclNodes($rootNode); - - $expectedDom = new \DOMDocument(); - $expectedDom->load($fileExpected); - $expectedRootNode = $expectedDom->getElementsByTagName('resources')->item(0); - - $this->assertEquals($expectedDom->saveXML($expectedRootNode), $dom->saveXML($rootNode)); - } - - public function testIsNodeEmpty() - { - $dom = new \DOMDocument(); - $node = $dom->createElement('node', 'test'); - $dom->appendChild($node); - $this->assertTrue($this->_model->isNodeEmpty($node)); - - $comment = $dom->createComment('comment'); - $node->appendChild($comment); - $this->assertTrue($this->_model->isNodeEmpty($node)); - - $subNode = $dom->createElement('subnode'); - $node->appendChild($subNode); - $this->assertFalse($this->_model->isNodeEmpty($node)); - } -} diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/Menu/GeneratorTest.php b/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/Menu/GeneratorTest.php deleted file mode 100644 index 25b3a871a862ee2fa86f18fe2dd4ce71abac719d..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/Menu/GeneratorTest.php +++ /dev/null @@ -1,248 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\Test\Unit\Acl\Menu; - -require_once realpath( - __DIR__ . '/../../../../../../../../' -) . '/tools/Magento/Tools/Migration/Acl/Menu/Generator.php'; -/** - * Tools_Migration_Acl_Menu_Generator_Menu generate test case - */ -class GeneratorTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var $model \Magento\Tools\Migration\Acl\Menu\Generator - */ - protected $_model; - - /** - * @var string - */ - protected $_fixturePath; - - /** - * @var array - */ - protected $_menuFiles = []; - - /** - * @var array - */ - protected $_menuIdToXPath = []; - - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $_fileManagerMock; - - protected function setUp() - { - $this->_fixturePath = realpath(__DIR__ . '/../') . '/_files'; - - $aclXPathToId = [ - 'config/acl/resources/admin/system' => 'Module_Name::acl_resource', - 'config/acl/resources/admin/area_config/design/node' => 'Module_Name::acl_resource_design', - 'config/acl/resources/admin/area_config' => 'Module_Name::acl_resource_area', - 'config/acl/resources/admin/some_other_resource' => 'Module_Name::some_other_resource', - ]; - $this->_fileManagerMock = $this->getMock('Magento\Tools\Migration\Acl\FileManager'); - - $this->_model = new \Magento\Tools\Migration\Acl\Menu\Generator( - $this->_fixturePath, - [1], - $aclXPathToId, - $this->_fileManagerMock, - false - ); - - $prefix = $this->_fixturePath . '/app/code/'; - $suffix = '/etc/adminhtml/menu.xml'; - - $this->_menuFiles = [ - $prefix . 'community/Namespace/Module' . $suffix, - $prefix . 'core/ANamespace/Module' . $suffix, - $prefix . 'core/BNamespace/Module' . $suffix, - $prefix . 'local/Namespace/Module' . $suffix, - ]; - - $this->_menuIdToXPath = [ - 'Module_Name::system' => '/some/resource', - 'Module_Name::system_config' => 'system/config', - 'Module_Name::area_config_design_node' => 'area_config/design/node', - 'Some_Module::area_config_design' => 'area_config/design', - 'Magento_Module::area_config' => 'area_config', - 'Local_Module::area_config_design_node_email_template' => 'area_config/design/node/email_template', - ]; - } - - public function testGetEtcPattern() - { - $path = $this->_fixturePath . '/app/code/*/*/*/etc/'; - - $this->assertEquals($path, $this->_model->getEtcDirPattern()); - } - - public function testGetMenuFiles() - { - $this->assertEquals($this->_menuFiles, $this->_model->getMenuFiles()); - } - - public function testParseMenuNode() - { - $menuFile = $this->_menuFiles[0]; - $dom = new \DOMDocument(); - $dom->load($menuFile); - $node = $dom->getElementsByTagName('menu')->item(0); - $expected = [ - 'Module_Name::system' => ['parent' => '', 'resource' => '/some/resource'], - 'Module_Name::system_config' => ['parent' => 'Module_Name::system', 'resource' => ''], - 'Module_Name::area_config_design_node' => [ - 'parent' => 'Some_Module::area_config_design', - 'resource' => '', - ], - ]; - - $this->assertEmpty($this->_model->getMenuIdMaps()); - $this->_model->parseMenuNode($node); - $this->assertEquals($expected, $this->_model->getMenuIdMaps()); - } - - public function testParseMenuFiles() - { - $this->_model->parseMenuFiles(); - /** - * Check that all nodes from all fixture files were read - */ - $this->assertEquals(6, count($this->_model->getMenuIdMaps())); - - /** - * Check that dom list is initialized - */ - $domList = $this->_model->getMenuDomList(); - $this->assertEquals(4, count($domList)); - $this->assertEquals($this->_menuFiles, array_keys($domList)); - $this->assertInstanceOf('DOMDocument', current($domList)); - } - - public function testInitParentItems() - { - $this->_model->parseMenuFiles(); - $menuId = 'Local_Module::area_config_design_node_email_template'; - - $maps = $this->_model->getMenuIdMaps(); - $this->assertArrayNotHasKey('parents', $maps[$menuId]); - - $this->_model->initParentItems($menuId); - - $expected = [ - 'Module_Name::area_config_design_node', - 'Some_Module::area_config_design', - 'Magento_Module::area_config', - ]; - $maps = $this->_model->getMenuIdMaps(); - $this->assertEquals($expected, $maps[$menuId]['parents']); - } - - /** - * @covers \Magento\Tools\Migration\Acl\Menu\Generator::buildMenuItemsXPath - * @covers \Magento\Tools\Migration\Acl\Menu\Generator::buildXPath - */ - public function testBuildMenuItemsXPath() - { - $this->_model->parseMenuFiles(); - $this->assertEmpty($this->_model->getIdToXPath()); - - $this->_model->buildMenuItemsXPath(); - $maps = $this->_model->getIdToXPath(); - - $this->assertEquals($this->_menuIdToXPath, $maps); - } - - public function testMapMenuToAcl() - { - $this->assertEmpty($this->_model->getMenuIdToAclId()); - $this->_model->setIdToXPath($this->_menuIdToXPath); - $result = $this->_model->mapMenuToAcl(); - $map = $this->_model->getMenuIdToAclId(); - $expectedMap = [ - 'Module_Name::area_config_design_node' => 'Module_Name::acl_resource_design', - 'Magento_Module::area_config' => 'Module_Name::acl_resource_area', - ]; - $this->assertEquals($expectedMap, $map); - $this->assertEquals(array_keys($expectedMap), $result['mapped']); - $this->assertEquals(4, count($result['not_mapped'])); - $this->assertEquals($expectedMap, json_decode(current($result['artifacts']), true)); - } - - public function testUpdateMenuAttributes() - { - $menuFileSource = $this->_fixturePath . '/update_menu_attributes_source.xml'; - $menuFileResult = $this->_fixturePath . '/update_menu_attributes_result.xml'; - - $domSource = new \DOMDocument(); - $domSource->load($menuFileSource); - - $domExpected = new \DOMDocument(); - $domExpected->load($menuFileResult); - - $domList = [$menuFileSource => $domSource]; - $menuIdToAclId = ['item1' => 'acl1', 'item2' => 'acl2', 'item3' => 'acl3']; - $aclXPathToId = [ - 'config/acl/resources/admin/some/resource' => 'acl4', - 'config/acl/resources/admin/some_other_resource' => 'acl5', - ]; - $this->_model->setMenuDomList($domList); - $this->_model->setMenuIdToAclId($menuIdToAclId); - $this->_model->setAclXPathToId($aclXPathToId); - - $errors = $this->_model->updateMenuAttributes(); - - $this->assertEquals($domExpected->saveXML(), $domSource->saveXML()); - $this->assertEquals(2, count($errors)); - - $this->assertContains('item4 is not mapped', $errors[0]); - $this->assertContains($menuFileSource, $errors[0]); - - $this->assertContains('no ACL resource with XPath', $errors[1]); - $this->assertContains($menuFileSource, $errors[1]); - } - - public function testSaveMenuFiles() - { - $dom = new \DOMDocument(); - $menuDomList = ['file1' => $dom, 'file2' => $dom, 'file3' => $dom]; - $this->_model->setMenuDomList($menuDomList); - - $this->_fileManagerMock->expects( - $this->at(0) - )->method( - 'write' - )->with( - $this->equalTo('file1'), - $this->equalTo($dom->saveXML()) - ); - - $this->_fileManagerMock->expects( - $this->at(1) - )->method( - 'write' - )->with( - $this->equalTo('file2'), - $this->equalTo($dom->saveXML()) - ); - - $this->_fileManagerMock->expects( - $this->at(2) - )->method( - 'write' - )->with( - $this->equalTo('file3'), - $this->equalTo($dom->saveXML()) - ); - - $this->_model->saveMenuFiles(); - } -} diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/app/code/community/Namespace/Module/etc/adminhtml.xml b/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/app/code/community/Namespace/Module/etc/adminhtml.xml deleted file mode 100644 index fdcd9d219d02e2d980281f93b81ab88b0faa78a2..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/app/code/community/Namespace/Module/etc/adminhtml.xml +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> - <acl> - <resources> - <admin> - </admin> - </resources> - </acl> -</config> diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/app/code/community/Namespace/Module/etc/adminhtml/menu.xml b/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/app/code/community/Namespace/Module/etc/adminhtml/menu.xml deleted file mode 100644 index 6e5f3ce0f89f35528b3f09e82167448fbf5a45b2..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/app/code/community/Namespace/Module/etc/adminhtml/menu.xml +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../../../../../app/code/Magento/Backend/etc/menu.xsd"> - <menu> - <add id="Module_Name::system" title="Title 1" module="Module_Name" sortOrder="50" action="adminhtml/level_one" resource='/some/resource' /> - <add id="Module_Name::system_config" title="Title 2" module="Module_Name" sortOrder="60" parent="Module_Name::system" action="adminhtml/level_two" /> - <update id="Module_Name::system_config" resource='/some_other_resource' /> - <add id="Module_Name::area_config_design_node" title="Title 3" module="Module_Name" sortOrder="70" parent="Some_Module::area_config_design" action="adminhtml/level_three" /> - </menu> -</config> diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/app/code/core/ANamespace/Module/etc/adminhtml.xml b/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/app/code/core/ANamespace/Module/etc/adminhtml.xml deleted file mode 100644 index fdcd9d219d02e2d980281f93b81ab88b0faa78a2..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/app/code/core/ANamespace/Module/etc/adminhtml.xml +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> - <acl> - <resources> - <admin> - </admin> - </resources> - </acl> -</config> diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/app/code/core/ANamespace/Module/etc/adminhtml/menu.xml b/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/app/code/core/ANamespace/Module/etc/adminhtml/menu.xml deleted file mode 100644 index 30581e136e1653bb1b25b9eb294a7d6d3461ed64..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/app/code/core/ANamespace/Module/etc/adminhtml/menu.xml +++ /dev/null @@ -1,12 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../../../../../app/code/Magento/Backend/etc/menu.xsd"> - <menu> - <add id="Magento_Module::area_config" title="Title 1" module="Magento_Module" sortOrder="50" action="adminhtml/level_one" /> - </menu> -</config> diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/app/code/core/BNamespace/Module/etc/adminhtml.xml b/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/app/code/core/BNamespace/Module/etc/adminhtml.xml deleted file mode 100644 index fdcd9d219d02e2d980281f93b81ab88b0faa78a2..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/app/code/core/BNamespace/Module/etc/adminhtml.xml +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> - <acl> - <resources> - <admin> - </admin> - </resources> - </acl> -</config> diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/app/code/core/BNamespace/Module/etc/adminhtml/menu.xml b/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/app/code/core/BNamespace/Module/etc/adminhtml/menu.xml deleted file mode 100644 index e925d896dbfe1c369a82e186edfe9bb3d8c59f8f..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/app/code/core/BNamespace/Module/etc/adminhtml/menu.xml +++ /dev/null @@ -1,12 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../../../../../app/code/Magento/Backend/etc/menu.xsd"> - <menu> - <add id="Some_Module::area_config_design" title="Title 1" module="Some_Module" sortOrder="50" parent="Magento_Module::area_config" action="adminhtml/level_one" /> - </menu> -</config> diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/app/code/local/Namespace/Module/etc/adminhtml.xml b/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/app/code/local/Namespace/Module/etc/adminhtml.xml deleted file mode 100644 index fdcd9d219d02e2d980281f93b81ab88b0faa78a2..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/app/code/local/Namespace/Module/etc/adminhtml.xml +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> - <acl> - <resources> - <admin> - </admin> - </resources> - </acl> -</config> diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/app/code/local/Namespace/Module/etc/adminhtml/menu.xml b/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/app/code/local/Namespace/Module/etc/adminhtml/menu.xml deleted file mode 100644 index 856a3b92a37b10a156b2dac0440b1bbfef29c4c0..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/app/code/local/Namespace/Module/etc/adminhtml/menu.xml +++ /dev/null @@ -1,12 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../../../../../app/code/Magento/Backend/etc/menu.xsd"> - <menu> - <add id="Local_Module::area_config_design_node_email_template" title="Title 1" module="Local_Module" sortOrder="50" parent="Module_Name::area_config_design_node" action="adminhtml/level_one" /> - </menu> -</config> diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/log/AclXPathToAclId.log b/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/log/AclXPathToAclId.log deleted file mode 100644 index 9cfa8b1c47e7333111e0605184dd8fbd20a6b285..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/log/AclXPathToAclId.log +++ /dev/null @@ -1 +0,0 @@ -{"config\/acl\/resources\/admin\/test1\/test2":"Test1_Test2::all","config\/acl\/resources\/admin\/test1\/test2\/test3":"Test1_Test2::test3","config\/acl\/resources\/admin\/test1\/test2\/test4":"Test1_Test2::test4","config\/acl\/resources\/admin\/test1\/test2\/test5":"Test1_Test2::test5","config\/acl\/resources\/admin\/test6":"Test6_Test6::all"} diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/parse_node_result.xml b/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/parse_node_result.xml deleted file mode 100644 index 9536b354bd2566b2b3b3c560388ae03163b282fc..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/parse_node_result.xml +++ /dev/null @@ -1,21 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<root> - <resource xpath="/admin" id="admin"> - <resource xpath="/admin/customer" id="customer" title="Customers" moduleOwner="Module_Name" sortOrder="40"> - <resource xpath="/admin/customer/group" id="group" title="Customer Groups" moduleOwner="Module_Name" sortOrder="10"/> - <resource xpath="/admin/customer/manage" id="manage" title="Manage Customers" moduleOwner="Module_Name" sortOrder="0"/> - <resource xpath="/admin/customer/online" id="online" title="Online Customers" moduleOwner="Module_Name" sortOrder="100"/> - </resource> - <resource xpath="/admin/system" id="system"> - <resource xpath="/admin/system/config" id="config"> - <resource xpath="/admin/system/config/customer" id="config_customer" title="Customers Section" moduleOwner="Module_Name" sortOrder="50"/> - </resource> - </resource> - </resource> -</root> diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/parse_node_source.xml b/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/parse_node_source.xml deleted file mode 100644 index 7d4ce9a3d9b8cf0d9b601cc05d07dff62925caeb..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/parse_node_source.xml +++ /dev/null @@ -1,47 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> - <acl> - <resources> - <admin> - <children> - <customer translate="title"> - <title>Customers</title> - <sort_order>40</sort_order> - <children> - <group translate="title"> - <title>Customer Groups</title> - <sort_order>10</sort_order> - </group> - <manage translate="title"> - <title>Manage Customers</title> - <sort_order>0</sort_order> - </manage> - <online translate="title"> - <title>Online Customers</title> - <sort_order>100</sort_order> - </online> - </children> - </customer> - <system> - <children> - <config> - <children> - <customer translate="title"> - <title>Customers Section</title> - <sort_order>50</sort_order> - </customer> - </children> - </config> - </children> - </system> - </children> - </admin> - </resources> - </acl> -</config> diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/remove/empty.xml b/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/remove/empty.xml deleted file mode 100644 index fe7b2fae89a7462a072df28a914172154cf6c645..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/remove/empty.xml +++ /dev/null @@ -1,63 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> - <acl> - <resources> - <admin> - <children> - <customer translate="title"> - <title>Customers</title> - <sort_order>40</sort_order> - <children> - <group translate="title"> - <title>Customer Groups</title> - <sort_order>10</sort_order> - </group> - <manage translate="title"> - <title>Manage Customers</title> - <sort_order>0</sort_order> - </manage> - <online translate="title"> - <title>Online Customers</title> - <sort_order>100</sort_order> - </online> - </children> - </customer> - <system> - <children> - <config> - <children> - <customer translate="title"> - <title>Customers Section</title> - <sort_order>50</sort_order> - </customer> - </children> - </config> - </children> - </system> - </children> - </admin> - </resources> - <privilegeSets> - <default> - <view> - <descr>View entity</descr> - </view> - <edit> - <descr>Edit entity</descr> - </edit> - <delete> - <descr/> - </delete> - <create> - <descr/> - </create> - </default> - </privilegeSets> - </acl> -</config> diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/remove/not_empty.xml b/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/remove/not_empty.xml deleted file mode 100644 index 96b9d62842a5a64a9314ae7e5bc3f05ff08ee24e..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/remove/not_empty.xml +++ /dev/null @@ -1,65 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> - <acl> - <resources> - <admin> - <children> - <customer translate="title"> - <title>Customers</title> - <sort_order>40</sort_order> - <children> - <group translate="title"> - <title>Customer Groups</title> - <sort_order>10</sort_order> - </group> - <manage translate="title"> - <title>Manage Customers</title> - <sort_order>0</sort_order> - </manage> - <online translate="title"> - <title>Online Customers</title> - <sort_order>100</sort_order> - </online> - </children> - </customer> - <system> - <children> - <config> - <children> - <customer translate="title"> - <title>Customers Section</title> - <sort_order>50</sort_order> - </customer> - </children> - </config> - </children> - </system> - </children> - </admin> - </resources> - <privilegeSets> - <default> - <view> - <descr>View entity</descr> - </view> - <edit> - <descr>Edit entity</descr> - </edit> - <delete> - <descr/> - </delete> - <create> - <descr/> - </create> - </default> - </privilegeSets> - <some_other_node> - </some_other_node> - </acl> -</config> diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/save/adminhtml.xml b/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/save/adminhtml.xml deleted file mode 100644 index 6b9660d5f93f94661686d74efec1491eb4d280e2..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/save/adminhtml.xml +++ /dev/null @@ -1,47 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> - <acl> - <resources> - <admin> - <children> - <customer translate="title"> - <title>Customers</title> - <sort_order>40</sort_order> - <children> - <group translate="title"> - <title>Customer Groups</title> - <sort_order>10</sort_order> - </group> - <manage translate="title"> - <title>Manage Customers</title> - <sort_order>0</sort_order> - </manage> - <online translate="title"> - <title>Online Customers</title> - <sort_order>100</sort_order> - </online> - </children> - </customer> - <system> - <children> - <config> - <children> - <customer translate="title"> - <title>Customers Section</title> - <sort_order>50</sort_order> - </customer> - </children> - </config> - </children> - </system> - </children> - </admin> - </resources> - </acl> -</config> diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/update_child_acl_nodes_result.xml b/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/update_child_acl_nodes_result.xml deleted file mode 100644 index 67e578e002e47652460c7b808244fa1079432ea4..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/update_child_acl_nodes_result.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> - <acl> - <resources> - <resource id="Map_Module::admin"> - <resource id="Module_One::customer" title="Customers" sortOrder="40" > - <resource id="Module_Two::group" title="Customer Groups" sortOrder="10" /> - <resource id="Map_Module::manage" title="Manage Customers" sortOrder="0"/> - <resource id="Module_Four::online" title="Online Customers" sortOrder="100"/> - </resource> - <resource id="Map_Module::system"> - <resource id="Map_Module::config"> - <resource id="Module_Five::customer" title="Customers Section" sortOrder="50"/> - </resource> - </resource> - </resource> - </resources> - </acl> -</config> diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/update_child_acl_nodes_source.xml b/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/update_child_acl_nodes_source.xml deleted file mode 100644 index 4f7b05c0649d144a1ac3303ca8a38ab01ccef9c4..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/update_child_acl_nodes_source.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> - <acl> - <resources> - <resource id="admin" xpath="/admin"> - <resource id="customer" xpath="/admin/customer" title="Customers" moduleOwner="Module_One" sortOrder="40"> - <resource id="group" xpath="/admin/customer/group" moduleOwner="Module_Two" title="Customer Groups" sortOrder="10"/> - <resource id="manage" xpath="/admin/customer/manage" moduleOwner="Module_Three" title="Manage Customers" sortOrder="0"/> - <resource id="online" xpath="/admin/customer/online" moduleOwner="Module_Four" title="Online Customers" sortOrder="100"/> - </resource> - <resource id="system" xpath="/admin/system"> - <resource id="config" xpath="/admin/system/config"> - <resource id="customer" xpath="/admin/system/config/customer" title="Customers Section" moduleOwner="Module_Five" sortOrder="50"/> - </resource> - </resource> - </resource> - </resources> - </acl> -</config> diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/update_menu_attributes_result.xml b/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/update_menu_attributes_result.xml deleted file mode 100644 index 941e463f01f3a8571e38e533a5ee123730c3f8ae..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/update_menu_attributes_result.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> - <menu> - <add id="item1" resource="acl4"/> - <add id="item2" resource="acl2"/> - <update id="item2" resource="acl5"/> - <add id="item3" resource="acl3"/> - <update id="item3"/> - <add id="item4"/> - <update id="item3" resource="dummy_resource"/> - </menu> -</config> diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/update_menu_attributes_source.xml b/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/update_menu_attributes_source.xml deleted file mode 100644 index 24e223a7a5c47a801d4db15aec749dae3b9e27c8..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/Acl/_files/update_menu_attributes_source.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> - <menu> - <add id="item1" resource='some/resource' /> - <add id="item2" /> - <update id="item2" resource='some_other_resource' /> - <add id="item3" /> - <update id="item3" /> - <add id="item4" /> - <update id="item3" resource='dummy_resource'/> - </menu> -</config> diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/System/Configuration/GeneratorTest.php b/dev/tools/Magento/Tools/Migration/Test/Unit/System/Configuration/GeneratorTest.php deleted file mode 100644 index b1c9970e31c8148eacd36d022f909abe12a05fbd..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/System/Configuration/GeneratorTest.php +++ /dev/null @@ -1,121 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\Test\Unit\System\Configuration; - -require_once realpath( - __DIR__ . '/../../../../../../../../' -) . '/tools/Magento/Tools/Migration/System/Configuration/Generator.php'; -require_once realpath( - __DIR__ . '/../../../../../../../../' -) . '/tools/Magento/Tools/Migration/System/FileManager.php'; -require_once realpath( - __DIR__ . '/../../../../../../../../' -) . '/tools/Magento/Tools/Migration/System/Configuration/AbstractLogger.php'; -require_once realpath( - __DIR__ . '/../../../../../../../../' -) . '/tools/Magento/Tools/Migration/System/Configuration/Formatter.php'; -class GeneratorTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var \Magento\Tools\Migration\System\Configuration\Generator - */ - protected $_model; - - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $_fileManagerMock; - - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $_loggerMock; - - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $_formatterMock; - - protected function setUp() - { - $this->_fileManagerMock = $this->getMock( - 'Magento\Tools\Migration\System\FileManager', - [], - [], - '', - false - ); - $this->_loggerMock = $this->getMockForAbstractClass( - 'Magento\Tools\Migration\System\Configuration\AbstractLogger', - [], - '', - false, - false, - false, - ['add'] - ); - $this->_formatterMock = $this->getMock( - 'Magento\Tools\Migration\System\Configuration\Formatter', - [], - [], - '', - false - ); - - $this->_model = new \Magento\Tools\Migration\System\Configuration\Generator( - $this->_formatterMock, - $this->_fileManagerMock, - $this->_loggerMock - ); - } - - public function testCreateConfigurationGeneratesConfiguration() - { - $dom = new \DOMDocument(); - $dom->loadXML( - preg_replace('/\n|\s{4}/', '', file_get_contents(__DIR__ . '/_files/convertedConfiguration.xml')) - ); - $stripComments = new \DOMXPath($dom); - foreach ($stripComments->query('//comment()') as $comment) { - $comment->parentNode->removeChild($comment); - } - $dom->formatOutput = true; - $dom->preserveWhiteSpace = false; - $expectedXml = $dom->saveXML(); - - $this->_fileManagerMock->expects( - $this->once() - )->method( - 'write' - )->with( - $this->stringContains('system.xml'), - $expectedXml - ); - - $this->_formatterMock->expects($this->once())->method('parseString')->will( - $this->returnCallback( - function ($xml) { - $dom = new \DOMDocument(); - $dom->loadXML($xml); - $dom->preserveWhiteSpace = false; - $dom->formatOutput = true; - return $dom->saveXML(); - } - ) - ); - - $this->_loggerMock->expects( - $this->once() - )->method( - 'add' - )->with( - 'someFile', - \Magento\Tools\Migration\System\Configuration\AbstractLogger::FILE_KEY_INVALID - ); - - $this->_model->createConfiguration('someFile', include __DIR__ . '/_files/mappedConfiguration.php'); - } -} diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/System/Configuration/Logger/ConsoleTest.php b/dev/tools/Magento/Tools/Migration/Test/Unit/System/Configuration/Logger/ConsoleTest.php deleted file mode 100644 index b8581993e26ed7bbba6193dff452a7b2107f7390..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/System/Configuration/Logger/ConsoleTest.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\Test\Unit\System\Configuration\Logger; - -require_once realpath( - __DIR__ . '/../../../../../../../../../' -) . '/tools/Magento/Tools/Migration/System/Configuration/AbstractLogger.php'; -require_once realpath( - __DIR__ . '/../../../../../../../../../' -) . '/tools/Magento/Tools/Migration/System/Configuration/Logger/Console.php'; -class ConsoleTest extends \PHPUnit_Framework_TestCase -{ - public function testReport() - { - $this->expectOutputRegex('/^valid: 0(.)*/'); - $model = new \Magento\Tools\Migration\System\Configuration\Logger\Console(); - $model->report(); - } -} diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/System/Configuration/Logger/FactoryTest.php b/dev/tools/Magento/Tools/Migration/Test/Unit/System/Configuration/Logger/FactoryTest.php deleted file mode 100644 index 24a0c85a32430dcee143c421f2f08a6d661e2e40..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/System/Configuration/Logger/FactoryTest.php +++ /dev/null @@ -1,87 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\Test\Unit\System\Configuration\Logger; - -require_once realpath( - __DIR__ . '/../../../../../../../../../' -) . '/tools/Magento/Tools/Migration/System/Configuration/AbstractLogger.php'; -require_once realpath( - __DIR__ . '/../../../../../../../../../' -) . '/tools/Magento/Tools/Migration/System/Configuration/Logger/File.php'; -require_once realpath( - __DIR__ . '/../../../../../../../../../' -) . '/tools/Magento/Tools/Migration/System/Configuration/Logger/Console.php'; -require_once realpath( - __DIR__ . '/../../../../../../../../../' -) . '/tools/Magento/Tools/Migration/System/Configuration/Logger/Factory.php'; -require_once realpath( - __DIR__ . '/../../../../../../../../../' -) . '/tools/Magento/Tools/Migration/System/FileManager.php'; -require_once realpath( - __DIR__ . '/../../../../../../../../../' -) . '/tools/Magento/Tools/Migration/System/FileReader.php'; -require_once realpath( - __DIR__ . '/../../../../../../../../../' -) . '/tools/Magento/Tools/Migration//System/WriterInterface.php'; -require_once realpath( - __DIR__ . '/../../../../../../../../../' -) . '/tools/Magento/Tools/Migration/System/Writer/Memory.php'; -class FactoryTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var \Magento\Tools\Migration\System\Configuration\Logger\Factory - */ - protected $_model; - - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $_fileManagerMock; - - protected function setUp() - { - $this->_model = new \Magento\Tools\Migration\System\Configuration\Logger\Factory(); - $this->_fileManagerMock = $this->getMock( - 'Magento\Tools\Migration\System\FileManager', - [], - [], - '', - false - ); - } - - protected function tearDown() - { - unset($this->_model); - unset($this->_fileManagerMock); - } - - /** - * @return array - */ - public function getLoggerDataProvider() - { - return [ - ['Magento\Tools\Migration\System\Configuration\Logger\File', 'file', 'report.log'], - ['Magento\Tools\Migration\System\Configuration\Logger\Console', 'console', null], - ['Magento\Tools\Migration\System\Configuration\Logger\Console', 'dummy', null] - ]; - } - - /** - * @param string $expectedInstance - * @param string $loggerType - * @param string $path - * @dataProvider getLoggerDataProvider - */ - public function testGetLogger($expectedInstance, $loggerType, $path) - { - $this->assertInstanceOf( - $expectedInstance, - $this->_model->getLogger($loggerType, $path, $this->_fileManagerMock) - ); - } -} diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/System/Configuration/Logger/FileTest.php b/dev/tools/Magento/Tools/Migration/Test/Unit/System/Configuration/Logger/FileTest.php deleted file mode 100644 index 00e909ca7deb02bf5b6cee6f3dc087f4ff0064dd..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/System/Configuration/Logger/FileTest.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\Test\Unit\System\Configuration\Logger; - -require_once realpath( - __DIR__ . '/../../../../../../../../../' -) . '/tools/Magento/Tools/Migration//Acl/Db/AbstractLogger.php'; -require_once realpath( - __DIR__ . '/../../../../../../../../../' -) . '/tools/Magento/Tools/Migration//Acl/Db/Logger/File.php'; -require_once realpath( - __DIR__ . '/../../../../../../../../../' -) . '/tools/Magento/Tools/Migration//System/Configuration/AbstractLogger.php'; -require_once realpath( - __DIR__ . '/../../../../../../../../../' -) . '/tools/Magento/Tools/Migration//System/Configuration/Logger/File.php'; -require_once realpath( - __DIR__ . '/../../../../../../../../../' -) . '/tools/Magento/Tools/Migration//System/FileManager.php'; -class FileTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $_fileManagerMock; - - protected function setUp() - { - $this->_fileManagerMock = $this->getMock( - 'Magento\Tools\Migration\System\FileManager', - [], - [], - '', - false - ); - } - - protected function tearDown() - { - unset($this->_fileManagerMock); - } - - public function testConstructWithValidFile() - { - new \Magento\Tools\Migration\System\Configuration\Logger\File('report.log', $this->_fileManagerMock); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testConstructWithInValidFile() - { - new \Magento\Tools\Migration\System\Configuration\Logger\File(null, $this->_fileManagerMock); - } - - public function testReport() - { - $model = new \Magento\Tools\Migration\System\Configuration\Logger\File('report.log', $this->_fileManagerMock); - $this->_fileManagerMock->expects($this->once())->method('write')->with($this->stringEndsWith('report.log')); - $model->report(); - } -} diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/System/Configuration/LoggerAbstractTest.php b/dev/tools/Magento/Tools/Migration/Test/Unit/System/Configuration/LoggerAbstractTest.php deleted file mode 100644 index a4bdcdc5c81ac01ea1cec8a489d294427cc5bcde..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/System/Configuration/LoggerAbstractTest.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\Test\Unit\System\Configuration; - -require_once realpath( - __DIR__ . '/../../../../../../../../' -) . '/tools/Magento/Tools/Migration/System/Configuration/AbstractLogger.php'; -class LoggerAbstractTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var \Magento\Tools\Migration\System\Configuration\AbstractLogger - */ - protected $_model; - - protected function setUp() - { - $this->_model = $this->getMockForAbstractClass('Magento\Tools\Migration\System\Configuration\AbstractLogger'); - } - - protected function tearDown() - { - unset($this->_model); - } - - /** - * @covers \Magento\Tools\Migration\System\Configuration\AbstractLogger::add() - * @covers \Magento\Tools\Migration\System\Configuration\AbstractLogger::__toString() - */ - public function testToString() - { - $this->_model->add('file1', \Magento\Tools\Migration\System\Configuration\AbstractLogger::FILE_KEY_VALID); - $this->_model->add('file2', \Magento\Tools\Migration\System\Configuration\AbstractLogger::FILE_KEY_INVALID); - - $expected = 'valid: 1' . - PHP_EOL . - 'invalid: 1' . - PHP_EOL . - 'Total: 2' . - PHP_EOL . - '------------------------------' . - PHP_EOL . - 'valid:' . - PHP_EOL . - 'file1' . - PHP_EOL . - '------------------------------' . - PHP_EOL . - 'invalid:' . - PHP_EOL . - 'file2'; - - $this->assertEquals($expected, (string)$this->_model); - } -} diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/System/Configuration/Mapper/FieldTest.php b/dev/tools/Magento/Tools/Migration/Test/Unit/System/Configuration/Mapper/FieldTest.php deleted file mode 100644 index d50c82f293c2a204126b058c13c641e83874d82b..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/System/Configuration/Mapper/FieldTest.php +++ /dev/null @@ -1,109 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\Test\Unit\System\Configuration\Mapper; - -require_once realpath( - __DIR__ . '/../../../../../../../../../' -) . '/tools/Magento/Tools/Migration/System/Configuration/Mapper/AbstractMapper.php'; -require_once realpath( - __DIR__ . '/../../../../../../../../../' -) . '/tools/Magento/Tools/Migration/System/Configuration/Mapper/Field.php'; -/** - * Test case for Tools_Migration_System_Configuration_Mapper_Field - */ -class FieldTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var \Magento\Tools\Migration\System\Configuration\Mapper\Field - */ - protected $_object; - - protected function setUp() - { - $this->_object = new \Magento\Tools\Migration\System\Configuration\Mapper\Field(); - } - - protected function tearDown() - { - $this->_object = null; - } - - public function testTransform() - { - $config = [ - 'field_1' => [ - 'comment' => ['#cdata-section' => 'comment_test'], - 'tooltip' => ['#text' => 'tooltip_test'], - 'frontend_class' => ['#text' => 'frontend_class_test'], - 'validate' => ['#text' => 'validate_test'], - 'can_be_empty' => ['#text' => 'can_be_empty_test'], - 'if_module_enabled' => ['#text' => 'if_module_enabled_test'], - 'frontend_model' => ['#text' => 'frontend_model_test'], - 'backend_model' => ['#text' => 'backend_model_test'], - 'source_model' => ['#text' => 'source_model_test'], - 'config_path' => ['#text' => 'config_path_test'], - 'base_url' => ['#text' => 'base_url_test'], - 'upload_dir' => ['#text' => 'upload_dir_test'], - 'button_url' => ['#text' => 'button_url_test'], - 'button_label' => ['#text' => 'button_label_test'], - 'depends' => ['module1' => ['#text' => 'yes']], - 'more_url' => ['#text' => 'more_url_test'], - 'demo_url' => ['#text' => 'demo_url_test'], - 'undefined' => ['#text' => 'undefined_test', '@attributes' => ['some' => 'attribute']], - 'node' => ['label' => ['nodeLabel' => ['#text' => 'nodeValue']]], - ], - ]; - - $expected = [ - [ - 'nodeName' => 'field', - '@attributes' => ['id' => 'field_1'], - 'parameters' => [ - ['name' => 'comment', '#cdata-section' => 'comment_test'], - ['name' => 'tooltip', '#text' => 'tooltip_test'], - ['name' => 'frontend_class', '#text' => 'frontend_class_test'], - ['name' => 'validate', '#text' => 'validate_test'], - ['name' => 'can_be_empty', '#text' => 'can_be_empty_test'], - ['name' => 'if_module_enabled', '#text' => 'if_module_enabled_test'], - ['name' => 'frontend_model', '#text' => 'frontend_model_test'], - ['name' => 'backend_model', '#text' => 'backend_model_test'], - ['name' => 'source_model', '#text' => 'source_model_test'], - ['name' => 'config_path', '#text' => 'config_path_test'], - ['name' => 'base_url', '#text' => 'base_url_test'], - ['name' => 'upload_dir', '#text' => 'upload_dir_test'], - ['name' => 'button_url', '#text' => 'button_url_test'], - ['name' => 'button_label', '#text' => 'button_label_test'], - [ - 'name' => 'depends', - 'subConfig' => [ - ['nodeName' => 'field', '@attributes' => ['id' => 'module1'], '#text' => 'yes'], - ] - ], - ['name' => 'more_url', '#text' => 'more_url_test'], - ['name' => 'demo_url', '#text' => 'demo_url_test'], - [ - '@attributes' => ['type' => 'undefined', 'some' => 'attribute'], - 'name' => 'attribute', - '#text' => 'undefined_test' - ], - [ - '@attributes' => ['type' => 'node'], - 'name' => 'attribute', - 'subConfig' => [ - [ - 'nodeName' => 'label', - 'subConfig' => [['nodeName' => 'nodeLabel', '#text' => 'nodeValue']], - ], - ] - ], - ], - ], - ]; - - $actual = $this->_object->transform($config); - $this->assertEquals($expected, $actual); - } -} diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/System/Configuration/Mapper/GroupTest.php b/dev/tools/Magento/Tools/Migration/Test/Unit/System/Configuration/Mapper/GroupTest.php deleted file mode 100644 index 8e6d50eb77acb22c1c93f5448a50c362d3123911..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/System/Configuration/Mapper/GroupTest.php +++ /dev/null @@ -1,111 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\Test\Unit\System\Configuration\Mapper; - -require_once realpath( - __DIR__ . '/../../../../../../../../../' -) . '/tools/Magento/Tools/Migration/System/Configuration/Mapper/AbstractMapper.php'; -require_once realpath( - __DIR__ . '/../../../../../../../../../' -) . '/tools/Magento/Tools/Migration/System/Configuration/Mapper/Field.php'; -require_once realpath( - __DIR__ . '/../../../../../../../../../' -) . '/tools/Magento/Tools/Migration/System/Configuration/Mapper/Group.php'; -/** - * Test case for \Magento\Tools\Migration\System\Configuration\Mapper\Group - */ -class GroupTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $_fieldMapperMock; - - /** - * @var \Magento\Tools\Migration\System\Configuration\Mapper\Group - */ - protected $_object; - - protected function setUp() - { - $this->_fieldMapperMock = $this->getMock( - 'Magento\Tools\Migration\System\Configuration\Mapper\Field', - [], - [], - '', - false - ); - - $this->_object = new \Magento\Tools\Migration\System\Configuration\Mapper\Group($this->_fieldMapperMock); - } - - protected function tearDown() - { - $this->_object = null; - $this->_fieldMapperMock = null; - } - - public function testTransform() - { - $config = [ - 'group_1' => [ - 'sort_order' => ['#text' => 10], - 'frontend_type' => ['#text' => 'text'], - 'class' => ['#text' => 'css class'], - 'label' => ['#text' => 'group label'], - 'comment' => ['#cdata-section' => 'group comment'], - 'resource' => ['#text' => 'acl'], - 'fieldset_css' => ['#text' => 'some css class'], - 'clone_fields' => ['#text' => 'some fields'], - 'clone_model' => ['#text' => 'some model'], - 'help_url' => ['#text' => 'some url'], - 'hide_in_single_store_mode' => ['#text' => 'mode'], - 'expanded' => ['#text' => 'yes'], - ], - 'group_2' => [], - 'group_3' => ['fields' => ['label' => 'label']], - ]; - - $expected = [ - [ - 'nodeName' => 'group', - '@attributes' => ['id' => 'group_1', 'sortOrder' => 10, 'type' => 'text'], - 'parameters' => [ - ['name' => 'class', '#text' => 'css class'], - ['name' => 'label', '#text' => 'group label'], - ['name' => 'comment', '#cdata-section' => 'group comment'], - ['name' => 'resource', '#text' => 'acl'], - ['name' => 'fieldset_css', '#text' => 'some css class'], - ['name' => 'clone_fields', '#text' => 'some fields'], - ['name' => 'clone_model', '#text' => 'some model'], - ['name' => 'help_url', '#text' => 'some url'], - ['name' => 'hide_in_single_store_mode', '#text' => 'mode'], - ['name' => 'expanded', '#text' => 'yes'], - ], - ], - ['nodeName' => 'group', '@attributes' => ['id' => 'group_2'], 'parameters' => []], - [ - 'nodeName' => 'group', - '@attributes' => ['id' => 'group_3'], - 'parameters' => [], - 'subConfig' => ['label' => 'label'] - ], - ]; - - $this->_fieldMapperMock->expects( - $this->once() - )->method( - 'transform' - )->with( - ['label' => 'label'] - )->will( - $this->returnArgument(0) - ); - - $actual = $this->_object->transform($config); - $this->assertEquals($expected, $actual); - } -} diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/System/Configuration/Mapper/SectionTest.php b/dev/tools/Magento/Tools/Migration/Test/Unit/System/Configuration/Mapper/SectionTest.php deleted file mode 100644 index d10e71f23a4e1ad1a402c146c738e93cfe7d6640..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/System/Configuration/Mapper/SectionTest.php +++ /dev/null @@ -1,103 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\Test\Unit\System\Configuration\Mapper; - -require_once realpath( - __DIR__ . '/../../../../../../../../../' -) . '/tools/Magento/Tools/Migration/System/Configuration/Mapper/AbstractMapper.php'; -require_once realpath( - __DIR__ . '/../../../../../../../../../' -) . '/tools/Magento/Tools/Migration/System/Configuration/Mapper/Group.php'; -require_once realpath( - __DIR__ . '/../../../../../../../../../' -) . '/tools/Magento/Tools/Migration/System/Configuration/Mapper/Section.php'; -/** - * Test case for \Magento\Tools\Migration\System\Configuration\Mapper\Section - */ -class SectionTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $_groupMapperMock; - - /** - * @var \Magento\Tools\Migration\System\Configuration\Mapper\Section - */ - protected $_object; - - protected function setUp() - { - $this->_groupMapperMock = $this->getMock( - 'Magento\Tools\Migration\System\Configuration\Mapper\Group', - [], - [], - '', - false - ); - - $this->_object = new \Magento\Tools\Migration\System\Configuration\Mapper\Section($this->_groupMapperMock); - } - - protected function tearDown() - { - $this->_object = null; - $this->_groupMapperMock = null; - } - - public function testTransform() - { - $config = [ - 'section_1' => [ - 'sort_order' => ['#text' => 10], - 'frontend_type' => ['#text' => 'text'], - 'class' => ['#text' => 'css class'], - 'label' => ['#text' => 'section label'], - 'comment' => ['#cdata-section' => 'section comment'], - 'resource' => ['#text' => 'acl'], - 'header_css' => ['#text' => 'some css class'], - 'tab' => ['#text' => 'some tab'], - ], - 'section_2' => [], - 'section_3' => ['groups' => ['label' => 'label']], - ]; - - $expected = [ - [ - 'nodeName' => 'section', - '@attributes' => ['id' => 'section_1', 'sortOrder' => 10, 'type' => 'text'], - 'parameters' => [ - ['name' => 'class', '#text' => 'css class'], - ['name' => 'label', '#text' => 'section label'], - ['name' => 'comment', '#cdata-section' => 'section comment'], - ['name' => 'resource', '#text' => 'acl'], - ['name' => 'header_css', '#text' => 'some css class'], - ['name' => 'tab', '#text' => 'some tab'], - ], - ], - ['nodeName' => 'section', '@attributes' => ['id' => 'section_2'], 'parameters' => []], - [ - 'nodeName' => 'section', - '@attributes' => ['id' => 'section_3'], - 'parameters' => [], - 'subConfig' => ['label' => 'label'] - ], - ]; - - $this->_groupMapperMock->expects( - $this->once() - )->method( - 'transform' - )->with( - ['label' => 'label'] - )->will( - $this->returnArgument(0) - ); - - $actual = $this->_object->transform($config); - $this->assertEquals($expected, $actual); - } -} diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/System/Configuration/Mapper/TabTest.php b/dev/tools/Magento/Tools/Migration/Test/Unit/System/Configuration/Mapper/TabTest.php deleted file mode 100644 index b2ddb316f41977d6905be1bef860f95e27ff8172..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/System/Configuration/Mapper/TabTest.php +++ /dev/null @@ -1,62 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\Test\Unit\System\Configuration\Mapper; - -require_once realpath( - __DIR__ . '/../../../../../../../../../' -) . '/tools/Magento/Tools/Migration/System/Configuration/Mapper/AbstractMapper.php'; -require_once realpath( - __DIR__ . '/../../../../../../../../../' -) . '/tools/Magento/Tools/Migration/System/Configuration/Mapper/Tab.php'; -/** - * Test case for \Magento\Tools\Migration\System\Configuration\Mapper\Tab - */ -class TabTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var \Magento\Tools\Migration\System\Configuration\Mapper\Tab - */ - protected $_object; - - protected function setUp() - { - $this->_object = new \Magento\Tools\Migration\System\Configuration\Mapper\Tab(); - } - - protected function tearDown() - { - $this->_object = null; - } - - public function testTransform() - { - $config = [ - 'tab_1' => [ - 'sort_order' => ['#text' => 10], - 'frontend_type' => ['#text' => 'text'], - 'class' => ['#text' => 'css class'], - 'label' => ['#text' => 'tab label'], - 'comment' => ['#cdata-section' => 'tab comment'], - ], - 'tab_2' => [], - ]; - - $expected = [ - [ - 'nodeName' => 'tab', - '@attributes' => ['id' => 'tab_1', 'sortOrder' => 10, 'type' => 'text', 'class' => 'css class'], - 'parameters' => [ - ['name' => 'label', '#text' => 'tab label'], - ['name' => 'comment', '#cdata-section' => 'tab comment'], - ], - ], - ['nodeName' => 'tab', '@attributes' => ['id' => 'tab_2'], 'parameters' => []], - ]; - - $actual = $this->_object->transform($config); - $this->assertEquals($expected, $actual); - } -} diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/System/Configuration/MapperTest.php b/dev/tools/Magento/Tools/Migration/Test/Unit/System/Configuration/MapperTest.php deleted file mode 100644 index 21eabb96f61eb45a4777d97525e26b5c2b573a48..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/System/Configuration/MapperTest.php +++ /dev/null @@ -1,133 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\Test\Unit\System\Configuration; - -require_once realpath( - __DIR__ . '/../../../../../../../../' -) . '/tools/Magento/Tools/Migration/System/Configuration/Mapper/AbstractMapper.php'; -require_once realpath( - __DIR__ . '/../../../../../../../../' -) . '/tools/Magento/Tools/Migration/System/Configuration/Mapper.php'; -require_once realpath( - __DIR__ . '/../../../../../../../../' -) . '/tools/Magento/Tools/Migration/System/Configuration/Mapper/Tab.php'; -require_once realpath( - __DIR__ . '/../../../../../../../../' -) . '/tools/Magento/Tools/Migration/System/Configuration/Mapper/Section.php'; -/** - * Test case for \Magento\Tools\Migration\System\Configuration\Mapper - */ -class MapperTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var \Magento\Tools\Migration\System\Configuration\Mapper - */ - protected $_object; - - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $_tabMapperMock; - - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $_sectionMapperMock; - - protected function setUp() - { - $this->_tabMapperMock = $this->getMock( - 'Magento\Tools\Migration\System\Configuration\Mapper\Tab', - [], - [], - '', - false - ); - $this->_sectionMapperMock = $this->getMock( - 'Magento\Tools\Migration\System\Configuration\Mapper\Section', - [], - [], - '', - false - ); - - $this->_object = new \Magento\Tools\Migration\System\Configuration\Mapper( - $this->_tabMapperMock, - $this->_sectionMapperMock - ); - } - - protected function tearDown() - { - $this->_object = null; - $this->_tabMapperMock = null; - $this->_sectionMapperMock = null; - } - - public function testTransformWithSetTabsAndSections() - { - $config = [ - 'comment' => 'test comment', - 'tabs' => ['test tabs config'], - 'sections' => ['test sections config'], - ]; - - $this->_tabMapperMock->expects( - $this->once() - )->method( - 'transform' - )->with( - ['test tabs config'] - )->will( - $this->returnArgument(0) - ); - - $this->_sectionMapperMock->expects( - $this->once() - )->method( - 'transform' - )->with( - ['test sections config'] - )->will( - $this->returnArgument(0) - ); - - $expected = ['comment' => 'test comment', 'nodes' => ['test tabs config', 'test sections config']]; - $actual = $this->_object->transform($config); - - $this->assertEquals($expected, $actual); - } - - public function testTransformWithoutSetTabsAndSections() - { - $config = ['comment' => 'test comment']; - - $this->_tabMapperMock->expects( - $this->once() - )->method( - 'transform' - )->with( - [] - )->will( - $this->returnArgument(0) - ); - - $this->_sectionMapperMock->expects( - $this->once() - )->method( - 'transform' - )->with( - [] - )->will( - $this->returnArgument(0) - ); - - $expected = ['comment' => 'test comment', 'nodes' => []]; - $actual = $this->_object->transform($config); - - $this->assertEquals($expected, $actual); - } -} diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/System/Configuration/ParserTest.php b/dev/tools/Magento/Tools/Migration/Test/Unit/System/Configuration/ParserTest.php deleted file mode 100644 index 439415801dc28136673e15d3d337ae85f8b4fcde..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/System/Configuration/ParserTest.php +++ /dev/null @@ -1,103 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Tools\Migration\Test\Unit\System\Configuration; - -require_once realpath(__DIR__ . '/../../../../../../../../') - . '/tools/Magento/Tools/Migration/System/Configuration/Parser.php'; - -/** - * Tools_Migration_System_Configuration_Parser test case - */ -class ParserTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var \Magento\Tools\Migration\System\Configuration\Parser - */ - protected $_parser; - - protected function setUp() - { - $this->_parser = new \Magento\Tools\Migration\System\Configuration\Parser(); - } - - protected function tearDown() - { - $this->_parser = null; - } - - public function testParseEmptyDom() - { - $this->assertEquals([], $this->_parser->parse(new \DOMDocument())); - } - - public function testParseDomWithoutNodes() - { - $xml = <<<XML -<?xml version="1.0"?> -<config> -</config> -XML; - - $expected = []; - $dom = new \DOMDocument(); - $dom->loadXML($xml); - $this->assertEquals($expected, $this->_parser->parse($dom)); - } - - public function testParseDomNodes() - { - $xml = <<<XML -<?xml version="1.0"?> -<!-- -/** - * some comment - */ ---> -<config> - <sections> - <some_section translate="label"> - <label>Section Name</label> - <tab>test</tab> - <frontend_type>text</frontend_type> - <sort_order>140</sort_order> - <show_in_default>1</show_in_default> - <show_in_website>1</show_in_website> - <show_in_store>1</show_in_store> - <resource>Magento_Some::resource</resource> - </some_section> - </sections> -</config> -XML; - - $comment = <<<XMLCOMMENT - -/** - * some comment - */ - -XMLCOMMENT; - $expected = [ - 'comment' => $comment, - 'sections' => [ - 'some_section' => [ - 'label' => ['#text' => 'Section Name'], - 'tab' => ['#text' => 'test'], - 'frontend_type' => ['#text' => 'text'], - 'sort_order' => ['#text' => '140'], - 'show_in_default' => ['#text' => '1'], - 'show_in_website' => ['#text' => '1'], - 'show_in_store' => ['#text' => '1'], - 'resource' => ['#text' => 'Magento_Some::resource'], - '@attributes' => ['translate' => 'label'], - ], - ], - ]; - $dom = new \DOMDocument(); - $dom->loadXML($xml); - $this->assertEquals($expected, $this->_parser->parse($dom)); - } -} diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/System/Configuration/ReaderTest.php b/dev/tools/Magento/Tools/Migration/Test/Unit/System/Configuration/ReaderTest.php deleted file mode 100644 index 81de8cd332358c4619f6f4002f2d89f895b43370..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/System/Configuration/ReaderTest.php +++ /dev/null @@ -1,115 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\Test\Unit\System\Configuration; - -require_once realpath( - __DIR__ . '/../../../../../../../../' -) . '/tools/Magento/Tools/Migration/System/Configuration/Reader.php'; -require_once realpath( - __DIR__ . '/../../../../../../../../' -) . '/tools/Magento/Tools/Migration/System/FileManager.php'; -require_once realpath( - __DIR__ . '/../../../../../../../../' -) . '/tools/Magento/Tools/Migration/System/Configuration/Mapper.php'; -require_once realpath( - __DIR__ . '/../../../../../../../../' -) . '/tools/Magento/Tools/Migration/System/Configuration/Parser.php'; -class ReaderTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var \Magento\Tools\Migration\System\Configuration\Reader - */ - protected $_model; - - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $_fileManagerMock; - - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $_parserMock; - - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $_mapperMock; - - protected function setUp() - { - $this->_fileManagerMock = $this->getMock( - 'Magento\Tools\Migration\System\FileManager', - [], - [], - '', - false - ); - $this->_parserMock = $this->getMock( - 'Magento\Tools\Migration\System\Configuration\Parser', - [], - [], - '', - false - ); - $this->_mapperMock = $this->getMock( - 'Magento\Tools\Migration\System\Configuration\Mapper', - [], - [], - '', - false - ); - - $this->_model = new \Magento\Tools\Migration\System\Configuration\Reader( - $this->_fileManagerMock, - $this->_parserMock, - $this->_mapperMock - ); - } - - public function testgetConfiguration() - { - $this->_fileManagerMock->expects( - $this->once() - )->method( - 'getFileList' - )->will( - $this->returnValue(['testFile']) - ); - $this->_fileManagerMock->expects( - $this->once() - )->method( - 'getContents' - )->with( - 'testFile' - )->will( - $this->returnValue('<config><system><tabs></tabs></system></config>') - ); - $parsedArray = ['config' => ['system' => ['tabs']]]; - $this->_parserMock->expects( - $this->once() - )->method( - 'parse' - )->with( - $this->isInstanceOf('DOMDocument') - )->will( - $this->returnValue($parsedArray) - ); - - $transformedArray = ['value' => 'expected']; - $this->_mapperMock->expects( - $this->once() - )->method( - 'transform' - )->with( - $parsedArray - )->will( - $this->returnValue($transformedArray) - ); - - $this->assertEquals(['testFile' => $transformedArray], $this->_model->getConfiguration()); - } -} diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/System/Configuration/_files/convertedConfiguration.xml b/dev/tools/Magento/Tools/Migration/Test/Unit/System/Configuration/_files/convertedConfiguration.xml deleted file mode 100644 index 5b2a7df2bb2129b8c6574abb23bd12e8e1d46c52..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/System/Configuration/_files/convertedConfiguration.xml +++ /dev/null @@ -1,58 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<config> - <system> - <tab id="tab_1" sortOrder="10" class="css class"> - <label>tab label</label> - </tab> - <section id="section_1" sortOrder="10" type="text"> - <class>css class</class> - <label>section label</label> - <resource>Magento_Backend::acl</resource> - <header_css>some css class</header_css> - <tab>tab_1</tab> - <group id="group_1" sortOrder="10" type="text"> - <label>group label</label> - <comment><![CDATA[group comment]]></comment> - <fieldset_css>some css class</fieldset_css> - <clone_fields>1</clone_fields> - <clone_model>Magento\Some\Model\Name</clone_model> - <help_url>some_url</help_url> - <hide_in_single_store_mode>1</hide_in_single_store_mode> - <expanded>1</expanded> - <field id="field_1"> - <comment><![CDATA[comment_test]]></comment> - <tooltip>tooltip_test</tooltip> - <frontend_class>frontend_class_test</frontend_class> - <validate>validate_test</validate> - <can_be_empty>1</can_be_empty> - <if_module_enabled>Magento_Backend</if_module_enabled> - <frontend_model>Magento\Some\Model\Name</frontend_model> - <backend_model>Magento\Some\Model\Name</backend_model> - <source_model>Magento\Some\Model\Name</source_model> - <config_path>config/path/test</config_path> - <base_url>some_url</base_url> - <upload_dir>some_directory</upload_dir> - <button_url>some_url</button_url> - <button_label>some_label</button_label> - <depends> - <field id="module1">yes</field> - </depends> - <more_url>more_url_test</more_url> - <demo_url>demo_url_test</demo_url> - <attribute type="undefined" some="attribute">undefined_test</attribute> - <attribute type="node"> - <label> - <nodeLabel>nodeValue</nodeLabel> - </label> - </attribute> - </field> - </group> - </section> - </system> -</config> diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/System/Configuration/_files/mappedConfiguration.php b/dev/tools/Magento/Tools/Migration/Test/Unit/System/Configuration/_files/mappedConfiguration.php deleted file mode 100644 index 15257c6ceb0a4c0821d0aff06a66682252b4b165..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/System/Configuration/_files/mappedConfiguration.php +++ /dev/null @@ -1,94 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -return [ - 'comment' => 'comment', - 'nodes' => [ - [ - 'nodeName' => 'tab', - '@attributes' => ['id' => 'tab_1', 'sortOrder' => 10, 'class' => 'css class'], - 'parameters' => [['name' => 'label', '#text' => 'tab label']], - ], - [ - 'nodeName' => 'section', - '@attributes' => ['id' => 'section_1', 'sortOrder' => 10, 'type' => 'text'], - 'parameters' => [ - ['name' => 'class', '#text' => 'css class'], - ['name' => 'label', '#text' => 'section label'], - ['name' => 'resource', '#text' => 'Magento_Backend::acl'], - ['name' => 'header_css', '#text' => 'some css class'], - ['name' => 'tab', '#text' => 'tab_1'], - ], - 'subConfig' => [ - [ - 'nodeName' => 'group', - '@attributes' => ['id' => 'group_1', 'sortOrder' => 10, 'type' => 'text'], - 'parameters' => [ - ['name' => 'label', '#text' => 'group label'], - ['name' => 'comment', '#cdata-section' => 'group comment'], - ['name' => 'fieldset_css', '#text' => 'some css class'], - ['name' => 'clone_fields', '#text' => '1'], - ['name' => 'clone_model', '#text' => 'Magento\Some\Model\Name'], - ['name' => 'help_url', '#text' => 'some_url'], - ['name' => 'hide_in_single_store_mode', '#text' => '1'], - ['name' => 'expanded', '#text' => '1'], - ], - 'subConfig' => [ - [ - 'nodeName' => 'field', - '@attributes' => ['id' => 'field_1'], - 'parameters' => [ - ['name' => 'comment', '#cdata-section' => 'comment_test'], - ['name' => 'tooltip', '#text' => 'tooltip_test'], - ['name' => 'frontend_class', '#text' => 'frontend_class_test'], - ['name' => 'validate', '#text' => 'validate_test'], - ['name' => 'can_be_empty', '#text' => '1'], - ['name' => 'if_module_enabled', '#text' => 'Magento_Backend'], - ['name' => 'frontend_model', '#text' => 'Magento\Some\Model\Name'], - ['name' => 'backend_model', '#text' => 'Magento\Some\Model\Name'], - ['name' => 'source_model', '#text' => 'Magento\Some\Model\Name'], - ['name' => 'config_path', '#text' => 'config/path/test'], - ['name' => 'base_url', '#text' => 'some_url'], - ['name' => 'upload_dir', '#text' => 'some_directory'], - ['name' => 'button_url', '#text' => 'some_url'], - ['name' => 'button_label', '#text' => 'some_label'], - [ - 'name' => 'depends', - 'subConfig' => [ - [ - 'nodeName' => 'field', - '@attributes' => ['id' => 'module1'], - '#text' => 'yes', - ], - ] - ], - ['name' => 'more_url', '#text' => 'more_url_test'], - ['name' => 'demo_url', '#text' => 'demo_url_test'], - [ - '@attributes' => ['type' => 'undefined', 'some' => 'attribute'], - 'name' => 'attribute', - '#text' => 'undefined_test' - ], - [ - '@attributes' => ['type' => 'node'], - 'name' => 'attribute', - 'subConfig' => [ - [ - 'nodeName' => 'label', - 'subConfig' => [ - ['nodeName' => 'nodeLabel', '#text' => 'nodeValue'], - ], - ], - ] - ], - ], - ], - ], - ], - ] - ], - ] -]; diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/System/FileManagerTest.php b/dev/tools/Magento/Tools/Migration/Test/Unit/System/FileManagerTest.php deleted file mode 100644 index aa44b504fa5d241f97df2f1fda2164a038dabd91..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/System/FileManagerTest.php +++ /dev/null @@ -1,91 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\Test\Unit\System; - -require_once realpath(__DIR__ . '/../../../../../../../') . '/tools/Magento/Tools/Migration/System/FileManager.php'; -require_once realpath(__DIR__ . '/../../../../../../../') . '/tools/Magento/Tools/Migration/System/FileReader.php'; -require_once realpath( - __DIR__ . '/../../../../../../../' -) . '/tools/Magento/Tools/Migration/System/Writer/Memory.php'; -class FileManagerTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var \Magento\Tools\Migration\System\FileManager - */ - protected $_model; - - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $_readerMock; - - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $_writerMock; - - protected function setUp() - { - $this->_readerMock = $this->getMock('Magento\Tools\Migration\System\FileReader', [], [], '', false); - $this->_writerMock = $this->getMock( - 'Magento\Tools\Migration\System\Writer\Memory', - [], - [], - '', - false - ); - $this->_model = new \Magento\Tools\Migration\System\FileManager($this->_readerMock, $this->_writerMock); - } - - protected function tearDown() - { - $this->_model = null; - $this->_readerMock = null; - $this->_writerMock = null; - } - - public function testWrite() - { - $this->_writerMock->expects($this->once())->method('write')->with('someFile', 'someContent'); - $this->_model->write('someFile', 'someContent'); - } - - public function testRemove() - { - $this->_writerMock->expects($this->once())->method('remove')->with('someFile'); - $this->_model->remove('someFile'); - } - - public function testGetContents() - { - $this->_readerMock->expects( - $this->once() - )->method( - 'getContents' - )->with( - 'someFile' - )->will( - $this->returnValue('123') - ); - $this->assertEquals('123', $this->_model->getContents('someFile')); - } - - public function testGetFileList() - { - $expected = ['file1', 'file2']; - $this->_readerMock->expects( - $this->once() - )->method( - 'getFileList' - )->with( - 'pattern' - )->will( - $this->returnValue($expected) - ); - - $this->assertEquals($expected, $this->_model->getFileList('pattern')); - } -} diff --git a/dev/tools/Magento/Tools/Migration/Test/Unit/System/Writer/FactoryTest.php b/dev/tools/Magento/Tools/Migration/Test/Unit/System/Writer/FactoryTest.php deleted file mode 100644 index c760dc4ef6397464af9be48fe57b8b65d47d7060..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/Test/Unit/System/Writer/FactoryTest.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Tools\Migration\Test\Unit\System\Writer; - -require_once realpath( - __DIR__ . '/../../../../../../../../' -) . '/tools/Magento/Tools/Migration/System/Writer/Factory.php'; -require_once realpath( - __DIR__ . '/../../../../../../../../' -) . '/tools/Magento/Tools/Migration/System/Writer/FileSystem.php'; -class FactoryTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var \Magento\Tools\Migration\System\Writer\Factory - */ - protected $_model; - - protected function setUp() - { - $this->_model = new \Magento\Tools\Migration\System\Writer\Factory(); - } - - public function testGetWriterReturnsProperWriter() - { - $this->assertInstanceOf('Magento\Tools\Migration\System\Writer\FileSystem', $this->_model->getWriter('write')); - $this->assertInstanceOf( - 'Magento\Tools\Migration\System\Writer\Memory', - $this->_model->getWriter('someWriter') - ); - } -} diff --git a/dev/tools/Magento/Tools/Migration/acl.php b/dev/tools/Magento/Tools/Migration/acl.php deleted file mode 100644 index 841e25b905a9226f446f2a8e5d647f9363e44a4f..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/acl.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -require_once './Acl/Formatter.php'; -require_once './Acl/FileManager.php'; -require_once './Acl/Generator.php'; - -$shortOpts = 'ph'; -$options = getopt($shortOpts); -try { - $tool = new \Magento\Tools\Migration\Acl\Generator( - new \Magento\Tools\Migration\Acl\Formatter(), - new \Magento\Tools\Migration\Acl\FileManager(), - $options - ); - $tool->run(); -} catch (\Exception $exp) { - echo $exp->getMessage(); -} diff --git a/dev/tools/Magento/Tools/Migration/aliases_map/cms_content_tables_ce.php b/dev/tools/Magento/Tools/Migration/aliases_map/cms_content_tables_ce.php deleted file mode 100644 index 30a92b4f0e2dfba8219d8eed84bb087989f5eaf3..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/aliases_map/cms_content_tables_ce.php +++ /dev/null @@ -1,10 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -/** - * List of tables and fields with cms content Magento CE - */ -return ['cms_page' => 'content', 'cms_block' => 'content']; 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 deleted file mode 100644 index 39b57135fb1d9b6d6a95080280d9111428bfd460..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/aliases_map/composite_modules_ce.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -/** - * List on composite module names for Magento CE - */ -require_once __DIR__ . '/../../../../../../app/bootstrap.php'; -require_once realpath( - dirname(dirname(dirname(dirname(dirname(dirname(__DIR__)))))) -) . '/app/code/Magento/Core/Model/Resource/SetupInterface.php'; -require_once realpath( - dirname(dirname(dirname(dirname(dirname(dirname(__DIR__)))))) -) . '/app/code/Magento/Core/Model/Resource/Setup.php'; -require_once realpath( - dirname(dirname(dirname(dirname(dirname(dirname(__DIR__)))))) -) . '/app/code/Magento/Core/Model/Resource/Setup/Migration.php'; - -$objectManager = new \Magento\Framework\App\ObjectManager(); -return $objectManager->create('Magento\Framework\Module\Setup\Migration')->getCompositeModules(); diff --git a/dev/tools/Magento/Tools/Migration/factory_names.php b/dev/tools/Magento/Tools/Migration/factory_names.php deleted file mode 100644 index 96b3dbe8c1b2ed15ca957706b2e1fb6159cc4306..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/factory_names.php +++ /dev/null @@ -1,182 +0,0 @@ -<?php -/** - * Automated replacement of factory names into real ones - * - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -require realpath(dirname(dirname(dirname(dirname(dirname(__DIR__)))))) . '/dev/tests/static/framework/bootstrap.php'; - -// PHP code -foreach (\Magento\Framework\App\Utility\Files::init()->getPhpFiles(true, true, true, false, false) as $file) { - $content = file_get_contents($file); - $classes = \Magento\Framework\App\Utility\Classes::collectPhpCodeClasses($content); - $factoryNames = array_filter($classes, 'isFactoryName'); - if (!$factoryNames) { - continue; - } - $search = []; - $replace = []; - foreach ($factoryNames as $factoryName) { - list($module, $name) = getModuleName($factoryName); - addReplace($factoryName, $module, $name, '::getModel(\'%s\'', '_Model_', $search, $replace); - addReplace($factoryName, $module, $name, '::getSingleton(\'%s\'', '_Model_', $search, $replace); - addReplace($factoryName, $module, $name, '::getResourceModel(\'%s\'', '_Model_Resource_', $search, $replace); - addReplace($factoryName, $module, $name, "::getResourceSingleton('%s'", '_Model_Resource_', $search, $replace); - addReplace($factoryName, $module, $name, 'addBlock(\'%s\'', '_Block_', $search, $replace); - addReplace($factoryName, $module, $name, 'createBlock(\'%s\'', '_Block_', $search, $replace); - addReplace($factoryName, $module, $name, 'getBlockClassName(\'%s\'', '_Block_', $search, $replace); - addReplace($factoryName, $module, $name, 'getBlockSingleton(\'%s\'', '_Block_', $search, $replace); - addReplace($factoryName, $module, $name, 'helper(\'%s\'', '_Helper_', $search, $replace); - } - replaceAndOutput($file, $search, $replace, $factoryNames); -} - -// layouts -$layouts = \Magento\Framework\App\Utility\Files::init()->getLayoutFiles([], false); -foreach ($layouts as $file) { - $xml = simplexml_load_file($file); - $classes = \Magento\Framework\App\Utility\Classes::collectLayoutClasses($xml); - $factoryNames = array_filter($classes, 'isFactoryName'); - if (!$factoryNames) { - continue; - } - $search = []; - $replace = []; - foreach ($factoryNames as $factoryName) { - list($module, $name) = getModuleName($factoryName); - addReplace($factoryName, $module, $name, 'type="%s"', '_Block_', $search, $replace); - } - replaceAndOutput($file, $search, $replace, $factoryNames); -} - -// modules in configuration and layouts -$configs = \Magento\Framework\App\Utility\Files::init()->getConfigFiles( - '*.xml', - ['wsdl.xml', 'wsdl2.xml', 'wsi.xml'], - false -); -foreach (array_merge($layouts, $configs) as $file) { - $modules = array_unique( - \Magento\Framework\App\Utility\Classes::getXmlAttributeValues( - simplexml_load_file($file), - '//@module', - 'module' - ) - ); - $factoryNames = array_filter($modules, 'isFactoryName'); - if (!$factoryNames) { - continue; - } - $search = []; - $replace = []; - foreach ($factoryNames as $factoryName) { - list($module, $name) = getModuleName($factoryName); - if ($module) { - $search[] = 'module="' . $factoryName . '"'; - $replace[] = 'module="' . implode('\\', array_map('ucfirst', explode('_', $module))) . '"'; - } else { - $search[] = 'module="' . $factoryName . '"'; - $replace[] = 'module="' . implode('\\', array_map('ucfirst', explode('_', $name))) . '"'; - } - } - replaceAndOutput($file, $search, $replace, $factoryNames); -} - -/** - * Whether the given class name is a factory name - * - * @param string $class - * @return bool - */ -function isFactoryName($class) -{ - return false !== strpos( - $class, - '/' - ) || preg_match( - '/^([A-Za-z\\d])+((_[A-Za-z\\d]+))+?$/', - $class - ) || preg_match( - '/^[a-z\d]+(_[A-Za-z\d]+)?$/', - $class - ); -} - -/** - * Transform factory name into a pair of module and name - * - * @param string $factoryName - * @return array - */ -function getModuleName($factoryName) -{ - if (false !== strpos($factoryName, 'Magento_')) { - $module = false; - $name = $factoryName; - } else { - if (false !== strpos($factoryName, '/')) { - list($module, $name) = explode('/', $factoryName); - } else { - $module = $factoryName; - $name = false; - } - - if (false === strpos($module, '_')) { - $module = "Magento_{$factoryName}"; - } - } - - return [$module, $name]; -} - -/** - * Add search/replacements of factory name into real name based on a specified "sprintf()" pattern - * - * @param string $factoryName - * @param string $module - * @param string $name - * @param string $pattern - * @param string $suffix - * @param array &$search - * @param array &$replace - * @return void - */ -function addReplace($factoryName, $module, $name, $pattern, $suffix, &$search, &$replace) -{ - if (empty($name)) { - if ('_Helper_' !== $suffix) { - return; - } - $name = 'data'; - } - - if (empty($module)) { - $realName = '\\' . implode('\\', array_map('ucfirst', explode('_', $name))); - } else { - $realName = '\\' . implode('\\', array_map('ucfirst', explode('_', $module . $suffix . $name))); - } - - $search[] = sprintf($pattern, "{$factoryName}"); - $replace[] = sprintf($pattern, "{$realName}"); -} - -/** - * Perform replacement if needed - * - * @param string $file - * @param array $search - * @param array $replace - * @param mixed $output - * @return void - */ -function replaceAndOutput($file, $search, $replace, $output) -{ - $content = file_get_contents($file); - $newContent = str_replace($search, $replace, $content); - if ($newContent != $content) { - echo "{$file}\n"; - print_r($output); - file_put_contents($file, $newContent); - } -} diff --git a/dev/tools/Magento/Tools/Migration/factory_table_names.php b/dev/tools/Magento/Tools/Migration/factory_table_names.php deleted file mode 100644 index 6dfaa0a8e22fde0b3778387594b800a9d47e316d..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/factory_table_names.php +++ /dev/null @@ -1,169 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -define( - 'USAGE', -<<<USAGE -$>./FactoryTableNames.php -- [-dseh] - additional parameters: - -d replacement in dry-run mode - -s search for table names not in list for replacement - -e output with errors during replacement - -h print usage -USAGE -); - -$shortOpts = 'ehds'; -$options = getopt($shortOpts); - -if (isset($options['h'])) { - echo USAGE; - exit(0); -} - -$outputWithErrors = isset($options['e']); -$isDryRunMode = isset($options['d']); -$isSearchTables = isset($options['s']); - -require realpath(dirname(dirname(dirname(__DIR__)))) . '/dev/tests/static/framework/bootstrap.php'; -$tablesAssociation = getFilesCombinedArray(__DIR__ . '/FactoryTableNames', 'replace_*.php'); -$blackList = getFilesCombinedArray(__DIR__ . '/FactoryTableNames', 'blacklist_*.php'); - -$phpFiles = \Magento\Framework\App\Utility\Files::init()->getPhpFiles(true, false, false, false, false); - -$replacementResult = false; -if (!$isSearchTables || $isDryRunMode) { - $replacementResult = replaceTableNames($phpFiles, $tablesAssociation, $outputWithErrors, $isDryRunMode); -} - -$searchResult = $isSearchTables ? searchTableNamesNotInReplacedList($phpFiles, $tablesAssociation, $blackList) : false; - -if ($replacementResult || $searchResult) { - exit(1); -} -exit(0); - -/** - * Get combined array from similar files by pattern - * - * @param string $dirPath - * @param string $filePattern - * @return array - */ -function getFilesCombinedArray($dirPath, $filePattern) -{ - $result = []; - foreach (glob($dirPath . '/' . $filePattern, GLOB_NOSORT | GLOB_BRACE) as $filePath) { - $arrayFromFile = include_once $filePath; - $result = array_merge($result, $arrayFromFile); - } - return $result; -} - -/** - * Replace table names in all files - * - * @param array $files - * @param array &$tablesAssociation - * @param bool $outputWithErrors - * @param bool $isDryRunMode - * @return bool - */ -function replaceTableNames(array $files, array &$tablesAssociation, $outputWithErrors, $isDryRunMode) -{ - $isErrorsFound = false; - $errors = []; - foreach ($files as $filePath) { - $search = $replace = []; - - $tables = Magento_Test_Legacy_TableTest::extractTables($filePath); - $tables = array_filter( - $tables, - function ($table) { - return false !== strpos($table['name'], '/'); - } - ); - - if (!empty($tables)) { - foreach ($tables as $table) { - $tableName = $table['name']; - if (isset($tablesAssociation[$tableName])) { - $search[] = $tableName; - $replace[] = $tablesAssociation[$tableName]; - } else { - $errors[] = $tableName; - } - } - - if (!empty($replace) && !empty($search)) { - replaceTableNamesInFile($filePath, $search, $replace, $isDryRunMode); - } - if (!empty($errors)) { - if ($outputWithErrors) { - echo "Error - Missed table names in config: \n" . implode(", ", $errors) . "\n"; - } - $errors = []; - $isErrorsFound = true; - } - } - } - - return $isErrorsFound; -} - -/** - * Replace table names in an file - * - * @param string $filePath - * @param string $search - * @param string $replace - * @param bool $isDryRunMode - * @return void - */ -function replaceTableNamesInFile($filePath, $search, $replace, $isDryRunMode) -{ - $content = file_get_contents($filePath); - $newContent = str_replace($search, $replace, $content); - if ($newContent != $content) { - echo "{$filePath}\n"; - echo 'Replaced tables: '; - print_r($search); - if (!$isDryRunMode) { - file_put_contents($filePath, $newContent); - } - } -} - -/** - * Looking for table names which not defined in current config - * - * @param array $files - * @param array &$tablesAssociation - * @param array &$blackList - * @return bool - */ -function searchTableNamesNotInReplacedList(array $files, array &$tablesAssociation, array &$blackList) -{ - $search = []; - foreach ($files as $filePath) { - $tables = Magento_Test_Legacy_TableTest::extractTables($filePath); - foreach ($tables as $table) { - if (in_array($table['name'], $blackList)) { - continue; - } - if (!in_array($table['name'], array_values($tablesAssociation)) && !in_array($table['name'], $search)) { - $search[] = $table['name']; - } - } - } - - if (!empty($search)) { - echo "List of table names not in association list: \n"; - print_r(array_unique($search)); - } - - return false; -} diff --git a/dev/tools/Magento/Tools/Migration/factory_table_names/blacklist_ce.php b/dev/tools/Magento/Tools/Migration/factory_table_names/blacklist_ce.php deleted file mode 100644 index bb65b88102254572602932f1fa69c848dd50f172..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/factory_table_names/blacklist_ce.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -/** - * Black list - * Return table names list which are: - * a) aliased of previous usage in Zend_Db_Select - * b) used in dynamic created table names - * c) not available by used as dead code - */ - -return [ - 'c', - 'l', - 'sc', - 'cat_pro', - 'table_name', - 'rule_customer', - 'sales_', - 'catalog_product_link_attribute_', - 'catalog_category_flat_', - 'catalog_category_entity_', - 'catalog_product_flat_', - 'catalog_product_entity_', - 'price_index', - 'invitation', - 'entity_attribute', - 'directory_currency', - 'sales_bestsellers_aggregated_' -]; diff --git a/dev/tools/Magento/Tools/Migration/factory_table_names/replace_ce.php b/dev/tools/Magento/Tools/Migration/factory_table_names/replace_ce.php deleted file mode 100644 index 44e24033941d809897b13d6582937c6b41c0287a..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/factory_table_names/replace_ce.php +++ /dev/null @@ -1,355 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -/** - * Table names association between Magento1 and Magento2 for Community Edition - * key => Magento1 table name - * value => Magento2 table name - */ - -return [ - 'admin/assert' => 'admin_assert', - 'admin/role' => 'authorization_role', - 'admin/rule' => 'authorization_rule', - 'admin/user' => 'admin_user', - 'adminnotification/inbox' => 'adminnotification_inbox', - 'amazonpayments/api_debug' => 'amazonpayments_api_debug', - 'array(\'catalog/category\', \'datetime\')' => 'catalog_category_entity_datetime', - 'array(\'catalog/category\', \'decimal\')' => 'catalog_category_entity_decimal', - 'array(\'catalog/category\', \'int\')' => 'catalog_category_entity_int', - 'array(\'catalog/category\', \'text\')' => 'catalog_category_entity_text', - 'array(\'catalog/category\', \'varchar\')' => 'catalog_category_entity_varchar', - 'array(\'catalog/product\', \'datetime\')' => 'catalog_product_entity_datetime', - 'array(\'catalog/product\', \'decimal\')' => 'catalog_product_entity_decimal', - 'array(\'catalog/product\', \'gallery\'' => 'catalog_product_entity_gallery', - 'array(\'catalog/product\', \'int\')' => 'catalog_product_entity_int', - 'array(\'catalog/product\', \'text\')' => 'catalog_product_entity_text', - 'array(\'catalog/product\', \'varchar\')' => 'catalog_product_entity_varchar', - 'array(\'catalog_product\', \'group_price\')' => 'catalog_product_entity_group_price', - 'bundle/option' => 'catalog_product_bundle_option', - 'bundle/option_indexer_idx' => 'catalog_product_index_price_bundle_opt_idx', - 'bundle/option_indexer_tmp' => 'catalog_product_index_price_bundle_opt_tmp', - 'bundle/option_value' => 'catalog_product_bundle_option_value', - 'bundle/price_index' => 'catalog_product_bundle_price_index', - 'bundle/price_indexer_idx' => 'catalog_product_index_price_bundle_idx', - 'bundle/price_indexer_tmp' => 'catalog_product_index_price_bundle_tmp', - 'bundle/selection' => 'catalog_product_bundle_selection', - 'bundle/selection_indexer_idx' => 'catalog_product_index_price_bundle_sel_idx', - 'bundle/selection_indexer_tmp' => 'catalog_product_index_price_bundle_sel_tmp', - 'bundle/selection_price' => 'catalog_product_bundle_selection_price', - 'bundle/stock_index' => 'catalog_product_bundle_stock_index', - 'captcha/log' => 'captcha_log', - 'catalog/category' => 'catalog_category_entity', - 'catalog/category_flat' => 'catalog_category_flat', - 'catalog/category_product' => 'catalog_category_product', - 'catalog/category_product_index' => 'catalog_category_product_index', - 'catalog/compare_item' => 'catalog_compare_item', - 'catalog/eav_attribute' => 'catalog_eav_attribute', - 'catalog/product' => 'catalog_product_entity', - 'catalog/product_attribute_group_price' => 'catalog_product_entity_group_price', - 'catalog/product_attribute_media_gallery' => 'catalog_product_entity_media_gallery', - 'catalog/product_attribute_media_gallery_value' => 'catalog_product_entity_media_gallery_value', - 'catalog/product_attribute_tier_price' => 'catalog_product_entity_tier_price', - 'catalog/product_eav_decimal_indexer_idx' => 'catalog_product_index_eav_decimal_idx', - 'catalog/product_eav_decimal_indexer_tmp' => 'catalog_product_index_eav_decimal_tmp', - 'catalog/product_eav_indexer_idx' => 'catalog_product_index_eav_idx', - 'catalog/product_eav_indexer_tmp' => 'catalog_product_index_eav_tmp', - 'catalog/product_flat' => 'catalog_product_flat', - 'catalog/product_index_eav' => 'catalog_product_index_eav', - 'catalog/product_index_eav_decimal' => 'catalog_product_index_eav_decimal', - 'catalog/product_index_group_price' => 'catalog_product_index_group_price', - 'catalog/product_index_price' => 'catalog_product_index_price', - 'catalog/product_index_tier_price' => 'catalog_product_index_tier_price', - 'catalog/product_index_website' => 'catalog_product_index_website', - 'catalog/product_link' => 'catalog_product_link', - 'catalog/product_link_attribute' => 'catalog_product_link_attribute', - 'catalog/product_link_attribute_decimal' => 'catalog_product_link_attribute_decimal', - 'catalog/product_link_attribute_int' => 'catalog_product_link_attribute_int', - 'catalog/product_link_attribute_varchar' => 'catalog_product_link_attribute_varchar', - 'catalog/product_link_type' => 'catalog_product_link_type', - 'catalog/product_option' => 'catalog_product_option', - 'catalog/product_option_price' => 'catalog_product_option_price', - 'catalog/product_option_title' => 'catalog_product_option_title', - 'catalog/product_option_type_price' => 'catalog_product_option_type_price', - 'catalog/product_option_type_title' => 'catalog_product_option_type_title', - 'catalog/product_option_type_value' => 'catalog_product_option_type_value', - 'catalog/product_price_indexer_cfg_option_aggregate_idx' => 'catalog_product_index_price_cfg_opt_agr_idx', - 'catalog/product_price_indexer_cfg_option_aggregate_tmp' => 'catalog_product_index_price_cfg_opt_agr_tmp', - 'catalog/product_price_indexer_cfg_option_idx' => 'catalog_product_index_price_cfg_opt_idx', - 'catalog/product_price_indexer_cfg_option_tmp' => 'catalog_product_index_price_cfg_opt_tmp', - 'catalog/product_price_indexer_final_idx' => 'catalog_product_index_price_final_idx', - 'catalog/product_price_indexer_final_tmp' => 'catalog_product_index_price_final_tmp', - 'catalog/product_price_indexer_idx' => 'catalog_product_index_price_idx', - 'catalog/product_price_indexer_option_aggregate_idx' => 'catalog_product_index_price_opt_agr_idx', - 'catalog/product_price_indexer_option_aggregate_tmp' => 'catalog_product_index_price_opt_agr_tmp', - 'catalog/product_price_indexer_option_idx' => 'catalog_product_index_price_opt_idx', - 'catalog/product_price_indexer_option_tmp' => 'catalog_product_index_price_opt_tmp', - 'catalog/product_price_indexer_tmp' => 'catalog_product_index_price_tmp', - 'catalog/product_relation' => 'catalog_product_relation', - 'catalog/product_super_attribute' => 'catalog_product_super_attribute', - 'catalog/product_super_attribute_label' => 'catalog_product_super_attribute_label', - 'catalog/product_super_attribute_pricing' => 'catalog_product_super_attribute_pricing', - 'catalog/product_super_link' => 'catalog_product_super_link', - 'catalog/product_website' => 'catalog_product_website', - 'catalogindex/aggregation' => 'catalogindex_aggregation', - 'catalogindex/aggregation_tag' => 'catalogindex_aggregation_tag', - 'catalogindex/aggregation_to_tag' => 'catalogindex_aggregation_to_tag', - 'catalogindex/eav' => 'catalog_product_index_eav', - 'catalogindex/minimal_price' => 'catalogindex_minimal_price', - 'catalogindex/price' => 'catalog_product_index_price', - 'cataloginventory/stock' => 'cataloginventory_stock', - 'cataloginventory/stock_item' => 'cataloginventory_stock_item', - 'cataloginventory/stock_status' => 'cataloginventory_stock_status', - 'cataloginventory/stock_status_indexer_idx' => 'cataloginventory_stock_status_idx', - 'cataloginventory/stock_status_indexer_tmp' => 'cataloginventory_stock_status_tmp', - 'catalogrule/customer_group' => 'catalogrule_customer_group', - 'catalogrule/rule' => 'catalogrule', - 'catalogrule/rule_group_website' => 'catalogrule_group_website', - 'catalogrule/rule_product' => 'catalogrule_product', - 'catalogrule/rule_product_price' => 'catalogrule_product_price', - 'catalogrule/website' => 'catalogrule_website', - 'catalogsearch/fulltext' => 'catalogsearch_fulltext', - 'catalogsearch/result' => 'catalogsearch_result', - 'catalogsearch/search_query' => 'search_query', - 'checkout/agreement' => 'checkout_agreement', - 'checkout/agreement_store' => 'checkout_agreement_store', - 'chronopay/api_debug' => 'chronopay_api_debug', - 'cms/block' => 'cms_block', - 'cms/block_store' => 'cms_block_store', - 'cms/page' => 'cms_page', - 'cms/page_store' => 'cms_page_store', - 'compiler/configuration' => 'compiler_configuration', - 'core/cache' => 'cache', - 'core/cache_tag' => 'cache_tag', - 'core/config_data' => 'core_config_data', - 'core/design_change' => 'design_change', - 'core/directory_storage' => 'media_storage_directory_storage', - 'core/email_template' => 'email_template', - 'core/file_storage' => 'media_storage_file_storage', - 'core/flag' => 'flag', - 'core/layout_link' => 'layout_link', - 'core/layout_update' => 'layout_update', - 'core_resource' => 'setup_module', - 'core/session' => 'session', - 'core/store' => 'store', - 'core/store_group' => 'store_group', - 'core/variable' => 'variable', - 'core/variable_value' => 'variable_value', - 'core/website' => 'store_website', - 'cron/schedule' => 'cron_schedule', - 'customer/address_entity' => 'customer_address_entity', - 'customer/customer_group' => 'customer_group', - 'customer/eav_attribute' => 'customer_eav_attribute', - 'customer/eav_attribute_website' => 'customer_eav_attribute_website', - 'customer/entity' => 'customer_entity', - 'customer/form_attribute' => 'customer_form_attribute', - 'customer/value_prefix' => 'customer_entity', - 'customer_address_entity_datetime' => 'customer_address_entity_datetime', - 'customer_address_entity_decimal' => 'customer_address_entity_decimal', - 'customer_address_entity_int' => 'customer_address_entity_int', - 'customer_address_entity_text' => 'customer_address_entity_text', - 'customer_address_entity_varchar' => 'customer_address_entity_varchar', - 'customer_entity_datetime' => 'customer_entity_datetime', - 'customer_entity_decimal' => 'customer_entity_decimal', - 'customer_entity_int' => 'customer_entity_int', - 'customer_entity_text' => 'customer_entity_text', - 'customer_entity_varchar' => 'customer_entity_varchar', - 'cybermut/api_debug' => 'cybermut_api_debug', - 'cybersource/api_debug' => 'cybersource_api_debug', - 'directory/country' => 'directory_country', - 'directory/country_format' => 'directory_country_format', - 'directory/country_name' => 'directory_country_name', - 'directory/country_region' => 'directory_country_region', - 'directory/country_region_name' => 'directory_country_region_name', - 'directory/currency_rate' => 'directory_currency_rate', - 'downloadable/link' => 'downloadable_link', - 'downloadable/link_price' => 'downloadable_link_price', - 'downloadable/link_purchased' => 'downloadable_link_purchased', - 'downloadable/link_purchased_item' => 'downloadable_link_purchased_item', - 'downloadable/link_title' => 'downloadable_link_title', - 'downloadable/product_price_indexer_idx' => 'catalog_product_index_price_downlod_idx', - 'downloadable/product_price_indexer_tmp' => 'catalog_product_index_price_downlod_tmp', - 'downloadable/sample' => 'downloadable_sample', - 'downloadable/sample_title' => 'downloadable_sample_title', - 'eav/attribute' => 'eav_attribute', - 'eav/attribute_group' => 'eav_attribute_group', - 'eav/attribute_label' => 'eav_attribute_label', - 'eav/attribute_option' => 'eav_attribute_option', - 'eav/attribute_option_value' => 'eav_attribute_option_value', - 'eav/attribute_set' => 'eav_attribute_set', - 'eav/entity' => 'eav_entity', - 'eav/entity_attribute' => 'eav_entity_attribute', - 'eav/entity_attribute_source_table' => 'eav_entity_attribute_source_table', - 'eav/entity_store' => 'eav_entity_store', - 'eav/entity_type' => 'eav_entity_type', - 'eav/entity_value_prefix' => 'eav_entity', - 'eav/form_element' => 'eav_form_element', - 'eav/form_fieldset' => 'eav_form_fieldset', - 'eav/form_fieldset_label' => 'eav_form_fieldset_label', - 'eav/form_type' => 'eav_form_type', - 'eav/form_type_entity' => 'eav_form_type_entity', - 'eav_entity_datetime' => 'eav_entity_datetime', - 'eav_entity_decimal' => 'eav_entity_decimal', - 'eav_entity_int' => 'eav_entity_int', - 'eav_entity_text' => 'eav_entity_text', - 'eav_entity_varchar' => 'eav_entity_varchar', - 'eway/api_debug' => 'eway_api_debug', - 'flo2cash/api_debug' => 'flo2cash_api_debug', - 'giftmessage/message' => 'gift_message', - 'googlebase/attributes' => 'googlebase_attributes', - 'googlebase/items' => 'googlebase_items', - 'googlebase/types' => 'googlebase_types', - 'googleoptimizer/code' => 'googleoptimizer_code', - 'ideal/api_debug' => 'ideal_api_debug', - 'importexport/importdata' => 'importexport_importdata', - 'index/event' => 'index_event', - 'index/process' => 'index_process', - 'index/process_event' => 'index_process_event', - 'log/customer' => 'log_customer', - 'log/quote_table' => 'log_quote', - 'log/summary_table' => 'log_summary', - 'log/summary_type_table' => 'log_summary_type', - 'log/url_info_table' => 'log_url_info', - 'log/url_table' => 'log_url', - 'log/visitor' => 'log_visitor', - 'log/visitor_info' => 'log_visitor_info', - 'log/visitor_online' => 'log_visitor_online', - 'newsletter/problem' => 'newsletter_problem', - 'newsletter/queue' => 'newsletter_queue', - 'newsletter/queue_link' => 'newsletter_queue_link', - 'newsletter/queue_store_link' => 'newsletter_queue_store_link', - 'newsletter/subscriber' => 'newsletter_subscriber', - 'newsletter/template' => 'newsletter_template', - 'oauth/consumer' => 'oauth_consumer', - 'oauth/nonce' => 'oauth_nonce', - 'oauth/token' => 'oauth_token', - 'oscommerce/catalog_category' => 'catalog_category_entity', - 'oscommerce/catalog_product_website' => 'catalog_product_website', - 'oscommerce/oscommerce' => 'oscommerce_import', - 'oscommerce/oscommerce_order' => 'oscommerce_orders', - 'oscommerce/oscommerce_order_history' => 'oscommerce_orders_status_history', - 'oscommerce/oscommerce_order_products' => 'oscommerce_orders_products', - 'oscommerce/oscommerce_order_total' => 'oscommerce_orders_total', - 'oscommerce/oscommerce_ref' => 'oscommerce_ref', - 'oscommerce/oscommerce_type' => 'oscommerce_import_type', - 'paybox/api_debug' => 'paybox_api_debug', - 'paybox/question_number' => 'paybox_question_number', - 'paygate/authorizenet_debug' => 'authorizenet_debug', - 'paypal/cert' => 'paypal_cert', - 'paypal/payment_transaction' => 'paypal_payment_transaction', - 'paypal/settlement_report' => 'paypal_settlement_report', - 'paypal/settlement_report_row' => 'paypal_settlement_report_row', - 'persistent/session' => 'persistent_session', - 'poll/poll' => 'poll', - 'poll/poll_answer' => 'poll_answer', - 'poll/poll_store' => 'poll_store', - 'poll/poll_vote' => 'poll_vote', - 'productalert/price' => 'product_alert_price', - 'productalert/stock' => 'product_alert_stock', - 'protx/api_debug' => 'protx_api_debug', - 'rating/rating' => 'rating', - 'rating/rating_entity' => 'rating_entity', - 'rating/rating_option' => 'rating_option', - 'rating/rating_option_vote' => 'rating_option_vote', - 'rating/rating_store' => 'rating_store', - 'rating/rating_title' => 'rating_title', - 'rating/rating_vote_aggregated' => 'rating_option_vote_aggregated', - 'reports/compared_product_index' => 'report_compared_product_index', - 'reports/event' => 'report_event', - 'reports/event_type' => 'report_event_types', - 'reports/viewed_product_index' => 'report_viewed_product_index', - 'review/review' => 'review', - 'review/review_aggregate' => 'review_entity_summary', - 'review/review_detail' => 'review_detail', - 'review/review_entity' => 'review_entity', - 'review/review_status' => 'review_status', - 'review/review_store' => 'review_store', - 'sales/bestsellers_aggregated_daily' => 'sales_bestsellers_aggregated_daily', - 'sales/bestsellers_aggregated_monthly' => 'sales_bestsellers_aggregated_monthly', - 'sales/bestsellers_aggregated_yearly' => 'sales_bestsellers_aggregated_yearly', - 'sales/billing_agreement' => 'paypal_billing_agreement', - 'sales/billing_agreement_order' => 'paypal_billing_agreement_order', - 'sales/creditmemo' => 'sales_creditmemo', - 'sales/creditmemo_comment' => 'sales_creditmemo_comment', - 'sales/creditmemo_grid' => 'sales_creditmemo_grid', - 'sales/creditmemo_item' => 'sales_creditmemo_item', - 'sales/invoice' => 'sales_invoice', - 'sales/invoice_comment' => 'sales_invoice_comment', - 'sales/invoice_grid' => 'sales_invoice_grid', - 'sales/invoice_item' => 'sales_invoice_item', - 'sales/invoiced_aggregated' => 'sales_invoiced_aggregated', - 'sales/invoiced_aggregated_order' => 'sales_invoiced_aggregated_order', - 'sales/order' => 'sales_order', - 'sales/order_address' => 'sales_order_address', - 'sales/order_aggregated_created' => 'sales_order_aggregated_created', - 'sales/order_aggregated_updated' => 'sales_order_aggregated_updated', - 'sales/order_entity' => 'sales_order_entity', - 'sales/order_grid' => 'sales_order_grid', - 'sales/order_item' => 'sales_order_item', - 'sales/order_item_option' => 'sales_order_item_option', - 'sales/order_payment' => 'sales_order_payment', - 'sales/order_status' => 'sales_order_status', - 'sales/order_status_history' => 'sales_order_status_history', - 'sales/order_status_label' => 'sales_order_status_label', - 'sales/order_status_state' => 'sales_order_status_state', - 'sales/order_tax' => 'sales_order_tax', - 'sales/payment_transaction' => 'sales_payment_transaction', - 'sales/quote' => 'quote', - 'sales/quote_address' => 'quote_address', - 'sales/quote_address_item' => 'quote_address_item', - 'sales/quote_address_shipping_rate' => 'quote_shipping_rate', - 'sales/quote_item' => 'quote_item', - 'sales/quote_item_option' => 'quote_item_option', - 'sales/quote_payment' => 'quote_payment', - 'sales/refunded_aggregated' => 'sales_refunded_aggregated', - 'sales/refunded_aggregated_order' => 'sales_refunded_aggregated_order', - 'sales/shipment' => 'sales_shipment', - 'sales/shipment_comment' => 'sales_shipment_comment', - 'sales/shipment_grid' => 'sales_shipment_grid', - 'sales/shipment_item' => 'sales_shipment_item', - 'sales/shipment_track' => 'sales_shipment_track', - 'sales/shipping_aggregated' => 'sales_shipping_aggregated', - 'sales/shipping_aggregated_order' => 'sales_shipping_aggregated_order', - 'sales_entity/order' => 'sales_order', - 'sales_entity/order_entity' => 'sales_order_entity', - 'sales_entity/quote' => 'quote', - 'sales_entity/quote_address' => 'quote_address', - 'sales_entity/quote_entity' => 'quote_entity', - 'sales_entity/quote_item' => 'quote_item', - 'sales_entity/quote_temp' => 'quote_temp', - 'salesrule/coupon' => 'salesrule_coupon', - 'salesrule/coupon_aggregated' => 'coupon_aggregated', - 'salesrule/coupon_aggregated_order' => 'coupon_aggregated_order', - 'salesrule/coupon_aggregated_updated' => 'coupon_aggregated_updated', - 'salesrule/coupon_usage' => 'salesrule_coupon_usage', - 'salesrule/customer_group' => 'salesrule_website', - 'salesrule/label' => 'salesrule_label', - 'salesrule/product_attribute' => 'salesrule_product_attribute', - 'salesrule/rule' => 'salesrule', - 'salesrule/rule_customer' => 'salesrule_customer', - 'salesrule/website' => 'salesrule_customer_group', - 'sendfriend/sendfriend' => 'sendfriend_log', - 'shipping/tablerate' => 'shipping_tablerate', - 'sitemap/sitemap' => 'sitemap', - 'strikeiron/tax_rate' => 'strikeiron_tax_rate', - 'tax/sales_order_tax' => 'sales_order_tax', - 'tax/sales_order_tax_item' => 'sales_order_tax_item', - 'tax/tax_calculation' => 'tax_calculation', - 'tax/tax_calculation_rate' => 'tax_calculation_rate', - 'tax/tax_calculation_rate_title' => 'tax_calculation_rate_title', - 'tax/tax_calculation_rule' => 'tax_calculation_rule', - 'tax/tax_class' => 'tax_class', - 'tax/tax_order_aggregated_created' => 'tax_order_aggregated_created', - 'tax/tax_order_aggregated_updated' => 'tax_order_aggregated_updated', - 'weee/tax' => 'weee_tax', - 'widget/widget' => 'widget', - 'widget/widget_instance' => 'widget_instance', - 'widget/widget_instance_page' => 'widget_instance_page', - 'widget/widget_instance_page_layout' => 'widget_instance_page_layout', - 'wishlist/item' => 'wishlist_item', - 'wishlist/item_option' => 'wishlist_item_option', - 'wishlist/wishlist' => 'wishlist' -]; diff --git a/dev/tools/Magento/Tools/Migration/get_aliases_map.php b/dev/tools/Magento/Tools/Migration/get_aliases_map.php deleted file mode 100644 index d1abe748f9204b671afa01cb8fd07e8100f9b3bb..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/get_aliases_map.php +++ /dev/null @@ -1,177 +0,0 @@ -<?php -/** - * Automated replacement of factory names into real ones and put result information into file - * - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -define( - 'USAGE', -<<<USAGE -$>./get_aliases_map.php -- [-ph] - Build Magento 1 Aliases To Magento 2 Classes Names. - Additional parameters: - -p path to code scope of magento instance - -h print usage - -USAGE -); - -$options = getopt('p:h'); - -if (isset($options['h'])) { - echo USAGE; - exit(0); -} - -require_once realpath( - dirname(dirname(dirname(dirname(dirname(__DIR__))))) -) . '/dev/tests/static/framework/bootstrap.php'; -require_once realpath(dirname(dirname(dirname(dirname(dirname(__DIR__)))))) . '/lib/internal/Zend/Json.php'; - -$magentoBaseDir = dirname(__DIR__) . '/../../../../'; -if (isset($options['p'])) { - $magentoBaseDir = $options['p']; -} - -$utilityFiles = new Magento\Framework\App\Utility\Files($magentoBaseDir); -$map = []; -$compositeModules = getFilesCombinedArray(__DIR__ . '/aliases_map', '/^composite_modules_.*\.php$/'); -// PHP code -foreach ($utilityFiles->getPhpFiles(true, true, true, false, false) as $file) { - $content = file_get_contents($file); - $classes = \Magento\Framework\App\Utility\Classes::collectPhpCodeClasses($content); - if ($classes) { - $factoryNames = array_filter($classes, 'isFactoryName'); - foreach ($factoryNames as $factoryName) { - list($module, $name) = getModuleName($factoryName, $compositeModules); - $patterns = [ - '::getModel(\'%s\'' => 'Model', - '::getSingleton(\'%s\'' => 'Model', - '::getResourceModel(\'%s\'' => 'Model_Resource', - '::getResourceSingleton(\'%s\'' => 'Model_Resource', - 'addBlock(\'%s\'' => 'Block', - 'createBlock(\'%s\'' => 'Block', - 'getBlockClassName(\'%s\'' => 'Block', - 'getBlockSingleton(\'%s\'' => 'Block', - ]; - - foreach ($patterns as $pattern => $classType) { - if (isPatternExist($content, $pattern, $factoryName)) { - if (!isset($map[$classType])) { - $map[$classType] = []; - } - - $map[$classType][$factoryName] = getClassName($module, $classType, $name); - } - } - } - } -} - -// layouts -$classType = 'Block'; -$layouts = $utilityFiles->getLayoutFiles([], false); -foreach ($layouts as $file) { - $xml = simplexml_load_file($file); - $classes = \Magento\Framework\App\Utility\Classes::collectLayoutClasses($xml); - $factoryNames = array_filter($classes, 'isFactoryName'); - if (!$factoryNames) { - continue; - } - foreach ($factoryNames as $factoryName) { - list($module, $name) = getModuleName($factoryName, $compositeModules); - $map[$classType][$factoryName] = getClassName($module, $classType, $name); - } -} - -echo Zend_Json::prettyPrint(Zend_Json::encode($map)); - -/** - * Get combined array from similar files by pattern - * - * @param string $dirPath - * @param string $filePattern - * @return array - */ -function getFilesCombinedArray($dirPath, $filePattern) -{ - $result = []; - $directoryIterator = new DirectoryIterator($dirPath); - $patternIterator = new RegexIterator($directoryIterator, $filePattern); - - foreach ($patternIterator as $fileInfo) { - $arrayFromFile = include_once $fileInfo->getPathname(); - $result = array_merge($result, $arrayFromFile); - } - return $result; -} - -/** - * Check if pattern exist in file content - * - * @param string $content - * @param string $pattern - * @param string $alias - * @return bool - */ -function isPatternExist($content, $pattern, $alias) -{ - $search = sprintf($pattern, $alias); - return strpos($content, $search) !== false; -} - -/** - * Build class name supported in magento 2 - * - * @param string $module - * @param string $type - * @param string $name - * @return string|bool - */ -function getClassName($module, $type, $name = null) -{ - if (empty($name)) { - if ('Helper' !== $type) { - return false; - } - $name = 'data'; - } - - return implode('_', array_map('ucfirst', explode('_', $module . '_' . $type . '_' . $name))); -} - -/** - * Whether the given class name is a factory name - * - * @param string $class - * @return bool - */ -function isFactoryName($class) -{ - return false !== strpos($class, '/') || preg_match('/^[a-z\d]+(_[A-Za-z\d]+)?$/', $class); -} - -/** - * Transform factory name into a pair of module and name - * - * @param string $factoryName - * @param array $compositeModules - * @return array - */ -function getModuleName($factoryName, $compositeModules = []) -{ - if (false !== strpos($factoryName, '/')) { - list($module, $name) = explode('/', $factoryName); - } else { - $module = $factoryName; - $name = false; - } - if (array_key_exists($module, $compositeModules)) { - $module = $compositeModules[$module]; - } elseif (false === strpos($module, '_')) { - $module = "Magento_{$module}"; - } - return [$module, $name]; -} diff --git a/dev/tools/Magento/Tools/Migration/system_config.php b/dev/tools/Magento/Tools/Migration/system_config.php deleted file mode 100644 index 6fc6fb1ed1aa5f00d669468b81f7da83ae7b23f6..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/system_config.php +++ /dev/null @@ -1,72 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -use Magento\Tools\Migration\System\Configuration\Formatter; -use Magento\Tools\Migration\System\Configuration\Generator; -use Magento\Tools\Migration\System\Configuration\Logger as Logger; -use Magento\Tools\Migration\System\Configuration\Mapper; -use Magento\Tools\Migration\System\Configuration\Mapper\Field; -use Magento\Tools\Migration\System\Configuration\Mapper\Group; -use Magento\Tools\Migration\System\Configuration\Mapper\Section; -use Magento\Tools\Migration\System\Configuration\Mapper\Tab; -use Magento\Tools\Migration\System\Configuration\Parser; -use Magento\Tools\Migration\System\Configuration\Reader; -use Magento\Tools\Migration\System\FileManager; -use Magento\Tools\Migration\System\Writer\Factory; - -$rootDir = realpath(__DIR__ . '../../../../../../'); - -require __DIR__ . '/../../../../../app/autoload.php'; -\Magento\Framework\Filesystem\FileResolver::addIncludePath([$rootDir . '/lib', $rootDir . '/dev']); - -$defaultReportFile = 'report.log'; - -try { - $options = new \Zend_Console_Getopt( - [ - 'mode|w' => "Application mode. Preview mode is default. If set to 'write' - file system is updated", - 'output|f-w' => "Report output type. Report is flushed to console by default." . - "If set to 'file', report is written to file /log/report.log", - ] - ); - - $writerFactory = new Factory(); - - $fileManager = new FileManager( - new \Magento\Tools\Migration\System\FileReader(), - $writerFactory->getWriter($options->getOption('mode')) - ); - - $loggerFactory = new Logger\Factory(); - $logger = $loggerFactory->getLogger($options->getOption('output'), $defaultReportFile, $fileManager); - - $generator = new Generator( - new Formatter(), - $fileManager, - $logger - ); - - $fieldMapper = new Field(); - $groupMapper = new Group($fieldMapper); - $sectionMapper = new Section($groupMapper); - $tabMapper = new Tab(); - $mapper = new Mapper($tabMapper, $sectionMapper); - - $parser = new Parser(); - $reader = new Reader($fileManager, $parser, $mapper); - - foreach ($reader->getConfiguration() as $file => $config) { - $generator->createConfiguration($file, $config); - $fileManager->remove($file); - } - $logger->report(); -} catch (\Zend_Console_Getopt_Exception $e) { - echo $e->getUsageMessage(); - exit; -} catch (InvalidArgumentException $exp) { - echo $exp->getMessage(); -} catch (Exception $exp) { - echo $exp->getMessage(); -} diff --git a/dev/tools/Magento/Tools/Migration/themes_view.php b/dev/tools/Magento/Tools/Migration/themes_view.php deleted file mode 100644 index a35394e615399f71cada87be6fd575f747599238..0000000000000000000000000000000000000000 --- a/dev/tools/Magento/Tools/Migration/themes_view.php +++ /dev/null @@ -1,92 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -require_once __DIR__ . '/../../../../../app/bootstrap.php'; -$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER); -try { - $objectManager = $bootstrap->getObjectManager(); - /** @var $configModel \Magento\Framework\App\Config\ReinitableConfigInterface */ - $configModel = $objectManager->get('Magento\Framework\App\Config\ReinitableConfigInterface'); - $configModel->reinit(); - $config = []; - - foreach (glob(__DIR__ . '/AliasesMap/cms_content_tables_*.php', GLOB_BRACE) as $configFile) { - $config = array_merge($config, include $configFile); - } - - foreach ($config as $table => $field) { - updateFieldForTable($objectManager, $table, $field); - } -} catch (\Exception $e) { - echo "Make sure that you launch this script with Magento 2 configured sources. \n\n"; - echo $e->getMessage(); -} - -/** - * Replace {{skin url=""}} with {{view url=""}} for given table field - * - * @param \Magento\Framework\ObjectManagerInterface $objectManager - * @param string $table - * @param string $col - * @return void - */ -function updateFieldForTable($objectManager, $table, $col) -{ - /** @var $installer \Magento\Framework\Setup\ModuleDataSetupInterface */ - $installer = $objectManager->create('\Magento\Framework\Setup\ModuleDataSetupInterface'); - $installer->startSetup(); - - $table = $installer->getTable($table); - echo '-----' . "\n"; - if ($installer->getConnection()->isTableExists($table)) { - echo 'Table `' . $table . "` processed\n"; - - $indexList = $installer->getConnection()->getIndexList($table); - $pkField = array_shift($indexList[$installer->getConnection()->getPrimaryKeyName($table)]['fields']); - /** @var $select \Magento\Framework\DB\Select */ - $select = $installer->getConnection()->select()->from($table, ['id' => $pkField, 'content' => $col]); - $result = $installer->getConnection()->fetchPairs($select); - - echo 'Records count: ' . count($result) . ' in table: `' . $table . "`\n"; - - $logMessages = []; - foreach ($result as $recordId => $string) { - $content = str_replace('{{skin', '{{view', $string, $count); - if ($count) { - $installer->getConnection()->update( - $table, - [$col => $content], - $installer->getConnection()->quoteInto($pkField . '=?', $recordId) - ); - $logMessages['replaced'][] = 'Replaced -- Id: ' . $recordId . ' in table `' . $table . '`'; - } else { - $logMessages['skipped'][] = 'Skipped -- Id: ' . $recordId . ' in table `' . $table . '`'; - } - } - if (count($result)) { - printLog($logMessages); - } - } else { - echo 'Table `' . $table . "` was not found\n"; - } - $installer->endSetup(); - echo '-----' . "\n"; -} - -/** - * Print array of messages - * - * @param array $logMessages - * @return void - */ -function printLog($logMessages) -{ - foreach ($logMessages as $stringsArray) { - echo "\n"; - echo implode("\n", $stringsArray); - echo "\n"; - } -} diff --git a/lib/internal/Magento/Framework/Acl/Resource/Config/SchemaLocator.php b/lib/internal/Magento/Framework/Acl/Resource/Config/SchemaLocator.php index cb727e4bd28394e794135bf05e3bd44af7c4a15e..b431fc1c8159ff56faaa9c24dce4d48b15753805 100644 --- a/lib/internal/Magento/Framework/Acl/Resource/Config/SchemaLocator.php +++ b/lib/internal/Magento/Framework/Acl/Resource/Config/SchemaLocator.php @@ -9,6 +9,14 @@ namespace Magento\Framework\Acl\Resource\Config; class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface { + /** @var \Magento\Framework\Config\Dom\UrnResolver */ + protected $urnResolver; + + public function __construct(\Magento\Framework\Config\Dom\UrnResolver $urnResolver) + { + $this->urnResolver = $urnResolver; + } + /** * Get path to merged config schema * @@ -16,7 +24,7 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface */ public function getSchema() { - return realpath(__DIR__ . '/../../etc/acl.xsd'); + return $this->urnResolver->getRealPath('urn:magento:framework:Acl/etc/acl.xsd'); } /** diff --git a/lib/internal/Magento/Framework/Acl/Test/Unit/Resource/Config/Converter/_files/valid_acl.xml b/lib/internal/Magento/Framework/Acl/Test/Unit/Resource/Config/Converter/_files/valid_acl.xml index fdf0062c4583379168539bf2ce893844dae7683f..e71a8453f14991f8bb76e3f19ebeedefd84f865c 100644 --- a/lib/internal/Magento/Framework/Acl/Test/Unit/Resource/Config/Converter/_files/valid_acl.xml +++ b/lib/internal/Magento/Framework/Acl/Test/Unit/Resource/Config/Converter/_files/valid_acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <!-- commented text --> diff --git a/lib/internal/Magento/Framework/Acl/Test/Unit/Resource/Config/SchemaLocatorTest.php b/lib/internal/Magento/Framework/Acl/Test/Unit/Resource/Config/SchemaLocatorTest.php new file mode 100644 index 0000000000000000000000000000000000000000..04194883e292efafc0e3da9122d610d7a013fd17 --- /dev/null +++ b/lib/internal/Magento/Framework/Acl/Test/Unit/Resource/Config/SchemaLocatorTest.php @@ -0,0 +1,25 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Framework\Acl\Test\Unit\Resource\Config; + +class SchemaLocatorTest extends \PHPUnit_Framework_TestCase +{ + public function testGetSchema() + { + $urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + /** @var \Magento\Framework\Config\Dom\UrnResolver $urnResolverMock */ + $urnResolverMock = $this->getMock('Magento\Framework\Config\Dom\UrnResolver', [], [], '', false); + $urnResolverMock->expects($this->once()) + ->method('getRealPath') + ->with('urn:magento:framework:Acl/etc/acl.xsd') + ->willReturn($urnResolver->getRealPath('urn:magento:framework:Acl/etc/acl.xsd')); + $schemaLocator = new \Magento\Framework\Acl\Resource\Config\SchemaLocator($urnResolverMock); + $this->assertEquals( + $urnResolver->getRealPath('urn:magento:framework:Acl/etc/acl.xsd'), + $schemaLocator->getSchema() + ); + } +} diff --git a/lib/internal/Magento/Framework/Acl/Test/Unit/Resource/Config/XsdTest.php b/lib/internal/Magento/Framework/Acl/Test/Unit/Resource/Config/XsdTest.php index 32e950030aac177d2934c6093c84af440f0efd9b..13d8ee4e086eb7da4592e761606614fe6b1bba05 100644 --- a/lib/internal/Magento/Framework/Acl/Test/Unit/Resource/Config/XsdTest.php +++ b/lib/internal/Magento/Framework/Acl/Test/Unit/Resource/Config/XsdTest.php @@ -19,13 +19,15 @@ class XsdTest extends \PHPUnit_Framework_TestCase protected $_xsdSchema; /** - * @var \Magento\TestFramework\Utility\XsdValidator + * @var \Magento\Framework\TestFramework\Unit\Utility\XsdValidator */ protected $_xsdValidator; protected function setUp() { - $this->_schemaLocator = new \Magento\Framework\Acl\Resource\Config\SchemaLocator(); + $this->_schemaLocator = new \Magento\Framework\Acl\Resource\Config\SchemaLocator( + new \Magento\Framework\Config\Dom\UrnResolver() + ); $this->_xsdSchema = $this->_schemaLocator->getSchema(); $this->_xsdValidator = new \Magento\Framework\TestFramework\Unit\Utility\XsdValidator(); } diff --git a/lib/internal/Magento/Framework/Acl/Test/Unit/Resource/Config/_files/invalidAclXmlArray.php b/lib/internal/Magento/Framework/Acl/Test/Unit/Resource/Config/_files/invalidAclXmlArray.php index 47127bb6e36937c80665ab7dd3c7ce2f5ad348d0..5f805f6316c47620a6fee42f6bb8831dd1985d6f 100644 --- a/lib/internal/Magento/Framework/Acl/Test/Unit/Resource/Config/_files/invalidAclXmlArray.php +++ b/lib/internal/Magento/Framework/Acl/Test/Unit/Resource/Config/_files/invalidAclXmlArray.php @@ -7,31 +7,34 @@ return [ 'disabled_attribute_empty_value' => [ '<?xml version="1.0"?><config><acl><resources><resource id="Test_Value::show_toolbar" ' . 'disabled=""/></resources></acl></config>', - ["Element 'resource', attribute 'disabled': '' is not a valid value of the atomic type 'xs:boolean'."], + [ + "Element 'resource', attribute 'disabled': '' is not a valid value of the atomic" . + " type 'xs:boolean'.\nLine: 1\n"], ], 'disabled_attribute_wrong_type_value' => [ '<?xml version="1.0"?><config><acl><resources><resource id="Test_Value::show_toolbar" ' . 'disabled="notBool"/></resources></acl></config>', [ "Element 'resource', attribute 'disabled': 'notBool' is not a valid value of the atomic type " . - "'xs:boolean'." + "'xs:boolean'.\nLine: 1\n" ], ], 'double_acl' => [ '<?xml version="1.0"?><config><acl><resources></resources></acl><acl/></config>', - ["Element 'acl': This element is not expected."], + ["Element 'acl': This element is not expected.\nLine: 1\n"], ], 'double_resource' => [ '<?xml version="1.0"?><config><acl><resources></resources><resources></resources></acl></config>', - ["Element 'resources': This element is not expected."], + ["Element 'resources': This element is not expected.\nLine: 1\n"], ], 'less_minLength_title_attribute' => [ '<?xml version="1.0"?><config><acl><resources><resource id="Test_Value::show_toolbar" ' . 'title="Sh"/></resources></acl></config>', [ "Element 'resource', attribute 'title': [facet 'minLength'] The value 'Sh' has a length of '2'; " . - "this underruns the allowed minimum length of '3'.", - "Element 'resource', attribute 'title': 'Sh' is not a valid value of the atomic type 'typeTitle'." + "this underruns the allowed minimum length of '3'.\nLine: 1\n", + "Element 'resource', attribute 'title': 'Sh' is not a valid value of the atomic type" . + " 'typeTitle'.\nLine: 1\n" ], ], 'more_maxLength_title_attribute' => [ @@ -39,9 +42,10 @@ return [ ' title="Lorem ipsum dolor sit amet, consectetur adipisicing"/></resources></acl></config>', [ "Element 'resource', attribute 'title': [facet 'maxLength'] The value 'Lorem ipsum dolor sit amet, " . - "consectetur adipisicing' has a length of '51'; this exceeds the allowed maximum length of '50'.", + "consectetur adipisicing' has a length of '51'; this exceeds the allowed maximum" . + " length of '50'.\nLine: 1\n", "Element 'resource', attribute 'title': 'Lorem ipsum dolor sit amet, consectetur adipisicing' is not " . - "a valid value of the atomic type 'typeTitle'." + "a valid value of the atomic type 'typeTitle'.\nLine: 1\n" ], ], 'notvalid_id_attribute_value_regexp1' => [ @@ -49,12 +53,13 @@ return [ '</resources></acl></config>', [ "Element 'resource', attribute 'id': [facet 'pattern'] The value 'test_Value::show_toolbar' is " . - "not accepted by the pattern '([A-Z]+[a-zA-Z0-9]{1,}){1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.", + "not accepted by the pattern" . + " '([A-Z]+[a-zA-Z0-9]{1,}){1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.\nLine: 1\n", "Element 'resource', attribute 'id': 'test_Value::show_toolbar' is not a valid value of the atomic type " . - "'typeId'.", + "'typeId'.\nLine: 1\n", "Element 'resource', attribute 'id': Warning: No precomputed value available, " . "the value was either invalid or " . - "something strange happend." + "something strange happend.\nLine: 1\n" ], ], 'notvalid_id_attribute_value_regexp2' => [ @@ -62,12 +67,11 @@ return [ '</resources></acl></config>', [ "Element 'resource', attribute 'id': [facet 'pattern'] The value 'Test_value::show_toolbar' is not " . - "accepted by the pattern '([A-Z]+[a-zA-Z0-9]{1,}){1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.", + "accepted by the pattern '([A-Z]+[a-zA-Z0-9]{1,}){1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.\nLine: 1\n", "Element 'resource', attribute 'id': 'Test_value::show_toolbar' is not a valid value of the atomic type " . - "'typeId'.", + "'typeId'.\nLine: 1\n", "Element 'resource', attribute 'id': Warning: No precomputed value available, " . - "the value was either invalid " . - "or something strange happend." + "the value was either invalid or something strange happend.\nLine: 1\n" ], ], 'notvalid_id_attribute_value_regexp3' => [ @@ -75,13 +79,11 @@ return [ '</resources></acl></config>', [ "Element 'resource', attribute 'id': [facet 'pattern'] The value 'M@#$%^*_Value::show_toolbar' is not " . - "accepted by the pattern '([A-Z]+[a-zA-Z0-9]{1,}){1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.", + "accepted by the pattern '([A-Z]+[a-zA-Z0-9]{1,}){1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.\nLine: 1\n", "Element 'resource', attribute 'id': 'M@#$%^*_Value::show_toolbar' " . - "is not a valid value of the atomic type " . - "'typeId'.", + "is not a valid value of the atomic type 'typeId'.\nLine: 1\n", "Element 'resource', attribute 'id': Warning: No precomputed value available, " . - "the value was either invalid " . - "or something strange happend." + "the value was either invalid or something strange happend.\nLine: 1\n" ], ], 'notvalid_id_attribute_value_regexp4' => [ @@ -89,12 +91,12 @@ return [ '</resources></acl></config>', [ "Element 'resource', attribute 'id': [facet 'pattern'] The value '_Value::show_toolbar' is not " . - "accepted by the pattern '([A-Z]+[a-zA-Z0-9]{1,}){1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.", + "accepted by the pattern '([A-Z]+[a-zA-Z0-9]{1,}){1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.\nLine: 1\n", "Element 'resource', attribute 'id': '_Value::show_toolbar' " . - "is not a valid value of the atomic type 'typeId'.", + "is not a valid value of the atomic type 'typeId'.\nLine: 1\n", "Element 'resource', attribute 'id': " . "Warning: No precomputed value available, the value was either invalid " . - "or something strange happend." + "or something strange happend.\nLine: 1\n" ], ], 'notvalid_id_attribute_value_regexp5' => [ @@ -102,12 +104,12 @@ return [ '</acl></config>', [ "Element 'resource', attribute 'id': [facet 'pattern'] The value 'Value_::show_toolbar' is not " . - "accepted by the pattern '([A-Z]+[a-zA-Z0-9]{1,}){1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.", + "accepted by the pattern '([A-Z]+[a-zA-Z0-9]{1,}){1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.\nLine: 1\n", "Element 'resource', attribute 'id': 'Value_::show_toolbar' " . - "is not a valid value of the atomic type 'typeId'.", + "is not a valid value of the atomic type 'typeId'.\nLine: 1\n", "Element 'resource', attribute 'id': " . "Warning: No precomputed value available, the value was either invalid " . - "or something strange happend." + "or something strange happend.\nLine: 1\n" ], ], 'notvalid_id_attribute_value_regexp6' => [ @@ -115,23 +117,24 @@ return [ '</resources></acl></config>', [ "Element 'resource', attribute 'id': [facet 'pattern'] The value 'Test_value:show_toolbar' is not " . - "accepted by the pattern '([A-Z]+[a-zA-Z0-9]{1,}){1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.", + "accepted by the pattern '([A-Z]+[a-zA-Z0-9]{1,}){1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.\nLine: 1\n", "Element 'resource', attribute 'id': 'Test_value:show_toolbar' is not a valid value of the atomic " . - "type 'typeId'.", + "type 'typeId'.\nLine: 1\n", "Element 'resource', attribute 'id': " . "Warning: No precomputed value available, the value was either invalid " . - "or something strange happend." + "or something strange happend.\nLine: 1\n" ], ], 'notvalid_id_attribute_value_regexp7' => [ '<?xml version="1.0"?><config><acl><resources><resource id="Test_Value::"/></resources>' . '</acl></config>', [ "Element 'resource', attribute 'id': [facet 'pattern'] The value 'Test_Value::' is not accepted by " . - "the pattern '([A-Z]+[a-zA-Z0-9]{1,}){1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.", - "Element 'resource', attribute 'id': 'Test_Value::' is not a valid value of the atomic type 'typeId'.", + "the pattern '([A-Z]+[a-zA-Z0-9]{1,}){1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.\nLine: 1\n", + "Element 'resource', attribute 'id': 'Test_Value::' is not a valid value of the atomic type" . + " 'typeId'.\nLine: 1\n", "Element 'resource', attribute 'id': " . "Warning: No precomputed value available, the value was either invalid " . - "or something strange happend." + "or something strange happend.\nLine: 1\n" ], ], 'sortOrder_attribute_empty_value' => [ @@ -139,18 +142,18 @@ return [ 'title="Lorem ipsum" sortOrder="stringValue"/></resources></acl></config>', [ "Element 'resource', attribute 'sortOrder': 'stringValue' is not a valid value of the atomic " . - "type 'xs:int'." + "type 'xs:int'.\nLine: 1\n" ], ], 'sortOrder_attribute_wrong_type_value' => [ '<?xml version="1.0"?><config><acl><resources><resource id="Test_Value::show_toolbar" ' . 'title="Lorem ipsum" sortOrder=""/></resources></acl></config>', - ["Element 'resource', attribute 'sortOrder': '' is not a valid value of the atomic type 'xs:int'."], + ["Element 'resource', attribute 'sortOrder': '' is not a valid value of the atomic type 'xs:int'.\nLine: 1\n"], ], 'with_not_allowed_attribute' => [ '<?xml version="1.0"?><config><acl><resources><resource id="Test_Value::show_toolbar" ' . 'someatrrname="some value"/></resources></acl></config>', - ["Element 'resource', attribute 'someatrrname': The attribute 'someatrrname' is not allowed."], + ["Element 'resource', attribute 'someatrrname': The attribute 'someatrrname' is not allowed.\nLine: 1\n"], ], 'with_two_same_id' => [ '<?xml version="1.0"?><config><acl><resources><resource id="Test_Value::show_toolbar" ' . @@ -158,19 +161,19 @@ return [ '</resources></acl></config>', [ "Element 'resource': Duplicate key-sequence ['Test_Value::show_toolbar'] in unique identity-constraint " . - "'uniqueResourceId'." + "'uniqueResourceId'.\nLine: 1\n" ], ], 'without_acl' => [ '<?xml version="1.0"?><config/>', - ["Element 'config': Missing child element(s). Expected is ( acl )."], + ["Element 'config': Missing child element(s). Expected is ( acl ).\nLine: 1\n"], ], 'without_required_id_attribute' => [ '<?xml version="1.0"?><config><acl><resources><resource title="Notifications"/></resources></acl></config>', - ["Element 'resource': The attribute 'id' is required but missing."], + ["Element 'resource': The attribute 'id' is required but missing.\nLine: 1\n"], ], 'without_resource' => [ '<?xml version="1.0"?><config><acl/></config>', - ["Element 'acl': Missing child element(s). Expected is ( resources )."], + ["Element 'acl': Missing child element(s). Expected is ( resources ).\nLine: 1\n"], ] ]; diff --git a/lib/internal/Magento/Framework/Acl/Test/Unit/Resource/Config/_files/valid_acl.xml b/lib/internal/Magento/Framework/Acl/Test/Unit/Resource/Config/_files/valid_acl.xml index b2efe77d4fae381137a356f4b1b5d7640f69e1f5..1f00c8a128a91da0c3811ef62d377fbd2afbdf63 100644 --- a/lib/internal/Magento/Framework/Acl/Test/Unit/Resource/Config/_files/valid_acl.xml +++ b/lib/internal/Magento/Framework/Acl/Test/Unit/Resource/Config/_files/valid_acl.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> <acl> <resources> <resource id="Test_Value::show_toolbar" title="Lorem ipsum" sortOrder="12"> diff --git a/lib/internal/Magento/Framework/Api/ExtensionAttribute/Config/SchemaLocator.php b/lib/internal/Magento/Framework/Api/ExtensionAttribute/Config/SchemaLocator.php index a6fa7a9d8798f2b132923e9b862f4356aa94376b..320d8a77d877a36fabfb04c8964ec4a88da0d243 100644 --- a/lib/internal/Magento/Framework/Api/ExtensionAttribute/Config/SchemaLocator.php +++ b/lib/internal/Magento/Framework/Api/ExtensionAttribute/Config/SchemaLocator.php @@ -9,6 +9,14 @@ namespace Magento\Framework\Api\ExtensionAttribute\Config; class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface { + /** @var \Magento\Framework\Config\Dom\UrnResolver */ + protected $urnResolver; + + public function __construct(\Magento\Framework\Config\Dom\UrnResolver $urnResolver) + { + $this->urnResolver = $urnResolver; + } + /** * Get path to merged config schema * @@ -16,7 +24,7 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface */ public function getSchema() { - return realpath(__DIR__ . '/../../etc/extension_attributes.xsd'); + return $this->urnResolver->getRealPath('urn:magento:framework:Api/etc/extension_attributes.xsd'); } /** diff --git a/lib/internal/Magento/Framework/Api/Test/Unit/Api/ImageContentValidatorTest.php b/lib/internal/Magento/Framework/Api/Test/Unit/Api/ImageContentValidatorTest.php index 4134d8ec39c233026cda8db72ca489dafe50555d..3004c9f1309d528295b2ae871ebdd45ef24b1fb3 100644 --- a/lib/internal/Magento/Framework/Api/Test/Unit/Api/ImageContentValidatorTest.php +++ b/lib/internal/Magento/Framework/Api/Test/Unit/Api/ImageContentValidatorTest.php @@ -67,7 +67,7 @@ class ImageContentValidatorTest extends \PHPUnit_Framework_TestCase */ public function testIsValidInvalidMIMEType() { - $pathToImageFile = BP . '/app/code/Magento/Eav/Test/Unit/Model/Attribute/Data/_files/image.jpg'; + $pathToImageFile = __DIR__ . '/_files/image.jpg'; $encodedData = @base64_encode(file_get_contents($pathToImageFile)); $imageContent = $this->getMockBuilder('Magento\Framework\Api\Data\ImageContentInterface') @@ -89,7 +89,7 @@ class ImageContentValidatorTest extends \PHPUnit_Framework_TestCase */ public function testIsValidInvalidName() { - $pathToImageFile = BP . '/app/code/Magento/Eav/Test/Unit/Model/Attribute/Data/_files/image.jpg'; + $pathToImageFile = __DIR__ . '/_files/image.jpg'; $encodedData = @base64_encode(file_get_contents($pathToImageFile)); $imageContent = $this->getMockBuilder('Magento\Framework\Api\Data\ImageContentInterface') @@ -110,7 +110,7 @@ class ImageContentValidatorTest extends \PHPUnit_Framework_TestCase public function testIsValid() { - $pathToImageFile = BP . '/app/code/Magento/Eav/Test/Unit/Model/Attribute/Data/_files/image.jpg'; + $pathToImageFile = __DIR__ . '/_files/image.jpg'; $encodedData = @base64_encode(file_get_contents($pathToImageFile)); $imageContent = $this->getMockBuilder('Magento\Framework\Api\Data\ImageContentInterface') diff --git a/lib/internal/Magento/Framework/Api/Test/Unit/Api/_files/image.jpg b/lib/internal/Magento/Framework/Api/Test/Unit/Api/_files/image.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f8e1802e54465b1b3c22ed78fe1514482e6d5e0d Binary files /dev/null and b/lib/internal/Magento/Framework/Api/Test/Unit/Api/_files/image.jpg differ diff --git a/lib/internal/Magento/Framework/Api/Test/Unit/ExtensionAttribute/Config/SchemaLocatorTest.php b/lib/internal/Magento/Framework/Api/Test/Unit/ExtensionAttribute/Config/SchemaLocatorTest.php index d3cf12de695450e9a5b5e053e7c01e093df76d8f..af6fab44b9ecdd6a868659a32fa609be821d14f0 100644 --- a/lib/internal/Magento/Framework/Api/Test/Unit/ExtensionAttribute/Config/SchemaLocatorTest.php +++ b/lib/internal/Magento/Framework/Api/Test/Unit/ExtensionAttribute/Config/SchemaLocatorTest.php @@ -13,24 +13,38 @@ class SchemaLocatorTest extends \PHPUnit_Framework_TestCase /** * @var \Magento\Framework\Api\ExtensionAttribute\Config\SchemaLocator */ - protected $_model; + protected $model; + + /** @var \Magento\Framework\Config\Dom\UrnResolver $urnResolverMock */ + protected $urnResolver; protected function setUp() { - $this->_model = new \Magento\Framework\Api\ExtensionAttribute\Config\SchemaLocator(); + $this->urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + /** @var \Magento\Framework\Config\Dom\UrnResolver $urnResolverMock */ + $urnResolverMock = $this->getMock('Magento\Framework\Config\Dom\UrnResolver', [], [], '', false); + $urnResolverMock->expects($this->once()) + ->method('getRealPath') + ->with('urn:magento:framework:Api/etc/extension_attributes.xsd') + ->willReturn( + $this->urnResolver->getRealPath('urn:magento:framework:Api/etc/extension_attributes.xsd') + ); + $this->model = new \Magento\Framework\Api\ExtensionAttribute\Config\SchemaLocator($urnResolverMock); } public function testGetSchema() { - $expected = str_replace('\\', '/', BP . '/lib/internal/Magento/Framework/Api/etc/extension_attributes.xsd'); - $actual = str_replace('\\', '/', $this->_model->getSchema()); - $this->assertEquals($expected, $actual); + $this->assertEquals( + $this->urnResolver->getRealPath('urn:magento:framework:Api/etc/extension_attributes.xsd'), + $this->model->getSchema() + ); } public function testGetPerFileSchema() { - $actual = str_replace('\\', '/', $this->_model->getPerFileSchema()); - $expected = str_replace('\\', '/', BP . '/lib/internal/Magento/Framework/Api/etc/extension_attributes.xsd'); - $this->assertEquals($expected, $actual); + $this->assertEquals( + $this->urnResolver->getRealPath('urn:magento:framework:Api/etc/extension_attributes.xsd'), + $this->model->getPerFileSchema() + ); } } diff --git a/lib/internal/Magento/Framework/Api/Test/Unit/ExtensionAttribute/Config/XsdTest.php b/lib/internal/Magento/Framework/Api/Test/Unit/ExtensionAttribute/Config/XsdTest.php index 9dab40a9ad26cae94f41b13f15770c4304257efa..90658f3120bed36b6cda7600c07caa24d3e84787 100644 --- a/lib/internal/Magento/Framework/Api/Test/Unit/ExtensionAttribute/Config/XsdTest.php +++ b/lib/internal/Magento/Framework/Api/Test/Unit/ExtensionAttribute/Config/XsdTest.php @@ -14,7 +14,8 @@ class XsdTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_schemaFile = BP . '/lib/internal/Magento/Framework/Api/etc/extension_attributes.xsd'; + $urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + $this->_schemaFile = $urnResolver->getRealPath('urn:magento:framework:Api/etc/extension_attributes.xsd'); } /** diff --git a/lib/internal/Magento/Framework/Api/Test/Unit/ExtensionAttribute/Config/_files/extension_attributes.xml b/lib/internal/Magento/Framework/Api/Test/Unit/ExtensionAttribute/Config/_files/extension_attributes.xml index 20272619db1fb78a9cb4d212d4c57316a78e13f9..5dbaebd4137d380f8224cbe1b7db5a36202714d0 100644 --- a/lib/internal/Magento/Framework/Api/Test/Unit/ExtensionAttribute/Config/_files/extension_attributes.xml +++ b/lib/internal/Magento/Framework/Api/Test/Unit/ExtensionAttribute/Config/_files/extension_attributes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/Api/etc/extension_attributes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> <extension_attributes for="Magento\Tax\Api\Data\TaxRateInterface"> </extension_attributes> <extension_attributes for="Magento\Catalog\Api\Data\ProductInterface"> diff --git a/lib/internal/Magento/Framework/Api/Test/Unit/ExtensionAttribute/Config/_files/extension_attributes_with_join_directives.xml b/lib/internal/Magento/Framework/Api/Test/Unit/ExtensionAttribute/Config/_files/extension_attributes_with_join_directives.xml index baacb34779535867a463cb8feee35b01f246ac41..587019ba753025a3ad2be2d9938cdce48ade46da 100644 --- a/lib/internal/Magento/Framework/Api/Test/Unit/ExtensionAttribute/Config/_files/extension_attributes_with_join_directives.xml +++ b/lib/internal/Magento/Framework/Api/Test/Unit/ExtensionAttribute/Config/_files/extension_attributes_with_join_directives.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/Api/etc/extension_attributes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> <extension_attributes for="Magento\Customer\Api\Data\CustomerInterface"> <attribute code="library_card_id" type="string"> <join reference_table="library_account" diff --git a/lib/internal/Magento/Framework/App/Action/Action.php b/lib/internal/Magento/Framework/App/Action/Action.php index cd6ea1f5b66ba74c3c290515a53f06e9ede9434d..310f2f57d4d8bbfaa7e63769dc0fb28f106506d1 100644 --- a/lib/internal/Magento/Framework/App/Action/Action.php +++ b/lib/internal/Magento/Framework/App/Action/Action.php @@ -47,7 +47,6 @@ abstract class Action extends AbstractAction protected $_redirect; /** - * @deprecated * @var \Magento\Framework\App\ViewInterface */ protected $_view; diff --git a/lib/internal/Magento/Framework/App/Area.php b/lib/internal/Magento/Framework/App/Area.php index 703679c3515bec9b6601dd5567811216a92dad2c..f689003b831bc30a317b7abcb23468af05724a5e 100644 --- a/lib/internal/Magento/Framework/App/Area.php +++ b/lib/internal/Magento/Framework/App/Area.php @@ -16,10 +16,13 @@ use Magento\Framework\ObjectManager\ConfigLoaderInterface; class Area implements \Magento\Framework\App\AreaInterface { const AREA_GLOBAL = 'global'; - const AREA_FRONTEND = 'frontend'; - const AREA_ADMIN = 'admin'; + const AREA_ADMINHTML = 'adminhtml'; + const AREA_DOC = 'doc'; + const AREA_CRONTAB = 'crontab'; + const AREA_WEBAPI_REST = 'webapi_rest'; + const AREA_WEBAPI_SOAP = 'webapi_soap'; /** * Area parameter. diff --git a/lib/internal/Magento/Framework/App/Arguments/FileResolver/Primary.php b/lib/internal/Magento/Framework/App/Arguments/FileResolver/Primary.php index 65697ad42a9bb3393b1e0de5df184754b9b75e0c..230d1609f271d3e5e87815d925271b885f2539c3 100644 --- a/lib/internal/Magento/Framework/App/Arguments/FileResolver/Primary.php +++ b/lib/internal/Magento/Framework/App/Arguments/FileResolver/Primary.php @@ -11,13 +11,6 @@ use Magento\Framework\App\Filesystem\DirectoryList; class Primary implements \Magento\Framework\Config\FileResolverInterface { - /** - * Module configuration file reader - * - * @var \Magento\Framework\Module\Dir\Reader - */ - protected $_moduleReader; - /** * @var \Magento\Framework\Filesystem\Directory\ReadInterface */ @@ -46,9 +39,11 @@ class Primary implements \Magento\Framework\Config\FileResolverInterface */ public function get($filename, $scope) { - return $this->iteratorFactory->create( - $this->configDirectory, - $this->configDirectory->search('{*' . $filename . ',*/*' . $filename . '}') - ); + $configPaths = $this->configDirectory->search('{*' . $filename . ',*/*' . $filename . '}'); + $configAbsolutePaths = []; + foreach ($configPaths as $configPath) { + $configAbsolutePaths[] = $this->configDirectory->getAbsolutePath($configPath); + } + return $this->iteratorFactory->create($configAbsolutePaths); } } diff --git a/lib/internal/Magento/Framework/App/Bootstrap.php b/lib/internal/Magento/Framework/App/Bootstrap.php index 8fff13c5e4c34d80e60ef0622879d376d7efa5c5..a801b8cc99f0d6b4ba8743a03f19e02cb89fc473 100644 --- a/lib/internal/Magento/Framework/App/Bootstrap.php +++ b/lib/internal/Magento/Framework/App/Bootstrap.php @@ -10,6 +10,7 @@ use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\AppInterface; use Magento\Framework\Autoload\AutoloaderRegistry; use Magento\Framework\Autoload\Populator; +use Magento\Framework\Component\ComponentRegistrar; use Magento\Framework\Filesystem\DriverPool; use Magento\Framework\Profiler; use Magento\Framework\Config\File\ConfigFilePool; @@ -134,7 +135,7 @@ class Bootstrap { $dirList = self::createFilesystemDirectoryList($rootDir, $initParams); $autoloadWrapper = AutoloaderRegistry::getAutoloader(); - Populator::populateMappings($autoloadWrapper, $dirList); + Populator::populateMappings($autoloadWrapper, $dirList, new ComponentRegistrar()); } /** diff --git a/lib/internal/Magento/Framework/App/Config/FileResolver.php b/lib/internal/Magento/Framework/App/Config/FileResolver.php index 803ef72b534dc6587dec629f72312b58f2227726..58b629bcd366ca845fa6baf8950799ce3238ece8 100644 --- a/lib/internal/Magento/Framework/App/Config/FileResolver.php +++ b/lib/internal/Magento/Framework/App/Config/FileResolver.php @@ -25,6 +25,13 @@ class FileResolver implements \Magento\Framework\Config\FileResolverInterface */ protected $iteratorFactory; + /** + * Filesystem + * + * @var \Magento\Framework\Filesystem + */ + protected $filesystem; + /** * @param \Magento\Framework\Module\Dir\Reader $moduleReader * @param \Magento\Framework\Filesystem $filesystem @@ -48,10 +55,11 @@ class FileResolver implements \Magento\Framework\Config\FileResolverInterface switch ($scope) { case 'primary': $directory = $this->filesystem->getDirectoryRead(DirectoryList::CONFIG); - $iterator = $this->iteratorFactory->create( - $directory, - $directory->search('{' . $filename . ',*/' . $filename . '}') - ); + $absolutePaths = []; + foreach ($directory->search('{' . $filename . ',*/' . $filename . '}') as $path) { + $absolutePaths[] = $directory->getAbsolutePath($path); + } + $iterator = $this->iteratorFactory->create($absolutePaths); break; case 'global': $iterator = $this->_moduleReader->getConfigurationFiles($filename); diff --git a/lib/internal/Magento/Framework/App/Config/Initial/SchemaLocator.php b/lib/internal/Magento/Framework/App/Config/Initial/SchemaLocator.php index 26141caab2b945e982270d804dfd8c5dbbc946d8..91e4063d3a0f14a143c2a919187862158b307143 100644 --- a/lib/internal/Magento/Framework/App/Config/Initial/SchemaLocator.php +++ b/lib/internal/Magento/Framework/App/Config/Initial/SchemaLocator.php @@ -7,6 +7,8 @@ */ namespace Magento\Framework\App\Config\Initial; +use Magento\Framework\Module\Dir; + class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface { /** @@ -22,7 +24,7 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface */ public function __construct(\Magento\Framework\Module\Dir\Reader $moduleReader, $moduleName) { - $this->_schema = $moduleReader->getModuleDir('etc', $moduleName) . '/config.xsd'; + $this->_schema = $moduleReader->getModuleDir(Dir::MODULE_ETC_DIR, $moduleName) . '/config.xsd'; } /** diff --git a/lib/internal/Magento/Framework/App/Filesystem/DirectoryList.php b/lib/internal/Magento/Framework/App/Filesystem/DirectoryList.php index 64422cb528d82b21631b67118a50fc60695e36ea..157d4d661e932ac7f27c95863390f70885ac1627 100644 --- a/lib/internal/Magento/Framework/App/Filesystem/DirectoryList.php +++ b/lib/internal/Magento/Framework/App/Filesystem/DirectoryList.php @@ -20,16 +20,6 @@ class DirectoryList extends \Magento\Framework\Filesystem\DirectoryList */ const APP = 'app'; - /** - * Modules - */ - const MODULES = 'code'; - - /** - * Themes - */ - const THEMES = 'design'; - /** * Initial configuration of the application */ @@ -45,11 +35,6 @@ class DirectoryList extends \Magento\Framework\Filesystem\DirectoryList */ const LIB_WEB = 'lib_web'; - /** - * Language packages - */ - const LOCALE = 'i18n'; - /** * \Directory within document root of a web-server to access static view files publicly */ @@ -130,7 +115,6 @@ class DirectoryList extends \Magento\Framework\Filesystem\DirectoryList $result = [ self::ROOT => [parent::PATH => ''], self::APP => [parent::PATH => 'app'], - self::MODULES => [parent::PATH => 'app/code'], self::CONFIG => [parent::PATH => 'app/etc'], self::LIB_INTERNAL => [parent::PATH => 'lib/internal'], self::VAR_DIR => [parent::PATH => 'var'], @@ -138,14 +122,12 @@ class DirectoryList extends \Magento\Framework\Filesystem\DirectoryList self::LOG => [parent::PATH => 'var/log'], self::DI => [parent::PATH => 'var/di'], self::GENERATION => [parent::PATH => 'var/generation'], - self::LOCALE => [parent::PATH => 'app/i18n'], self::SESSION => [parent::PATH => 'var/session'], self::MEDIA => [parent::PATH => 'pub/media', parent::URL_PATH => 'pub/media'], self::STATIC_VIEW => [parent::PATH => 'pub/static', parent::URL_PATH => 'pub/static'], self::PUB => [parent::PATH => 'pub', parent::URL_PATH => 'pub'], self::LIB_WEB => [parent::PATH => 'lib/web'], self::TMP => [parent::PATH => 'var/tmp'], - self::THEMES => [parent::PATH => 'app/design'], self::UPLOAD => [parent::PATH => 'pub/media/upload', parent::URL_PATH => 'pub/media/upload'], self::TMP_MATERIALIZATION_DIR => [parent::PATH => 'var/view_preprocessed'], self::TEMPLATE_MINIFICATION_DIR => [parent::PATH => 'var/view_preprocessed/html'], diff --git a/lib/internal/Magento/Framework/App/Helper/AbstractHelper.php b/lib/internal/Magento/Framework/App/Helper/AbstractHelper.php index 64b6ee171207a9a9f12bfd5fd7dfeecefae04f28..2dcd585b591505466e97690cc97f8c1ae130fc84 100644 --- a/lib/internal/Magento/Framework/App/Helper/AbstractHelper.php +++ b/lib/internal/Magento/Framework/App/Helper/AbstractHelper.php @@ -120,7 +120,7 @@ abstract class AbstractHelper * * @param string $moduleName Full module name * @return boolean - * @deprecated use \Magento\Framework\Module\Manager::isOutputEnabled() + * use \Magento\Framework\Module\Manager::isOutputEnabled() */ public function isModuleOutputEnabled($moduleName = null) { diff --git a/lib/internal/Magento/Framework/App/Language/Config.php b/lib/internal/Magento/Framework/App/Language/Config.php index 62c29d8f23b4c85635200af4ba67d6d5028ad579..84dfdfe149cbebd6cc288ee17319895da3d76ffd 100644 --- a/lib/internal/Magento/Framework/App/Language/Config.php +++ b/lib/internal/Magento/Framework/App/Language/Config.php @@ -13,6 +13,9 @@ use Magento\Framework\Config\Dom; */ class Config { + /** @var \Magento\Framework\Config\Dom\UrnResolver */ + protected $urnResolver; + /** * Data extracted from the configuration file * @@ -24,10 +27,14 @@ class Config * Constructor * * @param string $source + * @param \Magento\Framework\Config\Dom\UrnResolver $urnResolver * @throws \Magento\Framework\Exception\LocalizedException */ - public function __construct($source) - { + public function __construct( + $source, + \Magento\Framework\Config\Dom\UrnResolver $urnResolver + ) { + $this->urnResolver = $urnResolver; $config = new \DOMDocument(); $config->loadXML($source); $errors = Dom::validateDomDocument($config, $this->getSchemaFile()); @@ -46,7 +53,7 @@ class Config */ protected function getSchemaFile() { - return __DIR__ . '/package.xsd'; + return $this->urnResolver->getRealPath('urn:magento:framework:App/Language/package.xsd'); } /** diff --git a/lib/internal/Magento/Framework/App/Language/Dictionary.php b/lib/internal/Magento/Framework/App/Language/Dictionary.php index 385e6d7ebf1d4f8d453aaf5ab0651a4b8f541e57..7327b46b5911695fea4bdd5f16c1bda12f32dc68 100644 --- a/lib/internal/Magento/Framework/App/Language/Dictionary.php +++ b/lib/internal/Magento/Framework/App/Language/Dictionary.php @@ -6,8 +6,8 @@ namespace Magento\Framework\App\Language; -use Magento\Framework\App\Filesystem\DirectoryList; -use Magento\Framework\Filesystem; +use Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Filesystem\Directory\ReadFactory; /** * A service for reading language package dictionaries @@ -15,9 +15,25 @@ use Magento\Framework\Filesystem; class Dictionary { /** - * @var \Magento\Framework\Filesystem\Directory\ReadInterface + * Paths of all language packages + * + * @var string[] + */ + private $paths; + + /** + * Creates directory read objects + * + * @var ReadFactory */ - private $dir; + private $directoryReadFactory; + + /** + * Component Registrar + * + * @var ReadFactory + */ + private $componentRegistrar; /** * @var ConfigFactory @@ -30,14 +46,17 @@ class Dictionary private $packList = []; /** - * @param Filesystem $filesystem + * @param ReadFactory $directoryReadFactory + * @param ComponentRegistrar $componentRegistrar * @param ConfigFactory $configFactory */ public function __construct( - Filesystem $filesystem, + ReadFactory $directoryReadFactory, + ComponentRegistrar $componentRegistrar, ConfigFactory $configFactory ) { - $this->dir = $filesystem->getDirectoryRead(DirectoryList::LOCALE); + $this->directoryReadFactory = $directoryReadFactory; + $this->componentRegistrar = $componentRegistrar; $this->configFactory = $configFactory; } @@ -53,13 +72,16 @@ class Dictionary public function getDictionary($languageCode) { $languages = []; - $declarations = $this->dir->search('*/*/language.xml'); - foreach ($declarations as $file) { - $xmlSource = $this->dir->readFile($file); - $languageConfig = $this->configFactory->create(['source' => $xmlSource]); - $this->packList[$languageConfig->getVendor()][$languageConfig->getPackage()] = $languageConfig; - if ($languageConfig->getCode() === $languageCode) { - $languages[] = $languageConfig; + $this->paths = $this->componentRegistrar->getPaths(ComponentRegistrar::LANGUAGE); + foreach ($this->paths as $path) { + $directoryRead = $this->directoryReadFactory->create($path); + if ($directoryRead->isExist('language.xml')) { + $xmlSource = $directoryRead->readFile('language.xml'); + $languageConfig = $this->configFactory->create(['source' => $xmlSource]); + $this->packList[$languageConfig->getVendor()][$languageConfig->getPackage()] = $languageConfig; + if ($languageConfig->getCode() === $languageCode) { + $languages[] = $languageConfig; + } } } @@ -89,21 +111,26 @@ class Dictionary * @param Config $languageConfig * @param array $result * @param int $level + * @param array $visitedPacks * @return void */ - private function collectInheritedPacks($languageConfig, &$result, $level = 0) + private function collectInheritedPacks($languageConfig, &$result, $level = 0, array &$visitedPacks = []) { $packKey = implode('|', [$languageConfig->getVendor(), $languageConfig->getPackage()]); - if (!isset($result[$packKey])) { + if (!isset($visitedPacks[$packKey]) && + (!isset($result[$packKey]) || $result[$packKey]['inheritance_level'] < $level) + ) { + $visitedPacks[$packKey] = true; $result[$packKey] = [ 'inheritance_level' => $level, 'sort_order' => $languageConfig->getSortOrder(), 'language' => $languageConfig, + 'key' => $packKey, ]; foreach ($languageConfig->getUses() as $reuse) { if (isset($this->packList[$reuse['vendor']][$reuse['package']])) { $parentLanguageConfig = $this->packList[$reuse['vendor']][$reuse['package']]; - $this->collectInheritedPacks($parentLanguageConfig, $result, $level + 1); + $this->collectInheritedPacks($parentLanguageConfig, $result, $level + 1, $visitedPacks); } } } @@ -131,7 +158,7 @@ class Dictionary } elseif ($current['sort_order'] < $next['sort_order']) { return -1; } - return 0; + return strcmp($current['key'], $next['key']); } /** @@ -145,13 +172,16 @@ class Dictionary */ private function readPackCsv($vendor, $package) { - $files = $this->dir->search("{$vendor}/{$package}/*.csv"); - sort($files); + $path = $this->componentRegistrar->getPath(ComponentRegistrar::LANGUAGE, strtolower($vendor . '_' . $package)); $result = []; - foreach ($files as $path) { - $file = $this->dir->openFile($path); - while (($row = $file->readCsv()) !== false) { - $result[$row[0]] = $row[1]; + if (isset($path)) { + $directoryRead = $this->directoryReadFactory->create($path); + $foundCsvFiles = $directoryRead->search("*.csv"); + foreach ($foundCsvFiles as $foundCsvFile) { + $file = $directoryRead->openFile($foundCsvFile); + while (($row = $file->readCsv()) !== false) { + $result[$row[0]] = $row[1]; + } } } return $result; diff --git a/lib/internal/Magento/Framework/App/ObjectManagerFactory.php b/lib/internal/Magento/Framework/App/ObjectManagerFactory.php index 0585f359c8e186be55cb045f2a3ffcb073c01737..742221429db1bb039cf2e4a20811b898ab833e8b 100644 --- a/lib/internal/Magento/Framework/App/ObjectManagerFactory.php +++ b/lib/internal/Magento/Framework/App/ObjectManagerFactory.php @@ -253,7 +253,9 @@ class ObjectManagerFactory new \Magento\Framework\Filesystem\Directory\ReadFactory($driverPool), new \Magento\Framework\Filesystem\Directory\WriteFactory($driverPool) ), - new \Magento\Framework\Config\FileIteratorFactory() + new \Magento\Framework\Config\FileIteratorFactory( + new \Magento\Framework\Filesystem\File\ReadFactory(new \Magento\Framework\Filesystem\DriverPool()) + ) ); $schemaLocator = new \Magento\Framework\ObjectManager\Config\SchemaLocator(); $validationState = new \Magento\Framework\App\Arguments\ValidationState($appMode); diff --git a/lib/internal/Magento/Framework/App/PageCache/Identifier.php b/lib/internal/Magento/Framework/App/PageCache/Identifier.php index 8387884e0790d7f7f56f73a84f5017258217139c..a52579de4560377763fa58082cc8dfe9d3e6e005 100644 --- a/lib/internal/Magento/Framework/App/PageCache/Identifier.php +++ b/lib/internal/Magento/Framework/App/PageCache/Identifier.php @@ -40,8 +40,7 @@ class Identifier public function getValue() { $data = [ - $this->request->isSecure(), - $this->request->getRequestUri(), + $this->request->getUriString(), $this->request->get(\Magento\Framework\App\Response\Http::COOKIE_VARY_STRING) ?: $this->context->getVaryString() ]; diff --git a/lib/internal/Magento/Framework/App/PageCache/NotCacheableInterface.php b/lib/internal/Magento/Framework/App/PageCache/NotCacheableInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..de1bb42959fc215aeb8c2bfb9237b8af610f6716 --- /dev/null +++ b/lib/internal/Magento/Framework/App/PageCache/NotCacheableInterface.php @@ -0,0 +1,12 @@ +<?php +/** + * HTTP response interface + * + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Framework\App\PageCache; + +interface NotCacheableInterface +{ +} diff --git a/lib/internal/Magento/Framework/App/Resource/Config/SchemaLocator.php b/lib/internal/Magento/Framework/App/Resource/Config/SchemaLocator.php index 401c299b801dfcc9193a802829977f3819ed7c61..ee5b713769a1c55a3ec46114a51a72e7d5aff4fa 100644 --- a/lib/internal/Magento/Framework/App/Resource/Config/SchemaLocator.php +++ b/lib/internal/Magento/Framework/App/Resource/Config/SchemaLocator.php @@ -9,6 +9,14 @@ namespace Magento\Framework\App\Resource\Config; class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface { + /** @var \Magento\Framework\Config\Dom\UrnResolver */ + protected $urnResolver; + + public function __construct(\Magento\Framework\Config\Dom\UrnResolver $urnResolver) + { + $this->urnResolver = $urnResolver; + } + /** * Get path to per file validation schema * @@ -16,7 +24,7 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface */ public function getPerFileSchema() { - return realpath(__DIR__ . '/../../etc/resources.xsd'); + return $this->urnResolver->getRealPath('urn:magento:framework:App/etc/resources.xsd'); } /** diff --git a/lib/internal/Magento/Framework/App/Route/Config/SchemaLocator.php b/lib/internal/Magento/Framework/App/Route/Config/SchemaLocator.php index 7e8076e435c9ef00346bf429bda08f2d07853660..a9094faa7c49f53ce6e68c34c2c630136a0c1828 100644 --- a/lib/internal/Magento/Framework/App/Route/Config/SchemaLocator.php +++ b/lib/internal/Magento/Framework/App/Route/Config/SchemaLocator.php @@ -9,6 +9,14 @@ namespace Magento\Framework\App\Route\Config; class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface { + /** @var \Magento\Framework\Config\Dom\UrnResolver */ + protected $urnResolver; + + public function __construct(\Magento\Framework\Config\Dom\UrnResolver $urnResolver) + { + $this->urnResolver = $urnResolver; + } + /** * Get path to merged config schema * @@ -16,7 +24,7 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface */ public function getSchema() { - return realpath(__DIR__ . '/../../etc/routes_merged.xsd'); + return $this->urnResolver->getRealPath('urn:magento:framework:App/etc/routes_merged.xsd'); } /** @@ -26,6 +34,6 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface */ public function getPerFileSchema() { - return realpath(__DIR__ . '/../../etc/routes.xsd'); + return $this->urnResolver->getRealPath('urn:magento:framework:App/etc/routes.xsd'); } } diff --git a/lib/internal/Magento/Framework/App/Router/ActionList.php b/lib/internal/Magento/Framework/App/Router/ActionList.php index 355640fc44b928cc2e271f6fbf8153b0f3e1a76e..a9a090c15f73d08e4026eccda731a3bd7690fa0f 100644 --- a/lib/internal/Magento/Framework/App/Router/ActionList.php +++ b/lib/internal/Magento/Framework/App/Router/ActionList.php @@ -6,6 +6,8 @@ */ namespace Magento\Framework\App\Router; +use Magento\Framework\Module\Dir\Reader as ModuleReader; + class ActionList { /** @@ -15,6 +17,11 @@ class ActionList */ protected $actions; + /** + * @var ModuleReader + */ + protected $moduleReader; + /** * @var array */ @@ -30,14 +37,14 @@ class ActionList /** * @param \Magento\Framework\Config\CacheInterface $cache - * @param ActionList\Reader $actionReader + * @param ModuleReader $moduleReader * @param string $actionInterface * @param string $cacheKey * @param array $reservedWords */ public function __construct( \Magento\Framework\Config\CacheInterface $cache, - ActionList\Reader $actionReader, + ModuleReader $moduleReader, $actionInterface = '\Magento\Framework\App\ActionInterface', $cacheKey = 'app_action_list', $reservedWords = [] @@ -45,8 +52,9 @@ class ActionList $this->reservedWords = array_merge($reservedWords, $this->reservedWords); $this->actionInterface = $actionInterface; $data = $cache->load($cacheKey); + $this->moduleReader = $moduleReader; if (!$data) { - $this->actions = $actionReader->read(); + $this->actions = $this->moduleReader->getActionFiles(); $cache->save(serialize($this->actions), $cacheKey); } else { $this->actions = unserialize($data); diff --git a/lib/internal/Magento/Framework/App/Router/ActionList/Reader.php b/lib/internal/Magento/Framework/App/Router/ActionList/Reader.php deleted file mode 100644 index 70f331c3e157ace6ee841ef9c29f814c85342e52..0000000000000000000000000000000000000000 --- a/lib/internal/Magento/Framework/App/Router/ActionList/Reader.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php -/** - * - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Framework\App\Router\ActionList; - -class Reader -{ - /** - * @var \Magento\Framework\Module\Dir\Reader - */ - protected $moduleReader; - - /** - * @param \Magento\Framework\Module\Dir\Reader $moduleReader - */ - public function __construct(\Magento\Framework\Module\Dir\Reader $moduleReader) - { - $this->moduleReader = $moduleReader; - } - - /** - * Read list of all available application actions - * - * @return array - */ - public function read() - { - $actionFiles = $this->moduleReader->getActionFiles(); - $actions = []; - foreach ($actionFiles as $actionFile) { - $action = str_replace('/', '\\', substr($actionFile, 0, -4)); - $actions[strtolower($action)] = $action; - } - return $actions; - } -} diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Arguments/FileResolver/PrimaryTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Arguments/FileResolver/PrimaryTest.php index f4c54eba2b0a25d40d4ced84fc45b5dac26ea2b2..57ce78072173821526bf75d6ce03d54ffbc491e0 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Arguments/FileResolver/PrimaryTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Arguments/FileResolver/PrimaryTest.php @@ -17,8 +17,8 @@ class PrimaryTest extends \PHPUnit_Framework_TestCase */ public function testGet(array $fileList, $scope, $filename) { - $directory = $this->getMock('Magento\Framework\Filesystem\Directory\Read', ['search'], [], '', false); - $filesystem = $this->getMock('Magento\Framework\Filesystem', ['getDirectoryRead'], [], '', false); + $directory = $this->getMock('Magento\Framework\Filesystem\Directory\Read', [], [], '', false); + $filesystem = $this->getMock('Magento\Framework\Filesystem', [], [], '', false); $iteratorFactory = $this->getMock( 'Magento\Framework\Config\FileIteratorFactory', ['create'], diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Config/FileResolverTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Config/FileResolverTest.php index 09f7d9b9034d8836dfee38919dd3e9f6626c7b08..e7766ae62e7b200d6a20de09cde412d690a86005 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Config/FileResolverTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Config/FileResolverTest.php @@ -76,13 +76,7 @@ class FileResolverTest extends \PHPUnit_Framework_TestCase public function testGetPrimary($filename, $fileList) { $scope = 'primary'; - $directory = $this->getMock( - 'Magento\Framework\Filesystem\Directory\Read', - ['search', 'getRelativePath'], - [], - '', - false - ); + $directory = $this->getMock('Magento\Framework\Filesystem\Directory\Read', [], [], '', false); $directory->expects( $this->once() )->method( @@ -92,6 +86,10 @@ class FileResolverTest extends \PHPUnit_Framework_TestCase )->will( $this->returnValue($fileList) ); + $i = 1; + foreach ($fileList as $file) { + $directory->expects($this->at($i++))->method('getAbsolutePath')->willReturn($file); + } $this->filesystem->expects( $this->once() )->method( @@ -106,7 +104,6 @@ class FileResolverTest extends \PHPUnit_Framework_TestCase )->method( 'create' )->with( - $directory, $fileList )->will( $this->returnValue(true) diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Config/Initial/XsdTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Config/Initial/XsdTest.php index 3c54962e2f5966ad8409d78d8af371ab7711d073..881dca1e11584ad43dbd22282f6698481b836deb 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Config/Initial/XsdTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Config/Initial/XsdTest.php @@ -12,17 +12,18 @@ class XsdTest extends \PHPUnit_Framework_TestCase * Path to xsd schema file * @var string */ - protected $_xsdSchema; + protected $xsdSchema; /** - * @var \Magento\TestFramework\Utility\XsdValidator + * @var \Magento\Framework\TestFramework\Unit\Utility\XsdValidator */ - protected $_xsdValidator; + protected $xsdValidator; protected function setUp() { - $this->_xsdSchema = BP . '/app/code/Magento/Store/etc/config.xsd'; - $this->_xsdValidator = new \Magento\Framework\TestFramework\Unit\Utility\XsdValidator(); + $urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + $this->xsdSchema = $urnResolver->getRealPath('urn:magento:module:Magento_Store:etc/config.xsd'); + $this->xsdValidator = new \Magento\Framework\TestFramework\Unit\Utility\XsdValidator(); } /** @@ -32,14 +33,14 @@ class XsdTest extends \PHPUnit_Framework_TestCase */ public function testSchemaCorrectlyIdentifiesInvalidXml($xmlString, $expectedError) { - $actualError = $this->_xsdValidator->validate($this->_xsdSchema, $xmlString); + $actualError = $this->xsdValidator->validate($this->xsdSchema, $xmlString); $this->assertEquals($expectedError, $actualError); } public function testSchemaCorrectlyIdentifiesValidXml() { $xmlString = file_get_contents(__DIR__ . '/_files/valid_config.xml'); - $actualResult = $this->_xsdValidator->validate($this->_xsdSchema, $xmlString); + $actualResult = $this->xsdValidator->validate($this->xsdSchema, $xmlString); $this->assertEmpty($actualResult); } diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Config/Initial/_files/config.xml b/lib/internal/Magento/Framework/App/Test/Unit/Config/Initial/_files/config.xml index c0d6f535bcaa634059f38914bce449b9b1929e67..767a76b08bf1b5a46f9cb86d07b8d5336b653d3e 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Config/Initial/_files/config.xml +++ b/lib/internal/Magento/Framework/App/Test/Unit/Config/Initial/_files/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <payment> <payment_method> diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Config/Initial/_files/initial_config1.xml b/lib/internal/Magento/Framework/App/Test/Unit/Config/Initial/_files/initial_config1.xml index 0268e0a19ea007e138ea3079dd4af00077b750a6..e2145f133b4a55cc5495bfcd7c1252aa94e7077c 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Config/Initial/_files/initial_config1.xml +++ b/lib/internal/Magento/Framework/App/Test/Unit/Config/Initial/_files/initial_config1.xml @@ -5,5 +5,5 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> </config> diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Config/Initial/_files/initial_config2.xml b/lib/internal/Magento/Framework/App/Test/Unit/Config/Initial/_files/initial_config2.xml index 0268e0a19ea007e138ea3079dd4af00077b750a6..e2145f133b4a55cc5495bfcd7c1252aa94e7077c 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Config/Initial/_files/initial_config2.xml +++ b/lib/internal/Magento/Framework/App/Test/Unit/Config/Initial/_files/initial_config2.xml @@ -5,5 +5,5 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> </config> diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Config/Initial/_files/invalidConfigXmlArray.php b/lib/internal/Magento/Framework/App/Test/Unit/Config/Initial/_files/invalidConfigXmlArray.php index ae64b8d109ef19e04f6e21e06c45947f0a2839a8..971d7ea17b530c11fa70c79afcfc053fa7e09b4b 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Config/Initial/_files/invalidConfigXmlArray.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Config/Initial/_files/invalidConfigXmlArray.php @@ -7,6 +7,9 @@ return [ 'with_notallowed_handle' => [ '<?xml version="1.0"?><config><notallowe></notallowe></config>', - ["Element 'notallowe': This element is not expected. Expected is one of ( default, stores, websites )."], + [ + "Element 'notallowe': This element is not expected. Expected is one of" . + " ( default, stores, websites ).\nLine: 1\n" + ], ] ]; diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Config/Initial/_files/invalid_config.xml b/lib/internal/Magento/Framework/App/Test/Unit/Config/Initial/_files/invalid_config.xml index 803d1ef87c4d1471f6618fecf572ccde7dade9ce..abd2ecd2d405b964e915c4400e01a2e2d3e477b4 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Config/Initial/_files/invalid_config.xml +++ b/lib/internal/Magento/Framework/App/Test/Unit/Config/Initial/_files/invalid_config.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <invalid></invalid> </config> diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Config/Initial/_files/valid_config.xml b/lib/internal/Magento/Framework/App/Test/Unit/Config/Initial/_files/valid_config.xml index da8b5603b23f196a48eb04dea6d077e98acf1ed4..24c06a508c144d9c6672fbbcba9751566ffa7aed 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Config/Initial/_files/valid_config.xml +++ b/lib/internal/Magento/Framework/App/Test/Unit/Config/Initial/_files/valid_config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/Store/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <some></some> </default> diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Config/XsdTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Config/XsdTest.php index cd9f83aa75952d5a84a8fcdd70f6ec461141d7fe..8407c98728dc83abb6dd6b2b9e6dd2213ab42275 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Config/XsdTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Config/XsdTest.php @@ -14,14 +14,14 @@ class XsdTest extends \PHPUnit_Framework_TestCase protected $_xsdSchema; /** - * @var \Magento\TestFramework\Utility\XsdValidator + * @var \Magento\Framework\TestFramework\Unit\Utility\XsdValidator */ protected $_xsdValidator; protected function setUp() { - $this->_xsdSchema = BP . '/lib/internal/Magento/Framework/App/etc/routes.xsd'; - + $urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + $this->_xsdSchema = $urnResolver->getRealPath('urn:magento:framework:App/etc/routes.xsd'); $this->_xsdValidator = new \Magento\Framework\TestFramework\Unit\Utility\XsdValidator(); } diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Config/_files/invalidRoutesXmlArray.php b/lib/internal/Magento/Framework/App/Test/Unit/Config/_files/invalidRoutesXmlArray.php index bf7b099fd1acad4da8a47f32dec923338ea9e655..02ac7bed31d27a4cc7200f47d243af7f00035c86 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Config/_files/invalidRoutesXmlArray.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Config/_files/invalidRoutesXmlArray.php @@ -6,42 +6,44 @@ return [ 'without_router_handle' => [ '<?xml version="1.0"?><config></config>', - ["Element 'config': Missing child element(s). Expected is ( router )."], + ["Element 'config': Missing child element(s). Expected is ( router ).\nLine: 1\n"], ], 'router_without_required_id_attribute' => [ '<?xml version="1.0"?><config><router><route id="first"> <module name="Some_ModuleName" />' . '</route></router></config>', - ["Element 'router': The attribute 'id' is required but missing."], + ["Element 'router': The attribute 'id' is required but missing.\nLine: 1\n"], ], 'route_with_same_id_attribute' => [ '<?xml version="1.0"?><config><router id="some"><route id="first"><module name="Some_ModuleName" />' . '</route><route id="first" frontName="test_test" ><module name="Some_ModuleName" />' . '</route></router></config>', - ["Element 'route': Duplicate key-sequence ['first'] in unique identity-constraint 'uniqueRouteId'."], + ["Element 'route': Duplicate key-sequence ['first'] in unique identity-constraint 'uniqueRouteId'.\nLine: 1\n"], ], 'router_without_required_route_handle' => [ '<?xml version="1.0"?><config><router id="first"></router></config>', - ["Element 'router': Missing child element(s). Expected is ( route )."], + ["Element 'router': Missing child element(s). Expected is ( route ).\nLine: 1\n"], ], 'routers_with_same_id' => [ '<?xml version="1.0"?><config><router id="first"><route id="first_route"><module name="Some_ModuleName" />' . '</route></router><router id="first"><route id="test"><module name="Some_ModuleName" ' . 'before="asdasd" /></route></router></config>', - ["Element 'router': Duplicate key-sequence ['first'] in unique identity-constraint 'uniqueRouterId'."], + [ + "Element 'router': Duplicate key-sequence ['first'] in unique identity-constraint" . + " 'uniqueRouterId'.\nLine: 1\n"], ], 'router_with_notallowed_attribute' => [ '<?xml version="1.0"?><config><router id="first" notallowed="text"><route id="first_route">' . '<module name="Some_ModuleName" /></route></router></config>', - ["Element 'router', attribute 'notallowed': The attribute 'notallowed' is not allowed."], + ["Element 'router', attribute 'notallowed': The attribute 'notallowed' is not allowed.\nLine: 1\n"], ], 'route_without_required_module_handle' => [ '<?xml version="1.0"?><config><router id="first" ><route id="first_route"></route></router></config>', - ["Element 'route': Missing child element(s). Expected is ( module )."], + ["Element 'route': Missing child element(s). Expected is ( module ).\nLine: 1\n"], ], 'route_with_notallowed_attribute' => [ '<?xml version="1.0"?><config><router id="first"><route id="first_route" notallowe="text"><module' . ' name="Some_ModuleName" /></route></router></config>', - ["Element 'route', attribute 'notallowe': The attribute 'notallowe' is not allowed."], + ["Element 'route', attribute 'notallowe': The attribute 'notallowe' is not allowed.\nLine: 1\n"], ], 'same_route_frontname_attribute_value' => [ '<?xml version="1.0"?><config><router id="first"><route id="first_route" frontName="test_test">' . @@ -49,24 +51,24 @@ return [ '<module name="Some_ModuleName" /></route></router></config>', [ "Element 'route': Duplicate key-sequence ['test_test'] in unique " . - "identity-constraint 'uniqueRouteFrontName'." + "identity-constraint 'uniqueRouteFrontName'.\nLine: 1\n" ], ], 'module_with_notallowed_attribute' => [ '<?xml version="1.0"?><config><router id="first"><route id="first_route"><module ' . 'name="Some_ModuleName" notallowed="text" /></route></router></config>', - ["Element 'module', attribute 'notallowed': The attribute 'notallowed' is not allowed."], + ["Element 'module', attribute 'notallowed': The attribute 'notallowed' is not allowed.\nLine: 1\n"], ], 'router_id_empty_value' => [ '<?xml version="1.0"?><config><router id=""><route id="first_route"><module name="Some_ModuleName" />' . '</route></router></config>', [ "Element 'router', attribute 'id': [facet 'pattern'] The value '' is not accepted by the " . - "pattern '[A-Za-z0-9\-_]{3,}'.", - "Element 'router', attribute 'id': '' is not a valid value of the atomic type 'routerIdType'.", + "pattern '[A-Za-z0-9\-_]{3,}'.\nLine: 1\n", + "Element 'router', attribute 'id': '' is not a valid value of the atomic type 'routerIdType'.\nLine: 1\n", "Element 'router', attribute 'id': " . "Warning: No precomputed value available, the value was either invalid or " . - "something strange happend." + "something strange happend.\nLine: 1\n" ], ], 'router_id_value_regexp1' => [ @@ -74,23 +76,24 @@ return [ '</route></router></config>', [ "Element 'router', attribute 'id': [facet 'pattern'] The value 'as' is not accepted by the " . - "pattern '[A-Za-z0-9\-_]{3,}'.", - "Element 'router', attribute 'id': 'as' is not a valid value of the atomic type 'routerIdType'.", + "pattern '[A-Za-z0-9\-_]{3,}'.\nLine: 1\n", + "Element 'router', attribute 'id': 'as' is not a valid value of the atomic type 'routerIdType'.\nLine: 1\n", "Element 'router', attribute 'id': " . "Warning: No precomputed value available, the value was either invalid or " . - "something strange happend." + "something strange happend.\nLine: 1\n" ], ], 'router_id_value_regexp2' => [ - '<?xml version="1.0"?><config><router id="#%#%#"><route id="first_route"><module name="Some_ModuleName" />' . + '<?xml version="1.0"?><config><router id="##%#"><route id="first_route"><module name="Some_ModuleName" />' . '</route></router></config>', [ - "Element 'router', attribute 'id': [facet 'pattern'] The value '#%#%#' is not accepted by the " . - "pattern '[A-Za-z0-9\-_]{3,}'.", - "Element 'router', attribute 'id': '#%#%#' is not a valid value of the atomic type 'routerIdType'.", + "Element 'router', attribute 'id': [facet 'pattern'] The value '##%#' is not accepted by the " . + "pattern '[A-Za-z0-9\-_]{3,}'.\nLine: 1\n", + "Element 'router', attribute 'id': '##%#' is not a valid value of the atomic type" . + " 'routerIdType'.\nLine: 1\n", "Element 'router', attribute 'id': " . "Warning: No precomputed value available, the value was either invalid or " . - "something strange happend." + "something strange happend.\nLine: 1\n" ], ], 'router_route_value_regexp1' => [ @@ -98,10 +101,10 @@ return [ '</route></router></config>', [ "Element 'route', attribute 'id': [facet 'pattern'] The value 'dc' is not accepted by the " . - "pattern '[A-Za-z0-9_]{3,}'.", - "Element 'route', attribute 'id': 'dc' is not a valid value of the atomic type 'routeIdType'.", + "pattern '[A-Za-z0-9_]{3,}'.\nLine: 1\n", + "Element 'route', attribute 'id': 'dc' is not a valid value of the atomic type 'routeIdType'.\nLine: 1\n", "Element 'route', attribute 'id': Warning: No precomputed value available, the value was either " . - "invalid or something strange happend." + "invalid or something strange happend.\nLine: 1\n" ], ], 'router_route_empty_before_attribute_value' => [ @@ -109,8 +112,9 @@ return [ 'before="" /></route></router></config>', [ "Element 'module', attribute 'before': [facet 'pattern'] The value '' is not accepted by the " . - "pattern '[A-Za-z0-9_]{3,}'.", - "Element 'module', attribute 'before': '' is not a valid value of the atomic type 'beforeAfterType'." + "pattern '[A-Za-z0-9_]{3,}'.\nLine: 1\n", + "Element 'module', attribute 'before': '' is not a valid value of the atomic type" . + " 'beforeAfterType'.\nLine: 1\n" ], ], 'router_route_before_attribute_value_regexp1' => [ @@ -118,8 +122,9 @@ return [ 'name="Some_ModuleName" before="!!!!" /></route></router></config>', [ "Element 'module', attribute 'before': [facet 'pattern'] The value '!!!!' is not accepted by the " . - "pattern '[A-Za-z0-9_]{3,}'.", - "Element 'module', attribute 'before': '!!!!' is not a valid value of the atomic type 'beforeAfterType'." + "pattern '[A-Za-z0-9_]{3,}'.\nLine: 1\n", + "Element 'module', attribute 'before': '!!!!' is not a valid value of the atomic type" . + " 'beforeAfterType'.\nLine: 1\n" ], ], 'router_route_before_attribute_value_regexp2' => [ @@ -127,23 +132,25 @@ return [ '<module name="Some_ModuleName" before="ab" /></route></router></config>', [ "Element 'module', attribute 'before': [facet 'pattern'] The value 'ab' is not accepted by " . - "the pattern '[A-Za-z0-9_]{3,}'.", - "Element 'module', attribute 'before': 'ab' is not a valid value of the atomic type 'beforeAfterType'." + "the pattern '[A-Za-z0-9_]{3,}'.\nLine: 1\n", + "Element 'module', attribute 'before': 'ab' is not a valid value of the atomic type" . + " 'beforeAfterType'.\nLine: 1\n" ], ], 'route_module_without_required_name_atrribute' => [ '<?xml version="1.0"?><config><router id="first"><route id="test"><module /></route></router></config>', - ["Element 'module': The attribute 'name' is required but missing."], + ["Element 'module': The attribute 'name' is required but missing.\nLine: 1\n"], ], 'route_module_name_attribute_value_regexp1' => [ '<?xml version="1.0"?><config><router id="first"><route id="test"><module name="ss" />' . '</route></router></config>', [ "Element 'module', attribute 'name': [facet 'pattern'] The value 'ss' is not accepted by the " . - "pattern '[A-Za-z0-9_]{3,}'.", - "Element 'module', attribute 'name': 'ss' is not a valid value of the atomic type 'moduleNameType'.", + "pattern '[A-Za-z0-9_]{3,}'.\nLine: 1\n", + "Element 'module', attribute 'name': 'ss' is not a valid value of the atomic type" . + " 'moduleNameType'.\nLine: 1\n", "Element 'module', attribute 'name': Warning: No precomputed value available, the value was either " . - "invalid or something strange happend." + "invalid or something strange happend.\nLine: 1\n" ], ], 'route_module_name_attribute_value_regexp2' => [ @@ -151,10 +158,11 @@ return [ '</route></router></config>', [ "Element 'module', attribute 'name': [facet 'pattern'] The value '#$%^' is not accepted by " . - "the pattern '[A-Za-z0-9_]{3,}'.", - "Element 'module', attribute 'name': '#$%^' is not a valid value of the atomic type 'moduleNameType'.", + "the pattern '[A-Za-z0-9_]{3,}'.\nLine: 1\n", + "Element 'module', attribute 'name': '#$%^' is not a valid value of the atomic type" . + " 'moduleNameType'.\nLine: 1\n", "Element 'module', attribute 'name': Warning: No precomputed value available, the value was either " . - "invalid or something strange happend." + "invalid or something strange happend.\nLine: 1\n" ], ], 'route_module_before_attribute_empty_value' => [ @@ -162,8 +170,9 @@ return [ '<module name="Some_ModuleName" before="" /></route></router></config>', [ "Element 'module', attribute 'before': [facet 'pattern'] The value '' is not accepted by " . - "the pattern '[A-Za-z0-9_]{3,}'.", - "Element 'module', attribute 'before': '' is not a valid value of the atomic type 'beforeAfterType'." + "the pattern '[A-Za-z0-9_]{3,}'.\nLine: 1\n", + "Element 'module', attribute 'before': '' is not a valid value of the atomic type" . + " 'beforeAfterType'.\nLine: 1\n" ], ], 'route_module_before_attribute_value_regexp1' => [ @@ -171,8 +180,9 @@ return [ '<module name="Some_ModuleName" before="qq" /></route></router></config>', [ "Element 'module', attribute 'before': [facet 'pattern'] The value 'qq' is not accepted by the " . - "pattern '[A-Za-z0-9_]{3,}'.", - "Element 'module', attribute 'before': 'qq' is not a valid value of the atomic type 'beforeAfterType'." + "pattern '[A-Za-z0-9_]{3,}'.\nLine: 1\n", + "Element 'module', attribute 'before': 'qq' is not a valid value of the atomic type" . + " 'beforeAfterType'.\nLine: 1\n" ], ], 'route_module_before_attribute_value_regexp2' => [ @@ -180,8 +190,9 @@ return [ '<module name="Some_ModuleName" before="!!!!" /></route></router></config>', [ "Element 'module', attribute 'before': [facet 'pattern'] The value '!!!!' is not accepted by the " . - "pattern '[A-Za-z0-9_]{3,}'.", - "Element 'module', attribute 'before': '!!!!' is not a valid value of the atomic type 'beforeAfterType'." + "pattern '[A-Za-z0-9_]{3,}'.\nLine: 1\n", + "Element 'module', attribute 'before': '!!!!' is not a valid value of the atomic type" . + " 'beforeAfterType'.\nLine: 1\n" ], ], 'route_module_after_attribute_empty_value' => [ @@ -189,8 +200,9 @@ return [ '</route></router></config>', [ "Element 'module', attribute 'after': [facet 'pattern'] The value '' is not accepted " . - "by the pattern '[A-Za-z0-9_]{3,}'.", - "Element 'module', attribute 'after': '' is not a valid value of the atomic type 'beforeAfterType'." + "by the pattern '[A-Za-z0-9_]{3,}'.\nLine: 1\n", + "Element 'module', attribute 'after': '' is not a valid value of the atomic type" . + " 'beforeAfterType'.\nLine: 1\n" ], ], 'route_module_after_attribute_value_regexp1' => [ @@ -199,8 +211,9 @@ return [ '</route></router></config>', [ "Element 'module', attribute 'after': [facet 'pattern'] The value 'sd' is not accepted by" . - " the pattern '[A-Za-z0-9_]{3,}'.", - "Element 'module', attribute 'after': 'sd' is not a valid value of the atomic type 'beforeAfterType'." + " the pattern '[A-Za-z0-9_]{3,}'.\nLine: 1\n", + "Element 'module', attribute 'after': 'sd' is not a valid value of the atomic type" . + " 'beforeAfterType'.\nLine: 1\n" ], ], 'route_module_after_attribute_value_regexp2' => [ @@ -208,8 +221,9 @@ return [ '<module name="Some_ModuleName" after="!!!!" /></route></router></config>', [ "Element 'module', attribute 'after': [facet 'pattern'] The value '!!!!' is not accepted by the " . - "pattern '[A-Za-z0-9_]{3,}'.", - "Element 'module', attribute 'after': '!!!!' is not a valid value of the atomic type 'beforeAfterType'." + "pattern '[A-Za-z0-9_]{3,}'.\nLine: 1\n", + "Element 'module', attribute 'after': '!!!!' is not a valid value of the atomic type" . + " 'beforeAfterType'.\nLine: 1\n" ], ] ]; diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Config/_files/valid_routes.xml b/lib/internal/Magento/Framework/App/Test/Unit/Config/_files/valid_routes.xml index 3fd100e47a449f4efff8aad6790a29e3efa11563..b551e9b7eeebe1da28c606fd097d73bed2f6f60d 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Config/_files/valid_routes.xml +++ b/lib/internal/Magento/Framework/App/Test/Unit/Config/_files/valid_routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="first"> <route id="test"> <module name="Some_ModuleName" before="Some_BeforeModuleName" /> diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Language/ConfigTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Language/ConfigTest.php index 4ba0f004e3c3f5f6869c47cef4fb37f24f46d7d3..c69c340fda154753c53b4601f686320f9f46fee5 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Language/ConfigTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Language/ConfigTest.php @@ -13,20 +13,51 @@ use \Magento\Framework\App\Language\Config; */ class ConfigTest extends \PHPUnit_Framework_TestCase { + /** @var \Magento\Framework\Config\Dom\UrnResolver */ + protected $urnResolver; + + /** @var \Magento\Framework\Config\Dom\UrnResolver */ + protected $urnResolverMock; + + /** @var Config */ + protected $config; + + public function setUp() + { + $this->urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + $this->urnResolverMock = $this->getMock('Magento\Framework\Config\Dom\UrnResolver', [], [], '', false); + $this->urnResolverMock->expects($this->any()) + ->method('getRealPath') + ->with('urn:magento:framework:App/Language/package.xsd') + ->willReturn($this->urnResolver->getRealPath('urn:magento:framework:App/Language/package.xsd')); + $this->config = new Config( + file_get_contents(__DIR__ . '/_files/language.xml'), + $this->urnResolverMock + ); + } + public function testConfiguration() { - $languageXml = file_get_contents(__DIR__ . '/_files/language.xml'); - $languageConfig = new Config($languageXml); - $this->assertEquals('en_GB', $languageConfig->getCode()); - $this->assertEquals('magento', $languageConfig->getVendor()); - $this->assertEquals('en_gb', $languageConfig->getPackage()); - $this->assertEquals('100', $languageConfig->getSortOrder()); + $this->assertEquals('en_GB', $this->config->getCode()); + $this->assertEquals('magento', $this->config->getVendor()); + $this->assertEquals('en_gb', $this->config->getPackage()); + $this->assertEquals('100', $this->config->getSortOrder()); $this->assertEquals( [ ['vendor' => 'oxford-university', 'package' => 'en_us'], ['vendor' => 'oxford-university', 'package' => 'en_gb'], ], - $languageConfig->getUses() + $this->config->getUses() + ); + } + + public function testGetSchemaFile() + { + $method = new \ReflectionMethod($this->config, 'getSchemaFile'); + $method->setAccessible(true); + $this->assertEquals( + $this->urnResolver->getRealPath('urn:magento:framework:App/Language/package.xsd'), + $method->invoke($this->config) ); } } diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Language/DictionaryTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Language/DictionaryTest.php index 36ac05cce4f0f231390d372f6b6e92ea05addcb3..373a4655514794f65cd116f1eac8c913c60a62df 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Language/DictionaryTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Language/DictionaryTest.php @@ -6,9 +6,8 @@ namespace Magento\Framework\App\Test\Unit\Language; -use \Magento\Framework\App\Language\Dictionary; - -use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\App\Language\Dictionary; +use Magento\Framework\Filesystem\DriverPool; class DictionaryTest extends \PHPUnit_Framework_TestCase { @@ -20,7 +19,12 @@ class DictionaryTest extends \PHPUnit_Framework_TestCase /** * @var \PHPUnit_Framework_MockObject_MockObject */ - private $dir; + private $readFactory; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + private $componentRegistrar; /** * @var \PHPUnit_Framework_MockObject_MockObject @@ -29,261 +33,54 @@ class DictionaryTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->dir = $this->getMockForAbstractClass('\Magento\Framework\Filesystem\Directory\ReadInterface'); - $filesystem = $this->getMock('\Magento\Framework\Filesystem', [], [], '', false); - $filesystem->expects($this->once()) - ->method('getDirectoryRead') - ->with(DirectoryList::LOCALE) - ->will($this->returnValue($this->dir)); + $this->readFactory = $this->getMock('\Magento\Framework\Filesystem\Directory\ReadFactory', [], [], '', false); + $this->componentRegistrar = $this->getMock('Magento\Framework\Component\ComponentRegistrar', [], [], '', false); $this->configFactory = $this->getMockBuilder('\Magento\Framework\App\Language\ConfigFactory') ->setMethods(['create']) ->disableOriginalConstructor() ->getMock(); - $this->model = new Dictionary($filesystem, $this->configFactory); - } - - /** - * @param array $languagesData - * @param array $csvMap - * @param array $dictionaryMap - * @param $languageCode - * @param array $expectation - * @dataProvider dictionaryDataProvider - */ - public function testDictionaryGetter($languagesData, $csvMap, $dictionaryMap, $languageCode, $expectation) - { - $languagePaths = array_keys($languagesData); - $this->dir->expects($this->any())->method('search')->will($this->returnValueMap( - array_merge([['*/*/language.xml', null, $languagePaths]], $csvMap) - )); - - // Return first argument to mark content for configuration factory mock - $this->dir->expects($this->any())->method('readFile')->will($this->returnArgument(0)); - $configCallback = $this->returnCallback(function ($arguments) use ($languagesData) { - return $this->getLanguageConfigMock($languagesData[$arguments['source']]); - }); - $this->configFactory->expects($this->any())->method('create')->will($configCallback); - - // Covers data from dataProvider - $dictionaryMap = array_map(function ($data) { - list($path, $result) = $data; - return [$path, $this->getCsvMock($result)]; - }, $dictionaryMap); - $this->dir->expects($this->any())->method('openFile')->will($this->returnValueMap($dictionaryMap)); - - $result = $this->model->getDictionary($languageCode); - $this->assertSame($expectation, $result); - } - - public function dictionaryDataProvider() - { - return [ - // First case with multiple inheritance, the obtained dictionary is en_AU - 'a case with multiple inheritance' => $this->getDataMultipleInheritance(), - // Second case with inheritance of package with the same language code - 'a case with inheritance similar language code' => $this->getDataInheritanceWitSimilarCode(), - // Third case with circular inheritance, when two packages depend on each other - 'a case with circular inheritance' => $this->getDataCircularInheritance() - ]; + $this->model = new Dictionary($this->readFactory, $this->componentRegistrar, $this->configFactory); } - /** - * Create mock of language configuration model - * - * @param array $languageData - * @return \PHPUnit_Framework_MockObject_MockObject - */ - private function getLanguageConfigMock($languageData) + public function testDictionaryGetter() { - $languageConfig = $this->getMock('\Magento\Framework\App\Language\Config', [], [], '', false); - $languageConfig->expects($this->any())->method('getCode')->will($this->returnValue($languageData['code'])); - $languageConfig->expects($this->any())->method('getVendor')->will($this->returnValue($languageData['vendor'])); - $languageConfig->expects($this->any())->method('getPackage') - ->will($this->returnValue($languageData['package'])); - $languageConfig->expects($this->any())->method('getSortOrder') - ->will($this->returnValue($languageData['sort_order'])); - $languageConfig->expects($this->any())->method('getUses')->will($this->returnValue($languageData['use'])); - return $languageConfig; - } + $csvFileName = 'abc.csv'; + $data = [['one', '1'], ['two', '2']]; + $expected = []; + foreach ($data as $item) { + $expected[$item[0]] = $item[1]; + } - /** - * Imitate a CSV-file read operation through "App filesystem" interface - * - * @param array $data - * @return \PHPUnit_Framework_MockObject_MockObject - */ - private function getCsvMock($data) - { $file = $this->getMockForAbstractClass('Magento\Framework\Filesystem\File\ReadInterface'); for ($i = 0; $i < count($data); $i++) { $file->expects($this->at($i))->method('readCsv')->will($this->returnValue($data[$i])); } $file->expects($this->at($i))->method('readCsv')->will($this->returnValue(false)); - return $file; - } - /** - * @return array - */ - private function getDataMultipleInheritance() - { - return [ - 'languages' => [ - 'foo/en_au/language.xml' => [ - 'code' => 'en_AU', - 'vendor' => 'foo', - 'package' => 'en_au', - 'sort_order' => 0, - 'use' => [ - ['vendor' => 'bar', 'package' => 'en_gb'], - ['vendor' => 'baz', 'package' => 'en_gb'], - ], - ], - 'bar/en_gb/language.xml' => [ - 'code' => 'en_GB', - 'vendor' => 'bar', - 'package' => 'en_gb', - 'sort_order' => 100, - 'use' => [ - ['vendor' => 'bar', 'package' => 'en_us'], - ], - ], - 'baz/en_gb/language.xml' => [ - 'code' => 'en_GB', - 'vendor' => 'baz', - 'package' => 'en_gb', - 'sort_order' => 50, - 'use' => [], - ], - 'bar/en_us/language.xml' => [ - 'code' => 'en_US', - 'vendor' => 'bar', - 'package' => 'en_us', - 'sort_order' => 0, - 'use' => [], - ], - ], - // ValueMap for \Magento\Framework\Filesystem\Directory\ReadInterface::search($pattern, $path = null) - 'csv_map' => [ - ['bar/en_us/*.csv', null, ['bar/en_us/b.csv', 'bar/en_us/a.csv']], - ['baz/en_gb/*.csv', null, ['baz/en_gb/1.csv']], - ['bar/en_gb/*.csv', null, ['bar/en_gb/1.csv']], - ['foo/en_au/*.csv', null, ['foo/en_au/1.csv', 'foo/en_au/2.csv']], - ], - // ValueMap for \Magento\Framework\Filesystem\Directory\ReadInterface::openFile($path) - 'dictionary_map' => [ - ['bar/en_us/a.csv', [['one', '1'], ['two', '2']]], - ['bar/en_us/b.csv', [['three', '3'], ['four', '4']]], - ['baz/en_gb/1.csv', [['four and 5/10', '4.5']]], - ['bar/en_gb/1.csv', [['four and 75/100', '4.75'], ['four and 5/10', '4.50']]], - ['foo/en_au/1.csv', [['one', '1.0'], ['five', '5.0']]], - ['foo/en_au/2.csv', [['six', '6.0']]], - ], - // Dictionary that will be requested - 'language_code' => 'en_AU', - // Expected merged dictionary data - 'expectation' => [ - 'one' => '1.0', - 'two' => '2', - 'three' => '3', - 'four' => '4', - 'four and 5/10' => '4.50', - 'four and 75/100' => '4.75', - 'five' => '5.0', - 'six' => '6.0', - ] - ]; - } + $readMock = $this->getMockForAbstractClass('\Magento\Framework\Filesystem\Directory\ReadInterface'); + $readMock->expects($this->any())->method('readFile')->willReturnMap([ + ['language.xml', $readMock], + [$csvFileName, $file], + ]); + $readMock->expects($this->any())->method('openFile')->willReturn($file); + $readMock->expects($this->any())->method('isExist')->willReturn(true); + $readMock->expects($this->any())->method('search')->willReturn([$csvFileName]); - /** - * @return array - */ - private function getDataInheritanceWitSimilarCode() - { - return [ - 'languages' => [ - 'theirs/ru_ru/language.xml' => [ - 'code' => 'ru_RU', - 'vendor' => 'theirs', - 'package' => 'ru_ru', - 'sort_order' => 0, - 'use' => [], - ], - 'my/ru_ru/language.xml' => [ - 'code' => 'ru_RU', - 'vendor' => 'my', - 'package' => 'ru_ru', - 'sort_order' => 100, - 'use' => [ - ['vendor' => 'theirs', 'package' => 'ru_ru'], - ], - ], - ], - // ValueMap for \Magento\Framework\Filesystem\Directory\ReadInterface::search($pattern, $path = null) - 'csv_map' => [ - ['theirs/ru_ru/*.csv', null, ['theirs/ru_ru/1.csv']], - ['my/ru_ru/*.csv', null, ['my/ru_ru/1.csv']], - ], - // ValueMap for \Magento\Framework\Filesystem\Directory\ReadInterface::openFile($path) - 'dictionary_map' => [ - ['theirs/ru_ru/1.csv', [['one', '1'], ['two', '2']]], - ['my/ru_ru/1.csv', [['three', '3'], ['one', '1.0']]], - ], - // Dictionary that will be requested - 'language_code' => 'ru_RU', - // Expected merged dictionary data - 'expectation' => [ - 'one' => '1.0', - 'two' => '2', - 'three' => '3', - ] - ]; - } + $this->componentRegistrar->expects($this->once())->method('getPaths')->willReturn(['foo/en_us']); + $this->componentRegistrar->expects($this->once())->method('getPath')->willReturn('foo/en_us'); - /** - * @return array - */ - private function getDataCircularInheritance() - { - return [ - 'languages' => [ - 'first/en_us/language.xml' => [ - 'code' => 'en_US', - 'vendor' => 'first', - 'package' => 'en_us', - 'sort_order' => 0, - 'use' => [ - ['vendor' => 'second', 'package' => 'en_gb'], - ], - ], - 'second/en_gb/language.xml' => [ - 'code' => 'en_GB', - 'vendor' => 'second', - 'package' => 'en_gb', - 'sort_order' => 0, - 'use' => [ - ['vendor' => 'first', 'package' => 'en_us'], - ], - ], - ], - // ValueMap for \Magento\Framework\Filesystem\Directory\ReadInterface::search($pattern, $path = null) - 'csv_map' => [ - ['first/en_us/*.csv', null, ['first/en_us/1.csv']], - ['second/en_gb/*.csv', null, ['second/en_gb/1.csv']], - ], - // ValueMap for \Magento\Framework\Filesystem\Directory\ReadInterface::openFile($path) - 'dictionary_map' => [ - ['first/en_us/1.csv', [['three', '3'], ['one', '1.0']]], - ['second/en_gb/1.csv', [['one', '1'], ['two', '2']]], - ], - // Dictionary that will be requested - 'language_code' => 'en_US', - // Expected merged dictionary data - 'expectation' => [ - 'one' => '1.0', - 'two' => '2', - 'three' => '3', - ] - ]; + $this->readFactory->expects($this->any())->method("create")->willReturn($readMock); + + $languageConfig = $this->getMock('\Magento\Framework\App\Language\Config', [], [], '', false); + $languageConfig->expects($this->any())->method('getCode')->will($this->returnValue('en_US')); + $languageConfig->expects($this->any())->method('getVendor')->will($this->returnValue('foo')); + $languageConfig->expects($this->any())->method('getPackage')->will($this->returnValue('en_us')); + $languageConfig->expects($this->any())->method('getSortOrder')->will($this->returnValue(0)); + $languageConfig->expects($this->any())->method('getUses')->will($this->returnValue([])); + + $this->configFactory->expects($this->any())->method('create')->willReturn($languageConfig); + + $result = $this->model->getDictionary("en_US"); + $this->assertSame($expected, $result); } } diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Language/_files/language.xml b/lib/internal/Magento/Framework/App/Test/Unit/Language/_files/language.xml index d4bb062ef2380c08a10a5acae2f6285a05f488fd..d57e77e60a93ce20d9e3b5ea9dd10921dc9b27fa 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Language/_files/language.xml +++ b/lib/internal/Magento/Framework/App/Test/Unit/Language/_files/language.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/App/Language/package.xsd"> +<language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/Language/package.xsd"> <code>en_GB</code> <vendor>magento</vendor> <package>en_gb</package> diff --git a/lib/internal/Magento/Framework/App/Test/Unit/PageCache/IdentifierTest.php b/lib/internal/Magento/Framework/App/Test/Unit/PageCache/IdentifierTest.php index 69d12182268354dcc3047cac2a03db7f3c4e887b..a293241025fcad2dfa68fe8371bb4ea3f8969d3a 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/PageCache/IdentifierTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/PageCache/IdentifierTest.php @@ -18,19 +18,15 @@ class IdentifierTest extends \PHPUnit_Framework_TestCase } /** - * @param bool $isSecure * @param string $uri * @param string|null $vary * @return \Magento\Framework\App\Request\Http */ - protected function getRequestMock($isSecure, $uri, $vary = null) + protected function getRequestMock($uri, $vary = null) { $requestMock = $this->getMock('\Magento\Framework\App\Request\Http', [], [], '', false); $requestMock->expects($this->once()) - ->method('isSecure') - ->willReturn($isSecure); - $requestMock->expects($this->once()) - ->method('getRequestUri') + ->method('getUriString') ->willReturn($uri); $requestMock->expects($this->once()) ->method('get') @@ -54,16 +50,15 @@ class IdentifierTest extends \PHPUnit_Framework_TestCase } /** - * @param bool $isSecure * @param string $uri * @param string|null $varyStringCookie * @param string|null $varyStringContext * @param string $expected * @dataProvider dataProvider */ - public function testGetValue($isSecure, $uri, $varyStringCookie, $varyStringContext, $expected) + public function testGetValue($uri, $varyStringCookie, $varyStringContext, $expected) { - $request = $this->getRequestMock($isSecure, $uri, $varyStringCookie); + $request = $this->getRequestMock($uri, $varyStringCookie); $context = $this->getContextMock($varyStringCookie ? 0 : 1, $varyStringContext); $model = $this->objectManager->getObject( @@ -81,17 +76,15 @@ class IdentifierTest extends \PHPUnit_Framework_TestCase */ public function dataProvider() { - $uri = 'index.php/customer'; - $isSecure = 0; + $uri = 'http://domain.com/customer'; $vary = 1; - - $data = [$isSecure, $uri, $vary]; + $data = [$uri, $vary]; ksort($data); $expected = md5(serialize($data)); return [ - [$isSecure, $uri, $vary, null, $expected], - [$isSecure, $uri, null, $vary, $expected] + [$uri, $vary, null, $expected], + [$uri, null, $vary, $expected] ]; } } diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Resource/Config/SchemaLocatorTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Resource/Config/SchemaLocatorTest.php index 582cc77ac6ae5bfed2a6fd1e12d1869c20820469..9f786c9904d5e0b84b7930585aea808c66573f98 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Resource/Config/SchemaLocatorTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Resource/Config/SchemaLocatorTest.php @@ -7,29 +7,42 @@ namespace Magento\Framework\App\Test\Unit\Resource\Config; class SchemaLocatorTest extends \PHPUnit_Framework_TestCase { - /** - * @var string - */ - protected $_expected; /** * @var \Magento\Framework\App\Resource\Config\SchemaLocator */ - protected $_model; + protected $model; + + /** @var \Magento\Framework\Config\Dom\UrnResolver $urnResolverMock */ + protected $urnResolver; protected function setUp() { - $this->_expected = str_replace('\\', '/', BP) . '/lib/internal/Magento/Framework/App/etc/resources.xsd'; - $this->_model = new \Magento\Framework\App\Resource\Config\SchemaLocator(); + $this->urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + /** @var \Magento\Framework\Config\Dom\UrnResolver $urnResolverMock */ + $urnResolverMock = $this->getMock('Magento\Framework\Config\Dom\UrnResolver', [], [], '', false); + $urnResolverMock->expects($this->once()) + ->method('getRealPath') + ->with('urn:magento:framework:App/etc/resources.xsd') + ->willReturn( + $this->urnResolver->getRealPath('urn:magento:framework:App/etc/resources.xsd') + ); + $this->model = new \Magento\Framework\App\Resource\Config\SchemaLocator($urnResolverMock); } public function testGetSchema() { - $this->assertEquals($this->_expected, str_replace('\\', '/', $this->_model->getSchema())); + $this->assertEquals( + $this->urnResolver->getRealPath('urn:magento:framework:App/etc/resources.xsd'), + $this->model->getSchema() + ); } public function testGetPerFileSchema() { - $this->assertEquals($this->_expected, str_replace('\\', '/', $this->_model->getPerFileSchema())); + $this->assertEquals( + $this->urnResolver->getRealPath('urn:magento:framework:App/etc/resources.xsd'), + $this->model->getPerFileSchema() + ); } } diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Resource/Config/XsdTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Resource/Config/XsdTest.php index 4786151a69cd3e58d669214ce4bdce50c3c677fa..a9214b9b60e61991e01682fcf5fbe35d05fa78a8 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Resource/Config/XsdTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Resource/Config/XsdTest.php @@ -14,13 +14,14 @@ class XsdTest extends \PHPUnit_Framework_TestCase protected $_xsdSchema; /** - * @var \Magento\TestFramework\Utility\XsdValidator + * @var \Magento\Framework\TestFramework\Unit\Utility\XsdValidator */ protected $_xsdValidator; protected function setUp() { - $this->_xsdSchema = BP . '/lib/internal/Magento/Framework/App/etc/resources.xsd'; + $urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + $this->_xsdSchema = $urnResolver->getRealPath('urn:magento:framework:App/etc/resources.xsd'); $this->_xsdValidator = new \Magento\Framework\TestFramework\Unit\Utility\XsdValidator(); } diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Resource/Config/_files/invalidResourcesXmlArray.php b/lib/internal/Magento/Framework/App/Test/Unit/Resource/Config/_files/invalidResourcesXmlArray.php index aade50b4b21461a5077931d726a0effddf9e46b1..f383a2ba23701abf9e306666e66a1609605b5e7d 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Resource/Config/_files/invalidResourcesXmlArray.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Resource/Config/_files/invalidResourcesXmlArray.php @@ -6,49 +6,50 @@ return [ 'without_required_resource_handle' => [ '<?xml version="1.0"?><config></config>', - ["Element 'config': Missing child element(s). Expected is ( resource )."], + ["Element 'config': Missing child element(s). Expected is ( resource ).\nLine: 1\n"], ], 'resource_without_required_name_attribute' => [ '<?xml version="1.0"?><config><resource /></config>', - ["Element 'resource': The attribute 'name' is required but missing."], + ["Element 'resource': The attribute 'name' is required but missing.\nLine: 1\n"], ], 'resource_name_attribute_invalid_value' => [ - '<?xml version="1.0"?><config><resource name="testinvalidname1" /></config>', + '<?xml version="1.0"?><config><resource name="testinvalidname$" /></config>', [ - "Element 'resource', attribute 'name': [facet 'pattern'] The value 'testinvalidname1' is not accepted" . - " by the pattern '[A-Za-z_]+'.", - "Element 'resource', attribute 'name': 'testinvalidname1' is not a valid value of the atomic " . - "type 'nameIdentifier'.", + "Element 'resource', attribute 'name': [facet 'pattern'] The value 'testinvalidname$' is not accepted" . + " by the pattern '[A-Za-z_0-9]+'.\nLine: 1\n", + "Element 'resource', attribute 'name': 'testinvalidname$' is not a valid value of the atomic " . + "type 'nameIdentifier'.\nLine: 1\n", "Element 'resource', attribute 'name': Warning: No precomputed value available, the value was either " . - "invalid or something strange happend." + "invalid or something strange happend.\nLine: 1\n" ], ], 'resource_extends_attribute_invalid_value' => [ - '<?xml version="1.0"?><config><resource name="test_name" extends="test1"/></config>', + '<?xml version="1.0"?><config><resource name="test_name" extends="test@"/></config>', [ - "Element 'resource', attribute 'extends': [facet 'pattern'] The value 'test1' is not accepted " . - "by the pattern '[A-Za-z_]+'.", - "Element 'resource', attribute 'extends': 'test1' is not a valid value of the atomic type 'nameIdentifier'." + "Element 'resource', attribute 'extends': [facet 'pattern'] The value 'test@' is not accepted " . + "by the pattern '[A-Za-z_0-9]+'.\nLine: 1\n", + "Element 'resource', attribute 'extends': 'test@' is not a valid value of the atomic" . + " type 'nameIdentifier'.\nLine: 1\n" ], ], 'resource_connection_attribute_invalid_value' => [ - '<?xml version="1.0"?><config><resource name="test_name" connection="test1"/></config>', + '<?xml version="1.0"?><config><resource name="test_name" connection="test#"/></config>', [ - "Element 'resource', attribute 'connection': [facet 'pattern'] The value 'test1' is not accepted " . - "by the pattern '[A-Za-z_]+'.", - "Element 'resource', attribute 'connection': 'test1' is not a valid value of the atomic" . - " type 'nameIdentifier'." + "Element 'resource', attribute 'connection': [facet 'pattern'] The value 'test#' is not accepted " . + "by the pattern '[A-Za-z_0-9]+'.\nLine: 1\n", + "Element 'resource', attribute 'connection': 'test#' is not a valid value of the atomic" . + " type 'nameIdentifier'.\nLine: 1\n" ], ], 'resource_with_notallowed_attribute' => [ '<?xml version="1.0"?><config><resource name="test_name" notallowed="test" /></config>', - ["Element 'resource', attribute 'notallowed': The attribute 'notallowed' is not allowed."], + ["Element 'resource', attribute 'notallowed': The attribute 'notallowed' is not allowed.\nLine: 1\n"], ], 'resource_with_same_name_value' => [ '<?xml version="1.0"?><config><resource name="test_name" /><resource name="test_name" /></config>', [ "Element 'resource': Duplicate key-sequence ['test_name'] in unique " . - "identity-constraint 'uniqueResourceName'." + "identity-constraint 'uniqueResourceName'.\nLine: 1\n" ], ] ]; diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Resource/Config/_files/resources.xml b/lib/internal/Magento/Framework/App/Test/Unit/Resource/Config/_files/resources.xml index f9a88db75b8bbba00a88ad0bb659fdf2f3827269..af070b16103efac9c1c8bd7366e47a1e8dbbdb2c 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Resource/Config/_files/resources.xml +++ b/lib/internal/Magento/Framework/App/Test/Unit/Resource/Config/_files/resources.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/App/etc/resources.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/resources.xsd"> <resource name="resourceName" extends="anotherResourceName" /> <resource name="otherResourceName" connection="connectionName" /> <resource name="defaultSetup" connection="customConnection" /> diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Resource/Config/_files/valid_resources.xml b/lib/internal/Magento/Framework/App/Test/Unit/Resource/Config/_files/valid_resources.xml index 511edaf040b909aa4830391c5bc7212680ad25db..e3e67578ced89602cbd56e129269d1e8183dd70f 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Resource/Config/_files/valid_resources.xml +++ b/lib/internal/Magento/Framework/App/Test/Unit/Resource/Config/_files/valid_resources.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/App/etc/resources.xsd"> - <resource name="test_name" extends="test_extends" connection="test_connection" /> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/resources.xsd"> + <resource name="test_name1" extends="test_extends1" connection="test_connection1" /> <resource name="test_name_two" /> </config> diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Route/Config/SchemaLocatorTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Route/Config/SchemaLocatorTest.php index 938aaa66107c0ee839a28feb543f4a5e5b61ca5d..6c7a5cf3e8ee7a4121de73c5e94756f4a9a6ee7c 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Route/Config/SchemaLocatorTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Route/Config/SchemaLocatorTest.php @@ -10,22 +10,47 @@ class SchemaLocatorTest extends \PHPUnit_Framework_TestCase /** * @var \Magento\Framework\App\Route\Config\SchemaLocator */ - protected $_config; + protected $config; + + /** @var \Magento\Framework\Config\Dom\UrnResolver $urnResolverMock */ + protected $urnResolver; + + /** @var \Magento\Framework\Config\Dom\UrnResolver $urnResolverMock */ + protected $urnResolverMock; protected function setUp() { - $this->_config = new \Magento\Framework\App\Route\Config\SchemaLocator(); + $this->urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + /** @var \Magento\Framework\Config\Dom\UrnResolver $urnResolverMock */ + $this->urnResolverMock = $this->getMock('Magento\Framework\Config\Dom\UrnResolver', [], [], '', false); + $this->config = new \Magento\Framework\App\Route\Config\SchemaLocator($this->urnResolverMock); } public function testGetSchema() { - $actual = $this->_config->getSchema(); - $this->assertContains('routes_merged.xsd', $actual); + $this->urnResolverMock->expects($this->once()) + ->method('getRealPath') + ->with('urn:magento:framework:App/etc/routes_merged.xsd') + ->willReturn( + $this->urnResolver->getRealPath('urn:magento:framework:App/etc/routes_merged.xsd') + ); + $this->assertContains( + $this->urnResolver->getRealPath('urn:magento:framework:App/etc/routes_merged.xsd'), + $this->config->getSchema() + ); } public function testGetPerFileSchema() { - $actual = $this->_config->getPerFileSchema(); - $this->assertContains('routes.xsd', $actual); + $this->urnResolverMock->expects($this->once()) + ->method('getRealPath') + ->with('urn:magento:framework:App/etc/routes.xsd') + ->willReturn( + $this->urnResolver->getRealPath('urn:magento:framework:App/etc/routes.xsd') + ); + $this->assertContains( + $this->urnResolver->getRealPath('urn:magento:framework:App/etc/routes.xsd'), + $this->config->getPerFileSchema() + ); } } diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Route/Config/_files/routes.xml b/lib/internal/Magento/Framework/App/Test/Unit/Route/Config/_files/routes.xml index 5903998979ad9996260980f691a78262a398c101..e3efab5eb241561c9331def3ad36c596d7fa2743 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Route/Config/_files/routes.xml +++ b/lib/internal/Magento/Framework/App/Test/Unit/Route/Config/_files/routes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="backend"> <route id="adminhtml" frontName="admin"> <module name="Magento_ModuleD" /> diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Router/ActionList/ReaderTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Router/ActionList/ReaderTest.php deleted file mode 100644 index 24a5a63a490f3625de44d1e63a7353c5d0749b36..0000000000000000000000000000000000000000 --- a/lib/internal/Magento/Framework/App/Test/Unit/Router/ActionList/ReaderTest.php +++ /dev/null @@ -1,69 +0,0 @@ -<?php -/** - * RouterList model test class - * - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Framework\App\Test\Unit\Router\ActionList; - -class ReaderTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager - */ - protected $objectManager; - - /** - * @var \Magento\Framework\Module\Dir\Reader| \PHPUnit_Framework_MockObject_MockObject - */ - protected $moduleReaderMock; - - /** - * @var \Magento\Framework\App\Router\ActionList\Reader - */ - protected $actionListReader; - - public function setUp() - { - $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); - $this->moduleReaderMock = $this->getMockBuilder('Magento\Framework\Module\Dir\Reader') - ->disableOriginalConstructor() - ->getMock(); - $this->actionListReader = $this->objectManager->getObject( - 'Magento\Framework\App\Router\ActionList\Reader', - ['moduleReader' => $this->moduleReaderMock] - ); - } - - /** - * @param array $actionFiles - * @param array $expected - * @dataProvider readDataProvider - */ - public function testRead($actionFiles, $expected) - { - $this->moduleReaderMock->expects($this->once()) - ->method('getActionFiles') - ->willReturn($actionFiles); - $this->assertEquals($expected, $this->actionListReader->read()); - } - - public function readDataProvider() - { - return [ - [[], []], - [ - [ - 'Magento/Backend/Controller/Adminhtml/Cache.php', - 'Magento/Backend/Controller/Adminhtml/Index.php' - ], - [ - 'magento\backend\controller\adminhtml\cache' => 'Magento\Backend\Controller\Adminhtml\Cache', - 'magento\backend\controller\adminhtml\index' => 'Magento\Backend\Controller\Adminhtml\Index' - - ] - ] - ]; - } -} diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Router/ActionListTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Router/ActionListTest.php index 187192828067e85d8e61020659aa0aee11f347fa..adeccfb17019ace4a71a19ad8bac1528d9d2f185 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Router/ActionListTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Router/ActionListTest.php @@ -20,9 +20,9 @@ class ActionListTest extends \PHPUnit_Framework_TestCase protected $cacheMock; /** - * @var \Magento\Framework\App\Router\ActionList\Reader | \PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\Module\Dir\Reader | \PHPUnit_Framework_MockObject_MockObject */ - protected $actionReaderMock; + protected $moduleReaderMock; /** * @var \Magento\Framework\App\Router\ActionList @@ -35,7 +35,7 @@ class ActionListTest extends \PHPUnit_Framework_TestCase $this->cacheMock = $this->getMockBuilder('Magento\Framework\Config\CacheInterface') ->disableOriginalConstructor() ->getMock(); - $this->actionReaderMock = $this->getMockBuilder('Magento\Framework\App\Router\ActionList\Reader') + $this->moduleReaderMock = $this->getMockBuilder('Magento\Framework\Module\Dir\Reader') ->disableOriginalConstructor() ->getMock(); } @@ -47,13 +47,13 @@ class ActionListTest extends \PHPUnit_Framework_TestCase ->will($this->returnValue(serialize('data'))); $this->cacheMock->expects($this->never()) ->method('save'); - $this->actionReaderMock->expects($this->never()) - ->method('read'); + $this->moduleReaderMock->expects($this->never()) + ->method('getActionFiles'); $this->actionList = $this->objectManager->getObject( 'Magento\Framework\App\Router\ActionList', [ 'cache' => $this->cacheMock, - 'actionReader' => $this->actionReaderMock, + 'moduleReader' => $this->moduleReaderMock, ] ); } @@ -65,14 +65,14 @@ class ActionListTest extends \PHPUnit_Framework_TestCase ->will($this->returnValue(false)); $this->cacheMock->expects($this->once()) ->method('save'); - $this->actionReaderMock->expects($this->once()) - ->method('read') + $this->moduleReaderMock->expects($this->once()) + ->method('getActionFiles') ->will($this->returnValue('data')); $this->actionList = $this->objectManager->getObject( 'Magento\Framework\App\Router\ActionList', [ 'cache' => $this->cacheMock, - 'actionReader' => $this->actionReaderMock, + 'moduleReader' => $this->moduleReaderMock, ] ); } @@ -94,14 +94,14 @@ class ActionListTest extends \PHPUnit_Framework_TestCase ->will($this->returnValue(false)); $this->cacheMock->expects($this->once()) ->method('save'); - $this->actionReaderMock->expects($this->once()) - ->method('read') + $this->moduleReaderMock->expects($this->once()) + ->method('getActionFiles') ->will($this->returnValue($data)); $this->actionList = $this->objectManager->getObject( 'Magento\Framework\App\Router\ActionList', [ 'cache' => $this->cacheMock, - 'actionReader' => $this->actionReaderMock, + 'moduleReader' => $this->moduleReaderMock, ] ); $this->assertEquals($expected, $this->actionList->get($module, $area, $namespace, $action)); diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Utility/FilesTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Utility/FilesTest.php index dd6b953664bfdb04d6bd941d76b63b19febf2a1a..5c9d22b7207dc5c1c14556c56da7ce748705e210 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Utility/FilesTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Utility/FilesTest.php @@ -5,62 +5,59 @@ */ namespace Magento\Framework\App\Test\Unit\Utility; -use \Magento\Framework\App\Utility\Files; +use Magento\Framework\App\Utility\Files; +use Magento\Framework\Component\ComponentRegistrar; class FilesTest extends \PHPUnit_Framework_TestCase { /** - * @var string + * @var \Magento\Framework\Component\DirSearch|\PHPUnit_Framework_MockObject_MockObject */ - private static $baseDir; + private $dirSearch; - public static function setUpBeforeClass() - { - self::$baseDir = __DIR__ . '/_files/foo'; - Files::setInstance(new Files(self::$baseDir)); - } - - public static function tearDownAfterClass() - { - Files::setInstance(); - } + /** + * @var ComponentRegistrar + */ + private $componentRegistrar; - public function testReadLists() + protected function setUp() { - $result = Files::init()->readLists(__DIR__ . '/_files/*good.txt'); - - // the braces - $this->assertContains(self::$baseDir . '/one.txt', $result); - $this->assertContains(self::$baseDir . '/two.txt', $result); - - // directory is returned as-is, without expanding contents recursively - $this->assertContains(self::$baseDir . '/bar', $result); - - // the * wildcard - $this->assertContains(self::$baseDir . '/baz/one.txt', $result); - $this->assertContains(self::$baseDir . '/baz/two.txt', $result); + $this->componentRegistrar = new ComponentRegistrar(); + $this->dirSearch = $this->getMock('Magento\Framework\Component\DirSearch', [], [], '', false); + $themePackageList = $this->getMock('Magento\Framework\View\Design\Theme\ThemePackageList', [], [], '', false); + Files::setInstance(new Files($this->componentRegistrar, $this->dirSearch, $themePackageList)); } - public function testReadListsWrongPattern() + protected function tearDown() { - $this->assertSame([], Files::init()->readLists(__DIR__ . '/_files/no_good.txt')); + Files::setInstance(); } - public function testReadListsCorruptedDir() + public function testGetConfigFiles() { - $result = Files::init()->readLists(__DIR__ . '/_files/list_corrupted_dir.txt'); - - foreach ($result as $path) { - $this->assertNotContains('bar/unknown', $path); - } + $this->dirSearch->expects($this->once()) + ->method('collectFiles') + ->with(ComponentRegistrar::MODULE, '/etc/some.file') + ->willReturn(['/one/some.file', '/two/some.file', 'some.other.file']); + + $expected = ['/one/some.file', '/two/some.file']; + $actual = Files::init()->getConfigFiles('some.file', ['some.other.file'], false); + $this->assertSame($expected, $actual); + // Check that the result is cached (collectFiles() is called only once) + $this->assertSame($expected, $actual); } - public function testReadListsCorruptedFile() + public function testGetLayoutConfigFiles() { - $result = Files::init()->readLists(__DIR__ . '/_files/list_corrupted_file.txt'); - - foreach ($result as $path) { - $this->assertNotContains('unknown.txt', $path); - } + $this->dirSearch->expects($this->once()) + ->method('collectFiles') + ->with(ComponentRegistrar::THEME, '/etc/some.file') + ->willReturn(['/one/some.file', '/two/some.file']); + + $expected = ['/one/some.file', '/two/some.file']; + $actual = Files::init()->getLayoutConfigFiles('some.file', false); + $this->assertSame($expected, $actual); + // Check that the result is cached (collectFiles() is called only once) + $this->assertSame($expected, $actual); } } diff --git a/lib/internal/Magento/Framework/App/Test/Unit/_files/app/etc/di.xml b/lib/internal/Magento/Framework/App/Test/Unit/_files/app/etc/di.xml index 77c37c59d030ad76e782509acbef89a2cd2a1ab3..0a81b2862f5c3481bf1cca7100baba13d90b07b4 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/_files/app/etc/di.xml +++ b/lib/internal/Magento/Framework/App/Test/Unit/_files/app/etc/di.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Framework\ObjectManager\Factory\Dynamic\Developer" type="Magento\Framework\App\Test\Unit\ObjectManager\FactoryStub" /> </config> diff --git a/lib/internal/Magento/Framework/App/Utility/Classes.php b/lib/internal/Magento/Framework/App/Utility/Classes.php index f49118641b3f4de5d3dd08e4cef4ddd9d46bef51..8956ce88c342db7fe7f03d5cf2b3dfdd7d289785 100644 --- a/lib/internal/Magento/Framework/App/Utility/Classes.php +++ b/lib/internal/Magento/Framework/App/Utility/Classes.php @@ -191,7 +191,7 @@ class Classes '/' ) . '\/app\/code\/([A-Za-z]+)\/([A-Za-z]+)\/(' . $subTypePattern . '\/.+)\.php$/'; $result = []; - foreach (Files::init()->getPhpFiles(true, false, false, false, false) as $file) { + foreach (Files::init()->getPhpFiles(Files::INCLUDE_APP_CODE | Files::INCLUDE_NON_CLASSES) as $file) { if (preg_match($pattern, $file, $matches)) { $module = "{$matches[1]}_{$matches[2]}"; $class = "{$module}" . '\\' . str_replace( diff --git a/lib/internal/Magento/Framework/App/Utility/Files.php b/lib/internal/Magento/Framework/App/Utility/Files.php index 86d747d14187f935335d2b6ca9fd9f0ef5dcb9ea..f5255ea78fe902f590ec14699731d027b5f60094 100644 --- a/lib/internal/Magento/Framework/App/Utility/Files.php +++ b/lib/internal/Magento/Framework/App/Utility/Files.php @@ -6,6 +6,10 @@ namespace Magento\Framework\App\Utility; +use Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\DirSearch; +use Magento\Framework\View\Design\Theme\ThemePackageList; + /** * A helper to gather specific kind of files in Magento application * @@ -14,6 +18,31 @@ namespace Magento\Framework\App\Utility; */ class Files { + /**@#+ + * File types offset flags + */ + const INCLUDE_APP_CODE = 1; + const INCLUDE_TESTS = 2; + const INCLUDE_DEV_TOOLS = 4; + const INCLUDE_TEMPLATES = 8; + const INCLUDE_LIBS = 16; + const INCLUDE_PUB_CODE = 32; + const INCLUDE_NON_CLASSES = 64; + /**#@-*/ + + /** + * Return as DataSet offset flag + */ + const AS_DATA_SET = 1024; + + + /** + * Component registrar + * + * @var ComponentRegistrar + */ + protected $componentRegistrar; + /** * @var \Magento\Framework\App\Utility\Files */ @@ -27,18 +56,18 @@ class Files protected static $_cache = []; /** - * @var string + * Dir search for registered components + * + * @var DirSearch */ - protected $_path = ''; - - /** @var string regex for test directories in app/code */ - protected $moduleTestDirs = '#app/code/[\\w]+/[\\w]+/Test#'; - - /** @var string regex for test directories in tools */ - protected $toolsTestDirs = '#dev/tools/Magento/Tools/[\\w]+/Test#'; + private $dirSearch; - /** @var string regex for test directories in lib/internal */ - protected $libTestDirs = '#lib/internal/[\\w]+/[\\w]+/([\\w]+/)?Test#'; + /** + * Theme list for registered themes + * + * @var ThemePackageList + */ + private $themePackageList; /** * Setter for an instance of self @@ -77,7 +106,7 @@ class Files { $result = []; foreach ($files as $file) { - $result[substr($file, strlen(BP))] = [$file]; + $result[$file] = [$file]; } return $result; } @@ -85,132 +114,202 @@ class Files /** * Set path to source code * - * @param string $pathToSource + * @param ComponentRegistrar $componentRegistrar + * @param DirSearch $dirSearch + * @param ThemePackageList $themePackageList */ - public function __construct($pathToSource) + public function __construct( + ComponentRegistrar $componentRegistrar, + DirSearch $dirSearch, + ThemePackageList $themePackageList + ) { + $this->componentRegistrar = $componentRegistrar; + $this->dirSearch = $dirSearch; + $this->themePackageList = $themePackageList; + } + + /** + * Get list of regular expressions for matching test directories in modules + * + * @return array + */ + private function getModuleTestDirsRegex() { - $this->_path = $pathToSource; + $moduleTestDirs = []; + foreach ($this->componentRegistrar->getPaths(ComponentRegistrar::MODULE) as $moduleDir) { + $moduleTestDirs[] = str_replace('\\', '/', '#' . $moduleDir . '/Test#'); + } + return $moduleTestDirs; } /** - * Getter for _path + * Get base path * * @return string */ public function getPathToSource() { - return $this->_path; + return BP; } /** - * Returns array of PHP-files, that use or declare Magento application classes and Magento libs + * Returns list of files, where expected to have class declarations * - * @param bool $appCode application PHP-code - * @param bool $otherCode non-application PHP-code (doesn't include "dev" directory) - * @param bool $templates application PHTML-code - * @param bool $asDataSet - * @param bool $tests tests folder + * @param int $flags * @return array */ - public function getPhpFiles($appCode = true, $otherCode = true, $templates = true, $asDataSet = true, $tests = true) + public function getPhpFiles($flags = 0) { - $key = __METHOD__ . "/{$this->_path}/{$appCode}/{$otherCode}/{$templates}"; + // Sets default value + if ($flags === 0) { + $flags = self::INCLUDE_APP_CODE + | self::INCLUDE_TESTS + | self::INCLUDE_DEV_TOOLS + | self::INCLUDE_LIBS + | self::AS_DATA_SET; + } + $key = __METHOD__ . BP . $flags; if (!isset(self::$_cache[$key])) { - $namespace = '*'; - $module = '*'; $files = []; - if ($appCode) { - $files = array_merge( - glob($this->_path . '/app/*.php', GLOB_NOSORT), - $this->getFilesSubset( - ["{$this->_path}/app/code/{$namespace}/{$module}"], - '*.php', - $this->moduleTestDirs - ) - ); - } - if ($otherCode) { - $files = array_merge( - $files, - glob($this->_path . '/*.php', GLOB_NOSORT), - glob($this->_path . '/pub/*.php', GLOB_NOSORT), - $this->getFilesSubset(["{$this->_path}/lib/internal/Magento"], '*.php', $this->libTestDirs) - ); - } - if ($tests) { - $files = array_merge( - $files, - self::getFiles(["{$this->_path}/dev/tests"], '*.php') - ); - } - if ($templates) { - $files = array_merge($files, $this->getPhtmlFiles(false, false)); - } + + $files = array_merge($files, $this->getAppCodeFiles($flags)); + $files = array_merge($files, $this->getTestFiles($flags)); + $files = array_merge($files, $this->getDevToolsFiles($flags)); + $files = array_merge($files, $this->getTemplateFiles($flags)); + $files = array_merge($files, $this->getLibraryFiles($flags)); + $files = array_merge($files, $this->getPubFiles($flags)); self::$_cache[$key] = $files; } - - if ($asDataSet) { + if ($flags & self::AS_DATA_SET) { return self::composeDataSets(self::$_cache[$key]); } return self::$_cache[$key]; } /** - * Returns list of files, where expected to have class declarations + * Return array with all template files * - * @param bool $appCode application PHP-code - * @param bool $tests - * @param bool $devTools - * @param bool $lib - * @param bool $asDataSet + * @param int $flags * @return array */ - public function getClassFiles( - $appCode = true, - $tests = true, - $devTools = true, - $lib = true, - $asDataSet = true - ) { - $key = __METHOD__ . "/{$this->_path}/{$appCode}/{$tests}/{$devTools}/{$lib}"; - if (!isset(self::$_cache[$key])) { - $files = []; - if ($appCode) { - $files = array_merge( - $files, - $this->getFilesSubset(["{$this->_path}/app/code/Magento"], '*.php', $this->moduleTestDirs) - ); + private function getTemplateFiles($flags) + { + if ($flags & self::INCLUDE_TEMPLATES) { + return $this->getPhtmlFiles(false, false); + } + return []; + } + + /** + * Return array with all php files related to library + * + * @param int $flags + * @return array + */ + private function getLibraryFiles($flags) + { + if ($flags & self::INCLUDE_LIBS) { + $libraryExcludeDirs = []; + foreach ($this->componentRegistrar->getPaths(ComponentRegistrar::LIBRARY) as $libraryDir) { + $libraryExcludeDirs[] = str_replace('\\', '/', '#' . $libraryDir . '/Test#'); + $libraryExcludeDirs[] = str_replace('\\', '/', '#' . $libraryDir) . '/[\\w]+/Test#'; + if (!($flags & self::INCLUDE_NON_CLASSES)) { + $libraryExcludeDirs[] = str_replace('\\', '/', '#' . $libraryDir . '/registration#'); + } } - if ($tests) { - $testDirs = [ - "{$this->_path}/dev/tests", - "{$this->_path}/app/code/*/*/Test", - "{$this->_path}/lib/internal/*/*/Test", - "{$this->_path}/lib/internal/*/*/*/Test", - "{$this->_path}/dev/tools/Magento/Tools/*/Test", - "{$this->_path}/setup/src/Magento/Setup/Test", + return $this->getFilesSubset( + $this->componentRegistrar->getPaths(ComponentRegistrar::LIBRARY), + '*.php', + $libraryExcludeDirs + ); + } + return []; + } - ]; - $files = array_merge($files, self::getFiles($testDirs, '*.php')); + /** + * Return array with all php files related to pub + * + * @param int $flags + * @return array + */ + private function getPubFiles($flags) + { + if ($flags & self::INCLUDE_PUB_CODE) { + return array_merge( + glob(BP . '/*.php', GLOB_NOSORT), + glob(BP . '/pub/*.php', GLOB_NOSORT) + ); + } + return []; + } + + /** + * Return array with all php files related to dev tools + * + * @param int $flags + * @return array + */ + private function getDevToolsFiles($flags) + { + if ($flags & self::INCLUDE_DEV_TOOLS) { + return $this->getFilesSubset([BP . '/dev/tools/Magento'], '*.php', []); + } + return []; + } + + /** + * Return array with all php files related to modules + * + * @param int $flags + * @return array + */ + private function getAppCodeFiles($flags) + { + if ($flags & self::INCLUDE_APP_CODE) { + $excludePaths = []; + $paths = $this->componentRegistrar->getPaths(ComponentRegistrar::MODULE); + if ($flags & self::INCLUDE_NON_CLASSES) { + $paths[] = BP . '/app'; + } else { + foreach ($this->componentRegistrar->getPaths(ComponentRegistrar::MODULE) as $moduleDir) { + $excludePaths[] = str_replace('\\', '/', '#' . $moduleDir . '/registration.php#'); + } } - if ($devTools) { - $files = array_merge( - $files, - $this->getFilesSubset(["{$this->_path}/dev/tools/Magento"], '*.php', $this->toolsTestDirs) - ); + return $this->getFilesSubset( + $paths, + '*.php', + array_merge($this->getModuleTestDirsRegex(), $excludePaths) + ); + } + return []; + } + + /** + * Return array with all test files + * + * @param int $flags + * @return array + */ + private function getTestFiles($flags) + { + if ($flags & self::INCLUDE_TESTS) { + $testDirs = [ + BP . '/dev/tests', + BP . '/setup/src/Magento/Setup/Test', + ]; + $moduleTestDir = []; + foreach ($this->componentRegistrar->getPaths(ComponentRegistrar::MODULE) as $moduleDir) { + $moduleTestDir[] = $moduleDir . '/Test'; } - if ($lib) { - $files = array_merge( - $files, - $this->getFilesSubset(["{$this->_path}/lib/internal/Magento"], '*.php', $this->libTestDirs) - ); + $libraryTestDirs = []; + foreach ($this->componentRegistrar->getPaths(ComponentRegistrar::LIBRARY) as $libraryDir) { + $libraryTestDirs[] = $libraryDir . '/Test'; + $libraryTestDirs[] = $libraryDir . '/*/Test'; } - self::$_cache[$key] = $files; - } - if ($asDataSet) { - return self::composeDataSets(self::$_cache[$key]); + $testDirs = array_merge($testDirs, $moduleTestDir, $libraryTestDirs); + return self::getFiles($testDirs, '*.php'); } - return self::$_cache[$key]; + return []; } /** @@ -239,17 +338,19 @@ class Files */ public function getMainConfigFiles($asDataSet = true) { - $cacheKey = __METHOD__ . '|' . $this->_path . '|' . serialize(func_get_args()); + $cacheKey = __METHOD__ . '|' . BP . '|' . serialize(func_get_args()); if (!isset(self::$_cache[$cacheKey])) { - $globPaths = [ - 'app/etc/config.xml', - 'app/etc/*/config.xml', - 'app/code/*/*/etc/config.xml', - 'app/code/*/*/etc/config.*.xml' // Module DB-specific configs, e.g. config.mysql4.xml - ]; + $configXmlPaths = []; + foreach ($this->componentRegistrar->getPaths(ComponentRegistrar::MODULE) as $moduleDir) { + $configXmlPaths[] = $moduleDir . '/etc/config.xml'; + // Module DB-specific configs, e.g. config.mysql4.xml + $configXmlPaths[] = $moduleDir . '/etc/config.*.xml'; + } + $globPaths = [BP . '/app/etc/config.xml', BP . '/app/etc/*/config.xml']; + $configXmlPaths = array_merge($globPaths, $configXmlPaths); $files = []; - foreach ($globPaths as $globPath) { - $files = array_merge($files, glob($this->_path . '/' . $globPath)); + foreach ($configXmlPaths as $xmlPath) { + $files = array_merge($files, glob($xmlPath)); } self::$_cache[$cacheKey] = $files; } @@ -273,9 +374,9 @@ class Files $excludedFileNames = ['wsdl.xml', 'wsdl2.xml', 'wsi.xml'], $asDataSet = true ) { - $cacheKey = __METHOD__ . '|' . $this->_path . '|' . serialize(func_get_args()); + $cacheKey = __METHOD__ . '|' . BP . '|' . serialize(func_get_args()); if (!isset(self::$_cache[$cacheKey])) { - $files = $this->_getConfigFilesList($fileNamePattern, 'code'); + $files = $this->dirSearch->collectFiles(ComponentRegistrar::MODULE, "/etc/{$fileNamePattern}"); $files = array_filter( $files, function ($file) use ($excludedFileNames) { @@ -292,7 +393,7 @@ class Files // @codingStandardsIgnoreEnd /** - * Returns a list of configuration files found under the app/design directory. + * Returns a list of configuration files found under theme directories. * * @param string $fileNamePattern * @param bool $asDataSet @@ -300,9 +401,12 @@ class Files */ public function getLayoutConfigFiles($fileNamePattern = '*.xml', $asDataSet = true) { - $cacheKey = __METHOD__ . '|' . $this->_path . '|' . serialize(func_get_args()); + $cacheKey = __METHOD__ . '|' . BP . '|' . serialize(func_get_args()); if (!isset(self::$_cache[$cacheKey])) { - self::$_cache[$cacheKey] = $this->_getConfigFilesList($fileNamePattern, 'design'); + self::$_cache[$cacheKey] = $this->dirSearch->collectFiles( + ComponentRegistrar::THEME, + "/etc/{$fileNamePattern}" + ); } if ($asDataSet) { return self::composeDataSets(self::$_cache[$cacheKey]); @@ -378,29 +482,17 @@ class Files $params[$key] = $incomingParams[$key]; } } - $cacheKey = md5($this->_path . '|' . $location . '|' . implode('|', $params)); + $cacheKey = md5(BP . '|' . $location . '|' . implode('|', $params)); if (!isset(self::$_cache[__METHOD__][$cacheKey])) { $files = []; - $area = $params['area']; - $namespace = $params['namespace']; - $module = $params['module']; if ($params['include_code']) { - $this->_accumulateFilesByPatterns( - ["{$this->_path}/app/code/{$namespace}/{$module}/view/{$area}/{$location}"], - '*.xml', - $files, - $params['with_metainfo'] ? '_parseModuleLayout' : false - ); + $files = array_merge($files, $this->collectModuleLayoutFiles($params, $location)); } if ($params['include_design']) { - $this->_accumulateFilesByPatterns( - ["{$this->_path}/app/design/{$area}/{$params['theme_path']}/{$namespace}_{$module}/{$location}"], - '*.xml', - $files, - $params['with_metainfo'] ? '_parseThemeLayout' : false - ); + $files = array_merge($files, $this->collectThemeLayoutFiles($params, $location)); } + self::$_cache[__METHOD__][$cacheKey] = $files; } @@ -411,45 +503,111 @@ class Files } /** - * Parse meta-info of a layout file in module + * Collect layout files from modules * - * @param string $file - * @param string $path + * @param array $params + * @param string $location * @return array */ - protected function _parseModuleLayout($file, $path) + private function collectModuleLayoutFiles(array $params, $location) { - preg_match( - '/^' . preg_quote("{$path}/app/code/", '/') . '([a-z\d]+)\/([a-z\d]+)\/view\/([a-z]+)\/layout\/(.+)$/i', - $file, - $matches - ); - list(, $namespace, $module, $area, $filePath) = $matches; - return [$area, '', $namespace . '_' . $module, $filePath, $file]; + $files = []; + $area = $params['area']; + $requiredModuleName = $params['namespace'] . '_' . $params['module']; + foreach ($this->componentRegistrar->getPaths(ComponentRegistrar::MODULE) as $moduleName => $moduleDir) { + if ($requiredModuleName == '*_*' || $moduleName == $requiredModuleName) { + $moduleFiles = []; + $this->_accumulateFilesByPatterns( + [$moduleDir . "/view/{$area}/{$location}"], + '*.xml', + $moduleFiles + ); + if ($params['with_metainfo']) { + foreach ($moduleFiles as $moduleFile) { + $modulePath = str_replace(DIRECTORY_SEPARATOR, '/', preg_quote($moduleDir, '#')); + $regex = '#^' . $modulePath . '/view/(?P<area>[a-z]+)/layout/(?P<path>.+)$#i'; + if (preg_match($regex, $moduleFile, $matches)) { + $files[] = [ + $matches['area'], + '', + $moduleName, + $matches['path'], + $moduleFile, + ]; + } else { + throw new \UnexpectedValueException("Could not parse modular layout file '$moduleFile'"); + } + } + } else { + $files = array_merge($files, $moduleFiles); + } + } + } + return $files; } /** - * Parse meta-info of a layout file in theme + * Collect layout files from themes * - * @param string $file - * @param string $path + * @param array $params + * @param string $location * @return array */ - protected function _parseThemeLayout($file, $path) + private function collectThemeLayoutFiles(array $params, $location) { - $appDesign = preg_quote("{$path}/app/design/", '/'); - $invariant = '/^' . $appDesign . '([a-z\d]+)\/([a-z\d]+)\/([a-z\d_]+)\/([a-z\d]+_[a-z\d]+)\/layout\/'; - if (preg_match($invariant . 'override\/base\/(.+)$/i', $file, $matches)) { - list(, $area, $themeNS, $themeCode, $module, $filePath) = $matches; - return [$area, $themeNS . '/' . $themeCode, $module, $filePath]; - } - if (preg_match($invariant . 'override\/theme\/[a-z\d_]+\/[a-z\d_]+\/(.+)$/i', $file, $matches)) { - list(, $area, $themeNS, $themeCode, $module, $filePath) = $matches; - return [$area, $themeNS . '/' . $themeCode, $module, $filePath]; - } - preg_match($invariant . '(.+)$/i', $file, $matches); - list(, $area, $themeNS, $themeCode, $module, $filePath) = $matches; - return [$area, $themeNS . '/' . $themeCode, $module, $filePath, $file]; + $files = []; + $area = $params['area']; + $requiredModuleName = $params['namespace'] . '_' . $params['module']; + $themePath = $params['theme_path']; + foreach ($this->themePackageList->getThemes() as $theme) { + $currentThemePath = str_replace(DIRECTORY_SEPARATOR, '/', $theme->getPath()); + $currentThemeCode = $theme->getVendor() . '/' . $theme->getName(); + if (($area == '*' || $theme->getArea() === $area) + && ($themePath == '*' || $themePath == '*/*' || $themePath == $currentThemeCode) + ) { + $themeFiles = []; + $this->_accumulateFilesByPatterns( + [$currentThemePath . "/{$requiredModuleName}/{$location}"], + '*.xml', + $themeFiles + ); + + if ($params['with_metainfo']) { + $files = array_merge($this->parseThemeFiles($themeFiles, $currentThemePath, $theme)); + } else { + $files = array_merge($files, $themeFiles); + } + } + } + return $files; + } + + /** + * @param array $themeFiles + * @param string $currentThemePath + * @param ThemePackage $theme + * @return array + */ + private function parseThemeFiles($themeFiles, $currentThemePath, $theme) + { + $files = []; + $regex = '#^' . $currentThemePath + . '/(?P<module>[a-z\d]+_[a-z\d]+)/layout/(override/((base/)|(theme/[a-z\d_]+/[a-z\d_]+/)))?' + . '(?P<path>.+)$#i'; + foreach ($themeFiles as $themeFile) { + if (preg_match($regex, $themeFile, $matches)) { + $files[] = [ + $theme->getArea(), + $theme->getVendor() . '/' . $theme->getName(), + $matches['module'], + $matches['path'], + $themeFile, + ]; + } else { + throw new \UnexpectedValueException("Could not parse theme layout file '$themeFile'"); + } + } + return $files; } /** @@ -469,22 +627,19 @@ class Files */ public function getPageTypeFiles($incomingParams = [], $asDataSet = true) { - $params = ['namespace' => '*', 'module' => '*', 'area' => '*', 'theme_path' => '*/*']; + $params = ['namespace' => '*', 'module' => '*', 'area' => '*']; foreach (array_keys($params) as $key) { if (isset($incomingParams[$key])) { $params[$key] = $incomingParams[$key]; } } - $cacheKey = md5($this->_path . '|' . implode('|', $params)); + $cacheKey = md5(BP . '|' . implode('|', $params)); if (!isset(self::$_cache[__METHOD__][$cacheKey])) { - $files = []; - $files = self::getFiles( - ["{$this->_path}/app/code/{$params['namespace']}/{$params['module']}" . "/etc/{$params['area']}"], + self::$_cache[__METHOD__][$cacheKey] = self::getFiles( + $this->getEtcAreaPaths($params['namespace'], $params['module'], $params['area']), 'page_types.xml' ); - - self::$_cache[__METHOD__][$cacheKey] = $files; } if ($asDataSet) { @@ -493,6 +648,28 @@ class Files return self::$_cache[__METHOD__][$cacheKey]; } + /** + * Get module etc paths for specified area + * + * @param string $namespace + * @param string $module + * @param string $area + * @return array + */ + private function getEtcAreaPaths($namespace, $module, $area) + { + $etcAreaPaths = []; + foreach ($this->componentRegistrar->getPaths(ComponentRegistrar::MODULE) as $moduleName => $moduleDir) { + $keyInfo = explode('_', $moduleName); + if ($keyInfo[0] == $namespace || $namespace == '*') { + if ($keyInfo[1] == $module || $module == '*') { + $etcAreaPaths[] = $moduleDir . "/etc/{$area}"; + } + } + } + return $etcAreaPaths; + } + /** * Returns list of Javascript files in Magento * @@ -504,17 +681,28 @@ class Files */ public function getJsFiles($area = '*', $themePath = '*/*', $namespace = '*', $module = '*') { - $key = $area . $themePath . $namespace . $module . __METHOD__ . $this->_path; + $key = $area . $themePath . $namespace . $module . __METHOD__ . BP; if (isset(self::$_cache[$key])) { return self::$_cache[$key]; } + $moduleWebPaths = []; + foreach ($this->componentRegistrar->getPaths(ComponentRegistrar::MODULE) as $moduleName => $moduleDir) { + $keyInfo = explode('_', $moduleName); + if ($keyInfo[0] == $namespace || $namespace == '*') { + if ($keyInfo[1] == $module || $module == '*') { + $moduleWebPaths[] = $moduleDir . "/view/{$area}/web"; + } + } + } + $themePaths = $this->getThemePaths($area, $namespace . '_' . $module, '/web'); $files = self::getFiles( - [ - "{$this->_path}/app/code/{$namespace}/{$module}/view/{$area}/web", - "{$this->_path}/app/design/{$area}/{$themePath}/web", - "{$this->_path}/app/design/{$area}/{$themePath}/{$module}/web", - "{$this->_path}/lib/web/{mage,varien}" - ], + array_merge( + [ + BP . "/lib/web/{mage,varien}" + ], + $themePaths, + $moduleWebPaths + ), '*.js' ); $result = self::composeDataSets($files); @@ -522,6 +710,24 @@ class Files return $result; } + /** + * @param string $area + * @param string $module + * @param string $subFolder + * @return array + */ + private function getThemePaths($area, $module, $subFolder) + { + $themePaths = []; + foreach ($this->themePackageList->getThemes() as $theme) { + if ($area == '*' || $theme->getArea() === $area) { + $themePaths[] = $theme->getPath() . $subFolder; + $themePaths[] = $theme->getPath() . "/{$module}" . $subFolder; + } + } + return $themePaths; + } + /** * Returns list of Static HTML files in Magento * @@ -533,16 +739,25 @@ class Files */ public function getStaticHtmlFiles($area = '*', $themePath = '*/*', $namespace = '*', $module = '*') { - $key = $area . $themePath . $namespace . $module . __METHOD__ . $this->_path; + $key = $area . $themePath . $namespace . $module . __METHOD__ . BP; if (isset(self::$_cache[$key])) { return self::$_cache[$key]; } + $moduleTemplatePaths = []; + foreach ($this->componentRegistrar->getPaths(ComponentRegistrar::MODULE) as $moduleName => $moduleDir) { + $keyInfo = explode('_', $moduleName); + if ($keyInfo[0] == $namespace || $namespace == '*') { + if ($keyInfo[1] == $module || $module == '*') { + $moduleTemplatePaths[] = $moduleDir . "/view/{$area}/web/template"; + } + } + } + $themePaths = $this->getThemePaths($area, $namespace . '_' . $module, '/web/template'); $files = self::getFiles( - [ - "{$this->_path}/app/code/{$namespace}/{$module}/view/{$area}/web/template", - "{$this->_path}/app/design/{$area}/{$themePath}/web/template", - "{$this->_path}/app/design/{$area}/{$themePath}/{$module}/web/template" - ], + array_merge( + $themePaths, + $moduleTemplatePaths + ), '*.html' ); $result = self::composeDataSets($files); @@ -551,57 +766,77 @@ class Files } /** - * Get list of static view files that are subject of Magento static view files preprocessing system + * Get list of static view files that are subject of Magento static view files pre-processing system * * @param string $filePattern * @return array */ public function getStaticPreProcessingFiles($filePattern = '*') { - $key = __METHOD__ . $this->_path . '|' . $filePattern; + $key = __METHOD__ . BP . '|' . $filePattern; if (isset(self::$_cache[$key])) { return self::$_cache[$key]; } - $namespace = '*'; - $module = '*'; $area = '*'; - $themePath = '*/*'; $locale = '*'; $result = []; - $this->_accumulateFilesByPatterns( - ["{$this->_path}/app/code/{$namespace}/{$module}/view/{$area}/web"], - $filePattern, - $result, - '_parseModuleStatic' - ); - $this->_accumulateFilesByPatterns( - ["{$this->_path}/app/code/{$namespace}/{$module}/view/{$area}/web/i18n/{$locale}"], - $filePattern, - $result, - '_parseModuleLocaleStatic' - ); - $this->_accumulateFilesByPatterns( - [ - "{$this->_path}/app/design/{$area}/{$themePath}/web", - "{$this->_path}/app/design/{$area}/{$themePath}/{$module}/web", - ], - $filePattern, - $result, - '_parseThemeStatic' - ); - $this->_accumulateFilesByPatterns( - [ - "{$this->_path}/app/design/{$area}/{$themePath}/web/i18n/{$locale}", - "{$this->_path}/app/design/{$area}/{$themePath}/{$module}/web/i18n/{$locale}", - ], - $filePattern, - $result, - '_parseThemeLocaleStatic' - ); + $moduleWebPath = []; + $moduleLocalePath = []; + foreach ($this->componentRegistrar->getPaths(ComponentRegistrar::MODULE) as $moduleDir) { + $moduleWebPath[] = $moduleDir . "/view/{$area}/web"; + $moduleLocalePath[] = $moduleDir . "/view/{$area}/web/i18n/{$locale}"; + } + + $this->_accumulateFilesByPatterns($moduleWebPath, $filePattern, $result, '_parseModuleStatic'); + $this->_accumulateFilesByPatterns($moduleLocalePath, $filePattern, $result, '_parseModuleLocaleStatic'); + $this->accumulateThemeStaticFiles($area, $locale, $filePattern, $result); self::$_cache[$key] = $result; return $result; } + /** + * Accumulate files from themes + * + * @param string $area + * @param string $locale + * @param string $filePattern + * @param array $result + * @return void + */ + private function accumulateThemeStaticFiles($area, $locale, $filePattern, &$result) + { + foreach ($this->themePackageList->getThemes() as $themePackage) { + $themeArea = $themePackage->getArea(); + if ($area == '*' || $area == $themeArea) { + $files = []; + $themePath = str_replace(DIRECTORY_SEPARATOR, '/', $themePackage->getPath()); + $paths = [ + $themePath . "/web", + $themePath . "/*_*/web", + $themePath . "/web/i18n/{$locale}", + $themePath . "/*_*/web/i18n/{$locale}" + ]; + $this->_accumulateFilesByPatterns($paths, $filePattern, $files); + $regex = '#^' . $themePath . + '/((?P<module>[a-z\d]+_[a-z\d]+)/)?web/(i18n/(?P<locale>[a-z_]+)/)?(?P<path>.+)$#i'; + foreach ($files as $file) { + if (preg_match($regex, $file, $matches)) { + $result[] = [ + $themeArea, + $themePackage->getVendor() . '/' . $themePackage->getName(), + $matches['locale'], + $matches['module'], + $matches['path'], + $file, + ]; + } else { + throw new \UnexpectedValueException("Could not parse theme static file '$file'"); + } + } + } + } + } + /** * Get all files from static library directory * @@ -610,7 +845,7 @@ class Files public function getStaticLibraryFiles() { $result = []; - $this->_accumulateFilesByPatterns(["{$this->_path}/lib/web"], '*', $result, '_parseLibStatic'); + $this->_accumulateFilesByPatterns([BP . "/lib/web"], '*', $result, '_parseLibStatic'); return $result; } @@ -638,7 +873,7 @@ class Files */ protected function _accumulateFilesByPatterns(array $patterns, $filePattern, array &$result, $subroutine = false) { - $path = str_replace(DIRECTORY_SEPARATOR, '/', $this->_path); + $path = str_replace(DIRECTORY_SEPARATOR, '/', BP); foreach (self::getFiles($patterns, $filePattern) as $file) { $file = str_replace(DIRECTORY_SEPARATOR, '/', $file); if ($subroutine) { @@ -653,93 +888,40 @@ class Files * Parse meta-info of a static file in module * * @param string $file - * @param string $path * @return array */ - protected function _parseModuleStatic($file, $path) + protected function _parseModuleStatic($file) { - preg_match( - '/^' . preg_quote("{$path}/app/code/", '/') . '([a-z\d]+)\/([a-z\d]+)\/view\/([a-z]+)\/web\/(.+)$/i', - $file, - $matches - ); - list(, $namespace, $module, $area, $filePath) = $matches; - return [$area, '', '', $namespace . '_' . $module, $filePath, $file]; + foreach ($this->componentRegistrar->getPaths(ComponentRegistrar::MODULE) as $moduleName => $modulePath) { + if (preg_match( + '/^' . preg_quote("{$modulePath}/", '/') . 'view\/([a-z]+)\/web\/(.+)$/i', + $file, + $matches + ) === 1 + ) { + list(, $area, $filePath) = $matches; + return [$area, '', '', $moduleName, $filePath, $file]; + } + } + return []; } /** * Parse meta-info of a localized (translated) static file in module * * @param string $file - * @param string $path - * @return array - */ - protected function _parseModuleLocaleStatic($file, $path) - { - $appCode = preg_quote("{$path}/app/code/", '/'); - preg_match( - '/^' . $appCode . '([a-z\d]+)\/([a-z\d]+)\/view\/([a-z]+)\/web\/i18n\/([a-z_]+)\/(.+)$/i', - $file, - $matches - ); - list(, $namespace, $module, $area, $locale, $filePath) = $matches; - return [$area, '', $locale, $namespace . '_' . $module, $filePath, $file]; - } - - /** - * Parse meta-info of a static file in theme - * - * @param string $file - * @param string $path * @return array */ - protected function _parseThemeStatic($file, $path) + protected function _parseModuleLocaleStatic($file) { - $appDesign = preg_quote("{$path}/app/design/", '/'); - if (preg_match( - '/^' . $appDesign . '([a-z\d]+)\/([a-z\d]+)\/([a-z\d_]+)\/([a-z\d]+_[a-z\d]+)\/web\/(.+)$/i', - $file, - $matches - )) { - list(, $area, $themeNS, $themeCode, $module, $filePath) = $matches; - return [$area, $themeNS . '/' . $themeCode, '', $module, $filePath, $file]; - } - - preg_match( - '/^' . $appDesign . '([a-z\d]+)\/([a-z\d]+)\/([a-z\d_]+)\/web\/(.+)$/i', - $file, - $matches - ); - list(, $area, $themeNS, $themeCode, $filePath) = $matches; - return [$area, $themeNS . '/' . $themeCode, '', '', $filePath, $file]; - } - - /** - * Parse meta-info of a localized (translated) static file in theme - * - * @param string $file - * @param string $path - * @return array - */ - protected function _parseThemeLocaleStatic($file, $path) - { - $design = preg_quote("{$path}/app/design/", '/'); - if (preg_match( - '/^' . $design. '([a-z\d]+)\/([a-z\d]+)\/([a-z\d_]+)\/([a-z\d]+_[a-z\d]+)\/web\/i18n\/([a-z_]+)\/(.+)$/i', - $file, - $matches - )) { - list(, $area, $themeNS, $themeCode, $module, $locale, $filePath) = $matches; - return [$area, $themeNS . '/' . $themeCode, $locale, $module, $filePath, $file]; - } - - preg_match( - '/^' . $design . '([a-z\d]+)\/([a-z\d]+)\/([a-z\d_]+)\/web\/i18n\/([a-z_]+)\/(.+)$/i', - $file, - $matches - ); - list(, $area, $themeNS, $themeCode, $locale, $filePath) = $matches; - return [$area, $themeNS . '/' . $themeCode, $locale, '', $filePath, $file]; + foreach ($this->componentRegistrar->getPaths(ComponentRegistrar::MODULE) as $moduleName => $modulePath) { + $appCode = preg_quote("{$modulePath}/", '/'); + if (preg_match('/^' . $appCode . 'view\/([a-z]+)\/web\/i18n\/([a-z_]+)\/(.+)$/i', $file, $matches) === 1) { + list(, $area, $locale, $filePath) = $matches; + return [$area, '', $locale, $moduleName, $filePath, $file]; + } + } + return []; } /** @@ -750,24 +932,31 @@ class Files */ public function getJsFilesForArea($area) { - $key = __METHOD__ . $this->_path . $area; + $key = __METHOD__ . BP . $area; if (isset(self::$_cache[$key])) { return self::$_cache[$key]; } - $namespace = $module = '*'; - $themePath = '*/*'; + $viewAreaPaths = []; + foreach ($this->componentRegistrar->getPaths(ComponentRegistrar::MODULE) as $moduleDir) { + $viewAreaPaths[] = $moduleDir . "/view/{$area}"; + } + $themePaths = []; + foreach ($this->themePackageList->getThemes() as $theme) { + if ($area == '*' || $theme->getArea() === $area) { + $themePaths[] = $theme->getPath(); + } + } $paths = [ - "{$this->_path}/app/code/{$namespace}/{$module}/view/{$area}", - "{$this->_path}/app/design/{$area}/{$themePath}", - "{$this->_path}/lib/web/varien" + BP . "/lib/web/varien" ]; + $paths = array_merge($paths, $viewAreaPaths, $themePaths); $files = self::getFiles($paths, '*.js'); if ($area == 'adminhtml') { - $adminhtmlPaths = ["{$this->_path}/lib/web/mage/{adminhtml,backend}"]; + $adminhtmlPaths = [BP . "/lib/web/mage/{adminhtml,backend}"]; $files = array_merge($files, self::getFiles($adminhtmlPaths, '*.js')); } else { - $frontendPaths = ["{$this->_path}/lib/web/mage"]; + $frontendPaths = [BP . "/lib/web/mage"]; /* current structure of /lib/web/mage directory contains frontend javascript in the root, backend javascript in subdirectories. That's why script shouldn't go recursive throught subdirectories to get js files for frontend */ @@ -787,25 +976,11 @@ class Files */ public function getPhtmlFiles($withMetaInfo = false, $asDataSet = true) { - $key = __METHOD__ . $this->_path . '|' . (int)$withMetaInfo; + $key = __METHOD__ . BP . '|' . (int)$withMetaInfo; if (!isset(self::$_cache[$key])) { - $namespace = '*'; - $module = '*'; - $area = '*'; - $themePath = '*/*'; $result = []; - $this->_accumulateFilesByPatterns( - ["{$this->_path}/app/code/{$namespace}/{$module}/view/{$area}/templates"], - '*.phtml', - $result, - $withMetaInfo ? '_parseModuleTemplate' : false - ); - $this->_accumulateFilesByPatterns( - ["{$this->_path}/app/design/{$area}/{$themePath}/{$namespace}_{$module}/templates"], - '*.phtml', - $result, - $withMetaInfo ? '_parseThemeTemplate' : false - ); + $this->accumulateModuleTemplateFiles($withMetaInfo, $result); + $this->accumulateThemeTemplateFiles($withMetaInfo, $result); self::$_cache[$key] = $result; } if ($asDataSet) { @@ -815,40 +990,80 @@ class Files } /** - * Parse meta-information from a modular template file + * Collect templates from themes * - * @param string $file - * @param string $path - * @return array + * @param bool $withMetaInfo + * @param array $result + * @return void */ - protected function _parseModuleTemplate($file, $path) + private function accumulateThemeTemplateFiles($withMetaInfo, array &$result) { - preg_match( - '/^' . preg_quote("{$path}/app/code/", '/') . '([a-z\d]+)\/([a-z\d]+)\/view\/([a-z]+)\/templates\/(.+)$/i', - $file, - $matches - ); - list(, $namespace, $module, $area, $filePath) = $matches; - return [$area, '', $namespace . '_' . $module, $filePath, $file]; + foreach ($this->themePackageList->getThemes() as $theme) { + $files = []; + $this->_accumulateFilesByPatterns( + [$theme->getPath() . '/*_*/templates'], + '*.phtml', + $files + ); + if ($withMetaInfo) { + $regex = '#^' . str_replace(DIRECTORY_SEPARATOR, '/', $theme->getPath()) + . '/(?P<module>[a-z\d]+_[a-z\d]+)/templates/(?P<path>.+)$#i'; + foreach ($files as $file) { + if (preg_match($regex, $file, $matches)) { + $result[] = [ + $theme->getArea(), + $theme->getVendor() . '/' . $theme->getName(), + $matches['module'], + $matches['path'], + $file, + ]; + } else { + echo $regex . " - " . $file . "\n"; + throw new \UnexpectedValueException("Could not parse theme template file '$file'"); + } + } + } else { + $result = array_merge($result, $files); + } + } } /** - * Parse meta-information from a theme template file + * Collect templates from modules * - * @param string $file - * @param string $path - * @return array + * @param bool $withMetaInfo + * @param array $result + * @return void */ - protected function _parseThemeTemplate($file, $path) + private function accumulateModuleTemplateFiles($withMetaInfo, array &$result) { - $appDesign = preg_quote("{$path}/app/design/", '/'); - preg_match( - '/^' . $appDesign . '([a-z\d]+)\/([a-z\d]+)\/([a-z\d_]+)\/([a-z\d]+_[a-z\d]+)\/templates\/(.+)$/i', - $file, - $matches - ); - list(, $area, $themeNS, $themeCode, $module, $filePath) = $matches; - return [$area, $themeNS . '/' . $themeCode, $module, $filePath, $file]; + foreach ($this->componentRegistrar->getPaths(ComponentRegistrar::MODULE) as $moduleName => $moduleDir) { + $files = []; + $this->_accumulateFilesByPatterns( + [$moduleDir . "/view/*/templates"], + '*.phtml', + $files + ); + if ($withMetaInfo) { + $modulePath = str_replace(DIRECTORY_SEPARATOR, '/', preg_quote($moduleDir, '#')); + $regex = '#^' . $modulePath . '/view/(?P<area>[a-z]+)/templates/(?P<path>.+)$#i'; + foreach ($files as $file) { + if (preg_match($regex, $file, $matches)) { + $result[] = [ + $matches['area'], + '', + $moduleName, + $matches['path'], + $file, + ]; + } else { + throw new \UnexpectedValueException("Could not parse module template file '$file'"); + } + } + } else { + $result = array_merge($result, $files); + } + } } /** @@ -858,11 +1073,15 @@ class Files */ public function getEmailTemplates() { - $key = __METHOD__ . $this->_path; + $key = __METHOD__ . BP; if (isset(self::$_cache[$key])) { return self::$_cache[$key]; } - $files = self::getFiles([$this->_path . '/app/code/*/*/view/email'], '*.html'); + $moduleEmailPaths = []; + foreach ($this->componentRegistrar->getPaths(ComponentRegistrar::MODULE) as $moduleDir) { + $moduleEmailPaths[] = $moduleDir . "/view/email"; + } + $files = self::getFiles($moduleEmailPaths, '*.html'); $result = self::composeDataSets($files); self::$_cache[$key] = $result; return $result; @@ -876,22 +1095,20 @@ class Files */ public function getAllFiles() { - $key = __METHOD__ . $this->_path; + $key = __METHOD__ . BP; if (isset(self::$_cache[$key])) { return self::$_cache[$key]; } - $subFiles = self::getFiles( - [ - $this->_path . '/app', - $this->_path . '/dev', - $this->_path . '/lib', - $this->_path . '/pub' - ], - '*' + $paths = array_merge( + [BP . '/app', BP . '/dev', BP . '/lib', BP . '/pub'], + $this->componentRegistrar->getPaths(ComponentRegistrar::LANGUAGE), + $this->componentRegistrar->getPaths(ComponentRegistrar::THEME), + $this->getPaths() ); + $subFiles = self::getFiles($paths, '*'); - $rootFiles = glob($this->_path . '/*', GLOB_NOSORT); + $rootFiles = glob(BP . '/*', GLOB_NOSORT); $rootFiles = array_filter( $rootFiles, function ($file) { @@ -918,6 +1135,7 @@ class Files { $result = []; foreach ($dirPatterns as $oneDirPattern) { + $oneDirPattern = str_replace('\\', '/', $oneDirPattern); $entriesInDir = glob("{$oneDirPattern}/{$fileNamePattern}", GLOB_NOSORT | GLOB_BRACE); $subDirs = glob("{$oneDirPattern}/*", GLOB_ONLYDIR | GLOB_NOSORT | GLOB_BRACE); $filesInDir = array_diff($entriesInDir, $subDirs); @@ -938,8 +1156,11 @@ class Files */ public function getDiConfigs($asDataSet = false) { - $primaryConfigs = glob($this->_path . '/app/etc/{di.xml,*/di.xml}', GLOB_BRACE); - $moduleConfigs = glob($this->_path . '/app/code/*/*/etc/{di,*/di}.xml', GLOB_BRACE); + $primaryConfigs = glob(BP . '/app/etc/{di.xml,*/di.xml}', GLOB_BRACE); + $moduleConfigs = []; + foreach ($this->componentRegistrar->getPaths(ComponentRegistrar::MODULE) as $moduleDir) { + $moduleConfigs = array_merge($moduleConfigs, glob($moduleDir . '/etc/{di,*/di}.xml', GLOB_BRACE)); + } $configs = array_merge($primaryConfigs, $moduleConfigs); if ($asDataSet) { @@ -953,6 +1174,23 @@ class Files return $configs; } + /** + * Get module and library paths + * + * @return array + */ + private function getPaths() + { + $directories = []; + foreach ($this->componentRegistrar->getPaths(ComponentRegistrar::MODULE) as $fullModuleDir) { + $directories[] = $fullModuleDir; + } + foreach ($this->componentRegistrar->getPaths(ComponentRegistrar::LIBRARY) as $libraryDir) { + $directories[] = $libraryDir; + } + return $directories; + } + /** * Check if specified class exists * @@ -970,43 +1208,41 @@ class Files $namespace = implode('\\', $classParts); $path = implode('/', explode('\\', $class)) . '.php'; $directories = [ - '/app/code/', - '/lib/internal/', - '/dev/tools/', - '/dev/tests/api-functional/framework/', - '/dev/tests/integration/framework/', - '/dev/tests/integration/framework/tests/unit/testsuite/', - '/dev/tests/integration/testsuite/', - '/dev/tests/integration/testsuite/Magento/Test/Integrity/', - '/dev/tests/static/framework/', - '/dev/tests/static/testsuite/', - '/dev/tests/functional/tests/app/', - '/setup/src/' + '/dev/tools', + '/dev/tests/api-functional/framework', + '/dev/tests/integration/framework', + '/dev/tests/integration/framework/tests/unit/testsuite', + '/dev/tests/integration/testsuite', + '/dev/tests/integration/testsuite/Magento/Test/Integrity', + '/dev/tests/static/framework', + '/dev/tests/static/testsuite', + '/dev/tests/functional/tests/app', + '/setup/src' ]; + foreach ($directories as $key => $dir) { + $directories[$key] = BP . $dir; + } + + $directories = array_merge($directories, $this->getPaths()); foreach ($directories as $dir) { - $fullPath = $this->_path . $dir . $path; - /** - * Use realpath() instead of file_exists() to avoid incorrect work on Windows because of case insensitivity - * of file names - * Note that realpath() automatically changes directory separator to the OS-native - * Since realpath won't work with symlinks we also check file_exists if realpath failed - */ - if (realpath($fullPath) == str_replace(['/', '\\'], DIRECTORY_SEPARATOR, $fullPath) - || file_exists($fullPath) - ) { - $fileContent = file_get_contents($fullPath); - if (strpos( - $fileContent, - 'namespace ' . $namespace - ) !== false && (strpos( - $fileContent, - 'class ' . $className - ) !== false || strpos( - $fileContent, - 'interface ' . $className - ) !== false) - ) { + $fullPath = $dir . '/' . $path; + if ($this->classFileExistsCheckContent($fullPath, $namespace, $className)) { + return true; + } + $classParts = explode('/', $path, 3); + if (count($classParts) >= 3) { + // Check if it's PSR-4 class with trimmed vendor and package name parts + $trimmedFullPath = $dir . '/' . $classParts[2]; + if ($this->classFileExistsCheckContent($trimmedFullPath, $namespace, $className)) { + return true; + } + } + $classParts = explode('/', $path, 4); + if (count($classParts) >= 4) { + // Check if it's a library under framework directory + $trimmedFullPath = $dir . '/' . $classParts[3]; + if ($this->classFileExistsCheckContent($trimmedFullPath, $namespace, $className)) { return true; } } @@ -1014,6 +1250,36 @@ class Files return false; } + /** + * Helper function for classFileExists to check file content + * + * @param string $fullPath + * @param string $namespace + * @param string $className + * @return bool + */ + private function classFileExistsCheckContent($fullPath, $namespace, $className) + { + /** + * Use realpath() instead of file_exists() to avoid incorrect work on Windows + * because of case insensitivity of file names + * Note that realpath() automatically changes directory separator to the OS-native + * Since realpath won't work with symlinks we also check file_exists if realpath failed + */ + if (realpath($fullPath) == str_replace(['/', '\\'], DIRECTORY_SEPARATOR, $fullPath) + || file_exists($fullPath) + ) { + $fileContent = file_get_contents($fullPath); + if (strpos($fileContent, 'namespace ' . $namespace) !== false + && (strpos($fileContent, 'class ' . $className) !== false + || strpos($fileContent, 'interface ' . $className) !== false) + ) { + return true; + } + } + return false; + } + /** * Return list of declared namespaces * @@ -1021,19 +1287,18 @@ class Files */ public function getNamespaces() { - $key = __METHOD__ . $this->_path; + $key = __METHOD__ . BP; if (isset(self::$_cache[$key])) { return self::$_cache[$key]; } - $iterator = new \DirectoryIterator($this->_path . '/app/code/'); $result = []; - foreach ($iterator as $file) { - if (!$file->isDot() && !in_array($file->getFilename(), ['Zend']) && $file->isDir()) { - $result[] = $file->getFilename(); + foreach (array_keys($this->componentRegistrar->getPaths(ComponentRegistrar::MODULE)) as $moduleName) { + $namespace = explode('_', $moduleName)[0]; + if (!in_array($namespace, $result) && $namespace !== 'Zend') { + $result[] = $namespace; } } - self::$_cache[$key] = $result; return $result; } @@ -1046,20 +1311,8 @@ class Files */ public function getModuleFile($namespace, $module, $file) { - return $this->_path . '/app/code/' . $namespace . '/' . $module . '/' . $file; - } - - /** - * Helper function for finding config files in various app directories such as 'code' or 'design'. - * - * @param string $fileNamePattern can be a glob pattern that represents files to be found. - * @param string $appDir directory under app folder in which to search (Ex: 'code' or 'design') - * @return array of strings that represent paths to config files - */ - protected function _getConfigFilesList($fileNamePattern, $appDir) - { - $pathPattern = $appDir == 'design' ? "/*/*/*/etc/{$fileNamePattern}" : "/*/*/etc/{$fileNamePattern}"; - return glob($this->_path . '/app/' . $appDir . $pathPattern, GLOB_NOSORT | GLOB_BRACE); + return $this->componentRegistrar->getPath(ComponentRegistrar::MODULE, $namespace . '_' . $module) . + '/' . $file; } /** @@ -1073,7 +1326,10 @@ class Files { $key = __METHOD__ . "/{$module}"; if (!isset(self::$_cache[$key])) { - $files = self::getFiles(["{$this->_path}/app/code/Magento/{$module}"], '*.php'); + $files = self::getFiles( + [$this->componentRegistrar->getPath(ComponentRegistrar::MODULE, 'Magento_'. $module)], + '*.php' + ); self::$_cache[$key] = $files; } @@ -1085,17 +1341,23 @@ class Files } /** - * Returns array of composer.json for specified app directory, such as code/Magento, design, i18n + * Returns array of composer.json for components of specified type * - * @param string $appDir + * @param string $componentType * @param bool $asDataSet * @return array */ - public function getComposerFiles($appDir, $asDataSet = true) + public function getComposerFiles($componentType, $asDataSet = true) { - $key = __METHOD__ . '|' . $this->_path . '|' . serialize(func_get_args()); + $key = __METHOD__ . '|' . BP . '|' . serialize(func_get_args()); if (!isset(self::$_cache[$key])) { - $files = $this->getFilesSubset(["{$this->_path}/app/{$appDir}"], 'composer.json', $this->moduleTestDirs); + $excludes = $componentType == ComponentRegistrar::MODULE ? $this->getModuleTestDirsRegex() : []; + $files = $this->getFilesSubset( + $this->componentRegistrar->getPaths($componentType), + 'composer.json', + $excludes + ); + self::$_cache[$key] = $files; } @@ -1115,32 +1377,81 @@ class Files * @return array * @throws \Exception if any of the patterns don't return any result */ - public static function readLists($globPattern) + public function readLists($globPattern) { $patterns = []; foreach (glob($globPattern) as $list) { - $patterns = array_merge($patterns, file($list, FILE_IGNORE_NEW_LINES)); + $patterns = array_merge($patterns, file($list, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES)); } // Expand glob patterns $result = []; + $incorrectPatterns = []; foreach ($patterns as $pattern) { if (0 === strpos($pattern, '#')) { continue; } - /** - * Note that glob() for directories will be returned as is, - * but passing directory is supported by the tools (phpcpd, phpmd, phpcs) - */ - $files = glob(self::init()->getPathToSource() . '/' . $pattern, GLOB_BRACE); + $patternParts = explode(' ', $pattern); + if (count($patternParts) == 3) { + list($componentType, $componentName, $pathPattern) = $patternParts; + $files = $this->getPathByComponentPattern($componentType, $componentName, $pathPattern); + } elseif (count($patternParts) == 1) { + /** + * Note that glob() for directories will be returned as is, + * but passing directory is supported by the tools (phpcpd, phpmd, phpcs) + */ + $files = glob($this->getPathToSource() . '/' . $pattern, GLOB_BRACE); + } else { + throw new \UnexpectedValueException( + "Incorrect pattern record '$pattern'. Supported formats: " + . "'<componentType> <componentName> <glob_pattern>' or '<glob_pattern>'" + ); + } if (empty($files)) { - continue; + $incorrectPatterns[] = $pattern; } $result = array_merge($result, $files); } + if (!empty($incorrectPatterns)) { + throw new \Exception("The following patterns didn't return any result:\n" . join("\n", $incorrectPatterns)); + } return $result; } + /** + * Get paths by pattern for specified component component + * + * @param string $componentType + * @param string $componentName + * @param string $pathPattern + * @return array + */ + private function getPathByComponentPattern($componentType, $componentName, $pathPattern) + { + $files = []; + if ($componentType == '*') { + $componentTypes = [ + ComponentRegistrar::MODULE, + ComponentRegistrar::LIBRARY, + ComponentRegistrar::THEME, + ComponentRegistrar::LANGUAGE, + ]; + } else { + $componentTypes = [$componentType]; + } + foreach ($componentTypes as $type) { + if ($componentName == '*') { + $files = array_merge($files, $this->dirSearch->collectFiles($type, $pathPattern)); + } else { + $componentDir = $this->componentRegistrar->getPath($type, $componentName); + if (!empty($componentDir)) { + $files = array_merge($files, glob($componentDir . '/' . $pathPattern, GLOB_BRACE)); + } + } + } + return $files; + } + /** * Check module existence * @@ -1151,8 +1462,9 @@ class Files { $key = __METHOD__ . "/{$moduleName}"; if (!isset(self::$_cache[$key])) { - list($namespace, $module) = explode('_', $moduleName); - self::$_cache[$key] = file_exists("{$this->_path}/app/code/{$namespace}/{$module}"); + self::$_cache[$key] = file_exists( + $this->componentRegistrar->getPath(ComponentRegistrar::MODULE, $moduleName) + ); } return self::$_cache[$key]; diff --git a/lib/internal/Magento/Framework/App/etc/resources.xsd b/lib/internal/Magento/Framework/App/etc/resources.xsd index ee95beeea44f6a8c30424f5bc466a3ea2efe05a2..4bd59f3d2f416ae32f9a0ed90e81924e8357cf88 100644 --- a/lib/internal/Magento/Framework/App/etc/resources.xsd +++ b/lib/internal/Magento/Framework/App/etc/resources.xsd @@ -37,11 +37,11 @@ <xs:simpleType name="nameIdentifier"> <xs:annotation> <xs:documentation> - Name identifier can contain only [A-Za-z_]. + Name identifier can contain only [A-Za-z_0-9]. </xs:documentation> </xs:annotation> <xs:restriction base="xs:string"> - <xs:pattern value="[A-Za-z_]+" /> + <xs:pattern value="[A-Za-z_0-9]+" /> </xs:restriction> </xs:simpleType> </xs:schema> diff --git a/lib/internal/Magento/Framework/Autoload/Populator.php b/lib/internal/Magento/Framework/Autoload/Populator.php index 5239669b08cb3e5b8540ff590e5a513087ba413e..6c1730cf1f23bc6b81a20a303c8eb3f3cbc28561 100644 --- a/lib/internal/Magento/Framework/Autoload/Populator.php +++ b/lib/internal/Magento/Framework/Autoload/Populator.php @@ -16,23 +16,19 @@ use Magento\Framework\Filesystem\FileResolver; class Populator { /** - * @param AutoloaderInterface $registry + * @param AutoloaderInterface $autoloader * @param DirectoryList $dirList * @return void */ public static function populateMappings(AutoloaderInterface $autoloader, DirectoryList $dirList) { - $modulesDir = $dirList->getPath(DirectoryList::MODULES); $generationDir = $dirList->getPath(DirectoryList::GENERATION); $frameworkDir = $dirList->getPath(DirectoryList::LIB_INTERNAL); - $autoloader->addPsr4('Magento\\', [$modulesDir . '/Magento/', $generationDir . '/Magento/'], true); + $autoloader->addPsr4('Magento\\', [$generationDir . '/Magento/'], true); - $autoloader->addPsr0('Apache_', $frameworkDir, true); $autoloader->addPsr0('Cm_', $frameworkDir, true); $autoloader->addPsr0('Credis_', $frameworkDir, true); - $autoloader->addPsr0('Less_', $frameworkDir, true); - $autoloader->addPsr0('Symfony\\', $frameworkDir, true); /** Required for Zend functionality */ FileResolver::addIncludePath($frameworkDir); @@ -41,6 +37,6 @@ class Populator FileResolver::addIncludePath($generationDir); /** Required to autoload custom classes */ - $autoloader->addPsr0('', [$modulesDir, $generationDir]); + $autoloader->addPsr0('', [$generationDir]); } } diff --git a/lib/internal/Magento/Framework/Autoload/Test/Unit/PopulatorTest.php b/lib/internal/Magento/Framework/Autoload/Test/Unit/PopulatorTest.php index c5588da7fe57dd3b921e24e26974847105ec6cd8..bbe5b56cebe681af9217c9b0a529554a506daa2e 100644 --- a/lib/internal/Magento/Framework/Autoload/Test/Unit/PopulatorTest.php +++ b/lib/internal/Magento/Framework/Autoload/Test/Unit/PopulatorTest.php @@ -33,25 +33,20 @@ class PopulatorTest extends \PHPUnit_Framework_TestCase $mockAutoloader->expects($this->at(0)) ->method('addPsr4') - ->with('Magento\\', [DirectoryList::MODULES . '/Magento/', DirectoryList::GENERATION . '/Magento/'], true); + ->with( + 'Magento\\', + [DirectoryList::GENERATION . '/Magento/'], + true + ); $mockAutoloader->expects($this->at(1)) - ->method('addPsr0') - ->with('Apache_', DirectoryList::LIB_INTERNAL, true); - $mockAutoloader->expects($this->at(2)) ->method('addPsr0') ->with('Cm_', DirectoryList::LIB_INTERNAL, true); - $mockAutoloader->expects($this->at(3)) + $mockAutoloader->expects($this->at(2)) ->method('addPsr0') ->with('Credis_', DirectoryList::LIB_INTERNAL, true); - $mockAutoloader->expects($this->at(4)) - ->method('addPsr0') - ->with('Less_', DirectoryList::LIB_INTERNAL, true); - $mockAutoloader->expects($this->at(5)) - ->method('addPsr0') - ->with('Symfony\\', DirectoryList::LIB_INTERNAL, true); - $mockAutoloader->expects($this->at(6)) + $mockAutoloader->expects($this->at(3)) ->method('addPsr0') - ->with('', [DirectoryList::MODULES, DirectoryList::GENERATION]); + ->with('', [DirectoryList::GENERATION]); Populator::populateMappings($mockAutoloader, $this->mockDirectoryList); } diff --git a/lib/internal/Magento/Framework/Cache/Config/SchemaLocator.php b/lib/internal/Magento/Framework/Cache/Config/SchemaLocator.php index 279c73e897ca6b010b39567997ccb72278d73ecf..0d4636d691c202184bc2135735805e712bd882af 100644 --- a/lib/internal/Magento/Framework/Cache/Config/SchemaLocator.php +++ b/lib/internal/Magento/Framework/Cache/Config/SchemaLocator.php @@ -9,26 +9,12 @@ namespace Magento\Framework\Cache\Config; class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface { - /** - * Path to corresponding XSD file with validation rules for merged config - * - * @var string - */ - protected $_schema; - - /** - * Path to corresponding XSD file with validation rules for separate config files - * - * @var string - */ - protected $_perFileSchema; + /** @var \Magento\Framework\Config\Dom\UrnResolver */ + protected $urnResolver; - /** - * Constructor - */ - public function __construct() + public function __construct(\Magento\Framework\Config\Dom\UrnResolver $urnResolver) { - $this->_schema = realpath(__DIR__ . '/../etc/cache.xsd'); + $this->urnResolver = $urnResolver; } /** @@ -38,16 +24,16 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface */ public function getSchema() { - return $this->_schema; + return $this->urnResolver->getRealPath('urn:magento:framework:Cache/etc/cache.xsd'); } /** * Get path to pre file validation schema * - * @return string|null + * @return null */ public function getPerFileSchema() { - return $this->_perFileSchema; + return null; } } diff --git a/lib/internal/Magento/Framework/Cache/Test/Unit/Config/SchemaLocatorTest.php b/lib/internal/Magento/Framework/Cache/Test/Unit/Config/SchemaLocatorTest.php index 1e184194ea5e04e42d8fa934eb742c52ab596886..bc9e9d5d4adbb756cb0a33215061b97bedf319f8 100644 --- a/lib/internal/Magento/Framework/Cache/Test/Unit/Config/SchemaLocatorTest.php +++ b/lib/internal/Magento/Framework/Cache/Test/Unit/Config/SchemaLocatorTest.php @@ -7,21 +7,35 @@ namespace Magento\Framework\Cache\Test\Unit\Config; class SchemaLocatorTest extends \PHPUnit_Framework_TestCase { - /** - * @var \Magento\Framework\Cache\Config\SchemaLocator - */ + /** @var \Magento\Framework\Cache\Config\SchemaLocator */ protected $schemaLocator; + /** @var \Magento\Framework\Config\Dom\UrnResolver */ + protected $urnResolver; + + /** @var \Magento\Framework\Config\Dom\UrnResolver */ + protected $urnResolverMock; + public function setUp() { - $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); - - $this->schemaLocator = $objectManager->getObject('Magento\Framework\Cache\Config\SchemaLocator'); + $this->urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + /** @var \Magento\Framework\Config\Dom\UrnResolver $urnResolverMock */ + $this->urnResolverMock = $this->getMock('Magento\Framework\Config\Dom\UrnResolver', [], [], '', false); + $this->schemaLocator = new \Magento\Framework\Cache\Config\SchemaLocator($this->urnResolverMock); } public function testGetSchema() { - $this->assertRegExp('/etc[\/\\\\]cache.xsd/', $this->schemaLocator->getSchema()); + $this->urnResolverMock->expects($this->once()) + ->method('getRealPath') + ->with('urn:magento:framework:Cache/etc/cache.xsd') + ->willReturn( + $this->urnResolver->getRealPath('urn:magento:framework:Cache/etc/cache.xsd') + ); + $this->assertEquals( + $this->urnResolver->getRealPath('urn:magento:framework:Cache/etc/cache.xsd'), + $this->schemaLocator->getSchema() + ); } public function testGetPerFileSchema() diff --git a/lib/internal/Magento/Framework/Cache/Test/Unit/Config/_files/cache_config.xml b/lib/internal/Magento/Framework/Cache/Test/Unit/Config/_files/cache_config.xml index e1ba0c159a2ea67a4ee17174e418a932c8153e72..f9212a7b5fda819fb8c209103faf02556f0651df 100644 --- a/lib/internal/Magento/Framework/Cache/Test/Unit/Config/_files/cache_config.xml +++ b/lib/internal/Magento/Framework/Cache/Test/Unit/Config/_files/cache_config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../lib/internal/Magento/Framework/Cache/etc/cache.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Cache/etc/cache.xsd"> <type name="config" translate="label,description" instance="Magento\Framework\App\Cache\Type\Config"> <label>Configuration</label> <description>Cache Description</description> diff --git a/lib/internal/Magento/Framework/Catalog/README.md b/lib/internal/Magento/Framework/Catalog/README.md new file mode 100644 index 0000000000000000000000000000000000000000..6cb1e7b6ec3b25f2057c1406483448d74b35828b --- /dev/null +++ b/lib/internal/Magento/Framework/Catalog/README.md @@ -0,0 +1 @@ +Library contains schema files used to validate XML files in Magento\Catalog module diff --git a/app/code/Magento/Catalog/etc/view.xsd b/lib/internal/Magento/Framework/Catalog/etc/view.xsd similarity index 96% rename from app/code/Magento/Catalog/etc/view.xsd rename to lib/internal/Magento/Framework/Catalog/etc/view.xsd index b05d57c48422ad78dd9685b2207141af52ee9749..cc9c4fec4a74d3bc4992c2d9f7cc2184e6314960 100644 --- a/app/code/Magento/Catalog/etc/view.xsd +++ b/lib/internal/Magento/Framework/Catalog/etc/view.xsd @@ -6,7 +6,7 @@ */ --> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> - <xs:redefine schemaLocation="../../../../../lib/internal/Magento/Framework/Config/etc/view.xsd"> + <xs:redefine schemaLocation="../../Config/etc/view.xsd"> <xs:complexType name="mediaType" mixed="true"> <xs:complexContent> <xs:extension base="mediaType"> diff --git a/lib/internal/Magento/Framework/Component/ComponentFile.php b/lib/internal/Magento/Framework/Component/ComponentFile.php new file mode 100644 index 0000000000000000000000000000000000000000..ab7bad5dae6a5287715444331f250ac1b6737e22 --- /dev/null +++ b/lib/internal/Magento/Framework/Component/ComponentFile.php @@ -0,0 +1,77 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Framework\Component; + +/** + * Value-object for files found in components + */ +class ComponentFile +{ + /** + * Component type + * + * @var string + */ + private $componentType; + + /** + * Component name + * + * @var string + */ + private $componentName; + + /** + * Full path + * + * @var string + */ + private $path; + + /** + * Constructor + * + * @param string $componentType + * @param string $componentName + * @param string $fullPath + */ + public function __construct($componentType, $componentName, $fullPath) + { + $this->componentType = $componentType; + $this->componentName = $componentName; + $this->path = $fullPath; + } + + /** + * Get component type + * + * @return string + */ + public function getComponentType() + { + return $this->componentType; + } + + /** + * Get component name + * + * @return string + */ + public function getComponentName() + { + return $this->componentName; + } + + /** + * Get full path to the component + * + * @return string + */ + public function getFullPath() + { + return $this->path; + } +} diff --git a/lib/internal/Magento/Framework/Component/ComponentRegistrar.php b/lib/internal/Magento/Framework/Component/ComponentRegistrar.php new file mode 100644 index 0000000000000000000000000000000000000000..c2c928b2376efe8589e86741e5fa8d3df1c4966b --- /dev/null +++ b/lib/internal/Magento/Framework/Component/ComponentRegistrar.php @@ -0,0 +1,86 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Framework\Component; + +/** + * Provides ability to statically register components. + * + * @author Josh Di Fabio <joshdifabio@gmail.com> + */ +class ComponentRegistrar implements ComponentRegistrarInterface +{ + /**#@+ + * Different types of components + */ + const MODULE = 'module'; + const LIBRARY = 'library'; + const THEME = 'theme'; + const LANGUAGE = 'language'; + /**#@- */ + + /** + * All paths + * + * @var array + */ + private static $paths = [ + self::MODULE => [], + self::LIBRARY => [], + self::LANGUAGE => [], + self::THEME => [], + ]; + + /** + * Sets the location of a component. + * + * @param string $type component type + * @param string $componentName Fully-qualified component name + * @param string $path Absolute file path to the component + * @throws \LogicException + * @return void + */ + public static function register($type, $componentName, $path) + { + self::validateType($type); + if (isset(self::$paths[$type][$componentName])) { + throw new \LogicException('\'' . $componentName . '\' component already exists'); + } else { + self::$paths[$type][$componentName] = $path; + } + } + + /** + * {@inheritdoc} + */ + public function getPaths($type) + { + self::validateType($type); + return self::$paths[$type]; + } + + /** + * {@inheritdoc} + */ + public function getPath($type, $componentName) + { + self::validateType($type); + return isset(self::$paths[$type][$componentName]) ? self::$paths[$type][$componentName] : null; + } + + /** + * Checks if type of component is valid + * + * @param string $type + * @return void + * @throws \LogicException + */ + private static function validateType($type) + { + if (!isset(self::$paths[$type])) { + throw new \LogicException('\'' . $type . '\' is not a valid component type'); + } + } +} diff --git a/lib/internal/Magento/Framework/Component/ComponentRegistrarInterface.php b/lib/internal/Magento/Framework/Component/ComponentRegistrarInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..1d83afc66377f30b75912a5c0a17888013e9074e --- /dev/null +++ b/lib/internal/Magento/Framework/Component/ComponentRegistrarInterface.php @@ -0,0 +1,31 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Framework\Component; + +/** + * @author Josh Di Fabio <joshdifabio@gmail.com> + */ +interface ComponentRegistrarInterface +{ + /** + * Get list of registered Magento components + * + * Returns an array where key is fully-qualified component name and value is absolute path to component + * + * @param string $type + * @return array + */ + public function getPaths($type); + + /** + * Get path of a component if it is already registered + * + * @param string $type + * @param string $componentName + * @return null|string + */ + public function getPath($type, $componentName); +} diff --git a/lib/internal/Magento/Framework/Component/DirSearch.php b/lib/internal/Magento/Framework/Component/DirSearch.php new file mode 100644 index 0000000000000000000000000000000000000000..5e1c402ad5ddc29798ff1fe63ce2021759a822b3 --- /dev/null +++ b/lib/internal/Magento/Framework/Component/DirSearch.php @@ -0,0 +1,91 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Framework\Component; + +use Magento\Framework\Filesystem; + +/** + * Class for searching files across all locations of certain component type + */ +class DirSearch +{ + /** + * Component registrar + * + * @var ComponentRegistrarInterface + */ + private $registrar; + + /** + * Read dir factory + * + * @var Filesystem\Directory\ReadFactory + */ + private $readFactory; + + /** + * Constructor + * + * @param ComponentRegistrarInterface $registrar + * @param Filesystem\Directory\ReadFactory $readFactory + */ + public function __construct(ComponentRegistrarInterface $registrar, Filesystem\Directory\ReadFactory $readFactory) + { + $this->registrar = $registrar; + $this->readFactory = $readFactory; + } + + /** + * Search for files in each component by pattern, returns absolute paths + * + * @param string $componentType + * @param string $pattern + * @return array + */ + public function collectFiles($componentType, $pattern) + { + return $this->collect($componentType, $pattern, false); + } + + /** + * Search for files in each component by pattern, returns file objects with absolute file paths + * + * @param string $componentType + * @param string $pattern + * @return ComponentFile[] + */ + public function collectFilesWithContext($componentType, $pattern) + { + return $this->collect($componentType, $pattern, true); + } + + /** + * Collect files in components + * If $withContext is true, returns array of file objects with component context + * + * @param string $componentType + * @param string $pattern + * @param bool|false $withContext + * @return array + */ + private function collect($componentType, $pattern, $withContext) + { + $files = []; + foreach ($this->registrar->getPaths($componentType) as $componentName => $path) { + $directoryRead = $this->readFactory->create($path); + $foundFiles = $directoryRead->search($pattern); + foreach ($foundFiles as $foundFile) { + $foundFile = $directoryRead->getAbsolutePath($foundFile); + if ($withContext) { + $files[] = new ComponentFile($componentType, $componentName, $foundFile); + } else { + $files[] = $foundFile; + } + } + } + return $files; + } +} diff --git a/lib/internal/Magento/Framework/Component/README.md b/lib/internal/Magento/Framework/Component/README.md new file mode 100644 index 0000000000000000000000000000000000000000..6e99e472cb7994e3067064c6a06a3e4487c84793 --- /dev/null +++ b/lib/internal/Magento/Framework/Component/README.md @@ -0,0 +1,21 @@ +# Component + +**Component** library provides feature for components (modules/themes/languages/libraries) to load from any +custom directory like vendor. +* Modules should be registered using +``` +ComponentRegistrar::register(ComponentRegistrar::MODULE, '<module name>', __DIR__); +``` +* Themes should be registered using +``` +ComponentRegistrar::register(ComponentRegistrar::THEME, '<theme name>', __DIR__); +``` +* Languages should be registered using +``` +ComponentRegistrar::register(ComponentRegistrar::LANGUAGE, '<language name>', __DIR__); +``` +* Libraries should be registered using +``` +ComponentRegistrar::register(ComponentRegistrar::LIBRARY, '<library name>', __DIR__); +``` + diff --git a/lib/internal/Magento/Framework/Component/Test/Unit/ComponentFileTest.php b/lib/internal/Magento/Framework/Component/Test/Unit/ComponentFileTest.php new file mode 100644 index 0000000000000000000000000000000000000000..1410b232fe7890cec2a4b597c91169490f6863de --- /dev/null +++ b/lib/internal/Magento/Framework/Component/Test/Unit/ComponentFileTest.php @@ -0,0 +1,22 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Framework\Component\Test\Unit; + +use Magento\Framework\Component\ComponentFile; + +class ComponentFileTest extends \PHPUnit_Framework_TestCase +{ + public function testGetters() + { + $type = 'type'; + $name = 'name'; + $path = 'path'; + $component = new ComponentFile($type, $name, $path); + $this->assertSame($type, $component->getComponentType()); + $this->assertSame($name, $component->getComponentName()); + $this->assertSame($path, $component->getFullPath()); + } +} diff --git a/lib/internal/Magento/Framework/Component/Test/Unit/ComponentRegistrarTest.php b/lib/internal/Magento/Framework/Component/Test/Unit/ComponentRegistrarTest.php new file mode 100644 index 0000000000000000000000000000000000000000..db7fa8f35e8c5eafdf6f7a797654a8947483c832 --- /dev/null +++ b/lib/internal/Magento/Framework/Component/Test/Unit/ComponentRegistrarTest.php @@ -0,0 +1,60 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Framework\Component\Test\Unit; + +use Magento\Framework\Component\ComponentRegistrar; + +class ComponentRegistrarTest extends \PHPUnit_Framework_TestCase +{ + /** + * Module registrar object + * + * @var ComponentRegistrar + */ + private $object; + + public function setUp() + { + $this->object = new ComponentRegistrar(); + } + + /** + * @expectedException \LogicException + * @expectedExceptionMessage 'some_type' is not a valid component type + */ + public function testWithInvalidType() + { + ComponentRegistrar::register('some_type', "test_module_one", "some/path/name/one"); + } + + public function testGetPathsForModule() + { + ComponentRegistrar::register(ComponentRegistrar::MODULE, "test_module_one", "some/path/name/one"); + ComponentRegistrar::register(ComponentRegistrar::MODULE, "test_module_two", "some/path/name/two"); + $expected = [ + 'test_module_one' => "some/path/name/one", + 'test_module_two' => "some/path/name/two", + ]; + $this->assertContains($expected['test_module_one'], $this->object->getPaths(ComponentRegistrar::MODULE)); + $this->assertContains($expected['test_module_two'], $this->object->getPaths(ComponentRegistrar::MODULE)); + } + + /** + * @expectedException \LogicException + * @expectedExceptionMessage 'test_module_one' component already exists + */ + public function testRegistrarWithExceptionForModules() + { + ComponentRegistrar::register(ComponentRegistrar::MODULE, "test_module_one", "some/path/name/one"); + } + + public function testGetPath() + { + $this->assertSame("some/path/name/one", $this->object->getPath(ComponentRegistrar::MODULE, 'test_module_one')); + $this->assertSame("some/path/name/two", $this->object->getPath(ComponentRegistrar::MODULE, 'test_module_two')); + } +} diff --git a/lib/internal/Magento/Framework/Component/Test/Unit/DirSearchTest.php b/lib/internal/Magento/Framework/Component/Test/Unit/DirSearchTest.php new file mode 100644 index 0000000000000000000000000000000000000000..fab3fc9a5eeb64e6d4744753181aa83ac3e6179c --- /dev/null +++ b/lib/internal/Magento/Framework/Component/Test/Unit/DirSearchTest.php @@ -0,0 +1,110 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Framework\Component\Test\Unit; + +use Magento\Framework\Component\DirSearch; +use Magento\Framework\Filesystem\DriverPool; + +class DirSearchTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Framework\Filesystem\Directory\ReadInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $dir; + + /** + * @var \Magento\Framework\Component\ComponentRegistrarInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $registrar; + + /** + * @var \Magento\Framework\Filesystem\Directory\ReadFactory|\PHPUnit_Framework_MockObject_MockObject + */ + private $readFactory; + + /** + * @var DirSearch + */ + private $object; + + protected function setUp() + { + $this->registrar = $this->getMockForAbstractClass('\Magento\Framework\Component\ComponentRegistrarInterface'); + $this->readFactory = $this->getMock('\Magento\Framework\Filesystem\Directory\ReadFactory', [], [], '', false); + $this->dir = $this->getMockForAbstractClass('\Magento\Framework\Filesystem\Directory\ReadInterface'); + $this->dir->expects($this->any()) + ->method('getAbsolutePath') + ->willReturnArgument(0); + $this->object = new DirSearch($this->registrar, $this->readFactory); + } + + public function testCollectFilesNothingFound() + { + $componentType = 'component_type'; + $this->registrar->expects($this->exactly(2)) + ->method('getPaths') + ->with($componentType) + ->willReturn([]); + $this->readFactory->expects($this->never()) + ->method('create'); + $this->assertSame([], $this->object->collectFiles($componentType, '*/file.xml')); + $this->assertSame([], $this->object->collectFilesWithContext($componentType, '*/file.xml')); + } + + public function testCollectFiles() + { + $componentType = 'component_type'; + $componentPaths = ['component1' => 'path1', 'component2' => 'path2']; + $pattern = '*/file.xml'; + $this->registrar->expects($this->once()) + ->method('getPaths') + ->with($componentType) + ->willReturn($componentPaths); + $this->readFactory->expects($this->exactly(2)) + ->method('create') + ->willReturnMap([ + ['path1', DriverPool::FILE, $this->dir], + ['path2', DriverPool::FILE, $this->dir], + ]); + $this->dir->method('search') + ->with($pattern) + ->willReturnOnConsecutiveCalls(['one/file.xml'], ['two/file.xml']); + $expected = ['one/file.xml', 'two/file.xml']; + $this->assertSame($expected, $this->object->collectFiles($componentType, $pattern)); + } + + public function testCollectFilesWithContext() + { + $componentType = 'component_type'; + $componentPaths = ['component1' => 'path1', 'component2' => 'path2']; + $pattern = '*/file.xml'; + $this->registrar->expects($this->once()) + ->method('getPaths') + ->with($componentType) + ->willReturn($componentPaths); + $this->readFactory->expects($this->exactly(2)) + ->method('create') + ->willReturnMap([ + ['path1', DriverPool::FILE, $this->dir], + ['path2', DriverPool::FILE, $this->dir], + ]); + $this->dir->method('search') + ->with($pattern) + ->willReturnOnConsecutiveCalls(['one/file.xml'], ['two/file.xml']); + $actualFiles = $this->object->collectFilesWithContext($componentType, $pattern); + $this->assertNotEmpty($actualFiles); + /** @var \Magento\Framework\Component\ComponentFile $file */ + foreach ($actualFiles as $file) { + $this->assertInstanceOf('\Magento\Framework\Component\ComponentFile', $file); + $this->assertSame($componentType, $file->getComponentType()); + } + $this->assertCount(2, $actualFiles); + $this->assertSame('component1', $actualFiles[0]->getComponentName()); + $this->assertSame('one/file.xml', $actualFiles[0]->getFullPath()); + $this->assertSame('component2', $actualFiles[1]->getComponentName()); + $this->assertSame('two/file.xml', $actualFiles[1]->getFullPath()); + } +} diff --git a/lib/internal/Magento/Framework/Config/ConfigOptionsListConstants.php b/lib/internal/Magento/Framework/Config/ConfigOptionsListConstants.php index 6608cb60426d4f4a735f9ccf27f3d7f5be65c1a7..5bb8e80888b6b6e2be74875430165d6e7c0e6169 100644 --- a/lib/internal/Magento/Framework/Config/ConfigOptionsListConstants.php +++ b/lib/internal/Magento/Framework/Config/ConfigOptionsListConstants.php @@ -56,6 +56,7 @@ class ConfigOptionsListConstants */ const SESSION_SAVE_FILES = 'files'; const SESSION_SAVE_DB = 'db'; + const SESSION_SAVE_REDIS = 'redis'; /**#@-*/ /** diff --git a/lib/internal/Magento/Framework/Config/Dom.php b/lib/internal/Magento/Framework/Config/Dom.php index a516d77a8f16fff8916e74ed8f614c88ace02d1c..4f512fd7820a55cd8a68c754c0877c0d581d0d4a 100644 --- a/lib/internal/Magento/Framework/Config/Dom.php +++ b/lib/internal/Magento/Framework/Config/Dom.php @@ -11,6 +11,8 @@ */ namespace Magento\Framework\Config; +use Magento\Framework\Config\Dom\UrnResolver; + /** * Class Dom * @@ -33,40 +35,45 @@ class Dom * * @var \DOMDocument */ - protected $_dom; + protected $dom; /** * @var Dom\NodeMergingConfig */ - protected $_nodeMergingConfig; + protected $nodeMergingConfig; /** * Name of attribute that specifies type of argument node * * @var string|null */ - protected $_typeAttributeName; + protected $typeAttributeName; /** * Schema validation file * * @var string */ - protected $_schemaFile; + protected $schema; /** * Format of error messages * * @var string */ - protected $_errorFormat; + protected $errorFormat; /** * Default namespace for xml elements * * @var string */ - protected $_rootNamespace; + protected $rootNamespace; + + /** + * \Magento\Framework\Config\Dom\UrnResolver + */ + private static $urnResolver; /** * Build DOM with initial XML contents and specifying identifier attributes for merging @@ -87,12 +94,12 @@ class Dom $schemaFile = null, $errorFormat = self::ERROR_FORMAT_DEFAULT ) { - $this->_schemaFile = $schemaFile; - $this->_nodeMergingConfig = new Dom\NodeMergingConfig(new Dom\NodePathMatcher(), $idAttributes); - $this->_typeAttributeName = $typeAttributeName; - $this->_errorFormat = $errorFormat; - $this->_dom = $this->_initDom($xml); - $this->_rootNamespace = $this->_dom->lookupNamespaceUri($this->_dom->namespaceURI); + $this->schema = $schemaFile; + $this->nodeMergingConfig = new Dom\NodeMergingConfig(new Dom\NodePathMatcher(), $idAttributes); + $this->typeAttributeName = $typeAttributeName; + $this->errorFormat = $errorFormat; + $this->dom = $this->_initDom($xml); + $this->rootNamespace = $this->dom->lookupNamespaceUri($this->dom->namespaceURI); } /** @@ -129,21 +136,18 @@ class Dom /* Update matched node attributes and value */ if ($matchedNode) { //different node type - if ($this->_typeAttributeName - && $node->hasAttribute( - $this->_typeAttributeName - ) - && $matchedNode->hasAttribute( - $this->_typeAttributeName - ) - && $node->getAttribute( - $this->_typeAttributeName - ) !== $matchedNode->getAttribute( - $this->_typeAttributeName - ) + if ($this->typeAttributeName && $node->hasAttribute( + $this->typeAttributeName + ) && $matchedNode->hasAttribute( + $this->typeAttributeName + ) && $node->getAttribute( + $this->typeAttributeName + ) !== $matchedNode->getAttribute( + $this->typeAttributeName + ) ) { $parentMatchedNode = $this->_getMatchedNode($parentPath); - $newNode = $this->_dom->importNode($node, true); + $newNode = $this->dom->importNode($node, true); $parentMatchedNode->replaceChild($newNode, $matchedNode); return; } @@ -169,7 +173,7 @@ class Dom } else { /* Add node as is to the document under the same parent element */ $parentMatchedNode = $this->_getMatchedNode($parentPath); - $newNode = $this->_dom->importNode($node, true); + $newNode = $this->dom->importNode($node, true); $parentMatchedNode->appendChild($newNode); } } @@ -208,9 +212,9 @@ class Dom */ protected function _getNodePathByParent(\DOMElement $node, $parentPath) { - $prefix = is_null($this->_rootNamespace) ? '' : self::ROOT_NAMESPACE_PREFIX . ':'; + $prefix = is_null($this->rootNamespace) ? '' : self::ROOT_NAMESPACE_PREFIX . ':'; $path = $parentPath . '/' . $prefix . $node->tagName; - $idAttribute = $this->_nodeMergingConfig->getIdAttribute($path); + $idAttribute = $this->nodeMergingConfig->getIdAttribute($path); if (is_array($idAttribute)) { $constraints = []; foreach ($idAttribute as $attribute) { @@ -234,9 +238,9 @@ class Dom */ protected function _getMatchedNode($nodePath) { - $xPath = new \DOMXPath($this->_dom); - if ($this->_rootNamespace) { - $xPath->registerNamespace(self::ROOT_NAMESPACE_PREFIX, $this->_rootNamespace); + $xPath = new \DOMXPath($this->dom); + if ($this->rootNamespace) { + $xPath->registerNamespace(self::ROOT_NAMESPACE_PREFIX, $this->rootNamespace); } $matchedNodes = $xPath->query($nodePath); $node = null; @@ -254,22 +258,26 @@ class Dom * Validate dom document * * @param \DOMDocument $dom - * @param string $schemaSource + * @param string $schema Absolute schema file path or URN * @param string $errorFormat * @return array of errors * @throws \Exception */ public static function validateDomDocument( \DOMDocument $dom, - $schemaSource, + $schema, $errorFormat = self::ERROR_FORMAT_DEFAULT ) { + if (!self::$urnResolver) { + self::$urnResolver = new UrnResolver(); + } + $schema = self::$urnResolver->getRealPath($schema); libxml_use_internal_errors(true); try { - if (file_exists($schemaSource)) { - $result = $dom->schemaValidate($schemaSource); + if (file_exists($schema)) { + $result = $dom->schemaValidate($schema); } else { - $result = $dom->schemaValidateSource($schemaSource); + $result = $dom->schemaValidateSource($schema); } $errors = []; if (!$result) { @@ -307,7 +315,19 @@ class Dom $result = str_replace($placeholder, $value, $result); } if (strpos($result, '%') !== false) { - throw new \InvalidArgumentException("Error format '{$format}' contains unsupported placeholders."); + if (preg_match_all('/%.+%/', $result, $matches)) { + $unsupported = []; + foreach ($matches[0] as $placeholder) { + if (strpos($result, $placeholder) !== false) { + $unsupported[] = $placeholder; + } + } + if (!empty($unsupported)) { + throw new \InvalidArgumentException( + "Error format '{$format}' contains unsupported placeholders: " . join(', ', $unsupported) + ); + } + } } return $result; } @@ -319,7 +339,7 @@ class Dom */ public function getDom() { - return $this->_dom; + return $this->dom; } /** @@ -333,8 +353,8 @@ class Dom { $dom = new \DOMDocument(); $dom->loadXML($xml); - if ($this->_schemaFile) { - $errors = self::validateDomDocument($dom, $this->_schemaFile, $this->_errorFormat); + if ($this->schema) { + $errors = $this->validateDomDocument($dom, $this->schema, $this->errorFormat); if (count($errors)) { throw new \Magento\Framework\Config\Dom\ValidationException(implode("\n", $errors)); } @@ -351,7 +371,7 @@ class Dom */ public function validate($schemaFileName, &$errors = []) { - $errors = self::validateDomDocument($this->_dom, $schemaFileName, $this->_errorFormat); + $errors = $this->validateDomDocument($this->dom, $schemaFileName, $this->errorFormat); return !count($errors); } @@ -363,7 +383,7 @@ class Dom */ public function setSchemaFile($schemaFile) { - $this->_schemaFile = $schemaFile; + $this->schema = $schemaFile; return $this; } diff --git a/lib/internal/Magento/Framework/Config/Dom/UrnResolver.php b/lib/internal/Magento/Framework/Config/Dom/UrnResolver.php new file mode 100644 index 0000000000000000000000000000000000000000..e81a99ea53fec6354e4fdf962f26e64bb5ab0281 --- /dev/null +++ b/lib/internal/Magento/Framework/Config/Dom/UrnResolver.php @@ -0,0 +1,59 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +/** + * Resolve URN path to a real schema path + */ +namespace Magento\Framework\Config\Dom; + +use Magento\Framework\Component\ComponentRegistrar; + +class UrnResolver +{ + /** + * Get real file path by it's URN reference + * + * @param string $schema + * @return string + * @throws \UnexpectedValueException + */ + public function getRealPath($schema) + { + $componentRegistrar = new ComponentRegistrar(); + if (substr($schema, 0, 4) == 'urn:') { + // resolve schema location + $urnParts = explode(':', $schema); + if ($urnParts[2] == 'module') { + // urn:magento:module:Magento_Catalog:etc/catalog_attributes.xsd + // 0 : urn, 1: magento, 2: module, 3: Magento_Catalog, 4: etc/catalog_attributes.xsd + // moduleName -> Magento_Catalog + $schemaPath = $componentRegistrar->getPath( + ComponentRegistrar::MODULE, + $urnParts[3] + ) . '/' . $urnParts[4]; + } else if (strpos($urnParts[2], 'framework') === 0) { + // urn:magento:framework:Module/etc/module.xsd + // 0: urn, 1: magento, 2: framework, 3: Module/etc/module.xsd + // libaryName -> magento/framework + $libraryName = $urnParts[1] . '/' . $urnParts[2]; + $schemaPath = $componentRegistrar->getPath( + ComponentRegistrar::LIBRARY, + $libraryName + ) . '/' . $urnParts[3]; + } else { + throw new \UnexpectedValueException("Unsupported format of schema location: " . $schema); + } + if (!empty($schemaPath) && file_exists($schemaPath)) { + $schema = $schemaPath; + } else { + throw new \UnexpectedValueException( + "Could not locate schema: '" . $schema . "' at '" . $schemaPath . "'" + ); + } + } + return $schema; + } +} diff --git a/lib/internal/Magento/Framework/Config/FileIterator.php b/lib/internal/Magento/Framework/Config/FileIterator.php index caf5b0a496426c749cb9114f6980665e7028116f..e1c7e084414bd31cacc9c3495b0dc027f2fa9603 100644 --- a/lib/internal/Magento/Framework/Config/FileIterator.php +++ b/lib/internal/Magento/Framework/Config/FileIterator.php @@ -6,6 +6,9 @@ */ namespace Magento\Framework\Config; +use Magento\Framework\Filesystem\DriverPool; +use Magento\Framework\Filesystem\File\ReadFactory; + /** * Class FileIterator */ @@ -26,27 +29,27 @@ class FileIterator implements \Iterator, \Countable protected $position; /** - * Read directory + * File read factory * - * @var \Magento\Framework\Filesystem\Directory\ReadInterface + * @var ReadFactory */ - protected $directoryRead; + protected $fileReadFactory; /** * Constructor * - * @param \Magento\Framework\Filesystem\Directory\ReadInterface $directory + * @param ReadFactory $readFactory * @param array $paths */ - public function __construct(\Magento\Framework\Filesystem\Directory\ReadInterface $directory, array $paths) + public function __construct(ReadFactory $readFactory, array $paths) { + $this->fileReadFactory = $readFactory; $this->paths = $paths; $this->position = 0; - $this->directoryRead = $directory; } /** - *Rewind + * Rewind * * @return void */ @@ -62,7 +65,9 @@ class FileIterator implements \Iterator, \Countable */ public function current() { - return $this->directoryRead->readFile($this->key()); + /** @var \Magento\Framework\Filesystem\File\Read $fileRead */ + $fileRead = $this->fileReadFactory->create($this->key(), DriverPool::FILE); + return $fileRead->readAll(); } /** diff --git a/lib/internal/Magento/Framework/Config/FileIteratorFactory.php b/lib/internal/Magento/Framework/Config/FileIteratorFactory.php index 370263712277f06070dee33d20dfd23983f8f304..b18ab8a878ec9c7c146470db572ea221042977c6 100644 --- a/lib/internal/Magento/Framework/Config/FileIteratorFactory.php +++ b/lib/internal/Magento/Framework/Config/FileIteratorFactory.php @@ -8,15 +8,29 @@ namespace Magento\Framework\Config; class FileIteratorFactory { + /** + * @var \Magento\Framework\Filesystem\File\ReadFactory + */ + private $fileReadFactory; + + /** + * Constructor + * + * @param \Magento\Framework\Filesystem\File\ReadFactory $fileReadFactory + */ + public function __construct(\Magento\Framework\Filesystem\File\ReadFactory $fileReadFactory) + { + $this->fileReadFactory = $fileReadFactory; + } + /** * Create file iterator * - * @param \Magento\Framework\Filesystem\Directory\ReadInterface $readDirectory - * @param array $paths + * @param array $paths List of absolute paths * @return FileIterator */ - public function create(\Magento\Framework\Filesystem\Directory\ReadInterface $readDirectory, $paths) + public function create($paths) { - return new \Magento\Framework\Config\FileIterator($readDirectory, $paths); + return new FileIterator($this->fileReadFactory, $paths); } } diff --git a/lib/internal/Magento/Framework/Config/GenericSchemaLocator.php b/lib/internal/Magento/Framework/Config/GenericSchemaLocator.php index e476c015136c5bf23fc5410da1905c43997c02d0..fc3306780ccad08f7d3777c62c175d87530645de 100644 --- a/lib/internal/Magento/Framework/Config/GenericSchemaLocator.php +++ b/lib/internal/Magento/Framework/Config/GenericSchemaLocator.php @@ -6,6 +6,7 @@ namespace Magento\Framework\Config; +use Magento\Framework\Module\Dir; use Magento\Framework\Module\Dir\Reader as ModuleDirReader; /** @@ -54,7 +55,7 @@ class GenericSchemaLocator implements SchemaLocatorInterface */ public function getSchema() { - return $this->moduleDirReader->getModuleDir('etc', $this->moduleName) . '/' . $this->schema; + return $this->moduleDirReader->getModuleDir(Dir::MODULE_ETC_DIR, $this->moduleName) . '/' . $this->schema; } /** @@ -65,7 +66,8 @@ class GenericSchemaLocator implements SchemaLocatorInterface public function getPerFileSchema() { if ($this->perFileSchema !== null) { - return $this->moduleDirReader->getModuleDir('etc', $this->moduleName) . '/' . $this->perFileSchema; + return $this->moduleDirReader->getModuleDir(Dir::MODULE_ETC_DIR, $this->moduleName) + . '/' . $this->perFileSchema; } } } diff --git a/lib/internal/Magento/Framework/Config/Test/Unit/Dom/UrnResolverTest.php b/lib/internal/Magento/Framework/Config/Test/Unit/Dom/UrnResolverTest.php new file mode 100644 index 0000000000000000000000000000000000000000..6d78174e755739cafce02fbcfb81c3f7ce8aadfc --- /dev/null +++ b/lib/internal/Magento/Framework/Config/Test/Unit/Dom/UrnResolverTest.php @@ -0,0 +1,74 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Framework\Config\Test\Unit\Dom; + +use \Magento\Framework\Config\Dom\UrnResolver; +use Magento\Framework\Component\ComponentRegistrar; + +class UrnResolverTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var UrnResolver + */ + protected $urnResolver; + + /** + * @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager + */ + protected $objectManagerHelper; + + public function setUp() + { + $this->objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); + $this->urnResolver = $this->objectManagerHelper->getObject('Magento\Framework\Config\Dom\UrnResolver'); + } + + public function testGetRealPathNoUrn() + { + $xsdPath = '../../testPath/test.xsd'; + $result = $this->urnResolver->getRealPath($xsdPath); + $this->assertSame($xsdPath, $result, 'XSD paths does not match.'); + } + + public function testGetRealPathWithFrameworkUrn() + { + $xsdUrn = 'urn:magento:framework:Config/Test/Unit/_files/sample.xsd'; + $xsdPath = realpath(dirname(__DIR__)) . '/_files/sample.xsd'; + $result = $this->urnResolver->getRealPath($xsdUrn); + $this->assertSame($xsdPath, $result, 'XSD paths does not match.'); + } + + public function testGetRealPathWithModuleUrn() + { + $xsdUrn = 'urn:magento:module:Magento_Customer:etc/address_formats.xsd'; + $componentRegistrar = new ComponentRegistrar(); + $xsdPath = $componentRegistrar->getPath(ComponentRegistrar::MODULE, 'Magento_Customer') + . '/etc/address_formats.xsd'; + + $result = $this->urnResolver->getRealPath($xsdUrn); + $this->assertSame($xsdPath, $result, 'XSD paths does not match.'); + } + + /** + * @expectedException \UnexpectedValueException + * @expectedExceptionMessage Unsupported format of schema location: urn:magento:test:test:etc/test_test.xsd + */ + public function testGetRealPathWrongSection() + { + $xsdUrn = 'urn:magento:test:test:etc/test_test.xsd'; + $this->urnResolver->getRealPath($xsdUrn); + } + + /** + * @expectedException \UnexpectedValueException + * @expectedExceptionMessage Could not locate schema: 'urn:magento:module:Magento_Test:test.xsd' at '/test.xsd' + */ + public function testGetRealPathWrongModule() + { + $xsdUrn = 'urn:magento:module:Magento_Test:test.xsd'; + $this->urnResolver->getRealPath($xsdUrn); + } +} diff --git a/lib/internal/Magento/Framework/Config/Test/Unit/FileIteratorTest.php b/lib/internal/Magento/Framework/Config/Test/Unit/FileIteratorTest.php index 3109ba310726bc292ce8bc00aab6a2e107f77184..f418bf30a57b9f190efa85f18a84f3fabde5dc25 100644 --- a/lib/internal/Magento/Framework/Config/Test/Unit/FileIteratorTest.php +++ b/lib/internal/Magento/Framework/Config/Test/Unit/FileIteratorTest.php @@ -7,7 +7,6 @@ namespace Magento\Framework\Config\Test\Unit; use \Magento\Framework\Config\FileIterator; - /** * Class FileIteratorTest */ @@ -19,9 +18,9 @@ class FileIteratorTest extends \PHPUnit_Framework_TestCase protected $fileIterator; /** - * @var \Magento\Framework\Filesystem\Directory\Read | \PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\Filesystem\File\Read|\PHPUnit_Framework_MockObject_MockObject */ - protected $directoryMock; + protected $fileRead; /** * Array of relative file paths @@ -30,21 +29,22 @@ class FileIteratorTest extends \PHPUnit_Framework_TestCase */ protected $filePaths; + /** + * @var \Magento\Framework\Filesystem\File\ReadFactory|\PHPUnit_Framework_MockObject_MockObject + */ + protected $fileReadFactory; + protected function setUp() { $this->filePaths = ['/file1', '/file2']; - $this->directoryMock = $this->getMock('Magento\Framework\Filesystem\Directory\Read', [], [], '', false); - - $this->fileIterator = new FileIterator( - $this->directoryMock, - $this->filePaths - ); + $this->fileReadFactory = $this->getMock('Magento\Framework\Filesystem\File\ReadFactory', [], [], '', false); + $this->fileRead = $this->getMock('Magento\Framework\Filesystem\File\Read', [], [], '', false); + $this->fileIterator = new FileIterator($this->fileReadFactory, $this->filePaths); } protected function tearDown() { $this->fileIterator = null; - $this->directoryMock = null; $this->filePaths = null; } @@ -53,9 +53,12 @@ class FileIteratorTest extends \PHPUnit_Framework_TestCase $contents = ['content1', 'content2']; $index = 0; foreach ($this->filePaths as $filePath) { - $this->directoryMock->expects($this->at($index)) - ->method('readFile') + $this->fileReadFactory->expects($this->at($index)) + ->method('create') ->with($filePath) + ->willReturn($this->fileRead); + $this->fileRead->expects($this->at($index)) + ->method('readAll') ->will($this->returnValue($contents[$index++])); } $index = 0; @@ -71,9 +74,12 @@ class FileIteratorTest extends \PHPUnit_Framework_TestCase $index = 0; foreach ($this->filePaths as $filePath) { $expectedArray[$filePath] = $contents[$index]; - $this->directoryMock->expects($this->at($index)) - ->method('readFile') + $this->fileReadFactory->expects($this->at($index)) + ->method('create') ->with($filePath) + ->willReturn($this->fileRead); + $this->fileRead->expects($this->at($index)) + ->method('readAll') ->will($this->returnValue($contents[$index++])); } $this->assertEquals($expectedArray, $this->fileIterator->toArray()); diff --git a/lib/internal/Magento/Framework/Config/Test/Unit/Reader/FilesystemTest.php b/lib/internal/Magento/Framework/Config/Test/Unit/Reader/FilesystemTest.php index bef2654e8c296a9f60e15ebbdde140aaa9d96d89..57e7a97d57350593e013a52f1f9f8383b5922791 100644 --- a/lib/internal/Magento/Framework/Config/Test/Unit/Reader/FilesystemTest.php +++ b/lib/internal/Magento/Framework/Config/Test/Unit/Reader/FilesystemTest.php @@ -29,6 +29,11 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase */ protected $_validationStateMock; + /** + * @var \Magento\Framework\Config\Dom\UrnResolver + */ + protected $urnResolver; + /** * @var string */ @@ -47,6 +52,7 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase ); $this->_schemaLocatorMock = $this->getMock('Magento\Framework\Config\SchemaLocatorInterface'); $this->_validationStateMock = $this->getMock('Magento\Framework\Config\ValidationStateInterface'); + $this->urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); } public function testRead() @@ -94,7 +100,9 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase )->method( 'getSchema' )->will( - $this->returnValue(__DIR__ . "/../_files/reader/schema.xsd") + $this->returnValue( + $this->urnResolver->getRealPath('urn:magento:framework:Config/Test/Unit/_files/reader/schema.xsd') + ) ); $this->_validationStateMock->expects($this->any())->method('isValidated')->will($this->returnValue(true)); $model = new Filesystem( @@ -121,7 +129,9 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase )->method( 'getPerFileSchema' )->will( - $this->returnValue(__DIR__ . "/../_files/reader/schema.xsd") + $this->returnValue( + $this->urnResolver->getRealPath('urn:magento:framework:Config/Test/Unit/_files/reader/schema.xsd') + ) ); $this->_validationStateMock->expects($this->any())->method('isValidated')->will($this->returnValue(true)); diff --git a/lib/internal/Magento/Framework/Config/Test/Unit/ThemeTest.php b/lib/internal/Magento/Framework/Config/Test/Unit/ThemeTest.php index b29a044e03558faf0db1590dc2508a68d4a49793..4397e43c41bf66a4440b07988716bb2aa1b217a3 100644 --- a/lib/internal/Magento/Framework/Config/Test/Unit/ThemeTest.php +++ b/lib/internal/Magento/Framework/Config/Test/Unit/ThemeTest.php @@ -5,45 +5,32 @@ */ namespace Magento\Framework\Config\Test\Unit; -use Magento\Framework\App\Filesystem\DirectoryList; - class ThemeTest extends \PHPUnit_Framework_TestCase { - /** - * @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager - */ - protected $objectManager; + /** @var \Magento\Framework\Config\Dom\UrnResolver $urnResolverMock */ + protected $urnResolver; - /** - * @var \Magento\Framework\Filesystem | \PHPUnit_Framework_MockObject_MockObject - */ - protected $filesystemMock; + /** @var \Magento\Framework\Config\Dom\UrnResolver $urnResolverMock */ + protected $urnResolverMock; - /** - * @var \Magento\Framework\Filesystem\Directory\ReadInterface | \PHPUnit_Framework_MockObject_MockObject - */ - protected $dirReadMock; - - public function setUp() + protected function setUp() { - $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); - $this->filesystemMock = $this->getMockBuilder('Magento\Framework\Filesystem') - ->disableOriginalConstructor() - ->getMock(); - $this->dirReadMock = $this->getMockBuilder('Magento\Framework\Filesystem\Directory\ReadInterface') - ->disableOriginalConstructor() - ->getMock(); - $this->filesystemMock->expects($this->any()) - ->method('getDirectoryRead') - ->with(DirectoryList::THEMES) - ->willReturn($this->dirReadMock); + $this->urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + $this->urnResolverMock = $this->getMock('Magento\Framework\Config\Dom\UrnResolver', [], [], '', false); } public function testGetSchemaFile() { - /** @var \Magento\Framework\Config\Theme $config */ - $config = $this->objectManager->getObject( - 'Magento\Framework\Config\Theme' + $config = new \Magento\Framework\Config\Theme($this->urnResolverMock, null); + $this->urnResolverMock->expects($this->exactly(2)) + ->method('getRealPath') + ->with('urn:magento:framework:Config/etc/theme.xsd') + ->willReturn( + $this->urnResolver->getRealPath('urn:magento:framework:Config/etc/theme.xsd') + ); + $this->assertEquals( + $this->urnResolver->getRealPath('urn:magento:framework:Config/etc/theme.xsd'), + $config->getSchemaFile() ); $this->assertFileExists($config->getSchemaFile()); } @@ -56,12 +43,9 @@ class ThemeTest extends \PHPUnit_Framework_TestCase public function testDataGetter($themePath, $expected) { $expected = reset($expected); - /** @var \Magento\Framework\Config\Theme $config */ - $config = $this->objectManager->getObject( - 'Magento\Framework\Config\Theme', - [ - 'configContent' => file_get_contents(__DIR__ . '/_files/area/' . $themePath . '/theme.xml') - ] + $config = new \Magento\Framework\Config\Theme( + $this->urnResolverMock, + file_get_contents(__DIR__ . '/_files/area/' . $themePath . '/theme.xml') ); $this->assertSame($expected['media'], $config->getMedia()); $this->assertSame($expected['title'], $config->getThemeTitle()); diff --git a/lib/internal/Magento/Framework/Config/Test/Unit/XsdTest.php b/lib/internal/Magento/Framework/Config/Test/Unit/XsdTest.php index 09e86a121000c84a6ca18147e818b108229ce1d6..af64bfc72dfcb7d35f434e7c1e208a4601efe6df 100644 --- a/lib/internal/Magento/Framework/Config/Test/Unit/XsdTest.php +++ b/lib/internal/Magento/Framework/Config/Test/Unit/XsdTest.php @@ -17,14 +17,15 @@ class XsdTest extends \PHPUnit_Framework_TestCase { $dom = new \DOMDocument(); $dom->load(__DIR__ . "/_files/{$invalidXmlFile}"); - libxml_use_internal_errors(true); - $result = $dom->schemaValidate(BP . "/lib/internal/Magento/Framework/Config/etc/{$xsdFile}"); + $schema = __DIR__ . "/../../etc/{$xsdFile}"; - $errorsQty = count(libxml_get_errors()); + libxml_use_internal_errors(true); + $result = \Magento\Framework\Config\Dom::validateDomDocument($dom, $schema); + $errorsQty = count($result); libxml_use_internal_errors(false); if ($expectedErrorsQty > 0) { - $this->assertFalse($result); + $this->assertNotEmpty($result); } $this->assertEquals($expectedErrorsQty, $errorsQty); } diff --git a/lib/internal/Magento/Framework/Config/Test/Unit/_files/area/default_default/theme.xml b/lib/internal/Magento/Framework/Config/Test/Unit/_files/area/default_default/theme.xml index f4d680fbb1926d82712f874db24c0fc7c36e79b9..460e20d8d025569fde530f702a44327504774c3c 100644 --- a/lib/internal/Magento/Framework/Config/Test/Unit/_files/area/default_default/theme.xml +++ b/lib/internal/Magento/Framework/Config/Test/Unit/_files/area/default_default/theme.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> +<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> <title>Default</title> <media> <preview_image>media/default_default.jpg</preview_image> diff --git a/lib/internal/Magento/Framework/Config/Test/Unit/_files/area/default_test/theme.xml b/lib/internal/Magento/Framework/Config/Test/Unit/_files/area/default_test/theme.xml index ff8150ba5a531728a5c631caa8dd1a3b074a0ed3..a964a97c32057ac639886e43dc4ba69c0c6d69fd 100644 --- a/lib/internal/Magento/Framework/Config/Test/Unit/_files/area/default_test/theme.xml +++ b/lib/internal/Magento/Framework/Config/Test/Unit/_files/area/default_test/theme.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> +<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> <title>Test</title> <parent>default_default</parent> <media> diff --git a/lib/internal/Magento/Framework/Config/Test/Unit/_files/area/default_test2/theme.xml b/lib/internal/Magento/Framework/Config/Test/Unit/_files/area/default_test2/theme.xml index 20544c5878ee96f623d0839c89cfb5cae521aa36..3562f4371de138409519dc275b5720b462889440 100644 --- a/lib/internal/Magento/Framework/Config/Test/Unit/_files/area/default_test2/theme.xml +++ b/lib/internal/Magento/Framework/Config/Test/Unit/_files/area/default_test2/theme.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> +<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> <title>Test2</title> <parent>default_test</parent> </theme> diff --git a/lib/internal/Magento/Framework/Config/Test/Unit/_files/area/test_default/theme.xml b/lib/internal/Magento/Framework/Config/Test/Unit/_files/area/test_default/theme.xml index 5e1f675373a7db9ea587b5e9d31837cad5afa57b..09721f39b9a20ce802da41f0cd914bbca65710e3 100644 --- a/lib/internal/Magento/Framework/Config/Test/Unit/_files/area/test_default/theme.xml +++ b/lib/internal/Magento/Framework/Config/Test/Unit/_files/area/test_default/theme.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> +<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> <title>Default</title> <media> <preview_image>media/test_default.jpg</preview_image> diff --git a/lib/internal/Magento/Framework/Config/Test/Unit/_files/area/test_external_package_descendant/theme.xml b/lib/internal/Magento/Framework/Config/Test/Unit/_files/area/test_external_package_descendant/theme.xml index c0c8d6b4ce5f98f8de98921f0d9a149c7ed01554..eee8f2b31f907ff6f02eda249dacb906f9c51fbf 100644 --- a/lib/internal/Magento/Framework/Config/Test/Unit/_files/area/test_external_package_descendant/theme.xml +++ b/lib/internal/Magento/Framework/Config/Test/Unit/_files/area/test_external_package_descendant/theme.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> +<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> <title>Default</title> <parent>default_test2</parent> </theme> diff --git a/lib/internal/Magento/Framework/Config/Test/Unit/_files/theme_invalid.xml b/lib/internal/Magento/Framework/Config/Test/Unit/_files/theme_invalid.xml index c1a8e8d9c965012dc1faceb9ed0d0b050ab9acc9..bb4c470ae51d96e8c9f62210b3e366a8e597a09f 100644 --- a/lib/internal/Magento/Framework/Config/Test/Unit/_files/theme_invalid.xml +++ b/lib/internal/Magento/Framework/Config/Test/Unit/_files/theme_invalid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> +<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> <title>Default</title> <version>0.1.0-alpha108</version> </theme> diff --git a/lib/internal/Magento/Framework/Config/Test/Unit/_files/view_invalid.xml b/lib/internal/Magento/Framework/Config/Test/Unit/_files/view_invalid.xml index 2e3b2083e53049d730b659989b5888c2ec44b4c5..3b8fb59fae2111d3a86b80f662dd9b9bfba0559a 100644 --- a/lib/internal/Magento/Framework/Config/Test/Unit/_files/view_invalid.xml +++ b/lib/internal/Magento/Framework/Config/Test/Unit/_files/view_invalid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../lib/internal/Magento/Framework/Config/etc/view.xsd"> +<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/view.xsd"> <vars module="Namespace_Module1"> <var name="var1">Value1</var> <var name="var1">Value1</var><!-- duplicate var name --> diff --git a/lib/internal/Magento/Framework/Config/Test/Unit/_files/view_one.xml b/lib/internal/Magento/Framework/Config/Test/Unit/_files/view_one.xml index 1ec823d6aa43a5a81c64f37699ed3217a0d48f82..a9a7a8cfa460e11607562ccbdfc1849859409175 100644 --- a/lib/internal/Magento/Framework/Config/Test/Unit/_files/view_one.xml +++ b/lib/internal/Magento/Framework/Config/Test/Unit/_files/view_one.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../lib/internal/Magento/Framework/Config/etc/view.xsd"> +<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/view.xsd"> <vars module="One"> <var name="one">Value One</var> </vars> diff --git a/lib/internal/Magento/Framework/Config/Test/Unit/_files/view_two.xml b/lib/internal/Magento/Framework/Config/Test/Unit/_files/view_two.xml index 007d5f713b447de38a7a74bf1a557658446aaa74..d958ab35661165fc8f34ad329dfe961de68eca25 100644 --- a/lib/internal/Magento/Framework/Config/Test/Unit/_files/view_two.xml +++ b/lib/internal/Magento/Framework/Config/Test/Unit/_files/view_two.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../lib/internal/Magento/Framework/Config/etc/view.xsd"> +<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/view.xsd"> <vars module="One"> <var name="one">Value One Another</var> </vars> diff --git a/lib/internal/Magento/Framework/Config/Theme.php b/lib/internal/Magento/Framework/Config/Theme.php index aaa6c4f95a45da7d2ed5bec0641783e61952efa7..6bfd720c74a1d9bf5272e6e52ea9b5aadc01108e 100644 --- a/lib/internal/Magento/Framework/Config/Theme.php +++ b/lib/internal/Magento/Framework/Config/Theme.php @@ -25,13 +25,20 @@ class Theme */ protected $_data; + /** @var \Magento\Framework\Config\Dom\UrnResolver */ + protected $urnResolver; + /** * Constructor * + * @param \Magento\Framework\Config\Dom\UrnResolver $urnResolver * @param string $configContent */ - public function __construct($configContent = null) - { + public function __construct( + \Magento\Framework\Config\Dom\UrnResolver $urnResolver, + $configContent = null + ) { + $this->urnResolver = $urnResolver; $this->_data = $this->_extractData($configContent); } @@ -42,7 +49,7 @@ class Theme */ public function getSchemaFile() { - return __DIR__ . '/etc/theme.xsd'; + return $this->urnResolver->getRealPath('urn:magento:framework:Config/etc/theme.xsd'); } /** diff --git a/lib/internal/Magento/Framework/Config/View.php b/lib/internal/Magento/Framework/Config/View.php index a4ae2bde6d8b7041a35cb2687e97b2998a89f216..00aab9b33e2e3feffe76c3b908c9deb33e628e24 100644 --- a/lib/internal/Magento/Framework/Config/View.php +++ b/lib/internal/Magento/Framework/Config/View.php @@ -9,15 +9,14 @@ */ namespace Magento\Framework\Config; +use Magento\Framework\Config\Dom\UrnResolver; use Magento\Framework\View\Xsd\Reader; use Magento\Framework\View\Xsd\Media\TypeDataExtractorPool; class View extends \Magento\Framework\Config\AbstractXml { - /** - * @var \Magento\Framework\View\Xsd\Reader - */ - protected $xsdReader; + /** @var UrnResolver */ + protected $urnResolver; /** * @var \Magento\Framework\View\Xsd\Media\TypeDataExtractorPool @@ -29,24 +28,32 @@ class View extends \Magento\Framework\Config\AbstractXml */ protected $xpath; + /** + * @var Reader + */ + private $xsdReader; + /** * @param array $configFiles - * @param array $xpath * @param Reader $xsdReader + * @param UrnResolver $urnResolver * @param TypeDataExtractorPool $extractorPool + * @param array $xpath */ public function __construct( $configFiles, Reader $xsdReader, + UrnResolver $urnResolver, TypeDataExtractorPool $extractorPool, $xpath = [] ) { - $this->xsdReader = $xsdReader; $this->xpath = $xpath; $this->extractorPool = $extractorPool; + $this->urnResolver = $urnResolver; + $this->xsdReader = $xsdReader; parent::__construct($configFiles); } - + /** * Merged file view.xsd * diff --git a/lib/internal/Magento/Framework/Config/ViewFactory.php b/lib/internal/Magento/Framework/Config/ViewFactory.php index cfd3b40dc4c967ea68e70b95c0b45c370017d7a1..5b0247ddf72915771efaf46ef03e5a31eaeae5ed 100644 --- a/lib/internal/Magento/Framework/Config/ViewFactory.php +++ b/lib/internal/Magento/Framework/Config/ViewFactory.php @@ -3,43 +3,35 @@ * Copyright © 2015 Magento. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\Framework\Config; -use Magento\Framework\ObjectManagerInterface; +namespace Magento\Framework\Config; -/** - * Magento configuration View factory - */ class ViewFactory { - const CLASS_NAME = 'Magento\Framework\Config\View'; - /** - * Object manager - * * @var \Magento\Framework\ObjectManagerInterface */ - protected $objectManager; + private $objectManager; /** * Constructor * * @param \Magento\Framework\ObjectManagerInterface $objectManager */ - public function __construct(ObjectManagerInterface $objectManager) + public function __construct(\Magento\Framework\ObjectManagerInterface $objectManager) { $this->objectManager = $objectManager; } /** - * - * Create View object - * - * @param array $arguments - * @return \Magento\Framework\Config\View + * @param array $configFiles + * @return View */ - public function create(array $arguments) + public function create($configFiles) { - return $this->objectManager->create(self::CLASS_NAME, ["configFiles" => $arguments]); + return $this->objectManager->create( + 'Magento\Framework\Config\View', + ['configFiles' => $configFiles] + ); } } diff --git a/lib/internal/Magento/Framework/Css/PreProcessor/File/Collector/Library.php b/lib/internal/Magento/Framework/Css/PreProcessor/File/Collector/Library.php index 2424a5c8dcd28958f9e72f3c8d1dd9e80a09ae19..68eb0a40f46bb31479e35c576ae1f1a493fddcbc 100644 --- a/lib/internal/Magento/Framework/Css/PreProcessor/File/Collector/Library.php +++ b/lib/internal/Magento/Framework/Css/PreProcessor/File/Collector/Library.php @@ -6,12 +6,12 @@ namespace Magento\Framework\Css\PreProcessor\File\Collector; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrarInterface; use Magento\Framework\Filesystem; use Magento\Framework\Filesystem\Directory\ReadInterface; use Magento\Framework\View\Design\ThemeInterface; use Magento\Framework\View\File\CollectorInterface; -use Magento\Framework\View\File\Factory; -use Magento\Framework\View\File\FileList\Factory as FileListFactory; /** * Source of base layout files introduced by modules @@ -19,7 +19,7 @@ use Magento\Framework\View\File\FileList\Factory as FileListFactory; class Library implements CollectorInterface { /** - * @var Factory + * @var \Magento\Framework\View\File\Factory */ protected $fileFactory; @@ -29,29 +29,43 @@ class Library implements CollectorInterface protected $libraryDirectory; /** - * @var ReadInterface + * @var \Magento\Framework\View\File\FileList\Factory */ - protected $themesDirectory; + protected $fileListFactory; /** - * @var FileListFactory + * @var \Magento\Framework\Filesystem\Directory\ReadFactory */ - protected $fileListFactory; + private $readFactory; + + /** + * Component registry + * + * @var ComponentRegistrarInterface + */ + private $componentRegistrar; /** - * @param FileListFactory $fileListFactory + * @param \Magento\Framework\View\File\FileList\Factory $fileListFactory * @param Filesystem $filesystem - * @param Factory $fileFactory + * @param \Magento\Framework\View\File\Factory $fileFactory + * @param \Magento\Framework\Filesystem\Directory\ReadFactory $readFactory + * @param ComponentRegistrarInterface $componentRegistrar */ public function __construct( - FileListFactory $fileListFactory, + \Magento\Framework\View\File\FileList\Factory $fileListFactory, Filesystem $filesystem, - Factory $fileFactory + \Magento\Framework\View\File\Factory $fileFactory, + \Magento\Framework\Filesystem\Directory\ReadFactory $readFactory, + ComponentRegistrarInterface $componentRegistrar ) { $this->fileListFactory = $fileListFactory; - $this->libraryDirectory = $filesystem->getDirectoryRead(DirectoryList::LIB_WEB); - $this->themesDirectory = $filesystem->getDirectoryRead(DirectoryList::THEMES); + $this->libraryDirectory = $filesystem->getDirectoryRead( + DirectoryList::LIB_WEB + ); $this->fileFactory = $fileFactory; + $this->readFactory = $readFactory; + $this->componentRegistrar = $componentRegistrar; } /** @@ -69,8 +83,16 @@ class Library implements CollectorInterface foreach ($theme->getInheritedThemes() as $currentTheme) { $themeFullPath = $currentTheme->getFullPath(); - $files = $this->themesDirectory->search("{$themeFullPath}/web/{$filePath}"); - $list->replace($this->createFiles($this->themesDirectory, $theme, $files)); + $path = $this->componentRegistrar->getPath( + ComponentRegistrar::THEME, + $themeFullPath + ); + if (empty($path)) { + continue; + } + $directoryRead = $this->readFactory->create($path); + $foundFiles = $directoryRead->search("web/{$filePath}"); + $list->replace($this->createFiles($directoryRead, $theme, $foundFiles)); } return $list->getAll(); } diff --git a/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/File/Collector/LibraryTest.php b/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/File/Collector/LibraryTest.php index 7f67740394f5337e54450408319dfb2d08d2e8ac..459a13aa3a8654a556f7965fe35553b30d947c7b 100644 --- a/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/File/Collector/LibraryTest.php +++ b/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/File/Collector/LibraryTest.php @@ -5,6 +5,7 @@ */ namespace Magento\Framework\Css\Test\Unit\PreProcessor\File\Collector; +use Magento\Framework\Component\ComponentRegistrar; use \Magento\Framework\Css\PreProcessor\File\Collector\Library; use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\Filesystem; @@ -14,6 +15,11 @@ use Magento\Framework\Filesystem; */ class LibraryTest extends \PHPUnit_Framework_TestCase { + /** + * @var Library + */ + private $library; + /** * @var \Magento\Framework\View\File\FileList\Factory|\PHPUnit_Framework_MockObject_MockObject */ @@ -40,9 +46,16 @@ class LibraryTest extends \PHPUnit_Framework_TestCase protected $libraryDirectoryMock; /** - * @var \Magento\Framework\Filesystem\Directory\ReadInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\Filesystem\Directory\ReadFactory|\PHPUnit_Framework_MockObject_MockObject */ - protected $themesDirectoryMock; + private $readFactoryMock; + + /** + * Component registry + * + * @var \Magento\Framework\Component\ComponentRegistrarInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $componentRegistrarMock; /** * @var \Magento\Framework\View\Design\ThemeInterface|\PHPUnit_Framework_MockObject_MockObject @@ -63,20 +76,20 @@ class LibraryTest extends \PHPUnit_Framework_TestCase ->method('create') ->with('Magento\Framework\Css\PreProcessor\File\FileList\Collator') ->will($this->returnValue($this->fileListMock)); - + $this->readFactoryMock = $this->getMockBuilder('Magento\Framework\Filesystem\Directory\ReadFactory') + ->disableOriginalConstructor()->getMock(); + $this->componentRegistrarMock = $this->getMockBuilder('Magento\Framework\Component\ComponentRegistrarInterface') + ->disableOriginalConstructor()->getMock(); $this->fileSystemMock = $this->getMockBuilder('Magento\Framework\Filesystem') ->disableOriginalConstructor() ->getMock(); $this->libraryDirectoryMock = $this->getMockBuilder('Magento\Framework\Filesystem\Directory\ReadInterface') ->getMock(); - $this->themesDirectoryMock = $this->getMockBuilder('Magento\Framework\Filesystem\Directory\ReadInterface') - ->getMock(); $this->fileSystemMock->expects($this->any())->method('getDirectoryRead') ->will( $this->returnValueMap( [ [DirectoryList::LIB_WEB, Filesystem\DriverPool::FILE, $this->libraryDirectoryMock], - [DirectoryList::THEMES, Filesystem\DriverPool::FILE, $this->themesDirectoryMock], ] ) ); @@ -85,6 +98,13 @@ class LibraryTest extends \PHPUnit_Framework_TestCase ->disableOriginalConstructor() ->getMock(); $this->themeMock = $this->getMockBuilder('\Magento\Framework\View\Design\ThemeInterface')->getMock(); + $this->library = new Library( + $this->fileListFactoryMock, + $this->fileSystemMock, + $this->fileFactoryMock, + $this->readFactoryMock, + $this->componentRegistrarMock + ); } public function testGetFilesEmpty() @@ -93,15 +113,12 @@ class LibraryTest extends \PHPUnit_Framework_TestCase $this->themeMock->expects($this->any())->method('getInheritedThemes')->will($this->returnValue([])); // Verify search/replace are never called if no inheritedThemes - $this->themesDirectoryMock->expects($this->never())->method('search'); - $this->fileListMock->expects($this->never())->method('replace'); + $this->readFactoryMock->expects($this->never()) + ->method('create'); + $this->componentRegistrarMock->expects($this->never()) + ->method('getPath'); - $library = new Library( - $this->fileListFactoryMock, - $this->fileSystemMock, - $this->fileFactoryMock - ); - $library->getFiles($this->themeMock, '*'); + $this->library->getFiles($this->themeMock, '*'); } /** @@ -125,24 +142,22 @@ class LibraryTest extends \PHPUnit_Framework_TestCase )); $themePath = '/var/Magento/ATheme'; $subPath = '*'; - - $this->themesDirectoryMock->expects($this->any()) + $readerMock = $this->getMockBuilder('Magento\Framework\Filesystem\Directory\ReadInterface')->getMock(); + $this->readFactoryMock->expects($this->once()) + ->method('create') + ->will($this->returnValue($readerMock)); + $this->componentRegistrarMock->expects($this->once()) + ->method('getPath') + ->with(ComponentRegistrar::THEME, $themePath) + ->will($this->returnValue(['/path/to/theme'])); + $readerMock->expects($this->once()) ->method('search') - ->with($themePath . '/web/' . $subPath) ->will($this->returnValue($themeFiles)); - - $library = new Library( - $this->fileListFactoryMock, - $this->fileSystemMock, - $this->fileFactoryMock - ); - $inheritedThemeMock = $this->getMockBuilder('\Magento\Framework\View\Design\ThemeInterface')->getMock(); $inheritedThemeMock->expects($this->any())->method('getFullPath')->will($this->returnValue($themePath)); $this->themeMock->expects($this->any())->method('getInheritedThemes') ->will($this->returnValue([$inheritedThemeMock])); - - $this->assertEquals(['returnedFile'], $library->getFiles($this->themeMock, $subPath)); + $this->assertEquals(['returnedFile'], $this->library->getFiles($this->themeMock, $subPath)); } /** diff --git a/lib/internal/Magento/Framework/DB/Tree.php b/lib/internal/Magento/Framework/DB/Tree.php index 42b3060e86fc76afe3ed717dcb6b725bb1c18a25..19148e403a82221fbf122f96d6b35841a3847dd3 100644 --- a/lib/internal/Magento/Framework/DB/Tree.php +++ b/lib/internal/Magento/Framework/DB/Tree.php @@ -5,9 +5,6 @@ */ namespace Magento\Framework\DB; -\Zend_Loader::loadClass('\Magento\Framework\DB\Select'); -\Zend_Loader::loadClass('\Magento\Framework\DB\Tree\Node'); -\Zend_Loader::loadClass('\Magento\Framework\DB\Tree\NodeSet'); use Magento\Framework\DB\Tree\Node; use Magento\Framework\DB\Tree\NodeSet; use Magento\Framework\Exception\LocalizedException; diff --git a/lib/internal/Magento/Framework/Data/Test/Unit/Argument/XsdTest.php b/lib/internal/Magento/Framework/Data/Test/Unit/Argument/XsdTest.php index ddd01ed6296891fff32f3047929c9d9d3475b76b..5bbb077799ed70d66efd2a1b307ff8165a6936ec 100644 --- a/lib/internal/Magento/Framework/Data/Test/Unit/Argument/XsdTest.php +++ b/lib/internal/Magento/Framework/Data/Test/Unit/Argument/XsdTest.php @@ -14,7 +14,7 @@ class XsdTest extends \PHPUnit_Framework_TestCase protected $_typesXsdSchema; /** - * @var \Magento\TestFramework\Utility\XsdValidator + * @var \Magento\Framework\TestFramework\Unit\Utility\XsdValidator */ protected $_xsdValidator; diff --git a/lib/internal/Magento/Framework/Data/Test/Unit/Argument/_files/typesInvalidArray.php b/lib/internal/Magento/Framework/Data/Test/Unit/Argument/_files/typesInvalidArray.php index 22a40a91a997031f788a9fdc36a9dcb55477493d..cd5bd4b29f948db3ed7de3b95b9d295b58110de2 100644 --- a/lib/internal/Magento/Framework/Data/Test/Unit/Argument/_files/typesInvalidArray.php +++ b/lib/internal/Magento/Framework/Data/Test/Unit/Argument/_files/typesInvalidArray.php @@ -6,63 +6,65 @@ return [ 'no arguments' => [ '<?xml version="1.0"?><arguments xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" />', - ["Element 'arguments': Missing child element(s). Expected is ( argument )."], + ["Element 'arguments': Missing child element(s). Expected is ( argument ).\nLine: 1\n"], ], 'argument without type' => [ '<?xml version="1.0"?><arguments xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><argument/></arguments>', - ["Element 'argument': The type definition is abstract."], + ["Element 'argument': The type definition is abstract.\nLine: 1\n"], ], 'forbidden type used' => [ '<?xml version="1.0"?><arguments xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <argument name="a" xsi:type="forbiddenType">v</argument></arguments>', [ "Element 'argument', attribute '{http://www.w3.org/2001/XMLSchema-instance}type': The QName value " . - "'forbiddenType' of the xsi:type attribute does not resolve to a type definition.", - "Element 'argument': The type definition is abstract." + "'forbiddenType' of the xsi:type attribute does not resolve to a type definition.\nLine: 2\n", + "Element 'argument': The type definition is abstract.\nLine: 2\n" ], ], 'abstract type argumentType used' => [ '<?xml version="1.0"?><arguments xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <argument name="a" xsi:type="argumentType">v</argument></arguments>', - ["Element 'argument': The type definition is abstract."], + ["Element 'argument': The type definition is abstract.\nLine: 2\n"], ], 'no name attribute' => [ '<?xml version="1.0"?><arguments xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <argument xsi:type="number">v</argument></arguments>', - ["Element 'argument': The attribute 'name' is required but missing."], + ["Element 'argument': The attribute 'name' is required but missing.\nLine: 2\n"], ], 'forbidden attribute' => [ '<?xml version="1.0"?><arguments xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <argument name="a" xsi:type="string" forbiddenAttribute="w">v</argument></arguments>', - ["Element 'argument', attribute 'forbiddenAttribute': The attribute 'forbiddenAttribute' is not allowed."], + [ + "Element 'argument', attribute 'forbiddenAttribute': The attribute 'forbiddenAttribute'" . + " is not allowed.\nLine: 2\n"], ], 'forbidden translate attribute value for string' => [ '<?xml version="1.0"?><arguments xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <argument name="a" xsi:type="string" translate="forbidden">v</argument></arguments>', [ "Element 'argument', attribute 'translate': 'forbidden' is not a valid value of the atomic type " . - "'xs:boolean'." + "'xs:boolean'.\nLine: 2\n" ], ], 'attribute translate for non-string' => [ '<?xml version="1.0"?><arguments xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <argument name="a" xsi:type="boolean" translate="true">true</argument></arguments>', - ["Element 'argument', attribute 'translate': The attribute 'translate' is not allowed."], + ["Element 'argument', attribute 'translate': The attribute 'translate' is not allowed.\nLine: 2\n"], ], 'null type should be empty' => [ '<?xml version="1.0"?><arguments xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <argument name="a" xsi:type="null">v</argument></arguments>', - ["Element 'argument': Character content is not allowed, because the content type is empty."], + ["Element 'argument': Character content is not allowed, because the content type is empty.\nLine: 2\n"], ], 'forbidden child node' => [ '<?xml version="1.0"?><arguments xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <argument name="a" xsi:type="string"><child>v</child></argument></arguments>', - ["Element 'child': This element is not expected."], + ["Element 'child': This element is not expected.\nLine: 2\n"], ], 'array with forbidden child' => [ '<?xml version="1.0"?><arguments xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <argument name="a" xsi:type="array"><child>v</child></argument></arguments>', - ["Element 'child': This element is not expected. Expected is ( item )."], + ["Element 'child': This element is not expected. Expected is ( item ).\nLine: 2\n"], ], 'array with 2 same items' => [ '<?xml version="1.0"?><arguments xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> @@ -70,14 +72,15 @@ return [ <item name="name" xsi:type="string">v1</item> <item name="name" xsi:type="string">v2</item> </argument></arguments>', - ["Element 'item': Duplicate key-sequence ['name'] in key identity-constraint 'argumentItemName'."], + ["Element 'item': Duplicate key-sequence ['name'] in key identity-constraint 'argumentItemName'.\nLine: 4\n"], ], 'array item without name' => [ '<?xml version="1.0"?><arguments xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <argument name="a" xsi:type="array"><item xsi:type="string">v</item></argument></arguments>', [ - "Element 'item': The attribute 'name' is required but missing.", - "Element 'item': Not all fields of key identity-constraint 'argumentItemName' evaluate to a node." + "Element 'item': The attribute 'name' is required but missing.\nLine: 2\n", + "Element 'item': Not all fields of key identity-constraint 'argumentItemName'" . + " evaluate to a node.\nLine: 2\n" ], ], 'array item with forbidden child' => [ @@ -85,7 +88,7 @@ return [ <argument name="a" xsi:type="array"> <item name="item" xsi:type="string"><child>v</child></item> </argument></arguments>', - ["Element 'child': This element is not expected."], + ["Element 'child': This element is not expected.\nLine: 3\n"], ], 'nested array with same named items' => [ '<?xml version="1.0"?><arguments xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> @@ -99,6 +102,6 @@ return [ <item name="item4" xsi:type="string">v</item> </item> </argument></arguments>', - ["Element 'item': Duplicate key-sequence ['item4'] in key identity-constraint 'itemName'."], + ["Element 'item': Duplicate key-sequence ['item4'] in key identity-constraint 'itemName'.\nLine: 9\n"], ] ]; diff --git a/lib/internal/Magento/Framework/Data/Test/Unit/Argument/_files/types_schema.xsd b/lib/internal/Magento/Framework/Data/Test/Unit/Argument/_files/types_schema.xsd index e306c30fa7fbb3c3b3bf1edeecba4a7988f332d5..376f73561e6f27ed9953feb1b9384654c415b61d 100644 --- a/lib/internal/Magento/Framework/Data/Test/Unit/Argument/_files/types_schema.xsd +++ b/lib/internal/Magento/Framework/Data/Test/Unit/Argument/_files/types_schema.xsd @@ -9,6 +9,6 @@ */ --> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> - <xs:include schemaLocation="../../../../../../../../../lib/internal/Magento/Framework/Data/etc/argument/types.xsd"/> + <xs:include schemaLocation="../../../../etc/argument/types.xsd"/> <xs:element name="arguments" type="argumentsType"/> </xs:schema> diff --git a/lib/internal/Magento/Framework/Data/Test/Unit/Argument/_files/types_valid.xml b/lib/internal/Magento/Framework/Data/Test/Unit/Argument/_files/types_valid.xml index b89930f0754c4f9bd25c29d114d881f3bc4d153d..259ceab3011d59d5efdede33ac49a6a94600b937 100644 --- a/lib/internal/Magento/Framework/Data/Test/Unit/Argument/_files/types_valid.xml +++ b/lib/internal/Magento/Framework/Data/Test/Unit/Argument/_files/types_valid.xml @@ -7,7 +7,7 @@ * See COPYING.txt for license details. */ --> -<arguments xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="types_schema.xsd"> +<arguments xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Data/Test/Unit/Argument/_files/types_schema.xsd"> <argument name="string " xsi:type="string">String</argument> <argument name="string with translate" xsi:type="string" translate="true">String with translate</argument> <argument name="string with translate false (for overriding)" xsi:type="string" translate="false">String with translate false</argument> diff --git a/lib/internal/Magento/Framework/DataObject/Copy/Config/SchemaLocator.php b/lib/internal/Magento/Framework/DataObject/Copy/Config/SchemaLocator.php index bbce34c2ba97b4736da0c29e3c03e8a01461a58f..b3046227d8bca727787cf39e6cd055c721653691 100644 --- a/lib/internal/Magento/Framework/DataObject/Copy/Config/SchemaLocator.php +++ b/lib/internal/Magento/Framework/DataObject/Copy/Config/SchemaLocator.php @@ -7,8 +7,7 @@ */ namespace Magento\Framework\DataObject\Copy\Config; -use Magento\Framework\App\Filesystem\DirectoryList; -use Magento\Framework\Filesystem; +use Magento\Framework\Config\Dom\UrnResolver; class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface { @@ -27,15 +26,14 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface protected $_perFileSchema; /** - * @param Filesystem $filesystem + * @param UrnResolver $urnResolver * @param string $schema * @param string $perFileSchema */ - public function __construct(Filesystem $filesystem, $schema, $perFileSchema) + public function __construct(UrnResolver $urnResolver, $schema, $perFileSchema) { - $rootDir = $filesystem->getDirectoryRead(DirectoryList::ROOT); - $this->_schema = $rootDir->getAbsolutePath($schema); - $this->_perFileSchema = $rootDir->getAbsolutePath($perFileSchema); + $this->_schema = $urnResolver->getRealPath($schema); + $this->_perFileSchema = $urnResolver->getRealPath($perFileSchema); } /** diff --git a/lib/internal/Magento/Framework/DataObject/Test/Unit/Copy/Config/SchemaLocatorTest.php b/lib/internal/Magento/Framework/DataObject/Test/Unit/Copy/Config/SchemaLocatorTest.php index 921a63c71ead8c235f88b713bb4e071fd1d7795c..417f68739a675a2927b3a2b47e6a34722af0b577 100644 --- a/lib/internal/Magento/Framework/DataObject/Test/Unit/Copy/Config/SchemaLocatorTest.php +++ b/lib/internal/Magento/Framework/DataObject/Test/Unit/Copy/Config/SchemaLocatorTest.php @@ -17,38 +17,34 @@ class SchemaLocatorTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $rootDirMock = $this->getMockForAbstractClass('\Magento\Framework\Filesystem\Directory\ReadInterface'); - $rootDirMock->expects($this->exactly(2)) - ->method('getAbsolutePath') - ->will($this->returnCallback(function ($path) { - return 'schema_dir/' . $path; - })); - $fileSystemMock = $this->getMock( - 'Magento\Framework\Filesystem', + $urnResolverMock = $this->getMock( + 'Magento\Framework\Config\Dom\UrnResolver', [], [], '', false ); - $fileSystemMock->expects($this->once()) - ->method('getDirectoryRead') - ->with(DirectoryList::ROOT) - ->will($this->returnValue($rootDirMock)); + $urnResolverMock->expects($this->exactly(2)) + ->method('getRealPath') + ->will($this->returnCallback(function ($urn) { + $urnParts = explode(':', $urn); + return 'schema_dir/' . $urnParts[3]; + })); $this->model = new \Magento\Framework\DataObject\Copy\Config\SchemaLocator( - $fileSystemMock, - 'schema.xsd', - 'perFileSchema.xsd' + $urnResolverMock, + 'urn:magento:framework:DataObject/etc/schema.xsd', + 'urn:magento:framework:DataObject/etc/perFileSchema.xsd' ); } public function testGetSchema() { - $this->assertEquals('schema_dir/schema.xsd', $this->model->getSchema()); + $this->assertEquals('schema_dir/DataObject/etc/schema.xsd', $this->model->getSchema()); } public function testGetPerFileSchema() { - $this->assertEquals('schema_dir/perFileSchema.xsd', $this->model->getPerFileSchema()); + $this->assertEquals('schema_dir/DataObject/etc/perFileSchema.xsd', $this->model->getPerFileSchema()); } } diff --git a/lib/internal/Magento/Framework/DataObject/Test/Unit/Copy/Config/_files/fieldset.xml b/lib/internal/Magento/Framework/DataObject/Test/Unit/Copy/Config/_files/fieldset.xml index 0f0b53fc459bea9482eaec06e416698126b9211d..532648084e3cf5e96bf068f8ff2626b86f08db18 100644 --- a/lib/internal/Magento/Framework/DataObject/Test/Unit/Copy/Config/_files/fieldset.xml +++ b/lib/internal/Magento/Framework/DataObject/Test/Unit/Copy/Config/_files/fieldset.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../..//etc/fieldset.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:framework:DataObject/etc/fieldset.xsd"> <scope id="global"> <fieldset id="sales_convert_quote_address"> <field name="company"> diff --git a/lib/internal/Magento/Framework/Encryption/EncryptorInterface.php b/lib/internal/Magento/Framework/Encryption/EncryptorInterface.php index 0af8a165a977a2bfcf4837b9c30de4ac28a02341..583a5efb20e2fe442f043e8a92b85b32d57a3ad7 100644 --- a/lib/internal/Magento/Framework/Encryption/EncryptorInterface.php +++ b/lib/internal/Magento/Framework/Encryption/EncryptorInterface.php @@ -40,7 +40,6 @@ interface EncryptorInterface * @param string $hash * @return bool * @throws \Exception - * @deprecated */ public function validateHash($password, $hash); diff --git a/lib/internal/Magento/Framework/Event/Config/SchemaLocator.php b/lib/internal/Magento/Framework/Event/Config/SchemaLocator.php index e64b3db16678b39f98c243b7724c4b7820e5e763..19dc01404c10bb4c4a0ea0a75296dacecefa613e 100644 --- a/lib/internal/Magento/Framework/Event/Config/SchemaLocator.php +++ b/lib/internal/Magento/Framework/Event/Config/SchemaLocator.php @@ -9,6 +9,14 @@ namespace Magento\Framework\Event\Config; class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface { + /** @var \Magento\Framework\Config\Dom\UrnResolver */ + protected $urnResolver; + + public function __construct(\Magento\Framework\Config\Dom\UrnResolver $urnResolver) + { + $this->urnResolver = $urnResolver; + } + /** * Get path to merged config schema * @@ -16,7 +24,7 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface */ public function getSchema() { - return realpath(__DIR__ . '/../etc/events.xsd'); + return $this->urnResolver->getRealPath('urn:magento:framework:Event/etc/events.xsd'); } /** @@ -26,6 +34,6 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface */ public function getPerFileSchema() { - return $this->getSchema(); + return $this->urnResolver->getRealPath('urn:magento:framework:Event/etc/events.xsd'); } } diff --git a/lib/internal/Magento/Framework/Event/ConfigInterface.php b/lib/internal/Magento/Framework/Event/ConfigInterface.php index 5ab14fe123be9d5dfe1e6286dee01ec336fb98c0..0d744932da82f9ba688fd39de641846abc88c577 100644 --- a/lib/internal/Magento/Framework/Event/ConfigInterface.php +++ b/lib/internal/Magento/Framework/Event/ConfigInterface.php @@ -9,6 +9,13 @@ namespace Magento\Framework\Event; interface ConfigInterface { + /**#@+ + * Event types + */ + const TYPE_CORE = 'core'; + const TYPE_CUSTOM = 'custom'; + /**#@-*/ + /** * Get observers by event name * diff --git a/lib/internal/Magento/Framework/Event/Test/Unit/Config/SchemaLocatorTest.php b/lib/internal/Magento/Framework/Event/Test/Unit/Config/SchemaLocatorTest.php index 0aa3de2e4591abaa5936900b6b912fc60858f7b9..c57385fbf69f450b9bc78a846a7c722a8f790e21 100644 --- a/lib/internal/Magento/Framework/Event/Test/Unit/Config/SchemaLocatorTest.php +++ b/lib/internal/Magento/Framework/Event/Test/Unit/Config/SchemaLocatorTest.php @@ -8,31 +8,48 @@ namespace Magento\Framework\Event\Test\Unit\Config; class SchemaLocatorTest extends \PHPUnit_Framework_TestCase { /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Resource\Config\SchemaLocator */ - protected $_moduleReaderMock; + protected $model; - /** - * @var \Magento\Framework\Event\Config\SchemaLocator - */ - protected $_model; + /** @var \Magento\Framework\Config\Dom\UrnResolver $urnResolverMock */ + protected $urnResolver; + + /** @var \Magento\Framework\Config\Dom\UrnResolver $urnResolverMock */ + protected $urnResolverMock; protected function setUp() { - $this->_model = new \Magento\Framework\Event\Config\SchemaLocator(); + $this->urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + $this->urnResolverMock = $this->getMock('Magento\Framework\Config\Dom\UrnResolver', [], [], '', false); + $this->model = new \Magento\Framework\Event\Config\SchemaLocator($this->urnResolverMock); } public function testGetSchema() { - $expected = str_replace('\\', '/', BP . '/lib/internal/Magento/Framework/Event/etc/events.xsd'); - $actual = str_replace('\\', '/', $this->_model->getSchema()); - $this->assertEquals($expected, $actual); + $this->urnResolverMock->expects($this->once()) + ->method('getRealPath') + ->with('urn:magento:framework:Event/etc/events.xsd') + ->willReturn( + $this->urnResolver->getRealPath('urn:magento:framework:Event/etc/events.xsd') + ); + $this->assertEquals( + $this->urnResolver->getRealPath('urn:magento:framework:Event/etc/events.xsd'), + $this->model->getSchema() + ); } public function testGetPerFileSchema() { - $actual = str_replace('\\', '/', $this->_model->getPerFileSchema()); - $expected = str_replace('\\', '/', BP . '/lib/internal/Magento/Framework/Event/etc/events.xsd'); - $this->assertEquals($expected, $actual); + $this->urnResolverMock->expects($this->once()) + ->method('getRealPath') + ->with('urn:magento:framework:Event/etc/events.xsd') + ->willReturn( + $this->urnResolver->getRealPath('urn:magento:framework:Event/etc/events.xsd') + ); + $this->assertEquals( + $this->urnResolver->getRealPath('urn:magento:framework:Event/etc/events.xsd'), + $this->model->getPerFileSchema() + ); } } diff --git a/lib/internal/Magento/Framework/Event/Test/Unit/Config/XsdTest.php b/lib/internal/Magento/Framework/Event/Test/Unit/Config/XsdTest.php index 0749c35e08d90b6263096234e68d5ad81819f0da..38c0bccd90f0e203080a435b689955d3b9ece3f0 100644 --- a/lib/internal/Magento/Framework/Event/Test/Unit/Config/XsdTest.php +++ b/lib/internal/Magento/Framework/Event/Test/Unit/Config/XsdTest.php @@ -14,13 +14,14 @@ class XsdTest extends \PHPUnit_Framework_TestCase protected $_xsdSchema; /** - * @var \Magento\TestFramework\Utility\XsdValidator + * @var \Magento\Framework\TestFramework\Unit\Utility\XsdValidator */ protected $_xsdValidator; protected function setUp() { - $this->_xsdSchema = BP . '/lib/internal/Magento/Framework/Event/etc/events.xsd'; + $urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + $this->_xsdSchema = $urnResolver->getRealPath('urn:magento:framework:Event/etc/events.xsd'); $this->_xsdValidator = new \Magento\Framework\TestFramework\Unit\Utility\XsdValidator(); } diff --git a/lib/internal/Magento/Framework/Event/Test/Unit/Config/_files/event_config.xml b/lib/internal/Magento/Framework/Event/Test/Unit/Config/_files/event_config.xml index c6741a6435b3d618c51393d3ec8d56e8e3e009a2..35aaf442c1512d280c42f0fe8f19b00f91adfea6 100644 --- a/lib/internal/Magento/Framework/Event/Test/Unit/Config/_files/event_config.xml +++ b/lib/internal/Magento/Framework/Event/Test/Unit/Config/_files/event_config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="event_1"> <observer name="observer_1" instance="instance_1" method="method_name_1" /> <observer name="observer_5" instance="instance_5" method="method_name_5" disabled="false" shared="true" /> diff --git a/lib/internal/Magento/Framework/Event/Test/Unit/Config/_files/event_invalid_config.xml b/lib/internal/Magento/Framework/Event/Test/Unit/Config/_files/event_invalid_config.xml index 2f2e0310d6ad8c13af782eb86e1e302d78031023..24ce02edff2ab7144dd13cdf3c9e73271e673387 100644 --- a/lib/internal/Magento/Framework/Event/Test/Unit/Config/_files/event_invalid_config.xml +++ b/lib/internal/Magento/Framework/Event/Test/Unit/Config/_files/event_invalid_config.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="event_1"> <observer instance="instance_1" method="method_name_1" /> </event> diff --git a/lib/internal/Magento/Framework/Event/Test/Unit/Config/_files/invalidEventsXmlArray.php b/lib/internal/Magento/Framework/Event/Test/Unit/Config/_files/invalidEventsXmlArray.php index b6f56d943361fcaad21bdc95e58a020df7ff7ef2..0c243dc6ca3afd305f296aca6476c44fbc87bb4a 100644 --- a/lib/internal/Magento/Framework/Event/Test/Unit/Config/_files/invalidEventsXmlArray.php +++ b/lib/internal/Magento/Framework/Event/Test/Unit/Config/_files/invalidEventsXmlArray.php @@ -6,39 +6,39 @@ return [ 'without_event_handle' => [ '<?xml version="1.0"?><config></config>', - ["Element 'config': Missing child element(s). Expected is ( event )."], + ["Element 'config': Missing child element(s). Expected is ( event ).\nLine: 1\n"], ], 'event_without_required_name_attribute' => [ '<?xml version="1.0"?><config><event name="some_name"></event></config>', - ["Element 'event': Missing child element(s). Expected is ( observer )."], + ["Element 'event': Missing child element(s). Expected is ( observer ).\nLine: 1\n"], ], 'event_with_notallowed_attribute' => [ '<?xml version="1.0"?><config><event name="somename" notallowed="some value"><observer name="observer_name" ' . '/></event></config>', - ["Element 'event', attribute 'notallowed': The attribute 'notallowed' is not allowed."], + ["Element 'event', attribute 'notallowed': The attribute 'notallowed' is not allowed.\nLine: 1\n"], ], 'event_with_same_name_attribute_value' => [ '<?xml version="1.0"?><config><event name="same_name"><observer name="observer_name" /></event><event ' . 'name="same_name"><observer name="observer_name" /></event></config>', [ "Element 'event': Duplicate key-sequence ['same_name'] in unique identity-constraint " . - "'uniqueEventName'." + "'uniqueEventName'.\nLine: 1\n" ], ], 'event_without_required_observer_handle' => [ '<?xml version="1.0"?><config><event name="some_name"></event></config>', - ["Element 'event': Missing child element(s). Expected is ( observer )."], + ["Element 'event': Missing child element(s). Expected is ( observer ).\nLine: 1\n"], ], 'event_without_required_observer_name_attribute' => [ '<?xml version="1.0"?><config><event name="some_name"><observer shared="true"/></event></config>', - ["Element 'observer': The attribute 'name' is required but missing."], + ["Element 'observer': The attribute 'name' is required but missing.\nLine: 1\n"], ], 'event_with_same_observer_handle_name' => [ '<?xml version="1.0"?><config><event name="some_name"><observer name="observer_name"/><observer ' . 'name="observer_name"/></event></config>', [ "Element 'observer': Duplicate key-sequence ['observer_name'] in unique identity-constraint " . - "'uniqueObserverName'." + "'uniqueObserverName'.\nLine: 1\n" ], ], 'event_observer_with_invalid_disabled_value' => [ @@ -46,7 +46,7 @@ return [ 'name="observer_name" disabled="string"/></event></config>', [ "Element 'observer', attribute 'disabled': 'string' is not a valid value of the atomic type" . - " 'xs:boolean'." + " 'xs:boolean'.\nLine: 1\n" ], ], 'event_observer_with_invalid_shared_value' => [ @@ -54,7 +54,7 @@ return [ 'name="observer_name" shared="string"/></event></config>', [ "Element 'observer', attribute 'shared': 'string' is not a valid value of the atomic type" . - " 'xs:boolean'." + " 'xs:boolean'.\nLine: 1\n" ], ], 'event_observer_with_invalid_method_value' => [ @@ -62,9 +62,9 @@ return [ 'name="observer_name" method="_wrong name"/></event></config>', [ "Element 'observer', attribute 'method': [facet 'pattern'] The value '_wrong name' is not accepted by" . - " the pattern '[a-zA-Z]+'.", + " the pattern '[a-zA-Z]+'.\nLine: 1\n", "Element 'observer', attribute 'method': '_wrong name' is not a valid value of the atomic type " . - "'methodName'." + "'methodName'.\nLine: 1\n" ], ] ]; diff --git a/lib/internal/Magento/Framework/Event/Test/Unit/Config/_files/valid_events.xml b/lib/internal/Magento/Framework/Event/Test/Unit/Config/_files/valid_events.xml index 4f7a1b2567403bb26b7cc60472bf5e2ab97faeb1..88d806d805f38a711dd534075da09e23b9526e41 100644 --- a/lib/internal/Magento/Framework/Event/Test/Unit/Config/_files/valid_events.xml +++ b/lib/internal/Magento/Framework/Event/Test/Unit/Config/_files/valid_events.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="authorization_roles_load_after"> <observer name="observer_name" instance="Some_Test_Value" method="addDataAfterRoleLoad" disabled="false" shared="true"/> </event> diff --git a/lib/internal/Magento/Framework/Indexer/Config/SchemaLocator.php b/lib/internal/Magento/Framework/Indexer/Config/SchemaLocator.php index e6fffe6aa191feca8406d4b09708ade4cbd2a84b..0eda1f01f54565c3e2f0551395d1ec0abaabb7dc 100644 --- a/lib/internal/Magento/Framework/Indexer/Config/SchemaLocator.php +++ b/lib/internal/Magento/Framework/Indexer/Config/SchemaLocator.php @@ -9,6 +9,14 @@ use Magento\Framework\Config\SchemaLocatorInterface; class SchemaLocator implements SchemaLocatorInterface { + /** @var \Magento\Framework\Config\Dom\UrnResolver */ + protected $urnResolver; + + public function __construct(\Magento\Framework\Config\Dom\UrnResolver $urnResolver) + { + $this->urnResolver = $urnResolver; + } + /** * Get path to merged config schema * @@ -16,7 +24,7 @@ class SchemaLocator implements SchemaLocatorInterface */ public function getSchema() { - return realpath(__DIR__ . '/../etc/') . '/indexer_merged.xsd'; + return $this->urnResolver->getRealPath('urn:magento:framework:Indexer/etc/indexer_merged.xsd'); } /** @@ -26,6 +34,6 @@ class SchemaLocator implements SchemaLocatorInterface */ public function getPerFileSchema() { - return realpath(__DIR__ . '/../etc/') . '/indexer.xsd'; + return $this->urnResolver->getRealPath('urn:magento:framework:Indexer/etc/indexer.xsd'); } } diff --git a/lib/internal/Magento/Framework/Indexer/Test/Unit/Config/ReaderTest.php b/lib/internal/Magento/Framework/Indexer/Test/Unit/Config/ReaderTest.php index 266ddc2ae61ce697deaad008a2da32a0d206c1a0..54f09ad61288082e6efb53e31faaab607ad67225 100644 --- a/lib/internal/Magento/Framework/Indexer/Test/Unit/Config/ReaderTest.php +++ b/lib/internal/Magento/Framework/Indexer/Test/Unit/Config/ReaderTest.php @@ -39,7 +39,9 @@ class ReaderTest extends \PHPUnit_Framework_TestCase $this->_model = new \Magento\Framework\Indexer\Config\Reader( $this->_fileResolverMock, $this->_converter, - new \Magento\Framework\Indexer\Config\SchemaLocator(), + new \Magento\Framework\Indexer\Config\SchemaLocator( + new \Magento\Framework\Config\Dom\UrnResolver() + ), $validationState ); } diff --git a/lib/internal/Magento/Framework/Indexer/Test/Unit/Config/SchemaLocatorTest.php b/lib/internal/Magento/Framework/Indexer/Test/Unit/Config/SchemaLocatorTest.php new file mode 100644 index 0000000000000000000000000000000000000000..cc112a7f0a83e4432fca872165790690dcb5cb69 --- /dev/null +++ b/lib/internal/Magento/Framework/Indexer/Test/Unit/Config/SchemaLocatorTest.php @@ -0,0 +1,56 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Framework\Indexer\Test\Unit\Config; + +class SchemaLocatorTest extends \PHPUnit_Framework_TestCase +{ + + /** + * @var \Magento\Framework\App\Resource\Config\SchemaLocator + */ + protected $model; + + /** @var \Magento\Framework\Config\Dom\UrnResolver $urnResolverMock */ + protected $urnResolver; + + /** @var \Magento\Framework\Config\Dom\UrnResolver $urnResolverMock */ + protected $urnResolverMock; + + protected function setUp() + { + $this->urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + $this->urnResolverMock = $this->getMock('Magento\Framework\Config\Dom\UrnResolver', [], [], '', false); + $this->model = new \Magento\Framework\Indexer\Config\SchemaLocator($this->urnResolverMock); + } + + public function testGetSchema() + { + $this->urnResolverMock->expects($this->once()) + ->method('getRealPath') + ->with('urn:magento:framework:Indexer/etc/indexer_merged.xsd') + ->willReturn( + $this->urnResolver->getRealPath('urn:magento:framework:Indexer/etc/indexer_merged.xsd') + ); + $this->assertEquals( + $this->urnResolver->getRealPath('urn:magento:framework:Indexer/etc/indexer_merged.xsd'), + $this->model->getSchema() + ); + } + + public function testGetPerFileSchema() + { + $this->urnResolverMock->expects($this->once()) + ->method('getRealPath') + ->with('urn:magento:framework:Indexer/etc/indexer.xsd') + ->willReturn( + $this->urnResolver->getRealPath('urn:magento:framework:Indexer/etc/indexer.xsd') + ); + $this->assertEquals( + $this->urnResolver->getRealPath('urn:magento:framework:Indexer/etc/indexer.xsd'), + $this->model->getPerFileSchema() + ); + } +} diff --git a/lib/internal/Magento/Framework/Indexer/Test/Unit/XsdTest.php b/lib/internal/Magento/Framework/Indexer/Test/Unit/XsdTest.php index 8f94183c530f790c372e85b9dd319d9a45c3acb6..11ef33fcce3568ca64582d75779b2f327245935a 100644 --- a/lib/internal/Magento/Framework/Indexer/Test/Unit/XsdTest.php +++ b/lib/internal/Magento/Framework/Indexer/Test/Unit/XsdTest.php @@ -14,13 +14,18 @@ class XsdTest extends \PHPUnit_Framework_TestCase protected $_xsdSchema; /** - * @var \Magento\TestFramework\Utility\XsdValidator + * @var \Magento\Framework\Config\Dom\UrnResolver + */ + protected $urnResolver; + /** + * @var \Magento\Framework\TestFramework\Unit\Utility\XsdValidator */ protected $_xsdValidator; protected function setUp() { - $this->_xsdSchema = BP . '/lib/internal/Magento/Framework/Indexer/etc/indexer.xsd'; + $this->urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + $this->_xsdSchema = $this->urnResolver->getRealPath('urn:magento:framework:Indexer/etc/indexer.xsd'); $this->_xsdValidator = new \Magento\Framework\TestFramework\Unit\Utility\XsdValidator(); } @@ -32,7 +37,7 @@ class XsdTest extends \PHPUnit_Framework_TestCase public function testSchemaCorrectlyIdentifiesInvalidXml($xmlString, $expectedError) { $actualError = $this->_xsdValidator->validate( - BP . '/lib/internal/Magento/Framework/Indexer/etc/indexer_merged.xsd', + $this->urnResolver->getRealPath('urn:magento:framework:Indexer/etc/indexer_merged.xsd'), $xmlString ); $this->assertEquals($expectedError, $actualError); diff --git a/lib/internal/Magento/Framework/Indexer/Test/Unit/_files/indexer_merged_one.xml b/lib/internal/Magento/Framework/Indexer/Test/Unit/_files/indexer_merged_one.xml index d886f7bfb04f944c24409ad8dcbc202e5dd27c0a..378a532b52688665cd5e6638dfe0238d718f17ad 100644 --- a/lib/internal/Magento/Framework/Indexer/Test/Unit/_files/indexer_merged_one.xml +++ b/lib/internal/Magento/Framework/Indexer/Test/Unit/_files/indexer_merged_one.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../etc/indexer.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Indexer/etc/indexer.xsd"> <indexer id="indexer_internal_name_one" view_id="view_one" class="Index\Class\Name\One"> <title translate="true">Indexer public name one</title> <description translate="true">Indexer public description one</description> diff --git a/lib/internal/Magento/Framework/Indexer/Test/Unit/_files/indexer_merged_two.xml b/lib/internal/Magento/Framework/Indexer/Test/Unit/_files/indexer_merged_two.xml index 546d8a46627c3e19aa1a241554743ab6fbe7b3b8..cf4dc874fc11901f1c853b0de7382dfb0182c5c5 100644 --- a/lib/internal/Magento/Framework/Indexer/Test/Unit/_files/indexer_merged_two.xml +++ b/lib/internal/Magento/Framework/Indexer/Test/Unit/_files/indexer_merged_two.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../etc/indexer.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Indexer/etc/indexer.xsd"> <indexer id="indexer_internal_name_one" view_id="view_two" class="Index\Class\Name\Two"> <title translate="true">Indexer public name two</title> <description translate="true">Indexer public description two</description> diff --git a/lib/internal/Magento/Framework/Indexer/Test/Unit/_files/indexer_one.xml b/lib/internal/Magento/Framework/Indexer/Test/Unit/_files/indexer_one.xml index eff97c9480a84c27202a38ce15efdd67f32a770d..3c33b5102c0130f958ae1041cfd3ad9caa847248 100644 --- a/lib/internal/Magento/Framework/Indexer/Test/Unit/_files/indexer_one.xml +++ b/lib/internal/Magento/Framework/Indexer/Test/Unit/_files/indexer_one.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../etc/indexer.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Indexer/etc/indexer.xsd"> <indexer id="indexer_internal_name_one" view_id="view_one" class="Index\Class\Name\One"> <title translate="true">Indexer public name one</title> <description translate="true">Indexer public description one</description> diff --git a/lib/internal/Magento/Framework/Indexer/Test/Unit/_files/indexer_three.xml b/lib/internal/Magento/Framework/Indexer/Test/Unit/_files/indexer_three.xml index 546d8a46627c3e19aa1a241554743ab6fbe7b3b8..cf4dc874fc11901f1c853b0de7382dfb0182c5c5 100644 --- a/lib/internal/Magento/Framework/Indexer/Test/Unit/_files/indexer_three.xml +++ b/lib/internal/Magento/Framework/Indexer/Test/Unit/_files/indexer_three.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../etc/indexer.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Indexer/etc/indexer.xsd"> <indexer id="indexer_internal_name_one" view_id="view_two" class="Index\Class\Name\Two"> <title translate="true">Indexer public name two</title> <description translate="true">Indexer public description two</description> diff --git a/lib/internal/Magento/Framework/Indexer/Test/Unit/_files/indexer_two.xml b/lib/internal/Magento/Framework/Indexer/Test/Unit/_files/indexer_two.xml index 80e8743d1a23ef149a4d880041f68624ecc9c96a..bb070481b335fbd3cff7fee24ab2be9e03d25691 100644 --- a/lib/internal/Magento/Framework/Indexer/Test/Unit/_files/indexer_two.xml +++ b/lib/internal/Magento/Framework/Indexer/Test/Unit/_files/indexer_two.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../etc/indexer.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Indexer/etc/indexer.xsd"> <indexer id="indexer_internal_name_two" view_id="view_two" class="Index\Class\Name\Two"> <title translate="true">Indexer public name two</title> <description translate="true">Indexer public description two</description> diff --git a/lib/internal/Magento/Framework/Indexer/Test/Unit/_files/invalidIndexerXmlArray.php b/lib/internal/Magento/Framework/Indexer/Test/Unit/_files/invalidIndexerXmlArray.php index ee42af815c85ccac896d36e7643c89572bba5f50..529a856bf55c75516a6b3cad14452a36e5c137f5 100644 --- a/lib/internal/Magento/Framework/Indexer/Test/Unit/_files/invalidIndexerXmlArray.php +++ b/lib/internal/Magento/Framework/Indexer/Test/Unit/_files/invalidIndexerXmlArray.php @@ -6,24 +6,27 @@ return [ 'without_indexer_handle' => [ '<?xml version="1.0"?><config></config>', - ["Element 'config': Missing child element(s). Expected is ( indexer )."], + ["Element 'config': Missing child element(s). Expected is ( indexer ).\nLine: 1\n"], ], 'indexer_with_notallowed_attribute' => [ '<?xml version="1.0"?><config>' . '<indexer id="somename" view_id="view_01" class="Class\Name" notallowed="some value">' . '<title>Test</title><description>Test</description></indexer></config>', - ["Element 'indexer', attribute 'notallowed': The attribute 'notallowed' is not allowed."], + ["Element 'indexer', attribute 'notallowed': The attribute 'notallowed' is not allowed.\nLine: 1\n"], ], 'indexer_without_view_attribute' => [ '<?xml version="1.0"?><config><indexer id="somename" class="Class\Name">' . '<title>Test</title><description>Test</description></indexer></config>', - ["Element 'indexer': The attribute 'view_id' is required but missing."], + ["Element 'indexer': The attribute 'view_id' is required but missing.\nLine: 1\n"], ], 'indexer_duplicate_view_attribute' => [ '<?xml version="1.0"?><config><indexer id="somename" view_id="view_01" class="Class\Name">' . '<title>Test</title><description>Test</description></indexer>' . '<indexer id="somename_two" view_id="view_01" class="Class\Name">' . '<title>Test</title><description>Test</description></indexer></config>', - ["Element 'indexer': Duplicate key-sequence ['view_01'] in unique identity-constraint 'uniqueViewId'."], + [ + "Element 'indexer': Duplicate key-sequence ['view_01'] in unique identity-constraint" + . " 'uniqueViewId'.\nLine: 1\n" + ], ], ]; diff --git a/lib/internal/Magento/Framework/Indexer/Test/Unit/_files/valid_indexer.xml b/lib/internal/Magento/Framework/Indexer/Test/Unit/_files/valid_indexer.xml index 904ba16ef833fbacdc8c1208ab4a40154263225b..97e6fb0daa86df1549b717b7b492665572919463 100644 --- a/lib/internal/Magento/Framework/Indexer/Test/Unit/_files/valid_indexer.xml +++ b/lib/internal/Magento/Framework/Indexer/Test/Unit/_files/valid_indexer.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../etc/indexer.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Indexer/etc/indexer.xsd"> <indexer id="indexer_internal_name" view_id="view01" class="Index\Class\Name"> <title translate="true">Indexer public name</title> <description translate="true">Indexer public description</description> diff --git a/lib/internal/Magento/Framework/Message/ManagerInterface.php b/lib/internal/Magento/Framework/Message/ManagerInterface.php index 8d0ab6aaec417aadb30a07a16f2954f3061fcab1..8fca79206bf157b1a169a1041e30bd4b3d200738 100644 --- a/lib/internal/Magento/Framework/Message/ManagerInterface.php +++ b/lib/internal/Magento/Framework/Message/ManagerInterface.php @@ -52,7 +52,6 @@ interface ManagerInterface * @param string $message * @param string|null $group * @return ManagerInterface - * @deprecated * @see \Magento\Framework\Message\ManagerInterface::addErrorMessage */ public function addError($message, $group = null); @@ -63,7 +62,6 @@ interface ManagerInterface * @param string $message * @param string|null $group * @return ManagerInterface - * @deprecated * @see \Magento\Framework\Message\ManagerInterface::addWarningMessage */ public function addWarning($message, $group = null); @@ -74,7 +72,6 @@ interface ManagerInterface * @param string $message * @param string|null $group * @return ManagerInterface - * @deprecated * @see \Magento\Framework\Message\ManagerInterface::addNoticeMessage */ public function addNotice($message, $group = null); @@ -85,7 +82,6 @@ interface ManagerInterface * @param string $message * @param string|null $group * @return ManagerInterface - * @deprecated * @see \Magento\Framework\Message\ManagerInterface::addSuccessMessage */ public function addSuccess($message, $group = null); @@ -182,7 +178,6 @@ interface ManagerInterface * @param string $alternativeText * @param string|null $group * @return ManagerInterface - * @deprecated */ public function addException(\Exception $exception, $alternativeText, $group = null); diff --git a/lib/internal/Magento/Framework/Model/AbstractModel.php b/lib/internal/Magento/Framework/Model/AbstractModel.php index 630090d5f83ad57c96fa47470f33ef4fa2ee5a04..22c94a0fa18f988ead8ad8bf34cddb21466e4755 100644 --- a/lib/internal/Magento/Framework/Model/AbstractModel.php +++ b/lib/internal/Magento/Framework/Model/AbstractModel.php @@ -474,7 +474,6 @@ abstract class AbstractModel extends \Magento\Framework\DataObject /** * Get collection instance * - * @deprecated * @TODO MAGETWO-23541: Incorrect dependencies between Model\AbstractModel and Data\Collection\Db from Framework * @throws \Magento\Framework\Exception\LocalizedException * @return \Magento\Framework\Model\Resource\Db\Collection\AbstractCollection @@ -496,7 +495,6 @@ abstract class AbstractModel extends \Magento\Framework\DataObject /** * Retrieve collection instance * - * @deprecated * @TODO MAGETWO-23541: Incorrect dependencies between Model\AbstractModel and Data\Collection\Db from Framework * @return \Magento\Framework\Model\Resource\Db\Collection\AbstractCollection */ diff --git a/lib/internal/Magento/Framework/Module/Dir.php b/lib/internal/Magento/Framework/Module/Dir.php index 3e3307f92f40fd0544cb536cec186f53f00f69b1..c124eb7c3a362d0eb503d090a06b5642982c5763 100644 --- a/lib/internal/Magento/Framework/Module/Dir.php +++ b/lib/internal/Magento/Framework/Module/Dir.php @@ -7,11 +7,9 @@ */ namespace Magento\Framework\Module; -use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrarInterface; use Magento\Framework\Filesystem; -use Magento\Framework\Filesystem\Directory\ReadInterface; -use Magento\Framework\Stdlib\StringUtils as StringHelper; -use Magento\Framework\Module\ModuleRegistryInterface; class Dir { @@ -24,38 +22,19 @@ class Dir const MODULE_CONTROLLER_DIR = 'Controller'; /**#@-*/ - /** - * Modules root directory - * - * @var ReadInterface - */ - protected $_modulesDirectory; - - /** - * @var \Magento\Framework\Stdlib\StringUtils - */ - protected $_string; - /** * Module registry * - * @var ModuleRegistryInterface + * @var ComponentRegistrarInterface */ - private $moduleRegistry; + private $componentRegistrar; /** - * @param Filesystem $filesystem - * @param StringHelper $string - * @param ModuleRegistryInterface $moduleRegistry + * @param ComponentRegistrarInterface $componentRegistrar */ - public function __construct( - Filesystem $filesystem, - StringHelper $string, - ModuleRegistryInterface $moduleRegistry - ) { - $this->_modulesDirectory = $filesystem->getDirectoryRead(DirectoryList::MODULES); - $this->_string = $string; - $this->moduleRegistry = $moduleRegistry; + public function __construct(ComponentRegistrarInterface $componentRegistrar) + { + $this->componentRegistrar = $componentRegistrar; } /** @@ -68,10 +47,7 @@ class Dir */ public function getDir($moduleName, $type = '') { - if (null === $path = $this->moduleRegistry->getModulePath($moduleName)) { - $relativePath = $this->_string->upperCaseWords($moduleName, '_', '/'); - $path = $this->_modulesDirectory->getAbsolutePath($relativePath); - } + $path = $this->componentRegistrar->getPath(ComponentRegistrar::MODULE, $moduleName); if ($type) { if (!in_array($type, [ diff --git a/lib/internal/Magento/Framework/Module/Dir/Reader.php b/lib/internal/Magento/Framework/Module/Dir/Reader.php index 5f5167f88efa7776b3dfa033ede0e0715240e71d..a0a9083fc022efc4b0d08ad1192b1cff79adeac7 100644 --- a/lib/internal/Magento/Framework/Module/Dir/Reader.php +++ b/lib/internal/Magento/Framework/Module/Dir/Reader.php @@ -7,11 +7,9 @@ */ namespace Magento\Framework\Module\Dir; -use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\Config\FileIterator; use Magento\Framework\Config\FileIteratorFactory; use Magento\Framework\Filesystem; -use Magento\Framework\Filesystem\Directory\Read; use Magento\Framework\Module\Dir; use Magento\Framework\Module\ModuleListInterface; @@ -39,31 +37,31 @@ class Reader protected $modulesList; /** - * @var Read + * @var FileIteratorFactory */ - protected $modulesDirectory; + protected $fileIteratorFactory; /** - * @var FileIteratorFactory + * @var Filesystem\Directory\ReadFactory */ - protected $fileIteratorFactory; + protected $readFactory; /** * @param Dir $moduleDirs * @param ModuleListInterface $moduleList - * @param Filesystem $filesystem * @param FileIteratorFactory $fileIteratorFactory + * @param Filesystem\Directory\ReadFactory $readFactory */ public function __construct( Dir $moduleDirs, ModuleListInterface $moduleList, - Filesystem $filesystem, - FileIteratorFactory $fileIteratorFactory + FileIteratorFactory $fileIteratorFactory, + Filesystem\Directory\ReadFactory $readFactory ) { $this->moduleDirs = $moduleDirs; $this->modulesList = $moduleList; $this->fileIteratorFactory = $fileIteratorFactory; - $this->modulesDirectory = $filesystem->getDirectoryRead(DirectoryList::MODULES); + $this->readFactory = $readFactory; } /** @@ -74,15 +72,7 @@ class Reader */ public function getConfigurationFiles($filename) { - $result = []; - foreach ($this->modulesList->getNames() as $moduleName) { - $file = $this->getModuleDir('etc', $moduleName) . '/' . $filename; - $path = $this->modulesDirectory->getRelativePath($file); - if ($this->modulesDirectory->isExist($path)) { - $result[] = $path; - } - } - return $this->fileIteratorFactory->create($this->modulesDirectory, $result); + return $this->fileIteratorFactory->create($this->getFiles($filename, Dir::MODULE_ETC_DIR)); } /** @@ -91,16 +81,30 @@ class Reader * @return FileIterator */ public function getComposerJsonFiles() + { + return $this->fileIteratorFactory->create($this->getFiles('composer.json')); + } + + /** + * Go through all modules and find corresponding files of active modules + * + * @param string $filename + * @param string $subDir + * @return array + */ + private function getFiles($filename, $subDir = '') { $result = []; foreach ($this->modulesList->getNames() as $moduleName) { - $file = $this->getModuleDir('', $moduleName) . '/composer.json'; - $path = $this->modulesDirectory->getRelativePath($file); - if ($this->modulesDirectory->isExist($path)) { - $result[] = $path; + $moduleEtcDir = $this->getModuleDir($subDir, $moduleName); + $file = $moduleEtcDir . '/' . $filename; + $directoryRead = $this->readFactory->create($moduleEtcDir); + $path = $directoryRead->getRelativePath($file); + if ($directoryRead->isExist($path)) { + $result[] = $file; } } - return $this->fileIteratorFactory->create($this->modulesDirectory, $result); + return $result; } /** @@ -112,15 +116,18 @@ class Reader { $actions = []; foreach ($this->modulesList->getNames() as $moduleName) { - $actionDir = $this->getModuleDir('Controller', $moduleName); + $actionDir = $this->getModuleDir(Dir::MODULE_CONTROLLER_DIR, $moduleName); if (!file_exists($actionDir)) { continue; } $dirIterator = new \RecursiveDirectoryIterator($actionDir, \RecursiveDirectoryIterator::SKIP_DOTS); $recursiveIterator = new \RecursiveIteratorIterator($dirIterator, \RecursiveIteratorIterator::LEAVES_ONLY); + $namespace = str_replace('_', '\\', $moduleName); /** @var \SplFileInfo $actionFile */ foreach ($recursiveIterator as $actionFile) { - $actions[] = $this->modulesDirectory->getRelativePath($actionFile->getPathname()); + $actionName = str_replace('/', '\\', str_replace($actionDir, '', $actionFile->getPathname())); + $action = $namespace . "\\" . Dir::MODULE_CONTROLLER_DIR . substr($actionName, 0, -4); + $actions[strtolower($action)] = $action; } } return $actions; diff --git a/lib/internal/Magento/Framework/Module/Dir/ReverseResolver.php b/lib/internal/Magento/Framework/Module/Dir/ReverseResolver.php index 8f8a1bba1f99a4861e873849d0bc040c865c6da3..24e5f91666f762005b082f1ebba7f83c123bacd3 100644 --- a/lib/internal/Magento/Framework/Module/Dir/ReverseResolver.php +++ b/lib/internal/Magento/Framework/Module/Dir/ReverseResolver.php @@ -7,7 +7,7 @@ */ namespace Magento\Framework\Module\Dir; -use Magento\Framework\Module\Dir as ModuleDir; +use Magento\Framework\Module\Dir; use Magento\Framework\Module\ModuleListInterface; class ReverseResolver @@ -18,15 +18,15 @@ class ReverseResolver protected $_moduleList; /** - * @var ModuleDir + * @var Dir */ protected $_moduleDirs; /** * @param ModuleListInterface $moduleList - * @param ModuleDir $moduleDirs + * @param Dir $moduleDirs */ - public function __construct(ModuleListInterface $moduleList, ModuleDir $moduleDirs) + public function __construct(ModuleListInterface $moduleList, Dir $moduleDirs) { $this->_moduleList = $moduleList; $this->_moduleDirs = $moduleDirs; diff --git a/lib/internal/Magento/Framework/Module/ModuleList/Loader.php b/lib/internal/Magento/Framework/Module/ModuleList/Loader.php index 0321cc772fc3c683a9b723b10e1c187c5d5456a6..107a6473ba1841db9dbdb421771266f2d4f8c81c 100644 --- a/lib/internal/Magento/Framework/Module/ModuleList/Loader.php +++ b/lib/internal/Magento/Framework/Module/ModuleList/Loader.php @@ -6,11 +6,10 @@ namespace Magento\Framework\Module\ModuleList; -use Magento\Framework\App\Filesystem\DirectoryList; -use Magento\Framework\Filesystem; use Magento\Framework\Module\Declaration\Converter\Dom; use Magento\Framework\Xml\Parser; -use Magento\Framework\Module\ModuleRegistryInterface; +use Magento\Framework\Component\ComponentRegistrarInterface; +use Magento\Framework\Component\ComponentRegistrar; use Magento\Framework\Filesystem\DriverInterface; /** @@ -20,13 +19,6 @@ use Magento\Framework\Filesystem\DriverInterface; */ class Loader { - /** - * Application filesystem - * - * @var Filesystem - */ - private $filesystem; - /** * Converter of XML-files to associative arrays (specific to module.xml file format) * @@ -44,7 +36,7 @@ class Loader /** * Module registry * - * @var ModuleRegistryInterface + * @var ComponentRegistrarInterface */ private $moduleRegistry; @@ -58,20 +50,17 @@ class Loader /** * Constructor * - * @param Filesystem $filesystem * @param Dom $converter * @param Parser $parser - * @param ModuleRegistryInterface $moduleRegistry + * @param ComponentRegistrarInterface $moduleRegistry * @param DriverInterface $filesystemDriver */ public function __construct( - Filesystem $filesystem, Dom $converter, Parser $parser, - ModuleRegistryInterface $moduleRegistry, + ComponentRegistrarInterface $moduleRegistry, DriverInterface $filesystemDriver ) { - $this->filesystem = $filesystem; $this->converter = $converter; $this->parser = $parser; $this->parser->initErrorHandler(); @@ -125,13 +114,9 @@ class Loader */ private function getModuleConfigs() { - $modulesDir = $this->filesystem->getDirectoryRead(DirectoryList::MODULES); - foreach ($modulesDir->search('*/*/etc/module.xml') as $filePath) { - yield [$filePath, $modulesDir->readFile($filePath)]; - } - - foreach ($this->moduleRegistry->getModulePaths() as $modulePath) { - $filePath = str_replace(['\\', '/'], DIRECTORY_SEPARATOR, "$modulePath/etc/module.xml"); + $modulePaths = $this->moduleRegistry->getPaths(ComponentRegistrar::MODULE); + foreach ($modulePaths as $modulePath) { + $filePath = str_replace(['\\', '/'], DIRECTORY_SEPARATOR, "$modulePath/etc/module.xml"); yield [$filePath, $this->filesystemDriver->fileGetContents($filePath)]; } } @@ -145,6 +130,7 @@ class Loader */ private function sortBySequence($origList) { + ksort($origList); $expanded = []; foreach ($origList as $moduleName => $value) { $expanded[] = [ diff --git a/lib/internal/Magento/Framework/Module/ModuleRegistryInterface.php b/lib/internal/Magento/Framework/Module/ModuleRegistryInterface.php deleted file mode 100644 index 331bd80cab338d7c90b71cab0ecdf337df05d0f6..0000000000000000000000000000000000000000 --- a/lib/internal/Magento/Framework/Module/ModuleRegistryInterface.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Framework\Module; - -/** - * @author Josh Di Fabio <joshdifabio@gmail.com> - */ -interface ModuleRegistryInterface -{ - /** - * Get list of registered Magento module paths - * - * Returns an array where key is fully-qualified module name and value is absolute path to module - * - * @return array - */ - public function getModulePaths(); - - /** - * Get path of a module if it is already registered - * - * @param string $moduleName - * @return null|string - */ - public function getModulePath($moduleName); -} diff --git a/lib/internal/Magento/Framework/Module/PackageInfo.php b/lib/internal/Magento/Framework/Module/PackageInfo.php index 22f6d5f9ddddb9ede72aef28d68ad3bdc35b42d2..97fd828c36d6c3f0540ff8d37808fa172c5f5213 100644 --- a/lib/internal/Magento/Framework/Module/PackageInfo.php +++ b/lib/internal/Magento/Framework/Module/PackageInfo.php @@ -5,7 +5,7 @@ */ namespace Magento\Framework\Module; -use Magento\Framework\Stdlib\StringUtils; +use Magento\Framework\Component\ComponentRegistrar; /** * Provide information of dependencies and conflicts in composer.json files, mapping of package name to module name, @@ -41,13 +41,6 @@ class PackageInfo */ private $conflictMap; - /** - * All modules loader - * - * @var ModuleList\Loader - */ - private $loader; - /** * Reader of composer.json files * @@ -56,24 +49,20 @@ class PackageInfo private $reader; /** - * StringUtils utilities - * - * @var String + * @var ComponentRegistrar */ - private $string; + private $componentRegistrar; /** * Constructor * - * @param ModuleList\Loader $loader * @param Dir\Reader $reader - * @param \Magento\Framework\Stdlib\StringUtils $string + * @param ComponentRegistrar $componentRegistrar */ - public function __construct(ModuleList\Loader $loader, Dir\Reader $reader, StringUtils $string) + public function __construct(Dir\Reader $reader, ComponentRegistrar $componentRegistrar) { - $this->loader = $loader; $this->reader = $reader; - $this->string = $string; + $this->componentRegistrar = $componentRegistrar; } /** @@ -85,8 +74,8 @@ class PackageInfo { if ($this->packageModuleMap === null) { $jsonData = $this->reader->getComposerJsonFiles()->toArray(); - foreach (array_keys($this->loader->load()) as $moduleName) { - $key = $this->string->upperCaseWords($moduleName, '_', '/') . '/composer.json'; + foreach ($this->componentRegistrar->getPaths(ComponentRegistrar::MODULE) as $moduleName => $moduleDir) { + $key = $moduleDir . '/composer.json'; if (isset($jsonData[$key]) && $jsonData[$key]) { $packageData = \Zend_Json::decode($jsonData[$key]); if (isset($packageData['name'])) { diff --git a/lib/internal/Magento/Framework/Module/Registrar.php b/lib/internal/Magento/Framework/Module/Registrar.php deleted file mode 100644 index d5144de92a6c0f1404ace0187044098f9000b55e..0000000000000000000000000000000000000000 --- a/lib/internal/Magento/Framework/Module/Registrar.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Framework\Module; - -/** - * Provides ability to statically register modules which do not reside in the modules directory. Not all modules - * will be registered by default. - * - * @author Josh Di Fabio <joshdifabio@gmail.com> - */ -class Registrar implements ModuleRegistryInterface -{ - /** - * Paths to modules - * - * @var string[] - */ - private static $modulePaths = []; - - /** - * Sets the location of a module. Necessary for modules which do not reside in modules directory - * - * @param string $moduleName Fully-qualified module name - * @param string $path Absolute file path to the module - * @return void - */ - public static function registerModule($moduleName, $path) - { - self::$modulePaths[$moduleName] = $path; - } - - /** - * {@inheritdoc} - */ - public function getModulePaths() - { - return self::$modulePaths; - } - - /** - * {@inheritdoc} - */ - public function getModulePath($moduleName) - { - return isset(self::$modulePaths[$moduleName]) ? self::$modulePaths[$moduleName] : null; - } -} diff --git a/lib/internal/Magento/Framework/Module/Test/Unit/Declaration/Converter/_files/valid_module.xml b/lib/internal/Magento/Framework/Module/Test/Unit/Declaration/Converter/_files/valid_module.xml index da1d5ff6e2a192ff36d4a6de59be44c4dce299a8..7164260021956d18e4ee042530501f347b904f7b 100644 --- a/lib/internal/Magento/Framework/Module/Test/Unit/Declaration/Converter/_files/valid_module.xml +++ b/lib/internal/Magento/Framework/Module/Test/Unit/Declaration/Converter/_files/valid_module.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <!-- commented text --> <module name="Module_One" setup_version="1.0.0.0"> </module> diff --git a/lib/internal/Magento/Framework/Module/Test/Unit/Dir/ReaderTest.php b/lib/internal/Magento/Framework/Module/Test/Unit/Dir/ReaderTest.php index 78f9b1f038981cfb4ede8d08bed975881e96b465..6fe2ec66d6c377f4e5f11cefc1ec7dc446b970cd 100644 --- a/lib/internal/Magento/Framework/Module/Test/Unit/Dir/ReaderTest.php +++ b/lib/internal/Magento/Framework/Module/Test/Unit/Dir/ReaderTest.php @@ -11,8 +11,8 @@ namespace Magento\Framework\Module\Test\Unit\Dir; use Magento\Framework\Config\FileIteratorFactory; -use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\Filesystem; +use Magento\Framework\Module\Dir; class ReaderTest extends \PHPUnit_Framework_TestCase { @@ -49,7 +49,7 @@ class ReaderTest extends \PHPUnit_Framework_TestCase /** * @var \PHPUnit_Framework_MockObject_MockObject */ - protected $_filesystemMock; + protected $directoryReadFactoryMock; protected function setUp() { @@ -71,8 +71,8 @@ class ReaderTest extends \PHPUnit_Framework_TestCase false ); $this->_moduleListMock = $this->getMock('Magento\Framework\Module\ModuleListInterface'); - $this->_filesystemMock = $this->getMock( - '\Magento\Framework\Filesystem', + $this->directoryReadFactoryMock = $this->getMock( + '\Magento\Framework\Filesystem\Directory\ReadFactory', [], [], '', @@ -91,8 +91,8 @@ class ReaderTest extends \PHPUnit_Framework_TestCase $this->_model = new \Magento\Framework\Module\Dir\Reader( $this->_dirsMock, $this->_moduleListMock, - $this->_filesystemMock, - $this->_fileIteratorFactory + $this->_fileIteratorFactory, + $this->directoryReadFactoryMock ); } @@ -108,7 +108,10 @@ class ReaderTest extends \PHPUnit_Framework_TestCase )->will( $this->returnValue('app/code/Test/Module/etc') ); - $this->assertEquals('app/code/Test/Module/etc', $this->_model->getModuleDir('etc', 'Test_Module')); + $this->assertEquals( + 'app/code/Test/Module/etc', + $this->_model->getModuleDir(Dir::MODULE_ETC_DIR, 'Test_Module') + ); } public function testGetModuleDirWhenCustomDirIsSet() @@ -116,7 +119,7 @@ class ReaderTest extends \PHPUnit_Framework_TestCase $moduleDir = 'app/code/Test/Module/etc/custom'; $this->_dirsMock->expects($this->never())->method('getDir'); $this->_model->setModuleDir('Test_Module', 'etc', $moduleDir); - $this->assertEquals($moduleDir, $this->_model->getModuleDir('etc', 'Test_Module')); + $this->assertEquals($moduleDir, $this->_model->getModuleDir(Dir::MODULE_ETC_DIR, 'Test_Module')); } public function testGetConfigurationFiles() @@ -127,15 +130,18 @@ class ReaderTest extends \PHPUnit_Framework_TestCase $modulesDirectoryMock->expects($this->any())->method('isExist') ->with($configPath) ->will($this->returnValue(true)); - $this->_filesystemMock->expects($this->any())->method('getDirectoryRead')->with(DirectoryList::MODULES) + $this->directoryReadFactoryMock->expects($this->any()) + ->method('create') ->will($this->returnValue($modulesDirectoryMock)); $this->_moduleListMock->expects($this->once())->method('getNames')->will($this->returnValue(['Test_Module'])); $model = new \Magento\Framework\Module\Dir\Reader( $this->_dirsMock, $this->_moduleListMock, - $this->_filesystemMock, - new FileIteratorFactory() + new FileIteratorFactory( + new \Magento\Framework\Filesystem\File\ReadFactory(new \Magento\Framework\Filesystem\DriverPool()) + ), + $this->directoryReadFactoryMock ); $model->setModuleDir('Test_Module', 'etc', 'app/code/Test/Module/etc'); @@ -150,15 +156,18 @@ class ReaderTest extends \PHPUnit_Framework_TestCase $modulesDirectoryMock->expects($this->any())->method('isExist') ->with($configPath) ->will($this->returnValue(true)); - $this->_filesystemMock->expects($this->any())->method('getDirectoryRead')->with(DirectoryList::MODULES) + $this->directoryReadFactoryMock->expects($this->any()) + ->method('create') ->will($this->returnValue($modulesDirectoryMock)); $this->_moduleListMock->expects($this->once())->method('getNames')->will($this->returnValue(['Test_Module'])); $model = new \Magento\Framework\Module\Dir\Reader( $this->_dirsMock, $this->_moduleListMock, - $this->_filesystemMock, - new FileIteratorFactory() + new FileIteratorFactory( + new \Magento\Framework\Filesystem\File\ReadFactory(new \Magento\Framework\Filesystem\DriverPool()) + ), + $this->directoryReadFactoryMock ); $model->setModuleDir('Test_Module', '', 'app/code/Test/Module'); diff --git a/lib/internal/Magento/Framework/Module/Test/Unit/DirTest.php b/lib/internal/Magento/Framework/Module/Test/Unit/DirTest.php index bacb2890c36e8a032fd3f0b8f83c0c0791ff140c..cd92bece84e3294b71af60570b2ea983faf57b15 100644 --- a/lib/internal/Magento/Framework/Module/Test/Unit/DirTest.php +++ b/lib/internal/Magento/Framework/Module/Test/Unit/DirTest.php @@ -5,6 +5,8 @@ */ namespace Magento\Framework\Module\Test\Unit; +use Magento\Framework\Component\ComponentRegistrar; + class DirTest extends \PHPUnit_Framework_TestCase { /** @@ -13,39 +15,14 @@ class DirTest extends \PHPUnit_Framework_TestCase protected $_model; /** - * @var \Magento\Framework\Filesystem|\PHPUnit_Framework_MockObject_MockObject - */ - protected $filesystemMock; - - /** - * @var \Magento\Framework\Stdlib\StringUtils|\PHPUnit_Framework_MockObject_MockObject - */ - protected $_stringMock; - - /** - * @var \Magento\Framework\Filesystem\Directory\ReadInterface|\PHPUnit_Framework_MockObject_MockObject - */ - protected $directoryMock; - - /** - * @var \Magento\Framework\Module\ModuleRegistryInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\Component\ComponentRegistrarInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $moduleRegistryMock; protected function setUp() { - $this->filesystemMock = $this->getMock('Magento\Framework\Filesystem', [], [], '', false, false); - $this->directoryMock = $this->getMock( - 'Magento\Framework\Filesystem\Directory\Read', - [], - [], - '', - false, - false - ); - $this->_stringMock = $this->getMock('Magento\Framework\Stdlib\StringUtils', [], [], '', false, false); $this->moduleRegistryMock = $this->getMock( - 'Magento\Framework\Module\ModuleRegistryInterface', + 'Magento\Framework\Component\ComponentRegistrarInterface', [], [], '', @@ -53,76 +30,25 @@ class DirTest extends \PHPUnit_Framework_TestCase false ); - $this->filesystemMock->expects( - $this->once() - )->method( - 'getDirectoryRead' - )->will( - $this->returnValue($this->directoryMock) - ); - - $this->_model = new \Magento\Framework\Module\Dir( - $this->filesystemMock, - $this->_stringMock, - $this->moduleRegistryMock - ); + $this->_model = new \Magento\Framework\Module\Dir($this->moduleRegistryMock); } public function testGetDirModuleRoot() { - $this->moduleRegistryMock->expects( - $this->once() - )->method( - 'getModulePath' - )->with( - 'Test_Module' - )->will( - $this->returnValue(null) - ); - - $this->_stringMock->expects($this->once())->method('upperCaseWords')->will($this->returnValue('Test/Module')); - - $this->directoryMock->expects( - $this->once() - )->method( - 'getAbsolutePath' - )->with( - 'Test/Module' - )->will( - $this->returnValue('/Test/Module') - ); + $this->moduleRegistryMock->expects($this->once()) + ->method('getPath') + ->with(ComponentRegistrar::MODULE, 'Test_Module') + ->will($this->returnValue('/Test/Module')); $this->assertEquals('/Test/Module', $this->_model->getDir('Test_Module')); } - public function testGetDirModuleRootFromResolver() - { - $this->moduleRegistryMock->expects( - $this->once() - )->method( - 'getModulePath' - )->with( - 'Test_Module2' - )->will( - $this->returnValue('/path/to/module') - ); - - $this->assertEquals('/path/to/module', $this->_model->getDir('Test_Module2')); - } - public function testGetDirModuleSubDir() { - $this->_stringMock->expects($this->once())->method('upperCaseWords')->will($this->returnValue('Test/Module')); - - $this->directoryMock->expects( - $this->once() - )->method( - 'getAbsolutePath' - )->with( - 'Test/Module' - )->will( - $this->returnValue('/Test/Module') - ); + $this->moduleRegistryMock->expects($this->once()) + ->method('getPath') + ->with(ComponentRegistrar::MODULE, 'Test_Module') + ->will($this->returnValue('/Test/Module')); $this->assertEquals('/Test/Module/etc', $this->_model->getDir('Test_Module', 'etc')); } @@ -133,7 +59,10 @@ class DirTest extends \PHPUnit_Framework_TestCase */ public function testGetDirModuleSubDirUnknown() { - $this->_stringMock->expects($this->once())->method('upperCaseWords')->will($this->returnValue('Test/Module')); + $this->moduleRegistryMock->expects($this->once()) + ->method('getPath') + ->with(ComponentRegistrar::MODULE, 'Test_Module') + ->will($this->returnValue('/Test/Module')); $this->_model->getDir('Test_Module', 'unknown'); } diff --git a/lib/internal/Magento/Framework/Module/Test/Unit/ModuleList/LoaderTest.php b/lib/internal/Magento/Framework/Module/Test/Unit/ModuleList/LoaderTest.php index 6705d04d35c3a67df6554c805cdd69bd063a209d..7798d4a1a3bd5ab41a1c55ea5909046f09809108 100644 --- a/lib/internal/Magento/Framework/Module/Test/Unit/ModuleList/LoaderTest.php +++ b/lib/internal/Magento/Framework/Module/Test/Unit/ModuleList/LoaderTest.php @@ -8,9 +8,6 @@ namespace Magento\Framework\Module\Test\Unit\ModuleList; use \Magento\Framework\Module\ModuleList\Loader; -use Magento\Framework\App\Filesystem\DirectoryList; -use Magento\Framework\Xml\Parser; - class LoaderTest extends \PHPUnit_Framework_TestCase { /** @@ -20,16 +17,6 @@ class LoaderTest extends \PHPUnit_Framework_TestCase */ private static $sampleXml = '<?xml version="1.0"?><test></test>'; - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - private $filesystem; - - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - private $dir; - /** * @var \PHPUnit_Framework_MockObject_MockObject */ @@ -55,25 +42,38 @@ class LoaderTest extends \PHPUnit_Framework_TestCase */ private $loader; + /** + * @var array + */ + private $loadFixture; + protected function setUp() { - $this->filesystem = $this->getMock('Magento\Framework\Filesystem', [], [], '', false); - $this->dir = $this->getMockForAbstractClass('Magento\Framework\Filesystem\Directory\ReadInterface'); - $this->filesystem->expects($this->once()) - ->method('getDirectoryRead') - ->with(DirectoryList::MODULES) - ->willReturn($this->dir); $this->converter = $this->getMock('Magento\Framework\Module\Declaration\Converter\Dom', [], [], '', false); $this->parser = $this->getMock('Magento\Framework\Xml\Parser', [], [], '', false); $this->parser->expects($this->once())->method('initErrorHandler'); - $this->registry = $this->getMock('Magento\Framework\Module\ModuleRegistryInterface', [], [], '', false, false); + $this->registry = $this->getMock( + 'Magento\Framework\Component\ComponentRegistrarInterface', + [], + [], + '', + false, + false + ); $this->driver = $this->getMock('Magento\Framework\Filesystem\DriverInterface', [], [], '', false, false); - $this->loader = new Loader($this->filesystem, $this->converter, $this->parser, $this->registry, $this->driver); + $this->loader = new Loader($this->converter, $this->parser, $this->registry, $this->driver); } - public function testLoad() + /** + * @param $paths + * @dataProvider testLoadDataProvider + */ + public function testLoad($paths) { - $fixtures = [ + $this->registry->expects($this->once()) + ->method('getPaths') + ->willReturn($paths); + $this->loadFixture = [ 'a' => ['name' => 'a', 'sequence' => []], // a is on its own 'b' => ['name' => 'b', 'sequence' => ['d']], // b is after d 'c' => ['name' => 'c', 'sequence' => ['e']], // c is after e @@ -81,19 +81,15 @@ class LoaderTest extends \PHPUnit_Framework_TestCase 'e' => ['name' => 'e', 'sequence' => ['a']], // e is after a // so expected sequence is a -> e -> c -> d -> b ]; - $this->dir->expects($this->once())->method('search')->willReturn(['a', 'b', 'c']); - $this->registry->expects($this->once())->method('getModulePaths')->willReturn(['/path/to/d', '/path/to/e']); - $this->dir->expects($this->exactly(3))->method('readFile')->will($this->returnValueMap([ - ['a', null, null, self::$sampleXml], - ['b', null, null, self::$sampleXml], - ['c', null, null, self::$sampleXml], - ])); - $this->driver->expects($this->exactly(2))->method('fileGetContents')->will($this->returnValueMap([ + $this->driver->expects($this->exactly(5))->method('fileGetContents')->will($this->returnValueMap([ + ['/path/to/a/etc/module.xml', null, null, self::$sampleXml], + ['/path/to/b/etc/module.xml', null, null, self::$sampleXml], + ['/path/to/c/etc/module.xml', null, null, self::$sampleXml], ['/path/to/d/etc/module.xml', null, null, self::$sampleXml], ['/path/to/e/etc/module.xml', null, null, self::$sampleXml], ])); $index = 0; - foreach ($fixtures as $name => $fixture) { + foreach ($this->loadFixture as $name => $fixture) { $this->converter->expects($this->at($index++))->method('convert')->willReturn([$name => $fixture]); } $this->parser->expects($this->atLeastOnce())->method('loadXML') @@ -101,11 +97,28 @@ class LoaderTest extends \PHPUnit_Framework_TestCase $this->parser->expects($this->atLeastOnce())->method('getDom'); $result = $this->loader->load(); $this->assertSame(['a', 'e', 'c', 'd', 'b'], array_keys($result)); - foreach ($fixtures as $name => $fixture) { + foreach ($this->loadFixture as $name => $fixture) { $this->assertSame($fixture, $result[$name]); } } + /** + * @return array + */ + public function testLoadDataProvider() + { + return [ + 'Ordered modules list returned by registrar' => + [[ + '/path/to/a', '/path/to/b', '/path/to/c', '/path/to/d', '/path/to/e' + ]], + 'UnOrdered modules list returned by registrar' => + [[ + '/path/to/b', '/path/to/a', '/path/to/c', '/path/to/e', '/path/to/d' + ]], + ]; + } + public function testLoadExclude() { $fixture = [ @@ -115,16 +128,15 @@ class LoaderTest extends \PHPUnit_Framework_TestCase 'd' => ['name' => 'd', 'sequence' => ['a']], // d is after a // exclude d, so expected sequence is a -> c -> b ]; - $this->dir->expects($this->once())->method('search')->willReturn(['a', 'b', 'c', 'd']); - $this->dir->expects($this->exactly(4))->method('readFile')->will($this->returnValueMap([ - ['a', null, null, self::$sampleXml], - ['b', null, null, self::$sampleXml], - ['c', null, null, self::$sampleXml], - ['d', null, null, self::$sampleXml], - ])); $this->registry->expects($this->once()) - ->method('getModulePaths') - ->willReturn([]); + ->method('getPaths') + ->willReturn(['/path/to/a', '/path/to/b', '/path/to/c', '/path/to/d']); + $this->driver->expects($this->exactly(4))->method('fileGetContents')->will($this->returnValueMap([ + ['/path/to/a/etc/module.xml', null, null, self::$sampleXml], + ['/path/to/b/etc/module.xml', null, null, self::$sampleXml], + ['/path/to/c/etc/module.xml', null, null, self::$sampleXml], + ['/path/to/d/etc/module.xml', null, null, self::$sampleXml], + ])); $this->converter->expects($this->at(0))->method('convert')->willReturn(['a' => $fixture['a']]); $this->converter->expects($this->at(1))->method('convert')->willReturn(['b' => $fixture['b']]); $this->converter->expects($this->at(2))->method('convert')->willReturn(['c' => $fixture['c']]); @@ -148,14 +160,13 @@ class LoaderTest extends \PHPUnit_Framework_TestCase 'a' => ['name' => 'a', 'sequence' => ['b']], 'b' => ['name' => 'b', 'sequence' => ['a']], ]; - $this->dir->expects($this->once())->method('search')->willReturn(['a', 'b']); - $this->dir->expects($this->exactly(2))->method('readFile')->will($this->returnValueMap([ - ['a', null, null, self::$sampleXml], - ['b', null, null, self::$sampleXml], - ])); $this->converter->expects($this->at(0))->method('convert')->willReturn(['a' => $fixture['a']]); $this->converter->expects($this->at(1))->method('convert')->willReturn(['b' => $fixture['b']]); - $this->registry->expects($this->once())->method('getModulePaths')->willReturn([]); + $this->registry->expects($this->once())->method('getPaths')->willReturn(['/path/to/a', '/path/to/b']); + $this->driver->expects($this->exactly(2))->method('fileGetContents')->will($this->returnValueMap([ + ['/path/to/a/etc/module.xml', null, null, self::$sampleXml], + ['/path/to/b/etc/module.xml', null, null, self::$sampleXml], + ])); $this->loader->load(); } } diff --git a/lib/internal/Magento/Framework/Module/Test/Unit/PackageInfoTest.php b/lib/internal/Magento/Framework/Module/Test/Unit/PackageInfoTest.php index 230ab9c0a82303fc34e31d6cf43b38152960ac80..8a2512c485fd1f1d98cb02ab45019ebd9f3e4c43 100644 --- a/lib/internal/Magento/Framework/Module/Test/Unit/PackageInfoTest.php +++ b/lib/internal/Magento/Framework/Module/Test/Unit/PackageInfoTest.php @@ -10,9 +10,9 @@ use \Magento\Framework\Module\PackageInfo; class PackageInfoTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Framework\Module\ModuleList\Loader|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\Component\ComponentRegistrar|\PHPUnit_Framework_MockObject_MockObject */ - private $loader; + private $componentRegistrar; /** * @var \Magento\Framework\Module\Dir\Reader|\PHPUnit_Framework_MockObject_MockObject @@ -26,11 +26,11 @@ class PackageInfoTest extends \PHPUnit_Framework_TestCase public function setUp() { - $this->loader = $this->getMock('Magento\Framework\Module\ModuleList\Loader', [], [], '', false); + $this->componentRegistrar = $this->getMock('Magento\Framework\Component\ComponentRegistrar', [], [], '', false); $this->reader = $this->getMock('Magento\Framework\Module\Dir\Reader', [], [], '', false); - $this->loader->expects($this->once()) - ->method('load') - ->will($this->returnValue(['A' => [], 'B' => [], 'C' => [], 'D' => [], 'E' => []])); + $this->componentRegistrar->expects($this->once()) + ->method('getPaths') + ->will($this->returnValue(['A' => 'A', 'B' => 'B', 'C' => 'C', 'D' => 'D', 'E' => 'E'])); $composerData = [ 'A/composer.json' => '{"name":"a", "require":{"b":"0.1"}, "conflict":{"c":"0.1"}, "version":"0.1"}', @@ -47,7 +47,7 @@ class PackageInfoTest extends \PHPUnit_Framework_TestCase ->method('getComposerJsonFiles') ->will($this->returnValue($fileIteratorMock)); - $this->packageInfo = new PackageInfo($this->loader, $this->reader, new \Magento\Framework\Stdlib\StringUtils()); + $this->packageInfo = new PackageInfo($this->reader, $this->componentRegistrar); } public function testGetModuleName() diff --git a/lib/internal/Magento/Framework/Module/etc/module.xsd b/lib/internal/Magento/Framework/Module/etc/module.xsd index 519c6e3508a3a769f7484c57353e907701eadc42..250ad1da5dfda16db93520f5e7e226b0add9a37b 100644 --- a/lib/internal/Magento/Framework/Module/etc/module.xsd +++ b/lib/internal/Magento/Framework/Module/etc/module.xsd @@ -43,7 +43,7 @@ </xs:element> </xs:all> <xs:attribute name="name" type="moduleName" use="required" /> - <xs:attribute name="setup_version" type="setupVersion" use="optional" /> + <xs:attribute name="setup_version" type="setupVersion" use="required" /> </xs:complexType> <xs:complexType name="moduleSequence"> diff --git a/lib/internal/Magento/Framework/Mview/Config/SchemaLocator.php b/lib/internal/Magento/Framework/Mview/Config/SchemaLocator.php index 4f0f6da4b9187f1ce4d5de36a11d55fdfe40d796..9f1b482a551a3f463ef1c8dc09337862b9318787 100644 --- a/lib/internal/Magento/Framework/Mview/Config/SchemaLocator.php +++ b/lib/internal/Magento/Framework/Mview/Config/SchemaLocator.php @@ -24,14 +24,12 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface protected $_perFileSchema = null; /** - * @param \Magento\Framework\Filesystem\DirectoryList $directoryList + * @param \Magento\Framework\Config\Dom\UrnResolver $urnResolver */ - public function __construct(\Magento\Framework\Filesystem\DirectoryList $directoryList) + public function __construct(\Magento\Framework\Config\Dom\UrnResolver $urnResolver) { - $etcDir = $directoryList->getPath(DirectoryList::LIB_INTERNAL) - . '/Magento/Framework/Mview/etc'; - $this->_schema = $etcDir . '/mview.xsd'; - $this->_perFileSchema = $etcDir . '/mview.xsd'; + $this->_schema = $urnResolver->getRealPath('urn:magento:framework:Mview/etc/mview.xsd'); + $this->_perFileSchema = $this->_schema; } /** diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/Config/ReaderTest.php b/lib/internal/Magento/Framework/Mview/Test/Unit/Config/ReaderTest.php index 22b4709bce75f7ea57343017bef90d40fcbcfd6d..ced986821731c37c8b976d6a7d52b996e56f29a7 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/Config/ReaderTest.php +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/Config/ReaderTest.php @@ -36,17 +36,12 @@ class ReaderTest extends \PHPUnit_Framework_TestCase $this->_converter = $this->getMock('Magento\Framework\Mview\Config\Converter', ['convert']); - $fsDirList = $this->getMock('Magento\Framework\Filesystem\DirectoryList', ['getPath'], [], '', false); - $fsDirList->expects( - $this->once() - )->method( - 'getPath' - )->with( - DirectoryList::LIB_INTERNAL - )->will( - $this->returnValue('stub') - ); - $schemaLocator = new \Magento\Framework\Mview\Config\SchemaLocator($fsDirList); + $urnResolverMock = $this->getMock('Magento\Framework\Config\Dom\UrnResolver', [], [], '', false); + $urnResolverMock->expects($this->once()) + ->method('getRealPath') + ->with('urn:magento:framework:Mview/etc/mview.xsd') + ->willReturn('test_folder'); + $schemaLocator = new \Magento\Framework\Mview\Config\SchemaLocator($urnResolverMock); $validationState = $this->getMock('Magento\Framework\Config\ValidationStateInterface'); $validationState->expects($this->once())->method('isValidated')->will($this->returnValue(false)); diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/XsdTest.php b/lib/internal/Magento/Framework/Mview/Test/Unit/XsdTest.php index 263a838e88ec558ea237929e3405ab3f0506d23e..7ed511488c9a938745af20d99c909160ea74b2ae 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/XsdTest.php +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/XsdTest.php @@ -14,13 +14,14 @@ class XsdTest extends \PHPUnit_Framework_TestCase protected $_xsdSchema; /** - * @var \Magento\TestFramework\Utility\XsdValidator + * @var \Magento\Framework\TestFramework\Unit\Utility\XsdValidator */ protected $_xsdValidator; protected function setUp() { - $this->_xsdSchema = BP . '/lib/internal/Magento/Framework/Mview/etc/mview.xsd'; + $urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + $this->_xsdSchema = $urnResolver->getRealPath('urn:magento:framework:Mview/etc/mview.xsd'); $this->_xsdValidator = new \Magento\Framework\TestFramework\Unit\Utility\XsdValidator(); } diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/_files/invalidMviewXmlArray.php b/lib/internal/Magento/Framework/Mview/Test/Unit/_files/invalidMviewXmlArray.php index 970e2dc0bdb35b839b63247274a36dca9ef5c59f..7f38a5fcac1fa8fdd97529d602d30bf7d7133670 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/_files/invalidMviewXmlArray.php +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/_files/invalidMviewXmlArray.php @@ -6,41 +6,41 @@ return [ 'without_mview_handle' => [ '<?xml version="1.0"?><config></config>', - ["Element 'config': Missing child element(s). Expected is ( view )."], + ["Element 'config': Missing child element(s). Expected is ( view ).\nLine: 1\n"], ], 'mview_with_notallowed_attribute' => [ '<?xml version="1.0" encoding="UTF-8"?><config>' . '<view id="view_one" notallow="notallow" class="Ogogo\Class\One" group="some_view_group">' . '<subscriptions><table name="some_entity" entity_column="entity_id" /></subscriptions></view></config>', - ["Element 'view', attribute 'notallow': The attribute 'notallow' is not allowed."], + ["Element 'view', attribute 'notallow': The attribute 'notallow' is not allowed.\nLine: 1\n"], ], 'mview_without_class_attribute' => [ '<?xml version="1.0" encoding="UTF-8"?><config><view id="view_one" group="some_view_group"><subscriptions>' . '<table name="some_entity" entity_column="entity_id" /></subscriptions></view></config>', - ["Element 'view': The attribute 'class' is required but missing."], + ["Element 'view': The attribute 'class' is required but missing.\nLine: 1\n"], ], 'mview_without_group_attribute' => [ '<?xml version="1.0" encoding="UTF-8"?><config><view id="view_one" class="Ogogo\Class\One"><subscriptions>' . '<table name="some_entity" entity_column="entity_id" /></subscriptions></view></config>', - ["Element 'view': The attribute 'group' is required but missing."], + ["Element 'view': The attribute 'group' is required but missing.\nLine: 1\n"], ], 'mview_with_empty_subscriptions' => [ '<?xml version="1.0" encoding="UTF-8"?><config>' . '<view id="view_one" class="Ogogo\Class\One" group="some_view_group"><subscriptions>' . '</subscriptions></view></config>', - ["Element 'subscriptions': Missing child element(s). Expected is ( table )."], + ["Element 'subscriptions': Missing child element(s). Expected is ( table ).\nLine: 1\n"], ], 'subscriptions_without_table' => [ '<?xml version="1.0" encoding="UTF-8"?><config>' . '<view id="view_one" class="Ogogo\Class\One" group="some_view_group"><subscriptions>' . '</subscriptions></view></config>', - ["Element 'subscriptions': Missing child element(s). Expected is ( table )."], + ["Element 'subscriptions': Missing child element(s). Expected is ( table ).\nLine: 1\n"], ], 'table_without_column_attribute' => [ '<?xml version="1.0" encoding="UTF-8"?><config>' . '<view id="view_one" class="Ogogo\Class\One" group="some_view_group"><subscriptions>' . '<table name="some_entity" /></subscriptions></view></config>', - ["Element 'table': The attribute 'entity_column' is required but missing."], + ["Element 'table': The attribute 'entity_column' is required but missing.\nLine: 1\n"], ], 'subscriptions_duplicate_table' => [ '<?xml version="1.0" encoding="UTF-8"?><config>' . @@ -49,7 +49,7 @@ return [ '<table name="some_entity" entity_column="entity_id" /></subscriptions></view></config>', [ "Element 'table': Duplicate key-sequence ['some_entity', 'entity_id'] in unique identity-constraint " . - "'uniqueSubscriptionsTable'." + "'uniqueSubscriptionsTable'.\nLine: 1\n" ], ] ]; diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/_files/mview_merged_one.xml b/lib/internal/Magento/Framework/Mview/Test/Unit/_files/mview_merged_one.xml index c61c79119a563dd57b976cb24baee104824d6633..16ab05859eeb108c670e6b88926ab893c33fbb18 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/_files/mview_merged_one.xml +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/_files/mview_merged_one.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/Mview/etc/mview.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Mview/etc/mview.xsd"> <view id="view_one" class="Ogogo\Class\One" group="default"> <subscriptions> <table name="some_entity" entity_column="entity_id" /> @@ -24,4 +24,4 @@ <table name="some_product_relation" entity_column="product_id" /> </subscriptions> </view> -</config> \ No newline at end of file +</config> diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/_files/mview_merged_two.xml b/lib/internal/Magento/Framework/Mview/Test/Unit/_files/mview_merged_two.xml index 95865bc1fd2a0ddb04daed39a604a10e5788e1e6..60319ebc2e165ffa5ebdf4fe4013f2cd50b5d594 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/_files/mview_merged_two.xml +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/_files/mview_merged_two.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/Mview/etc/mview.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Mview/etc/mview.xsd"> <view id="view_one" class="Ogogo\Class\Two" group="default"> <subscriptions> <table name="some_entity" entity_column="entity_id" /> @@ -18,4 +18,4 @@ <table name="some_product_relation" entity_column="product_id" /> </subscriptions> </view> -</config> \ No newline at end of file +</config> diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/_files/mview_one.xml b/lib/internal/Magento/Framework/Mview/Test/Unit/_files/mview_one.xml index d1b561db93cd518a3cb3e6aba3843258665fda8a..c68a6f2e85b182670a9bb3c8f31f1b3cc371d71d 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/_files/mview_one.xml +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/_files/mview_one.xml @@ -5,11 +5,11 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/Mview/etc/mview.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Mview/etc/mview.xsd"> <view id="view_one" class="Ogogo\Class\One" group="default"> <subscriptions> <table name="some_entity" entity_column="entity_id" /> <table name="some_product_relation" entity_column="product_id" /> </subscriptions> </view> -</config> \ No newline at end of file +</config> diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/_files/mview_three.xml b/lib/internal/Magento/Framework/Mview/Test/Unit/_files/mview_three.xml index 0ff17bc9a0f423400b55f5f5f920326fa87673d3..beb367e40bf90545c5564b69a27e812a25b2e512 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/_files/mview_three.xml +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/_files/mview_three.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/Mview/etc/mview.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Mview/etc/mview.xsd"> <view id="view_one" class="Ogogo\Class\Two" group="default"> <subscriptions> <table name="some_product_relation" entity_column="entity_id" /> @@ -17,4 +17,4 @@ <table name="some_product_relation" entity_column="product_id" /> </subscriptions> </view> -</config> \ No newline at end of file +</config> diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/_files/mview_two.xml b/lib/internal/Magento/Framework/Mview/Test/Unit/_files/mview_two.xml index ce7995df8c56699c3e0eb568fcea291b00aa8276..fa5c0f9f7fb1fc6b3ab19670bc6372422abccbda 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/_files/mview_two.xml +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/_files/mview_two.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/Mview/etc/mview.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Mview/etc/mview.xsd"> <view id="view_two" class="Ogogo\Class\Two" group="default"> <subscriptions> <table name="some_entity" entity_column="entity_id" /> @@ -18,4 +18,4 @@ <table name="some_product_relation" entity_column="product_id" /> </subscriptions> </view> -</config> \ No newline at end of file +</config> diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/_files/valid_mview.xml b/lib/internal/Magento/Framework/Mview/Test/Unit/_files/valid_mview.xml index e9f51e2401533190ffd49973d5873ec8887f9b0a..4bf8c9c4a328abc07d63c6a45115300f4bbfc1b6 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/_files/valid_mview.xml +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/_files/valid_mview.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/Mview/etc/mview.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Mview/etc/mview.xsd"> <view id="view_one" class="Ogogo\Class\One" group="index"> <subscriptions> <table name="some_entity" entity_column="entity_id" /> @@ -18,4 +18,4 @@ <table name="some_product_relation_other" entity_column="product_id" /> </subscriptions> </view> -</config> \ No newline at end of file +</config> diff --git a/lib/internal/Magento/Framework/ObjectManager/Config/SchemaLocator.php b/lib/internal/Magento/Framework/ObjectManager/Config/SchemaLocator.php index c67f58aff5e625e555592e7673ccf656d94848f9..466d36bb7619c94edd0a40c3b2884d195a661315 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Config/SchemaLocator.php +++ b/lib/internal/Magento/Framework/ObjectManager/Config/SchemaLocator.php @@ -9,6 +9,14 @@ namespace Magento\Framework\ObjectManager\Config; class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface { + /** @var \Magento\Framework\Config\Dom\UrnResolver */ + protected $urnResolver; + + public function __construct() + { + $this->urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + } + /** * Get path to merged config schema * @@ -16,7 +24,7 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface */ public function getSchema() { - return realpath(__DIR__ . '/../etc/') . '/config.xsd'; + return $this->urnResolver->getRealPath('urn:magento:framework:ObjectManager/etc/config.xsd'); } /** diff --git a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Config/Mapper/_files/simple_di_config.xml b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Config/Mapper/_files/simple_di_config.xml index d930f3dadf451c56bcaea24e5dab4060faba8e01..a7bcdbfc045eddac5f2b8d022af8c787fbd3a44f 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Config/Mapper/_files/simple_di_config.xml +++ b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Config/Mapper/_files/simple_di_config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <!-- Comment within root node --> <preference for="Magento\Framework\Module\SomeInterface" type="Magento\Framework\Module\ClassOne" /> <preference for="Magento\Framework\App\RequestInterface" type="Magento\Framework\App\Request\Http\Proxy" /> diff --git a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Config/SchemaLocatorTest.php b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Config/SchemaLocatorTest.php new file mode 100644 index 0000000000000000000000000000000000000000..7771efa8cfef97db8aecb276d7a55e7aafecbd6d --- /dev/null +++ b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Config/SchemaLocatorTest.php @@ -0,0 +1,53 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Framework\ObjectManager\Test\Unit\Config; + +class SchemaLocatorTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Framework\App\Resource\Config\SchemaLocator + */ + protected $model; + + /** @var \Magento\Framework\Config\Dom\UrnResolver $urnResolverMock */ + protected $urnResolver; + + /** @var \Magento\Framework\Config\Dom\UrnResolver $urnResolverMock */ + protected $urnResolverMock; + + protected function setUp() + { + $this->urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + $this->urnResolverMock = $this->getMock('Magento\Framework\Config\Dom\UrnResolver', [], [], '', false); + $this->model = new \Magento\Framework\ObjectManager\Config\SchemaLocator($this->urnResolverMock); + $property = new \ReflectionProperty($this->model, 'urnResolver'); + $property->setAccessible(true); + $property->setValue($this->model, $this->urnResolverMock); + + } + + public function testGetSchema() + { + $this->urnResolverMock->expects($this->once()) + ->method('getRealPath') + ->with('urn:magento:framework:ObjectManager/etc/config.xsd') + ->willReturn( + $this->urnResolver->getRealPath('urn:magento:framework:ObjectManager/etc/config.xsd') + ); + $this->assertEquals( + $this->urnResolver->getRealPath('urn:magento:framework:ObjectManager/etc/config.xsd'), + $this->model->getSchema() + ); + } + + public function testGetPerFileSchema() + { + $this->assertEquals( + null, + $this->model->getPerFileSchema() + ); + } +} diff --git a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Config/XsdTest.php b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Config/XsdTest.php index 61f727b304d6e0977444379aae6862caada44597..7b1a54b28ce4ab112332ad36e82131ca069997aa 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Config/XsdTest.php +++ b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Config/XsdTest.php @@ -19,7 +19,7 @@ class XsdTest extends \PHPUnit_Framework_TestCase protected $_xsdSchema; /** - * @var \Magento\TestFramework\Utility\XsdValidator + * @var \Magento\Framework\TestFramework\Unit\Utility\XsdValidator */ protected $_xsdValidator; diff --git a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Config/_files/invalidConfigXmlArray.php b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Config/_files/invalidConfigXmlArray.php index b43e4aabe0bed5b340bbabd129a393fd4f32ed23..bd737ee6d711b5ae528eefa4184032b11dc5bccd 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Config/_files/invalidConfigXmlArray.php +++ b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Config/_files/invalidConfigXmlArray.php @@ -6,11 +6,11 @@ return [ 'preference_without_required_for_attribute' => [ '<?xml version="1.0"?><config><preference type="Some_Type_Name" /></config>', - ["Element 'preference': The attribute 'for' is required but missing."], + ["Element 'preference': The attribute 'for' is required but missing.\nLine: 1\n"], ], 'preference_without_required_type_attribute' => [ '<?xml version="1.0"?><config><preference for="Some_For_Name" /></config>', - ["Element 'preference': The attribute 'type' is required but missing."], + ["Element 'preference': The attribute 'type' is required but missing.\nLine: 1\n"], ], 'preferences_with_same_for_attribute_value' => [ '<?xml version="1.0"?> @@ -20,17 +20,17 @@ return [ </config>', [ "Element 'preference': Duplicate key-sequence ['Some_For_Name'] in unique " . - "identity-constraint 'uniquePreference'." + "identity-constraint 'uniquePreference'.\nLine: 4\n" ], ], 'preferences_with_forbidden_attribute' => [ '<?xml version="1.0"?> <config><preference for="Some_For_Name" type="Some_Type_Name" forbidden="text"/></config>', - ["Element 'preference', attribute 'forbidden': The attribute 'forbidden' is not allowed."], + ["Element 'preference', attribute 'forbidden': The attribute 'forbidden' is not allowed.\nLine: 2\n"], ], 'type_without_required_name_attribute' => [ '<?xml version="1.0"?><config><type /></config>', - ["Element 'type': The attribute 'name' is required but missing."], + ["Element 'type': The attribute 'name' is required but missing.\nLine: 1\n"], ], 'type_with_same_name_attribute_value' => [ '<?xml version="1.0"?> @@ -38,15 +38,21 @@ return [ <type name="Some_Type_name" /> <type name="Some_Type_name" /> </config>', - ["Element 'type': Duplicate key-sequence ['Some_Type_name'] in unique identity-constraint 'uniqueType'."], + [ + "Element 'type': Duplicate key-sequence ['Some_Type_name'] in unique identity-constraint" + . " 'uniqueType'.\nLine: 4\n" + ], ], 'type_with_forbidden_attribute' => [ '<?xml version="1.0"?><config><type name="Some_Name" forbidden="text"/></config>', - ["Element 'type', attribute 'forbidden': The attribute 'forbidden' is not allowed."], + ["Element 'type', attribute 'forbidden': The attribute 'forbidden' is not allowed.\nLine: 1\n"], ], 'type_shared_attribute_with_forbidden_value' => [ '<?xml version="1.0"?><config><type name="Some_Name" shared="forbidden"/></config>', - ["Element 'type', attribute 'shared': 'forbidden' is not a valid value of the atomic type 'xs:boolean'."], + [ + "Element 'type', attribute 'shared': 'forbidden' is not a valid value of the atomic type" + . " 'xs:boolean'.\nLine: 1\n" + ], ], 'type_object_with_forbidden_shared_value' => [ '<?xml version="1.0"?> @@ -58,7 +64,8 @@ return [ </type> </config>', [ - "Element 'argument', attribute 'shared': 'forbidden' is not a valid value of the atomic type 'xs:boolean'." + "Element 'argument', attribute 'shared': 'forbidden' is not a valid value of the atomic type" + . " 'xs:boolean'.\nLine: 5\n" ], ], 'type_instance_with_forbidden_attribute' => [ @@ -70,29 +77,32 @@ return [ </arguments> </type> </config>', - ["Element 'argument', attribute 'forbidden': The attribute 'forbidden' is not allowed."], + ["Element 'argument', attribute 'forbidden': The attribute 'forbidden' is not allowed.\nLine: 5\n"], ], 'type_plugin_without_required_name_attribute' => [ '<?xml version="1.0"?><config><type name="Some_Name"><plugin /></type></config>', - ["Element 'plugin': The attribute 'name' is required but missing."], + ["Element 'plugin': The attribute 'name' is required but missing.\nLine: 1\n"], ], 'type_plugin_with_forbidden_attribute' => [ '<?xml version="1.0"?> <config><type name="Some_Name"><plugin name="some_name" forbidden="text" /></type></config>', - ["Element 'plugin', attribute 'forbidden': The attribute 'forbidden' is not allowed."], + ["Element 'plugin', attribute 'forbidden': The attribute 'forbidden' is not allowed.\nLine: 2\n"], ], 'type_plugin_disabled_attribute_invalid_value' => [ '<?xml version="1.0"?> <config><type name="Some_Name"><plugin name="some_name" disabled="string" /></type></config>', [ "Element 'plugin', attribute 'disabled': 'string' is not a valid value of the atomic " . - "type 'xs:boolean'." + "type 'xs:boolean'.\nLine: 2\n" ], ], 'type_plugin_sortorder_attribute_invalid_value' => [ '<?xml version="1.0"?> <config><type name="Some_Name"><plugin name="some_name" sortOrder="string" /></type></config>', - ["Element 'plugin', attribute 'sortOrder': 'string' is not a valid value of the atomic type 'xs:int'."], + [ + "Element 'plugin', attribute 'sortOrder': 'string' is not a valid value of the atomic type" + . " 'xs:int'.\nLine: 2\n" + ], ], 'type_with_same_argument_name_attribute' => [ '<?xml version="1.0"?> @@ -106,29 +116,29 @@ return [ </config>', [ "Element 'argument': Duplicate key-sequence ['same_argument_name'] in key identity-constraint " . - "'argumentName'." + "'argumentName'.\nLine: 6\n" ], ], 'virtualtype_without_required_name_attribute' => [ '<?xml version="1.0"?><config><virtualType /></config>', - ["Element 'virtualType': The attribute 'name' is required but missing."], + ["Element 'virtualType': The attribute 'name' is required but missing.\nLine: 1\n"], ], 'virtualtype_with_forbidden_shared_attribute_value' => [ '<?xml version="1.0"?><config><virtualType name="virtual_name" shared="forbidden"/></config>', [ "Element 'virtualType', attribute 'shared': 'forbidden' is not a valid value of the atomic " . - "type 'xs:boolean'." + "type 'xs:boolean'.\nLine: 1\n" ], ], 'virtualtype_with_forbidden_attribute' => [ '<?xml version="1.0"?><config><virtualType name="virtual_name" forbidden="text"/></config>', - ["Element 'virtualType', attribute 'forbidden': The attribute 'forbidden' is not allowed."], + ["Element 'virtualType', attribute 'forbidden': The attribute 'forbidden' is not allowed.\nLine: 1\n"], ], 'virtualtype_with_same_name_attribute_value' => [ '<?xml version="1.0"?><config><virtualType name="test_name" /><virtualType name="test_name" /></config>', [ "Element 'virtualType': Duplicate key-sequence ['test_name'] in unique" . - " identity-constraint 'uniqueVirtualType'." + " identity-constraint 'uniqueVirtualType'.\nLine: 1\n" ], ], 'virtualtype_with_same_argument_name_attribute' => [ @@ -142,7 +152,8 @@ return [ </virtualType> </config>', [ - "Element 'argument': Duplicate key-sequence ['same_param_name'] in key identity-constraint 'argumentName'." + "Element 'argument': Duplicate key-sequence ['same_param_name'] in key identity-constraint" + . " 'argumentName'.\nLine: 6\n" ], ] ]; diff --git a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Config/_files/valid_config.xml b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Config/_files/valid_config.xml index abbd9bc105f3f2d640b7a3327e2627e49a3a6437..fb78556acc82b4d7d52be6f99f15ac7095acbfdc 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Config/_files/valid_config.xml +++ b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Config/_files/valid_config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Some_For_Name" type="Some_Type_Name" /> <virtualType name="" type="" shared="true"> <arguments> diff --git a/lib/internal/Magento/Framework/Phrase.php b/lib/internal/Magento/Framework/Phrase.php index f4194f69b02d8c46e2907d43dc8574a2f503044f..294b5daef2723a9c1444c431e1581bc82f488bd0 100644 --- a/lib/internal/Magento/Framework/Phrase.php +++ b/lib/internal/Magento/Framework/Phrase.php @@ -7,9 +7,9 @@ */ namespace Magento\Framework; -use Zend\Stdlib\JsonSerializable; -use Magento\Framework\Phrase\RendererInterface; use Magento\Framework\Phrase\Renderer\Placeholder as RendererPlaceholder; +use Magento\Framework\Phrase\RendererInterface; +use Zend\Stdlib\JsonSerializable; class Phrase implements JsonSerializable { diff --git a/lib/internal/Magento/Framework/ProductVideo/README.md b/lib/internal/Magento/Framework/ProductVideo/README.md new file mode 100644 index 0000000000000000000000000000000000000000..88bf074ef921029dddc69e0c304ba3cd23bd9539 --- /dev/null +++ b/lib/internal/Magento/Framework/ProductVideo/README.md @@ -0,0 +1 @@ +Library contains schema files used to validate XML files in Magento\ProductVideo module diff --git a/app/code/Magento/ProductVideo/etc/view.xsd b/lib/internal/Magento/Framework/ProductVideo/etc/view.xsd similarity index 94% rename from app/code/Magento/ProductVideo/etc/view.xsd rename to lib/internal/Magento/Framework/ProductVideo/etc/view.xsd index d08c70e45af84069d09e2c163298e7f3fd19c97a..e5af826629af43085b84e36f3d5dda78a6b8e4f5 100644 --- a/app/code/Magento/ProductVideo/etc/view.xsd +++ b/lib/internal/Magento/Framework/ProductVideo/etc/view.xsd @@ -6,7 +6,7 @@ */ --> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> - <xs:redefine schemaLocation="../../../../../lib/internal/Magento/Framework/Config/etc/view.xsd"> + <xs:redefine schemaLocation="../../Config/etc/view.xsd"> <xs:complexType name="mediaType" mixed="true"> <xs:complexContent> <xs:extension base="mediaType"> diff --git a/lib/internal/Magento/Framework/RequireJs/Config.php b/lib/internal/Magento/Framework/RequireJs/Config.php index 9abc0d24e6793028c31b3240c8c1675e3f32cfa8..3c77d2172b553e50c7632643f01a7d428c1cdf31 100644 --- a/lib/internal/Magento/Framework/RequireJs/Config.php +++ b/lib/internal/Magento/Framework/RequireJs/Config.php @@ -5,7 +5,8 @@ */ namespace Magento\Framework\RequireJs; -use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Filesystem\DriverPool; +use Magento\Framework\Filesystem\File\ReadFactory; use Magento\Framework\View\Asset\Minification; /** @@ -82,9 +83,9 @@ config; private $design; /** - * @var \Magento\Framework\Filesystem\Directory\ReadInterface + * @var \Magento\Framework\Filesystem\File\ReadFactory */ - private $baseDir; + private $readFactory; /** * @var \Magento\Framework\View\Asset\ContextInterface @@ -104,7 +105,7 @@ config; /** * @param \Magento\Framework\RequireJs\Config\File\Collector\Aggregated $fileSource * @param \Magento\Framework\View\DesignInterface $design - * @param \Magento\Framework\Filesystem $appFilesystem + * @param ReadFactory $readFactory * @param \Magento\Framework\View\Asset\Repository $assetRepo * @param \Magento\Framework\Code\Minifier\AdapterInterface $minifyAdapter * @param Minification $minification @@ -112,14 +113,14 @@ config; public function __construct( \Magento\Framework\RequireJs\Config\File\Collector\Aggregated $fileSource, \Magento\Framework\View\DesignInterface $design, - \Magento\Framework\Filesystem $appFilesystem, + ReadFactory $readFactory, \Magento\Framework\View\Asset\Repository $assetRepo, \Magento\Framework\Code\Minifier\AdapterInterface $minifyAdapter, Minification $minification ) { $this->fileSource = $fileSource; $this->design = $design; - $this->baseDir = $appFilesystem->getDirectoryRead(DirectoryList::ROOT); + $this->readFactory = $readFactory; $this->staticContext = $assetRepo->getStaticViewFileContext(); $this->minifyAdapter = $minifyAdapter; $this->minification = $minification; @@ -136,7 +137,9 @@ config; $baseConfig = $this->getBaseConfig(); $customConfigFiles = $this->fileSource->getFiles($this->design->getDesignTheme(), self::CONFIG_FILE_NAME); foreach ($customConfigFiles as $file) { - $config = $this->baseDir->readFile($this->baseDir->getRelativePath($file->getFilename())); + /** @var $fileReader \Magento\Framework\Filesystem\File\Read */ + $fileReader = $this->readFactory->create($file->getFileName(), DriverPool::FILE); + $config = $fileReader->readAll($file->getName()); $distributedConfig .= str_replace( ['%config%', '%context%'], [$config, $file->getModule()], diff --git a/lib/internal/Magento/Framework/RequireJs/Test/Unit/ConfigTest.php b/lib/internal/Magento/Framework/RequireJs/Test/Unit/ConfigTest.php index 592193f6a8a1053c52ab4670b036d248e930a87b..2480c753defb47bd1fd10c71cce8b04759a3fe3c 100644 --- a/lib/internal/Magento/Framework/RequireJs/Test/Unit/ConfigTest.php +++ b/lib/internal/Magento/Framework/RequireJs/Test/Unit/ConfigTest.php @@ -8,8 +8,6 @@ namespace Magento\Framework\RequireJs\Test\Unit; use \Magento\Framework\RequireJs\Config; -use Magento\Framework\App\Filesystem\DirectoryList; - class ConfigTest extends \PHPUnit_Framework_TestCase { /** @@ -23,9 +21,9 @@ class ConfigTest extends \PHPUnit_Framework_TestCase private $design; /** - * @var \Magento\Framework\Filesystem\Directory\ReadInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\Filesystem\File\Read|\PHPUnit_Framework_MockObject_MockObject */ - private $baseDir; + private $fileReader; /** * @var \Magento\Framework\View\Asset\ContextInterface|\PHPUnit_Framework_MockObject_MockObject @@ -57,12 +55,12 @@ class ConfigTest extends \PHPUnit_Framework_TestCase false ); $this->design = $this->getMockForAbstractClass('\Magento\Framework\View\DesignInterface'); - $this->baseDir = $this->getMockForAbstractClass('\Magento\Framework\Filesystem\Directory\ReadInterface'); - $filesystem = $this->getMock('\Magento\Framework\Filesystem', [], [], '', false); - $filesystem->expects($this->once()) - ->method('getDirectoryRead') - ->with(DirectoryList::ROOT) - ->will($this->returnValue($this->baseDir)); + + $readFactory = $this->getMock('\Magento\Framework\Filesystem\File\ReadFactory', [], [], '', false); + $this->fileReader = $this->getMock('\Magento\Framework\Filesystem\File\Read', [], [], '', false); + $readFactory->expects($this->any()) + ->method('create') + ->will($this->returnValue($this->fileReader)); $repo = $this->getMock('\Magento\Framework\View\Asset\Repository', [], [], '', false); $this->context = $this->getMockBuilder('Magento\Framework\View\Asset\ContextInterface') ->setMethods( @@ -84,7 +82,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase $this->object = new Config( $this->fileSource, $this->design, - $filesystem, + $readFactory, $repo, $this->minifyAdapterMock, $this->minificationMock @@ -93,19 +91,17 @@ class ConfigTest extends \PHPUnit_Framework_TestCase public function testGetConfig() { - $this->baseDir->expects($this->any()) - ->method('getRelativePath') - ->will($this->returnCallback(function ($path) { - return 'relative/' . $path; - })); - $this->baseDir->expects($this->any()) - ->method('readFile') + $this->fileReader->expects($this->any()) + ->method('readAll') ->will($this->returnCallback(function ($file) { return $file . ' content'; })); $fileOne = $this->getMock('\Magento\Framework\View\File', [], [], '', false); $fileOne->expects($this->once()) ->method('getFilename') + ->will($this->returnValue('some/full/relative/path/file_one.js')); + $fileOne->expects($this->once()) + ->method('getName') ->will($this->returnValue('file_one.js')); $fileOne->expects($this->once()) ->method('getModule') @@ -113,6 +109,9 @@ class ConfigTest extends \PHPUnit_Framework_TestCase $fileTwo = $this->getMock('\Magento\Framework\View\File', [], [], '', false); $fileTwo->expects($this->once()) ->method('getFilename') + ->will($this->returnValue('some/full/relative/path/file_two.js')); + $fileTwo->expects($this->once()) + ->method('getName') ->will($this->returnValue('file_two.js')); $theme = $this->getMockForAbstractClass('\Magento\Framework\View\Design\ThemeInterface'); $this->design->expects($this->once()) @@ -132,11 +131,11 @@ class ConfigTest extends \PHPUnit_Framework_TestCase (function(require){ require.config({"baseUrl":""}); (function() { -relative/file_one.js content +file_one.js content require.config(config); })(); (function() { -relative/file_two.js content +file_two.js content require.config(config); })(); diff --git a/lib/internal/Magento/Framework/Search/Request/Config/SchemaLocator.php b/lib/internal/Magento/Framework/Search/Request/Config/SchemaLocator.php index a54db98b0f4172eb2c5e8a7b6010695e8136fe62..413e816f64e9747d067595a49ba32cb3f76906c7 100644 --- a/lib/internal/Magento/Framework/Search/Request/Config/SchemaLocator.php +++ b/lib/internal/Magento/Framework/Search/Request/Config/SchemaLocator.php @@ -10,6 +10,14 @@ namespace Magento\Framework\Search\Request\Config; */ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface { + /** @var \Magento\Framework\Config\Dom\UrnResolver */ + protected $urnResolver; + + public function __construct(\Magento\Framework\Config\Dom\UrnResolver $urnResolver) + { + $this->urnResolver = $urnResolver; + } + /** * Get path to merged config schema * @@ -17,7 +25,7 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface */ public function getSchema() { - return realpath(__DIR__ . '/../../etc/search_request_merged.xsd'); + return $this->urnResolver->getRealPath('urn:magento:framework:Search/etc/search_request_merged.xsd'); } /** @@ -27,6 +35,6 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface */ public function getPerFileSchema() { - return realpath(__DIR__ . '/../../etc/search_request.xsd'); + return $this->urnResolver->getRealPath('urn:magento:framework:Search/etc/search_request.xsd'); } } diff --git a/lib/internal/Magento/Framework/Search/Test/Unit/Request/Config/SchemaLocatorTest.php b/lib/internal/Magento/Framework/Search/Test/Unit/Request/Config/SchemaLocatorTest.php new file mode 100644 index 0000000000000000000000000000000000000000..0078fb76c143b1d07443ad51c84bc8815d21d441 --- /dev/null +++ b/lib/internal/Magento/Framework/Search/Test/Unit/Request/Config/SchemaLocatorTest.php @@ -0,0 +1,54 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Framework\Search\Test\Unit\Request\Config; + +class SchemaLocatorTest extends \PHPUnit_Framework_TestCase +{ + /** @var \Magento\Framework\Cache\Config\SchemaLocator */ + protected $schemaLocator; + + /** @var \Magento\Framework\Config\Dom\UrnResolver */ + protected $urnResolver; + + /** @var \Magento\Framework\Config\Dom\UrnResolver */ + protected $urnResolverMock; + + public function setUp() + { + $this->urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + /** @var \Magento\Framework\Config\Dom\UrnResolver $urnResolverMock */ + $this->urnResolverMock = $this->getMock('Magento\Framework\Config\Dom\UrnResolver', [], [], '', false); + $this->schemaLocator = new \Magento\Framework\Search\Request\Config\SchemaLocator($this->urnResolverMock); + } + + public function testGetSchema() + { + $this->urnResolverMock->expects($this->once()) + ->method('getRealPath') + ->with('urn:magento:framework:Search/etc/search_request_merged.xsd') + ->willReturn( + $this->urnResolver->getRealPath('urn:magento:framework:Search/etc/search_request_merged.xsd') + ); + $this->assertEquals( + $this->urnResolver->getRealPath('urn:magento:framework:Search/etc/search_request_merged.xsd'), + $this->schemaLocator->getSchema() + ); + } + + public function testGetPerFileSchema() + { + $this->urnResolverMock->expects($this->once()) + ->method('getRealPath') + ->with('urn:magento:framework:Search/etc/search_request.xsd') + ->willReturn( + $this->urnResolver->getRealPath('urn:magento:framework:Search/etc/search_request.xsd') + ); + $this->assertEquals( + $this->urnResolver->getRealPath('urn:magento:framework:Search/etc/search_request.xsd'), + $this->schemaLocator->getPerFileSchema() + ); + } +} diff --git a/lib/internal/Magento/Framework/Session/Config.php b/lib/internal/Magento/Framework/Session/Config.php index f90ccb04301f039240df7049241c2251334471f2..f006da9dcf7b376505f64d7c8485997fe925ba1e 100644 --- a/lib/internal/Magento/Framework/Session/Config.php +++ b/lib/internal/Magento/Framework/Session/Config.php @@ -11,6 +11,7 @@ use Magento\Framework\App\DeploymentConfig; use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\Filesystem; use Magento\Framework\Session\Config\ConfigInterface; +use Magento\Framework\Session\SaveHandlerInterface; /** * Magento session configuration @@ -128,15 +129,25 @@ class Config implements ConfigInterface $this->_httpRequest = $request; $this->_scopeType = $scopeType; + /** + * Session handler + * + * Save handler may be set to custom value in deployment config, which will override everything else. + * Otherwise, try to read PHP settings for session.save_handler value. Otherwise, use 'files' as default. + */ + $defaultSaveHandler = $this->getStorageOption('session.save_handler') + ?: SaveHandlerInterface::DEFAULT_HANDLER; $saveMethod = $deploymentConfig->get( self::PARAM_SESSION_SAVE_METHOD, - \Magento\Framework\Session\SaveHandlerInterface::DEFAULT_HANDLER + $defaultSaveHandler ); - $savePath = $deploymentConfig->get(self::PARAM_SESSION_SAVE_PATH); - $cacheLimiter = $deploymentConfig->get(self::PARAM_SESSION_CACHE_LIMITER); - - $this->setSaveHandler($saveMethod === 'db' ? 'user' : $saveMethod); + $saveMethod = $saveMethod === 'db' ? 'user' : $saveMethod; + $this->setSaveHandler($saveMethod); + /** + * Session path + */ + $savePath = $deploymentConfig->get(self::PARAM_SESSION_SAVE_PATH); if (!$savePath && !ini_get('session.save_path')) { $sessionDir = $filesystem->getDirectoryWrite(DirectoryList::SESSION); $savePath = $sessionDir->getAbsolutePath(); @@ -145,10 +156,18 @@ class Config implements ConfigInterface if ($savePath) { $this->setSavePath($savePath); } + + /** + * Session cache limiter + */ + $cacheLimiter = $deploymentConfig->get(self::PARAM_SESSION_CACHE_LIMITER); if ($cacheLimiter) { $this->setOption('session.cache_limiter', $cacheLimiter); } + /** + * Cookie settings: lifetime, path, domain, httpOnly. These govern settings for the session cookie. + */ $lifetime = $this->_scopeConfig->getValue($lifetimePath, $this->_scopeType); $this->setCookieLifetime($lifetime, self::COOKIE_LIFETIME_DEFAULT); diff --git a/lib/internal/Magento/Framework/Session/SaveHandlerFactory.php b/lib/internal/Magento/Framework/Session/SaveHandlerFactory.php index 7fc89d686b7abc0a8717d5871aa3b2c20b816921..9cf89d8859cf6dddf1a7ca18e0242d50771e8401 100644 --- a/lib/internal/Magento/Framework/Session/SaveHandlerFactory.php +++ b/lib/internal/Magento/Framework/Session/SaveHandlerFactory.php @@ -59,8 +59,8 @@ class SaveHandlerFactory } $model = $this->objectManager->create($sessionHandler, $params); - if (!$model instanceof \SessionHandler) { - throw new \LogicException($sessionHandler . ' doesn\'t implement \SessionHandler'); + if (!$model instanceof \SessionHandlerInterface) { + throw new \LogicException($sessionHandler . ' doesn\'t implement \SessionHandlerInterface'); } return $model; diff --git a/lib/internal/Magento/Framework/Session/Test/Unit/ConfigTest.php b/lib/internal/Magento/Framework/Session/Test/Unit/ConfigTest.php index 4fa9328557ba5196c855a94f3f57e01048f779e7..6c43bf72c0d010fe2eee5d71622e33ee1044b6d6 100644 --- a/lib/internal/Magento/Framework/Session/Test/Unit/ConfigTest.php +++ b/lib/internal/Magento/Framework/Session/Test/Unit/ConfigTest.php @@ -15,6 +15,9 @@ use \Magento\Framework\Session\Config; class ConfigTest extends \PHPUnit_Framework_TestCase { + /** mock session.save_handler value from deployment config */ + const SESSION_HANDLER_CONFIG = 'files'; + /** * @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager */ @@ -132,11 +135,11 @@ class ConfigTest extends \PHPUnit_Framework_TestCase $this->assertEquals('FOOBAR', $this->config->getName()); } - public function testSaveHandlerDefaultsToIniSettings() + public function testSaveHandlerFromConfig() { $this->getModel($this->validatorMock); $this->assertSame( - ini_get('session.save_handler'), + self::SESSION_HANDLER_CONFIG, $this->config->getSaveHandler(), var_export($this->config->toArray(), 1) ); @@ -442,17 +445,17 @@ class ConfigTest extends \PHPUnit_Framework_TestCase $this->configMock->method('getValue') ->will($this->returnValueMap($getValueReturnMap)); - $filesystemMock = $this->getMock('\Magento\Framework\Filesystem', [], [], '', false); + $filesystemMock = $this->getMock('Magento\Framework\Filesystem', [], [], '', false); $dirMock = $this->getMockForAbstractClass('Magento\Framework\Filesystem\Directory\WriteInterface'); $filesystemMock->expects($this->any()) ->method('getDirectoryWrite') ->will($this->returnValue($dirMock)); - $deploymentConfigMock = $this->getMock('\Magento\Framework\App\DeploymentConfig', [], [], '', false); + $deploymentConfigMock = $this->getMock('Magento\Framework\App\DeploymentConfig', [], [], '', false); $deploymentConfigMock->expects($this->at(0)) ->method('get') - ->with(Config::PARAM_SESSION_SAVE_METHOD, 'files') - ->will($this->returnValue('files')); + ->with(Config::PARAM_SESSION_SAVE_METHOD, ini_get('session.save_handler') ?: 'files') + ->willReturn(self::SESSION_HANDLER_CONFIG); $deploymentConfigMock->expects($this->at(1)) ->method('get') ->with(Config::PARAM_SESSION_SAVE_PATH) diff --git a/lib/internal/Magento/Framework/Session/Test/Unit/SaveHandlerFactoryTest.php b/lib/internal/Magento/Framework/Session/Test/Unit/SaveHandlerFactoryTest.php index 937806cf8fd705691710916d760344d225c74630..bf2e04d26ec13d53384d5808445e2d3aa4876cce 100644 --- a/lib/internal/Magento/Framework/Session/Test/Unit/SaveHandlerFactoryTest.php +++ b/lib/internal/Magento/Framework/Session/Test/Unit/SaveHandlerFactoryTest.php @@ -36,14 +36,31 @@ class SaveHandlerFactoryTest extends \PHPUnit_Framework_TestCase $result = $model->create($saveMethod); $this->assertInstanceOf($saveClass, $result); $this->assertInstanceOf('\Magento\Framework\Session\SaveHandler\Native', $result); - $this->assertInstanceOf('\SessionHandler', $result); + $this->assertInstanceOf('\SessionHandlerInterface', $result); } /** * @return array */ - public static function createDataProvider() + public function createDataProvider() { return [[[], 'Magento\Framework\Session\SaveHandler\Native', 'files']]; } + + /** + * @expectedException \LogicException + * @expectedExceptionMessage Magento\Framework\Session\SaveHandler\Native doesn't implement \SessionHandlerInterface + */ + public function testCreateInvalid() + { + $invalidSaveHandler = new \Magento\Framework\DataObject(); + $objectManager = $this->getMockBuilder('Magento\Framework\ObjectManager\ObjectManager') + ->disableOriginalConstructor() + ->getMock(); + $objectManager->expects($this->once()) + ->method('create') + ->willReturn($invalidSaveHandler); + $model = new SaveHandlerFactory($objectManager, []); + $model->create('files'); + } } diff --git a/lib/internal/Magento/Framework/Stdlib/DateTime/DateTime.php b/lib/internal/Magento/Framework/Stdlib/DateTime/DateTime.php index eefc5291aeee7bdeb9e68d397d5f7fb40eadee7d..9402420d3e059a367388285a1134e69e341918c8 100644 --- a/lib/internal/Magento/Framework/Stdlib/DateTime/DateTime.php +++ b/lib/internal/Magento/Framework/Stdlib/DateTime/DateTime.php @@ -64,8 +64,6 @@ class DateTime * @param string $format * @param int|string $input date in current timezone * @return string - * - * @deprecated (MAGETWO-35555) */ public function gmtDate($format = null, $input = null) { diff --git a/lib/internal/Magento/Framework/TestFramework/Test/Unit/Unit/Utility/XsdValidatorTest.php b/lib/internal/Magento/Framework/TestFramework/Test/Unit/Unit/Utility/XsdValidatorTest.php index 7dab1be9e7b1de6aecf93906168b18da5982e3d7..08aebe82e8bea6fa391205514f50e9145409e82a 100644 --- a/lib/internal/Magento/Framework/TestFramework/Test/Unit/Unit/Utility/XsdValidatorTest.php +++ b/lib/internal/Magento/Framework/TestFramework/Test/Unit/Unit/Utility/XsdValidatorTest.php @@ -36,8 +36,8 @@ class XsdValidatorTest extends \PHPUnit_Framework_TestCase { $xmlFile = realpath(__DIR__ . '/_files/invalid.xml'); $expected = [ - "Element 'block', attribute 'type': The attribute 'type' is not allowed.", - "Element 'actions': This element is not expected. Expected is ( property ).", + "Element 'block', attribute 'type': The attribute 'type' is not allowed.\nLine: 9\n", + "Element 'actions': This element is not expected. Expected is ( property ).\nLine: 10\n", ]; $xmlString = file_get_contents($xmlFile); diff --git a/lib/internal/Magento/Framework/TestFramework/Test/Unit/Unit/Utility/_files/invalid.xml b/lib/internal/Magento/Framework/TestFramework/Test/Unit/Unit/Utility/_files/invalid.xml index 0dc5fcee2bb7c1de8067e60be8550458ddcf84ce..27fb06983dc685ed2dfb46c96dee553cbfb43f6d 100644 --- a/lib/internal/Magento/Framework/TestFramework/Test/Unit/Unit/Utility/_files/invalid.xml +++ b/lib/internal/Magento/Framework/TestFramework/Test/Unit/Unit/Utility/_files/invalid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="valid.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:TestFramework/Test/Unit/Unit/Utility/_files/valid.xsd"> <block type="some_name"> <actions attribute="testName" /> </block> diff --git a/lib/internal/Magento/Framework/TestFramework/Test/Unit/Unit/Utility/_files/valid.xml b/lib/internal/Magento/Framework/TestFramework/Test/Unit/Unit/Utility/_files/valid.xml index 6d3092e1894fdf9e095063148727ccdefa18063a..056751ce61e0c860b9dae787969f17f4e27337c3 100644 --- a/lib/internal/Magento/Framework/TestFramework/Test/Unit/Unit/Utility/_files/valid.xml +++ b/lib/internal/Magento/Framework/TestFramework/Test/Unit/Unit/Utility/_files/valid.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="valid.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:TestFramework/Test/Unit/Unit/Utility/_files/valid.xsd"> <block name="some_name"> <property attribute="testName" /> </block> diff --git a/lib/internal/Magento/Framework/TestFramework/Unit/Utility/XsdValidator.php b/lib/internal/Magento/Framework/TestFramework/Unit/Utility/XsdValidator.php index a42cd2ff6f28ff8b399c733ce965ec7d1cc49f01..9e426e7a1dbbfa20ad9797fb3811656cd3752c0e 100644 --- a/lib/internal/Magento/Framework/TestFramework/Unit/Utility/XsdValidator.php +++ b/lib/internal/Magento/Framework/TestFramework/Unit/Utility/XsdValidator.php @@ -16,14 +16,11 @@ class XsdValidator { $document = new \DOMDocument(); $document->loadXML($xml); + libxml_use_internal_errors(true); - $document->schemaValidate($schema); - $validationResult = libxml_get_errors(); + $errors = \Magento\Framework\Config\Dom::validateDomDocument($document, $schema); libxml_use_internal_errors(false); - $result = []; - foreach ($validationResult as $error) { - $result[] = trim($error->message); - } - return $result; + + return $errors; } } diff --git a/lib/internal/Magento/Framework/Translate.php b/lib/internal/Magento/Framework/Translate.php index 4cf9f524400fe190fe45635c5183f2d3a288fde8..2a3341bd5e21b936c97f5624de97c0196a73fc41 100644 --- a/lib/internal/Magento/Framework/Translate.php +++ b/lib/internal/Magento/Framework/Translate.php @@ -317,7 +317,7 @@ class Translate implements \Magento\Framework\TranslateInterface */ protected function _getModuleTranslationFile($moduleName, $locale) { - $file = $this->_modulesReader->getModuleDir('i18n', $moduleName); + $file = $this->_modulesReader->getModuleDir(Module\Dir::MODULE_I18N_DIR, $moduleName); $file .= '/' . $locale . '.csv'; return $file; } diff --git a/lib/internal/Magento/Framework/Ui/README.md b/lib/internal/Magento/Framework/Ui/README.md new file mode 100644 index 0000000000000000000000000000000000000000..f955cbb0d9efdd8d91962bd4a79a19387da78397 --- /dev/null +++ b/lib/internal/Magento/Framework/Ui/README.md @@ -0,0 +1 @@ +Library contain schema files used to validate XML files in Magento\Ui module diff --git a/app/code/Magento/Ui/etc/ui_components.xsd b/lib/internal/Magento/Framework/Ui/etc/ui_components.xsd similarity index 99% rename from app/code/Magento/Ui/etc/ui_components.xsd rename to lib/internal/Magento/Framework/Ui/etc/ui_components.xsd index 79c3c684786300bfad686a283b717f058b18eea6..3790dec48e07bbcb9d6661d3ce09551e4cc75f19 100644 --- a/app/code/Magento/Ui/etc/ui_components.xsd +++ b/lib/internal/Magento/Framework/Ui/etc/ui_components.xsd @@ -7,7 +7,7 @@ --> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <!-- Include section --> - <xs:include schemaLocation="../../../../../lib/internal/Magento/Framework/Data/etc/argument/types.xsd"/> + <xs:include schemaLocation="../../Data/etc/argument/types.xsd"/> <!-- Defined the types of components --> <xs:complexType name="layout" xml:base="ui_element"> <xs:complexContent> diff --git a/app/code/Magento/Ui/etc/ui_configuration.xsd b/lib/internal/Magento/Framework/Ui/etc/ui_configuration.xsd similarity index 100% rename from app/code/Magento/Ui/etc/ui_configuration.xsd rename to lib/internal/Magento/Framework/Ui/etc/ui_configuration.xsd diff --git a/app/code/Magento/Ui/etc/ui_definition.xsd b/lib/internal/Magento/Framework/Ui/etc/ui_definition.xsd similarity index 100% rename from app/code/Magento/Ui/etc/ui_definition.xsd rename to lib/internal/Magento/Framework/Ui/etc/ui_definition.xsd diff --git a/lib/internal/Magento/Framework/Unserialize/README.md b/lib/internal/Magento/Framework/Unserialize/README.md new file mode 100644 index 0000000000000000000000000000000000000000..971bd6980abb136c2246e4618a8776be8bdaa16d --- /dev/null +++ b/lib/internal/Magento/Framework/Unserialize/README.md @@ -0,0 +1,2 @@ +Library provides custom unserialize method. Method checks if serialized string contains serialized object and do not +unserialize it. If string doesn't contain serialized object, method calls native PHP function unserialize. \ No newline at end of file diff --git a/lib/internal/Magento/Framework/Unserialize/Test/Unit/UnserializeTest.php b/lib/internal/Magento/Framework/Unserialize/Test/Unit/UnserializeTest.php new file mode 100644 index 0000000000000000000000000000000000000000..60d7235986aaf5a9cdfb32bf28f0d7f6ec1df6fb --- /dev/null +++ b/lib/internal/Magento/Framework/Unserialize/Test/Unit/UnserializeTest.php @@ -0,0 +1,36 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Framework\Unserialize\Test\Unit; + +/** + * @package Magento\Framework + */ +class UnserializeTest extends \PHPUnit_Framework_TestCase +{ + /** @var \Magento\Framework\Unserialize\Unserialize */ + protected $unserialize; + + public function setUp() + { + $this->unserialize = new \Magento\Framework\Unserialize\Unserialize(); + } + + public function testUnserializeArray() + { + $array = ['foo' => 'bar', 1, 4]; + $this->assertEquals($array, $this->unserialize->unserialize(serialize($array))); + } + + /** + * @expectedException Exception + * @expectedExceptionMessage String contains serialized object + */ + public function testUnserializeObject() + { + $serialized = 'a:2:{i:0;s:3:"foo";i:1;O:6:"Object":1:{s:11:"Objectvar";i:123;}}'; + $this->assertFalse($this->unserialize->unserialize($serialized)); + } +} diff --git a/lib/internal/Magento/Framework/Unserialize/Unserialize.php b/lib/internal/Magento/Framework/Unserialize/Unserialize.php new file mode 100644 index 0000000000000000000000000000000000000000..8c45b88ec5cd82b5718585933edc05be3bae9bd3 --- /dev/null +++ b/lib/internal/Magento/Framework/Unserialize/Unserialize.php @@ -0,0 +1,23 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Framework\Unserialize; + +class Unserialize +{ + /** + * @param string $string + * @return bool|mixed + */ + public function unserialize($string) + { + if (preg_match('/o:\d+:"[a-z0-9_]+":\d+:{.*?}/i', $string)) { + trigger_error('String contains serialized object'); + return false; + } + return unserialize($string); + } +} diff --git a/lib/internal/Magento/Framework/Validator/Config.php b/lib/internal/Magento/Framework/Validator/Config.php index 85317aa88e7a2acd4ae7b5b26f8390acf43a6504..9b10f61bb596d87814b0704b322ec39ca1c8b1ec 100644 --- a/lib/internal/Magento/Framework/Validator/Config.php +++ b/lib/internal/Magento/Framework/Validator/Config.php @@ -32,14 +32,22 @@ class Config extends \Magento\Framework\Config\AbstractXml */ protected $_builderFactory; + /** @var \Magento\Framework\Config\Dom\UrnResolver */ + protected $urnResolver; + /** * @param array $configFiles * @param \Magento\Framework\Validator\UniversalFactory $builderFactory + * @param \Magento\Framework\Config\Dom\UrnResolver $urnResolver */ - public function __construct($configFiles, \Magento\Framework\Validator\UniversalFactory $builderFactory) - { - parent::__construct($configFiles); + public function __construct( + $configFiles, + \Magento\Framework\Validator\UniversalFactory $builderFactory, + \Magento\Framework\Config\Dom\UrnResolver $urnResolver + ) { $this->_builderFactory = $builderFactory; + $this->urnResolver = $urnResolver; + parent::__construct($configFiles); } /** @@ -399,7 +407,7 @@ class Config extends \Magento\Framework\Config\AbstractXml */ public function getSchemaFile() { - return __DIR__ . '/etc/validation.xsd'; + return $this->urnResolver->getRealPath('urn:magento:framework:Validator/etc/validation.xsd'); } /** diff --git a/lib/internal/Magento/Framework/Validator/Test/Unit/ConfigTest.php b/lib/internal/Magento/Framework/Validator/Test/Unit/ConfigTest.php index 507a1c881d6c98a71c5b6bdeffa836197186c184..9a9bb9aafcaae66ff4e780de8d992b5ac7a56609 100644 --- a/lib/internal/Magento/Framework/Validator/Test/Unit/ConfigTest.php +++ b/lib/internal/Magento/Framework/Validator/Test/Unit/ConfigTest.php @@ -19,9 +19,13 @@ class ConfigTest extends \PHPUnit_Framework_TestCase */ protected $_objectManager; + /** @var \Magento\Framework\Config\Dom\UrnResolver */ + protected $urnResolver; + protected function setUp() { $this->_objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); + $this->urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); } /** @@ -54,9 +58,19 @@ class ConfigTest extends \PHPUnit_Framework_TestCase $realObjectManager = new \Magento\Framework\ObjectManager\ObjectManager($factory, $config); $factory->setObjectManager($realObjectManager); $universalFactory = $realObjectManager->get('Magento\Framework\Validator\UniversalFactory'); + /** @var \Magento\Framework\Config\Dom\UrnResolver $urnResolverMock */ + $urnResolverMock = $this->getMock('Magento\Framework\Config\Dom\UrnResolver', [], [], '', false); + $urnResolverMock->expects($this->any()) + ->method('getRealPath') + ->with('urn:magento:framework:Validator/etc/validation.xsd') + ->willReturn($this->urnResolver->getRealPath('urn:magento:framework:Validator/etc/validation.xsd')); $this->_config = $this->_objectManager->getObject( 'Magento\Framework\Validator\Config', - ['configFiles' => $configFiles, 'builderFactory' => $universalFactory] + [ + 'configFiles' => $configFiles, + 'builderFactory' => $universalFactory, + 'urnResolver' => $urnResolverMock + ] ); } @@ -295,6 +309,10 @@ class ConfigTest extends \PHPUnit_Framework_TestCase public function testGetSchemaFile() { $this->_initConfig(); + $this->assertEquals( + $this->urnResolver->getRealPath('urn:magento:framework:Validator/etc/validation.xsd'), + $this->_config->getSchemaFile() + ); $this->assertFileExists($this->_config->getSchemaFile()); } } diff --git a/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/invalid_builder_class.xml b/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/invalid_builder_class.xml index c2afa00cac014b8805344ae4529a0416dd77bcd1..49a958fa7c1bd32915e568d6efc3b061929443e3 100644 --- a/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/invalid_builder_class.xml +++ b/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/invalid_builder_class.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<validation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/Validator/etc/validation.xsd"> +<validation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Validator/etc/validation.xsd"> <entity name="catalog_product"> <rules> <rule name="name_sku_and_price"> diff --git a/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/invalid_builder_instance.xml b/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/invalid_builder_instance.xml index 47234a17257524479d6e98830c526239a629a6dc..fe9e029d1d29ce23034ac68809239d12bc1663b8 100644 --- a/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/invalid_builder_instance.xml +++ b/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/invalid_builder_instance.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<validation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/Validator/etc/validation.xsd"> +<validation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Validator/etc/validation.xsd"> <entity name="catalog_product"> <rules> <rule name="name_sku_and_price"> diff --git a/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/invalid_child_for_option.xml b/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/invalid_child_for_option.xml index 3ee9d26568f96eece673b2a81a26884416a910aa..93e22e2e2d4a1145a770813d02fcba6f7adbd0e0 100644 --- a/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/invalid_child_for_option.xml +++ b/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/invalid_child_for_option.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<validation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/Validator/etc/validation.xsd"> +<validation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Validator/etc/validation.xsd"> <entity name="catalog_product"> <rules> <rule name="name_sku_and_price"> diff --git a/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/invalid_constraint.xml b/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/invalid_constraint.xml index 49de19bd1578e71a37626b0612b1b196e1dc8853..bfc6883fc73c703efa6eb13e6b650bb3e2481b62 100644 --- a/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/invalid_constraint.xml +++ b/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/invalid_constraint.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<validation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/Validator/etc/validation.xsd"> +<validation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Validator/etc/validation.xsd"> <entity name="test_entity"> <rules> <rule name="test_rule"> diff --git a/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/invalid_content_for_callback.xml b/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/invalid_content_for_callback.xml index e5e4fa0a90ac8b4208d539617a56b94b2050bb40..84a4e81f2d60520f3e7ce8fcf3c1428fe99b50a7 100644 --- a/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/invalid_content_for_callback.xml +++ b/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/invalid_content_for_callback.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<validation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/Validator/etc/validation.xsd"> +<validation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Validator/etc/validation.xsd"> <entity name="catalog_product"> <rules> <rule name="name_sku_and_price"> diff --git a/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/invalid_entity_callback.xml b/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/invalid_entity_callback.xml index ad8704fffaf6ba645370b6a208680a911beb1b2c..a8eac9e8131ab731c6cf3ef078dbfe955a88c9db 100644 --- a/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/invalid_entity_callback.xml +++ b/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/invalid_entity_callback.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<validation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/Validator/etc/validation.xsd"> +<validation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Validator/etc/validation.xsd"> <entity name="catalog_product"> <rules> <rule name="name_sku_and_price"> diff --git a/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/invalid_method.xml b/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/invalid_method.xml index bcdced702d440099eba4a885fb592cda7fe4bec5..a3139da3ccebcb9d29fc34c1bc3e93c6c858782f 100644 --- a/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/invalid_method.xml +++ b/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/invalid_method.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<validation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/Validator/etc/validation.xsd"> +<validation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Validator/etc/validation.xsd"> <entity name="catalog_product"> <rules> <rule name="name_sku_and_price"> diff --git a/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/invalid_method_callback.xml b/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/invalid_method_callback.xml index 8a9ec909b25e6cf8f15823fc61e03d062660a93f..72ceef4f8d9425c949f120b73bddc22187d4d1f9 100644 --- a/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/invalid_method_callback.xml +++ b/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/invalid_method_callback.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<validation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/Validator/etc/validation.xsd"> +<validation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Validator/etc/validation.xsd"> <entity name="catalog_product"> <rules> <rule name="name_sku_and_price"> diff --git a/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/multiple_callback_in_argument.xml b/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/multiple_callback_in_argument.xml index 04edf82c4546e6d0e6e1dafa80574886280bee59..f8a3c4efc748141384281adb1132b6fac03c40d3 100644 --- a/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/multiple_callback_in_argument.xml +++ b/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/multiple_callback_in_argument.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<validation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/Validator/etc/validation.xsd"> +<validation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Validator/etc/validation.xsd"> <entity name="catalog_product"> <rules> <rule name="name_sku_and_price"> diff --git a/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/no_class_for_constraint.xml b/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/no_class_for_constraint.xml index d155ff4b420cbe82cfa8ba7f5ce72fc69d364426..b4a833674149aede10e289e2abbecefa4dc1fbb2 100644 --- a/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/no_class_for_constraint.xml +++ b/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/no_class_for_constraint.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<validation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/Validator/etc/validation.xsd"> +<validation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Validator/etc/validation.xsd"> <entity name="test_entity"> <rules> <rule name="test_rule_constraint"> diff --git a/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/no_constraint.xml b/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/no_constraint.xml index 3f2eaa7651f1beeb81d28b8f41fcdccdd9f42ca9..4763b9ec64702bfb010c0882a5483955abb34712 100644 --- a/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/no_constraint.xml +++ b/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/no_constraint.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<validation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/Validator/etc/validation.xsd"> +<validation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Validator/etc/validation.xsd"> <entity name="test_entity"> <rules> <rule name="test_rule_a"> diff --git a/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/no_name_for_entity.xml b/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/no_name_for_entity.xml index 8765552c8447e7617e86a0b0cca01747eefdd4bb..53dd9af09762d5eff8667fcec0386315b82a5aa0 100644 --- a/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/no_name_for_entity.xml +++ b/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/no_name_for_entity.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<validation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/Validator/etc/validation.xsd"> +<validation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Validator/etc/validation.xsd"> <entity> <rules> <rule name="test_rule_b"> diff --git a/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/no_name_for_group.xml b/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/no_name_for_group.xml index 508e1dc4382870f036b7eabfc416395b09da00e2..4f99f56c4ff86b2c18eb9567ac1161cf430453ff 100644 --- a/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/no_name_for_group.xml +++ b/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/no_name_for_group.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<validation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/Validator/etc/validation.xsd"> +<validation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Validator/etc/validation.xsd"> <entity name="test_entity"> <rules> <rule name="test_rule_entity"> diff --git a/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/no_name_for_rule.xml b/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/no_name_for_rule.xml index ea401adc8ce448b51314b4e8b86e95d34d6090f9..9b992490826281cda0c7fa7d8d2244bd8c3faff7 100644 --- a/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/no_name_for_rule.xml +++ b/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/no_name_for_rule.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<validation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/Validator/etc/validation.xsd"> +<validation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Validator/etc/validation.xsd"> <entity name="test_entity"> <rules> <!-- attribute name is required for rule element --> diff --git a/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/no_rule_for_reference.xml b/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/no_rule_for_reference.xml index d6f60889e6c5eb00ef9a4318341498bbe30015bd..2c175b802af755c07906facac457f693fc0409bc 100644 --- a/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/no_rule_for_reference.xml +++ b/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/no_rule_for_reference.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<validation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/Validator/etc/validation.xsd"> +<validation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Validator/etc/validation.xsd"> <entity name="test_entity"> <rules> <rule name="test_rule_sku_and_name"> diff --git a/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/not_unique_use.xml b/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/not_unique_use.xml index 890cc567460b0c5f8abe56d3633446184f5225cc..3da520998231f567e667eff6ee011a5b664f0091 100644 --- a/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/not_unique_use.xml +++ b/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/negative/not_unique_use.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<validation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/Validator/etc/validation.xsd"> +<validation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Validator/etc/validation.xsd"> <entity name="test_entity"> <rules> <rule name="test_rule_sku"> diff --git a/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/positive/builder/validation.xml b/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/positive/builder/validation.xml index fc118e817b17ff20e09b9c4c597c8083f450de95..33b98dbae8c20e05ffef75ac9874e38c7c316bd4 100644 --- a/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/positive/builder/validation.xml +++ b/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/positive/builder/validation.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<validation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../lib/internal/Magento/Framework/Validator/etc/validation.xsd"> +<validation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Validator/etc/validation.xsd"> <entity name="test_entity_a"> <rules> <rule name="rules_for_builder"> diff --git a/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/positive/module_a/validation.xml b/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/positive/module_a/validation.xml index 9d8a8e0d0ee97cb35552cf39b927c0a5dd3b3978..720ef0dc75b2c9cadf3ffa4e60614a2dae3b3029 100644 --- a/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/positive/module_a/validation.xml +++ b/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/positive/module_a/validation.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<validation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../lib/internal/Magento/Framework/Validator/etc/validation.xsd"> +<validation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Validator/etc/validation.xsd"> <entity name="test_entity_a"> <rules> <rule name="check_alnum_and_int_not_empty_and_have_valid_value"> diff --git a/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/positive/module_b/validation.xml b/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/positive/module_b/validation.xml index e136f5414ff18803b60c42e163873f51d83a50d2..017bf4af2156af6fda10b6fd2101115894f0944f 100644 --- a/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/positive/module_b/validation.xml +++ b/lib/internal/Magento/Framework/Validator/Test/Unit/_files/validation/positive/module_b/validation.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<validation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../lib/internal/Magento/Framework/Validator/etc/validation.xsd"> +<validation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Validator/etc/validation.xsd"> <entity name="test_entity_a"> <rules> <rule name="check_alnum_and_int_not_empty_and_have_valid_value"> diff --git a/lib/internal/Magento/Framework/View/Config.php b/lib/internal/Magento/Framework/View/Config.php index d186f0170b19fccf00ad595f9c9147981e5a4afa..fb4c687a731764c9d873f59c738a6d251e3bbece 100644 --- a/lib/internal/Magento/Framework/View/Config.php +++ b/lib/internal/Magento/Framework/View/Config.php @@ -62,6 +62,9 @@ class Config implements \Magento\Framework\View\ConfigInterface */ protected $fileIteratorFactory; + /** @var \Magento\Framework\Config\ViewFactory */ + protected $viewConfigFactory; + /** * File view factory * @@ -77,7 +80,7 @@ class Config implements \Magento\Framework\View\ConfigInterface * @param \Magento\Framework\View\Asset\Repository $assetRepo * @param \Magento\Framework\View\FileSystem $viewFileSystem * @param \Magento\Framework\Config\FileIteratorFactory $fileIteratorFactory - * @param \Magento\Framework\Config\ViewFactory $viewFactory + * @param \Magento\Framework\Config\ViewFactory $viewConfigFactory * @param string $filename */ public function __construct( @@ -86,16 +89,16 @@ class Config implements \Magento\Framework\View\ConfigInterface \Magento\Framework\View\Asset\Repository $assetRepo, \Magento\Framework\View\FileSystem $viewFileSystem, \Magento\Framework\Config\FileIteratorFactory $fileIteratorFactory, - \Magento\Framework\Config\ViewFactory $viewFactory, + \Magento\Framework\Config\ViewFactory $viewConfigFactory, $filename = self::CONFIG_FILE_NAME ) { $this->moduleReader = $moduleReader; $this->rootDirectory = $filesystem->getDirectoryRead(DirectoryList::ROOT); $this->assetRepo = $assetRepo; $this->viewFileSystem = $viewFileSystem; - $this->filename = $filename; $this->fileIteratorFactory = $fileIteratorFactory; - $this->viewFactory = $viewFactory; + $this->viewConfigFactory = $viewConfigFactory; + $this->filename = $filename; } /** @@ -128,8 +131,7 @@ class Config implements \Magento\Framework\View\ConfigInterface $this->rootDirectory->getRelativePath($themeConfigFile) ); } - - $config = $this->viewFactory->create($configFiles); + $config = $this->viewConfigFactory->create($configFiles); $this->viewConfigs[$key] = $config; return $config; diff --git a/lib/internal/Magento/Framework/View/Design/Fallback/Rule/ModularSwitch.php b/lib/internal/Magento/Framework/View/Design/Fallback/Rule/ModularSwitch.php index 2be308824d6976dd0057a56702f5eeeb9483bec1..d583392026fb64966c7f33c2d47f32294c863aee 100644 --- a/lib/internal/Magento/Framework/View/Design/Fallback/Rule/ModularSwitch.php +++ b/lib/internal/Magento/Framework/View/Design/Fallback/Rule/ModularSwitch.php @@ -43,17 +43,13 @@ class ModularSwitch implements RuleInterface * * @param array $params * @return array - * @throws \InvalidArgumentException */ public function getPatternDirs(array $params) { - $isNamespaceDefined = isset($params['namespace']); - $isModuleDefined = isset($params['module']); - if ($isNamespaceDefined && $isModuleDefined) { + if (isset($params['module_name'])) { return $this->ruleModular->getPatternDirs($params); - } elseif (!$isNamespaceDefined && !$isModuleDefined) { + } else { return $this->ruleNonModular->getPatternDirs($params); } - throw new \InvalidArgumentException("Parameters 'namespace' and 'module' should either be both set or unset."); } } diff --git a/lib/internal/Magento/Framework/View/Design/Fallback/Rule/ModularSwitchFactory.php b/lib/internal/Magento/Framework/View/Design/Fallback/Rule/ModularSwitchFactory.php new file mode 100644 index 0000000000000000000000000000000000000000..191f73892a8dbd09634dacc924749f0930e0a88b --- /dev/null +++ b/lib/internal/Magento/Framework/View/Design/Fallback/Rule/ModularSwitchFactory.php @@ -0,0 +1,39 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Framework\View\Design\Fallback\Rule; + +use Magento\Framework\ObjectManagerInterface; + +class ModularSwitchFactory +{ + /** + * Object manager + * + * @var ObjectManagerInterface + */ + private $objectManager; + + /** + * Constructor + * + * @param ObjectManagerInterface $objectManager + */ + public function __construct(ObjectManagerInterface $objectManager) + { + $this->objectManager = $objectManager; + } + + /** + * Create rule instance + * + * @param array $data + * @return \Magento\Framework\View\Design\Fallback\Rule\Simple + */ + public function create(array $data = []) + { + return $this->objectManager->create('Magento\Framework\View\Design\Fallback\Rule\ModularSwitch', $data); + } +} diff --git a/lib/internal/Magento/Framework/View/Design/Fallback/Rule/Module.php b/lib/internal/Magento/Framework/View/Design/Fallback/Rule/Module.php new file mode 100644 index 0000000000000000000000000000000000000000..fe6e23dc46c62d8af767ee7e963df68b4777dbaf --- /dev/null +++ b/lib/internal/Magento/Framework/View/Design/Fallback/Rule/Module.php @@ -0,0 +1,64 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Framework\View\Design\Fallback\Rule; + +use Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrarInterface; + +/** + * Fallback Rule Module + * + * Propagates all parameters necessary for modular rule + */ +class Module implements RuleInterface +{ + /** + * Rule + * + * @var RuleInterface + */ + protected $rule; + + /** + * Component registrar + * + * @var ComponentRegistrarInterface + */ + private $componentRegistrar; + + /** + * Constructors + * + * @param RuleInterface $rule + * @param ComponentRegistrarInterface $componentRegistrar + */ + public function __construct(RuleInterface $rule, ComponentRegistrarInterface $componentRegistrar) + { + $this->rule = $rule; + $this->componentRegistrar = $componentRegistrar; + } + + /** + * Propagate parameters necessary for modular rule basing on module_name parameter + * + * @param array $params + * @return array + * @throws \InvalidArgumentException + */ + public function getPatternDirs(array $params) + { + if (!array_key_exists('module_name', $params)) { + throw new \InvalidArgumentException( + 'Required parameter "module_name" is not specified.' + ); + } + $params['module_dir'] = $this->componentRegistrar->getPath( + ComponentRegistrar::MODULE, + $params['module_name'] + ); + return $this->rule->getPatternDirs($params); + } +} diff --git a/lib/internal/Magento/Framework/View/Design/Fallback/Rule/ModuleFactory.php b/lib/internal/Magento/Framework/View/Design/Fallback/Rule/ModuleFactory.php new file mode 100644 index 0000000000000000000000000000000000000000..117072503387e1a1950d35b296eebde1f2b61f1d --- /dev/null +++ b/lib/internal/Magento/Framework/View/Design/Fallback/Rule/ModuleFactory.php @@ -0,0 +1,39 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Framework\View\Design\Fallback\Rule; + +use Magento\Framework\ObjectManagerInterface; + +class ModuleFactory +{ + /** + * Object manager + * + * @var ObjectManagerInterface + */ + private $objectManager; + + /** + * Constructor + * + * @param ObjectManagerInterface $objectManager + */ + public function __construct(ObjectManagerInterface $objectManager) + { + $this->objectManager = $objectManager; + } + + /** + * Create rule instance + * + * @param array $data + * @return \Magento\Framework\View\Design\Fallback\Rule\Simple + */ + public function create(array $data = []) + { + return $this->objectManager->create('Magento\Framework\View\Design\Fallback\Rule\Module', $data); + } +} diff --git a/lib/internal/Magento/Framework/View/Design/Fallback/Rule/Simple.php b/lib/internal/Magento/Framework/View/Design/Fallback/Rule/Simple.php index 01b62d86447dd27222c02b62960d1b95592b0189..61beff6750d8dd8922fa432d294bbecab7e5a38a 100644 --- a/lib/internal/Magento/Framework/View/Design/Fallback/Rule/Simple.php +++ b/lib/internal/Magento/Framework/View/Design/Fallback/Rule/Simple.php @@ -5,6 +5,10 @@ */ namespace Magento\Framework\View\Design\Fallback\Rule; +use Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrarInterface; +use Magento\Framework\Module\Dir\Reader; + /** * Class with simple substitution parameters to values */ @@ -30,8 +34,10 @@ class Simple implements RuleInterface * @param string $pattern * @param array $optionalParams */ - public function __construct($pattern, array $optionalParams = []) - { + public function __construct( + $pattern, + array $optionalParams = [] + ) { $this->pattern = $pattern; $this->optionalParams = $optionalParams; } diff --git a/lib/internal/Magento/Framework/View/Design/Fallback/Rule/SimpleFactory.php b/lib/internal/Magento/Framework/View/Design/Fallback/Rule/SimpleFactory.php new file mode 100644 index 0000000000000000000000000000000000000000..b40b6ba85a48a7d930f724e5b103272c1b183281 --- /dev/null +++ b/lib/internal/Magento/Framework/View/Design/Fallback/Rule/SimpleFactory.php @@ -0,0 +1,35 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Framework\View\Design\Fallback\Rule; + +use Magento\Framework\ObjectManagerInterface; + +class SimpleFactory +{ + /** + * @var ObjectManagerInterface + */ + private $objectManager; + + /** + * @param ObjectManagerInterface $objectManager + */ + public function __construct(ObjectManagerInterface $objectManager) + { + $this->objectManager = $objectManager; + } + + /** + * Create rule instance + * + * @param array $data + * @return \Magento\Framework\View\Design\Fallback\Rule\Simple + */ + public function create(array $data = []) + { + return $this->objectManager->create('Magento\Framework\View\Design\Fallback\Rule\Simple', $data); + } +} diff --git a/lib/internal/Magento/Framework/View/Design/Fallback/Rule/Theme.php b/lib/internal/Magento/Framework/View/Design/Fallback/Rule/Theme.php index a123d90df9b01497d6d9147ed7b92965f56ce16b..fe130a0dd4b6f1cc8363d273de8d05d2f67297a1 100644 --- a/lib/internal/Magento/Framework/View/Design/Fallback/Rule/Theme.php +++ b/lib/internal/Magento/Framework/View/Design/Fallback/Rule/Theme.php @@ -5,6 +5,8 @@ */ namespace Magento\Framework\View\Design\Fallback\Rule; +use Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrarInterface; use Magento\Framework\View\Design\ThemeInterface; /** @@ -21,14 +23,23 @@ class Theme implements RuleInterface */ protected $rule; + /** + * Component registrar + * + * @var ComponentRegistrarInterface + */ + private $componentRegistrar; + /** * Constructors * * @param RuleInterface $rule + * @param ComponentRegistrarInterface $componentRegistrar */ - public function __construct(RuleInterface $rule) + public function __construct(RuleInterface $rule, ComponentRegistrarInterface $componentRegistrar) { $this->rule = $rule; + $this->componentRegistrar = $componentRegistrar; } /** @@ -50,8 +61,11 @@ class Theme implements RuleInterface $theme = $params['theme']; unset($params['theme']); while ($theme) { - if ($theme->getThemePath()) { - $params['theme_path'] = $theme->getThemePath(); + if ($theme->getFullPath()) { + $params['theme_dir'] = $this->componentRegistrar->getPath( + ComponentRegistrar::THEME, + $theme->getFullPath() + ); $result = array_merge($result, $this->rule->getPatternDirs($params)); } $theme = $theme->getParentTheme(); diff --git a/lib/internal/Magento/Framework/View/Design/Fallback/Rule/ThemeFactory.php b/lib/internal/Magento/Framework/View/Design/Fallback/Rule/ThemeFactory.php new file mode 100644 index 0000000000000000000000000000000000000000..f13a1dc813b07e31332803a4bcd2d99e9315c8ce --- /dev/null +++ b/lib/internal/Magento/Framework/View/Design/Fallback/Rule/ThemeFactory.php @@ -0,0 +1,35 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Framework\View\Design\Fallback\Rule; + +use Magento\Framework\ObjectManagerInterface; + +class ThemeFactory +{ + /** + * @var ObjectManagerInterface + */ + private $objectManager; + + /** + * @param ObjectManagerInterface $objectManager + */ + public function __construct(ObjectManagerInterface $objectManager) + { + $this->objectManager = $objectManager; + } + + /** + * Create rule instance + * + * @param array $data + * @return \Magento\Framework\View\Design\Fallback\Rule\Theme + */ + public function create(array $data = []) + { + return $this->objectManager->create('Magento\Framework\View\Design\Fallback\Rule\Theme', $data); + } +} diff --git a/lib/internal/Magento/Framework/View/Design/Fallback/RulePool.php b/lib/internal/Magento/Framework/View/Design/Fallback/RulePool.php index 6280e1c5288c5af5f26b94021f0ff4a0b779ae6c..f6a146ab2e60213422eb8f0564c43f8e4d552e28 100644 --- a/lib/internal/Magento/Framework/View/Design/Fallback/RulePool.php +++ b/lib/internal/Magento/Framework/View/Design/Fallback/RulePool.php @@ -7,12 +7,8 @@ namespace Magento\Framework\View\Design\Fallback; use Magento\Framework\App\Filesystem\DirectoryList; -use Magento\Framework\Filesystem; use Magento\Framework\View\Design\Fallback\Rule\Composite; -use Magento\Framework\View\Design\Fallback\Rule\ModularSwitch; use Magento\Framework\View\Design\Fallback\Rule\RuleInterface; -use Magento\Framework\View\Design\Fallback\Rule\Simple; -use Magento\Framework\View\Design\Fallback\Rule\Theme; /** * Fallback Factory @@ -34,23 +30,66 @@ class RulePool /** * File system * - * @var Filesystem + * @var \Magento\Framework\Filesystem */ protected $filesystem; /** + * Rules + * * @var array */ private $rules = []; + /** + * Factory for simple rule + * + * @var \Magento\Framework\View\Design\Fallback\Rule\SimpleFactory + */ + private $simpleFactory; + + /** + * Factory for theme rule + * + * @var Rule\ThemeFactory + */ + private $themeFactory; + + /** + * Factory for modular switcher + * + * @var Rule\ModularSwitchFactory + */ + private $modularSwitchFactory; + + /** + * Factory for module rule + * + * @var Rule\ModuleFactory + */ + private $moduleFactory; + /** * Constructor * - * @param Filesystem $filesystem + * @param \Magento\Framework\Filesystem $filesystem + * @param Rule\SimpleFactory $simpleFactory + * @param Rule\ThemeFactory $themeFactory + * @param Rule\ModuleFactory $moduleFactory + * @param Rule\ModularSwitchFactory $modularSwitchFactory */ - public function __construct(Filesystem $filesystem) - { + public function __construct( + \Magento\Framework\Filesystem $filesystem, + Rule\SimpleFactory $simpleFactory, + Rule\ThemeFactory $themeFactory, + Rule\ModuleFactory $moduleFactory, + Rule\ModularSwitchFactory $modularSwitchFactory + ) { $this->filesystem = $filesystem; + $this->simpleFactory = $simpleFactory; + $this->themeFactory = $themeFactory; + $this->moduleFactory = $moduleFactory; + $this->modularSwitchFactory = $modularSwitchFactory; } /** @@ -60,9 +99,8 @@ class RulePool */ protected function createLocaleFileRule() { - $themesDir = $this->filesystem->getDirectoryRead(DirectoryList::THEMES)->getAbsolutePath(); - return new Theme( - new Simple("$themesDir/<area>/<theme_path>") + return $this->themeFactory->create( + ['rule' => $this->simpleFactory->create(['pattern' => "<theme_dir>"])] ); } @@ -73,19 +111,24 @@ class RulePool */ protected function createTemplateFileRule() { - $themesDir = $this->filesystem->getDirectoryRead(DirectoryList::THEMES)->getAbsolutePath(); - $modulesDir = $this->filesystem->getDirectoryRead(DirectoryList::MODULES)->getAbsolutePath(); - return new ModularSwitch( - new Theme( - new Simple("$themesDir/<area>/<theme_path>/templates") + return $this->modularSwitchFactory->create( + ['ruleNonModular' => + $this->themeFactory->create( + ['rule' => $this->simpleFactory->create(['pattern' => "<theme_dir>/templates"])] ), - new Composite( + 'ruleModular' => new Composite( [ - new Theme(new Simple("$themesDir/<area>/<theme_path>/<namespace>_<module>/templates")), - new Simple("$modulesDir/<namespace>/<module>/view/<area>/templates"), - new Simple("$modulesDir/<namespace>/<module>/view/base/templates"), + $this->themeFactory->create( + ['rule' => $this->simpleFactory->create(['pattern' => "<theme_dir>/<module_name>/templates"])] + ), + $this->moduleFactory->create( + ['rule' => $this->simpleFactory->create(['pattern' => "<module_dir>/view/<area>/templates"])] + ), + $this->moduleFactory->create( + ['rule' => $this->simpleFactory->create(['pattern' => "<module_dir>/view/base/templates"])] + ), ] - ) + )] ); } @@ -96,17 +139,23 @@ class RulePool */ protected function createFileRule() { - $themesDir = $this->filesystem->getDirectoryRead(DirectoryList::THEMES)->getAbsolutePath(); - $modulesDir = $this->filesystem->getDirectoryRead(DirectoryList::MODULES)->getAbsolutePath(); - return new ModularSwitch( - new Theme(new Simple("$themesDir/<area>/<theme_path>")), - new Composite( + return $this->modularSwitchFactory->create( + ['ruleNonModular' => $this->themeFactory->create( + ['rule' => $this->simpleFactory->create(['pattern' => "<theme_dir>"])] + ), + 'ruleModular' => new Composite( [ - new Theme(new Simple("$themesDir/<area>/<theme_path>/<namespace>_<module>")), - new Simple("$modulesDir/<namespace>/<module>/view/<area>"), - new Simple("{$modulesDir}/<namespace>/<module>/view/base"), + $this->themeFactory->create( + ['rule' => $this->simpleFactory->create(['pattern' => "<theme_dir>/<module_name>"])] + ), + $this->moduleFactory->create( + ['rule' => $this->simpleFactory->create(['pattern' => "<module_dir>/view/<area>"])] + ), + $this->moduleFactory->create( + ['rule' => $this->simpleFactory->create(['pattern' => "<module_dir>/view/base"])] + ), ] - ) + )] ); } @@ -117,48 +166,69 @@ class RulePool */ protected function createViewFileRule() { - $themesDir = rtrim($this->filesystem->getDirectoryRead(DirectoryList::THEMES)->getAbsolutePath(), '/'); - $modulesDir = rtrim($this->filesystem->getDirectoryRead(DirectoryList::MODULES)->getAbsolutePath(), '/'); $libDir = rtrim($this->filesystem->getDirectoryRead(DirectoryList::LIB_WEB)->getAbsolutePath(), '/'); - return new ModularSwitch( - new Composite( + return $this->modularSwitchFactory->create( + ['ruleNonModular' => new Composite( [ - new Theme( + $this->themeFactory->create( + ['rule' => new Composite( [ - new Simple("$themesDir/<area>/<theme_path>/web/i18n/<locale>", ['locale']), - new Simple("$themesDir/<area>/<theme_path>/web"), + $this->simpleFactory + ->create([ + 'pattern' => "<theme_dir>/web/i18n/<locale>", + 'optionalParams' => ['locale'] + ]), + $this->simpleFactory + ->create(['pattern' => "<theme_dir>/web"]) ] - ) + )] ), - new Simple($libDir), + $this->simpleFactory->create(['pattern' => $libDir]), ] ), - new Composite( + 'ruleModular' => new Composite( [ - new Theme( + $this->themeFactory->create( + ['rule' => new Composite( [ - new Simple( - "$themesDir/<area>/<theme_path>/<namespace>_<module>/web/i18n/<locale>", - ['locale'] + $this->simpleFactory->create( + [ + 'pattern' => "<theme_dir>/<module_name>/web/i18n/<locale>", + 'optionalParams' => ['locale'], + ] ), - new Simple("$themesDir/<area>/<theme_path>/<namespace>_<module>/web"), + $this->simpleFactory->create( + ['pattern' => "<theme_dir>/<module_name>/web"] + ), + ] + )] + ), + $this->moduleFactory->create( + ['rule' => $this->simpleFactory->create( + [ + 'pattern' => "<module_dir>/view/<area>/web/i18n/<locale>", + 'optionalParams' => ['locale'] ] - ) + )] ), - new Simple( - "$modulesDir/<namespace>/<module>/view/<area>/web/i18n/<locale>", - ['locale'] + $this->moduleFactory->create( + ['rule' => $this->simpleFactory->create( + [ + 'pattern' => "<module_dir>/view/base/web/i18n/<locale>", + 'optionalParams' => ['locale'] + ] + )] ), - new Simple( - "$modulesDir/<namespace>/<module>/view/base/web/i18n/<locale>", - ['locale'] + $this->moduleFactory->create( + ['rule' => $this->simpleFactory->create(['pattern' => "<module_dir>/view/<area>/web"])] + ), + $this->moduleFactory->create( + ['rule' => $this->simpleFactory->create(['pattern' => "<module_dir>/view/base/web"])] ), - new Simple("$modulesDir/<namespace>/<module>/view/<area>/web"), - new Simple("{$modulesDir}/<namespace>/<module>/view/base/web"), ] - ) + )] ); } @@ -171,17 +241,24 @@ class RulePool */ protected function createEmailTemplateFileRule() { - $themesDir = rtrim($this->filesystem->getDirectoryRead(DirectoryList::THEMES)->getAbsolutePath(), '/'); - $modulesDir = rtrim($this->filesystem->getDirectoryRead(DirectoryList::MODULES)->getAbsolutePath(), '/'); return new Composite( [ - new Theme(new Simple("$themesDir/<area>/<theme_path>/<namespace>_<module>/email")), - new Simple("$modulesDir/<namespace>/<module>/view/<area>/email"), + $this->themeFactory->create( + ['rule' => + $this->simpleFactory->create( + ['pattern' => "<theme_dir>/<module_name>/email"] + )] + ), + $this->moduleFactory->create( + ['rule' => $this->simpleFactory->create(['pattern' => "<module_dir>/view/<area>/email"])] + ), ] ); } /** + * Get rule by type + * * @param string $type * @return RuleInterface * @throws \InvalidArgumentException diff --git a/lib/internal/Magento/Framework/View/Design/FileResolution/Fallback/Resolver/Simple.php b/lib/internal/Magento/Framework/View/Design/FileResolution/Fallback/Resolver/Simple.php index 89f5f45fd1ba3d07bcb823889c316e13cf2dae8d..3524480c270994c8240edaa3fcebac7d893334f9 100644 --- a/lib/internal/Magento/Framework/View/Design/FileResolution/Fallback/Resolver/Simple.php +++ b/lib/internal/Magento/Framework/View/Design/FileResolution/Fallback/Resolver/Simple.php @@ -20,6 +20,8 @@ use Magento\Framework\View\Design\ThemeInterface; class Simple implements Fallback\ResolverInterface { /** + * Root directory + * * @var ReadInterface */ protected $rootDirectory; @@ -57,7 +59,7 @@ class Simple implements Fallback\ResolverInterface } } if (!empty($module)) { - list($params['namespace'], $params['module']) = explode('_', $module, 2); + $params['module_name'] = $module; } $path = $this->resolveFile($this->rulePool->getRule($type), $file, $params); diff --git a/lib/internal/Magento/Framework/View/Design/Theme/Customization/Path.php b/lib/internal/Magento/Framework/View/Design/Theme/Customization/Path.php index 124841f38a78773bf2d395b4a300d78c40592723..a6c2a6b44ec0359e735d62bb06a1c194d6f9abf4 100644 --- a/lib/internal/Magento/Framework/View/Design/Theme/Customization/Path.php +++ b/lib/internal/Magento/Framework/View/Design/Theme/Customization/Path.php @@ -3,13 +3,11 @@ * Copyright © 2015 Magento. All rights reserved. * See COPYING.txt for license details. */ - -/** - * Theme Customization Path - */ namespace Magento\Framework\View\Design\Theme\Customization; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrarInterface; /** * Theme Customization Path @@ -43,26 +41,28 @@ class Path protected $mediaDirectoryRead; /** - * Theme directory read + * Component registrar * - * @var \Magento\Framework\Filesystem\Directory\Read + * @var ComponentRegistrarInterface */ - protected $themeDirectoryRead; + private $componentRegistrar; /** * Constructor * * @param \Magento\Framework\Filesystem $filesystem + * @param ComponentRegistrarInterface $componentRegistrar * @param string $filename */ public function __construct( \Magento\Framework\Filesystem $filesystem, + ComponentRegistrarInterface $componentRegistrar, $filename = \Magento\Framework\View\ConfigInterface::CONFIG_FILE_NAME ) { $this->filesystem = $filesystem; $this->filename = $filename; $this->mediaDirectoryRead = $this->filesystem->getDirectoryRead(DirectoryList::MEDIA); - $this->themeDirectoryRead = $this->filesystem->getDirectoryRead(DirectoryList::THEMES); + $this->componentRegistrar = $componentRegistrar; } /** @@ -90,7 +90,7 @@ class Path { $path = null; if ($theme->getFullPath()) { - $path = $this->themeDirectoryRead->getAbsolutePath($theme->getFullPath()); + $path = $this->componentRegistrar->getPath(ComponentRegistrar::THEME, $theme->getFullPath()); } return $path; } diff --git a/lib/internal/Magento/Framework/View/Design/Theme/ThemePackage.php b/lib/internal/Magento/Framework/View/Design/Theme/ThemePackage.php new file mode 100644 index 0000000000000000000000000000000000000000..d5a54f19bc565279aa4c00624144dca74947e261 --- /dev/null +++ b/lib/internal/Magento/Framework/View/Design/Theme/ThemePackage.php @@ -0,0 +1,121 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Framework\View\Design\Theme; + +use Magento\Framework\Config\Theme; + +/** + * Value-object for a theme package + */ +class ThemePackage +{ + /** + * Area + * + * @var string + */ + private $area; + + /** + * Vendor name + * + * @var string + */ + private $vendor; + + /** + * Theme name + * + * @var string + */ + private $name; + + /** + * Theme path key + * + * @var string + */ + private $key; + + /** + * Full path to the theme + * + * @var string + */ + private $path; + + /** + * Constructor + * + * @param string $key + * @param string $path + */ + public function __construct($key, $path) + { + $keyParts = explode(Theme::THEME_PATH_SEPARATOR, $key); + if (count($keyParts) != 3) { + throw new \UnexpectedValueException( + "Theme's key does not correspond to required format: '<area>/<vendor>/<name>'" + ); + } + + $this->key = $key; + $this->path = $path; + $this->area = $keyParts[0]; + $this->vendor = $keyParts[1]; + $this->name = $keyParts[2]; + } + + /** + * Get area + * + * @return string + */ + public function getArea() + { + return $this->area; + } + + /** + * Get vendor name + * + * @return string + */ + public function getVendor() + { + return $this->vendor; + } + + /** + * Get theme name + * + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Get path key + * + * @return string + */ + public function getKey() + { + return $this->key; + } + + /** + * Get full path + * + * @return string + */ + public function getPath() + { + return $this->path; + } +} diff --git a/lib/internal/Magento/Framework/View/Design/Theme/ThemePackageFactory.php b/lib/internal/Magento/Framework/View/Design/Theme/ThemePackageFactory.php new file mode 100644 index 0000000000000000000000000000000000000000..7bea2509dfeba1c1dd3bd142a6b54d3eff933d7a --- /dev/null +++ b/lib/internal/Magento/Framework/View/Design/Theme/ThemePackageFactory.php @@ -0,0 +1,27 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Framework\View\Design\Theme; + +use Magento\Framework\View\Design\Theme\ThemePackage; + +/** + * Factory for theme packages + */ +class ThemePackageFactory +{ + /** + * Create an instance of ThemePackage + * + * @param string $key + * @param string $path + * + * @return ThemePackage + */ + public function create($key, $path) + { + return new ThemePackage($key, $path); + } +} diff --git a/lib/internal/Magento/Framework/View/Design/Theme/ThemePackageList.php b/lib/internal/Magento/Framework/View/Design/Theme/ThemePackageList.php new file mode 100644 index 0000000000000000000000000000000000000000..6d27d2745a82c5c9bd8bc3af4403fdff85942016 --- /dev/null +++ b/lib/internal/Magento/Framework/View/Design/Theme/ThemePackageList.php @@ -0,0 +1,71 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Framework\View\Design\Theme; + +use Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrarInterface; + +/** + * List of theme package value objects + */ +class ThemePackageList +{ + /** + * Component registrar + * + * @var ComponentRegistrarInterface + */ + private $componentRegistrar; + + /** + * Factory for ThemePackage + * + * @var ThemePackageFactory + */ + private $factory; + + /** + * Constructor + * + * @param ComponentRegistrarInterface $componentRegistrar + * @param ThemePackageFactory $factory + */ + public function __construct(ComponentRegistrarInterface $componentRegistrar, ThemePackageFactory $factory) + { + $this->componentRegistrar = $componentRegistrar; + $this->factory = $factory; + } + + /** + * Get theme by path key + * + * @param string $key + * @return ThemePackage + * @throws \UnexpectedValueException + */ + public function getTheme($key) + { + $themePath = $this->componentRegistrar->getPath(ComponentRegistrar::THEME, $key); + if (empty($themePath)) { + throw new \UnexpectedValueException("No theme registered with name '$key'"); + } + return $this->factory->create($key, $themePath); + } + + /** + * Get all themes + * + * @return ThemePackage[] + */ + public function getThemes() + { + $themes = []; + foreach ($this->componentRegistrar->getPaths(ComponentRegistrar::THEME) as $key => $path) { + $themes[$key] = $this->factory->create($key, $path); + } + return $themes; + } +} diff --git a/lib/internal/Magento/Framework/View/DesignInterface.php b/lib/internal/Magento/Framework/View/DesignInterface.php index 181a652204f47218868521e9e1cae9daa5835114..bc449355b6c4f6642031080efd973e5e9d00d22e 100644 --- a/lib/internal/Magento/Framework/View/DesignInterface.php +++ b/lib/internal/Magento/Framework/View/DesignInterface.php @@ -32,7 +32,6 @@ interface DesignInterface * * @param string $area * @return DesignInterface - * @deprecated * @TODO MAGETWO-31474: Remove deprecated method setArea */ public function setArea($area); diff --git a/lib/internal/Magento/Framework/View/Element/Template/File/Validator.php b/lib/internal/Magento/Framework/View/Element/Template/File/Validator.php index 101bae7ad7037e583c6d4cbac150402068d1326e..e2da1ee344aa27bc4ac7f2443ec40def14b2f2f2 100644 --- a/lib/internal/Magento/Framework/View/Element/Template/File/Validator.php +++ b/lib/internal/Magento/Framework/View/Element/Template/File/Validator.php @@ -6,6 +6,7 @@ namespace Magento\Framework\View\Element\Template\File; use \Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Component\ComponentRegistrar; /** * Class Validator @@ -72,17 +73,19 @@ class Validator * * @param \Magento\Framework\Filesystem $filesystem * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfigInterface + * @param ComponentRegistrar $componentRegistrar * @param string|null $scope */ public function __construct( \Magento\Framework\Filesystem $filesystem, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfigInterface, + ComponentRegistrar $componentRegistrar, $scope = null ) { $this->_filesystem = $filesystem; $this->_isAllowSymlinks = $scopeConfigInterface->getValue(self::XML_PATH_TEMPLATE_ALLOW_SYMLINK, $scope); - $this->_themesDir = $this->_filesystem->getDirectoryRead(DirectoryList::THEMES)->getAbsolutePath(); - $this->_appDir = $this->_filesystem->getDirectoryRead(DirectoryList::APP)->getAbsolutePath(); + $this->_themesDir = $componentRegistrar->getPaths(ComponentRegistrar::THEME); + $this->moduleDirs = $componentRegistrar->getPaths(ComponentRegistrar::MODULE); $this->_compiledDir = $this->_filesystem->getDirectoryRead(DirectoryList::TEMPLATE_MINIFICATION_DIR) ->getAbsolutePath(); } @@ -103,10 +106,10 @@ class Validator $filename = str_replace('\\', '/', $filename); if (!isset($this->_templatesValidationResults[$filename])) { $this->_templatesValidationResults[$filename] = - ($this->isPathInDirectory($filename, $this->_compiledDir) - || $this->isPathInDirectory($filename, $this->_appDir) - || $this->isPathInDirectory($filename, $this->_themesDir) - || $this->_isAllowSymlinks) + ($this->isPathInDirectories($filename, $this->_compiledDir) + || $this->isPathInDirectories($filename, $this->moduleDirs) + || $this->isPathInDirectories($filename, $this->_themesDir) + || $this->_isAllowSymlinks) && $this->getRootDirectory()->isFile($this->getRootDirectory()->getRelativePath($filename)); } return $this->_templatesValidationResults[$filename]; @@ -116,12 +119,20 @@ class Validator * Checks whether path related to the directory * * @param string $path - * @param string $directory + * @param string|array $directories * @return bool */ - protected function isPathInDirectory($path, $directory) + protected function isPathInDirectories($path, $directories) { - return 0 === strpos($path, $directory); + if (!is_array($directories)) { + $directories = (array)$directories; + } + foreach ($directories as $directory) { + if (0 === strpos($path, $directory)) { + return true; + } + } + return false; } /** diff --git a/lib/internal/Magento/Framework/View/Element/UiComponent/Config/DomMerger.php b/lib/internal/Magento/Framework/View/Element/UiComponent/Config/DomMerger.php index 72b18bb610577f7218ef4615f0d7cde0cf3d421e..ae7107665b4ae8f8a96816ecd8560109e9081599 100644 --- a/lib/internal/Magento/Framework/View/Element/UiComponent/Config/DomMerger.php +++ b/lib/internal/Magento/Framework/View/Element/UiComponent/Config/DomMerger.php @@ -6,6 +6,7 @@ namespace Magento\Framework\View\Element\UiComponent\Config; use Magento\Framework\Config\Dom; +use Magento\Framework\Config\Dom\UrnResolver; use Magento\Framework\Module\Dir\Reader as DirectoryReader; /** @@ -56,32 +57,25 @@ class DomMerger implements DomMergerInterface /** * Build DOM with initial XML contents and specifying identifier attributes for merging * - * Format of $schemaFileType: array('etc', 'sql', 'data', 'i18n', 'view', 'Controller') - * Format of $schemaFileModule: 'Magento_XXXXX' - * Format of $schemaFileName: 'schema.xsd' + * Format of $schema: Absolute schema file path or URN * Format of $idAttributes: array('name', 'id') * Format of $contextXPath: array('/config/ui') * The path to ID attribute name should not include any attribute notations or modifiers -- only node names * - * @param string $schemaFileType - * @param string $schemaFileModule - * @param string $schemaFileName - * @param DirectoryReader $directoryReader + * @param UrnResolver $urnResolver + * @param string $schema Absolute schema file path or URN * @param bool $isMergeSimpleXMLElement * @param array $contextXPath * @param array $idAttributes */ public function __construct( - DirectoryReader $directoryReader, - $schemaFileType, - $schemaFileModule, - $schemaFileName, + UrnResolver $urnResolver, + $schema, $isMergeSimpleXMLElement = false, array $contextXPath = [], array $idAttributes = [] ) { - $this->schemaFilePath = $directoryReader->getModuleDir($schemaFileType, $schemaFileModule) . '/' - . trim($schemaFileName, '/'); + $this->schemaFilePath = $urnResolver->getRealPath($schema); $this->isMergeSimpleXMLElement = $isMergeSimpleXMLElement; $this->contextXPath = $contextXPath; $this->idAttributes = $idAttributes; @@ -324,7 +318,9 @@ class DomMerger implements DomMergerInterface if ($this->schemaFilePath) { $errors = $this->validateDomDocument($domDocument); if (count($errors)) { - throw new \Magento\Framework\Exception\LocalizedException(implode("\n", $errors)); + throw new \Magento\Framework\Exception\LocalizedException( + new \Magento\Framework\Phrase(implode("\n", $errors)) + ); } } @@ -344,18 +340,7 @@ class DomMerger implements DomMergerInterface $schemaFilePath = $schemaFilePath !== null ? $schemaFilePath : $this->schemaFilePath; libxml_use_internal_errors(true); try { - $result = $domDocument->schemaValidate($schemaFilePath); - $errors = []; - if (!$result) { - $validationErrors = libxml_get_errors(); - if (count($validationErrors)) { - foreach ($validationErrors as $error) { - $errors[] = $this->renderErrorMessage($error, static::ERROR_FORMAT_DEFAULT); - } - } else { - $errors[] = 'Unknown validation error'; - } - } + $errors = \Magento\Framework\Config\Dom::validateDomDocument($domDocument, $schemaFilePath); } catch (\Exception $exception) { libxml_use_internal_errors(false); throw $exception; diff --git a/lib/internal/Magento/Framework/View/File/AbstractCollector.php b/lib/internal/Magento/Framework/View/File/AbstractCollector.php deleted file mode 100644 index 89fd9fad6efa05ed6b40607ade36f75693bff7d2..0000000000000000000000000000000000000000 --- a/lib/internal/Magento/Framework/View/File/AbstractCollector.php +++ /dev/null @@ -1,67 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Framework\View\File; - -use Magento\Framework\Filesystem; -use Magento\Framework\View\File\Factory as FileFactory; -use Magento\Framework\View\Helper\PathPattern as PathPatternHelper; -use Magento\Framework\App\Filesystem\DirectoryList; - -/** - * Abstract file collector - */ -abstract class AbstractCollector implements CollectorInterface -{ - /** - * @var \Magento\Framework\Filesystem\Directory\ReadInterface - */ - protected $directory; - - /** - * @var \Magento\Framework\View\File\Factory - */ - protected $fileFactory; - - /** - * @var \Magento\Framework\View\Helper\PathPattern - */ - protected $pathPatternHelper; - - /** - * @var string - */ - protected $subDir; - - /** - * Constructor - * - * @param \Magento\Framework\Filesystem $filesystem - * @param \Magento\Framework\View\File\Factory $fileFactory - * @param \Magento\Framework\View\Helper\PathPattern $pathPatternHelper - * @param string $subDir - */ - public function __construct( - Filesystem $filesystem, - FileFactory $fileFactory, - PathPatternHelper $pathPatternHelper, - $subDir = '' - ) { - $this->directory = $filesystem->getDirectoryRead($this->getScopeDirectory()); - $this->fileFactory = $fileFactory; - $this->pathPatternHelper = $pathPatternHelper; - $this->subDir = $subDir ? $subDir . '/' : ''; - } - - /** - * Get scope directory of this file collector - * - * @return string - */ - protected function getScopeDirectory() - { - return DirectoryList::MODULES; - } -} diff --git a/lib/internal/Magento/Framework/View/File/Collector/Base.php b/lib/internal/Magento/Framework/View/File/Collector/Base.php index 44ac685f092ae2e1ac722af3f2d76c7a845d2018..878f89c51c18bcba598e8ccbdbabd92d9f6b011d 100644 --- a/lib/internal/Magento/Framework/View/File/Collector/Base.php +++ b/lib/internal/Magento/Framework/View/File/Collector/Base.php @@ -5,14 +5,49 @@ */ namespace Magento\Framework\View\File\Collector; -use Magento\Framework\View\File\AbstractCollector; +use Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\DirSearch; use Magento\Framework\View\Design\ThemeInterface; +use Magento\Framework\View\File\CollectorInterface; +use Magento\Framework\View\File\Factory as FileFactory; /** * Source of base files introduced by modules */ -class Base extends AbstractCollector +class Base implements CollectorInterface { + /** + * @var DirSearch + */ + protected $componentDirSearch; + + /** + * @var string + */ + private $subDir; + + /** + * @var FileFactory + */ + private $fileFactory; + + /** + * Constructor + * + * @param DirSearch $dirSearch + * @param FileFactory $fileFactory + * @param string $subDir + */ + public function __construct( + DirSearch $dirSearch, + FileFactory $fileFactory, + $subDir = '' + ) { + $this->componentDirSearch = $dirSearch; + $this->fileFactory = $fileFactory; + $this->subDir = $subDir ? $subDir . '/' : ''; + } + /** * Retrieve files * @@ -23,29 +58,20 @@ class Base extends AbstractCollector public function getFiles(ThemeInterface $theme, $filePath) { $result = []; - $namespace = $module = '*'; - $sharedFiles = $this->directory->search("{$namespace}/{$module}/view/base/{$this->subDir}{$filePath}"); - - $filePathPtn = $this->pathPatternHelper->translatePatternFromGlob($filePath); - $pattern = "#(?<namespace>[^/]+)/(?<module>[^/]+)/view/base/{$this->subDir}" . $filePathPtn . "$#i"; + $sharedFiles = $this->componentDirSearch->collectFilesWithContext( + ComponentRegistrar::MODULE, + "view/base/{$this->subDir}{$filePath}" + ); foreach ($sharedFiles as $file) { - $filename = $this->directory->getAbsolutePath($file); - if (!preg_match($pattern, $filename, $matches)) { - continue; - } - $moduleFull = "{$matches['namespace']}_{$matches['module']}"; - $result[] = $this->fileFactory->create($filename, $moduleFull, null, true); + $result[] = $this->fileFactory->create($file->getFullPath(), $file->getComponentName(), null, true); } $area = $theme->getData('area'); - $themeFiles = $this->directory->search("{$namespace}/{$module}/view/{$area}/{$this->subDir}{$filePath}"); - $pattern = "#(?<namespace>[^/]+)/(?<module>[^/]+)/view/{$area}/{$this->subDir}" . $filePathPtn . "$#i"; + $themeFiles = $this->componentDirSearch->collectFilesWithContext( + ComponentRegistrar::MODULE, + "view/{$area}/{$this->subDir}{$filePath}" + ); foreach ($themeFiles as $file) { - $filename = $this->directory->getAbsolutePath($file); - if (!preg_match($pattern, $filename, $matches)) { - continue; - } - $moduleFull = "{$matches['namespace']}_{$matches['module']}"; - $result[] = $this->fileFactory->create($filename, $moduleFull); + $result[] = $this->fileFactory->create($file->getFullPath(), $file->getComponentName()); } return $result; } diff --git a/lib/internal/Magento/Framework/View/File/Collector/Override/Base.php b/lib/internal/Magento/Framework/View/File/Collector/Override/Base.php index 570982a270588d6cbc46cc579b1db67c6697dfc2..64919707e011175f6de9b81d5b37b801a4c0d2b3 100644 --- a/lib/internal/Magento/Framework/View/File/Collector/Override/Base.php +++ b/lib/internal/Magento/Framework/View/File/Collector/Override/Base.php @@ -5,19 +5,82 @@ */ namespace Magento\Framework\View\File\Collector\Override; -use Magento\Framework\View\File\AbstractCollector; +use Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrarInterface; +use Magento\Framework\Filesystem; +use Magento\Framework\Filesystem\Directory\ReadFactory; use Magento\Framework\View\Design\ThemeInterface; -use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\View\File\CollectorInterface; +use Magento\Framework\View\File\Factory as FileFactory; +use Magento\Framework\View\Helper\PathPattern; /** * Source of view files that explicitly override base files introduced by modules */ -class Base extends AbstractCollector +class Base implements CollectorInterface { + /** + * Pattern helper + * + * @var PathPattern + */ + private $pathPatternHelper; + + /** + * File factory + * + * @var FileFactory + */ + private $fileFactory; + + /** + * Directory factory + * + * @var ReadFactory + */ + private $readDirFactory; + + /** + * Component registrar + * + * @var ComponentRegistrarInterface + */ + private $componentRegistrar; + + /** + * Sub-directory path + * + * @var string + */ + private $subDir; + + /** + * Constructor + * + * @param FileFactory $fileFactory + * @param ReadFactory $readDirFactory + * @param ComponentRegistrarInterface $componentRegistrar + * @param PathPattern $pathPatternHelper + * @param string $subDir + */ + public function __construct( + FileFactory $fileFactory, + ReadFactory $readDirFactory, + ComponentRegistrarInterface $componentRegistrar, + PathPattern $pathPatternHelper, + $subDir = '' + ) { + $this->pathPatternHelper = $pathPatternHelper; + $this->fileFactory = $fileFactory; + $this->readDirFactory = $readDirFactory; + $this->componentRegistrar = $componentRegistrar; + $this->subDir = $subDir ? $subDir . '/' : ''; + } + /** * Retrieve files * - * @param \Magento\Framework\View\Design\ThemeInterface $theme + * @param ThemeInterface $theme * @param string $filePath * @return \Magento\Framework\View\File[] */ @@ -25,13 +88,21 @@ class Base extends AbstractCollector { $namespace = $module = '*'; $themePath = $theme->getFullPath(); - $searchPattern = "{$themePath}/{$namespace}_{$module}/{$this->subDir}{$filePath}"; - $files = $this->directory->search($searchPattern); + if (empty($themePath)) { + return []; + } + $themeAbsolutePath = $this->componentRegistrar->getPath(ComponentRegistrar::THEME, $themePath); + if (!$themeAbsolutePath) { + return []; + } + $themeDir = $this->readDirFactory->create($themeAbsolutePath); + $searchPattern = "{$namespace}_{$module}/{$this->subDir}{$filePath}"; + $files = $themeDir->search($searchPattern); $result = []; $pattern = "#(?<moduleName>[^/]+)/{$this->subDir}" . $this->pathPatternHelper->translatePatternFromGlob($filePath) . "$#i"; foreach ($files as $file) { - $filename = $this->directory->getAbsolutePath($file); + $filename = $themeDir->getAbsolutePath($file); if (!preg_match($pattern, $filename, $matches)) { continue; } @@ -39,14 +110,4 @@ class Base extends AbstractCollector } return $result; } - - /** - * Get scope directory of this file collector - * - * @return string - */ - protected function getScopeDirectory() - { - return DirectoryList::THEMES; - } } diff --git a/lib/internal/Magento/Framework/View/File/Collector/Override/ThemeModular.php b/lib/internal/Magento/Framework/View/File/Collector/Override/ThemeModular.php index 8059013958c9d73f02882acc5450ba585344a102..8fd580f48a87c3a39651df7bfe3a93e3ad120e37 100644 --- a/lib/internal/Magento/Framework/View/File/Collector/Override/ThemeModular.php +++ b/lib/internal/Magento/Framework/View/File/Collector/Override/ThemeModular.php @@ -5,20 +5,82 @@ */ namespace Magento\Framework\View\File\Collector\Override; -use Magento\Framework\View\File\AbstractCollector; +use Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrarInterface; +use Magento\Framework\Filesystem\Directory\ReadFactory; use Magento\Framework\View\Design\ThemeInterface; use Magento\Framework\Exception\LocalizedException; -use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\View\File\CollectorInterface; +use Magento\Framework\View\Helper\PathPattern; +use Magento\Framework\View\File\Factory as FileFactory; /** * Source of view files that explicitly override modular files of ancestor themes */ -class ThemeModular extends AbstractCollector +class ThemeModular implements CollectorInterface { + /** + * Path pattern helper + * + * @var \Magento\Framework\View\Helper\PathPattern + */ + private $pathPatternHelper; + + /** + * View file factopry + * + * @var FileFactory + */ + private $fileFactory; + + /** + * Read directory factory + * + * @var \Magento\Framework\Filesystem\Directory\ReadFactory + */ + private $readDirFactory; + + /** + * Component registrar + * + * @var ComponentRegistrarInterface + */ + private $componentRegistrar; + + /** + * Sub-directory path + * + * @var string + */ + private $subDir; + + /** + * Constructor + * + * @param FileFactory $fileFactory + * @param ReadFactory $readDirFactory + * @param ComponentRegistrarInterface $componentRegistrar + * @param PathPattern $pathPatternHelper + * @param string $subDir + */ + public function __construct( + FileFactory $fileFactory, + ReadFactory $readDirFactory, + ComponentRegistrarInterface $componentRegistrar, + PathPattern $pathPatternHelper, + $subDir = '' + ) { + $this->pathPatternHelper = $pathPatternHelper; + $this->fileFactory = $fileFactory; + $this->readDirFactory = $readDirFactory; + $this->componentRegistrar = $componentRegistrar; + $this->subDir = $subDir ? $subDir . '/' : ''; + } + /** * Retrieve files * - * @param \Magento\Framework\View\Design\ThemeInterface $theme + * @param ThemeInterface $theme * @param string $filePath * @return \Magento\Framework\View\File[] * @throws \Magento\Framework\Exception\LocalizedException @@ -27,9 +89,15 @@ class ThemeModular extends AbstractCollector { $namespace = $module = '*'; $themePath = $theme->getFullPath(); - $searchPattern = "{$themePath}/{$namespace}_{$module}/{$this->subDir}*/*/{$filePath}"; - $files = $this->directory->search($searchPattern); - + if (empty($themePath)) { + return []; + } + $themeAbsolutePath = $this->componentRegistrar->getPath(ComponentRegistrar::THEME, $themePath); + if (!$themeAbsolutePath) { + return []; + } + $themeDir = $this->readDirFactory->create($themeAbsolutePath); + $files = $themeDir->search("{$namespace}_{$module}/{$this->subDir}*/*/{$filePath}"); if (empty($files)) { return []; } @@ -43,7 +111,7 @@ class ThemeModular extends AbstractCollector $pattern = "#/(?<module>[^/]+)/{$this->subDir}(?<themeVendor>[^/]+)/(?<themeName>[^/]+)/" . $this->pathPatternHelper->translatePatternFromGlob($filePath) . "$#i"; foreach ($files as $file) { - $filename = $this->directory->getAbsolutePath($file); + $filename = $themeDir->getAbsolutePath($file); if (!preg_match($pattern, $filename, $matches)) { continue; } @@ -61,14 +129,4 @@ class ThemeModular extends AbstractCollector } return $result; } - - /** - * Get scope directory of this file collector - * - * @return string - */ - protected function getScopeDirectory() - { - return DirectoryList::THEMES; - } } diff --git a/lib/internal/Magento/Framework/View/File/Collector/Theme.php b/lib/internal/Magento/Framework/View/File/Collector/Theme.php index d9f1a53b4df1e6989c341d1f7f6ce423c39adf2b..b9d3d8ad283b4aec13c526254ff993a380607f0f 100644 --- a/lib/internal/Magento/Framework/View/File/Collector/Theme.php +++ b/lib/internal/Magento/Framework/View/File/Collector/Theme.php @@ -5,41 +5,64 @@ */ namespace Magento\Framework\View\File\Collector; -use Magento\Framework\View\File\AbstractCollector; +use Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrarInterface; +use Magento\Framework\Filesystem; +use Magento\Framework\Filesystem\Directory\ReadFactory; use Magento\Framework\View\Design\ThemeInterface; -use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\View\File\CollectorInterface; +use Magento\Framework\View\File\Factory as FileFactory; /** * Source of view files introduced by a theme */ -class Theme extends AbstractCollector +class Theme implements CollectorInterface { + /** + * Constructor + * + * @param FileFactory $fileFactory + * @param ReadFactory $readDirFactory + * @param ComponentRegistrarInterface $componentRegistrar + * @param string $subDir + */ + public function __construct( + FileFactory $fileFactory, + ReadFactory $readDirFactory, + ComponentRegistrarInterface $componentRegistrar, + $subDir = '' + ) { + $this->fileFactory = $fileFactory; + $this->readDirFactory = $readDirFactory; + $this->componentRegistrar = $componentRegistrar; + $this->subDir = $subDir ? $subDir . '/' : ''; + } + /** * Retrieve files * - * @param \Magento\Framework\View\Design\ThemeInterface $theme + * @param ThemeInterface $theme * @param string $filePath * @return \Magento\Framework\View\File[] + * @throws \UnexpectedValueException */ public function getFiles(ThemeInterface $theme, $filePath) { $themePath = $theme->getFullPath(); - $files = $this->directory->search("{$themePath}/{$this->subDir}{$filePath}"); + if (empty($themePath)) { + return []; + } + $themeAbsolutePath = $this->componentRegistrar->getPath(ComponentRegistrar::THEME, $themePath); + if (!$themeAbsolutePath) { + return []; + } + $themeDir = $this->readDirFactory->create($themeAbsolutePath); + $files = $themeDir->search($this->subDir . $filePath); $result = []; foreach ($files as $file) { - $filename = $this->directory->getAbsolutePath($file); + $filename = $themeDir->getAbsolutePath($file); $result[] = $this->fileFactory->create($filename, null, $theme); } return $result; } - - /** - * Get scope directory of this file collector - * - * @return string - */ - protected function getScopeDirectory() - { - return DirectoryList::THEMES; - } } diff --git a/lib/internal/Magento/Framework/View/File/Collector/ThemeModular.php b/lib/internal/Magento/Framework/View/File/Collector/ThemeModular.php index cbbc3afa466d13047740b908ddfbc277da375778..f2fa6d8df79cec917a013620fdb87c0148ac0eee 100644 --- a/lib/internal/Magento/Framework/View/File/Collector/ThemeModular.php +++ b/lib/internal/Magento/Framework/View/File/Collector/ThemeModular.php @@ -5,15 +5,67 @@ */ namespace Magento\Framework\View\File\Collector; -use Magento\Framework\View\File\AbstractCollector; +use Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrarInterface; +use Magento\Framework\Filesystem\Directory\ReadFactory; use Magento\Framework\View\Design\ThemeInterface; -use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\View\File\CollectorInterface; +use Magento\Framework\View\File\Factory as FileFactory; +use Magento\Framework\View\Helper\PathPattern; /** * Source of modular view files introduced by a theme */ -class ThemeModular extends AbstractCollector +class ThemeModular implements CollectorInterface { + /** + * @var PathPattern + */ + private $pathPatternHelper; + + /** + * @var FileFactory + */ + private $fileFactory; + + /** + * @var ReadFactory + */ + private $readDirFactory; + + /** + * @var ComponentRegistrarInterface + */ + private $componentRegistrar; + + /** + * @var string + */ + private $subDir; + + /** + * Constructor + * + * @param FileFactory $fileFactory + * @param ReadFactory $readDirFactory + * @param ComponentRegistrarInterface $componentRegistrar + * @param PathPattern $pathPatternHelper + * @param string $subDir + */ + public function __construct( + FileFactory $fileFactory, + ReadFactory $readDirFactory, + ComponentRegistrarInterface $componentRegistrar, + PathPattern $pathPatternHelper, + $subDir = '' + ) { + $this->pathPatternHelper = $pathPatternHelper; + $this->fileFactory = $fileFactory; + $this->readDirFactory = $readDirFactory; + $this->componentRegistrar = $componentRegistrar; + $this->subDir = $subDir ? $subDir . '/' : ''; + } + /** * Retrieve files * @@ -25,12 +77,20 @@ class ThemeModular extends AbstractCollector { $namespace = $module = '*'; $themePath = $theme->getFullPath(); - $files = $this->directory->search("{$themePath}/{$namespace}_{$module}/{$this->subDir}{$filePath}"); + if (empty($themePath)) { + return []; + } + $themeAbsolutePath = $this->componentRegistrar->getPath(ComponentRegistrar::THEME, $themePath); + if (!$themeAbsolutePath) { + return []; + } + $themeDir = $this->readDirFactory->create($themeAbsolutePath); + $files = $themeDir->search("{$namespace}_{$module}/{$this->subDir}$filePath"); $result = []; $pattern = "#/(?<moduleName>[^/]+)/{$this->subDir}" . $this->pathPatternHelper->translatePatternFromGlob($filePath) . "$#i"; foreach ($files as $file) { - $filename = $this->directory->getAbsolutePath($file); + $filename = $themeDir->getAbsolutePath($file); if (!preg_match($pattern, $filename, $matches)) { continue; } @@ -38,14 +98,4 @@ class ThemeModular extends AbstractCollector } return $result; } - - /** - * Get scope directory of this file collector - * - * @return string - */ - protected function getScopeDirectory() - { - return DirectoryList::THEMES; - } } diff --git a/lib/internal/Magento/Framework/View/Layout.php b/lib/internal/Magento/Framework/View/Layout.php index 9825140565fa7f4be0d7faa398c1b0b96c6c45da..649e957b8cc06189b65318f00a5f38ba4cefb98e 100755 --- a/lib/internal/Magento/Framework/View/Layout.php +++ b/lib/internal/Magento/Framework/View/Layout.php @@ -247,8 +247,6 @@ class Layout extends \Magento\Framework\Simplexml\Config implements \Magento\Fra /** * TODO Will be eliminated in MAGETWO-28359 - * - * @deprecated * @return void */ public function publicBuild() diff --git a/lib/internal/Magento/Framework/View/Layout/PageType/Config/SchemaLocator.php b/lib/internal/Magento/Framework/View/Layout/PageType/Config/SchemaLocator.php index 6d65479e651389b58d854843afe3a687bee0ca3a..ad8ce2cdb4a8faac44bcd81884a48e72d95bb91d 100644 --- a/lib/internal/Magento/Framework/View/Layout/PageType/Config/SchemaLocator.php +++ b/lib/internal/Magento/Framework/View/Layout/PageType/Config/SchemaLocator.php @@ -14,14 +14,14 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface * * @var string */ - protected $_schema = null; + protected $schema; /** - * Constructor + * @param \Magento\Framework\Config\Dom\UrnResolver $urnResolver */ - public function __construct() + public function __construct(\Magento\Framework\Config\Dom\UrnResolver $urnResolver) { - $this->_schema = realpath(__DIR__ . '/../../etc/page_types.xsd'); + $this->schema = $urnResolver->getRealPath('urn:magento:framework:View/Layout/etc/page_types.xsd'); } /** @@ -31,7 +31,7 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface */ public function getSchema() { - return $this->_schema; + return $this->schema; } /** @@ -41,6 +41,6 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface */ public function getPerFileSchema() { - return $this->_schema; + return $this->schema; } } diff --git a/lib/internal/Magento/Framework/View/Model/Layout/Merge.php b/lib/internal/Magento/Framework/View/Model/Layout/Merge.php index 95c51d545c726b8ab4d7b6cb050202ed6e4686fa..5adb074c2274a54b49d8086103b4428897b2a93b 100644 --- a/lib/internal/Magento/Framework/View/Model/Layout/Merge.php +++ b/lib/internal/Magento/Framework/View/Model/Layout/Merge.php @@ -5,8 +5,9 @@ */ namespace Magento\Framework\View\Model\Layout; +use Magento\Framework\Filesystem\DriverPool; +use Magento\Framework\Filesystem\File\ReadFactory; use Magento\Framework\View\Model\Layout\Update\Validator; -use Magento\Framework\App\Filesystem\DirectoryList; /** * Layout merge model @@ -115,11 +116,6 @@ class Merge implements \Magento\Framework\View\Layout\ProcessorInterface */ protected $logger; - /** - * @var \Magento\Framework\Filesystem - */ - protected $filesystem; - /** * @var string */ @@ -151,6 +147,11 @@ class Merge implements \Magento\Framework\View\Layout\ProcessorInterface */ protected $handleProcessed = 2; + /** + * @var ReadFactory + */ + private $readFactory; + /** * Init merge model * @@ -162,7 +163,7 @@ class Merge implements \Magento\Framework\View\Layout\ProcessorInterface * @param \Magento\Framework\Cache\FrontendInterface $cache * @param \Magento\Framework\View\Model\Layout\Update\Validator $validator * @param \Psr\Log\LoggerInterface $logger - * @param \Magento\Framework\Filesystem $filesystem + * @param ReadFactory $readFactory, * @param \Magento\Framework\View\Design\ThemeInterface $theme Non-injectable theme instance * @param string $cacheSuffix * @SuppressWarnings(PHPMD.ExcessiveParameterList) @@ -176,7 +177,7 @@ class Merge implements \Magento\Framework\View\Layout\ProcessorInterface \Magento\Framework\Cache\FrontendInterface $cache, \Magento\Framework\View\Model\Layout\Update\Validator $validator, \Psr\Log\LoggerInterface $logger, - \Magento\Framework\Filesystem $filesystem, + ReadFactory $readFactory, \Magento\Framework\View\Design\ThemeInterface $theme = null, $cacheSuffix = '' ) { @@ -188,7 +189,7 @@ class Merge implements \Magento\Framework\View\Layout\ProcessorInterface $this->cache = $cache; $this->layoutValidator = $validator; $this->logger = $logger; - $this->filesystem = $filesystem; + $this->readFactory = $readFactory; $this->cacheSuffix = $cacheSuffix; } @@ -678,11 +679,11 @@ class Merge implements \Magento\Framework\View\Layout\ProcessorInterface $theme = $this->_getPhysicalTheme($this->theme); $updateFiles = $this->fileSource->getFiles($theme, '*.xml'); $updateFiles = array_merge($updateFiles, $this->pageLayoutFileSource->getFiles($theme, '*.xml')); - $dir = $this->filesystem->getDirectoryRead(DirectoryList::ROOT); $useErrors = libxml_use_internal_errors(true); foreach ($updateFiles as $file) { - $filename = $dir->getRelativePath($file->getFilename()); - $fileStr = $dir->readFile($filename); + /** @var $fileReader \Magento\Framework\Filesystem\File\Read */ + $fileReader = $this->readFactory->create($file->getFilename(), DriverPool::FILE); + $fileStr = $fileReader->readAll($file->getName()); $fileStr = $this->_substitutePlaceholders($fileStr); /** @var $fileXml \Magento\Framework\View\Layout\Element */ $fileXml = $this->_loadXmlString($fileStr); diff --git a/lib/internal/Magento/Framework/View/Model/Layout/Update/Validator.php b/lib/internal/Magento/Framework/View/Model/Layout/Update/Validator.php index 8721ae0be6dd04eaf9fb611164ad99088e4ba4ec..71762e2566933e0c14079139935548457cac9aaa 100644 --- a/lib/internal/Magento/Framework/View/Model/Layout/Update/Validator.php +++ b/lib/internal/Magento/Framework/View/Model/Layout/Update/Validator.php @@ -5,7 +5,7 @@ */ namespace Magento\Framework\View\Model\Layout\Update; -use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Config\Dom\UrnResolver; /** * Validator for custom layout update @@ -56,20 +56,22 @@ class Validator extends \Zend_Validate_Abstract protected $_domConfigFactory; /** - * @param DirectoryList $dirList * @param \Magento\Framework\Config\DomFactory $domConfigFactory + * @param \Magento\Framework\Config\Dom\UrnResolver $urnResolver */ public function __construct( - DirectoryList $dirList, - \Magento\Framework\Config\DomFactory $domConfigFactory + \Magento\Framework\Config\DomFactory $domConfigFactory, + UrnResolver $urnResolver ) { $this->_domConfigFactory = $domConfigFactory; $this->_initMessageTemplates(); $this->_xsdSchemas = [ - self::LAYOUT_SCHEMA_PAGE_HANDLE => $dirList->getPath(DirectoryList::LIB_INTERNAL) - . '/Magento/Framework/View/Layout/etc/page_layout.xsd', - self::LAYOUT_SCHEMA_MERGED => $dirList->getPath(DirectoryList::LIB_INTERNAL) - . '/Magento/Framework/View/Layout/etc/layout_merged.xsd', + self::LAYOUT_SCHEMA_PAGE_HANDLE => $urnResolver->getRealPath( + 'urn:magento:framework:View/Layout/etc/page_layout.xsd' + ), + self::LAYOUT_SCHEMA_MERGED => $urnResolver->getRealPath( + 'urn:magento:framework:View/Layout/etc/layout_merged.xsd' + ), ]; } @@ -82,9 +84,15 @@ class Validator extends \Zend_Validate_Abstract { if (!$this->_messageTemplates) { $this->_messageTemplates = [ - self::HELPER_ARGUMENT_TYPE => (string)new \Magento\Framework\Phrase('Helper arguments should not be used in custom layout updates.'), - self::UPDATER_MODEL => (string)new \Magento\Framework\Phrase('Updater model should not be used in custom layout updates.'), - self::XML_INVALID => (string)new \Magento\Framework\Phrase('Please correct the XML data and try again. %value%'), + self::HELPER_ARGUMENT_TYPE => (string)new \Magento\Framework\Phrase( + 'Helper arguments should not be used in custom layout updates.' + ), + self::UPDATER_MODEL => (string)new \Magento\Framework\Phrase( + 'Updater model should not be used in custom layout updates.' + ), + self::XML_INVALID => (string)new \Magento\Framework\Phrase( + 'Please correct the XML data and try again. %value%' + ), ]; } return $this; diff --git a/lib/internal/Magento/Framework/View/Page/Config.php b/lib/internal/Magento/Framework/View/Page/Config.php index 1816c6a1b6d613243360a9fa7ba23829d62af2d1..45d47247212d3b82c1eb62b2d1e6ee022070485d 100644 --- a/lib/internal/Magento/Framework/View/Page/Config.php +++ b/lib/internal/Magento/Framework/View/Page/Config.php @@ -169,8 +169,6 @@ class Config /** * TODO Will be eliminated in MAGETWO-28359 - * - * @deprecated * @return void */ public function publicBuild() diff --git a/lib/internal/Magento/Framework/View/PageLayout/Config.php b/lib/internal/Magento/Framework/View/PageLayout/Config.php index a6c6d9eb411c13b9cae680bfa5902a0729469d9d..31279b31a061659df213c2b87e18c208a125a116 100644 --- a/lib/internal/Magento/Framework/View/PageLayout/Config.php +++ b/lib/internal/Magento/Framework/View/PageLayout/Config.php @@ -11,6 +11,22 @@ namespace Magento\Framework\View\PageLayout; */ class Config extends \Magento\Framework\Config\AbstractXml { + /** @var \Magento\Framework\Config\Dom\UrnResolver */ + protected $urnResolver; + + /** + * Instantiate with the list of files to merge + * + * @param \Magento\Framework\Config\Dom\UrnResolver $urnResolver + * @param array $configFiles + * @throws \InvalidArgumentException + */ + public function __construct($configFiles, \Magento\Framework\Config\Dom\UrnResolver $urnResolver) + { + $this->urnResolver = $urnResolver; + parent::__construct($configFiles); + } + /** * Get absolute path to the XML-schema file * @@ -18,7 +34,7 @@ class Config extends \Magento\Framework\Config\AbstractXml */ public function getSchemaFile() { - return __DIR__ . '/etc/layouts.xsd'; + return $this->urnResolver->getRealPath('urn:magento:framework:View/PageLayout/etc/layouts.xsd'); } /** diff --git a/lib/internal/Magento/Framework/View/TemplateEngine/Php.php b/lib/internal/Magento/Framework/View/TemplateEngine/Php.php index ffa80966efb32e761ee74f70db31beb759855036..62f4aba4b45be42fae693ddeb039442ccbcee15e 100644 --- a/lib/internal/Magento/Framework/View/TemplateEngine/Php.php +++ b/lib/internal/Magento/Framework/View/TemplateEngine/Php.php @@ -73,7 +73,6 @@ class Php implements TemplateEngineInterface * This is needed because the templates are included in the context of this engine * rather than in the context of the block. * - * @deprecated * @param string $method * @param array $args * @return mixed @@ -89,7 +88,6 @@ class Php implements TemplateEngineInterface * This is needed because the templates are included in the context of this engine rather than * in the context of the block. * - * @deprecated * @param string $name * @return bool */ @@ -104,7 +102,6 @@ class Php implements TemplateEngineInterface * This is needed because the templates are included in the context of this engine rather * than in the context of the block. * - * @deprecated * @param string $name * @return mixed */ diff --git a/lib/internal/Magento/Framework/View/Test/Unit/ConfigTest.php b/lib/internal/Magento/Framework/View/Test/Unit/ConfigTest.php index d62be05c31cdc21208835525084f4551907caf49..c6c980ee74c530e013a401b469dbde403ff6dc3d 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/ConfigTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/ConfigTest.php @@ -9,10 +9,6 @@ namespace Magento\Framework\View\Test\Unit; use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; -/** - * Class ConfigTest - * @SuppressWarnings(PHPMD.CouplingBetweenObjects) - */ class ConfigTest extends \PHPUnit_Framework_TestCase { /** @var \Magento\Framework\View\Config */ @@ -21,33 +17,29 @@ class ConfigTest extends \PHPUnit_Framework_TestCase /** @var ObjectManagerHelper */ protected $objectManagerHelper; - /** @var \Magento\Framework\Module\Dir\Reader|\PHPUnit_Framework_MockObject_MockObject */ + /** @var \Magento\Framework\Module\Dir\Reader | \PHPUnit_Framework_MockObject_MockObject */ protected $readerMock; - /** @var \Magento\Framework\Filesystem|\PHPUnit_Framework_MockObject_MockObject */ + /** @var \Magento\Framework\Filesystem | \PHPUnit_Framework_MockObject_MockObject */ protected $filesystemMock; - /** @var \Magento\Framework\View\Asset\Repository|\PHPUnit_Framework_MockObject_MockObject */ + /** @var \Magento\Framework\View\Asset\Repository | \PHPUnit_Framework_MockObject_MockObject */ protected $repositoryMock; - /** @var \Magento\Framework\View\FileSystem|\PHPUnit_Framework_MockObject_MockObject */ + /** @var \Magento\Framework\View\FileSystem | \PHPUnit_Framework_MockObject_MockObject */ protected $fileSystemMock; - /** @var \Magento\Framework\Config\FileIteratorFactory|\PHPUnit_Framework_MockObject_MockObject */ + /** @var \Magento\Framework\Config\FileIteratorFactory | \PHPUnit_Framework_MockObject_MockObject */ protected $fileIteratorFactoryMock; - /** @var \Magento\Framework\Filesystem\Directory\ReadInterface|\PHPUnit_Framework_MockObject_MockObject */ + /** @var \Magento\Framework\Filesystem\Directory\ReadInterface | \PHPUnit_Framework_MockObject_MockObject */ protected $directoryReadMock; - /** @var \Magento\Framework\Config\ViewFactory|\PHPUnit_Framework_MockObject_MockObject */ - protected $viewFactoryMock; - - /** @var \Magento\Framework\Config\View|\PHPUnit_Framework_MockObject_MockObject */ - protected $viewMock; - /** - * Set up + * @var \Magento\Framework\Config\ViewFactory | \PHPUnit_Framework_MockObject_MockObject */ + protected $viewConfigFactoryMock; + protected function setUp() { $this->readerMock = $this->getMock('Magento\Framework\Module\Dir\Reader', [], [], '', false); @@ -59,19 +51,14 @@ class ConfigTest extends \PHPUnit_Framework_TestCase ->will($this->returnValue($this->directoryReadMock)); $this->repositoryMock = $this->getMock('Magento\Framework\View\Asset\Repository', [], [], '', false); $this->fileSystemMock = $this->getMock('Magento\Framework\View\FileSystem', [], [], '', false); - $this->fileIteratorFactoryMock = $this->getMock('Magento\Framework\Config\FileIteratorFactory'); - $this->viewFactoryMock = $this->getMock( - 'Magento\Framework\Config\ViewFactory', - ['create'], + $this->fileIteratorFactoryMock = $this->getMock( + 'Magento\Framework\Config\FileIteratorFactory', + [], [], '', false ); - $this->viewMock = $this->getMock('Magento\Framework\Config\View', [], [], '', false); - $this->viewFactoryMock->expects($this->any()) - ->method('create') - ->willReturn($this->viewMock); - + $this->viewConfigFactoryMock = $this->getMock('Magento\Framework\Config\ViewFactory', [], [], '', false); $this->objectManagerHelper = new ObjectManagerHelper($this); $this->config = $this->objectManagerHelper->getObject( 'Magento\Framework\View\Config', @@ -81,14 +68,11 @@ class ConfigTest extends \PHPUnit_Framework_TestCase 'assetRepo' => $this->repositoryMock, 'viewFileSystem' => $this->fileSystemMock, 'fileIteratorFactory' => $this->fileIteratorFactoryMock, - 'viewFactory' => $this->viewFactoryMock + 'viewConfigFactory' => $this->viewConfigFactoryMock ] ); } - /** - * Test getViewConfig - */ public function testGetViewConfig() { $themeMock = $this->getMock( @@ -138,6 +122,11 @@ class ConfigTest extends \PHPUnit_Framework_TestCase ->method('readFile') ->with($this->equalTo($configFile)) ->will($this->returnValue($xmlData)); + $configViewMock = $this->getMock('Magento\Framework\Config\View', [], [], '', false); + $this->viewConfigFactoryMock->expects($this->once()) + ->method('create') + ->with([$configFile => $xmlData]) + ->willReturn($configViewMock); $this->assertInstanceOf('Magento\Framework\Config\View', $this->config->getViewConfig($params)); // lazy load test $this->assertInstanceOf('Magento\Framework\Config\View', $this->config->getViewConfig($params)); diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Design/Fallback/Rule/ModularSwitchTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Design/Fallback/Rule/ModularSwitchTest.php index 5b0126609792225b0f94d1cc754a19368d6523cc..8c644412b56a9cbac47e4a068742ea180a9bcf4f 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Design/Fallback/Rule/ModularSwitchTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Design/Fallback/Rule/ModularSwitchTest.php @@ -7,10 +7,6 @@ namespace Magento\Framework\View\Test\Unit\Design\Fallback\Rule; use \Magento\Framework\View\Design\Fallback\Rule\ModularSwitch; -/** - * ModularSwitch Test - * - */ class ModularSwitchTest extends \PHPUnit_Framework_TestCase { /** @@ -67,7 +63,7 @@ class ModularSwitchTest extends \PHPUnit_Framework_TestCase public function testGetPatternDirsModular() { - $inputParams = ['param' => 'value', 'namespace' => 'Magento', 'module' => 'Core']; + $inputParams = ['param' => 'value', 'module_name' => 'Magento_Core']; $expectedResult = new \stdClass(); $this->ruleNonModular->expects($this->never())->method('getPatternDirs'); @@ -83,26 +79,4 @@ class ModularSwitchTest extends \PHPUnit_Framework_TestCase $this->assertSame($expectedResult, $this->object->getPatternDirs($inputParams)); } - - /** - * @param array $inputParams - * @dataProvider getPatternDirsExceptionDataProvider - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Parameters 'namespace' and 'module' should either be both set or unset - */ - public function testGetPatternDirsException(array $inputParams) - { - $this->object->getPatternDirs($inputParams); - } - - /** - * @return array - */ - public function getPatternDirsExceptionDataProvider() - { - return [ - 'no namespace' => [['module' => 'Core']], - 'no module' => [['namespace' => 'Magento']] - ]; - } } diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Design/Fallback/Rule/ModuleTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Design/Fallback/Rule/ModuleTest.php new file mode 100644 index 0000000000000000000000000000000000000000..ccdb9eadd59bf8afde9fca5f59e14e33da727d65 --- /dev/null +++ b/lib/internal/Magento/Framework/View/Test/Unit/Design/Fallback/Rule/ModuleTest.php @@ -0,0 +1,63 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Framework\View\Test\Unit\Design\Fallback\Rule; + +use Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrarInterface; +use \Magento\Framework\View\Design\Fallback\Rule\Module; +use Magento\Framework\View\Design\Fallback\Rule\RuleInterface; + +class ModuleTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var RuleInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $rule; + + /** + * @var ComponentRegistrarInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $componentRegistrar; + + /** + * @var Module + */ + private $model; + + protected function setUp() + { + $this->rule = $this->getMockForAbstractClass('\Magento\Framework\View\Design\Fallback\Rule\RuleInterface'); + $this->componentRegistrar = $this->getMockForAbstractClass( + '\Magento\Framework\Component\ComponentRegistrarInterface' + ); + $this->model = new Module($this->rule, $this->componentRegistrar); + } + + /** + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage Required parameter "module_name" is not specified + */ + public function testGetPatternDirsException() + { + $this->model->getPatternDirs([]); + } + + public function testGetPatternDirs() + { + $expectedResult = ['path1', 'path2']; + $module = 'Some_Module'; + $modulePath = '/module/path'; + $this->componentRegistrar->expects($this->once()) + ->method('getPath') + ->with(ComponentRegistrar::MODULE, $module) + ->will($this->returnValue($modulePath)); + $this->rule->expects($this->once()) + ->method('getPatternDirs') + ->with(['module_name' => $module, 'module_dir' => $modulePath]) + ->will($this->returnValue($expectedResult)); + $this->assertEquals($expectedResult, $this->model->getPatternDirs(['module_name' => $module])); + } +} diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Design/Fallback/Rule/ThemeTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Design/Fallback/Rule/ThemeTest.php index 6009825e1c991883ecd2ec55e72aa29a0895d26c..e7215dbc8bae215589a654b41678a7758a799a2e 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Design/Fallback/Rule/ThemeTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Design/Fallback/Rule/ThemeTest.php @@ -5,56 +5,78 @@ */ namespace Magento\Framework\View\Test\Unit\Design\Fallback\Rule; +use Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrarInterface; +use Magento\Framework\View\Design\Fallback\Rule\RuleInterface; use \Magento\Framework\View\Design\Fallback\Rule\Theme; -/** - * Theme Test - * - */ class ThemeTest extends \PHPUnit_Framework_TestCase { + /** + * @var RuleInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $rule; + + /** + * @var ComponentRegistrarInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $componentRegistrar; + + /** + * @var Theme + */ + private $model; + + protected function setUp() + { + $this->rule = $this->getMockForAbstractClass('\Magento\Framework\View\Design\Fallback\Rule\RuleInterface'); + $this->componentRegistrar = $this->getMockForAbstractClass( + '\Magento\Framework\Component\ComponentRegistrarInterface' + ); + $this->model = new Theme($this->rule, $this->componentRegistrar); + } /** * @expectedException \InvalidArgumentException * @expectedExceptionMessage Parameter "theme" should be specified and should implement the theme interface */ public function testGetPatternDirsException() { - $rule = $this->getMockForAbstractClass('\Magento\Framework\View\Design\Fallback\Rule\RuleInterface'); - /** @var $rule RuleInterface */ - $object = new Theme($rule); - $object->getPatternDirs([]); + $this->model->getPatternDirs([]); } public function testGetPatternDirs() { $parentTheme = $this->getMockForAbstractClass('Magento\Framework\View\Design\ThemeInterface'); - $parentTheme->expects($this->any())->method('getThemePath')->will($this->returnValue('package/parent_theme')); + $parentTheme->expects($this->any())->method('getFullPath')->will($this->returnValue('package/parent_theme')); $theme = $this->getMockForAbstractClass('Magento\Framework\View\Design\ThemeInterface'); - $theme->expects($this->any())->method('getThemePath')->will($this->returnValue('package/current_theme')); + $theme->expects($this->any())->method('getFullPath')->will($this->returnValue('package/current_theme')); $theme->expects($this->any())->method('getParentTheme')->will($this->returnValue($parentTheme)); + $this->componentRegistrar->expects($this->any()) + ->method('getPath') + ->will($this->returnValueMap([ + [ComponentRegistrar::THEME, 'package/parent_theme', '/path/to/parent/theme'], + [ComponentRegistrar::THEME, 'package/current_theme', '/path/to/current/theme'], + ])); + $ruleDirsMap = [ [ - ['theme_path' => 'package/current_theme'], + ['theme_dir' => '/path/to/current/theme'], ['package/current_theme/path/one', 'package/current_theme/path/two'], ], [ - ['theme_path' => 'package/parent_theme'], + ['theme_dir' => '/path/to/parent/theme'], ['package/parent_theme/path/one', 'package/parent_theme/path/two'] ], ]; - $rule = $this->getMockForAbstractClass('Magento\Framework\View\Design\Fallback\Rule\RuleInterface'); - $rule->expects($this->any())->method('getPatternDirs')->will($this->returnValueMap($ruleDirsMap)); - /** @var $rule RuleInterface */ - $object = new Theme($rule); - + $this->rule->expects($this->any())->method('getPatternDirs')->will($this->returnValueMap($ruleDirsMap)); $expectedResult = [ 'package/current_theme/path/one', 'package/current_theme/path/two', 'package/parent_theme/path/one', 'package/parent_theme/path/two', ]; - $this->assertEquals($expectedResult, $object->getPatternDirs(['theme' => $theme])); + $this->assertEquals($expectedResult, $this->model->getPatternDirs(['theme' => $theme])); } } diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Design/Fallback/RulePoolTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Design/Fallback/RulePoolTest.php index 93278e4b7185df60982b39d6c1ad58bcbb57ae2a..80bf7ca59e16f4bfbc8ce88c0780f84852ef6829 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Design/Fallback/RulePoolTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Design/Fallback/RulePoolTest.php @@ -4,29 +4,18 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\View\Test\Unit\Design\Fallback; use \Magento\Framework\View\Design\Fallback\RulePool; -use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\Filesystem; -/** - * Factory Test - */ class RulePoolTest extends \PHPUnit_Framework_TestCase { /** * @var RulePool */ - protected $model; - - /** - * @var array - */ - protected $defaultParams; + private $model; protected function setUp() { @@ -44,7 +33,37 @@ class RulePoolTest extends \PHPUnit_Framework_TestCase return $dirMock; })); - $this->model = new RulePool($filesystemMock); + $simpleFactory = $this->getMock('Magento\Framework\View\Design\Fallback\Rule\SimpleFactory', [], [], '', false); + $rule = $this->getMockForAbstractClass('\Magento\Framework\View\Design\Fallback\Rule\RuleInterface'); + $simpleFactory->expects($this->any()) + ->method('create') + ->will($this->returnValue($rule)); + + $themeFactory = $this->getMock('Magento\Framework\View\Design\Fallback\Rule\ThemeFactory', [], [], '', false); + $themeFactory->expects($this->any()) + ->method('create') + ->will($this->returnValue($rule)); + $moduleFactory = $this->getMock('Magento\Framework\View\Design\Fallback\Rule\ModuleFactory', [], [], '', false); + $moduleFactory->expects($this->any()) + ->method('create') + ->will($this->returnValue($rule)); + $moduleSwitchFactory = $this->getMock( + 'Magento\Framework\View\Design\Fallback\Rule\ModularSwitchFactory', + [], + [], + '', + false + ); + $moduleSwitchFactory->expects($this->any()) + ->method('create') + ->will($this->returnValue($rule)); + $this->model = new RulePool( + $filesystemMock, + $simpleFactory, + $themeFactory, + $moduleFactory, + $moduleSwitchFactory + ); $parentTheme = $this->getMockForAbstractClass('Magento\Framework\View\Design\ThemeInterface'); $parentTheme->expects($this->any())->method('getThemePath')->will($this->returnValue('parent_theme_path')); @@ -52,20 +71,11 @@ class RulePoolTest extends \PHPUnit_Framework_TestCase $theme = $this->getMockForAbstractClass('Magento\Framework\View\Design\ThemeInterface'); $theme->expects($this->any())->method('getThemePath')->will($this->returnValue('current_theme_path')); $theme->expects($this->any())->method('getParentTheme')->will($this->returnValue($parentTheme)); - - $this->defaultParams = [ - 'area' => 'area', - 'theme' => $theme, - 'namespace' => 'namespace', - 'module' => 'module', - 'locale' => 'en_US', - ]; } protected function tearDown() { $this->model = null; - $this->defaultParams = []; } /** @@ -101,200 +111,4 @@ class RulePoolTest extends \PHPUnit_Framework_TestCase { $this->model->getRule('unsupported_type'); } - - /** - * @param string $type - * @param array $overriddenParams - * @param string $expectedErrorMessage - * - * @dataProvider getPatternDirsExceptionDataProvider - */ - public function testGetPatternDirsException($type, array $overriddenParams, $expectedErrorMessage) - { - $this->setExpectedException('InvalidArgumentException', $expectedErrorMessage); - $this->model->getRule($type)->getPatternDirs($overriddenParams + $this->defaultParams); - } - - /** - * @return array - */ - public function getPatternDirsExceptionDataProvider() - { - $exceptions = [ - 'no theme' => [ - ['theme' => null], - 'Parameter "theme" should be specified and should implement the theme interface', - ], - 'no area' => [ - ['area' => null], - "Required parameter 'area' was not passed", - ], - 'no namespace' => [ - ['namespace' => null], - "Parameters 'namespace' and 'module' should either be both set or unset", - ], - 'no module' => [ - ['module' => null], - "Parameters 'namespace' and 'module' should either be both set or unset", - ], - ]; - $exceptionsPerTypes = [ - \Magento\Framework\View\Design\Fallback\RulePool::TYPE_LOCALE_FILE => [ - 'no theme', 'no area', - ], - \Magento\Framework\View\Design\Fallback\RulePool::TYPE_FILE => [ - 'no theme', 'no area', 'no namespace', 'no module', - ], - \Magento\Framework\View\Design\Fallback\RulePool::TYPE_TEMPLATE_FILE => [ - 'no theme', 'no area', 'no namespace', 'no module', - ], - \Magento\Framework\View\Design\Fallback\RulePool::TYPE_STATIC_FILE => [ - 'no theme', 'no area', 'no namespace', 'no module', - ], - ]; - - $data = []; - foreach ($exceptionsPerTypes as $type => $exceptionKeys) { - foreach ($exceptionKeys as $key) { - $data[$type . ', ' . $key] = [$type, $exceptions[$key][0], $exceptions[$key][1]]; - } - } - - return $data; - } - - /** - * @param string $type - * @param array $overriddenParams - * @param array $expectedResult - * - * @dataProvider getPatternDirsDataProvider - */ - public function testGetPatternDirs($type, array $overriddenParams, array $expectedResult) - { - $actualResult = $this->model->getRule($type) - ->getPatternDirs($overriddenParams + $this->defaultParams); - $this->assertEquals($expectedResult, $actualResult); - } - - /** - * @return array - * - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) - */ - public function getPatternDirsDataProvider() - { - return [ - 'locale' => [ - \Magento\Framework\View\Design\Fallback\RulePool::TYPE_LOCALE_FILE, - [], - [ - DirectoryList::THEMES . '/area/current_theme_path', - DirectoryList::THEMES . '/area/parent_theme_path', - ], - ], - 'file, modular' => [ - \Magento\Framework\View\Design\Fallback\RulePool::TYPE_FILE, - [], - [ - DirectoryList::THEMES . '/area/current_theme_path/namespace_module', - DirectoryList::THEMES . '/area/parent_theme_path/namespace_module', - DirectoryList::MODULES . '/namespace/module/view/area', - DirectoryList::MODULES . '/namespace/module/view/base', - ], - ], - 'file, non-modular' => [ - \Magento\Framework\View\Design\Fallback\RulePool::TYPE_FILE, - ['namespace' => null, 'module' => null], - [ - DirectoryList::THEMES . '/area/current_theme_path', - DirectoryList::THEMES . '/area/parent_theme_path', - ], - ], - - 'template, modular' => [ - \Magento\Framework\View\Design\Fallback\RulePool::TYPE_TEMPLATE_FILE, - [], - [ - DirectoryList::THEMES . '/area/current_theme_path/namespace_module/templates', - DirectoryList::THEMES . '/area/parent_theme_path/namespace_module/templates', - DirectoryList::MODULES . '/namespace/module/view/area/templates', - DirectoryList::MODULES . '/namespace/module/view/base/templates', - ], - ], - 'template, non-modular' => [ - \Magento\Framework\View\Design\Fallback\RulePool::TYPE_TEMPLATE_FILE, - ['namespace' => null, 'module' => null], - [ - DirectoryList::THEMES . '/area/current_theme_path/templates', - DirectoryList::THEMES . '/area/parent_theme_path/templates', - ], - ], - 'template, non-modular-magento-core' => [ - \Magento\Framework\View\Design\Fallback\RulePool::TYPE_TEMPLATE_FILE, - ['namespace' => 'Magento', 'module' => 'Theme'], - [ - DirectoryList::THEMES . '/area/current_theme_path/Magento_Theme/templates', - DirectoryList::THEMES . '/area/parent_theme_path/Magento_Theme/templates', - DirectoryList::MODULES . '/Magento/Theme/view/area/templates', - DirectoryList::MODULES . '/Magento/Theme/view/base/templates', - ], - ], - - 'view, modular localized' => [ - \Magento\Framework\View\Design\Fallback\RulePool::TYPE_STATIC_FILE, - [], - [ - DirectoryList::THEMES . '/area/current_theme_path/namespace_module/web/i18n/en_US', - DirectoryList::THEMES . '/area/current_theme_path/namespace_module/web', - DirectoryList::THEMES . '/area/parent_theme_path/namespace_module/web/i18n/en_US', - DirectoryList::THEMES . '/area/parent_theme_path/namespace_module/web', - DirectoryList::MODULES . '/namespace/module/view/area/web/i18n/en_US', - DirectoryList::MODULES . '/namespace/module/view/base/web/i18n/en_US', - DirectoryList::MODULES . '/namespace/module/view/area/web', - DirectoryList::MODULES . '/namespace/module/view/base/web', - ], - ], - 'view, modular non-localized' => [ - \Magento\Framework\View\Design\Fallback\RulePool::TYPE_STATIC_FILE, - ['locale' => null], - [ - DirectoryList::THEMES . '/area/current_theme_path/namespace_module/web', - DirectoryList::THEMES . '/area/parent_theme_path/namespace_module/web', - DirectoryList::MODULES . '/namespace/module/view/area/web', - DirectoryList::MODULES . '/namespace/module/view/base/web', - ], - ], - 'view, non-modular localized' => [ - \Magento\Framework\View\Design\Fallback\RulePool::TYPE_STATIC_FILE, - ['module' => null, 'namespace' => null], - [ - DirectoryList::THEMES . '/area/current_theme_path/web/i18n/en_US', - DirectoryList::THEMES . '/area/current_theme_path/web', - DirectoryList::THEMES . '/area/parent_theme_path/web/i18n/en_US', - DirectoryList::THEMES . '/area/parent_theme_path/web', - DirectoryList::LIB_WEB, - ], - ], - 'view, non-modular non-localized' => [ - \Magento\Framework\View\Design\Fallback\RulePool::TYPE_STATIC_FILE, - ['module' => null, 'namespace' => null, 'locale' => null], - [ - DirectoryList::THEMES . '/area/current_theme_path/web', - DirectoryList::THEMES . '/area/parent_theme_path/web', - DirectoryList::LIB_WEB, - ], - ], - // Single test, as emails will always be loaded in a modular context with no locale specificity - 'email' => [ - \Magento\Framework\View\Design\Fallback\RulePool::TYPE_EMAIL_TEMPLATE, - [], - [ - DirectoryList::THEMES . '/area/current_theme_path/namespace_module/email', - DirectoryList::THEMES . '/area/parent_theme_path/namespace_module/email', - DirectoryList::MODULES . '/namespace/module/view/area/email', - ], - ], - ]; - } } diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Design/FileResolution/Fallback/Resolver/SimpleTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Design/FileResolution/Fallback/Resolver/SimpleTest.php index 35f55d4d69ae5c184cc7b4cab18d8d414d4482df..14411757fc878da7da9396408da3f7cd505b613e 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Design/FileResolution/Fallback/Resolver/SimpleTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Design/FileResolution/Fallback/Resolver/SimpleTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\View\Test\Unit\Design\FileResolution\Fallback\Resolver; use \Magento\Framework\View\Design\FileResolution\Fallback\Resolver\Simple; @@ -40,9 +38,7 @@ class SimpleTest extends \PHPUnit_Framework_TestCase ->method('getDirectoryRead') ->with(DirectoryList::ROOT) ->will($this->returnValue($this->directory)); - $this->rule = $this->getMock( - '\Magento\Framework\View\Design\Fallback\Rule\RuleInterface', [], [], '', false - ); + $this->rule = $this->getMock('\Magento\Framework\View\Design\Fallback\Rule\RuleInterface', [], [], '', false); $rulePool = $this->getMock('Magento\Framework\View\Design\Fallback\RulePool', [], [], '', false); $rulePool->expects($this->any()) ->method('getRule') @@ -79,9 +75,7 @@ class SimpleTest extends \PHPUnit_Framework_TestCase ->method('isExist') ->with($expectedPath) ->will($this->returnValue(true)); - $actualPath = $this->object->resolve( - 'type', 'file.ext', $area, $theme, $locale, $module - ); + $actualPath = $this->object->resolve('type', 'file.ext', $area, $theme, $locale, $module); $this->assertSame($expectedPath, $actualPath); } @@ -96,8 +90,7 @@ class SimpleTest extends \PHPUnit_Framework_TestCase [ 'theme' => 'magento_theme', 'locale' => 'en_US', - 'namespace' => 'Magento', - 'module' => 'Module', + 'module_name' => 'Magento_Module', ], ], 'no theme' => [ @@ -105,8 +98,7 @@ class SimpleTest extends \PHPUnit_Framework_TestCase [ 'area' => 'frontend', 'locale' => 'en_US', - 'namespace' => 'Magento', - 'module' => 'Module', + 'module_name' => 'Magento_Module', ], ], 'no locale' => [ @@ -114,8 +106,7 @@ class SimpleTest extends \PHPUnit_Framework_TestCase [ 'area' => 'frontend', 'theme' => 'magento_theme', - 'namespace' => 'Magento', - 'module' => 'Module', + 'module_name' => 'Magento_Module', ], ], 'no module' => [ @@ -132,8 +123,7 @@ class SimpleTest extends \PHPUnit_Framework_TestCase 'area' => 'frontend', 'theme' => 'magento_theme', 'locale' => 'en_US', - 'namespace' => 'Magento', - 'module' => 'Module', + 'module_name' => 'Magento_Module', ], ], ]; @@ -156,7 +146,12 @@ class SimpleTest extends \PHPUnit_Framework_TestCase $this->assertFalse( $this->object->resolve( - 'type', 'file.ext', 'frontend', $this->getMockForTheme('magento_theme'), 'en_US', 'Magento_Module' + 'type', + 'file.ext', + 'frontend', + $this->getMockForTheme('magento_theme'), + 'en_US', + 'Magento_Module' ) ); } @@ -171,7 +166,12 @@ class SimpleTest extends \PHPUnit_Framework_TestCase ->will($this->returnValue(false)); $this->assertFalse( $this->object->resolve( - 'type', 'file.ext', 'frontend', $this->getMockForTheme('magento_theme'), 'en_US', 'Magento_Module' + 'type', + 'file.ext', + 'frontend', + $this->getMockForTheme('magento_theme'), + 'en_US', + 'Magento_Module' ) ); } diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Design/Theme/Customization/PathTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Design/Theme/Customization/PathTest.php index f04ac911ee14d57c216a5f90fc27663daff8aa1f..69acf60a255fcba3e543b8ae432b574a7458feb7 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Design/Theme/Customization/PathTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Design/Theme/Customization/PathTest.php @@ -9,45 +9,45 @@ */ namespace Magento\Framework\View\Test\Unit\Design\Theme\Customization; +use Magento\Framework\Component\ComponentRegistrar; + class PathTest extends \PHPUnit_Framework_TestCase { /** * @var \Magento\Framework\View\Design\Theme\Customization\Path */ - protected $_model; + private $_model; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Theme\Model\Theme|\PHPUnit_Framework_MockObject_MockObject */ - protected $_dir; + private $_theme; /** * @var \PHPUnit_Framework_MockObject_MockObject */ - protected $_theme; + private $_directory; /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $_appState; - - /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\Component\ComponentRegistrarInterface|\PHPUnit_Framework_MockObject_MockObject */ - protected $_directory; + private $componentRegistrar; protected function setUp() { - $this->_theme = $this->getMock('Magento\Theme\Model\Theme', ['__wakeup'], [], '', false); - $this->_appState = $this->getMock('Magento\Framework\App\State', ['getAreaCode'], [], '', false); - $appStateProperty = new \ReflectionProperty('\Magento\Theme\Model\Theme', '_appState'); - $appStateProperty->setAccessible(true); - $appStateProperty->setValue($this->_theme, $this->_appState); + $this->_theme = $this->getMockForAbstractClass('\Magento\Framework\View\Design\ThemeInterface'); + /** @var \Magento\Framework\Filesystem|\PHPUnit_Framework_MockObject_MockObject $filesystem */ $filesystem = $this->getMock('Magento\Framework\Filesystem', [], [], '', false); $this->_directory = $this->getMock('\Magento\Framework\Filesystem\Directory\Read', [], [], '', false); $filesystem->expects($this->any())->method('getDirectoryRead')->will($this->returnValue($this->_directory)); - $this->_directory->expects($this->once())->method('getAbsolutePath')->will($this->returnArgument(0)); - $this->_model = new \Magento\Framework\View\Design\Theme\Customization\Path($filesystem); + $this->_directory->expects($this->any())->method('getAbsolutePath')->will($this->returnArgument(0)); + $this->componentRegistrar = $this->getMockForAbstractClass( + '\Magento\Framework\Component\ComponentRegistrarInterface' + ); + $this->_model = new \Magento\Framework\View\Design\Theme\Customization\Path( + $filesystem, + $this->componentRegistrar + ); } protected function tearDown() @@ -64,8 +64,22 @@ class PathTest extends \PHPUnit_Framework_TestCase public function testGetCustomizationPath() { $expectedPath = implode('/', [\Magento\Framework\View\Design\Theme\Customization\Path::DIR_NAME, '123']); - $this->assertEquals($expectedPath, $this->_model->getCustomizationPath($this->_theme->setId(123))); - $this->assertNull($this->_model->getCustomizationPath($this->_theme->setId(null))); + $this->_theme->expects($this->exactly(2)) + ->method('getId') + ->will($this->returnValue(123)); + $this->assertEquals($expectedPath, $this->_model->getCustomizationPath($this->_theme)); + } + + /** + * @covers \Magento\Framework\View\Design\Theme\Customization\Path::__construct + * @covers \Magento\Framework\View\Design\Theme\Customization\Path::getCustomizationPath + */ + public function testGetCustomizationPathNoId() + { + $this->_theme->expects($this->once()) + ->method('getId') + ->will($this->returnValue(null)); + $this->assertNull($this->_model->getCustomizationPath($this->_theme)); } /** @@ -73,10 +87,28 @@ class PathTest extends \PHPUnit_Framework_TestCase */ public function testGetThemeFilesPath() { - $this->_appState->expects($this->any())->method('getAreaCode')->will($this->returnValue('area51')); - $expectedPath = implode('/', ['area51', 'path']); - $this->assertEquals($expectedPath, $this->_model->getThemeFilesPath($this->_theme->setThemePath('path'))); - $this->assertNull($this->_model->getCustomizationPath($this->_theme->setThemePath(null))); + $this->_theme->expects($this->any()) + ->method('getFullPath') + ->will($this->returnValue('frontend/Magento/theme')); + $expectedPath = '/fill/theme/path'; + $this->componentRegistrar->expects($this->once()) + ->method('getPath') + ->with(ComponentRegistrar::THEME, 'frontend/Magento/theme') + ->will($this->returnValue($expectedPath)); + $this->assertEquals($expectedPath, $this->_model->getThemeFilesPath($this->_theme)); + } + + /** + * @covers \Magento\Framework\View\Design\Theme\Customization\Path::getThemeFilesPath + */ + public function testGetThemeFilesPathNoPath() + { + $this->_theme->expects($this->any()) + ->method('getFullPath') + ->will($this->returnValue(null)); + $this->componentRegistrar->expects($this->never()) + ->method('getPath'); + $this->assertNull($this->_model->getCustomizationPath($this->_theme)); } /** @@ -92,7 +124,20 @@ class PathTest extends \PHPUnit_Framework_TestCase \Magento\Framework\View\ConfigInterface::CONFIG_FILE_NAME ] ); - $this->assertEquals($expectedPath, $this->_model->getCustomViewConfigPath($this->_theme->setId(123))); - $this->assertNull($this->_model->getCustomViewConfigPath($this->_theme->setId(null))); + $this->_theme->expects($this->exactly(2)) + ->method('getId') + ->will($this->returnValue(123)); + $this->assertEquals($expectedPath, $this->_model->getCustomViewConfigPath($this->_theme)); + } + + /** + * @covers \Magento\Framework\View\Design\Theme\Customization\Path::getCustomViewConfigPath + */ + public function testGetCustomViewConfigPathNoId() + { + $this->_theme->expects($this->once()) + ->method('getId') + ->will($this->returnValue(null)); + $this->assertNull($this->_model->getCustomViewConfigPath($this->_theme)); } } diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Design/Theme/ThemePackageListTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Design/Theme/ThemePackageListTest.php new file mode 100644 index 0000000000000000000000000000000000000000..b20ab2ed503fa5fcfc8f63d1f0176b435160ab8b --- /dev/null +++ b/lib/internal/Magento/Framework/View/Test/Unit/Design/Theme/ThemePackageListTest.php @@ -0,0 +1,87 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Framework\View\Test\Unit\Design\Theme; + +use Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\View\Design\Theme\ThemePackageList; + +class ThemePackageListTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Framework\Component\ComponentRegistrarInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $registrar; + + /** + * @var ThemePackageList + */ + private $object; + + /** + * @var \Magento\Framework\View\Design\Theme\ThemePackageFactory|\PHPUnit_Framework_MockObject_MockObject + */ + private $factory; + + protected function setUp() + { + $this->registrar = $this->getMockForAbstractClass('\Magento\Framework\Component\ComponentRegistrarInterface'); + $this->factory = $this->getMock('Magento\Framework\View\Design\Theme\ThemePackageFactory', [], [], '', false); + $this->object = new ThemePackageList($this->registrar, $this->factory); + } + + /** + * @expectedException \UnexpectedValueException + * @expectedExceptionMessage No theme registered with name 'theme' + */ + public function testGetThemeNonexistent() + { + $themeKey = 'theme'; + $this->registrar->expects($this->once()) + ->method('getPath') + ->with(ComponentRegistrar::THEME, $themeKey) + ->willReturn(null); + $this->factory->expects($this->never()) + ->method('create'); + $this->object->getTheme($themeKey); + } + + public function testGetTheme() + { + $themeKey = 'theme'; + $themePath = 'path'; + $this->registrar->expects($this->once()) + ->method('getPath') + ->with(ComponentRegistrar::THEME, $themeKey) + ->willReturn($themePath); + $themePackage = $this->getMock('\Magento\Framework\View\Design\Theme\ThemePackage', [], [], '', false); + $this->factory->expects($this->once()) + ->method('create') + ->with($themeKey, $themePath) + ->willReturn($themePackage); + $this->assertSame($themePackage, $this->object->getTheme($themeKey)); + } + + public function testGetThemes() + { + $this->registrar->expects($this->once()) + ->method('getPaths') + ->with(ComponentRegistrar::THEME) + ->willReturn(['theme1' => 'path1', 'theme2' => 'path2']); + $themePackage = $this->getMock('\Magento\Framework\View\Design\Theme\ThemePackage', [], [], '', false); + $this->factory->expects($this->exactly(2)) + ->method('create') + ->withConsecutive( + ['theme1', 'path1'], + ['theme2', 'path2'] + ) + ->willReturn($themePackage); + $actual = $this->object->getThemes(); + $this->assertCount(2, $actual); + foreach ($actual as $themePackage) { + $this->assertSame($themePackage, $themePackage); + } + } +} diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Design/Theme/ThemePackageTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Design/Theme/ThemePackageTest.php new file mode 100644 index 0000000000000000000000000000000000000000..7bd129e4f8d62572dedebfd68314abd1af35111f --- /dev/null +++ b/lib/internal/Magento/Framework/View/Test/Unit/Design/Theme/ThemePackageTest.php @@ -0,0 +1,48 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Framework\View\Test\Unit\Design\Theme; + +use Magento\Framework\View\Design\Theme\ThemePackage; + +class ThemePackageTest extends \PHPUnit_Framework_TestCase +{ + /** + * @param string $key + * + * @dataProvider constructBadKeyDataProvider + * @expectedException \UnexpectedValueException + * @expectedExceptionMessage Theme's key does not correspond to required format: '<area>/<vendor>/<name>' + */ + public function testConstructBadKey($key) + { + new ThemePackage($key, 'path'); + } + + /** + * @return array + */ + public function constructBadKeyDataProvider() + { + return [ + [''], + ['one'], + ['two/parts'], + ['four/parts/four/parts'], + ]; + } + + public function testGetters() + { + $key = 'area/Vendor/name'; + $path = 'path'; + $object = new ThemePackage($key, $path); + $this->assertSame('area', $object->getArea()); + $this->assertSame('Vendor', $object->getVendor()); + $this->assertSame('name', $object->getName()); + $this->assertSame($key, $object->getKey()); + $this->assertSame($path, $object->getPath()); + } +} diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Element/Template/File/ValidatorTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Element/Template/File/ValidatorTest.php index befcf7e5a8c9f2d7397c049b7b704da5d72e0b6a..c4776c40ba843ec6392127ca0ffa1dc8e1365a38 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Element/Template/File/ValidatorTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Element/Template/File/ValidatorTest.php @@ -6,6 +6,7 @@ namespace Magento\Framework\View\Test\Unit\Element\Template\File; use \Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Component\ComponentRegistrar; use \Magento\Framework\Filesystem\DriverPool; /** @@ -19,49 +20,40 @@ class ValidatorTest extends \PHPUnit_Framework_TestCase * * @var \Magento\Framework\View\Element\Template\File\Validator */ - protected $_validator; + private $_validator; /** * Mock for view file system * * @var \Magento\Framework\FileSystem|\PHPUnit_Framework_MockObject_MockObject */ - protected $_fileSystemMock; + private $_fileSystemMock; /** * Mock for scope config * * @var \Magento\Framework\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject */ - protected $_scopeConfigMock; + private $_scopeConfigMock; /** * Mock for root directory reader * * @var \Magento\Framework\Filesystem\Directory\ReadInterface|\PHPUnit_Framework_MockObject_MockObject */ - protected $rootDirectoryMock; + private $rootDirectoryMock; /** - * Mock for app directory reader - * - * @var \Magento\Framework\Filesystem\Directory\ReadInterface|\PHPUnit_Framework_MockObject_MockObject - */ - protected $appDirectoryMock; - - /** - * Mock for themes directory reader + * Mock for compiled directory reader * * @var \Magento\Framework\Filesystem\Directory\ReadInterface|\PHPUnit_Framework_MockObject_MockObject */ - protected $themesDirectoryMock; + private $compiledDirectoryMock; /** - * Mock for compiled directory reader - * - * @var \Magento\Framework\Filesystem\Directory\ReadInterface|\PHPUnit_Framework_MockObject_MockObject + * @var ComponentRegistrar|\PHPUnit_Framework_MockObject_MockObject */ - protected $compiledDirectoryMock; + private $componentRegistrar; /** * Test Setup @@ -73,8 +65,6 @@ class ValidatorTest extends \PHPUnit_Framework_TestCase $this->_fileSystemMock = $this->getMock('\Magento\Framework\Filesystem', [], [], '', false); $this->_scopeConfigMock = $this->getMock('\Magento\Framework\App\Config\ScopeConfigInterface'); $this->rootDirectoryMock = $this->getMock('\Magento\Framework\Filesystem\Directory\ReadInterface'); - $this->appDirectoryMock = $this->getMock('\Magento\Framework\Filesystem\Directory\ReadInterface'); - $this->themesDirectoryMock = $this->getMock('\Magento\Framework\Filesystem\Directory\ReadInterface'); $this->compiledDirectoryMock = $this->getMock('\Magento\Framework\Filesystem\Directory\ReadInterface'); $this->_fileSystemMock->expects($this->any()) @@ -82,8 +72,6 @@ class ValidatorTest extends \PHPUnit_Framework_TestCase ->will($this->returnValueMap( [ [DirectoryList::ROOT, DriverPool::FILE, $this->rootDirectoryMock], - [DirectoryList::THEMES, DriverPool::FILE, $this->themesDirectoryMock], - [DirectoryList::APP, DriverPool::FILE, $this->appDirectoryMock], [DirectoryList::TEMPLATE_MINIFICATION_DIR, DriverPool::FILE, $this->compiledDirectoryMock], ] )); @@ -92,17 +80,21 @@ class ValidatorTest extends \PHPUnit_Framework_TestCase ->method('getAbsolutePath') ->will($this->returnValue('/magento/var/compiled')); - $this->appDirectoryMock->expects($this->any()) - ->method('getAbsolutePath') - ->will($this->returnValue('/magento/app')); - - $this->themesDirectoryMock->expects($this->any()) - ->method('getAbsolutePath') - ->will($this->returnValue('/magento/themes')); - + $this->componentRegistrar = $this->getMock('Magento\Framework\Component\ComponentRegistrar', [], [], '', false); + $this->componentRegistrar->expects($this->any()) + ->method('getPaths') + ->will( + $this->returnValueMap( + [ + [ComponentRegistrar::MODULE, ['/magento/app/code/Some/Module']], + [ComponentRegistrar::THEME, ['/magento/themes/default']] + ] + ) + ); $this->_validator = new \Magento\Framework\View\Element\Template\File\Validator( $this->_fileSystemMock, - $this->_scopeConfigMock + $this->_scopeConfigMock, + $this->componentRegistrar ); } @@ -118,7 +110,6 @@ class ValidatorTest extends \PHPUnit_Framework_TestCase */ public function testIsValid($file, $expectedResult) { - $this->rootDirectoryMock->expects($this->any())->method('isFile')->will($this->returnValue(true)); $this->assertEquals($expectedResult, $this->_validator->isValid($file)); } diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Element/TemplateTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Element/TemplateTest.php index ff74bfe6f4789f77d234cc101d26f703c8960314..e0c34119b1cf33933764b13425cf7813d66f369c 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Element/TemplateTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Element/TemplateTest.php @@ -5,6 +5,7 @@ */ namespace Magento\Framework\View\Test\Unit\Element; +use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\Filesystem\DriverPool; class TemplateTest extends \PHPUnit_Framework_TestCase @@ -61,24 +62,12 @@ class TemplateTest extends \PHPUnit_Framework_TestCase $this->rootDirMock->expects($this->any()) ->method('getRelativePath') ->will($this->returnArgument(0)); - $appDirMock = $this->getMock('\Magento\Framework\Filesystem\Directory\Read', [], [], '', false); - $themesDirMock = $this->getMock('\Magento\Framework\Filesystem\Directory\Read', [], [], '', false); - $themesDirMock->expects($this->any()) - ->method('getAbsolutePath') - ->will($this->returnValue('themedir')); $this->_filesystem = $this->getMock('\Magento\Framework\Filesystem', [], [], '', false); $this->_filesystem->expects($this->any()) ->method('getDirectoryRead') - ->will($this->returnValueMap([ - [\Magento\Framework\App\Filesystem\DirectoryList::THEMES, DriverPool::FILE, $themesDirMock], - [\Magento\Framework\App\Filesystem\DirectoryList::APP, DriverPool::FILE, $appDirMock], - [\Magento\Framework\App\Filesystem\DirectoryList::ROOT, DriverPool::FILE, $this->rootDirMock], - [ - \Magento\Framework\App\Filesystem\DirectoryList::TEMPLATE_MINIFICATION_DIR, DriverPool::FILE, - $this->rootDirMock - ], - ])); + ->with(DirectoryList::ROOT, DriverPool::FILE) + ->will($this->returnValue($this->rootDirMock)); $this->_templateEngine = $this->getMock( 'Magento\Framework\View\TemplateEnginePool', diff --git a/lib/internal/Magento/Framework/View/Test/Unit/File/Collector/BaseTest.php b/lib/internal/Magento/Framework/View/Test/Unit/File/Collector/BaseTest.php index a98cf7e647b75f1f9f2bb73a6b2c555726d67319..2f1ddca85387a0e71421a50799243a3b902b1006 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/File/Collector/BaseTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/File/Collector/BaseTest.php @@ -5,107 +5,73 @@ */ namespace Magento\Framework\View\Test\Unit\File\Collector; -use Magento\Framework\App\Filesystem\DirectoryList; -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use Magento\Framework\Component\ComponentRegistrar; use Magento\Framework\View\File; class BaseTest extends \PHPUnit_Framework_TestCase { - /** - * @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager - */ - protected $objectManagerHelper; - /** * @var \Magento\Framework\View\File\Collector\Base */ - protected $fileCollector; - - /** - * @var \Magento\Framework\Filesystem\Directory\ReadInterface|\PHPUnit_Framework_MockObject_MockObject - */ - protected $directoryMock; - - /** - * @var \Magento\Framework\Filesystem|\PHPUnit_Framework_MockObject_MockObject - */ - protected $filesystemMock; + private $fileCollector; /** * @var \Magento\Framework\View\File\Factory|\PHPUnit_Framework_MockObject_MockObject */ - protected $fileFactoryMock; + private $fileFactoryMock; /** - * @var \Magento\Framework\View\Helper\PathPattern|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\View\Design\ThemeInterface|\PHPUnit_Framework_MockObject_MockObject */ - protected $pathPatternHelperMock; + private $themeMock; /** - * @var \Magento\Framework\View\Design\ThemeInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\Component\DirSearch|\PHPUnit_Framework_MockObject_MockObject */ - protected $themeMock; + private $dirSearch; protected function setUp() { - $this->filesystemMock = $this->getMockBuilder('Magento\Framework\Filesystem') - ->disableOriginalConstructor() - ->getMock(); $this->fileFactoryMock = $this->getMockBuilder('Magento\Framework\View\File\Factory') ->disableOriginalConstructor() ->getMock(); - $this->pathPatternHelperMock = $this->getMockBuilder('Magento\Framework\View\Helper\PathPattern') - ->disableOriginalConstructor() - ->getMock(); - $this->directoryMock = $this->getMockBuilder('Magento\Framework\Filesystem\Directory\ReadInterface') - ->getMockForAbstractClass(); $this->themeMock = $this->getMockBuilder('Magento\Framework\View\Design\ThemeInterface') ->setMethods(['getData']) ->getMockForAbstractClass(); - $this->filesystemMock->expects($this->once()) - ->method('getDirectoryRead') - ->with(DirectoryList::MODULES) - ->willReturn($this->directoryMock); + $this->dirSearch = $this->getMock('Magento\Framework\Component\DirSearch', [], [], '', false); - $this->objectManagerHelper = new ObjectManagerHelper($this); - $this->fileCollector = $this->objectManagerHelper->getObject( - 'Magento\Framework\View\File\Collector\Base', - [ - 'filesystem' => $this->filesystemMock, - 'fileFactory' => $this->fileFactoryMock, - 'pathPatternHelper' => $this->pathPatternHelperMock, - 'subDir' => 'layout' - ] + $this->fileCollector = new \Magento\Framework\View\File\Collector\Base( + $this->dirSearch, + $this->fileFactoryMock, + 'layout' ); } public function testGetFiles() { - $sharedFiles = [ - 'Namespace/One/view/base/layout/one.xml', - 'Namespace/Two/view/base/layout/two.xml' - ]; - $themeFiles = [ - 'Namespace/Two/view/frontend/layout/four.txt', - 'Namespace/Two/view/frontend/layout/three.xml' - ]; + $files = []; + foreach (['shared', 'theme'] as $fileType) { + for ($i = 0; $i < 2; $i++) { + $file = $this->getMock('\Magento\Framework\Component\ComponentFile', [], [], '', false); + $file->expects($this->once()) + ->method('getFullPath') + ->will($this->returnValue("{$fileType}/module/{$i}/path")); + $file->expects($this->once()) + ->method('getComponentName') + ->will($this->returnValue('Module_' . $i)); + $files[$fileType][] = $file; + } + } - $this->directoryMock->expects($this->any()) - ->method('search') + $this->dirSearch->expects($this->any()) + ->method('collectFilesWithContext') ->willReturnMap( [ - ['*/*/view/base/layout/*.xml', null, $sharedFiles], - ['*/*/view/frontend/layout/*.xml', null, $themeFiles] + [ComponentRegistrar::MODULE, 'view/base/layout/*.xml', $files['shared']], + [ComponentRegistrar::MODULE, 'view/frontend/layout/*.xml', $files['theme']] ] ); - $this->pathPatternHelperMock->expects($this->once()) - ->method('translatePatternFromGlob') - ->with('*.xml') - ->willReturn('[^/]*\\.xml'); - $this->directoryMock->expects($this->atLeastOnce()) - ->method('getAbsolutePath') - ->willReturnArgument(0); $this->fileFactoryMock->expects($this->atLeastOnce()) ->method('create') ->willReturn($this->createFileMock()); @@ -115,10 +81,11 @@ class BaseTest extends \PHPUnit_Framework_TestCase ->willReturn('frontend'); $result = $this->fileCollector->getFiles($this->themeMock, '*.xml'); - $this->assertCount(3, $result); + $this->assertCount(4, $result); $this->assertInstanceOf('Magento\Framework\View\File', $result[0]); $this->assertInstanceOf('Magento\Framework\View\File', $result[1]); $this->assertInstanceOf('Magento\Framework\View\File', $result[2]); + $this->assertInstanceOf('Magento\Framework\View\File', $result[3]); } /** diff --git a/lib/internal/Magento/Framework/View/Test/Unit/File/Collector/Override/BaseTest.php b/lib/internal/Magento/Framework/View/Test/Unit/File/Collector/Override/BaseTest.php index 2f858a7cfa8df18d48ee95965a6dd966cf85742b..87a7a74aabada64ede94e1ce6300121d21e679ea 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/File/Collector/Override/BaseTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/File/Collector/Override/BaseTest.php @@ -5,8 +5,8 @@ */ namespace Magento\Framework\View\Test\Unit\File\Collector\Override; +use Magento\Framework\Component\ComponentRegistrar; use Magento\Framework\View\File\Collector\Override\Base; -use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\Filesystem\Directory\Read; use Magento\Framework\View\File\Factory; @@ -20,7 +20,7 @@ class BaseTest extends \PHPUnit_Framework_TestCase /** * @var Read | \PHPUnit_Framework_MockObject_MockObject */ - private $directory; + private $themeDirectory; /** * @var Factory | \PHPUnit_Framework_MockObject_MockObject @@ -30,11 +30,21 @@ class BaseTest extends \PHPUnit_Framework_TestCase /** * @var \Magento\Framework\View\Helper\PathPattern|\PHPUnit_Framework_MockObject_MockObject */ - protected $pathPatternHelperMock; + private $pathPatternHelperMock; + + /** + * @var \Magento\Framework\Filesystem\Directory\ReadFactory|\PHPUnit_Framework_MockObject_MockObject + */ + private $readDirFactory; + + /** + * @var \Magento\Framework\Component\ComponentRegistrarInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $componentRegistrar; protected function setUp() { - $this->directory = $this->getMock( + $this->themeDirectory = $this->getMock( 'Magento\Framework\Filesystem\Directory\Read', ['getAbsolutePath', 'search'], [], @@ -44,20 +54,35 @@ class BaseTest extends \PHPUnit_Framework_TestCase $this->pathPatternHelperMock = $this->getMockBuilder('Magento\Framework\View\Helper\PathPattern') ->disableOriginalConstructor() ->getMock(); - $filesystem = $this->getMock('Magento\Framework\Filesystem', ['getDirectoryRead'], [], '', false); - $filesystem->expects($this->once()) - ->method('getDirectoryRead') - ->with(DirectoryList::THEMES) - ->willReturn($this->directory); $this->fileFactory = $this->getMock('Magento\Framework\View\File\Factory', [], [], '', false); + $this->readDirFactory = $this->getMock('Magento\Framework\Filesystem\Directory\ReadFactory', [], [], '', false); + $this->readDirFactory->expects($this->any()) + ->method('create') + ->will($this->returnValue($this->themeDirectory)); + $this->componentRegistrar = $this->getMockForAbstractClass( + 'Magento\Framework\Component\ComponentRegistrarInterface' + ); $this->model = new \Magento\Framework\View\File\Collector\Override\Base( - $filesystem, $this->fileFactory, + $this->readDirFactory, + $this->componentRegistrar, $this->pathPatternHelperMock, 'override' ); } + public function testGetFilesWrongTheme() + { + $this->componentRegistrar->expects($this->once()) + ->method('getPath') + ->will($this->returnValue('')); + $theme = $this->getMockForAbstractClass('Magento\Framework\View\Design\ThemeInterface'); + $theme->expects($this->once()) + ->method('getFullPath') + ->will($this->returnValue('area/Vendor/theme')); + $this->assertSame([], $this->model->getFiles($theme, '')); + } + /** * @param array $files * @param string $filePath @@ -67,8 +92,9 @@ class BaseTest extends \PHPUnit_Framework_TestCase */ public function testGetFiles($files, $filePath, $pathPattern) { + $themePath = 'area/theme/path'; $theme = $this->getMockForAbstractClass('Magento\Framework\View\Design\ThemeInterface'); - $theme->expects($this->once())->method('getFullPath')->willReturn('area/theme/path'); + $theme->expects($this->once())->method('getFullPath')->willReturn($themePath); $handlePath = 'design/area/theme/path/%s/override/%s'; $returnKeys = []; @@ -76,14 +102,18 @@ class BaseTest extends \PHPUnit_Framework_TestCase $returnKeys[] = sprintf($handlePath, $file['module'], $file['handle']); } + $this->componentRegistrar->expects($this->once()) + ->method('getPath') + ->with(ComponentRegistrar::THEME, $themePath) + ->will($this->returnValue('/full/theme/path')); $this->pathPatternHelperMock->expects($this->any()) ->method('translatePatternFromGlob') ->with($filePath) ->willReturn($pathPattern); - $this->directory->expects($this->once()) + $this->themeDirectory->expects($this->once()) ->method('search') ->willReturn($returnKeys); - $this->directory->expects($this->any()) + $this->themeDirectory->expects($this->any()) ->method('getAbsolutePath') ->willReturnArgument(0); diff --git a/lib/internal/Magento/Framework/View/Test/Unit/File/Collector/Override/ThemeModularTest.php b/lib/internal/Magento/Framework/View/Test/Unit/File/Collector/Override/ThemeModularTest.php index 1ff6d432511d6460f922729f0a4cb20347923cdf..69da90ea71f9ad38ab7e109eb62b72c3cfa25d15 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/File/Collector/Override/ThemeModularTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/File/Collector/Override/ThemeModularTest.php @@ -5,7 +5,7 @@ */ namespace Magento\Framework\View\Test\Unit\File\Collector\Override; -use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Component\ComponentRegistrar; class ThemeModularTest extends \PHPUnit_Framework_TestCase { @@ -17,7 +17,7 @@ class ThemeModularTest extends \PHPUnit_Framework_TestCase /** * @var \Magento\Framework\Filesystem\Directory\Read|\PHPUnit_Framework_MockObject_MockObject */ - private $directory; + private $themeDirectory; /** * @var \Magento\Framework\View\File\Factory|\PHPUnit_Framework_MockObject_MockObject @@ -29,31 +29,58 @@ class ThemeModularTest extends \PHPUnit_Framework_TestCase */ protected $pathPatternHelperMock; + /** + * @var \Magento\Framework\Filesystem\Directory\ReadFactory|\PHPUnit_Framework_MockObject_MockObject + */ + private $readDirFactory; + + /** + * @var \Magento\Framework\Component\ComponentRegistrarInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $componentRegistrar; + protected function setUp() { - $filesystem = $this->getMock('Magento\Framework\Filesystem', ['getDirectoryRead'], [], '', false); - $this->directory = $this->getMock('Magento\Framework\Filesystem\Directory\Read', [], [], '', false); - $this->directory->expects($this->any()) + $this->themeDirectory = $this->getMock('Magento\Framework\Filesystem\Directory\Read', [], [], '', false); + $this->themeDirectory->expects($this->any()) ->method('getAbsolutePath') ->willReturnArgument(0); $this->pathPatternHelperMock = $this->getMockBuilder('Magento\Framework\View\Helper\PathPattern') ->disableOriginalConstructor() ->getMock(); - $filesystem->expects($this->any())->method('getDirectoryRead') - ->with($this->equalTo(DirectoryList::THEMES)) - ->willReturn($this->directory); $this->fileFactory = $this->getMock('Magento\Framework\View\File\Factory', [], [], '', false); + $this->readDirFactory = $this->getMock('Magento\Framework\Filesystem\Directory\ReadFactory', [], [], '', false); + $this->readDirFactory->expects($this->any()) + ->method('create') + ->will($this->returnValue($this->themeDirectory)); + $this->componentRegistrar = $this->getMockForAbstractClass( + 'Magento\Framework\Component\ComponentRegistrarInterface' + ); $this->model = new \Magento\Framework\View\File\Collector\Override\ThemeModular( - $filesystem, $this->fileFactory, + $this->readDirFactory, + $this->componentRegistrar, $this->pathPatternHelperMock, 'override/theme' ); } + public function testGetFilesWrongTheme() + { + $this->componentRegistrar->expects($this->once()) + ->method('getPath') + ->will($this->returnValue('')); + $theme = $this->getMockForAbstractClass('Magento\Framework\View\Design\ThemeInterface'); + $theme->expects($this->once()) + ->method('getFullPath') + ->will($this->returnValue('area/Vendor/theme')); + $this->assertSame([], $this->model->getFiles($theme, '')); + } + public function testGetFiles() { + $themePath = 'area/theme_path'; $inputPath = '*.xml'; $grandparentTheme = $this->getMockForAbstractClass('Magento\Framework\View\Design\ThemeInterface'); $grandparentTheme->expects($this->once())->method('getCode')->willReturn('vendor/grand_parent_theme'); @@ -63,22 +90,22 @@ class ThemeModularTest extends \PHPUnit_Framework_TestCase $parentTheme->expects($this->once())->method('getParentTheme')->willReturn($grandparentTheme); $theme = $this->getMockForAbstractClass('Magento\Framework\View\Design\ThemeInterface'); - $theme->expects($this->once())->method('getFullPath')->willReturn('area/theme_path'); + $theme->expects($this->once())->method('getFullPath')->willReturn($themePath); $theme->expects($this->once())->method('getParentTheme')->willReturn($parentTheme); $filePathOne = 'design/area/theme_path/Module_One/override/theme/vendor/parent_theme/1.xml'; $filePathTwo = 'design/area/theme_path/Module_Two/override/theme/vendor/grand_parent_theme/2.xml'; - $this->directory->expects($this->once()) + $this->themeDirectory->expects($this->once()) ->method('search') - ->with($this->equalTo('area/theme_path/*_*/override/theme/*/*/*.xml')) + ->with('*_*/override/theme/*/*/*.xml') ->willReturn([$filePathOne, $filePathTwo]); $this->pathPatternHelperMock->expects($this->any()) ->method('translatePatternFromGlob') ->with($inputPath) ->willReturn('[^/]*\\.xml'); - $fileOne = new \Magento\Framework\View\File('1.xml', 'Module_One', $parentTheme); - $fileTwo = new \Magento\Framework\View\File('2.xml', 'Module_Two', $grandparentTheme); + $fileOne = $this->getMock('Magento\Framework\View\File', [], [], '', false); + $fileTwo = $this->getMock('Magento\Framework\View\File', [], [], '', false); $this->fileFactory ->expects($this->exactly(2)) ->method('create') @@ -88,12 +115,17 @@ class ThemeModularTest extends \PHPUnit_Framework_TestCase [$filePathTwo, 'Module_Two', $grandparentTheme, false, $fileTwo], ] ); + $this->componentRegistrar->expects($this->once()) + ->method('getPath') + ->with(ComponentRegistrar::THEME, $themePath) + ->will($this->returnValue('/full/theme/path')); $this->assertSame([$fileOne, $fileTwo], $this->model->getFiles($theme, $inputPath)); } public function testGetFilesWithPreset() { + $themePath = 'area/theme_path'; $inputPath = 'preset/3.xml'; $grandparentTheme = $this->getMockForAbstractClass('Magento\Framework\View\Design\ThemeInterface'); $grandparentTheme->expects($this->once())->method('getCode')->willReturn('vendor/grand_parent_theme'); @@ -103,16 +135,16 @@ class ThemeModularTest extends \PHPUnit_Framework_TestCase $parentTheme->expects($this->once())->method('getParentTheme')->willReturn($grandparentTheme); $theme = $this->getMockForAbstractClass('Magento\Framework\View\Design\ThemeInterface'); - $theme->expects($this->once())->method('getFullPath')->willReturn('area/theme_path'); + $theme->expects($this->once())->method('getFullPath')->willReturn($themePath); $theme->expects($this->once())->method('getParentTheme')->willReturn($parentTheme); $filePathOne = 'design/area/theme_path/Module_Two/override/theme/vendor/grand_parent_theme/preset/3.xml'; - $this->directory->expects($this->once()) + $this->themeDirectory->expects($this->once()) ->method('search') - ->with('area/theme_path/*_*/override/theme/*/*/preset/3.xml') + ->with('*_*/override/theme/*/*/preset/3.xml') ->willReturn([$filePathOne]); - $fileOne = new \Magento\Framework\View\File('3.xml', 'Module_Two', $grandparentTheme); + $fileOne = $this->getMock('Magento\Framework\View\File', [], [], '', false); $this->fileFactory ->expects($this->once()) ->method('create') @@ -122,12 +154,17 @@ class ThemeModularTest extends \PHPUnit_Framework_TestCase ->method('translatePatternFromGlob') ->with($inputPath) ->willReturn('preset/3.xml'); + $this->componentRegistrar->expects($this->once()) + ->method('getPath') + ->with(ComponentRegistrar::THEME, $themePath) + ->will($this->returnValue('/full/theme/path')); $this->assertSame([$fileOne], $this->model->getFiles($theme, $inputPath)); } public function testGetFilesWrongAncestor() { + $themePath = 'area/theme_path'; $inputPath = '*.xml'; $filePath = 'design/area/theme_path/Module_One/override/theme/vendor/parent_theme/1.xml'; $expectedMessage = "Trying to override modular view file '$filePath' for theme 'vendor/parent_theme'" @@ -135,18 +172,22 @@ class ThemeModularTest extends \PHPUnit_Framework_TestCase $this->setExpectedException('Magento\Framework\Exception\LocalizedException', $expectedMessage); $theme = $this->getMockForAbstractClass('Magento\Framework\View\Design\ThemeInterface'); - $theme->expects($this->once())->method('getFullPath')->willReturn('area/theme_path'); + $theme->expects($this->once())->method('getFullPath')->willReturn($themePath); $theme->expects($this->once())->method('getParentTheme')->willReturn(null); $theme->expects($this->once())->method('getCode')->willReturn('vendor/theme_path'); - $this->directory->expects($this->once()) + $this->themeDirectory->expects($this->once()) ->method('search') - ->with('area/theme_path/*_*/override/theme/*/*/*.xml') + ->with('*_*/override/theme/*/*/*.xml') ->willReturn([$filePath]); $this->pathPatternHelperMock->expects($this->any()) ->method('translatePatternFromGlob') ->with($inputPath) ->willReturn('[^/]*\\.xml'); + $this->componentRegistrar->expects($this->once()) + ->method('getPath') + ->with(ComponentRegistrar::THEME, $themePath) + ->will($this->returnValue('/full/theme/path')); $this->model->getFiles($theme, $inputPath); } diff --git a/lib/internal/Magento/Framework/View/Test/Unit/File/Collector/ThemeModularTest.php b/lib/internal/Magento/Framework/View/Test/Unit/File/Collector/ThemeModularTest.php index 0d1a14375a4ff691740be8b67685454d6c6a802f..70e1afb575dcad32430aabc97b48689f995bc796 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/File/Collector/ThemeModularTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/File/Collector/ThemeModularTest.php @@ -5,8 +5,8 @@ */ namespace Magento\Framework\View\Test\Unit\File\Collector; +use Magento\Framework\Component\ComponentRegistrar; use Magento\Framework\View\File\Collector\ThemeModular; -use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\Filesystem\Directory\Read; use Magento\Framework\View\File\Factory; @@ -20,7 +20,7 @@ class ThemeModularTest extends \PHPUnit_Framework_TestCase /** * @var Read | \PHPUnit_Framework_MockObject_MockObject */ - private $directory; + private $themeDirectory; /** * @var Factory | \PHPUnit_Framework_MockObject_MockObject @@ -32,9 +32,19 @@ class ThemeModularTest extends \PHPUnit_Framework_TestCase */ protected $pathPatternHelperMock; + /** + * @var \Magento\Framework\Filesystem\Directory\ReadFactory|\PHPUnit_Framework_MockObject_MockObject + */ + private $readDirFactory; + + /** + * @var \Magento\Framework\Component\ComponentRegistrarInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $componentRegistrar; + protected function setUp() { - $this->directory = $this->getMock( + $this->themeDirectory = $this->getMock( 'Magento\Framework\Filesystem\Directory\Read', ['getAbsolutePath', 'search'], [], @@ -44,26 +54,35 @@ class ThemeModularTest extends \PHPUnit_Framework_TestCase $this->pathPatternHelperMock = $this->getMockBuilder('Magento\Framework\View\Helper\PathPattern') ->disableOriginalConstructor() ->getMock(); - $filesystem = $this->getMock( - 'Magento\Framework\Filesystem', - ['getDirectoryRead', '__wakeup'], - [], - '', - false - ); - $filesystem->expects($this->once()) - ->method('getDirectoryRead') - ->with(DirectoryList::THEMES) - ->willReturn($this->directory); $this->fileFactory = $this->getMock('Magento\Framework\View\File\Factory', [], [], '', false); + $this->readDirFactory = $this->getMock('Magento\Framework\Filesystem\Directory\ReadFactory', [], [], '', false); + $this->readDirFactory->expects($this->any()) + ->method('create') + ->will($this->returnValue($this->themeDirectory)); + $this->componentRegistrar = $this->getMockForAbstractClass( + 'Magento\Framework\Component\ComponentRegistrarInterface' + ); $this->model = new \Magento\Framework\View\File\Collector\ThemeModular( - $filesystem, $this->fileFactory, + $this->readDirFactory, + $this->componentRegistrar, $this->pathPatternHelperMock, 'subdir' ); } + public function testGetFilesWrongTheme() + { + $this->componentRegistrar->expects($this->once()) + ->method('getPath') + ->will($this->returnValue('')); + $theme = $this->getMockForAbstractClass('Magento\Framework\View\Design\ThemeInterface'); + $theme->expects($this->once()) + ->method('getFullPath') + ->will($this->returnValue('area/Vendor/theme')); + $this->assertSame([], $this->model->getFiles($theme, '')); + } + /** * @param array $files * @param string $filePath @@ -74,7 +93,8 @@ class ThemeModularTest extends \PHPUnit_Framework_TestCase public function testGetFiles($files, $filePath, $pathPattern) { $theme = $this->getMockForAbstractClass('Magento\Framework\View\Design\ThemeInterface'); - $theme->expects($this->once())->method('getFullPath')->willReturn('area/theme/path'); + $themePath = 'area/theme/path'; + $theme->expects($this->once())->method('getFullPath')->willReturn($themePath); $handlePath = 'design/area/theme/path/%s/subdir/%s'; $returnKeys = []; @@ -82,20 +102,25 @@ class ThemeModularTest extends \PHPUnit_Framework_TestCase $returnKeys[] = sprintf($handlePath, $file['module'], $file['handle']); } + $this->componentRegistrar->expects($this->once()) + ->method('getPath') + ->with(ComponentRegistrar::THEME, $themePath) + ->will($this->returnValue('/full/theme/path')); $this->pathPatternHelperMock->expects($this->any()) ->method('translatePatternFromGlob') ->with($filePath) ->willReturn($pathPattern); - $this->directory->expects($this->once()) + $this->themeDirectory->expects($this->once()) ->method('search') ->willReturn($returnKeys); - $this->directory->expects($this->any()) + $this->themeDirectory->expects($this->any()) ->method('getAbsolutePath') ->willReturnArgument(0); $checkResult = []; foreach ($files as $key => $file) { $checkResult[$key] = new \Magento\Framework\View\File($file['handle'], $file['module'], $theme); + $checkResult[$key] = $this->getMock('Magento\Framework\View\File', [], [], '', false); $this->fileFactory ->expects($this->at($key)) ->method('create') diff --git a/lib/internal/Magento/Framework/View/Test/Unit/File/Collector/ThemeTest.php b/lib/internal/Magento/Framework/View/Test/Unit/File/Collector/ThemeTest.php index 8c9d8afbcf6d846f7e30d8713ffab4726e38988a..0cfa400e82c5f38e5aa9a987804a09a5da4deb66 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/File/Collector/ThemeTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/File/Collector/ThemeTest.php @@ -5,72 +5,98 @@ */ namespace Magento\Framework\View\Test\Unit\File\Collector; -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\View\File\Collector\Theme; use Magento\Framework\View\File\Factory; class ThemeTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Framework\View\File\Collector\Theme + * Theme path + * + * @var string */ - protected $themeFileCollector; + private $themePath = 'frontend/Magento/theme'; /** - * @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager + * Full theme path */ - protected $objectManagerHelper; + const FULL_THEME_PATH = '/full/theme/path'; /** - * @var \Magento\Framework\Filesystem|\PHPUnit_Framework_MockObject_MockObject + * @var Theme */ - protected $filesystemMock; + private $themeFileCollector; /** * @var Factory|\PHPUnit_Framework_MockObject_MockObject */ - protected $fileFactoryMock; + private $fileFactoryMock; /** * @var \Magento\Framework\Filesystem\Directory\ReadInterface|\PHPUnit_Framework_MockObject_MockObject */ - protected $directoryMock; + private $themeDirectoryMock; /** * @var \Magento\Framework\View\Design\ThemeInterface|\PHPUnit_Framework_MockObject_MockObject */ - protected $themeMock; + private $themeMock; + + /** + * @var \Magento\Framework\Filesystem\Directory\ReadFactory|\PHPUnit_Framework_MockObject_MockObject + */ + private $readDirFactory; + + /** + * @var \Magento\Framework\Component\ComponentRegistrarInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $componentRegistrar; public function setup() { - $this->filesystemMock = $this->getMockBuilder('Magento\Framework\Filesystem') - ->disableOriginalConstructor() - ->getMock(); - $this->directoryMock = $this->getMockBuilder('Magento\Framework\Filesystem\Directory\ReadInterface') + $this->themeDirectoryMock = $this->getMockBuilder('Magento\Framework\Filesystem\Directory\ReadInterface') ->getMock(); $this->fileFactoryMock = $this->getMockBuilder('Magento\Framework\View\File\Factory') ->disableOriginalConstructor() ->getMock(); $this->themeMock = $this->getMockBuilder('Magento\Framework\View\Design\ThemeInterface') ->getMock(); + $this->themeMock->expects($this->once()) + ->method('getFullPath') + ->will($this->returnValue($this->themePath)); - $this->filesystemMock->expects($this->any()) - ->method('getDirectoryRead') - ->willReturn($this->directoryMock); - - $this->objectManagerHelper = new ObjectManagerHelper($this); - $this->themeFileCollector = $this->objectManagerHelper->getObject( - 'Magento\Framework\View\File\Collector\Theme', - [ - 'filesystem' => $this->filesystemMock, - 'fileFactory' => $this->fileFactoryMock - ] + $this->readDirFactory = $this->getMock('Magento\Framework\Filesystem\Directory\ReadFactory', [], [], '', false); + $this->readDirFactory->expects($this->any()) + ->method('create') + ->will($this->returnValue($this->themeDirectoryMock)); + $this->componentRegistrar = $this->getMockForAbstractClass( + 'Magento\Framework\Component\ComponentRegistrarInterface' + ); + $this->themeFileCollector = new Theme( + $this->fileFactoryMock, + $this->readDirFactory, + $this->componentRegistrar ); } + public function testGetFilesWrongTheme() + { + $this->componentRegistrar->expects($this->once()) + ->method('getPath') + ->will($this->returnValue('')); + $this->assertSame([], $this->themeFileCollector->getFiles($this->themeMock, '')); + } + public function testGetFilesEmpty() { - $this->directoryMock->expects($this->any()) + $this->componentRegistrar->expects($this->once()) + ->method('getPath') + ->with(ComponentRegistrar::THEME, $this->themePath) + ->will($this->returnValue(self::FULL_THEME_PATH)); + $this->themeDirectoryMock->expects($this->any()) ->method('search') + ->with('') ->willReturn([]); // Verify no files were returned @@ -79,16 +105,22 @@ class ThemeTest extends \PHPUnit_Framework_TestCase public function testGetFilesSingle() { - $filePath = '/opt/magento2/app/design/frontend/Magento/blank/Magento_Customer/css/something.less'; + $searchPath = 'css/*.less'; + $filePath = '/some/absolute/path/css/*.less'; + $this->componentRegistrar->expects($this->once()) + ->method('getPath') + ->with(ComponentRegistrar::THEME, $this->themePath) + ->will($this->returnValue(self::FULL_THEME_PATH)); $fileMock = $this->getMockBuilder('Magento\Framework\View\File') ->disableOriginalConstructor() ->getMock(); - $this->directoryMock->expects($this->once()) + $this->themeDirectoryMock->expects($this->once()) ->method('search') + ->with($searchPath) ->willReturn(['file']); - $this->directoryMock->expects($this->once()) + $this->themeDirectoryMock->expects($this->once()) ->method('getAbsolutePath') ->with('file') ->willReturn($filePath); @@ -98,23 +130,23 @@ class ThemeTest extends \PHPUnit_Framework_TestCase ->willReturn($fileMock); // One file was returned from search - $this->assertEquals([$fileMock], $this->themeFileCollector->getFiles($this->themeMock, 'css/*.less')); + $this->assertEquals([$fileMock], $this->themeFileCollector->getFiles($this->themeMock, $searchPath)); } public function testGetFilesMultiple() { $dirPath = '/Magento_Customer/css/'; - $themePath = '/opt/magento2/app/design/frontend/Magento/blank'; $searchPath = 'css/*.test'; + $this->componentRegistrar->expects($this->once()) + ->method('getPath') + ->with(ComponentRegistrar::THEME, $this->themePath) + ->will($this->returnValue(self::FULL_THEME_PATH)); $fileMock = $this->getMockBuilder('Magento\Framework\View\File') ->disableOriginalConstructor() ->getMock(); - $this->themeMock->expects($this->any()) - ->method('getFullPath') - ->willReturn($themePath); - $this->directoryMock->expects($this->any()) + $this->themeDirectoryMock->expects($this->any()) ->method('getAbsolutePath') ->willReturnMap( [ @@ -124,9 +156,9 @@ class ThemeTest extends \PHPUnit_Framework_TestCase ] ); // Verifies correct files are searched for - $this->directoryMock->expects($this->once()) + $this->themeDirectoryMock->expects($this->once()) ->method('search') - ->with($themePath . '/' . $searchPath) + ->with($searchPath) ->willReturn(['fileA.test', 'fileC.test']); // Verifies Magento_Customer was correctly produced from directory path $this->fileFactoryMock->expects($this->any()) @@ -137,7 +169,7 @@ class ThemeTest extends \PHPUnit_Framework_TestCase // Only two files should be in array, which were returned from search $this->assertEquals( [$fileMock, $fileMock], - $this->themeFileCollector->getFiles($this->themeMock, 'css/*.test') + $this->themeFileCollector->getFiles($this->themeMock, $searchPath) ); } } diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Layout/XsdTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Layout/XsdTest.php index dae07e2a6ac190804687ad60dee637df0c2d5acd..bf763cbf301dcd9767514d6de61ea9db6c2d0ca9 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Layout/XsdTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Layout/XsdTest.php @@ -17,13 +17,14 @@ class XsdTest extends \PHPUnit_Framework_TestCase protected $_xsdSchema; /** - * @var \Magento\TestFramework\Utility\XsdValidator + * @var \Magento\Framework\TestFramework\Unit\Utility\XsdValidator */ protected $_xsdValidator; protected function setUp() { - $this->_xsdSchema = BP . '/lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd'; + $urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + $this->_xsdSchema = $urnResolver->getRealPath('urn:magento:framework:View/Layout/etc/page_configuration.xsd'); $this->_xsdValidator = new \Magento\Framework\TestFramework\Unit\Utility\XsdValidator(); } diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Layout/_files/arguments.xml b/lib/internal/Magento/Framework/View/Test/Unit/Layout/_files/arguments.xml index cfda9d37a3fea1de5065684614d078e9ca51415a..0fd7a624d9e320b4d1dd07708e9381514fe8abc4 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Layout/_files/arguments.xml +++ b/lib/internal/Magento/Framework/View/Test/Unit/Layout/_files/arguments.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <block class="Magento\Test\Block" name="test.block"> <arguments> diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Layout/_files/invalidLayoutArgumentsXmlArray.php b/lib/internal/Magento/Framework/View/Test/Unit/Layout/_files/invalidLayoutArgumentsXmlArray.php index 0bb28856ca1479a34f6033a6edcf5778cf333ee3..b2f18c7a76979e5dc90b8c113da1173dfe01b42f 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Layout/_files/invalidLayoutArgumentsXmlArray.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Layout/_files/invalidLayoutArgumentsXmlArray.php @@ -14,7 +14,7 @@ return [ </block> </body> </page>', - ["Element 'argument': The attribute 'model' is required but missing."], ], + ["Element 'argument': The attribute 'model' is required but missing.\nLine: 5\n"], ], 'url without path attribute' => [ '<?xml version="1.0"?><page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <body> @@ -25,7 +25,7 @@ return [ </block> </body> </page>', - ["Element 'argument': The attribute 'path' is required but missing."], ], + ["Element 'argument': The attribute 'path' is required but missing.\nLine: 5\n"], ], 'url without param name' => [ '<?xml version="1.0"?><page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <body> @@ -38,7 +38,7 @@ return [ </block> </body> </page>', - ["Element 'param': The attribute 'name' is required but missing."], ], + ["Element 'param': The attribute 'name' is required but missing.\nLine: 6\n"], ], 'url with forbidden param attribute' => [ '<?xml version="1.0"?><page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <body> @@ -51,7 +51,7 @@ return [ </block> </body> </page>', - ["Element 'param', attribute 'forbidden': The attribute 'forbidden' is not allowed."], ], + ["Element 'param', attribute 'forbidden': The attribute 'forbidden' is not allowed.\nLine: 6\n"], ], 'url with forbidden param sub-element' => [ '<?xml version="1.0"?><page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <body> @@ -64,7 +64,7 @@ return [ </block> </body> </page>', - ["Element 'forbidden': This element is not expected."], ], + ["Element 'forbidden': This element is not expected.\nLine: 6\n"], ], 'helper without helper attribute' => [ '<?xml version="1.0"?><page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <body> @@ -75,7 +75,7 @@ return [ </block> </body> </page>', - ["Element 'argument': The attribute 'helper' is required but missing."], ], + ["Element 'argument': The attribute 'helper' is required but missing.\nLine: 5\n"], ], 'helper without param name' => [ '<?xml version="1.0"?><page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <body> @@ -89,7 +89,7 @@ return [ </block> </body> </page>', - ["Element 'param': The attribute 'name' is required but missing."], ], + ["Element 'param': The attribute 'name' is required but missing.\nLine: 7\n"], ], 'helper with forbidden param attribute' => [ '<?xml version="1.0"?><page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <body> @@ -103,7 +103,7 @@ return [ </block> </body> </page>', - ["Element 'param', attribute 'forbidden': The attribute 'forbidden' is not allowed."], ], + ["Element 'param', attribute 'forbidden': The attribute 'forbidden' is not allowed.\nLine: 7\n"], ], 'helper with forbidden param sub-element' => [ '<?xml version="1.0"?><page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <body> @@ -117,7 +117,7 @@ return [ </block> </body> </page>', - ["Element 'forbidden': This element is not expected."], ], + ["Element 'forbidden': This element is not expected.\nLine: 7\n"], ], 'action with doubled arguments' => [ '<?xml version="1.0"?><page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <body> @@ -130,6 +130,8 @@ return [ </body> </page>', [ - "Element 'argument': Duplicate key-sequence ['string'] in key identity-constraint 'actionArgumentName'." - ], ], + "Element 'argument': Duplicate key-sequence ['string'] in key identity-constraint" + . " 'actionArgumentName'.\nLine: 6\n" + ], + ], ]; diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/Update/ValidatorTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/Update/ValidatorTest.php index d279a539a1fca34e02c71d9b6d088e61e0c4c434..b35ffa554badaf392a91657609b1ea47c0c053c5 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/Update/ValidatorTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/Update/ValidatorTest.php @@ -26,26 +26,15 @@ class ValidatorTest extends \PHPUnit_Framework_TestCase */ protected function _createValidator($layoutUpdate, $isSchemaValid = true) { - $dirList = $this->getMockBuilder('Magento\Framework\App\Filesystem\DirectoryList') - ->disableOriginalConstructor() - ->getMock(); - $dirList->expects( - $this->exactly(2) - )->method( - 'getPath' - )->will( - $this->returnValue('dummyDir') - ); - $domConfigFactory = $this->getMockBuilder( 'Magento\Framework\Config\DomFactory' )->disableOriginalConstructor()->getMock(); + $urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); $params = [ - 'xml' => '<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">' . trim( - $layoutUpdate - ) . '</layout>', - 'schemaFile' => 'dummyDir/Magento/Framework/View/Layout/etc/page_layout.xsd', + 'xml' => '<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">' . + trim($layoutUpdate) . '</layout>', + 'schemaFile' => $urnResolver->getRealPath('urn:magento:framework:View/Layout/etc/page_layout.xsd'), ]; $exceptionMessage = 'validation exception'; @@ -60,10 +49,10 @@ class ValidatorTest extends \PHPUnit_Framework_TestCase new \Magento\Framework\Config\Dom\ValidationException($exceptionMessage) ) ); - + $urnResolver = $this->_objectHelper->getObject('Magento\Framework\Config\Dom\UrnResolver'); $model = $this->_objectHelper->getObject( 'Magento\Framework\View\Model\Layout\Update\Validator', - ['dirList' => $dirList, 'domConfigFactory' => $domConfigFactory] + ['domConfigFactory' => $domConfigFactory, 'urnResolver' => $urnResolver] ); return $model; @@ -87,7 +76,7 @@ class ValidatorTest extends \PHPUnit_Framework_TestCase false ) ); - $this->assertEquals($model->getMessages(), $messages); + $this->assertEquals($messages, $model->getMessages()); } /** diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Page/Config/_files/template_body.xml b/lib/internal/Magento/Framework/View/Test/Unit/Page/Config/_files/template_body.xml index e1a224775c69cf06a9aa3db53d91d7da3fe40ff9..58d789f17b74e53cf3b21f40bde6c7ccd1b866da 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Page/Config/_files/template_body.xml +++ b/lib/internal/Magento/Framework/View/Test/Unit/Page/Config/_files/template_body.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <attribute name="body_attribute_name" value="body_attribute_value" /> </body> diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Page/Config/_files/template_head.xml b/lib/internal/Magento/Framework/View/Test/Unit/Page/Config/_files/template_head.xml index 15873b46e98e04e944349560e7ef0a3814d24cfb..8c95c788373d627d8da42f0632789d46ed8e2c09 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Page/Config/_files/template_head.xml +++ b/lib/internal/Magento/Framework/View/Test/Unit/Page/Config/_files/template_head.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <title>Test title</title> <meta name="meta_name" content="meta_content"/> diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Page/Config/_files/template_html.xml b/lib/internal/Magento/Framework/View/Test/Unit/Page/Config/_files/template_html.xml index e767ae227c8510508f98e86f0286b1ad1484c32e..7b8455049e8ec6fc3d821530e0695de4738002fd 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Page/Config/_files/template_html.xml +++ b/lib/internal/Magento/Framework/View/Test/Unit/Page/Config/_files/template_html.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <html> <attribute name="html_attribute_name" value="html_attribute_value" /> </html> diff --git a/lib/internal/Magento/Framework/View/Test/Unit/PageLayout/ConfigTest.php b/lib/internal/Magento/Framework/View/Test/Unit/PageLayout/ConfigTest.php index 81c0544cd7d1aa56fe1c5e067a161e1043989267..8bdac494e98a6b3741038e5f21dec573e41174cf 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/PageLayout/ConfigTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/PageLayout/ConfigTest.php @@ -17,10 +17,17 @@ class ConfigTest extends \PHPUnit_Framework_TestCase protected function setUp() { + $urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); + $urnResolverMock = $this->getMock('Magento\Framework\Config\Dom\UrnResolver', [], [], '', false); + $urnResolverMock->expects($this->once()) + ->method('getRealPath') + ->with('urn:magento:framework:View/PageLayout/etc/layouts.xsd') + ->willReturn($urnResolver->getRealPath('urn:magento:framework:View/PageLayout/etc/layouts.xsd')); $objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->config = $objectManagerHelper->getObject( 'Magento\Framework\View\PageLayout\Config', [ + 'urnResolver' => $urnResolverMock, 'configFiles' => [ 'layouts_one.xml' => file_get_contents(__DIR__ . '/_files/layouts_one.xml'), 'layouts_two.xml' => file_get_contents(__DIR__ . '/_files/layouts_two.xml'), diff --git a/lib/internal/Magento/Framework/View/Test/Unit/PageLayout/_files/layouts_one.xml b/lib/internal/Magento/Framework/View/Test/Unit/PageLayout/_files/layouts_one.xml index 03edcaa31cfe6c27121cbdc6b520300f078d70ae..d042bdbcee4505772368a5a9d926a6dedfd0189d 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/PageLayout/_files/layouts_one.xml +++ b/lib/internal/Magento/Framework/View/Test/Unit/PageLayout/_files/layouts_one.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/View/PageLayout/etc/layouts.xsd"> +<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/PageLayout/etc/layouts.xsd"> <layout id="one"> <label translate="true">One</label> </layout> diff --git a/lib/internal/Magento/Framework/View/Test/Unit/PageLayout/_files/layouts_two.xml b/lib/internal/Magento/Framework/View/Test/Unit/PageLayout/_files/layouts_two.xml index b0454e59c17b6efb7c01dd2cb3a1551dc79b6b56..7d31ced96975792db65331233e0c92d767370223 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/PageLayout/_files/layouts_two.xml +++ b/lib/internal/Magento/Framework/View/Test/Unit/PageLayout/_files/layouts_two.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/internal/Magento/Framework/View/PageLayout/etc/layouts.xsd"> +<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/PageLayout/etc/layouts.xsd"> <layout id="two"> <label translate="true">Two</label> </layout> diff --git a/lib/internal/Magento/Framework/View/Xsd/Reader.php b/lib/internal/Magento/Framework/View/Xsd/Reader.php index 0c7bb78d4e7b532d5c6243f1b9d8d736ed4b0543..7891ba7e0143c7e073e0f1955c9b10cbdc22c20a 100644 --- a/lib/internal/Magento/Framework/View/Xsd/Reader.php +++ b/lib/internal/Magento/Framework/View/Xsd/Reader.php @@ -5,9 +5,11 @@ */ namespace Magento\Framework\View\Xsd; -use Magento\Framework\Filesystem; +use Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\DirSearch; +use Magento\Framework\Config\Dom\UrnResolver; use Magento\Framework\Config\FileIteratorFactory; -use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Filesystem; class Reader implements \Magento\Framework\Config\ReaderInterface { @@ -22,69 +24,68 @@ class Reader implements \Magento\Framework\Config\ReaderInterface protected $fileName; /** - * @var \Magento\Framework\Filesystem\Directory\ReadInterface - */ - protected $directoryRead; - - /** - * @var \Magento\Framework\Config\FileIteratorFactory + * @var DirSearch */ - protected $iteratorFactory; + protected $componentDirSearch; /** * @var string */ - protected $searchPattern; + protected $searchFilesPattern; + + /** @var \Magento\Framework\Config\Dom\UrnResolver */ + protected $urnResolver; /** - * @var string + * @var FileIteratorFactory */ - protected $searchFilesPattern; + private $iteratorFactory; /** - * @param Filesystem $filesystem + * @param DirSearch $dirSearch + * @param UrnResolver $urnResolver * @param FileIteratorFactory $iteratorFactory * @param string $fileName * @param string $defaultScope - * @param string $searchPattern * @param string $searchFilesPattern */ public function __construct( - Filesystem $filesystem, + DirSearch $dirSearch, + UrnResolver $urnResolver, FileIteratorFactory $iteratorFactory, $fileName, $defaultScope, - $searchPattern, $searchFilesPattern ) { - $this->directoryRead = $filesystem->getDirectoryRead(DirectoryList::MODULES); - $this->iteratorFactory = $iteratorFactory; + $this->componentDirSearch = $dirSearch; + $this->urnResolver = $urnResolver; $this->fileName = $fileName; $this->defaultScope = $defaultScope; - $this->searchPattern = $searchPattern; $this->searchFilesPattern = $searchFilesPattern; + $this->iteratorFactory = $iteratorFactory; } /** * Get list of xsd files * * @param string $filename - * @return \Magento\Framework\Config\FileIterator + * @return array */ public function getListXsdFiles($filename) { - $iterator = $this->iteratorFactory->create( - $this->directoryRead, - $this->directoryRead->search($this->searchPattern . $filename) + return $this->iteratorFactory->create( + array_merge( + $this->componentDirSearch->collectFiles(ComponentRegistrar::MODULE, 'etc/' . $filename), + $this->componentDirSearch->collectFiles(ComponentRegistrar::LIBRARY, '*/etc/' . $filename) + ) ); - return $iterator; } /** * Read xsd files from list * * @param null $scope - * @return array|\Magento\Framework\Config\FileIterator + * @return array * @throws \Magento\Framework\Exception\LocalizedException * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ @@ -110,9 +111,13 @@ class Reader implements \Magento\Framework\Config\ReaderInterface public function readXsdFiles($fileList, $baseXsd = null) { $baseXsd = new \DOMDocument(); - $baseXsd->load(__DIR__ . $this->searchFilesPattern . $this->fileName); + $baseXsdPath = $this->urnResolver->getRealPath($this->searchFilesPattern . $this->fileName); + $baseXsd->load($baseXsdPath); $configMerge = null; foreach ($fileList as $key => $content) { + if ($key == $baseXsdPath) { + continue; + } try { if (!empty($content)) { if ($configMerge) { diff --git a/lib/internal/Magento/Framework/composer.json b/lib/internal/Magento/Framework/composer.json index 0e4c4462546d2bd603de51e0fde07a46db1922dc..061a0f9c765c68772f18406aa59a0f1bb77a6eb8 100644 --- a/lib/internal/Magento/Framework/composer.json +++ b/lib/internal/Magento/Framework/composer.json @@ -18,23 +18,15 @@ "ext-iconv": "*", "ext-gd": "*", "lib-libxml": "*", - "ext-xsl": "*", - "magento/magento-composer-installer": "*" + "ext-xsl": "*" }, "suggest": { "ext-imagick": "Use Image Magick >=3.0.0 as an optional alternative image processing library" }, - "extra": { - "map": [ - [ - "*", - "Magento/Framework" - ] - ] - }, "autoload": { "psr-4": { "Magento\\Framework\\": "" - } + }, + "files": [ "registration.php" ] } } diff --git a/lib/internal/Magento/Framework/registration.php b/lib/internal/Magento/Framework/registration.php new file mode 100644 index 0000000000000000000000000000000000000000..1152ebad30d44d241ffddf72fd499585779ef07a --- /dev/null +++ b/lib/internal/Magento/Framework/registration.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +\Magento\Framework\Component\ComponentRegistrar::register( + \Magento\Framework\Component\ComponentRegistrar::LIBRARY, + 'magento/framework', + __DIR__ +); diff --git a/nginx.conf.sample b/nginx.conf.sample index 01b163498156956cb37f9ea99a5f5f9c9817981c..137ef8205deda016379d2b4a2abd4f103f8f9882 100644 --- a/nginx.conf.sample +++ b/nginx.conf.sample @@ -24,6 +24,9 @@ index index.php; autoindex off; charset off; +add_header 'X-Content-Type-Options' 'nosniff'; +add_header 'X-XSS-Protection' '1; mode=block'; + location /setup { root $MAGE_ROOT; location ~ ^/setup/index.php { diff --git a/setup/config/di.config.php b/setup/config/di.config.php index 120b32b928ce57115b3007da9e0feb15b5232d84..e7f0ac693af6cfc74d8ec18a9b98ac2585e952b3 100644 --- a/setup/config/di.config.php +++ b/setup/config/di.config.php @@ -44,8 +44,9 @@ return [ 'Zend\ServiceManager\ServiceLocatorInterface' => 'ServiceManager', 'Magento\Framework\DB\LoggerInterface' => 'Magento\Framework\DB\Logger\Quiet', 'Magento\Framework\Locale\ConfigInterface' => 'Magento\Framework\Locale\Config', - 'Magento\Framework\Module\ModuleRegistryInterface' => 'Magento\Framework\Module\Registrar', 'Magento\Framework\Filesystem\DriverInterface' => 'Magento\Framework\Filesystem\Driver\File', + 'Magento\Framework\Component\ComponentRegistrarInterface' => + 'Magento\Framework\Component\ComponentRegistrar', ], ], ], diff --git a/setup/pub/magento/setup/readiness-check.js b/setup/pub/magento/setup/readiness-check.js index fbbbdf1540e6d6d93fb2c58bad9c4e10c342422e..e1c8a0ad9db5d043270cfbe46a5355e47ee7bdf8 100644 --- a/setup/pub/magento/setup/readiness-check.js +++ b/setup/pub/magento/setup/readiness-check.js @@ -7,6 +7,7 @@ angular.module('readiness-check', []) .constant('COUNTER', 1) .controller('readinessCheckController', ['$rootScope', '$scope', '$localStorage', '$http', '$timeout', '$sce', '$state', 'COUNTER', function ($rootScope, $scope, $localStorage, $http, $timeout, $sce, $state, COUNTER) { + $scope.Object = Object; $scope.titles = $localStorage.titles; $scope.moduleName = $localStorage.moduleName; $scope.progressCounter = COUNTER; @@ -152,6 +153,7 @@ angular.module('readiness-check', []) process: function(data) { $scope.extensions.processed = true; angular.extend($scope.extensions, data); + $scope.extensions.length = Object.keys($scope.extensions.data.required).length; $scope.updateOnProcessed($scope.extensions.responseType); $scope.stopProgress(); }, diff --git a/setup/src/Magento/Setup/Console/Command/AbstractDependenciesCommand.php b/setup/src/Magento/Setup/Console/Command/AbstractDependenciesCommand.php index 5a604c2e8eb9a6a94a246d63f5dfb7ce47bbabfb..f1331ff415293d925ce517cacf6550742aac2c62 100644 --- a/setup/src/Magento/Setup/Console/Command/AbstractDependenciesCommand.php +++ b/setup/src/Magento/Setup/Console/Command/AbstractDependenciesCommand.php @@ -6,6 +6,12 @@ namespace Magento\Setup\Console\Command; use Magento\Framework\App\Utility\Files; +use Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\DirSearch; +use Magento\Framework\Filesystem\Directory\ReadFactory; +use Magento\Framework\ObjectManager\ObjectManager; +use Magento\Framework\View\Design\Theme\ThemePackageList; +use Magento\Setup\Model\ObjectManagerProvider; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputInterface; @@ -26,6 +32,24 @@ abstract class AbstractDependenciesCommand extends Command */ const INPUT_KEY_OUTPUT = 'output'; + /** + * Object Manager + * + * @var ObjectManager + */ + private $objectManager; + + /** + * Constructor + * + * @param ObjectManagerProvider $objectManagerProvider + */ + public function __construct(ObjectManagerProvider $objectManagerProvider) + { + $this->objectManager = $objectManagerProvider->get(); + parent::__construct(); + } + /** * {@inheritdoc} */ @@ -33,13 +57,6 @@ abstract class AbstractDependenciesCommand extends Command { $this->setDefinition( [ - new InputOption( - self::INPUT_KEY_DIRECTORY, - 'd', - InputOption::VALUE_REQUIRED, - 'Path to base directory for parsing', - BP - ), new InputOption( self::INPUT_KEY_OUTPUT, 'o', @@ -73,7 +90,13 @@ abstract class AbstractDependenciesCommand extends Command protected function execute(InputInterface $input, OutputInterface $output) { try { - Files::setInstance(new Files($input->getOption(self::INPUT_KEY_DIRECTORY))); + /** @var \Magento\Framework\Component\ComponentRegistrar $componentRegistrar */ + $componentRegistrar = $this->objectManager->get('Magento\Framework\Component\ComponentRegistrar'); + /** @var \Magento\Framework\Component\DirSearch $dirSearch */ + $dirSearch = $this->objectManager->get('Magento\Framework\Component\DirSearch'); + /** @var \Magento\Framework\View\Design\Theme\ThemePackageList $themePackageList */ + $themePackageList = $this->objectManager->get('Magento\Framework\View\Design\Theme\ThemePackageList'); + Files::setInstance(new Files($componentRegistrar, $dirSearch, $themePackageList)); $this->buildReport($input->getOption(self::INPUT_KEY_OUTPUT)); $output->writeln('<info>Report successfully processed.</info>'); } catch (\Exception $e) { diff --git a/setup/src/Magento/Setup/Console/Command/DependenciesShowFrameworkCommand.php b/setup/src/Magento/Setup/Console/Command/DependenciesShowFrameworkCommand.php index c665ff7f3edcc419ddba64600a0cb8c58b73b67e..d928b4afae881f676f9fab65992e2d8973c1a042 100644 --- a/setup/src/Magento/Setup/Console/Command/DependenciesShowFrameworkCommand.php +++ b/setup/src/Magento/Setup/Console/Command/DependenciesShowFrameworkCommand.php @@ -7,6 +7,9 @@ namespace Magento\Setup\Console\Command; use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\App\Utility\Files; +use Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Component\ComponentRegistrarInterface; +use Magento\Setup\Model\ObjectManagerProvider; use Magento\Setup\Module\Dependency\ServiceLocator; /** @@ -15,19 +18,20 @@ use Magento\Setup\Module\Dependency\ServiceLocator; class DependenciesShowFrameworkCommand extends AbstractDependenciesCommand { /** - * @var DirectoryList + * @var ComponentRegistrarInterface */ - private $directoryList; + private $registrar; /** * Constructor - * - * @param DirectoryList $directoryList + * + * @param ComponentRegistrarInterface $registrar + * @param ObjectManagerProvider $objectManagerProvider */ - public function __construct(DirectoryList $directoryList) + public function __construct(ComponentRegistrarInterface $registrar, ObjectManagerProvider $objectManagerProvider) { - $this->directoryList = $directoryList; - parent::__construct(); + $this->registrar = $registrar; + parent::__construct($objectManagerProvider); } /** @@ -58,13 +62,9 @@ class DependenciesShowFrameworkCommand extends AbstractDependenciesCommand */ protected function buildReport($outputPath) { - $root = $this->directoryList->getRoot(); - $filePath = str_replace( - $root, - Files::init()->getPathToSource(), - $this->directoryList->getPath(DirectoryList::MODULES) . '/Magento' - ); - $filesForParse = Files::init()->getFiles([$filePath], '*'); + $filePaths = $this->registrar->getPaths(ComponentRegistrar::MODULE); + + $filesForParse = Files::init()->getFiles($filePaths, '*'); $configFiles = Files::init()->getConfigFiles('module.xml', [], false); ServiceLocator::getFrameworkDependenciesReportBuilder()->build( diff --git a/setup/src/Magento/Setup/Console/Command/DependenciesShowModulesCircularCommand.php b/setup/src/Magento/Setup/Console/Command/DependenciesShowModulesCircularCommand.php index 01b2208f57f13bbe60d6d44c34c0f5024dc2596b..587298b0645d9d49de691181d752c61a56390c3a 100644 --- a/setup/src/Magento/Setup/Console/Command/DependenciesShowModulesCircularCommand.php +++ b/setup/src/Magento/Setup/Console/Command/DependenciesShowModulesCircularCommand.php @@ -6,6 +6,7 @@ namespace Magento\Setup\Console\Command; use Magento\Framework\App\Utility\Files; +use Magento\Framework\Component\ComponentRegistrar; use Magento\Setup\Module\Dependency\ServiceLocator; /** @@ -41,8 +42,9 @@ class DependenciesShowModulesCircularCommand extends AbstractDependenciesCommand */ protected function buildReport($outputPath) { - $filesForParse = Files::init()->getComposerFiles('code', false); + $filesForParse = Files::init()->getComposerFiles(ComponentRegistrar::MODULE, false); + asort($filesForParse); ServiceLocator::getCircularDependenciesReportBuilder()->build( [ 'parse' => ['files_for_parse' => $filesForParse], diff --git a/setup/src/Magento/Setup/Console/Command/DependenciesShowModulesCommand.php b/setup/src/Magento/Setup/Console/Command/DependenciesShowModulesCommand.php index 429d36c89d00fe51d136141afbdf11ce2dce4850..baffb1b7e63d1651204475acce465324052608d9 100644 --- a/setup/src/Magento/Setup/Console/Command/DependenciesShowModulesCommand.php +++ b/setup/src/Magento/Setup/Console/Command/DependenciesShowModulesCommand.php @@ -6,6 +6,7 @@ namespace Magento\Setup\Console\Command; use Magento\Framework\App\Utility\Files; +use Magento\Framework\Component\ComponentRegistrar; use Magento\Setup\Module\Dependency\ServiceLocator; /** @@ -41,7 +42,7 @@ class DependenciesShowModulesCommand extends AbstractDependenciesCommand */ protected function buildReport($outputPath) { - $filesForParse = Files::init()->getComposerFiles('code', false); + $filesForParse = Files::init()->getComposerFiles(ComponentRegistrar::MODULE, false); ServiceLocator::getDependenciesReportBuilder()->build( [ diff --git a/setup/src/Magento/Setup/Console/Command/DiCompileCommand.php b/setup/src/Magento/Setup/Console/Command/DiCompileCommand.php index 05a46aac47dade5b0a8f9b40ad7eeb16ea175388..b404778db1629d69099f5289e0f04e8892ee3d33 100644 --- a/setup/src/Magento/Setup/Console/Command/DiCompileCommand.php +++ b/setup/src/Magento/Setup/Console/Command/DiCompileCommand.php @@ -11,6 +11,7 @@ use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\Filesystem\DriverInterface; use Magento\Framework\ObjectManagerInterface; use Magento\Framework\App\DeploymentConfig; +use Magento\Framework\Component\ComponentRegistrar; use Magento\Setup\Model\ObjectManagerProvider; use Magento\Setup\Module\Di\App\Task\Manager; use Magento\Setup\Module\Di\App\Task\OperationFactory; @@ -48,6 +49,11 @@ class DiCompileCommand extends Command /** @var DriverInterface */ private $fileDriver; + /** + * @var ComponentRegistrar + */ + private $componentRegistrar; + /** * Constructor * @@ -57,6 +63,7 @@ class DiCompileCommand extends Command * @param ObjectManagerProvider $objectManagerProvider * @param Filesystem $filesystem * @param DriverInterface $fileDriver + * @param \Magento\Framework\Component\ComponentRegistrar $componentRegistrar */ public function __construct( DeploymentConfig $deploymentConfig, @@ -64,7 +71,8 @@ class DiCompileCommand extends Command Manager $taskManager, ObjectManagerProvider $objectManagerProvider, Filesystem $filesystem, - DriverInterface $fileDriver + DriverInterface $fileDriver, + ComponentRegistrar $componentRegistrar ) { $this->deploymentConfig = $deploymentConfig; $this->directoryList = $directoryList; @@ -72,6 +80,7 @@ class DiCompileCommand extends Command $this->taskManager = $taskManager; $this->filesystem = $filesystem; $this->fileDriver = $fileDriver; + $this->componentRegistrar = $componentRegistrar; parent::__construct(); } @@ -127,19 +136,27 @@ class DiCompileCommand extends Command return; } - $appCodePath = $this->directoryList->getPath(DirectoryList::MODULES); - $libraryPath = $this->directoryList->getPath(DirectoryList::LIB_INTERNAL); + $modulePaths = $this->componentRegistrar->getPaths(ComponentRegistrar::MODULE); + $libraryPaths = $this->componentRegistrar->getPaths(ComponentRegistrar::LIBRARY); $generationPath = $this->directoryList->getPath(DirectoryList::GENERATION); $this->objectManager->get('Magento\Framework\App\Cache')->clean(); $compiledPathsList = [ - 'application' => $appCodePath, - 'library' => $libraryPath . '/Magento/Framework', + 'application' => $modulePaths, + 'library' => $libraryPaths, 'generated_helpers' => $generationPath ]; + $excludedModulePaths = []; + foreach ($modulePaths as $appCodePath) { + $excludedModulePaths[] = '#^' . $appCodePath . '/Test#'; + } + $excludedLibraryPaths = []; + foreach ($libraryPaths as $libraryPath) { + $excludedLibraryPaths[] = '#^' . $libraryPath . '/([\\w]+/)?Test#'; + } $this->excludedPathsList = [ - 'application' => '#^' . $appCodePath . '/[\\w]+/[\\w]+/Test#', - 'framework' => '#^' . $libraryPath . '/[\\w]+/[\\w]+/([\\w]+/)?Test#' + 'application' => $excludedModulePaths, + 'framework' => $excludedLibraryPaths ]; $dataAttributesIncludePattern = [ 'extension_attributes' => '/\/etc\/([a-zA-Z_]*\/extension_attributes|extension_attributes)\.xml$/' @@ -276,11 +293,11 @@ class DiCompileCommand extends Command ) { $operations = [ OperationFactory::REPOSITORY_GENERATOR => [ - 'path' => $compiledPathsList['application'], + 'paths' => $compiledPathsList['application'], 'filePatterns' => ['di' => '/\/etc\/([a-zA-Z_]*\/di|di)\.xml$/'] ], OperationFactory::DATA_ATTRIBUTES_GENERATOR => [ - 'path' => $compiledPathsList['application'], + 'paths' => $compiledPathsList['application'], 'filePatterns' => $dataAttributesIncludePattern ], OperationFactory::APPLICATION_CODE_GENERATOR => [ diff --git a/setup/src/Magento/Setup/Console/Command/DiCompileMultiTenantCommand.php b/setup/src/Magento/Setup/Console/Command/DiCompileMultiTenantCommand.php index 95cac1be21853d08406f84100d5e84eefe065146..33f8f763ede317220fb6fb2e491a9dfc84839acd 100644 --- a/setup/src/Magento/Setup/Console/Command/DiCompileMultiTenantCommand.php +++ b/setup/src/Magento/Setup/Console/Command/DiCompileMultiTenantCommand.php @@ -14,6 +14,7 @@ use Symfony\Component\Console\Input\InputOption; use Magento\Framework\Api\Code\Generator\Mapper; use Magento\Framework\Api\Code\Generator\SearchResults; use Magento\Framework\Autoload\AutoloaderRegistry; +use Magento\Framework\Component\ComponentRegistrar; use Magento\Framework\Interception\Code\Generator\Interceptor; use Magento\Framework\ObjectManager\Code\Generator\Converter; use Magento\Framework\ObjectManager\Code\Generator\Factory; @@ -79,7 +80,7 @@ class DiCompileMultiTenantCommand extends AbstractSetupCommand * * @var array */ - private $files; + private $files = []; /** * @@ -93,16 +94,26 @@ class DiCompileMultiTenantCommand extends AbstractSetupCommand */ private $log; + /** + * @var ComponentRegistrar + */ + private $componentRegistrar; + /** * Constructor * * @param ObjectManagerProvider $objectManagerProvider * @param DirectoryList $directoryList + * @param ComponentRegistrar $componentRegistrar */ - public function __construct(ObjectManagerProvider $objectManagerProvider, DirectoryList $directoryList) - { + public function __construct( + ObjectManagerProvider $objectManagerProvider, + DirectoryList $directoryList, + ComponentRegistrar $componentRegistrar + ) { $this->objectManager = $objectManagerProvider->get(); $this->directoryList = $directoryList; + $this->componentRegistrar = $componentRegistrar; parent::__construct(); } @@ -153,6 +164,34 @@ class DiCompileMultiTenantCommand extends AbstractSetupCommand parent::configure(); } + /** + * Get module directories exclude patterns + * + * @return array + */ + private function getModuleExcludePatterns() + { + $modulesExcludePatterns = []; + foreach ($this->componentRegistrar->getPaths(ComponentRegistrar::MODULE) as $modulePath) { + $modulesExcludePatterns[] = "#^" . $modulePath . "/Test#"; + } + return $modulesExcludePatterns; + } + + /** + * Get library directories exclude patterns + * + * @return array + */ + private function getLibraryExcludePatterns() + { + $libraryExcludePatterns = []; + foreach ($this->componentRegistrar->getPaths(ComponentRegistrar::LIBRARY) as $libraryPath) { + $libraryExcludePatterns[] = "#^" . $libraryPath . "/([\\w]+/)?Test#"; + } + return $libraryExcludePatterns; + } + /** * {@inheritdoc} */ @@ -166,13 +205,13 @@ class DiCompileMultiTenantCommand extends AbstractSetupCommand $generationDir = $input->getOption(self::INPUT_KEY_GENERATION) ? $input->getOption(self::INPUT_KEY_GENERATION) : $this->directoryList->getPath(DirectoryList::GENERATION); + $modulesExcludePatterns = $this->getModuleExcludePatterns(); $testExcludePatterns = [ - "#^" . $this->directoryList->getPath(DirectoryList::MODULES) . "/[\\w]+/[\\w]+/Test#", - "#^" . $this->directoryList->getPath(DirectoryList::LIB_INTERNAL) - . "/[\\w]+/[\\w]+/([\\w]+/)?Test#", "#^" . $this->directoryList->getPath(DirectoryList::SETUP) . "/[\\w]+/[\\w]+/Test#", "#^" . $this->directoryList->getRoot() . "/dev/tools/Magento/Tools/[\\w]+/Test#" ]; + $librariesExcludePatterns = $this->getLibraryExcludePatterns(); + $testExcludePatterns = array_merge($testExcludePatterns, $modulesExcludePatterns, $librariesExcludePatterns); $fileExcludePatterns = $input->getOption('exclude-pattern') ? [$input->getOption(self::INPUT_KEY_EXCLUDE_PATTERN)] : ['#[\\\\/]M1[\\\\/]#i']; $fileExcludePatterns = array_merge($fileExcludePatterns, $testExcludePatterns); @@ -211,9 +250,13 @@ class DiCompileMultiTenantCommand extends AbstractSetupCommand { // 1.1 Code scan $filePatterns = ['php' => '/.*\.php$/', 'di' => '/\/etc\/([a-zA-Z_]*\/di|di)\.xml$/']; - $codeScanDir = $this->directoryList->getRoot() . '/app'; $directoryScanner = new Scanner\DirectoryScanner(); - $this->files = $directoryScanner->scan($codeScanDir, $filePatterns, $fileExcludePatterns); + foreach ($this->componentRegistrar->getPaths(ComponentRegistrar::MODULE) as $codeScanDir) { + $this->files = array_merge_recursive( + $this->files, + $directoryScanner->scan($codeScanDir, $filePatterns, $fileExcludePatterns) + ); + } $this->files['additional'] = [$input->getOption(self::INPUT_KEY_EXTRA_CLASSES_FILE)]; $repositoryScanner = new Scanner\RepositoryScanner(); $repositories = $repositoryScanner->collectEntities($this->files['di']); @@ -301,11 +344,14 @@ class DiCompileMultiTenantCommand extends AbstractSetupCommand $relationsFile = $diDir . '/relations.ser'; $pluginDefFile = $diDir . '/plugins.ser'; $compilationDirs = [ - $this->directoryList->getPath(DirectoryList::MODULES), - $this->directoryList->getPath(DirectoryList::LIB_INTERNAL) . '/Magento', $this->directoryList->getPath(DirectoryList::SETUP) . '/Magento/Setup/Module', $this->directoryList->getRoot() . '/dev/tools/Magento/Tools', ]; + $compilationDirs = array_merge( + $compilationDirs, + $this->componentRegistrar->getPaths(ComponentRegistrar::MODULE), + $this->componentRegistrar->getPaths(ComponentRegistrar::LIBRARY) + ); $serializer = $input->getOption(self::INPUT_KEY_SERIALIZER) == Igbinary::NAME ? new Igbinary() : new Standard(); // 2.1 Code scan $validator = new \Magento\Framework\Code\Validator(); diff --git a/setup/src/Magento/Setup/Model/ConfigOptionsList.php b/setup/src/Magento/Setup/Model/ConfigOptionsList.php index 1011731e112dcfc844cd9c3727eb009d2acf06c3..bcc84dca9bd7fa8fdb6477b5b759e7aa2b78ded1 100644 --- a/setup/src/Magento/Setup/Model/ConfigOptionsList.php +++ b/setup/src/Magento/Setup/Model/ConfigOptionsList.php @@ -18,21 +18,28 @@ use Magento\Framework\App\ObjectManagerFactory; /** * Deployment configuration options needed for Setup application + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class ConfigOptionsList implements ConfigOptionsListInterface { /** * Generate config data for individual segments * - * @var ConfigGenerator + * @var ConfigGenerator */ private $configGenerator; - /** - * @var DbValidator - */ + /** @var DbValidator */ private $dbValidator; + /** @var array */ + private $validSaveHandlers = [ + ConfigOptionsListConstants::SESSION_SAVE_FILES, + ConfigOptionsListConstants::SESSION_SAVE_DB, + ConfigOptionsListConstants::SESSION_SAVE_REDIS + ]; + /** * Constructor * @@ -61,9 +68,9 @@ class ConfigOptionsList implements ConfigOptionsListInterface new SelectConfigOption( ConfigOptionsListConstants::INPUT_KEY_SESSION_SAVE, SelectConfigOption::FRONTEND_WIZARD_SELECT, - [ConfigOptionsListConstants::SESSION_SAVE_FILES, ConfigOptionsListConstants::SESSION_SAVE_DB], + $this->validSaveHandlers, ConfigOptionsListConstants::CONFIG_PATH_SESSION_SAVE, - 'Session save location', + 'Session save handler', ConfigOptionsListConstants::SESSION_SAVE_FILES ), new SelectConfigOption( @@ -260,15 +267,10 @@ class ConfigOptionsList implements ConfigOptionsListInterface private function validateSessionSave(array $options) { $errors = []; - - if (isset($options[ConfigOptionsListConstants::INPUT_KEY_SESSION_SAVE])) { - if ($options[ConfigOptionsListConstants::INPUT_KEY_SESSION_SAVE] - != ConfigOptionsListConstants::SESSION_SAVE_FILES - && $options[ConfigOptionsListConstants::INPUT_KEY_SESSION_SAVE] - != ConfigOptionsListConstants::SESSION_SAVE_DB - ) { - $errors[] = 'Invalid session save location.'; - } + if (isset($options[ConfigOptionsListConstants::INPUT_KEY_SESSION_SAVE]) + && !in_array($options[ConfigOptionsListConstants::INPUT_KEY_SESSION_SAVE], $this->validSaveHandlers) + ) { + $errors[] = "Invalid session handler '{$options[ConfigOptionsListConstants::INPUT_KEY_SESSION_SAVE]}'"; } return $errors; @@ -286,7 +288,7 @@ class ConfigOptionsList implements ConfigOptionsListInterface if (isset($options[ConfigOptionsListConstants::INPUT_KEY_ENCRYPTION_KEY]) && !$options[ConfigOptionsListConstants::INPUT_KEY_ENCRYPTION_KEY]) { - $errors[] = 'Invalid encryption key.'; + $errors[] = 'Invalid encryption key'; } return $errors; diff --git a/setup/src/Magento/Setup/Model/Installer.php b/setup/src/Magento/Setup/Model/Installer.php index 51692aebce7520d6c389ff2d55b518296c1d8439..0afe71e591b6e5fb3a6837455a869a6aa69f44f9 100644 --- a/setup/src/Magento/Setup/Model/Installer.php +++ b/setup/src/Magento/Setup/Model/Installer.php @@ -11,6 +11,7 @@ use Magento\Framework\App\DeploymentConfig\Reader; use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\App\MaintenanceMode; use Magento\Framework\App\Resource\Config; +use Magento\Framework\Component\ComponentRegistrar; use Magento\Framework\Config\ConfigOptionsListConstants; use Magento\Framework\Filesystem; use Magento\Framework\Exception\FileSystemException; @@ -204,6 +205,13 @@ class Installer */ private $dataSetupFactory; + /** + * Component Registrar + * + * @var ComponentRegistrar + */ + private $componentRegistrar; + /** * Constructor * @@ -225,6 +233,7 @@ class Installer * @param DbValidator $dbValidator * @param SetupFactory $setupFactory * @param DataSetupFactory $dataSetupFactory + * @param ComponentRegistrar $componentRegistrar * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ @@ -246,7 +255,8 @@ class Installer CleanupFiles $cleanupFiles, DbValidator $dbValidator, SetupFactory $setupFactory, - DataSetupFactory $dataSetupFactory + DataSetupFactory $dataSetupFactory, + ComponentRegistrar $componentRegistrar ) { $this->filePermissions = $filePermissions; $this->deploymentConfigWriter = $deploymentConfigWriter; @@ -267,6 +277,7 @@ class Installer $this->dbValidator = $dbValidator; $this->setupFactory = $setupFactory; $this->dataSetupFactory = $dataSetupFactory; + $this->componentRegistrar = $componentRegistrar; } /** @@ -297,7 +308,7 @@ class Installer $script[] = ['Installing admin user...', 'installAdminUser', [$request]]; $script[] = ['Enabling caches:', 'enableCaches', []]; if (!empty($request[InstallCommand::INPUT_KEY_USE_SAMPLE_DATA]) - && $this->filesystem->getDirectoryRead(DirectoryList::MODULES)->isExist('Magento/SampleData') + && $this->componentRegistrar->getPath(ComponentRegistrar::MODULE, 'Magento_SampleData') !== null ) { $script[] = ['Installing sample data:', 'installSampleData', [$request]]; } diff --git a/setup/src/Magento/Setup/Model/InstallerFactory.php b/setup/src/Magento/Setup/Model/InstallerFactory.php index 9d99342d21a193dbaf83636c436df9e5a4a22b37..0266a9c5261ef1a97abd97d08929d7245bcb8a48 100644 --- a/setup/src/Magento/Setup/Model/InstallerFactory.php +++ b/setup/src/Magento/Setup/Model/InstallerFactory.php @@ -71,7 +71,8 @@ class InstallerFactory $this->serviceLocator->get('Magento\Framework\App\State\CleanupFiles'), $this->serviceLocator->get('Magento\Setup\Validator\DbValidator'), $this->serviceLocator->get('Magento\Setup\Module\SetupFactory'), - $this->serviceLocator->get('Magento\Setup\Module\DataSetupFactory') + $this->serviceLocator->get('Magento\Setup\Module\DataSetupFactory'), + new \Magento\Framework\Component\ComponentRegistrar() ); } diff --git a/setup/src/Magento/Setup/Module/DataSetup.php b/setup/src/Magento/Setup/Module/DataSetup.php index 5766567f9d23d3b5e5694033491764d578f44104..ae926d232f6c118999221f817a9943a3af578747 100644 --- a/setup/src/Magento/Setup/Module/DataSetup.php +++ b/setup/src/Magento/Setup/Module/DataSetup.php @@ -20,13 +20,6 @@ class DataSetup extends \Magento\Framework\Module\Setup implements ModuleDataSet */ private $setupCache; - /** - * Modules configuration reader - * - * @var \Magento\Framework\Module\Dir\Reader - */ - private $_modulesReader; - /** * Event manager * @@ -55,13 +48,6 @@ class DataSetup extends \Magento\Framework\Module\Setup implements ModuleDataSet */ private $filesystem; - /** - * Modules list object - * - * @var \Magento\Framework\Filesystem\Directory\ReadInterface - */ - private $modulesDir; - /** * Init * @@ -75,10 +61,8 @@ class DataSetup extends \Magento\Framework\Module\Setup implements ModuleDataSet parent::__construct($context->getResourceModel(), $connectionName); $this->_eventManager = $context->getEventManager(); $this->_logger = $context->getLogger(); - $this->_modulesReader = $context->getModulesReader(); $this->_migrationFactory = $context->getMigrationFactory(); $this->filesystem = $context->getFilesystem(); - $this->modulesDir = $this->filesystem->getDirectoryRead(DirectoryList::MODULES); $this->setupCache = new SetupCache(); } diff --git a/setup/src/Magento/Setup/Module/Di/App/Task/Operation/ApplicationCodeGenerator.php b/setup/src/Magento/Setup/Module/Di/App/Task/Operation/ApplicationCodeGenerator.php index 82c13934833e18508cc61e4e20704d8d51703f97..3b412d15cc14a644951a23f9087e085a5daf4f38 100644 --- a/setup/src/Magento/Setup/Module/Di/App/Task/Operation/ApplicationCodeGenerator.php +++ b/setup/src/Magento/Setup/Module/Di/App/Task/Operation/ApplicationCodeGenerator.php @@ -41,8 +41,13 @@ class ApplicationCodeGenerator implements OperationInterface return; } - foreach ($this->data as $path) { - $this->classesScanner->getList($path); + foreach ($this->data as $paths) { + if (!is_array($paths)) { + $paths = (array)$paths; + } + foreach ($paths as $path) { + $this->classesScanner->getList($path); + } } } diff --git a/setup/src/Magento/Setup/Module/Di/App/Task/Operation/Area.php b/setup/src/Magento/Setup/Module/Di/App/Task/Operation/Area.php index 79c985af01d71c24b94c065115ff068122b80a54..9f681ec6dd619ff24ef66f1a5ec3c21decf942ed 100644 --- a/setup/src/Magento/Setup/Module/Di/App/Task/Operation/Area.php +++ b/setup/src/Magento/Setup/Module/Di/App/Task/Operation/Area.php @@ -76,8 +76,13 @@ class Area implements OperationInterface } $definitionsCollection = new DefinitionsCollection(); - foreach ($this->data as $path) { - $definitionsCollection->addCollection($this->getDefinitionsCollection($path)); + foreach ($this->data as $paths) { + if (!is_array($paths)) { + $paths = (array)$paths; + } + foreach ($paths as $path) { + $definitionsCollection->addCollection($this->getDefinitionsCollection($path)); + } } $areaCodes = array_merge([App\Area::AREA_GLOBAL], $this->areaList->getCodes()); diff --git a/setup/src/Magento/Setup/Module/Di/App/Task/Operation/Interception.php b/setup/src/Magento/Setup/Module/Di/App/Task/Operation/Interception.php index bfd3cfcf5e09d8abede8986852b85cbb24d3571f..0c48cd4f519ecc0547ddf5900fb192561e6f81ba 100644 --- a/setup/src/Magento/Setup/Module/Di/App/Task/Operation/Interception.php +++ b/setup/src/Magento/Setup/Module/Di/App/Task/Operation/Interception.php @@ -75,8 +75,13 @@ class Interception implements OperationInterface } $classesList = []; - foreach ($this->data['intercepted_paths'] as $path) { - $classesList = array_merge($classesList, $this->classesScanner->getList($path)); + foreach ($this->data['intercepted_paths'] as $paths) { + if (!is_array($paths)) { + $paths = (array)$paths; + } + foreach ($paths as $path) { + $classesList = array_merge($classesList, $this->classesScanner->getList($path)); + } } $generatorIo = new \Magento\Framework\Code\Generator\Io( diff --git a/setup/src/Magento/Setup/Module/Di/App/Task/Operation/InterceptionCache.php b/setup/src/Magento/Setup/Module/Di/App/Task/Operation/InterceptionCache.php index e99a15a9130620ec4d45e5f00e4ea83d515d30ae..6e224b4555c1dd75371125f183c92388b76fc5dc 100644 --- a/setup/src/Magento/Setup/Module/Di/App/Task/Operation/InterceptionCache.php +++ b/setup/src/Magento/Setup/Module/Di/App/Task/Operation/InterceptionCache.php @@ -51,8 +51,13 @@ class InterceptionCache implements OperationInterface } $definitions = []; - foreach ($this->data as $path) { - $definitions = array_merge($definitions, $this->interceptionsInstancesNamesList->getList($path)); + foreach ($this->data as $paths) { + if (!is_array($paths)) { + $paths = (array)$paths; + } + foreach ($paths as $path) { + $definitions = array_merge($definitions, $this->interceptionsInstancesNamesList->getList($path)); + } } $this->configInterface->initialize($definitions); diff --git a/setup/src/Magento/Setup/Module/Di/App/Task/Operation/RepositoryGenerator.php b/setup/src/Magento/Setup/Module/Di/App/Task/Operation/RepositoryGenerator.php index 22c57aea87fedd77b04b9fee03b2df78c18aa45e..cf3c779a3f77603eb3032d02d5134efa39d8af5e 100644 --- a/setup/src/Magento/Setup/Module/Di/App/Task/Operation/RepositoryGenerator.php +++ b/setup/src/Magento/Setup/Module/Di/App/Task/Operation/RepositoryGenerator.php @@ -57,14 +57,19 @@ class RepositoryGenerator implements OperationInterface */ public function doOperation() { - if (array_diff(array_keys($this->data), ['filePatterns', 'path']) - !== array_diff(['filePatterns', 'path'], array_keys($this->data))) { + if (array_diff(array_keys($this->data), ['filePatterns', 'paths']) + !== array_diff(['filePatterns', 'paths'], array_keys($this->data))) { return; } - $this->classesScanner->getList($this->data['path']); + foreach ($this->data['paths'] as $path) { + $this->classesScanner->getList($path); + } $this->repositoryScanner->setUseAutoload(false); - $files = $this->directoryScanner->scan($this->data['path'], $this->data['filePatterns']); + $files = []; + foreach ($this->data['paths'] as $path) { + $files = array_merge_recursive($files, $this->directoryScanner->scan($path, $this->data['filePatterns'])); + } $repositories = $this->repositoryScanner->collectEntities($files['di']); foreach ($repositories as $entityName) { class_exists($entityName); diff --git a/setup/src/Magento/Setup/Module/Di/App/Task/Operation/ServiceDataAttributesGenerator.php b/setup/src/Magento/Setup/Module/Di/App/Task/Operation/ServiceDataAttributesGenerator.php index 46b75bf10efeffef190264e3ff7fdfa37fe3492e..0a28df86d27fc2b6fa8c4221a98798fbb9c8f7c0 100644 --- a/setup/src/Magento/Setup/Module/Di/App/Task/Operation/ServiceDataAttributesGenerator.php +++ b/setup/src/Magento/Setup/Module/Di/App/Task/Operation/ServiceDataAttributesGenerator.php @@ -53,12 +53,14 @@ class ServiceDataAttributesGenerator implements OperationInterface */ public function doOperation() { - if (array_diff(array_keys($this->data), ['filePatterns', 'path']) - !== array_diff(['filePatterns', 'path'], array_keys($this->data))) { + if (array_diff(array_keys($this->data), ['filePatterns', 'paths']) + !== array_diff(['filePatterns', 'paths'], array_keys($this->data))) { return; } - - $files = $this->directoryScanner->scan($this->data['path'], $this->data['filePatterns']); + $files = []; + foreach ($this->data['paths'] as $path) { + $files = array_merge_recursive($files, $this->directoryScanner->scan($path, $this->data['filePatterns'])); + } $repositories = $this->serviceDataAttributesScanner->collectEntities($files['extension_attributes']); foreach ($repositories as $entityName) { class_exists($entityName); diff --git a/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php b/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php index 8e52fc761c4d2ce3fa21ea902bf2cd396298ab5b..38848ef13caafd2d9c72e32bae2b005de318de84 100644 --- a/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php +++ b/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php @@ -58,8 +58,8 @@ class ClassesScanner implements ClassesScannerInterface if ($fileItem->getExtension() !== 'php') { continue; } - foreach ($this->excludePatterns as $excludePattern) { - if (preg_match($excludePattern, $fileItem->getRealPath())) { + foreach ($this->excludePatterns as $excludePatterns) { + if ($this->isExclude($fileItem, $excludePatterns)) { continue 2; } } @@ -74,4 +74,24 @@ class ClassesScanner implements ClassesScannerInterface } return $classes; } + + /** + * Find out if file should be excluded + * + * @param \SplFileInfo $fileItem + * @param string $patterns + * @return bool + */ + private function isExclude(\SplFileInfo $fileItem, $patterns) + { + if (!is_array($patterns)) { + $patterns = (array)$patterns; + } + foreach ($patterns as $pattern) { + if (preg_match($pattern, $fileItem->getRealPath())) { + return true; + } + } + return false; + } } diff --git a/setup/src/Magento/Setup/Module/I18n/Context.php b/setup/src/Magento/Setup/Module/I18n/Context.php index 165669bbced84a6cb7490065bee00257ec6c780a..4944390f175c3e80c5a1933d24a5b67deba6efde 100644 --- a/setup/src/Magento/Setup/Module/I18n/Context.php +++ b/setup/src/Magento/Setup/Module/I18n/Context.php @@ -5,6 +5,10 @@ */ namespace Magento\Setup\Module\I18n; +use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Filesystem; + /** * Context */ @@ -26,6 +30,21 @@ class Context /**#@-*/ + /** + * @var ComponentRegistrar + */ + private $componentRegistrar; + + /** + * Constructor + * + * @param ComponentRegistrar $componentRegistrar + */ + public function __construct(ComponentRegistrar $componentRegistrar) + { + $this->componentRegistrar = $componentRegistrar; + } + /** * Get context from file path in array(<context type>, <context value>) format * - for module: <Namespace>_<module name> @@ -38,14 +57,10 @@ class Context */ public function getContextByPath($path) { - if ($value = strstr($path, '/app/code/')) { + if ($value = $this->getComponentName(ComponentRegistrar::MODULE, $path)) { $type = self::CONTEXT_TYPE_MODULE; - $value = explode('/', $value); - $value = $value[3] . '_' . $value[4]; - } elseif ($value = strstr($path, '/app/design/')) { + } elseif ($value = $this->getComponentName(ComponentRegistrar::THEME, $path)) { $type = self::CONTEXT_TYPE_THEME; - $value = explode('/', $value); - $value = $value[3] . '/' . $value[4] . '/' . $value[5]; } elseif ($value = strstr($path, '/lib/web/')) { $type = self::CONTEXT_TYPE_LIB; $value = ltrim($value, '/'); @@ -55,6 +70,24 @@ class Context return [$type, $value]; } + /** + * Try to get component name by path, return false if not found + * + * @param string $componentType + * @param string $path + * @return bool|string + */ + private function getComponentName($componentType, $path) + { + foreach ($this->componentRegistrar->getPaths($componentType) as $componentName => $componentDir) { + $componentDir .= '/'; + if (strpos($path, $componentDir) !== false) { + return $componentName; + } + } + return false; + } + /** * Get paths by context * @@ -67,10 +100,12 @@ class Context { switch ($type) { case self::CONTEXT_TYPE_MODULE: - $path = 'app/code/' . str_replace('_', '/', $value); + $absolutePath = $this->componentRegistrar->getPath(ComponentRegistrar::MODULE, $value); + $path = str_replace(BP . '/', '', $absolutePath); break; case self::CONTEXT_TYPE_THEME: - $path = 'app/design/' . $value; + $absolutePath = $this->componentRegistrar->getPath(ComponentRegistrar::THEME, $value); + $path = str_replace(BP . '/', '', $absolutePath); break; case self::CONTEXT_TYPE_LIB: $path = 'lib/web'; diff --git a/setup/src/Magento/Setup/Module/I18n/Dictionary/Options/Resolver.php b/setup/src/Magento/Setup/Module/I18n/Dictionary/Options/Resolver.php index b3147dd30dc344f3337ff157d93efc704c16e70c..07a469246bd4627420e41341a78ad63230a9fd08 100644 --- a/setup/src/Magento/Setup/Module/I18n/Dictionary/Options/Resolver.php +++ b/setup/src/Magento/Setup/Module/I18n/Dictionary/Options/Resolver.php @@ -5,6 +5,9 @@ */ namespace Magento\Setup\Module\I18n\Dictionary\Options; +use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Component\ComponentRegistrar; + /** * Dictionary generator options resolver */ @@ -25,14 +28,24 @@ class Resolver implements ResolverInterface */ protected $withContext; + /** + * @var ComponentRegistrar + */ + protected $componentRegistrar; + /** * Resolver construct * + * @param ComponentRegistrar $componentRegistrar * @param string $directory * @param bool $withContext */ - public function __construct($directory, $withContext) - { + public function __construct( + ComponentRegistrar $componentRegistrar, + $directory, + $withContext + ) { + $this->componentRegistrar = $componentRegistrar; $this->directory = $directory; $this->withContext = $withContext; } @@ -44,31 +57,37 @@ class Resolver implements ResolverInterface { if (null === $this->options) { if ($this->withContext) { - $this->directory = rtrim($this->directory, '\\/'); + $directory = rtrim($this->directory, '\\/'); + $this->directory = ($directory == '.' || $directory == '..') ? BP : realpath($directory); + $moduleDirs = $this->getComponentDirectories(ComponentRegistrar::MODULE); + $themeDirs = $this->getComponentDirectories(ComponentRegistrar::THEME); + $this->options = [ [ 'type' => 'php', - 'paths' => [$this->directory . '/app/code/', $this->directory . '/app/design/'], + 'paths' => array_merge($moduleDirs, $themeDirs), 'fileMask' => '/\.(php|phtml)$/', ], [ 'type' => 'html', - 'paths' => [$this->directory . '/app/code/', $this->directory . '/app/design/'], + 'paths' => array_merge($moduleDirs, $themeDirs), 'fileMask' => '/\.html$/', ], [ 'type' => 'js', - 'paths' => [ - $this->directory . '/app/code/', - $this->directory . '/app/design/', - $this->directory . '/lib/web/mage/', - $this->directory . '/lib/web/varien/', - ], + 'paths' => array_merge( + $moduleDirs, + $themeDirs, + [ + $this->directory . '/lib/web/mage/', + $this->directory . '/lib/web/varien/', + ] + ), 'fileMask' => '/\.(js|phtml)$/' ], [ 'type' => 'xml', - 'paths' => [$this->directory . '/app/code/', $this->directory . '/app/design/'], + 'paths' => array_merge($moduleDirs, $themeDirs), 'fileMask' => '/\.xml$/' ], ]; @@ -104,4 +123,21 @@ class Resolver implements ResolverInterface } } } + + /** + * Get the given type component directories + * + * @param string $componentType + * @return array + */ + private function getComponentDirectories($componentType) + { + $dirs = []; + foreach ($this->componentRegistrar->getPaths($componentType) as $componentDir) { + if (strstr($componentDir, $this->directory)) { + $dirs[] = $componentDir . '/'; + } + } + return $dirs; + } } diff --git a/setup/src/Magento/Setup/Module/I18n/Dictionary/Options/ResolverFactory.php b/setup/src/Magento/Setup/Module/I18n/Dictionary/Options/ResolverFactory.php index 0068ac187a7c9ae16c7643e8080eb306bc04fedc..55f30fd1158b11c2b327a017e98271bd649e91fc 100644 --- a/setup/src/Magento/Setup/Module/I18n/Dictionary/Options/ResolverFactory.php +++ b/setup/src/Magento/Setup/Module/I18n/Dictionary/Options/ResolverFactory.php @@ -5,6 +5,8 @@ */ namespace Magento\Setup\Module\I18n\Dictionary\Options; +use Magento\Framework\Component\ComponentRegistrar; + /** * Options resolver factory */ @@ -36,7 +38,7 @@ class ResolverFactory */ public function create($directory, $withContext) { - $resolver = new $this->resolverClass($directory, $withContext); + $resolver = new $this->resolverClass(new ComponentRegistrar(), $directory, $withContext); if (!$resolver instanceof ResolverInterface) { throw new \InvalidArgumentException($this->resolverClass . ' doesn\'t implement ResolverInterface'); } diff --git a/setup/src/Magento/Setup/Module/I18n/Parser/Adapter/AbstractAdapter.php b/setup/src/Magento/Setup/Module/I18n/Parser/Adapter/AbstractAdapter.php index 3faf4f513bcb2124ac139d46b415c7d87fedd001..71db8855a8021b7ec90917f38a2219d44d376e2c 100644 --- a/setup/src/Magento/Setup/Module/I18n/Parser/Adapter/AbstractAdapter.php +++ b/setup/src/Magento/Setup/Module/I18n/Parser/Adapter/AbstractAdapter.php @@ -63,9 +63,7 @@ abstract class AbstractAdapter implements AdapterInterface protected function _addPhrase($phrase, $line = '') { if (!$phrase) { - throw new \InvalidArgumentException( - sprintf('Phrase cannot be empty. File: "%s" Line: "%s"', $this->_file, $line) - ); + return; } if (!isset($this->_phrases[$phrase])) { $enclosureCharacter = $this->getEnclosureCharacter($phrase); diff --git a/setup/src/Magento/Setup/Module/I18n/Parser/Contextual.php b/setup/src/Magento/Setup/Module/I18n/Parser/Contextual.php index 1642f3b1683c04a3a50586226a5f873c27c43d02..d759eb11b2be3620a1e4855b9a8f0c4e9082071f 100644 --- a/setup/src/Magento/Setup/Module/I18n/Parser/Contextual.php +++ b/setup/src/Magento/Setup/Module/I18n/Parser/Contextual.php @@ -63,7 +63,7 @@ class Contextual extends AbstractParser */ protected function _addPhrase($phraseData, $contextType, $contextValue) { - $phraseKey = $contextType . $phraseData['phrase']; + $phraseKey = $contextType . stripslashes($phraseData['phrase']); if (isset($this->_phrases[$phraseKey])) { /** @var \Magento\Setup\Module\I18n\Dictionary\Phrase $phrase */ diff --git a/setup/src/Magento/Setup/Module/I18n/ServiceLocator.php b/setup/src/Magento/Setup/Module/I18n/ServiceLocator.php index 504af8b8b1a56694538e60b651812623cbb2808a..4e64a1cedf6b77867e32107e0cf115332d6802a8 100644 --- a/setup/src/Magento/Setup/Module/I18n/ServiceLocator.php +++ b/setup/src/Magento/Setup/Module/I18n/ServiceLocator.php @@ -5,6 +5,7 @@ */ namespace Magento\Setup\Module\I18n; +use Magento\Framework\Component\ComponentRegistrar; /** * Service Locator (instead DI container) @@ -112,7 +113,7 @@ class ServiceLocator private static function _getContext() { if (null === self::$_context) { - self::$_context = new Context(); + self::$_context = new Context(new ComponentRegistrar()); } return self::$_context; } diff --git a/setup/src/Magento/Setup/Test/Unit/Console/Command/DiCompileCommandTest.php b/setup/src/Magento/Setup/Test/Unit/Console/Command/DiCompileCommandTest.php index 205e0799436bb77e81fcda0bfed630df89874c55..4230d3a67d8820c73ec139d02ed20566e6ff345f 100644 --- a/setup/src/Magento/Setup/Test/Unit/Console/Command/DiCompileCommandTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Console/Command/DiCompileCommandTest.php @@ -5,6 +5,7 @@ */ namespace Magento\Setup\Test\Unit\Console\Command; +use Magento\Framework\Component\ComponentRegistrar; use Magento\Setup\Console\Command\DiCompileCommand; use Symfony\Component\Console\Tester\CommandTester; @@ -34,6 +35,9 @@ class DiCompileCommandTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Framework\App\Filesystem\DirectoryList | \PHPUnit_Framework_MockObject_MockObject*/ private $directoryList; + /** @var \Magento\Framework\Component\ComponentRegistrar|\PHPUnit_Framework_MockObject_MockObject */ + private $componentRegistrar; + public function setUp() { $this->deploymentConfig = $this->getMock('Magento\Framework\App\DeploymentConfig', [], [], '', false); @@ -66,6 +70,17 @@ class DiCompileCommandTest extends \PHPUnit_Framework_TestCase $this->fileDriver = $this->getMockBuilder('Magento\Framework\Filesystem\Driver\File') ->disableOriginalConstructor() ->getMock(); + $this->componentRegistrar = $this->getMock( + '\Magento\Framework\Component\ComponentRegistrar', + [], + [], + '', + false + ); + $this->componentRegistrar->expects($this->any())->method('getPaths')->willReturnMap([ + [ComponentRegistrar::MODULE, ['/path/to/module/one', '/path/to/module/two']], + [ComponentRegistrar::LIBRARY, ['/path/to/library/one', '/path/to/library/two']], + ]); $this->command = new DiCompileCommand( $this->deploymentConfig, @@ -73,7 +88,8 @@ class DiCompileCommandTest extends \PHPUnit_Framework_TestCase $this->manager, $objectManagerProvider, $this->filesystem, - $this->fileDriver + $this->fileDriver, + $this->componentRegistrar ); } diff --git a/setup/src/Magento/Setup/Test/Unit/Console/Command/DiCompileMultiTenantCommandTest.php b/setup/src/Magento/Setup/Test/Unit/Console/Command/DiCompileMultiTenantCommandTest.php index 0290915484c7114d478674b495fafc41f41c2cf8..45edf5578c83333180f84ee1bee5c77d904ec58e 100644 --- a/setup/src/Magento/Setup/Test/Unit/Console/Command/DiCompileMultiTenantCommandTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Console/Command/DiCompileMultiTenantCommandTest.php @@ -5,6 +5,7 @@ */ namespace Magento\Setup\Test\Unit\Console\Command; +use Magento\Framework\Component\ComponentRegistrar; use Magento\Setup\Console\Command\DiCompileMultiTenantCommand; use Symfony\Component\Console\Tester\CommandTester; @@ -32,7 +33,18 @@ class DiCompileMultiTenantCommandTest extends \PHPUnit_Framework_TestCase ); $objectManagerProvider->expects($this->once())->method('get')->willReturn($objectManager); $directoryList = $this->getMock('Magento\Framework\App\Filesystem\DirectoryList', [], [], '', false); - $command = new DiCompileMultiTenantCommand($objectManagerProvider, $directoryList); + $componentRegistrar = $this->getMock( + '\Magento\Framework\Component\ComponentRegistrar', + [], + [], + '', + false + ); + $componentRegistrar->expects($this->any())->method('getPaths')->willReturnMap([ + [ComponentRegistrar::MODULE, ['/path/to/module/one', '/path/to/module/two']], + [ComponentRegistrar::LIBRARY, ['/path/to/library/one', '/path/to/library/two']], + ]); + $command = new DiCompileMultiTenantCommand($objectManagerProvider, $directoryList, $componentRegistrar); $commandTester = new CommandTester($command); $commandTester->execute($option); $this->assertEquals($error . PHP_EOL, $commandTester->getDisplay()); diff --git a/setup/src/Magento/Setup/Test/Unit/Fixtures/FixtureModelTest.php b/setup/src/Magento/Setup/Test/Unit/Fixtures/FixtureModelTest.php index 4ac088271bfad8621e6ab40d6558071a01e4ca49..740ae09316fe288b46e54ab19873a997c62a7f55 100644 --- a/setup/src/Magento/Setup/Test/Unit/Fixtures/FixtureModelTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Fixtures/FixtureModelTest.php @@ -25,16 +25,11 @@ class FixtureModelTest extends \PHPUnit_Framework_TestCase '', false ); - $fileParserMock = $this->getMock('\Magento\Framework\XML\Parser', [], [], '', false); + $fileParserMock = $this->getMock('\Magento\Framework\Xml\Parser', [], [], '', false); $this->model = new FixtureModel($reindexCommandMock, $fileParserMock); } - public function testGetObjectManager() - { - $this->assertInstanceOf('Magento\Framework\ObjectManager\ObjectManager', $this->model->getObjectManager()); - } - public function testReindex() { $outputMock = $this->getMock('\Symfony\Component\Console\Output\OutputInterface', [], [], '', false); @@ -60,13 +55,14 @@ class FixtureModelTest extends \PHPUnit_Framework_TestCase false ); - $fileParserMock = $this->getMock('\Magento\Framework\XML\Parser', [], [], '', false); - $fileParserMock->expects($this->once()) - ->method('load') - ->willReturnSelf(); - + $fileParserMock = $this->getMock('\Magento\Framework\Xml\Parser', ['load', 'xmlToArray'], [], '', false); + $fileParserMock->expects($this->once())->method('xmlToArray')->willReturn( + ['config' => [ 'profile' => ['some_key' => 'some_value']]] + ); + $fileParserMock->expects($this->once())->method('load')->with('config.file')->willReturn($fileParserMock); $this->model = new FixtureModel($reindexCommandMock, $fileParserMock); $this->model->loadConfig('config.file'); + $this->assertSame('some_value', $this->model->getValue('some_key')); } public function testGetValue() diff --git a/setup/src/Magento/Setup/Test/Unit/Model/InstallerTest.php b/setup/src/Magento/Setup/Test/Unit/Model/InstallerTest.php index ac7907be62fbf0dc23001f951de9bc9141e563c4..2b752d96dc2854cabef00e7f34f14db6b97643d7 100644 --- a/setup/src/Magento/Setup/Test/Unit/Model/InstallerTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Model/InstallerTest.php @@ -121,6 +121,11 @@ class InstallerTest extends \PHPUnit_Framework_TestCase */ private $dataSetupFactory; + /** + * @var \Magento\Framework\Component\ComponentRegistrar|\PHPUnit_Framework_MockObject_MockObject + */ + private $componentRegistrar; + /** * Sample DB configuration segment * @@ -167,6 +172,7 @@ class InstallerTest extends \PHPUnit_Framework_TestCase $this->dbValidator = $this->getMock('Magento\Setup\Validator\DbValidator', [], [], '', false); $this->setupFactory = $this->getMock('Magento\Setup\Module\SetupFactory', [], [], '', false); $this->dataSetupFactory = $this->getMock('Magento\Setup\Module\DataSetupFactory', [], [], '', false); + $this->componentRegistrar = $this->getMock('Magento\Framework\Component\ComponentRegistrar', [], [], '', false); $this->object = $this->createObject(); } @@ -206,7 +212,8 @@ class InstallerTest extends \PHPUnit_Framework_TestCase $this->cleanupFiles, $this->dbValidator, $this->setupFactory, - $this->dataSetupFactory + $this->dataSetupFactory, + $this->componentRegistrar ); } diff --git a/setup/src/Magento/Setup/Test/Unit/Module/ConfigOptionsListTest.php b/setup/src/Magento/Setup/Test/Unit/Module/ConfigOptionsListTest.php index 15c6de640bc6066d08a361afce1459a9a5e7aebe..35403b4966f6e70777a8a33ad217e4676f131a04 100644 --- a/setup/src/Magento/Setup/Test/Unit/Module/ConfigOptionsListTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Module/ConfigOptionsListTest.php @@ -47,7 +47,7 @@ class ConfigOptionsListTest extends \PHPUnit_Framework_TestCase $this->assertInstanceOf('Magento\Framework\Setup\Option\TextConfigOption', $options[0]); $this->assertSame('Encryption key', $options[0]->getDescription()); $this->assertInstanceOf('Magento\Framework\Setup\Option\SelectConfigOption', $options[1]); - $this->assertSame('Session save location', $options[1]->getDescription()); + $this->assertSame('Session save handler', $options[1]->getDescription()); $this->assertInstanceOf('Magento\Framework\Setup\Option\SelectConfigOption', $options[2]); $this->assertSame('Type of definitions used by Object Manager', $options[2]->getDescription()); $this->assertInstanceOf('Magento\Framework\Setup\Option\TextConfigOption', $options[3]); @@ -106,23 +106,50 @@ class ConfigOptionsListTest extends \PHPUnit_Framework_TestCase $this->assertEquals(8, count($configData)); } - public function testValidate() + public function testValidateSuccess() { $options = [ ConfigOptionsListConstants::INPUT_KEY_DB_PREFIX => 'prefix', + ConfigOptionsListConstants::INPUT_KEY_SESSION_SAVE => 'files', ConfigOptionsListConstants::INPUT_KEY_SKIP_DB_VALIDATION => false, ConfigOptionsListConstants::INPUT_KEY_DB_NAME => 'name', ConfigOptionsListConstants::INPUT_KEY_DB_HOST => 'host', ConfigOptionsListConstants::INPUT_KEY_DB_USER => 'user', ConfigOptionsListConstants::INPUT_KEY_DB_PASSWORD => 'pass' ]; - $configDataMock = $this->getMock('Magento\Framework\Config\Data\ConfigData', [], [], '', false); + $this->prepareValidationMocks(); + $this->assertEquals([], $this->object->validate($options, $this->deploymentConfig)); + } + + public function testValidateInvalidSessionHandler() + { + $invalidSaveHandler = 'clay-tablet'; + + $options = [ + ConfigOptionsListConstants::INPUT_KEY_DB_PREFIX => 'prefix', + ConfigOptionsListConstants::INPUT_KEY_SESSION_SAVE => $invalidSaveHandler, + ConfigOptionsListConstants::INPUT_KEY_SKIP_DB_VALIDATION => false, + ConfigOptionsListConstants::INPUT_KEY_DB_NAME => 'name', + ConfigOptionsListConstants::INPUT_KEY_DB_HOST => 'host', + ConfigOptionsListConstants::INPUT_KEY_DB_USER => 'user', + ConfigOptionsListConstants::INPUT_KEY_DB_PASSWORD => 'pass' + ]; + $this->prepareValidationMocks(); + $this->assertEquals( + ["Invalid session handler '$invalidSaveHandler'"], + $this->object->validate($options, $this->deploymentConfig) + ); + } + + private function prepareValidationMocks() + { + $configDataMock = $this->getMockBuilder('Magento\Framework\Config\Data\ConfigData') + ->disableOriginalConstructor() + ->getMock(); $this->dbValidator->expects($this->once())->method('checkDatabaseTablePrefix')->willReturn($configDataMock); $this->dbValidator->expects($this->once())->method('checkDatabaseConnection')->willReturn($configDataMock); - $result = $this->object->validate($options, $this->deploymentConfig); - $this->assertEquals([], $result); } - + /** * @param string $hosts * @param bool $expectedError diff --git a/setup/src/Magento/Setup/Test/Unit/Module/DataSetupFactoryTest.php b/setup/src/Magento/Setup/Test/Unit/Module/DataSetupFactoryTest.php index 57bc8e5d62e4c520136452216236558ff873c000..cdb1680dda96d4de364ace803d70a94192adad81 100644 --- a/setup/src/Magento/Setup/Test/Unit/Module/DataSetupFactoryTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Module/DataSetupFactoryTest.php @@ -13,11 +13,9 @@ class DataSetupFactoryTest extends \PHPUnit_Framework_TestCase { $resource = $this->getMock('Magento\Framework\App\Resource', [], [], '', false); $filesystem = $this->getMock('Magento\Framework\Filesystem', [], [], '', false); - $filesystem->expects($this->once())->method('getDirectoryRead'); $context = $this->getMock('Magento\Framework\Module\Setup\Context', [], [], '', false); $context->expects($this->once())->method('getEventManager'); $context->expects($this->once())->method('getLogger'); - $context->expects($this->once())->method('getModulesReader'); $context->expects($this->once())->method('getMigrationFactory'); $context->expects($this->once())->method('getResourceModel')->willReturn($resource); $context->expects($this->once())->method('getFilesystem')->willReturn($filesystem); diff --git a/setup/src/Magento/Setup/Test/Unit/Module/Di/App/Task/RepositoryGeneratorTest.php b/setup/src/Magento/Setup/Test/Unit/Module/Di/App/Task/RepositoryGeneratorTest.php index 0b2b5310c67b2e57fd168ec618b3626397cce02e..8b49d60df518b313108b02eecb5a510974de6e7f 100644 --- a/setup/src/Magento/Setup/Test/Unit/Module/Di/App/Task/RepositoryGeneratorTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Module/Di/App/Task/RepositoryGeneratorTest.php @@ -73,7 +73,7 @@ class RepositoryGeneratorTest extends \PHPUnit_Framework_TestCase public function testDoOperationEmptyRepositories() { $data = [ - 'path' => 'path/to/app', + 'paths' => ['path/to/app'], 'filePatterns' => ['di' => 'di.xml'], ]; $files = ['di' => []]; @@ -86,11 +86,11 @@ class RepositoryGeneratorTest extends \PHPUnit_Framework_TestCase $this->classesScannerMock->expects($this->once()) ->method('getList') - ->with($data['path']); + ->with($data['paths'][0]); $this->directoryScannerMock->expects($this->once()) ->method('scan') ->with( - $data['path'], + $data['paths'][0], $data['filePatterns'] )->willReturn($files); $this->repositoryScannerMock->expects($this->once()) diff --git a/setup/src/Magento/Setup/Test/Unit/Module/Di/App/Task/ServiceDataAttributesGeneratorTest.php b/setup/src/Magento/Setup/Test/Unit/Module/Di/App/Task/ServiceDataAttributesGeneratorTest.php index 92212e3d79cb9fd7eb9ca2a0b9296d77f818bded..b1b01608ea21da8850a7db17bcdc585a5abc2564 100644 --- a/setup/src/Magento/Setup/Test/Unit/Module/Di/App/Task/ServiceDataAttributesGeneratorTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Module/Di/App/Task/ServiceDataAttributesGeneratorTest.php @@ -73,7 +73,7 @@ class ServiceDataAttributesGeneratorTest extends \PHPUnit_Framework_TestCase public function testDoOperation() { $data = [ - 'path' => 'path/to/app', + 'paths' => ['path/to/app'], 'filePatterns' => ['di' => 'di.xml'], ]; $files = ['extension_attributes' => []]; @@ -86,7 +86,7 @@ class ServiceDataAttributesGeneratorTest extends \PHPUnit_Framework_TestCase $this->directoryScannerMock->expects($this->once()) ->method('scan') ->with( - $data['path'], + $data['paths'][0], $data['filePatterns'] )->willReturn($files); $this->serviceDataAttributesScannerMock->expects($this->once()) diff --git a/setup/src/Magento/Setup/Test/Unit/Module/Di/_files/app/code/Magento/SomeModule/etc/adminhtml/system.xml b/setup/src/Magento/Setup/Test/Unit/Module/Di/_files/app/code/Magento/SomeModule/etc/adminhtml/system.xml index d5b7796b99db9e40bb52a40e4270b2a3b2628081..b63092e6922543518b1709bd629b1dd90a72f98e 100644 --- a/setup/src/Magento/Setup/Test/Unit/Module/Di/_files/app/code/Magento/SomeModule/etc/adminhtml/system.xml +++ b/setup/src/Magento/Setup/Test/Unit/Module/Di/_files/app/code/Magento/SomeModule/etc/adminhtml/system.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../../../../app/code/Magento/Config/etc/system_file.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="advanced" translate="label" type="text" sortOrder="910" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Advanced</label> diff --git a/setup/src/Magento/Setup/Test/Unit/Module/Di/_files/app/code/Magento/SomeModule/etc/di.xml b/setup/src/Magento/Setup/Test/Unit/Module/Di/_files/app/code/Magento/SomeModule/etc/di.xml index ec1a122e8f6cd08f459b64b651d49baf87a188c1..b834664573b716252101e4041e0707fd6669d6d5 100644 --- a/setup/src/Magento/Setup/Test/Unit/Module/Di/_files/app/code/Magento/SomeModule/etc/di.xml +++ b/setup/src/Magento/Setup/Test/Unit/Module/Di/_files/app/code/Magento/SomeModule/etc/di.xml @@ -5,8 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> - <preference for="Magento\Framework\App\RequestInterface" type="Magento\Framework\App\Request\Http\Proxy" /> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Store\Model\Config\InvalidatorInterface" type="Magento\Store\Model\Config\Invalidator\Proxy" /> <preference for="Magento\Framework\App\CacheInterface" type="Magento\Framework\App\Cache\Proxy" /> <virtualType name="custom_cache_instance" type="Magento\Framework\App\Cache"> diff --git a/setup/src/Magento/Setup/Test/Unit/Module/Di/_files/app/code/Magento/SomeModule/view/frontend/default.xml b/setup/src/Magento/Setup/Test/Unit/Module/Di/_files/app/code/Magento/SomeModule/view/frontend/default.xml index 4664b27f04c42eb6c3d71dd3bef5ae5c6280574f..dbad40e4dbe36d1f72c121b0b237eca284c5352a 100644 --- a/setup/src/Magento/Setup/Test/Unit/Module/Di/_files/app/code/Magento/SomeModule/view/frontend/default.xml +++ b/setup/src/Magento/Setup/Test/Unit/Module/Di/_files/app/code/Magento/SomeModule/view/frontend/default.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_layout.xsd"> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"> <referenceBlock name="root"> <block class="Magento\Backend\Block\Menu\Proxy" name="menu" as="menu" template="Magento_Backend::menu.phtml" /> </referenceBlock> diff --git a/setup/src/Magento/Setup/Test/Unit/Module/Di/_files/app/etc/config.xml b/setup/src/Magento/Setup/Test/Unit/Module/Di/_files/app/etc/config.xml index 2197266b7f07fd276114725c09ba157f35d60c57..2c73a4c00f44dfe04f0ea8ff3ebf89213ec00827 100644 --- a/setup/src/Magento/Setup/Test/Unit/Module/Di/_files/app/etc/config.xml +++ b/setup/src/Magento/Setup/Test/Unit/Module/Di/_files/app/etc/config.xml @@ -6,5 +6,5 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../../../../app/code/Magento/Store/etc/config.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> </config> diff --git a/setup/src/Magento/Setup/Test/Unit/Module/Di/_files/app/etc/di/config.xml b/setup/src/Magento/Setup/Test/Unit/Module/Di/_files/app/etc/di/config.xml index 0b1395817de460ea28f44a6e79eadef1adf1446b..52726a7122637ce92ea3fdfca2996de40837f7d7 100644 --- a/setup/src/Magento/Setup/Test/Unit/Module/Di/_files/app/etc/di/config.xml +++ b/setup/src/Magento/Setup/Test/Unit/Module/Di/_files/app/etc/di/config.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Framework\App\Cache"> <arguments> <argument name="storeManager" xsi:type="object">customStoreManagerProxy</argument> diff --git a/setup/src/Magento/Setup/Test/Unit/Module/Di/_files/extension_attributes.xml b/setup/src/Magento/Setup/Test/Unit/Module/Di/_files/extension_attributes.xml index 336d89dd4ecc727b5a382ecb0e03878fef50dfaa..528902cb59911876cc4c567bd51cd4a09b58006e 100644 --- a/setup/src/Magento/Setup/Test/Unit/Module/Di/_files/extension_attributes.xml +++ b/setup/src/Magento/Setup/Test/Unit/Module/Di/_files/extension_attributes.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Api/etc/extension_attributes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> <extension_attributes for="Magento\Sales\Api\Data\OrderInterface"> <attribute code="gift_message" type="Magento\GiftMessage\Api\Data\MessageInterface" /> </extension_attributes> diff --git a/setup/src/Magento/Setup/Test/Unit/Module/I18n/ContextTest.php b/setup/src/Magento/Setup/Test/Unit/Module/I18n/ContextTest.php index 5a641e556ff5539b2f3b25aa82fbe71b08913090..4972001695db18ed6f76fd7dfc55f49e7489d3c6 100644 --- a/setup/src/Magento/Setup/Test/Unit/Module/I18n/ContextTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Module/I18n/ContextTest.php @@ -5,6 +5,7 @@ */ namespace Magento\Setup\Test\Unit\Module\I18n; +use Magento\Framework\Component\ComponentRegistrar; use \Magento\Setup\Module\I18n\Context; class ContextTest extends \PHPUnit_Framework_TestCase @@ -14,19 +15,28 @@ class ContextTest extends \PHPUnit_Framework_TestCase */ protected $context; + /** + * @var \Magento\Framework\Component\ComponentRegistrar|\PHPUnit_Framework_MockObject_MockObject + */ + protected $componentRegistrar; + protected function setUp() { - $objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); - $this->context = $objectManagerHelper->getObject('Magento\Setup\Module\I18n\Context'); + $this->componentRegistrar = $this->getMock('Magento\Framework\Component\ComponentRegistrar', [], [], '', false); } /** * @param array $context * @param string $path + * @param array $pathValues * @dataProvider dataProviderContextByPath */ - public function testGetContextByPath($context, $path) + public function testGetContextByPath($context, $path, $pathValues) { + $this->componentRegistrar->expects($this->any()) + ->method('getPaths') + ->will($this->returnValueMap($pathValues)); + $this->context = new Context($this->componentRegistrar); $this->assertEquals($context, $this->context->getContextByPath($path)); } @@ -36,9 +46,30 @@ class ContextTest extends \PHPUnit_Framework_TestCase public function dataProviderContextByPath() { return [ - [[Context::CONTEXT_TYPE_MODULE, 'Magento_Module'], '/app/code/Magento/Module/Block/Test.php'], - [[Context::CONTEXT_TYPE_THEME, 'area/theme/test.phtml'], '/app/design/area/theme/test.phtml'], - [[Context::CONTEXT_TYPE_LIB, 'lib/web/module/test.phtml'], '/lib/web/module/test.phtml'], + [ + [Context::CONTEXT_TYPE_MODULE, 'Magento_Module'], + '/app/code/Magento/Module/Block/Test.php', + [ + [Context::CONTEXT_TYPE_MODULE, ['Magento_Module' => '/app/code/Magento/Module']], + [Context::CONTEXT_TYPE_THEME, []], + ] + ], + [ + [Context::CONTEXT_TYPE_THEME, 'frontend/Some/theme'], + '/app/design/area/theme/test.phtml', + [ + [Context::CONTEXT_TYPE_MODULE, []], + [Context::CONTEXT_TYPE_THEME, ['frontend/Some/theme' => '/app/design/area/theme']], + ] + ], + [ + [Context::CONTEXT_TYPE_LIB, 'lib/web/module/test.phtml'], + '/lib/web/module/test.phtml', + [ + [Context::CONTEXT_TYPE_MODULE, []], + [Context::CONTEXT_TYPE_THEME, []], + ] + ], ]; } @@ -48,16 +79,34 @@ class ContextTest extends \PHPUnit_Framework_TestCase */ public function testGetContextByPathWithInvalidPath() { + $this->componentRegistrar->expects($this->any()) + ->method('getPaths') + ->willReturnMap([ + [ComponentRegistrar::MODULE, ['/path/to/module']], + [ComponentRegistrar::THEME, ['/path/to/theme']] + ]); + $this->context = new Context($this->componentRegistrar); $this->context->getContextByPath('invalid_path'); } /** * @param string $path * @param array $context + * @param array $registrar * @dataProvider dataProviderPathToLocaleDirectoryByContext */ - public function testBuildPathToLocaleDirectoryByContext($path, $context) + public function testBuildPathToLocaleDirectoryByContext($path, $context, $registrar) { + $paths = []; + foreach ($registrar as $module) { + $paths[$module[1]] = $module[2]; + } + $this->componentRegistrar->expects($this->any()) + ->method('getPaths') + ->with(ComponentRegistrar::MODULE) + ->willReturn($paths); + $this->componentRegistrar->expects($this->any())->method('getPath')->will($this->returnValueMap($registrar)); + $this->context = new Context($this->componentRegistrar); $this->assertEquals($path, $this->context->buildPathToLocaleDirectoryByContext($context[0], $context[1])); } @@ -67,9 +116,13 @@ class ContextTest extends \PHPUnit_Framework_TestCase public function dataProviderPathToLocaleDirectoryByContext() { return [ - ['app/code/Magento/Module/i18n/', [Context::CONTEXT_TYPE_MODULE, 'Magento_Module']], - ['app/design/theme/test.phtml/i18n/', [Context::CONTEXT_TYPE_THEME, 'theme/test.phtml']], - ['lib/web/i18n/', [Context::CONTEXT_TYPE_LIB, 'lib/web/module/test.phtml']], + [ + 'app/code/Magento/Module/i18n/', + [Context::CONTEXT_TYPE_MODULE, 'Magento_Module'], + [[ComponentRegistrar::MODULE, 'Magento_Module', BP . '/app/code/Magento/Module']] + ], + ['/i18n/', [Context::CONTEXT_TYPE_THEME, 'theme/test.phtml'], []], + ['lib/web/i18n/', [Context::CONTEXT_TYPE_LIB, 'lib/web/module/test.phtml'], []], ]; } @@ -79,6 +132,11 @@ class ContextTest extends \PHPUnit_Framework_TestCase */ public function testBuildPathToLocaleDirectoryByContextWithInvalidType() { + $this->componentRegistrar->expects($this->any()) + ->method('getPaths') + ->with(ComponentRegistrar::MODULE) + ->willReturn(['module' => '/path/to/module']); + $this->context = new Context($this->componentRegistrar); $this->context->buildPathToLocaleDirectoryByContext('invalid_type', 'Magento_Module'); } } diff --git a/setup/src/Magento/Setup/Test/Unit/Module/I18n/Dictionary/Options/ResolverTest.php b/setup/src/Magento/Setup/Test/Unit/Module/I18n/Dictionary/Options/ResolverTest.php index 9f35c509411face2ac0c16a6bc33027cc7895a11..6d39432c33358d7c47b890129c3f018c7c694337 100644 --- a/setup/src/Magento/Setup/Test/Unit/Module/I18n/Dictionary/Options/ResolverTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Module/I18n/Dictionary/Options/ResolverTest.php @@ -5,6 +5,8 @@ */ namespace Magento\Setup\Test\Unit\Module\I18n\Dictionary\Options; +use Magento\Framework\Component\ComponentRegistrar; + /** * Class ResolverTest */ @@ -19,12 +21,26 @@ class ResolverTest extends \PHPUnit_Framework_TestCase public function testGetOptions($directory, $withContext, $result) { $objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); + $componentRegistrar = $this->getMock('Magento\Framework\Component\ComponentRegistrar', [], [], '', false); + $root = __DIR__ . '/_files/source'; + $componentRegistrar->expects($this->any()) + ->method('getPaths') + ->will( + $this->returnValueMap([ + [ComponentRegistrar::MODULE, [$root . '/app/code/module1', $root . '/app/code/module2']], + [ComponentRegistrar::THEME, [$root . '/app/design']], + ]) + ); + $directoryList = $this->getMock('Magento\Framework\App\Filesystem\DirectoryList', [], [], '', false); + $directoryList->expects($this->any())->method('getRoot')->willReturn('root'); /** @var \Magento\Setup\Module\I18n\Dictionary\Options\Resolver $resolver */ $resolver = $objectManagerHelper->getObject( 'Magento\Setup\Module\I18n\Dictionary\Options\Resolver', [ 'directory' => $directory, 'withContext' => $withContext, + 'componentRegistrar' => $componentRegistrar, + 'directoryList' => $directoryList ] ); $this->assertSame($result, $resolver->getOptions()); @@ -44,18 +60,27 @@ class ResolverTest extends \PHPUnit_Framework_TestCase [ [ 'type' => 'php', - 'paths' => [$sourceFirst . '/app/code/', $sourceFirst . '/app/design/'], + 'paths' => [ + $sourceFirst . '/app/code/module1/', + $sourceFirst . '/app/code/module2/', + $sourceFirst . '/app/design/' + ], 'fileMask' => '/\.(php|phtml)$/', ], [ 'type' => 'html', - 'paths' => [$sourceFirst . '/app/code/', $sourceFirst . '/app/design/'], + 'paths' => [ + $sourceFirst . '/app/code/module1/', + $sourceFirst . '/app/code/module2/', + $sourceFirst . '/app/design/' + ], 'fileMask' => '/\.html$/', ], [ 'type' => 'js', 'paths' => [ - $sourceFirst . '/app/code/', + $sourceFirst . '/app/code/module1/', + $sourceFirst . '/app/code/module2/', $sourceFirst . '/app/design/', $sourceFirst . '/lib/web/mage/', $sourceFirst . '/lib/web/varien/', @@ -64,7 +89,11 @@ class ResolverTest extends \PHPUnit_Framework_TestCase ], [ 'type' => 'xml', - 'paths' => [$sourceFirst . '/app/code/', $sourceFirst . '/app/design/'], + 'paths' => [ + $sourceFirst . '/app/code/module1/', + $sourceFirst . '/app/code/module2/', + $sourceFirst . '/app/design/' + ], 'fileMask' => '/\.xml$/' ] ], @@ -90,6 +119,12 @@ class ResolverTest extends \PHPUnit_Framework_TestCase */ public function testGetOptionsWrongDir($directory, $withContext, $message) { + $componentRegistrar = $this->getMock('Magento\Framework\Component\ComponentRegistrar', [], [], '', false); + $root = __DIR__ . '/_files/source'; + $componentRegistrar->expects($this->any()) + ->method('getPaths') + ->willReturn([$root . '/app/code/module1', $root . '/app/code/module2']); + $directoryList = $this->getMock('Magento\Framework\App\Filesystem\DirectoryList', [], [], '', false); $objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); /** @var \Magento\Setup\Module\I18n\Dictionary\Options\Resolver $resolver */ $resolver = $objectManagerHelper->getObject( @@ -97,6 +132,8 @@ class ResolverTest extends \PHPUnit_Framework_TestCase [ 'directory' => $directory, 'withContext' => $withContext, + 'componentRegistrar' => $componentRegistrar, + 'directoryList' => $directoryList ] ); $this->setExpectedException('\InvalidArgumentException', $message); diff --git a/setup/src/Magento/Setup/Test/Unit/Module/I18n/Dictionary/Options/_files/source/app/code/.gitignore b/setup/src/Magento/Setup/Test/Unit/Module/I18n/Dictionary/Options/_files/source/app/code/module1/.gitignore similarity index 100% rename from setup/src/Magento/Setup/Test/Unit/Module/I18n/Dictionary/Options/_files/source/app/code/.gitignore rename to setup/src/Magento/Setup/Test/Unit/Module/I18n/Dictionary/Options/_files/source/app/code/module1/.gitignore diff --git a/setup/src/Magento/Setup/Test/Unit/Module/I18n/Dictionary/Options/_files/source/app/code/module2/.gitignore b/setup/src/Magento/Setup/Test/Unit/Module/I18n/Dictionary/Options/_files/source/app/code/module2/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/setup/src/Magento/Setup/Test/Unit/Module/I18n/Dictionary/Options/_files/source/app/code/module2/.gitignore @@ -0,0 +1 @@ + diff --git a/setup/src/Magento/Setup/Test/Unit/Module/I18n/Parser/Adapter/AbstractAdapterTest.php b/setup/src/Magento/Setup/Test/Unit/Module/I18n/Parser/Adapter/AbstractAdapterTest.php index 676c24fb0877979d663a511342ddd4055685401d..7c466e7c4a34ddf6b6c8bb1ccc8db7db53cf3b64 100644 --- a/setup/src/Magento/Setup/Test/Unit/Module/I18n/Parser/Adapter/AbstractAdapterTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Module/I18n/Parser/Adapter/AbstractAdapterTest.php @@ -12,6 +12,11 @@ class AbstractAdapterTest extends \PHPUnit_Framework_TestCase */ protected $_adapterMock; + /** + * @var \Magento\Setup\Module\I18n\Parser\Adapter\AbstractAdapter + */ + protected $_adapterReflection; + protected function setUp() { $this->_adapterMock = $this->getMockForAbstractClass( @@ -23,6 +28,11 @@ class AbstractAdapterTest extends \PHPUnit_Framework_TestCase true, ['_parse'] ); + $this->_adapterReflection = new \ReflectionMethod( + 'Magento\Setup\Module\I18n\Parser\Adapter\AbstractAdapter', + '_addPhrase' + ); + $this->_adapterReflection->setAccessible(true); } public function testParse() @@ -36,4 +46,25 @@ class AbstractAdapterTest extends \PHPUnit_Framework_TestCase { $this->assertInternalType('array', $this->_adapterMock->getPhrases()); } + + public function testAddPhrase() + { + $phrase = 'test phrase'; + $line = 2; + $expected = [ + [ + 'phrase' => $phrase, + 'file' => null, + 'line' => $line, + 'quote' => '' + ] + ]; + $this->_adapterReflection->invoke($this->_adapterMock, $phrase, $line); + $actual = $this->_adapterMock->getPhrases(); + $this->assertEquals($expected, $actual); + + $this->_adapterReflection->invoke($this->_adapterMock, '', ''); + $actual = $this->_adapterMock->getPhrases(); + $this->assertEquals($expected, $actual); + } } diff --git a/setup/view/magento/setup/readiness-check/progress.phtml b/setup/view/magento/setup/readiness-check/progress.phtml index a7498e98ac636b7d762f5b67d8c594925b280cf5..964f9c403e472b31c115fbd5d30da479b40382e3 100755 --- a/setup/view/magento/setup/readiness-check/progress.phtml +++ b/setup/view/magento/setup/readiness-check/progress.phtml @@ -304,7 +304,7 @@ <span></span><span></span><span></span><span></span> </span> <h3 class="readiness-check-title">Checking PHP Extensions...</h3> - </div> + </div> <div ng-show="extensions.processed" ng-switch="extensions.responseType"> <div ng-switch-when="success" ng-init="updateOnSuccess(extensions)"> @@ -314,7 +314,7 @@ <div class="readiness-check-content"> <h3 class="readiness-check-title">PHP Extensions Check</h3> <p> - You meet {{extensions.data.required.length}} out of {{extensions.data.required.length}} PHP extensions requirements. + You meet {{extensions.length}} out of {{extensions.length}} PHP extensions requirements. <a href="#php-extensions" ng-click="updateOnExpand(extensions)"> <span ng-hide="extensions.expanded">Show detail</span> <span ng-show="extensions.expanded">Hide detail</span>