diff --git a/.github/workflows/check-files.yml b/.github/workflows/check-files.yml index 1c463234dbd..b1470d0ea4e 100644 --- a/.github/workflows/check-files.yml +++ b/.github/workflows/check-files.yml @@ -75,7 +75,7 @@ jobs: - name: Get changed files id: changed-files-specific - uses: tj-actions/changed-files@v44 + uses: tj-actions/changed-files@v45 with: files: | composer.* diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index d0f7a216412..ccf6efe4e53 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -8,6 +8,8 @@ name: Labeler on: pull_request_target: + # Allow manually triggering the workflow. + workflow_dispatch: jobs: triage: diff --git a/.github/workflows/phpcs.yml b/.github/workflows/phpcs.yml index e078a040ebe..420390adadc 100644 --- a/.github/workflows/phpcs.yml +++ b/.github/workflows/phpcs.yml @@ -45,4 +45,4 @@ jobs: - name: PHPCodeSniffer run: php vendor/bin/phpcs -s --report=full --standard=${{ matrix.rules.path }} - continue-on-error: ${{ matrix.rules.path != '.phpcs.xml.dist' }} + continue-on-error: ${{ matrix.rules.path == '.phpcs.ecg.xml.dist' }} diff --git a/.gitignore b/.gitignore index 442b0be24ae..b4818b73403 100644 --- a/.gitignore +++ b/.gitignore @@ -40,8 +40,6 @@ /dev/openmage/docker-magento /dev/openmage/.env /dev/openmage/Caddyfile -/dev/tests/functional/generated -/dev/tests/functional/vendor /media/* !/media/.htaccess diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index fb06ee5555f..8c1bf39a95b 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -6,7 +6,10 @@ */ $config = new PhpCsFixer\Config(); return $config + ->setRiskyAllowed(true) ->setRules([ + // PHP arrays should be declared using the configured syntax. + 'array_syntax' => ['syntax' => 'short'], // There MUST be one blank line after the namespace declaration. 'blank_line_after_namespace' => true, // Ensure there is no code on the same line as the PHP open tag and it is followed by a blank line. @@ -33,6 +36,8 @@ 'indentation_type' => true, // All PHP files must use same line ending. 'line_ending' => true, + // Use && and || logical operators instead of and and or. + 'logical_operators' => true, // Cast should be written in lower case. 'lowercase_cast' => true, // PHP keywords MUST be in lower case. @@ -41,6 +46,8 @@ 'lowercase_static_reference' => true, // In method arguments and method call, there MUST NOT be a space before each comma and there MUST be one space after each comma. Argument lists MAY be split across multiple lines, where each subsequent line is indented once. When doing so, the first item in the list MUST be on the next line, and there MUST be only one argument per line. 'method_argument_space' => true, + // Replaces intval, floatval, doubleval, strval and boolval function calls with according type casting operator. + 'modernize_types_casting' => true, // All instances created with new keyword must be followed by braces. 'new_with_braces' => true, // There should be no empty lines after class opening brace. @@ -83,6 +90,8 @@ 'single_import_per_statement' => true, // Each namespace use MUST go on its own line and there MUST be one blank line after the use statements block. 'single_line_after_imports' => true, + // Convert double quotes to single quotes for simple strings. + 'single_quote' => true, // Each trait `use` must be done as single statement. 'single_trait_insert_per_statement' => true, // A case should be followed by a colon and not a semicolon. diff --git a/.phpcs.php.xml.dist b/.phpcs.php.xml.dist index 302d5e75ff9..8304f4f1435 100644 --- a/.phpcs.php.xml.dist +++ b/.phpcs.php.xml.dist @@ -18,4 +18,57 @@ */Varien/Db/Tree.php* */Varien/Directory/Collection.php* + + */Magento/Crypt.php* + */Varien/Crypt/Mcrypt.php* + + + */Varien/Crypt/Mcrypt.php* + + + */Magento/Crypt.php* + */Varien/Crypt/Mcrypt.php* + + + */Varien/Crypt/Mcrypt.php* + + + */Varien/Crypt/Mcrypt.php* + + + */Magento/Crypt.php* + */Varien/Crypt/Mcrypt.php* + + + */Magento/Crypt.php* + */Varien/Crypt/Mcrypt.php* + + + */Magento/Crypt.php* + */Varien/Crypt/Mcrypt.php* + + + */Magento/Crypt.php* + */Varien/Crypt/Mcrypt.php* + + + */Magento/Crypt.php* + */Varien/Crypt/Mcrypt.php* + + + */Magento/Crypt.php* + */Varien/Crypt/Mcrypt.php* + + + */Magento/Crypt.php* + */Varien/Crypt/Mcrypt.php* + + + */Magento/Crypt.php* + */Varien/Crypt/Mcrypt.php* + + + */Magento/Crypt.php* + */Varien/Crypt/Mcrypt.php* + diff --git a/app/code/core/Mage/Admin/Model/Config.php b/app/code/core/Mage/Admin/Model/Config.php index e2a4e17b0f7..cb7aa5c3816 100644 --- a/app/code/core/Mage/Admin/Model/Config.php +++ b/app/code/core/Mage/Admin/Model/Config.php @@ -79,7 +79,7 @@ public function __construct() public function loadAclResources(Mage_Admin_Model_Acl $acl, $resource = null, $parentName = null) { if (is_null($resource)) { - $resource = $this->getAdminhtmlConfig()->getNode("acl/resources"); + $resource = $this->getAdminhtmlConfig()->getNode('acl/resources'); $resourceName = null; } else { $resourceName = (is_null($parentName) ? '' : $parentName . '/') . $resource->getName(); @@ -117,7 +117,7 @@ public function loadAclResources(Mage_Admin_Model_Acl $acl, $resource = null, $p */ public function getAclAssert($name = '') { - $asserts = $this->getNode("admin/acl/asserts"); + $asserts = $this->getNode('admin/acl/asserts'); if ($name === '') { return $asserts; } @@ -133,7 +133,7 @@ public function getAclAssert($name = '') */ public function getAclPrivilegeSet($name = '') { - $sets = $this->getNode("admin/acl/privilegeSets"); + $sets = $this->getNode('admin/acl/privilegeSets'); if ($name === '') { return $sets; } diff --git a/app/code/core/Mage/Admin/Model/Observer.php b/app/code/core/Mage/Admin/Model/Observer.php index 918ba07c1e2..e945acc6c94 100644 --- a/app/code/core/Mage/Admin/Model/Observer.php +++ b/app/code/core/Mage/Admin/Model/Observer.php @@ -55,7 +55,7 @@ public function actionPreDispatchAdmin($observer) /** @var Mage_Core_Model_Session $coreSession */ $coreSession = Mage::getSingleton('core/session'); - if ($coreSession->validateFormKey($request->getPost("form_key"))) { + if ($coreSession->validateFormKey($request->getPost('form_key'))) { $postLogin = $request->getPost('login'); $username = $postLogin['username'] ?? ''; $password = $postLogin['password'] ?? ''; diff --git a/app/code/core/Mage/Admin/Model/Resource/Acl.php b/app/code/core/Mage/Admin/Model/Resource/Acl.php index f7ad5dd0a16..b07083b4c70 100644 --- a/app/code/core/Mage/Admin/Model/Resource/Acl.php +++ b/app/code/core/Mage/Admin/Model/Resource/Acl.php @@ -148,7 +148,7 @@ public function loadRules(Mage_Admin_Model_Acl $acl, array $rulesArr) Mage::helper('adminhtml')->__( 'The following role resources are no longer available in the system: %s. You can delete them by clicking here.', implode(', ', $orphanedResources), - Mage::helper("adminhtml")->getUrl('adminhtml/permissions_orphanedResource') + Mage::helper('adminhtml')->getUrl('adminhtml/permissions_orphanedResource') ) ); } diff --git a/app/code/core/Mage/Admin/Model/Resource/Roles/Collection.php b/app/code/core/Mage/Admin/Model/Resource/Roles/Collection.php index 0c50262abd5..dad38cc5c52 100644 --- a/app/code/core/Mage/Admin/Model/Resource/Roles/Collection.php +++ b/app/code/core/Mage/Admin/Model/Resource/Roles/Collection.php @@ -33,7 +33,7 @@ protected function _initSelect() { parent::_initSelect(); - $this->getSelect()->where("main_table.role_type = ?", 'G'); + $this->getSelect()->where('main_table.role_type = ?', 'G'); return $this; } diff --git a/app/code/core/Mage/Admin/Model/Resource/Roles/User/Collection.php b/app/code/core/Mage/Admin/Model/Resource/Roles/User/Collection.php index c5d3c102903..74c531cca25 100644 --- a/app/code/core/Mage/Admin/Model/Resource/Roles/User/Collection.php +++ b/app/code/core/Mage/Admin/Model/Resource/Roles/User/Collection.php @@ -33,7 +33,7 @@ protected function _initSelect() { parent::_initSelect(); - $this->getSelect()->where("user_id > 0"); + $this->getSelect()->where('user_id > 0'); return $this; } diff --git a/app/code/core/Mage/Admin/Model/Roles.php b/app/code/core/Mage/Admin/Model/Roles.php index 9ecda32e68d..ab3d1b57387 100644 --- a/app/code/core/Mage/Admin/Model/Roles.php +++ b/app/code/core/Mage/Admin/Model/Roles.php @@ -146,8 +146,8 @@ protected function _buildResourcesArray( } if ($rawNodes) { - $resource->addAttribute("aclpath", $resourceName); - $resource->addAttribute("module_c", $module); + $resource->addAttribute('aclpath', $resourceName); + $resource->addAttribute('module_c', $module); } if (is_null($represent2Darray)) { diff --git a/app/code/core/Mage/Admin/sql/admin_setup/upgrade-1.6.1.1-1.6.1.2.php b/app/code/core/Mage/Admin/sql/admin_setup/upgrade-1.6.1.1-1.6.1.2.php index 214c224a287..bae52aea26f 100644 --- a/app/code/core/Mage/Admin/sql/admin_setup/upgrade-1.6.1.1-1.6.1.2.php +++ b/app/code/core/Mage/Admin/sql/admin_setup/upgrade-1.6.1.1-1.6.1.2.php @@ -28,7 +28,7 @@ ->addColumn('variable_name', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255, [ 'primary' => true, 'nullable' => false, - 'default' => "", + 'default' => '', ], 'Config Path') ->addColumn('is_allowed', Varien_Db_Ddl_Table::TYPE_BOOLEAN, null, [ 'nullable' => false, @@ -73,7 +73,7 @@ ], 'Block ID') ->addColumn('block_name', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255, [ 'nullable' => false, - 'default' => "", + 'default' => '', ], 'Block Name') ->addColumn('is_allowed', Varien_Db_Ddl_Table::TYPE_BOOLEAN, null, [ 'nullable' => false, diff --git a/app/code/core/Mage/Adminhtml/Block/Api/Editroles.php b/app/code/core/Mage/Adminhtml/Block/Api/Editroles.php index 91a146b3c10..a86d17128c8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/Editroles.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/Editroles.php @@ -30,7 +30,7 @@ public function __construct() protected function _beforeToHtml() { $roleId = $this->getRequest()->getParam('rid', false); - $role = Mage::getModel("api/roles") + $role = Mage::getModel('api/roles') ->load($roleId); $this->addTab('info', [ diff --git a/app/code/core/Mage/Adminhtml/Block/Api/Grid/Role.php b/app/code/core/Mage/Adminhtml/Block/Api/Grid/Role.php index 9399e10b178..bb072483a89 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/Grid/Role.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/Grid/Role.php @@ -33,7 +33,7 @@ public function __construct() protected function _prepareCollection() { - $collection = Mage::getModel("api/roles")->getCollection(); + $collection = Mage::getModel('api/roles')->getCollection(); $this->setCollection($collection); return parent::_prepareCollection(); diff --git a/app/code/core/Mage/Adminhtml/Block/Api/Role/Grid/User.php b/app/code/core/Mage/Adminhtml/Block/Api/Role/Grid/User.php index 22546bb20bd..804d2273e2f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/Role/Grid/User.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/Role/Grid/User.php @@ -145,7 +145,7 @@ public function getGridUrl() */ protected function _getUsers($json = false) { - if ($this->getRequest()->getParam('in_role_user') != "") { + if ($this->getRequest()->getParam('in_role_user') != '') { return (int)$this->getRequest()->getParam('in_role_user'); } $roleId = ($this->getRequest()->getParam('rid') > 0) ? $this->getRequest()->getParam('rid') : Mage::registry('RID'); diff --git a/app/code/core/Mage/Adminhtml/Block/Api/Tab/Rolesusers.php b/app/code/core/Mage/Adminhtml/Block/Api/Tab/Rolesusers.php index 9c947400215..44ba406e84b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/Tab/Rolesusers.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/Tab/Rolesusers.php @@ -25,7 +25,7 @@ public function __construct() $roleId = $this->getRequest()->getParam('rid', false); - $users = Mage::getModel("api/user")->getCollection()->load(); + $users = Mage::getModel('api/user')->getCollection()->load(); $this->setTemplate('api/rolesusers.phtml') ->assign('users', $users->getItems()) ->assign('roleId', $roleId); diff --git a/app/code/core/Mage/Adminhtml/Block/Api/Tab/Userroles.php b/app/code/core/Mage/Adminhtml/Block/Api/Tab/Userroles.php index d3abcab2e81..3d6d06704db 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/Tab/Userroles.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/Tab/Userroles.php @@ -25,11 +25,11 @@ public function __construct() $uid = $this->getRequest()->getParam('id', false); $uid = !empty($uid) ? $uid : 0; - $roles = Mage::getModel("api/roles") + $roles = Mage::getModel('api/roles') ->getCollection() ->load(); - $user_roles = Mage::getModel("api/roles") + $user_roles = Mage::getModel('api/roles') ->getUsersCollection() ->setUserFilter($uid) ->load(); diff --git a/app/code/core/Mage/Adminhtml/Block/Api/User/Edit/Tab/Roles.php b/app/code/core/Mage/Adminhtml/Block/Api/User/Edit/Tab/Roles.php index e0b684d12ff..eefad54c8d3 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/User/Edit/Tab/Roles.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/User/Edit/Tab/Roles.php @@ -103,7 +103,7 @@ public function getGridUrl() */ protected function _getSelectedRoles($json = false) { - if ($this->getRequest()->getParam('user_roles') != "") { + if ($this->getRequest()->getParam('user_roles') != '') { return $this->getRequest()->getParam('user_roles'); } $uRoles = Mage::registry('api_user')->getRoles(); diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Abstract.php index 94ce3400af7..8f0d533dc8c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Abstract.php @@ -163,7 +163,7 @@ public function getSaveUrl(array $args = []) public function getEditUrl() { - return $this->getUrl("*/catalog_category/edit", ['_current' => true, 'store' => null, '_query' => false, 'id' => null, 'parent' => null]); + return $this->getUrl('*/catalog_category/edit', ['_current' => true, 'store' => null, '_query' => false, 'id' => null, 'parent' => null]); } /** diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Pricestep.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Pricestep.php index 7c8f8f979c1..72e1fc4a4c8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Pricestep.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Pricestep.php @@ -29,7 +29,7 @@ class Mage_Adminhtml_Block_Catalog_Category_Helper_Pricestep extends Varien_Data public function getToggleCode() { $htmlId = 'use_config_' . $this->getHtmlId(); - return "toggleValueElements(this, this.parentNode.parentNode);" + return 'toggleValueElements(this, this.parentNode.parentNode);' . "if (!this.checked) toggleValueElements($('$htmlId'), $('$htmlId').parentNode);"; } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Sortby/Available.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Sortby/Available.php index 5b18263637c..bae54abe7ce 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Sortby/Available.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Sortby/Available.php @@ -29,7 +29,7 @@ class Mage_Adminhtml_Block_Catalog_Category_Helper_Sortby_Available extends Vari public function getToggleCode() { $htmlId = 'use_config_' . $this->getHtmlId(); - return "toggleValueElements(this, this.parentNode.parentNode);" + return 'toggleValueElements(this, this.parentNode.parentNode);' . "if (!this.checked) toggleValueElements($('$htmlId'), $('$htmlId').parentNode);"; } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Sortby/Default.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Sortby/Default.php index 62ad2eb35ab..91591cc65a4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Sortby/Default.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Sortby/Default.php @@ -29,7 +29,7 @@ class Mage_Adminhtml_Block_Catalog_Category_Helper_Sortby_Default extends Varien public function getToggleCode() { $htmlId = 'use_config_' . $this->getHtmlId(); - return "toggleValueElements(this, this.parentNode.parentNode);" + return 'toggleValueElements(this, this.parentNode.parentNode);' . "if (!this.checked) toggleValueElements($('$htmlId'), $('$htmlId').parentNode);"; } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tree.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tree.php index 503a2ed4107..e2d48b66b04 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tree.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tree.php @@ -33,7 +33,7 @@ public function __construct() protected function _prepareLayout() { - $addUrl = $this->getUrl("*/*/add", [ + $addUrl = $this->getUrl('*/*/add', [ '_current' => true, 'id' => null, '_query' => false @@ -141,7 +141,7 @@ public function getNodesUrl() public function getSwitchTreeUrl() { return $this->getUrl( - "*/catalog_category/tree", + '*/catalog_category/tree', ['_current' => true, 'store' => null, '_query' => false, 'id' => null, 'parent' => null] ); } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/Main.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/Main.php index e72ab3107ee..1c38afcf7cb 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/Main.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/Main.php @@ -148,7 +148,7 @@ protected function _prepareForm() $fieldset->addField('is_filterable', 'select', [ 'name' => 'is_filterable', - 'label' => Mage::helper('catalog')->__("Use In Layered Navigation"), + 'label' => Mage::helper('catalog')->__('Use In Layered Navigation'), 'title' => Mage::helper('catalog')->__('Can be used only with catalog input type Dropdown, Multiple Select and Price'), 'note' => Mage::helper('catalog')->__('Can be used only with catalog input type Dropdown, Multiple Select and Price'), 'values' => [ @@ -160,7 +160,7 @@ protected function _prepareForm() $fieldset->addField('is_filterable_in_search', 'select', [ 'name' => 'is_filterable_in_search', - 'label' => Mage::helper('catalog')->__("Use In Search Results Layered Navigation"), + 'label' => Mage::helper('catalog')->__('Use In Search Results Layered Navigation'), 'title' => Mage::helper('catalog')->__('Can be used only with catalog input type Dropdown, Multiple Select and Price'), 'note' => Mage::helper('catalog')->__('Can be used only with catalog input type Dropdown, Multiple Select and Price'), 'values' => $yesnoSource, @@ -233,9 +233,9 @@ protected function _prepareForm() /** @var Mage_Adminhtml_Block_Widget_Form_Element_Dependence $block */ $block = $this->getLayout()->createBlock('adminhtml/widget_form_element_dependence'); $this->setChild('form_after', $block - ->addFieldMap("is_wysiwyg_enabled", 'wysiwyg_enabled') - ->addFieldMap("is_html_allowed_on_front", 'html_allowed_on_front') - ->addFieldMap("frontend_input", 'frontend_input_type') + ->addFieldMap('is_wysiwyg_enabled', 'wysiwyg_enabled') + ->addFieldMap('is_html_allowed_on_front', 'html_allowed_on_front') + ->addFieldMap('frontend_input', 'frontend_input_type') ->addFieldDependence('wysiwyg_enabled', 'frontend_input_type', 'textarea') ->addFieldDependence('html_allowed_on_front', 'wysiwyg_enabled', '0')); diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Gallery.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Gallery.php index 4f865355dc8..dd9369974ac 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Gallery.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Gallery.php @@ -79,12 +79,12 @@ public function usedDefault($attribute) // special management for "label" and "position" since they're columns of the // catalog_product_entity_media_gallery_value database table - if ($attributeCode == "label" || $attributeCode == "position") { + if ($attributeCode == 'label' || $attributeCode == 'position') { $media_gallery = $this->getDataObject()->getMediaGallery(); - if (!count($media_gallery["images"])) { + if (!count($media_gallery['images'])) { return true; } - return $media_gallery["images"][0]["{$attributeCode}_use_default"]; + return $media_gallery['images'][0]["{$attributeCode}_use_default"]; } $defaultValue = $this->getDataObject()->getAttributeDefaultValue($attributeCode); diff --git a/app/code/core/Mage/Adminhtml/Block/Checkout/Formkey.php b/app/code/core/Mage/Adminhtml/Block/Checkout/Formkey.php index 3787ccd3f98..d4c668fee43 100644 --- a/app/code/core/Mage/Adminhtml/Block/Checkout/Formkey.php +++ b/app/code/core/Mage/Adminhtml/Block/Checkout/Formkey.php @@ -39,6 +39,6 @@ public function canShow() */ public function getSecurityAdminUrl() { - return Mage::helper("adminhtml")->getUrl('adminhtml/system_config/edit/section/admin'); + return Mage::helper('adminhtml')->getUrl('adminhtml/system_config/edit/section/admin'); } } diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php index afc5f13938c..1eb775d3fa1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php @@ -253,10 +253,10 @@ public function getChartUrl($directUrl = true) $this->_allSeries = $datas; // Image-Charts Awesome data format values - $params['chd'] = "a:"; - $dataDelimiter = ","; - $dataSetdelimiter = "|"; - $dataMissing = "_"; + $params['chd'] = 'a:'; + $dataDelimiter = ','; + $dataSetdelimiter = '|'; + $dataMissing = '_'; // process each string in the array, and find the max length foreach ($this->getAllSeries() as $index => $serie) { @@ -321,9 +321,9 @@ public function getChartUrl($directUrl = true) $params['chd'] .= $buffer; - $labelBuffer = ""; + $labelBuffer = ''; $valueBuffer = []; - $rangeBuffer = ""; + $rangeBuffer = ''; if (count($this->_axisLabels)) { $params['chxt'] = implode(',', array_keys($this->_axisLabels)); @@ -353,7 +353,7 @@ public function getChartUrl($directUrl = true) case '2y': $formats = Mage::app()->getLocale()->getTranslationList('datetime'); $format = $formats['yyMM'] ?? 'MM/yyyy'; - $format = str_replace(["yyyy", "yy", "MM"], ["Y", "y", "m"], $format); + $format = str_replace(['yyyy', 'yy', 'MM'], ['Y', 'y', 'm'], $format); $this->_axisLabels[$idx][$_index] = date($format, strtotime($_label)); break; } @@ -364,21 +364,21 @@ public function getChartUrl($directUrl = true) $tmpstring = implode('|', $this->_axisLabels[$idx]); - $valueBuffer[] = $indexid . ":|" . $tmpstring; + $valueBuffer[] = $indexid . ':|' . $tmpstring; if (count($this->_axisLabels[$idx]) > 1) { $deltaX = 100 / (count($this->_axisLabels[$idx]) - 1); } else { $deltaX = 100; } } elseif ($idx === 'y') { - $valueBuffer[] = $indexid . ":|" . implode('|', $yLabels); + $valueBuffer[] = $indexid . ':|' . implode('|', $yLabels); if (count($yLabels) - 1) { $deltaY = 100 / (count($yLabels) - 1); } else { $deltaY = 100; } // setting range values for y axis - $rangeBuffer = $indexid . "," . $miny . "," . $maxy . "|"; + $rangeBuffer = $indexid . ',' . $miny . ',' . $maxy . '|'; } $indexid++; } diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Preview.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Preview.php index dabca1b8a51..17a2eceda81 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Preview.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Preview.php @@ -49,7 +49,7 @@ protected function _toHtml() $storeId = Mage::app()->getAnyStoreView()->getId(); } - Varien_Profiler::start("newsletter_queue_proccessing"); + Varien_Profiler::start('newsletter_queue_proccessing'); $vars = []; $vars['subscriber'] = Mage::getModel('newsletter/subscriber'); @@ -59,13 +59,13 @@ protected function _toHtml() $template->revertDesign(); if ($template->isPlain()) { - $templateProcessed = "
" . htmlspecialchars($templateProcessed) . "
"; + $templateProcessed = '
' . htmlspecialchars($templateProcessed) . '
'; } $templateProcessed = Mage::getSingleton('core/input_filter_maliciousCode') ->linkFilter($templateProcessed); - Varien_Profiler::stop("newsletter_queue_proccessing"); + Varien_Profiler::stop('newsletter_queue_proccessing'); return $templateProcessed; } diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Preview.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Preview.php index b66245e6cfa..673121247bd 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Preview.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Preview.php @@ -45,7 +45,7 @@ protected function _toHtml() $storeId = Mage::app()->getAnyStoreView()->getId(); } - Varien_Profiler::start("newsletter_template_proccessing"); + Varien_Profiler::start('newsletter_template_proccessing'); $vars = []; $vars['subscriber'] = Mage::getModel('newsletter/subscriber'); @@ -58,13 +58,13 @@ protected function _toHtml() $template->revertDesign(); if ($template->isPlain()) { - $templateProcessed = "
" . htmlspecialchars($templateProcessed) . "
"; + $templateProcessed = '
' . htmlspecialchars($templateProcessed) . '
'; } $templateProcessed = Mage::getSingleton('core/input_filter_maliciousCode') ->linkFilter($templateProcessed); - Varien_Profiler::stop("newsletter_template_proccessing"); + Varien_Profiler::stop('newsletter_template_proccessing'); return $templateProcessed; } diff --git a/app/code/core/Mage/Adminhtml/Block/Notification/Curl.php b/app/code/core/Mage/Adminhtml/Block/Notification/Curl.php index 0f95b91ce96..e6fe15454c1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Notification/Curl.php +++ b/app/code/core/Mage/Adminhtml/Block/Notification/Curl.php @@ -63,7 +63,7 @@ protected function _canShow() public function getMessage() { return $this->helper('adminhtml')->__( - "Your current version of cURL php5 module is %s, which can prevent services that require TLS v1.2 from working correctly. It is recommended to update your cURL php5 module to version %s or higher.", + 'Your current version of cURL php5 module is %s, which can prevent services that require TLS v1.2 from working correctly. It is recommended to update your cURL php5 module to version %s or higher.', $this->_curlVersion['version'], $this::REQUIRED_CURL_VERSION ); diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/Grid/Role.php b/app/code/core/Mage/Adminhtml/Block/Permissions/Grid/Role.php index 0387623ca76..9ade3099fb6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/Grid/Role.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/Grid/Role.php @@ -33,7 +33,7 @@ public function __construct() protected function _prepareCollection() { - $collection = Mage::getModel("admin/roles")->getCollection(); + $collection = Mage::getModel('admin/roles')->getCollection(); $this->setCollection($collection); return parent::_prepareCollection(); diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/Grid/User.php b/app/code/core/Mage/Adminhtml/Block/Permissions/Grid/User.php index 6b92fe40e47..6d1fcc5e819 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/Grid/User.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/Grid/User.php @@ -32,7 +32,7 @@ public function __construct() protected function _prepareCollection() { - $collection = Mage::getModel("permissions/users")->getCollection(); + $collection = Mage::getModel('permissions/users')->getCollection(); $this->setCollection($collection); return parent::_prepareCollection(); diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/Role/Grid/User.php b/app/code/core/Mage/Adminhtml/Block/Permissions/Role/Grid/User.php index 197df5b29af..1794f7abfbd 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/Role/Grid/User.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/Role/Grid/User.php @@ -141,7 +141,7 @@ public function getGridUrl() protected function _getUsers($json = false) { - if ($this->getRequest()->getParam('in_role_user') != "") { + if ($this->getRequest()->getParam('in_role_user') != '') { return $this->getRequest()->getParam('in_role_user'); } $roleId = ($this->getRequest()->getParam('rid') > 0) ? $this->getRequest()->getParam('rid') : Mage::registry('RID'); diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Rolesusers.php b/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Rolesusers.php index 21d6c748f7a..53a164d42a4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Rolesusers.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Rolesusers.php @@ -25,7 +25,7 @@ public function __construct() $roleId = $this->getRequest()->getParam('rid', false); - $users = Mage::getModel("admin/user")->getCollection()->load(); + $users = Mage::getModel('admin/user')->getCollection()->load(); $this->setTemplate('permissions/rolesusers.phtml') ->assign('users', $users->getItems()) ->assign('roleId', $roleId); diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Userroles.php b/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Userroles.php index 65af2a7cd76..4b04f26b5ad 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Userroles.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Userroles.php @@ -25,11 +25,11 @@ public function __construct() $uid = $this->getRequest()->getParam('id', false); $uid = !empty($uid) ? $uid : 0; - $roles = Mage::getModel("admin/roles") + $roles = Mage::getModel('admin/roles') ->getCollection() ->load(); - $user_roles = Mage::getModel("admin/roles") + $user_roles = Mage::getModel('admin/roles') ->getUsersCollection() ->setUserFilter($uid) ->load(); diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit/Tab/Roles.php b/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit/Tab/Roles.php index bb05bfb8292..2a6be3175d2 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit/Tab/Roles.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit/Tab/Roles.php @@ -92,7 +92,7 @@ public function getGridUrl() protected function _getSelectedRoles($json = false) { - if ($this->getRequest()->getParam('user_roles') != "") { + if ($this->getRequest()->getParam('user_roles') != '') { return $this->getRequest()->getParam('user_roles'); } /** @var Mage_Admin_Model_User $user */ diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/Usernroles.php b/app/code/core/Mage/Adminhtml/Block/Permissions/Usernroles.php index e2c91d0a256..581de16e558 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/Usernroles.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/Usernroles.php @@ -22,8 +22,8 @@ class Mage_Adminhtml_Block_Permissions_UsernRoles extends Mage_Adminhtml_Block_T public function __construct() { parent::__construct(); - $userCollection = Mage::getModel("permissions/users")->getCollection()->load(); - $rolesCollection = Mage::getModel("permissions/roles")->getCollection()->load(); + $userCollection = Mage::getModel('permissions/users')->getCollection()->load(); + $rolesCollection = Mage::getModel('permissions/roles')->getCollection()->load(); $this->setTemplate('permissions/usernroles.phtml') ->assign('users', $userCollection) diff --git a/app/code/core/Mage/Adminhtml/Block/Rating/Edit.php b/app/code/core/Mage/Adminhtml/Block/Rating/Edit.php index 87dadb63cc0..656ee9a8040 100644 --- a/app/code/core/Mage/Adminhtml/Block/Rating/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Rating/Edit.php @@ -44,7 +44,7 @@ public function __construct() public function getHeaderText() { if (Mage::registry('rating_data') && Mage::registry('rating_data')->getId()) { - return Mage::helper('rating')->__("Edit Rating", $this->escapeHtml(Mage::registry('rating_data')->getRatingCode())); + return Mage::helper('rating')->__('Edit Rating', $this->escapeHtml(Mage::registry('rating_data')->getRatingCode())); } return Mage::helper('rating')->__('New Rating'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Currency.php b/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Currency.php index bf9b64a0ea6..92c8643a11a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Currency.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Currency.php @@ -37,7 +37,7 @@ public function render(Varien_Object $row) } $data = (float) $data * $this->_getRate($row); - $data = sprintf("%F", $data); + $data = sprintf('%F', $data); $data = Mage::app()->getLocale()->currency($currency_code)->toCurrency($data); return $data; } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create.php index e4ede5c8026..2a834b56878 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create.php @@ -36,7 +36,7 @@ public function __construct() $storeId = $this->_getSession()->getStoreId(); $this->_updateButton('save', 'label', Mage::helper('sales')->__('Submit Order')); - $this->_updateButton('save', 'onclick', "order.submit()"); + $this->_updateButton('save', 'onclick', 'order.submit()'); $this->_updateButton('save', 'id', 'submit_order_top_button'); if (is_null($customerId) || !$storeId) { $this->_updateButton('save', 'style', 'display:none'); diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Customer.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Customer.php index dae7ed1771d..60e76866ed5 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Customer.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Customer.php @@ -42,18 +42,18 @@ public function getButtonsHtml() { $html = ''; - $addButtonData = array( + $addButtonData = [ 'label' => Mage::helper('sales')->__('Create New Customer'), 'onclick' => 'order.setCustomerId(false)', 'class' => 'add', - ); + ]; $html .= $this->getLayout()->createBlock('adminhtml/widget_button')->setData($addButtonData)->toHtml(); - $addButtonData = array( + $addButtonData = [ 'label' => Mage::helper('sales')->__('Create Guest Order'), 'onclick' => 'order.setCustomerIsGuest()', 'class' => 'add', - ); + ]; $html .= $this->getLayout()->createBlock('adminhtml/widget_button')->setData($addButtonData)->toHtml(); return $html; diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Items/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Items/Grid.php index 11297222419..31340158816 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Items/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Items/Grid.php @@ -458,7 +458,7 @@ public function isMoveToWishlistAllowed($item) */ public function getCustomerWishlists() { - return Mage::getModel("wishlist/wishlist")->getCollection() + return Mage::getModel('wishlist/wishlist')->getCollection() ->filterByCustomerId($this->getCustomerId()); } } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/History.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/History.php index 1ebb1a7e1c3..02d063b64aa 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/History.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/History.php @@ -116,7 +116,7 @@ public function getFullHistory() ); } - usort($history, [__CLASS__, "_sortHistoryByTimestamp"]); + usort($history, [__CLASS__, '_sortHistoryByTimestamp']); return $history; } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Detail.php b/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Detail.php index 76582ddff10..c0b83ee96ac 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Detail.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Detail.php @@ -64,7 +64,7 @@ public function __construct() public function getHeaderText() { return Mage::helper('sales')->__( - "Transaction # %s | %s", + 'Transaction # %s | %s', $this->_txn->getTxnId(), $this->formatDate( $this->_txn->getCreatedAt(), diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Export.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Export.php index 4f61ac0d4cc..961c4b2fc41 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Export.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Export.php @@ -34,7 +34,7 @@ public function getElementHtml() $data = [ 'label' => Mage::helper('adminhtml')->__('Export CSV'), - 'onclick' => 'setLocation(\'' . Mage::helper('adminhtml')->getUrl("*/*/exportTablerates", $params) . 'conditionName/\' + $(\'carriers_tablerate_condition_name\').value + \'/tablerates.csv\' )', + 'onclick' => 'setLocation(\'' . Mage::helper('adminhtml')->getUrl('*/*/exportTablerates', $params) . 'conditionName/\' + $(\'carriers_tablerate_condition_name\').value + \'/tablerates.csv\' )', 'class' => '', ]; diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Tabs.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Tabs.php index 861de52c603..3871b4a9a5f 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Tabs.php @@ -302,7 +302,7 @@ public function checkSectionPermissions($code = null) { static $permissions; - if (!$code || trim($code) == "") { + if (!$code || trim($code) == '') { return false; } diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tab/Wizard.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tab/Wizard.php index 40c2a54fd93..13abc90c8a0 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tab/Wizard.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tab/Wizard.php @@ -128,7 +128,7 @@ public function getAddMapButtonHtml() if (!$this->_addMapButtonHtml) { $this->_addMapButtonHtml = $this->getLayout()->createBlock('adminhtml/widget_button')->setType('button') ->setClass('add')->setLabel($this->__('Add Field Mapping')) - ->setOnClick("addFieldMapping()")->toHtml(); + ->setOnClick('addFieldMapping()')->toHtml(); } return $this->_addMapButtonHtml; } @@ -141,7 +141,7 @@ public function getRemoveMapButtonHtml() if (!$this->_removeMapButtonHtml) { $this->_removeMapButtonHtml = $this->getLayout()->createBlock('adminhtml/widget_button')->setType('button') ->setClass('delete')->setLabel($this->__('Remove')) - ->setOnClick("removeFieldMapping(this)")->toHtml(); + ->setOnClick('removeFieldMapping(this)')->toHtml(); } return $this->_removeMapButtonHtml; } diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Run.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Run.php index 9bc83a880e2..0311bc9c720 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Run.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Run.php @@ -177,10 +177,10 @@ public function getExceptions() break; } $exceptions[] = [ - "style" => $liStyle, - "src" => Mage::getDesign()->getSkinUrl('images/' . $img), - "message" => $e->getMessage(), - "position" => $e->getPosition() + 'style' => $liStyle, + 'src' => Mage::getDesign()->getSkinUrl('images/' . $img), + 'message' => $e->getMessage(), + 'position' => $e->getPosition() ]; } parent::setExceptions($exceptions); diff --git a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Preview.php b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Preview.php index ee8319388f5..b0786525b35 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Preview.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Preview.php @@ -54,16 +54,16 @@ protected function _toHtml() $this->maliciousCodeFilter($template->getTemplateText()) ); - Varien_Profiler::start("email_template_proccessing"); + Varien_Profiler::start('email_template_proccessing'); $vars = []; $templateProcessed = $template->getProcessedTemplate($vars, true); if ($template->isPlain()) { - $templateProcessed = "
" . htmlspecialchars($templateProcessed) . "
"; + $templateProcessed = '
' . htmlspecialchars($templateProcessed) . '
'; } - Varien_Profiler::stop("email_template_proccessing"); + Varien_Profiler::stop('email_template_proccessing'); // Stop store emulation process $appEmulation->stopEnvironmentEmulation($initialEnvironmentInfo); diff --git a/app/code/core/Mage/Adminhtml/Block/System/Store/Delete/Group.php b/app/code/core/Mage/Adminhtml/Block/System/Store/Delete/Group.php index bec54cff8b8..addf1580d4a 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Store/Delete/Group.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Store/Delete/Group.php @@ -36,7 +36,7 @@ protected function _prepareLayout() $this->getLayout()->createBlock('adminhtml/widget_button') ->setData([ 'label' => Mage::helper('core')->__('Delete Store'), - 'onclick' => "deleteForm.submit()", + 'onclick' => 'deleteForm.submit()', 'class' => 'cancel' ]) ); diff --git a/app/code/core/Mage/Adminhtml/Block/System/Store/Delete/Website.php b/app/code/core/Mage/Adminhtml/Block/System/Store/Delete/Website.php index bffd0edfc58..115a5e50cae 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Store/Delete/Website.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Store/Delete/Website.php @@ -36,7 +36,7 @@ protected function _prepareLayout() $this->getLayout()->createBlock('adminhtml/widget_button') ->setData([ 'label' => Mage::helper('core')->__('Delete Website'), - 'onclick' => "deleteForm.submit()", + 'onclick' => 'deleteForm.submit()', 'class' => 'cancel' ]) ); diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Rule/Edit.php b/app/code/core/Mage/Adminhtml/Block/Tax/Rule/Edit.php index 47453d99d7b..2086b80027c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Rule/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Rule/Edit.php @@ -48,7 +48,7 @@ public function __construct() public function getHeaderText() { if (Mage::registry('tax_rule')->getId()) { - return Mage::helper('tax')->__("Edit Rule"); + return Mage::helper('tax')->__('Edit Rule'); } return Mage::helper('tax')->__('New Rule'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Form/Element/Gallery.php b/app/code/core/Mage/Adminhtml/Block/Widget/Form/Element/Gallery.php index 25da4427d28..90ac04bed96 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Form/Element/Gallery.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Form/Element/Gallery.php @@ -57,7 +57,7 @@ protected function _prepareLayout() $this->getLayout()->createBlock('adminhtml/widget_button') ->setData([ 'label' => Mage::helper('adminhtml')->__('Delete'), - 'onclick' => "deleteImage(#image#)", + 'onclick' => 'deleteImage(#image#)', 'class' => 'delete' ]) ); diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php index 5b701ae5133..f51c7a42c20 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php @@ -1134,7 +1134,7 @@ protected function _exportCsvItem(Varien_Object $item, Varien_Io_File $adapter) } $adapter->streamWriteCsv( - Mage::helper("core")->getEscapedCSVData($row) + Mage::helper('core')->getEscapedCSVData($row) ); } @@ -1167,7 +1167,7 @@ public function getCsvFile() if ($this->getCountTotals()) { $io->streamWriteCsv( - Mage::helper("core")->getEscapedCSVData($this->_getExportTotals()) + Mage::helper('core')->getEscapedCSVData($this->_getExportTotals()) ); } diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Checkbox.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Checkbox.php index b9d7f43aa0a..0c747a9defc 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Checkbox.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Checkbox.php @@ -64,7 +64,7 @@ public function render(Varien_Object $row) if ($this->getNoObjectId() || $this->getColumn()->getUseIndex()) { $v = $value; } else { - $v = ($row->getId() != "") ? $row->getId() : $value; + $v = ($row->getId() != '') ? $row->getId() : $value; } return $this->_getCheckboxHtml($v, $checked); diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Currency.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Currency.php index 86087468142..4e9f5930488 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Currency.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Currency.php @@ -45,7 +45,7 @@ public function render(Varien_Object $row) $data = (float) $data * $this->_getRate($row); $sign = (bool)(int)$this->getColumn()->getShowNumberSign() && ($data > 0) ? '+' : ''; - $data = sprintf("%F", $data); + $data = sprintf('%F', $data); $data = Mage::app()->getLocale()->currency($currency_code)->toCurrency($data); return $sign . $data; } diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Price.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Price.php index 8647483d4a0..a09ace5bfd8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Price.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Price.php @@ -43,7 +43,7 @@ public function render(Varien_Object $row) } $data = (float) $data * $this->_getRate($row); - $data = sprintf("%F", $data); + $data = sprintf('%F', $data); $data = Mage::app()->getLocale()->currency($currency_code)->toCurrency($data); return $data; } diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Wrapline.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Wrapline.php index 281c859e4e6..ca9a0b653f5 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Wrapline.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Wrapline.php @@ -42,7 +42,7 @@ public function render(Varien_Object $row) ? $this->getColumn()->getData('lineLength') : $this->_defaultMaxLineLength; for ($i = 0, $n = floor(Mage::helper('core/string')->strlen($line) / $lineLength); $i <= $n; $i++) { - $wrappedLine .= Mage::helper('core/string')->substr($line, ($lineLength * $i), $lineLength) . "
"; + $wrappedLine .= Mage::helper('core/string')->substr($line, ($lineLength * $i), $lineLength) . '
'; } return $wrappedLine; } diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction/Abstract.php index 886f76e971d..a7abf519cb5 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction/Abstract.php @@ -252,7 +252,7 @@ public function getSelected() */ public function getApplyButtonHtml() { - return $this->getButtonHtml($this->__('Submit'), $this->getJsObjectName() . ".apply()"); + return $this->getButtonHtml($this->__('Submit'), $this->getJsObjectName() . '.apply()'); } /** @@ -282,7 +282,7 @@ public function getGridIdsJson() $gridIds = $this->getParentBlock()->getCollection()->getAllIds(); if (!empty($gridIds)) { - return implode(",", $gridIds); + return implode(',', $gridIds); } return ''; } diff --git a/app/code/core/Mage/Adminhtml/Controller/Action.php b/app/code/core/Mage/Adminhtml/Controller/Action.php index ec3fd52958d..4f1d37c8640 100644 --- a/app/code/core/Mage/Adminhtml/Controller/Action.php +++ b/app/code/core/Mage/Adminhtml/Controller/Action.php @@ -152,9 +152,9 @@ public function preDispatch() { // get legacy theme choice form backend config if (Mage::getStoreConfigFlag('admin/design/use_legacy_theme')) { - $theme = Mage::getConfig()->getNode("stores/admin/design/theme/default"); + $theme = Mage::getConfig()->getNode('stores/admin/design/theme/default'); } else { - $theme = Mage::getConfig()->getNode("stores/admin/design/theme/openmage"); + $theme = Mage::getConfig()->getNode('stores/admin/design/theme/openmage'); } Mage::getDesign() diff --git a/app/code/core/Mage/Adminhtml/Helper/Help/Mapping.php b/app/code/core/Mage/Adminhtml/Helper/Help/Mapping.php index e8727e2b36f..78451d7bcde 100644 --- a/app/code/core/Mage/Adminhtml/Helper/Help/Mapping.php +++ b/app/code/core/Mage/Adminhtml/Helper/Help/Mapping.php @@ -231,7 +231,7 @@ protected function findInMapping($frontModule, $controllerName, $actionName) /** * Determine which version of docs should target onto * - * @return string + * @return Mage_Core_Model_Config_Element|Varien_Simplexml_Element|false */ protected function getHelpTargetVersion() { diff --git a/app/code/core/Mage/Adminhtml/Model/Customer/Renderer/Region.php b/app/code/core/Mage/Adminhtml/Model/Customer/Renderer/Region.php index d5db077f2ce..f22deaaab27 100644 --- a/app/code/core/Mage/Adminhtml/Model/Customer/Renderer/Region.php +++ b/app/code/core/Mage/Adminhtml/Model/Customer/Renderer/Region.php @@ -80,7 +80,7 @@ public function render(Varien_Data_Form_Element_Abstract $element) . $element->serialize($htmlAttributes) . '>' . "\n"; foreach ($regionCollection as $region) { $selected = ($regionId == $region['value']) ? ' selected="selected"' : ''; - $value = is_numeric($region['value']) ? (int)$region['value'] : ""; + $value = is_numeric($region['value']) ? (int)$region['value'] : ''; $html .= ''; @@ -101,7 +101,7 @@ public function render(Varien_Data_Form_Element_Abstract $element) $html .= ''; $html .= 'serialize($htmlAttributes) . "/>" . "\n"; + . $element->serialize($htmlAttributes) . '/>' . "\n"; $html .= ''; $html .= '' . "\n"; } diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Basedon.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Basedon.php index 54ee3ea831f..8a127356fd3 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Basedon.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Basedon.php @@ -24,7 +24,7 @@ public function toOptionArray() return [ ['value' => 'shipping', 'label' => Mage::helper('adminhtml')->__('Shipping Address')], ['value' => 'billing', 'label' => Mage::helper('adminhtml')->__('Billing Address')], - ['value' => 'origin', 'label' => Mage::helper('adminhtml')->__("Shipping Origin")], + ['value' => 'origin', 'label' => Mage::helper('adminhtml')->__('Shipping Origin')], ]; } } diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Catalog.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Catalog.php index 4c0be87b86d..785ccd48ce3 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Catalog.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Catalog.php @@ -24,7 +24,7 @@ public function toOptionArray() return [ ['value' => 0, 'label' => Mage::helper('adminhtml')->__('No (price without tax)')], ['value' => 1, 'label' => Mage::helper('adminhtml')->__('Yes (only price with tax)')], - ['value' => 2, 'label' => Mage::helper('adminhtml')->__("Both (without and with tax)")], + ['value' => 2, 'label' => Mage::helper('adminhtml')->__('Both (without and with tax)')], ]; } } diff --git a/app/code/core/Mage/Adminhtml/controllers/Api/RoleController.php b/app/code/core/Mage/Adminhtml/controllers/Api/RoleController.php index ca5b01fa927..75e0d2a2ed7 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Api/RoleController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Api/RoleController.php @@ -125,13 +125,13 @@ public function deleteAction() } try { - Mage::getModel("api/roles")->load($rid)->delete(); + Mage::getModel('api/roles')->load($rid)->delete(); Mage::getSingleton('adminhtml/session')->addSuccess($this->__('The role has been deleted.')); } catch (Exception $e) { Mage::getSingleton('adminhtml/session')->addError($this->__('An error occurred while deleting this role.')); } - $this->_redirect("*/*/"); + $this->_redirect('*/*/'); } public function saveRoleAction() @@ -168,7 +168,7 @@ public function saveRoleAction() $isAll = $this->getRequest()->getParam('all'); if ($isAll) { - $resource = ["all"]; + $resource = ['all']; } try { @@ -178,7 +178,7 @@ public function saveRoleAction() ->setRoleType('G') ->save(); - Mage::getModel("api/rules") + Mage::getModel('api/rules') ->setRoleId($role->getId()) ->setResources($resource) ->saveRel(); @@ -208,7 +208,7 @@ public function editrolegridAction() protected function _deleteUserFromRole($userId, $roleId) { try { - Mage::getModel("api/user") + Mage::getModel('api/user') ->setRoleId($roleId) ->setUserId($userId) ->deleteFromRole(); @@ -220,7 +220,7 @@ protected function _deleteUserFromRole($userId, $roleId) protected function _addUserToRole($userId, $roleId) { - $user = Mage::getModel("api/user")->load($userId); + $user = Mage::getModel('api/user')->load($userId); $user->setRoleId($roleId)->setUserId($userId); if ($user->roleUserExists() === true) { diff --git a/app/code/core/Mage/Adminhtml/controllers/CacheController.php b/app/code/core/Mage/Adminhtml/controllers/CacheController.php index 80d701b0788..407caba728e 100644 --- a/app/code/core/Mage/Adminhtml/controllers/CacheController.php +++ b/app/code/core/Mage/Adminhtml/controllers/CacheController.php @@ -54,7 +54,7 @@ public function flushAllAction() { Mage::app()->getCacheInstance()->flush(); Mage::dispatchEvent('adminhtml_cache_flush_all'); - $this->_getSession()->addSuccess(Mage::helper('adminhtml')->__("The cache storage has been flushed.")); + $this->_getSession()->addSuccess(Mage::helper('adminhtml')->__('The cache storage has been flushed.')); $this->_redirect('*/*'); } @@ -76,7 +76,7 @@ public function flushSystemAction() Mage::getConfig()->releaseCacheSaveLock(); } Mage::dispatchEvent('adminhtml_cache_flush_system'); - $this->_getSession()->addSuccess(Mage::helper('adminhtml')->__("The OpenMage cache has been flushed and updates applied.")); + $this->_getSession()->addSuccess(Mage::helper('adminhtml')->__('The OpenMage cache has been flushed and updates applied.')); $this->_redirect('*/*'); } @@ -97,7 +97,7 @@ public function massEnableAction() } if ($updatedTypes > 0) { Mage::app()->saveUseCache($allTypes); - $this->_getSession()->addSuccess(Mage::helper('adminhtml')->__("%s cache type(s) enabled.", $updatedTypes)); + $this->_getSession()->addSuccess(Mage::helper('adminhtml')->__('%s cache type(s) enabled.', $updatedTypes)); } $this->_redirect('*/*'); } @@ -120,7 +120,7 @@ public function massDisableAction() } if ($updatedTypes > 0) { Mage::app()->saveUseCache($allTypes); - $this->_getSession()->addSuccess(Mage::helper('adminhtml')->__("%s cache type(s) disabled.", $updatedTypes)); + $this->_getSession()->addSuccess(Mage::helper('adminhtml')->__('%s cache type(s) disabled.', $updatedTypes)); } $this->_redirect('*/*'); } @@ -140,7 +140,7 @@ public function massRefreshAction() } } if ($updatedTypes > 0) { - $this->_getSession()->addSuccess(Mage::helper('adminhtml')->__("%s cache type(s) refreshed.", $updatedTypes)); + $this->_getSession()->addSuccess(Mage::helper('adminhtml')->__('%s cache type(s) refreshed.', $updatedTypes)); } $this->_redirect('*/*'); } diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/CategoryController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/CategoryController.php index ad534a4be6c..78bb850604e 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Catalog/CategoryController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/CategoryController.php @@ -320,7 +320,7 @@ public function saveAction() * Proceed with $_POST['use_config'] * set into category model for proccessing through validation */ - $category->setData("use_post_data_config", $this->getRequest()->getPost('use_config')); + $category->setData('use_post_data_config', $this->getRequest()->getPost('use_config')); try { $validate = $category->validate(); @@ -375,7 +375,7 @@ public function moveAction() $category->setData('save_rewrites_history', Mage::helper('catalog')->shouldSaveUrlRewritesHistory()); try { $category->move($parentNodeId, $prevNodeId); - $this->getResponse()->setBody("SUCCESS"); + $this->getResponse()->setBody('SUCCESS'); } catch (Mage_Core_Exception $e) { $this->getResponse()->setBody($e->getMessage()); } catch (Exception $e) { diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/GalleryController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/GalleryController.php index 99e5975584f..58c0f9c5ced 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/GalleryController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/GalleryController.php @@ -56,8 +56,8 @@ public function uploadAction() /** * Workaround for prototype 1.7 methods "isJSON", "evalJSON" on Windows OS */ - $result['tmp_name'] = str_replace(DS, "/", $result['tmp_name']); - $result['path'] = str_replace(DS, "/", $result['path']); + $result['tmp_name'] = str_replace(DS, '/', $result['tmp_name']); + $result['path'] = str_replace(DS, '/', $result['path']); $result['url'] = Mage::getSingleton('catalog/product_media_config')->getTmpMediaUrl($result['file']); $result['file'] = $result['file'] . '.tmp'; diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php index c5fc49a0e20..6e8df72ded7 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php @@ -97,7 +97,7 @@ protected function _initProduct() $productType = $product->getTypeInstance(); if (!$productId || !$productType->getUsedProductAttributeIds()) { $productType->setUsedProductAttributeIds( - explode(",", base64_decode(urldecode($attributes))) + explode(',', base64_decode(urldecode($attributes))) ); } } @@ -106,7 +106,7 @@ protected function _initProduct() if ($this->getRequest()->getParam('popup') && $requiredAttributes = $this->getRequest()->getParam('required') ) { - $requiredAttributes = explode(",", $requiredAttributes); + $requiredAttributes = explode(',', $requiredAttributes); foreach ($product->getAttributes() as $attribute) { if (in_array($attribute->getId(), $requiredAttributes)) { $attribute->setIsRequired(1); diff --git a/app/code/core/Mage/Adminhtml/controllers/Cms/BlockController.php b/app/code/core/Mage/Adminhtml/controllers/Cms/BlockController.php index 78d358af8b3..6ba8ede730e 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Cms/BlockController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Cms/BlockController.php @@ -168,7 +168,7 @@ public function deleteAction() { // check if we know what should be deleted if ($id = $this->getRequest()->getParam('block_id')) { - $title = ""; + $title = ''; try { // init model and delete $model = Mage::getModel('cms/block'); diff --git a/app/code/core/Mage/Adminhtml/controllers/Cms/PageController.php b/app/code/core/Mage/Adminhtml/controllers/Cms/PageController.php index 9924aa89982..7ff8117718a 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Cms/PageController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Cms/PageController.php @@ -175,7 +175,7 @@ public function deleteAction() { // check if we know what should be deleted if ($id = $this->getRequest()->getParam('page_id')) { - $title = ""; + $title = ''; try { // init model and delete $model = Mage::getModel('cms/page'); diff --git a/app/code/core/Mage/Adminhtml/controllers/IndexController.php b/app/code/core/Mage/Adminhtml/controllers/IndexController.php index 0918021f0f2..555e630f9b7 100644 --- a/app/code/core/Mage/Adminhtml/controllers/IndexController.php +++ b/app/code/core/Mage/Adminhtml/controllers/IndexController.php @@ -89,7 +89,7 @@ public function logoutAction() */ public function globalSearchAction() { - $searchModules = Mage::getConfig()->getNode("adminhtml/global_search"); + $searchModules = Mage::getConfig()->getNode('adminhtml/global_search'); $items = []; if (!Mage::getStoreConfigFlag('admin/global_search/enable') || !Mage::getSingleton('admin/session')->isAllowed('admin/global_search')) { diff --git a/app/code/core/Mage/Adminhtml/controllers/RatingController.php b/app/code/core/Mage/Adminhtml/controllers/RatingController.php index 08a1d5fa62c..64e01257890 100644 --- a/app/code/core/Mage/Adminhtml/controllers/RatingController.php +++ b/app/code/core/Mage/Adminhtml/controllers/RatingController.php @@ -92,7 +92,7 @@ public function saveAction() $i = 1; foreach ($options as $key => $optionCode) { $optionModel = Mage::getModel('rating/rating_option'); - if (!preg_match("/^add_([0-9]*?)$/", $key)) { + if (!preg_match('/^add_([0-9]*?)$/', $key)) { $optionModel->setId($key); } diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/Billing/AgreementController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/Billing/AgreementController.php index a5cabb872cf..2a3dd992164 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/Billing/AgreementController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/Billing/AgreementController.php @@ -56,7 +56,7 @@ public function viewAction() if ($agreementModel) { $this->_title($this->__('Sales')) ->_title($this->__('Billing Agreements')) - ->_title(sprintf("#%s", $agreementModel->getReferenceId())); + ->_title(sprintf('#%s', $agreementModel->getReferenceId())); $this->loadLayout() ->_setActiveMenu('sales/billing_agreement') diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreditmemoController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreditmemoController.php index 8ad63eb97ae..36bacef02c7 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreditmemoController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreditmemoController.php @@ -179,7 +179,7 @@ public function viewAction() { $creditmemo = $this->_initCreditmemo(); if ($creditmemo) { - $this->_title(sprintf("#%s", $creditmemo->getIncrementId())); + $this->_title(sprintf('#%s', $creditmemo->getIncrementId())); $this->loadLayout(); @@ -212,9 +212,9 @@ public function newAction() { if ($creditmemo = $this->_initCreditmemo()) { if ($creditmemo->getInvoice()) { - $this->_title($this->__("New Memo for #%s", $creditmemo->getInvoice()->getIncrementId())); + $this->_title($this->__('New Memo for #%s', $creditmemo->getInvoice()->getIncrementId())); } else { - $this->_title($this->__("New Memo")); + $this->_title($this->__('New Memo')); } if ($comment = Mage::getSingleton('adminhtml/session')->getCommentText(true)) { diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/InvoiceController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/InvoiceController.php index f382469a91c..2319d945f5e 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/InvoiceController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/InvoiceController.php @@ -130,7 +130,7 @@ public function viewAction() { $invoice = $this->_initInvoice(); if ($invoice) { - $this->_title(sprintf("#%s", $invoice->getIncrementId())); + $this->_title(sprintf('#%s', $invoice->getIncrementId())); $this->loadLayout() ->_setActiveMenu('sales/invoice'); diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php index dd803294b5a..ae7a56568ec 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php @@ -119,7 +119,7 @@ public function viewAction() { $shipment = $this->_initShipment(); if ($shipment) { - $this->_title(sprintf("#%s", $shipment->getIncrementId())); + $this->_title(sprintf('#%s', $shipment->getIncrementId())); $this->loadLayout(); diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php index de4a727492b..74dc1789a6c 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php @@ -110,7 +110,7 @@ public function viewAction() $this->_initAction(); - $this->_title(sprintf("#%s", $order->getRealOrderId())); + $this->_title(sprintf('#%s', $order->getRealOrderId())); $this->renderLayout(); } diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/TransactionsController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/TransactionsController.php index 5187b8acd41..73b2f894af3 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/TransactionsController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/TransactionsController.php @@ -79,7 +79,7 @@ public function viewAction() } $this->_title($this->__('Sales')) ->_title($this->__('Transactions')) - ->_title(sprintf("#%s", $txn->getTxnId())); + ->_title(sprintf('#%s', $txn->getTxnId())); $this->loadLayout() ->_setActiveMenu('sales/transactions') diff --git a/app/code/core/Mage/Adminhtml/controllers/System/AccountController.php b/app/code/core/Mage/Adminhtml/controllers/System/AccountController.php index e1c719d5700..d55ca3c7084 100644 --- a/app/code/core/Mage/Adminhtml/controllers/System/AccountController.php +++ b/app/code/core/Mage/Adminhtml/controllers/System/AccountController.php @@ -43,7 +43,7 @@ public function indexAction() public function saveAction() { $userId = Mage::getSingleton('admin/session')->getUser()->getId(); - $user = Mage::getModel("admin/user")->load($userId); + $user = Mage::getModel('admin/user')->load($userId); $user->setId($userId) ->setUsername($this->getRequest()->getParam('username', false)) @@ -74,7 +74,7 @@ public function saveAction() foreach ($result as $error) { Mage::getSingleton('adminhtml/session')->addError($error); } - $this->getResponse()->setRedirect($this->getUrl("*/*/")); + $this->getResponse()->setRedirect($this->getUrl('*/*/')); return; } @@ -86,6 +86,6 @@ public function saveAction() } catch (Exception $e) { Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('An error occurred while saving account.')); } - $this->getResponse()->setRedirect($this->getUrl("*/*/")); + $this->getResponse()->setRedirect($this->getUrl('*/*/')); } } diff --git a/app/code/core/Mage/Adminhtml/controllers/System/Convert/GuiController.php b/app/code/core/Mage/Adminhtml/controllers/System/Convert/GuiController.php index 53a03873d9f..a957e1846ad 100644 --- a/app/code/core/Mage/Adminhtml/controllers/System/Convert/GuiController.php +++ b/app/code/core/Mage/Adminhtml/controllers/System/Convert/GuiController.php @@ -13,7 +13,7 @@ * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -include_once "ProfileController.php"; +include_once 'ProfileController.php'; /** * Convert GUI admin controller diff --git a/app/code/core/Mage/Adminhtml/controllers/System/DesignController.php b/app/code/core/Mage/Adminhtml/controllers/System/DesignController.php index 51b34e561f5..780a432dbb0 100644 --- a/app/code/core/Mage/Adminhtml/controllers/System/DesignController.php +++ b/app/code/core/Mage/Adminhtml/controllers/System/DesignController.php @@ -130,7 +130,7 @@ public function deleteAction() ->addError($e->getMessage()); } catch (Exception $e) { Mage::getSingleton('adminhtml/session') - ->addException($e, $this->__("Cannot delete the design change.")); + ->addException($e, $this->__('Cannot delete the design change.')); } } $this->getResponse()->setRedirect($this->getUrl('*/*/')); diff --git a/app/code/core/Mage/Adminhtml/controllers/System/StoreController.php b/app/code/core/Mage/Adminhtml/controllers/System/StoreController.php index 87154be97c6..07f04a18227 100644 --- a/app/code/core/Mage/Adminhtml/controllers/System/StoreController.php +++ b/app/code/core/Mage/Adminhtml/controllers/System/StoreController.php @@ -117,21 +117,21 @@ public function editStoreAction() case 'website': $itemId = $this->getRequest()->getParam('website_id', null); $model = Mage::getModel('core/website'); - $title = Mage::helper('core')->__("Website"); - $notExists = Mage::helper('core')->__("The website does not exist."); + $title = Mage::helper('core')->__('Website'); + $notExists = Mage::helper('core')->__('The website does not exist.'); $codeBase = Mage::helper('core')->__('Before modifying the website code please make sure that it is not used in index.php.'); break; case 'group': $itemId = $this->getRequest()->getParam('group_id', null); $model = Mage::getModel('core/store_group'); - $title = Mage::helper('core')->__("Store"); - $notExists = Mage::helper('core')->__("The store does not exist"); + $title = Mage::helper('core')->__('Store'); + $notExists = Mage::helper('core')->__('The store does not exist'); $codeBase = false; break; case 'store': $itemId = $this->getRequest()->getParam('store_id', null); $model = Mage::getModel('core/store'); - $title = Mage::helper('core')->__("Store View"); + $title = Mage::helper('core')->__('Store View'); $notExists = Mage::helper('core')->__("Store view doesn't exist"); $codeBase = Mage::helper('core')->__('Before modifying the store view code please make sure that it is not used in index.php.'); break; diff --git a/app/code/core/Mage/Adminhtml/controllers/Tax/Class/CustomerController.php b/app/code/core/Mage/Adminhtml/controllers/Tax/Class/CustomerController.php index d86f3e6bc69..0411a7f8709 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Tax/Class/CustomerController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Tax/Class/CustomerController.php @@ -138,7 +138,7 @@ public function deleteAction() $classModel->delete(); $session->addSuccess(Mage::helper('tax')->__('The tax class has been deleted.')); - $this->getResponse()->setRedirect($this->getUrl("*/*/")); + $this->getResponse()->setRedirect($this->getUrl('*/*/')); return ; } catch (Mage_Core_Exception $e) { $session->addError($e->getMessage()); diff --git a/app/code/core/Mage/Adminhtml/controllers/Tax/Class/ProductController.php b/app/code/core/Mage/Adminhtml/controllers/Tax/Class/ProductController.php index ffdada2720b..5ff6f509ea5 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Tax/Class/ProductController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Tax/Class/ProductController.php @@ -137,7 +137,7 @@ public function deleteAction() $classModel->delete(); $session->addSuccess(Mage::helper('tax')->__('The tax class has been deleted.')); - $this->getResponse()->setRedirect($this->getUrl("*/*/")); + $this->getResponse()->setRedirect($this->getUrl('*/*/')); return; } catch (Mage_Core_Exception $e) { $session->addError($e->getMessage()); diff --git a/app/code/core/Mage/Adminhtml/controllers/Tax/RateController.php b/app/code/core/Mage/Adminhtml/controllers/Tax/RateController.php index 299e39c8932..fc07f93bdd5 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Tax/RateController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Tax/RateController.php @@ -99,7 +99,7 @@ public function saveAction() $rateModel->save(); Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('tax')->__('The tax rate has been saved.')); - $this->getResponse()->setRedirect($this->getUrl("*/*/")); + $this->getResponse()->setRedirect($this->getUrl('*/*/')); return true; } catch (Mage_Core_Exception $e) { Mage::getSingleton('adminhtml/session')->setFormData($ratePost); @@ -131,7 +131,7 @@ public function editAction() } if (!$rateModel->getId()) { - $this->getResponse()->setRedirect($this->getUrl("*/*/")); + $this->getResponse()->setRedirect($this->getUrl('*/*/')); return; } @@ -139,7 +139,7 @@ public function editAction() $rateModel->setTaxPostcode($rateModel->getZipFrom() . '-' . $rateModel->getZipTo()); } - $this->_title(sprintf("%s", $rateModel->getCode())); + $this->_title(sprintf('%s', $rateModel->getCode())); /** @var Mage_Adminhtml_Block_Tax_Rate_Toolbar_Save $block */ $block = $this->getLayout()->createBlock('adminhtml/tax_rate_toolbar_save'); @@ -169,7 +169,7 @@ public function deleteAction() $rateModel->delete(); Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('tax')->__('The tax rate has been deleted.')); - $this->getResponse()->setRedirect($this->getUrl("*/*/")); + $this->getResponse()->setRedirect($this->getUrl('*/*/')); return true; } catch (Mage_Core_Exception $e) { Mage::getSingleton('adminhtml/session')->addError($e->getMessage()); @@ -179,7 +179,7 @@ public function deleteAction() if ($referer = $this->getRequest()->getServer('HTTP_REFERER')) { $this->getResponse()->setRedirect($referer); } else { - $this->getResponse()->setRedirect($this->getUrl("*/*/")); + $this->getResponse()->setRedirect($this->getUrl('*/*/')); } } else { Mage::getSingleton('adminhtml/session')->addError(Mage::helper('tax')->__('An error occurred while deleting this rate. Incorrect rate ID.')); diff --git a/app/code/core/Mage/Adminhtml/controllers/Tax/RuleController.php b/app/code/core/Mage/Adminhtml/controllers/Tax/RuleController.php index 5362ec9663f..2740d0685a2 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Tax/RuleController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Tax/RuleController.php @@ -79,7 +79,7 @@ public function editAction() $ruleModel->setData($data); } - $this->_title($ruleModel->getId() ? sprintf("%s", $ruleModel->getCode()) : $this->__('New Rule')); + $this->_title($ruleModel->getId() ? sprintf('%s', $ruleModel->getCode()) : $this->__('New Rule')); Mage::register('tax_rule', $ruleModel); @@ -157,7 +157,7 @@ protected function _isValidRuleRequest($ruleModel) //Verify if a Rule already exists. If not throw an error if (count($existingRules) > 0) { - $ruleCodes = implode(",", $existingRules); + $ruleCodes = implode(',', $existingRules); $session->addError( $this->_getHelperModel('tax')->__('Rules (%s) already exist for the specified Tax Rate, Customer Tax Class and Product Tax Class combinations', $ruleCodes) ); diff --git a/app/code/core/Mage/Api/Model/Resource/Roles/User/Collection.php b/app/code/core/Mage/Api/Model/Resource/Roles/User/Collection.php index f8ff652c5a2..66074b75dd4 100644 --- a/app/code/core/Mage/Api/Model/Resource/Roles/User/Collection.php +++ b/app/code/core/Mage/Api/Model/Resource/Roles/User/Collection.php @@ -39,7 +39,7 @@ protected function _initSelect() { parent::_initSelect(); - $this->getSelect()->where("user_id > 0"); + $this->getSelect()->where('user_id > 0'); return $this; } diff --git a/app/code/core/Mage/Api/Model/Resource/Rules/Collection.php b/app/code/core/Mage/Api/Model/Resource/Rules/Collection.php index d75ce75b774..ed564251cff 100644 --- a/app/code/core/Mage/Api/Model/Resource/Rules/Collection.php +++ b/app/code/core/Mage/Api/Model/Resource/Rules/Collection.php @@ -38,7 +38,7 @@ protected function _construct() */ public function getByRoles($id) { - $this->getSelect()->where("role_id = ?", (int)$id); + $this->getSelect()->where('role_id = ?', (int)$id); return $this; } diff --git a/app/code/core/Mage/Api/Model/Roles.php b/app/code/core/Mage/Api/Model/Roles.php index d73dd218a3e..026564883ae 100644 --- a/app/code/core/Mage/Api/Model/Roles.php +++ b/app/code/core/Mage/Api/Model/Roles.php @@ -134,7 +134,7 @@ protected function _buildResourcesArray( } if ($rawNodes) { - $resource->addAttribute("aclpath", $resourceName); + $resource->addAttribute('aclpath', $resourceName); } $resource->title = Mage::helper($module)->__((string)$resource->title); diff --git a/app/code/core/Mage/Api/Model/Server.php b/app/code/core/Mage/Api/Model/Server.php index 6d319bbadb5..b7444712fa4 100644 --- a/app/code/core/Mage/Api/Model/Server.php +++ b/app/code/core/Mage/Api/Model/Server.php @@ -25,7 +25,7 @@ class Mage_Api_Model_Server * Api Name by Adapter * @var string */ - protected $_api = ""; + protected $_api = ''; /** * Web service adapter diff --git a/app/code/core/Mage/Api/Model/Server/Adapter/Soap.php b/app/code/core/Mage/Api/Model/Server/Adapter/Soap.php index a0821aadd5d..36cafcc06e4 100644 --- a/app/code/core/Mage/Api/Model/Server/Adapter/Soap.php +++ b/app/code/core/Mage/Api/Model/Server/Adapter/Soap.php @@ -123,7 +123,7 @@ public function getController() */ public function run() { - $apiConfigCharset = Mage::getStoreConfig("api/config/charset"); + $apiConfigCharset = Mage::getStoreConfig('api/config/charset'); if ($this->getController()->getRequest()->getParam('wsdl') !== null) { // Generating wsdl content from template @@ -226,7 +226,7 @@ protected function getWsdlUrl($params = null, $withAuth = true) if ($phpAuthUser && $phpAuthPw) { $wsdlUrl = sprintf( - "%s://%s:%s@%s", + '%s://%s:%s@%s', $scheme, $phpAuthUser, $phpAuthPw, @@ -260,7 +260,7 @@ protected function _instantiateServer() $retry = false; try { $this->_soap = new Zend_Soap_Server( - $this->getWsdlUrl(["wsdl" => 1]), + $this->getWsdlUrl(['wsdl' => 1]), ['encoding' => $apiConfigCharset] ); } catch (SoapFault $e) { diff --git a/app/code/core/Mage/Api/Model/Server/Adapter/Xmlrpc.php b/app/code/core/Mage/Api/Model/Server/Adapter/Xmlrpc.php index 92895b1d6d4..9ed16c81f41 100644 --- a/app/code/core/Mage/Api/Model/Server/Adapter/Xmlrpc.php +++ b/app/code/core/Mage/Api/Model/Server/Adapter/Xmlrpc.php @@ -88,7 +88,7 @@ public function getController() */ public function run() { - $apiConfigCharset = Mage::getStoreConfig("api/config/charset"); + $apiConfigCharset = Mage::getStoreConfig('api/config/charset'); $this->_xmlRpc = new Zend_XmlRpc_Server(); $this->_xmlRpc->setEncoding($apiConfigCharset) diff --git a/app/code/core/Mage/Api/Model/Server/V2/Adapter/Soap.php b/app/code/core/Mage/Api/Model/Server/V2/Adapter/Soap.php index f7785e3bb2f..292f1741200 100644 --- a/app/code/core/Mage/Api/Model/Server/V2/Adapter/Soap.php +++ b/app/code/core/Mage/Api/Model/Server/V2/Adapter/Soap.php @@ -39,7 +39,7 @@ protected function _getWsdlConfig() */ public function run() { - $apiConfigCharset = Mage::getStoreConfig("api/config/charset"); + $apiConfigCharset = Mage::getStoreConfig('api/config/charset'); if ($this->getController()->getRequest()->getParam('wsdl') !== null) { $this->wsdlConfig->setHandler($this->getHandler()) diff --git a/app/code/core/Mage/Api/Model/Server/Wsi/Adapter/Soap.php b/app/code/core/Mage/Api/Model/Server/Wsi/Adapter/Soap.php index 7557cca522c..3a6796a80b7 100644 --- a/app/code/core/Mage/Api/Model/Server/Wsi/Adapter/Soap.php +++ b/app/code/core/Mage/Api/Model/Server/Wsi/Adapter/Soap.php @@ -42,7 +42,7 @@ protected function _getWsdlConfig() */ public function run() { - $apiConfigCharset = Mage::getStoreConfig("api/config/charset"); + $apiConfigCharset = Mage::getStoreConfig('api/config/charset'); if ($this->getController()->getRequest()->getParam('wsdl') !== null) { $this->getController()->getResponse() diff --git a/app/code/core/Mage/Api/Model/Wsdl/Config.php b/app/code/core/Mage/Api/Model/Wsdl/Config.php index 1cf684c10e6..0ff9b2903f8 100644 --- a/app/code/core/Mage/Api/Model/Wsdl/Config.php +++ b/app/code/core/Mage/Api/Model/Wsdl/Config.php @@ -120,9 +120,9 @@ public function init() * Exclude Mage_Api wsdl xml file because it used for previous version * of API wsdl declaration */ - $mergeWsdl->addLoadedFile(Mage::getConfig()->getModuleDir('etc', "Mage_Api") . DS . 'wsi.xml'); + $mergeWsdl->addLoadedFile(Mage::getConfig()->getModuleDir('etc', 'Mage_Api') . DS . 'wsi.xml'); - $baseWsdlFile = Mage::getConfig()->getModuleDir('etc', "Mage_Api") . DS . 'wsi.xml'; + $baseWsdlFile = Mage::getConfig()->getModuleDir('etc', 'Mage_Api') . DS . 'wsi.xml'; $this->loadFile($baseWsdlFile); Mage::getConfig()->loadModulesConfiguration('wsi.xml', $this, $mergeWsdl); } else { @@ -130,9 +130,9 @@ public function init() * Exclude Mage_Api wsdl xml file because it used for previous version * of API wsdl declaration */ - $mergeWsdl->addLoadedFile(Mage::getConfig()->getModuleDir('etc', "Mage_Api") . DS . 'wsdl.xml'); + $mergeWsdl->addLoadedFile(Mage::getConfig()->getModuleDir('etc', 'Mage_Api') . DS . 'wsdl.xml'); - $baseWsdlFile = Mage::getConfig()->getModuleDir('etc', "Mage_Api") . DS . 'wsdl2.xml'; + $baseWsdlFile = Mage::getConfig()->getModuleDir('etc', 'Mage_Api') . DS . 'wsdl2.xml'; $this->loadFile($baseWsdlFile); Mage::getConfig()->loadModulesConfiguration('wsdl.xml', $this, $mergeWsdl); } diff --git a/app/code/core/Mage/Api2/Model/Resource/Validator/Eav.php b/app/code/core/Mage/Api2/Model/Resource/Validator/Eav.php index c6583ef1b79..8d5b3aee797 100644 --- a/app/code/core/Mage/Api2/Model/Resource/Validator/Eav.php +++ b/app/code/core/Mage/Api2/Model/Resource/Validator/Eav.php @@ -96,7 +96,7 @@ public function __construct($options) } $this->_entity = Mage::getModel($validationConfig[$userType]['entity_model']); if (empty($this->_entity) || !$this->_entity instanceof Mage_Core_Model_Abstract) { - throw new Exception("Entity is not model."); + throw new Exception('Entity is not model.'); } $this->_eavForm = Mage::getModel($this->_formPath); diff --git a/app/code/core/Mage/Api2/Model/Server.php b/app/code/core/Mage/Api2/Model/Server.php index 1847e81260f..4f414a4b176 100644 --- a/app/code/core/Mage/Api2/Model/Server.php +++ b/app/code/core/Mage/Api2/Model/Server.php @@ -161,8 +161,8 @@ protected function _setAuthUser(Mage_Api2_Model_Auth_User_Abstract $authUser) protected function _getAuthUser() { if (!$this->_authUser) { - throw new Exception("Mage_Api2_Model_Server::internalCall() seems to be executed " - . "before Mage_Api2_Model_Server::run()"); + throw new Exception('Mage_Api2_Model_Server::internalCall() seems to be executed ' + . 'before Mage_Api2_Model_Server::run()'); } return $this->_authUser; } diff --git a/app/code/core/Mage/Api2/controllers/Adminhtml/Api2/RoleController.php b/app/code/core/Mage/Api2/controllers/Adminhtml/Api2/RoleController.php index 7c0771ade6c..c1ef897571d 100644 --- a/app/code/core/Mage/Api2/controllers/Adminhtml/Api2/RoleController.php +++ b/app/code/core/Mage/Api2/controllers/Adminhtml/Api2/RoleController.php @@ -272,7 +272,7 @@ public function deleteAction() try { /** @var Mage_Api2_Model_Acl_Global_Role $model */ - $model = Mage::getModel("api2/acl_global_role"); + $model = Mage::getModel('api2/acl_global_role'); $model->load($id)->delete(); $this->_getSession()->addSuccess($this->__('Role has been deleted.')); } catch (Mage_Core_Exception $e) { @@ -281,7 +281,7 @@ public function deleteAction() $this->_getSession()->addException($e, $this->__('An error occurred while deleting the role.')); } - $this->_redirect("*/*/"); + $this->_redirect('*/*/'); } /** @@ -316,7 +316,7 @@ public function rolesGridAction() */ protected function _getUsers($id) { - if ($this->getRequest()->getParam('in_role_users') != "") { + if ($this->getRequest()->getParam('in_role_users') != '') { return $this->getRequest()->getParam('in_role_users'); } diff --git a/app/code/core/Mage/Authorizenet/Helper/Admin.php b/app/code/core/Mage/Authorizenet/Helper/Admin.php index 32b239b3fc3..77dcbfb1abe 100644 --- a/app/code/core/Mage/Authorizenet/Helper/Admin.php +++ b/app/code/core/Mage/Authorizenet/Helper/Admin.php @@ -53,7 +53,7 @@ public function getSaveOrderUrlParams($controller) { $route = parent::getSaveOrderUrlParams($controller); - if ($controller === "sales_order_create" || $controller === "sales_order_edit") { + if ($controller === 'sales_order_create' || $controller === 'sales_order_edit') { $route['action'] = 'save'; $route['controller'] = 'sales_order_create'; $route['module'] = 'admin'; diff --git a/app/code/core/Mage/Authorizenet/Helper/Data.php b/app/code/core/Mage/Authorizenet/Helper/Data.php index 73b77315c39..aaf36ee138f 100644 --- a/app/code/core/Mage/Authorizenet/Helper/Data.php +++ b/app/code/core/Mage/Authorizenet/Helper/Data.php @@ -62,7 +62,7 @@ protected function _getUrl($route, $params = []) public function getSaveOrderUrlParams($controller) { $route = []; - if ($controller === "onepage") { + if ($controller === 'onepage') { $route['action'] = 'saveOrder'; $route['controller'] = 'onepage'; $route['module'] = 'checkout'; diff --git a/app/code/core/Mage/Authorizenet/Model/Directpost/Request.php b/app/code/core/Mage/Authorizenet/Model/Directpost/Request.php index 444e4df7ffd..7c2de8885f6 100644 --- a/app/code/core/Mage/Authorizenet/Model/Directpost/Request.php +++ b/app/code/core/Mage/Authorizenet/Model/Directpost/Request.php @@ -67,7 +67,7 @@ protected function _setTransactionKey($transKey) public function generateRequestSign($merchantApiLoginId, $merchantTransactionKey, $amount, $currencyCode, $fpSequence, $fpTimestamp) { return hash_hmac( - "md5", + 'md5', $merchantApiLoginId . '^' . $fpSequence . '^' . $fpTimestamp . '^' . diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Extend.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Extend.php index ef3def6fa2e..1dd2fb4eddd 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Extend.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Extend.php @@ -71,8 +71,8 @@ public function getElementHtml() $html .= '' . $elementHtml . ''; } if ($this->getDisableChild() && !$this->getElement()->getReadonly()) { - $html .= ""; + $html .= $switchAttributeCode . '_change(); + '; } return $html; } diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Sales/Order/Items/Renderer.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Sales/Order/Items/Renderer.php index 65e49b59c28..22ae9d96f4b 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Sales/Order/Items/Renderer.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Sales/Order/Items/Renderer.php @@ -201,7 +201,7 @@ public function getValueHtml($item) } if (!$this->isChildCalculated($item)) { if ($attributes = $this->getSelectionAttributes($item)) { - $result .= " " . $this->getOrderItem()->getOrder()->formatPrice($attributes['price']); + $result .= ' ' . $this->getOrderItem()->getOrder()->formatPrice($attributes['price']); } } return $result; diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Sales/Order/View/Items/Renderer.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Sales/Order/View/Items/Renderer.php index 58f8390e5c0..6da0573e4a7 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Sales/Order/View/Items/Renderer.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Sales/Order/View/Items/Renderer.php @@ -152,7 +152,7 @@ public function getValueHtml($item) } if (!$this->isChildCalculated($item)) { if ($attributes = $this->getSelectionAttributes($item)) { - $result .= " " . $this->getItem()->getOrder()->formatPrice($attributes['price']); + $result .= ' ' . $this->getItem()->getOrder()->formatPrice($attributes['price']); } } return $result; diff --git a/app/code/core/Mage/Bundle/Block/Sales/Order/Items/Renderer.php b/app/code/core/Mage/Bundle/Block/Sales/Order/Items/Renderer.php index 40f501cd4b4..94bcd32ccf8 100644 --- a/app/code/core/Mage/Bundle/Block/Sales/Order/Items/Renderer.php +++ b/app/code/core/Mage/Bundle/Block/Sales/Order/Items/Renderer.php @@ -133,7 +133,7 @@ public function getValueHtml($item) if ($attributes = $this->getSelectionAttributes($item)) { return sprintf('%d', $attributes['qty']) . ' x ' . $this->escapeHtml($item->getName()) . - " " . $this->getOrder()->formatPrice($attributes['price']); + ' ' . $this->getOrder()->formatPrice($attributes['price']); } else { return $this->escapeHtml($item->getName()); } diff --git a/app/code/core/Mage/Bundle/Model/Resource/Bundle.php b/app/code/core/Mage/Bundle/Model/Resource/Bundle.php index 38e9562613d..db383b6f25d 100644 --- a/app/code/core/Mage/Bundle/Model/Resource/Bundle.php +++ b/app/code/core/Mage/Bundle/Model/Resource/Bundle.php @@ -32,13 +32,13 @@ class Mage_Bundle_Model_Resource_Bundle extends Mage_CatalogIndex_Model_Resource protected function _getSelect($productId, $columns = []) { return $this->_getReadAdapter()->select() - ->from(["bundle_option" => $this->getTable('bundle/option')], ['type', 'option_id']) - ->where("bundle_option.parent_id = ?", $productId) - ->where("bundle_option.required = 1") + ->from(['bundle_option' => $this->getTable('bundle/option')], ['type', 'option_id']) + ->where('bundle_option.parent_id = ?', $productId) + ->where('bundle_option.required = 1') ->joinLeft( [ - "bundle_selection" => $this->getTable('bundle/selection')], - "bundle_selection.option_id = bundle_option.option_id", + 'bundle_selection' => $this->getTable('bundle/selection')], + 'bundle_selection.option_id = bundle_option.option_id', $columns ); } @@ -53,7 +53,7 @@ public function getSelectionsData($productId) { return $this->_getReadAdapter()->fetchAll($this->_getSelect( $productId, - ["*"] + ['*'] )); } diff --git a/app/code/core/Mage/Bundle/Model/Resource/Indexer/Price.php b/app/code/core/Mage/Bundle/Model/Resource/Indexer/Price.php index d194e27bb42..9b149f29ef9 100644 --- a/app/code/core/Mage/Bundle/Model/Resource/Indexer/Price.php +++ b/app/code/core/Mage/Bundle/Model/Resource/Indexer/Price.php @@ -203,7 +203,7 @@ protected function _prepareBundlePriceByType($priceType, $entityIds = null) '1', '0' ) - ) . " > 0 AND " . + ) . ' > 0 AND ' . $write->getCheckSql( $specialTo . ' IS NULL', '1', @@ -224,7 +224,7 @@ protected function _prepareBundlePriceByType($priceType, $entityIds = null) '0' ); - $tierExpr = new Zend_Db_Expr("tp.min_price"); + $tierExpr = new Zend_Db_Expr('tp.min_price'); if ($priceType == Mage_Bundle_Model_Product_Price::PRICE_TYPE_FIXED) { $finalPrice = $write->getCheckSql( @@ -248,7 +248,7 @@ protected function _prepareBundlePriceByType($priceType, $entityIds = null) $finalPrice ); } else { - $finalPrice = new Zend_Db_Expr("0"); + $finalPrice = new Zend_Db_Expr('0'); $tierPrice = $write->getCheckSql($tierExpr . ' IS NOT NULL', '0', 'NULL'); $groupPrice = $write->getCheckSql($groupPriceExpr . ' > 0', $groupPriceExpr, 'NULL'); } @@ -329,7 +329,7 @@ protected function _calculateBundleOptionPrice() 'MIN(io.alt_price)', 'SUM(io.min_price)' ) . ' + i.price'); - $maxPrice = new Zend_Db_Expr("SUM(io.max_price) + i.price"); + $maxPrice = new Zend_Db_Expr('SUM(io.max_price) + i.price'); $tierPrice = $write->getCheckSql( 'MIN(i.tier_percent) IS NOT NULL', $write->getCheckSql( diff --git a/app/code/core/Mage/Bundle/Model/Resource/Selection.php b/app/code/core/Mage/Bundle/Model/Resource/Selection.php index 3d00b64258e..c1dd98ca4fe 100644 --- a/app/code/core/Mage/Bundle/Model/Resource/Selection.php +++ b/app/code/core/Mage/Bundle/Model/Resource/Selection.php @@ -48,7 +48,7 @@ public function getPriceFromIndex($productId, $qty, $storeId, $groupId) $websiteId = Mage::app()->getStore($storeId)->getWebsiteId(); - $select->from(["price_index" => $this->getTable('catalogindex/price')], ['price' => 'SUM(value)']) + $select->from(['price_index' => $this->getTable('catalogindex/price')], ['price' => 'SUM(value)']) ->where('entity_id = :product_id') ->where('website_id = :website_id') ->where('customer_group_id = :customer_group') diff --git a/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Abstract.php b/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Abstract.php index 62cb3dfa7fc..e5fc2e4cf09 100644 --- a/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Abstract.php +++ b/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Abstract.php @@ -243,7 +243,7 @@ public function getValueHtml($item) if (!$this->isChildCalculated($item)) { $attributes = $this->getSelectionAttributes($item); if ($attributes) { - $result .= " " . strip_tags($this->getOrderItem()->getOrder()->formatPrice($attributes['price'])); + $result .= ' ' . strip_tags($this->getOrderItem()->getOrder()->formatPrice($attributes['price'])); } } return $result; diff --git a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-data-upgrade-0.1.13-0.1.14.php b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-data-upgrade-0.1.13-0.1.14.php index d7a2178df37..cb2045b153f 100644 --- a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-data-upgrade-0.1.13-0.1.14.php +++ b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-data-upgrade-0.1.13-0.1.14.php @@ -20,8 +20,8 @@ $taxClassAttribute = $installer->getAttribute('catalog_product', 'tax_class_id'); $productTable = $installer->getTable('catalog/product'); -$priceTypeTable = $productTable . "_" . $priceTypeAttribute['backend_type']; -$taxClassTable = $productTable . "_" . $taxClassAttribute['backend_type']; +$priceTypeTable = $productTable . '_' . $priceTypeAttribute['backend_type']; +$taxClassTable = $productTable . '_' . $taxClassAttribute['backend_type']; $db = $installer->getConnection(); $db->beginTransaction(); diff --git a/app/code/core/Mage/Catalog/Block/Widget/Link.php b/app/code/core/Mage/Catalog/Block/Widget/Link.php index 393f2a7bdf6..658bdc1829a 100644 --- a/app/code/core/Mage/Catalog/Block/Widget/Link.php +++ b/app/code/core/Mage/Catalog/Block/Widget/Link.php @@ -80,9 +80,9 @@ public function getHref() } if ($this->_href) { - if (strpos($this->_href, "___store") === false) { - $symbol = (strpos($this->_href, "?") === false) ? "?" : "&"; - $this->_href = $this->_href . $symbol . "___store=" . $store->getCode(); + if (strpos($this->_href, '___store') === false) { + $symbol = (strpos($this->_href, '?') === false) ? '?' : '&'; + $this->_href = $this->_href . $symbol . '___store=' . $store->getCode(); } } else { return false; diff --git a/app/code/core/Mage/Catalog/Helper/Category/Url/Rewrite.php b/app/code/core/Mage/Catalog/Helper/Category/Url/Rewrite.php index c38648923e4..c15d83e9609 100644 --- a/app/code/core/Mage/Catalog/Helper/Category/Url/Rewrite.php +++ b/app/code/core/Mage/Catalog/Helper/Category/Url/Rewrite.php @@ -60,9 +60,9 @@ public function joinTableToEavCollection(Mage_Eav_Model_Entity_Collection_Abstra 'core/url_rewrite', 'category_id=entity_id', ['request_path'], - "{{table}}.is_system=1 AND " . + '{{table}}.is_system=1 AND ' . "{{table}}.store_id='{$storeId}' AND " . - "{{table}}.category_id IS NOT NULL AND " . + '{{table}}.category_id IS NOT NULL AND ' . "{{table}}.id_path LIKE 'category/%'", 'left' ); diff --git a/app/code/core/Mage/Catalog/Helper/Data.php b/app/code/core/Mage/Catalog/Helper/Data.php index 79b39545d28..24ada49f41b 100644 --- a/app/code/core/Mage/Catalog/Helper/Data.php +++ b/app/code/core/Mage/Catalog/Helper/Data.php @@ -424,7 +424,7 @@ public function canApplyMsrpToProductType($product) */ public function getMsrpPriceMessage($product) { - $message = ""; + $message = ''; if ($this->canApplyMsrp($product, Mage_Catalog_Model_Product_Attribute_Source_Msrp_Type::TYPE_IN_CART)) { $message = $this->__('To see product price, add this item to your cart. You can always remove it later.'); } elseif ($this->canApplyMsrp($product, Mage_Catalog_Model_Product_Attribute_Source_Msrp_Type::TYPE_BEFORE_ORDER_CONFIRM)) { diff --git a/app/code/core/Mage/Catalog/Helper/Image.php b/app/code/core/Mage/Catalog/Helper/Image.php index 0809ccd6eac..3939a00d2a6 100644 --- a/app/code/core/Mage/Catalog/Helper/Image.php +++ b/app/code/core/Mage/Catalog/Helper/Image.php @@ -266,9 +266,10 @@ public function constrainOnly($flag) */ public function backgroundColor($colorRGB) { + $args = func_get_args(); // assume that 3 params were given instead of array if (!is_array($colorRGB)) { - $colorRGB = func_get_args(); + $colorRGB = $args; } $this->_getModel()->setBackgroundColor($colorRGB); return $this; diff --git a/app/code/core/Mage/Catalog/Helper/Product.php b/app/code/core/Mage/Catalog/Helper/Product.php index 245222cf695..c334c99052b 100644 --- a/app/code/core/Mage/Catalog/Helper/Product.php +++ b/app/code/core/Mage/Catalog/Helper/Product.php @@ -450,7 +450,7 @@ public function getProduct($productId, $store, $identifierType = null) $expectedIdType = false; if ($identifierType === null) { - if (is_string($productId) && !preg_match("/^[+-]?[1-9][0-9]*$|^0$/", $productId)) { + if (is_string($productId) && !preg_match('/^[+-]?[1-9][0-9]*$|^0$/', $productId)) { $expectedIdType = 'sku'; } } diff --git a/app/code/core/Mage/Catalog/Model/Category/Api.php b/app/code/core/Mage/Catalog/Model/Category/Api.php index 7ed9cb27d50..8fb3120484b 100644 --- a/app/code/core/Mage/Catalog/Model/Category/Api.php +++ b/app/code/core/Mage/Catalog/Model/Category/Api.php @@ -265,7 +265,7 @@ public function create($parentId, $categoryData, $store = null) * Proceed with $useConfig set into category model for processing through validation */ if (count($useConfig) > 0) { - $category->setData("use_post_data_config", $useConfig); + $category->setData('use_post_data_config', $useConfig); } try { @@ -355,7 +355,7 @@ public function move($categoryId, $parentId, $afterId = null) } if (str_starts_with($parent_category->getPath(), $category->getPath())) { - $this->_fault('not_moved', "Operation do not allow to move a parent category to any of children category"); + $this->_fault('not_moved', 'Operation do not allow to move a parent category to any of children category'); } try { diff --git a/app/code/core/Mage/Catalog/Model/Category/Attribute/Backend/Sortby.php b/app/code/core/Mage/Catalog/Model/Category/Attribute/Backend/Sortby.php index 14fc7752f9d..08f3277bfc1 100644 --- a/app/code/core/Mage/Catalog/Model/Category/Attribute/Backend/Sortby.php +++ b/app/code/core/Mage/Catalog/Model/Category/Attribute/Backend/Sortby.php @@ -63,7 +63,7 @@ public function validate($object) $available = explode(',', $available); } $data = (!in_array('default_sort_by', $postDataConfig)) ? $object->getData($attributeCode) : - Mage::getStoreConfig("catalog/frontend/default_sort_by"); + Mage::getStoreConfig('catalog/frontend/default_sort_by'); if (!in_array($data, $available)) { Mage::throwException(Mage::helper('eav')->__('Default Product Listing Sort by does not exist in Available Product Listing Sort By.')); } diff --git a/app/code/core/Mage/Catalog/Model/Convert/Adapter/Product.php b/app/code/core/Mage/Catalog/Model/Convert/Adapter/Product.php index 9dab4c052c0..c3ab65a4e3a 100644 --- a/app/code/core/Mage/Catalog/Model/Convert/Adapter/Product.php +++ b/app/code/core/Mage/Catalog/Model/Convert/Adapter/Product.php @@ -575,7 +575,7 @@ public function save() unset($model); $i++; } - $this->addException(Mage::helper('catalog')->__("Saved %d record(s)", $i)); + $this->addException(Mage::helper('catalog')->__('Saved %d record(s)', $i)); } catch (Exception $e) { if (!$e instanceof Mage_Dataflow_Model_Convert_Exception) { $this->addException( diff --git a/app/code/core/Mage/Catalog/Model/Design.php b/app/code/core/Mage/Catalog/Model/Design.php index 990db6a020d..49007b18f80 100644 --- a/app/code/core/Mage/Catalog/Model/Design.php +++ b/app/code/core/Mage/Catalog/Model/Design.php @@ -162,7 +162,7 @@ protected function _isApplyDesign($design, array $date) return false; } - $designInfo = explode("/", $design); + $designInfo = explode('/', $design); if (count($designInfo) != 2) { return false; } diff --git a/app/code/core/Mage/Catalog/Model/Product.php b/app/code/core/Mage/Catalog/Model/Product.php index 799a44cbe2b..0f72908b9ce 100644 --- a/app/code/core/Mage/Catalog/Model/Product.php +++ b/app/code/core/Mage/Catalog/Model/Product.php @@ -2069,7 +2069,7 @@ public function getReservedAttributes() foreach ($methods as $method) { if (preg_match('/^get([A-Z]{1}.+)/', $method, $matches)) { $method = $matches[1]; - $tmp = strtolower(preg_replace('/(.)([A-Z])/', "$1_$2", $method)); + $tmp = strtolower(preg_replace('/(.)([A-Z])/', '$1_$2', $method)); $_reserved[] = $tmp; } } diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Media.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Media.php index 7e5b29466a2..9bbd405d247 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Media.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Media.php @@ -167,11 +167,13 @@ public function beforeSave($object) foreach ($value['values'] as $mediaAttrCode => $attrData) { if (array_key_exists($attrData, $newImages)) { $object->setData($mediaAttrCode, $newImages[$attrData]['new_file']); - $object->setData($mediaAttrCode . '_label', ($newImages[$attrData]['label'] === null || $newImages[$attrData]['label_use_default']) ? $newImages[$attrData]['label_default'] : $newImages[$attrData]['label']); + $label = $newImages[$attrData]['label'] === null || !empty($newImages[$attrData]['label_use_default']) ? $newImages[$attrData]['label_default'] : $newImages[$attrData]['label']; + $object->setData($mediaAttrCode . '_label', $label); } if (array_key_exists($attrData, $existImages)) { - $object->setData($mediaAttrCode . '_label', ($existImages[$attrData]['label'] === null || $existImages[$attrData]['label_use_default']) ? $existImages[$attrData]['label_default'] : $existImages[$attrData]['label']); + $label = $existImages[$attrData]['label'] === null || !empty($existImages[$attrData]['label_use_default']) ? $existImages[$attrData]['label_default'] : $existImages[$attrData]['label']; + $object->setData($mediaAttrCode . '_label', $label); } } @@ -243,14 +245,14 @@ public function afterSave($object) } if ($storeId === 0) { - $image["label_use_default"] = false; - $image["position_use_default"] = false; + $image['label_use_default'] = false; + $image['position_use_default'] = false; } else { - if (!isset($image["label_use_default"])) { - $image["label_use_default"] = null; + if (!isset($image['label_use_default'])) { + $image['label_use_default'] = null; } - if (!isset($image["position_use_default"])) { - $image["position_use_default"] = null; + if (!isset($image['position_use_default'])) { + $image['position_use_default'] = null; } } @@ -259,8 +261,8 @@ public function afterSave($object) // Add per store labels, position, disabled $data = []; $data['value_id'] = $image['value_id']; - $data['label'] = ($image['label'] === null || $image["label_use_default"]) ? null : $image['label']; - $data['position'] = ($image['position'] === null || $image["position_use_default"]) ? null : (int) $image['position']; + $data['label'] = ($image['label'] === null || $image['label_use_default']) ? null : $image['label']; + $data['position'] = ($image['position'] === null || $image['position_use_default']) ? null : (int) $image['position']; $data['disabled'] = (int) $image['disabled']; $data['store_id'] = (int) $object->getStoreId(); diff --git a/app/code/core/Mage/Catalog/Model/Product/Image.php b/app/code/core/Mage/Catalog/Model/Product/Image.php index bbd30f55fe2..112d1827231 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Image.php +++ b/app/code/core/Mage/Catalog/Model/Product/Image.php @@ -248,7 +248,7 @@ protected function _getMemoryLimit() $memoryLimit = trim(strtoupper(ini_get('memory_limit'))); if (!isset($memoryLimit[0])) { - $memoryLimit = "128M"; + $memoryLimit = '128M'; } return ini_parse_quantity($memoryLimit); @@ -566,7 +566,7 @@ public function saveFile() public function getUrl() { $baseDir = Mage::getBaseDir('media'); - $path = str_replace($baseDir . DS, "", $this->_newFile); + $path = str_replace($baseDir . DS, '', $this->_newFile); return Mage::getBaseUrl('media') . str_replace(DS, '/', $path); } diff --git a/app/code/core/Mage/Catalog/Model/Product/Option/Type/File.php b/app/code/core/Mage/Catalog/Model/Product/Option/Type/File.php index 5b08b5ca993..364b8c9a7c2 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Option/Type/File.php +++ b/app/code/core/Mage/Catalog/Model/Product/Option/Type/File.php @@ -180,7 +180,7 @@ protected function _validateUploadedFile() $this->setIsValid(false); $value = $this->_bytesToMbytes($this->_getUploadMaxFilesize()); Mage::throwException( - Mage::helper('catalog')->__("The file you uploaded is larger than %s Megabytes allowed by server", $value) + Mage::helper('catalog')->__('The file you uploaded is larger than %s Megabytes allowed by server', $value) ); } else { switch ($this->getProcessMode()) { @@ -434,7 +434,7 @@ public function prepareForCart() try { Mage::helper('core/unserializeArray')->unserialize($result); } catch (Exception $e) { - Mage::throwException(Mage::helper('catalog')->__("File options format is not valid.")); + Mage::throwException(Mage::helper('catalog')->__('File options format is not valid.')); } } else { /* @@ -515,7 +515,7 @@ protected function _getOptionHtml($optionValue) $sizes ); } catch (Exception $e) { - Mage::throwException(Mage::helper('catalog')->__("File options format is not valid.")); + Mage::throwException(Mage::helper('catalog')->__('File options format is not valid.')); } } diff --git a/app/code/core/Mage/Catalog/Model/Product/Type/Abstract.php b/app/code/core/Mage/Catalog/Model/Product/Type/Abstract.php index 5773d9f4cf0..69b72222482 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Type/Abstract.php +++ b/app/code/core/Mage/Catalog/Model/Product/Type/Abstract.php @@ -449,7 +449,7 @@ public function processFileQueue() if (isset($queueOptions['option'])) { $queueOptions['option']->setIsValid(false); } - Mage::throwException(Mage::helper('catalog')->__("File upload failed")); + Mage::throwException(Mage::helper('catalog')->__('File upload failed')); } Mage::helper('core/file_storage_database')->saveFile($dst); break; diff --git a/app/code/core/Mage/Catalog/Model/Resource/Category.php b/app/code/core/Mage/Catalog/Model/Resource/Category.php index c3201921c2f..658fa1dccbd 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Category.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Category.php @@ -459,7 +459,7 @@ public function getChildrenAmount($category, $isActiveFlag = true) ) ->joinLeft( ['c' => $table], - "c.attribute_id = :attribute_id AND c.store_id = :store_id AND c.entity_id = m.entity_id", + 'c.attribute_id = :attribute_id AND c.store_id = :store_id AND c.entity_id = m.entity_id', [] ) ->where('m.path LIKE :c_path') @@ -480,7 +480,7 @@ protected function _getIsActiveAttributeId() ->getAttribute(Mage_Catalog_Model_Category::ENTITY, 'is_active') ->getId(); if (!is_int($attributeId)) { - Mage::throwException("Failed to find category attribute is_active"); + Mage::throwException('Failed to find category attribute is_active'); } $this->_isActiveAttributeId = $attributeId; } @@ -704,7 +704,7 @@ public function getChildren($category, $recursive = true) [] ) ->where($checkSql . ' = :scope') - ->order("m.position ASC"); + ->order('m.position ASC'); return $adapter->fetchCol($select, $bind); } diff --git a/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php b/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php index 7e962fb0b72..5209f23b5cc 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php @@ -285,7 +285,7 @@ protected function _loadNodes($parentNode = null, $recursionLevel = 0, $storeId $urlRewrite->joinTableToSelect($select, $storeId); if ($parentPath) { - $select->where($_conn->quoteInto("main_table.path like ?", "$parentPath/%")); + $select->where($_conn->quoteInto('main_table.path like ?', "$parentPath/%")); } if ($recursionLevel != 0) { $levelField = $_conn->quoteIdentifier('level'); @@ -1120,7 +1120,7 @@ public function moveold($categoryId, $prevParentId, $parentId) $update = "UPDATE {$mainStoreTable}, {$catalogCategoryTable} SET"; foreach ($_staticFields as $field) { - $update .= " {$mainStoreTable}." . $field . "={$catalogCategoryTable}." . $field . ","; + $update .= " {$mainStoreTable}." . $field . "={$catalogCategoryTable}." . $field . ','; } $update = substr($update, 0, -1); $update .= " WHERE {$mainStoreTable}.entity_id = {$catalogCategoryTable}.entity_id AND " . @@ -1335,7 +1335,7 @@ public function getChildren($category, $recursive = true, $isActive = true) $select = $this->_getReadAdapter()->select() ->from($maintable, 'entity_id') ->where('path LIKE ?', "{$category->getPath()}/%") - ->order($maintable . ".position ASC"); + ->order($maintable . '.position ASC'); if (!$recursive) { $select->where('level <= ?', $category->getLevel() + 1); } diff --git a/app/code/core/Mage/Catalog/Model/Resource/Category/Indexer/Product.php b/app/code/core/Mage/Catalog/Model/Resource/Category/Indexer/Product.php index 286e83a1be5..cc6cd8b9fb1 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Category/Indexer/Product.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Category/Indexer/Product.php @@ -269,7 +269,7 @@ public function catalogCategorySave(Mage_Index_Model_Event $event) ->from(['ce' => $this->_categoryTable], ['entity_id']) ->joinInner( ['dca' => $anchorInfo['table']], - "dca.entity_id=ce.entity_id AND dca.attribute_id=:attribute_id AND dca.store_id=:store_id", + 'dca.entity_id=ce.entity_id AND dca.attribute_id=:attribute_id AND dca.store_id=:store_id', [] ) ->where('dca.value=:e_value') @@ -385,7 +385,7 @@ protected function _refreshNotAnchorRootCategories(?array $categoryIds = null) ->joinLeft( ['sv' => $visibilityInfo['table']], "sv.entity_id = pw.product_id AND sv.attribute_id = {$visibilityInfo['id']}" - . " AND sv.store_id = " . (int)$storeId, + . ' AND sv.store_id = ' . (int)$storeId, [] ) ->join( @@ -396,7 +396,7 @@ protected function _refreshNotAnchorRootCategories(?array $categoryIds = null) ->joinLeft( ['ss' => $statusInfo['table']], "ss.entity_id = pw.product_id AND ss.attribute_id = {$statusInfo['id']}" - . " AND ss.store_id = " . (int)$storeId, + . ' AND ss.store_id = ' . (int)$storeId, [] ) ->where('i.product_id IS NULL') @@ -463,7 +463,7 @@ protected function _refreshDirectRelations($categoryIds = null, $productIds = nu ->joinLeft( ['dv' => $visibilityInfo['table']], $adapter->quoteInto( - "dv.entity_id=cp.product_id AND dv.attribute_id=? AND dv.store_id=0", + 'dv.entity_id=cp.product_id AND dv.attribute_id=? AND dv.store_id=0', $visibilityInfo['id'] ), [] @@ -471,7 +471,7 @@ protected function _refreshDirectRelations($categoryIds = null, $productIds = nu ->joinLeft( ['sv' => $visibilityInfo['table']], $adapter->quoteInto( - "sv.entity_id=cp.product_id AND sv.attribute_id=? AND sv.store_id=s.store_id", + 'sv.entity_id=cp.product_id AND sv.attribute_id=? AND sv.store_id=s.store_id', $visibilityInfo['id'] ), ['visibility' => $adapter->getCheckSql( @@ -713,7 +713,7 @@ protected function _refreshRootRelations($productIds) ->joinLeft( ['sv' => $visibilityInfo['table']], "sv.entity_id = pw.product_id AND sv.attribute_id = {$visibilityInfo['id']}" - . " AND sv.store_id = s.store_id", + . ' AND sv.store_id = s.store_id', [] ) ->join( @@ -1121,14 +1121,14 @@ protected function _prepareAnchorCategories($storeId, $rootPath) ->joinLeft( ['cad' => $anchorTable], $adapter->quoteInto( - "cad.entity_id=ce.entity_id AND cad.attribute_id=? AND cad.store_id=0", + 'cad.entity_id=ce.entity_id AND cad.attribute_id=? AND cad.store_id=0', $anchorAttributeId ), [] ) ->joinLeft( ['cas' => $anchorTable], - $adapter->quoteInto("cas.entity_id=ce.entity_id AND cas.attribute_id=? AND ", $anchorAttributeId) + $adapter->quoteInto('cas.entity_id=ce.entity_id AND cas.attribute_id=? AND ', $anchorAttributeId) . $adapter->quoteInto('cas.store_id=?', $storeId), [] ) diff --git a/app/code/core/Mage/Catalog/Model/Resource/Collection/Abstract.php b/app/code/core/Mage/Catalog/Model/Resource/Collection/Abstract.php index 2656a117d98..eef89b9b8ad 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Collection/Abstract.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Collection/Abstract.php @@ -181,7 +181,7 @@ protected function _joinAttributeToSelect($method, $attribute, $tableAlias, $con $defCondition = str_replace($tableAlias, $defAlias, $defCondition); $defCondition .= $adapter->quoteInto( - " AND " . $adapter->quoteColumnAs("$defAlias.store_id", null) . " = ?", + ' AND ' . $adapter->quoteColumnAs("$defAlias.store_id", null) . ' = ?', $this->getDefaultStoreId() ); diff --git a/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Decimal.php b/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Decimal.php index 06d4aa1a8d1..fd0a48f2f39 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Decimal.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Decimal.php @@ -125,7 +125,7 @@ public function getCount($filter, $range) $select = $this->_getSelect($filter); $adapter = $this->_getReadAdapter(); - $countExpr = new Zend_Db_Expr("COUNT(*)"); + $countExpr = new Zend_Db_Expr('COUNT(*)'); $rangeExpr = new Zend_Db_Expr("FLOOR(decimal_index.value / {$range}) + 1"); $select->columns([ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php index d9d7df5b4a5..1eedf9b2469 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php @@ -1528,7 +1528,7 @@ public function addAttributeToSort($attribute, $dir = self::SORT_ORDER_ASC) return $this; } elseif ($attribute == 'is_saleable') { - $this->getSelect()->order("is_saleable " . $dir); + $this->getSelect()->order('is_saleable ' . $dir); return $this; } diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Flat/Indexer.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Flat/Indexer.php index 751bca62d8c..08aad3aceac 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Flat/Indexer.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Flat/Indexer.php @@ -623,7 +623,7 @@ public function prepareFlatTable($storeId) $maxIndex = Mage::getConfig()->getNode(self::XML_NODE_MAX_INDEX_COUNT); if (count($indexesNeed) > $maxIndex) { - Mage::throwException(Mage::helper('catalog')->__("The Flat Catalog module has a limit of %2\$d filterable and/or sortable attributes. Currently there are %1\$d of them. Please reduce the number of filterable/sortable attributes in order to use this module", count($indexesNeed), $maxIndex)); + Mage::throwException(Mage::helper('catalog')->__('The Flat Catalog module has a limit of %2$d filterable and/or sortable attributes. Currently there are %1$d of them. Please reduce the number of filterable/sortable attributes in order to use this module', count($indexesNeed), $maxIndex)); } // Process indexes to create names for them in MMDB-style and reformat to common index definition diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Configurable.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Configurable.php index 7823a08ff35..34d4ee12d57 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Configurable.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Configurable.php @@ -172,12 +172,12 @@ protected function _applyConfigurableOption() $tierPrice = $priceExpression; $tierRoundPriceExp = $write->getCheckSql("{$percentExpr} = 1", $roundExpr, $tierPrice); $tierPriceExp = $write->getCheckSql("{$tierPrice} IS NULL", '0', $tierRoundPriceExp); - $tierPriceColumn = $write->getCheckSql("MIN(i.tier_price) IS NOT NULL", "SUM({$tierPriceExp})", 'NULL'); + $tierPriceColumn = $write->getCheckSql('MIN(i.tier_price) IS NOT NULL', "SUM({$tierPriceExp})", 'NULL'); $groupPrice = $priceExpression; $groupRoundPriceExp = $write->getCheckSql("{$percentExpr} = 1", $roundExpr, $groupPrice); $groupPriceExp = $write->getCheckSql("{$groupPrice} IS NULL", '0', $groupRoundPriceExp); - $groupPriceColumn = $write->getCheckSql("MIN(i.group_price) IS NOT NULL", "SUM({$groupPriceExp})", 'NULL'); + $groupPriceColumn = $write->getCheckSql('MIN(i.group_price) IS NOT NULL', "SUM({$groupPriceExp})", 'NULL'); $select->columns([ 'price' => $priceColumn, diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Default.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Default.php index 8c3e2b5f56d..eed78fc54a3 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Default.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Default.php @@ -403,19 +403,19 @@ protected function _applyCustomOption() $minPriceRound = new Zend_Db_Expr("ROUND(i.price * ({$optPriceValue} / 100), 4)"); $minPriceExpr = $write->getCheckSql("{$optPriceType} = 'fixed'", $optPriceValue, $minPriceRound); $minPriceMin = new Zend_Db_Expr("MIN({$minPriceExpr})"); - $minPrice = $write->getCheckSql("MIN(o.is_require) = 1", $minPriceMin, '0'); + $minPrice = $write->getCheckSql('MIN(o.is_require) = 1', $minPriceMin, '0'); $tierPriceRound = new Zend_Db_Expr("ROUND(i.base_tier * ({$optPriceValue} / 100), 4)"); $tierPriceExpr = $write->getCheckSql("{$optPriceType} = 'fixed'", $optPriceValue, $tierPriceRound); $tierPriceMin = new Zend_Db_Expr("MIN($tierPriceExpr)"); - $tierPriceValue = $write->getCheckSql("MIN(o.is_require) > 0", $tierPriceMin, 0); - $tierPrice = $write->getCheckSql("MIN(i.base_tier) IS NOT NULL", $tierPriceValue, "NULL"); + $tierPriceValue = $write->getCheckSql('MIN(o.is_require) > 0', $tierPriceMin, 0); + $tierPrice = $write->getCheckSql('MIN(i.base_tier) IS NOT NULL', $tierPriceValue, 'NULL'); $groupPriceRound = new Zend_Db_Expr("ROUND(i.base_group_price * ({$optPriceValue} / 100), 4)"); $groupPriceExpr = $write->getCheckSql("{$optPriceType} = 'fixed'", $optPriceValue, $groupPriceRound); $groupPriceMin = new Zend_Db_Expr("MIN($groupPriceExpr)"); - $groupPriceValue = $write->getCheckSql("MIN(o.is_require) > 0", $groupPriceMin, 0); - $groupPrice = $write->getCheckSql("MIN(i.base_group_price) IS NOT NULL", $groupPriceValue, "NULL"); + $groupPriceValue = $write->getCheckSql('MIN(o.is_require) > 0', $groupPriceMin, 0); + $groupPrice = $write->getCheckSql('MIN(i.base_group_price) IS NOT NULL', $groupPriceValue, 'NULL'); $maxPriceRound = new Zend_Db_Expr("ROUND(i.price * ({$optPriceValue} / 100), 4)"); $maxPriceExpr = $write->getCheckSql("{$optPriceType} = 'fixed'", $optPriceValue, $maxPriceRound); @@ -478,12 +478,12 @@ protected function _applyCustomOption() $tierPriceRound = new Zend_Db_Expr("ROUND(i.base_tier * ({$optPriceValue} / 100), 4)"); $tierPriceExpr = $write->getCheckSql("{$optPriceType} = 'fixed'", $optPriceValue, $tierPriceRound); $tierPriceValue = $write->getCheckSql("{$tierPriceExpr} > 0 AND o.is_require > 0", $tierPriceExpr, 0); - $tierPrice = $write->getCheckSql("i.base_tier IS NOT NULL", $tierPriceValue, "NULL"); + $tierPrice = $write->getCheckSql('i.base_tier IS NOT NULL', $tierPriceValue, 'NULL'); $groupPriceRound = new Zend_Db_Expr("ROUND(i.base_group_price * ({$optPriceValue} / 100), 4)"); $groupPriceExpr = $write->getCheckSql("{$optPriceType} = 'fixed'", $optPriceValue, $groupPriceRound); $groupPriceValue = $write->getCheckSql("{$groupPriceExpr} > 0 AND o.is_require > 0", $groupPriceExpr, 0); - $groupPrice = $write->getCheckSql("i.base_group_price IS NOT NULL", $groupPriceValue, "NULL"); + $groupPrice = $write->getCheckSql('i.base_group_price IS NOT NULL', $groupPriceValue, 'NULL'); $select->columns([ 'min_price' => $minPrice, diff --git a/app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.4-1.6.0.0.5.php b/app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.4-1.6.0.0.5.php index 31054cd3e33..a8716e73bbb 100644 --- a/app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.4-1.6.0.0.5.php +++ b/app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.4-1.6.0.0.5.php @@ -28,7 +28,7 @@ $attributeTable = $installer->getAttributeTable('catalog_product', $attributeCode); $select = $installer->getConnection()->select() ->from(['e' => $attributeTable]) - ->where("e.attribute_id=?", $attribute['attribute_id']) + ->where('e.attribute_id=?', $attribute['attribute_id']) ->where('e.value LIKE "%,,%"'); $result = $installer->getConnection()->fetchAll($select); @@ -40,7 +40,7 @@ if ($replaceCnt) { $installer->getConnection() - ->update($attributeTable, ['value' => $row['value']], "value_id=" . $row['value_id']); + ->update($attributeTable, ['value' => $row['value']], 'value_id=' . $row['value_id']); } } } diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.13-0.7.14.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.13-0.7.14.php index 59bee154ffe..f1ad75bdbbe 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.13-0.7.14.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.13-0.7.14.php @@ -18,7 +18,7 @@ $mediaAttributeId = (int) $installer->getAttributeId('catalog_product', 'media_gallery'); -$imagesAttributesIds = implode(",", [ +$imagesAttributesIds = implode(',', [ (int) $installer->getAttributeId('catalog_product', 'small_image'), (int) $installer->getAttributeId('catalog_product', 'image'), (int) $installer->getAttributeId('catalog_product', 'thumbnail') diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.46-0.7.47.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.46-0.7.47.php index f6c712f58fa..78ad1ea7f92 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.46-0.7.47.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.46-0.7.47.php @@ -111,8 +111,8 @@ ON (t_s.entity_id = t_v_default.entity_id) AND (t_s.attribute_id='{$statusAttributeId}') AND (t_s.store_id='{$storeId}') WHERE t_v_default.attribute_id='{$visibilityAttributeId}' AND t_v_default.store_id=0 - AND (IFNULL(t_s.value, t_s_default.value)=" . Mage_Catalog_Model_Product_Status::STATUS_ENABLED . ") - "); + AND (IFNULL(t_s.value, t_s_default.value)=" . Mage_Catalog_Model_Product_Status::STATUS_ENABLED . ') + '); } } diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.51-0.7.52.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.51-0.7.52.php index 9a07d5e20ff..803ab65522c 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.51-0.7.52.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.51-0.7.52.php @@ -17,7 +17,7 @@ $this->startSetup(); $table = $this->getTable('catalog/category'); -$tableTmp = $table . "_tmp"; +$tableTmp = $table . '_tmp'; $this->run("DROP TABLE IF EXISTS `{$tableTmp}`"); $this->run("CREATE TABLE `{$tableTmp}` ( diff --git a/app/code/core/Mage/CatalogIndex/Model/Indexer.php b/app/code/core/Mage/CatalogIndex/Model/Indexer.php index 9023af6f262..fa015083699 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Indexer.php +++ b/app/code/core/Mage/CatalogIndex/Model/Indexer.php @@ -714,14 +714,14 @@ public function buildEntityFilter($attributes, $values, &$filteredAttributes, $p $values[$code]['from'] = $_date; } - $filter[$code]->where("value >= ?", $values[$code]['from']); + $filter[$code]->where('value >= ?', $values[$code]['from']); } if ($values[$code]['to']) { if (!is_numeric($values[$code]['to'])) { $values[$code]['to'] = date(Varien_Db_Adapter_Pdo_Mysql::TIMESTAMP_FORMAT, strtotime($values[$code]['to'])); } - $filter[$code]->where("value <= ?", $values[$code]['to']); + $filter[$code]->where('value <= ?', $values[$code]['to']); } } else { $filter[$code]->where('value in (?)', $values[$code]); diff --git a/app/code/core/Mage/CatalogIndex/Model/Resource/Aggregation.php b/app/code/core/Mage/CatalogIndex/Model/Resource/Aggregation.php index 5ecdabcf3e9..56a8f89cdd3 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Resource/Aggregation.php +++ b/app/code/core/Mage/CatalogIndex/Model/Resource/Aggregation.php @@ -213,7 +213,7 @@ protected function _addTags($tags) foreach ($tags as $index => $tag) { $tags[$index] = $this->_getWriteAdapter()->quote($tag); } - $query = "INSERT INTO `{$this->_tagTable}` (tag_code) VALUES (" . implode('),(', $tags) . ")"; + $query = "INSERT INTO `{$this->_tagTable}` (tag_code) VALUES (" . implode('),(', $tags) . ')'; $this->_getWriteAdapter()->query($query); } else { $this->_getWriteAdapter()->insert($this->_tagTable, [ diff --git a/app/code/core/Mage/CatalogIndex/Model/Resource/Data/Abstract.php b/app/code/core/Mage/CatalogIndex/Model/Resource/Data/Abstract.php index 53dbfb59cd8..d230138cc6a 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Resource/Data/Abstract.php +++ b/app/code/core/Mage/CatalogIndex/Model/Resource/Data/Abstract.php @@ -84,7 +84,7 @@ public function getAttributeData($products, $attributes, $store) foreach ($suffixes as $suffix) { $tableName = "{$this->getTable('catalog/product')}_{$suffix}"; $condition = "product.entity_id = c.entity_id AND c.store_id = {$store} AND c.attribute_id = d.attribute_id"; - $defaultCondition = "product.entity_id = d.entity_id AND d.store_id = 0"; + $defaultCondition = 'product.entity_id = d.entity_id AND d.store_id = 0'; $fields = [ 'entity_id', 'type_id', @@ -121,9 +121,9 @@ public function getAttributeData($products, $attributes, $store) */ public function fetchLinkInformation($store, $table, $idField, $whereField, $id, $additionalWheres = []) { - $idsConditionSymbol = "= ?"; + $idsConditionSymbol = '= ?'; if (is_array($id)) { - $idsConditionSymbol = "in (?)"; + $idsConditionSymbol = 'in (?)'; } $select = $this->_getReadAdapter()->select(); @@ -210,7 +210,7 @@ public function getTierPrices($products, $website) 'c.value', 'c.all_groups', ]; - $condition = "product.entity_id = c.entity_id"; + $condition = 'product.entity_id = c.entity_id'; $select = $this->_getReadAdapter()->select() ->from(['product' => $this->getTable('catalog/product')], $fields) diff --git a/app/code/core/Mage/CatalogIndex/Model/Resource/Indexer.php b/app/code/core/Mage/CatalogIndex/Model/Resource/Indexer.php index 47cbb6a4a2a..3d7ccd361f8 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Resource/Indexer.php +++ b/app/code/core/Mage/CatalogIndex/Model/Resource/Indexer.php @@ -150,7 +150,7 @@ public function clear( $this->_getWriteAdapter()->query($query); } elseif (is_array($variable) && count($variable)) { $query = "DELETE FROM {$this->getTable($table)} WHERE "; - $query .= $this->_getWriteAdapter()->quoteInto("attribute_id in (?)", $variable); + $query .= $this->_getWriteAdapter()->quoteInto('attribute_id in (?)', $variable); if ($suffixToInsert) { $query .= " AND {$suffixToInsert}"; } @@ -638,7 +638,7 @@ public function updateCatalogProductFlat($storeId, $productIds = null, $tableNam $select = $this->_getWriteAdapter()->select() ->join( ['p' => $this->getTable('catalogindex/price')], - "`e`.`entity_id`=`p`.`entity_id`" + '`e`.`entity_id`=`p`.`entity_id`' . " AND `p`.`attribute_id`={$priceAttribute}" . " AND `p`.`customer_group_id`={$group->getId()}" . " AND `p`.`website_id`={$websiteId}", @@ -651,7 +651,7 @@ public function updateCatalogProductFlat($storeId, $productIds = null, $tableNam if ($productIds instanceof Mage_Catalog_Model_Product_Condition_Interface) { $select->where('e.entity_id IN (' . $productIds->getIdsSelect($this->_getWriteAdapter())->__toString() . ')'); } elseif (!is_null($productIds)) { - $select->where("e.entity_id IN(?)", $productIds); + $select->where('e.entity_id IN(?)', $productIds); } $sql = $select->crossUpdateFromSelect(['e' => $tableName]); @@ -664,7 +664,7 @@ public function updateCatalogProductFlat($storeId, $productIds = null, $tableNam $select = $this->_getWriteAdapter()->select() ->join( ['p' => $this->getTable('catalogindex/price')], - "`e`.`child_id`=`p`.`entity_id`" + '`e`.`child_id`=`p`.`entity_id`' . " AND `p`.`attribute_id`={$priceAttribute}" . " AND `p`.`customer_group_id`={$group->getId()}" . " AND `p`.`website_id`={$websiteId}", @@ -675,7 +675,7 @@ public function updateCatalogProductFlat($storeId, $productIds = null, $tableNam if ($productIds instanceof Mage_Catalog_Model_Product_Condition_Interface) { $select->where('e.child_id IN (' . $productIds->getIdsSelect($this->_getWriteAdapter())->__toString() . ')'); } elseif (!is_null($productIds)) { - $select->where("e.child_id IN(?)", $productIds); + $select->where('e.child_id IN(?)', $productIds); } $sql = $select->crossUpdateFromSelect(['e' => $tableName]); diff --git a/app/code/core/Mage/CatalogIndex/Model/Resource/Price.php b/app/code/core/Mage/CatalogIndex/Model/Resource/Price.php index a09414b0d19..21ce51840e3 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Resource/Price.php +++ b/app/code/core/Mage/CatalogIndex/Model/Resource/Price.php @@ -106,7 +106,7 @@ public function getMaxValue($attribute, $entitySelect) } $select - ->columns("MAX(price_table.value" . implode('', $response->getAdditionalCalculations()) . ")") + ->columns('MAX(price_table.value' . implode('', $response->getAdditionalCalculations()) . ')') ->where('price_table.website_id = ?', $this->getWebsiteId()) ->where('price_table.attribute_id = ?', $attribute->getId()); @@ -142,7 +142,7 @@ public function getCount($range, $attribute, $entitySelect) Mage::dispatchEvent('catalogindex_prepare_price_select', $args); } - $fields = ['count' => 'COUNT(DISTINCT price_table.entity_id)', 'range' => "FLOOR(((price_table.value" . implode('', $response->getAdditionalCalculations()) . ")*{$this->getRate()})/{$range})+1"]; + $fields = ['count' => 'COUNT(DISTINCT price_table.entity_id)', 'range' => 'FLOOR(((price_table.value' . implode('', $response->getAdditionalCalculations()) . ")*{$this->getRate()})/{$range})+1"]; $select->columns($fields) ->group('range') @@ -257,7 +257,7 @@ public function getMinimalPrices($ids) $select = $this->_getReadAdapter()->select(); $select->from( ['price_table' => $this->getTable('catalogindex/minimal_price')], - ['price_table.entity_id', 'value' => "(price_table.value)", 'tax_class_id' => '(price_table.tax_class_id)'] + ['price_table.entity_id', 'value' => '(price_table.value)', 'tax_class_id' => '(price_table.tax_class_id)'] ) ->where('price_table.entity_id in (?)', $ids) ->where('price_table.website_id = ?', $this->getWebsiteId()) diff --git a/app/code/core/Mage/CatalogRule/Model/Action/Index/Refresh.php b/app/code/core/Mage/CatalogRule/Model/Action/Index/Refresh.php index 8503c2f906b..5172a163e60 100644 --- a/app/code/core/Mage/CatalogRule/Model/Action/Index/Refresh.php +++ b/app/code/core/Mage/CatalogRule/Model/Action/Index/Refresh.php @@ -540,12 +540,12 @@ protected function _prepareIndexSelect(Mage_Core_Model_Website $website, $time) 'earliest_end_date' => 'earliest_end_date', ] ) - ->where(new Zend_Db_Expr($this->_connection->getUnixTimestamp('dates.rule_date') . " >= from_time")) + ->where(new Zend_Db_Expr($this->_connection->getUnixTimestamp('dates.rule_date') . ' >= from_time')) ->where( $this->_connection->getCheckSql( new Zend_Db_Expr('to_time = 0'), new Zend_Db_Expr(1), - new Zend_Db_Expr($this->_connection->getUnixTimestamp('dates.rule_date') . " <= to_time") + new Zend_Db_Expr($this->_connection->getUnixTimestamp('dates.rule_date') . ' <= to_time') ) ) ->group(['customer_group_id', 'product_id', 'dates.rule_date', 'website_id']); diff --git a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.1-0.7.2.php index 532382b0c11..6bec3f765ec 100644 --- a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.1-0.7.2.php @@ -35,7 +35,7 @@ } } - $conn->update($ruleTable, ['website_ids' => implode(',', array_keys($websiteIds))], "rule_id=" . $r['rule_id']); + $conn->update($ruleTable, ['website_ids' => implode(',', array_keys($websiteIds))], 'rule_id=' . $r['rule_id']); } $conn->dropColumn($ruleTable, 'store_ids'); } @@ -55,9 +55,9 @@ $websiteId = $websites[$r['store_id']]; $key = $r['from_time'] . '|' . $r['to_time'] . '|' . $websiteId . '|' . $r['customer_group_id'] . '|' . $r['product_id'] . '|' . $r['sort_order']; if (isset($unique[$key])) { - $conn->delete($ruleProductTable, $conn->quoteInto("rule_product_id=?", $r['rule_product_id'])); + $conn->delete($ruleProductTable, $conn->quoteInto('rule_product_id=?', $r['rule_product_id'])); } else { - $conn->update($ruleProductTable, ['website_id' => $websiteId], "rule_product_id=" . $r['rule_product_id']); + $conn->update($ruleProductTable, ['website_id' => $websiteId], 'rule_product_id=' . $r['rule_product_id']); $unique[$key] = true; } } diff --git a/app/code/core/Mage/CatalogSearch/Block/Advanced/Form.php b/app/code/core/Mage/CatalogSearch/Block/Advanced/Form.php index 2e0619b5121..a501404c9af 100644 --- a/app/code/core/Mage/CatalogSearch/Block/Advanced/Form.php +++ b/app/code/core/Mage/CatalogSearch/Block/Advanced/Form.php @@ -224,7 +224,7 @@ public function getAttributeYesNoElement($attribute) ->setName($name) ->setId($attribute->getAttributeCode()) ->setTitle($this->getAttributeLabel($attribute)) - ->setExtraParams("") + ->setExtraParams('') ->setValue($this->getAttributeValue($attribute)) ->setOptions($options) ->getHtml(); diff --git a/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php b/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php index 6c78488d870..c958c6874d9 100644 --- a/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php +++ b/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php @@ -359,7 +359,7 @@ public function prepareResult($object, $queryText, $query) ) ->where($mainTableAlias . '.store_id = ?', (int)$query->getStoreId()); - $where = ""; + $where = ''; if ($searchType == Mage_CatalogSearch_Model_Fulltext::SEARCH_TYPE_FULLTEXT || $searchType == Mage_CatalogSearch_Model_Fulltext::SEARCH_TYPE_COMBINE ) { diff --git a/app/code/core/Mage/CatalogSearch/Model/Resource/Helper/Mysql4.php b/app/code/core/Mage/CatalogSearch/Model/Resource/Helper/Mysql4.php index 4a37b43b2b2..3e98281efd7 100644 --- a/app/code/core/Mage/CatalogSearch/Model/Resource/Helper/Mysql4.php +++ b/app/code/core/Mage/CatalogSearch/Model/Resource/Helper/Mysql4.php @@ -58,7 +58,7 @@ public function prepareTerms($str, $maxWordLength = 0) '(' => '(', ')' => ')' ]; - $words = [0 => ""]; + $words = [0 => '']; $terms = []; preg_match_all('/([\(\)]|[\"\'][^"\']*[\"\']|[^\s\"\(\)]*)/uis', $str, $matches); $isOpenBracket = 0; @@ -85,9 +85,9 @@ public function prepareTerms($str, $maxWordLength = 0) } } if ($isOpenBracket > 0) { - $words[] = sprintf("%')" . $isOpenBracket . "s", ''); + $words[] = sprintf("%')" . $isOpenBracket . 's', ''); } elseif ($isOpenBracket < 0) { - $words[0] = sprintf("%'(" . $isOpenBracket . "s", ''); + $words[0] = sprintf("%'(" . $isOpenBracket . 's', ''); } if ($maxWordLength && count($terms) > $maxWordLength) { $terms = array_slice($terms, 0, $maxWordLength); diff --git a/app/code/core/Mage/CatalogSearch/Model/Resource/Search/Collection.php b/app/code/core/Mage/CatalogSearch/Model/Resource/Search/Collection.php index 7862c441895..c492cb21fcb 100644 --- a/app/code/core/Mage/CatalogSearch/Model/Resource/Search/Collection.php +++ b/app/code/core/Mage/CatalogSearch/Model/Resource/Search/Collection.php @@ -105,7 +105,7 @@ protected function _hasAttributeOptionsAndSearchable($attribute) * Retrieve SQL for search entities * * @param string $query - * @return string + * @return Varien_Db_Select */ protected function _getSearchEntityIdsSql($query) { @@ -168,7 +168,7 @@ protected function _getSearchEntityIdsSql($query) * Retrieve SQL for search entities by option * * @param string $query - * @return false|string + * @return false|Varien_Db_Select */ protected function _getSearchInOptionSql($query) { diff --git a/app/code/core/Mage/Centinel/Model/Api/Client.php b/app/code/core/Mage/Centinel/Model/Api/Client.php index 408bd64c24b..b173b4a8d91 100644 --- a/app/code/core/Mage/Centinel/Model/Api/Client.php +++ b/app/code/core/Mage/Centinel/Model/Api/Client.php @@ -29,7 +29,7 @@ class Mage_Centinel_Model_Api_Client extends CentinelClient public function sendHttp($url, $connectTimeout, $timeout) { // verify that the URL uses a supported protocol. - if ((strpos($url, "http://") === 0) || (strpos($url, "https://") === 0)) { + if ((strpos($url, 'http://') === 0) || (strpos($url, 'https://') === 0)) { //Construct the payload to POST to the url. $data = $this->getRequestXml(); @@ -57,7 +57,7 @@ public function sendHttp($url, $connectTimeout, $timeout) } // Assert that we received an expected Centinel Message in reponse. - if (strpos($result, "") === false) { + if (strpos($result, '') === false) { $result = $this->setErrorResponse(CENTINEL_ERROR_CODE_8010, CENTINEL_ERROR_CODE_8010_DESC); } } else { diff --git a/app/code/core/Mage/Checkout/Model/Api/Resource.php b/app/code/core/Mage/Checkout/Model/Api/Resource.php index 510c821ae51..92751f397f2 100644 --- a/app/code/core/Mage/Checkout/Model/Api/Resource.php +++ b/app/code/core/Mage/Checkout/Model/Api/Resource.php @@ -103,7 +103,7 @@ protected function _getStoreId($store = null) protected function _getQuote($quoteId, $store = null) { /** @var Mage_Sales_Model_Quote $quote */ - $quote = Mage::getModel("sales/quote"); + $quote = Mage::getModel('sales/quote'); if (!(is_string($store) || is_int($store))) { $quote->loadByIdWithoutStore($quoteId); diff --git a/app/code/core/Mage/Checkout/Model/Api/Resource/Product.php b/app/code/core/Mage/Checkout/Model/Api/Resource/Product.php index e8648f848db..52491f42581 100644 --- a/app/code/core/Mage/Checkout/Model/Api/Resource/Product.php +++ b/app/code/core/Mage/Checkout/Model/Api/Resource/Product.php @@ -114,7 +114,7 @@ protected function _getQuoteItemByProduct( } if (is_null($item)) { - $item = Mage::getModel("sales/quote_item"); + $item = Mage::getModel('sales/quote_item'); } return $item; diff --git a/app/code/core/Mage/Checkout/Model/Cart/Api.php b/app/code/core/Mage/Checkout/Model/Cart/Api.php index 8a59d5114f7..4cb3d233f71 100644 --- a/app/code/core/Mage/Checkout/Model/Cart/Api.php +++ b/app/code/core/Mage/Checkout/Model/Cart/Api.php @@ -23,7 +23,7 @@ class Mage_Checkout_Model_Cart_Api extends Mage_Checkout_Model_Api_Resource { public function __construct() { - $this->_storeIdSessionField = "cart_store_id"; + $this->_storeIdSessionField = 'cart_store_id'; $this->_attributesMap['quote'] = ['quote_id' => 'entity_id']; $this->_attributesMap['quote_customer'] = ['customer_id' => 'entity_id']; $this->_attributesMap['quote_address'] = ['address_id' => 'entity_id']; @@ -104,8 +104,8 @@ public function totals($quoteId, $store = null) $totalsResult = []; foreach ($totals as $total) { $totalsResult[] = [ - "title" => $total->getTitle(), - "amount" => $total->getValue() + 'title' => $total->getTitle(), + 'amount' => $total->getValue() ]; } return $totalsResult; @@ -140,7 +140,7 @@ public function createOrder($quoteId, $store = null, $agreements = null) } /** @var Mage_Checkout_Model_Api_Resource_Customer $customerResource */ - $customerResource = Mage::getModel("checkout/api_resource_customer"); + $customerResource = Mage::getModel('checkout/api_resource_customer'); $isNewCustomer = $customerResource->prepareCustomerForQuote($quote); try { @@ -200,7 +200,7 @@ public function licenseAgreement($quoteId, $store = null) foreach ($agreementsCollection as $_a) { /** @var Mage_Checkout_Model_Agreement $_a */ - $agreements[] = $this->_getAttributes($_a, "quote_agreement"); + $agreements[] = $this->_getAttributes($_a, 'quote_agreement'); } } diff --git a/app/code/core/Mage/Checkout/Model/Cart/Coupon/Api.php b/app/code/core/Mage/Checkout/Model/Cart/Coupon/Api.php index 839ed8a4446..b181a09a1c9 100644 --- a/app/code/core/Mage/Checkout/Model/Cart/Coupon/Api.php +++ b/app/code/core/Mage/Checkout/Model/Cart/Coupon/Api.php @@ -80,7 +80,7 @@ protected function _applyCoupon($quoteId, $couponCode, $store = null) ->collectTotals() ->save(); } catch (Exception $e) { - $this->_fault("cannot_apply_coupon_code", $e->getMessage()); + $this->_fault('cannot_apply_coupon_code', $e->getMessage()); } if ($couponCode) { diff --git a/app/code/core/Mage/Checkout/Model/Cart/Customer/Api.php b/app/code/core/Mage/Checkout/Model/Cart/Customer/Api.php index 86c85cdf01d..2c97e11d13e 100644 --- a/app/code/core/Mage/Checkout/Model/Cart/Customer/Api.php +++ b/app/code/core/Mage/Checkout/Model/Cart/Customer/Api.php @@ -23,7 +23,7 @@ class Mage_Checkout_Model_Cart_Customer_Api extends Mage_Checkout_Model_Api_Reso { public function __construct() { - $this->_storeIdSessionField = "cart_store_id"; + $this->_storeIdSessionField = 'cart_store_id'; $this->_attributesMap['quote'] = ['quote_id' => 'entity_id']; $this->_attributesMap['quote_customer'] = ['customer_id' => 'entity_id']; @@ -103,7 +103,7 @@ public function setAddresses($quoteId, $customerAddressData, $store = null) foreach ($customerAddressData as $addressItem) { /** @var Mage_Sales_Model_Quote_Address $address */ - $address = Mage::getModel("sales/quote_address"); + $address = Mage::getModel('sales/quote_address'); $addressMode = $addressItem['mode']; unset($addressItem['mode']); diff --git a/app/code/core/Mage/Checkout/Model/Cart/Payment/Api.php b/app/code/core/Mage/Checkout/Model/Cart/Payment/Api.php index d858dee6246..8e51bf40f7d 100644 --- a/app/code/core/Mage/Checkout/Model/Cart/Payment/Api.php +++ b/app/code/core/Mage/Checkout/Model/Cart/Payment/Api.php @@ -136,7 +136,7 @@ public function setPaymentMethod($quoteId, $paymentData, $store = null) $paymentData = $this->_preparePaymentData($paymentData); if (empty($paymentData)) { - $this->_fault("payment_method_empty"); + $this->_fault('payment_method_empty'); } if ($quote->isVirtual()) { @@ -171,7 +171,7 @@ public function setPaymentMethod($quoteId, $paymentData, $store = null) || $method->getCode() == 'free' || ($quote->hasRecurringItems() && $method->canManageRecurringProfiles()))) ) { - $this->_fault("method_not_allowed"); + $this->_fault('method_not_allowed'); } } } diff --git a/app/code/core/Mage/Checkout/Model/Cart/Product/Api.php b/app/code/core/Mage/Checkout/Model/Cart/Product/Api.php index dfd589b6c05..58f67f790b3 100644 --- a/app/code/core/Mage/Checkout/Model/Cart/Product/Api.php +++ b/app/code/core/Mage/Checkout/Model/Cart/Product/Api.php @@ -53,11 +53,11 @@ public function add($quoteId, $productsData, $store = null) $errors = []; foreach ($productsData as $productItem) { if (isset($productItem['product_id'])) { - $productByItem = $this->_getProduct($productItem['product_id'], $store, "id"); + $productByItem = $this->_getProduct($productItem['product_id'], $store, 'id'); } elseif (isset($productItem['sku'])) { - $productByItem = $this->_getProduct($productItem['sku'], $store, "sku"); + $productByItem = $this->_getProduct($productItem['sku'], $store, 'sku'); } else { - $errors[] = Mage::helper('checkout')->__("One item of products do not have identifier or sku"); + $errors[] = Mage::helper('checkout')->__('One item of products do not have identifier or sku'); continue; } @@ -73,13 +73,13 @@ public function add($quoteId, $productsData, $store = null) } if (!empty($errors)) { - $this->_fault("add_product_fault", implode(PHP_EOL, $errors)); + $this->_fault('add_product_fault', implode(PHP_EOL, $errors)); } try { $quote->collectTotals()->save(); } catch (Exception $e) { - $this->_fault("add_product_quote_save_fault", $e->getMessage()); + $this->_fault('add_product_quote_save_fault', $e->getMessage()); } return true; @@ -106,11 +106,11 @@ public function update($quoteId, $productsData, $store = null) $errors = []; foreach ($productsData as $productItem) { if (isset($productItem['product_id'])) { - $productByItem = $this->_getProduct($productItem['product_id'], $store, "id"); + $productByItem = $this->_getProduct($productItem['product_id'], $store, 'id'); } elseif (isset($productItem['sku'])) { - $productByItem = $this->_getProduct($productItem['sku'], $store, "sku"); + $productByItem = $this->_getProduct($productItem['sku'], $store, 'sku'); } else { - $errors[] = Mage::helper('checkout')->__("One item of products do not have identifier or sku"); + $errors[] = Mage::helper('checkout')->__('One item of products do not have identifier or sku'); continue; } @@ -120,7 +120,7 @@ public function update($quoteId, $productsData, $store = null) $this->_getProductRequest($productItem) ); if (is_null($quoteItem->getId())) { - $errors[] = Mage::helper('checkout')->__("One item of products is not belong any of quote item"); + $errors[] = Mage::helper('checkout')->__('One item of products is not belong any of quote item'); continue; } @@ -130,13 +130,13 @@ public function update($quoteId, $productsData, $store = null) } if (!empty($errors)) { - $this->_fault("update_product_fault", implode(PHP_EOL, $errors)); + $this->_fault('update_product_fault', implode(PHP_EOL, $errors)); } try { $quote->collectTotals()->save(); } catch (Exception $e) { - $this->_fault("update_product_quote_save_fault", $e->getMessage()); + $this->_fault('update_product_quote_save_fault', $e->getMessage()); } return true; @@ -163,11 +163,11 @@ public function remove($quoteId, $productsData, $store = null) $errors = []; foreach ($productsData as $productItem) { if (isset($productItem['product_id'])) { - $productByItem = $this->_getProduct($productItem['product_id'], $store, "id"); + $productByItem = $this->_getProduct($productItem['product_id'], $store, 'id'); } elseif (isset($productItem['sku'])) { - $productByItem = $this->_getProduct($productItem['sku'], $store, "sku"); + $productByItem = $this->_getProduct($productItem['sku'], $store, 'sku'); } else { - $errors[] = Mage::helper('checkout')->__("One item of products do not have identifier or sku"); + $errors[] = Mage::helper('checkout')->__('One item of products do not have identifier or sku'); continue; } @@ -178,7 +178,7 @@ public function remove($quoteId, $productsData, $store = null) $this->_getProductRequest($productItem) ); if (is_null($quoteItem->getId())) { - $errors[] = Mage::helper('checkout')->__("One item of products is not belong any of quote item"); + $errors[] = Mage::helper('checkout')->__('One item of products is not belong any of quote item'); continue; } $quote->removeItem($quoteItem->getId()); @@ -188,13 +188,13 @@ public function remove($quoteId, $productsData, $store = null) } if (!empty($errors)) { - $this->_fault("remove_product_fault", implode(PHP_EOL, $errors)); + $this->_fault('remove_product_fault', implode(PHP_EOL, $errors)); } try { $quote->collectTotals()->save(); } catch (Exception $e) { - $this->_fault("remove_product_quote_save_fault", $e->getMessage()); + $this->_fault('remove_product_quote_save_fault', $e->getMessage()); } return true; @@ -273,11 +273,11 @@ public function moveToCustomerQuote($quoteId, $productsData, $store = null) $errors = []; foreach ($productsData as $key => $productItem) { if (isset($productItem['product_id'])) { - $productByItem = $this->_getProduct($productItem['product_id'], $store, "id"); + $productByItem = $this->_getProduct($productItem['product_id'], $store, 'id'); } elseif (isset($productItem['sku'])) { - $productByItem = $this->_getProduct($productItem['sku'], $store, "sku"); + $productByItem = $this->_getProduct($productItem['sku'], $store, 'sku'); } else { - $errors[] = Mage::helper('checkout')->__("One item of products do not have identifier or sku"); + $errors[] = Mage::helper('checkout')->__('One item of products do not have identifier or sku'); continue; } @@ -294,7 +294,7 @@ public function moveToCustomerQuote($quoteId, $productsData, $store = null) $quote->removeItem($quoteItem->getId()); unset($productsData[$key]); } else { - $errors[] = Mage::helper('checkout')->__("One item of products is not belong any of quote item"); + $errors[] = Mage::helper('checkout')->__('One item of products is not belong any of quote item'); } } catch (Mage_Core_Exception $e) { $errors[] = $e->getMessage(); @@ -314,7 +314,7 @@ public function moveToCustomerQuote($quoteId, $productsData, $store = null) ->collectTotals() ->save(); } catch (Exception $e) { - $this->_fault("product_move_quote_save_fault", $e->getMessage()); + $this->_fault('product_move_quote_save_fault', $e->getMessage()); } return true; diff --git a/app/code/core/Mage/Checkout/Model/Cart/Shipping/Api.php b/app/code/core/Mage/Checkout/Model/Cart/Shipping/Api.php index ecc43b506e1..877228a7b1e 100644 --- a/app/code/core/Mage/Checkout/Model/Cart/Shipping/Api.php +++ b/app/code/core/Mage/Checkout/Model/Cart/Shipping/Api.php @@ -40,7 +40,7 @@ public function setShippingMethod($quoteId, $shippingMethod, $store = null) $quoteShippingAddress = $quote->getShippingAddress(); if (is_null($quoteShippingAddress->getId())) { - $this->_fault("shipping_address_is_not_set"); + $this->_fault('shipping_address_is_not_set'); } $rate = $quote->getShippingAddress()->collectShippingRates()->getShippingRateByCode($shippingMethod); @@ -71,7 +71,7 @@ public function getShippingMethodsList($quoteId, $store = null) $quoteShippingAddress = $quote->getShippingAddress(); if (is_null($quoteShippingAddress->getId())) { - $this->_fault("shipping_address_is_not_set"); + $this->_fault('shipping_address_is_not_set'); } try { @@ -86,7 +86,7 @@ public function getShippingMethodsList($quoteId, $store = null) } foreach ($rates as $rate) { - $rateItem = $this->_getAttributes($rate, "quote_shipping_rate"); + $rateItem = $this->_getAttributes($rate, 'quote_shipping_rate'); $rateItem['carrierName'] = $carrierName; $ratesResult[] = $rateItem; unset($rateItem); diff --git a/app/code/core/Mage/Checkout/controllers/OnepageController.php b/app/code/core/Mage/Checkout/controllers/OnepageController.php index 68af5285672..50fd294b5c5 100644 --- a/app/code/core/Mage/Checkout/controllers/OnepageController.php +++ b/app/code/core/Mage/Checkout/controllers/OnepageController.php @@ -521,7 +521,7 @@ protected function _getOrder() if (is_null($this->_order)) { $this->_order = Mage::getModel('sales/order')->load($this->getOnepage()->getQuote()->getId(), 'quote_id'); if (!$this->_order->getId()) { - throw new Mage_Payment_Model_Info_Exception(Mage::helper('core')->__("Can not create invoice. Order was not found.")); + throw new Mage_Payment_Model_Info_Exception(Mage::helper('core')->__('Can not create invoice. Order was not found.')); } } return $this->_order; diff --git a/app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage.php b/app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage.php index 94e143a9073..8aa9f1998c3 100644 --- a/app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage.php +++ b/app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage.php @@ -28,7 +28,7 @@ class Mage_Cms_Model_Wysiwyg_Images_Storage extends Varien_Object /** * Config object * - * @var Mage_Core_Model_Config_Element|Varien_Simplexml_Element|false + * @var Mage_Core_Model_Config_Element */ protected $_config; diff --git a/app/code/core/Mage/Cms/data/cms_setup/data-install-1.6.0.0.php b/app/code/core/Mage/Cms/data/cms_setup/data-install-1.6.0.0.php index 033bd3ae90d..d3b6a989cd4 100644 --- a/app/code/core/Mage/Cms/data/cms_setup/data-install-1.6.0.0.php +++ b/app/code/core/Mage/Cms/data/cms_setup/data-install-1.6.0.0.php @@ -17,11 +17,11 @@ [ 'title' => 'Footer Links', 'identifier' => 'footer_links', - 'content' => " + 'content' => ' ", +
  • About Us
  • +
  • Customer Service
  • +', 'is_active' => 1, 'stores' => 0 ] @@ -35,12 +35,12 @@ 'meta_description' => 'Page description', 'identifier' => 'no-route', - 'content' => " -

    Whoops, our bad...

    + 'content' => ' +

    Whoops, our bad...

    The page you requested was not found, and we have a fine guess why.
    -
      +
      • If you typed the URL directly, please make sure the spelling is correct.
      • If you clicked on a link to get here, the link is outdated.
      @@ -50,15 +50,15 @@
      What can you do?
      Have no fear, help is near! There are many ways you can get back on track with Magento Store.
      -
        -
      • Go back to the previous page.
      • +
          +
        • Go back to the previous page.
        • Use the search bar at the top of the page to search for your products.
        • -
        • Follow these links to get you back on track!
          Store Home - | My Account
        • +
        • Follow these links to get you back on track!
          Store Home + | My Account
    -", +', 'is_active' => 1, 'stores' => [0], 'sort_order' => 0 @@ -67,7 +67,7 @@ 'title' => 'Home page', 'root_template' => 'two_columns_right', 'identifier' => 'home', - 'content' => "

    Home Page

    ", + 'content' => '

    Home Page

    ', 'is_active' => 1, 'stores' => [0], 'sort_order' => 0 @@ -76,19 +76,19 @@ 'title' => 'About Us', 'root_template' => 'two_columns_right', 'identifier' => 'about-magento-demo-store', - 'content' => " -
    + 'content' => ' +

    About Magento Store

    -
    -

    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. +

    +

    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi luctus. Duis lobortis. Nulla nec velit. Mauris pulvinar erat non massa. Suspendisse tortor turpis, porta nec, tempus vitae, iaculis semper, pede.

    -

    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. +

    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi luctus. Duis lobortis. Nulla nec velit. Mauris pulvinar erat non massa. Suspendisse tortor turpis, porta nec, tempus vitae, iaculis semper, pede. Cras vel libero id lectus rhoncus porta.

    -
    -

    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi luctus. +

    +

    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi luctus. Duis lobortis. Nulla nec velit.

    Vivamus tortor nisl, lobortis in, faucibus et, tempus at, dui. Nunc risus. Proin scelerisque augue. Nam ullamcorper. Phasellus id massa. Pellentesque nisl. Pellentesque habitant morbi tristique senectus et netus et malesuada @@ -99,19 +99,19 @@ Vestibulum sapien dolor, aliquet nec, porta ac, malesuada a, libero. Praesent feugiat purus eget est. Nulla facilisi. Vestibulum tincidunt sapien eu velit. Mauris purus. Maecenas eget mauris eu orci accumsan feugiat. Pellentesque eget velit. Nunc tincidunt.

    -
    +

    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi luctus. Duis lobortis. Nulla nec velit. Mauris pulvinar erat non massa. Suspendisse tortor turpis, porta nec, tempus vitae, iaculis semper, pede. Cras vel libero id lectus rhoncus porta. Suspendisse convallis felis ac enim. Vivamus tortor nisl, lobortis in, faucibus et, tempus at, dui. Nunc risus. Proin scelerisque augue. Nam ullamcorper

    -

    Maecenas ullamcorper, odio vel tempus egestas, dui orci faucibus orci, +

    Maecenas ullamcorper, odio vel tempus egestas, dui orci faucibus orci, sit amet aliquet lectus dolor et quam. Pellentesque consequat luctus purus.

    Nunc et risus. Etiam a nibh. Phasellus dignissim metus eget nisi.

    -
    +

    To all of you, from all of us at Magento Store - Thank you and Happy eCommerce!

    -

    John Doe
    +

    John Doe
    Some important guy

    -
    ", +
    ', 'is_active' => 1, 'stores' => [0], 'sort_order' => 0 @@ -120,20 +120,20 @@ 'title' => 'Customer Service', 'root_template' => 'three_columns', 'identifier' => 'customer-service', - 'content' => "
    + 'content' => '

    Customer Service

    -
      -
    • Shipping & Delivery
    • -
    • Privacy & Security
    • -
    • Returns & Replacements
    • -
    • Ordering
    • -
    • Payment, Pricing & Promotions
    • -
    • Viewing Orders
    • -
    • Updating Account Information
    • +
      -
      Shipping & Delivery
      +
      Shipping & Delivery
      Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi luctus. Duis lobortis. Nulla nec velit. Mauris pulvinar erat non massa. Suspendisse tortor turpis, porta nec, tempus vitae, iaculis semper, pede. Cras vel libero id lectus rhoncus porta. Suspendisse convallis felis ac enim. Vivamus tortor nisl, lobortis in, @@ -141,7 +141,7 @@ Pellentesque nisl. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nunc augue. Aenean sed justo non leo vehicula laoreet. Praesent ipsum libero, auctor ac, tempus nec, tempor nec, justo.
      -
      Privacy & Security
      +
      Privacy & Security
      Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi luctus. Duis lobortis. Nulla nec velit. Mauris pulvinar erat non massa. Suspendisse tortor turpis, porta nec, tempus vitae, iaculis semper, pede. Cras vel libero id lectus rhoncus porta. Suspendisse convallis felis ac enim. Vivamus tortor nisl, lobortis in, @@ -149,7 +149,7 @@ Pellentesque nisl. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nunc augue. Aenean sed justo non leo vehicula laoreet. Praesent ipsum libero, auctor ac, tempus nec, tempor nec, justo.
      -
      Returns & Replacements
      +
      Returns & Replacements
      Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi luctus. Duis lobortis. Nulla nec velit. Mauris pulvinar erat non massa. Suspendisse tortor turpis, porta nec, tempus vitae, iaculis semper, pede. Cras vel libero id lectus rhoncus porta. Suspendisse convallis felis ac enim. Vivamus tortor nisl, lobortis in, @@ -157,7 +157,7 @@ Pellentesque nisl. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nunc augue. Aenean sed justo non leo vehicula laoreet. Praesent ipsum libero, auctor ac, tempus nec, tempor nec, justo.
      -
      Ordering
      +
      Ordering
      Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi luctus. Duis lobortis. Nulla nec velit. Mauris pulvinar erat non massa. Suspendisse tortor turpis, porta nec, tempus vitae, iaculis semper, pede. Cras vel libero id lectus rhoncus porta. Suspendisse convallis felis ac enim. Vivamus tortor nisl, lobortis in, @@ -165,7 +165,7 @@ Pellentesque nisl. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nunc augue. Aenean sed justo non leo vehicula laoreet. Praesent ipsum libero, auctor ac, tempus nec, tempor nec, justo.
      -
      Payment, Pricing & Promotions
      +
      Payment, Pricing & Promotions
      Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi luctus. Duis lobortis. Nulla nec velit. Mauris pulvinar erat non massa. Suspendisse tortor turpis, porta nec, tempus vitae, iaculis semper, pede. Cras vel libero id lectus rhoncus porta. Suspendisse convallis felis ac enim. Vivamus tortor nisl, lobortis in, @@ -173,7 +173,7 @@ Pellentesque nisl. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nunc augue. Aenean sed justo non leo vehicula laoreet. Praesent ipsum libero, auctor ac, tempus nec, tempor nec, justo.
      -
      Viewing Orders
      +
      Viewing Orders
      Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi luctus. Duis lobortis. Nulla nec velit. Mauris pulvinar erat non massa. Suspendisse tortor turpis, porta nec, tempus vitae, iaculis semper, pede. Cras vel libero id lectus rhoncus porta. Suspendisse convallis felis ac enim. Vivamus tortor nisl, lobortis in, @@ -181,7 +181,7 @@ Pellentesque nisl. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nunc augue. Aenean sed justo non leo vehicula laoreet. Praesent ipsum libero, auctor ac, tempus nec, tempor nec, justo.
      -
      Updating Account Information
      +
      Updating Account Information
      Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi luctus. Duis lobortis. Nulla nec velit. Mauris pulvinar erat non massa. Suspendisse tortor turpis, porta nec, tempus vitae, iaculis semper, pede. Cras vel libero id lectus rhoncus porta. Suspendisse convallis felis ac enim. Vivamus tortor nisl, lobortis in, @@ -189,7 +189,7 @@ Pellentesque nisl. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nunc augue. Aenean sed justo non leo vehicula laoreet. Praesent ipsum libero, auctor ac, tempus nec, tempor nec, justo.
      -
      ", +', 'is_active' => 1, 'stores' => [0], 'sort_order' => 0 @@ -198,16 +198,16 @@ 'title' => 'Enable Cookies', 'root_template' => 'one_column', 'identifier' => 'enable-cookies', - 'content' => "
      -
        -
      • + 'content' => '
        +
          +
          • Please enable cookies in your web browser to continue.
        -
        -

        What are Cookies?

        +
        +

        What are Cookies?

        Cookies are short pieces of data that are sent to your computer when you visit a website. On later visits, this data is then returned to that website. Cookies allow us to recognize you automatically @@ -217,53 +217,53 @@ or take advantage of certain features of our website, such as storing items in your Shopping Cart or receiving personalized recommendations. As a result, we strongly encourage you to configure your web browser to accept cookies from our website.

        -

        Enabling Cookies

        -
          -
        • Internet Explorer 7.x
        • -
        • Internet Explorer 6.x
        • -
        • Mozilla/Firefox
        • -
        • Opera 7.x
        • +

          Enabling Cookies

          + -

          Internet Explorer 7.x

          +

          Internet Explorer 7.x

          1. Start Internet Explorer

          2. Under the Tools menu, click Internet Options

            -

            \"\"

            +

          3. Click the Privacy tab

            -

            \"\"

            +

          4. Click the Advanced button

            -

            \"\"

            +

          5. Put a check mark in the box for Override Automatic Cookie Handling, put another check mark in the Always accept session cookies box

            -

            \"\"

            +

          6. Click OK

            -

            \"\"

            +

          7. Click OK

            -

            \"\"

            +

          8. Restart Internet Explore

          -

          Back to Top

          -

          Internet Explorer 6.x

          +

          Back to Top

          +

          Internet Explorer 6.x

          1. Select Internet Options from the Tools menu

            -

            \"\"

            +

          2. Click on the Privacy tab

            @@ -271,11 +271,11 @@
          3. Click the Default button (or manually slide the bar down to Medium) under Settings. Click OK

            -

            \"\"

            +

          -

          Back to Top

          -

          Mozilla/Firefox

          +

          Back to Top

          +

          Mozilla/Firefox

          1. Click on the Tools-menu in Mozilla

            @@ -285,7 +285,7 @@
          2. Click on the Privacy selection in the left part of the window. (See image below)

            -

            \"\"

            +

          3. Expand the Cookies section

            @@ -297,8 +297,8 @@

            Save changes by clicking Ok.

          -

          Back to Top

          -

          Opera 7.x

          +

          Back to Top

          +

          Opera 7.x

          1. Click on the Tools menu in Opera

            @@ -308,7 +308,7 @@
          2. Click on the Privacy selection near the bottom left of the window. (See image below)

            -

            \"\"

            +

          3. The Enable cookies checkbox must be checked, and Accept all cookies @@ -318,9 +318,9 @@

            Save changes by clicking Ok

          -

          Back to Top

          +

          Back to Top

        -", +', 'is_active' => 1, 'stores' => [0] ] diff --git a/app/code/core/Mage/Cms/data/cms_setup/data-upgrade-1.6.0.0.0-1.6.0.0.1.php b/app/code/core/Mage/Cms/data/cms_setup/data-upgrade-1.6.0.0.0-1.6.0.0.1.php index c3e4a763dfb..bcc473e9ca4 100644 --- a/app/code/core/Mage/Cms/data/cms_setup/data-upgrade-1.6.0.0.0-1.6.0.0.1.php +++ b/app/code/core/Mage/Cms/data/cms_setup/data-upgrade-1.6.0.0.0-1.6.0.0.1.php @@ -252,7 +252,7 @@ if (preg_match('/
          (.*?)<\\/ul>/ims', $content, $matches)) { $content = preg_replace('/
        • /ims', '
        • ', $content); $replacment = '
        • ' - . "" + . '' . "Privacy Policy
        • \r\n
        "; $content = preg_replace('/<\\/ul>/ims', $replacment, $content); $footerLinksBlock->setContent($content)->save(); diff --git a/app/code/core/Mage/Cms/data/cms_setup/data-upgrade-1.6.0.0.1-1.6.0.0.2.php b/app/code/core/Mage/Cms/data/cms_setup/data-upgrade-1.6.0.0.1-1.6.0.0.2.php index 53511bf431e..5139e277156 100644 --- a/app/code/core/Mage/Cms/data/cms_setup/data-upgrade-1.6.0.0.1-1.6.0.0.2.php +++ b/app/code/core/Mage/Cms/data/cms_setup/data-upgrade-1.6.0.0.1-1.6.0.0.2.php @@ -13,10 +13,10 @@ * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -$content = "

        This website requires cookies to provide all of its features. For more " . - "information on what data is contained in the cookies, please see our " . - "Privacy Policy page. " . - "To accept cookies from this site, please click the Allow button below.

        "; +$content = '

        This website requires cookies to provide all of its features. For more ' . + 'information on what data is contained in the cookies, please see our ' . + 'Privacy Policy page. ' . + 'To accept cookies from this site, please click the Allow button below.

        '; $cmsBlock = [ 'title' => 'Cookie restriction notice', diff --git a/app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php b/app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php index 2f4f1619d45..f210de677cb 100644 --- a/app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php +++ b/app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php @@ -299,7 +299,7 @@ public function createSwatchImage($value, $width, $height) } $newImage = imagecreatetruecolor($width, $height); - list($r, $g, $b) = sscanf($optionSwatch->getValue(), "#%02x%02x%02x"); + list($r, $g, $b) = sscanf($optionSwatch->getValue(), '#%02x%02x%02x'); $backgroundColor = imagecolorallocate($newImage, (int)$r, (int)$g, (int)$b); imagefill($newImage, 0, 0, $backgroundColor); imagepng($newImage, Mage::getBaseDir(Mage_Core_Model_Store::URL_TYPE_MEDIA) . DS . $destPath); @@ -382,7 +382,7 @@ public function filterImageInGallery($product, $image) } if (!isset($this->_productImageFilters[$product->getId()])) { - $mapping = call_user_func_array("array_merge_recursive", array_values($product->getChildAttributeLabelMapping())); + $mapping = call_user_func_array('array_merge_recursive', array_values($product->getChildAttributeLabelMapping())); $filters = array_unique($mapping['labels']); $filters = array_merge($filters, array_map(function ($label) { return $label . Mage_ConfigurableSwatches_Helper_Productimg::SWATCH_LABEL_SUFFIX; diff --git a/app/code/core/Mage/Core/Block/Abstract.php b/app/code/core/Mage/Core/Block/Abstract.php index f33b14a031e..a164fea34fc 100644 --- a/app/code/core/Mage/Core/Block/Abstract.php +++ b/app/code/core/Mage/Core/Block/Abstract.php @@ -513,9 +513,9 @@ public function unsetChild($alias) */ public function unsetCallChild($alias, $callback, $result, $params) { + $args = func_get_args(); $child = $this->getChild($alias); if ($child) { - $args = func_get_args(); $alias = array_shift($args); $callback = array_shift($args); $result = (string)array_shift($args); @@ -993,7 +993,9 @@ protected function _getUrlModelClass() */ protected function _getUrlModel() { - return Mage::getModel($this->_getUrlModelClass()); + /** @var Mage_Core_Model_Url $model */ + $model = Mage::getModel($this->_getUrlModelClass()); + return $model; } /** diff --git a/app/code/core/Mage/Core/Block/Template/Facade.php b/app/code/core/Mage/Core/Block/Template/Facade.php index 764f03903ca..6437feb2013 100644 --- a/app/code/core/Mage/Core/Block/Template/Facade.php +++ b/app/code/core/Mage/Core/Block/Template/Facade.php @@ -61,8 +61,9 @@ public function setDataByKeyFromRegistry($key, $registryKey) */ public function ifEquals($conditionKeys) { + $args = func_get_args(); if (!is_array($conditionKeys)) { - $conditionKeys = func_get_args(); + $conditionKeys = $args; } // evaluate conditions (equality) diff --git a/app/code/core/Mage/Core/Helper/Data.php b/app/code/core/Mage/Core/Helper/Data.php index d3c9a73ac45..a56890db38c 100644 --- a/app/code/core/Mage/Core/Helper/Data.php +++ b/app/code/core/Mage/Core/Helper/Data.php @@ -1014,7 +1014,7 @@ public function isRateLimitExceeded(bool $setErrorMessage = true, bool $recordRa $cacheTag = 'rate_limit_' . $remoteAddr; if (Mage::app()->testCache($cacheTag)) { if ($setErrorMessage) { - $errorMessage = $this->__("Too Soon: You are trying to perform this operation too frequently. Please wait a few seconds and try again."); + $errorMessage = $this->__('Too Soon: You are trying to perform this operation too frequently. Please wait a few seconds and try again.'); Mage::getSingleton('core/session')->addError($errorMessage); } return true; diff --git a/app/code/core/Mage/Core/Helper/EnvironmentConfigLoader.php b/app/code/core/Mage/Core/Helper/EnvironmentConfigLoader.php index 61abc39e84e..5899c40acb9 100644 --- a/app/code/core/Mage/Core/Helper/EnvironmentConfigLoader.php +++ b/app/code/core/Mage/Core/Helper/EnvironmentConfigLoader.php @@ -68,14 +68,14 @@ public function overrideEnvironment(Varien_Simplexml_Config $xmlConfig) switch ($scope) { case static::CONFIG_KEY_DEFAULT: - list($_, $_, $section, $group, $field) = $configKeyParts; + list($unused1, $unused2, $section, $group, $field) = $configKeyParts; $path = $this->buildPath($section, $group, $field); $xmlConfig->setNode($this->buildNodePath($scope, $path), $value); break; case static::CONFIG_KEY_WEBSITES: case static::CONFIG_KEY_STORES: - list($_, $_, $code, $section, $group, $field) = $configKeyParts; + list($unused1, $unused2, $code, $section, $group, $field) = $configKeyParts; $path = $this->buildPath($section, $group, $field); $nodePath = sprintf('%s/%s/%s', strtolower($scope), strtolower($code), $path); $xmlConfig->setNode($nodePath, $value); @@ -110,7 +110,7 @@ protected function getConfigKey(string $configKey): array 'trim' ); list($_, $scope) = $configKeyParts; - return array($configKeyParts, $scope); + return [$configKeyParts, $scope]; } protected function isConfigKeyValid(string $configKey): bool diff --git a/app/code/core/Mage/Core/Helper/Http.php b/app/code/core/Mage/Core/Helper/Http.php index 09157240db6..89e95379092 100644 --- a/app/code/core/Mage/Core/Helper/Http.php +++ b/app/code/core/Mage/Core/Helper/Http.php @@ -62,10 +62,10 @@ public function authValidate($headers = null) // IIS Note:: For HTTP Authentication to work with IIS, // the PHP directive cgi.rfc2616_headers must be set to 0 (the default value). $auth = $_SERVER['HTTP_AUTHORIZATION']; - list($user, $pass) = explode(':', base64_decode(substr($auth, strpos($auth, " ") + 1))); + list($user, $pass) = explode(':', base64_decode(substr($auth, strpos($auth, ' ') + 1))); } elseif (!empty($_SERVER['Authorization'])) { $auth = $_SERVER['Authorization']; - list($user, $pass) = explode(':', base64_decode(substr($auth, strpos($auth, " ") + 1))); + list($user, $pass) = explode(':', base64_decode(substr($auth, strpos($auth, ' ') + 1))); } if (!$user || !$pass) { diff --git a/app/code/core/Mage/Core/Helper/Js.php b/app/code/core/Mage/Core/Helper/Js.php index 9dda64d13be..7bbca238395 100644 --- a/app/code/core/Mage/Core/Helper/Js.php +++ b/app/code/core/Mage/Core/Helper/Js.php @@ -138,7 +138,7 @@ protected function _getTranslateData() if (!empty($messages)) { foreach ($messages as $message) { $messageText = (string)$message; - $module = $message->getParent()->getAttribute("module"); + $module = $message->getParent()->getAttribute('module'); $this->_translateData[$messageText] = Mage::helper(empty($module) ? 'core' : $module)->__($messageText); } } diff --git a/app/code/core/Mage/Core/Helper/String.php b/app/code/core/Mage/Core/Helper/String.php index 74b8aca84a5..02ab17ead36 100644 --- a/app/code/core/Mage/Core/Helper/String.php +++ b/app/code/core/Mage/Core/Helper/String.php @@ -307,7 +307,7 @@ public function ksortMultibyte(array &$sort) if (empty($sort)) { return false; } - $oldLocale = setlocale(LC_COLLATE, "0"); + $oldLocale = setlocale(LC_COLLATE, '0'); $localeCode = Mage::app()->getLocale()->getLocaleCode(); // use fallback locale if $localeCode is not available setlocale(LC_COLLATE, $localeCode . '.UTF8', 'C.UTF-8', 'en_US.utf8'); @@ -466,7 +466,7 @@ protected function _getLastSubkey($key, $withBrackets = true) /** * Set array helper * - * @param Mage_Core_Helper_Abstract|Mage_Core_Helper_Array $helper + * @param Mage_Core_Helper_Array $helper * @return $this */ public function setArrayHelper(Mage_Core_Helper_Abstract $helper) diff --git a/app/code/core/Mage/Core/Helper/Translate.php b/app/code/core/Mage/Core/Helper/Translate.php index 87c9259cbc7..57b0c1f8c42 100644 --- a/app/code/core/Mage/Core/Helper/Translate.php +++ b/app/code/core/Mage/Core/Helper/Translate.php @@ -38,7 +38,7 @@ public function apply($translate, $area, $returnType = 'json') Mage::getDesign()->setArea($area); } Mage::getModel('core/translate_inline')->processAjaxPost($translate); - return $returnType == 'json' ? "{success:true}" : true; + return $returnType == 'json' ? '{success:true}' : true; } catch (Exception $e) { return $returnType == 'json' ? "{error:true,message:'" . $e->getMessage() . "'}" : false; } diff --git a/app/code/core/Mage/Core/Model/App.php b/app/code/core/Mage/Core/Model/App.php index 9989bd21744..8149769fa65 100644 --- a/app/code/core/Mage/Core/Model/App.php +++ b/app/code/core/Mage/Core/Model/App.php @@ -1338,7 +1338,7 @@ public function getResponse() if (empty($this->_response)) { $this->_response = new Mage_Core_Controller_Response_Http(); $this->_response->headersSentThrowsException = Mage::$headersSentThrowsException; - $this->_response->setHeader("Content-Type", "text/html; charset=UTF-8"); + $this->_response->setHeader('Content-Type', 'text/html; charset=UTF-8'); } return $this->_response; } diff --git a/app/code/core/Mage/Core/Model/Config.php b/app/code/core/Mage/Core/Model/Config.php index 9cc7b792e67..546aa7bbef4 100644 --- a/app/code/core/Mage/Core/Model/Config.php +++ b/app/code/core/Mage/Core/Model/Config.php @@ -724,7 +724,7 @@ protected function _getSectionConfig($path) * Get node value from cached section data * * @param array $path - * @return false|Varien_Simplexml_Element + * @return false|Mage_Core_Model_Config_Element */ public function getSectionNode($path) { @@ -741,7 +741,7 @@ public function getSectionNode($path) * Returns node found by the $path and scope info * * @inheritDoc - * @return Mage_Core_Model_Config_Element|Varien_Simplexml_Element|false + * @return Mage_Core_Model_Config_Element */ public function getNode($path = null, $scope = '', $scopeCode = null) { @@ -1150,7 +1150,7 @@ public function substDistroServerVars($data) * Get module config node * * @param string $moduleName - * @return Mage_Core_Model_Config_Element|SimpleXMLElement + * @return Mage_Core_Model_Config_Element */ public function getModuleConfig($moduleName = '') { @@ -1785,7 +1785,7 @@ public function getResourceModelClassName($modelClass) */ protected function _makeEventsLowerCase($area, Varien_Simplexml_Config $mergeModel) { - $events = $mergeModel->getNode($area . "/" . Mage_Core_Model_App_Area::PART_EVENTS); + $events = $mergeModel->getNode($area . '/' . Mage_Core_Model_App_Area::PART_EVENTS); if ($events !== false) { $children = clone $events->children(); /** @var Mage_Core_Model_Config_Element $event */ diff --git a/app/code/core/Mage/Core/Model/Email/Queue.php b/app/code/core/Mage/Core/Model/Email/Queue.php index 04b54b385c9..0607026739a 100644 --- a/app/code/core/Mage/Core/Model/Email/Queue.php +++ b/app/code/core/Mage/Core/Model/Email/Queue.php @@ -193,7 +193,7 @@ public function send() if ($message->getId()) { $parameters = new Varien_Object($message->getMessageParameters()); if ($parameters->getReturnPathEmail() !== null) { - $mailTransport = new Zend_Mail_Transport_Sendmail("-f" . $parameters->getReturnPathEmail()); + $mailTransport = new Zend_Mail_Transport_Sendmail('-f' . $parameters->getReturnPathEmail()); Zend_Mail::setDefaultTransport($mailTransport); } diff --git a/app/code/core/Mage/Core/Model/Email/Template.php b/app/code/core/Mage/Core/Model/Email/Template.php index d57cf4b9dbe..623b9e2ab5a 100644 --- a/app/code/core/Mage/Core/Model/Email/Template.php +++ b/app/code/core/Mage/Core/Model/Email/Template.php @@ -434,7 +434,7 @@ public function send($email, $name = null, array $variables = []) $mail = $this->getMail(); if ($returnPathEmail !== null) { - $mailTransport = new Zend_Mail_Transport_Sendmail("-f" . $returnPathEmail); + $mailTransport = new Zend_Mail_Transport_Sendmail('-f' . $returnPathEmail); Zend_Mail::setDefaultTransport($mailTransport); } diff --git a/app/code/core/Mage/Core/Model/Email/Template/Abstract.php b/app/code/core/Mage/Core/Model/Email/Template/Abstract.php index d11ec8cf843..4ced0c25206 100644 --- a/app/code/core/Mage/Core/Model/Email/Template/Abstract.php +++ b/app/code/core/Mage/Core/Model/Email/Template/Abstract.php @@ -155,12 +155,12 @@ protected function _addEmailVariables($variables, $storeId) } $defaultValuesMap = [ - "logo_width" => self::XML_PATH_DESIGN_EMAIL_LOGO_WIDTH, - "logo_height" => self::XML_PATH_DESIGN_EMAIL_LOGO_HEIGHT, - "phone" => Mage_Core_Model_Store::XML_PATH_STORE_STORE_PHONE, - "store_phone" => Mage_Core_Model_Store::XML_PATH_STORE_STORE_PHONE, - "store_hours" => Mage_Core_Model_Store::XML_PATH_STORE_STORE_HOURS, - "store_email" => Mage_Customer_Helper_Data::XML_PATH_SUPPORT_EMAIL, + 'logo_width' => self::XML_PATH_DESIGN_EMAIL_LOGO_WIDTH, + 'logo_height' => self::XML_PATH_DESIGN_EMAIL_LOGO_HEIGHT, + 'phone' => Mage_Core_Model_Store::XML_PATH_STORE_STORE_PHONE, + 'store_phone' => Mage_Core_Model_Store::XML_PATH_STORE_STORE_PHONE, + 'store_hours' => Mage_Core_Model_Store::XML_PATH_STORE_STORE_HOURS, + 'store_email' => Mage_Customer_Helper_Data::XML_PATH_SUPPORT_EMAIL, ]; foreach ($defaultValuesMap as $variableName => $configValue) { @@ -252,7 +252,7 @@ protected function _getCssByConfig($configPath) if (!$filesToLoad) { return ''; } - $files = array_map('trim', explode(",", $filesToLoad)); + $files = array_map('trim', explode(',', $filesToLoad)); $css = ''; foreach ($files as $fileName) { diff --git a/app/code/core/Mage/Core/Model/File/Uploader.php b/app/code/core/Mage/Core/Model/File/Uploader.php index 3b7316b79b8..ecbb8828d1d 100644 --- a/app/code/core/Mage/Core/Model/File/Uploader.php +++ b/app/code/core/Mage/Core/Model/File/Uploader.php @@ -109,7 +109,7 @@ public function save($destinationFolder, $newFileName = null) $fileName = $newFileName ?? $this->_file['name']; if (strlen($fileName) > $this->_fileNameMaxLength) { throw new Exception( - Mage::helper('core')->__("File name is too long. Maximum length is %s.", $this->_fileNameMaxLength) + Mage::helper('core')->__('File name is too long. Maximum length is %s.', $this->_fileNameMaxLength) ); } return parent::save($destinationFolder, $newFileName); diff --git a/app/code/core/Mage/Core/Model/File/Validator/Image.php b/app/code/core/Mage/Core/Model/File/Validator/Image.php index bac27129500..d7957a1ed0e 100644 --- a/app/code/core/Mage/Core/Model/File/Validator/Image.php +++ b/app/code/core/Mage/Core/Model/File/Validator/Image.php @@ -21,7 +21,7 @@ */ class Mage_Core_Model_File_Validator_Image { - public const NAME = "isImage"; + public const NAME = 'isImage'; protected $_allowedImageTypes = [ IMAGETYPE_WEBP, diff --git a/app/code/core/Mage/Core/Model/Input/Filter.php b/app/code/core/Mage/Core/Model/Input/Filter.php index 0fa3e22411b..01b0d27f0be 100644 --- a/app/code/core/Mage/Core/Model/Input/Filter.php +++ b/app/code/core/Mage/Core/Model/Input/Filter.php @@ -250,7 +250,7 @@ protected function _filter(array $data, &$filters = null, $isFilterListSimple = protected function _applyFiltrationWithHelper($value, Mage_Core_Helper_Abstract $helper, array $filterData) { if (!isset($filterData['method']) || empty($filterData['method'])) { - throw new Exception("Helper filtration method is not set"); + throw new Exception('Helper filtration method is not set'); } if (!isset($filterData['args']) || empty($filterData['args'])) { $filterData['args'] = []; diff --git a/app/code/core/Mage/Core/Model/Layout.php b/app/code/core/Mage/Core/Model/Layout.php index b71d87ce8d0..33243ff947f 100644 --- a/app/code/core/Mage/Core/Model/Layout.php +++ b/app/code/core/Mage/Core/Model/Layout.php @@ -146,7 +146,7 @@ public function getDirectOutput() public function generateXml() { $xml = $this->getUpdate()->asSimplexml(); - $removeInstructions = $xml->xpath("//remove"); + $removeInstructions = $xml->xpath('//remove'); if (is_array($removeInstructions)) { foreach ($removeInstructions as $infoNode) { $attributes = $infoNode->attributes(); diff --git a/app/code/core/Mage/Core/Model/Layout/Validator.php b/app/code/core/Mage/Core/Model/Layout/Validator.php index 2d14731992b..5a64b73ce7f 100644 --- a/app/code/core/Mage/Core/Model/Layout/Validator.php +++ b/app/code/core/Mage/Core/Model/Layout/Validator.php @@ -188,7 +188,7 @@ public function getProtectedExpressions() */ public function getXpathValidationExpression() { - return implode(" | ", $this->_disallowedXPathExpressions); + return implode(' | ', $this->_disallowedXPathExpressions); } /** @@ -209,7 +209,7 @@ public function getXpathBlockValidationExpression() if (!$this->_xpathBlockValidationExpression) { if (count($this->_disallowedBlock)) { foreach ($this->_disallowedBlock as $key => $value) { - $this->_xpathBlockValidationExpression .= $key > 0 ? " | " : ''; + $this->_xpathBlockValidationExpression .= $key > 0 ? ' | ' : ''; $this->_xpathBlockValidationExpression .= "//block[translate(@type, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = "; $this->_xpathBlockValidationExpression .= diff --git a/app/code/core/Mage/Core/Model/Locale.php b/app/code/core/Mage/Core/Model/Locale.php index 2a0c44563c3..5ade3b84cc0 100644 --- a/app/code/core/Mage/Core/Model/Locale.php +++ b/app/code/core/Mage/Core/Model/Locale.php @@ -695,7 +695,7 @@ public function getJsPriceFormat() if ($pos !== false) { $format = substr($format, 0, $pos); } - $format = preg_replace("/[^0\#\.,]/", "", $format); + $format = preg_replace("/[^0\#\.,]/", '', $format); $totalPrecision = 0; $decimalPoint = strpos($format, '.'); if ($decimalPoint !== false) { diff --git a/app/code/core/Mage/Core/Model/Resource/Url/Rewrite/Collection.php b/app/code/core/Mage/Core/Model/Resource/Url/Rewrite/Collection.php index 373d04b1c11..ae359a25a01 100644 --- a/app/code/core/Mage/Core/Model/Resource/Url/Rewrite/Collection.php +++ b/app/code/core/Mage/Core/Model/Resource/Url/Rewrite/Collection.php @@ -97,7 +97,7 @@ public function filterAllByProductId($productId) public function filterAllByCategory() { $this->getSelect() - ->where('id_path LIKE ?', "category/%"); + ->where('id_path LIKE ?', 'category/%'); return $this; } } diff --git a/app/code/core/Mage/Core/Model/Session/Abstract.php b/app/code/core/Mage/Core/Model/Session/Abstract.php index c3b858d04c3..1e30dc2ddc0 100644 --- a/app/code/core/Mage/Core/Model/Session/Abstract.php +++ b/app/code/core/Mage/Core/Model/Session/Abstract.php @@ -524,7 +524,7 @@ public function getSessionHosts() /** * Retrieve session save method * - * @return string + * @return Mage_Core_Model_Config_Element|Varien_Simplexml_Element|false|string */ public function getSessionSaveMethod() { @@ -537,7 +537,7 @@ public function getSessionSaveMethod() /** * Get session save path * - * @return string + * @return Mage_Core_Model_Config_Element|Varien_Simplexml_Element|false|string */ public function getSessionSavePath() { diff --git a/app/code/core/Mage/Core/Model/Store.php b/app/code/core/Mage/Core/Model/Store.php index 286db5850d0..981e8d1fe66 100644 --- a/app/code/core/Mage/Core/Model/Store.php +++ b/app/code/core/Mage/Core/Model/Store.php @@ -967,9 +967,9 @@ public function roundPrice($price) /** * Format price with currency filter (taking rate into consideration) * - * @param double $price + * @param float $price * @param bool $includeContainer - * @return string + * @return string|float */ public function formatPrice($price, $includeContainer = true) { diff --git a/app/code/core/Mage/Core/Model/Url.php b/app/code/core/Mage/Core/Model/Url.php index 0ee085048eb..c3b01d16ffb 100644 --- a/app/code/core/Mage/Core/Model/Url.php +++ b/app/code/core/Mage/Core/Model/Url.php @@ -1143,7 +1143,7 @@ public function sessionUrlVar($html) } else { return preg_replace_callback( '#(\?|&|&)___SID=([SU])(&|&)?#', - [$this, "sessionVarCallback"], + [$this, 'sessionVarCallback'], $html ); } diff --git a/app/code/core/Mage/Core/functions.php b/app/code/core/Mage/Core/functions.php index 517f2c2512f..1e46c5d5814 100644 --- a/app/code/core/Mage/Core/functions.php +++ b/app/code/core/Mage/Core/functions.php @@ -103,7 +103,7 @@ function mageFindClassFile($class) * @param string $errstr * @param string $errfile * @param int $errline - * @return bool|void + * @return bool|null */ function mageCoreErrorHandler($errno, $errstr, $errfile, $errline) { @@ -133,46 +133,46 @@ function mageCoreErrorHandler($errno, $errstr, $errfile, $errline) switch ($errno) { case E_ERROR: - $errorMessage .= "Error"; + $errorMessage .= 'Error'; break; case E_WARNING: - $errorMessage .= "Warning"; + $errorMessage .= 'Warning'; break; case E_PARSE: - $errorMessage .= "Parse Error"; + $errorMessage .= 'Parse Error'; break; case E_NOTICE: - $errorMessage .= "Notice"; + $errorMessage .= 'Notice'; break; case E_CORE_ERROR: - $errorMessage .= "Core Error"; + $errorMessage .= 'Core Error'; break; case E_CORE_WARNING: - $errorMessage .= "Core Warning"; + $errorMessage .= 'Core Warning'; break; case E_COMPILE_ERROR: - $errorMessage .= "Compile Error"; + $errorMessage .= 'Compile Error'; break; case E_COMPILE_WARNING: - $errorMessage .= "Compile Warning"; + $errorMessage .= 'Compile Warning'; break; case E_USER_ERROR: - $errorMessage .= "User Error"; + $errorMessage .= 'User Error'; break; case E_USER_WARNING: - $errorMessage .= "User Warning"; + $errorMessage .= 'User Warning'; break; case E_USER_NOTICE: - $errorMessage .= "User Notice"; + $errorMessage .= 'User Notice'; break; case E_STRICT: - $errorMessage .= "Strict Notice"; + $errorMessage .= 'Strict Notice'; break; case E_RECOVERABLE_ERROR: - $errorMessage .= "Recoverable Error"; + $errorMessage .= 'Recoverable Error'; break; case E_DEPRECATED: - $errorMessage .= "Deprecated functionality"; + $errorMessage .= 'Deprecated functionality'; break; default: $errorMessage .= "Unknown error ($errno)"; @@ -184,6 +184,7 @@ function mageCoreErrorHandler($errno, $errstr, $errfile, $errline) throw new Exception($errorMessage); } else { Mage::log($errorMessage, Zend_Log::ERR); + return null; } } @@ -191,7 +192,7 @@ function mageCoreErrorHandler($errno, $errstr, $errfile, $errline) * @param bool $return * @param bool $html * @param bool $showFirst - * @return string|void + * @return string|null * * @SuppressWarnings(PHPMD.ErrorControlOperator) */ @@ -200,7 +201,7 @@ function mageDebugBacktrace($return = false, $html = true, $showFirst = false) $d = debug_backtrace(); $out = ''; if ($html) { - $out .= "
        ";
        +        $out .= '
        ';
             }
             foreach ($d as $i => $r) {
                 if (!$showFirst && $i == 0) {
        @@ -210,12 +211,13 @@ function mageDebugBacktrace($return = false, $html = true, $showFirst = false)
                 @$out .= "[$i] {$r['file']}:{$r['line']}\n";
             }
             if ($html) {
        -        $out .= "
        "; + $out .= '
        '; } if ($return) { return $out; } else { echo $out; + return null; } } @@ -256,7 +258,7 @@ function mageDelTree($path) * @param string $escape * @return array */ -function mageParseCsv($string, $delimiter = ",", $enclosure = '"', $escape = '\\') +function mageParseCsv($string, $delimiter = ',', $enclosure = '"', $escape = '\\') { $elements = explode($delimiter, $string); for ($i = 0; $i < count($elements); $i++) { diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.14-0.8.15.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.14-0.8.15.php index f8d5a7742df..0e3ae3d17e7 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.14-0.8.15.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.14-0.8.15.php @@ -16,5 +16,5 @@ /** @var Mage_Core_Model_Resource_Setup $installer */ $installer = $this; $installer->startSetup(); -$installer->getConnection()->addColumn($installer->getTable('core/email_template'), 'orig_template_code', "VARCHAR(200) DEFAULT NULL"); +$installer->getConnection()->addColumn($installer->getTable('core/email_template'), 'orig_template_code', 'VARCHAR(200) DEFAULT NULL'); $installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.15-0.8.16.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.15-0.8.16.php index ca2ff9c4989..4f57a05f12c 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.15-0.8.16.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.15-0.8.16.php @@ -20,7 +20,7 @@ $installer->getConnection()->addColumn( $installer->getTable('core_email_template'), 'template_styles', - "text AFTER `template_text`" + 'text AFTER `template_text`' ); $installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.16-0.8.17.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.16-0.8.17.php index 41216e6067f..c96ad411d03 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.16-0.8.17.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.16-0.8.17.php @@ -39,6 +39,6 @@ CONSTRAINT `FK_CORE_EMAIL_VARIABLE_VALUE_VARIABLE_ID` FOREIGN KEY (`variable_id`) REFERENCES `{$installer->getTable('core_email_variable')}` (`variable_id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 "); -$installer->getConnection()->addColumn($installer->getTable('core/email_template'), 'orig_template_variables', "text NOT NULL"); +$installer->getConnection()->addColumn($installer->getTable('core/email_template'), 'orig_template_variables', 'text NOT NULL'); $installer->endSetup(); diff --git a/app/code/core/Mage/Cron/Model/Schedule.php b/app/code/core/Mage/Cron/Model/Schedule.php index eb014331b6f..36d2ae69867 100644 --- a/app/code/core/Mage/Cron/Model/Schedule.php +++ b/app/code/core/Mage/Cron/Model/Schedule.php @@ -145,7 +145,7 @@ public function matchCronExpression($expr, $num) throw Mage::exception('Mage_Cron', "Invalid cron expression, expecting 'match/modulus': " . $expr); } if (!is_numeric($e[1])) { - throw Mage::exception('Mage_Cron', "Invalid cron expression, expecting numeric modulus: " . $expr); + throw Mage::exception('Mage_Cron', 'Invalid cron expression, expecting numeric modulus: ' . $expr); } $expr = $e[0]; $mod = $e[1]; @@ -171,7 +171,7 @@ public function matchCronExpression($expr, $num) } if ($from === false || $to === false) { - throw Mage::exception('Mage_Cron', "Invalid cron expression: " . $expr); + throw Mage::exception('Mage_Cron', 'Invalid cron expression: ' . $expr); } return ($num >= $from) && ($num <= $to) && ($num % $mod === 0); diff --git a/app/code/core/Mage/Customer/Block/Account/Dashboard/Sidebar.php b/app/code/core/Mage/Customer/Block/Account/Dashboard/Sidebar.php index 76aa0047fae..30bfffb45d2 100644 --- a/app/code/core/Mage/Customer/Block/Account/Dashboard/Sidebar.php +++ b/app/code/core/Mage/Customer/Block/Account/Dashboard/Sidebar.php @@ -116,7 +116,7 @@ public function getCompareItems() */ public function getCompareJsObjectName() { - return "dashboardSidebarCompareJsObject"; + return 'dashboardSidebarCompareJsObject'; } /** diff --git a/app/code/core/Mage/Customer/Model/Convert/Adapter/Customer.php b/app/code/core/Mage/Customer/Model/Convert/Adapter/Customer.php index 173725a4acd..e105bf6dfd7 100644 --- a/app/code/core/Mage/Customer/Model/Convert/Adapter/Customer.php +++ b/app/code/core/Mage/Customer/Model/Convert/Adapter/Customer.php @@ -403,7 +403,7 @@ public function save() } $i++; } - $this->addException(Mage::helper('customer')->__("Saved %d record(s)", $i)); + $this->addException(Mage::helper('customer')->__('Saved %d record(s)', $i)); } catch (Exception $e) { if (!$e instanceof Mage_Dataflow_Model_Convert_Exception) { $this->addException( diff --git a/app/code/core/Mage/Customer/Model/Convert/Parser/Customer.php b/app/code/core/Mage/Customer/Model/Convert/Parser/Customer.php index 64113720af9..a6a5ab6b317 100644 --- a/app/code/core/Mage/Customer/Model/Convert/Parser/Customer.php +++ b/app/code/core/Mage/Customer/Model/Convert/Parser/Customer.php @@ -258,7 +258,7 @@ public function unparse() if ($attribute->usesSource()) { $option = $attribute->getSource()->getOptionText($value); if ($value && empty($option)) { - $message = Mage::helper('catalog')->__("An invalid option ID is specified for %s (%s), skipping the record.", $field, $value); + $message = Mage::helper('catalog')->__('An invalid option ID is specified for %s (%s), skipping the record.', $field, $value); $this->addException($message, Mage_Dataflow_Model_Convert_Exception::ERROR); continue; } @@ -329,7 +329,7 @@ public function unparse() $groupCode = $this->_getCustomerGroupCode($customer); if (is_null($groupCode)) { $this->addException( - Mage::helper('catalog')->__("An invalid group ID is specified, skipping the record."), + Mage::helper('catalog')->__('An invalid group ID is specified, skipping the record.'), Mage_Dataflow_Model_Convert_Exception::ERROR ); continue; @@ -467,7 +467,7 @@ public function parse() // get attribute_set_id, if not throw error $row['attribute_set_id'] = $this->getAttributeSetId($entityTypeId, $row['attribute_set']); if (!$row['attribute_set_id']) { - $this->addException(Mage::helper('customer')->__("Invalid attribute set specified, skipping the record."), Varien_Convert_Exception::ERROR); + $this->addException(Mage::helper('customer')->__('Invalid attribute set specified, skipping the record.'), Varien_Convert_Exception::ERROR); continue; } @@ -488,7 +488,7 @@ public function parse() // get store ids $storeIds = $this->getStoreIds($row['store'] ?? $this->getVar('store')); if (!$storeIds) { - $this->addException(Mage::helper('customer')->__("Invalid store specified, skipping the record."), Varien_Convert_Exception::ERROR); + $this->addException(Mage::helper('customer')->__('Invalid store specified, skipping the record.'), Varien_Convert_Exception::ERROR); continue; } @@ -517,7 +517,7 @@ public function parse() $rowError = true; $this->addException( Mage::helper('customer')->__( - "Invalid attribute option specified for attribute %s (%s), skipping the record.", + 'Invalid attribute option specified for attribute %s (%s), skipping the record.', $field, $value ), diff --git a/app/code/core/Mage/Customer/Model/Resource/Group/Collection.php b/app/code/core/Mage/Customer/Model/Resource/Group/Collection.php index 13becdf1752..7dbba37bdac 100644 --- a/app/code/core/Mage/Customer/Model/Resource/Group/Collection.php +++ b/app/code/core/Mage/Customer/Model/Resource/Group/Collection.php @@ -75,7 +75,7 @@ public function addTaxClass() { $this->getSelect()->joinLeft( ['tax_class_table' => $this->getTable('tax/tax_class')], - "main_table.tax_class_id = tax_class_table.class_id" + 'main_table.tax_class_id = tax_class_table.class_id' ); return $this; } diff --git a/app/code/core/Mage/Customer/controllers/AccountController.php b/app/code/core/Mage/Customer/controllers/AccountController.php index df89ba23189..8cf9e7399a9 100644 --- a/app/code/core/Mage/Customer/controllers/AccountController.php +++ b/app/code/core/Mage/Customer/controllers/AccountController.php @@ -23,8 +23,8 @@ */ class Mage_Customer_AccountController extends Mage_Core_Controller_Front_Action { - public const CUSTOMER_ID_SESSION_NAME = "customerId"; - public const TOKEN_SESSION_NAME = "token"; + public const CUSTOMER_ID_SESSION_NAME = 'customerId'; + public const TOKEN_SESSION_NAME = 'token'; /** * Action list where need check enabled cookie @@ -895,7 +895,7 @@ public function resetPasswordPostAction() */ protected function getCustomerId() { - $customerId = $this->getRequest()->getQuery("id"); + $customerId = $this->getRequest()->getQuery('id'); if (strlen($customerId) > 12) { $customerCollection = Mage::getModel('customer/customer') ->getCollection() diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Container/Abstract.php b/app/code/core/Mage/Dataflow/Model/Convert/Container/Abstract.php index 7382de11ff5..19860511fb1 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Container/Abstract.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Container/Abstract.php @@ -129,7 +129,7 @@ public function validateDataSerialized($data = null) } catch (Exception $e) { $result = false; $this->addException( - "Invalid data, expecting serialized array.", + 'Invalid data, expecting serialized array.', Mage_Dataflow_Model_Convert_Exception::FATAL ); } @@ -144,7 +144,7 @@ public function validateDataString($data = null) $data = $this->getData(); } if (!is_string($data)) { - $this->addException("Invalid data type, expecting string.", Mage_Dataflow_Model_Convert_Exception::FATAL); + $this->addException('Invalid data type, expecting string.', Mage_Dataflow_Model_Convert_Exception::FATAL); } return true; } @@ -155,7 +155,7 @@ public function validateDataArray($data = null) $data = $this->getData(); } if (!is_array($data)) { - $this->addException("Invalid data type, expecting array.", Mage_Dataflow_Model_Convert_Exception::FATAL); + $this->addException('Invalid data type, expecting array.', Mage_Dataflow_Model_Convert_Exception::FATAL); } return true; } @@ -170,7 +170,7 @@ public function validateDataGrid($data = null) return true; } $this->addException( - "Invalid data type, expecting 2D grid array.", + 'Invalid data type, expecting 2D grid array.', Mage_Dataflow_Model_Convert_Exception::FATAL ); } diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Parser/Csv.php b/app/code/core/Mage/Dataflow/Model/Convert/Parser/Csv.php index a118510405e..23458115e99 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Parser/Csv.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Parser/Csv.php @@ -162,7 +162,7 @@ public function unparse() $io->open(); if (!$batchExportIds) { - $io->write(""); + $io->write(''); $io->close(); return $this; } @@ -234,7 +234,7 @@ public function getCsvString($fields = []) $str = ''; foreach ($fields as $value) { - $escapedValue = Mage::helper("core")->getEscapedCSVData([$value]); + $escapedValue = Mage::helper('core')->getEscapedCSVData([$value]); $value = $escapedValue[0]; if (str_contains($value, $delimiter) || diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Profile/Abstract.php b/app/code/core/Mage/Dataflow/Model/Convert/Profile/Abstract.php index cc4d6325ad4..95b73e75b17 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Profile/Abstract.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Profile/Abstract.php @@ -108,7 +108,7 @@ public function importXml(Varien_Simplexml_Element $profileNode) public function run() { if (!$this->_actions) { - $e = new Mage_Dataflow_Model_Convert_Exception("Could not find any actions for this profile"); + $e = new Mage_Dataflow_Model_Convert_Exception('Could not find any actions for this profile'); $e->setLevel(Mage_Dataflow_Model_Convert_Exception::FATAL); $this->addException($e); return; diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Validator/Dryrun.php b/app/code/core/Mage/Dataflow/Model/Convert/Validator/Dryrun.php index 84d50adadd5..da7e6d3d0e3 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Validator/Dryrun.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Validator/Dryrun.php @@ -26,7 +26,7 @@ class Mage_Dataflow_Model_Convert_Validator_Dryrun extends Mage_Dataflow_Model_C public function validate() { if ($this->getVar('dry_run') || $this->getProfile()->getDryRun()) { - $this->addException(Mage::helper('dataflow')->__("Dry run set, stopping execution."), Mage_Dataflow_Model_Convert_Exception::FATAL); + $this->addException(Mage::helper('dataflow')->__('Dry run set, stopping execution.'), Mage_Dataflow_Model_Convert_Exception::FATAL); } return $this; } diff --git a/app/code/core/Mage/Dataflow/Model/Mysql4/Catalogold.php b/app/code/core/Mage/Dataflow/Model/Mysql4/Catalogold.php index 31e53808426..c74eaef3c48 100644 --- a/app/code/core/Mage/Dataflow/Model/Mysql4/Catalogold.php +++ b/app/code/core/Mage/Dataflow/Model/Mysql4/Catalogold.php @@ -76,8 +76,8 @@ public function addProductToStore($productId, $storeId) $write = $this->getConnection(); $table = $this->getTable('catalog/product_store'); try { - if (!$write->fetchOne("select * from $table where product_id=" . (int)$productId . " and store_id=" . (int)$storeId)) { - $write->query("insert into $table (product_id, store_id) values (" . (int)$productId . "," . (int)$storeId . ")"); + if (!$write->fetchOne("select * from $table where product_id=" . (int)$productId . ' and store_id=' . (int)$storeId)) { + $write->query("insert into $table (product_id, store_id) values (" . (int)$productId . ',' . (int)$storeId . ')'); } } catch (Exception $e) { throw $e; diff --git a/app/code/core/Mage/Dataflow/Model/Profile.php b/app/code/core/Mage/Dataflow/Model/Profile.php index 215937e35be..8ab3d17216d 100644 --- a/app/code/core/Mage/Dataflow/Model/Profile.php +++ b/app/code/core/Mage/Dataflow/Model/Profile.php @@ -90,7 +90,7 @@ protected function _beforeSave() if ($actionsXML !== null && strlen($actionsXML) < 0 && @simplexml_load_string('' . $actionsXML . '', null, LIBXML_NOERROR) === false ) { - Mage::throwException(Mage::helper('dataflow')->__("Actions XML is not valid.")); + Mage::throwException(Mage::helper('dataflow')->__('Actions XML is not valid.')); } if (is_array($this->getGuiData())) { @@ -131,7 +131,7 @@ protected function _beforeSave() } if ($this->_getResource()->isProfileExists($this->getName(), $this->getId())) { - Mage::throwException(Mage::helper('dataflow')->__("Profile with the same name already exists.")); + Mage::throwException(Mage::helper('dataflow')->__('Profile with the same name already exists.')); } return $this; } @@ -178,8 +178,8 @@ protected function _afterSave() $uploader->save($path); $uploadFile = $uploader->getUploadedFileName(); - if ($_FILES['file_' . ($index + 1)]['type'] == "text/csv" - || $_FILES['file_' . ($index + 1)]['type'] == "application/vnd.ms-excel" + if ($_FILES['file_' . ($index + 1)]['type'] == 'text/csv' + || $_FILES['file_' . ($index + 1)]['type'] == 'application/vnd.ms-excel' ) { $fileData = $csvParser->getData($path . $uploadFile); $fileData = array_shift($fileData); diff --git a/app/code/core/Mage/Directory/Model/Country.php b/app/code/core/Mage/Directory/Model/Country.php index 8c35648c8da..ed07bcc194f 100644 --- a/app/code/core/Mage/Directory/Model/Country.php +++ b/app/code/core/Mage/Directory/Model/Country.php @@ -94,16 +94,16 @@ public function formatAddress(Varien_Object $address, $html = false) if (!$this->getId()) { $template = '{{firstname}} {{lastname}}'; } elseif (!$html) { - $template = "{{firstname}} {{lastname}} + $template = '{{firstname}} {{lastname}} {{company}} {{street1}} {{street2}} -{{city}}, {{region}} {{postcode}}"; +{{city}}, {{region}} {{postcode}}'; } else { - $template = "{{firstname}} {{lastname}}
        + $template = '{{firstname}} {{lastname}}
        {{street}}
        {{city}}, {{region}} {{postcode}}
        -T: {{telephone}}"; +T: {{telephone}}'; } } diff --git a/app/code/core/Mage/Directory/Model/Currency.php b/app/code/core/Mage/Directory/Model/Currency.php index 8fd5df33432..1363a76498d 100644 --- a/app/code/core/Mage/Directory/Model/Currency.php +++ b/app/code/core/Mage/Directory/Model/Currency.php @@ -260,7 +260,7 @@ public function formatTxt($price, $options = []) * %f - the argument is treated as a float, and presented as a floating-point number (locale aware). * %F - the argument is treated as a float, and presented as a floating-point number (non-locale aware). */ - $price = sprintf("%F", $price); + $price = sprintf('%F', $price); if ($price == -0) { $price = 0; } diff --git a/app/code/core/Mage/Directory/Model/Currency/Filter.php b/app/code/core/Mage/Directory/Model/Currency/Filter.php index ed481822601..51c6bf0a7db 100644 --- a/app/code/core/Mage/Directory/Model/Currency/Filter.php +++ b/app/code/core/Mage/Directory/Model/Currency/Filter.php @@ -67,7 +67,7 @@ public function filter($value) $value = Mage::app()->getLocale()->getNumber($value); $value = Mage::app()->getStore()->roundPrice($this->_rate * $value); //$value = round($value, 2); - $value = sprintf("%F", $value); + $value = sprintf('%F', $value); return $this->_currency->toCurrency($value); } } diff --git a/app/code/core/Mage/Directory/Model/Resource/Country/Collection.php b/app/code/core/Mage/Directory/Model/Resource/Country/Collection.php index 92c210c8f33..97db11c2565 100644 --- a/app/code/core/Mage/Directory/Model/Resource/Country/Collection.php +++ b/app/code/core/Mage/Directory/Model/Resource/Country/Collection.php @@ -50,7 +50,7 @@ public function loadByStore($store = null) { $allowCountries = explode(',', (string)$this->_getStoreConfig('general/country/allow', $store)); if (!empty($allowCountries)) { - $this->addFieldToFilter("country_id", ['in' => $allowCountries]); + $this->addFieldToFilter('country_id', ['in' => $allowCountries]); } return $this; } @@ -119,9 +119,9 @@ public function addCountryIdFilter($countryId) { if (!empty($countryId)) { if (is_array($countryId)) { - $this->addFieldToFilter("country_id", ['in' => $countryId]); + $this->addFieldToFilter('country_id', ['in' => $countryId]); } else { - $this->addFieldToFilter("country_id", $countryId); + $this->addFieldToFilter('country_id', $countryId); } } return $this; diff --git a/app/code/core/Mage/Directory/Model/Resource/Currency/Collection.php b/app/code/core/Mage/Directory/Model/Resource/Currency/Collection.php index 8a203b48a22..3dab8301334 100644 --- a/app/code/core/Mage/Directory/Model/Resource/Currency/Collection.php +++ b/app/code/core/Mage/Directory/Model/Resource/Currency/Collection.php @@ -90,9 +90,9 @@ public function addLanguageFilter($lang = null) public function addCodeFilter($code) { if (is_array($code)) { - $this->addFieldToFilter("main_table.currency_code", ['in' => $code]); + $this->addFieldToFilter('main_table.currency_code', ['in' => $code]); } else { - $this->addFieldToFilter("main_table.currency_code", $code); + $this->addFieldToFilter('main_table.currency_code', $code); } return $this; diff --git a/app/code/core/Mage/Directory/Model/Resource/Region/Collection.php b/app/code/core/Mage/Directory/Model/Resource/Region/Collection.php index 09fbdf6d1f0..c262b214cc1 100644 --- a/app/code/core/Mage/Directory/Model/Resource/Region/Collection.php +++ b/app/code/core/Mage/Directory/Model/Resource/Region/Collection.php @@ -168,7 +168,7 @@ public function toOptionArray() if (count($options) > 0) { array_unshift($options, [ 'title ' => null, - 'value' => "", + 'value' => '', 'label' => Mage::helper('directory')->__('-- Please select --') ]); } diff --git a/app/code/core/Mage/Downloadable/Model/Resource/Indexer/Price.php b/app/code/core/Mage/Downloadable/Model/Resource/Indexer/Price.php index 35355af3a06..ccfcc59749e 100644 --- a/app/code/core/Mage/Downloadable/Model/Resource/Indexer/Price.php +++ b/app/code/core/Mage/Downloadable/Model/Resource/Indexer/Price.php @@ -109,7 +109,7 @@ protected function _applyDownloadableLink() ->join( ['dl' => $dlType->getBackend()->getTable()], "dl.entity_id = i.entity_id AND dl.attribute_id = {$dlType->getAttributeId()}" - . " AND dl.store_id = 0", + . ' AND dl.store_id = 0', [] ) ->join( diff --git a/app/code/core/Mage/Downloadable/controllers/Adminhtml/Downloadable/FileController.php b/app/code/core/Mage/Downloadable/controllers/Adminhtml/Downloadable/FileController.php index 49e224f2701..dd05a7658ad 100644 --- a/app/code/core/Mage/Downloadable/controllers/Adminhtml/Downloadable/FileController.php +++ b/app/code/core/Mage/Downloadable/controllers/Adminhtml/Downloadable/FileController.php @@ -51,8 +51,8 @@ public function uploadAction() /** * Workaround for prototype 1.7 methods "isJSON", "evalJSON" on Windows OS */ - $result['tmp_name'] = str_replace(DS, "/", $result['tmp_name']); - $result['path'] = str_replace(DS, "/", $result['path']); + $result['tmp_name'] = str_replace(DS, '/', $result['tmp_name']); + $result['path'] = str_replace(DS, '/', $result['path']); if (isset($result['file'])) { $fullPath = rtrim($tmpPath, DS) . DS . ltrim($result['file'], DS); diff --git a/app/code/core/Mage/Downloadable/controllers/DownloadController.php b/app/code/core/Mage/Downloadable/controllers/DownloadController.php index c46b4059e9d..8bac8cf7078 100644 --- a/app/code/core/Mage/Downloadable/controllers/DownloadController.php +++ b/app/code/core/Mage/Downloadable/controllers/DownloadController.php @@ -157,7 +157,7 @@ public function linkAction() $id = $this->getRequest()->getParam('id', 0); $linkPurchasedItem = Mage::getModel('downloadable/link_purchased_item')->load($id, 'link_hash'); if (!$linkPurchasedItem->getId()) { - $this->_getCustomerSession()->addNotice(Mage::helper('downloadable')->__("Requested link does not exist.")); + $this->_getCustomerSession()->addNotice(Mage::helper('downloadable')->__('Requested link does not exist.')); return $this->_redirect('*/customer/products'); } if (!Mage::helper('downloadable')->getIsShareable($linkPurchasedItem)) { @@ -179,7 +179,7 @@ public function linkAction() } $linkPurchased = Mage::getModel('downloadable/link_purchased')->load($linkPurchasedItem->getPurchasedId()); if ($linkPurchased->getCustomerId() != $customerId) { - $this->_getCustomerSession()->addNotice(Mage::helper('downloadable')->__("Requested link does not exist.")); + $this->_getCustomerSession()->addNotice(Mage::helper('downloadable')->__('Requested link does not exist.')); return $this->_redirect('*/customer/products'); } } diff --git a/app/code/core/Mage/Eav/Model/Attribute/Data/Multiline.php b/app/code/core/Mage/Eav/Model/Attribute/Data/Multiline.php index 6a80e7c4c3b..98110ec1004 100644 --- a/app/code/core/Mage/Eav/Model/Attribute/Data/Multiline.php +++ b/app/code/core/Mage/Eav/Model/Attribute/Data/Multiline.php @@ -130,10 +130,10 @@ public function outputValue($format = Mage_Eav_Model_Attribute_Data::OUTPUT_FORM $output = $values; break; case Mage_Eav_Model_Attribute_Data::OUTPUT_FORMAT_HTML: - $output = implode("
        ", $values); + $output = implode('
        ', $values); break; case Mage_Eav_Model_Attribute_Data::OUTPUT_FORMAT_ONELINE: - $output = implode(" ", $values); + $output = implode(' ', $values); break; default: $output = implode("\n", $values); diff --git a/app/code/core/Mage/Eav/Model/Config.php b/app/code/core/Mage/Eav/Model/Config.php index ac23acf4ab3..2e04f7c9ce8 100644 --- a/app/code/core/Mage/Eav/Model/Config.php +++ b/app/code/core/Mage/Eav/Model/Config.php @@ -505,7 +505,7 @@ public function getAttribute($entityType, $code, $storeId = null) // return an empty model to avoid breaking compatibility if (!$attribute) { - $attribute = $this->_hydrateAttribute(["entity_type_id" => $entityType->getId()]); + $attribute = $this->_hydrateAttribute(['entity_type_id' => $entityType->getId()]); } return $attribute; diff --git a/app/code/core/Mage/Eav/Model/Convert/Adapter/Entity.php b/app/code/core/Mage/Eav/Model/Convert/Adapter/Entity.php index 6439f24f5bf..736294a5844 100644 --- a/app/code/core/Mage/Eav/Model/Convert/Adapter/Entity.php +++ b/app/code/core/Mage/Eav/Model/Convert/Adapter/Entity.php @@ -302,7 +302,7 @@ public function load() */ $entityIds = $collection->getAllIds(); - $message = Mage::helper('eav')->__("Loaded %d records", count($entityIds)); + $message = Mage::helper('eav')->__('Loaded %d records', count($entityIds)); $this->addException($message); } catch (Varien_Convert_Exception $e) { throw $e; @@ -351,7 +351,7 @@ public function save() $model->save(); $i++; } - $this->addException(Mage::helper('eav')->__("Saved %d record(s).", $i)); + $this->addException(Mage::helper('eav')->__('Saved %d record(s).', $i)); } catch (Varien_Convert_Exception $e) { throw $e; } catch (Exception $e) { diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php index dc83e413615..efa6c2ac6fc 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php @@ -760,7 +760,7 @@ protected function _getFlatColumnsOldDefinition() if (isset($prop['PRECISION'], $prop['SCALE'])) { $type .= "({$prop['PRECISION']},{$prop['SCALE']})"; } else { - $type .= (isset($prop['LENGTH']) && $prop['LENGTH']) ? "({$prop['LENGTH']})" : ""; + $type .= (isset($prop['LENGTH']) && $prop['LENGTH']) ? "({$prop['LENGTH']})" : ''; } $columns[$this->getAttributeCode()] = [ 'type' => $type, diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Abstract.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Abstract.php index ee17d9c6b3c..faf00f6602d 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Abstract.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Abstract.php @@ -210,7 +210,7 @@ public function getDefaultValue() if ($this->getAttribute()->getDefaultValue()) { $this->_defaultValue = $this->getAttribute()->getDefaultValue(); } else { - $this->_defaultValue = ""; + $this->_defaultValue = ''; } } diff --git a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute.php b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute.php index 809c33ffc0c..41f603795d3 100644 --- a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute.php +++ b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute.php @@ -107,7 +107,7 @@ private function _getMaxSortOrder(Mage_Core_Model_Abstract $object) ':attribute_group_id' => $object->getAttributeGroupId() ]; $select = $adapter->select() - ->from($this->getTable('eav/entity_attribute'), new Zend_Db_Expr("MAX(sort_order)")) + ->from($this->getTable('eav/entity_attribute'), new Zend_Db_Expr('MAX(sort_order)')) ->where('attribute_set_id = :attribute_set_id') ->where('attribute_group_id = :attribute_group_id'); @@ -338,7 +338,7 @@ protected function _saveOption(Mage_Core_Model_Abstract $object) foreach ($stores as $store) { if (isset($values[$store->getId()]) && (!empty($values[$store->getId()]) - || $values[$store->getId()] == "0") + || $values[$store->getId()] == '0') ) { $data = [ 'option_id' => $intOptionId, @@ -429,10 +429,10 @@ public function getAttributeCodesByFrontendType($frontendType) public function getFlatUpdateSelect(Mage_Eav_Model_Entity_Attribute_Abstract $attribute, $storeId) { $adapter = $this->_getReadAdapter(); - $joinConditionTemplate = "%s.entity_id = %s.entity_id" - . " AND %s.entity_type_id = " . $attribute->getEntityTypeId() - . " AND %s.attribute_id = " . $attribute->getId() - . " AND %s.store_id = %d"; + $joinConditionTemplate = '%s.entity_id = %s.entity_id' + . ' AND %s.entity_type_id = ' . $attribute->getEntityTypeId() + . ' AND %s.attribute_id = ' . $attribute->getId() + . ' AND %s.store_id = %d'; $joinCondition = sprintf( $joinConditionTemplate, 'e', @@ -460,7 +460,7 @@ public function getFlatUpdateSelect(Mage_Eav_Model_Entity_Attribute_Abstract $at [$attribute->getAttributeCode() => $valueExpr] ); if ($attribute->getFlatAddChildData()) { - $select->where("e.is_child = ?", 0); + $select->where('e.is_child = ?', 0); } return $select; diff --git a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Group.php b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Group.php index eb890ed1032..19f6fa8d631 100644 --- a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Group.php +++ b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Group.php @@ -90,7 +90,7 @@ protected function _getMaxSortOrder($object) $adapter = $this->_getReadAdapter(); $bind = [':attribute_set_id' => $object->getAttributeSetId()]; $select = $adapter->select() - ->from($this->getMainTable(), new Zend_Db_Expr("MAX(sort_order)")) + ->from($this->getMainTable(), new Zend_Db_Expr('MAX(sort_order)')) ->where('attribute_set_id = :attribute_set_id'); return $adapter->fetchOne($select, $bind); diff --git a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Option.php b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Option.php index 22b62d2a5b4..9d913c2f6e2 100644 --- a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Option.php +++ b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Option.php @@ -84,10 +84,10 @@ public function getFlatUpdateSelect( $attributeTable = $attribute->getBackend()->getTable(); $attributeCode = $attribute->getAttributeCode(); - $joinConditionTemplate = "%s.entity_id = %s.entity_id" - . " AND %s.entity_type_id = " . $attribute->getEntityTypeId() - . " AND %s.attribute_id = " . $attribute->getId() - . " AND %s.store_id = %d"; + $joinConditionTemplate = '%s.entity_id = %s.entity_id' + . ' AND %s.entity_type_id = ' . $attribute->getEntityTypeId() + . ' AND %s.attribute_id = ' . $attribute->getId() + . ' AND %s.store_id = %d'; $joinCondition = sprintf( $joinConditionTemplate, 'e', @@ -126,7 +126,7 @@ public function getFlatUpdateSelect( } if ($attribute->getFlatAddChildData()) { - $select->where("e.is_child = ?", 0); + $select->where('e.is_child = ?', 0); } return $select; diff --git a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.10-0.7.11.php b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.10-0.7.11.php index eb1de5771e1..798de10a2ca 100644 --- a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.10-0.7.11.php +++ b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.10-0.7.11.php @@ -20,7 +20,7 @@ $table = $installer->getTable('eav/attribute'); $installer->getConnection()->addColumn( $table, - "is_filterable_in_search", + 'is_filterable_in_search', "TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '1'" ); $installer->run(" diff --git a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.7-0.7.8.php b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.7-0.7.8.php index 1d2fa81f573..237b25a7f6e 100644 --- a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.7-0.7.8.php +++ b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.7-0.7.8.php @@ -17,6 +17,6 @@ $installer = $this; $installer->startSetup(); -$installer->getConnection()->addColumn($installer->getTable('eav/attribute'), "is_visible_in_advanced_search", "TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0'"); +$installer->getConnection()->addColumn($installer->getTable('eav/attribute'), 'is_visible_in_advanced_search', "TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0'"); $installer->endSetup(); diff --git a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.9-0.7.10.php b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.9-0.7.10.php index 7cf31cddb4a..a91e5b4f716 100644 --- a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.9-0.7.10.php +++ b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.9-0.7.10.php @@ -16,5 +16,5 @@ /** @var Mage_Eav_Model_Entity_Setup $installer */ $installer = $this; $installer->startSetup(); -$installer->getConnection()->addColumn($installer->getTable('eav/attribute'), "is_used_for_price_rules", "TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '1'"); +$installer->getConnection()->addColumn($installer->getTable('eav/attribute'), 'is_used_for_price_rules', "TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '1'"); $installer->endSetup(); diff --git a/app/code/core/Mage/GiftMessage/Model/Api.php b/app/code/core/Mage/GiftMessage/Model/Api.php index 9ac15e8ff6b..edeb794eb00 100644 --- a/app/code/core/Mage/GiftMessage/Model/Api.php +++ b/app/code/core/Mage/GiftMessage/Model/Api.php @@ -81,7 +81,7 @@ public function setForQuote($quoteId, $giftMessage, $store = null) $giftMessage['type'] = 'quote'; $giftMessages = [$quoteId => $giftMessage]; $request = new Mage_Core_Controller_Request_Http(); - $request->setParam("giftmessage", $giftMessages); + $request->setParam('giftmessage', $giftMessages); return $this->_setGiftMessage($quote->getId(), $request, $quote); } @@ -123,9 +123,9 @@ public function setForQuoteProduct($quoteId, $productsAndMessages, $store = null } if (isset($product['product_id'])) { - $productByItem = $this->_getProduct($product['product_id'], $store, "id"); + $productByItem = $this->_getProduct($product['product_id'], $store, 'id'); } elseif (isset($product['sku'])) { - $productByItem = $this->_getProduct($product['sku'], $store, "sku"); + $productByItem = $this->_getProduct($product['sku'], $store, 'sku'); } else { continue; } @@ -152,7 +152,7 @@ public function setForQuoteItem($quoteItemId, $giftMessage, $store = null) /** @var Mage_Sales_Model_Quote_Item $quoteItem */ $quoteItem = Mage::getModel('sales/quote_item')->load($quoteItemId); if (is_null($quoteItem->getId())) { - $this->_fault("quote_item_not_exists"); + $this->_fault('quote_item_not_exists'); } $quote = $this->_getQuote($quoteItem->getQuoteId(), $store); @@ -163,7 +163,7 @@ public function setForQuoteItem($quoteItemId, $giftMessage, $store = null) $giftMessages = [$quoteItem->getId() => $giftMessage]; $request = new Mage_Core_Controller_Request_Http(); - $request->setParam("giftmessage", $giftMessages); + $request->setParam('giftmessage', $giftMessages); return $this->_setGiftMessage($quoteItemId, $request, $quote); } diff --git a/app/code/core/Mage/GoogleAnalytics/Block/Ga.php b/app/code/core/Mage/GoogleAnalytics/Block/Ga.php index 751c65770d6..5b62f716095 100644 --- a/app/code/core/Mage/GoogleAnalytics/Block/Ga.php +++ b/app/code/core/Mage/GoogleAnalytics/Block/Ga.php @@ -21,8 +21,8 @@ */ class Mage_GoogleAnalytics_Block_Ga extends Mage_Core_Block_Template { - protected const CHECKOUT_MODULE_NAME = "checkout"; - protected const CHECKOUT_CONTROLLER_NAME = "onepage"; + protected const CHECKOUT_MODULE_NAME = 'checkout'; + protected const CHECKOUT_CONTROLLER_NAME = 'onepage'; /** * Render regular page tracking javascript code @@ -368,7 +368,7 @@ protected function _getEnhancedEcommerceDataForAnalytics4() } foreach ($result as $k => $ga4Event) { - $result[$k] = "gtag('event', '{$ga4Event[0]}', " . json_encode($ga4Event[1], JSON_THROW_ON_ERROR) . ");"; + $result[$k] = "gtag('event', '{$ga4Event[0]}', " . json_encode($ga4Event[1], JSON_THROW_ON_ERROR) . ');'; } return implode("\n", $result); } diff --git a/app/code/core/Mage/GoogleAnalytics/Helper/Data.php b/app/code/core/Mage/GoogleAnalytics/Helper/Data.php index c2b9686d77d..b1e98e19f17 100644 --- a/app/code/core/Mage/GoogleAnalytics/Helper/Data.php +++ b/app/code/core/Mage/GoogleAnalytics/Helper/Data.php @@ -182,7 +182,7 @@ public function getLastCategoryName($product): string ->addAttributeToSelect('name') ->addIdFilter($product->getCategoryIds()) ->addIsActiveFilter() - ->addFieldToFilter('path', ['like' => $storeRootCategory->getPath() . "/%"]) + ->addFieldToFilter('path', ['like' => $storeRootCategory->getPath() . '/%']) ->addOrder('level') ->getFirstItem(); return $lastCategory->getName() ?: ''; diff --git a/app/code/core/Mage/ImportExport/Model/Export/Adapter/Csv.php b/app/code/core/Mage/ImportExport/Model/Export/Adapter/Csv.php index f8d904de9e0..32c28990f63 100644 --- a/app/code/core/Mage/ImportExport/Model/Export/Adapter/Csv.php +++ b/app/code/core/Mage/ImportExport/Model/Export/Adapter/Csv.php @@ -104,7 +104,7 @@ public function writeRow(array $rowData) * @see https://bugzilla.mozilla.org/show_bug.cgi?id=1054702 */ $data = array_merge($this->_headerCols, array_intersect_key($rowData, $this->_headerCols)); - $data = Mage::helper("core")->getEscapedCSVData($data); + $data = Mage::helper('core')->getEscapedCSVData($data); fputcsv( $this->_fileHandler, diff --git a/app/code/core/Mage/ImportExport/Model/Import.php b/app/code/core/Mage/ImportExport/Model/Import.php index 89527a1e637..2644486fa14 100644 --- a/app/code/core/Mage/ImportExport/Model/Import.php +++ b/app/code/core/Mage/ImportExport/Model/Import.php @@ -335,7 +335,7 @@ public function isImportAllowed() */ public function expandSource() { - $writer = Mage::getModel('importexport/export_adapter_csv', self::getWorkingDir() . "big0.csv"); + $writer = Mage::getModel('importexport/export_adapter_csv', self::getWorkingDir() . 'big0.csv'); $regExps = ['last' => '/(.*?)(\d+)$/', 'middle' => '/(.*?)(\d+)(.*)$/']; $colReg = [ 'sku' => 'last', 'name' => 'last', 'description' => 'last', 'short_description' => 'last', diff --git a/app/code/core/Mage/ImportExport/Model/Import/Adapter/Abstract.php b/app/code/core/Mage/ImportExport/Model/Import/Adapter/Abstract.php index 9808582d3d3..5e51c4e3e72 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Adapter/Abstract.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Adapter/Abstract.php @@ -70,7 +70,7 @@ final public function __construct($source) Mage::throwException(Mage::helper('importexport')->__('Source file path must be a string')); } if (!is_readable($source)) { - Mage::throwException(Mage::helper('importexport')->__("%s file does not exists or is not readable", $source)); + Mage::throwException(Mage::helper('importexport')->__('%s file does not exists or is not readable', $source)); } $this->_source = $source; diff --git a/app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php b/app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php index 572535fd856..6b1b8221b83 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php @@ -263,7 +263,7 @@ protected function _saveValidatedBunches() $bunchSize = Mage::helper('importexport')->getBunchSize(); /** @var Mage_Core_Helper_Data $coreHelper */ - $coreHelper = Mage::helper("core"); + $coreHelper = Mage::helper('core'); $source->rewind(); $this->_dataSourceModel->cleanBunches(); @@ -658,7 +658,7 @@ public function validateData() if (!$this->_dataValidated) { // does all permanent columns exists? if (($colsAbsent = array_diff($this->_permanentAttributes, $this->_getSource()->getColNames()))) { - file_put_contents($this->_getSource()->getSource(), ""); + file_put_contents($this->_getSource()->getSource(), ''); Mage::throwException( Mage::helper('importexport')->__('Can not find required columns: %s', implode(', ', $colsAbsent)) ); diff --git a/app/code/core/Mage/Index/Model/Resource/Helper/Mysql4.php b/app/code/core/Mage/Index/Model/Resource/Helper/Mysql4.php index ff55e533815..0521f99f784 100644 --- a/app/code/core/Mage/Index/Model/Resource/Helper/Mysql4.php +++ b/app/code/core/Mage/Index/Model/Resource/Helper/Mysql4.php @@ -44,7 +44,7 @@ public function insertData($object, $select, $destTable, $columns, $readToIndex) */ public function setLock($name) { - return (bool) $this->_getWriteAdapter()->query("SELECT GET_LOCK(?, ?);", [$name, self::LOCK_GET_TIMEOUT]) + return (bool) $this->_getWriteAdapter()->query('SELECT GET_LOCK(?, ?);', [$name, self::LOCK_GET_TIMEOUT]) ->fetchColumn(); } @@ -56,7 +56,7 @@ public function setLock($name) */ public function releaseLock($name) { - return (bool) $this->_getWriteAdapter()->query("SELECT RELEASE_LOCK(?);", [$name])->fetchColumn(); + return (bool) $this->_getWriteAdapter()->query('SELECT RELEASE_LOCK(?);', [$name])->fetchColumn(); } /** @@ -67,7 +67,7 @@ public function releaseLock($name) */ public function isLocked($name) { - return (bool) $this->_getWriteAdapter()->query("SELECT IS_USED_LOCK(?);", [$name])->fetchColumn(); + return (bool) $this->_getWriteAdapter()->query('SELECT IS_USED_LOCK(?);', [$name])->fetchColumn(); } /** diff --git a/app/code/core/Mage/Install/Model/Observer.php b/app/code/core/Mage/Install/Model/Observer.php index 1eb968fa929..2b679c6cf66 100644 --- a/app/code/core/Mage/Install/Model/Observer.php +++ b/app/code/core/Mage/Install/Model/Observer.php @@ -33,8 +33,8 @@ public function bindLocale($observer) public function installFailure($observer) { - echo "

        There was a problem proceeding with Magento installation.

        "; - echo "

        Please contact developers with error messages on this page.

        "; + echo '

        There was a problem proceeding with Magento installation.

        '; + echo '

        Please contact developers with error messages on this page.

        '; echo Mage::printException($observer->getEvent()->getException()); } } diff --git a/app/code/core/Mage/Log/Model/Aggregation.php b/app/code/core/Mage/Log/Model/Aggregation.php index 7ab2efa3bf8..6fcaf7de95d 100644 --- a/app/code/core/Mage/Log/Model/Aggregation.php +++ b/app/code/core/Mage/Log/Model/Aggregation.php @@ -185,6 +185,6 @@ private function _timestamp($in, $offset = null) */ private function _round($in) { - return date("Y-m-d H:00:00", $this->_timestamp($in)); + return date('Y-m-d H:00:00', $this->_timestamp($in)); } } diff --git a/app/code/core/Mage/Newsletter/Model/Resource/Problem/Collection.php b/app/code/core/Mage/Newsletter/Model/Resource/Problem/Collection.php index 9faf330354b..b0045d91f2e 100644 --- a/app/code/core/Mage/Newsletter/Model/Resource/Problem/Collection.php +++ b/app/code/core/Mage/Newsletter/Model/Resource/Problem/Collection.php @@ -107,7 +107,7 @@ protected function _addCustomersData() $customers = Mage::getResourceModel('customer/customer_collection') ->addNameToSelect() - ->addAttributeToFilter('entity_id', ["in" => $customersIds]); + ->addAttributeToFilter('entity_id', ['in' => $customersIds]); $customers->load(); diff --git a/app/code/core/Mage/Newsletter/Model/Resource/Subscriber/Collection.php b/app/code/core/Mage/Newsletter/Model/Resource/Subscriber/Collection.php index 05de12c54c9..47f17964410 100644 --- a/app/code/core/Mage/Newsletter/Model/Resource/Subscriber/Collection.php +++ b/app/code/core/Mage/Newsletter/Model/Resource/Subscriber/Collection.php @@ -83,8 +83,8 @@ protected function _construct() public function useQueue(Mage_Newsletter_Model_Queue $queue) { $this->getSelect() - ->join(['link' => $this->_queueLinkTable], "link.subscriber_id = main_table.subscriber_id", []) - ->where("link.queue_id = ? ", $queue->getId()); + ->join(['link' => $this->_queueLinkTable], 'link.subscriber_id = main_table.subscriber_id', []) + ->where('link.queue_id = ? ', $queue->getId()); $this->_queueJoinedFlag = true; return $this; } @@ -173,7 +173,7 @@ public function showStoreInfo() * @deprecated after 1.4.0.0-rc1 * * @param string $field - * @return string + * @return string|Zend_Db_Expr */ public function _getFieldTableAlias($field) { diff --git a/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.8.1-0.8.2.php b/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.8.1-0.8.2.php index c27907eca52..2fedc172842 100644 --- a/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.8.1-0.8.2.php +++ b/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.8.1-0.8.2.php @@ -20,7 +20,7 @@ $installer->getConnection()->addColumn( $installer->getTable('newsletter_template'), 'template_styles', - "text AFTER `template_text_preprocessed`" + 'text AFTER `template_text_preprocessed`' ); $installer->endSetup(); diff --git a/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.8.2-0.8.3.php b/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.8.2-0.8.3.php index fa3aff72940..3b185d5e6f8 100644 --- a/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.8.2-0.8.3.php +++ b/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.8.2-0.8.3.php @@ -20,15 +20,15 @@ $templateTable = $installer->getTable('newsletter_template'); $conn = $installer->getConnection(); -$conn->addColumn($queueTable, 'newsletter_type', "int(3) default NULL AFTER `template_id`"); -$conn->addColumn($queueTable, 'newsletter_text', "text AFTER `newsletter_type`"); -$conn->addColumn($queueTable, 'newsletter_styles', "text AFTER `newsletter_text`"); -$conn->addColumn($queueTable, 'newsletter_subject', "varchar(200) default NULL AFTER `newsletter_styles`"); -$conn->addColumn($queueTable, 'newsletter_sender_name', "varchar(200) default NULL AFTER `newsletter_subject`"); +$conn->addColumn($queueTable, 'newsletter_type', 'int(3) default NULL AFTER `template_id`'); +$conn->addColumn($queueTable, 'newsletter_text', 'text AFTER `newsletter_type`'); +$conn->addColumn($queueTable, 'newsletter_styles', 'text AFTER `newsletter_text`'); +$conn->addColumn($queueTable, 'newsletter_subject', 'varchar(200) default NULL AFTER `newsletter_styles`'); +$conn->addColumn($queueTable, 'newsletter_sender_name', 'varchar(200) default NULL AFTER `newsletter_subject`'); $conn->addColumn( $queueTable, 'newsletter_sender_email', - "varchar(200) character set latin1 collate latin1_general_ci default NULL AFTER `newsletter_sender_name`" + 'varchar(200) character set latin1 collate latin1_general_ci default NULL AFTER `newsletter_sender_name`' ); $conn->modifyColumn($templateTable, 'template_text_preprocessed', "text comment 'deprecated since 1.4.0.1'"); diff --git a/app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/Consumer/Edit.php b/app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/Consumer/Edit.php index 473e006ea2f..0a28788248a 100644 --- a/app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/Consumer/Edit.php +++ b/app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/Consumer/Edit.php @@ -57,7 +57,7 @@ public function __construct() 'class' => 'save' ], 100); - $this->_formScripts[] = "function saveAndContinueEdit()" . + $this->_formScripts[] = 'function saveAndContinueEdit()' . "{editForm.submit($('edit_form').action + 'back/edit/')}"; $this->_updateButton('save', 'label', $this->__('Save')); diff --git a/app/code/core/Mage/Oauth/Model/Consumer/Validator/KeyLength.php b/app/code/core/Mage/Oauth/Model/Consumer/Validator/KeyLength.php index 7a76430e5de..ac4a2f9b13e 100644 --- a/app/code/core/Mage/Oauth/Model/Consumer/Validator/KeyLength.php +++ b/app/code/core/Mage/Oauth/Model/Consumer/Validator/KeyLength.php @@ -35,8 +35,9 @@ class Mage_Oauth_Model_Consumer_Validator_KeyLength extends Zend_Validate_String */ public function __construct($options = []) { + $args = func_get_args(); if (!is_array($options)) { - $options = func_get_args(); + $options = $args; if (!isset($options[1])) { $options[1] = 'utf-8'; } diff --git a/app/code/core/Mage/Page/Block/Html/Head.php b/app/code/core/Mage/Page/Block/Html/Head.php index 3a1a4a4816a..ca02a259ce5 100644 --- a/app/code/core/Mage/Page/Block/Html/Head.php +++ b/app/code/core/Mage/Page/Block/Html/Head.php @@ -44,7 +44,7 @@ protected function _construct() * @param bool $before * @return $this */ - public function addCss($name, $params = "", $referenceName = "*", $before = null) + public function addCss($name, $params = '', $referenceName = '*', $before = null) { $this->addItem('skin_css', $name, $params, null, null, $referenceName, $before); return $this; @@ -59,7 +59,7 @@ public function addCss($name, $params = "", $referenceName = "*", $before = null * @param bool $before * @return $this */ - public function addJs($name, $params = "", $referenceName = "*", $before = null) + public function addJs($name, $params = '', $referenceName = '*', $before = null) { $this->addItem('js', $name, $params, null, null, $referenceName, $before); return $this; @@ -75,7 +75,7 @@ public function addJs($name, $params = "", $referenceName = "*", $before = null) * @return $this * @deprecated */ - public function addCssIe($name, $params = "", $referenceName = "*", $before = null) + public function addCssIe($name, $params = '', $referenceName = '*', $before = null) { return $this; } @@ -90,7 +90,7 @@ public function addCssIe($name, $params = "", $referenceName = "*", $before = nu * @return $this * @deprecated */ - public function addJsIe($name, $params = "", $referenceName = "*", $before = null) + public function addJsIe($name, $params = '', $referenceName = '*', $before = null) { return $this; } @@ -127,7 +127,7 @@ public function addLinkRel($rel, $href) * @param string|bool $before If true insert before the $referenceName instead of after * @return $this */ - public function addItem($type, $name, $params = null, $if = null, $cond = null, $referenceName = "*", $before = false) + public function addItem($type, $name, $params = null, $if = null, $cond = null, $referenceName = '*', $before = false) { // allow skipping of parameters in the layout XML files via empty-string if ($params === '') { @@ -547,6 +547,9 @@ protected function _isFile($filename) */ protected function _sortItems($referenceName, $before, $type) { + // Convert string values ("true"/"false") to bool + $before = filter_var($before, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE); + $items = $this->_data['items']; // get newly inserted item so we do not have to reproduce the functionality of the parent diff --git a/app/code/core/Mage/Payment/Block/Form/Cc.php b/app/code/core/Mage/Payment/Block/Form/Cc.php index 08a12b4c037..8abf0b5a733 100644 --- a/app/code/core/Mage/Payment/Block/Form/Cc.php +++ b/app/code/core/Mage/Payment/Block/Form/Cc.php @@ -132,7 +132,7 @@ public function hasSsCardType() public function getSsStartYears() { $years = []; - $first = date("Y"); + $first = date('Y'); for ($index = 5; $index >= 0; $index--) { $year = $first - $index; diff --git a/app/code/core/Mage/Payment/Model/Config.php b/app/code/core/Mage/Payment/Model/Config.php index 44a1a96d422..85ba523dd0f 100644 --- a/app/code/core/Mage/Payment/Model/Config.php +++ b/app/code/core/Mage/Payment/Model/Config.php @@ -134,7 +134,7 @@ public function getMonths() public function getYears() { $years = []; - $first = date("Y"); + $first = date('Y'); for ($index = 0; $index <= 10; $index++) { $year = $first + $index; diff --git a/app/code/core/Mage/Paypal/Model/Config.php b/app/code/core/Mage/Paypal/Model/Config.php index af3cb556d9c..d7c558f4bad 100644 --- a/app/code/core/Mage/Paypal/Model/Config.php +++ b/app/code/core/Mage/Paypal/Model/Config.php @@ -784,7 +784,7 @@ public function __get($key) return $this->_config[$key]; } - $underscored = strtolower(preg_replace('/(.)([A-Z])/', "$1_$2", $key)); + $underscored = strtolower(preg_replace('/(.)([A-Z])/', '$1_$2', $key)); if (array_key_exists($underscored, $this->_config)) { return $this->_config[$underscored]; } @@ -1305,7 +1305,7 @@ public function getAdditionalOptionsLogoUrl($localeCode, $type = false) */ public function getBuildNotationCode() { - return Mage::getStoreConfig("paypal/bncode", $this->_storeId); + return Mage::getStoreConfig('paypal/bncode', $this->_storeId); } /** @@ -1745,7 +1745,7 @@ protected function _mapBmlFieldset($fieldName) { switch ($fieldName) { case 'allow_ba_signup': - return "payment/" . self::METHOD_WPP_EXPRESS . "/{$fieldName}"; + return 'payment/' . self::METHOD_WPP_EXPRESS . "/{$fieldName}"; default: return $this->_mapExpressFieldset($fieldName); } @@ -1761,7 +1761,7 @@ protected function _mapBmlUkFieldset($fieldName) { switch ($fieldName) { case 'allow_ba_signup': - return "payment/" . self::METHOD_WPP_PE_EXPRESS . "/{$fieldName}"; + return 'payment/' . self::METHOD_WPP_PE_EXPRESS . "/{$fieldName}"; default: return $this->_mapExpressFieldset($fieldName); } diff --git a/app/code/core/Mage/Paypal/Model/Hostedpro.php b/app/code/core/Mage/Paypal/Model/Hostedpro.php index 2cf89676411..23ea50542fd 100644 --- a/app/code/core/Mage/Paypal/Model/Hostedpro.php +++ b/app/code/core/Mage/Paypal/Model/Hostedpro.php @@ -248,8 +248,8 @@ protected function _getUrl($path, $storeId, $secure = null) { $store = Mage::app()->getStore($storeId); return Mage::getUrl($path, [ - "_store" => $store, - "_secure" => is_null($secure) ? $store->isCurrentlySecure() : $secure + '_store' => $store, + '_secure' => is_null($secure) ? $store->isCurrentlySecure() : $secure ]); } } diff --git a/app/code/core/Mage/Paypal/Model/Payflow/Request.php b/app/code/core/Mage/Paypal/Model/Payflow/Request.php index b7a8494abc3..56b8f9cf305 100644 --- a/app/code/core/Mage/Paypal/Model/Payflow/Request.php +++ b/app/code/core/Mage/Paypal/Model/Payflow/Request.php @@ -48,6 +48,6 @@ public function __call($method, $args) case 'has': return isset($this->_data[$key]); } - throw new Varien_Exception("Invalid method " . get_class($this) . "::" . $method . "(" . print_r($args, 1) . ")"); + throw new Varien_Exception('Invalid method ' . get_class($this) . '::' . $method . '(' . print_r($args, 1) . ')'); } } diff --git a/app/code/core/Mage/Paypal/Model/Report/Settlement.php b/app/code/core/Mage/Paypal/Model/Report/Settlement.php index 250df5dfa48..fca1da12888 100644 --- a/app/code/core/Mage/Paypal/Model/Report/Settlement.php +++ b/app/code/core/Mage/Paypal/Model/Report/Settlement.php @@ -39,31 +39,31 @@ class Mage_Paypal_Model_Report_Settlement extends Mage_Core_Model_Abstract * Default PayPal SFTP host * @var string */ - public const REPORTS_HOSTNAME = "reports.paypal.com"; + public const REPORTS_HOSTNAME = 'reports.paypal.com'; /** * Default PayPal SFTP host for sandbox mode * @var string */ - public const SANDBOX_REPORTS_HOSTNAME = "reports.sandbox.paypal.com"; + public const SANDBOX_REPORTS_HOSTNAME = 'reports.sandbox.paypal.com'; /** * PayPal SFTP path * @var string */ - public const REPORTS_PATH = "/ppreports/outgoing"; + public const REPORTS_PATH = '/ppreports/outgoing'; /** * Original charset of old report files * @var string */ - public const FILES_IN_CHARSET = "UTF-16"; + public const FILES_IN_CHARSET = 'UTF-16'; /** * Target charset of report files to be parsed * @var string */ - public const FILES_OUT_CHARSET = "UTF-8"; + public const FILES_OUT_CHARSET = 'UTF-8'; /** * Reports rows storage diff --git a/app/code/core/Mage/Paypal/Model/Resource/Payment/Transaction/Collection.php b/app/code/core/Mage/Paypal/Model/Resource/Payment/Transaction/Collection.php index 51d5a8fac62..d4bf134aba7 100644 --- a/app/code/core/Mage/Paypal/Model/Resource/Payment/Transaction/Collection.php +++ b/app/code/core/Mage/Paypal/Model/Resource/Payment/Transaction/Collection.php @@ -27,7 +27,7 @@ class Mage_Paypal_Model_Resource_Payment_Transaction_Collection extends Mage_Cor * * @var string */ - protected $_createdBefore = ""; + protected $_createdBefore = ''; /** * Initialize collection items factory class */ diff --git a/app/code/core/Mage/Paypal/Model/System/Config/Source/FetchingSchedule.php b/app/code/core/Mage/Paypal/Model/System/Config/Source/FetchingSchedule.php index e4079b0d7bd..f8591fb3f1f 100644 --- a/app/code/core/Mage/Paypal/Model/System/Config/Source/FetchingSchedule.php +++ b/app/code/core/Mage/Paypal/Model/System/Config/Source/FetchingSchedule.php @@ -24,13 +24,13 @@ class Mage_Paypal_Model_System_Config_Source_FetchingSchedule public function toOptionArray() { return [ - 1 => Mage::helper('paypal')->__("Daily"), - 3 => Mage::helper('paypal')->__("Every 3 days"), - 7 => Mage::helper('paypal')->__("Every 7 days"), - 10 => Mage::helper('paypal')->__("Every 10 days"), - 14 => Mage::helper('paypal')->__("Every 14 days"), - 30 => Mage::helper('paypal')->__("Every 30 days"), - 40 => Mage::helper('paypal')->__("Every 40 days"), + 1 => Mage::helper('paypal')->__('Daily'), + 3 => Mage::helper('paypal')->__('Every 3 days'), + 7 => Mage::helper('paypal')->__('Every 7 days'), + 10 => Mage::helper('paypal')->__('Every 10 days'), + 14 => Mage::helper('paypal')->__('Every 14 days'), + 30 => Mage::helper('paypal')->__('Every 30 days'), + 40 => Mage::helper('paypal')->__('Every 40 days'), ]; } } diff --git a/app/code/core/Mage/Rating/Model/Resource/Rating.php b/app/code/core/Mage/Rating/Model/Resource/Rating.php index e62d8b650b3..04accb0f1ce 100644 --- a/app/code/core/Mage/Rating/Model/Resource/Rating.php +++ b/app/code/core/Mage/Rating/Model/Resource/Rating.php @@ -300,7 +300,7 @@ protected function _getEntitySummaryData($object) { $adapter = $this->_getReadAdapter(); $sumColumn = new Zend_Db_Expr("SUM(rating_vote.{$adapter->quoteIdentifier('percent')})"); - $countColumn = new Zend_Db_Expr("COUNT(*)"); + $countColumn = new Zend_Db_Expr('COUNT(*)'); $select = $adapter->select() ->from( diff --git a/app/code/core/Mage/Rating/Model/Resource/Rating/Option/Vote/Collection.php b/app/code/core/Mage/Rating/Model/Resource/Rating/Option/Vote/Collection.php index 060ee5a37bd..8eb345ab13a 100644 --- a/app/code/core/Mage/Rating/Model/Resource/Rating/Option/Vote/Collection.php +++ b/app/code/core/Mage/Rating/Model/Resource/Rating/Option/Vote/Collection.php @@ -41,7 +41,7 @@ protected function _construct() public function setReviewFilter($reviewId) { $this->getSelect() - ->where("main_table.review_id = ?", $reviewId); + ->where('main_table.review_id = ?', $reviewId); return $this; } @@ -54,7 +54,7 @@ public function setReviewFilter($reviewId) public function setEntityPkFilter($entityId) { $this->getSelect() - ->where("entity_pk_value = ?", $entityId); + ->where('entity_pk_value = ?', $entityId); return $this; } diff --git a/app/code/core/Mage/Reports/Helper/Data.php b/app/code/core/Mage/Reports/Helper/Data.php index 57ea227933b..9d3b969bb0e 100644 --- a/app/code/core/Mage/Reports/Helper/Data.php +++ b/app/code/core/Mage/Reports/Helper/Data.php @@ -60,11 +60,11 @@ public function getIntervals($from, $to, $period = self::REPORT_PERIOD_TYPE_DAY) } if ($period == self::REPORT_PERIOD_TYPE_MONTH) { - $dateStart = new Zend_Date(date("Y-m", $start->getTimestamp()), Varien_Date::DATE_INTERNAL_FORMAT); + $dateStart = new Zend_Date(date('Y-m', $start->getTimestamp()), Varien_Date::DATE_INTERNAL_FORMAT); } if ($period == self::REPORT_PERIOD_TYPE_YEAR) { - $dateStart = new Zend_Date(date("Y", $start->getTimestamp()), Varien_Date::DATE_INTERNAL_FORMAT); + $dateStart = new Zend_Date(date('Y', $start->getTimestamp()), Varien_Date::DATE_INTERNAL_FORMAT); } $dateEnd = new Zend_Date($to, Varien_Date::DATE_INTERNAL_FORMAT); diff --git a/app/code/core/Mage/Reports/Model/Resource/Customer/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Customer/Collection.php index bf2cfb8cf57..9cf8ed63411 100644 --- a/app/code/core/Mage/Reports/Model/Resource/Customer/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Customer/Collection.php @@ -115,7 +115,7 @@ public function joinOrders($from = '', $to = '') $this->getSelect() ->joinLeft( ['orders' => $this->getTable('sales/order')], - "orders.customer_id = e.entity_id" . $dateFilter, + 'orders.customer_id = e.entity_id' . $dateFilter, [] ); @@ -130,9 +130,9 @@ public function joinOrders($from = '', $to = '') public function addOrdersCount() { $this->getSelect() - ->columns(["orders_count" => "COUNT(orders.entity_id)"]) + ->columns(['orders_count' => 'COUNT(orders.entity_id)']) ->where('orders.state <> ?', Mage_Sales_Model_Order::STATE_CANCELED) - ->group("e.entity_id"); + ->group('e.entity_id'); return $this; } @@ -158,8 +158,8 @@ public function addSumAvgTotals($storeId = 0) : "orders.base_subtotal - {$baseSubtotalCanceled} - {$baseSubtotalRefunded}"; $this->getSelect() - ->columns(["orders_avg_amount" => "AVG({$expr})"]) - ->columns(["orders_sum_amount" => "SUM({$expr})"]); + ->columns(['orders_avg_amount' => "AVG({$expr})"]) + ->columns(['orders_sum_amount' => "SUM({$expr})"]); return $this; } @@ -271,7 +271,7 @@ public function getSelectCountSql() $countSelect->reset(Zend_Db_Select::COLUMNS); $countSelect->reset(Zend_Db_Select::GROUP); $countSelect->reset(Zend_Db_Select::HAVING); - $countSelect->columns("count(DISTINCT e.entity_id)"); + $countSelect->columns('count(DISTINCT e.entity_id)'); return $countSelect; } diff --git a/app/code/core/Mage/Reports/Model/Resource/Entity/Summary/Collection/Abstract.php b/app/code/core/Mage/Reports/Model/Resource/Entity/Summary/Collection/Abstract.php index a74fcccafe3..252ca5549ef 100644 --- a/app/code/core/Mage/Reports/Model/Resource/Entity/Summary/Collection/Abstract.php +++ b/app/code/core/Mage/Reports/Model/Resource/Entity/Summary/Collection/Abstract.php @@ -39,22 +39,22 @@ class Mage_Reports_Model_Resource_Entity_Summary_Collection_Abstract extends Var public function setSelectPeriod($periodType, $customStart = null, $customEnd = null) { switch ($periodType) { - case "24h": + case '24h': $customStart = Varien_Date::toTimestamp(true) - 86400; $customEnd = Varien_Date::toTimestamp(true); break; - case "7d": + case '7d': $customStart = Varien_Date::toTimestamp(true) - 604800; $customEnd = Varien_Date::toTimestamp(true); break; - case "30d": + case '30d': $customStart = Varien_Date::toTimestamp(true) - 2592000; $customEnd = Varien_Date::toTimestamp(true); break; - case "1y": + case '1y': $customStart = Varien_Date::toTimestamp(true) - 31536000; $customEnd = Varien_Date::toTimestamp(true); break; diff --git a/app/code/core/Mage/Reports/Model/Resource/Invoiced/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Invoiced/Collection.php index 625fc7c76db..35d50f2f686 100644 --- a/app/code/core/Mage/Reports/Model/Resource/Invoiced/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Invoiced/Collection.php @@ -116,7 +116,7 @@ public function getSelectCountSql() $countSelect->reset(Zend_Db_Select::COLUMNS); $countSelect->reset(Zend_Db_Select::GROUP); $countSelect->reset(Zend_Db_Select::HAVING); - $countSelect->columns("COUNT(*)"); + $countSelect->columns('COUNT(*)'); return $countSelect; } diff --git a/app/code/core/Mage/Reports/Model/Resource/Order/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Order/Collection.php index 19a497d3e06..3bc2d3d57b3 100644 --- a/app/code/core/Mage/Reports/Model/Resource/Order/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Order/Collection.php @@ -772,7 +772,7 @@ public function getSelectCountSql() $countSelect->reset(Zend_Db_Select::COLUMNS); $countSelect->reset(Zend_Db_Select::GROUP); $countSelect->reset(Zend_Db_Select::HAVING); - $countSelect->columns("COUNT(DISTINCT main_table.entity_id)"); + $countSelect->columns('COUNT(DISTINCT main_table.entity_id)'); return $countSelect; } diff --git a/app/code/core/Mage/Reports/Model/Resource/Product/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Product/Collection.php index c56128c2c79..c2da53b10d7 100644 --- a/app/code/core/Mage/Reports/Model/Resource/Product/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Product/Collection.php @@ -185,7 +185,7 @@ public function getSelectCountSql() $countSelect->reset(Zend_Db_Select::COLUMNS); $countSelect->reset(Zend_Db_Select::GROUP); $countSelect->reset(Zend_Db_Select::HAVING); - $countSelect->columns("count(DISTINCT e.entity_id)"); + $countSelect->columns('count(DISTINCT e.entity_id)'); return $countSelect; } @@ -206,10 +206,10 @@ public function addCartsCount() 'quotes.entity_id = quote_items.quote_id AND quotes.is_active = 1', [] ) - ->where("quote_items.product_id = e.entity_id"); + ->where('quote_items.product_id = e.entity_id'); $this->getSelect() - ->columns(["carts" => "({$countSelect})"]) + ->columns(['carts' => "({$countSelect})"]) ->group("e.{$this->getProductEntityId()}") ->having('carts > ?', 0); @@ -361,7 +361,7 @@ public function addViewsCount($from = '', $to = '') ->join( ['e' => $this->getProductEntityTableName()], $this->getConnection()->quoteInto( - "e.entity_id = report_table_views.object_id AND e.entity_type_id = ?", + 'e.entity_id = report_table_views.object_id AND e.entity_type_id = ?', $this->getProductEntityTypeId() ) ) diff --git a/app/code/core/Mage/Reports/Model/Resource/Quote/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Quote/Collection.php index 8c28b459bed..2ac7a6c8289 100644 --- a/app/code/core/Mage/Reports/Model/Resource/Quote/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Quote/Collection.php @@ -288,9 +288,9 @@ public function getSelectCountSql() $countSelect->resetJoinLeft(); if ($this->_selectCountSqlType == self::SELECT_COUNT_SQL_TYPE_CART) { - $countSelect->columns("COUNT(DISTINCT e.entity_id)"); + $countSelect->columns('COUNT(DISTINCT e.entity_id)'); } else { - $countSelect->columns("COUNT(DISTINCT main_table.entity_id)"); + $countSelect->columns('COUNT(DISTINCT main_table.entity_id)'); } return $countSelect; diff --git a/app/code/core/Mage/Reports/Model/Resource/Report/Abstract.php b/app/code/core/Mage/Reports/Model/Resource/Report/Abstract.php index 3ac56d8df51..92aa5cab177 100644 --- a/app/code/core/Mage/Reports/Model/Resource/Report/Abstract.php +++ b/app/code/core/Mage/Reports/Model/Resource/Report/Abstract.php @@ -371,7 +371,7 @@ public function getStoreTZOffsetQuery($table, $column, $from = null, $to = null, return $column; } - $query = ""; + $query = ''; $periodsCount = count($periods); $i = 0; @@ -384,7 +384,7 @@ public function getStoreTZOffsetQuery($table, $column, $from = null, $to = null, $then = $this->_getWriteAdapter() ->getDateAddSql($column, $offset, Varien_Db_Adapter_Interface::INTERVAL_SECOND); - $query .= (++$i == $periodsCount) ? $then : "CASE WHEN " . implode(" OR ", $subParts) . " THEN $then ELSE "; + $query .= (++$i == $periodsCount) ? $then : 'CASE WHEN ' . implode(' OR ', $subParts) . " THEN $then ELSE "; } return $query . str_repeat('END ', count($periods) - 1); diff --git a/app/code/core/Mage/Reports/Model/Resource/Review/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Review/Collection.php index cfa8baa3ca1..4b36f9ec023 100644 --- a/app/code/core/Mage/Reports/Model/Resource/Review/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Review/Collection.php @@ -61,7 +61,7 @@ public function getSelectCountSql() $countSelect->reset(Zend_Db_Select::LIMIT_COUNT); $countSelect->reset(Zend_Db_Select::LIMIT_OFFSET); $countSelect->reset(Zend_Db_Select::COLUMNS); - $countSelect->columns("COUNT(main_table.review_id)"); + $countSelect->columns('COUNT(main_table.review_id)'); return $countSelect; } diff --git a/app/code/core/Mage/Reports/Model/Resource/Review/Product/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Review/Product/Collection.php index 3d572772377..bc3c522d55f 100644 --- a/app/code/core/Mage/Reports/Model/Resource/Review/Product/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Review/Product/Collection.php @@ -111,7 +111,7 @@ public function getSelectCountSql() $countSelect = clone $select; $countSelect->reset(); - $countSelect->from($select, "COUNT(*)"); + $countSelect->from($select, 'COUNT(*)'); return $countSelect; } diff --git a/app/code/core/Mage/Reports/Model/Resource/Tag/Customer/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Tag/Customer/Collection.php index 2028bd551ba..18a52825887 100644 --- a/app/code/core/Mage/Reports/Model/Resource/Tag/Customer/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Tag/Customer/Collection.php @@ -51,7 +51,7 @@ public function getSelectCountSql() $countSelect->reset(Zend_Db_Select::LIMIT_COUNT); $countSelect->reset(Zend_Db_Select::LIMIT_OFFSET); $countSelect->reset(Zend_Db_Select::COLUMNS); - $countSelect->columns("COUNT(DISTINCT tr.customer_id)"); + $countSelect->columns('COUNT(DISTINCT tr.customer_id)'); return $countSelect; } diff --git a/app/code/core/Mage/Reports/Model/Resource/Tax/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Tax/Collection.php index 15f438aed82..1a0a59a76c4 100644 --- a/app/code/core/Mage/Reports/Model/Resource/Tax/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Tax/Collection.php @@ -96,7 +96,7 @@ public function getSelectCountSql() $countSelect->reset(Zend_Db_Select::COLUMNS); $countSelect->reset(Zend_Db_Select::GROUP); $countSelect->reset(Zend_Db_Select::HAVING); - $countSelect->columns("COUNT(DISTINCT e.entity_id)"); + $countSelect->columns('COUNT(DISTINCT e.entity_id)'); return $countSelect; } } diff --git a/app/code/core/Mage/Reports/Model/Resource/Wishlist/Product/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Wishlist/Product/Collection.php index fd6ca60dd34..36dd6c98241 100644 --- a/app/code/core/Mage/Reports/Model/Resource/Wishlist/Product/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Wishlist/Product/Collection.php @@ -83,7 +83,7 @@ public function getSelectCountSql() $countSelect->reset(Zend_Db_Select::LIMIT_OFFSET); $countSelect->reset(Zend_Db_Select::GROUP); $countSelect->reset(Zend_Db_Select::COLUMNS); - $countSelect->columns("COUNT(*)"); + $countSelect->columns('COUNT(*)'); return $countSelect; } diff --git a/app/code/core/Mage/Reports/Model/Test.php b/app/code/core/Mage/Reports/Model/Test.php index b5196abfceb..3148f231b21 100644 --- a/app/code/core/Mage/Reports/Model/Test.php +++ b/app/code/core/Mage/Reports/Model/Test.php @@ -83,11 +83,11 @@ public function getAllLinearExample() $allData = []; $countOfStartData = 12; for ($i = 1; $i <= $countOfStartData; $i++) { - $allData[] = ['time' => date("Y-m-d H:i", $startPoint), 'value' => rand(1, 100)]; + $allData[] = ['time' => date('Y-m-d H:i', $startPoint), 'value' => rand(1, 100)]; $startPoint += 30 * 60; } - $allData[] = ['time' => date("Y-m-d H:i", $startPoint + (90 * 60))]; + $allData[] = ['time' => date('Y-m-d H:i', $startPoint + (90 * 60))]; $session -> setData('startPoint', $startPoint); @@ -106,11 +106,11 @@ public function getNewLinearData() $reset = 12; $newData = [ - ['time' => date("Y-m-d H:i", $startPoint), 'value' => rand(1, 100)] + ['time' => date('Y-m-d H:i', $startPoint), 'value' => rand(1, 100)] ]; $startPoint += 30 * 60; - $newData[] = ['time' => date("Y-m-d H:i", $startPoint + (90 * 60))]; + $newData[] = ['time' => date('Y-m-d H:i', $startPoint + (90 * 60))]; $session->setData('startPoint', $startPoint); @@ -126,10 +126,10 @@ private function returnAsDataSource(&$array, $reset = 0) { $dom = new DOMDocument(); $dom -> preserveWhiteSpace = false; - $dom -> loadXML("<" . "?xml version=\"1.0\" encoding=\"UTF-8\"?" . ">\n"); + $dom -> loadXML('<' . '?xml version="1.0" encoding="UTF-8"?' . ">\n"); $root = $dom ->documentElement; if ($reset) { - $resetItem = $dom -> createElement("reset"); + $resetItem = $dom -> createElement('reset'); $resetItem -> nodeValue = $reset; $root->appendChild($resetItem); } diff --git a/app/code/core/Mage/Reports/Model/Totals.php b/app/code/core/Mage/Reports/Model/Totals.php index 6b98422fdee..e4181308677 100644 --- a/app/code/core/Mage/Reports/Model/Totals.php +++ b/app/code/core/Mage/Reports/Model/Totals.php @@ -36,7 +36,7 @@ public function countTotals($grid, $from, $to) if ($col->getTotal() === null) { continue; } - $columns[$col->getIndex()] = ["total" => $col->getTotal(), "value" => 0]; + $columns[$col->getIndex()] = ['total' => $col->getTotal(), 'value' => 0]; } $count = 0; diff --git a/app/code/core/Mage/Review/Model/Resource/Review.php b/app/code/core/Mage/Review/Model/Resource/Review.php index fae7c100218..f04dd65e16f 100644 --- a/app/code/core/Mage/Review/Model/Resource/Review.php +++ b/app/code/core/Mage/Review/Model/Resource/Review.php @@ -147,7 +147,7 @@ protected function _afterSave(Mage_Core_Model_Abstract $object) $detailId = $adapter->fetchOne($select, [':review_id' => $object->getId()]); if ($detailId) { - $condition = ["detail_id = ?" => $detailId]; + $condition = ['detail_id = ?' => $detailId]; $adapter->update($this->_reviewDetailTable, $detail, $condition); } else { $detail['store_id'] = $object->getStoreId(); @@ -242,8 +242,8 @@ public function afterDeleteCommit(Mage_Core_Model_Abstract $object) 'review_count' => new Zend_Db_Expr('COUNT(*)') ] ) - ->where("entity_id = ?", $object->getEntityId()) - ->where("entity_pk_value = ?", $object->getEntityPkValue()); + ->where('entity_id = ?', $object->getEntityId()) + ->where('entity_pk_value = ?', $object->getEntityPkValue()); $total_reviews = $read_adapter->fetchOne($select); if ($total_reviews == 0) { $this->_getWriteAdapter()->delete($this->_aggregateTable, [ diff --git a/app/code/core/Mage/Rule/Model/Action/Abstract.php b/app/code/core/Mage/Rule/Model/Action/Abstract.php index d8cb87fb7f4..ce3b7befe28 100644 --- a/app/code/core/Mage/Rule/Model/Action/Abstract.php +++ b/app/code/core/Mage/Rule/Model/Action/Abstract.php @@ -89,10 +89,10 @@ public function asArray(array $arrAttributes = []) */ public function asXml() { - return "" . $this->getType() . "" - . "" . $this->getAttribute() . "" - . "" . $this->getOperator() . "" - . "" . $this->getValue() . ""; + return '' . $this->getType() . '' + . '' . $this->getAttribute() . '' + . '' . $this->getOperator() . '' + . '' . $this->getValue() . ''; } /** @@ -313,7 +313,7 @@ public function getRemoveLinkHtml() */ public function asString($format = '') { - return ""; + return ''; } /** diff --git a/app/code/core/Mage/Rule/Model/Action/Collection.php b/app/code/core/Mage/Rule/Model/Action/Collection.php index 20ee2500c0f..5e0322669dd 100644 --- a/app/code/core/Mage/Rule/Model/Action/Collection.php +++ b/app/code/core/Mage/Rule/Model/Action/Collection.php @@ -136,7 +136,7 @@ public function asHtmlRecursive() */ public function asString($format = '') { - return Mage::helper('rule')->__("Perform following actions"); + return Mage::helper('rule')->__('Perform following actions'); } /** diff --git a/app/code/core/Mage/Rule/Model/Condition/Combine.php b/app/code/core/Mage/Rule/Model/Condition/Combine.php index 1d9b0093d13..3c856176cdf 100644 --- a/app/code/core/Mage/Rule/Model/Condition/Combine.php +++ b/app/code/core/Mage/Rule/Model/Condition/Combine.php @@ -51,7 +51,7 @@ public function prepareConditionSql() if (empty($wheres)) { return ''; } - $delimiter = $this->getAggregator() == "all" ? ' AND ' : ' OR '; + $delimiter = $this->getAggregator() == 'all' ? ' AND ' : ' OR '; return ' (' . implode($delimiter, $wheres) . ') '; } @@ -232,8 +232,8 @@ public function asArray(array $arrAttributes = []) */ public function asXml($containerKey = 'conditions', $itemKey = 'condition') { - $xml = "" . $this->getAggregator() . "" - . "" . $this->getValue() . "" + $xml = '' . $this->getAggregator() . '' + . '' . $this->getValue() . '' . "<$containerKey>"; foreach ($this->getConditions() as $condition) { $xml .= "<$itemKey>" . $condition->asXml() . ""; @@ -329,7 +329,7 @@ public function asHtmlRecursive() */ public function asString($format = '') { - return Mage::helper('rule')->__("If %s of these conditions are %s:", $this->getAggregatorName(), $this->getValueName()); + return Mage::helper('rule')->__('If %s of these conditions are %s:', $this->getAggregatorName(), $this->getValueName()); } /** diff --git a/app/code/core/Mage/Sales/Block/Order/Email/Items/Default.php b/app/code/core/Mage/Sales/Block/Order/Email/Items/Default.php index 91a17e15b7f..3588c522507 100644 --- a/app/code/core/Mage/Sales/Block/Order/Email/Items/Default.php +++ b/app/code/core/Mage/Sales/Block/Order/Email/Items/Default.php @@ -59,7 +59,7 @@ public function getItemOptions() public function getValueHtml($value) { if (is_array($value)) { - return sprintf('%d', $value['qty']) . ' x ' . $this->escapeHtml($value['title']) . " " + return sprintf('%d', $value['qty']) . ' x ' . $this->escapeHtml($value['title']) . ' ' . $this->getItem()->getOrder()->formatPrice($value['price']); } else { return $this->escapeHtml($value); diff --git a/app/code/core/Mage/Sales/Block/Order/Email/Items/Order/Default.php b/app/code/core/Mage/Sales/Block/Order/Email/Items/Order/Default.php index 2b52c125759..fc76f78481b 100644 --- a/app/code/core/Mage/Sales/Block/Order/Email/Items/Order/Default.php +++ b/app/code/core/Mage/Sales/Block/Order/Email/Items/Order/Default.php @@ -59,7 +59,7 @@ public function getItemOptions() public function getValueHtml($value) { if (is_array($value)) { - return sprintf('%d', $value['qty']) . ' x ' . $this->escapeHtml($value['title']) . " " + return sprintf('%d', $value['qty']) . ' x ' . $this->escapeHtml($value['title']) . ' ' . $this->getItem()->getOrder()->formatPrice($value['price']); } else { return $this->escapeHtml($value); diff --git a/app/code/core/Mage/Sales/Model/Observer.php b/app/code/core/Mage/Sales/Model/Observer.php index 9fd3f68e2df..0be7dd2ac34 100644 --- a/app/code/core/Mage/Sales/Model/Observer.php +++ b/app/code/core/Mage/Sales/Model/Observer.php @@ -111,7 +111,7 @@ public function markQuotesRecollectOnCatalogRules(Varien_Event_Observer $observe $product = $observer->getEvent()->getProduct(); if (is_numeric($product)) { - $product = Mage::getModel("catalog/product")->load($product); + $product = Mage::getModel('catalog/product')->load($product); } if ($product instanceof Mage_Catalog_Model_Product) { $childrenProductList = Mage::getSingleton('catalog/product_type')->factory($product) diff --git a/app/code/core/Mage/Sales/Model/Order/Api.php b/app/code/core/Mage/Sales/Model/Order/Api.php index f8d97f13fdb..9bbf7d519c0 100644 --- a/app/code/core/Mage/Sales/Model/Order/Api.php +++ b/app/code/core/Mage/Sales/Model/Order/Api.php @@ -68,7 +68,7 @@ public function items($filters = null) $billingAliasName = 'billing_o_a'; $shippingAliasName = 'shipping_o_a'; - $orderCollection = Mage::getModel("sales/order")->getCollection(); + $orderCollection = Mage::getModel('sales/order')->getCollection(); $billingFirstnameField = "$billingAliasName.firstname"; $billingLastnameField = "$billingAliasName.lastname"; $shippingFirstnameField = "$shippingAliasName.firstname"; @@ -77,22 +77,22 @@ public function items($filters = null) ->addAddressFields() ->addExpressionFieldToSelect( 'billing_firstname', - "{{billing_firstname}}", + '{{billing_firstname}}', ['billing_firstname' => $billingFirstnameField] ) ->addExpressionFieldToSelect( 'billing_lastname', - "{{billing_lastname}}", + '{{billing_lastname}}', ['billing_lastname' => $billingLastnameField] ) ->addExpressionFieldToSelect( 'shipping_firstname', - "{{shipping_firstname}}", + '{{shipping_firstname}}', ['shipping_firstname' => $shippingFirstnameField] ) ->addExpressionFieldToSelect( 'shipping_lastname', - "{{shipping_lastname}}", + '{{shipping_lastname}}', ['shipping_lastname' => $shippingLastnameField] ) ->addExpressionFieldToSelect( diff --git a/app/code/core/Mage/Sales/Model/Order/Config.php b/app/code/core/Mage/Sales/Model/Order/Config.php index e30b9714775..44f2076cc25 100644 --- a/app/code/core/Mage/Sales/Model/Order/Config.php +++ b/app/code/core/Mage/Sales/Model/Order/Config.php @@ -153,7 +153,7 @@ public function getStates() public function getStateStatuses($state, $addLabels = true) { if (is_array($state)) { - $key = implode("|", $state) . $addLabels; + $key = implode('|', $state) . $addLabels; } else { $key = $state . $addLabels; } diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice/Item.php b/app/code/core/Mage/Sales/Model/Order/Invoice/Item.php index f88b39f3d28..dccf8f37865 100644 --- a/app/code/core/Mage/Sales/Model/Order/Invoice/Item.php +++ b/app/code/core/Mage/Sales/Model/Order/Invoice/Item.php @@ -190,8 +190,8 @@ public function setQty($qty) /** * Check qty availability */ - $qtyToInvoice = sprintf("%F", $this->getOrderItem()->getQtyToInvoice()); - $qty = sprintf("%F", $qty); + $qtyToInvoice = sprintf('%F', $this->getOrderItem()->getQtyToInvoice()); + $qty = sprintf('%F', $qty); if ($qty <= $qtyToInvoice || $this->getOrderItem()->isDummy()) { $this->setData('qty', $qty); } else { diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php index cc54947be8d..be3bd15544d 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php @@ -366,7 +366,7 @@ protected function insertOrder(&$page, $obj, $putOrderId = true) if (!$order->getIsVirtual()) { $this->y = $addressesStartY; - if (isset($shippingAddress) and is_iterable($shippingAddress)) { + if (isset($shippingAddress) && is_iterable($shippingAddress)) { foreach ($shippingAddress as $value) { if ($value !== '') { $text = []; @@ -438,8 +438,8 @@ protected function insertOrder(&$page, $obj, $putOrderId = true) } $yShipments = $this->y; - $totalShippingChargesText = "(" . Mage::helper('sales')->__('Total Shipping Charges') . " " - . $order->formatPriceTxt($order->getShippingAmount()) . ")"; + $totalShippingChargesText = '(' . Mage::helper('sales')->__('Total Shipping Charges') . ' ' + . $order->formatPriceTxt($order->getShippingAmount()) . ')'; $page->drawText($totalShippingChargesText, 285, $yShipments - $topMargin, 'UTF-8'); $yShipments -= $topMargin + 10; @@ -663,7 +663,7 @@ protected function _formatOptionValue($value, $order) $resultValue .= $value['title']; if (isset($value['price'])) { - $resultValue .= " " . $order->formatPrice($value['price']); + $resultValue .= ' ' . $order->formatPrice($value['price']); } return $resultValue; } else { diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Abstract.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Abstract.php index 7f76f850a57..79dd95e47eb 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Abstract.php @@ -211,7 +211,7 @@ protected function _formatOptionValue($value) $resultValue .= $value['title']; if (isset($value['price'])) { - $resultValue .= " " . $order->formatPrice($value['price']); + $resultValue .= ' ' . $order->formatPrice($value['price']); } return $resultValue; } else { diff --git a/app/code/core/Mage/Sales/Model/Recurring/Profile.php b/app/code/core/Mage/Sales/Model/Recurring/Profile.php index e6c8c5895cf..fa81c529470 100644 --- a/app/code/core/Mage/Sales/Model/Recurring/Profile.php +++ b/app/code/core/Mage/Sales/Model/Recurring/Profile.php @@ -639,7 +639,7 @@ protected function _getItem($itemInfo) { $paymentType = $itemInfo->getPaymentType(); if (!$paymentType) { - throw new Exception("Recurring profile payment type is not specified."); + throw new Exception('Recurring profile payment type is not specified.'); } switch ($paymentType) { diff --git a/app/code/core/Mage/Sales/Model/Resource/Order.php b/app/code/core/Mage/Sales/Model/Resource/Order.php index cb853aa8d38..9adad48e276 100644 --- a/app/code/core/Mage/Sales/Model/Resource/Order.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order.php @@ -136,7 +136,7 @@ public function getIncrementId($orderId) $adapter = $this->getReadConnection(); $bind = [':entity_id' => $orderId]; $select = $adapter->select() - ->from($this->getMainTable(), ["increment_id"]) + ->from($this->getMainTable(), ['increment_id']) ->where('entity_id = :entity_id'); return $adapter->fetchOne($select, $bind); } diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Item/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Item/Collection.php index ddf9a89208a..98de0296819 100644 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Item/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Item/Collection.php @@ -129,7 +129,7 @@ public function filterByParent($parentId = null) public function addAvailableFilter() { $fieldExpression = '(qty_shipped - qty_returned)'; - $resultCondition = $this->_getConditionSql($fieldExpression, ["gt" => 0]); + $resultCondition = $this->_getConditionSql($fieldExpression, ['gt' => 0]); $this->getSelect()->where($resultCondition); return $this; } diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Invoiced/Collection/Order.php b/app/code/core/Mage/Sales/Model/Resource/Report/Invoiced/Collection/Order.php index ee7b289e758..9f9e8662e5a 100644 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Invoiced/Collection/Order.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Invoiced/Collection/Order.php @@ -24,7 +24,7 @@ class Mage_Sales_Model_Resource_Report_Invoiced_Collection_Order extends Mage_Sa /** * Period format * - * @var string + * @var Zend_Db_Expr */ protected $_periodFormat; diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Order/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Report/Order/Collection.php index 4e49fec48cc..6810a3b9029 100644 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Order/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Order/Collection.php @@ -24,7 +24,7 @@ class Mage_Sales_Model_Resource_Report_Order_Collection extends Mage_Sales_Model /** * Period format * - * @var string + * @var Zend_Db_Expr */ protected $_periodFormat; diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Refunded/Collection/Order.php b/app/code/core/Mage/Sales/Model/Resource/Report/Refunded/Collection/Order.php index 0e568ccf98b..1872af34d95 100644 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Refunded/Collection/Order.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Refunded/Collection/Order.php @@ -24,7 +24,7 @@ class Mage_Sales_Model_Resource_Report_Refunded_Collection_Order extends Mage_Sa /** * Period format * - * @var string + * @var Zend_Db_Expr */ protected $_periodFormat; diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Shipping/Collection/Order.php b/app/code/core/Mage/Sales/Model/Resource/Report/Shipping/Collection/Order.php index 6f4108d7275..3054e6597b8 100644 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Shipping/Collection/Order.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Shipping/Collection/Order.php @@ -24,7 +24,7 @@ class Mage_Sales_Model_Resource_Report_Shipping_Collection_Order extends Mage_Sa /** * Period format * - * @var string + * @var Zend_Db_Expr */ protected $_periodFormat; diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.13-0.8.14.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.13-0.8.14.php index 9525a968c57..a907f09cb27 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.13-0.8.14.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.13-0.8.14.php @@ -218,7 +218,7 @@ $installer->run("UPDATE {$this->getTable('sales_order_entity')} SET parent_id={$new_entity_id} WHERE parent_id={$old_entity_id}"); - $tables = ["varchar", "int", "datetime", "text", "decimal"]; + $tables = ['varchar', 'int', 'datetime', 'text', 'decimal']; foreach ($tables as $table) { $delete = []; $attrs = $installer->getConnection()->fetchAll("SELECT tt.* FROM {$this->getTable('sales_order_entity')}_{$table} tt JOIN eav_attribute on eav_attribute.attribute_id = tt.attribute_id WHERE entity_id={$old_entity_id}"); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.46-0.9.47.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.46-0.9.47.php index 17360573c36..1ea2f9a34fc 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.46-0.9.47.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.46-0.9.47.php @@ -25,7 +25,7 @@ $installer->getAttribute($orderEntityTypeId, 'shipping_description') ]; -$installer->getConnection()->addColumn($this->getTable('sales_order'), $attributes[0]['attribute_code'], "tinyint(1) UNSIGNED NOT NULL DEFAULT 0"); +$installer->getConnection()->addColumn($this->getTable('sales_order'), $attributes[0]['attribute_code'], 'tinyint(1) UNSIGNED NOT NULL DEFAULT 0'); $installer->getConnection()->addColumn($this->getTable('sales_order'), $attributes[1]['attribute_code'], "varchar(255) NOT NULL DEFAULT ''"); try { diff --git a/app/code/core/Mage/SalesRule/Model/Resource/Report/Collection.php b/app/code/core/Mage/SalesRule/Model/Resource/Report/Collection.php index 354e7162f6b..93ed63c9c28 100644 --- a/app/code/core/Mage/SalesRule/Model/Resource/Report/Collection.php +++ b/app/code/core/Mage/SalesRule/Model/Resource/Report/Collection.php @@ -24,7 +24,7 @@ class Mage_SalesRule_Model_Resource_Report_Collection extends Mage_Sales_Model_R /** * Period format for report (day, month, year) * - * @var string + * @var Zend_Db_Expr */ protected $_periodFormat; diff --git a/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Found.php b/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Found.php index 1733189d91c..aab91530b7e 100644 --- a/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Found.php +++ b/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Found.php @@ -48,7 +48,7 @@ public function loadValueOptions() */ public function asHtml() { - $html = $this->getTypeElement()->getHtml() . Mage::helper('salesrule')->__("If an item is %s in the cart with %s of these conditions true:", $this->getValueElement()->getHtml(), $this->getAggregatorElement()->getHtml()); + $html = $this->getTypeElement()->getHtml() . Mage::helper('salesrule')->__('If an item is %s in the cart with %s of these conditions true:', $this->getValueElement()->getHtml(), $this->getAggregatorElement()->getHtml()); if ($this->getId() != '1') { $html .= $this->getRemoveLinkHtml(); } diff --git a/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Subselect.php b/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Subselect.php index bd72f283463..02a0c54a9f2 100644 --- a/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Subselect.php +++ b/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Subselect.php @@ -108,7 +108,7 @@ public function getValueElementType() public function asHtml() { $html = $this->getTypeElement()->getHtml() . - Mage::helper('salesrule')->__("If %s %s %s for a subselection of items in cart matching %s of these conditions:", $this->getAttributeElement()->getHtml(), $this->getOperatorElement()->getHtml(), $this->getValueElement()->getHtml(), $this->getAggregatorElement()->getHtml()); + Mage::helper('salesrule')->__('If %s %s %s for a subselection of items in cart matching %s of these conditions:', $this->getAttributeElement()->getHtml(), $this->getOperatorElement()->getHtml(), $this->getValueElement()->getHtml(), $this->getAggregatorElement()->getHtml()); if ($this->getId() != '1') { $html .= $this->getRemoveLinkHtml(); } diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.4-0.7.5.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.4-0.7.5.php index c1ceeb0afeb..3f9175e6147 100644 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.4-0.7.5.php +++ b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.4-0.7.5.php @@ -36,7 +36,7 @@ $conn->update( $this->getTable('salesrule'), ['website_ids' => implode(',', array_keys($websiteIds))], - "rule_id=" . $r['rule_id'] + 'rule_id=' . $r['rule_id'] ); } $conn->dropColumn($this->getTable('salesrule'), 'store_ids'); diff --git a/app/code/core/Mage/Shipping/Model/Resource/Carrier/Tablerate.php b/app/code/core/Mage/Shipping/Model/Resource/Carrier/Tablerate.php index 912ee11617f..1e4854703f5 100644 --- a/app/code/core/Mage/Shipping/Model/Resource/Carrier/Tablerate.php +++ b/app/code/core/Mage/Shipping/Model/Resource/Carrier/Tablerate.php @@ -112,7 +112,7 @@ public function getRate(Mage_Shipping_Model_Rate_Request $request) ->limit(1); $conditions = [ - "dest_country_id = :country_id AND dest_region_id = :region_id AND dest_zip = :postcode", + 'dest_country_id = :country_id AND dest_region_id = :region_id AND dest_zip = :postcode', "dest_country_id = :country_id AND dest_region_id = :region_id AND dest_zip = ''", "dest_country_id = :country_id AND dest_region_id = '0' AND dest_zip = :postcode", "dest_country_id = '0' AND dest_region_id = :region_id AND dest_zip = :postcode", @@ -397,7 +397,7 @@ protected function _getImportRow($row, $rowNumber = 0) } // protect from duplicate - $hash = sprintf("%s-%d-%s-%F", $countryId, $regionId, $zipCode, $value); + $hash = sprintf('%s-%d-%s-%F', $countryId, $regionId, $zipCode, $value); if (isset($this->_importUniqueHash[$hash])) { $this->_importErrors[] = Mage::helper('shipping')->__('Duplicate Row #%s (Country "%s", Region/State "%s", Zip "%s" and Value "%s").', $rowNumber, $row[0], $row[1], $zipCode, $value); return false; diff --git a/app/code/core/Mage/Tag/Block/Customer/Tags.php b/app/code/core/Mage/Tag/Block/Customer/Tags.php index 075c3960090..01ce223e417 100644 --- a/app/code/core/Mage/Tag/Block/Customer/Tags.php +++ b/app/code/core/Mage/Tag/Block/Customer/Tags.php @@ -31,7 +31,7 @@ protected function _loadTags() $this->_tags = []; $tags = Mage::getResourceModel('tag/tag_collection') - ->addPopularity(null, Mage::app()->getStore()->getId()) + ->addPopularity() ->setOrder('popularity', 'DESC') ->addCustomerFilter(Mage::getSingleton('customer/session')->getCustomerId()) ->setActiveFilter() diff --git a/app/code/core/Mage/Tag/Block/Product/List.php b/app/code/core/Mage/Tag/Block/Product/List.php index fd71223d3c8..d69ee562fa1 100644 --- a/app/code/core/Mage/Tag/Block/Product/List.php +++ b/app/code/core/Mage/Tag/Block/Product/List.php @@ -83,7 +83,7 @@ protected function _getCollection() protected function _beforeToHtml() { if (!$this->getProductId()) { - return false; + return $this; } return parent::_beforeToHtml(); diff --git a/app/code/core/Mage/Tag/Block/Product/Result.php b/app/code/core/Mage/Tag/Block/Product/Result.php index aeb8638ff49..bd5da0fb927 100644 --- a/app/code/core/Mage/Tag/Block/Product/Result.php +++ b/app/code/core/Mage/Tag/Block/Product/Result.php @@ -24,7 +24,7 @@ class Mage_Tag_Block_Product_Result extends Mage_Catalog_Block_Product_Abstract { /** - * @var Mage_Tag_Model_Resource_Tag_Collection|null + * @var Mage_Tag_Model_Resource_Product_Collection|null */ protected $_productCollection; @@ -81,7 +81,7 @@ public function getProductListHtml() } /** - * @return Mage_Tag_Model_Resource_Tag_Collection + * @return Mage_Tag_Model_Resource_Product_Collection * @throws Mage_Core_Model_Store_Exception */ protected function _getProductCollection() diff --git a/app/code/core/Mage/Tag/Model/Api.php b/app/code/core/Mage/Tag/Model/Api.php index bb04b28c842..bb8debcee0e 100644 --- a/app/code/core/Mage/Tag/Model/Api.php +++ b/app/code/core/Mage/Tag/Model/Api.php @@ -95,6 +95,7 @@ public function info($tagId, $store) */ public function add($data) { + $result = []; $data = $this->_prepareDataForAdd($data); /** @var Mage_Catalog_Model_Product $product */ $product = Mage::getModel('catalog/product')->load($data['product_id']); diff --git a/app/code/core/Mage/Tag/Model/Api/V2.php b/app/code/core/Mage/Tag/Model/Api/V2.php index 92fa9b27c8e..0684d77772a 100644 --- a/app/code/core/Mage/Tag/Model/Api/V2.php +++ b/app/code/core/Mage/Tag/Model/Api/V2.php @@ -59,7 +59,7 @@ public function add($data) * * @param int $tagId * @param string|int $store - * @return object + * @return object|array */ public function info($tagId, $store) { @@ -74,7 +74,7 @@ public function info($tagId, $store) /** * Convert data from object to array before add * - * @param object $data + * @param array|object $data * @return array */ protected function _prepareDataForAdd($data) @@ -86,7 +86,7 @@ protected function _prepareDataForAdd($data) /** * Convert data from object to array before update * - * @param object $data + * @param array|object $data * @return array */ protected function _prepareDataForUpdate($data) diff --git a/app/code/core/Mage/Tag/Model/Entity/Customer/Collection.php b/app/code/core/Mage/Tag/Model/Entity/Customer/Collection.php index f6fe3c7b8b6..d358c941611 100644 --- a/app/code/core/Mage/Tag/Model/Entity/Customer/Collection.php +++ b/app/code/core/Mage/Tag/Model/Entity/Customer/Collection.php @@ -22,6 +22,7 @@ class Mage_Tag_Model_Entity_Customer_Collection extends Mage_Customer_Model_Entity_Customer_Collection { protected $_tagTable; + protected $_tagRelTable; public function __construct() diff --git a/app/code/core/Mage/Tag/Model/Resource/Customer/Collection.php b/app/code/core/Mage/Tag/Model/Resource/Customer/Collection.php index d9b4dbf5770..167552ad0f2 100644 --- a/app/code/core/Mage/Tag/Model/Resource/Customer/Collection.php +++ b/app/code/core/Mage/Tag/Model/Resource/Customer/Collection.php @@ -268,6 +268,7 @@ public function getSelectCountSql() public function addProductName() { $productsId = []; + $productsSku = []; $productsData = []; foreach ($this->getItems() as $item) { diff --git a/app/code/core/Mage/Tag/Model/Resource/Tag/Relation.php b/app/code/core/Mage/Tag/Model/Resource/Tag/Relation.php index bf174bd0857..b551409dfc8 100644 --- a/app/code/core/Mage/Tag/Model/Resource/Tag/Relation.php +++ b/app/code/core/Mage/Tag/Model/Resource/Tag/Relation.php @@ -118,7 +118,7 @@ public function getRelatedTagIds($model) $productIds = (is_array($model->getProductId())) ? $model->getProductId() : [$model->getProductId()]; $select = $this->_getReadAdapter()->select() ->from($this->getMainTable(), 'tag_id') - ->where("product_id IN(?)", $productIds) + ->where('product_id IN(?)', $productIds) ->order('tag_id'); return $this->_getReadAdapter()->fetchCol($select); } diff --git a/app/code/core/Mage/Tag/Model/Tag.php b/app/code/core/Mage/Tag/Model/Tag.php index 0f20394cd4c..1dc6ee88c3a 100644 --- a/app/code/core/Mage/Tag/Model/Tag.php +++ b/app/code/core/Mage/Tag/Model/Tag.php @@ -366,6 +366,7 @@ public function saveRelation($productId, $customerId, $storeId) ->setActive(Mage_Tag_Model_Tag_Relation::STATUS_ACTIVE) ->setCreatedAt($relationModel->getResource()->formatDate(time())); + $result = ''; $relationModelSaveNeed = false; switch ($this->getStatus()) { case $this->getApprovedStatus(): diff --git a/app/code/core/Mage/Tax/Helper/Data.php b/app/code/core/Mage/Tax/Helper/Data.php index 82012c90f7e..88dbf246ad8 100644 --- a/app/code/core/Mage/Tax/Helper/Data.php +++ b/app/code/core/Mage/Tax/Helper/Data.php @@ -833,7 +833,7 @@ public function getPriceTaxSql($priceField, $taxClassField) $$rateVariable = ''; foreach ($$rateArray as $classId => $rate) { if ($rate) { - $$rateVariable .= sprintf("WHEN %d THEN %12.4f ", $classId, $rate / 100); + $$rateVariable .= sprintf('WHEN %d THEN %12.4f ', $classId, $rate / 100); } } if ($$rateVariable) { diff --git a/app/code/core/Mage/Tax/Model/Resource/Calculation.php b/app/code/core/Mage/Tax/Model/Resource/Calculation.php index 9c1cc5d7284..d73a7bcc559 100644 --- a/app/code/core/Mage/Tax/Model/Resource/Calculation.php +++ b/app/code/core/Mage/Tax/Model/Resource/Calculation.php @@ -292,12 +292,12 @@ protected function _getRates($request) ) ->joinLeft( ['title_table' => $this->getTable('tax/tax_calculation_rate_title')], - "rate.tax_calculation_rate_id = title_table.tax_calculation_rate_id " + 'rate.tax_calculation_rate_id = title_table.tax_calculation_rate_id ' . "AND title_table.store_id = '{$storeId}'", ['title' => $ifnullTitleValue] ) ->where('rate.tax_country_id = ?', $countryId) - ->where("rate.tax_region_id IN(?)", [0, (int)$regionId]); + ->where('rate.tax_region_id IN(?)', [0, (int)$regionId]); $postcodeIsNumeric = is_numeric($postcode); $postcodeIsRange = false; if (preg_match('/^(.+)-(.+)$/', $postcode, $matches)) { @@ -371,7 +371,7 @@ public function getApplicableRateIds($request) $select = $this->_getReadAdapter()->select() ->from(['rate' => $this->getTable('tax/tax_calculation_rate')], ['tax_calculation_rate_id']) ->where('rate.tax_country_id = ?', $countryId) - ->where("rate.tax_region_id IN(?)", [0, (int)$regionId]); + ->where('rate.tax_region_id IN(?)', [0, (int)$regionId]); $expr = $this->_getWriteAdapter()->getCheckSql( 'zip_is_range is NULL', diff --git a/app/code/core/Mage/Tax/Model/Resource/Report/Collection.php b/app/code/core/Mage/Tax/Model/Resource/Report/Collection.php index 83364b3ca50..291994d8c6a 100644 --- a/app/code/core/Mage/Tax/Model/Resource/Report/Collection.php +++ b/app/code/core/Mage/Tax/Model/Resource/Report/Collection.php @@ -22,7 +22,7 @@ class Mage_Tax_Model_Resource_Report_Collection extends Mage_Sales_Model_Resource_Report_Collection_Abstract { /** - * @var string + * @var Zend_Db_Expr */ protected $_periodFormat; diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.4-0.7.5.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.4-0.7.5.php index 1787bc436b7..2c32d013709 100644 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.4-0.7.5.php +++ b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.4-0.7.5.php @@ -27,7 +27,7 @@ $installer->run( "UPDATE {$installer->getTable('customer_group')} SET tax_class_id = {$customerTaxClassIds[0]} - WHERE tax_class_id NOT IN (" . implode(',', $customerTaxClassIds) . ")" + WHERE tax_class_id NOT IN (" . implode(',', $customerTaxClassIds) . ')' ); } diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.7-0.7.8.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.7-0.7.8.php index 2ab25630bb3..279d5d8696d 100644 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.7-0.7.8.php +++ b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.7-0.7.8.php @@ -17,6 +17,6 @@ $installer = $this; $installer->startSetup(); -$installer->getConnection()->addColumn($installer->getTable('sales_order_tax'), 'hidden', "smallint (5) unsigned not null default 0"); +$installer->getConnection()->addColumn($installer->getTable('sales_order_tax'), 'hidden', 'smallint (5) unsigned not null default 0'); $installer->endSetup(); diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.9-0.7.10.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.9-0.7.10.php index e93d93573b1..313641716bc 100644 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.9-0.7.10.php +++ b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.9-0.7.10.php @@ -19,9 +19,9 @@ $table = $installer->getTable('tax_calculation_rate'); -$installer->getConnection()->addColumn($table, 'zip_is_range', "TINYINT(1) DEFAULT NULL"); -$installer->getConnection()->addColumn($table, 'zip_from', "VARCHAR(10) DEFAULT NULL"); -$installer->getConnection()->addColumn($table, 'zip_to', "VARCHAR(10) DEFAULT NULL"); +$installer->getConnection()->addColumn($table, 'zip_is_range', 'TINYINT(1) DEFAULT NULL'); +$installer->getConnection()->addColumn($table, 'zip_from', 'VARCHAR(10) DEFAULT NULL'); +$installer->getConnection()->addColumn($table, 'zip_to', 'VARCHAR(10) DEFAULT NULL'); $installer->getConnection()->addKey($table, 'IDX_TAX_CALCULATION_RATE_RANGE', ['tax_calculation_rate_id', 'tax_country_id', 'tax_region_id', 'zip_is_range', 'tax_postcode']); diff --git a/app/code/core/Mage/Uploader/Model/Config/Abstract.php b/app/code/core/Mage/Uploader/Model/Config/Abstract.php index 2bee5f1a347..906801629f0 100644 --- a/app/code/core/Mage/Uploader/Model/Config/Abstract.php +++ b/app/code/core/Mage/Uploader/Model/Config/Abstract.php @@ -56,6 +56,6 @@ public function __call($method, $args) case 'has': return isset($this->_data[$key]); } - throw new Varien_Exception("Invalid method " . get_class($this) . "::" . $method . "(" . print_r($args, 1) . ")"); + throw new Varien_Exception('Invalid method ' . get_class($this) . '::' . $method . '(' . print_r($args, 1) . ')'); } } diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl.php index 17b72682502..33b38946200 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl.php @@ -1070,7 +1070,7 @@ protected function _parseXmlTrackingResponse($trackings, $response) */ $rArr['service'] = (string)$txml->Service->Desc; if (isset($txml->Weight)) { - $rArr['weight'] = (string)$txml->Weight . " lbs"; + $rArr['weight'] = (string)$txml->Weight . ' lbs'; } if (isset($txml->Delivery)) { $rArr['deliverydate'] = (string)$txml->Delivery->Date; diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php index 8700e0181ed..0e3953c2a74 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php @@ -799,7 +799,7 @@ protected function _getQuotes() $code = $bodyXml->xpath('//GetQuoteResponse/Note/Condition/ConditionCode'); if (isset($code[0]) && (int)$code[0] == self::CONDITION_CODE_SERVICE_DATE_UNAVAILABLE) { $debugPoint['info'] = sprintf( - Mage::helper('usa')->__("DHL service is not available at %s date"), + Mage::helper('usa')->__('DHL service is not available at %s date'), $date ); } else { @@ -886,7 +886,7 @@ protected function _buildQuotesRequestXml() $nodeDutiable = $nodeGetQuote->addChild('Dutiable'); $baseCurrencyCode = Mage::app()->getWebsite($this->_request->getWebsiteId())->getBaseCurrencyCode(); $nodeDutiable->addChild('DeclaredCurrency', $baseCurrencyCode); - $nodeDutiable->addChild('DeclaredValue', sprintf("%.2F", $rawRequest->getValue())); + $nodeDutiable->addChild('DeclaredValue', sprintf('%.2F', $rawRequest->getValue())); } return $xml; } @@ -1026,7 +1026,7 @@ protected function _addRate(SimpleXMLElement $shipmentDetails) } if (!isset($rates[$currencyCode]) || !$totalEstimate) { $totalEstimate = false; - $this->_errors[] = Mage::helper('usa')->__("Exchange rate %s (Base Currency) -> %s not found. DHL method %s skipped", $currencyCode, $baseCurrencyCode, $dhlProductDescription); + $this->_errors[] = Mage::helper('usa')->__('Exchange rate %s (Base Currency) -> %s not found. DHL method %s skipped', $currencyCode, $baseCurrencyCode, $dhlProductDescription); } } } @@ -1051,7 +1051,7 @@ protected function _addRate(SimpleXMLElement $shipmentDetails) if (isset($shipmentDetails->GlobalProductCode)) { $dhlProductDescription = $this->getDhlProductTitle((string)$shipmentDetails->GlobalProductCode); } - $dhlProductDescription = $dhlProductDescription ? $dhlProductDescription : Mage::helper('usa')->__("DHL"); + $dhlProductDescription = $dhlProductDescription ? $dhlProductDescription : Mage::helper('usa')->__('DHL'); $this->_errors[] = Mage::helper('usa')->__("Zero shipping charge for '%s'", $dhlProductDescription); } return $this; @@ -1067,7 +1067,7 @@ protected function _getDimensionUnit() $countryId = $this->_rawRequest->getOrigCountryId(); $measureUnit = $this->getCountryParams($countryId)->getMeasureUnit(); if (empty($measureUnit)) { - Mage::throwException(Mage::helper('usa')->__("Cannot identify measure unit for %s", $countryId)); + Mage::throwException(Mage::helper('usa')->__('Cannot identify measure unit for %s', $countryId)); } return $measureUnit; } @@ -1082,7 +1082,7 @@ protected function _getWeightUnit() $countryId = $this->_rawRequest->getOrigCountryId(); $weightUnit = $this->getCountryParams($countryId)->getWeightUnit(); if (empty($weightUnit)) { - Mage::throwException(Mage::helper('usa')->__("Cannot identify weight unit for %s", $countryId)); + Mage::throwException(Mage::helper('usa')->__('Cannot identify weight unit for %s', $countryId)); } return $weightUnit; } @@ -1235,7 +1235,7 @@ protected function _mapRequestToShipment(Varien_Object $request) */ protected function _getMinDimension($dimensionUnit) { - return $dimensionUnit == "CENTIMETER" ? self::DIMENSION_MIN_CM : self::DIMENSION_MIN_IN; + return $dimensionUnit == 'CENTIMETER' ? self::DIMENSION_MIN_CM : self::DIMENSION_MIN_IN; } /** @@ -1345,7 +1345,7 @@ protected function _doRequest() $nodeDutiable = $xml->addChild('Dutiable', '', ''); $nodeDutiable->addChild( 'DeclaredValue', - sprintf("%.2F", $rawRequest->getOrderShipment()->getOrder()->getSubtotal()) + sprintf('%.2F', $rawRequest->getOrderShipment()->getOrder()->getSubtotal()) ); $baseCurrencyCode = Mage::app()->getWebsite($rawRequest->getWebsiteId())->getBaseCurrencyCode(); $nodeDutiable->addChild('DeclaredCurrency', $baseCurrencyCode); diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/PageBuilder.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/PageBuilder.php index f8e83f80c7a..4c1de7f7ca2 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/PageBuilder.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/PageBuilder.php @@ -194,7 +194,7 @@ public function addProductContentCode($code) $this->_y(28), Zend_Pdf_Page::SHAPE_DRAW_FILL ); - $this->_page->setFillColor(new Zend_Pdf_Color_Html("#ffffff")); + $this->_page->setFillColor(new Zend_Pdf_Color_Html('#ffffff')); $font = $this->_fontBold; } else { $font = $this->_fontNormal; @@ -258,7 +258,7 @@ public function addSenderInfo(SimpleXMLElement $sender) $phoneNumber = implode(' ', array_filter([(string)$sender->Contact->PhoneNumber, (string)$sender->Contact->PhoneExtension])); - $phoneNumber = $phoneNumber ? "Phone: " . $phoneNumber : ''; + $phoneNumber = $phoneNumber ? 'Phone: ' . $phoneNumber : ''; $pageY = $this->_drawSenderAddress($sender->AddressLine, $phoneNumber); $divisionCode = (string)(strlen($sender->DivisionCode) ? $sender->DivisionCode . ' ' : null); @@ -325,7 +325,7 @@ public function addOriginInfo($serviceAreaCode) } $this->_page->saveGS(); $this->_page->setFont($this->_fontNormal, 6); - $this->_page->drawText("Origin:", $this->_x(260), $this->_y(36)); + $this->_page->drawText('Origin:', $this->_x(260), $this->_y(36)); $this->_page->setFont($this->_fontBold, 9); $this->_page->drawText($serviceAreaCode, $this->_x(260), $this->_y(45)); @@ -344,7 +344,7 @@ public function addReceiveInfo(SimpleXMLElement $consignee) $this->_page->saveGS(); $this->_page->setFont($this->_fontNormal, 9); - $this->_page->drawText("To:", $this->_x(5), $this->_y(92)); + $this->_page->drawText('To:', $this->_x(5), $this->_y(92)); $this->_page->drawText($consignee->CompanyName, $this->_x(20), $this->_y(90)); $y = $this->_page->drawLines($consignee->AddressLine, $this->_x(19), $this->_y(100), 50); @@ -500,7 +500,7 @@ public function addWeightInfo($weight, $unit) { $this->_page->saveGS(); - $units = ["K" => 'kg', "L" => 'lb']; + $units = ['K' => 'kg', 'L' => 'lb']; if (!isset($units[$unit])) { throw new InvalidArgumentException(Mage::helper('usa')->__('Weight unit is invalid')); } @@ -560,12 +560,12 @@ public function addWaybillBarcode($number, $barCode) if (!strlen($number) || !strlen($barCode)) { throw new InvalidArgumentException(Mage::helper('usa')->__('Waybill barcode information is missing')); } - $image = new Zend_Pdf_Resource_Image_Png("data://image/png;base64," . $barCode); + $image = new Zend_Pdf_Resource_Image_Png('data://image/png;base64,' . $barCode); $this->_page->drawImage($image, $this->_x(0), $this->_y(296), $this->_x(232), $this->_y(375)); $this->_page->setFont($this->_fontNormal, 9); $number = substr($number, 0, 2) . ' ' . substr($number, 2, 4) . ' ' . substr($number, 6, 4); - $this->_page->drawText("WAYBILL " . $number, $this->_x(13.5), $this->_y(382)); + $this->_page->drawText('WAYBILL ' . $number, $this->_x(13.5), $this->_y(382)); $this->_page->restoreGS(); return $this; @@ -588,7 +588,7 @@ public function addRoutingBarcode($routingCode, $id, $barCode) throw new InvalidArgumentException(Mage::helper('usa')->__('Routing barcode is missing')); } - $image = new Zend_Pdf_Resource_Image_Png("data://image/png;base64," . $barCode); + $image = new Zend_Pdf_Resource_Image_Png('data://image/png;base64,' . $barCode); $this->_page->drawImage($image, $this->_x(0), $this->_y(386), $this->_x(232), $this->_y(465)); $this->_page->setFont($this->_fontNormal, 9); diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php index ee3bdb4ce14..fc52347002f 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php @@ -480,7 +480,7 @@ protected function _prepareRateResponse($response) $errorTitle = (string)$response->Notifications->Message; } } elseif (isset($response->RateReplyDetails)) { - $allowedMethods = explode(",", $this->getConfigData('allowed_methods')); + $allowedMethods = explode(',', $this->getConfigData('allowed_methods')); if (is_array($response->RateReplyDetails)) { foreach ($response->RateReplyDetails as $rate) { @@ -686,7 +686,7 @@ protected function _parseXmlResponse($response) $errorTitle = 'Unknown error'; } - $allowedMethods = explode(",", $this->getConfigData('allowed_methods')); + $allowedMethods = explode(',', $this->getConfigData('allowed_methods')); foreach ($xml->Entry as $entry) { if (in_array((string)$entry->Service, $allowedMethods)) { diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php index 61090b27a62..acf390d2397 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php @@ -507,11 +507,11 @@ public function getCode($type, $code = '') ], 'pickup' => [ - 'RDP' => ["label" => 'Regular Daily Pickup',"code" => "01"], - 'OCA' => ["label" => 'On Call Air',"code" => "07"], - 'OTP' => ["label" => 'One Time Pickup',"code" => "06"], - 'LC' => ["label" => 'Letter Center',"code" => "19"], - 'CC' => ["label" => 'Customer Counter',"code" => "03"], + 'RDP' => ['label' => 'Regular Daily Pickup','code' => '01'], + 'OCA' => ['label' => 'On Call Air','code' => '07'], + 'OTP' => ['label' => 'One Time Pickup','code' => '06'], + 'LC' => ['label' => 'Letter Center','code' => '19'], + 'CC' => ['label' => 'Customer Counter','code' => '03'], ], 'container' => [ @@ -711,10 +711,10 @@ protected function _getXmlQuotes() XMLRequest; if ($params['serviceCode'] !== null) { - $xmlRequest .= "" . + $xmlRequest .= '' . "{$params['serviceCode']}" . "{$params['serviceDescription']}" . - ""; + ''; } $xmlRequest .= <<< XMLRequest @@ -781,7 +781,7 @@ protected function _getXmlQuotes() XMLRequest; if ($this->getConfigFlag('negotiated_active')) { - $xmlRequest .= ""; + $xmlRequest .= ''; } $xmlRequest .= <<< XMLRequest @@ -845,14 +845,14 @@ protected function _parseXmlResponse($xmlResponse) if (strlen(trim($xmlResponse)) > 0) { $xml = new Varien_Simplexml_Config(); $xml->loadString($xmlResponse); - $arr = $xml->getXpath("//RatingServiceSelectionResponse/Response/ResponseStatusCode/text()"); + $arr = $xml->getXpath('//RatingServiceSelectionResponse/Response/ResponseStatusCode/text()'); $success = (int)$arr[0]; if ($success === 1) { - $arr = $xml->getXpath("//RatingServiceSelectionResponse/RatedShipment"); - $allowedMethods = explode(",", $this->getConfigData('allowed_methods')); + $arr = $xml->getXpath('//RatingServiceSelectionResponse/RatedShipment'); + $allowedMethods = explode(',', $this->getConfigData('allowed_methods')); // Negotiated rates - $negotiatedArr = $xml->getXpath("//RatingServiceSelectionResponse/RatedShipment/NegotiatedRates"); + $negotiatedArr = $xml->getXpath('//RatingServiceSelectionResponse/RatedShipment/NegotiatedRates'); $negotiatedActive = $this->getConfigFlag('negotiated_active') && $this->getConfigData('shipper_number') && !empty($negotiatedArr); @@ -891,7 +891,7 @@ protected function _parseXmlResponse($xmlResponse) } } } else { - $arr = $xml->getXpath("//RatingServiceSelectionResponse/Response/Error/ErrorDescription/text()"); + $arr = $xml->getXpath('//RatingServiceSelectionResponse/Response/Error/ErrorDescription/text()'); $errorTitle = (string)$arr[0][0]; $error = Mage::getModel('shipping/rate_result_error'); $error->setCarrier('ups'); @@ -1045,25 +1045,25 @@ protected function _parseXmlTrackingResponse($trackingvalue, $xmlResponse) if ($xmlResponse) { $xml = new Varien_Simplexml_Config(); $xml->loadString($xmlResponse); - $arr = $xml->getXpath("//TrackResponse/Response/ResponseStatusCode/text()"); + $arr = $xml->getXpath('//TrackResponse/Response/ResponseStatusCode/text()'); $success = (int)$arr[0][0]; if ($success === 1) { - $arr = $xml->getXpath("//TrackResponse/Shipment/Service/Description/text()"); + $arr = $xml->getXpath('//TrackResponse/Shipment/Service/Description/text()'); $resultArr['service'] = (string)$arr[0]; - $arr = $xml->getXpath("//TrackResponse/Shipment/PickupDate/text()"); + $arr = $xml->getXpath('//TrackResponse/Shipment/PickupDate/text()'); $resultArr['shippeddate'] = (string)$arr[0]; - $arr = $xml->getXpath("//TrackResponse/Shipment/Package/PackageWeight/Weight/text()"); + $arr = $xml->getXpath('//TrackResponse/Shipment/Package/PackageWeight/Weight/text()'); $weight = (string)$arr[0]; - $arr = $xml->getXpath("//TrackResponse/Shipment/Package/PackageWeight/UnitOfMeasurement/Code/text()"); + $arr = $xml->getXpath('//TrackResponse/Shipment/Package/PackageWeight/UnitOfMeasurement/Code/text()'); $unit = (string)$arr[0]; $resultArr['weight'] = "{$weight} {$unit}"; - $activityTags = $xml->getXpath("//TrackResponse/Shipment/Package/Activity"); + $activityTags = $xml->getXpath('//TrackResponse/Shipment/Package/Activity'); if ($activityTags) { $i = 1; foreach ($activityTags as $activityTag) { @@ -1113,7 +1113,7 @@ protected function _parseXmlTrackingResponse($trackingvalue, $xmlResponse) $resultArr['progressdetail'] = $packageProgress; } } else { - $arr = $xml->getXpath("//TrackResponse/Response/Error/ErrorDescription/text()"); + $arr = $xml->getXpath('//TrackResponse/Response/Error/ErrorDescription/text()'); $errorTitle = (string)$arr[0][0]; } } @@ -1147,7 +1147,7 @@ protected function _getRestTracking($trackings) return $this->_trackingResult; } - $version = "v1"; + $version = 'v1'; $query = http_build_query([ 'locale' => 'en_US', 'returnSignature' => 'false', @@ -1654,7 +1654,7 @@ protected function _doShipmentRequestRest(Varien_Object $request): Varien_Object /** Rest API Payload */ $headers = [ "Authorization: Bearer $accessToken", - "Content-Type: application/json" + 'Content-Type: application/json' ]; $debugData = [ 'request' => $rawJsonRequest @@ -1764,25 +1764,25 @@ protected function _formShipmentRestRequest(Varien_Object $request): string /** Shipment API Payload */ $shipParams = [ - "ShipmentRequest" => [ - "Request" => [ - "SubVersion" => "1801", - "RequestOption" => "nonvalidate", - "TransactionReference" => [ - "CustomerContext" => "Shipment Request" + 'ShipmentRequest' => [ + 'Request' => [ + 'SubVersion' => '1801', + 'RequestOption' => 'nonvalidate', + 'TransactionReference' => [ + 'CustomerContext' => 'Shipment Request' ] ], - "Shipment" => [ - "Description" => $shipmentDescription, - "Shipper" => [], - "ShipTo" => [], - "ShipFrom" => [], - "PaymentInformation" => [], - "Service" => [], - "Package" => [], - "ShipmentServiceOptions" => [] + 'Shipment' => [ + 'Description' => $shipmentDescription, + 'Shipper' => [], + 'ShipTo' => [], + 'ShipFrom' => [], + 'PaymentInformation' => [], + 'Service' => [], + 'Package' => [], + 'ShipmentServiceOptions' => [] ], - "LabelSpecification" => [] + 'LabelSpecification' => [] ] ]; if ($request->getIsReturn()) { @@ -1914,7 +1914,7 @@ protected function _formShipmentRestRequest(Varien_Object $request): string = $deliveryConfirmation; } - $shipParams['ShipmentRequest']['Shipment']['PaymentInformation']['ShipmentCharge']['Type'] = "01"; + $shipParams['ShipmentRequest']['Shipment']['PaymentInformation']['ShipmentCharge']['Type'] = '01'; $shipParams['ShipmentRequest']['Shipment']['PaymentInformation']['ShipmentCharge']['BillShipper'] ['AccountNumber'] = $this->getConfigData('shipper_number'); @@ -2204,38 +2204,38 @@ protected function _getRestQuotes() } $rateParams = [ - "RateRequest" => [ - "Request" => [ - "TransactionReference" => [ - "CustomerContext" => "Rating and Service" + 'RateRequest' => [ + 'Request' => [ + 'TransactionReference' => [ + 'CustomerContext' => 'Rating and Service' ] ], - "Shipment" => [ - "Shipper" => [ - "Name" => "UPS", - "ShipperNumber" => "{$shipperNumber}", - "Address" => [ - "AddressLine" => [], - "City" => "{$shipperCity}", - "StateProvinceCode" => "{$shipperStateProvince}", - "PostalCode" => "{$shipperPostalCode}", - "CountryCode" => "{$shipperCountryCode}" + 'Shipment' => [ + 'Shipper' => [ + 'Name' => 'UPS', + 'ShipperNumber' => "{$shipperNumber}", + 'Address' => [ + 'AddressLine' => [], + 'City' => "{$shipperCity}", + 'StateProvinceCode' => "{$shipperStateProvince}", + 'PostalCode' => "{$shipperPostalCode}", + 'CountryCode' => "{$shipperCountryCode}" ] ], - "ShipTo" => [ - "Address" => [ - "AddressLine" => ["{$params['49_residential']}"], - "StateProvinceCode" => "{$params['destRegionCode']}", - "PostalCode" => "{$params['19_destPostal']}", - "CountryCode" => "{$params['22_destCountry']}" + 'ShipTo' => [ + 'Address' => [ + 'AddressLine' => ["{$params['49_residential']}"], + 'StateProvinceCode' => "{$params['destRegionCode']}", + 'PostalCode' => "{$params['19_destPostal']}", + 'CountryCode' => "{$params['22_destCountry']}" ] ], - "ShipFrom" => [ - "Address" => [ - "AddressLine" => [], - "StateProvinceCode" => "{$params['origRegionCode']}", - "PostalCode" => "{$params['15_origPostal']}", - "CountryCode" => "{$params['14_origCountry']}" + 'ShipFrom' => [ + 'Address' => [ + 'AddressLine' => [], + 'StateProvinceCode' => "{$params['origRegionCode']}", + 'PostalCode' => "{$params['15_origPostal']}", + 'CountryCode' => "{$params['14_origCountry']}" ] ], ] @@ -2247,11 +2247,11 @@ protected function _getRestQuotes() } if ($this->getConfigFlag('negotiated_active')) { - $rateParams['RateRequest']['Shipment']['ShipmentRatingOptions']['TPFCNegotiatedRatesIndicator'] = "Y"; - $rateParams['RateRequest']['Shipment']['ShipmentRatingOptions']['NegotiatedRatesIndicator'] = "Y"; + $rateParams['RateRequest']['Shipment']['ShipmentRatingOptions']['TPFCNegotiatedRatesIndicator'] = 'Y'; + $rateParams['RateRequest']['Shipment']['ShipmentRatingOptions']['NegotiatedRatesIndicator'] = 'Y'; } if ($this->getConfigFlag('include_taxes')) { - $rateParams['RateRequest']['Shipment']['TaxInformationIndicator'] = "Y"; + $rateParams['RateRequest']['Shipment']['TaxInformationIndicator'] = 'Y'; } if ($serviceCode !== null) { @@ -2260,41 +2260,41 @@ protected function _getRestQuotes() } $rateParams['RateRequest']['Shipment']['Package'][] = [ - "PackagingType" => [ - "Code" => "{$params['48_container']}", - "Description" => "Packaging" + 'PackagingType' => [ + 'Code' => "{$params['48_container']}", + 'Description' => 'Packaging' ], - "Dimensions" => [ - "UnitOfMeasurement" => [ - "Code" => $rowRequest->getUnitDimensions(), - "Description" => $rowRequest->getUnitDimensionsDescription() + 'Dimensions' => [ + 'UnitOfMeasurement' => [ + 'Code' => $rowRequest->getUnitDimensions(), + 'Description' => $rowRequest->getUnitDimensionsDescription() ], - "Length" => "5", - "Width" => "5", - "Height" => "5" + 'Length' => '5', + 'Width' => '5', + 'Height' => '5' ], - "PackageWeight" => [ - "UnitOfMeasurement" => [ - "Code" => "{$rowRequest->getUnitMeasure()}" + 'PackageWeight' => [ + 'UnitOfMeasurement' => [ + 'Code' => "{$rowRequest->getUnitMeasure()}" ], - "Weight" => "{$params['23_weight']}" + 'Weight' => "{$params['23_weight']}" ] ]; $ratePayload = json_encode($rateParams, JSON_PRETTY_PRINT); /** Rest API Payload */ - $version = "v1"; + $version = 'v1'; $requestOption = $params['10_action']; $headers = [ "Authorization: Bearer $accessToken", - "Content-Type: application/json" + 'Content-Type: application/json' ]; $debugData = [ 'request' => $ratePayload ]; $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, $url . $version . "/" . $requestOption); + curl_setopt($ch, CURLOPT_URL, $url . $version . '/' . $requestOption); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_POST, 1); @@ -2332,7 +2332,7 @@ protected function _parseRestResponse(string $rateResponse) // Handling cases where a single service is returned by UPS $arr = [$arr]; } - $allowedMethods = explode(",", $this->getConfigData('allowed_methods') ?? ''); + $allowedMethods = explode(',', $this->getConfigData('allowed_methods') ?? ''); $allowedCurrencies = Mage::getModel('directory/currency')->getConfigAllowCurrencies(); foreach ($arr as $shipElement) { $negotiatedArr = $shipElement['NegotiatedRateCharges'] ?? [] ; diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/UpsAuth.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/UpsAuth.php index 90ea30540f8..d8d974ea6ad 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/UpsAuth.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/UpsAuth.php @@ -40,9 +40,9 @@ public function getAccessToken(string $clientId, string $clientSecret, string $c } $headers = [ - "Content-Type: application/x-www-form-urlencoded", + 'Content-Type: application/x-www-form-urlencoded', "x-merchant-id: $clientId", - "Authorization: Basic " . base64_encode("$clientId:$clientSecret"), + 'Authorization: Basic ' . base64_encode("$clientId:$clientSecret"), ]; $authPayload = http_build_query([ 'grant_type' => 'client_credentials', diff --git a/app/code/core/Mage/Weee/Block/Renderer/Weee/Tax.php b/app/code/core/Mage/Weee/Block/Renderer/Weee/Tax.php index d829f18eb76..782dd078cc4 100644 --- a/app/code/core/Mage/Weee/Block/Renderer/Weee/Tax.php +++ b/app/code/core/Mage/Weee/Block/Renderer/Weee/Tax.php @@ -215,7 +215,7 @@ protected function _setAddButton() $this->setChild( 'add_button', $this->getLayout()->createBlock('adminhtml/widget_button') - ->setData(['id' => "add_tax_" . $this->getElement()->getHtmlId(), + ->setData(['id' => 'add_tax_' . $this->getElement()->getHtmlId(), 'label' => Mage::helper('catalog')->__('Add Tax'), 'onclick' => "weeeTaxControl.addItem('" . $this->getElement()->getHtmlId() . "')", 'class' => 'add' diff --git a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.11-0.12.php b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.11-0.12.php index 68ec97e9966..422683d7779 100644 --- a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.11-0.12.php +++ b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.11-0.12.php @@ -17,7 +17,7 @@ $installer = $this; $installer->startSetup(); -$installer->getConnection()->addColumn($installer->getTable('weee_tax'), 'entity_type_id', "smallint (5) unsigned not null"); +$installer->getConnection()->addColumn($installer->getTable('weee_tax'), 'entity_type_id', 'smallint (5) unsigned not null'); $installer->run(" UPDATE `{$installer->getTable('weee_tax')}` diff --git a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.2-0.3.php b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.2-0.3.php index 2bf0bce692c..1f183bf6d9f 100644 --- a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.2-0.3.php +++ b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.2-0.3.php @@ -17,6 +17,6 @@ $installer = $this; $installer->startSetup(); -$installer->getConnection()->addColumn($installer->getTable('weee_tax'), 'attribute_id', "smallint (5) unsigned not null"); +$installer->getConnection()->addColumn($installer->getTable('weee_tax'), 'attribute_id', 'smallint (5) unsigned not null'); $installer->endSetup(); diff --git a/app/code/core/Mage/Widget/Model/Widget.php b/app/code/core/Mage/Widget/Model/Widget.php index 9a8e51ef8ba..e87a5509478 100644 --- a/app/code/core/Mage/Widget/Model/Widget.php +++ b/app/code/core/Mage/Widget/Model/Widget.php @@ -195,7 +195,7 @@ public function getWidgetsArray($filters = []) 'description' => $helper->__((string)$widget->description) ]; } - usort($result, [$this, "_sortWidgets"]); + usort($result, [$this, '_sortWidgets']); $this->setData('widgets_array', $result); } return $this->_getData('widgets_array'); diff --git a/app/code/core/Mage/Wishlist/controllers/IndexController.php b/app/code/core/Mage/Wishlist/controllers/IndexController.php index ec358ecef3c..29cfc35b472 100644 --- a/app/code/core/Mage/Wishlist/controllers/IndexController.php +++ b/app/code/core/Mage/Wishlist/controllers/IndexController.php @@ -586,7 +586,7 @@ public function fromcartAction() $productName = Mage::helper('core')->escapeHtml($item->getProduct()->getName()); $wishlistName = Mage::helper('core')->escapeHtml($wishlist->getName()); $session->addSuccess( - Mage::helper('wishlist')->__("%s has been moved to wishlist %s", $productName, $wishlistName) + Mage::helper('wishlist')->__('%s has been moved to wishlist %s', $productName, $wishlistName) ); $wishlist->save(); } catch (Mage_Core_Exception $e) { diff --git a/composer.lock b/composer.lock index 8fdf520b2b4..7416609aac5 100644 --- a/composer.lock +++ b/composer.lock @@ -834,16 +834,16 @@ }, { "name": "phpseclib/phpseclib", - "version": "3.0.39", + "version": "3.0.41", "source": { "type": "git", "url": "https://github.com/phpseclib/phpseclib.git", - "reference": "211ebc399c6e73c225a018435fe5ae209d1d1485" + "reference": "621c73f7dcb310b61de34d1da4c4204e8ace6ceb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/211ebc399c6e73c225a018435fe5ae209d1d1485", - "reference": "211ebc399c6e73c225a018435fe5ae209d1d1485", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/621c73f7dcb310b61de34d1da4c4204e8ace6ceb", + "reference": "621c73f7dcb310b61de34d1da4c4204e8ace6ceb", "shasum": "" }, "require": { @@ -924,7 +924,7 @@ ], "support": { "issues": "https://github.com/phpseclib/phpseclib/issues", - "source": "https://github.com/phpseclib/phpseclib/tree/3.0.39" + "source": "https://github.com/phpseclib/phpseclib/tree/3.0.41" }, "funding": [ { @@ -940,7 +940,7 @@ "type": "tidelift" } ], - "time": "2024-06-24T06:27:33+00:00" + "time": "2024-08-12T00:13:54+00:00" }, { "name": "psr/container", @@ -1112,16 +1112,16 @@ }, { "name": "symfony/console", - "version": "v5.4.42", + "version": "v5.4.43", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "cef62396a0477e94fc52e87a17c6e5c32e226b7f" + "reference": "e86f8554de667c16dde8aeb89a3990cfde924df9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/cef62396a0477e94fc52e87a17c6e5c32e226b7f", - "reference": "cef62396a0477e94fc52e87a17c6e5c32e226b7f", + "url": "https://api.github.com/repos/symfony/console/zipball/e86f8554de667c16dde8aeb89a3990cfde924df9", + "reference": "e86f8554de667c16dde8aeb89a3990cfde924df9", "shasum": "" }, "require": { @@ -1191,7 +1191,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.42" + "source": "https://github.com/symfony/console/tree/v5.4.43" }, "funding": [ { @@ -1207,7 +1207,7 @@ "type": "tidelift" } ], - "time": "2024-07-26T12:21:55+00:00" + "time": "2024-08-13T16:31:56+00:00" }, { "name": "symfony/css-selector", @@ -2130,16 +2130,16 @@ }, { "name": "symfony/string", - "version": "v5.4.42", + "version": "v5.4.43", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "909cec913edea162a3b2836788228ad45fcab337" + "reference": "8be1d484951ff5ca995eaf8edcbcb8b9a5888450" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/909cec913edea162a3b2836788228ad45fcab337", - "reference": "909cec913edea162a3b2836788228ad45fcab337", + "url": "https://api.github.com/repos/symfony/string/zipball/8be1d484951ff5ca995eaf8edcbcb8b9a5888450", + "reference": "8be1d484951ff5ca995eaf8edcbcb8b9a5888450", "shasum": "" }, "require": { @@ -2196,7 +2196,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.42" + "source": "https://github.com/symfony/string/tree/v5.4.43" }, "funding": [ { @@ -2212,7 +2212,7 @@ "type": "tidelift" } ], - "time": "2024-07-20T18:38:32+00:00" + "time": "2024-08-01T10:24:28+00:00" } ], "packages-dev": [ @@ -2695,16 +2695,16 @@ }, { "name": "fidry/cpu-core-counter", - "version": "1.1.0", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/theofidry/cpu-core-counter.git", - "reference": "f92996c4d5c1a696a6a970e20f7c4216200fcc42" + "reference": "8520451a140d3f46ac33042715115e290cf5785f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/f92996c4d5c1a696a6a970e20f7c4216200fcc42", - "reference": "f92996c4d5c1a696a6a970e20f7c4216200fcc42", + "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/8520451a140d3f46ac33042715115e290cf5785f", + "reference": "8520451a140d3f46ac33042715115e290cf5785f", "shasum": "" }, "require": { @@ -2744,7 +2744,7 @@ ], "support": { "issues": "https://github.com/theofidry/cpu-core-counter/issues", - "source": "https://github.com/theofidry/cpu-core-counter/tree/1.1.0" + "source": "https://github.com/theofidry/cpu-core-counter/tree/1.2.0" }, "funding": [ { @@ -2752,20 +2752,20 @@ "type": "github" } ], - "time": "2024-02-07T09:43:46+00:00" + "time": "2024-08-06T10:04:20+00:00" }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.60.0", + "version": "v3.64.0", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "e595e4e070d17c5d42ed8c4206f630fcc5f401a4" + "reference": "58dd9c931c785a79739310aef5178928305ffa67" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/e595e4e070d17c5d42ed8c4206f630fcc5f401a4", - "reference": "e595e4e070d17c5d42ed8c4206f630fcc5f401a4", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/58dd9c931c785a79739310aef5178928305ffa67", + "reference": "58dd9c931c785a79739310aef5178928305ffa67", "shasum": "" }, "require": { @@ -2847,7 +2847,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.60.0" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.64.0" }, "funding": [ { @@ -2855,7 +2855,7 @@ "type": "github" } ], - "time": "2024-07-25T09:26:51+00:00" + "time": "2024-08-30T23:09:38+00:00" }, { "name": "macopedia/phpstan-magento1", @@ -3486,16 +3486,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.11.7", + "version": "1.12.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "52d2bbfdcae7f895915629e4694e9497d0f8e28d" + "reference": "384af967d35b2162f69526c7276acadce534d0e1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/52d2bbfdcae7f895915629e4694e9497d0f8e28d", - "reference": "52d2bbfdcae7f895915629e4694e9497d0f8e28d", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/384af967d35b2162f69526c7276acadce534d0e1", + "reference": "384af967d35b2162f69526c7276acadce534d0e1", "shasum": "" }, "require": { @@ -3540,7 +3540,7 @@ "type": "github" } ], - "time": "2024-07-06T11:17:41+00:00" + "time": "2024-08-27T09:18:05+00:00" }, { "name": "phpunit/php-code-coverage", @@ -6038,16 +6038,16 @@ }, { "name": "symfony/finder", - "version": "v5.4.42", + "version": "v5.4.43", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "0724c51fa067b198e36506d2864e09a52180998a" + "reference": "ae25a9145a900764158d439653d5630191155ca0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/0724c51fa067b198e36506d2864e09a52180998a", - "reference": "0724c51fa067b198e36506d2864e09a52180998a", + "url": "https://api.github.com/repos/symfony/finder/zipball/ae25a9145a900764158d439653d5630191155ca0", + "reference": "ae25a9145a900764158d439653d5630191155ca0", "shasum": "" }, "require": { @@ -6081,7 +6081,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.42" + "source": "https://github.com/symfony/finder/tree/v5.4.43" }, "funding": [ { @@ -6097,7 +6097,7 @@ "type": "tidelift" } ], - "time": "2024-07-22T08:53:29+00:00" + "time": "2024-08-13T14:03:51+00:00" }, { "name": "symfony/options-resolver", diff --git a/dev/tests/functional/bootstrap.php b/dev/tests/functional/bootstrap.php deleted file mode 100644 index eb3d5b7f9a0..00000000000 --- a/dev/tests/functional/bootstrap.php +++ /dev/null @@ -1,23 +0,0 @@ -=5.4.0", - "phpunit/phpunit": "4.1.0", - "phpunit/phpunit-selenium": ">=1.2", - "netwing/selenium-server-standalone": ">=2.35" - }, - "autoload": { - "psr-4": { - "Magento\\": ["lib/Magento/", "vendor/magento/mtf/Magento/", "testsuites/Magento/"], - "Mage\\": ["generated/Mage/", "tests/app/Mage/"], - "Test\\": "generated/Test/" - } - } -} diff --git a/dev/tests/functional/credentials.xml.dist b/dev/tests/functional/credentials.xml.dist deleted file mode 100644 index a35a21f5662..00000000000 --- a/dev/tests/functional/credentials.xml.dist +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/etc/config.xml b/dev/tests/functional/etc/config.xml deleted file mode 100644 index 9553f8b3463..00000000000 --- a/dev/tests/functional/etc/config.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - testCase - admin - 123123q123123q - - - - 127.0.0.1 - root - 123123q - default - http://127.0.0.1/magento1/ - admin - - - dev/tests/mtf/isolation.php - before - none - none - - - - - ANY - - - - - - - - - diff --git a/dev/tests/functional/etc/config.xsd b/dev/tests/functional/etc/config.xsd deleted file mode 100644 index ffa714d8e47..00000000000 --- a/dev/tests/functional/etc/config.xsd +++ /dev/null @@ -1,169 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/etc/di.xml b/dev/tests/functional/etc/di.xml deleted file mode 100644 index 3850413a8b7..00000000000 --- a/dev/tests/functional/etc/di.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - etc/config.xsd - - - diff --git a/dev/tests/functional/etc/events.xml b/dev/tests/functional/etc/events.xml deleted file mode 100644 index 8c6f8842d61..00000000000 --- a/dev/tests/functional/etc/events.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/etc/events.xsd b/dev/tests/functional/etc/events.xsd deleted file mode 100644 index 3f4bb1fd469..00000000000 --- a/dev/tests/functional/etc/events.xsd +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - Observer class must be unique. - - - - - - - - - - - - Preset name must be unique. - - - - - - - - - - - - - - Tag name must be unique. - - - - - - - - - - - - - - - - Observer node with all attached tags for events inside - - - - - - - - - - - - Tag with name to look for - - - - - - diff --git a/dev/tests/functional/isolation.php b/dev/tests/functional/isolation.php deleted file mode 100644 index d3a21560f7a..00000000000 --- a/dev/tests/functional/isolation.php +++ /dev/null @@ -1,19 +0,0 @@ -configuration = $configuration; - $this->remoteDriverFactory = $remoteDriverFactory; - $this->eventManager = $eventManager; - $this->objectManager = $objectManager; - $this->pageLoader = $pageLoader; - - $this->init(); - } - - /** - * Destructor. - * - * @return void - */ - public function __destruct() - { - if ($this->driver->getSessionId()) { - $this->driver->stop(); - } - } - - /** - * Initial web driver. - * - * @return void - */ - protected function init() - { - $this->driver = $this->remoteDriverFactory->create(); - - $this->driver->setBrowserUrl('about:blank'); - $params = $this->configuration->get('server/0/item/selenium'); - $this->driver->setupSpecificBrowser($params); - $this->driver->prepareSession(); - $this->driver->currentWindow()->maximize(); - $this->driver->cookie()->clear(); - $this->driver->refresh(); - } - - /** - * Get native element by locator. - * - * @param Locator $locator - * @param \PHPUnit_Extensions_Selenium2TestCase_Element $context - * @param bool $wait - * @return \PHPUnit_Extensions_Selenium2TestCase_Element - * @throws \Exception - */ - protected function findElement( - Locator $locator, - \PHPUnit_Extensions_Selenium2TestCase_Element $context = null, - $wait = true - ) { - $context = $context === null - ? $this->driver - : $context; - - $criteria = $this->getSearchCriteria($locator); - $this->pageLoader->setDriver($this->driver)->wait(); - if ($wait) { - return $this->waitUntil( - function () use ($context, $criteria) { - $element = $context->element($criteria); - return $element->displayed() ? $element : null; - } - ); - } - - $this->pageLoader->wait(); - - return $context->element($criteria); - } - - /** - * Get native element by Mtf Element. - * - * @param ElementInterface $element - * @param bool $wait - * @return null|\PHPUnit_Extensions_Selenium2TestCase_Element - * @throws \PHPUnit_Extensions_Selenium2TestCase_WebDriverException - */ - protected function getNativeElement(ElementInterface $element, $wait = true) - { - $chainElements = [$element]; - while ($element = $element->getContext()) { - $chainElements[] = $element; - } - - $contextElement = null; - /** @var ElementInterface $context */ - foreach (array_reverse($chainElements) as $chainElement) { - /** @var ElementInterface $chainElement */ - try { - // First call "getElement" with $resultElement equal "null" value - $contextElement = $this->findElement($chainElement->getLocator(), $contextElement, $wait); - } catch (\PHPUnit_Extensions_Selenium2TestCase_WebDriverException $e) { - throw new \PHPUnit_Extensions_Selenium2TestCase_WebDriverException( - sprintf( - 'Error occurred on attempt to get element. Message: "%s". Locator: "%s" . Wait: "%s"', - $e->getMessage(), - $chainElement->getAbsoluteSelector(), - $wait - ) - ); - } - } - - return $contextElement; - } - - /** - * Get search criteria. - * - * @param Locator $locator - * @return \PHPUnit_Extensions_Selenium2TestCase_ElementCriteria - */ - public function getSearchCriteria(Locator $locator) - { - $criteria = new \PHPUnit_Extensions_Selenium2TestCase_ElementCriteria($locator['using']); - $criteria->value($locator['value']); - - return $criteria; - } - - /** - * Inject Js Error collector. - * - * @return void - */ - public function injectJsErrorCollector() - { - $this->driver->execute( - [ - 'script' => 'window.onerror = function(msg, url, line) { - var errors = {}; - if (localStorage.getItem("errorsHistory")) { - errors = JSON.parse(localStorage.getItem("errorsHistory")); - } - if (!(window.location.href in errors)) { - errors[window.location.href] = []; - } - errors[window.location.href].push("error: \'" + msg + "\' " + "file: " + url + " " + "line: " + line); - localStorage.setItem("errorsHistory", JSON.stringify(errors)); - }', - 'args' => [] - ] - ); - } - - /** - * Get js errors. - * - * @return string[] - */ - public function getJsErrors() - { - return $this->driver->execute( - [ - 'script' => 'errors = JSON.parse(localStorage.getItem("errorsHistory")); - localStorage.removeItem("errorsHistory"); - return errors;', - 'args' => [] - ] - ); - } - - /** - * Click. - * - * @param ElementInterface $element - * @return void - */ - public function click(ElementInterface $element) - { - $absoluteSelector = $element->getAbsoluteSelector(); - $this->eventManager->dispatchEvent(['click_before'], [__METHOD__, $absoluteSelector]); - - $wrapperElement = $this->getNativeElement($element); - $this->driver->moveto($wrapperElement); - $wrapperElement->click(); - - $this->eventManager->dispatchEvent(['click_after'], [__METHOD__, $absoluteSelector]); - } - - /** - * Double click. - * - * @param ElementInterface $element - * @return void - */ - public function doubleClick(ElementInterface $element) - { - $this->eventManager->dispatchEvent(['double_click_before'], [__METHOD__, $element->getAbsoluteSelector()]); - - $this->driver->moveto($this->getNativeElement($element)); - $this->driver->doubleclick(); - } - - /** - * Right click. - * - * @param ElementInterface $element - * @return void - */ - public function rightClick(ElementInterface $element) - { - $this->eventManager->dispatchEvent(['right_click_before'], [__METHOD__, $element->getAbsoluteSelector()]); - - $this->driver->moveto($this->getNativeElement($element)); - $this->driver->click(\PHPUnit_Extensions_Selenium2TestCase_SessionCommand_Click::RIGHT); - } - - /** - * Check whether element is present in the DOM. - * - * @param ElementInterface $element - * @return bool - */ - public function isPresent(ElementInterface $element) - { - $isPresent = true; - $nativeElement = null; - try { - $this->eventManager->dispatchEvent(['is_present'], [__METHOD__, $element->getAbsoluteSelector()]); - $nativeElement = $this->getNativeElement($element, false); - } catch (\PHPUnit_Extensions_Selenium2TestCase_WebDriverException $e) { - $isPresent = false; - } - return $nativeElement !== null && $isPresent; - } - - /** - * Check whether element is visible. - * - * @param ElementInterface $element - * @return bool - */ - public function isVisible(ElementInterface $element) - { - try { - $this->eventManager->dispatchEvent(['is_visible'], [__METHOD__, $element->getAbsoluteSelector()]); - $visible = $this->getNativeElement($element, false)->displayed(); - } catch (\PHPUnit_Extensions_Selenium2TestCase_WebDriverException $e) { - $visible = false; - } - - return $visible; - } - - /** - * Check whether element is enabled. - * - * @param ElementInterface $element - * @return bool - */ - public function isDisabled(ElementInterface $element) - { - return !$this->getNativeElement($element)->enabled(); - } - - /** - * Check whether element is selected. - * - * @param ElementInterface $element - * @return bool - */ - public function isSelected(ElementInterface $element) - { - return $this->getNativeElement($element)->selected(); - } - - /** - * Set the value. - * - * @param ElementInterface $element - * @param string|array $value - * @return void - */ - public function setValue(ElementInterface $element, $value) - { - $this->eventManager->dispatchEvent(['set_value'], [__METHOD__, $element->getAbsoluteSelector()]); - - $wrappedElement = $this->getNativeElement($element); - $this->driver->moveto($wrappedElement); - $wrappedElement->clear(); - $this->focus($element); - - $wrappedElement->value($value); - $this->triggerChangeEvent($element); - } - - /** - * Get the value. - * - * @param ElementInterface $element - * @return null|string - */ - public function getValue(ElementInterface $element) - { - $this->eventManager->dispatchEvent(['get_value'], [__METHOD__, $element->getAbsoluteSelector()]); - return $this->getNativeElement($element)->value(); - } - - /** - * Get content. - * - * @param ElementInterface $element - * @return string - */ - public function getText(ElementInterface $element) - { - return $this->getNativeElement($element)->text(); - } - - /** - * Find element on the page. - * - * @param string $selector - * @param string $strategy - * @param string $type = select|multiselect|checkbox|null OR custom class with full namespace - * @param ElementInterface $context - * @return ElementInterface - * @throws \Exception - */ - public function find( - $selector, - $strategy = Locator::SELECTOR_CSS, - $type = null, - ElementInterface $context = null - ) { - $locator = new Locator($selector, $strategy); - - $this->eventManager->dispatchEvent(['find'], [__METHOD__, $locator]); - - $className = 'Magento\Mtf\Client\ElementInterface'; - if (null !== $type) { - if (strpos($type, '\\') === false) { - $type = ucfirst(strtolower($type)); - if (class_exists('Magento\Mtf\Client\Element\\' . $type . 'Element')) { - $className = 'Magento\Mtf\Client\Element\\' . $type . 'Element'; - } - } else { - if (!class_exists($type) && !interface_exists($type)) { - throw new \Exception( - sprintf('Requested interface or class "%s" does not exists!', $type) - ); - } - $className = $type; - } - } - - return $this->objectManager->create( - $className, - [ - 'driver' => $this, - 'locator' => $locator, - 'context' => $context - ] - ); - } - - /** - * Drag and drop element to(between) another element(s). - * - * @param ElementInterface $element - * @param ElementInterface $target - * @return void - */ - public function dragAndDrop(ElementInterface $element, ElementInterface $target) - { - $this->driver->moveto($this->getNativeElement($element)); - $this->driver->buttondown(); - - $this->driver->moveto($this->getNativeElement($target)); - $this->driver->buttonup(); - } - - /** - * Hover mouse over an element. - * - * @param ElementInterface $element - * @return void - */ - public function hover(ElementInterface $element) - { - $this->driver->moveto($this->getNativeElement($element)); - } - - /** - * Send a sequence of key strokes to the active element. - * - * @param ElementInterface $element - * @param array $keys - * @return void - */ - public function keys(ElementInterface $element, array $keys) - { - $wrappedElement = $this->getNativeElement($element); - $wrappedElement->clear(); - $this->focus($element); - foreach ($keys as $key) { - $this->driver->keys($key); - } - } - - /** - * Wait until callback isn't null or timeout occurs. - * - * @param callable $callback - * @return mixed - * @throws \Exception - */ - public function waitUntil($callback) - { - return $this->driver->waitUntil($callback); - } - - /** - * Get all elements by locator. - * - * @param ElementInterface $context - * @param string $selector - * @param string $strategy - * @param null|string $type - * @param bool $wait - * @return ElementInterface[] - * @throws \Exception - */ - public function getElements( - ElementInterface $context, - $selector, - $strategy = Locator::SELECTOR_CSS, - $type = null, - $wait = true - ) { - $locator = new Locator($selector, $strategy); - $criteria = $this->getSearchCriteria($locator); - $nativeContext = $this->getNativeElement($context); - $resultElements = []; - if ($wait) { - try { - $nativeElements = $this->waitUntil( - function () use ($nativeContext, $criteria) { - return $nativeContext->elements($criteria); - } - ); - } catch (\Exception $e) { - throw new \Exception( - sprintf( - 'Error occurred during waiting for an elements. Message: "%s". Locator: "%s"', - $e->getMessage(), - $context->getAbsoluteSelector() . ' -> ' . $locator - ) - ); - } - } else { - $nativeElements = $nativeContext->elements($criteria); - } - - foreach ($nativeElements as $key => $element) { - $resultElements[] = $this->find( - $this->getRelativeXpath($element, $nativeContext), - Locator::SELECTOR_XPATH, - $type, - $context - ); - } - - return $resultElements; - } - - /** - * Retrieve relative xpath from context to element. - * - * @param \PHPUnit_Extensions_Selenium2TestCase_Element $element - * @param \PHPUnit_Extensions_Selenium2TestCase_Element $context - * @param string $path - * @param bool $includeLastIndex - * @return null - */ - protected function getRelativeXpath( - \PHPUnit_Extensions_Selenium2TestCase_Element $element, - \PHPUnit_Extensions_Selenium2TestCase_Element $context, - $path = '', - $includeLastIndex = true - ) { - if ($element->equals($context)) { - return '.' . $path; - } - - $parentLocator = new Locator('..', Locator::SELECTOR_XPATH); - $parentElement = $element->element($this->getSearchCriteria($parentLocator)); - - $childrenLocator = new Locator('*', Locator::SELECTOR_XPATH); - - $index = 1; - $tag = $element->name(); - if (!$includeLastIndex) { - return $this->getRelativeXpath($parentElement, $context, '/' . $tag); - } - foreach ($parentElement->elements($this->getSearchCriteria($childrenLocator)) as $child) { - if ($child->equals($element)) { - return $this->getRelativeXpath($parentElement, $context, '/' . $tag . '[' . $index . ']' . $path); - } - if ($child->name() == $tag) { - ++$index; - } - } - return null; - } - - /** - * Get the value of a the given attribute of the element. - * - * @param ElementInterface $element - * @param string $name - * @return string - */ - public function getAttribute(ElementInterface $element, $name) - { - return $this->getNativeElement($element)->attribute($name); - } - - /** - * Open page. - * - * @param string $url - * @return void - */ - public function open($url) - { - $this->eventManager->dispatchEvent(['open_before'], [__METHOD__, $url]); - $this->driver->url($url); - $this->eventManager->dispatchEvent(['open_after'], [__METHOD__, $url]); - } - - /** - * Back to previous page. - * - * @return void - */ - public function back() - { - $this->driver->back(); - $this->eventManager->dispatchEvent(['back'], [__METHOD__]); - } - - /** - * Forward page. - * - * @return void - */ - public function forward() - { - $this->driver->forward(); - $this->eventManager->dispatchEvent(['forward'], [__METHOD__]); - } - - /** - * Refresh page. - * - * @return void - */ - public function refresh() - { - $this->driver->refresh(); - } - - /** - * Reopen browser. - * - * @return void - */ - public function reopen() - { - $this->eventManager->dispatchEvent(['reopen'], [__METHOD__]); - if ($this->driver->getSessionId()) { - $this->driver->stop(); - } - if ($sessionStrategy = $this->configuration->get('server/0/item/selenium/sessionStrategy')) { - $this->driver->setSessionStrategy($sessionStrategy); - } else { - $this->driver->setSessionStrategy('isolated'); - } - $this->init(); - } - - /** - * Change the focus to a frame in the page by locator. - * - * @param Locator|null $locator - * @return void - * @throws \Exception - */ - public function switchToFrame(Locator $locator = null) - { - if ($locator) { - $this->eventManager->dispatchEvent(['switch_to_frame'], [(string)$locator]); - try { - $element = $this->findElement($locator); - } catch (\Exception $e) { - throw new \Exception( - sprintf( - 'Error occurred during switch to frame! Message: "%s". Locator: "%s".', - $e->getMessage(), - $locator - ) - ); - } - } else { - $this->eventManager->dispatchEvent(['switch_to_frame'], ['Switch to main window']); - $element = null; - } - - $this->driver->frame($element); - } - - /** - * Close the current window. - * - * @return void - */ - public function closeWindow() - { - $windowHandles = $this->driver->windowHandles(); - if (count($windowHandles) > 1) { - $this->driver->window(end($windowHandles)); - $this->driver->closeWindow(); - $this->driver->window(reset($windowHandles)); - } else { - $this->driver->closeWindow(); - } - } - - /** - * Select window by its name. - * - * @return void - */ - public function selectWindow() - { - $windowHandles = $this->driver->windowHandles(); - $this->driver->window(end($windowHandles)); - } - - /** - * Get page title text. - * - * @return string - */ - public function getTitle() - { - return $this->driver->title(); - } - - /** - * Press OK on an alert or confirm a dialog. - * - * @return void - */ - public function acceptAlert() - { - //$this->_driver->acceptAlert(); Temporary fix for selenium issue 3544 - $this->waitForOperationSuccess('acceptAlert'); - $this->eventManager->dispatchEvent(['accept_alert_after'], [__METHOD__]); - } - - /** - * Press Cancel on alert or does not confirm a dialog. - * - * @return void - */ - public function dismissAlert() - { - //$this->_driver->dismissAlert(); Temporary fix for selenium issue 3544 - $this->waitForOperationSuccess('dismissAlert'); - $this->eventManager->dispatchEvent(['dismiss_alert_after'], [__METHOD__]); - } - - /** - * @todo Temporary fix for selenium issue 3544 - * https://code.google.com/p/selenium/issues/detail?id=3544 - * - * @param string $operation - */ - protected function waitForOperationSuccess($operation) - { - $driver = $this->driver; - $this->waitUntil( - function () use ($driver, $operation) { - try { - $driver->$operation(); - } catch (\PHPUnit_Extensions_Selenium2TestCase_WebDriverException $exception) { - return null; - } - return true; - } - ); - } - - /** - * Get the alert dialog text. - * - * @return string - */ - public function getAlertText() - { - return $this->driver->alertText(); - } - - /** - * Set the text to a prompt popup. - * - * @param string $text - * @return void - */ - public function setAlertText($text) - { - $this->driver->alertText($text); - } - - /** - * Get current page url. - * - * @return string - */ - public function getUrl() - { - try { - if ($this->driver->alertText()) { - return null; - } - } catch (\PHPUnit_Extensions_Selenium2TestCase_WebDriverException $exception) { - return $this->driver->url(); - } - - return $this->driver->url(); - } - - /** - * Get Html page source. - * - * @return string - */ - public function getHtmlSource() - { - return $this->driver->source(); - } - - /** - * Get binary string of image. - * - * @return string - */ - public function getScreenshotData() - { - return $this->driver->currentScreenshot(); - } - - /** - * Set focus on element. - * - * @param ElementInterface $element - * @return void - */ - public function focus(ElementInterface $element) - { - $elementId = $element->getAttribute('id'); - if ($elementId) { - $js = "if (window.jQuery != undefined) jQuery('[id=\"$elementId\"]').focus(); "; - $js .= "var element = document.getElementById('$elementId'); if (element != undefined) element.focus();"; - $this->driver->execute(['script' => $js, 'args' => []]); - } else { - $element->click(); - } - } - - /** - * Trigger change on event. - * - * @param ElementInterface $element - * @return void - */ - protected function triggerChangeEvent(ElementInterface $element) - { - $elementId = $element->getAttribute('id'); - if ($elementId) { - $js = "if (window.jQuery != undefined)"; - $js .= "{jQuery('[id=\"$elementId\"]').change(); jQuery('[id=\"$elementId\"]').keyup();}"; - $js .= "var element = document.getElementById('$elementId'); if (element != undefined) element.focus();"; - $this->driver->execute(['script' => $js, 'args' => []]); - } - } -} diff --git a/dev/tests/functional/lib/Magento/Mtf/Client/Element/ConditionsElement.php b/dev/tests/functional/lib/Magento/Mtf/Client/Element/ConditionsElement.php deleted file mode 100644 index f4a4b481750..00000000000 --- a/dev/tests/functional/lib/Magento/Mtf/Client/Element/ConditionsElement.php +++ /dev/null @@ -1,507 +0,0 @@ - '{', - '\}' => '}', - '\[' => '&lbracket;', - '\]' => '&rbracket;', - '\:' => ':', - ]; - - /** - * Map decode special chars. - * - * @var array - */ - protected $decodeChars = [ - '{' => '{', - '}' => '}', - '&lbracket;' => '[', - '&rbracket;' => ']', - ':' => ':', - ]; - - /** - * Rule param wait locator. - * - * @var string - */ - protected $ruleParamWait = './/*[@class="rule-param-wait"]'; - - /** - * Chooser grid locator. - * - * @var string - */ - protected $chooserGridLocator = 'div[id*=chooser]'; - - /** - * Rule param input selector. - * - * @var string - */ - protected $ruleParamInput = '.element [name^="rule"]'; - - /** - * Backend abstract block selector. - * - * @var string - */ - protected $templateBlock = './ancestor::body'; - - /** - * Set value to conditions. - * - * @param string $value - * @return void - */ - public function setValue($value) - { - $conditions = $this->decodeValue($value); - $context = $this->find($this->mainCondition, Locator::SELECTOR_XPATH); - $this->clear(); - $this->addMultipleCondition($conditions, $context); - } - - /** - * Add condition combination. - * - * @param string $condition - * @param ElementInterface $context - * @return ElementInterface - */ - protected function addConditionsCombination($condition, ElementInterface $context) - { - $condition = $this->parseCondition($condition); - $this->addCondition($condition['type'], $context); - $createdCondition = $context->find($this->created, Locator::SELECTOR_XPATH); - if (!empty($condition['rules'])) { - $this->fillCondition($condition['rules'], $createdCondition); - } - return $createdCondition; - } - - /** - * Add condition. - * - * @param string $type - * @param ElementInterface $context - * @throws \Exception - * @throws \PHPUnit_Extensions_Selenium2TestCase_WebDriverException - */ - protected function addCondition($type, ElementInterface $context) - { - $newCondition = $context->find($this->newCondition, Locator::SELECTOR_XPATH); - $count = 0; - - do { - $newCondition->find($this->addNew, Locator::SELECTOR_XPATH)->click(); - - try { - $newCondition->find($this->typeNew, Locator::SELECTOR_XPATH, 'select')->setValue($type); - $this->getTemplateBlock()->waitLoader(); - $this->waitForCondition(); - $isSetType = true; - } catch (\PHPUnit_Extensions_Selenium2TestCase_WebDriverException $e) { - $isSetType = false; - $this->exception = $e; - $this->eventManager->dispatchEvent(['exception'], [__METHOD__, $this->getAbsoluteSelector()]); - } - $count++; - } while (!$isSetType && $count < self::TRY_COUNT); - - if (!$isSetType) { - $exception = $this->exception ? $this->exception : (new \Exception("Can not add condition: {$type}")); - throw $exception; - } - } - - /** - * Add conditions. - * - * @param array $conditions - * @param ElementInterface $context - * @return void - */ - protected function addMultipleCondition(array $conditions, ElementInterface $context) - { - foreach ($conditions as $key => $condition) { - $elementContext = is_numeric($key) ? $context : $this->addConditionsCombination($key, $context); - if (is_string($condition)) { - $this->addSingleCondition($condition, $elementContext); - } else { - $this->addMultipleCondition($condition, $elementContext); - } - } - } - - /** - * Add single Condition. - * - * @param string $condition - * @param ElementInterface $context - * @return void - */ - protected function addSingleCondition($condition, ElementInterface $context) - { - $condition = $this->parseCondition($condition); - $this->addCondition($condition['type'], $context); - $createdCondition = $context->find($this->created, Locator::SELECTOR_XPATH); - $this->fillCondition($condition['rules'], $createdCondition); - } - - /** - * Fill single condition. - * - * @param array $rules - * @param ElementInterface $element - * @return void - * @throws \Exception - */ - protected function fillCondition(array $rules, ElementInterface $element) - { - $this->resetKeyParam(); - foreach ($rules as $rule) { - /** @var ElementInterface $param */ - $param = $this->findNextParam($element); - $isSet = false; - $count = 0; - - do { - try { - $openParamLink = $param->find('a'); - if ($openParamLink->isVisible()) { - $openParamLink->click(); - } - if (preg_match('`%(.*?)%`', $rule, $chooserGrid)) { - $chooserConfig = explode('#', $chooserGrid[1]); - $param->find($this->chooserLocator)->click(); - $rule = preg_replace('`%(.*?)%`', '', $rule); - $grid = ObjectManager::getInstance()->create( - str_replace('/', '\\', $chooserConfig[0]), - [ - 'element' => $this->find($this->chooserGridLocator) - ] - ); - $grid->searchAndSelect([$chooserConfig[1] => $rule]); - $isSet = true; - continue; - } - $input = $this->ruleParamInput; - $param->waitUntil( - function () use ($param, $input) { - $element = $param->find($input); - return $element->isVisible() ? true : null; - } - ); - $value = $param->find('select', Locator::SELECTOR_TAG_NAME, 'select'); - if ($value->isVisible()) { - $value->setValue($rule); - $isSet = true; - continue; - } - $value = $param->find('input', Locator::SELECTOR_TAG_NAME); - if ($value->isVisible()) { - $value->setValue($rule); - $apply = $param->find('.//*[@class="rule-param-apply"]', Locator::SELECTOR_XPATH); - if ($apply->isVisible()) { - $apply->click(); - } - $isSet = true; - continue; - } - } catch (\PHPUnit_Extensions_Selenium2TestCase_WebDriverException $e) { - $isSet = false; - $this->exception = $e; - $this->eventManager->dispatchEvent(['exception'], [__METHOD__, $this->getAbsoluteSelector()]); - } - $count++; - } while (!$isSet && $count < self::TRY_COUNT); - - if (!$isSet) { - $exception = $this->exception ? $this->exception : (new \Exception('Can not set value: ' . $rule)); - throw $exception; - } - } - } - - /** - * Decode value. - * - * @param string $value - * @return array - * @throws \Exception - */ - protected function decodeValue($value) - { - $value = str_replace(array_keys($this->encodeChars), $this->encodeChars, $value); - $value = preg_replace('/(\]|})({|\[)/', '$1,$2', $value); - $value = preg_replace('/{([^:]+):/', '{"$1":', $value); - $value = preg_replace('/\[([^\[{])/', '"$1', $value); - $value = preg_replace('/([^\]}])\]/', '$1"', $value); - $value = str_replace(array_keys($this->decodeChars), $this->decodeChars, $value); - - $value = "[{$value}]"; - $value = json_decode($value, true); - if (null === $value) { - throw new \Exception('Bad format value.'); - } - return $value; - } - - /** - * Parse condition. - * - * @param string $condition - * @return array - * @throws \Exception - */ - protected function parseCondition($condition) - { - if (!preg_match_all('/([^|]+\|?)/', $condition, $match)) { - throw new \Exception('Bad format condition'); - } - foreach ($match[1] as $key => $value) { - $match[1][$key] = rtrim($value, '|'); - } - - return [ - 'type' => array_shift($match[1]), - 'rules' => array_values($match[1]), - ]; - } - - /** - * Find next param of condition for fill. - * - * @param ElementInterface $context - * @return ElementInterface - * @throws \Exception - */ - protected function findNextParam(ElementInterface $context) - { - do { - if (!isset($this->mapParams[$this->findKeyParam])) { - throw new \Exception("Empty map of params"); - } - $param = $this->mapParams[$this->findKeyParam]; - $element = $context->find(sprintf($this->param, strlen($param), $param), Locator::SELECTOR_XPATH); - $this->findKeyParam += 1; - } while (!$element->isVisible()); - - return $element; - } - - /** - * Reset key of last find param. - * - * @return void - */ - protected function resetKeyParam() - { - $this->findKeyParam = 0; - } - - /** - * Param wait loader. - * - * @return void - */ - protected function waitForCondition() - { - $browser = $this; - $selector = $this->created; - $this->waitUntil( - function () use ($browser, $selector) { - if (!$browser->find($selector, Locator::SELECTOR_XPATH)->isVisible()) { - return null; - } - return true; - } - ); - } - - /** - * Clear conditions. - * - * @return void - */ - protected function clear() - { - $remote = $this->find($this->remove, Locator::SELECTOR_XPATH); - while ($remote->isVisible()) { - $remote->click(); - $remote = $this->find($this->remove, Locator::SELECTOR_XPATH); - } - } - - /** - * Get backend abstract block. - * - * @return Template - */ - protected function getTemplateBlock() - { - return ObjectManager::getInstance()->create( - 'Mage\Adminhtml\Test\Block\Template', - ['element' => $this->driver->find($this->templateBlock, Locator::SELECTOR_XPATH)] - ); - } - - /** - * Get value from conditions. - * - * @return null - */ - public function getValue() - { - return null; - } -} diff --git a/dev/tests/functional/lib/Magento/Mtf/Client/Element/MultiselectgrouplistElement.php b/dev/tests/functional/lib/Magento/Mtf/Client/Element/MultiselectgrouplistElement.php deleted file mode 100644 index 0aa56c08882..00000000000 --- a/dev/tests/functional/lib/Magento/Mtf/Client/Element/MultiselectgrouplistElement.php +++ /dev/null @@ -1,320 +0,0 @@ -deselectAll(); - $values = is_array($values) ? $values : [$values]; - foreach ($values as $value) { - $this->selectOption($value); - } - } - - /** - * Select option. - * - * @param string $option - * @return void - * @throws \Exception - */ - protected function selectOption($option) - { - $isOptgroup = false; - $optgroupIndent = ''; - $values = explode('/', $option); - $context = $this; - - foreach ($values as $value) { - $optionIndent = $isOptgroup ? $this->indent : ''; - $optionElement = $context->find(sprintf($this->option, $optionIndent . $value), Locator::SELECTOR_XPATH); - if ($optionElement->isVisible()) { - if (!$optionElement->isSelected()) { - $optionElement->click(); - } - return; - } - - $value = $optgroupIndent . $value; - $optgroupIndent .= $this->indent; - if ($isOptgroup) { - $context = $this->getChildOptgroup($value, $context); - } else { - $context = $this->getOptgroup($value, $context); - $isOptgroup = true; - } - } - throw new \Exception("Can't find option \"{$option}\"."); - } - - /** - * Get optgroup. - * - * @param string $value - * @param ElementInterface $context - * @return ElementInterface - * @throws \Exception - */ - protected function getOptgroup($value, ElementInterface $context) - { - $optgroup = $context->find(sprintf($this->optgroupByLabel, $value), Locator::SELECTOR_XPATH); - if (!$optgroup->isVisible()) { - throw new \Exception("Can't find group \"{$value}\"."); - } - - return $optgroup; - } - - /** - * Get child optgroup. - * - * @param string $value - * @param ElementInterface $context - * @return ElementInterface - * @throws \Exception - */ - protected function getChildOptgroup($value, ElementInterface $context) - { - $childOptgroup = null; - $count = 1; - while (!$childOptgroup) { - $optgroup = $context->find(sprintf($this->nextOptgroup, $count), Locator::SELECTOR_XPATH); - if (!$optgroup->isVisible()) { - throw new \Exception("Can't find child group \"{$value}\""); - } - - $childOptgroup = $context->find( - sprintf($this->childOptgroup, $count, $value), - Locator::SELECTOR_XPATH - ); - if (!$childOptgroup->isVisible()) { - $childOptgroup = null; - } - ++$count; - } - - return $childOptgroup; - } - - /** - * Get value. - * - * @return array - * @SuppressWarnings(PHPMD.NPathComplexity) - */ - public function getValue() - { - $values = []; - $indentOption = str_repeat(' ', self::INDENT_LENGTH); - - foreach ($this->getSelectedOptions() as $option) { - $value = []; - - /** @var ElementInterface $option */ - $optionText = $option->getText(); - $optionValue = trim($optionText, $this->trim); - $value[] = $optionValue; - if (0 !== strpos($optionText, $indentOption)) { - $values[] = implode('/', $value); - continue; - } - - $pathOptgroup = sprintf($this->parentOptgroup, $this->indent . $optionValue); - $optgroup = $this->find($pathOptgroup, Locator::SELECTOR_XPATH); - $optgroupText = $optgroup->getAttribute('label'); - $optgroupValue = trim($optgroupText, $this->trim); - $amountIndent = strlen($optgroupText) - strlen($optgroupValue); - $amountIndent = $amountIndent ? ($amountIndent / strlen($this->indent)) : 0; - $value[] = $optgroupValue; - if (0 == $amountIndent) { - $values[] = implode('/', $value); - continue; - } - - --$amountIndent; - $indent = $amountIndent ? str_repeat($this->indent, $amountIndent) : ''; - $pathOptgroup .= sprintf($this->precedingOptgroup, $amountIndent * self::INDENT_LENGTH, $indent); - while (0 <= $amountIndent && $this->find($pathOptgroup, Locator::SELECTOR_XPATH)->isVisible()) { - $optgroup = $this->find($pathOptgroup, Locator::SELECTOR_XPATH); - $optgroupText = $optgroup->getAttribute('label'); - $optgroupValue = trim($optgroupText, $this->trim); - $value[] = $optgroupValue; - - --$amountIndent; - $indent = (0 < $amountIndent) ? str_repeat($this->indent, $amountIndent) : ''; - $pathOptgroup .= sprintf($this->precedingOptgroup, $amountIndent * self::INDENT_LENGTH, $indent); - } - - $values[] = implode('/', array_reverse($value)); - } - - return $values; - } - - /** - * Get options. - * - * @return ElementInterface[] - */ - protected function getOptions() - { - $options = []; - - $countOption = 1; - $option = $this->find(sprintf($this->optionByNumber, $countOption), Locator::SELECTOR_XPATH); - while ($option->isVisible()) { - $options[] = $option; - ++$countOption; - $option = $this->find(sprintf($this->optionByNumber, $countOption), Locator::SELECTOR_XPATH); - } - - $countOptgroup = 1; - $optgroup = $this->find(sprintf($this->optgroupByNumber, $countOptgroup), Locator::SELECTOR_XPATH); - while ($optgroup->isVisible()) { - $countOption = 1; - $option = $this->find( - sprintf($this->childOptionByNumber, $countOptgroup, $countOption), - Locator::SELECTOR_XPATH - ); - while ($option->isVisible()) { - $options[] = $option; - ++$countOption; - $option = $this->find( - sprintf($this->childOptionByNumber, $countOptgroup, $countOption), - Locator::SELECTOR_XPATH - ); - } - - ++$countOptgroup; - $optgroup = $this->find(sprintf($this->optgroupByNumber, $countOptgroup), Locator::SELECTOR_XPATH); - } - - return $options; - } - - /** - * Get selected options. - * - * @return array - */ - protected function getSelectedOptions() - { - $options = []; - foreach ($this->getOptions() as $option) { - if ($option->isSelected()) { - $options[] = $option; - } - } - - return $options; - } -} diff --git a/dev/tests/functional/lib/Magento/Mtf/Client/Element/MultiselectlistElement.php b/dev/tests/functional/lib/Magento/Mtf/Client/Element/MultiselectlistElement.php deleted file mode 100644 index 37a6df2239b..00000000000 --- a/dev/tests/functional/lib/Magento/Mtf/Client/Element/MultiselectlistElement.php +++ /dev/null @@ -1,62 +0,0 @@ -getElements($this->optionElement); - - foreach ($options as $option) { - /** @var \Magento\Mtf\Client\ElementInterface $option */ - $optionsValue[] = $option->getText(); - } - - return $optionsValue; - } - - /** - * Check whether value is visible in the list. - * - * @param string $value - * @return bool - */ - public function isValueVisible($value) - { - $option = $this->find(sprintf($this->optionByValue, $this->escapeQuotes($value)), Locator::SELECTOR_XPATH); - return $option->isVisible(); - } - -} diff --git a/dev/tests/functional/lib/Magento/Mtf/Client/Element/OptgroupselectElement.php b/dev/tests/functional/lib/Magento/Mtf/Client/Element/OptgroupselectElement.php deleted file mode 100644 index 99cd8dae76a..00000000000 --- a/dev/tests/functional/lib/Magento/Mtf/Client/Element/OptgroupselectElement.php +++ /dev/null @@ -1,98 +0,0 @@ -eventManager->dispatchEvent(['get_value'], [(string)$this->getAbsoluteSelector()]); - - $selectedLabel = ''; - $labels = $this->getElements($this->optionByIndex, Locator::SELECTOR_XPATH); - foreach ($labels as $label) { - if ($label->isSelected()) { - $selectedLabel = $label->getText(); - break; - } - } - if ($selectedLabel == '') { - throw new \Exception('Selected value has not been found in optgroup select.'); - } - - $element = $this->find(sprintf($this->optGroup, $selectedLabel), Locator::SELECTOR_XPATH); - $value = trim($element->getAttribute('label'), chr(0xC2) . chr(0xA0)); - $value .= '/' . $selectedLabel; - - return $value; - } - - /** - * Select value in dropdown which has option groups. - * - * @param string $value - * @return void - */ - public function setValue($value) - { - $this->eventManager->dispatchEvent(['set_value'], [__METHOD__, $this->getAbsoluteSelector()]); - list($group, $option) = explode('/', $value); - $xpath = (($option != 'Time') - ? (sprintf($this->optionGroupValue, $group, $option)) - : (sprintf($this->optionGroupExactValue, $group, $option))); - $option = $this->find($xpath, Locator::SELECTOR_XPATH); - $option->click(); - } -} diff --git a/dev/tests/functional/lib/Magento/Mtf/Client/Element/SelectstoreElement.php b/dev/tests/functional/lib/Magento/Mtf/Client/Element/SelectstoreElement.php deleted file mode 100644 index 022ce0a94aa..00000000000 --- a/dev/tests/functional/lib/Magento/Mtf/Client/Element/SelectstoreElement.php +++ /dev/null @@ -1,81 +0,0 @@ -find(sprintf($this->website, $selectedLabel), Locator::SELECTOR_XPATH); - $value = trim($element->getAttribute('label')); - $element = $this->find(sprintf($this->storeGroup, $selectedLabel), Locator::SELECTOR_XPATH); - $value .= '/' . trim($element->getAttribute('label'), chr(0xC2) . chr(0xA0)); - $value .= '/' . $selectedLabel; - return $value; - } - - /** - * Select value in dropdown which has option groups. - * - * @param string $value - * @throws \Exception - * @return void - */ - public function setValue($value) - { - $pieces = explode('/', $value); - - if (1 == count($pieces)) { - $optionLocator = './/option[contains(text(),"' . $pieces[0] . '")]'; - } else { - $optionLocator = './/optgroup[contains(@label,"' - . $pieces[0] . '")]/following-sibling::optgroup[contains(@label,"' - . $pieces[1] . '")]/option[contains(text(), "' - . $pieces[2] . '")]'; - } - - $option = $this->context->find($optionLocator, Locator::SELECTOR_XPATH); - if (!$option->isVisible()) { - throw new \Exception('[' . implode('/', $pieces) . '] option is not visible in store switcher.'); - } - $option->click(); - } -} diff --git a/dev/tests/functional/lib/Magento/Mtf/Client/Element/SimpleElement.php b/dev/tests/functional/lib/Magento/Mtf/Client/Element/SimpleElement.php deleted file mode 100644 index ca99c07df58..00000000000 --- a/dev/tests/functional/lib/Magento/Mtf/Client/Element/SimpleElement.php +++ /dev/null @@ -1,297 +0,0 @@ -driver = $driver; - $this->eventManager = $eventManager; - $this->locator = $locator; - $this->context = $context; - } - - /** - * Drag and drop element to(between) another element(s) - * - * @param ElementInterface $target - * @return void - */ - public function dragAndDrop(ElementInterface $target) - { - $this->driver->dragAndDrop($this, $target); - } - - /** - * Check whether element is visible - * - * @return bool - */ - public function isVisible() - { - return $this->driver->isVisible($this); - } - - /** - * Get content - * - * @return string - */ - public function getText() - { - return $this->driver->getText($this); - } - - /** - * Find element by locator in context of current element - * - * @param string $selector - * @param string $strategy [optional] - * @param null|string $type [optional] - * @return ElementInterface - */ - public function find($selector, $strategy = Locator::SELECTOR_CSS, $type = null) - { - return $this->driver->find($selector, $strategy, $type, $this); - } - - /** - * Get all elements by locator - * - * @param string $selector - * @param string $strategy - * @param null|string $type - * @return ElementInterface[] - */ - public function getElements($selector, $strategy = Locator::SELECTOR_CSS, $type = null) - { - return $this->driver->getElements($this, $selector, $strategy, $type); - } - - /** - * Wait until callback isn't null or timeout occurs - * - * @param callable $callback - * @return mixed - */ - public function waitUntil($callback) - { - return $this->driver->waitUntil($callback); - } - - /** - * Click - * - * @return void - */ - public function click() - { - $this->driver->click($this); - } - - /** - * Send keys - * - * @param array $keys - * @return void - */ - public function keys(array $keys) - { - $this->driver->keys($this, $keys); - } - - /** - * Check whether element is enabled - * - * @return bool - */ - public function isDisabled() - { - return $this->driver->isDisabled($this); - } - - /** - * Check whether element is present in the DOM. - * - * @return bool - */ - public function isPresent() - { - return $this->driver->isPresent($this); - } - - /** - * Check whether element is selected - * - * @return bool - */ - public function isSelected() - { - return $this->driver->isSelected($this); - } - - /** - * Set the value - * - * @param string|array $value - * @return void - */ - public function setValue($value) - { - $this->driver->setValue($this, $value); - } - - /** - * Get the value - * - * @return string|array - */ - public function getValue() - { - return $this->driver->getValue($this); - } - - /** - * Get the value of a the given attribute of the element - * - * @param string $name - * @return string - */ - public function getAttribute($name) - { - return $this->driver->getAttribute($this, $name); - } - - /** - * Double click - * - * @return void - */ - public function doubleClick() - { - $this->driver->doubleClick($this); - } - - /** - * Right click - * - * @return void - */ - public function rightClick() - { - $this->driver->rightClick($this); - } - - /** - * Get absolute selector (for DBG) - * - * @return string - */ - public function getAbsoluteSelector() - { - $selectors = []; - $selectors[] = $this->getLocator(); - $element = $this; - while($element = $element->getContext()) { - $selectors[] = $element->getLocator(); - } - - return implode(' -> ', array_reverse($selectors)); - } - - /** - * Get element locator - * - * @return Locator - */ - public function getLocator() - { - return $this->locator; - } - - /** - * Get context element - * - * @return ElementInterface|null - */ - public function getContext() - { - return $this->context; - } - - /** - * Hover mouse over an element. - * - * @return void - */ - public function hover() - { - $this->driver->hover($this); - } -} diff --git a/dev/tests/functional/lib/Magento/Mtf/Client/Element/TreeElement.php b/dev/tests/functional/lib/Magento/Mtf/Client/Element/TreeElement.php deleted file mode 100644 index 9fdbcbeb456..00000000000 --- a/dev/tests/functional/lib/Magento/Mtf/Client/Element/TreeElement.php +++ /dev/null @@ -1,245 +0,0 @@ -getElements($this->selectedCheckboxes, Locator::SELECTOR_XPATH, 'checkbox'); - foreach ($checkboxes as $checkbox) { - $checkbox->setValue('No'); - } - } - - /** - * Get the value. - * - * @return array - */ - public function getValue() - { - $this->eventManager->dispatchEvent(['get_value'], [(string)$this->getAbsoluteSelector()]); - $checkboxes = $this->getElements($this->selectedLabels, Locator::SELECTOR_XPATH); - $values = []; - foreach ($checkboxes as $checkbox) { - $fullPath = $this->getFullPath($checkbox); - $values[] = implode('/', array_reverse($fullPath)); - } - - return $values; - } - - /** - * Get full path for element. - * - * @param ElementInterface $element - * @return string[] - */ - protected function getFullPath(ElementInterface $element) - { - $fullPath[] = $this->getElementLabel($element); - $parentElement = $element->find($this->parentElement, Locator::SELECTOR_XPATH); - if ($parentElement->isVisible()) { - $fullPath = array_merge($fullPath, $this->getFullPath($parentElement)); - } - - return $fullPath; - } - - /** - * Get element label. - * - * @param ElementInterface $element - * @return string - */ - protected function getElementLabel(ElementInterface $element) - { - $value = $element->getText(); - preg_match('`(.+) \(.*`', $value, $matches); - - return $matches[1]; - } - - /** - * Click a tree element by its path (Node names) in tree. - * - * @param string $path - * @return void - */ - public function setValue($path) - { - $this->eventManager->dispatchEvent(['set_value'], [(string)$this->getAbsoluteSelector()]); - $this->clear(); - $elementSelector = $this->prepareElementSelector($path); - $elements = $this->getElements($elementSelector . $this->input, Locator::SELECTOR_XPATH); - foreach ($elements as $element) { - $element->click(); - } - } - - /** - * Prepare element selector. - * - * @param string $path - * @return string - */ - protected function prepareElementSelector($path) - { - $pathArray = explode('/', $path); - $elementSelector = ''; - foreach ($pathArray as $itemElement) { - $this->displayChildren($itemElement); - $elementSelector .= sprintf($this->pattern, $itemElement); - } - - return $elementSelector; - } - - /** - * Check visible element. - * - * @param string $path - * @return bool - */ - public function isElementVisible($path) - { - $elementSelector = $this->prepareElementSelector($path); - return $this->find($elementSelector, Locator::SELECTOR_XPATH)->isVisible(); - } - - /** - * Display children. - * - * @param $element - * @return void - */ - protected function displayChildren($element) - { - $element = $this->find(sprintf($this->pattern, $element), Locator::SELECTOR_XPATH); - $plusButton = $element->find($this->imagePlus, Locator::SELECTOR_XPATH); - if ($plusButton->isVisible()) { - $plusButton->click(); - $this->waitLoadChildren($element); - } - } - - /** - * Waiter for load children. - * - * @param ElementInterface $element - * @return void - */ - protected function waitLoadChildren(ElementInterface $element) - { - $selector = $this->childLoader; - $this->waitUntil( - function () use ($element, $selector) { - return $element->find($selector)->isVisible() ? true : null; - } - ); - } - - /** - * keys method is not accessible in this class. - * Throws exception if used. - * - * @param array $keys - * @throws \BadMethodCallException - * @return void - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function keys(array $keys) - { - throw new \BadMethodCallException('Not applicable for this class of elements (TreeElement)'); - } - - /** - * Drag'n'drop method is not accessible in this class. - * Throws exception if used. - * - * @param ElementInterface $target - * @throws \BadMethodCallException - * @return void - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function dragAndDrop(ElementInterface $target) - { - throw new \BadMethodCallException('Not applicable for this class of elements (TreeElement)'); - } - -} diff --git a/dev/tests/functional/lib/Magento/Mtf/Constraint/AbstractAssertForm.php b/dev/tests/functional/lib/Magento/Mtf/Constraint/AbstractAssertForm.php deleted file mode 100644 index 795c431cfea..00000000000 --- a/dev/tests/functional/lib/Magento/Mtf/Constraint/AbstractAssertForm.php +++ /dev/null @@ -1,257 +0,0 @@ - $value) { - if (in_array($key, $this->skippedFields)) { - continue; - } - $formValue = isset($formData[$key]) ? $formData[$key] : null; - if (is_numeric($formValue)) { - $formValue = floatval($formValue); - } - - if (null === $formValue) { - $errors[] = '- field "' . $key . '" is absent in form'; - } elseif (is_array($value) && is_array($formValue)) { - $valueErrors = $this->verifyData($value, $formValue, $isStrict, $isPrepareError); - if (!empty($valueErrors)) { - $errors[$key] = $valueErrors; - } - } elseif ($value != $formValue) { - if (is_array($value)) { - $value = $this->arrayToString($value); - } - if (is_array($formValue)) { - $formValue = $this->arrayToString($formValue); - } - $errors[] = sprintf('- %s: "%s" instead of "%s"', $key, $formValue, $value); - } - } - - if ($isStrict) { - $diffData = array_diff(array_keys($formData), array_keys($fixtureData)); - if ($diffData) { - $errors[] = '- fields ' . implode(', ', $diffData) . ' is absent in fixture'; - } - } - - if ($isPrepareError) { - return $this->prepareErrors($errors); - } - return $errors; - } - - /** - * Sort array by value. - * - * @param array $data - * @return array - */ - protected function sortData(array $data) - { - $scalarValues = []; - $arrayValues = []; - - foreach ($data as $key => $value) { - if (is_array($value)) { - $arrayValues[$key] = $this->sortData($value); - } else { - $scalarValues[$key] = $value; - } - } - asort($scalarValues); - foreach (array_keys($arrayValues) as $key) { - if (!is_numeric($key)) { - ksort($arrayValues); - break; - } - } - - return $scalarValues + $arrayValues; - } - - /** - * Sort multidimensional array by paths. - * Pattern path: key/subKey::sorkKey. - * Exapmle: - * $data = [ - * 'custom_options' => [ - * 'options' => [ - * 0 => [ - * 'title' => 'title_2', - * ], - * 1 => [ - * 'title' => 'title_1' - * ] - * ] - * ] - * ]; - * $paths = ['custom_options/options::title']; - * - * Result: - * $data = [ - * 'custom_options' => [ - * 'options' => [ - * title_1 => [ - * 'title' => 'title_1', - * ], - * title_2 => [ - * 'title' => 'title_2' - * ] - * ] - * ] - * ]; - * - * @param array $data - * @param string $path - * @return array - * @throws \Exception - * - * @SuppressWarnings(PHPMD.NPathComplexity) - */ - protected function sortDataByPath(array $data, $path) - { - $steps = explode('/', $path); - $key = array_shift($steps); - $order = null; - $nextPath = empty($steps) ? null : implode('/', $steps); - - if (false !== strpos($key, '::')) { - list($key, $order) = explode('::', $key); - } - if ($key && !isset($data[$key])) { - return $data; - } - - if ($key) { - $data[$key] = $order ? $this->sortMultidimensionalArray($data[$key], $order) : $data[$key]; - $data[$key] = $nextPath ? $this->sortDataByPath($data[$key], $nextPath) : $data[$key]; - } else { - $data = $this->sortMultidimensionalArray($data, $order); - $data = $nextPath ? $this->sortDataByPath($data, $nextPath) : $data; - } - - return $data; - } - - /** - * Sort multidimensional array by key. - * - * @param array $data - * @param string $orderKey - * @return array - */ - protected function sortMultidimensionalArray(array $data, $orderKey) - { - $result = []; - foreach ($data as $key => $value) { - if (isset($value[$orderKey])) { - $orderValue = is_numeric($value[$orderKey]) ? floatval($value[$orderKey]) : $value[$orderKey]; - $result[$orderValue] = $value; - } else { - $result[$key] = $value; - } - } - - ksort($result); - return $result; - } - - /** - * Convert array to string. - * - * @param array $array - * @return string - */ - protected function arrayToString(array $array) - { - $result = []; - foreach ($array as $key => $value) { - $value = is_array($value) ? $this->arrayToString($value) : $value; - $result[] = "{$key} => {$value}"; - } - - return '[' . implode(', ', $result) . ']'; - } - - /** - * Prepare errors to string. - * - * @param array $errors - * @param string|null $notice - * @param string $indent [optional] - * @return string - */ - protected function prepareErrors(array $errors, $notice = null, $indent = '') - { - if (empty($errors)) { - return ''; - } - - $result = []; - foreach ($errors as $key => $error) { - $result[] = is_array($error) - ? $this->prepareErrors($error, "{$indent}{$key}:\n", $indent . "\t") - : ($indent . $error); - } - - if (null === $notice) { - $notice = $this->notice; - } - return $notice . implode("\n", $result); - } -} diff --git a/dev/tests/functional/lib/Magento/Mtf/Page/BackendPage.php b/dev/tests/functional/lib/Magento/Mtf/Page/BackendPage.php deleted file mode 100644 index 17a86951ac2..00000000000 --- a/dev/tests/functional/lib/Magento/Mtf/Page/BackendPage.php +++ /dev/null @@ -1,95 +0,0 @@ -url = $_ENV['app_backend_url'] . static::MCA; - } - - /** - * Open backend page and log in if needed. - * - * @param array $params - * @return $this - */ - public function open(array $params = []) - { - $systemConfig = ObjectManager::getInstance()->create('Magento\Mtf\Config\DataInterface'); - $admin = [ - 'username' => [ - 'value' => $systemConfig->get('application/0/backendLogin/0/value') - ], - 'password' => [ - 'value' => $systemConfig->get('application/0/backendPassword/0/value') - ] - ]; - $this->adminAuthLogin = ObjectManager::getInstance()->create('Mage\Adminhtml\Test\Page\AdminAuthLogin'); - $this->dashboard = ObjectManager::getInstance()->create('Mage\Adminhtml\Test\Page\Adminhtml\Dashboard'); - - if (!$this->dashboard->getAdminPanelHeader()->isVisible()) { - $this->loginSuperAdmin($admin); - } - return parent::open($params); - } - - /** - * Log in on backend for super admin. - * - * @param array $admin - * @return void - */ - protected function loginSuperAdmin(array $admin) - { - $this->adminAuthLogin->open(); - $loginBlock = $this->adminAuthLogin->getLoginBlock(); - if ($loginBlock->isVisible()) { - $loginBlock->loginToAdminPanel($admin); - } - } -} diff --git a/dev/tests/functional/lib/Magento/Mtf/Util/Generate/Fixture/FieldsProvider.php b/dev/tests/functional/lib/Magento/Mtf/Util/Generate/Fixture/FieldsProvider.php deleted file mode 100644 index 749d261936d..00000000000 --- a/dev/tests/functional/lib/Magento/Mtf/Util/Generate/Fixture/FieldsProvider.php +++ /dev/null @@ -1,187 +0,0 @@ -initMage(); - } - - /** - * Collect fields for the entity based on its type. - * - * @param array $fixture - * @return array - */ - public function getFields(array $fixture) - { - $method = $fixture['type'] . 'CollectFields'; - if (!method_exists($this, $method)) { - return []; - } - - return $this->$method($fixture); - } - - /** - * Collect fields for the entity with eav type. - * - * @param array $fixture - * @return array - */ - protected function eavCollectFields(array $fixture) - { - $entity = $fixture['entity_type']; - $collection = \Mage::getSingleton('eav/config')->getEntityType($entity)->getAttributeCollection(); - $attributes = []; - foreach ($collection as $attribute) { - if (isset($fixture['product_type'])) { - $applyTo = $attribute->getApplyTo(); - if (!empty($applyTo) && !in_array($fixture['product_type'], $applyTo)) { - continue; - } - } - - /** @var \Mage_Eav_Model_Attribute $attribute */ - $code = $attribute->getAttributeCode(); - $attributes[$code] = array( - 'attribute_code' => $code, - 'backend_type' => $attribute->getBackendType(), - 'is_required' => $attribute->getIsRequired(), - 'default_value' => $attribute->getDefaultValue(), - 'input' => $attribute->getFrontendInput() - ); - } - - return $attributes; - } - - /** - * Collect fields for the entity with table type. - * - * @param array $fixture - * @return array - */ - protected function tableCollectFields(array $fixture) - { - return $this->flatCollectFields($fixture); - } - - /** - * Collect fields for the entity with flat type. - * - * @param array $fixture - * @return array - */ - protected function flatCollectFields(array $fixture) - { - $entityType = $fixture['entity_type']; - $fields = $this->getConnection()->describeTable($this->retrieveTableName($entityType)); - - $attributes = []; - foreach ($fields as $code => $field) { - $attributes[$code] = array( - 'attribute_code' => $code, - 'backend_type' => $field['DATA_TYPE'], - 'is_required' => ($field['PRIMARY'] || $field['IDENTITY']), - 'default_value' => $field['DEFAULT'], - 'input' => '' - ); - } - - return $attributes; - } - - /** - * Collect fields for the entity with composite type. - * - * @param array $fixture - * @return array - */ - protected function compositeCollectFields(array $fixture) - { - $entityTypes = $fixture['entities']; - - $connection = $this->getConnection(); - $fields = []; - foreach ($entityTypes as $entityType) { - $fields = array_merge($fields, $connection->describeTable($this->retrieveTableName($entityType))); - } - - $attributes = []; - foreach ($fields as $code => $field) { - $attributes[$code] = [ - 'attribute_code' => $code, - 'backend_type' => $field['DATA_TYPE'], - 'is_required' => ($field['PRIMARY'] || $field['IDENTITY']), - 'default_value' => $field['DEFAULT'], - 'input' => '' - ]; - } - - return $attributes; - } - - /** - * Mage init. - * - * @return void - */ - protected function initMage() - { - require_once realpath(__DIR__ . "/../../../../../../../../../app/Mage.php"); - \Mage::app('default'); - } - - /** - * Get DB connection. - * - * @return \Magento_Db_Adapter_Pdo_Mysql - */ - protected function getConnection() - { - return \Mage::getSingleton('core/resource')->getConnection('core_write'); - } - - /** - * Get DB table name with prefix. - * - * @param string $entity - * @return string - */ - protected function retrieveTableName($entity) - { - return \Mage::getSingleton('core/resource')->getTableName($entity); - } - - /** - * Check connection to DB. - * - * @return bool - */ - public function checkConnection() - { - return $this->getConnection(); - } -} diff --git a/dev/tests/functional/lib/Magento/Mtf/Util/Generate/Page.php b/dev/tests/functional/lib/Magento/Mtf/Util/Generate/Page.php deleted file mode 100644 index 80da947321d..00000000000 --- a/dev/tests/functional/lib/Magento/Mtf/Util/Generate/Page.php +++ /dev/null @@ -1,193 +0,0 @@ -cnt = 0; - - foreach ($this->configData->get('page') as $name => $data) { - $this->generateClass($name, $data); - } - - \Magento\Mtf\Util\Generate\GenerateResult::addResult('Page Classes', $this->cnt); - } - - /** - * Generate single page class. - * - * @param string $className - * @return string|bool - * @throws \InvalidArgumentException - */ - public function generate($className) - { - $classNameParts = explode('\\', $className); - $classDataKey = 'page/' . end($classNameParts); - - if (!$this->configData->get($classDataKey)) { - throw new \InvalidArgumentException('Invalid class name: ' . $className); - } - - return $this->generateClass( - end($classNameParts), - $this->configData->get($classDataKey) - ); - } - - /** - * Generate page class from XML source. - * - * @param string $name - * @param array $data - * @return string|bool - * @SuppressWarnings(PHPMD.NPathComplexity) - */ - protected function generateClass($name, array $data) - { - $className = ucfirst($name); - $module = str_replace('_', '/', $data['module']); - $area = empty($data['area']) ? null : $data['area']; - $folderPath = $module . '/Test/Page' . (($area === null) ? '' : ('/' . $area)); - $realFolderPath = MTF_BP . '/generated/' . $folderPath; - $namespace = str_replace('/', '\\', $folderPath); - $mca = isset($data['mca']) ? $data['mca'] : ''; - $areaMtfPage = $this->getParentPage($folderPath, $mca, $area); - $blocks = isset($data['block']) ? $data['block'] : []; - - $content = "getFilePhpDoc(); - $content .= "namespace {$namespace};\n\n"; - $content .= "use Magento\\Mtf\\Page\\{$areaMtfPage};\n\n"; - $content .= "/**\n"; - $content .= " * Class {$className}\n"; - $content .= " */\n"; - $content .= "class {$className} extends {$areaMtfPage}\n"; - $content .= "{\n"; - $content .= " const MCA = '{$mca}';\n\n"; - - $content .= " /**\n"; - $content .= " * Blocks' config\n"; - $content .= " *\n"; - $content .= " * @var array\n"; - $content .= " */\n"; - $content .= " protected \$blocks = [\n"; - foreach ($blocks as $blockName => $block) { - $content .= $this->generatePageClassBlock($blockName, $block, ' '); - } - $content .= " ];\n"; - - foreach ($blocks as $blockName => $block) { - $content .= "\n /**\n"; - $content .= " * @return \\{$block['class']}\n"; - $content .= " */\n"; - $content .= ' public function get' . ucfirst($blockName) . '()' . "\n"; - $content .= " {\n"; - $content .= " return \$this->getBlockInstance('{$blockName}');\n"; - $content .= " }\n"; - } - - $content .= "}\n"; - - $newFilename = $className . '.php'; - - if (file_exists($realFolderPath . '/' . $newFilename)) { - unlink($realFolderPath . '/' . $newFilename); - } - - if (!is_dir($realFolderPath)) { - mkdir($realFolderPath, 0777, true); - } - - $result = @file_put_contents($realFolderPath . '/' . $newFilename, $content); - - if ($result === false) { - $error = error_get_last(); - $this->addError(sprintf('Unable to generate %s class. Error: %s', $className, $error['message'])); - return false; - } - - $this->cnt++; - - return $realFolderPath . '/' . $newFilename; - } - - /** - * Generate block for page class. - * - * @param string $blockName - * @param array $params - * @param string $indent - * @return string - */ - protected function generatePageClassBlock($blockName, array $params, $indent = '') - { - $content = $indent . "'{$blockName}' => [\n"; - foreach ($params as $key => $value) { - if (is_array($value)) { - $content .= $this->generatePageClassBlock($key, $value, $indent . ' '); - } else { - $escaped = str_replace('\'', '"', $value); - $content .= $indent . " '{$key}' => '{$escaped}',\n"; - } - } - $content .= $indent . "],\n"; - - return $content; - } - - /** - * Determine parent page class. - * - * @param string $folderPath - * @param string $mca - * @param string|null $area - * @return string - */ - protected function getParentPage($folderPath, $mca, $area) - { - if (str_contains($folderPath, 'Adminhtml') && $area === 'Adminhtml') { - $areaMtfPage = 'BackendPage'; - } else { - if (!str_contains($mca, 'http')) { - $areaMtfPage = 'FrontendPage'; - } else { - $areaMtfPage = 'ExternalPage'; - } - } - - return $areaMtfPage; - } -} diff --git a/dev/tests/functional/lib/Magento/Mtf/Util/Protocol/CurlTransport/BackendDecorator.php b/dev/tests/functional/lib/Magento/Mtf/Util/Protocol/CurlTransport/BackendDecorator.php deleted file mode 100644 index 30a466dfdc8..00000000000 --- a/dev/tests/functional/lib/Magento/Mtf/Util/Protocol/CurlTransport/BackendDecorator.php +++ /dev/null @@ -1,176 +0,0 @@ -transport = $transport; - $this->configuration = $configuration; - $this->authorize(); - } - - /** - * Authorize customer on backend. - * - * @throws \Exception - * @return void - */ - protected function authorize() - { - // Perform GET to backend url so form_key is set - $url = $_ENV['app_backend_url']; - $this->transport->write($url, [], CurlInterface::GET); - $this->read(); - - $data = [ - 'login[username]' => $this->configuration->get('application/0/backendLogin/0/value'), - 'login[password]' => $this->configuration->get('application/0/backendPassword/0/value'), - 'form_key' => $this->formKey, - ]; - $this->transport->write($url, $data, CurlInterface::POST, []); - $response = $this->read(); - - if (!strpos($response, 'link-logout')) { - throw new \Exception( - "Admin user cannot be logged in by curl handler!" - ); - } - } - - /** - * Init Form Key from response. - * - * @return void - */ - protected function initFormKey() - { - preg_match('!var FORM_KEY = \'(\w+)\';!', $this->response, $matches); - - if (!empty($matches[1])) { - $this->formKey = $matches[1]; - } else { - preg_match('!input name="form_key" type="hidden" value="(\w+)"!', $this->response, $matches); - if (!empty($matches[1])) { - $this->formKey = $matches[1]; - } - } - } - - /** - * Send request to the remote server. - * - * @param string $url - * @param mixed $params - * @param string $method - * @param mixed $headers - * @return void - * @throws \Exception - */ - public function write($url, $params = [], $method = CurlInterface::POST, $headers = []) - { - if ($this->formKey) { - $params['form_key'] = $this->formKey; - } else { - throw new \Exception(sprintf('Form key is absent! Url: "%s" Response: "%s"', $url, $this->response)); - } - $this->transport->write($url, http_build_query($params), $method, $headers); - } - - /** - * Read response from server. - * - * @return string - */ - public function read() - { - $this->response = $this->transport->read(); - $this->initFormKey(); - return $this->response; - } - - /** - * Add additional option to cURL. - * - * @param int $option the CURLOPT_* constants - * @param mixed $value - * @return void - */ - public function addOption($option, $value) - { - $this->transport->addOption($option, $value); - } - - /** - * Close the connection to the server. - * - * @return void - */ - public function close() - { - $this->transport->close(); - } -} diff --git a/dev/tests/functional/lib/Magento/Mtf/Util/Protocol/CurlTransport/FrontendDecorator.php b/dev/tests/functional/lib/Magento/Mtf/Util/Protocol/CurlTransport/FrontendDecorator.php deleted file mode 100644 index 0b4470f8729..00000000000 --- a/dev/tests/functional/lib/Magento/Mtf/Util/Protocol/CurlTransport/FrontendDecorator.php +++ /dev/null @@ -1,169 +0,0 @@ -transport = $transport; - $this->authorize($customer); - } - - /** - * Authorize customer on frontend. - * - * @param Customer $customer - * @throws \Exception - * @return void - */ - protected function authorize(Customer $customer) - { - $url = $_ENV['app_frontend_url'] . 'customer/account/login/'; - $this->transport->write($url); - $this->read(); - $url = $_ENV['app_frontend_url'] . 'customer/account/loginPost/'; - $data = [ - 'login[username]' => $customer->getEmail(), - 'login[password]' => $customer->getPassword(), - 'form_key' => $this->formKey, - ]; - $this->transport->write($url, $data, CurlInterface::POST, ['Set-Cookie:' . $this->cookies]); - $response = $this->read(); - if (strpos($response, 'customer/account/login')) { - throw new \Exception($customer->getFirstname() . ', cannot be logged in by curl handler!'); - } - } - - /** - * Init Form Key from response. - * - * @return void - */ - protected function initFormKey() - { - $str = substr($this->response, strpos($this->response, 'form_key')); - preg_match('/value="(.*)" \/>/', $str, $matches); - if (!empty($matches[1])) { - $this->formKey = $matches[1]; - } - } - - /** - * Init Cookies from response. - * - * @return void - */ - protected function initCookies() - { - preg_match_all('|Set-Cookie: (.*);|U', $this->response, $matches); - if (!empty($matches[1])) { - $this->cookies = implode('; ', $matches[1]); - } - } - - /** - * Send request to the remote server. - * - * @param string $url - * @param array $params - * @param string $method - * @param array $headers - * @throws \Exception - */ - public function write($url, $params = [], $method = CurlInterface::POST, $headers = []) - { - if ($this->formKey) { - $params['form_key'] = $this->formKey; - } - $this->transport->write($url, http_build_query($params), $method, ['Set-Cookie:' . $this->cookies]); - } - - /** - * Read response from server. - * - * @return string - */ - public function read() - { - $this->response = $this->transport->read(); - $this->initCookies(); - $this->initFormKey(); - return $this->response; - } - - /** - * Add additional option to cURL. - * - * @param int $option the CURLOPT_* constants - * @param mixed $value - * @return void - */ - public function addOption($option, $value) - { - $this->transport->addOption($option, $value); - } - - /** - * Close the connection to the server. - * - * @return void - */ - public function close() - { - $this->transport->close(); - } -} diff --git a/dev/tests/functional/phpunit.xml.dist b/dev/tests/functional/phpunit.xml.dist deleted file mode 100644 index 56dd56f9082..00000000000 --- a/dev/tests/functional/phpunit.xml.dist +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - tests - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertRoleInGrid.php b/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertRoleInGrid.php deleted file mode 100644 index 2f929ce4c14..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertRoleInGrid.php +++ /dev/null @@ -1,57 +0,0 @@ - $role->getRoleName()]; - $rolePage->open(); - \PHPUnit_Framework_Assert::assertTrue( - $rolePage->getRoleGrid()->isRowVisible($filter), - 'Role with name \'' . $filter['rolename'] . '\' is absent in Roles grid.' - ); - } - - /** - * Return string representation of object. - * - * @return string - */ - public function toString() - { - return 'Role is present in Roles grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertRoleSuccessSaveMessage.php b/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertRoleSuccessSaveMessage.php deleted file mode 100644 index 2a1ae7aa411..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertRoleSuccessSaveMessage.php +++ /dev/null @@ -1,55 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Return string representation of object. - * - * @return string - */ - public function toString() - { - return 'Success message on roles page is correct.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserAccessDeniedMessage.php b/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserAccessDeniedMessage.php deleted file mode 100644 index 3c4fcd42ca6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserAccessDeniedMessage.php +++ /dev/null @@ -1,29 +0,0 @@ -getMessagesBlock()->getErrorMessages(); - \PHPUnit_Framework_Assert::assertEquals( - self::ERROR_MESSAGE, - $failedMessage, - 'Wrong error message is displayed.' - ); - } - - /** - * Return string representation of object. - * - * @return string - */ - public function toString() - { - return 'Error message on creation user page is correct.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserInGrid.php b/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserInGrid.php deleted file mode 100644 index afeec788362..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserInGrid.php +++ /dev/null @@ -1,65 +0,0 @@ -hasData('password') || $user->hasData('username')) ? $user : $customAdmin; - $filter = ['username' => $adminUser->getUsername()]; - $userIndex->open(); - \PHPUnit_Framework_Assert::assertTrue( - $userIndex->getUserGrid()->isRowVisible($filter), - 'User with name \'' . $adminUser->getUsername() . '\' is absent in User grid.' - ); - } - - /** - * Return string representation of object. - * - * @return string - */ - public function toString() - { - return 'User is present in Users grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserInvalidEmailMessage.php b/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserInvalidEmailMessage.php deleted file mode 100644 index 3c2932cdafd..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserInvalidEmailMessage.php +++ /dev/null @@ -1,62 +0,0 @@ -getEmail()); - $actualMessage = $userEdit->getMessagesBlock()->getErrorMessages(); - \PHPUnit_Framework_Assert::assertEquals($expectedMessage, $actualMessage, 'Wrong error message is displayed.'); - } - - /** - * Return string representation of object. - * - * @return string - */ - public function toString() - { - return 'Error message about invalid email on creation user page is correct.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserIsLockedMessage.php b/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserIsLockedMessage.php deleted file mode 100644 index b5e5065952c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserIsLockedMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getErrorMessages() - ); - } - - /** - * Return string representation of object. - * - * @return string - */ - public function toString() - { - return 'Admin user account is locked.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserSuccessLogOut.php b/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserSuccessLogOut.php deleted file mode 100644 index f3aa6ecbce8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserSuccessLogOut.php +++ /dev/null @@ -1,59 +0,0 @@ -getAdminPanelHeader()->logOut(); - $isLoginBlockVisible = $adminAuth->getLoginBlock()->isVisible(); - \PHPUnit_Framework_Assert::assertTrue($isLoginBlockVisible, 'Admin user was not logged out.'); - } - - /** - * Return string representation of object. - * - * @return string - */ - public function toString() - { - return 'User had successfully logged out.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserSuccessLogin.php b/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserSuccessLogin.php deleted file mode 100644 index bc42e6f62b6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserSuccessLogin.php +++ /dev/null @@ -1,91 +0,0 @@ -getAdminPanelHeader(); - if ($adminPanelHeader->isVisible()) { - $adminPanelHeader->logOut(); - } - if (!$adminAuth->getLoginBlock()->isVisible()) { - $this->checkForInstallData($browser, $install); - } - $adminAuth->getLoginBlock()->loginToAdminPanel($adminUser->getData()); - - \PHPUnit_Framework_Assert::assertTrue($adminPanelHeader->isVisible(), 'Admin user was not logged in.'); - } - - /** - * Determines if assert is called after magento installation and performs assert precondition. - * - * @param Browser $browser - * @param array $install - * @return void - */ - protected function checkForInstallData(Browser $browser, array $install) - { - isset($install['admin_frontname']) - ? $browser->open($_ENV['app_frontend_url'] . $install['admin_frontname']) - : $browser->open($_ENV['app_backend_url']); - } - - /** - * Return string representation of object. - * - * @return string - */ - public function toString() - { - return 'Admin user is logged in.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserSuccessSaveMessage.php b/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserSuccessSaveMessage.php deleted file mode 100644 index dec8dae3d80..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserSuccessSaveMessage.php +++ /dev/null @@ -1,62 +0,0 @@ -getMessagesBlock()->getSuccessMessages(), - 'Wrong success save message is displayed.' - ); - } - - /** - * Returns success message if equals to expected message. - * - * @return string - */ - public function toString() - { - return 'Success message on User Index page is correct.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserWithCustomRole.php b/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserWithCustomRole.php deleted file mode 100644 index aa1aeee1273..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserWithCustomRole.php +++ /dev/null @@ -1,103 +0,0 @@ -getAdminPanelHeader(); - if ($adminPanelHeader->isVisible()) { - $adminPanelHeader->logOut(); - } - $adminAuth->getLoginBlock()->loginToAdminPanel($adminUser->getData()); - - $role = $user->getDataFieldConfig('role_id')['source']->getRole(); - $menuItems = $this->getMenuItems($role); - foreach ($menuItems as $item) { - \PHPUnit_Framework_Assert::assertTrue( - $adminPanelHeader->checkMenu(ucfirst($item)), - "Menu $item is absent on top menu." - ); - } - - // Check access denied message on category page. - $categoryIndex->open(); - \PHPUnit_Framework_Assert::assertTrue($categoryIndex->getContentBlock()->checkAccessDeniedMessage()); - } - - /** - * Get menu items. - * - * @param Role $role - * @return array - */ - protected function getMenuItems(Role $role) - { - $resources = $role->getRolesResources(); - $rootMenu = []; - foreach ($resources as $resource) { - $elements = explode('/', $resource); - if (!in_array($elements[0], $rootMenu)) { - $rootMenu[] = $elements[0]; - } - } - return $rootMenu; - } - - /** - * Return string representation of object. - * - * @return string - */ - public function toString() - { - return 'User have custom role.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserWithRestrictedResources.php b/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserWithRestrictedResources.php deleted file mode 100644 index 6508e90033c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserWithRestrictedResources.php +++ /dev/null @@ -1,85 +0,0 @@ -getAdminPanelHeader(); - if ($adminPanelHeader->isVisible()) { - $adminPanelHeader->logOut(); - } - $adminAuthLogin->getLoginBlock()->loginToAdminPanel($user->getData()); - $menuItems = $adminPanelHeader->getMenuFirstLevelItems(); - - \PHPUnit_Framework_Assert::assertTrue( - count($menuItems) == 1 && in_array('Sales', $menuItems), - 'Sales menu item is not visible or count of menu items is greater than 1.' - ); - - $browser->open($_ENV['app_backend_url'] . $this->manageProductsUrl); - \PHPUnit_Framework_Assert::assertTrue( - str_contains($dashboard->getMainBlock()->getMainBlockText(), self::ACCESS_DENIED), - self::ACCESS_DENIED . " text is not visible on dashboard page."); - } - - /** - * Return string representation of object. - * - * @return string - */ - public function toString() - { - return "Not allowed resources are not available on menu level." - . " In case if type it via URL - 'Access Denied' page appeared."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserWrongCredentialsMessage.php b/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserWrongCredentialsMessage.php deleted file mode 100644 index c402a38f0bf..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserWrongCredentialsMessage.php +++ /dev/null @@ -1,67 +0,0 @@ -open(); - $adminAuth->getLoginBlock()->loginToAdminPanel($user->getData()); - - \PHPUnit_Framework_Assert::assertEquals( - static::INVALID_CREDENTIALS_MESSAGE, - $adminAuth->getMessagesBlock()->getErrorMessages(), - 'Message "' . static::INVALID_CREDENTIALS_MESSAGE . '" is not visible.' - ); - } - - /** - * Returns success message if equals to expected message. - * - * @return string - */ - public function toString() - { - return 'Invalid credentials message was displayed.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Fixture/Role.xml b/dev/tests/functional/tests/app/Mage/Admin/Test/Fixture/Role.xml deleted file mode 100644 index 46fd77265b8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Fixture/Role.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Fixture/Role/GwsStoreGroups.php b/dev/tests/functional/tests/app/Mage/Admin/Test/Fixture/Role/GwsStoreGroups.php deleted file mode 100644 index ea621d700bd..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Fixture/Role/GwsStoreGroups.php +++ /dev/null @@ -1,112 +0,0 @@ -params = $params; - if (isset($data['datasets'])) { - $datasets = explode(',', $data['datasets']); - foreach ($datasets as $dataset) { - /** @var StoreGroup $storeGroup */ - $storeGroup = $fixtureFactory->createByCode('storeGroup', ['dataset' => trim($dataset)]); - $storeGroup->persist(); - $this->data[] = $storeGroup->getGroupId(); - $this->storeGroups[] = $storeGroup; - } - } - } - - /** - * Persist source. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set. - * - * @param string|null $key [optional] - * @return mixed - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings. - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Get store groups. - * - * @return StoreGroup[] - */ - public function getStoreGroups() - { - return $this->storeGroups; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Fixture/Role/InRoleUsers.php b/dev/tests/functional/tests/app/Mage/Admin/Test/Fixture/Role/InRoleUsers.php deleted file mode 100644 index 209d83058b1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Fixture/Role/InRoleUsers.php +++ /dev/null @@ -1,116 +0,0 @@ -params = $params; - if (isset($data['dataset']) && $data['dataset'] !== '-') { - $datasets = explode(',', $data['dataset']); - foreach ($datasets as $dataset) { - $adminUser = $fixtureFactory->createByCode('user', ['dataset' => trim($dataset)]); - if (!$adminUser->hasData('user_id')) { - $adminUser->persist(); - } - $this->adminUsers[] = $adminUser; - $this->data[] = $adminUser->getUsername(); - } - } - } - - /** - * Persist user role. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return array with user names. - * - * @param string $key [optional] - * @return array|null - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings. - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Return array with admin user fixtures. - * - * @return array - */ - public function getAdminUsers() - { - return $this->adminUsers; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Fixture/Role/RolesResources.php b/dev/tests/functional/tests/app/Mage/Admin/Test/Fixture/Role/RolesResources.php deleted file mode 100644 index 5796ed7b4bc..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Fixture/Role/RolesResources.php +++ /dev/null @@ -1,151 +0,0 @@ -params = $params; - if (isset($data['preset'])) { - $this->data = $this->getPreset($data['preset']); - } elseif (isset($data['value'])) { - $this->data = $data['value']; - } - } - - /** - * Persist attribute options. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set. - * - * @param string|null $key [optional] - * @return mixed - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings. - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Preset for Attribute manage options. - * - * @param string $name - * @return array|null - */ - protected function getPreset($name) - { - $presets = [ - 'sales' => [ - 'sales', - 'sales/archive', - 'sales/archive/creditmemos', - 'sales/archive/shipments', - 'sales/archive/invoices', - 'sales/archive/orders', - 'sales/archive/orders/remove', - 'sales/archive/orders/add', - 'sales/order', - 'sales/order/actions', - 'sales/order/actions/hold', - 'sales/order/actions/creditmemo', - 'sales/order/actions/unhold', - 'sales/order/actions/ship', - 'sales/order/actions/emails', - 'sales/order/actions/comment', - 'sales/order/actions/invoice', - 'sales/order/actions/capture', - 'sales/order/actions/email', - 'sales/order/actions/view', - 'sales/order/actions/reorder', - 'sales/order/actions/edit', - 'sales/order/actions/review_payment', - 'sales/order/actions/cancel', - 'sales/order/actions/create', - 'sales/order/actions/create/reward_spend', - 'sales/invoice', - 'sales/shipment', - 'sales/creditmemo', - 'sales/checkoutagreement', - 'sales/transactions', - 'sales/transactions/fetch', - 'sales/recurring_profile', - 'sales/billing_agreement', - 'sales/billing_agreement/actions', - 'sales/billing_agreement/actions/view', - 'sales/billing_agreement/actions/manage', - 'sales/billing_agreement/actions/use', - 'sales/tax', - 'sales/tax/classes_customer', - 'sales/tax/classes_product', - 'sales/tax/import_export', - 'sales/tax/rates', - 'sales/tax/rules' - ] - ]; - - if (!isset($presets[$name])) { - return null; - } - - return $presets[$name]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Fixture/User.xml b/dev/tests/functional/tests/app/Mage/Admin/Test/Fixture/User.xml deleted file mode 100644 index 67143e0eacc..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Fixture/User.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Fixture/User/RoleId.php b/dev/tests/functional/tests/app/Mage/Admin/Test/Fixture/User/RoleId.php deleted file mode 100644 index fb80b864f90..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Fixture/User/RoleId.php +++ /dev/null @@ -1,110 +0,0 @@ -params = $params; - if (isset($data['dataset'])) { - $this->role = $fixtureFactory->createByCode('role', ['dataset' => $data['dataset']]); - if (!$this->role->hasData('role_id')) { - $this->role->persist(); - } - $this->data = $this->role->getRoleName(); - } - if (isset($data['role']) && $data['role'] instanceof Role) { - $this->role = $data['role']; - $this->data = $data['role']->getRoleName(); - } - } - - /** - * Persist user role. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set. - * - * @param string $key [optional] - * @return string|null - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings. - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Return role fixture. - * - * @return Role - */ - public function getRole() - { - return $this->role; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Handler/Role/Curl.php b/dev/tests/functional/tests/app/Mage/Admin/Test/Handler/Role/Curl.php deleted file mode 100644 index 9d6c505b65c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Handler/Role/Curl.php +++ /dev/null @@ -1,117 +0,0 @@ - [ - 'Custom' => 0, - 'All' => 1 - ], - 'resource_access' => [ - 'Custom' => 0, - 'All' => 1 - ] - ]; - - /** - * Curl creation of User Role. - * - * @param FixtureInterface $fixture [optional] - * @return array - * @throws \Exception - */ - public function persist(FixtureInterface $fixture = null) - { - $data = $this->prepareData($fixture); - $url = $_ENV['app_backend_url'] . 'permissions_role/saverole/'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->write($url, $data); - $response = $curl->read(); - $curl->close(); - - if (!strpos($response, 'class="success-msg"')) { - throw new \Exception("Role entity creating by curl handler was not successful! Response: $response"); - } - - return ['role_id' => $this->getRoleId($response)]; - } - - /** - * Prepare data. - * - * @param FixtureInterface $fixture - * @return array - */ - protected function prepareData(FixtureInterface $fixture){ - /** @var Role $fixture */ - $data = $this->replaceMappingData($fixture->getData()); - if (isset($data['roles_resources'])) { - $data['resource'] = $this->prepareRolesResources($data['roles_resources']); - unset($data['roles_resources']); - } - - return $data; - } - - /** - * Prepare roles resources. - * - * @param array $resources - * @return string - */ - protected function prepareRolesResources(array $resources) - { - $data = '__root__,'; - $data .= implode(',', $resources); - $result = str_replace(',', ',admin/', $data); - - return $result; - } - - /** - * Get role id. - * - * @param string $response - * @return int - * @throws \Exception - */ - protected function getRoleId($response) - { - preg_match_all('~title="http[^\s]*\/rid\/(\d+)~', $response, $matches); - if (empty($matches)) { - throw new \Exception('Cannot find user role id'); - } - - return max($matches[1]); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Handler/Role/RoleInterface.php b/dev/tests/functional/tests/app/Mage/Admin/Test/Handler/Role/RoleInterface.php deleted file mode 100644 index 51c1b3f29dc..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Handler/Role/RoleInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - [ - 'Active' => 1 - ] - ]; - - /** - * Curl creation of Admin User. - * - * @param FixtureInterface $fixture - * @return array|mixed - * @throws \Exception - */ - public function persist(FixtureInterface $fixture = null) - { - /** @var \Mage\Admin\Test\Fixture\User $fixture */ - $data = $this->replaceMappingData($fixture->getData()); - if ($fixture->hasData('role_id')) { - $data['roles[]'] = $fixture->getDataFieldConfig('role_id')['source']->getRole()->getRoleId(); - } - $url = $_ENV['app_backend_url'] . 'permissions_user/save/'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->addOption(CURLOPT_HEADER, 1); - $curl->write($url, $data); - $response = $curl->read(); - $curl->close(); - - if (!strpos($response, 'class="success-msg"')) { - throw new \Exception("Admin user entity creating by curl handler was not successful! Response: $response"); - } - - return ['user_id' => $this->getId()]; - } - - /** - * Get created user id. - * - * @return string - */ - protected function getId() - { - $url = $_ENV['app_backend_url'] . 'permissions_user/roleGrid/sort/user_id/dir/desc/'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->addOption(CURLOPT_HEADER, 1); - $curl->write($url); - $response = $curl->read(); - $curl->close(); - - preg_match('@edit/user_id/(\d+)/@siu', $response, $matches); - return $matches[1]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Handler/User/UserInterface.php b/dev/tests/functional/tests/app/Mage/Admin/Test/Handler/User/UserInterface.php deleted file mode 100644 index ee6398478f7..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Handler/User/UserInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Page/Adminhtml/UserIndex.xml b/dev/tests/functional/tests/app/Mage/Admin/Test/Page/Adminhtml/UserIndex.xml deleted file mode 100644 index 3ee4db2cb3a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Page/Adminhtml/UserIndex.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Page/Adminhtml/UserRoleEditRole.xml b/dev/tests/functional/tests/app/Mage/Admin/Test/Page/Adminhtml/UserRoleEditRole.xml deleted file mode 100644 index 4345ea0ab0f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Page/Adminhtml/UserRoleEditRole.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Page/Adminhtml/UserRoleIndex.xml b/dev/tests/functional/tests/app/Mage/Admin/Test/Page/Adminhtml/UserRoleIndex.xml deleted file mode 100644 index 3f520b77fb4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Page/Adminhtml/UserRoleIndex.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Repository/Role.xml b/dev/tests/functional/tests/app/Mage/Admin/Test/Repository/Role.xml deleted file mode 100644 index 03f894bad6b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Repository/Role.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - Administrators - All - 1 - - - - Custom%isolation% - All - 123123q123123q - Custom - - sales - - - - - Custom%isolation% - Custom - 123123q123123q - Custom - - sales - - - custom - - - - diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Repository/User.xml b/dev/tests/functional/tests/app/Mage/Admin/Test/Repository/User.xml deleted file mode 100644 index efdb1b21fa1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Repository/User.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - AdminUser%isolation% - FirstName%isolation% - LastName%isolation% - email%isolation%@example.com - 123123q123123q - 123123q123123q - Active - 123123q123123q - - - AdminUser%isolation% - FirstName%isolation% - LastName%isolation% - email%isolation%@example.com - 123123q123123q - 123123q123123q - 123123q123123q - Active - - administrators - - - - AdminUser%isolation% - FirstName%isolation% - LastName%isolation% - email%isolation%@example.com - 123123q123123q - 123123q123123q - 123123q123123q - Active - - - AdminUserInstall%isolation% - FirstName%isolation% - LastName%isolation% - email%isolation%@example.com - 123123q123123q - 123123q123123q - - - admin - FirstName%isolation% - LastName%isolation% - email%isolation%@example.com - 123123q123123q - 123123q123123q - - - diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/TestCase/CreateAdminUserEntityTest.php b/dev/tests/functional/tests/app/Mage/Admin/Test/TestCase/CreateAdminUserEntityTest.php deleted file mode 100644 index bbb206924ae..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/TestCase/CreateAdminUserEntityTest.php +++ /dev/null @@ -1,144 +0,0 @@ -fixtureFactory = $fixtureFactory; - $adminUser = $fixtureFactory->createByCode('user'); - $adminUser->persist(); - - return ['adminUser' => $adminUser]; - } - - /** - * Injection data. - * - * @param UserIndex $userIndex - * @param UserEdit $userEdit - * @return void - */ - public function __inject(UserIndex $userIndex, UserEdit $userEdit) - { - $this->userIndexPage = $userIndex; - $this->userEditPage = $userEdit; - } - - /** - * Run Create Admin User Entity Test. - * - * @param User $user - * @param User $adminUser - * @param null|string $duplicatedParam - * @param bool $isCustomRole [optional] - * @return void - */ - public function test(User $user, User $adminUser, $duplicatedParam = null, $isCustomRole = false) - { - // Prepare data - $user = $this->prepareUser($user, $adminUser, $duplicatedParam, $isCustomRole); - - // Steps: - $this->userIndexPage->open(); - $this->userIndexPage->getPageActionsBlock()->addNew(); - $this->userEditPage->getUserForm()->fill($user); - $this->userEditPage->getFormPageActions()->save(); - } - - /** - * Prepare User fixture. - * - * @param User $user - * @param User $adminUser - * @param null|string $duplicatedParam - * @param bool $isCustomRole - * @return User - */ - protected function prepareUser(User $user, User $adminUser, $duplicatedParam, $isCustomRole) - { - if (!empty($duplicatedParam)) { - $data = $user->getData(); - $data[$duplicatedParam] = $adminUser->getData($duplicatedParam); - $user = $this->prepareUserFixture($user, $data); - } elseif ($isCustomRole) { - $data = $user->getData(); - $user = $this->prepareUserFixture($user, $data); - } - - return $user; - } - - /** - * Prepare user fixture. - * - * @param User $user - * @param array $data - * @return FixtureInterface - */ - protected function prepareUserFixture(User $user, array $data) - { - $data['role_id'] = ['role' => $user->getDataFieldConfig('role_id')['source']->getRole()]; - return $this->fixtureFactory->createByCode('user', ['data' => $data]); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/TestCase/CreateAdminUserEntityTest.xml b/dev/tests/functional/tests/app/Mage/Admin/Test/TestCase/CreateAdminUserEntityTest.xml deleted file mode 100644 index cb89a82e3dc..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/TestCase/CreateAdminUserEntityTest.xml +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - AdminUser%isolation% - FirstName%isolation% - LastName%isolation% - email%isolation%@example.com - 123123q123123q - 123123q123123q - Active - administrators - 123123q123123q - - - - - - - AdminUser%isolation% - FirstName%isolation% - LastName%isolation% - email%isolation%@example.com - 123123q123123q - 123123q123123q - Inactive - administrators - 123123q123123q - - - - - - - - - FirstName%isolation% - LastName%isolation% - email%isolation%@example.com - 123123q123123q - 123123q123123q - Active - administrators - username - 123123q123123q - - - - AdminUser%isolation% - FirstName%isolation% - LastName%isolation% - - - 123123q123123q - 123123q123123q - Active - administrators - email - 123123q123123q - - - - AdminUser%isolation% - FirstName%isolation% - LastName%isolation% - email%isolation%@example.com - 123123q123123q - 123123q123123q - Active - - - 123123q123123q - - - - - - - AdminUser%isolation% - FirstName%isolation% - LastName%isolation% - email%isolation%@example.cim - 123123q123123q - 123123q123123q - Active - - - 123123q123123q - - - - CustomUser%isolation% - FirstName%isolation% - LastName%isolation% - email%isolation%@example.com - 123123q123123q - 123123q123123q - Active - custom - true - 123123q123123q - - - - diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/TestCase/CreateAdminUserRoleEntityTest.php b/dev/tests/functional/tests/app/Mage/Admin/Test/TestCase/CreateAdminUserRoleEntityTest.php deleted file mode 100644 index 57b0bc0b720..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/TestCase/CreateAdminUserRoleEntityTest.php +++ /dev/null @@ -1,78 +0,0 @@ - Permissions -> Roles. - * 3. Press "Add new role" button to start create New Role. - * 4. Fill in all data according to data set. - * 5. Save role. - * 6. Perform assertions. - * - * @group ACL_(MX) - * @ZephyrId MPERF-7318 - */ -class CreateAdminUserRoleEntityTest extends Injectable -{ - /** - * User role index page. - * - * @var UserRoleIndex - */ - protected $userRoleIndex; - - /** - * User role edit page. - * - * @var UserRoleEditRole - */ - protected $userRoleEditRole; - - /** - * Injection data. - * - * @param UserRoleIndex $userRoleIndex - * @param UserRoleEditRole $userRoleEditRole - * @return void - */ - public function __inject(UserRoleIndex $userRoleIndex, UserRoleEditRole $userRoleEditRole) - { - $this->userRoleIndex = $userRoleIndex; - $this->userRoleEditRole = $userRoleEditRole; - } - - /** - * Run Create Admin User Role Entity test. - * - * @param Role $role - * @return void - */ - public function test(Role $role) - { - //Steps - $this->userRoleIndex->open(); - $this->userRoleIndex->getRoleActions()->addNew(); - $this->userRoleEditRole->getRoleFormTabs()->fill($role); - $this->userRoleEditRole->getPageActions()->save(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/TestCase/CreateAdminUserRoleEntityTest.xml b/dev/tests/functional/tests/app/Mage/Admin/Test/TestCase/CreateAdminUserRoleEntityTest.xml deleted file mode 100644 index bea74aeadb4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/TestCase/CreateAdminUserRoleEntityTest.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - AdminRole%isolation% - 123123q123123q - Custom - sales - - - - - AdminRole%isolation% - 123123q123123q - All - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/TestCase/UseAclRoleWithRestrictedGwsScopeTest.php b/dev/tests/functional/tests/app/Mage/Admin/Test/TestCase/UseAclRoleWithRestrictedGwsScopeTest.php deleted file mode 100644 index 0da0003a169..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/TestCase/UseAclRoleWithRestrictedGwsScopeTest.php +++ /dev/null @@ -1,129 +0,0 @@ - Permissions -> Users. Find user and open to edit it. - * 3. Go to User Role tab and assign user role from preconditions. Save changes. - * 4. Perform assertions. - * - * @group ACL_(MX) - * @ZephyrId MPERF-7602 - */ -class UseAclRoleWithRestrictedGwsScopeTest extends Injectable -{ - /** - * User index page. - * - * @var UserIndex - */ - protected $userIndexPage; - - /** - * User edit page. - * - * @var UserEdit - */ - protected $userEditPage; - - /** - * Factory of fixtures. - * - * @var FixtureFactory - */ - protected $fixtureFactory; - - /** - * Preconditions for test. - * - * @param FixtureFactory $fixtureFactory - * @return array - */ - public function __prepare(FixtureFactory $fixtureFactory) - { - /** @var Role $role */ - $role = $fixtureFactory->createByCode('role', ['dataset' => 'custom_with_gws_scope']); - $role->persist(); - $user = $fixtureFactory->createByCode('user', ['dataset' => 'admin_without_role']); - $user->persist(); - - $this->fixtureFactory = $fixtureFactory; - - return ['user' => $user, 'role' => $role]; - } - - /** - * Injection data. - * - * @param UserIndex $userIndex - * @param UserEdit $userEdit - * @return void - */ - public function __inject(UserIndex $userIndex, UserEdit $userEdit) - { - $this->userIndexPage = $userIndex; - $this->userEditPage = $userEdit; - } - - /** - * Run Use ACL Role with Restricted GWS Scope test. - * - * @param User $user - * @param Role $role - * @return array - */ - public function test(User $user, Role $role) - { - // Steps: - $this->userIndexPage->open(); - $this->userIndexPage->getUserGrid()->searchAndOpen(['email' => $user->getEmail()]); - $this->userEditPage->getUserForm()->fill($this->prepareUser($user, $role)); - $this->userEditPage->getFormPageActions()->save(); - - } - - /** - * Prepare user for test. - * - * @param User $user - * @param Role $role - * @return User - */ - protected function prepareUser(User $user, Role $role) - { - $userData = $user->getData(); - $userData['role_id'] = ['role' => $role]; - unset($userData['user_id'], $userData['password'], $userData['password_confirmation']); - - return $this->fixtureFactory->createByCode('user', ['data' => $userData]); - } - -} diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/TestCase/UseAclRoleWithRestrictedGwsScopeTest.xml b/dev/tests/functional/tests/app/Mage/Admin/Test/TestCase/UseAclRoleWithRestrictedGwsScopeTest.xml deleted file mode 100644 index bf46bcc7986..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/TestCase/UseAclRoleWithRestrictedGwsScopeTest.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Mage/Admin/Test/etc/curl/di.xml deleted file mode 100644 index ea5c80fd923..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/etc/curl/di.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Mage/Admin/Test/etc/fixture.xml deleted file mode 100644 index 261d7afb54e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/etc/fixture.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - flat - admin_user - Mage\Admin\Model\Resource\User\Collection - - - flat - admin_role - Mage\Admin\Model\Resource\Role\Collection - - - all - virtual - - - roles_resources - virtual - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Admin/Login.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Admin/Login.php deleted file mode 100644 index e3bd21b1cbf..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Admin/Login.php +++ /dev/null @@ -1,94 +0,0 @@ -dashboard = $dashboard; - } - - /** - * Submit login form. - * - * @return void - */ - protected function submit() - { - $this->_rootElement->find($this->submit, Locator::SELECTOR_CSS)->click(); - } - - /** - * Log in to admin panel. - * - * @param array $admin - * @return void - */ - public function loginToAdminPanel(array $admin) - { - $data = $this->dataMapping($admin); - $this->_fill($data); - $this->submit(); - if (!$this->_rootElement->isVisible()) { - $this->dashboard->getAdminPanelHeader()->waitVisible(); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Admin/Login.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Admin/Login.xml deleted file mode 100644 index f7404328eeb..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Admin/Login.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - login - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Api/User/Tab/Role.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Api/User/Tab/Role.php deleted file mode 100644 index 0ad95dabb65..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Api/User/Tab/Role.php +++ /dev/null @@ -1,51 +0,0 @@ -getRoleGrid()->searchAndSelect(['rolename' => $fields['role_id']['value']]); - } - - /** - * Returns role grid. - * - * @return Grid; - */ - public function getRoleGrid() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Api\User\Tab\Role\Grid', - ['element' => $this->_rootElement->find('#permissionsUserRolesGrid')] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Api/User/Tab/Role/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Api/User/Tab/Role/Grid.php deleted file mode 100644 index 220054f95b0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Api/User/Tab/Role/Grid.php +++ /dev/null @@ -1,40 +0,0 @@ - [ - 'selector' => '#permissionsUserRolesGrid_filter_role_name' - ] - ]; - - /** - * Radio button input selector. - * - * @var string - */ - protected $selectItem = '.a-center [type="radio"]'; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Api/User/UserForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Api/User/UserForm.php deleted file mode 100644 index 0d06c3cbc05..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Api/User/UserForm.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - \Mage\Adminhtml\Test\Block\Widget\Tab - #page_tabs_main_section - css selector - - - - - - - #user_password - - - #user_confirmation - - - - select - - - - - \Mage\Adminhtml\Test\Block\Api\User\Tab\Role - #page_tabs_roles_section - css selector - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cache/PageActions.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cache/PageActions.php deleted file mode 100644 index f5bd81a3a24..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cache/PageActions.php +++ /dev/null @@ -1,40 +0,0 @@ -_rootElement->find($this->flushCacheStorageButton)->click(); - $this->browser->acceptAlert(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Category/Content.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Category/Content.php deleted file mode 100644 index 2a730773837..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Category/Content.php +++ /dev/null @@ -1,41 +0,0 @@ -_rootElement->find($this->accessDenied)->isVisible(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Category/Edit/CategoryForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Category/Edit/CategoryForm.php deleted file mode 100644 index bf27e04af41..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Category/Edit/CategoryForm.php +++ /dev/null @@ -1,64 +0,0 @@ -hasData() ? parent::getData($category) : parent::getData(); - } - - /** - * Open tab. - * - * @param string $tabName - * @return Tab - */ - public function openTab($tabName) - { - $selector = $this->tabs[$tabName]['selector']; - $strategy = isset($this->tabs[$tabName]['strategy']) - ? $this->tabs[$tabName]['strategy'] - : Locator::SELECTOR_CSS; - $tab = $this->_rootElement->find($selector, $strategy); - $this->browser->find('#global_search')->click(); - $tab->click(); - - return $this; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Category/Edit/CategoryForm.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Category/Edit/CategoryForm.xml deleted file mode 100644 index 7b33db2d2de..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Category/Edit/CategoryForm.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - \Mage\Adminhtml\Test\Block\Widget\Tab - .//ul[contains(@id, "category_info_tabs")]/li[1]/a - xpath - general - - - select - - - - select - - - - - \Mage\Adminhtml\Test\Block\Widget\Tab - .//ul[contains(@id, "category_info_tabs")]/li[2]/a - xpath - general - - - select - - - select - - - #use_config_group_5available_sort_by - checkbox - - - #group_5available_sort_by - multiselect - - - #use_config_group_5default_sort_by - checkbox - - - select - - - select - - - select - - - select - - - - - \Mage\Adminhtml\Test\Block\Widget\Tab - .//ul[contains(@id, "category_info_tabs")]/li[3]/a - xpath - general - - - \Mage\Adminhtml\Test\Block\Catalog\Category\Edit\Tab\Product - #category_info_tabs_products - css selector - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Category/Edit/Tab/Product.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Category/Edit/Tab/Product.php deleted file mode 100644 index 3f5c3a9a98a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Category/Edit/Tab/Product.php +++ /dev/null @@ -1,105 +0,0 @@ -getProducts(); - $this->getProductGrid()->clear(); - foreach ($products as $product) { - $this->getProductGrid()->searchAndSelect(['sku' => $product->getSku()]); - } - - return $this; - } - - /** - * Returns product grid. - * - * @return Grid - */ - public function getProductGrid() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Catalog\Category\Edit\Tab\Product\Grid', - ['element' => $this->_rootElement->find($this->productGrid)] - ); - } - - /** - * Get data of tab. - * - * @param array|null $fields - * @param Element|null $element - * @return array - */ - public function getDataFormTab($fields = null, Element $element = null) - { - return ['category_products' => $this->getProducts($fields['category_products']['source']->getProducts())]; - } - - /** - * Get products. - * - * @param array $products - * @return array - */ - protected function getProducts(array $products) - { - $result = []; - $productGrid = $this->getProductGrid(); - foreach ($products as $key => $product) { - if ($productGrid->isSelect(['sku' => $product->getSku()])) { - $result[$key] = $product->getSku(); - } - } - - return $result; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Category/Edit/Tab/Product/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Category/Edit/Tab/Product/Grid.php deleted file mode 100644 index e38b0aafc1a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Category/Edit/Tab/Product/Grid.php +++ /dev/null @@ -1,78 +0,0 @@ - [ - 'selector' => '#catalog_category_products_filter_sku' - ] - ]; - - /** - * Clear grid. - * - * @return void - */ - public function clear() - { - $this->_rootElement->find($this->selectAll, Locator::SELECTOR_CSS, 'checkbox')->setValue('No'); - } - - /** - * Search for item product and select it. - * - * @param array $filter - * @return void - * @throws \Exception - */ - public function searchAndSelect(array $filter) - { - $this->search($filter); - $selectItem = $this->_rootElement->find($this->selectItem, Locator::SELECTOR_CSS, 'checkbox'); - if ($selectItem->isVisible()) { - $selectItem->setValue('No'); - $selectItem->setValue('Yes'); - } else { - throw new \Exception('Searched item product was not found.'); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Category/Tree.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Category/Tree.php deleted file mode 100644 index 7e12eba2aac..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Category/Tree.php +++ /dev/null @@ -1,162 +0,0 @@ -blockFactory->create( - 'Mage\Adminhtml\Test\Block\Template', - ['element' => $this->_rootElement->find($this->templateBlock, Locator::SELECTOR_XPATH)] - ); - } - - /** - * Press 'Add Subcategory' button. - * - * @return void - */ - public function addSubcategory() - { - $this->_rootElement->find($this->addSubcategory, Locator::SELECTOR_CSS)->click(); - $this->getTemplateBlock()->waitLoader(); - } - - /** - * Press 'Add Root Category' button. - * - * @return void - */ - public function addRootCategory() - { - $this->_rootElement->find($this->addRootCategory, Locator::SELECTOR_CSS)->click(); - $this->getTemplateBlock()->waitLoader(); - } - - /** - * Select category. - * - * @param CatalogCategory $category - * @param bool $fullPath - * @return void - */ - public function selectCategory(CatalogCategory $category, $fullPath = true) - { - $parentPath = $this->prepareFullCategoryPath($category); - if (!$fullPath) { - array_pop($parentPath); - } - if (empty($parentPath)) { - return; - } - $path = implode('/', $parentPath); - $this->expandAllCategories(); - $this->_rootElement->find($this->treeElement, Locator::SELECTOR_CSS, 'tree')->setValue($path); - $this->getTemplateBlock()->waitLoader(); - } - - /** - * Prepare category path. - * - * @param CatalogCategory $category - * @return array - */ - protected function prepareFullCategoryPath(CatalogCategory $category) - { - $path = []; - if ($category->hasData('parent_id')) { - $parentCategory = $category->getDataFieldConfig('parent_id')['source']->getParentCategory(); - if ($parentCategory != null) { - $path = $this->prepareFullCategoryPath($parentCategory); - } - } - return array_filter(array_merge($path, [$category->getPath(), $category->getName()])); - } - - /** - * Expand all categories tree. - * - * @return void - */ - protected function expandAllCategories() - { - $this->browser->find($this->addRootCategory)->hover(); - $this->_rootElement->find($this->expandAll)->click(); - } - - /** - * Check category in category tree. - * - * @param CatalogCategory $category - * @return bool - */ - public function isCategoryVisible(CatalogCategory $category) - { - $categoryPath = $this->prepareFullCategoryPath($category); - $categoryPath = implode('/', $categoryPath); - return $this->_rootElement->find($this->treeElement, Locator::SELECTOR_CSS, 'tree') - ->isElementVisible($categoryPath); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/CustomAttribute.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/CustomAttribute.php deleted file mode 100644 index 9a4db9ce7f6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/CustomAttribute.php +++ /dev/null @@ -1,175 +0,0 @@ - null, - 'textarea' => null, - 'hasDatepicker' => 'datepicker', - 'select' => 'select', - 'multiselect' => 'multiselect', - ]; - - /** - * @constructor - * @param DriverInterface $driver - * @param EventManagerInterface $eventManager - * @param Locator $locator - * @param ElementInterface $context - */ - public function __construct( - DriverInterface $driver, - EventManagerInterface $eventManager, - Locator $locator, - ElementInterface $context = null - ) { - parent:: __construct($driver, $eventManager, $locator, $context); - - $this->attributeLabel = $this->getAttributeLabelFromPage(); - } - - /** - * Get attribute label. - * - * @return mixed - */ - protected function getAttributeLabelFromPage() - { - $label = $this->find($this->attributeLabel, Locator::SELECTOR_XPATH)->getText(); - return str_replace(' *', '', $label); - } - - /** - * Set attribute value. - * - * @param array|string $data - * @return void - */ - public function setValue($data) - { - $this->eventManager->dispatchEvent(['set_value'], [__METHOD__, $this->getAbsoluteSelector()]); - $element = $this->getElementByClass($this->getElementClass()); - $value = is_array($data) ? $data['value'] : $data; - $this->find(sprintf($this->inputSelector, $this->attributeLabel), Locator::SELECTOR_CSS, $element) - ->setValue($value); - } - - /** - * Get custom attribute value. - * - * @return string|array - */ - public function getValue() - { - $this->eventManager->dispatchEvent(['get_value'], [__METHOD__, $this->getAbsoluteSelector()]); - $inputType = $this->getElementByClass($this->getElementClass()); - return $this->find(sprintf($this->inputSelector, $this->attributeLabel), Locator::SELECTOR_CSS, $inputType) - ->getValue(); - } - - /** - * Get custom attribute values. - * - * @return array - */ - public function getValues() - { - $result = []; - $this->eventManager->dispatchEvent(['get_value'], [__METHOD__, $this->getAbsoluteSelector()]); - $inputType = $this->getElementByClass($this->getElementClass()); - $element = $this->find(sprintf($this->inputSelector, $this->attributeLabel), Locator::SELECTOR_CSS, $inputType); - $values = $element->getElements('option'); - foreach ($values as $value) { - $result[] = $value->getText(); - } - - return array_reverse($this->prepareResult($inputType, $result)); - } - - /** - * Prepare result. - * - * @param string $inputType - * @param array $result - * @return array - */ - protected function prepareResult($inputType, array $result) - { - if ($inputType == 'multiselect') { - return $result; - } else { - array_shift($result); - return $result; - } - } - - /** - * Get element type by class. - * - * @param string $class - * @return string - */ - protected function getElementByClass($class) - { - $element = null; - foreach ($this->classReference as $key => $reference) { - if (str_contains($class, $key)) { - $element = $reference; - } - } - return $element; - } - - /** - * Get element class. - * - * @return string - */ - protected function getElementClass() - { - return $this->find(sprintf($this->inputSelector, $this->attributeLabel))->getAttribute('class'); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Edit/AttributeForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Edit/AttributeForm.php deleted file mode 100644 index 1344cfc1a92..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Edit/AttributeForm.php +++ /dev/null @@ -1,105 +0,0 @@ -tabs) as $tabName) { - $this->openTab($tabName); - $tabData = $this->getTabElement($tabName)->getDataFormTab(); - $data = array_merge($data, $tabData); - } - } else { - $tabsFields = $this->getFieldsByTabs($fixture); - foreach ($tabsFields as $tabName => $fields) { - $this->openTab($tabName); - $tabData = $this->getTabElement($tabName)->getDataFormTab($fields); - $data = array_merge($data, $tabData); - } - } - return $data; - } - - /** - * Fill form with tabs. - * - * @param FixtureInterface $fixture - * @param Element|null $element - * @return FormTabs - */ - public function fill(FixtureInterface $fixture, Element $element = null) - { - $tabs = $this->getFieldsByTabs($fixture); - - $this->openTab('attribute-properties'); - $tabElement = $this->getTabElement('attribute-properties'); - $tabElement->fillFormTab($tabs['attribute-properties'], $element); - unset($tabs['attribute-properties']); - - return $this->fillTabs($tabs, $element); - } - - /** - * Get options ids. - * - * @return array - */ - public function getOptionsIds() - { - $this->openTab('manage-options'); - return $this->getTabElement('manage-options')->getOptionsIds(); - } - - /** - * Get attribute id. - * - * @return int - */ - public function getAttributeId() - { - $attributeId = $this->_rootElement->find($this->deleteButton)->getAttribute('onclick'); - preg_match('`attribute_id/(\d+)`', $attributeId, $matches); - return $matches[1]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Edit/AttributeForm.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Edit/AttributeForm.xml deleted file mode 100644 index f97f4ced507..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Edit/AttributeForm.xml +++ /dev/null @@ -1,98 +0,0 @@ - - - - - \Mage\Adminhtml\Test\Block\Widget\Tab - #product_attribute_tabs_main - css selector - - - - - select - - - select - - - select - - - - select - - - select - - - - - \Mage\Adminhtml\Test\Block\Widget\Tab - #product_attribute_tabs_main - css selector - - - select - - - select - - - select - - - select - - - select - - - select - - - select - - - select - - - select - - - select - - - - - \Mage\Adminhtml\Test\Block\Widget\Tab - #product_attribute_tabs_labels - css selector - - - [name="frontend_label[0]"] - - - [name="frontend_label[1]"] - - - - - \Mage\Adminhtml\Test\Block\Catalog\Product\Attribute\Edit\Tab\Options - #product_attribute_tabs_labels - css selector - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Edit/Tab/Options.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Edit/Tab/Options.php deleted file mode 100644 index b8f259cb22c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Edit/Tab/Options.php +++ /dev/null @@ -1,127 +0,0 @@ -_rootElement->find($this->addOption)->click(); - $this->getOptionsBlock()->fillOption($field); - } - return $this; - } - - /** - * Get data of tab. - * - * @param array|null $fields - * @param Element|null $element - * @return array - */ - public function getDataFormTab($fields = null, Element $element = null) - { - $result = []; - $options = []; - foreach ($fields['options']['value'] as $key => $field) { - $options[] = $this->getOptionsBlock($key)->getOption($field); - } - $result['options'] = array_reverse($options); - - return $result; - } - - /** - * Get options block. - * - * @param int|null $key - * @return Option - */ - protected function getOptionsBlock($key = null) - { - $row = ''; - if ($key !== null) { - $row = sprintf($this->optionsRow, $key + 2); - } - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Catalog\Product\Attribute\Edit\Tab\Options\Option', - ['element' => $this->_rootElement->find($this->optionsBlock . $row, Locator::SELECTOR_XPATH)] - ); - } - - /** - * Get options ids. - * - * @return array - */ - public function getOptionsIds() - { - $result = []; - $selector = $this->optionsBlock . $this->optionsSelector; - $options = $this->_rootElement->getElements($selector, Locator::SELECTOR_XPATH); - foreach ($options as $option) { - $elementName = $option->getAttribute('name'); - preg_match('`option\[value\]\[(\d+)\]\[0\]`', $elementName, $matches); - $result[$option->getValue()] = $matches[1]; - } - - return $result; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Edit/Tab/Options/Option.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Edit/Tab/Options/Option.php deleted file mode 100644 index f0033224065..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Edit/Tab/Options/Option.php +++ /dev/null @@ -1,50 +0,0 @@ -dataMapping($fields); - $this->_fill($data); - } - - /** - * Get attribute option. - * - * @param array $value - * @return array - */ - public function getOption(array $value) - { - $mapping = $this->dataMapping($value); - $options = $this->_getData($mapping); - - return $options; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Edit/Tab/Options/Option.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Edit/Tab/Options/Option.xml deleted file mode 100644 index 45939ac22ad..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Edit/Tab/Options/Option.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - [name="default[]"] - checkbox - - - [name$="[0]"] - - - [name$="[1]"] - - - [name^="option[order]"] - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Grid.php deleted file mode 100644 index 704a0351831..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Grid.php +++ /dev/null @@ -1,71 +0,0 @@ - [ - 'selector' => 'input[name="attribute_code"]' - ], - 'frontend_label' => [ - 'selector' => 'input[name="frontend_label"]' - ], - 'is_required' => [ - 'selector' => 'select[name="is_required"]', - 'input' => 'select' - ], - 'is_user_defined' => [ - 'selector' => 'select[name="is_user_defined"]', - 'input' => 'select' - ], - 'is_visible' => [ - 'selector' => 'select[name="is_visible"]', - 'input' => 'select' - ], - 'is_global' => [ - 'selector' => 'select[name="is_global"]', - 'input' => 'select' - ], - 'is_searchable' => [ - 'selector' => 'select[name="is_searchable"]', - 'input' => 'select' - ], - 'is_filterable' => [ - 'selector' => 'select[name="is_filterable"]', - 'input' => 'select' - ], - 'is_comparable' => [ - 'selector' => 'select[name="is_comparable"]', - 'input' => 'select' - ] - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Set/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Set/Grid.php deleted file mode 100644 index 4d33865d010..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Set/Grid.php +++ /dev/null @@ -1,40 +0,0 @@ - [ - 'selector' => 'input[name="set_name"]', - ], - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Set/Main.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Set/Main.php deleted file mode 100644 index cc25d2d4264..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Set/Main.php +++ /dev/null @@ -1,138 +0,0 @@ -_rootElement->find(sprintf($this->attribute, 'color'), Locator::SELECTOR_XPATH)->click(); - $attributeLocator = sprintf($this->attribute, $attribute); - $attribute = $this->_rootElement->find($attributeLocator, Locator::SELECTOR_XPATH); - $attribute->click(); - $target = $this->_rootElement->find(sprintf($this->groups, $attributeGroup), Locator::SELECTOR_XPATH); - $this->browser->refresh(); - $attribute->dragAndDrop($target); - } - - /** - * Get AttributeSet name from product_set edit page. - * - * @return string - */ - public function getAttributeSetName() - { - return $this->_rootElement->find($this->attributeSetName, Locator::SELECTOR_CSS)->getValue(); - } - - /** - * Checks present Product Attribute on product_set Groups. - * - * @param string $attributeLabel - * @return bool - */ - public function checkProductAttribute($attributeLabel) - { - $attributeLabelLocator = sprintf($this->attributeLocator, $attributeLabel); - return $this->_rootElement->find($attributeLabelLocator, Locator::SELECTOR_XPATH)->isVisible(); - } - - /** - * Checks present Unassigned Product Attribute. - * - * @param string $attributeLabel - * @return bool - */ - public function checkUnassignedProductAttribute($attributeLabel) - { - $attributeLabelLocator = sprintf($this->attributeLabel, $attributeLabel); - - return $this->_rootElement->find($attributeLabelLocator, Locator::SELECTOR_XPATH)->isVisible(); - } - - /** - * Add attribute set group to Attribute Set. - * - * @param string $groupName - * @return void - */ - public function addAttributeSetGroup($groupName) - { - $this->_rootElement->find($this->addGroupButton)->click(); - $this->browser->setAlertText($groupName); - $this->browser->acceptAlert(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Set/Main/AttributeSetForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Set/Main/AttributeSetForm.php deleted file mode 100644 index a2eca905f97..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Set/Main/AttributeSetForm.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - select - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Set/Main/EditForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Set/Main/EditForm.php deleted file mode 100644 index 0a52dfcadee..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Set/Main/EditForm.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AbstractAppurtenant.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AbstractAppurtenant.php deleted file mode 100644 index fda248bf524..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AbstractAppurtenant.php +++ /dev/null @@ -1,82 +0,0 @@ -type]['value'])) { - $context = $element ? $element : $this->_rootElement; - $relatedBlock = $this->getGrid($context); - - foreach ($data[$this->type]['value'] as $product) { - $relatedBlock->searchAndSelect(['sku' => $product['sku']]); - } - } - - return $this; - } - - /** - * Get data of tab. - * - * @param array|null $fields - * @param Element|null $element - * @return array - */ - public function getDataFormTab($fields = null, Element $element = null) - { - $relatedBlock = $this->getGrid($element); - $columns = [ - 'entity_id' => '.="ID"', - 'name' => '.="Name"', - 'sku' => '.="SKU"', - ]; - $relatedProducts = $relatedBlock->getRowsData($columns); - - return [$this->type => $relatedProducts]; - } - - /** - * Return related products grid. - * - * @param Element $element - * @return Grid - */ - abstract protected function getGrid(Element $element = null); -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AbstractAppurtenantProductsGrid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AbstractAppurtenantProductsGrid.php deleted file mode 100644 index 17e85c547e8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AbstractAppurtenantProductsGrid.php +++ /dev/null @@ -1,53 +0,0 @@ - [ - 'selector' => 'input[name="name"]', - ], - 'sku' => [ - 'selector' => 'input[name="sku"]', - ], - 'type' => [ - 'selector' => 'select[name="type"]', - 'input' => 'select', - ], - ]; - - /** - * Column selectors map. - * - * @var array - */ - protected $columnFilters = [ - 'entity_id' => '.="ID"', - 'name' => '.="Name"', - 'sku' => '.="SKU"', - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AbstractOptions.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AbstractOptions.php deleted file mode 100644 index 193d58426bf..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AbstractOptions.php +++ /dev/null @@ -1,54 +0,0 @@ -_rootElement : $element; - $mapping = $this->dataMapping($fields); - $this->_fill($mapping, $element); - return $this; - } - - /** - * Getting options data form on the product form. - * - * @param array $fields [optional] - * @param Element $element [optional] - * @return $this - */ - public function getOptions(array $fields = null, Element $element = null) - { - $element = $element === null ? $this->_rootElement : $element; - $mapping = $this->dataMapping($fields); - return $this->_getData($mapping, $element); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AbstractSelectOptions.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AbstractSelectOptions.php deleted file mode 100644 index 6576bd3001d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AbstractSelectOptions.php +++ /dev/null @@ -1,94 +0,0 @@ -_rootElement; - foreach ($fields as $key => $value) { - $this->clickAddNewOptionsButton(); - $element = $context->find(sprintf($this->itemOption, ++$key), Locator::SELECTOR_XPATH); - parent::fillOptions($value, $element); - } - - return $this; - } - - /** - * Click on add new options button. - * - * @return void - */ - protected function clickAddNewOptionsButton() - { - $this->_rootElement->find($this->addButton)->click(); - } - - /** - * Getting options data form on the product form. - * - * @param array|null $fields - * @param Element|null $element - * @return array - */ - public function getOptions(array $fields = null, Element $element = null) - { - $result = []; - $context = $element ? $element : $this->_rootElement; - $items = $context->getElements($this->itemOptions, Locator::SELECTOR_XPATH); - foreach ($items as $key => $value) { - $result[$key] = parent::getOptions($fields[$key], $value); - } - - return $result; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AssociatedProducts.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AssociatedProducts.php deleted file mode 100644 index 558888f650c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AssociatedProducts.php +++ /dev/null @@ -1,107 +0,0 @@ -getSearchGridBlock(); - foreach ($fields['associated']['value'] as $key => $groupedProduct) { - $gridBlock->searchAndSelect(['name' => $groupedProduct['name'], 'id' => $groupedProduct['id']]); - $this->getProductBlock()->fillOptions($groupedProduct); - } - } - return $this; - } - - /** - * Get associated products grid. - * - * @return Grid - */ - protected function getSearchGridBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\AssociatedProducts\Grid', - ['element' => $this->_rootElement->find($this->productSearchGrid)] - ); - } - - /** - * Get product row block. - * - * @param int $key [optional] - * @return Product - */ - protected function getProductBlock($key = 1) - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\AssociatedProducts\Product', - ['element' => $this->_rootElement->find(sprintf($this->productRow, $key), Locator::SELECTOR_XPATH)] - ); - } - - /** - * Get data of tab. - * - * @param array|null $fields - * @param Element|null $element - * @return array - */ - public function getDataFormTab($fields = null, Element $element = null) - { - $result = []; - $options = []; - foreach ($fields['associated']['value'] as $key => $field) { - $options[$key] = $this->getProductBlock($key + 1)->getOptions($field); - } - $result['associated'] = array_reverse($options); - - return $result; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AssociatedProducts/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AssociatedProducts/Grid.php deleted file mode 100644 index 6c6af597b67..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AssociatedProducts/Grid.php +++ /dev/null @@ -1,41 +0,0 @@ - [ - 'selector' => '#super_product_grid_filter_name', - ], - 'id' => [ - 'selector' => '#super_product_grid_filter_entity_id', - ], - 'sku' => [ - 'selector' => '#super_product_grid_filter_sku', - ], - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AssociatedProducts/Product.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AssociatedProducts/Product.php deleted file mode 100644 index a0e6b860a55..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AssociatedProducts/Product.php +++ /dev/null @@ -1,86 +0,0 @@ -dataMapping($value); - $this->_fill($mapping); - } - - /** - * Get product options. - * - * @param array $value - * @return array - */ - public function getOptions(array $value) - { - $mapping = $this->dataMapping($value); - $options = $this->_getData($mapping); - $options['id'] = $this->getProductId(); - $options['name'] = $this->getProductName(); - return $options; - } - - /** - * Get product name. - * - * @return string - */ - protected function getProductName() - { - return $this->_rootElement->find($this->productName, Locator::SELECTOR_XPATH)->getText(); - } - - /** - * Get product id. - * - * @return string - */ - protected function getProductId() - { - return $this->_rootElement->find($this->productId, Locator::SELECTOR_XPATH)->getText(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AssociatedProducts/Product.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AssociatedProducts/Product.xml deleted file mode 100644 index 0e3cc62887c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AssociatedProducts/Product.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Categories.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Categories.php deleted file mode 100644 index 82c652832f0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Categories.php +++ /dev/null @@ -1,112 +0,0 @@ -selectCategory($category); - } - - return $this; - } - - /** - * Get value. - * - * @param null $fields - * @param Element $element - * @return array - */ - public function getDataFormTab($fields = null, Element $element = null) - { - return [ - 'category_ids' => $this->_rootElement->find($this->treeElement, Locator::SELECTOR_CSS, 'tree')->getValue() - ]; - } - - /** - * Select category. - * - * @param CatalogCategory $category - * @param bool $fullPath - * @return void - */ - public function selectCategory(CatalogCategory $category, $fullPath = true) - { - $parentPath = $this->prepareFullCategoryPath($category); - if (!$fullPath) { - array_pop($parentPath); - } - $path = implode('/', $parentPath); - - $this->_rootElement->find($this->treeElement, Locator::SELECTOR_CSS, 'tree')->setValue($path); - } - - /** - * Prepare category path. - * - * @param CatalogCategory $category - * @return array - */ - protected function prepareFullCategoryPath(CatalogCategory $category) - { - $path = []; - $parentCategory = $category->getDataFieldConfig('parent_id')['source']->getParentCategory(); - - if ($parentCategory != null) { - $path = $this->prepareFullCategoryPath($parentCategory); - } - return array_filter(array_merge($path, [$category->getPath(), $category->getName()])); - } - - /** - * Check category in category tree. - * - * @param CatalogCategory $category - * @return bool - */ - public function isCategoryVisible(CatalogCategory $category) - { - $categoryPath = $this->prepareFullCategoryPath($category); - return $this->_rootElement->find($this->treeElement, Locator::SELECTOR_CSS, 'tree') - ->isCategoryVisible($categoryPath); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable.php deleted file mode 100644 index 3fef4c9c769..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable.php +++ /dev/null @@ -1,237 +0,0 @@ -selectProducts($fields['configurable_options']['value']['products']); - $this->fillAttributes($fields['configurable_options']['value']['attributes_data']); - - return $this; - } - - /** - * Get data of tab. - * - * @param array|null $fields - * @param Element|null $element - * @return array - */ - public function getDataFormTab($fields = null, Element $element = null) - { - return [ - 'configurable_options' => [ - 'products' => $this->getProducts($fields['configurable_options']['value']['products']), - 'attributes_data' => $this->getAttributes($fields['configurable_options']['value']['attributes_data']) - ] - ]; - } - - /** - * Fill attributes. - * - * @param array $attributes - * @return void - */ - public function fillAttributes(array $attributes) - { - foreach ($attributes as $attribute) { - $this->getItemAttributeForm($attribute['attribute_code'])->fillAttribute($attribute); - } - } - - /** - * Get attributes. - * - * @param array $attributes - * @return array - */ - protected function getAttributes(array $attributes) - { - $result = []; - foreach ($attributes as $key => $attribute) { - $result[$key] = $this->getItemAttributeForm($attribute['attribute_code'])->getAttribute($attribute); - } - - return $result; - } - - /** - * Select products. - * - * @param array $products - * @return void - */ - public function selectProducts(array $products) - { - $productGrid = $this->getProductGrid(); - foreach ($products as $product) { - $productGrid->searchAndSelect(['sku' => $product]); - } - } - - /** - * Get products. - * - * @param array $products - * @return array - */ - protected function getProducts(array $products) - { - $result = []; - $productGrid = $this->getProductGrid(); - foreach ($products as $key => $product) { - if ($productGrid->isSelect(['sku' => $product])) { - $result[$key] = $product; - } - } - - return $result; - } - - /** - * Get product grid. - * - * @return Grid - */ - protected function getProductGrid() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Configurable\Grid', - ['element' => $this->_rootElement->find($this->grid)] - ); - } - - /** - * Get item attribute form. - * - * @param string $key - * @return Attribute - */ - protected function getItemAttributeForm($key) - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Configurable\Attribute', - ['element' => $this->_rootElement->find(sprintf($this->itemAttribute, $key), Locator::SELECTOR_XPATH)] - ); - } - - /** - * Unselect all products. - * - * @return void - */ - public function unselectAllProducts() - { - $this->getProductGrid()->unselectAllProducts(); - } - - /** - * Get quick creation block. - * - * @return QuickCreation - */ - public function getQuickCreationBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Configurable\QuickCreation', - ['element' => $this->_rootElement->find($this->simpleForm)] - ); - } - - /** - * Get new product popup. - * - * @return NewProductPopup - */ - public function getNewProductPopup() - { - $this->browser->selectWindow(); - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Configurable\NewProductPopup', - ['element' => $this->browser->find($this->newProductPopup)] - ); - } - - /** - * Get simple associated product block. - * - * @return SimpleAssociatedProduct - */ - public function getSimpleAssociatedProductBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Configurable\SimpleAssociatedProduct', - ['element' => $this->_rootElement->find($this->simpleAssociatedProduct)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/Attribute.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/Attribute.php deleted file mode 100644 index f3703ce6001..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/Attribute.php +++ /dev/null @@ -1,129 +0,0 @@ -dataMapping($attributeMapping); - $this->_fill($mapping); - $this->fillOptions($options); - } - - /** - * Get item attribute. - * - * @param array $attribute - * @return array - */ - public function getAttribute(array $attribute) - { - $attributeMapping = []; - $attributeMapping['frontend_label'] = $attribute['frontend_label']; - $options = $attribute['options']; -// unset($attribute['options']); - $mapping = $this->dataMapping($attributeMapping); - - return array_merge($this->_getData($mapping), ['options' => $this->getOptions($options)]); - } - - /** - * Fill attribute options. - * - * @param array $options - * @return void - */ - protected function fillOptions(array $options) - { - $optionFields = [ - 'price', - 'price_type', - 'admin' - ]; - foreach ($options as $option) { - $option = array_intersect_key($option, array_flip($optionFields)); - $optionName = $option['admin']; - unset($option['admin']); - $this->getItemOption($optionName)->fillOption($option); - } - } - - /** - * Get attribute options. - * - * @param array $options - * @return array - */ - protected function getOptions(array $options) - { - $result = []; - $optionFields = [ - 'price', - 'price_type', - 'admin' - ]; - foreach ($options as $key => $option) { - $option = array_intersect_key($option, array_flip($optionFields)); - $optionName = $option['admin']; - unset($option['admin']); - $result[$key] = array_merge( - $this->getItemOption($optionName)->getOption($option), - ['admin' => $optionName] - ); - } - - return $result; - } - - /** - * Get item option form. - * - * @param string $key - * @return Option - */ - protected function getItemOption($key) - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Configurable\Attribute\Option', - ['element' => $this->_rootElement->find(sprintf($this->itemOption, $key), Locator::SELECTOR_XPATH)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/Attribute.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/Attribute.xml deleted file mode 100644 index e30b5509d15..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/Attribute.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - [id$="_label"] - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/Attribute/Option.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/Attribute/Option.php deleted file mode 100644 index c579761420d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/Attribute/Option.php +++ /dev/null @@ -1,48 +0,0 @@ -dataMapping($option); - $this->_fill($mapping); - } - - /** - * Get option. - * - * @param array $option - * @return array - */ - public function getOption(array $option) - { - $mapping = $this->dataMapping($option); - return $this->_getData($mapping); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/Attribute/Option.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/Attribute/Option.xml deleted file mode 100644 index b9dbd85dd6e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/Attribute/Option.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - [id$="_pricing"] - - - [id$="_price_type"] - select - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/Grid.php deleted file mode 100644 index c6c586edebd..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/Grid.php +++ /dev/null @@ -1,59 +0,0 @@ - [ - 'selector' => '#super_product_links_filter_sku' - ] - ]; - - /** - * Unselect all products. - * - * @return void - */ - public function unselectAllProducts() - { - $this->_rootElement->find($this->selectAll, Locator::SELECTOR_CSS, 'checkbox')->setValue('No'); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/NewProductPopup.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/NewProductPopup.php deleted file mode 100644 index 9be1c2aca92..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/NewProductPopup.php +++ /dev/null @@ -1,64 +0,0 @@ -blockFactory->create( - 'Mage\Adminhtml\Test\Block\Catalog\Product\FormPageActions', - ['element' => $this->_rootElement->find($this->formPageActions)] - ); - } - - /** - * Close popup. - * - * @return void - */ - public function close() - { - $this->waitForElementVisible($this->saveMessage); - $this->browser->closeWindow(); - $this->browser->selectWindow(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/NewProductPopup.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/NewProductPopup.xml deleted file mode 100644 index a433375bc2e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/NewProductPopup.xml +++ /dev/null @@ -1,164 +0,0 @@ - - - - - \Mage\Adminhtml\Test\Block\Widget\Tab - //ul[@id="product_info_tabs"]/li[1]/a - xpath - product - - - - - - - - select - - - - select - - - Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Configurable\QuickCreation\AttributesElement - .form-list - - - - - \Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Prices - //ul[@id="product_info_tabs"]/li[2]/a - xpath - product - - - - select - - - - - - - - \Mage\Adminhtml\Test\Block\Widget\Tab - #product_info_tabs_inventory - product - - - - [name="product[stock_data][qty]"] - - - [name="product[stock_data][is_in_stock]"] - select - - - [name="product[stock_data][use_config_manage_stock]"] - checkbox - - - [name="product[stock_data][manage_stock]"] - select - - - [name='product[stock_data][use_config_min_qty]'] - checkbox - - - [name='product[stock_data][min_qty]'] - - - - - - \Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Categories - #product_info_tabs_categories - product - - - #product-categories - - - - - \Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\CustomOptions - #product_info_tabs_customer_options - css selector - - - <selector>input[id$='_title']</selector> - <strategy>css selector</strategy> - - - select[id$='_is_require'] - css selector - select - - - select[id$='_type'] - css selector - optgroupselect - - - - - \Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Related - #product_info_tabs_related - css selector - - - \Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Crosssell - #product_info_tabs_crosssell - css selector - - - \Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Upsell - #product_info_tabs_upsell - css selector - - - \Mage\Adminhtml\Test\Block\Widget\Tab - #product_info_tabs_group_17 - css selector - product - - - checkbox - - - select - - - select - - - - - - \Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Websites - #product_info_tabs_websites - css selector - - - //*[@class="website-name" and .//label[text()="%s"]]/input - checkbox - xpath - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/QuickCreation.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/QuickCreation.php deleted file mode 100644 index be0fc0dc02d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/QuickCreation.php +++ /dev/null @@ -1,95 +0,0 @@ -fillDefaultField($product); - $mapping = $this->dataMapping($product->getData()); - unset($mapping['isPersist']); - $this->_fill($mapping); - $this->_rootElement->find($this->create)->click(); - $this->getTemplateBlock()->waitLoader(); - } - - /** - * Fill default fields. - * - * @param InjectableFixture $product - * @return void - */ - protected function fillDefaultField(InjectableFixture $product) - { - $data = []; - foreach ($this->defaultFields as $field) { - if ($product->hasData($field)) { - $data[$field . '_autogenerate'] = 'No'; - } - } - $mapping = $this->dataMapping($data); - $this->_fill($mapping); - } - - /** - * Get backend abstract block. - * - * @return Template - */ - protected function getTemplateBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Template', - ['element' => $this->_rootElement->find($this->templateBlock, Locator::SELECTOR_XPATH)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/QuickCreation.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/QuickCreation.xml deleted file mode 100644 index c94a34fbe74..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/QuickCreation.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - simple_product - - - checkbox - - - - checkbox - - - - - select - - - select - - - Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Configurable\QuickCreation\AttributesElement - .form-list - - - - [name="simple_product[stock_data][qty]"] - - - [name="simple_product[stock_data][is_in_stock]"] - select - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/QuickCreation/AttributesElement.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/QuickCreation/AttributesElement.php deleted file mode 100644 index a189d0225bd..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/QuickCreation/AttributesElement.php +++ /dev/null @@ -1,58 +0,0 @@ - $itemValue) { - $selector = sprintf($this->attributeInput, $attributeCode, $this->escapeQuotes($itemValue)); - $option = $this->find($selector, Locator::SELECTOR_XPATH); - $option->click(); - } - } - - /** - * Skip this method. - * - * @return void - */ - public function getValue() - { - // - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/SimpleAssociatedProduct.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/SimpleAssociatedProduct.php deleted file mode 100644 index 2b5f100ccff..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/SimpleAssociatedProduct.php +++ /dev/null @@ -1,60 +0,0 @@ -browser->find(".//h4[text()='Create Simple Associated Product']", Locator::SELECTOR_XPATH)->hover(); - $this->_rootElement->find($this->createEmpty)->click(); - } - - /** - * Click on 'Copy From Configurable' button. - * - * @return void - */ - public function clickCopyFromConfigurable() - { - $this->_rootElement->find($this->copyFromConfigurable)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Crosssell.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Crosssell.php deleted file mode 100644 index 8e1d8e46023..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Crosssell.php +++ /dev/null @@ -1,54 +0,0 @@ -_rootElement; - return $this->blockFactory->create( - '\Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Crosssell\Grid', - ['element' => $element->find($this->crossSellGrid)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Crosssell/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Crosssell/Grid.php deleted file mode 100644 index fc5f6dc32c5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Crosssell/Grid.php +++ /dev/null @@ -1,31 +0,0 @@ -_rootElement; - foreach ($fields['custom_options']['value'] as $field) { - $context->find($this->addOptions)->click(); - $element = $this->getOptionsBlock(1, $context); - $options = array_pop($field); - $data = $this->dataMapping($field); - $this->_fill($data, $element); - $field['type'] = explode('/', $field['type'])[1]; - $this->fillSubOptions([$field['type'] => $options], $element); - } - - return $this; - } - - /** - * Fill price options. - * - * @param array $options - * @param Element $element - * @return void - */ - protected function fillSubOptions(array $options, Element $element) - { - $optionType = key($options); - $this->getSubOptionsBlock($optionType, $element)->fillOptions($options[$optionType]); - } - - /** - * Get option name. - * - * @param string $optionType - * @return string - */ - protected function getOptionName($optionType) - { - $optionName = str_replace([' ', '&'], "", $optionType); - $end = strpos($optionType, '-'); - if ($end !== false) { - $optionName = substr($optionName, 0, $end) . ucfirst(substr($optionName, ($end + 1))); - } - return $optionName; - } - - /** - * Get sub options block. - * - * @param string $optionType - * @param Element $context - * @return AbstractOptions - */ - protected function getSubOptionsBlock($optionType, Element $context) - { - return $this->blockFactory->create( - __NAMESPACE__ . '\\CustomOptions\\' . $this->getOptionName($optionType), - ['element' => $context->find($this->subOptions)] - ); - } - - /** - * Get data of tab. - * - * @param array|null $fields - * @param Element|null $element - * @return array - */ - public function getDataFormTab($fields = null, Element $element = null) - { - $result = []; - $context = $element ? $element : $this->_rootElement; - foreach ($fields['custom_options']['value'] as $key => $field) { - $element = $this->getOptionsBlock(($key + 1), $context); - $data = $this->dataMapping($field); - unset($data['options']); - $result['custom_options'][$key] = $this->_getData($data, $element); - $result['custom_options'][$key]['options'] = $this->getSubOptions($element); - } - - return $result; - } - - /** - * Get sub options. - * - * @param Element $element - * @return array - */ - protected function getSubOptions(Element $element) - { - $optionType = $element->find($this->checkedOptionType)->getText(); - $optionType = str_replace([' ', '&', '-'], '', $optionType); - return $this->getSubOptionsBlock($optionType, $element)->getOptions(); - } - - /** - * Get sub options. - * - * @param Element $element - * @param int $key - * @return Element - */ - protected function getOptionsBlock($key, Element $element) - { - $element = $element ? $element : $this->_rootElement; - return $element->find(sprintf($this->itemCustomOptions, $key), Locator::SELECTOR_XPATH); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/Area.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/Area.php deleted file mode 100644 index 2fc9fe3de85..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/Area.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - [id$='_price'] - - - [id$='_price_type'] - select - - - [name$='[sku]'] - - - [name$='[max_characters]'] - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/Checkbox.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/Checkbox.php deleted file mode 100644 index 17b82f14306..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/Checkbox.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - <selector>[id$="_title"]</selector> - - - [id$="_price"] - - - [id$="_price_type"] - select - - - [name$='[sku]'] - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/Date.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/Date.php deleted file mode 100644 index 997627afdff..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/Date.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - [id$='_price'] - - - [id$='_price_type'] - select - - - [name$='[sku]'] - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/DateTime.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/DateTime.php deleted file mode 100644 index 5acbfc5d346..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/DateTime.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - [id$='_price'] - - - [id$='_price_type'] - select - - - [name$='[sku]'] - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/DropDown.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/DropDown.php deleted file mode 100644 index cf93d81e1ba..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/DropDown.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - <selector>[id$="_title"]</selector> - - - [id$="_price"] - - - [id$="_price_type"] - select - - - [name$='[sku]'] - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/Field.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/Field.php deleted file mode 100644 index 7252af44bfe..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/Field.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - [id$='_price'] - - - [id$='_price_type'] - select - - - [name$='[sku]'] - - - [name$='[max_characters]'] - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/File.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/File.php deleted file mode 100644 index fa088e73661..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/File.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - [name$='[price]'] - - - [name$='[price_type]'] - select - - - [name$='[sku]'] - - - [name$='[file_extension]'] - - - [name$='[image_size_x]'] - - - [name$='[image_size_y]'] - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/MultipleSelect.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/MultipleSelect.php deleted file mode 100644 index a8606df5949..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/MultipleSelect.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - <selector>[id$="_title"]</selector> - - - [id$="_price"] - - - [id$="_price_type"] - select - - - [name$='[sku]'] - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/RadioButtons.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/RadioButtons.php deleted file mode 100644 index 56f787bdd1f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/RadioButtons.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - <selector>[id$="_title"]</selector> - - - [id$="_price"] - - - [id$="_price_type"] - select - - - [name$='[sku]'] - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/Time.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/Time.php deleted file mode 100644 index 264818d4bd0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/Time.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - [id$='_price'] - - - [id$='_price_type'] - select - - - [name$='[sku]'] - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Prices.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Prices.php deleted file mode 100644 index 657f84a8239..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Prices.php +++ /dev/null @@ -1,133 +0,0 @@ - [ - 'selector' => 'group_prices' - ], - 'tier_price' => [ - 'selector' => 'tiers' - ] - ]; - - /** - * Fill data to fields on tab. - * - * @param array $fields - * @param Element|null $element - * @return $this - */ - public function fillFormTab(array $fields, Element $element = null) - { - $context = $element ? $element : $this->_rootElement; - foreach (array_keys($this->childrenForm) as $key) { - if (isset($fields[$key])) { - $this->fillOptionsPrices([$key => $fields[$key]], $context); - unset($fields[$key]); - } - } - - $data = $this->dataMapping($fields); - $this->_fill($data, $element); - - return $this; - } - - /** - * Fill price options. - * - * @param array $options - * @param Element $context - * @return void - */ - protected function fillOptionsPrices(array $options, Element $context) - { - $priceType = key($options); - $this->getOptionBlock($priceType, $context)->fillOptions($options[$priceType]['value']); - } - - /** - * Get data of tab. - * - * @param array|null $fields - * @param Element|null $element - * @return array - */ - public function getDataFormTab($fields = null, Element $element = null) - { - $result = []; - $context = $element ? $element : $this->_rootElement; - foreach (array_keys($this->childrenForm) as $key) { - if (isset($fields[$key])) { - $result[$key] = $this->getOptionsPrices([$key => $fields[$key]], $context); - unset($fields[$key]); - } - } - $data = $this->dataMapping($fields); - $result += $this->_getData($data, $element); - - return $result; - } - - /** - * Get price options. - * - * @param array $options - * @param Element $context - * @return array - */ - protected function getOptionsPrices(array $options, Element $context) - { - $priceType = key($options); - return $this->getOptionBlock($priceType, $context)->getOptions($options[$priceType]['value']); - } - - /** - * Get price options block. - * - * @param string $priceType - * @param Element $context - * @return AbstractSelectOptions - */ - protected function getOptionBlock($priceType, Element $context) - { - return $this->blockFactory->create( - __NAMESPACE__ . '\\Prices\\Option' . ucfirst(str_replace('_price', '', $priceType)), - ['element' => $context->find(sprintf($this->priceType, $this->childrenForm[$priceType]['selector']))] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Prices/OptionGroup.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Prices/OptionGroup.php deleted file mode 100644 index 43f1797b346..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Prices/OptionGroup.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - [id$="_price"] - - - [id$="_cust_group"] - select - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Prices/OptionTier.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Prices/OptionTier.php deleted file mode 100644 index 0638a50463a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Prices/OptionTier.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - [id$="_price"] - - - [id$="_cust_group"] - select - - - [id$="_qty"] - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/ProductSettings.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/ProductSettings.php deleted file mode 100644 index d80197d055c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/ProductSettings.php +++ /dev/null @@ -1,48 +0,0 @@ -dataMapping($fields); - $this->_fill($data, $element); - $this->_rootElement->find($this->continue)->click(); - - return $this; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Related.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Related.php deleted file mode 100644 index 8deed3e139f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Related.php +++ /dev/null @@ -1,54 +0,0 @@ -_rootElement; - return $this->blockFactory->create( - '\Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Related\Grid', - ['element' => $element->find($this->relatedGrid)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Related/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Related/Grid.php deleted file mode 100644 index a6fb086e42a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Related/Grid.php +++ /dev/null @@ -1,31 +0,0 @@ -_rootElement; - $data = []; - $mapping = $this->dataMapping(['attribute' => '']); - $formatSelector = $mapping['attribute']['selector']; - foreach($fields['attribute']['value'] as $attribute) { - $mapping['attribute']['selector'] = sprintf($formatSelector, $attribute->getFrontendLabel()); - $mapping['attribute']['value'] = 'Yes'; - $data[] = $mapping['attribute']; - } - - $this->_fill($data, $context); - $context->find($this->continue)->click(); - - return $this; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Upsell.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Upsell.php deleted file mode 100644 index 4124305d295..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Upsell.php +++ /dev/null @@ -1,54 +0,0 @@ -_rootElement; - return $this->blockFactory->create( - '\Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Upsell\Grid', - ['element' => $element->find($this->upsellGrid)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Upsell/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Upsell/Grid.php deleted file mode 100644 index c645a916f96..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Upsell/Grid.php +++ /dev/null @@ -1,31 +0,0 @@ -_rootElement; - $mapping = $this->dataMapping(['website' => 'Yes']); - $data = []; - foreach ($fields as $key => $website) { - $data[$key] = $mapping['website']; - $data[$key]['selector'] = sprintf($mapping['website']['selector'], $website); - } - $this->_fill($data, $context); - - return $this; - } - - /** - * Get data of the form. - * - * @param FixtureInterface|null $fixture - * @param Element|null $element - * @return array - */ - public function getData(FixtureInterface $fixture = null, Element $element = null) - { - $result = []; - $checkedWebsites = $this->_rootElement->getElements($this->checkedWebsites, Locator::SELECTOR_CSS, 'checkbox'); - foreach ($checkedWebsites as $item) { - if($item->getValue() == 'Yes') { - $result[] = $item->find($this->websiteLabel, Locator::SELECTOR_XPATH)->getText(); - } - } - - return $result; - } - - /** - * Check if the tab is visible or not. - * - * @return bool - */ - public function isVisible() - { - return $this->_rootElement->find($this->tabSelector)->isVisible(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/FormPageActions.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/FormPageActions.php deleted file mode 100644 index bbbd7e21731..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/FormPageActions.php +++ /dev/null @@ -1,80 +0,0 @@ -buttonClick('save'); - } - - /** - * Click on "Save and Continue Edit" button. - * - * @return void - */ - public function saveAndContinue() - { - $this->buttonClick('saveAndContinue'); - } - - /** - * Click on "Duplicate" button. - * - * @return void - */ - public function duplicate() - { - $this->buttonClick('duplicate'); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Grid.php deleted file mode 100644 index 7e729321628..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Grid.php +++ /dev/null @@ -1,78 +0,0 @@ - [ - 'selector' => '#productGrid_product_filter_name' - ], - 'sku' => [ - 'selector' => '#productGrid_product_filter_sku' - ], - 'type' => [ - 'selector' => '#productGrid_product_filter_type', - 'input' => 'select' - ], - 'price_from' => [ - 'selector' => '#productGrid_product_filter_price_from' - ], - 'price_to' => [ - 'selector' => '#productGrid_product_filter_price_to' - ], - 'qty_from' => [ - 'selector' => '#productGrid_product_filter_qty_from' - ], - 'qty_to' => [ - 'selector' => '#productGrid_product_filter_qty_to' - ], - 'visibility' => [ - 'selector' => '#productGrid_product_filter_visibility', - 'input' => 'select' - ], - 'status' => [ - 'selector' => '#productGrid_product_filter_status', - 'input' => 'select' - ], - 'set_name' => [ - 'selector' => '#productGrid_product_filter_set_name', - 'input' => 'select' - ] - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/ProductForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/ProductForm.php deleted file mode 100644 index 565b823b7c5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/ProductForm.php +++ /dev/null @@ -1,369 +0,0 @@ -getProductType($product); - - // Fill product type - $this->fillSettingsTabs($product); - - if ($this->hasRender($typeId)) { - $renderArguments = [ - 'product' => $product, - 'element' => $element, - 'category' => $category, - ]; - $this->callRender($typeId, 'fill', $renderArguments); - } else { - $this->fillDefaultFields($product, $element, $category); - } - - return $this; - } - - /** - * Get data of the tabs. - * - * @param FixtureInterface|null $product - * @param Element|null $element - * @return array - */ - public function getData(FixtureInterface $product = null, Element $element = null) - { - $data = parent::getData($product, $element); - if ($this->isWebsiteTabVisible() && !isset($data['website_ids'])) { - $data['website_ids'] = $this->getWebsiteTabData(); - } - - return $data; - } - - /** - * Get data from website tab. - * - * @return array - */ - protected function getWebsiteTabData() - { - $this->openTab('websites'); - return $this->getTabElement('websites')->getData(); - } - - /** - * Fill default fields. - * - * @param FixtureInterface $product - * @param Element|null $element [optional] - * @param CatalogCategory|null $category [optional] - * @return void - */ - protected function fillDefaultFields( - FixtureInterface $product, - Element $element = null, - CatalogCategory $category = null - ) { - $tabs = $this->prepareTabs($product, $category); - $this->fillTabs($tabs, $element); - $this->fillWebsitesTab($product); - } - - /** - * Prepare tabs. - * - * @param FixtureInterface $product - * @param CatalogCategory|null $category - * @return array - */ - protected function prepareTabs(FixtureInterface $product, CatalogCategory $category = null) - { - $tabs = $this->getFieldsByTabs($product); - $categories = $this->prepareCategories($product, $category); - if (!empty($categories)) { - $tabs['categories'] = $categories; - } - return $tabs; - } - - /** - * Fill websites tab. - * - * @param FixtureInterface $product - * @return void - */ - protected function fillWebsitesTab(FixtureInterface $product) - { - if (!$this->isWebsiteTabVisible()) { - return; - } - $data = $product->hasData('website_ids') ? $product->getWebsiteIds() : ['Main Website']; - $this->openTab('websites'); - $this->getTabElement('websites')->fillFormTab($data); - } - - /** - * Check website tab visible. - * - * @return bool - */ - protected function isWebsiteTabVisible() - { - return $this->_rootElement->find($this->websitesTab)->isVisible(); - } - - /** - * Prepare categories for fill. - * - * @param FixtureInterface $product - * @param CatalogCategory|null $category - * @return array - */ - protected function prepareCategories(FixtureInterface $product, CatalogCategory $category = null) - { - return $category - ? [$category] - : ($product->hasData('category_ids') - ? $product->getDataFieldConfig('category_ids')['source']->getCategories() - : []); - } - - /** - * Get product type. - * - * @param FixtureInterface $product - * @return string|null - */ - protected function getProductType(FixtureInterface $product) - { - $dataConfig = $product->getDataConfig(); - return isset($dataConfig['type_id']) ? $dataConfig['type_id'] : null; - } - - /** - * Fill product's settings. - * - * @param FixtureInterface $product - * @return void - */ - protected function fillSettingsTabs(FixtureInterface $product) - { - if ($this->_rootElement->find($this->settingsTab)->isVisible()) { - $tabs = $this->prepareSettingsData($product); - foreach ($tabs as $tabName => $tabFields) { - $tabElement = $this->getTabElement($tabName); - $tabElement->fillFormTab($tabFields); - } - } - } - - /** - * Prepare data for settings tabs. - * - * @param FixtureInterface $product - * @return array - */ - protected function prepareSettingsData(FixtureInterface $product) - { - $typeId = $this->getProductType($product); - $attributeSet = null; - $tabs['settings']['product_type']['value'] = $this->hasRender($typeId) - ? $this->callRender($typeId, 'convertProductType') - : ucfirst($typeId) . ' Product'; - if ($product->hasData('attribute_set_id')) { - $attributeSet = $product->getDataFieldConfig('attribute_set_id')['source']->getAttributeSet(); - } elseif ($product instanceof ConfigurableProduct && !$product->hasData('attribute_set_id')) { - $attributeSet = $product->getDataFieldConfig('configurable_options')['source']->getAttributeSet(); - } - if ($attributeSet) { - $tabs['settings']['attribute_set_id']['value'] = $attributeSet->getAttributeSetName(); - if ($attributeSet->hasData('assigned_attributes')) { - $attributes = $attributeSet->getDataFieldConfig('assigned_attributes')['source']->getAttributes(); - $tabs['super-settings']['attribute']['value'] = $attributes; - } - } - - return $tabs; - } - - /** - * Open product tab. - * - * @param string $tabName - * @return Tab - */ - public function openTab($tabName) - { - $this->_rootElement->find($this->productInfo)->click(); - parent::openTab($tabName); - $this->getTemplateBlock()->waitLoader(); - - return $this; - } - - /** - * Get backend abstract block. - * - * @return Template - */ - protected function getTemplateBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Template', - ['element' => $this->_rootElement->find($this->templateBlock, Locator::SELECTOR_XPATH)] - ); - } - - /** - * Check visibility of the attribute on the product page. - * - * @param mixed $productAttribute - * @return bool - */ - public function checkAttributeLabel($productAttribute) - { - $frontendLabel = (is_array($productAttribute)) - ? $productAttribute['frontend_label'] - : $productAttribute->getFrontendLabel(); - $attributeLabelLocator = sprintf($this->attribute, $frontendLabel); - - return $this->_rootElement->find($attributeLabelLocator, Locator::SELECTOR_XPATH)->isVisible(); - } - - /** - * Check attribute set name. - * - * @param string $name - * @return bool - */ - public function checkAttributeSet($name) - { - $attributeSetLabel = $this->_rootElement->find(sprintf($this->attributeSet, $name), Locator::SELECTOR_XPATH); - $attributeSetLabel->click(); - return $attributeSetLabel->isVisible(); - } - - /** - * Get require notice attributes. - * - * @param FixtureInterface $product - * @return array - */ - public function getRequireNoticeAttributes(FixtureInterface $product) - { - $data = []; - $tabs = $this->getFieldsByTabs($product); - foreach (array_keys($tabs) as $tabName) { - $tab = $this->getTabElement($tabName); - $this->openTab($tabName); - $errors = $tab->getRequireNoticeMessages(); - if (!empty($errors)) { - $data[$tabName] = $errors; - } - } - return $data; - } - - /** - * Get attribute element. - * - * @param CatalogProductAttribute $attribute - * @return CustomAttribute - */ - public function getAttributeElement(CatalogProductAttribute $attribute) - { - return $this->_rootElement->find( - sprintf($this->attributeBlock, $attribute->getFrontendLabel()), - Locator::SELECTOR_XPATH, - 'Mage\Adminhtml\Test\Block\Catalog\Product\Attribute\CustomAttribute' - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/ProductForm.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/ProductForm.xml deleted file mode 100644 index 74402b3228c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/ProductForm.xml +++ /dev/null @@ -1,196 +0,0 @@ - - - - - \Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\ProductSettings - #product_info_tabs_set - - - #attribute_set_id - select - - - [name="type"] - select - - - - - \Mage\Adminhtml\Test\Block\Widget\Tab - //ul[@id="product_info_tabs"]/li[1]/a - xpath - product - - - - - - - - select - - - - select - - - - - \Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Prices - //ul[@id="product_info_tabs"]/li[2]/a - xpath - product - - - - select - - - - - - - - \Mage\Adminhtml\Test\Block\Widget\Tab - #product_info_tabs_inventory - product - - - - [name="product[stock_data][qty]"] - - - [name="product[stock_data][is_in_stock]"] - select - - - [name="product[stock_data][use_config_manage_stock]"] - checkbox - - - [name="product[stock_data][manage_stock]"] - select - - - [name='product[stock_data][use_config_min_qty]'] - checkbox - - - [name='product[stock_data][min_qty]'] - - - - - - \Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Categories - #product_info_tabs_categories - product - - - #product-categories - - - - - \Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\CustomOptions - #product_info_tabs_customer_options - css selector - - - <selector>input[id$='_title']</selector> - <strategy>css selector</strategy> - - - select[id$='_is_require'] - css selector - select - - - select[id$='_type'] - css selector - optgroupselect - - - - - \Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\SuperSettings - #product_info_tabs_super_settings - css selector - - - //tr[td[@class="label" and label[text()="%s"]]]//td[@class="value"]/input - checkbox - xpath - - - - - \Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Configurable - #product_info_tabs_configurable - css selector - - - \Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Related - #product_info_tabs_related - css selector - - - \Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Crosssell - #product_info_tabs_crosssell - css selector - - - \Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Upsell - #product_info_tabs_upsell - css selector - - - \Mage\Adminhtml\Test\Block\Widget\Tab - #product_info_tabs_group_17 - css selector - product - - - checkbox - - - select - - - select - - - - - - \Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Websites - #product_info_tabs_websites - css selector - - - //*[@class="website-name" and .//label[text()="%s"]]/input - checkbox - xpath - - - - - \Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\AssociatedProducts - #product_info_tabs_super - css selector - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogRule/FormPageActions.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogRule/FormPageActions.php deleted file mode 100644 index 8c696536667..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogRule/FormPageActions.php +++ /dev/null @@ -1,57 +0,0 @@ -_rootElement->find($this->saveAndApplyButton)->click(); - } - - /** - * Click "Delete" button. - * - * @return void - */ - public function delete() - { - $this->_rootElement->find($this->deleteButton)->click(); - $this->browser->acceptAlert(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogRule/Promo/Catalog.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogRule/Promo/Catalog.php deleted file mode 100644 index 04ceab84090..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogRule/Promo/Catalog.php +++ /dev/null @@ -1,59 +0,0 @@ - [ - 'selector' => '#promo_catalog_grid_filter_rule_id', - ], - 'name' => [ - 'selector' => '#promo_catalog_grid_filter_name', - ], - 'from_date' => [ - 'selector' => '[name="from_date[from]"]', - ], - 'to_date' => [ - 'selector' => '[name="from_date[to]"]', - ], - 'is_active' => [ - 'selector' => '#promo_catalog_grid_filter_is_active', - 'input' => 'select', - ], - 'rule_website' => [ - 'selector' => '#promo_catalog_grid_filter_rule_website', - 'input' => 'select', - ], - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogRule/Promo/Catalog/Edit/Form.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogRule/Promo/Catalog/Edit/Form.php deleted file mode 100644 index 6eb4ee8d0ab..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogRule/Promo/Catalog/Edit/Form.php +++ /dev/null @@ -1,91 +0,0 @@ -getFieldsByTabs($catalogPriceRule); - if ($replace) { - $tabs = $this->prepareData($tabs, $replace); - } - $this->fillWebsites($catalogPriceRule); - $this->fillTabs($tabs, $element); - } - - /** - * Fill website. - * - * @param CatalogRule $catalogPriceRule - * @return void - */ - protected function fillWebsites(CatalogRule $catalogPriceRule) - { - $websiteField = $this->_rootElement->find($this->website, Locator::SELECTOR_CSS, 'multiselectlist'); - if ($websiteField->isVisible() && !$catalogPriceRule->hasData('website_ids')) { - $websiteField->setValue('Main Website'); - } - } - - /** - * Replace placeholders in each values of data. - * - * @param array $tabs - * @param array $replace - * @return array - */ - protected function prepareData(array $tabs, array $replace) - { - foreach ($replace as $tabName => $fields) { - foreach ($fields as $key => $pairs) { - if (isset($tabs[$tabName][$key])) { - $tabs[$tabName][$key]['value'] = str_replace( - array_keys($pairs), - array_values($pairs), - $tabs[$tabName][$key]['value'] - ); - } - } - } - - return $tabs; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogRule/Promo/Catalog/Edit/Form.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogRule/Promo/Catalog/Edit/Form.xml deleted file mode 100644 index 4a0f7cb5136..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogRule/Promo/Catalog/Edit/Form.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - \Mage\Adminhtml\Test\Block\Widget\Tab - #promo_catalog_edit_tabs_main_section - css selector - - - - - select - - - [name='website_ids[]'] - multiselect - - - [name='customer_group_ids[]'] - multiselect - - - - - \Mage\Adminhtml\Test\Block\Widget\Tab - #promo_catalog_edit_tabs_conditions_section - css selector - - - #rule_conditions_fieldset - conditions - - - - - \Mage\Adminhtml\Test\Block\Widget\Tab - #promo_catalog_edit_tabs_actions_section - css selector - - - select - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogRule/Promo/Catalog/Edit/PromoForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogRule/Promo/Catalog/Edit/PromoForm.php deleted file mode 100644 index 02f7cd26799..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogRule/Promo/Catalog/Edit/PromoForm.php +++ /dev/null @@ -1,67 +0,0 @@ -getFieldsByTabs($fixture); - if ($replace) { - $tabs = $this->prepareData($tabs, $replace); - } - $this->fillTabs($tabs, $element); - } - - /** - * Replace placeholders in each values of data. - * - * @param array $tabs - * @param array $replace - * @return array - */ - protected function prepareData(array $tabs, array $replace) - { - foreach ($replace as $tabName => $fields) { - foreach ($fields as $key => $pairs) { - if (isset($tabs[$tabName][$key])) { - $tabs[$tabName][$key]['value'] = str_replace( - array_keys($pairs), - array_values($pairs), - $tabs[$tabName][$key]['value'] - ); - } - } - } - - return $tabs; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogRule/Promo/Catalog/Edit/PromoForm.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogRule/Promo/Catalog/Edit/PromoForm.xml deleted file mode 100644 index 4a0f7cb5136..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogRule/Promo/Catalog/Edit/PromoForm.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - \Mage\Adminhtml\Test\Block\Widget\Tab - #promo_catalog_edit_tabs_main_section - css selector - - - - - select - - - [name='website_ids[]'] - multiselect - - - [name='customer_group_ids[]'] - multiselect - - - - - \Mage\Adminhtml\Test\Block\Widget\Tab - #promo_catalog_edit_tabs_conditions_section - css selector - - - #rule_conditions_fieldset - conditions - - - - - \Mage\Adminhtml\Test\Block\Widget\Tab - #promo_catalog_edit_tabs_actions_section - css selector - - - select - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogRule/Promo/GridPageActions.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogRule/Promo/GridPageActions.php deleted file mode 100644 index b5d9512ce78..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogRule/Promo/GridPageActions.php +++ /dev/null @@ -1,37 +0,0 @@ -_rootElement->find($this->applyRules)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogSearch/Edit/SearchTermForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogSearch/Edit/SearchTermForm.php deleted file mode 100644 index 6b10e546884..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogSearch/Edit/SearchTermForm.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - selectstore - - - - - - - select - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogSearch/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogSearch/Grid.php deleted file mode 100644 index 3bfa859d011..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogSearch/Grid.php +++ /dev/null @@ -1,53 +0,0 @@ - [ - 'selector' => 'input[name="search_query"]', - ], - 'store_id' => [ - 'selector' => 'select[name="store_id"]', - 'input' => 'selectstore', - ], - 'results_from' => [ - 'selector' => 'input[name="num_results[from]"]', - ], - 'popularity_from' => [ - 'selector' => 'input[name="popularity[from]"]', - ], - 'synonym_for' => [ - 'selector' => 'input[name="synonym_for"]', - ], - 'redirect' => [ - 'selector' => 'input[name="redirect"]', - ], - 'display_in_terms' => [ - 'selector' => 'select[name="display_in_terms"]', - 'input' => 'select', - ], - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Checkout/Agreement/Edit/Form.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Checkout/Agreement/Edit/Form.php deleted file mode 100644 index 7c38c07e436..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Checkout/Agreement/Edit/Form.php +++ /dev/null @@ -1,61 +0,0 @@ -fillWebsite(); - - return $this; - } - - /** - * Fill website field. - * - * @return void - */ - protected function fillWebsite() - { - $storeViewField = $this->_rootElement->find($this->storeView, Locator::SELECTOR_CSS, 'multiselectgrouplist'); - if ($storeViewField->isVisible() && !$storeViewField->getValue()) { - $storeViewField->setValue('All Store Views'); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Checkout/Agreement/Edit/Form.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Checkout/Agreement/Edit/Form.xml deleted file mode 100644 index 907c0c60b35..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Checkout/Agreement/Edit/Form.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - select - - - select - - - [name="stores[]"] - multiselectgrouplist - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Checkout/Agreement/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Checkout/Agreement/Grid.php deleted file mode 100644 index 77baa20af22..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Checkout/Agreement/Grid.php +++ /dev/null @@ -1,47 +0,0 @@ - [ - 'selector' => 'input[name="name"]', - ], - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Block/CmsGrid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Block/CmsGrid.php deleted file mode 100644 index ccf7fb901ee..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Block/CmsGrid.php +++ /dev/null @@ -1,50 +0,0 @@ - [ - 'selector' => '#cmsBlockGrid_filter_title', - ], - 'identifier' => [ - 'selector' => '#cmsBlockGrid_filter_identifier', - ], - 'is_active' => [ - 'selector' => '#cmsBlockGrid_filter_is_active', - 'input' => 'select', - ] - ]; - - - /** - * Locator value for link in action column. - * - * @var string - */ - protected $editLink = 'td.last'; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Block/Edit/BlockForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Block/Edit/BlockForm.php deleted file mode 100644 index 55685d84b5e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Block/Edit/BlockForm.php +++ /dev/null @@ -1,69 +0,0 @@ -_rootElement->find($this->contentForm, Locator::SELECTOR_CSS); - $toggleButton = $this->_rootElement->find($this->toggleButton, Locator::SELECTOR_CSS); - if (!$content->isVisible()) { - $toggleButton->click(); - } - } - - /** - * Fill form. - * - * @param FixtureInterface $fixture - * @param SimpleElement|null $element - * @return void - */ - public function fill(FixtureInterface $fixture, SimpleElement $element = null) - { - $this->toggleEditor(); - parent::fill($fixture, $element); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Block/Edit/BlockForm.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Block/Edit/BlockForm.xml deleted file mode 100644 index 10e38f5a5a8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Block/Edit/BlockForm.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - <identifier /> - <is_active> - <input>select</input> - </is_active> - <content /> - <stores> - <selector>[name="stores[]"]</selector> - <input>multiselectgrouplist</input> - </stores> - </fields> -</mapping> diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Block/Edit/FormPageActions.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Block/Edit/FormPageActions.php deleted file mode 100644 index b509c715af6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Block/Edit/FormPageActions.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Cms\Block\Edit; - -/** - * Form page actions block for cms page. - */ -class FormPageActions extends \Mage\Adminhtml\Test\Block\FormPageActions -{ - /** - * Get Cms Block id. - * - * @return int - * @throws \Exception - */ - public function getBlockId() - { - $attribute = $this->_rootElement->find($this->deleteButton)->getAttribute('onclick'); - - preg_match('~http[^\s]*\/block_id\/(\d+)~', $attribute, $matches); - if (empty($matches)) { - throw new \Exception('Cannot find Block id'); - } - - return $matches[1]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Page/Edit/FormPageActions.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Page/Edit/FormPageActions.php deleted file mode 100644 index 4503fb42ec2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Page/Edit/FormPageActions.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Cms\Page\Edit; - -/** - * Form page actions block for cms page. - */ -class FormPageActions extends \Mage\Adminhtml\Test\Block\FormPageActions -{ - /** - * 'Preview' button selector. - * - * @var string - */ - protected $previewButton = '.scalable.preview'; - - /** - * Click "Preview" button. - * - * @return void - */ - public function preview() - { - $this->_rootElement->find($this->previewButton)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Page/Edit/PageForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Page/Edit/PageForm.php deleted file mode 100644 index fa2978c73e9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Page/Edit/PageForm.php +++ /dev/null @@ -1,63 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Cms\Page\Edit; - -use Mage\Adminhtml\Test\Block\Widget\FormTabs; -use Mage\Cms\Test\Fixture\CmsPage; -use Magento\Mtf\Client\Element\SimpleElement as Element; -use Magento\Mtf\Client\Locator; -use Magento\Mtf\Fixture\FixtureInterface; - -/** - * Backend Cms Page edit page. - */ -class PageForm extends FormTabs -{ - /** - * Selector for store view field. - * - * @var string - */ - protected $storeView = '#page_store_id'; - - /** - * Fill form with tabs. - * - * @param FixtureInterface $cms - * @param Element|null $element - * @return FormTabs - */ - public function fill(FixtureInterface $cms, Element $element = null) - { - $this->fillStoreView($cms); - return parent::fill($cms, $element); - } - - /** - * Fill store view. - * - * @param CmsPage $cms - * @return void - */ - protected function fillStoreView(CmsPage $cms) - { - $this->openTab('page_information'); - $storeViewField = $this->_rootElement->find($this->storeView, Locator::SELECTOR_CSS, 'multiselectgrouplist'); - if($storeViewField->isVisible() && !$cms->hasData('store_id')) { - $storeViewField->setValue('All Store Views'); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Page/Edit/PageForm.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Page/Edit/PageForm.xml deleted file mode 100644 index 1f460822e2f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Page/Edit/PageForm.xml +++ /dev/null @@ -1,46 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<tabs> - <page_information> - <class>\Mage\Adminhtml\Test\Block\Widget\Tab</class> - <selector>#page_tabs_main_section</selector> - <strategy>css selector</strategy> - <fields> - <title /> - <identifier /> - <store_id> - <selector>[name='stores[]']</selector> - <input>multiselectgrouplist</input> - </store_id> - <is_active> - <input>select</input> - </is_active> - <under_version_control> - <input>select</input> - </under_version_control> - </fields> - </page_information> - <content> - <class>\Mage\Adminhtml\Test\Block\Cms\Page\Edit\Tab\Content</class> - <selector>#page_tabs_content_section</selector> - <strategy>css selector</strategy> - <fields> - <content_heading /> - <content /> - </fields> - </content> -</tabs> diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Page/Edit/Tab/Content.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Page/Edit/Tab/Content.php deleted file mode 100644 index 28049e5eb6b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Page/Edit/Tab/Content.php +++ /dev/null @@ -1,166 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Cms\Page\Edit\Tab; - -use Mage\Adminhtml\Test\Block\Widget\Tab; -use Magento\Mtf\Client\Element\SimpleElement as Element; -use Magento\Mtf\Client\Locator; -use Mage\Adminhtml\Test\Block\Cms\Wysiwyg\Config; -use Mage\Widget\Test\Block\Adminhtml\WidgetForm; - -/** - * Backend cms page content tab. - */ -class Content extends Tab -{ - /** - * Page content toolbar selector. - * - * @var string - */ - protected $contentToolBar = "#page_content_toolbargroup"; - - /** - * Hide button selector. - * - * @var string - */ - protected $hideButton = "#togglepage_content"; - - /** - * Insert Variable button selector. - * - * @var string - */ - protected $addVariableButton = ".add-variable"; - - /** - * Insert Widget button selector. - * - * @var string - */ - protected $addWidgetButton = '.add-widget'; - - /** - * System Variable block selector. - * - * @var string - */ - protected $systemVariableBlock = ".//ancestor::body/div[@id='variables-chooser']"; - - /** - * Widget block selector. - * - * @var string - */ - protected $widgetBlock = ".//ancestor::body/div[@id='widget_window']"; - - /** - * Hide editor. - * - * @return void - */ - protected function hideEditor() - { - if ($this->_rootElement->find($this->contentToolBar)->isVisible()) { - $this->_rootElement->find($this->hideButton)->click(); - } - } - - /** - * Fill data to fields on tab. - * - * @param array $fields - * @param Element|null $element - * @return $this - */ - public function fillFormTab(array $fields, Element $element = null) - { - $this->hideEditor(); - $content = $fields['content']['value']; - $fields['content']['value'] = $content['content']; - $data = $this->dataMapping($fields); - $this->_fill($data, $element); - if (isset($content['variable'])) { - $this->clickInsertVariable(); - $config = $this->getWysiwygConfig(); - $config->selectVariable($content['variable']); - } - if (isset($content['widget'])) { - foreach ($content['widget']['preset'] as $widget) { - $this->clickInsertWidget(); - $this->getWidgetBlock()->addWidget($widget); - } - } - - return $this; - } - - /** - * Click 'Insert Variable' button. - * - * @return void - */ - public function clickInsertVariable() - { - $this->_rootElement->find($this->addVariableButton)->click(); - } - - /** - * Click 'Insert Widget' button. - * - * @return void - */ - public function clickInsertWidget() - { - $this->_rootElement->find($this->addWidgetButton)->click(); - } - - /** - * Get for wysiwyg config block. - * - * @return Config - */ - public function getWysiwygConfig() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Cms\Wysiwyg\Config', - ['element' => $this->_rootElement->find($this->systemVariableBlock, Locator::SELECTOR_XPATH)] - ); - } - - /** - * Get widget block. - * - * @return WidgetForm - */ - public function getWidgetBlock() - { - return $this->blockFactory->create( - 'Mage\Widget\Test\Block\Adminhtml\WidgetForm', - ['element' => $this->_rootElement->find($this->widgetBlock, Locator::SELECTOR_XPATH)] - ); - } - - /** - * {@inheritdoc} - */ - public function getDataFormTab($fields = null, Element $element = null) - { - $this->hideEditor(); - return parent::getDataFormTab($fields, $element); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Page/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Page/Grid.php deleted file mode 100644 index d3f4a70c254..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Page/Grid.php +++ /dev/null @@ -1,83 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Cms\Page; - -/** - * Backend Cms Page grid. - */ -class Grid extends \Mage\Adminhtml\Test\Block\Widget\Grid -{ - /** - * Filters array mapping. - * - * @var array - */ - protected $filters = [ - 'title' => [ - 'selector' => '#cmsPageGrid_filter_title' - ], - 'identifier' => [ - 'selector' => '#cmsPageGrid_filter_identifier' - ], - 'is_active' => [ - 'selector' => '#cmsPageGrid_filter_is_active', - 'input' => 'select' - ] - ]; - - /** - * Locator value for link in action column. - * - * @var string - */ - protected $editLink = 'td'; - - /** - * Selector for review link. - * - * @var string - */ - protected $reviewLink = 'a'; - - /** - * The number of attempts for click. - */ - const COUNT = 3; - - /** - * Search and review. - * - * @param $filter - * @throws \Exception - * @return void - */ - public function searchAndReview($filter) - { - $this->search($filter); - $rowItem = $this->_rootElement->find($this->rowItem); - if ($rowItem->isVisible()) { - $count = 0; - $link = $rowItem->find($this->reviewLink); - do { - $link->click(); - $this->browser->selectWindow(); - $count++; - } while ($link->isVisible() && $count < self::COUNT); - } else { - throw new \Exception('Searched item was not found.'); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Page/Widget/Chooser.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Page/Widget/Chooser.php deleted file mode 100644 index 862e07c58b8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Page/Widget/Chooser.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Cms\Page\Widget; - -use Mage\Adminhtml\Test\Block\Widget\Grid; - -/** - * Backend select page, block grid. - */ -class Chooser extends Grid -{ - /** - * Filters array mapping. - * - * @var array - */ - protected $filters = [ - 'chooser_identifier' => [ - 'selector' => 'input[name="chooser_identifier"]', - ], - ]; - - /** - * Locator value for link in action column. - * - * @var string - */ - protected $editLink = 'td'; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Wysiwyg/Config.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Wysiwyg/Config.php deleted file mode 100644 index ee8bd8cf219..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Wysiwyg/Config.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Cms\Wysiwyg; - -use Magento\Mtf\Block\Block; -use Magento\Mtf\Client\Locator; - -/** - * System variable management block. - */ -class Config extends Block -{ - /** - * Variable link selector. - * - * @var string - */ - protected $variableSelector = '//a[contains(text(),"%s")]'; - - /** - * Select variable by name. - * - * @param string $variableName - * @return void - */ - public function selectVariable($variableName) - { - $this->_rootElement->find(sprintf($this->variableSelector, $variableName), Locator::SELECTOR_XPATH)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/CustomerGrid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/CustomerGrid.php deleted file mode 100644 index 36634030c5c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/CustomerGrid.php +++ /dev/null @@ -1,63 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Customer; - -use Mage\Adminhtml\Test\Block\Widget\Grid; - -/** - * Backend customer grid - */ -class CustomerGrid extends Grid -{ - /** - * Selector for action option select. - * - * @var string - */ - protected $option = '[name="group"]'; - - /** - * The first row in grid. For this moment we suggest that we should strictly define what we are going to search. - * - * @var string - */ - protected $rowItem = 'div.grid tbody tr'; - - /** - * Locator value for link in action column. - * - * @var string - */ - protected $editLink = 'td[class*=last] a'; - - /** - * Filters array mapping. - * - * @var array - */ - protected $filters = [ - 'name' => [ - 'selector' => '#customerGrid_filter_name', - ], - 'email' => [ - 'selector' => '#customerGrid_filter_email', - ], - 'group' => [ - 'selector' => '#customerGrid_filter_group', - 'input' => 'select', - ], - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Edit/CustomerForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Edit/CustomerForm.php deleted file mode 100644 index 8ed1f319792..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Edit/CustomerForm.php +++ /dev/null @@ -1,82 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Customer\Edit; - -use Mage\Adminhtml\Test\Block\Widget\FormTabs; -use Mage\Customer\Test\Fixture\Customer; -use Mage\Customer\Test\Fixture\Address; - -/** - * Form for creation of the customer. - */ -class CustomerForm extends FormTabs -{ - /** - * Customer groups selector. - * - * @var string - */ - protected $customerGroupsSelector = "[name='account[group_id]']"; - - /** - * Fill Customer forms on tabs by customer, addresses data. - * - * @param Customer $customer - * @param Address|Address[]|null $address - * @return $this - */ - public function fillCustomer(Customer $customer, $address = null) - { - if ($customer->hasData()) { - parent::fill($customer); - } - if (null !== $address) { - $this->openTab('addresses'); - $this->getTabElement('addresses')->fillAddresses($address); - } - - return $this; - } - - /** - * Get data of Customer information, addresses on tabs. - * - * @param Customer $customer - * @param Address|Address[]|null $address - * @return array - */ - public function getDataCustomer(Customer $customer, $address = null) - { - $data = ['customer' => $customer->hasData() ? parent::getData($customer) : parent::getData()]; - - if (null !== $address) { - $this->openTab('addresses'); - $data['addresses'] = $this->getTabElement('addresses')->getDataAddresses($address); - } - - return $data; - } - - /** - * Get customer groups. - * - * @return array - */ - public function getCustomerGroups() - { - return explode("\n", $this->_rootElement->find($this->customerGroupsSelector)->getText()); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Edit/CustomerForm.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Edit/CustomerForm.xml deleted file mode 100644 index e98610c0d64..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Edit/CustomerForm.xml +++ /dev/null @@ -1,56 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<tabs> - <account_information> - <class>\Mage\Adminhtml\Test\Block\Widget\Tab</class> - <selector>#customer_info_tabs_account</selector> - <strategy>css selector</strategy> - <wrapper>account</wrapper> - <fields> - <website_id> - <input>select</input> - </website_id> - <group_id> - <input>select</input> - </group_id> - <prefix /> - <firstname /> - <middlename /> - <lastname /> - <suffix /> - <email /> - <dob> - <input>datepicker</input> - </dob> - <taxvat /> - <gender> - <input>select</input> - </gender> - <password /> - </fields> - </account_information> - <addresses> - <class>\Mage\Adminhtml\Test\Block\Customer\Edit\Tab\Addresses</class> - <selector>#customer_info_tabs_addresses</selector> - <strategy>css selector</strategy> - </addresses> - <wishlist> - <class>\Mage\Adminhtml\Test\Block\Wishlist\Customer\Edit\Tab\Wishlist</class> - <selector>#customer_info_tabs_wishlist</selector> - <strategy>css selector</strategy> - </wishlist> -</tabs> diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Edit/FormPageActions.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Edit/FormPageActions.php deleted file mode 100644 index 131f0a1fbff..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Edit/FormPageActions.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Customer\Edit; - -/** - * Form page actions block for customer page. - */ -class FormPageActions extends \Mage\Adminhtml\Test\Block\FormPageActions -{ - /** - * 'Create Order' button selector. - * - * @var string - */ - protected $createOrderButton = '.scalable.add'; - - /** - * Click "Create Order" button. - * - * @return void - */ - public function createOrder() - { - $this->_rootElement->find($this->createOrderButton)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Edit/Tab/Addresses.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Edit/Tab/Addresses.php deleted file mode 100644 index c9664ef6cf2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Edit/Tab/Addresses.php +++ /dev/null @@ -1,225 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Customer\Edit\Tab; - -use Magento\Mtf\Client\Element\SimpleElement as Element; -use Magento\Mtf\Client\Locator; -use Mage\Customer\Test\Fixture\Address; -use Mage\Adminhtml\Test\Block\Widget\Tab; -use Mage\Adminhtml\Test\Block\Template; - -/** - * Customer addresses edit block. - */ -class Addresses extends Tab -{ - /** - * "Add New Customer" button. - * - * @var string - */ - protected $addNewAddress = '#add_address_button'; - - /** - * Open customer address. - * - * @var string - */ - protected $customerAddress = '//*[@id="address_list"]/li[%d]/a'; - - /** - * Backend abstract block selector. - * - * @var string - */ - protected $templateBlock = './ancestor::body'; - - /** - * Get backend abstract block. - * - * @return Template - */ - protected function getTemplateBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Template', - ['element' => $this->_rootElement->find($this->templateBlock, Locator::SELECTOR_XPATH)] - ); - } - - /** - * Fill customer addresses. - * - * @param Address|Address[] $address - * @return $this - */ - public function fillAddresses($address) - { - $addresses = is_array($address) ? $address : [$address]; - foreach ($addresses as $address) { - $this->addNewAddress(); - - /* Fix switch between region_id and region */ - /** @var Address $address */ - $countryId = $address->getCountryId(); - if ($countryId && $this->mapping['country_id']) { - $this->_fill($this->dataMapping(['country_id' => $countryId])); - $this->getTemplateBlock()->waitLoader(); - } - - $this->fillFormTab($address->getData(), $this->_rootElement); - } - - return $this; - } - - /** - * Update customer addresses. - * - * @param Address|Address[] $address - * @return $this - * @throws \Exception - * - * @SuppressWarnings(PHPMD.NPathComplexity) - * @SuppressWarnings(PHPMD.CyclomaticComplexity) - */ - public function updateAddresses($address) - { - $addresses = is_array($address) ? $address : [1 => $address]; - foreach ($addresses as $addressNumber => $address) { - /* Throw exception if isn't exist previous customer address. */ - if (1 < $addressNumber && !$this->isVisibleCustomerAddress($addressNumber - 1)) { - throw new \Exception("Invalid argument: can't update customer address #{$addressNumber}"); - } - - if (!$this->isVisibleCustomerAddress($addressNumber)) { - $this->addNewAddress(); - } - $this->openCustomerAddress($addressNumber); - - /* Fix switch between region_id and region */ - /** @var Address $address */ - $countryId = $address->getCountryId(); - if ($countryId && $this->mapping['country_id']) { - $this->_fill($this->dataMapping(['country_id' => $countryId])); - $this->getTemplateBlock()->waitLoader(); - } - $defaultAddress = ['default_billing' => 'No', 'default_shipping' => 'No']; - $addressData = $address->getData(); - foreach ($defaultAddress as $key => $value) { - if (isset($addressData[$key])) { - $defaultAddress[$key] = $value; - } - } - $this->_fill($this->dataMapping($defaultAddress)); - - $this->fillFormTab(array_diff($addressData, $defaultAddress), $this->_rootElement); - } - - return $this; - } - - /** - * Get data of Customer addresses. - * - * @param Address|Address[]|null $address - * @return array - * @throws \Exception - */ - public function getDataAddresses($address = null) - { - $data = []; - $addresses = is_array($address) ? $address : [1 => $address]; - - foreach ($addresses as $addressNumber => $address) { - $isHasData = (null === $address) || $address->hasData(); - $isVisibleCustomerAddress = $this->isVisibleCustomerAddress($addressNumber); - - if ($isHasData && !$isVisibleCustomerAddress) { - throw new \Exception("Invalid argument: can't get data from customer address #{$addressNumber}"); - } - - if (!$isHasData && !$isVisibleCustomerAddress) { - $data[$addressNumber] = []; - } else { - $this->openCustomerAddress($addressNumber); - $data[$addressNumber] = $this->getData($address, $this->_rootElement); - } - } - - return $data; - } - - /** - * Get data to fields on tab. - * - * @param array|null $fields - * @param Element|null $element - * @return array - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getDataFormTab($fields = null, Element $element = null) - { - /* Skip get data for standard method. Use getDataAddresses. */ - return []; - } - - /** - * Click "Add New Address" button. - * - * @return void - */ - protected function addNewAddress() - { - $this->_rootElement->find($this->addNewAddress)->click(); - } - - /** - * Open customer address. - * - * @param int $addressNumber - * @throws \Exception - * @return void - */ - protected function openCustomerAddress($addressNumber) - { - $addressTab = $this->_rootElement->find( - sprintf($this->customerAddress, $addressNumber), - Locator::SELECTOR_XPATH - ); - - if (!$addressTab->isVisible()) { - throw new \Exception("Can't open customer address #{$addressNumber}"); - } - $addressTab->click(); - } - - /** - * Check is visible customer address. - * - * @param int $addressNumber - * @return bool - */ - protected function isVisibleCustomerAddress($addressNumber) - { - $addressTab = $this->_rootElement->find( - sprintf($this->customerAddress, $addressNumber), - Locator::SELECTOR_XPATH - ); - return $addressTab->isVisible(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Edit/Tab/Addresses.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Edit/Tab/Addresses.xml deleted file mode 100644 index 83194c08118..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Edit/Tab/Addresses.xml +++ /dev/null @@ -1,90 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<mapping strict="0"> - <fields> - <prefix> - <selector>#address_form_container [name^="address"][name$="[prefix]"]</selector> - <strategy>css selector</strategy> - </prefix> - <firstname> - <selector>#address_form_container [name^="address"][name$="[firstname]"]</selector> - <strategy>css selector</strategy> - </firstname> - <middlename> - <selector>#address_form_container [name^="address"][name$="[middlename]"]</selector> - <strategy>css selector</strategy> - </middlename> - <lastname> - <selector>#address_form_container [name^="address"][name$="[lastname]"]</selector> - <strategy>css selector</strategy> - </lastname> - <suffix> - <selector>#address_form_container [name^="address"][name$="[suffix]"]</selector> - <strategy>css selector</strategy> - </suffix> - <company> - <selector>#address_form_container [name^="address"][name$="[company]"]</selector> - <strategy>css selector</strategy> - </company> - <street> - <selector>#address_form_container [name^="address"][name$="[street][0]"]</selector> - <strategy>css selector</strategy> - </street> - <city> - <selector>#address_form_container [name^="address"][name$="[city]"]</selector> - <strategy>css selector</strategy> - </city> - <country_id> - <input>select</input> - <selector>#address_form_container [name^="address"][name$="[country_id]"]</selector> - <strategy>css selector</strategy> - </country_id> - <region_id> - <input>select</input> - <selector>#address_form_container [name^="address"][name$="[region_id]"]</selector> - <strategy>css selector</strategy> - </region_id> - <region> - <selector>#address_form_container [name^="address"][name$="[region]"]</selector> - <strategy>css selector</strategy> - </region> - <postcode> - <selector>#address_form_container [name^="address"][name$="[postcode]"]</selector> - <strategy>css selector</strategy> - </postcode> - <telephone> - <selector>#address_form_container [name^="address"][name$="[telephone]"]</selector> - <strategy>css selector</strategy> - </telephone> - <fax> - <selector>#address_form_container [name^="address"][name$="[fax]"]</selector> - <strategy>css selector</strategy> - </fax> - <vat_id> - <selector>#address_form_container [name^="address"][name$="[vat_id]"]</selector> - <strategy>css selector</strategy> - </vat_id> - <default_billing> - <selector>#address_list [name^="account"][name$="[default_billing]"]</selector> - <input>checkbox</input> - </default_billing> - <default_shipping> - <selector>#address_list [name^="account"][name$="[default_shipping]"]</selector> - <input>checkbox</input> - </default_shipping> - </fields> -</mapping> diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Group/Edit/Form.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Group/Edit/Form.php deleted file mode 100644 index 58b15d62a58..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Group/Edit/Form.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Customer\Group\Edit; - -/** - * Customer group edit form. - */ -class Form extends \Magento\Mtf\Block\Form -{ - // -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Group/Edit/Form.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Group/Edit/Form.xml deleted file mode 100644 index 3d3ee75ccf8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Group/Edit/Form.xml +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<mapping strict="0"> - <fields> - <code /> - <tax_class_id> - <selector>#tax_class_id</selector> - <input>select</input> - </tax_class_id> - <customer_group_code> - <selector>#customer_group_code</selector> - </customer_group_code> - </fields> -</mapping> diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Group/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Group/Grid.php deleted file mode 100644 index 35c39a06587..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Group/Grid.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Customer\Group; - -/** - * Customer group grid. - */ -class Grid extends \Mage\Adminhtml\Test\Block\Widget\Grid -{ - /** - * Filters array mapping. - * - * @var array $filters - */ - protected $filters = [ - 'code' => [ - 'selector' => '#customerGroupGrid_filter_type', - ], - ]; - - /** - * Locator value for link in action column. - * - * @var string - */ - protected $editLink = 'tr'; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/FormPageActions.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/FormPageActions.php deleted file mode 100644 index 409d388961a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/FormPageActions.php +++ /dev/null @@ -1,130 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block; - -/** - * Form page actions block. - */ -class FormPageActions extends PageActions -{ - /** - * 'Save' button selector. - * - * @var string - */ - protected $saveButton = '.scalable.save'; - - /** - * "Save and Continue Edit" button. - * - * @var string - */ - protected $saveAndContinueButton = '[onclick*="saveAndContinueEdit"]'; - - /** - * Header floating css selector. - * - * @var string - */ - protected $headerFloating = '.content-header-floating'; - - /** - * 'Delete' button selector. - * - * @var string - */ - protected $deleteButton = '.scalable.delete'; - - /** - * Selector for top page. - * - * @var string - */ - protected $topPage = '#global_search'; - - /** - * Click "Save" button. - * - * @return void - */ - public function save() - { - $this->buttonClick('save'); - } - - /** - * Click on "Save and Continue Edit" button. - * - * @return void - */ - public function saveAndContinue() - { - $this->buttonClick('saveAndContinue'); - } - - /** - * Click "Delete" button. - * - * @return void - */ - public function delete() - { - $this->browser->find($this->topPage)->hover(); - $this->_rootElement->find($this->deleteButton)->click(); - } - - /** - * Click "Delete" button and accept alert. - * - * @return void - */ - public function deleteAndAcceptAlert() - { - $this->delete(); - $this->browser->acceptAlert(); - } - - /** - * Click on button. - * - * @param string $buttonName - * @return void - */ - protected function buttonClick($buttonName) - { - $this->clickOnTopPage(); - $button = $this->_rootElement->find($this->{$buttonName . 'Button'}); - if ($button->isVisible()) { - $button->click(); - } else { - $this->browser->find($this->headerFloating . ' ' . $this->{$buttonName . 'Button'})->click(); - } - $this->getTemplateBlock()->waitLoader(); - } - - /** - * Click on top page. - * - * @return void - */ - protected function clickOnTopPage() - { - $topPage = $this->browser->find($this->topPage); - if ($topPage->isVisible()) { - $topPage->click(); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/GridPageActions.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/GridPageActions.php deleted file mode 100644 index 299aae9dc81..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/GridPageActions.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block; - -/** - * Grid page actions block. - */ -class GridPageActions extends PageActions -{ - /** - * "Add New" button. - * - * @var string - */ - protected $addNewButton = '.scalable.add'; - - /** - * Click on "Add New" button. - * - * @return void - */ - public function addNew() - { - $this->_rootElement->find($this->addNewButton)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Newsletter/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Newsletter/Grid.php deleted file mode 100644 index ccdcb8b8422..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Newsletter/Grid.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Newsletter; - -/** - * Newsletter subscribers grid. - */ -class Grid extends \Mage\Adminhtml\Test\Block\Widget\Grid -{ - /** - * Filters array mapping. - * - * @var array - */ - protected $filters = [ - 'email' => [ - 'selector' => '#subscriberGrid_filter_email', - ], - 'firstname' => [ - 'selector' => '#subscriberGrid_filter_firstname' - ], - 'lastname' => [ - 'selector' => '#subscriberGrid_filter_lastname' - ], - 'status' => [ - 'selector' => '#subscriberGrid_filter_status', - 'input' => 'select' - ], - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Page/Footer.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Page/Footer.php deleted file mode 100644 index ea1bb1fa8b6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Page/Footer.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2020-2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Page; - -use Magento\Mtf\Block\Block; -use Magento\Mtf\Client\Locator; - -/** - * Header block. - */ -class Footer extends Block -{ - /** - * @var string - */ - protected $versionPath = '//div[@class="footer" and contains(.,"OpenMage ver. '; - - /** - * @param $currentVersion - * @return string - */ - protected function getVersionLocator($currentVersion) - { - return $this->versionPath . $currentVersion . '")]'; - } - - /** - * - */ - public function findVersion($currentVersion) - { - return $this->_rootElement->find($this->getVersionLocator($currentVersion), Locator::SELECTOR_XPATH); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Page/Header.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Page/Header.php deleted file mode 100644 index 958ec941a55..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Page/Header.php +++ /dev/null @@ -1,102 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Page; - -use Magento\Mtf\Block\Block; -use Magento\Mtf\Client\Locator; - -/** - * Header block. - */ -class Header extends Block -{ - /** - * Logout link selector. - * - * @var string - */ - protected $logOut = '.link-logout'; - - /** - * Top menu item selector. - * - * @var string - */ - protected $topMenuItem = './/div[@class = "nav-bar"]/ul/li/a[contains(., "%s")]'; - - /** - * Log out Admin User. - * - * @return void - */ - public function logOut() - { - $this->_rootElement->find($this->logOut)->click(); - $this->waitForElementNotVisible($this->logOut); - } - - /** - * First level menu items selector. - * - * @var string - */ - protected $firstLevelMenuItem = 'li.parent.level0'; - - /** - * Check navigation menu. - * - * @param string $name - * @return bool - */ - public function checkMenu($name) - { - return $this->_rootElement->find(sprintf($this->topMenuItem, $name), Locator::SELECTOR_XPATH)->isVisible(); - } - - /** - * Wait header block is visible. - * - * @return bool - */ - public function waitVisible() - { - try { - $browser = $this->_rootElement; - return $browser->waitUntil( - function () use ($browser) { - return $browser->isVisible() ? true : null; - } - ); - } catch (\Exception $e) { - return false; - } - } - - /** - * Get first-level menu elements. - * - * @return array - */ - public function getMenuFirstLevelItems() - { - $elements = $this->_rootElement->getElements($this->firstLevelMenuItem); - $items = []; - foreach ($elements as $element) { - $items[] = $element->getText(); - } - return $items; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Page/Main.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Page/Main.php deleted file mode 100644 index c995bd006bb..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Page/Main.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Page; - -use Magento\Mtf\Block\Block; - -/** - * Main dashboard block. - */ -class Main extends Block -{ - /** - * Selector for Revenue prices. - * - * @var string - */ - protected $revenuePriceBlock = '#dashboard_diagram_totals td:first-child'; - - /** - * Get Revenue price. - * - * @return string - */ - public function getRevenuePrice() - { - return $this->_rootElement->find($this->revenuePriceBlock)->getText(); - } - - /** - * Get Main Block text. - * - * @return string - */ - public function getMainBlockText() - { - return $this->_rootElement->getText(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/PageActions.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/PageActions.php deleted file mode 100644 index 8324a93dc7a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/PageActions.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block; - -use Magento\Mtf\Block\Block; -use Magento\Mtf\Client\Locator; - -/** - * Page actions block for Form page & Grid page action blocks to extend. - */ -class PageActions extends Block -{ - /** - * Backend abstract block selector. - * - * @var string - */ - protected $templateBlock = './ancestor::body'; - - /** - * Get backend abstract block. - * - * @return Template - */ - protected function getTemplateBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Template', - ['element' => $this->_rootElement->find($this->templateBlock, Locator::SELECTOR_XPATH)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Permissions/Role/Edit/Tab/RoleResources.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Permissions/Role/Edit/Tab/RoleResources.php deleted file mode 100644 index 38a646e5854..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Permissions/Role/Edit/Tab/RoleResources.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Permissions\Role\Edit\Tab; - -use Magento\Mtf\Client\Element\SimpleElement as Element; -use Mage\Adminhtml\Test\Block\Widget\Tab; - -/** - * Role resources Tab. - */ -class RoleResources extends Tab -{ - /** - * Fill data to fields on tab. - * - * @param array $fields - * @param Element|null $element - * @return $this - */ - public function fillFormTab(array $fields, Element $element = null) - { - if (isset($fields['roles_resources'])) { - $fields['roles_resources']['value'] = ucfirst($fields['roles_resources']['value'][0]); - } - $data = $this->dataMapping($fields); - $this->_fill($data, $element); - - return $this; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Permissions/Role/Grid/RoleGrid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Permissions/Role/Grid/RoleGrid.php deleted file mode 100644 index 1fde3b3e717..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Permissions/Role/Grid/RoleGrid.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Permissions\Role\Grid; - -use Mage\Adminhtml\Test\Block\Widget\Grid; - -/** - * Role grid on role index page. - */ -class RoleGrid extends Grid -{ - /** - * Grid filters' selectors. - * - * @var array - */ - protected $filters = [ - 'id' => [ - 'selector' => '#roleGrid_filter_role_id', - ], - 'rolename' => [ - 'selector' => '#roleGrid_filter_role_name', - ], - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Permissions/Role/RoleForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Permissions/Role/RoleForm.php deleted file mode 100644 index 3c096d859af..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Permissions/Role/RoleForm.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Permissions\Role; - -use Mage\Adminhtml\Test\Block\Widget\FormTabs; - -/** - * Role edit form page. - */ -class RoleForm extends FormTabs -{ - // -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Permissions/Role/RoleForm.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Permissions/Role/RoleForm.xml deleted file mode 100644 index 1f50d55e154..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Permissions/Role/RoleForm.xml +++ /dev/null @@ -1,46 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<tabs> - <role-info> - <class>\Mage\Adminhtml\Test\Block\Widget\Tab</class> - <selector>#role_info_tabs_info</selector> - <strategy>css selector</strategy> - <fields> - <role_name> - <selector>[name='rolename']</selector> - <strategy>css selector</strategy> - </role_name> - </fields> - </role-info> - <role-resources> - <class>\Mage\Adminhtml\Test\Block\Permissions\Role\Edit\Tab\RoleResources</class> - <selector>#role_info_tabs_account</selector> - <strategy>css selector</strategy> - <fields> - <resource_access> - <selector>[name="all"]</selector> - <strategy>css selector</strategy> - <input>select</input> - </resource_access> - <roles_resources> - <selector>#resource-tree</selector> - <strategy>css selector</strategy> - <input>tree</input> - </roles_resources> - </fields> - </role-resources> -</tabs> diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Permissions/User/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Permissions/User/Grid.php deleted file mode 100644 index bb3c6c787e7..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Permissions/User/Grid.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Permissions\User; - -/** - * User grid on User index page. - */ -class Grid extends \Mage\Adminhtml\Test\Block\Widget\Grid -{ - /** - * Grid filters' selectors. - * - * @var array - */ - protected $filters = [ - 'username' => [ - 'selector' => '#permissionsUserGrid_filter_username' - ], - 'email' => [ - 'selector' => '#permissionsUserGrid_filter_email' - ] - ]; - - /** - * Locator value of td with username. - * - * @var string - */ - protected $editLink = 'td.last'; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Promo/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Promo/Grid.php deleted file mode 100644 index 172653b105e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Promo/Grid.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Promo; - -/** - * Shopping Cart Price Rules grid. - */ -class Grid extends \Mage\Adminhtml\Test\Block\Widget\Grid -{ - /** - * Locator value for link in action column. - * - * @var string - */ - protected $editLink = 'td.last'; - - /** - * Filters array mapping. - * - * @var array - */ - protected $filters = [ - 'name' => [ - 'selector' => 'input[name="name"]', - ], - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Promo/Quote/Edit/FormPageActions.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Promo/Quote/Edit/FormPageActions.php deleted file mode 100644 index 5f9ebda3b06..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Promo/Quote/Edit/FormPageActions.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Promo\Quote\Edit; - -/** - * Form page actions block for cart price rule page. - */ -class FormPageActions extends \Mage\Adminhtml\Test\Block\FormPageActions -{ - /** - * Click "Delete" button and accept alert. - * - * @return void - */ - public function delete() - { - $this->_rootElement->find($this->deleteButton)->click(); - $this->browser->acceptAlert(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Promo/Quote/Edit/PromoQuoteForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Promo/Quote/Edit/PromoQuoteForm.php deleted file mode 100644 index 380615921ef..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Promo/Quote/Edit/PromoQuoteForm.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Promo\Quote\Edit; - -use Mage\Adminhtml\Test\Block\Widget\FormTabs; - -/** - * PromoQuote form. - */ -class PromoQuoteForm extends FormTabs -{ - // -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Promo/Quote/Edit/PromoQuoteForm.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Promo/Quote/Edit/PromoQuoteForm.xml deleted file mode 100644 index 351ad746509..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Promo/Quote/Edit/PromoQuoteForm.xml +++ /dev/null @@ -1,93 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<tabs> - <rule_information> - <class>\Mage\Adminhtml\Test\Block\Promo\Quote\Edit\Tab\RuleInformation</class> - <selector>#promo_catalog_edit_tabs_main_section</selector> - <strategy>css selector</strategy> - <fields> - <name /> - <description /> - <is_active> - <input>select</input> - </is_active> - <website_ids> - <selector>#rule_website_ids</selector> - <input>multiselect</input> - </website_ids> - <customer_group_ids> - <selector>[name="customer_group_ids[]"]</selector> - <input>multiselect</input> - </customer_group_ids> - <coupon_type> - <input>select</input> - </coupon_type> - <coupon_code /> - <uses_per_coupon /> - <uses_per_customer /> - <from_date /> - <to_date /> - <sort_order /> - <is_rss> - <input>select</input> - </is_rss> - </fields> - </rule_information> - <conditions> - <class>\Mage\Adminhtml\Test\Block\Widget\Tab</class> - <selector>#promo_catalog_edit_tabs_conditions_section</selector> - <strategy>css selector</strategy> - <fields> - <conditions_serialized> - <selector>#rule_conditions_fieldset</selector> - <input>conditions</input> - </conditions_serialized> - </fields> - </conditions> - <actions> - <class>\Mage\Adminhtml\Test\Block\Widget\Tab</class> - <selector>#promo_catalog_edit_tabs_actions_section</selector> - <strategy>css selector</strategy> - <fields> - <simple_action> - <input>select</input> - </simple_action> - <discount_amount /> - <discount_qty /> - <discount_step /> - <apply_to_shipping> - <input>select</input> - </apply_to_shipping> - <simple_free_shipping> - <input>select</input> - </simple_free_shipping> - <stop_rules_processing> - <input>select</input> - </stop_rules_processing> - <reward_points_delta /> - <actions_serialized> - <selector>#rule_actions_fieldset</selector> - <input>conditions</input> - </actions_serialized> - </fields> - </actions> - <labels> - <class>\Mage\Adminhtml\Test\Block\Promo\Quote\Edit\Tab\Labels</class> - <selector>#promo_catalog_edit_tabs_labels_section</selector> - <strategy>css selector</strategy> - </labels> -</tabs> diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Promo/Quote/Edit/Tab/Labels.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Promo/Quote/Edit/Tab/Labels.php deleted file mode 100644 index abc8b66d155..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Promo/Quote/Edit/Tab/Labels.php +++ /dev/null @@ -1,74 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Promo\Quote\Edit\Tab; - -use Mage\Adminhtml\Test\Block\Widget\Tab; -use Magento\Mtf\Client\Element\SimpleElement as Element; - -/** - * Backend sales rule label tab. - */ -class Labels extends Tab -{ - /** - * Store label field name. - */ - const STORE_LABEL_NAME = '[name="store_labels[%s]"]'; - - /** - * Fill data to labels fields on labels tab. - * - * @param array $fields - * @param Element|null $element - * @return $this - */ - public function fillFormTab(array $fields, Element $element = null) - { - if (isset($fields['store_labels'])) { - $count = 0; - foreach ($fields['store_labels']['value'] as $storeLabel) { - $element->find(sprintf(self::STORE_LABEL_NAME, $count))->setValue($storeLabel); - ++$count; - } - } - - return $this; - } - - /** - * Get data of labels tab. - * - * @param array|null $fields - * @param Element|null $element - * @return array - */ - public function getDataFormTab($fields = null, Element $element = null) - { - $storeLabels = []; - $count = 0; - $field = $this->_rootElement->find(sprintf(self::STORE_LABEL_NAME, $count)); - while ($field->isVisible()) { - $fieldValue = $field->getValue(); - if ($fieldValue != '') { - $storeLabels[$count] = $fieldValue; - } - ++$count; - $field = $this->_rootElement->find(sprintf(self::STORE_LABEL_NAME, $count)); - } - - return ['store_labels' => $storeLabels]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Promo/Quote/Edit/Tab/RuleInformation.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Promo/Quote/Edit/Tab/RuleInformation.php deleted file mode 100644 index 5cd95be7a87..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Promo/Quote/Edit/Tab/RuleInformation.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Promo\Quote\Edit\Tab; - -use Mage\Adminhtml\Test\Block\Widget\Tab; -use Magento\Mtf\Client\Element\SimpleElement as Element; -use Magento\Mtf\Client\Locator; - -/** - * Backend sales rule information tab. - */ -class RuleInformation extends Tab -{ - /** - * Web site field. - * - * @var string - */ - protected $websiteField = '#rule_website_ids'; - - /** - * Fill data to labels fields on labels tab. - * - * @param array $fields - * @param Element|null $element - * @return $this - */ - public function fillFormTab(array $fields, Element $element = null) - { - parent::fillFormTab($fields, $element); - $webSiteField = $this->_rootElement->find($this->websiteField, Locator::SELECTOR_CSS, 'multiselect'); - if ($webSiteField->isVisible()) { - $webSiteFieldValue = $webSiteField->getValue(); - if (empty($webSiteFieldValue)) { - $webSiteField->setValue('Main Website'); - } - } - - return $this; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Rating/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Rating/Grid.php deleted file mode 100644 index d6babbda07b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Rating/Grid.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Rating; - -/** - * Grid on rating index page. - */ -class Grid extends \Mage\Adminhtml\Test\Block\Widget\Grid -{ - // -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Review/Edit/ReviewDetails.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Review/Edit/ReviewDetails.php deleted file mode 100644 index b254a3be91a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Review/Edit/ReviewDetails.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Review\Edit; - -use Mage\Adminhtml\Test\Block\Widget\Tab; -use Magento\Mtf\Client\Element\SimpleElement as Element; - -/** - * Review details tab. - */ -class ReviewDetails extends Tab -{ - /** - * Selector for customer. - * - * @var string - */ - protected $customer = '#customer'; - - /** - * Get data of tab. - * - * @param array|null $fields - * @param Element|null $element - * @return array - */ - public function getDataFormTab($fields = null, Element $element = null) - { - return array_merge(parent::getDataFormTab($fields, $element), ['customer' => $this->getCustomer()]); - } - - /** - * Get customer. - * - * @return string - */ - protected function getCustomer() - { - return $this->_rootElement->find($this->customer)->getText(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Review/Edit/ReviewDetails/RatingElement.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Review/Edit/ReviewDetails/RatingElement.php deleted file mode 100644 index 52a060a0d45..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Review/Edit/ReviewDetails/RatingElement.php +++ /dev/null @@ -1,72 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Review\Edit\ReviewDetails; - -use Magento\Mtf\Client\Locator; -use Magento\Mtf\Client\Element\SimpleElement; - -/** - * Rating typified element. - */ -class RatingElement extends SimpleElement -{ - /** - * Selector for label of checked rating. - * - * @var string - */ - protected $checkedRating = 'input:checked'; - - /** - * Selector for rating title. - * - * @var string - */ - protected $ratingTitle = '//*[@id="product-review-table"]/tbody/tr/td[1]'; - - /** - * Get ratings list. - * - * @return array - */ - public function getValue() - { - $result = []; - $ratings = $this->getElements($this->checkedRating, Locator::SELECTOR_CSS, 'checkbox'); - $titles = $this->getElements($this->ratingTitle, Locator::SELECTOR_XPATH); - foreach ($ratings as $key => $rating) { - $ratingTitle = $titles[$key]->getText(); - $result[] = [ - 'title' => $ratingTitle, - 'rating' => $this->prepareFormatValue($rating->getAttribute('id'), $ratingTitle) - ]; - } - - return $result; - } - - /** - * Prepare format for rating value. - * - * @param string $value - * @param string $replace - * @return string - */ - protected function prepareFormatValue($value, $replace) - { - return str_replace($replace . '_', '', $value); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Review/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Review/Grid.php deleted file mode 100644 index 469d2e8dae9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Review/Grid.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Review; - -/** - * Reviews grid. - */ -class Grid extends \Mage\Adminhtml\Test\Block\Widget\Grid -{ - /** - * Filters array mapping. - * - * @var array - */ - protected $filters = [ - 'review_id' => [ - 'selector' => 'input[name="review_id"]', - ], - 'title' => [ - 'selector' => 'input[name="title"]', - ], - 'status_id' => [ - 'selector' => '#reviwGrid_filter_status', - 'input' => 'select', - ], - 'nickname' => [ - 'selector' => 'input[name="nickname"]', - ], - 'detail' => [ - 'selector' => 'input[name="detail"]', - ], - 'type' => [ - 'selector' => 'select[name="type"]', - 'input' => 'select', - ], - 'name' => [ - 'selector' => 'input[name="name"]', - ], - 'sku' => [ - 'selector' => 'input[name="sku"]', - ], - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Review/ReviewForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Review/ReviewForm.php deleted file mode 100644 index 24fbe58ff88..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Review/ReviewForm.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Review; - -use Mage\Adminhtml\Test\Block\Widget\FormTabs; -use Magento\Mtf\Client\Locator; -use Mage\Adminhtml\Test\Block\Widget\Tab; - -/** - * Review form on backend review page. - */ -class ReviewForm extends FormTabs -{ - /** - * Rating status - * - * @var string - */ - protected $status = '[name=status_id]'; - - /** - * Open tab. - * - * @param string $tabName - * @return Tab - */ - public function openTab($tabName) - { - return $this; - } - - /** - * Set approve review. - * - * @return void - */ - public function setApproveReview() - { - $this->_rootElement->find($this->status, Locator::SELECTOR_CSS, 'select')->setValue('Approved'); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Review/ReviewForm.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Review/ReviewForm.xml deleted file mode 100644 index 7a9fd16e626..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Review/ReviewForm.xml +++ /dev/null @@ -1,36 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<tabs> - <review-details> - <class>\Mage\Adminhtml\Test\Block\Review\Edit\ReviewDetails</class> - <selector>.fieldset-legend</selector> - <fields> - <status_id> - <input>select</input> - </status_id> - <title /> - <nickname /> - <detail> - <input>textarea</input> - </detail> - <ratings> - <selector>#detailed_rating</selector> - <class>Mage\Adminhtml\Test\Block\Review\Edit\ReviewDetails\RatingElement</class> - </ratings> - </fields> - </review-details> -</tabs> diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/AbstractGrid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/AbstractGrid.php deleted file mode 100644 index 00c23acac37..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/AbstractGrid.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales; - -use Mage\Adminhtml\Test\Block\Widget\Grid; - -/** - * Sales abstract grid. - */ -abstract class AbstractGrid extends Grid -{ - /** - * Locator value for link on action column. - * - * @var string - */ - protected $editLink = 'td:nth-child(2)'; - - /** - * Name for id column. - * - * @var array - */ - protected $idColumnName; - - /** - * Get invoice ids - * - * @return array - */ - public function getIds() - { - $result = []; - $dataIds = $this->getRowsData(['id' => $this->idColumnName]); - foreach ($dataIds as $key => $dataId) { - $result[$key] = $dataId['id']; - } - - return $result; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/CreditMemos/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/CreditMemos/Grid.php deleted file mode 100644 index 923d7a50cb0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/CreditMemos/Grid.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\CreditMemos; - -use Mage\Adminhtml\Test\Block\Sales\AbstractGrid; - -/** - * Sales credit memos grid. - */ -class Grid extends AbstractGrid -{ - /** - * Products table identifier. - * - * @var string - */ - protected $tableIdentifier = '@id="order_creditmemos_table"'; - - /** - * Selector for title id column. - * - * @var array - */ - protected $idColumnName = '.="Credit Memo #"'; - - /** - * Base part of row locator template for getRow() method. - * - * @var string - */ - protected $location = './/div[@class="grid"]//tr['; - - /** - * Filters array mapping. - * - * @var array - */ - protected $filters = [ - 'id' => [ - 'selector' => 'input[name="increment_id"]', - ], - 'order_id' => [ - 'selector' => 'input[name="order_increment_id"]', - ], - 'from' => [ - 'selector' => 'input[name*="grand_total[from]"]', - ], - 'to' => [ - 'selector' => 'input[name*="grand_total[to]"]', - ], - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/CreditMemos/View/Items.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/CreditMemos/View/Items.php deleted file mode 100644 index ef881ff7ea5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/CreditMemos/View/Items.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\CreditMemos\View; - -use Mage\Adminhtml\Test\Block\Sales\Order\AbstractItems; - -/** - * Credit memo Items block on Credit memo view page. - */ -class Items extends AbstractItems -{ - /** - * Item class. - * - * @var string - */ - protected $itemClass ='Mage\Adminhtml\Test\Block\Sales\CreditMemos\View\Items\Item'; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/CreditMemos/View/Items/Item.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/CreditMemos/View/Items/Item.php deleted file mode 100644 index 44fa28bcadc..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/CreditMemos/View/Items/Item.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\CreditMemos\View\Items; - -use Mage\Adminhtml\Test\Block\Sales\Order\AbstractItems\AbstractItem; - -/** - * Credit memo Items block on Credit memo view page. - */ -class Item extends AbstractItem -{ - /** - * Columns in grid. - * - * @var array - */ - protected $columns = [ - 'product' => ['col_name' => 'Product'], - 'item_qty' => ['col_name' => 'Qty'], - 'item_price' => ['col_name' => 'Price'], - 'item_subtotal' => ['col_name' => 'Subtotal'], - 'item_tax' => ['col_name' => 'Tax Amount'], - 'item_discount' => ['col_name' => 'Discount Amount'], - 'item_row_total' => ['col_name' => 'Row Total'] - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Invoices/Actions.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Invoices/Actions.php deleted file mode 100644 index c2f17cdbaa2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Invoices/Actions.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Invoices; - -use Magento\Mtf\Block\Block; - -/** - * Order actions block. - */ -class Actions extends Block -{ - /** - * 'Credit Memo' button on the order page. - * - * @var string - */ - protected $orderCreditMemoButton = '[onclick*="sales_order_creditmemo"]'; - - /** - * Order credit memo. - * - * @return void - */ - public function creditMemo() - { - $this->_rootElement->find($this->orderCreditMemoButton)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Invoices/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Invoices/Grid.php deleted file mode 100644 index fbcf5c6621c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Invoices/Grid.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Invoices; - -use Mage\Adminhtml\Test\Block\Sales\AbstractGrid; - -/** - * Sales invoices grid. - */ -class Grid extends AbstractGrid -{ - /** - * Products table identifier. - * - * @var string - */ - protected $tableIdentifier = '@id="order_invoices_table"'; - - /** - * Name for id column. - * - * @var array - */ - protected $idColumnName = '.="Invoice #"'; - - /** - * Filters array mapping. - * - * @var array - */ - protected $filters = [ - 'id' => [ - 'selector' => 'input[name="increment_id"]', - ], - 'order_id' => [ - 'selector' => 'input[name="order_increment_id"]', - ], - 'from' => [ - 'selector' => 'input[name*="grand_total[from]"]', - ], - 'to' => [ - 'selector' => 'input[name*="grand_total[to]"]', - ], - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Invoices/View/Items.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Invoices/View/Items.php deleted file mode 100644 index 15c06fa84e3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Invoices/View/Items.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Invoices\View; - -use Mage\Adminhtml\Test\Block\Sales\Order\AbstractItems; - -/** - * Invoice Items block on Invoice view page. - */ -class Items extends AbstractItems -{ - /** - * Item class. - * - * @var string - */ - protected $itemClass ='Mage\Adminhtml\Test\Block\Sales\Invoices\View\Items\Item'; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Invoices/View/Items/Item.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Invoices/View/Items/Item.php deleted file mode 100644 index 06260caa165..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Invoices/View/Items/Item.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Invoices\View\Items; - -use Mage\Adminhtml\Test\Block\Sales\Order\AbstractItems\AbstractItem; - -/** - * Invoice Items block on Invoice view page. - */ -class Item extends AbstractItem -{ - /** - * Columns in grid. - * - * @var array - */ - protected $columns = [ - 'product' => ['col_name' => 'Product'], - 'item_qty' => ['col_name' => 'Qty'], - 'item_price' => ['col_name' => 'Price'], - 'item_subtotal' => ['col_name' => 'Subtotal'], - 'item_tax' => ['col_name' => 'Tax Amount'], - 'item_discount' => ['col_name' => 'Discount Amount'], - 'item_row_total' => ['col_name' => 'Row Total'] - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/AbstractForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/AbstractForm.php deleted file mode 100644 index 3b33d58367c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/AbstractForm.php +++ /dev/null @@ -1,148 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order; - -use Magento\Mtf\Block\Form; -use Mage\Adminhtml\Test\Block\Template; -use Magento\Mtf\Client\Locator; - -/** - * Abstract Form block. - */ -abstract class AbstractForm extends Form -{ - /** - * Backend abstract block selector. - * - * @var string - */ - protected $templateBlock = './ancestor::body'; - - /** - * Send button css selector. - * - * @var string - */ - protected $send = '.submit-button'; - - /** - * Disabled flag. - * - * @var string - */ - protected $disabledFlag = '.disabled'; - - /** - * Item block class. - * - * @var string - */ - protected $itemBlockClass; - - /** - * Items block css selector. - * - * @var string - */ - protected $items; - - /** - * Fill form data. - * - * @param array $data - * @param array|null $products - * @return void - */ - public function fillData(array $data, $products = null) - { - if (isset($data['form_data'])) { - $data['form_data'] = $this->dataMapping($data['form_data']); - $this->_fill($data['form_data']); - } - if (isset($data['items_data']) && $products !== null) { - $this->fillItemsData($data['items_data'], $products); - } - } - - /** - * Fill items data. - * - * @param array $data - * @param array $products - * @return void - */ - protected function fillItemsData(array $data, array $products) - { - foreach ($products as $key => $product) { - $this->getItemsBlock()->getItemProductBlock($product)->fillProduct($data[$key]); - } - } - - /** - * Click update qty's button. - * - * @return void - */ - public function updateQty() - { - $this->getItemsBlock()->clickUpdateQty(); - } - - /** - * Get items block. - * - * @return AbstractItemsNewBlock - */ - public function getItemsBlock() - { - return $this->blockFactory->create( - $this->itemBlockClass, - ['element' => $this->_rootElement->find($this->items)] - ); - } - - /** - * Submit order. - * - * @return void - */ - public function submit() - { - $this->getTemplateBlock()->waitLoader(); - $browser = $this->browser; - $selector = $this->send . $this->disabledFlag; - $browser->waitUntil( - function () use ($browser, $selector) { - $element = $browser->find($selector); - return $element->isVisible() == false ? true : null; - } - ); - $this->_rootElement->find($this->send)->click(); - } - - /** - * Get backend abstract block. - * - * @return Template - */ - protected function getTemplateBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Template', - ['element' => $this->_rootElement->find($this->templateBlock, Locator::SELECTOR_XPATH)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/AbstractForm/Product.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/AbstractForm/Product.php deleted file mode 100644 index 4cb7cf9830d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/AbstractForm/Product.php +++ /dev/null @@ -1,82 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\AbstractForm; - -use Mage\Checkout\Test\Block\AbstractItem; -use Magento\Mtf\Client\Locator; - -/** - * Item product form on items block. - */ -abstract class Product extends AbstractItem -{ - /** - * Items tax type. - * - * @var array - */ - protected $pricesType = [ - 'cart_item_price_excl_tax' => [ - 'selector' => '//span[@class="price-excl-tax"]//span[@class="price"]', - 'strategy' => Locator::SELECTOR_XPATH, - 'column' => 'Price' - ], - 'cart_item_price_incl_tax' => [ - 'selector' => '//span[@class="price-incl-tax"]//span[@class="price"]', - 'strategy' => Locator::SELECTOR_XPATH, - 'column' => 'Price' - ], - 'cart_item_subtotal_excl_tax' => [ - 'selector' => '//span[@class="price-excl-tax"]//span[@class="price"]', - 'strategy' => Locator::SELECTOR_XPATH, - 'column' => 'Subtotal' - ], - 'cart_item_subtotal_incl_tax' => [ - 'selector' => '//span[@class="price-incl-tax"]//span[@class="price"]', - 'strategy' => Locator::SELECTOR_XPATH, - 'column' => 'Subtotal' - ], - 'cart_item_price' => [ - 'selector' => '//span[@class="price"]', - 'strategy' => Locator::SELECTOR_XPATH, - 'column' => 'Price' - ], - 'cart_item_subtotal' => [ - 'selector' => '//span[@class="price"]', - 'strategy' => Locator::SELECTOR_XPATH, - 'column' => 'Subtotal' - ] - ]; - - /** - * Field selector. - * - * @var string - */ - protected $fieldSelector = '//td[count(//th[contains(text(),"%s")]/preceding-sibling::th)+1]'; - - /** - * Prepare selector for field. - * - * @param string $field - * @return string - */ - protected function prepareSelector($field) - { - $fieldMapping = $this->pricesType[$field]; - return sprintf($this->fieldSelector, $fieldMapping['column']) . $fieldMapping['selector']; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/AbstractForm/ProductForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/AbstractForm/ProductForm.php deleted file mode 100644 index 2700bcd6062..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/AbstractForm/ProductForm.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\AbstractForm; - -/** - * Item product form on items block. - */ -abstract class ProductForm extends Product -{ - /** - * Fill item product data. - * - * @param array $data - * @return void - */ - public function fillProduct(array $data) - { - $data = $this->dataMapping($data); - $this->_fill($data); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/AbstractItems.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/AbstractItems.php deleted file mode 100644 index 0ca4c41396c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/AbstractItems.php +++ /dev/null @@ -1,70 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order; - -use Magento\Mtf\Block\Block; -use Mage\Adminhtml\Test\Block\Sales\Order\AbstractItems\AbstractItem; - -/** - * Base Items block on Credit Memo, Invoice, Shipment view page. - */ -class AbstractItems extends Block -{ - /** - * Item class. - * - * @var string - */ - protected $itemClass; - - /** - * Locator for row item. - * - * @var string - */ - protected $rowItem = '.data.order-tables>tbody>tr'; - - /** - * Get items data. - * - * @return array - */ - public function getData() - { - $result = []; - foreach ($this->getItems() as $item) { - /** @var AbstractItem $item */ - $result[] = $item->getFieldsData(); - } - - return $result; - } - - /** - * Get items blocks. - * - * @return AbstractItem[] - */ - protected function getItems() - { - $items = $this->_rootElement->getElements($this->rowItem); - foreach ($items as $key => $item) { - $items[$key] = $this->blockFactory->create($this->itemClass, ['element' => $item]); - } - - return $items; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/AbstractItems/AbstractItem.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/AbstractItems/AbstractItem.php deleted file mode 100644 index 1c5cd424c5c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/AbstractItems/AbstractItem.php +++ /dev/null @@ -1,152 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\AbstractItems; - -use Mage\Adminhtml\Test\Block\Sales\Order\AbstractForm\Product; -use Magento\Mtf\Client\Locator; -use Magento\Mtf\Client\ElementInterface; - -/** - * Abstract item block on sales type view page. - */ -abstract class AbstractItem extends Product -{ - /** - * Columns in grid. - * - * @var array - */ - protected $columns = ['product' => ['col_name' => 'Product']]; - - /** - * Field selector. - * - * @var string - */ - protected $fieldSelector = './/td[count(//th[contains(.,"%s")]/preceding-sibling::th)+1]'; - - /** - * Mapping for products fields. - * - * @var array - */ - protected $productFields = [ - 'name' => [ - 'selector' => '.title' - ], - 'sku' => [ - 'selector' => './/*[*[contains(text(),"SKU")]]', - 'strategy' => Locator::SELECTOR_XPATH, - 'replace' => 'SKU:' - ], - 'options' => [ - 'selector' => '.item-options' - ] - ]; - - /** - * Option title selector. - * - * @var string - */ - protected $optionTitleSelector = 'dt'; - - /** - * Get data from item row. - * - * @param array $filter [optional] - * @return array - */ - public function getFieldsData(array $filter = []) - { - $result = []; - $fields = empty($filter) ? $this->columns : $filter; - foreach ($fields as $field => $fieldData) { - $methodName = 'get' . ucfirst($field); - if (method_exists($this, $methodName)) { - $result[$field] = $this->$methodName($fieldData['col_name']); - } else { - $column = $this->getColumn($fieldData['col_name']); - if ($column !== null) { - $result[$field] = $this->getColumnValue($column, $fieldData); - } - } - } - - return $result; - } - - /** - * Get data from product column. - * - * @param string $fieldName - * @return array - */ - protected function getProduct($fieldName) - { - $result = []; - $dataColumn = $this->getColumn($fieldName); - foreach ($this->productFields as $key => $mapping) { - $strategy = isset($mapping['strategy']) ? $mapping['strategy'] : Locator::SELECTOR_CSS; - $field = $dataColumn->find($mapping['selector'], $strategy); - if ($field->isVisible()) { - if ($key == 'options') { - $result[$key] = $this->getOptions($dataColumn); - } else { - $result[$key] = $this->getColumnValue($field, $mapping); - } - } - } - - return $result; - } - - /** - * Get column value. - * - * @param ElementInterface $element - * @param array $attributes - * @return string - */ - protected function getColumnValue(ElementInterface $element, array $attributes = []) - { - $search = isset($attributes['replace']) ? $attributes['replace'] : ['$', '%']; - return trim(str_replace($search, '', $element->getText())); - } - - /** - * Get column. - * - * @param string $fieldName - * @return ElementInterface|null - */ - protected function getColumn($fieldName) - { - $column = $this->_rootElement->find($this->getColumnSelector($fieldName), Locator::SELECTOR_XPATH); - return $column->isVisible() ? $column : null; - } - - /** - * Get column selector. - * - * @param string $fieldName - * @return string - */ - protected function getColumnSelector($fieldName) - { - return sprintf($this->fieldSelector, $fieldName); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/AbstractItemsNewBlock.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/AbstractItemsNewBlock.php deleted file mode 100644 index c376e6985e1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/AbstractItemsNewBlock.php +++ /dev/null @@ -1,70 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order; - -use Mage\Adminhtml\Test\Block\Sales\Order\AbstractForm\Product; -use Magento\Mtf\Block\Block; -use Magento\Mtf\Fixture\InjectableFixture; -use Magento\Mtf\Client\Locator; - -/** - * Items block on Credit Memo, Invoice, Shipment new pages. - */ -abstract class AbstractItemsNewBlock extends Block -{ - /** - * Item product row selector. - * - * @var string - */ - protected $productItem = '//tr[.//*[contains(text(),"%s")]]'; - - /** - * Item block class. - * - * @var string - */ - protected $classItemBlock; - - /** - * 'Update Qty's' button css selector. - * - * @var string - */ - protected $updateQty = '.update-button'; - - /** - * Get item product block. - * - * @param InjectableFixture $product - * @return Product - */ - public function getItemProductBlock(InjectableFixture $product) - { - $element = $this->_rootElement->find(sprintf($this->productItem, $product->getName()), Locator::SELECTOR_XPATH); - return $this->blockFactory->create($this->classItemBlock, ['element' => $element]); - } - - /** - * Click update qty button. - * - * @return void - */ - public function clickUpdateQty() - { - $this->_rootElement->find($this->updateQty)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Actions.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Actions.php deleted file mode 100644 index cd7f9c415a7..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Actions.php +++ /dev/null @@ -1,128 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order; - -use Magento\Mtf\Block\Block; - -/** - * Order actions block. - */ -class Actions extends Block -{ - /** - * General button selector. - * - * @var string - */ - protected $button = 'button[title="%s"]'; - - /** - * 'Invoice' button. - * - * @var string - */ - protected $orderInvoiceButton = '[onclick*="sales_order_invoice"]'; - - /** - * 'Ship' button. - * - * @var string - */ - protected $orderShipButton = '[onclick*="sales_order_shipment"]'; - - /** - * 'Credit Memo' button on the order page. - * - * @var string - */ - protected $orderCreditMemoButton = '[onclick*="sales_order_creditmemo"]'; - - /** - * Cancel button on the order page. - * - * @var string - */ - protected $orderCancelButton = '[onclick*="sales_order/cancel"]'; - - /** - * Reorder button on the order page. - * - * @var string - */ - protected $reorderButton = '[onclick*="sales_order_create/reorder/order_id"]'; - - /** - * Check if action button is visible. - * - * @param string $buttonName - * @return bool - */ - public function isActionButtonVisible($buttonName) - { - return $this->_rootElement->find(sprintf($this->button, $buttonName))->isVisible(); - } - - /** - * Invoice order. - * - * @return void - */ - public function invoice() - { - $this->_rootElement->find($this->orderInvoiceButton)->click(); - } - - /** - * Ship order. - * - * @return void - */ - public function shipment() - { - $this->_rootElement->find($this->orderShipButton)->click(); - } - - /** - * Order credit memo. - * - * @return void - */ - public function refund() - { - $this->_rootElement->find($this->orderCreditMemoButton)->click(); - } - - /** - * Cancel order. - * - * @return void - */ - public function cancel() - { - $this->_rootElement->find($this->orderCancelButton)->click(); - $this->browser->acceptAlert(); - } - - /** - * Reorder order. - * - * @return void - */ - public function reorder() - { - $this->_rootElement->find($this->reorderButton)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Address.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Address.php deleted file mode 100644 index 4908cd39c9e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Address.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order; - -use Magento\Mtf\Block\Block; - -/** - * Order address block. - */ -class Address extends Block -{ - /** - * Address selector. - * - * @var string - */ - protected $address = 'address'; - - /** - * Get address. - * - * @return string - */ - public function getAddress() - { - return $this->_rootElement->find($this->address)->getText(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Comments.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Comments.php deleted file mode 100644 index 2daef31db06..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Comments.php +++ /dev/null @@ -1,66 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022-2023 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order; - -use Magento\Mtf\Block\Block; - -/** - * Order comments block. - */ -class Comments extends Block -{ - /** - * Comment selector. - * - * @var string - */ - protected $comment = '.note-list li'; - - /** - * Comments form selector. - * - * @var string - */ - protected $commentsForm = '#history_form'; - - /** - * Get all comments elements. - * - * @return array - */ - protected function getCommentsElements() - { - $this->waitForElementVisible($this->commentsForm); - return $this->_rootElement->getElements($this->comment); - } - - /** - * Check if comment with specific text is present. - * - * @param string $commentText - * @return bool - */ - public function isCommentPresent($commentText) - { - $comments = $this->getCommentsElements(); - foreach ($comments as $comment) { - if (str_contains($comment->getText(), $commentText)) { - return true; - } - } - return false; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create.php deleted file mode 100644 index 4ba121cc304..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create.php +++ /dev/null @@ -1,190 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order; - -use Mage\Adminhtml\Test\Block\Sales\Order\Create\Coupons; -use Mage\Adminhtml\Test\Block\Template; -use Mage\Adminhtml\Test\Block\Sales\Order\Create\Items; -use Mage\Adminhtml\Test\Block\Sales\Order\Create\Search; -use Mage\Adminhtml\Test\Block\Sales\Order\Create\Payment; -use Mage\Adminhtml\Test\Block\Sales\Order\Create\Shipping; -use Mage\Adminhtml\Test\Block\Sales\Order\Create\Billing\Address; -use Magento\Mtf\Fixture\InjectableFixture; -use Magento\Mtf\Client\Locator; -use Magento\Mtf\Block\Block; - -/** - * Adminhtml sales order create block. - */ -class Create extends Block -{ - /** - * Items block selector. - * - * @var string - */ - protected $itemsBlock = '#order-items'; - - /** - * Backend abstract block. - * - * @var string - */ - protected $templateBlock = './ancestor::body'; - - /** - * Products grid selector. - * - * @var string - */ - protected $searchGrid = '#order-search'; - - /** - * Billing address block selector. - * - * @var string - */ - protected $billingAddress = '#order-billing_address'; - - /** - * Payment block selector. - * - * @var string - */ - protected $payment = '#order-billing_method'; - - /** - * Shipping block selector. - * - * @var string - */ - protected $shipping = '#order-shipping_method'; - - /** - * 'Submit Order' button. - * - * @var string - */ - protected $submitOrder = '.order-totals-bottom button'; - - /** - * Coupons block selector. - * - * @var string - */ - protected $coupons = '#order-coupons'; - - /** - * Getter for order selected products grid. - * - * @return Items - */ - public function getItemsBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Sales\Order\Create\Items', - ['element' => $this->_rootElement->find($this->itemsBlock)] - ); - } - - /** - * Get backend abstract block. - * - * @return Template - */ - public function getTemplateBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Template', - ['element' => $this->_rootElement->find($this->templateBlock, Locator::SELECTOR_XPATH)] - ); - } - - /** - * Get products search block. - * - * @return Search - */ - public function getSearchBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Sales\Order\Create\Search', - ['element' => $this->_rootElement->find($this->searchGrid)] - ); - } - - /** - * Get Billing address block. - * - * @return Address - */ - public function getBillingAddressForm() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Sales\Order\Create\Billing\Address', - ['element' => $this->_rootElement->find($this->billingAddress)] - ); - } - - /** - * Get payment block. - * - * @return Payment - */ - public function getPaymentBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Sales\Order\Create\Payment', - ['element' => $this->_rootElement->find($this->payment)] - ); - } - - /** - * Get shipping block. - * - * @return Shipping - */ - public function getShippingBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Sales\Order\Create\Shipping', - ['element' => $this->_rootElement->find($this->shipping)] - ); - } - - /** - * Click 'Submit Order' button. - * - * @return void - */ - public function submitOrder() - { - $this->_rootElement->find($this->submitOrder)->click(); - } - - /** - * Get coupons block. - * - * @return Coupons - */ - public function getCouponsBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Sales\Order\Create\Coupons', - ['element' => $this->_rootElement->find($this->coupons)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Billing/Address.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Billing/Address.php deleted file mode 100644 index a6260230089..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Billing/Address.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Create\Billing; - -use Magento\Mtf\Block\Form; - -/** - * Adminhtml sales order billing address form. - */ -class Address extends Form -{ - /** - * Existed addresses selector. - * - * @var string - */ - protected $existedAddresses = '#order-billing_address_customer_address_id'; - - /** - * Get existing addresses. - * - * @return string - */ - public function getExistingAddresses() - { - return explode("\n", $this->_rootElement->find($this->existedAddresses)->getText()); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Billing/Address.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Billing/Address.xml deleted file mode 100644 index b2d80c29df0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Billing/Address.xml +++ /dev/null @@ -1,39 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<mapping strict="0"> - <wrapper>order[billing_address]</wrapper> - <fields> - <firstname /> - <lastname /> - <company /> - <street> - <selector>[name='order[billing_address][street][0]']</selector> - </street> - <city /> - <country_id> - <input>select</input> - </country_id> - <region_id> - <input>select</input> - </region_id> - <postcode /> - <telephone /> - <save_in_address_book> - <input>checkbox</input> - </save_in_address_book> - </fields> -</mapping> diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Coupons.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Coupons.php deleted file mode 100644 index 05d3ae16cbc..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Coupons.php +++ /dev/null @@ -1,67 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Create; - -use Mage\SalesRule\Test\Fixture\SalesRule; -use Magento\Mtf\Block\Form; -use Magento\Mtf\Client\Locator; -use Mage\Adminhtml\Test\Block\Template; - -/** - * Adminhtml sales order coupons block. - */ -class Coupons extends Form -{ - /** - * Backend abstract block. - * - * @var string - */ - protected $templateBlock = './ancestor::body'; - - /** - * Click apply button selector. - * - * @var string - */ - protected $applyButton = '//*[@id="coupons:code"]/following-sibling::button'; - - /** - * Get backend abstract block. - * - * @return Template - */ - public function getTemplateBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Template', - ['element' => $this->_rootElement->find($this->templateBlock, Locator::SELECTOR_XPATH)] - ); - } - - /** - * Apply Sales rule coupon. - * - * @param SalesRule $salesRule - * @return void - */ - public function applyCouponsCode(SalesRule $salesRule) - { - parent::fill($salesRule); - $this->_rootElement->find($this->applyButton, Locator::SELECTOR_XPATH)->click(); - $this->getTemplateBlock()->waitLoader(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Coupons.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Coupons.xml deleted file mode 100644 index 5328af1fac8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Coupons.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<mapping strict="1"> - <fields> - <coupon_code> - <selector>input[name="coupon_code"]</selector> - </coupon_code> - </fields> -</mapping> diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/CustomerActivities.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/CustomerActivities.php deleted file mode 100644 index 7a1ed95a6ff..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/CustomerActivities.php +++ /dev/null @@ -1,85 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Create; - -use Mage\Adminhtml\Test\Block\Template; -use Mage\Adminhtml\Test\Block\Sales\Order\Create\CustomerActivities\Sidebar\ShoppingCartItems; -use Magento\Mtf\Block\Block; -use Magento\Mtf\Client\Locator; - -/** - * Customer's Activities block - */ -class CustomerActivities extends Block -{ - /** - * 'Update Changes' button. - * - * @var string - */ - protected $updateChanges = '[onclick^="order.sidebarApplyChanges"]'; - - /** - * Shopping cart sidebar selector. - * - * @var string - */ - protected $shoppingCartSidebar = '#order-sidebar_cart'; - - /** - * Backend abstract block. - * - * @var string - */ - protected $templateBlock = './ancestor::body'; - - /** - * Get shopping Cart items block. - * - * @return ShoppingCartItems - */ - public function getShoppingCartItemsBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Sales\Order\Create\CustomerActivities\Sidebar\ShoppingCartItems', - ['element' => $this->_rootElement->find($this->shoppingCartSidebar)] - ); - } - - /** - * Get backend abstract block. - * - * @return Template - */ - public function getTemplateBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Template', - ['element' => $this->_rootElement->find($this->templateBlock, Locator::SELECTOR_XPATH)] - ); - } - - /** - * Click 'Update Changes' button. - * - * @return void - */ - public function updateChanges() - { - $this->_rootElement->find($this->updateChanges)->click(); - $this->getTemplateBlock()->waitLoader(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/CustomerActivities/Sidebar.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/CustomerActivities/Sidebar.php deleted file mode 100644 index cce81937b58..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/CustomerActivities/Sidebar.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Create\CustomerActivities; - -use Magento\Mtf\Block\Block; -use Magento\Mtf\Client\Locator; - -/** - * Sidebar block. - */ -abstract class Sidebar extends Block -{ - /** - * 'Add to order' checkbox. - * - * @var string - */ - protected $addToOrder = '//tr[td[.="%s"]]//input[contains(@name,"add")]'; - - /** - * Add product to order. - * - * @param array $products - * @return void - */ - public function addToOrder(array $products) - { - foreach ($products as $product) { - $this->_rootElement - ->find(sprintf($this->addToOrder, $product->getName()), Locator::SELECTOR_XPATH, 'checkbox') - ->setValue('Yes'); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/CustomerActivities/Sidebar/ShoppingCartItems.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/CustomerActivities/Sidebar/ShoppingCartItems.php deleted file mode 100644 index 1a0a3199bfd..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/CustomerActivities/Sidebar/ShoppingCartItems.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Create\CustomerActivities\Sidebar; - -use Mage\Adminhtml\Test\Block\Sales\Order\Create\CustomerActivities\Sidebar; - -/** - * Shopping cart items block. - */ -class ShoppingCartItems extends Sidebar -{ - // -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/CustomerGrid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/CustomerGrid.php deleted file mode 100644 index 4336dde756d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/CustomerGrid.php +++ /dev/null @@ -1,66 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Create; - -use Mage\Adminhtml\Test\Block\Widget\Grid; -use Mage\Customer\Test\Fixture\Customer; - -/** - * Customer selection grid. - */ -class CustomerGrid extends Grid -{ - /** - * Selector for 'Create New Customer' button. - * - * @var string - */ - protected $createNewCustomer = '.add'; - - /** - * Locator value for link in action column. - * - * @var string - */ - protected $editLink = 'td'; - - /** - * Filters array mapping. - * - * @var array - */ - protected $filters = [ - 'email' => [ - 'selector' => '#sales_order_create_customer_grid_filter_email', - ], - ]; - - /** - * Select customer if it is specified or click create new customer button. - * - * @param Customer $customer - * @return void - */ - public function selectCustomer(Customer $customer) - { - if ($customer === null) { - $this->_rootElement->find($this->createNewCustomer)->click(); - } else { - $this->searchAndOpen(['email' => $customer->getEmail()]); - } - $this->getTemplateBlock()->waitLoader(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Items.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Items.php deleted file mode 100644 index 56037046a5d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Items.php +++ /dev/null @@ -1,167 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Create; - -use Magento\Mtf\Block\Block; -use Magento\Mtf\Client\Locator; -use Magento\Mtf\Fixture\InjectableFixture; -use Mage\Adminhtml\Test\Block\Sales\Order\Create\Items\ItemProduct; -use Mage\Adminhtml\Test\Block\Template; - -/** - * Adminhtml sales order create items block. - */ -class Items extends Block -{ - /** - * Item block selector. - * - * @var string - */ - protected $itemProduct = '//tbody/tr[td[contains(.,"%s")]]'; - - /** - * 'Add Products' button. - * - * @var string - */ - protected $addProducts = "//button[span='Add Products']"; - - /** - * 'Add Products By Sku' button. - * - * @var string - */ - protected $addProductsBySku = "//button[span='Add Products By SKU']"; - - /** - * 'Update Item's and Qty' button selector. - * - * @var string - */ - protected $updateProducts = '[onclick="order.itemsUpdate()"]'; - - /** - * Backend abstract block. - * - * @var string - */ - protected $templateBlock = './ancestor::body'; - - /** - * Product names. - * - * @var string - */ - protected $productNames = 'tbody tr td.first span'; - - /** - * Empty block selector. - * - * @var string - */ - protected $emptyBlock = '.empty-text'; - - /** - * Click 'Add Products' button. - * - * @return void - */ - public function clickAddProducts() - { - $this->_rootElement->find($this->addProducts, Locator::SELECTOR_XPATH)->click(); - } - - /** - * Update product data in sales. - * - * @param array $products - * @return void - */ - public function updateProductsData(array $products) - { - foreach ($products as $product) { - $this->getItemProduct($product->getName())->fillProductOptions($product->getCheckoutData()); - } - $this->_rootElement->find($this->updateProducts)->click(); - $this->getTemplateBlock()->waitLoader(); - } - - /** - * Get products data by fields from items ordered grid. - * - * @param array $fields - * @return array - */ - public function getProductsDataByFields($fields) - { - $this->getTemplateBlock()->waitLoader(); - $productsNames = $this->_rootElement->getElements($this->productNames); - $pageData = []; - foreach ($productsNames as $productName) { - $pageData[] = $this->getItemProduct($productName->getText())->getCheckoutData($fields); - } - - return $pageData; - } - - /** - * Get item product block. - * - * @param string $productName - * @return ItemProduct - */ - public function getItemProduct($productName) - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Sales\Order\Create\Items\ItemProduct', - ['element' => $this->_rootElement->find(sprintf($this->itemProduct, $productName), Locator::SELECTOR_XPATH)] - ); - } - - /** - * Get backend abstract block. - * - * @return Template - */ - public function getTemplateBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Template', - ['element' => $this->_rootElement->find($this->templateBlock, Locator::SELECTOR_XPATH)] - ); - } - - /** - * Check that empty block is visible. - * - * @return bool - */ - public function isEmptyBlockVisible() - { - return $this->_rootElement->find($this->emptyBlock)->isVisible(); - } - - /** - * Click 'Add Products By SKU' button. - * - * @return void - */ - public function clickAddProductsBySku() - { - $this->_rootElement->find($this->addProductsBySku, Locator::SELECTOR_XPATH)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Items/ItemProduct.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Items/ItemProduct.php deleted file mode 100644 index 1dfd2ea67ab..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Items/ItemProduct.php +++ /dev/null @@ -1,113 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Create\Items; - -use Magento\Mtf\Block\Form; - -/** - * Item product block. - */ -class ItemProduct extends Form -{ - /** - * Actions for fields. - * - * @var array - */ - protected $actions = [ - 'name' => 'getText', - 'price' => 'getText', - 'qty' => 'getValue', - 'checkout_data' => 'getValue', - ]; - - /** - * Error message selector. - * - * @var string - */ - protected $errorMessage = ".error"; - - /** - * Notice message selector. - * - * @var string - */ - protected $noticeMessage = ".notice"; - - /** - * Fill product options. - * - * @param array $options - */ - public function fillProductOptions(array $options) - { - if (isset($options['cartItem'])) { - unset($options['cartItem']); - } - if (isset($options['options'])) { - unset($options['options']); - } - - $mapping = $this->dataMapping($options); - $this->_fill($mapping); - } - - /** - * Get data item products. - * - * @param array $fields - * @param string $currency [optional] - * @return array - */ - public function getCheckoutData(array $fields, $currency = '$') - { - $result = []; - $data = $this->dataMapping($fields); - foreach ($data as $key => $item) { - if (!isset($item['value'])) { - $result[$key] = $this->getCheckoutData($item); - continue; - } - $value = $this->_rootElement->find($item['selector'], $item['strategy'], $item['input']) - ->{$this->actions[$key]}(); - - $result[$key] = str_replace($currency, '', trim($value)); - } - - return $result; - } - - /** - * Get error message. - * - * @return string - */ - public function getErrorMessage() - { - return $this->_rootElement->find($this->errorMessage)->getText(); - } - - /** - * Get notice message. - * - * @return string - */ - public function getNoticeMessage() - { - return $this->_rootElement->find($this->noticeMessage)->getText(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Items/ItemProduct.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Items/ItemProduct.xml deleted file mode 100644 index 159beb61b1e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Items/ItemProduct.xml +++ /dev/null @@ -1,41 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<mapping strict="0"> - <fields> - <name> - <selector>h5.title span</selector> - </name> - <price> - <selector>//td[@class="price"][1]/span</selector> - <strategy>xpath</strategy> - </price> - <qty> - <selector>.item-qty</selector> - </qty> - <checkout_data composite="1"> - <custom_price> - <selector>//td[@class="price"][1]/input</selector> - <strategy>xpath</strategy> - </custom_price> - <use_custom_price> - <selector>//td[@class="price"][1]/div/input[@type="checkbox"]</selector> - <strategy>xpath</strategy> - <input>checkbox</input> - </use_custom_price> - </checkout_data> - </fields> -</mapping> diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Payment.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Payment.php deleted file mode 100644 index d191ea6b60d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Payment.php +++ /dev/null @@ -1,72 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Create; - -use Magento\Mtf\Block\Block; -use Mage\Adminhtml\Test\Block\Template; -use Magento\Mtf\Client\Locator; - -/** - * Adminhtml sales order payment block. - */ -class Payment extends Block -{ - /** - * Payment method. - * - * @var string - */ - protected $paymentMethod = '#p_method_%s'; - - /** - * Backend abstract block. - * - * @var string - */ - protected $templateBlock = './ancestor::body'; - - /** - * Select payment method. - * - * @param array $paymentCode - * @throws \Exception - */ - public function selectPaymentMethod(array $paymentCode) - { - $paymentInput = $this->_rootElement->find(sprintf($this->paymentMethod, $paymentCode['method'])); - if ($paymentInput->isPresent()) { - if ($paymentInput->isVisible()) { - $paymentInput->click(); - } - $this->getTemplateBlock()->waitLoader(); - } else { - throw new \Exception("{$paymentCode['method']} method is not visible."); - } - } - - /** - * Get backend abstract block. - * - * @return Template - */ - public function getTemplateBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Template', - ['element' => $this->_rootElement->find($this->templateBlock, Locator::SELECTOR_XPATH)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Search.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Search.php deleted file mode 100644 index e067f03714c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Search.php +++ /dev/null @@ -1,62 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Create; - -use Magento\Mtf\Block\Block; -use Mage\Adminhtml\Test\Block\Sales\Order\Create\Search\Grid; - -/** - * Adminhtml sales order create search items block. - */ -class Search extends Block -{ - /** - * Search products grid selector. - * - * @var string - */ - protected $gridSelector = '#sales_order_create_search_grid'; - - /** - * 'Add Selected Product(s) to Order' button. - * - * @var string - */ - protected $addSelectedProducts = 'button[onclick="order.productGridAddSelected()"]'; - - /** - * Click "Add Selected Product(s) to Order" button. - * - * @return void - */ - public function addSelectedProductsToOrder() - { - $this->_rootElement->find($this->addSelectedProducts)->click(); - } - - /** - * Get search products grid. - * - * @return Grid - */ - public function getSearchGrid() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Sales\Order\Create\Search\Grid', - ['element' => $this->_rootElement->find($this->gridSelector)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Search/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Search/Grid.php deleted file mode 100644 index 603d58927ed..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Search/Grid.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Create\Search; - -/** - * Adminhtml sales order create search items grid. - */ -class Grid extends \Mage\Adminhtml\Test\Block\Widget\Grid -{ - /** - * An element locator which allows to select entities in grid. - * - * @var string - */ - protected $selectItem = '#sales_order_create_search_grid_table tbody tr'; - - /** - * Filters array mapping. - * - * @var array - */ - protected $filters = [ - 'sku' => [ - 'selector' => '#sales_order_create_search_grid_filter_sku', - ], - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Shipping.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Shipping.php deleted file mode 100644 index 003bbd741c0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Shipping.php +++ /dev/null @@ -1,74 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Create; - -use Magento\Mtf\Block\Block; -use Magento\Mtf\Client\Locator; -use Mage\Adminhtml\Test\Block\Template; - -/** - * Adminhtml sales order shipping block. - */ -class Shipping extends Block -{ - /** - * 'Get shipping methods and rates' link. - * - * @var string - */ - protected $shippingMethodsLink = '#order-shipping-method-summary a'; - - /** - * Shipping method selector. - * - * @var string - */ - protected $shippingMethod = '//dt[contains(.,"%s")]/following-sibling::*//*[contains(text(), "%s")]'; - - /** - * Backend abstract block. - * - * @var string - */ - protected $templateBlock = './ancestor::body'; - - /** - * Select shipping method. - * - * @param array $method - * @return void - */ - public function selectShippingMethod(array $method) - { - $this->_rootElement->find($this->shippingMethodsLink)->click(); - $selector = sprintf($this->shippingMethod, $method['shipping_service'], $method['shipping_method']); - $this->_rootElement->find($selector, Locator::SELECTOR_XPATH)->click(); - $this->getTemplateBlock()->waitLoader(); - } - - /** - * Get backend abstract block. - * - * @return Template - */ - public function getTemplateBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Template', - ['element' => $this->_rootElement->find($this->templateBlock, Locator::SELECTOR_XPATH)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Store.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Store.php deleted file mode 100644 index a15812ae788..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Store.php +++ /dev/null @@ -1,71 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Create; - -use Mage\Adminhtml\Test\Fixture\Store as StoreFixture; -use Magento\Mtf\Block\Block; -use Magento\Mtf\Client\Locator; -use Mage\Adminhtml\Test\Block\Template; - -/** - * Adminhtml sales order create select store block. - */ -class Store extends Block -{ - /** - * Backend abstract block. - * - * @var string - */ - protected $templateBlock = './ancestor::body'; - - /** - * Selector for store label. - * - * @var string - */ - protected $storeLabel = '//label[text()="%s"]/preceding-sibling::*'; - - /** - * Get backend abstract block. - * - * @return Template - */ - protected function getTemplateBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Template', - ['element' => $this->_rootElement->find($this->templateBlock, Locator::SELECTOR_XPATH)] - ); - } - - /** - * Select store view for order based on Order fixture. - * - * @param StoreFixture|null $store - * @return void - */ - public function selectStoreView(StoreFixture $store = null) - { - if (!$this->isVisible()) { - return; - } - $storeName = $store == null ? 'Default Store View' : $store->getName(); - $selector = sprintf($this->storeLabel, $storeName); - $this->_rootElement->find($selector, Locator::SELECTOR_XPATH, 'checkbox')->setValue('Yes'); - $this->getTemplateBlock()->waitLoader(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Creditmemo/Form.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Creditmemo/Form.php deleted file mode 100644 index 6b9429fae96..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Creditmemo/Form.php +++ /dev/null @@ -1,107 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Creditmemo; - -use Mage\Adminhtml\Test\Block\Sales\Order\AbstractForm; - -/** - * Credit memo create form. - */ -class Form extends AbstractForm -{ - /** - * Items block css selector. - * - * @var string - */ - protected $items = '#creditmemo_item_container'; - - /** - * Item block class. - * - * @var string - */ - protected $itemBlockClass = 'Mage\Adminhtml\Test\Block\Sales\Order\Creditmemo\Form\Items'; - - /** - * Online refund button. - * - * @var string - */ - protected $onlineRefund = '[onclick*="submitCreditMemo()"]'; - - /** - * Offline refund button. - * - * @var string - */ - protected $offlineRefund = '[onclick*="submitCreditMemoOffline()"]'; - - /** - * Fill items data. - * - * @param array $data - * @param array $products - * @return void - */ - protected function fillItemsData(array $data, array $products) - { - parent::fillItemsData($data, $products); - $this->updateQty(); - } - - /** - * Online refund. - * - * @return void - */ - public function onlineRefund() - { - $this->waitUntilRefundButtonVisible('online'); - $this->_rootElement->find($this->onlineRefund)->click(); - } - - /** - * Offline refund. - * - * @return void - */ - public function offlineRefund() - { - $this->waitUntilRefundButtonVisible('offline'); - $this->_rootElement->find($this->offlineRefund)->click(); - } - - /** - * Wait until refund button is visible. - * - * @param string $refundType - * @return void - */ - protected function waitUntilRefundButtonVisible($refundType) - { - $this->getTemplateBlock()->waitLoader(); - $browser = $this->browser; - $button = $refundType . "Refund"; - $selector = $this->$button . $this->disabledFlag; - $browser->waitUntil( - function () use ($browser, $selector) { - $element = $browser->find($selector); - return $element->isVisible() == false ? true : null; - } - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Creditmemo/Form.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Creditmemo/Form.xml deleted file mode 100644 index 20f445f32f1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Creditmemo/Form.xml +++ /dev/null @@ -1,36 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<mapping strict="0"> - <wrapper>creditmemo</wrapper> - <fields> - <comment_text /> - <shipping_amount /> - <adjustment_positive /> - <adjustment_negative /> - <comment_customer_notify> - <input>checkbox</input> - </comment_customer_notify> - <send_email> - <input>checkbox</input> - </send_email> - <refund_customerbalance_return_enable> - <selector>#creditmemo_customerbalance_return_enable</selector> - <input>checkbox</input> - </refund_customerbalance_return_enable> - <refund_customerbalance_return /> - </fields> -</mapping> diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Creditmemo/Form/Items.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Creditmemo/Form/Items.php deleted file mode 100644 index 5d991a8ee16..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Creditmemo/Form/Items.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Creditmemo\Form; - -use Mage\Adminhtml\Test\Block\Sales\Order\AbstractItemsNewBlock; - -/** - * Credit Memo Items block on Credit Memo new page. - */ -class Items extends AbstractItemsNewBlock -{ - /** - * Item block class. - * - * @var string - */ - protected $classItemBlock = 'Mage\Adminhtml\Test\Block\Sales\Order\Creditmemo\Form\Items\Product'; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Creditmemo/Form/Items/Product.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Creditmemo/Form/Items/Product.php deleted file mode 100644 index 14e65f0c7d6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Creditmemo/Form/Items/Product.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Creditmemo\Form\Items; - -use Mage\Adminhtml\Test\Block\Sales\Order\AbstractForm\ProductForm; - -/** - * Item product form on credit memo items block. - */ -class Product extends ProductForm -{ - // -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Creditmemo/Form/Items/Product.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Creditmemo/Form/Items/Product.xml deleted file mode 100644 index b62d39f0730..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Creditmemo/Form/Items/Product.xml +++ /dev/null @@ -1,27 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<mapping strict="0"> - <fields> - <qty> - <selector>[name$="[qty]"]</selector> - </qty> - <back_to_stock> - <selector>[name$="[back_to_stock]"]</selector> - <input>checkbox</input> - </back_to_stock> - </fields> -</mapping> diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Creditmemo/Totals.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Creditmemo/Totals.php deleted file mode 100644 index 8065cedea28..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Creditmemo/Totals.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Creditmemo; - -/** - * Invoice totals block. - */ -class Totals extends \Mage\Adminhtml\Test\Block\Sales\Order\Totals -{ - // -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Grid.php deleted file mode 100644 index e45762dcc31..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Grid.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order; - -/** - * Sales order grid. - */ -class Grid extends \Mage\Adminhtml\Test\Block\Widget\Grid -{ - /** - * Order Id td selector. - * - * @var string - */ - protected $editLink = 'a[data-column="action"]'; - - /** - * First row selector. - * - * @var string - */ - protected $firstRowSelector = '//tr[./td[contains(@class,"last")]][1]//a'; - - /** - * Filters array mapping. - * - * @var array - */ - protected $filters = [ - 'id' => [ - 'selector' => 'input[name="real_order_id"]', - ], - 'status' => [ - 'selector' => 'select[name="status"]', - 'input' => 'select', - ], - 'purchased_from' => [ - 'selector' => 'select[name="store_id"]', - 'input' => 'select', - ], - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Invoice/Form.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Invoice/Form.php deleted file mode 100644 index 01f4550f8ec..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Invoice/Form.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Invoice; - -use Mage\Adminhtml\Test\Block\Sales\Order\AbstractForm; - -/** - * Invoice create form. - */ -class Form extends AbstractForm -{ - /** - * Items block css selector. - * - * @var string - */ - protected $items = '#invoice_item_container'; - - /** - * Item block class. - * - * @var string - */ - protected $itemBlockClass = 'Mage\Adminhtml\Test\Block\Sales\Order\Invoice\Form\Items'; - - /** - * Fill items data. - * - * @param array $data - * @param array $products - * @return void - */ - protected function fillItemsData(array $data, array $products) - { - parent::fillItemsData($data, $products); - $this->updateQty(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Invoice/Form.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Invoice/Form.xml deleted file mode 100644 index 0066348f830..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Invoice/Form.xml +++ /dev/null @@ -1,34 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<mapping strict="0"> - <wrapper>invoice</wrapper> - <fields> - <comment_text /> - <do_shipment> - <input>checkbox</input> - </do_shipment> - <capture_case> - <input>select</input> - </capture_case> - <send_email> - <input>checkbox</input> - </send_email> - <comment_customer_notify> - <input>checkbox</input> - </comment_customer_notify> - </fields> -</mapping> diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Invoice/Form/Items.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Invoice/Form/Items.php deleted file mode 100644 index 6b8fd84f8bf..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Invoice/Form/Items.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Invoice\Form; - -use Mage\Adminhtml\Test\Block\Sales\Order\AbstractItemsNewBlock; - -/** - * Block for items to invoice on new invoice page. - */ -class Items extends AbstractItemsNewBlock -{ - /** - * Item block class. - * - * @var string - */ - protected $classItemBlock = 'Mage\Adminhtml\Test\Block\Sales\Order\Invoice\Form\Items\Product'; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Invoice/Form/Items/Product.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Invoice/Form/Items/Product.php deleted file mode 100644 index e5959b16999..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Invoice/Form/Items/Product.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Invoice\Form\Items; - -use Mage\Adminhtml\Test\Block\Sales\Order\AbstractForm\ProductForm; - -/** - * Item product block on invoice items block. - */ -class Product extends ProductForm -{ - // -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Invoice/Form/Items/Product.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Invoice/Form/Items/Product.xml deleted file mode 100644 index 1ca6c2a1c55..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Invoice/Form/Items/Product.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<mapping strict="0"> - <fields> - <qty> - <selector>input.qty-input</selector> - </qty> - </fields> -</mapping> diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Invoice/Totals.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Invoice/Totals.php deleted file mode 100644 index 2e2a06b0708..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Invoice/Totals.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Invoice; - -/** - * Invoice totals block. - */ -class Totals extends \Mage\Adminhtml\Test\Block\Sales\Order\Totals -{ - // -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form.php deleted file mode 100644 index 51ce9c7931e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form.php +++ /dev/null @@ -1,75 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Shipment; - -use Mage\Adminhtml\Test\Block\Sales\Order\AbstractForm; -use Mage\Adminhtml\Test\Block\Sales\Order\Shipment\Form\Tracking; - -/** - * Shipment create form. - */ -class Form extends AbstractForm -{ - /** - * Items block css selector. - * - * @var string - */ - protected $items = '#ship_items_container'; - - /** - * Item block class. - * - * @var string - */ - protected $itemBlockClass = 'Mage\Adminhtml\Test\Block\Sales\Order\Shipment\Form\Items'; - - /** - * Tracking block css selector. - * - * @var string - */ - protected $tracking = '#tracking_numbers_table'; - - /** - * Get tracking block. - * - * @return Tracking - */ - protected function getTrackingBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Sales\Order\Shipment\Form\Tracking', - ['element' => $this->_rootElement->find($this->tracking)] - ); - } - - /** - * Fill form data. - * - * @param array $data - * @param array|null $products - * @return void - */ - public function fillData(array $data, $products = null) - { - if (isset($data['form_data']['tracking'])) { - $this->getTrackingBlock()->fill($data['form_data']['tracking']); - unset($data['form_data']['tracking']); - } - parent::fillData($data, $products); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form.xml deleted file mode 100644 index b7e8f952ad8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form.xml +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<mapping strict="0"> - <wrapper>shipment</wrapper> - <fields> - <comment_text /> - <comment_customer_notify> - <input>checkbox</input> - </comment_customer_notify> - <send_email> - <input>checkbox</input> - </send_email> - </fields> -</mapping> diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form/Items.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form/Items.php deleted file mode 100644 index 7dd07b0945f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form/Items.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Shipment\Form; - -use Mage\Adminhtml\Test\Block\Sales\Order\AbstractItemsNewBlock; - -/** - * Block for items to shipment on new shipment page. - */ -class Items extends AbstractItemsNewBlock -{ - /** - * Item block class. - * - * @var string - */ - protected $classItemBlock = 'Mage\Adminhtml\Test\Block\Sales\Order\Shipment\Form\Items\Product'; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form/Items/Product.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form/Items/Product.php deleted file mode 100644 index 022d5c355d5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form/Items/Product.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Shipment\Form\Items; - -use Mage\Adminhtml\Test\Block\Sales\Order\AbstractForm\ProductForm; - -/** - * Item product block on invoice items block. - */ -class Product extends ProductForm -{ - // -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form/Items/Product.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form/Items/Product.xml deleted file mode 100644 index f6a93d47f18..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form/Items/Product.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<mapping strict="0"> - <fields> - <qty> - <selector>input.qty-item</selector> - </qty> - </fields> -</mapping> diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form/Tracking.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form/Tracking.php deleted file mode 100644 index f2cde88ea43..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form/Tracking.php +++ /dev/null @@ -1,70 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Shipment\Form; - -use Mage\Adminhtml\Test\Block\Sales\Order\Shipment\Form\Tracking\Item; -use Magento\Mtf\Block\Block; -use Magento\Mtf\Client\Locator; - -/** - * Tracking to ship block. - */ -class Tracking extends Block -{ - /** - * Add tracking button. - * - * @var string - */ - protected $addTracking = '[onclick*="trackingControl.add"]'; - - /** - * Item tracking block. - * - * @var string - */ - protected $itemTracking = './/tbody/tr[not(contains(@class,"no-display"))][%d]'; - - /** - * Get tracking block. - * - * @param int $index - * @return Item - */ - protected function getItemTrackingBlock($index) - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Sales\Order\Shipment\Form\Tracking\Item', - ['element' => $this->_rootElement->find(sprintf($this->itemTracking, $index), Locator::SELECTOR_XPATH)] - ); - } - - /** - * Fill tracking. - * - * @param array $data - * @return void - */ - public function fill(array $data) - { - foreach ($data as $key => $value) { - if (!$this->getItemTrackingBlock(++$key)->isVisible()) { - $this->_rootElement->find($this->addTracking)->click(); - } - $this->getItemTrackingBlock($key)->fillRow($value); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form/Tracking/Item.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form/Tracking/Item.php deleted file mode 100644 index 66702ec6da0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form/Tracking/Item.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Shipment\Form\Tracking; - -use Magento\Mtf\Block\Form; - -/** - * Item tracking to ship block. - */ -class Item extends Form -{ - /** - * Fill item tracking. - * - * @param array $fields - * @return void - */ - public function fillRow(array $fields) - { - $mapping = $this->dataMapping($fields); - $this->_fill($mapping); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form/Tracking/Item.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form/Tracking/Item.xml deleted file mode 100644 index 277305aa669..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form/Tracking/Item.xml +++ /dev/null @@ -1,30 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<mapping strict="0"> - <fields> - <carrier_code> - <selector>[name$='[carrier_code]']</selector> - <input>select</input> - </carrier_code> - <title> - <selector>[name$='[title]']</selector> - - - [name$='[number]'] - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Title.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Title.php deleted file mode 100644 index a8094831819..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Title.php +++ /dev/null @@ -1,41 +0,0 @@ -_rootElement->find($this->title)->getText(), $matches); - return isset($matches[1]) ? $matches[1] : null; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Totals.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Totals.php deleted file mode 100644 index 732093fa1b7..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Totals.php +++ /dev/null @@ -1,45 +0,0 @@ -fieldType[$type]['selector']); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/View/AbstractGridTab.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/View/AbstractGridTab.php deleted file mode 100644 index 52fb0c4fdf6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/View/AbstractGridTab.php +++ /dev/null @@ -1,52 +0,0 @@ -blockFactory->create( - $this->gridClass, - ['element' => $this->_rootElement->find($this->gridSelector)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/View/Form.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/View/Form.php deleted file mode 100644 index 8725e4b3f2c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/View/Form.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - Mage\Adminhtml\Test\Block\Sales\Order\View\Tab\Info - #sales_order_view_tabs_order_info - css selector - - - Mage\Adminhtml\Test\Block\Sales\Order\View\Tab\Invoices - #sales_order_view_tabs_order_invoices - css selector - - - Mage\Adminhtml\Test\Block\Sales\Order\View\Tab\Shipments - #sales_order_view_tabs_order_shipments - css selector - - - Mage\Adminhtml\Test\Block\Sales\Order\View\Tab\Transactions - #sales_order_view_tabs_order_transactions - css selector - - - Mage\Adminhtml\Test\Block\Sales\Order\View\Tab\CreditMemos - #sales_order_view_tabs_order_creditmemos - css selector - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/View/Items.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/View/Items.php deleted file mode 100644 index a7292e01621..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/View/Items.php +++ /dev/null @@ -1,71 +0,0 @@ -getName(); - - if ($product instanceof ConfigurableProduct) { - // Find the price for the specific configurable product that was purchased - $configurableAttributes = $product->getConfigurableAttributes(); - $productOptions = $product->getCheckoutData()['options']['configurable_options']; - $checkoutOption = reset($productOptions); - $attributeKey = $checkoutOption['title']; - $optionKey = $checkoutOption['value']; - $attributeValue = $configurableAttributes[$attributeKey]['label']['value']; - $optionValue = $configurableAttributes[$attributeKey][$optionKey]['option_label']['value']; - - $productDisplay = $productName . ' SKU: ' . $product->getVariationSku($checkoutOption); - $productDisplay .= ' ' . $attributeValue . ' ' . $optionValue; - } else { - $productDisplay = $productName . ' SKU: ' . $product->getSku(); - } - $selector = '//tr[normalize-space(td)="' . $productDisplay . '"]' . $this->priceSelector; - - return $this->_rootElement->find($selector, Locator::SELECTOR_XPATH)->getText(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/View/Items/Product.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/View/Items/Product.php deleted file mode 100644 index 424eda78893..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/View/Items/Product.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - [name$="[qty]"] - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/View/Tab/CreditMemos.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/View/Tab/CreditMemos.php deleted file mode 100644 index 9b32ce46e14..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/View/Tab/CreditMemos.php +++ /dev/null @@ -1,38 +0,0 @@ -blockFactory->create( - 'Mage\Adminhtml\Test\Block\Sales\Order\View\Tab\Info', - ['element' => $this->_rootElement->find($this->orderInfoBlock)] - ); - } - - /** - * Get order totals block. - * - * @return Totals - */ - public function getOrderTotalsBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Sales\Order\Totals', - ['element' => $this->_rootElement->find($this->orderTotalsBlock)] - ); - } - - /** - * Get order status from info block. - * - * @return string - */ - public function getOrderStatus() - { - return $this->_rootElement->find($this->orderStatus)->getText(); - } - - /** - * Get comments block. - * - * @return Comments - */ - public function getCommentsBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Sales\Order\Comments', - ['element' => $this->_rootElement->find($this->commentsBlock)] - ); - } - - /** - * Get billing address block. - * - * @return Address - */ - public function getBillingAddressBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Sales\Order\Address', - ['element' => $this->_rootElement->find($this->billingAddressBlock, Locator::SELECTOR_XPATH)] - ); - } - - /** - * Get shipping address block. - * - * @return Address - */ - public function getShippingAddressBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Sales\Order\Address', - ['element' => $this->_rootElement->find($this->shippingAddressBlock, Locator::SELECTOR_XPATH)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/View/Tab/Invoices.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/View/Tab/Invoices.php deleted file mode 100644 index 58af3be9a10..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/View/Tab/Invoices.php +++ /dev/null @@ -1,38 +0,0 @@ - [ - 'selector' => 'input[name="increment_id"]' - ], - 'total_qty_from' => [ - 'selector' => 'input[name="total_qty[from]"]' - ], - 'total_qty_to' => [ - 'selector' => 'input[name="total_qty[to]"]' - ] - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Transactions/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Transactions/Grid.php deleted file mode 100644 index e7f1871b04d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Transactions/Grid.php +++ /dev/null @@ -1,39 +0,0 @@ - [ - 'selector' => 'input[name="increment_id"]', - ], - 'transaction_type' => [ - 'selector' => 'select[name="txn_type"]', - 'input' => 'select', - ], - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Shipping/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Shipping/Grid.php deleted file mode 100644 index d60649424d2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Shipping/Grid.php +++ /dev/null @@ -1,42 +0,0 @@ - [ - 'selector' => 'input[name="increment_id"]', - ], - 'order_id' => [ - 'selector' => 'input[name="order_increment_id"]', - ], - 'total_qty_from' => [ - 'selector' => 'input[name="total_qty[from]"]', - ], - 'total_qty_to' => [ - 'selector' => 'input[name="total_qty[to]"]', - ], - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Shipping/View/Items.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Shipping/View/Items.php deleted file mode 100644 index c1cec7a9659..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Shipping/View/Items.php +++ /dev/null @@ -1,31 +0,0 @@ - ['col_name' => 'Product'], - 'item_qty' => ['col_name' => 'Qty'] - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sitemap/Edit/Form.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sitemap/Edit/Form.php deleted file mode 100644 index f2af877dcda..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sitemap/Edit/Form.php +++ /dev/null @@ -1,61 +0,0 @@ -fillStoreView($sitemap); - return parent::fill($sitemap, $element); - } - - /** - * Fill store view field. - * - * @param Sitemap $sitemap - * @return void - */ - protected function fillStoreView(Sitemap $sitemap) - { - $storeViewField = $this->_rootElement->find($this->storeView, Locator::SELECTOR_CSS, 'selectstore'); - if ($storeViewField->isVisible() && !$sitemap->hasData('store_id')) { - $storeViewField->setValue('Main Website/Main Website Store/Default Store View'); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sitemap/Edit/FormPageActions.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sitemap/Edit/FormPageActions.php deleted file mode 100644 index 4f1fa1695b1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sitemap/Edit/FormPageActions.php +++ /dev/null @@ -1,39 +0,0 @@ -_rootElement->find($this->saveAndGenerateButton)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sitemap/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sitemap/Grid.php deleted file mode 100644 index 21ba6d3399b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sitemap/Grid.php +++ /dev/null @@ -1,58 +0,0 @@ - [ - 'selector' => '#sitemapGrid_filter_sitemap_filename', - ], - 'sitemap_path' => [ - 'selector' => '#sitemapGrid_filter_sitemap_path', - ], - 'sitemap_id' => [ - 'selector' => '#sitemapGrid_filter_sitemap_id', - ], - ]; - - /** - * Locator link for Google in grid. - * - * @var string - */ - protected $linkForGoogle = ".//td/a[contains(.,'.xml')]"; - - /** - * Get link for Google. - * - * @return string - */ - public function getLinkForGoogle() - { - return $this->_rootElement->find($this->linkForGoogle, Locator::SELECTOR_XPATH)->getText(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Config/Switcher.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Config/Switcher.php deleted file mode 100644 index 018b426665a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Config/Switcher.php +++ /dev/null @@ -1,43 +0,0 @@ -_rootElement->find(sprintf($this->storeViewSelector, $store->getCode()))->isVisible(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Currency/CurrencyGrid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Currency/CurrencyGrid.php deleted file mode 100644 index 33aecd533a8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Currency/CurrencyGrid.php +++ /dev/null @@ -1,41 +0,0 @@ -_rootElement->find($this->gbpRate, Locator::SELECTOR_XPATH)->setValue('0.7'); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Currency/GridPageActions.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Currency/GridPageActions.php deleted file mode 100644 index d828aa07930..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Currency/GridPageActions.php +++ /dev/null @@ -1,93 +0,0 @@ -_rootElement->find($this->importButton)->click(); - - //Wait message - $browser = $this->browser; - $selector = $this->message; - $browser->waitUntil( - function () use ($browser, $selector) { - $message = $browser->find($selector); - return $message->isVisible() ? true : null; - } - ); - if ($this->getMessageBlock()->isVisibleMessage('warning')) { - throw new \Exception($this->getMessageBlock()->getWarningMessages()); - } - } - - /** - * Get message block. - * - * @return Messages - */ - protected function getMessageBlock() - { - return $this->blockFactory->create( - 'Mage\Core\Test\Block\Messages', - ['element' => $this->_rootElement->find($this->message)] - ); - } - - /** - * Save Currency Rates. - * - * @return void - */ - public function saveCurrentRate() - { - $this->_rootElement->find($this->saveCurrentRate)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/CurrencySymbolForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/CurrencySymbolForm.php deleted file mode 100644 index f3149fb3a77..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/CurrencySymbolForm.php +++ /dev/null @@ -1,51 +0,0 @@ -_rootElement->find(sprintf($this->currencyRow, $fixture->getCode()), Locator::SELECTOR_XPATH); - $data = $fixture->getData(); - unset($data['code']); - $mapping = $this->dataMapping($data); - $this->_fill($mapping, $element); - return $this; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/CurrencySymbolForm.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/CurrencySymbolForm.xml deleted file mode 100644 index 7315ed107cc..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/CurrencySymbolForm.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - variable - - - [id^=custom_currency_symbol_inherit] - css selector - checkbox - - - [id^=custom_currency_symbol] - css selector - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/FormPageActions.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/FormPageActions.php deleted file mode 100644 index b19c50d49af..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/FormPageActions.php +++ /dev/null @@ -1,44 +0,0 @@ -_rootElement->find($this->saveButton); - if ($saveButton->isVisible()) { - $saveButton->click(); - } else { - $this->browser->find($this->headerFloating . ' ' . $this->saveButton)->click(); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Process/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Process/Grid.php deleted file mode 100644 index a440f02a45d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Process/Grid.php +++ /dev/null @@ -1,37 +0,0 @@ -_rootElement->find($this->selectAll)->click(); - $this->_rootElement->find($this->massactionSelect, Locator::SELECTOR_CSS, 'select')->setValue($actionType); - $this->massActionSubmit(false); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Delete/Form/GroupForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Delete/Form/GroupForm.php deleted file mode 100644 index c71809f7193..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Delete/Form/GroupForm.php +++ /dev/null @@ -1,36 +0,0 @@ -dataMapping(['create_backup' => 'No']); - $this->_fill($mapping); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Delete/Form/GroupForm.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Delete/Form/GroupForm.xml deleted file mode 100644 index 649c7e2acaa..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Delete/Form/GroupForm.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - select - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Delete/Form/StoreForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Delete/Form/StoreForm.php deleted file mode 100644 index 3f2f1abca7b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Delete/Form/StoreForm.php +++ /dev/null @@ -1,36 +0,0 @@ -dataMapping(['create_backup' => 'No']); - $this->_fill($mapping); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Delete/Form/StoreForm.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Delete/Form/StoreForm.xml deleted file mode 100644 index 649c7e2acaa..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Delete/Form/StoreForm.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - select - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Delete/Website.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Delete/Website.php deleted file mode 100644 index a4247d01cd5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Delete/Website.php +++ /dev/null @@ -1,60 +0,0 @@ -dataMapping(['create_backup' => 'No']); - $this->_fill($mapping); - $this->_rootElement->find($this->delete)->click(); - } - - /** - * Check whether element is visible - * - * @return bool - */ - public function isVisible() - { - return $this->_rootElement->find($this->buttonContainer)->isVisible(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Delete/Website.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Delete/Website.xml deleted file mode 100644 index 649c7e2acaa..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Delete/Website.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - select - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Edit/Form/GroupForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Edit/Form/GroupForm.php deleted file mode 100644 index 56f48d5040a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Edit/Form/GroupForm.php +++ /dev/null @@ -1,43 +0,0 @@ -_rootElement->find(sprintf($this->website, $websiteName), Locator::SELECTOR_XPATH)->isVisible(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Edit/Form/GroupForm.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Edit/Form/GroupForm.xml deleted file mode 100644 index 29145e36618..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Edit/Form/GroupForm.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - group - - - select - - - - select - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Edit/Form/StoreForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Edit/Form/StoreForm.php deleted file mode 100644 index 22ba91f4ef0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Edit/Form/StoreForm.php +++ /dev/null @@ -1,43 +0,0 @@ -_rootElement->find(sprintf($this->store, $name), Locator::SELECTOR_XPATH)->isVisible(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Edit/Form/StoreForm.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Edit/Form/StoreForm.xml deleted file mode 100644 index 23d65dd3f64..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Edit/Form/StoreForm.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - store - - - optgroupselect - - - - - select - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Edit/Form/WebsiteForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Edit/Form/WebsiteForm.php deleted file mode 100644 index e753fe9d8c3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Edit/Form/WebsiteForm.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - website - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/GridPageActions.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/GridPageActions.php deleted file mode 100644 index bb827561fa1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/GridPageActions.php +++ /dev/null @@ -1,73 +0,0 @@ -_rootElement->find($this->addStoreViewButton)->click(); - } - - /** - * Click on "Create Store" button. - * - * @return void - */ - public function createStoreGroup() - { - $this->_rootElement->find($this->createStoreButton)->click(); - } - - /** - * Click on "Create Website" button. - * - * @return void - */ - public function createWebsite() - { - $this->_rootElement->find($this->createWebsiteButton)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/StoreGrid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/StoreGrid.php deleted file mode 100644 index d7647d47f6c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/StoreGrid.php +++ /dev/null @@ -1,146 +0,0 @@ -_rootElement->find(sprintf($this->titleFormat, $title), Locator::SELECTOR_XPATH); - return $element->isVisible(); - } - - /** - * Check if store group exists. - * - * @param string $title - * @return bool - */ - public function isStoreGroupExists($title) - { - return $this->_rootElement->find(sprintf($this->storeGroupName, $title), Locator::SELECTOR_XPATH)->isVisible(); - } - - /** - * Open Store View. - * - * @param Store $store - * @return void - */ - public function openStore(Store $store) - { - $this->_rootElement->find(sprintf($this->storeName, $store->getName()), Locator::SELECTOR_XPATH)->click(); - } - - /** - * Open Store Group. - * - * @param string $title - * @return void - */ - public function openStoreGroup($title) - { - $this->_rootElement->find(sprintf($this->storeGroupName, $title), Locator::SELECTOR_XPATH)->click(); - } - - /** - * Open website by name. - * - * @param string $title - * @return void - */ - public function openWebsite($title) - { - $this->_rootElement->find(sprintf($this->websiteName, $title), Locator::SELECTOR_XPATH)->click(); - } - - /** - * Open Store Group by name. - * - * @param string $storeGroupName - * @return void - */ - public function openStoreGroupByName($storeGroupName) - { - $this->_rootElement->find(sprintf($this->storeGroupName, $storeGroupName), Locator::SELECTOR_XPATH)->click(); - } - - /** - * Get link url. - * - * @param string $link - * @throws \Exception - * @return string - */ - public function getLinkUrl($link) - { - $link = $this->_rootElement->find(sprintf($this->link, $link), Locator::SELECTOR_XPATH); - if ($link->isVisible()) { - return $link->getAttribute('href'); - } else { - throw new \Exception("Link should be visible to take it's href"); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Tax/Rate/Edit/Form.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Tax/Rate/Edit/Form.php deleted file mode 100644 index 50325ae0aa0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Tax/Rate/Edit/Form.php +++ /dev/null @@ -1,39 +0,0 @@ -_rootElement->find($this->rate)->getValue(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Tax/Rate/Edit/Form.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Tax/Rate/Edit/Form.xml deleted file mode 100644 index d4e1d87e5f7..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Tax/Rate/Edit/Form.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - select - - - select - - - select - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Tax/Rate/RatesGrid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Tax/Rate/RatesGrid.php deleted file mode 100644 index 3e150181043..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Tax/Rate/RatesGrid.php +++ /dev/null @@ -1,47 +0,0 @@ - [ - 'selector' => 'input[name="code"]', - ], - 'tax_country_id' => [ - 'selector' => 'select[name="tax_country_id"]', - 'input' => 'select', - ], - 'tax_postcode' => [ - 'selector' => 'input[name="tax_postcode"]', - ], - ]; - - /** - * Locator value of td with tax rate. - * - * @var string - */ - protected $editLink = 'td'; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Tax/Rule/Edit/Form.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Tax/Rule/Edit/Form.php deleted file mode 100644 index d2d9d6a91be..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Tax/Rule/Edit/Form.php +++ /dev/null @@ -1,54 +0,0 @@ -_rootElement->find($this->taxRate, Locator::SELECTOR_CSS, 'multiselectlist')->getAllValues(); - } - - /** - * Check whether tax rate is visible in the list. - * - * @param string $value - * @return bool - */ - public function isTaxRateAvailable($value) - { - return $this->_rootElement->find($this->taxRate, Locator::SELECTOR_CSS, 'multiselectlist') - ->isValueVisible($value); - } - -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Tax/Rule/Edit/Form.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Tax/Rule/Edit/Form.xml deleted file mode 100644 index 00c36825e7c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Tax/Rule/Edit/Form.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - [name^="tax_customer_class"] - multiselect - - - [name^="tax_product_class"] - multiselect - - - [name^="tax_rate"] - multiselect - - - - checkbox - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Tax/Rule/FormPageActions.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Tax/Rule/FormPageActions.php deleted file mode 100644 index fe2f412bb66..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Tax/Rule/FormPageActions.php +++ /dev/null @@ -1,40 +0,0 @@ -_rootElement->find($this->deleteButton)->click(); - $this->browser->acceptAlert(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Tax/Rule/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Tax/Rule/Grid.php deleted file mode 100644 index 469cf3944de..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Tax/Rule/Grid.php +++ /dev/null @@ -1,90 +0,0 @@ - [ - 'selector' => '#taxRuleGrid_filter_code', - ], - 'tax_customer_class' => [ - 'selector' => '#taxRuleGrid_filter_customer_tax_classes', - 'input' => 'select', - ], - 'tax_product_class' => [ - 'selector' => '#taxRuleGrid_filter_product_tax_classes', - 'input' => 'select', - ], - 'tax_rate' => [ - 'selector' => '#taxRuleGrid_filter_tax_rates', - 'input' => 'select', - ], - ]; - - /** - * Check if specific row exists in grid. - * - * @param array $filter - * @param bool $isSearchable - * @param bool $isStrict - * @return bool - */ - public function isRowVisible(array $filter, $isSearchable = false, $isStrict = true) - { - $this->search(['code' => $filter['code']]); - return parent::isRowVisible($filter, $isSearchable); - } - - /** - * Press 'Reset' button. - * - * @return void - */ - public function resetFilter() - { - $this->_rootElement->find($this->resetButton, Locator::SELECTOR_CSS)->click(); - } - - /** - * Search item via grid filter. - * - * @param array $filter - */ - public function search(array $filter) - { - $this->resetFilter(); - $this->prepareForSearch($filter); - $this->_rootElement->find($this->searchButton, Locator::SELECTOR_CSS)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Template.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Template.php deleted file mode 100644 index 1b2ba78d1b0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Template.php +++ /dev/null @@ -1,42 +0,0 @@ -waitForElementNotVisible($this->loadingMask); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Widget/FormTabs.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Widget/FormTabs.php deleted file mode 100644 index a0c24f0c42d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Widget/FormTabs.php +++ /dev/null @@ -1,281 +0,0 @@ -tabs = $this->getFormMapping(); - } - - /** - * Get path for form *.xml file with mapping - * - * @return string - */ - protected function getFormMapping() - { - $result = []; - $paths = $this->getPaths(); - foreach ($paths as $path) { - $content = $this->mapper->read($path); - if (is_array($content)) { - $result = array_replace_recursive($result, $content); - } - } - - return $result; - } - - /** - * Get xml files paths for merge. - * - * @return array - */ - protected function getPaths() - { - $realPath = str_replace('\\', '/', get_class($this)) . '.xml'; - $paths = glob(MTF_TESTS_PATH . preg_replace('/Mage\/\w+/', '*/*', $realPath)); - if (str_contains($realPath, 'Adminhtml')) { - $paths = array_merge( - $paths, - glob(MTF_TESTS_PATH . preg_replace('/Mage\/(\w+)(\/.*Block\/)/', '*/*$2$1/', $realPath)), - glob(MTF_TESTS_PATH . preg_replace('@.*Adminhtml/(.*)@', '*/Adminhtml/Test/Block/$1', $realPath)), - glob(MTF_TESTS_PATH . preg_replace('/.*Adminhtml\/(.*)/', '*/*/Test/Block/*/$1', $realPath)) - ); - } - return array_reverse($paths); - } - - /** - * Fill form with tabs. - * - * @param FixtureInterface $fixture - * @param Element|null $element - * @return FormTabs - */ - public function fill(FixtureInterface $fixture, Element $element = null) - { - $tabs = $this->getFieldsByTabs($fixture); - return $this->fillTabs($tabs, $element); - } - - /** - * Fill specified form with tabs. - * - * @param array $tabs - * @param Element|null $element - * @return FormTabs - */ - protected function fillTabs(array $tabs, Element $element = null) - { - $context = ($element === null) ? $this->_rootElement : $element; - foreach ($tabs as $tabName => $tabFields) { - $tabElement = $this->getTabElement($tabName); - $this->openTab($tabName); - $tabElement->fillFormTab($tabFields, $context); - } - if (!empty($this->unassignedFields)) { - $this->fillMissedFields(); - } - - return $this; - } - - /** - * Fill fields which weren't found on filled tabs. - * - * @throws \Exception - * @SuppressWarnings(PHPMD.UnusedLocalVariable) - */ - protected function fillMissedFields() - { - foreach (array_keys($this->tabs) as $tabName) { - $tabElement = $this->getTabElement($tabName); - if ($this->openTab($tabName)) { - $mapping = $tabElement->dataMapping($this->unassignedFields); - foreach ($mapping as $fieldName => $data) { - $element = $tabElement->_rootElement->find($data['selector'], $data['strategy'], $data['input']); - if ($element->isVisible()) { - $element->setValue($data['value']); - unset($this->unassignedFields[$fieldName]); - } - } - if (empty($this->unassignedFields)) { - break; - } - } - } - - if (!empty($this->unassignedFields)) { - throw new \Exception( - 'Could not find all elements on the tabs: ' . implode(', ', array_keys($this->unassignedFields)) - ); - } - } - - /** - * Get data of the tabs. - * - * @param FixtureInterface|null $fixture - * @param Element|null $element - * @return array - * - * @SuppressWarnings(PHPMD.UnusedLocalVariable) - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData(FixtureInterface $fixture = null, Element $element = null) - { - $data = []; - - if (null === $fixture) { - foreach (array_keys($this->tabs) as $tabName) { - $this->openTab($tabName); - $tabData = $this->getTabElement($tabName)->getDataFormTab(); - $data = array_merge($data, $tabData); - } - } else { - $tabsFields = $fixture->hasData() ? $this->getFieldsByTabs($fixture) : []; - foreach ($tabsFields as $tabName => $fields) { - $this->openTab($tabName); - $tabData = $this->getTabElement($tabName)->getDataFormTab($fields, $this->_rootElement); - $data = array_merge($data, $tabData); - } - } - - return $data; - } - - /** - * Update form with tabs. - * - * @param FixtureInterface $fixture - * @return FormTabs - */ - public function update(FixtureInterface $fixture) - { - $tabs = $this->getFieldsByTabs($fixture); - foreach ($tabs as $tab => $tabFields) { - $this->openTab($tab)->updateFormTab($tabFields, $this->_rootElement); - } - return $this; - } - - /** - * Create data array for filling tabs. - * - * @param FixtureInterface $fixture - * @return array - */ - protected function getFieldsByTabs(FixtureInterface $fixture) - { - return $this->getFixtureFieldsByTabs($fixture); - } - - /** - * Create data array for filling tabs (new fixture specification). - * - * @param FixtureInterface $fixture - * @return array - */ - private function getFixtureFieldsByTabs(FixtureInterface $fixture) - { - $tabs = []; - - $data = $fixture->getData(); - foreach ($data as $field => $value) { - $attributes = $fixture->getDataFieldConfig($field); - $attributes['value'] = $value; - if (array_key_exists('group', $attributes) && $attributes['group'] != 'null') { - $tabs[$attributes['group']][$field] = $attributes; - } elseif (!array_key_exists('group', $attributes) && ($field != 'attribute_id')) { - $this->unassignedFields[$field] = $attributes; - } - } - return $tabs; - } - - /** - * Get tab element. - * - * @param string $tabName - * @return Tab - * @throws \Exception - */ - public function getTabElement($tabName) - { - $tabClass = $this->tabs[$tabName]['class']; - /** @var Tab $tabElement */ - $tabElement = $this->blockFactory->create($tabClass, ['element' => $this->_rootElement]); - if (!$tabElement instanceof Tab) { - throw new \Exception('Wrong Tab Class.'); - } - $tabElement->setWrapper(isset($this->tabs[$tabName]['wrapper']) ? $this->tabs[$tabName]['wrapper'] : ''); - $tabElement->setMapping(isset($this->tabs[$tabName]['fields']) ? (array)$this->tabs[$tabName]['fields'] : []); - - return $tabElement; - } - - /** - * Open tab. - * - * @param string $tabName - * @return Tab - */ - public function openTab($tabName) - { - $selector = $this->tabs[$tabName]['selector']; - $strategy = isset($this->tabs[$tabName]['strategy']) - ? $this->tabs[$tabName]['strategy'] - : Locator::SELECTOR_CSS; - $tab = $this->_rootElement->find($selector, $strategy); - $tab->click(); - - return $this; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Widget/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Widget/Grid.php deleted file mode 100644 index d1401e08a1c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Widget/Grid.php +++ /dev/null @@ -1,528 +0,0 @@ - $selector) { - $columnElements = $this->_rootElement - ->getElements($this->prepareColumnSelector($selector), Locator::SELECTOR_XPATH); - /** @var Element $columnElement */ - foreach ($columnElements as $columnElement) { - $data[$columnName][] = $columnElement->getText(); - } - } - return $data; - } - - /** - * Prepare column xpath selector. - * - * @param $selector - * @return string - */ - protected function prepareColumnSelector($selector) - { - $tableIdentifier = isset($this->tableIdentifier) ? $this->tableIdentifier : '@*'; - return sprintf($this->columnSelector, $tableIdentifier, $tableIdentifier, $selector); - } - - /** - * Convert column data in accordance with rows in grid. - * Example: - * Columns data - * 'id' => ['1', '2'] - * 'name' => ['Simple1', 'Simple2'] - * - * converts to - * 0 => ['id' = 1, 'name' => 'Simple1']; - * 1 => ['id' = 2, 'name' => 'Simple2']; - * - * @param array $columnData - * @return array - */ - protected function rowsDataConverter(array $columnData) - { - $rowData = []; - foreach ($columnData as $key => $dataValues) { - foreach($dataValues as $index => $value){ - $rowData[$index][$key] = $value; - } - } - - return $rowData; - } - - /** - * Prepare data to perform search, fill in search filter. - * - * @param array $filters - * @throws \Exception - */ - protected function prepareForSearch(array $filters) - { - foreach ($filters as $key => $value) { - if (isset($this->filters[$key])) { - $selector = $this->filters[$key]['selector']; - $strategy = isset($this->filters[$key]['strategy']) - ? $this->filters[$key]['strategy'] - : Locator::SELECTOR_CSS; - $typifiedElement = isset($this->filters[$key]['input']) - ? $this->filters[$key]['input'] - : null; - $this->_rootElement->find($selector, $strategy, $typifiedElement)->setValue($value); - } else { - throw new \Exception('Such column is absent in the grid or not described yet.'); - } - } - } - - /** - * Search item via grid filter. - * - * @param array $filter - */ - public function search(array $filter) - { - $this->resetFilter(); - $this->prepareForSearch($filter); - $this->_rootElement->find($this->searchButton, Locator::SELECTOR_CSS)->click(); - $this->getTemplateBlock()->waitLoader(); - } - - /** - * Search item and open it. - * - * @param array $filter - * @throws \Exception - */ - public function searchAndOpen(array $filter) - { - $this->search($filter); - $rowItem = $this->_rootElement->find($this->rowItem, Locator::SELECTOR_CSS); - if ($rowItem->isVisible()) { - $rowItem->find($this->editLink, Locator::SELECTOR_CSS)->click(); - } else { - throw new \Exception('Searched item was not found.'); - } - } - - /** - * Search for item and select it. - * - * @param array $filter - * @throws \Exception - */ - public function searchAndSelect(array $filter) - { - $this->search($filter); - $selectItem = $this->_rootElement->find($this->selectItem); - if ($selectItem->isVisible()) { - $selectItem->click(); - } else { - throw new \Exception('Searched item was not found.'); - } - } - - /** - * Press 'Reset' button. - */ - public function resetFilter() - { - $this->_rootElement->find($this->resetButton, Locator::SELECTOR_CSS)->click(); - $this->getTemplateBlock()->waitLoader(); - } - - /** - * Perform selected massaction over checked items. - * - * @param array $items - * @param array|string $action [array -> key = value from first select; value => value from subselect] - * @param bool $acceptAlert [optional] - * @param string $massActionSelection [optional] - * @return void - */ - public function massaction(array $items, $action, $acceptAlert = false, $massActionSelection = '') - { - if (!is_array($action)) { - $action = [$action => '-']; - } - foreach ($items as $item) { - $this->searchAndSelect($item); - } - if ($massActionSelection) { - $this->_rootElement->find($this->massactionAction, Locator::SELECTOR_CSS, 'select') - ->setValue($massActionSelection); - } - $actionType = key($action); - $this->_rootElement->find($this->massactionSelect, Locator::SELECTOR_CSS, 'select')->setValue($actionType); - if (isset($action[$actionType]) && $action[$actionType] != '-') { - $this->_rootElement->find($this->option, Locator::SELECTOR_CSS, 'select')->setValue($action[$actionType]); - } - $this->massActionSubmit($acceptAlert); - } - - /** - * Submit mass actions. - * - * @param bool $acceptAlert - * @return void - */ - protected function massActionSubmit($acceptAlert) - { - $this->_rootElement->find($this->massactionSubmit, Locator::SELECTOR_CSS)->click(); - if ($acceptAlert) { - $this->browser->acceptAlert(); - } - } - - /** - * Obtain specific row in grid. - * - * @param array $filter - * @param bool $isSearchable - * @param bool $isStrict - * @return Element - */ - protected function getRow(array $filter, $isSearchable = true, $isStrict = true) - { - if ($isSearchable) { - $this->search($filter); - } - $rowTemplate = 'td[contains(.,normalize-space("%s"))]'; - if ($isStrict) { - $rowTemplate = 'td[text()[normalize-space()="%s"]]'; - } - $rows = []; - foreach ($filter as $value) { - $rows[] = sprintf($rowTemplate, $value); - } - $location = $this->location . implode(' and ', $rows) . ']'; - return $this->_rootElement->find($location, Locator::SELECTOR_XPATH); - } - - /** - * Get rows data. - * - * @param array $columns - * @return array - */ - public function getRowsData(array $columns) - { - $columnData = $this->getColumnData($columns); - - return $this->rowsDataConverter($columnData); - } - - /** - * Check if specific row exists in grid. - * - * @param array $filter - * @param bool $isSearchable - * @param bool $isStrict - * @return bool - */ - public function isRowVisible(array $filter, $isSearchable = true, $isStrict = true) - { - return $this->getRow($filter, $isSearchable, $isStrict)->isVisible(); - } - - /** - * Sort grid by field. - * - * @param $field - * @param string $sort - */ - public function sortGridByField($field, $sort = "desc") - { - $sortBlock = $this->_rootElement->find(sprintf($this->sortLink, $field, $sort)); - if ($sortBlock->isVisible()) { - $sortBlock->click(); - $this->getTemplateBlock()->waitLoader(); - } - } - - /** - * Click to next page action link. - * - * @return bool - */ - protected function nextPage() - { - if ($this->_rootElement->find($this->actionNextPageDisabled)->isVisible()) { - return false; - } - $this->_rootElement->find($this->actionNextPage)->click(); - $this->getTemplateBlock()->waitLoader(); - return true; - } - - /** - * Check whether first row is visible. - * - * @return bool - */ - public function isFirstRowVisible() - { - return $this->_rootElement->find($this->firstRowSelector, Locator::SELECTOR_XPATH)->isVisible(); - } - - /** - * Open first item in grid. - * - * @return void - */ - public function openFirstRow() - { - $this->_rootElement->find($this->firstRowSelector, Locator::SELECTOR_XPATH)->click(); - } - - /** - * Check select entity. - * - * @param array $filter - * @throws \Exception - * @return bool - */ - public function isSelect(array $filter) - { - try { - $this->search($filter); - $checkValue = $this->_rootElement->find($this->selectedItem, Locator::SELECTOR_CSS, 'checkbox')->getValue(); - if ($checkValue == 'Yes') { - return true; - } - return false; - } catch (\Exception $e) { - throw new \Exception("Searched item was not found. \n $e"); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Widget/Tab.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Widget/Tab.php deleted file mode 100644 index a0b72019c20..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Widget/Tab.php +++ /dev/null @@ -1,154 +0,0 @@ -dataMapping($fields); - $this->_fill($data, $element); - - return $this; - } - - /** - * Get data of tab. - * - * @param array|null $fields - * @param Element|null $element - * @return array - */ - public function getDataFormTab($fields = null, Element $element = null) - { - $data = $this->dataMapping($fields); - return $this->_getData($data, $element); - } - - /** - * Update data to fields on tab. - * - * @param array $fields - * @param Element|null $element - * @return void - */ - public function updateFormTab(array $fields, Element $element = null) - { - $this->fillFormTab($fields, $element); - } - - /** - * Get array of label => js error text. - * - * @return array - */ - public function getJsErrors() - { - $data = []; - $elements = $this->_rootElement->getElements($this->mageErrorField, Locator::SELECTOR_XPATH); - foreach ($elements as $element) { - $error = $element->find($this->mageErrorText, Locator::SELECTOR_XPATH); - if ($error->isVisible()) { - $label = $element->find($this->mageErrorLabel, Locator::SELECTOR_XPATH)->getText(); - $data[$label] = $error->getText(); - } - } - return $data; - } - - /** - * Get require notice messages. - * - * @return array - */ - public function getRequireNoticeMessages() - { - $messages = []; - $elements = $this->_rootElement->getElements($this->noticeMassage); - foreach ($elements as $element) { - $error = $element->find($this->noticeLabel, Locator::SELECTOR_XPATH); - if ($error->isVisible()) { - $label = $this->getNoticeLabel($element); - $messages[$label] = $element->getText(); - } - } - - return $messages; - } - - /** - * Get label for notice message. - * - * @param Element $element - * @return string - */ - protected function getNoticeLabel(Element $element) - { - $noticeLabel = str_replace(' ', '', strtolower($element->find($this->noticeLabel, Locator::SELECTOR_XPATH)->getText())); - return str_replace('*', '', $noticeLabel); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Wishlist/Customer/Edit/Tab/Wishlist.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Wishlist/Customer/Edit/Tab/Wishlist.php deleted file mode 100644 index adb910b9953..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Wishlist/Customer/Edit/Tab/Wishlist.php +++ /dev/null @@ -1,45 +0,0 @@ -blockFactory->create( - 'Mage\Adminhtml\Test\Block\Wishlist\Customer\Edit\Tab\Wishlist\Grid', - ['element' => $this->_rootElement->find($this->wishlistGrid)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Wishlist/Customer/Edit/Tab/Wishlist/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Wishlist/Customer/Edit/Tab/Wishlist/Grid.php deleted file mode 100644 index e7b5a788339..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Wishlist/Customer/Edit/Tab/Wishlist/Grid.php +++ /dev/null @@ -1,132 +0,0 @@ - [ - 'selector' => 'input[name="product_name"]', - ], - 'qty_from' => [ - 'selector' => 'input[name="qty[from]"]', - ], - 'qty_to' => [ - 'selector' => 'input[name="qty[to]"]', - ], - 'options' => [ - 'selector' => 'td//*[dt[contains(.,"%option_name%")]/following-sibling::dd[contains(.,"%value%")]]', - 'strategy' => 'xpath', - ], - ]; - - /** - * Delete link selector. - * - * @var string - */ - protected $deleteLink = 'a[onclick*="removeItem"]'; - - /** - * Configure link selector. - * - * @var string - */ - protected $configureLink = 'a[onclick*="configureItem"]'; - - /** - * Delete product. - * - * @return void - */ - protected function delete() - { - $this->_rootElement->find($this->rowItem . ' ' . $this->deleteLink)->click(); - $this->browser->acceptAlert(); - } - - /** - * Configure product. - * - * @return void - */ - protected function configure() - { - $this->_rootElement->find($this->rowItem . ' ' . $this->configureLink)->click(); - } - - /** - * Search item product and action it. - * - * @param array $filter - * @param string $action - * @return void - */ - public function searchAndAction(array $filter, $action) - { - $this->search($filter); - $this->{ucfirst($action)}(); - $this->waitLoader(); - } - - /** - * Obtain specific row in grid. - * - * @param array $filter - * @param bool $isSearchable [optional] - * @param bool $isStrict [optional] - * @return Element - */ - protected function getRow(array $filter, $isSearchable = true, $isStrict = true) - { - $options = []; - if (isset($filter['options'])) { - $options = $filter['options']; - unset($filter['options']); - } - if ($isSearchable) { - $this->search($filter); - } - $location = '//div[@class="grid"]//tr['; - $rowTemplate = 'td[contains(.,normalize-space("%s"))]'; - $rows = []; - foreach ($filter as $value) { - $rows[] = sprintf($rowTemplate, $value); - } - if (!empty($options) && is_array($options)) { - foreach ($options as $value) { - $rows[] = str_replace( - '%value%', - $value['value'], - str_replace('%option_name%', $value['option_name'], $this->filters['options']['selector']) - ); - } - } - $location = $location . implode(' and ', $rows) . ']'; - return $this->_rootElement->find($location, Locator::SELECTOR_XPATH); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertProductIsPresentOnCustomWebsite.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertProductIsPresentOnCustomWebsite.php deleted file mode 100644 index 1cc8a29cad6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertProductIsPresentOnCustomWebsite.php +++ /dev/null @@ -1,196 +0,0 @@ -getDataFieldConfig('group_id')['source']->getStoreGroup(); - $this->website = $store->getDataFieldConfig('website_id')['source']->getWebsite(); - $this->setupPaths(); - $this->createWebsiteFolder(); - $this->placeFiles(); - $this->enableWebsiteConfiguration($fixtureFactory); - - $product = $fixtureFactory->createByCode( - 'catalogProductSimple', - ['dataset' => 'default', 'data' => ['website_ids' => ['websites' => [$this->website]]]] - ); - $product->persist(); - - $code = $this->website->getCode(); - $productUrl = $_ENV['app_frontend_url'] . "websites/$code/" . $product->getUrlKey() . ".html"; - $browser->open(str_replace("index.php/", "", $productUrl)); - - \PHPUnit_Framework_Assert::assertTrue( - $catalogProductView->getViewBlock()->isVisible(), - "Searched product is not visible." - ); - } - - /** - * Setup paths for assert. - * - * @throws \Exception - * @return void - */ - protected function setupPaths() - { - $code = $this->website->getCode(); - $this->magentoRoot = $this->resolveMagentoRoot(); - $this->websiteFolder = $this->magentoRoot . DIRECTORY_SEPARATOR . "websites" . DIRECTORY_SEPARATOR . $code; - } - - /** - * Resolve magento root path. - * - * @return string - */ - protected function resolveMagentoRoot() - { - $realPath = realpath(MTF_BP . '/../../../'); - preg_match('@instance-\d@', $_ENV['app_frontend_url'], $matches); - return isset($matches[0]) ? preg_replace('@instance-\d@', $matches[0], $realPath) : $realPath; - } - - /** - * Create Website folder in magento root. - * - * @return void - */ - protected function createWebsiteFolder() - { - $oldMask = umask(0); - if (!is_dir($this->magentoRoot . DIRECTORY_SEPARATOR . 'websites')) { - - mkdir($this->magentoRoot . DIRECTORY_SEPARATOR . 'websites', 0777); - } - mkdir($this->websiteFolder, 0777); - umask($oldMask); - } - - /** - * Place files in created folder in magento root dir. - * - * @return void - */ - protected function placeFiles() - { - $htaccessFile = file_get_contents($this->magentoRoot . DIRECTORY_SEPARATOR . '.htaccess'); - file_put_contents($this->websiteFolder . DIRECTORY_SEPARATOR . ".htaccess", $htaccessFile); - $indexPhpFile = file_get_contents($this->magentoRoot . DIRECTORY_SEPARATOR . 'index.php'); - - $replace = ["getcwd()", "(\$mageRunCode, \$mageRunType)"]; - $replacement = ["'{$this->magentoRoot}'", "('{$this->website->getCode()}', 'website')"]; - $indexPhpFile = str_replace($replace, $replacement, $indexPhpFile); - - file_put_contents($this->websiteFolder . DIRECTORY_SEPARATOR . "index.php", $indexPhpFile); - } - - /** - * Enable website configuration. - * - * @param FixtureFactory $fixtureFactory - * @return void - */ - protected function enableWebsiteConfiguration(FixtureFactory $fixtureFactory) - { - $code = $this->website->getCode(); - $scope = "web/website/$code/"; - $data = [ - $scope . 'secure/base_link_url' => [ - 'scope' => $scope, - 'value' => "{{secure_base_url}}websites/$code/" - ], - $scope . 'unsecure/base_link_url' => [ - 'scope' => $scope, - 'value' => "{{unsecure_base_url}}websites/$code/" - ] - ]; - - $fixture = $fixtureFactory->createByCode('customConfigData', ['data' => $data]); - $fixture->persist(); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return "Product is present on custom website."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreBackend.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreBackend.php deleted file mode 100644 index d3812ca9e29..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreBackend.php +++ /dev/null @@ -1,59 +0,0 @@ -open(); - \PHPUnit_Framework_Assert::assertTrue( - $systemConfig->getStoresSwitcher()->isStoreVisible($store), - "Store " . $store->getName() . " is not visible in dropdown on config page." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Store View is available in backend configuration.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreForm.php deleted file mode 100644 index f528996c3f9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreForm.php +++ /dev/null @@ -1,59 +0,0 @@ -open()->getStoreGrid()->openStore($store); - $errors = $this->verifyData($store->getData(), $storeNew->getStoreForm()->getData()); - \PHPUnit_Framework_Assert::assertEmpty($errors, $errors); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Store View data on edit page equals data from fixture.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreFrontend.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreFrontend.php deleted file mode 100644 index 56616e70c5f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreFrontend.php +++ /dev/null @@ -1,72 +0,0 @@ -open()->getPageActions()->flushCacheStorage(); - $cmsIndex->open(); - $footerBlock = $cmsIndex->getFooterBlock(); - $headerBlock = $cmsIndex->getHeaderBlock(); - if ($footerBlock->isStoreGroupSwitcherVisible() && $footerBlock->isStoreGroupVisible($store)) { - $footerBlock->selectStoreGroup($store); - } - - $isStoreViewVisible = $headerBlock->isStoreViewDropdownVisible() - ? $headerBlock->isStoreViewVisible($store) - : true; // if only one store view is assigned to store group - - \PHPUnit_Framework_Assert::assertTrue( - $isStoreViewVisible, - "Store view '{$store->getName()}' is not visible in dropdown on CmsIndex page." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Store view is visible in dropdown on CmsIndex page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreGroupForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreGroupForm.php deleted file mode 100644 index c1e06ad8d6b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreGroupForm.php +++ /dev/null @@ -1,67 +0,0 @@ -open(); - $storeIndex->getStoreGrid()->openStoreGroup($storeGroup->getName()); - $formData = $editGroup->getEditFormStoreGroup()->getData(); - $fixtureData = $storeGroup->getData(); - - $errors = $this->verifyData($fixtureData, $formData); - \PHPUnit_Framework_Assert::assertEmpty($errors, $errors); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Store Group data on edit page equals data from fixture.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreGroupInGrid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreGroupInGrid.php deleted file mode 100644 index 2ebb1e768c1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreGroupInGrid.php +++ /dev/null @@ -1,57 +0,0 @@ -open(); - $storeGroupName = $storeGroup->getName(); - \PHPUnit_Framework_Assert::assertTrue( - $storeIndex->getStoreGrid()->isStoreGroupExists($storeGroupName), - "Store group '$storeGroupName' is not present in grid." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Store Group is present in grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreGroupInPurchasePointDropdown.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreGroupInPurchasePointDropdown.php deleted file mode 100644 index 0f0ef5e3a9a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreGroupInPurchasePointDropdown.php +++ /dev/null @@ -1,60 +0,0 @@ -open(); - foreach ($storeGroups as $storeGroup) { - /** @var StoreGroup $storeGroup */ - $storeGroupName = $storeGroup->getName(); - \PHPUnit_Framework_Assert::assertTrue( - $salesOrderIndex->getSalesOrderGrid()->isRowVisible(['purchased_from' => $storeGroupName]), - "Store group '$storeGroupName' is not present in grid filter." - ); - } - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Store Group can be found in "Purchase Point" dropdown on SalesOrderIndex page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreGroupOnStoreViewForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreGroupOnStoreViewForm.php deleted file mode 100644 index 29e48fc7f69..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreGroupOnStoreViewForm.php +++ /dev/null @@ -1,60 +0,0 @@ -open(); - $storeGroupName = $storeGroup->getName(); - $storeIndex->getGridPageActions()->addStoreView(); - \PHPUnit_Framework_Assert::assertTrue( - $storeNew->getStoreForm()->isStoreVisible($storeGroupName), - "Store Group '$storeGroupName' is not present on StoreView Form in Store dropdown." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Store Group is visible on StoreView Form in Store dropdown.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreGroupSuccessSaveMessage.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreGroupSuccessSaveMessage.php deleted file mode 100644 index 6f879a07e70..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreGroupSuccessSaveMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Store Group success create message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreInGrid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreInGrid.php deleted file mode 100644 index 211b9a74fc5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreInGrid.php +++ /dev/null @@ -1,60 +0,0 @@ -getName(); - $storeIndex->open(); - \PHPUnit_Framework_Assert::assertTrue( - $storeIndex->getStoreGrid()->isStoreExists($storeName), - "Store $storeName is not present in grid." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Store View is present in grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreLocalized.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreLocalized.php deleted file mode 100644 index 44e75c34f80..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreLocalized.php +++ /dev/null @@ -1,123 +0,0 @@ -open(); - $adminCache->getPageActions()->flushCacheStorage(); - $adminCache->getMessagesBlock()->waitSuccessMessage(); - - $this->cmsIndexPage = $cmsIndex; - $this->setConfig($store, $fixtureFactory, $config); - $cmsIndex->open(); - $this->selectStore($store); - \PHPUnit_Framework_Assert::assertEquals( - strtolower($cmsIndex->getTopLinksBlock()->getAccountLabelText()), - self::EXPECTED_TEXT - ); - } - - /** - * Set config. - * - * @param Store $store - * @param FixtureFactory $fixtureFactory - * @param ConfigData $config - * @return void - */ - protected function setConfig(Store $store, FixtureFactory $fixtureFactory, ConfigData $config) - { - $configData = $config->getData(); - $configData['section']['general/locale/code']['scope'] .= '/' . $store->getCode(); - $fixtureFactory->createByCode('configData', ['data' => $configData['section']])->persist(); - } - - /** - * Select store. - * - * @param Store $store - * @return void - */ - protected function selectStore(Store $store) - { - $headerBlock = $this->cmsIndexPage->getHeaderBlock(); - $footerBlock = $this->cmsIndexPage->getFooterBlock(); - if ($footerBlock->isStoreGroupSwitcherVisible() && $footerBlock->isStoreGroupVisible($store)) { - $footerBlock->selectStoreGroup($store); - } - if ($headerBlock->isStoreViewDropdownVisible()) { - $headerBlock->selectStore($store->getName()); - }; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Created store view can be localized.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreNotOnFrontend.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreNotOnFrontend.php deleted file mode 100644 index 7b4ec697af4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreNotOnFrontend.php +++ /dev/null @@ -1,69 +0,0 @@ -open(); - $footerBlock = $cmsIndex->getFooterBlock(); - $headerBlock = $cmsIndex->getHeaderBlock(); - if ($footerBlock->isStoreGroupSwitcherVisible() && $footerBlock->isStoreGroupVisible($store)) { - $footerBlock->selectStoreGroup($store); - } - - $isStoreViewVisible = $headerBlock->isStoreViewDropdownVisible() - ? $headerBlock->isStoreViewVisible($store) - : false; // if only one store view is assigned to store group - - \PHPUnit_Framework_Assert::assertFalse( - $isStoreViewVisible, - "Store view '{$store->getName()}' is visible in dropdown on CmsIndex page." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Store view is not visible in dropdown on CmsIndex page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreSuccessSaveMessage.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreSuccessSaveMessage.php deleted file mode 100644 index b2a1d98a96c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreSuccessSaveMessage.php +++ /dev/null @@ -1,64 +0,0 @@ -getMessagesBlock()->getSuccessMessages(), - 'Wrong success message is displayed.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Store View success create message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertVersionCorrect.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertVersionCorrect.php deleted file mode 100644 index 38056de44a9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertVersionCorrect.php +++ /dev/null @@ -1,52 +0,0 @@ -get('Magento\Mtf\Config\GlobalConfig'); - $newVersion = $config->get('version/0/value'); - $dashboard->open(); - \PHPUnit_Framework_Assert::assertTrue( - $dashboard->getFooter()->findVersion($newVersion)->isVisible() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Magento has benn upgraded successfully'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Fixture/CustomConfigData.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Fixture/CustomConfigData.xml deleted file mode 100644 index 7ba1b4f3c7a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Fixture/CustomConfigData.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Fixture/Store.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Fixture/Store.xml deleted file mode 100644 index fc0485d06ac..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Fixture/Store.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Fixture/Store/GroupId.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Fixture/Store/GroupId.php deleted file mode 100644 index 1fd75cd4b94..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Fixture/Store/GroupId.php +++ /dev/null @@ -1,113 +0,0 @@ -params = $params; - if (isset($data['store_group'])) { - $this->storeGroup = $data['store_group']; - $this->data = $data['store_group']->getWebsiteId() . "/" . $data['store_group']->getName(); - } elseif (isset($data['dataset'])) { - $storeGroup = $fixtureFactory->createByCode('storeGroup', ['dataset' => $data['dataset']]); - /** @var StoreGroup $storeGroup */ - if (!$storeGroup->getGroupId()) { - $storeGroup->persist(); - } - $this->storeGroup = $storeGroup; - $this->data = $storeGroup->getWebsiteId() . "/" . $storeGroup->getName(); - } - } - - /** - * Persist attribute options. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set. - * - * @param string|null $key [optional] - * @return mixed - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings. - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Return StoreGroup fixture. - * - * @return StoreGroup - */ - public function getStoreGroup() - { - return $this->storeGroup; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Fixture/StoreGroup.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Fixture/StoreGroup.xml deleted file mode 100644 index 71e486d3f05..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Fixture/StoreGroup.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Fixture/StoreGroup/CategoryId.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Fixture/StoreGroup/CategoryId.php deleted file mode 100644 index 76289447240..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Fixture/StoreGroup/CategoryId.php +++ /dev/null @@ -1,113 +0,0 @@ -params = $params; - if (isset($data['category'])) { - $this->category = $data['category']; - $this->data = $data['category']->getName(); - } elseif (isset($data['dataset'])) { - $category = $fixtureFactory->createByCode('catalogCategory', ['dataset' => $data['dataset']]); - /** @var CatalogCategory $category */ - if (!$category->getId()) { - $category->persist(); - } - $this->category = $category; - $this->data = $category->getName(); - } - } - - /** - * Persist attribute options. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set. - * - * @param string|null $key [optional] - * @return mixed - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings. - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Return CatalogCategory fixture. - * - * @return CatalogCategory - */ - public function getCategory() - { - return $this->category; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Fixture/StoreGroup/WebsiteId.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Fixture/StoreGroup/WebsiteId.php deleted file mode 100644 index 1f9ab7f33d6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Fixture/StoreGroup/WebsiteId.php +++ /dev/null @@ -1,113 +0,0 @@ -params = $params; - if (isset($data['website'])) { - $this->website = $data['website']; - $this->data = $data['website']->getName(); - } elseif (isset($data['dataset'])) { - $website = $fixtureFactory->createByCode('website', ['dataset' => $data['dataset']]); - /** @var Website $website */ - if (!$website->getWebsiteId()) { - $website->persist(); - } - $this->website = $website; - $this->data = $website->getName(); - } - } - - /** - * Persist attribute options. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set. - * - * @param string|null $key [optional] - * @return mixed - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings. - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Return Website fixture. - * - * @return Website - */ - public function getWebsite() - { - return $this->website; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Fixture/Website.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Fixture/Website.xml deleted file mode 100644 index 6b4d28baaa2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Fixture/Website.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/Conditions.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/Conditions.php deleted file mode 100644 index 378b63eeaa8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/Conditions.php +++ /dev/null @@ -1,267 +0,0 @@ - [ - 'is' => '==', - 'is not' => '!=', - 'equal to' => '==', - 'matches' => '==', - ], - 'value_type' => [ - 'same_as' => 'the Same as Matched Product Categories', - ], - 'value' => [ - 'California' => '12', - 'United States' => 'US', - '[flatrate] Fixed' => 'flatrate_flatrate', - ], - 'aggregator' => [ - 'ALL' => 'all', - ], - ]; - - /** - * Map encode special chars. - * - * @var array - */ - protected $encodeChars = [ - '\{' => '{', - '\}' => '}', - '\[' => '&lbracket;', - '\]' => '&rbracket;', - '\:' => ':', - ]; - - /** - * Map decode special chars. - * - * @var array - */ - protected $decodeChars = [ - '{' => '{', - '}' => '}', - '&lbracket;' => '[', - '&rbracket;' => ']', - ':' => ':', - ]; - - /** - * Prepare conditions to array for send by post request. - * - * @param string $conditions - * @return array - */ - protected function prepareCondition($conditions) - { - $decodeConditions = empty($conditions) - ? $this->decodeValue("[Conditions combination]") - : $this->decodeValue("{Conditions combination:[{$conditions}]}"); - return $this->convertMultipleCondition($decodeConditions); - } - - /** - * Convert condition combination. - * - * @param string $combination - * @param array|string $conditions - * @param int $nesting - * @return array - */ - private function convertConditionsCombination($combination, $conditions, $nesting) - { - $combination = [$nesting => $this->convertSingleCondition($combination)]; - $conditions = $this->convertMultipleCondition($conditions, $nesting, 1); - return $combination + $conditions; - } - - /** - * Convert multiple condition. - * - * @param array $conditions - * @param int $nesting - * @param int $count - * @return array - */ - private function convertMultipleCondition(array $conditions, $nesting = 1, $count = 0) - { - $result = []; - foreach ($conditions as $key => $condition) { - $curNesting = $nesting . ($count ? ('--' . $count) : ''); - - if (!is_numeric($key)) { - $result += $this->convertConditionsCombination($key, $condition, $curNesting); - } elseif (is_string($condition)) { - $result[$curNesting] = $this->convertSingleCondition($condition); - } else { - $result += $this->convertMultipleCondition($condition, $nesting, $count); - } - $count++; - } - return $result; - } - - /** - * Convert single condition. - * - * @param string $condition - * @return array - * @throws \Exception - */ - private function convertSingleCondition($condition) - { - $condition = $this->parseCondition($condition); - extract($condition); - - $typeParam = $this->getTypeParam($type); - if (empty($typeParam)) { - throw new \Exception("Can't find type param \"{$type}\"."); - } - - $ruleParam = []; - foreach ($rules as $value) { - $param = $this->getRuleParam($value); - if (empty($param)) { - $ruleParam['value'] = $value; - break; - } - $ruleParam += $param; - } - if (count($ruleParam) != count($rules)) { - throw new \Exception( - "Can't find all params. " - . "\nSearch: " . implode(', ', $rules) . " " - . "\nFind: " . implode(', ', $ruleParam) - ); - } - - return $typeParam + $ruleParam; - } - - /** - * Get type param by name. - * - * @param string $name - * @return array - */ - private function getTypeParam($name) - { - return isset($this->mapTypeParams[$name]) ? $this->mapTypeParams[$name] : []; - } - - /** - * Get rule param by name. - * - * @param string $name - * @return array - */ - private function getRuleParam($name) - { - foreach ($this->mapRuleParams as $typeParam => &$params) { - if (isset($params[$name])) { - return [$typeParam => $params[$name]]; - } - } - return []; - } - - /** - * Decode value. - * - * @param string $value - * @return array - * @throws \Exception - */ - private function decodeValue($value) - { - $value = str_replace(array_keys($this->encodeChars), $this->encodeChars, $value); - $value = preg_replace('/(\]|})({|\[)/', '$1,$2', $value); - $value = preg_replace('/{([^:]+):/', '{"$1":', $value); - $value = preg_replace('/\[([^\[{])/', '"$1', $value); - $value = preg_replace('/([^\]}])\]/', '$1"', $value); - $value = str_replace(array_keys($this->decodeChars), $this->decodeChars, $value); - - $value = "[{$value}]"; - $value = json_decode($value, true); - if (null === $value) { - throw new \Exception('Bad format value.'); - } - return $value; - } - - /** - * Parse condition. - * - * @param string $condition - * @return array - * @throws \Exception - */ - private function parseCondition($condition) - { - if (!preg_match_all('/([^|]+\|?)/', $condition, $match)) { - throw new \Exception('Bad format condition'); - } - foreach ($match[1] as $key => $value) { - $match[1][$key] = rtrim($value, '|'); - } - - return [ - 'type' => array_shift($match[1]), - 'rules' => array_values($match[1]), - ]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/CustomConfigData/Curl.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/CustomConfigData/Curl.php deleted file mode 100644 index a731371a733..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/CustomConfigData/Curl.php +++ /dev/null @@ -1,57 +0,0 @@ - $subPath) { - if ($position === 0) { - $resultArray .= $subPath; - continue; - } elseif ($position === (count($path) - 1)) { - $resultArray .= '[fields]'; - } else { - $resultArray .= '[groups]'; - } - $resultArray .= '[' . $subPath . ']'; - } - $resultArray .= '[value]'; - if (is_array($InputValue)) { - $values = []; - foreach ($InputValue as $key => $value) { - $values[] = $resultArray . "[$key]=$value"; - } - $resultArray = implode('&', $values); - } elseif(!empty($InputValue)) { - $resultArray .= '=' . $InputValue; - } - return $resultArray; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/CustomConfigData/CustomConfigDataInterface.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/CustomConfigData/CustomConfigDataInterface.php deleted file mode 100644 index 751e43977ef..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/CustomConfigData/CustomConfigDataInterface.php +++ /dev/null @@ -1,26 +0,0 @@ -url = $url; - $this->regExpPattern = $regExpPattern; - $this->isAll = $isAll; - } - - /** - * Retrieves data from cURL response - * - * @throws \Exception - * @return array - */ - public function getData() - { - /** @var \Magento\Mtf\Config\DataInterface $config */ - $config = \Magento\Mtf\ObjectManagerFactory::getObjectManager()->get('Magento\Mtf\Config\DataInterface'); - $url = $_ENV['app_backend_url'] . $this->url; - $curl = new BackendDecorator(new CurlTransport(), $config); - $curl->addOption(CURLOPT_HEADER, 1); - $curl->write($url); - $response = $curl->read(); - $curl->close(); - if ($this->isAll) { - preg_match_all($this->regExpPattern, $response, $matches); - } else { - preg_match($this->regExpPattern, $response, $matches); - } - - $countMatches = $this->isAll ? count($matches[1]) : count($matches); - if ($countMatches == 0) { - throw new \Exception('Matches array can\'t be empty.'); - } - return $matches; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/Store/Curl.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/Store/Curl.php deleted file mode 100644 index 3acd3b71417..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/Store/Curl.php +++ /dev/null @@ -1,114 +0,0 @@ - [ - 'Main Website Store' => 1, - ], - 'is_active' => [ - 'Enabled' => 1, - 'Disabled' => 0, - ], - ]; - - /** - * POST request for creating store. - * - * @param FixtureInterface|null $fixture [optional] - * @return array - * @throws \Exception - */ - public function persist(FixtureInterface $fixture = null) - { - $data = $this->prepareData($fixture); - $url = $_ENV['app_backend_url'] . $this->saveUrl; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->write($url, $data); - $response = $curl->read(); - $curl->close(); - if (!strpos($response, 'class="success-msg"')) { - throw new \Exception("Store View entity creating by curl handler was not successful! Response: $response"); - } - - return ['store_id' => $this->getStoreId($fixture->getName())]; - } - - /** - * Prepare data from text to values. - * - * @param FixtureInterface $fixture - * @return array - */ - protected function prepareData(FixtureInterface $fixture) - { - $data = [ - 'store' => $this->replaceMappingData($fixture->getData()), - 'store_action' => 'add', - 'store_type' => 'store', - ]; - $data['store']['group_id'] = $fixture->getDataFieldConfig('group_id')['source']->getStoreGroup()->getGroupId(); - $data['store']['store_id'] = isset($data['store']['store_id']) ? $data['store']['store_id'] : ''; - - return $data; - } - - /** - * Get Store id by name after creating Store. - * - * @param string $name - * @return int|null - * @throws \Exception - */ - protected function getStoreId($name) - { - //Set pager limit to 2000 in order to find created store view by name - $url = $_ENV['app_backend_url'] . 'system_store/index/sort/store_title/dir/asc/limit/2000'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->addOption(CURLOPT_HEADER, 1); - $curl->write($url); - $response = $curl->read(); - preg_match('@.*store_id/(\d+).*' . $name . '@siu', $response, $matches); - if (empty($matches)) { - throw new \Exception('Cannot find store id'); - } - - return empty($matches[1]) ? null : $matches[1]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/Store/StoreInterface.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/Store/StoreInterface.php deleted file mode 100644 index 8126ddcc4aa..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/Store/StoreInterface.php +++ /dev/null @@ -1,26 +0,0 @@ -fixtureFactory = $fixtureFactory; - } - - /** - * POST request for creating store group. - * - * @param FixtureInterface $fixture - * @return array - * @throws \Exception - */ - public function persist(FixtureInterface $fixture = null) - { - /** @var StoreGroup $fixture */ - $data = $this->prepareData($fixture); - $url = $_ENV['app_backend_url'] . 'system_store/save/'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->write($url, $data); - $response = $curl->read(); - $curl->close(); - if (!strpos($response, 'success-msg')) { - throw new \Exception("Store group entity creating by curl handler was not successful! Response: $response"); - } - $groupId = $this->getStoreGroupIdByGroupName($fixture->getName()); - - if ($fixture->hasData('default_store_id')) { - $this->createStoreView($fixture, $groupId); - } - - return ['group_id' => $groupId]; - } - - /** - * Create store view. - * - * @param StoreGroup $storeGroup - * @param int $groupId - * @return void - */ - protected function createStoreView(StoreGroup $storeGroup, $groupId) - { - $storeId = $storeGroup->getDefaultStoreId(); - $storeGroup = $this->prepareStoreGroup($storeGroup, $groupId); - $store = $this->fixtureFactory->createByCode( - 'store', - ['dataset' => $storeId['dataset'], 'data' => ['group_id' => ['store_group' => $storeGroup]]] - ); - $store->persist(); - } - - /** - * Prepare store group fixture. - * - * @param StoreGroup $storeGroup - * @param int $groupId - * @return StoreGroup - */ - protected function prepareStoreGroup(StoreGroup $storeGroup, $groupId) - { - $category = $storeGroup->getDataFieldConfig('root_category_id')['source']->getCategory(); - $website = $storeGroup->getDataFieldConfig('website_id')['source']->getWebsite(); - $storeGroupData = array_replace_recursive( - $storeGroup->getData(), - [ - 'root_category_id' => ['category' => $category], - 'website_id' => ['website' => $website], - 'group_id' => $groupId - ] - ); - $storeGroup = $this->fixtureFactory->createByCode('storeGroup', ['data' => $storeGroupData]); - - return $storeGroup; - } - - /** - * Get store id by store name. - * - * @param string $storeName - * @return int - * @throws \Exception - */ - protected function getStoreGroupIdByGroupName($storeName) - { - //Set pager limit to 2000 in order to find created store group by name - $url = $_ENV['app_backend_url'] . 'system_store/index/sort/group_title/dir/asc/limit/2000'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->addOption(CURLOPT_HEADER, 1); - $curl->write($url); - $response = $curl->read(); - preg_match('@.*group_id/(\d+).*' . $storeName . '@siu', $response, $matches); - - if (empty($matches)) { - throw new \Exception('Cannot find store group id'); - } - - return intval($matches[1]); - } - - /** - * Prepare data from text to values. - * - * @param StoreGroup $fixture - * @return array - */ - protected function prepareData(StoreGroup $fixture) - { - $categoryId = $fixture->getDataFieldConfig('root_category_id')['source']->getCategory()->getId(); - $websiteId = $fixture->getDataFieldConfig('website_id')['source']->getWebsite()->getWebsiteId(); - $data = [ - 'group' => [ - 'name' => $fixture->getName(), - 'root_category_id' => $categoryId, - 'website_id' => $websiteId, - 'group_id' => $fixture->hasData('group_id') ? $fixture->getGroupId() : '' - ], - 'store_action' => 'add', - 'store_type' => 'group' - ]; - - return $data; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/StoreGroup/StoreGroupInterface.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/StoreGroup/StoreGroupInterface.php deleted file mode 100644 index 92b2d43e19d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/StoreGroup/StoreGroupInterface.php +++ /dev/null @@ -1,26 +0,0 @@ -adminAuthLogin = $adminAuthLogin; - $this->dashboard = $dashboard; - } - - /** - * Login admin user. - * - * @param FixtureInterface $fixture [optional] - * @return mixed|string - */ - public function persist(FixtureInterface $fixture = null) - { - $this->adminAuthLogin->open(); - $loginBlock = $this->adminAuthLogin->getLoginBlock(); - if ($loginBlock->isVisible()) { - $loginBlock->fill($fixture); - $loginBlock->submit(); - $this->dashboard->getAdminPanelHeader()->waitVisible(); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/Website/Curl.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/Website/Curl.php deleted file mode 100644 index 57f0f491b54..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/Website/Curl.php +++ /dev/null @@ -1,162 +0,0 @@ -fixtureFactory = $fixtureFactory; - } - - /** - * POST request for creating Website. - * - * @param FixtureInterface|null $fixture [optional] - * @return array - * @throws \Exception - */ - public function persist(FixtureInterface $fixture = null) - { - /** @var Website $fixture $data */ - $data = $this->prepareData($fixture); - $url = $_ENV['app_backend_url'] . 'system_store/save'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->write($url, $data); - $response = $curl->read(); - $curl->close(); - if (!strpos($response, 'success-msg"')) { - throw new \Exception("Website entity creating by curl handler was not successful! Response: $response"); - } - $websiteId = $this->getWebSiteId($fixture); - - if ($fixture->hasData('default_group_id')) { - $this->createStoreGroup($fixture, $websiteId); - } - - return ['website_id' => $websiteId]; - } - - /** - * Create store group. - * - * @param Website $website - * @param int $websiteId - * @return void - */ - protected function createStoreGroup(Website $website, $websiteId) - { - $groupId = $website->getDefaultGroupId(); - $website = $this->prepareWebsite($website, $websiteId); - $storeGroup = $this->fixtureFactory->createByCode( - 'storeGroup', - ['dataset' => $groupId['dataset'], 'data' => ['website_id' => ['website' => $website]]] - ); - $storeGroup->persist(); - } - - /** - * Prepare website fixture. - * - * @param Website $website - * @param int $websiteId - * @return Website - */ - protected function prepareWebsite(Website $website, $websiteId) - { - $websiteData = $website->getData(); - $websiteData['website_id'] = $websiteId; - $website = $this->fixtureFactory->createByCode('website', ['data' => $websiteData]); - - return $website; - } - - /** - * Get website id. - * - * @param Website $website - * @return int - * @throws \Exception - */ - protected function getWebSiteId(Website $website) - { - //Set pager limit to 2000 in order to find created website by name - $url = $_ENV['app_backend_url'] . 'system_store/index/sort/group_title/dir/asc/limit/2000'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->addOption(CURLOPT_HEADER, 1); - $curl->write($url); - $response = $curl->read(); - - $expectedUrl = '/admin/system_store/editWebsite/website_id/'; - preg_match('@.*' . $expectedUrl . '(\d+).*?' . $website->getName() . '@siu', $response, $matches); - - if (empty($matches)) { - throw new \Exception('Cannot find website id.'); - } - - return intval($matches[1]); - } - - /** - * Prepare data from text to values. - * - * @param FixtureInterface $fixture - * @return array - */ - protected function prepareData(FixtureInterface $fixture) - { - $data = [ - 'website' => $fixture->getData(), - 'store_action' => 'add', - 'store_type' => 'website', - ]; - $data['website']['website_id'] = isset($data['website']['website_id']) ? $data['website']['website_id'] : ''; - $data['website']['is_default'] = isset($data['website']['is_default']) ? $data['website']['is_default'] : ''; - - return $data; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/Website/WebsiteInterface.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/Website/WebsiteInterface.php deleted file mode 100644 index 15fa92a0690..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/Website/WebsiteInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/AdminLogout.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/AdminLogout.xml deleted file mode 100644 index a79ad8ec887..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/AdminLogout.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/Cache.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/Cache.xml deleted file mode 100644 index f8b309dd663..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/Cache.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/Dashboard.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/Dashboard.xml deleted file mode 100644 index ffc061600a0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/Dashboard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/DeleteGroup.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/DeleteGroup.xml deleted file mode 100644 index cabaa5758df..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/DeleteGroup.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/DeleteStore.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/DeleteStore.xml deleted file mode 100644 index 602504fa94f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/DeleteStore.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/DeleteWebsite.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/DeleteWebsite.xml deleted file mode 100644 index 69e6c915152..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/DeleteWebsite.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/EditGroup.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/EditGroup.xml deleted file mode 100644 index 4deced001b1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/EditGroup.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/EditStore.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/EditStore.xml deleted file mode 100644 index ac97d7a8d51..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/EditStore.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/EditWebsite.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/EditWebsite.xml deleted file mode 100644 index a61090af612..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/EditWebsite.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/NewStoreGroup.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/NewStoreGroup.xml deleted file mode 100644 index 7ccb0d8f033..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/NewStoreGroup.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/NewWebsite.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/NewWebsite.xml deleted file mode 100644 index 830b85e98e4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/NewWebsite.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/ProcessList.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/ProcessList.xml deleted file mode 100644 index de01aeffc10..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/ProcessList.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/StoreIndex.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/StoreIndex.xml deleted file mode 100644 index 55a46910b07..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/StoreIndex.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/StoreNew.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/StoreNew.xml deleted file mode 100644 index ec5e3345195..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/StoreNew.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/SystemConfig.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/SystemConfig.xml deleted file mode 100644 index 65cecf0181a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/SystemConfig.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Repository/ConfigData.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Repository/ConfigData.xml deleted file mode 100644 index 0074fd91d94..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Repository/ConfigData.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - general/website/base/store - 1 - German (Germany) - de_DE - - - - - general/website/base/store - 1 - English (United States) - en_US - - - - - general/website/base/store - 1 - English (United States) - en_US - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Repository/Store.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Repository/Store.xml deleted file mode 100644 index 54337f9f2e4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Repository/Store.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - default - - Default Store View - base - Enabled - 1 - - - - default - - Custom_Store_%isolation% - code_%isolation% - Enabled - - - - custom_with_custom_web_site - - Custom_Store_%isolation% - code_%isolation% - Enabled - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Repository/StoreGroup.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Repository/StoreGroup.xml deleted file mode 100644 index 9dfc294df1d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Repository/StoreGroup.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - main_website - - Main Website Store - 1 - - default_category - - - - - main_website - - store_name_%isolation% - - default_category - - - - - custom_website - - store_name_%isolation% - - default_category - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Repository/Website.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Repository/Website.xml deleted file mode 100644 index c788a35d773..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Repository/Website.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - Main Website - base - 1 - - - - Main Website - base - 0 - 1 - - - - Web_Site_%isolation% - code_%isolation% - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestCase/CreateStoreEntityTest.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestCase/CreateStoreEntityTest.php deleted file mode 100644 index 7dfbb9642e1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestCase/CreateStoreEntityTest.php +++ /dev/null @@ -1,181 +0,0 @@ - Manage Stores - * 3. Click "Create Store View" button - * 4. Fill data according to dataset - * 5. Perform all assertions - * - * @group Store_Management_(MX) - * @ZephyrId MPERF-6650 - */ -class CreateStoreEntityTest extends Injectable -{ - /** - * Page StoreIndex. - * - * @var StoreIndex - */ - protected $storeIndex; - - /** - * Page StoreNew. - * - * @var StoreNew - */ - protected $storeNew; - - /** - * Current Store View. - * - * @var Store - */ - protected $store; - - /** - * Page EditStore. - * - * @var EditStore - */ - protected $editStore; - - /** - * Page DeleteStore. - * - * @var DeleteStore - */ - protected $deleteStore; - - /** - * Page EditGroup. - * - * @var EditGroup - */ - protected $editGroup; - - /** - * Page DeleteGroup. - * - * @var DeleteGroup - */ - protected $deleteGroup; - - /** - * Admin logout page. - * - * @var AdminLogout - */ - protected $adminLogout; - - /** - * Preparing pages for test. - * - * @param StoreIndex $storeIndex - * @param StoreNew $storeNew - * @param EditStore $editStore - * @param DeleteStore $deleteStore - * @param EditGroup $editGroup - * @param DeleteGroup $deleteGroup - * @param AdminLogout $adminLogout - * @return void - */ - public function __inject( - StoreIndex $storeIndex, - StoreNew $storeNew, - EditStore $editStore, - DeleteStore $deleteStore, - EditGroup $editGroup, - DeleteGroup $deleteGroup, - AdminLogout $adminLogout - ) { - $this->storeIndex = $storeIndex; - $this->storeNew = $storeNew; - $this->editStore = $editStore; - $this->deleteStore = $deleteStore; - $this->editGroup = $editGroup; - $this->deleteGroup = $deleteGroup; - $this->adminLogout = $adminLogout; - } - - /** - * Run CreateStoreEntity test. - * - * @param Store $store - * @param ConfigData $config - * @return void - */ - public function test(Store $store, ConfigData $config) - { - // Preconditions - $this->store = $store; - $config->persist(); - $this->adminLogout->open(); - - // Steps - $this->storeIndex->open(); - $this->storeIndex->getGridPageActions()->addStoreView(); - $this->storeNew->getStoreForm()->fill($store); - $this->storeNew->getFormPageActions()->save(); - } - - /** - * Delete store. - * - * @return void - */ - public function tearDown() - { - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => 'store_view_local', 'rollback' => true] - )->run(); - $this->storeIndex->open(); - if ($this->store->getGroupId() === 'Main Website/Main Website Store') { - $this->storeIndex->getStoreGrid()->openStore($this->store); - $this->editStore->getFormPageActions()->delete(); - $deleteStoreFormPageActions = $this->deleteStore->getFormPageActions(); - if ($deleteStoreFormPageActions->isVisible()) { - $this->deleteStore->getForm()->fillForm(); - $deleteStoreFormPageActions->delete(); - } - } else { - $this->storeIndex->getStoreGrid()->openStoreGroup(explode('/', $this->store->getGroupId())[1]); - $this->editGroup->getFormPageActions()->delete(); - $deleteGroupFormPageActions = $this->deleteGroup->getFormPageActions(); - if ($deleteGroupFormPageActions->isVisible()) { - $this->deleteGroup->getForm()->fillForm(); - $deleteGroupFormPageActions->delete(); - } - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestCase/CreateStoreEntityTest.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestCase/CreateStoreEntityTest.xml deleted file mode 100644 index 850cb0524fb..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestCase/CreateStoreEntityTest.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - default - store_name_%isolation% - storecode_%isolation% - Enabled - store_view_local_us - The store view has been saved - main:ce - - - - - - - - default - store_name_%isolation% - storecode_%isolation% - Disabled - - - - - - - - - - custom - store_name_%isolation% - storecode_%isolation% - Enabled - store_view_local_us - The store view has been saved - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestCase/CreateStoreGroupEntityTest.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestCase/CreateStoreGroupEntityTest.php deleted file mode 100644 index a286c21a1e7..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestCase/CreateStoreGroupEntityTest.php +++ /dev/null @@ -1,160 +0,0 @@ - Manage Stores. - * 3. Click "Create Store" button. - * 4. Fill data according to dataset. - * 5. Click "Save Store" button. - * 6. Perform all assertions. - * - * @group Store_Management_(PS) - * @ZephyrId MPERF-6816 - */ -class CreateStoreGroupEntityTest extends Injectable -{ - /** - * Page StoreIndex. - * - * @var StoreIndex - */ - protected $storeIndex; - - /** - * NewGroupIndex page. - * - * @var NewStoreGroup - */ - protected $newStoreGroup; - - /** - * Page EditGroup. - * - * @var EditGroup - */ - protected $editGroup; - - /** - * Page DeleteGroup. - * - * @var DeleteGroup - */ - protected $deleteGroup; - - /** - * Page EditStore. - * - * @var EditStore - */ - protected $editStore; - - /** - * Page DeleteStore. - * - * @var DeleteStore - */ - protected $deleteStore; - - /** - * Store group fixture. - * - * @var StoreGroup - */ - protected $storeGroup; - - /** - * Injection pages. - * - * @param StoreIndex $storeIndex - * @param NewStoreGroup $newStoreGroup - * @param EditStore $editStore - * @param DeleteStore $deleteStore - * @param EditGroup $editGroup - * @param DeleteGroup $deleteGroup - * @return void - */ - public function __inject( - StoreIndex $storeIndex, - NewStoreGroup $newStoreGroup, - EditGroup $editGroup, - DeleteGroup $deleteGroup, - EditStore $editStore, - DeleteStore $deleteStore - ) - { - $this->storeIndex = $storeIndex; - $this->newStoreGroup = $newStoreGroup; - $this->editGroup = $editGroup; - $this->deleteGroup = $deleteGroup; - $this->editStore = $editStore; - $this->deleteStore = $deleteStore; - } - - /** - * Create new StoreGroup. - * - * @param StoreGroup $storeGroup - * @return void - */ - public function test(StoreGroup $storeGroup) - { - $this->storeGroup = $storeGroup; - //Steps - $this->storeIndex->open(); - $this->storeIndex->getGridPageActions()->createStoreGroup(); - $this->newStoreGroup->getEditFormStoreGroup()->fill($storeGroup); - $this->newStoreGroup->getFormPageActions()->save(); - } - - /** - * Delete store. - * - * @return void - */ - public function tearDown() - { - $this->storeIndex->open(); - if ($this->storeGroup->getWebsiteId() !== 'Main Website') { - $this->storeIndex->getStoreGrid()->openWebsite($this->storeGroup->getWebsiteId()); - $this->editStore->getFormPageActions()->delete(); - $deleteStoreFormPageActions = $this->deleteStore->getFormPageActions(); - if ($deleteStoreFormPageActions->isVisible()) { - $this->deleteStore->getForm()->fillForm(); - $deleteStoreFormPageActions->delete(); - } - } else { - $this->storeIndex->getStoreGrid()->openStoreGroupByName($this->storeGroup->getName()); - $this->editStore->getFormPageActions()->delete(); - $deleteStoreFormPageActions = $this->deleteStore->getFormPageActions(); - if ($deleteStoreFormPageActions->isVisible()) { - $this->deleteStore->getForm()->fillForm(); - $deleteStoreFormPageActions->delete(); - } - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestCase/CreateStoreGroupEntityTest.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestCase/CreateStoreGroupEntityTest.xml deleted file mode 100644 index 1ec681ccb10..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestCase/CreateStoreGroupEntityTest.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - main_website - store_name_%isolation% - default_category - - - - - - - custom_website - store_name_%isolation% - root_category - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestCase/CreateWebsiteEntityTest.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestCase/CreateWebsiteEntityTest.php deleted file mode 100644 index ae013cd478c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestCase/CreateWebsiteEntityTest.php +++ /dev/null @@ -1,222 +0,0 @@ - Manage Stores. - * 3. Click "Create Website" button. - * 4. Fill data according to dataset. - * 5. Create Store with created Website. - * 6. Create StoreView with created Store. - * 7. Create folder with appropriate files for created Website. - * 8. Configure configuration settings for created Website. - * 9. Perform all assertions - * - * @group Store_Management_(MX) - * @ZephyrId MPERF-7232 - */ -class CreateWebsiteEntityTest extends Injectable -{ - /** - * Page StoreIndex. - * - * @var StoreIndex - */ - protected $storeIndex; - - /** - * Website Fixture. - * - * @var Website - */ - protected $website; - - /** - * Page EditStore. - * - * @var EditStore - */ - protected $editStore; - - /** - * Page DeleteStore. - * - * @var DeleteStore - */ - protected $deleteStore; - - /** - * Page NewWebsite. - * - * @var NewWebsite - */ - protected $newWebsite; - - /** - * Fixture Factory. - * - * @var FixtureFactory - */ - protected $fixtureFactory; - - /** - * Prepare fixture factory for test. - * - * @param FixtureFactory $fixtureFactory - * @return void - */ - public function __prepare(FixtureFactory $fixtureFactory) - { - $this->fixtureFactory = $fixtureFactory; - } - - /** - * Preparing pages for test. - * - * @param StoreIndex $storeIndex - * @param EditStore $editStore - * @param DeleteStore $deleteStore - * @param NewWebsite $newWebsite - * @return void - */ - public function __inject( - StoreIndex $storeIndex, - EditStore $editStore, - DeleteStore $deleteStore, - NewWebsite $newWebsite - ) { - $this->storeIndex = $storeIndex; - $this->editStore = $editStore; - $this->deleteStore = $deleteStore; - $this->newWebsite = $newWebsite; - } - - /** - * Run Create Website Entity test. - * - * @param Website $website - * @param StoreGroup $store - * @param Store $storeView - * @return array - */ - public function test(Website $website, StoreGroup $store, Store $storeView) - { - // Steps - $this->storeIndex->open(); - $this->website = $this->createWebsite($website); - - // Persisting Store and StoreView with created website - $store = $this->persistStore($store); - $storeView = $this->persistStoreView($storeView, $store); - - return ['storeView' => $storeView]; - } - - /** - * Create website from admin panel. - * - * @param Website $website - * @return Website - */ - protected function createWebsite(Website $website) - { - $this->storeIndex->getGridPageActions()->createWebsite(); - $this->newWebsite->getWebsiteForm()->fill($website); - $this->newWebsite->getFormPageActions()->save(); - - return $this->prepareWebsite($website); - } - - /** - * Persist store with created website. - * - * @param StoreGroup $store - * @return StoreGroup - */ - protected function persistStore(StoreGroup $store) - { - $category = $store->getDataFieldConfig('root_category_id')['source']->getCategory(); - $data = ['website_id' => ['website' => $this->website], 'root_category_id' => ['category' => $category]]; - $store = $this->fixtureFactory->createByCode('storeGroup', ['data' => array_merge($store->getData(), $data)]); - $store->persist(); - - return $store; - } - - /** - * Persist store view with created store. - * - * @param Store $storeView - * @param StoreGroup $store - * @return Store - */ - protected function persistStoreView(Store $storeView, StoreGroup $store) - { - $data = ['data' => array_merge($storeView->getData(), ['group_id' => ['store_group' => $store]])]; - $storeView = $this->fixtureFactory->createByCode('store', $data); - $storeView->persist(); - - return $storeView; - } - - /** - * Prepare website for test. - * - * @param Website $website - * @return Website - */ - protected function prepareWebsite(Website $website) - { - $id = preg_replace("@.*/(\d+)/@", "$1", $this->storeIndex->getStoreGrid()->getLinkUrl($website->getName())); - $data = array_merge($website->getData(), ['website_id' => $id]); - - return $this->fixtureFactory->createByCode('website', ['data' => $data]); - } - - /** - * Delete Website after test variation. - * - * @return void - */ - public function tearDown() - { - // Delete Website - if ($this->website->hasData('website_id')) { - $this->storeIndex->open(); - $storeGrid = $this->storeIndex->getStoreGrid(); - $storeGrid->openWebsite($this->website->getName()); - $this->editStore->getFormPageActions()->delete(); - $deleteStoreFormPageActions = $this->deleteStore->getFormPageActions(); - if ($deleteStoreFormPageActions->isVisible()) { - $this->deleteStore->getForm()->fillForm(); - $deleteStoreFormPageActions->delete(); - } - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestCase/CreateWebsiteEntityTest.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestCase/CreateWebsiteEntityTest.xml deleted file mode 100644 index 9dfc84f99da..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestCase/CreateWebsiteEntityTest.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - custom_website - custom - custom - main:ce - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestStep/DeleteStoreGroupsStep.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestStep/DeleteStoreGroupsStep.php deleted file mode 100644 index ada33bfc2f3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestStep/DeleteStoreGroupsStep.php +++ /dev/null @@ -1,94 +0,0 @@ -storeIndex = $storeIndex; - $this->editStore = $editStore; - $this->deleteStore = $deleteStore; - $this->storeGroups = $storeGroups; - } - - /** - * Delete store groups. - * - * @return void - */ - public function run() - { - foreach ($this->storeGroups as $storeGroup) { - /** @var StoreGroup $storeGroup */ - $this->storeIndex->getStoreGrid()->openStoreGroupByName($storeGroup->getName()); - $this->editStore->getFormPageActions()->delete(); - $deleteStoreFormPageActions = $this->deleteStore->getFormPageActions(); - if ($deleteStoreFormPageActions->isVisible()) { - $this->deleteStore->getForm()->fillForm(); - $deleteStoreFormPageActions->delete(); - } - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestStep/DeleteWebsiteStep.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestStep/DeleteWebsiteStep.php deleted file mode 100644 index 79cbbd35f3a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestStep/DeleteWebsiteStep.php +++ /dev/null @@ -1,92 +0,0 @@ -websitesNames = $websitesNames; - $this->storeIndex = $storeIndex; - $this->editWebsite = $editWebsite; - $this->deleteWebsite = $deleteWebsite; - } - - /** - * Delete websites. - * - * @return void - */ - public function run() - { - foreach ($this->websitesNames as $websiteName) { - $this->storeIndex->open(); - $this->storeIndex->getStoreGrid()->openWebsite($websiteName); - $this->editWebsite->getFormPageActions()->delete(); - $deleteWebsiteForm = $this->deleteWebsite->getForm(); - if ($deleteWebsiteForm->isVisible()) { - $deleteWebsiteForm->delete(); - } - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/etc/curl/di.xml deleted file mode 100644 index 8b947467043..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/etc/curl/di.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/etc/fixture.xml deleted file mode 100644 index 84212dce5bd..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/etc/fixture.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - flat - core_website - Magento\Store\Model\Resource\Website\Collection - code - - - flat - core_store_group - Magento\Store\Model\Resource\Group\Collection - - - flat - core_store - Magento\Store\Model\Resource\Store\Collection - code - - - flat - core_config_data - Mage\Core\Model\Resource\Config\Data\Collection - -
        - section - virtual -
        -
        -
        -
        diff --git a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/Block/Directpost/Form.php b/dev/tests/functional/tests/app/Mage/Authorizenet/Test/Block/Directpost/Form.php deleted file mode 100644 index 81b52aa04a8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/Block/Directpost/Form.php +++ /dev/null @@ -1,24 +0,0 @@ - - - - payment - - - select - - - - select - - - select - - - - diff --git a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/Repository/ConfigData.xml b/dev/tests/functional/tests/app/Mage/Authorizenet/Test/Repository/ConfigData.xml deleted file mode 100644 index ae5728ba108..00000000000 --- a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/Repository/ConfigData.xml +++ /dev/null @@ -1,341 +0,0 @@ - - - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Authorize Only - authorize - - - payment - 1 - authorize - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - No - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - - - payment - 1 - No - - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Authorize and Capture - authorize_capture - - - payment - 1 - authorize - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - No - - - - payment - 1 - Yes - 1 - - - - - payment - 1 - No - - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Authorize Only - authorize - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 0 - No - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - - - payment - 1 - No - - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Authorize and Capture - authorize_capture - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - No - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - - - payment - 1 - No - - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Authorize Only - authorize - - - payment - 1 - authorize - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - No - - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - payment - 1 - Yes - 1 - - - - - payment - 1 - No - - - - payment - 1 - No - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOfflineInvoiceForAuthorizenetDirectpostMethodTest.php b/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOfflineInvoiceForAuthorizenetDirectpostMethodTest.php deleted file mode 100644 index d9b36410ecf..00000000000 --- a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOfflineInvoiceForAuthorizenetDirectpostMethodTest.php +++ /dev/null @@ -1,50 +0,0 @@ - Orders. - * 10. Select created order in the grid and open it. - * 11. Click 'Invoice' button. - * 12. Fill data according to dataset. - * 13. Click 'Submit Invoice' button. - * 14. Perform assertions. - * - * @group Order_Management_(CS) - * @ZephyrId MPERF-7251 - */ -class CreateOfflineInvoiceForAuthorizenetDirectpostMethodTest - extends CreateOfflineInvoiceForOnlinePaymentsMethodsWithIFrameTest -{ - /* tags */ - const TEST_TYPE = '3rd_party_test'; - /* end tags */ -} diff --git a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOfflineInvoiceForAuthorizenetDirectpostMethodTest.xml b/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOfflineInvoiceForAuthorizenetDirectpostMethodTest.xml deleted file mode 100644 index d8f18353cac..00000000000 --- a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOfflineInvoiceForAuthorizenetDirectpostMethodTest.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - Create full invoice for authorizenet directpost - authorizenet_directpost - catalogProductSimple::default - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - authorizenet_directpost - for_iframe - yes - comments for invoice - Capture Offline - 315.00 - 315.00 - 100.00 - 300.00 - 300.00 - Processing - payment_method:authorize_net_dp - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOfflineInvoiceForOnlinePaymentsMethodsWithoutIFrameTest.xml b/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOfflineInvoiceForOnlinePaymentsMethodsWithoutIFrameTest.xml deleted file mode 100644 index 5a30b94c8d3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOfflineInvoiceForOnlinePaymentsMethodsWithoutIFrameTest.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - Create full invoice with shipment for authorize.net - authorizenet_without_3d_secure - catalogProductSimple::default - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - authorizenet - default - comments for invoice - Capture Offline - Yes - 315.00 - 315.00 - Shipped - 100.00 - 300.00 - 300.00 - Complete - payment_method:authorize_net - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOfflineRefundForAuthorizenetDirectpostMethodTest.php b/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOfflineRefundForAuthorizenetDirectpostMethodTest.php deleted file mode 100644 index 310a7614fbb..00000000000 --- a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOfflineRefundForAuthorizenetDirectpostMethodTest.php +++ /dev/null @@ -1,95 +0,0 @@ - Orders. - * 10. Select created order in the grid and open it. - * 11. Click 'Invoice' button. - * 12. Fill data according to dataset. - * 13. Click 'Submit Invoice' button. - * 14. Perform assertions. - * - * @group Order_Management_(CS) - * @ZephyrId MPERF-7280 - */ -class CreateOfflineRefundForAuthorizenetDirectpostMethodTest extends Scenario -{ - /* tags */ - const TEST_TYPE = '3rd_party_test'; - /* end tags */ - - /** - * Customer logout page. - * - * @var CustomerAccountLogout - */ - protected $customerAccountLogout; - - /** - * Prepare environment for test. - * - * @param CustomerAccountLogout $customerAccountLogout - * @return void - */ - public function __prepare(CustomerAccountLogout $customerAccountLogout) - { - $this->objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - $this->customerAccountLogout = $customerAccountLogout; - } - - /** - * Create online refund with online payments methods with i-frame. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } - - /** - * Disable included config, delete all tax rules and logout after test. - * - * @return void - */ - public function tearDown() - { - $this->objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - $this->customerAccountLogout->open(); - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => $this->currentVariation['arguments']['configData'], 'rollback' => true] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOfflineRefundForAuthorizenetDirectpostMethodTest.xml b/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOfflineRefundForAuthorizenetDirectpostMethodTest.xml deleted file mode 100644 index 8ffdfbe2be1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOfflineRefundForAuthorizenetDirectpostMethodTest.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - Create full refund for Authorize.net direct post - catalogProductSimple::default - authorizenet_directpost - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - authorizenet_directpost - for_iframe - yes - comments for credit memo - 315.00 - 315.00 - 100.00 - 300.00 - 300.00 - Closed - payment_method:authorize_net_dp - - - - - - - - - - Create partial credit memo for Authorize.net direct post - catalogProductSimple::default - authorizenet_directpost - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - authorizenet_directpost - for_iframe - yes - true - 1 - comments for credit memo - 115.00 - 115.00 - 1 - 100.00 - 100.00 - 100.00 - Processing - payment_method:authorize_net_dp - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOnlineInvoiceForAuthorizenetDirectpostMethodTest.php b/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOnlineInvoiceForAuthorizenetDirectpostMethodTest.php deleted file mode 100644 index cd4c520851d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOnlineInvoiceForAuthorizenetDirectpostMethodTest.php +++ /dev/null @@ -1,50 +0,0 @@ - Orders. - * 10. Select created order in the grid and open it. - * 11. Click 'Invoice' button. - * 12. Fill data according to dataset. - * 13. Click 'Submit Invoice' button. - * 14. Perform assertions. - * - * @group Order_Management_(CS) - * @ZephyrId MPERF-7251 - */ -class CreateOnlineInvoiceForAuthorizenetDirectpostMethodTest - extends CreateOnlineInvoiceForOnlinePaymentsMethodsWithIFrameTest -{ - /* tags */ - const TEST_TYPE = '3rd_party_test'; - /* end tags */ -} diff --git a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOnlineInvoiceForAuthorizenetDirectpostMethodTest.xml b/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOnlineInvoiceForAuthorizenetDirectpostMethodTest.xml deleted file mode 100644 index 7a422fbd662..00000000000 --- a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOnlineInvoiceForAuthorizenetDirectpostMethodTest.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - Create full invoice for authorizenet directpost - authorizenet_directpost - catalogProductSimple::default - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - authorizenet_directpost - for_iframe - yes - comments for invoice - 315.00 - 315.00 - 100.00 - 300.00 - 300.00 - Processing - payment_method:authorize_net_dp - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOnlineInvoiceForOnlinePaymentsMethodsWithoutIFrameTest.xml b/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOnlineInvoiceForOnlinePaymentsMethodsWithoutIFrameTest.xml deleted file mode 100644 index dda59eceab2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOnlineInvoiceForOnlinePaymentsMethodsWithoutIFrameTest.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - Create full invoice with shipment for authorize.net - authorizenet_without_3d_secure - catalogProductSimple::default - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - authorizenet - default - comments for invoice - Yes - 315.00 - 315.00 - Shipped - 100.00 - 300.00 - 300.00 - Complete - payment_method:authorize_net - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOrderWithAuthorizenetDirectpostMethodTest.php b/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOrderWithAuthorizenetDirectpostMethodTest.php deleted file mode 100644 index fff730c0051..00000000000 --- a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOrderWithAuthorizenetDirectpostMethodTest.php +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - authorizenet_directpost - catalogProductSimple::order_default - default_frontend - guest - no - customer_US - Flat Rate - Fixed - authorizenet_directpost - for_iframe - yes - Authorization - Authorized - 105 - payment_method:authorize_net_dp - - - - - - - authorizenet_directpost - catalogProductSimple::order_default - default_frontend_new - login - customer_US_login - Flat Rate - Fixed - authorizenet_directpost - for_iframe - yes - Authorization - Authorized - 105 - payment_method:authorize_net_dp - - - - - - - authorizenet_directpost_capture - catalogProductSimple::order_default - default_frontend_new - register - no - customer_US_login - Flat Rate - Fixed - authorizenet_directpost - for_iframe - yes - Capture - Captured - 105 - payment_method:authorize_net_dp - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOrderWithOnlinePaymentsMethodsWith3DSecureTest.xml b/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOrderWithOnlinePaymentsMethodsWith3DSecureTest.xml deleted file mode 100644 index 68ded19b8c1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOrderWithOnlinePaymentsMethodsWith3DSecureTest.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - authorizenet_with_3d_secure_action_authorized, enable_3d_secure - catalogProductSimple::order_default - default_frontend - guest - customer_US - no - Flat Rate - Fixed - authorizenet - visa_3d_secure_positive_without_pass - visa_3d_secure_positive - 105.00 - true - payment_method:authorize_net - - - - - - authorizenet_with_3d_secure_action_authorized, enable_3d_secure - catalogProductSimple::order_default - default_frontend - guest - customer_US - no - Flat Rate - Fixed - authorizenet - visa_3d_secure_negative_without_pass - visa_3d_secure_negative - 105.00 - false - payment_method:authorize_net - - - - diff --git a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOrderWithOnlinePaymentsMethodsWithoutIFrameTest.xml b/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOrderWithOnlinePaymentsMethodsWithoutIFrameTest.xml deleted file mode 100644 index e1862182529..00000000000 --- a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOrderWithOnlinePaymentsMethodsWithoutIFrameTest.xml +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - authorizenet_without_3d_secure - catalogProductSimple::order_default - default_frontend - guest - no - customer_US - Flat Rate - Fixed - authorizenet - default - Authorization - Authorized - 105 - payment_method:authorize_net, main:ce - - - - - - - authorizenet_without_3d_secure - catalogProductSimple::order_default - default_frontend_new - login - customer_US_login - Flat Rate - Fixed - authorizenet - default - Authorization - Authorized - 105 - payment_method:authorize_net - - - - - - - authorizenet_without_3d_secure_action_capture - catalogProductSimple::order_default - default_frontend_new - register - no - customer_UK - Flat Rate - Fixed - authorizenet - default - Capture - Captured - 105 - payment_method:authorize_net - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateShipmentForAuthorizenetDirectpostMethodTest.php b/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateShipmentForAuthorizenetDirectpostMethodTest.php deleted file mode 100644 index ca7bd241977..00000000000 --- a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateShipmentForAuthorizenetDirectpostMethodTest.php +++ /dev/null @@ -1,50 +0,0 @@ - Orders. - * 10. Select created order in the grid and open it. - * 11. Click 'Ship' button. - * 12. Fill data according to dataset. - * 13. Click 'Submit Shipment' button. - * 14. Perform assertions. - * - * @group Order_Management_(CS) - * @ZephyrId MPERF-7251 - */ -class CreateShipmentForAuthorizenetDirectpostMethodTest - extends CreateShipmentForOnlinePaymentMethodsWithIFrameTest -{ - /* tags */ - const TEST_TYPE = '3rd_party_test'; - /* end tags */ -} diff --git a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateShipmentForAuthorizenetDirectpostMethodTest.xml b/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateShipmentForAuthorizenetDirectpostMethodTest.xml deleted file mode 100644 index ad5ea89cc92..00000000000 --- a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateShipmentForAuthorizenetDirectpostMethodTest.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - Create full shipment for Authorize.net direct post - catalogProductSimple::default - authorizenet_directpost - default_frontend_new - register - no - customer_US_login - Flat Rate - Fixed - authorizenet_directpost - for_iframe - yes - comments for shipment - 3 - 3 - Processing - payment_method:authorize_net_dp - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestStep/FillCreditCardStep.php b/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestStep/FillCreditCardStep.php deleted file mode 100644 index 4a4daea7559..00000000000 --- a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestStep/FillCreditCardStep.php +++ /dev/null @@ -1,69 +0,0 @@ -create('Mage\Payment\Test\Fixture\Cc', ['dataset' => $payment['cc']]); - } - $this->payment = $payment; - $this->checkoutOnepage = $checkoutOnepage; - } - - /** - * Fill credit card step. - * - * @return void - */ - public function run() - { - $this->checkoutOnepage->getAuthorizenetDirectpostForm()->fill($this->payment['cc']); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/etc/testcase.xml b/dev/tests/functional/tests/app/Mage/Authorizenet/Test/etc/testcase.xml deleted file mode 100644 index 4565cb0ed5e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/etc/testcase.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle.php b/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle.php deleted file mode 100644 index 8f59ae70637..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle.php +++ /dev/null @@ -1,141 +0,0 @@ -blockFactory->create( - 'Mage\Bundle\Test\Block\Adminhtml\Catalog\Product\Edit\Tab\Bundle\Option', - ['element' => $this->_rootElement->find(sprintf($this->bundleOptionsBlock, $blockNumber))] - ); - } - - /** - * Fill bundle options. - * - * @param array $fields - * @param Element|null $element - * @return $this - */ - public function fillFormTab(array $fields, Element $element = null) - { - if (isset($fields['bundle_selections'])) { - foreach ($fields['bundle_selections']['value'] as $key => $bundleOption) { - $this->createAndEditOption($key); - $this->getBundleOptionBlock($key)->fillOption($bundleOption); - } - unset($fields['bundle_selections']); - } - parent::fillFormTab($fields, $element); - } - - /** - * Open exist option for edit or create new. - * - * @param int $optionKey - * @return void - */ - protected function createAndEditOption($optionKey) - { - $itemOption = $this->_rootElement->find(sprintf($this->openOption, $optionKey)); - $isContent = $this->_rootElement->find(sprintf($this->optionContent, $optionKey))->isVisible(); - if ($itemOption->isVisible() && !$isContent) { - $itemOption->click(); - } elseif (!$itemOption->isVisible()) { - $this->_rootElement->find($this->addNewOption)->click(); - } - } - - /** - * Get data from fields on bundle items tab. - * - * @param array|null $fields - * @param Element|null $element - * @return array - */ - public function getDataFormTab($fields = null, Element $element = null) - { - $newFields = []; - if (isset($fields['bundle_selections'])) { - foreach ($fields['bundle_selections']['value'] as $key => $bundleOption) { - $bundleOption = $this->prepareBundleOptions($bundleOption); - $newFields['bundle_selections'][$key] = $this->getBundleOptionBlock($key)->getOptionData($bundleOption); - } - unset($fields['bundle_selections']); - } - - return array_merge($newFields, parent::getDataFormTab($fields, $element)); - } - - /** - * Prepare bundle options. - * - * @param array $bundleOption - * @return array - */ - protected function prepareBundleOptions(array $bundleOption) - { - foreach ($bundleOption['assigned_products'] as $productKey => $product) { - $bundleOption['assigned_products'][$productKey]['getProductSku'] = $product['sku']; - $bundleOption['assigned_products'][$productKey]['getProductName'] = $product['name']; - } - - return $bundleOption; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php b/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php deleted file mode 100644 index 0ffc18db1c5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php +++ /dev/null @@ -1,162 +0,0 @@ -blockFactory->create( - 'Mage\Bundle\Test\Block\Adminhtml\Catalog\Product\Edit\Tab\Bundle\Option\Search\Grid', - ['element' => $this->_rootElement->find($this->searchGridBlock)] - ); - } - - /** - * Get item selection product block. - * - * @param int $rowIndex - * @return Selection - */ - protected function getSelectionBlock($rowIndex) - { - return $this->blockFactory->create( - 'Mage\Bundle\Test\Block\Adminhtml\Catalog\Product\Edit\Tab\Bundle\Option\Selection', - ['element' => $this->_rootElement->find(sprintf($this->selectionBlock, $rowIndex), Locator::SELECTOR_XPATH)] - ); - } - - /** - * Get backend abstract block. - * - * @return Template - */ - protected function getTemplateBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Template', - ['element' => $this->_rootElement->find($this->templateBlock, Locator::SELECTOR_XPATH)] - ); - } - - /** - * Fill bundle option. - * - * @param array $fields - * @return void - */ - public function fillOption(array $fields) - { - $mapping = $this->dataMapping($fields); - $this->_fill($mapping); - $this->addAssignedProducts($fields['assigned_products']); - } - - /** - * Add assigned products. - * - * @param array $assignedProducts - * @return void - */ - protected function addAssignedProducts(array $assignedProducts) - { - foreach ($assignedProducts as $key => $product) { - $this->addProduct(['sku' => $product['sku']]); - $this->getSelectionBlock(++$key)->fillProductRow($product); - } - } - - /** - * Add product to option. - * - * @param array $filter - * @return void - */ - protected function addProduct(array $filter) - { - $this->_rootElement->find($this->addSelection)->click(); - $this->getTemplateBlock()->waitLoader(); - $searchBlock = $this->getSearchGridBlock(); - $searchBlock->searchAndSelect($filter); - $searchBlock->addProducts(); - } - - /** - * Get data bundle option. - * - * @param array $fields - * @return array - */ - public function getOptionData(array $fields) - { - $mapping = $this->dataMapping($fields); - $newField = $this->_getData($mapping); - foreach ($fields['assigned_products'] as $key => $field) { - $newField['assigned_products'][$key] = $this->getSelectionBlock($key + 1)->getProductRow($field); - } - - return $newField; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.xml b/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.xml deleted file mode 100644 index 1b6c3f92a8f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - <selector>[name$="[title]"]</selector> - <strategy>css selector</strategy> - - - [name$='[type]'] - css selector - select - - - [name$="[required]"] - css selector - select - - - [name$='[position]'] - css selector - - - diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search/Grid.php b/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search/Grid.php deleted file mode 100644 index 76cbb6ceb81..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search/Grid.php +++ /dev/null @@ -1,57 +0,0 @@ - [ - 'selector' => 'input[name=sku]' - ] - ]; - - /** - * Press 'Add Selected Product(s) to Option' button. - * - * @return void - */ - public function addProducts() - { - $this->_rootElement->find($this->addProducts)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Selection.php b/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Selection.php deleted file mode 100644 index fbd7de763ad..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Selection.php +++ /dev/null @@ -1,93 +0,0 @@ -dataMapping($this->unsetElements($fields)); - $this->_fill($mapping); - } - - /** - * Get data item selection. - * - * @param array $fields - * @return array - */ - public function getProductRow(array $fields) - { - $mapping = $this->dataMapping($this->unsetElements($fields)); - $newFields = $this->_getData($mapping); - $newFields['sku'] = $this->getProductSku($mapping['getProductSku']); - $newFields['name'] = $this->getProductName($mapping['getProductName']); - unset($newFields['getProductSku'], $newFields['getProductName']); - - return $newFields; - } - - /** - * Get product SKU. - * - * @param array $skuField - * @return string - */ - protected function getProductSku(array $skuField) - { - $productSku = $this->_rootElement->find($skuField['selector'], $skuField['strategy'])->getText(); - return preg_replace('@SKU: (.*)@', '$1', $productSku); - } - - /** - * Get product name. - * - * @param array $nameField - * @return string - */ - protected function getProductName(array $nameField) - { - $productName = $this->_rootElement->find($nameField['selector'], $nameField['strategy'])->getText(); - preg_match('@(.*)\n@', $productName, $matches); - return isset($matches[1]) ? $matches[1] : ''; - } - - protected function unsetElements(array $fields) - { - foreach($this->unsetElementsData as $value) { - unset($fields[$value]); - } - - return $fields; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Selection.xml b/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Selection.xml deleted file mode 100644 index d19b3725278..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Selection.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - [name$="[is_default]"] - checkbox - - - [name$='[selection_price_value]'] - - - [name$='[selection_price_type]'] - select - - - [name$='[selection_qty]'] - - - [name$='[selection_can_change_qty]'] - select - - - [name$="[is_default]"] - checkbox - - - ./td[1]/div[@class="nobr"] - xpath - - - ./td[1][div[@class="nobr"]] - xpath - - - diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Adminhtml/Catalog/Product/ProductForm.xml b/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Adminhtml/Catalog/Product/ProductForm.xml deleted file mode 100644 index 11672972468..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Adminhtml/Catalog/Product/ProductForm.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - \Mage\Adminhtml\Test\Block\Widget\Tab - //ul[@id="product_info_tabs"]/li[1]/a - xpath - product - - - select - - - select - - - - - \Mage\Bundle\Test\Block\Adminhtml\Catalog\Product\Edit\Tab\Bundle - #product_info_tabs_bundle_items - css selector - product - - - select - - - - - \Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Prices - //ul[@id="product_info_tabs"]/li[2]/a - xpath - product - - - select - - - select - - - - diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/Price.php b/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/Price.php deleted file mode 100644 index 84a5eb42a6d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/Price.php +++ /dev/null @@ -1,67 +0,0 @@ - [ - 'selector' => '.regular-price .price' - ], - 'old_price' => [ - 'selector' => '.old-price .price' - ], - 'minimal_price' => [ - 'selector' => 'p.minimal-price .price', - ], - 'price_from' => [ - 'selector' => 'p.price-from .price', - ], - 'price_to' => [ - 'selector' => 'p.price-to .price', - ] - ]; - - /** - * Get price from. - * - * @param string $currency - * @return string - */ - public function getPriceFrom($currency = '$') - { - return $this->getTypePrice('price_from', $currency); - } - - /** - * Get price to. - * - * @param string $currency - * @return string - */ - public function getPriceTo($currency = '$') - { - return $this->getTypePrice('price_to', $currency); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View.php b/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View.php deleted file mode 100644 index 84f7cdeabfd..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View.php +++ /dev/null @@ -1,170 +0,0 @@ -blockFactory->create( - 'Mage\Bundle\Test\Block\Catalog\Product\Price', - ['element' => $this->_rootElement->find($this->priceBlock, Locator::SELECTOR_XPATH)] - ); - } - - /** - * Get bundle options block. - * - * @return Bundle - */ - public function getBundleBlock() - { - return $this->blockFactory->create( - 'Mage\Bundle\Test\Block\Catalog\Product\View\Type\Bundle', - ['element' => $this->_rootElement->find($this->bundleBlock, Locator::SELECTOR_XPATH)] - ); - } - - /** - * Return product options. - * - * @param InjectableFixture $product [optional] - * @return array - */ - public function getOptions(InjectableFixture $product = null) - { - $options['bundle_options'] = $this->getBundleBlock()->getOptions($product); - $options += parent::getOptions($product); - - return $options; - } - - /** - * Fill in the option specified for the product. - * - * @param InjectableFixture $product - * @return void - */ - public function fillOptions(InjectableFixture $product) - { - /** @var BundleProduct $product */ - $bundleCheckoutData = $this->prepareBundleCheckoutData($product); - $this->getBundleBlock()->fillBundleOptions($bundleCheckoutData); - } - - /** - * Prepare checkout data for fill bundle options. - * - * @param BundleProduct $product - * @return array - */ - protected function prepareBundleCheckoutData(BundleProduct $product) - { - $assignedProducts = $product->getDataFieldConfig('bundle_selections')['source']->getProducts(); - $bundleOptions = $product->getBundleSelections(); - $checkoutData = $product->getCheckoutData(); - $checkoutData = isset($checkoutData['options']['bundle_options']) - ? $checkoutData['options']['bundle_options'] - : []; - - foreach ($checkoutData as $optionKey => $option) { - $optionIndex = str_replace('option_key_', '', $optionKey); - $names = explode(',', $checkoutData[$optionKey]['value']['name']); - $checkoutData[$optionKey]['title'] = $bundleOptions[$optionIndex]['title']; - $checkoutData[$optionKey]['type'] = $bundleOptions[$optionIndex]['type']; - $checkoutData[$optionKey]['value']['name'] = $this->prepareOptionValue( - $names, - $assignedProducts[$optionIndex] - ); - } - - return $checkoutData; - } - - /** - * Prepare option value. - * - * @param array $values - * @param array $assignedProducts - * @return mixed - */ - protected function prepareOptionValue(array $values, array $assignedProducts) - { - return (count($values) > 1) - ? $this->prepareOptionMultiValue($values, $assignedProducts) - : $this->prepareOptionSimpleValue($values[0], $assignedProducts); - } - - /** - * Prepare option simple value. - * - * @param string $value - * @param array $assignedProducts - * @return string - */ - protected function prepareOptionSimpleValue($value, array $assignedProducts) - { - $productIndex = str_replace('product_key_', '', $value); - return $assignedProducts[$productIndex]->getName(); - } - - /** - * Prepare option multilpe value. - * - * @param array $values - * @param array $assignedProducts - * @return array - */ - protected function prepareOptionMultiValue(array $values, array $assignedProducts) - { - $optionValues = []; - foreach ($values as $key => $value) { - $optionValues[$key] = $this->prepareOptionSimpleValue($value, $assignedProducts); - } - - return $optionValues; - } - - /** - * Get text of Stock Availability control. - * - * @return string - */ - public function getBundleStockAvailability() - { - return strtolower($this->_rootElement->find($this->stockAvailability)->getText()); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View/Type/Bundle.php b/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View/Type/Bundle.php deleted file mode 100644 index 4cc095ce57b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View/Type/Bundle.php +++ /dev/null @@ -1,305 +0,0 @@ -getBundleSelections(); - $listFormOptions = $this->getListOptions(); - $formOptions = []; - - foreach ($bundleSelections as $option) { - $optionData = $this->prepareOption($listFormOptions, $option); - $getTypeData = 'get' . $this->optionNameConvert($option['type']) . 'Data'; - $formOptions[] = array_merge($optionData, $this->$getTypeData($listFormOptions[$option['title']])); - } - - return $formOptions; - } - - /** - * Prepare option data. - * - * @param array $listFormOptions - * @param array $fixtureOption - * @return array - * @throws \Exception - */ - protected function prepareOption(array $listFormOptions, array $fixtureOption) - { - $title = $fixtureOption['title']; - if (!isset($listFormOptions[$title])) { - throw new \Exception("Can't find option: \"{$title}\""); - } - /** @var Element $optionElement */ - $optionElement = $listFormOptions[$title]; - $optionData = [ - 'title' => $title, - 'type' => $fixtureOption['type'], - 'is_require' => $this->checkRequireOption($optionElement) - ]; - - return $optionData; - } - - /** - * Check option is require or not. - * - * @param Element $optionElement - * @return string - */ - protected function checkRequireOption(Element $optionElement) - { - return $optionElement->find($this->required, Locator::SELECTOR_XPATH)->isVisible() ? 'Yes' : 'No'; - } - - /** - * Fill bundle options. - * - * @param array $bundleOptions - * @return void - */ - public function fillBundleOptions($bundleOptions) - { - foreach ($bundleOptions as $option) { - $this->getItemOptionForm($option)->fillOption($option['value']); - } - } - - /** - * Get item option form. - * - * @param array $option - * @return Option - */ - protected function getItemOptionForm(array $option) - { - $selector = sprintf($this->bundleOptionForm, $option['title']); - return $this->blockFactory->create( - 'Mage\Bundle\Test\Block\Catalog\Product\View\Type\Option\\' . $this->optionNameConvert($option['type']), - ['element' => $this->_rootElement->find($selector, Locator::SELECTOR_XPATH)] - ); - } - - /** - * Get list options. - * - * @return array - */ - protected function getListOptions() - { - $options = []; - $titles = $this->_rootElement->getElements($this->title, Locator::SELECTOR_XPATH); - foreach ($titles as $key => $title) { - $options[$title->getText()] = $this->_rootElement->find( - sprintf($this->optionElement, $key + 1), - Locator::SELECTOR_XPATH - ); - } - - return $options; - } - - /** - * Get data of "Drop-down" option. - * - * @param Element $option - * @return array - */ - protected function getDropdownData(Element $option) - { - $select = $option->find($this->selectOption, Locator::SELECTOR_XPATH, 'select'); - // Skip "Choose a selection ..."(option #1) - return $this->getSelectOptionsData($select, 2); - } - - /** - * Get data of "Multiple select" option. - * - * @param Element $option - * @return array - */ - protected function getMultipleselectData(Element $option) - { - $multiselect = $option->find($this->selectOption, Locator::SELECTOR_XPATH, 'multiselect'); - $data = $this->getSelectOptionsData($multiselect, 1); - - foreach ($data['options'] as $key => $option) { - $option['title'] = trim(preg_replace('/^[\d]+ x/', '', $option['title'])); - $data['options'][$key] = $option; - } - - return $data; - } - - /** - * Get data of "Radio buttons" option. - * - * @param Element $option - * @return array - */ - protected function getRadiobuttonsData(Element $option) - { - $listOptions = []; - $optionLabels = $option->getElements($this->optionLabel, Locator::SELECTOR_XPATH); - - foreach ($optionLabels as $optionLabel) { - if ($optionLabel->isVisible()) { - $listOptions[] = $this->parseOptionText($optionLabel->getText()); - } - } - - return ['options' => $listOptions]; - } - - /** - * Get data of "Checkbox" option. - * - * @param Element $option - * @return array - */ - protected function getCheckboxData(Element $option) - { - $data = $this->getRadiobuttonsData($option); - - foreach ($data['options'] as $key => $option) { - $option['title'] = trim(preg_replace('/^[\d]+ x/', '', $option['title'])); - $data['options'][$key] = $option; - } - - return $data; - } - - /** - * Get data from option of select and multiselect. - * - * @param Element $element - * @param int $firstOption - * @return array - */ - protected function getSelectOptionsData(Element $element, $firstOption = 1) - { - $listOptions = []; - - $count = $firstOption; - $selectOption = $element->find(sprintf($this->option, $count), Locator::SELECTOR_XPATH); - while ($selectOption->isVisible()) { - $listOptions[] = $this->parseOptionText($selectOption->getText()); - ++$count; - $selectOption = $element->find(sprintf($this->option, $count), Locator::SELECTOR_XPATH); - } - - return ['options' => $listOptions]; - } - - /** - * Parse option text to title and price. - * - * @param string $optionText - * @return array - */ - protected function parseOptionText($optionText) - { - preg_match('`^(.*?)\+ ?\$(\d.*?)$`', $optionText, $match); - $optionPrice = isset($match[2]) ? str_replace(',', '', $match[2]) : 0; - $optionTitle = isset($match[1]) ? trim($match[1]) : $optionText; - - return [ - 'title' => $optionTitle, - 'price' => $optionPrice - ]; - } - - /** - * Convert option name. - * - * @param string $optionType - * @return string - */ - protected function optionNameConvert($optionType) - { - $trimmedOptionType = preg_replace('/[^a-zA-Z]/', '', $optionType); - return ucfirst(strtolower($trimmedOptionType)); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View/Type/Option.php b/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View/Type/Option.php deleted file mode 100644 index 17f7e0f919e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View/Type/Option.php +++ /dev/null @@ -1,36 +0,0 @@ -dataMapping($data); - $this->_fill($mapping); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View/Type/Option/Checkbox.php b/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View/Type/Option/Checkbox.php deleted file mode 100644 index ce8f2660d41..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View/Type/Option/Checkbox.php +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - .//label[contains(.,"%product_name%")]/../preceding-sibling::input - xpath - checkbox - - - diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View/Type/Option/Dropdown.php b/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View/Type/Option/Dropdown.php deleted file mode 100644 index 51e8e11bc97..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View/Type/Option/Dropdown.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - select - select - - - input.qty - - - diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View/Type/Option/Multipleselect.php b/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View/Type/Option/Multipleselect.php deleted file mode 100644 index 41b457366b3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View/Type/Option/Multipleselect.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - .multiselect - multiselect - - - diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View/Type/Option/Radiobuttons.php b/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View/Type/Option/Radiobuttons.php deleted file mode 100644 index 73fbf645055..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View/Type/Option/Radiobuttons.php +++ /dev/null @@ -1,38 +0,0 @@ -dataMapping($data); - $mapping['name']['selector'] = str_replace('%product_name%', $data['name'], $mapping['name']['selector']); - $mapping['name']['value'] = 'Yes'; - $this->_fill($mapping); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View/Type/Option/Radiobuttons.xml b/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View/Type/Option/Radiobuttons.xml deleted file mode 100644 index ac17bf1b6fe..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View/Type/Option/Radiobuttons.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - .//label[contains(.,"%product_name%")]/../preceding-sibling::input - xpath - checkbox - - - .//input[contains(@class, "qty")] - xpath - - - diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Constraint/AssertBundleItemsOnProductPage.php b/dev/tests/functional/tests/app/Mage/Bundle/Test/Constraint/AssertBundleItemsOnProductPage.php deleted file mode 100644 index d8c04344d8e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Constraint/AssertBundleItemsOnProductPage.php +++ /dev/null @@ -1,185 +0,0 @@ -product = $product; - $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - - $productOptions = $this->prepareBundleOptions(); - $formOptions = $catalogProductView->getViewBlock()->getOptions($product)['bundle_options']; - $formOptions = $this->prepareFormData($formOptions); - - $error = $this->verifyData($productOptions, $formOptions); - \PHPUnit_Framework_Assert::assertEmpty($error, $error); - } - - /** - * Prepare form data. - * - * @param array $formOptions - * @return array - */ - protected function prepareFormData(array $formOptions) - { - foreach ($formOptions as $key => $formOption) { - $formOptions[$key] = $this->sortDataByPath($formOption, 'options::title'); - } - - return $this->sortDataByPath($formOptions, '::title'); - } - - /** - * Prepare bundle options. - * - * @return array|null - */ - protected function prepareBundleOptions() - { - $result = []; - $bundleSelections = $this->product->getBundleSelections(); - $assignedProducts = $this->product->getDataFieldConfig('bundle_selections')['source']->getProducts(); - foreach ($bundleSelections as $optionKey => $bundleOption) { - $options = $this->getOptions( - $bundleOption['assigned_products'], - $assignedProducts[$optionKey], - $bundleOption['type'] - ); - $optionData = [ - 'title' => $bundleOption['title'], - 'type' => $bundleOption['type'], - 'is_require' => $bundleOption['required'], - 'options' => $options - ]; - - $result[$optionKey] = $this->sortDataByPath($optionData, 'options::title'); - } - - return $this->sortDataByPath($result, '::title'); - } - - /** - * Get item bundle selections option. - * - * @param array $dataAssignedProducts - * @param array $fixturesAssignedProducts - * @param string $optionType - * @return array - */ - protected function getOptions(array $dataAssignedProducts, array $fixturesAssignedProducts, $optionType) - { - $result = []; - foreach ($fixturesAssignedProducts as $productKey => $fixtureProduct) { - $assignedProductPrice = $this->getAssignedProductPrice( - $dataAssignedProducts[$productKey], - $fixtureProduct, - $optionType - ); - $result[$productKey] = [ - 'title' => $fixtureProduct->getName(), - 'price' => $this->getOptionPrice($assignedProductPrice) - ]; - } - - return $result; - } - - /** - * Get assigned product price. - * - * @param array $dataAssignedProduct - * @param InjectableFixture $fixtureAssignedProduct - * @param string $optionType - * @return float - */ - protected function getAssignedProductPrice( - array $dataAssignedProduct, - InjectableFixture $fixtureAssignedProduct, - $optionType - ) { - $resultPrice = $fixtureAssignedProduct->getPrice(); - if (isset($dataAssignedProduct['selection_price_value'])) { - $assignedItemPrice = ($dataAssignedProduct['selection_price_type'] == 'Fixed') - ? $dataAssignedProduct['selection_price_value'] - : $this->product->getPrice() * $dataAssignedProduct['selection_price_value'] / 100; - $resultPrice = ($optionType == 'Drop-down' || $optionType == 'Radio Buttons') - ? $assignedItemPrice - : $assignedItemPrice * $dataAssignedProduct['selection_qty']; - } - - return $resultPrice; - } - - /** - * Get item option price for item bundle selection. - * - * @param float $assignedProductPrice - * @param string $customerGroup [optional] - * @return string - */ - protected function getOptionPrice($assignedProductPrice, $customerGroup = 'NOT LOGGED IN') - { - if ($this->product->hasData('group_price')) { - $groupPrice = $this->product->getGroupPrice(); - $groupPriceType = array_search($customerGroup, $groupPrice); - $assignedProductPrice -= $assignedProductPrice / 100 * $groupPrice[$groupPriceType]['price']; - } - $assignedProductPrice *= $this->product->hasData('special_price') ? $this->product->getSpecialPrice() / 100 : 1; - - return number_format($assignedProductPrice, 2); - } - - /** - * Return Text if displayed on frontend equals with fixture. - * - * @return string - */ - public function toString() - { - return 'Bundle options data on product page equals to passed from fixture preset.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Constraint/AssertBundlePriceType.php b/dev/tests/functional/tests/app/Mage/Bundle/Test/Constraint/AssertBundlePriceType.php deleted file mode 100644 index 9821efa2883..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Constraint/AssertBundlePriceType.php +++ /dev/null @@ -1,119 +0,0 @@ -product = $product; - $checkoutCartView->open()->getCartBlock()->clearShoppingCart(); - $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - $catalogProductView->getViewBlock()->addToCart($product); - - //Process assertions - $this->assertPrice($checkoutCartView); - } - - /** - * Assert prices on the product view page and shopping cart page. - * - * @param CheckoutCart $checkoutCartView - * @return void - */ - protected function assertPrice(CheckoutCart $checkoutCartView) - { - $formCartItem = $checkoutCartView->getCartBlock()->getCartItem($this->product); - $fixtureCartItem = $this->product->getCheckoutData()['cartItem']; - - $this->assertCartOptions($fixtureCartItem['options']['bundle_options'], $formCartItem->getOptions()); - $this->assertCartPrice($fixtureCartItem['price'], $formCartItem->getCartItemTypePrice('price')); - } - - /** - * Assert cart bundle options. - * - * @param array $fixtureBundleOptions - * @param array $formBundleOptions - * @return void - */ - protected function assertCartOptions(array $fixtureBundleOptions, array $formBundleOptions) - { - foreach ($fixtureBundleOptions as $key => $fixtureOption) { - $cartIndex = str_replace('option_key_', '', $key); - preg_match('`\d+ x .* \$*(.*)`', $formBundleOptions[$cartIndex]['value'], $matches); - \PHPUnit_Framework_Assert::assertEquals($fixtureOption['price'], number_format($matches[1], 2)); - } - } - - /** - * Assert cart price. - * - * @param $fixtureCartPrice - * @param $formCartPrice - * @return void - */ - protected function assertCartPrice($fixtureCartPrice, $formCartPrice) - { - \PHPUnit_Framework_Assert::assertEquals($fixtureCartPrice, number_format($formCartPrice, 2)); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Bundle price on shopping cart page is not correct.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Constraint/AssertBundlePriceView.php b/dev/tests/functional/tests/app/Mage/Bundle/Test/Constraint/AssertBundlePriceView.php deleted file mode 100644 index 900bbf36b4c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Constraint/AssertBundlePriceView.php +++ /dev/null @@ -1,83 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - - //Process assertions - $this->assertPrice($product, $catalogProductView); - } - - /** - * Assert prices on the product view Page - * - * @param BundleProduct $product - * @param CatalogProductView $catalogProductView - * @return void - */ - protected function assertPrice(BundleProduct $product, CatalogProductView $catalogProductView) - { - $priceData = $product->getDataFieldConfig('price')['source']->getPriceData(); - $priceBlock = $catalogProductView->getBundleViewBlock()->getPriceBlock(); - $priceLow = ($product->getPriceView() == 'Price Range') - ? $priceBlock->getPriceFrom() - : $priceBlock->getRegularPrice(); - - \PHPUnit_Framework_Assert::assertEquals($priceData['price_from'], $priceLow); - - if ($product->getPriceView() == 'Price Range') { - \PHPUnit_Framework_Assert::assertEquals($priceData['price_to'], $priceBlock->getPriceTo()); - } - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Bundle price on product view page is not correct.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Constraint/AssertBundleProductForm.php b/dev/tests/functional/tests/app/Mage/Bundle/Test/Constraint/AssertBundleProductForm.php deleted file mode 100644 index b5beafa6b5b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Constraint/AssertBundleProductForm.php +++ /dev/null @@ -1,41 +0,0 @@ -product->getDataFieldConfig('price')['source']->getPriceData(); - $priceBlock = $this->catalogProductView->getBundleViewBlock()->getPriceBlock(); - $priceLow = ($this->product->getPriceView() == 'Price Range') - ? $priceBlock->getPriceFrom() - : $priceBlock->getRegularPrice(); - $priceTo = $priceBlock->getPriceTo(); - - if ($priceData['price_from'] != $priceLow) { - $errors[] = "Bundle price 'From' on product view page is not correct:" - . "\n$priceLow != {$priceData['price_from']}"; - } - if ($this->product->getPriceView() == 'Price Range' && $priceData['price_to'] != $priceTo) { - $errors[] = "Bundle price 'To' on product view page is not correct:" - . "\n$priceTo != {$priceData['price_to']}"; - } - - return empty($errors) ? null : implode("\n", $errors); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Constraint/AssertProductTierPriceOnBundleProductPage.php b/dev/tests/functional/tests/app/Mage/Bundle/Test/Constraint/AssertProductTierPriceOnBundleProductPage.php deleted file mode 100644 index 772bf63b4d9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Constraint/AssertProductTierPriceOnBundleProductPage.php +++ /dev/null @@ -1,83 +0,0 @@ -getTierPrice(); - foreach ($tierPrices as $key => $tierPrice) { - $tierPrices[$key]['price'] = number_format($tierPrices[$key]['price'], $this->priceFormat); - } - - return $tierPrices; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Tier price is displayed on the bundle product page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Fixture/BundleProduct.xml b/dev/tests/functional/tests/app/Mage/Bundle/Test/Fixture/BundleProduct.xml deleted file mode 100644 index 487e8d7a466..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Fixture/BundleProduct.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - bundle - - bundle - 4 - - product - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Fixture/BundleProduct/BundleSelections.php b/dev/tests/functional/tests/app/Mage/Bundle/Test/Fixture/BundleProduct/BundleSelections.php deleted file mode 100644 index c434e57418d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Fixture/BundleProduct/BundleSelections.php +++ /dev/null @@ -1,128 +0,0 @@ -repositoryFactory = $repositoryFactory; - $this->params = $params; - $this->objectManager = $objectManager; - $this->data = $this->prepareData($data); - } - - /** - * Prepare dataset data. - * - * @param array $data - * @return array - */ - protected function prepareData(array $data) - { - $dataset = isset($data['dataset']) && isset($this->params['repository']) - ? $this->data = $this->repositoryFactory->get($this->params['repository'])->get($data['dataset']) - : []; - $this->products = isset($dataset['products']) ? $this->createProducts($dataset['products']) : []; - return $this->prepareBundleOptions($dataset['bundle_options']); - } - - /** - * Prepare bundle options. - * - * @param array $data - * @return array - */ - protected function prepareBundleOptions(array $data) - { - foreach ($data as $optionKey => $bundleOption) { - foreach ($bundleOption['assigned_products'] as $key => $assignedProduct) { - $data[$optionKey]['assigned_products'][$key]['sku'] = $this->products[$optionKey][$key]->getSku(); - $data[$optionKey]['assigned_products'][$key]['name'] = $this->products[$optionKey][$key]->getName(); - } - } - - return $data; - } - - /** - * Create products. - * - * @param array $products - * @return array - */ - protected function createProducts(array $products) - { - $resultProduct = []; - foreach ($products as $key => $product) { - $resultProduct[$key] = $this->objectManager - ->create('Mage\Catalog\Test\TestStep\CreateProductsStep', ['products' => implode(',', $product)]) - ->run()['products']; - } - - return $resultProduct; - } - - /** - * Return products' fixtures. - * - * @return array - */ - public function getProducts() - { - return $this->products; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Fixture/Cart/Item.php b/dev/tests/functional/tests/app/Mage/Bundle/Test/Fixture/Cart/Item.php deleted file mode 100644 index e0809569842..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Fixture/Cart/Item.php +++ /dev/null @@ -1,105 +0,0 @@ -getBundleSelections(); - $checkoutData = $product->getCheckoutData(); - $checkoutBundleOptions = isset($checkoutData['options']['bundle_options']) - ? $checkoutData['options']['bundle_options'] - : []; - foreach ($checkoutBundleOptions as $checkoutOptionKey => $checkoutOption) { - // Find option and value keys - $attributeKey = null; - $optionKey = null; - $productKey = null; - foreach ($bundleSelection as $key => $option) { - if ($option['title'] == $checkoutOption['title']) { - $attributeKey = $key; - $optionKey = $checkoutOptionKey; - } - foreach ($option['assigned_products'] as $keyProduct => $product) { - $productKey = $keyProduct; - } - } - // Prepare option data - $bundleOptions = $bundleSelection[$attributeKey]['assigned_products'][$productKey]; - $value = $bundleOptions['sku']; - $qty = isset($checkoutOption['value']['qty']) - ? $checkoutOption['value']['qty'] - : $bundleOptions['selection_qty']; - $price = number_format($checkoutData['cartItem']['options']['bundle_options'][$optionKey]['price'], 2); - $optionData = [ - 'title' => $checkoutOption['title'], - 'value' => "{$qty} x {$value} {$price}", - ]; - $checkoutBundleOptions[$checkoutOptionKey] = $optionData; - } - $this->data['options'] += $checkoutBundleOptions; - } - - /** - * Persist fixture. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set. - * - * @param string $key [optional] - * @return mixed - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings. - * - * @return string - */ - public function getDataConfig() - { - // - } -} diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Handler/BundleProductInterface.php b/dev/tests/functional/tests/app/Mage/Bundle/Test/Handler/BundleProductInterface.php deleted file mode 100644 index b9265ee0141..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Handler/BundleProductInterface.php +++ /dev/null @@ -1,26 +0,0 @@ -mappingData += [ - 'selection_can_change_qty' => [ - 'Yes' => 1, - 'No' => 0, - ], - 'sku_type' => [ - 'Dynamic' => 0, - 'Fixed' => 1, - ], - 'price_type' => [ - 'Dynamic' => 0, - 'Fixed' => 1, - ], - 'weight_type' => [ - 'Dynamic' => 0, - 'Fixed' => 1, - ], - 'shipment_type' => [ - 'Together' => 0, - 'Separately' => 1, - ], - 'type' => [ - 'Drop-down' => 'select', - 'Radio Buttons' => 'radio', - 'Checkbox' => 'checkbox', - 'Multiple Select' => 'multi', - ], - 'selection_price_type' => [ - 'Fixed' => 0, - 'Percent' => 1, - ] - ]; - } - - /** - * Post request for creating bundle product product. - * - * @param FixtureInterface|null $fixture [optional] - * @return array - */ - public function persist(FixtureInterface $fixture = null) - { - $this->fixture = $fixture; - return parent::persist($fixture); - } - - /** - * Prepare POST data for creating product request. - * - * @param FixtureInterface $fixture - * @param string|null $prefix [optional] - * @return array - */ - protected function prepareData(FixtureInterface $fixture, $prefix = null) - { - $data = parent::prepareData($fixture, null); - $bundleOptions = $this->prepareBundleOptions($data['bundle_selections']); - $bundleSelections = $this->prepareBundleSelections($data['bundle_selections']); - $data = $prefix ? [$prefix => $data] : $data; - $data['bundle_selections'] = $bundleSelections; - $data['bundle_options'] = $bundleOptions; - - return $this->replaceMappingData($data); - } - - /** - * Prepare bundle selections data. - * - * @param array $bundleData - * @return array - */ - protected function prepareBundleSelections(array $bundleData) - { - $result = []; - $products = $this->fixture->getDataFieldConfig('bundle_selections')['source']->getProducts(); - foreach ($bundleData as $optionKey => $option) { - $result[$optionKey] = $this->prepareItemSelectionData($option['assigned_products'], $products[$optionKey]); - } - - return $result; - } - - /** - * Prepare item selection data. - * - * @param array $selections - * @param array $products - * @return array - */ - protected function prepareItemSelectionData(array $selections, array $products) - { - foreach (array_keys($selections) as $key) { - $selections[$key]['product_id'] = $products[$key]->getId(); - unset($selections[$key]['sku']); - $selections[$key]['delete'] = ''; - } - - return $selections; - } - - /** - * Prepare bundle options data. - * - * @param array $bundleData - * @return array - */ - protected function prepareBundleOptions(array $bundleData) - { - foreach (array_keys($bundleData) as $key) { - $bundleData[$key] = array_intersect_key($bundleData[$key], array_flip($this->optionsFields)); - $bundleData[$key]['delete'] = ''; - } - - return $bundleData; - } - - /** - * Parse response. - * - * @param string $response - * @return array - */ - protected function parseResponse($response) - { - $result = parent::parseResponse($response); - return array_replace_recursive($result, $this->parseResponseSelections($result['id'])); - } - - /** - * Parse bundle selections in response. - * - * @param string $id - * @return array - */ - protected function parseResponseSelections($id) - { - $url = $_ENV['app_backend_url'] . "bundle_product_edit/form/id/{$id}/back/edit/tab/product_info_tabs_group_7/"; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->write($url); - $response = $curl->read(); - $curl->close(); - - $selectionIdKey = 1; - $optionIdKey = 2; - $productNameKey = 3; - $responseSelections = []; - $bundleSelections = $this->fixture->getBundleSelections(); - - preg_match_all( - '/{.*"selection_id":"(\d+)".*"option_id":"(\d+)".*"name":"([^"]+)".*}/', - $response, - $matches, - PREG_SET_ORDER - ); - foreach ($matches as $match) { - $productName = $match[$productNameKey]; - $responseSelections[$productName] = [ - 'selection_id' => $match[$selectionIdKey], - 'option_id' => $match[$optionIdKey], - ]; - } - - foreach ($bundleSelections as $optionKey => $option) { - foreach ($option['assigned_products'] as $assignedKey => $optionValue) { - $productName = $optionValue['name']; - $bundleSelections[$optionKey]['assigned_products'][$assignedKey] += $responseSelections[$productName]; - } - } - - return ['bundle_selections' => $bundleSelections]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Page/Product/CatalogProductView.xml b/dev/tests/functional/tests/app/Mage/Bundle/Test/Page/Product/CatalogProductView.xml deleted file mode 100644 index bb1bbcb5f6e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Page/Product/CatalogProductView.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Repository/BundleProduct.xml b/dev/tests/functional/tests/app/Mage/Bundle/Test/Repository/BundleProduct.xml deleted file mode 100644 index 717b2e8df2f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Repository/BundleProduct.xml +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - BundleProduct %isolation% - Dynamic - Dynamic - Dynamic - Bundle product %isolation% - Short description bundle product %isolation% - Enabled - Catalog, Search - bundleproduct-%isolation% - - - - Bundle dynamic product %isolation% - sku_bundle_dynamic_product_%isolation% - Dynamic - Dynamic - - - - default_dynamic - - Dynamic - Separately - - Taxable Goods - - - - main_website - - - - Yes - Yes - Yes - In Stock - - bundle-dynamic-product-%isolation% - Catalog, Search - - default_dynamic - - Default - - default_dynamic - - Description for bundle dynamic product - Short description for bundle dynamic product - Enabled - - - Bundle fixed product %isolation% - sku_bundle_fixed_product_%isolation% - Fixed - Fixed - - 750.00 - default_bundle_fixed - - - Taxable Goods - - 1.0000 - Fixed - Together - - - main_website - - - - Yes - Yes - Yes - In Stock - - bundle-fixed-product-%isolation% - Catalog, Search - - default_fixed - - Default - - default_fixed - - Description for bundle dynamic product - Short description for bundle dynamic product - Enabled - - - diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Repository/BundleProduct/BundleSelections.xml b/dev/tests/functional/tests/app/Mage/Bundle/Test/Repository/BundleProduct/BundleSelections.xml deleted file mode 100644 index c480775924f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Repository/BundleProduct/BundleSelections.xml +++ /dev/null @@ -1,339 +0,0 @@ - - - - - - - - Drop-down Option - Drop-down - Yes - 1 - - - %product_sku% - 2 - Yes - - - %product_sku% - 3 - Yes - - - - - - - catalogProductSimple::default - catalogProductSimple::50_dollar_product - - - - - - - - Drop-down Option - Drop-down - Yes - 0 - - - %product_sku% - 5 - Fixed - 2 - Yes - - - %product_sku% - 6 - Fixed - 3 - Yes - - - - - - - catalogProductSimple::default - catalogProductSimple::50_dollar_product - - - - - - - - Drop-down Option - Drop-down - Yes - 1 - - - %product_sku% - 5 - Fixed - 2 - Yes - - - %product_sku% - 6 - Fixed - 3 - Yes - - - - - Radio Button Option - Radio Buttons - Yes - 2 - - - %product_sku% - 5 - Fixed - 2 - Yes - - - %product_sku% - 6 - Fixed - 3 - Yes - - - - - Checkbox Option - Checkbox - Yes - 3 - - - %product_sku% - 5 - Fixed - 2 - - - %product_sku% - 6 - Fixed - 3 - - - - - Multiple Select Option - Multiple Select - Yes - 4 - - - %product_sku% - 5 - Fixed - 2 - - - %product_sku% - 6 - Fixed - 3 - - - - - - - catalogProductSimple::default - catalogProductSimple::50_dollar_product - - - catalogProductSimple::default - catalogProductSimple::50_dollar_product - - - catalogProductSimple::default - catalogProductSimple::50_dollar_product - - - catalogProductSimple::default - catalogProductSimple::50_dollar_product - - - - - - - - Drop-down Option - Drop-down - Yes - 1 - - - %product_sku% - 2 - Yes - - - %product_sku% - 3 - Yes - - - - - Radio Button Option - Radio Buttons - Yes - 2 - - - %product_sku% - 2 - Yes - - - %product_sku% - 3 - Yes - - - - - Checkbox Option - Checkbox - Yes - 3 - - - %product_sku% - 2 - - - %product_sku% - 3 - - - - - Multiple Select Option - Multiple Select - Yes - 4 - - - %product_sku% - 2 - - - %product_sku% - 3 - - - - - - - catalogProductSimple::default - catalogProductSimple::50_dollar_product - - - catalogProductSimple::default - catalogProductSimple::50_dollar_product - - - catalogProductSimple::default - catalogProductSimple::50_dollar_product - - - catalogProductSimple::default - catalogProductSimple::50_dollar_product - - - - - - - - Drop-down Option - Drop-down - No - 0 - - - %product_sku% - 2 - 45 - Fixed - Yes - - - %product_sku% - 3 - 43 - Fixed - Yes - - - - - Radio Button Option - Radio Buttons - No - 0 - - - %product_sku% - 2 - 45 - Fixed - Yes - - - %product_sku% - 3 - 43 - Fixed - Yes - - - - - - - catalogProductSimple::default - catalogProductSimple::50_dollar_product - - - catalogProductSimple::default - catalogProductSimple::50_dollar_product - - - - - \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Repository/BundleProduct/CheckoutData.xml b/dev/tests/functional/tests/app/Mage/Bundle/Test/Repository/BundleProduct/CheckoutData.xml deleted file mode 100644 index 6139dc93078..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Repository/BundleProduct/CheckoutData.xml +++ /dev/null @@ -1,286 +0,0 @@ - - - - - - - - - Drop-down Option - Drop-down - - product_key_1 - 2 - - - - - - - - - 50 - - - - 100 - 100 - - - - - - - - Drop-down Option - Drop-down - - product_key_1 - 3 - - - - - 1 - - - - - 6 - - - - 768 - 768 - - - - - - - - - product_key_0 - 2 - - - - - 15 - - - - - 76 - - - - 152 - 2,280.00 - - - - - - - - - product_key_0 - 4 - - - - - 7 - - - - - 10 - - - - 40 - 40 - - - - - - - - - product_key_1 - 3 - - - - - 2 - - - - - 0.6 - - - - 11.8 - 23.6 - - - - - - - - - product_key_1 - 1 - - - - - 3 - - - - - 50 - - - - 50 - 150 - - - - - - - - - product_key_1 - 2 - - - - - 4 - - - - - 6 - - - - 112 - 448 - - - - - - - - - product_key_0 - 2 - - - - - product_key_0 - 2 - - - - - product_key_0 - - - - - product_key_0 - - - - - - attribute_key_0 - Field - - - attribute_key_1 - Area - - - attribute_key_3 - option_key_0 - - - attribute_key_4 - option_key_0 - - - attribute_key_5 - option_key_0 - - - attribute_key_6 - option_key_0 - - - attribute_key_7 - 12/12/2014 - - - attribute_key_8 - 12/12/2014/12/30/AM - - - attribute_key_9 - 12/12/AM - - - - 4 - - - - - 5 - - - 5 - - - 5 - - - 5 - - - - 290 - 1,160.00 - - - - \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Repository/BundleProduct/Price.xml b/dev/tests/functional/tests/app/Mage/Bundle/Test/Repository/BundleProduct/Price.xml deleted file mode 100644 index e70538200dd..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Repository/BundleProduct/Price.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 150.00 - 200.00 - - - - 760.00 - 768.00 - - - - 760.00 - 768.00 - - - - 150.00 - 200.00 - - - - 15.00 - 20.00 - - - - 11.00 - 11.80 - - - - 150.00 - - - - 110.00 - - - - 290.00 - 372.00 - - - \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/AddProductToWishlistEntityTest.xml b/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/AddProductToWishlistEntityTest.xml deleted file mode 100644 index ec2e0b2421a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/AddProductToWishlistEntityTest.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - Add Bundle dynamic product to Wishlist - bundleProduct::bundle_dynamic_product - true - - - - - - Add Bundle fixed product to Wishlist - bundleProduct::bundle_fixed_product - true - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.xml b/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.xml deleted file mode 100644 index 7a2649127a3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - bundleProduct::bundle_dynamic_product - 2 - 2 - - - - - bundleProduct::bundle_fixed_product - 2 - 2 - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/AddProductsToShoppingCartEntityTest.xml b/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/AddProductsToShoppingCartEntityTest.xml deleted file mode 100644 index 5cb342161cd..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/AddProductsToShoppingCartEntityTest.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - bundleProduct::bundle_dynamic_product - 100 - - - - - - - - bundleProduct::bundle_fixed_product - 768 - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.xml b/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.xml deleted file mode 100644 index c5236c55c98..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - bundleProduct::bundle_dynamic_product - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/CreateBundleProductEntityTest.php b/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/CreateBundleProductEntityTest.php deleted file mode 100644 index cb21dca3b85..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/CreateBundleProductEntityTest.php +++ /dev/null @@ -1,93 +0,0 @@ - Manage Products. - * 3. Click "Add Product". - * 4. Select Bundle Product and Attribute set. - * 5. Fill in all data according to data set. - * 6. Save product. - * 7. Verify created product. - * - * @group Bundle_Product_(CS) - * @ZephyrId MPERF-6886 - */ -class CreateBundleProductEntityTest extends Injectable -{ - /** - * Product page on backend. - * - * @var CatalogProduct - */ - protected $catalogProductIndex; - - /** - * New product page on backend. - * - * @var CatalogProductNew - */ - protected $catalogProductNew; - - /** - * Persist category. - * - * @param CatalogCategory $category - * @return array - */ - public function __prepare(CatalogCategory $category) - { - $category->persist(); - return ['category' => $category]; - } - - /** - * Injection pages. - * - * @param CatalogProduct $catalogProductIndex - * @param CatalogProductNew $catalogProductNew - * @return void - */ - public function __inject(CatalogProduct $catalogProductIndex, CatalogProductNew $catalogProductNew) - { - $this->catalogProductIndex = $catalogProductIndex; - $this->catalogProductNew = $catalogProductNew; - } - - /** - * Test create bundle product. - * - * @param BundleProduct $product - * @param CatalogCategory $category - * @return void - */ - public function test(BundleProduct $product, CatalogCategory $category) - { - // Steps: - $this->catalogProductIndex->open(); - $this->catalogProductIndex->getGridPageActionBlock()->addNew(); - $this->catalogProductNew->getProductForm()->fill($product, null, $category); - $this->catalogProductNew->getFormPageActions()->save(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/CreateBundleProductEntityTest.xml b/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/CreateBundleProductEntityTest.xml deleted file mode 100644 index c6a07d36395..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/CreateBundleProductEntityTest.xml +++ /dev/null @@ -1,267 +0,0 @@ - - - - - - Create default dynamic bundle product - Bundle Dynamic %isolation% - Dynamic - sku_bundle_dynamic_%isolation% - bundle-product-%isolation% - Enabled - Dynamic - default_dynamic - In Stock - Bundle Product Description %isolation% - Bundle product short description %isolation% - Price Range - default_dynamic - default_dynamic - Catalog, Search - main:ce - - - - - - - - - - Create default fixed bundle product - Bundle Fixed %isolation% - Fixed - sku_bundle_fixed_%isolation% - bundle-product-%isolation% - Enabled - Fixed - 750 - default_fixed - Taxable Goods - In Stock - Fixed - 10 - Bundle Product Description %isolation% - Bundle product short description %isolation% - Price Range - Separately - default_fixed - default_fixed - Catalog, Search - - - - - - - - - - Create out of stock fixed bundle product - BundleProduct %isolation% - Fixed - bundle_sku_%isolation% - bundle-product-%isolation% - Enabled - Fixed - 10 - Taxable Goods - Out of Stock - Fixed - 10 - Bundle Product Description %isolation% - Bundle product short description %isolation% - Price Range - default_fixed - Catalog - - - - - - - - - Create dynamic bundle product with tier price and visible in search - BundleProduct %isolation% - Dynamic - bundle_sku_%isolation% - bundle-product-%isolation% - Enabled - Dynamic - dynamic_with_tier_price - In Stock - Fixed - 10 - Bundle Product Description %isolation% - Bundle product short description %isolation% - for_all_groups - Price Range - Together - default_dynamic - dynamic_with_tier_price - Search - - - - - - - - - - - - Create dynamic bundle product with grouped price and visible in catalog only - BundleProduct %isolation% - Dynamic - bundle_sku_%isolation% - bundle-product-%isolation% - Enabled - Dynamic - dynamic_with_group_price - In Stock - Fixed - 10 - Bundle Product Description %isolation% - Bundle product short description %isolation% - for_not_logged_users - Price Range - Together - default_dynamic - dynamic_with_group_price - Catalog - - - - - - - - - - - - Create fixed bundle product with special price - BundleProduct %isolation% - Fixed - bundle_sku_%isolation% - bundle-product-%isolation% - Enabled - Fixed - 100 - fixed_with_special_price - Taxable Goods - In Stock - Fixed - 10 - Bundle Product Description %isolation% - Bundle product short description %isolation% - 10 - Price Range - Together - default_fixed - fixed_with_special_price - Catalog, Search - - - - - - - - Create default dynamic bundle product with as low as price view - Bundle Dynamic %isolation% - Dynamic - sku_bundle_dynamic_%isolation% - bundle-product-%isolation% - Enabled - Dynamic - dynamic_as_low_as_price - In Stock - Bundle Product Description %isolation% - Bundle product short description %isolation% - As Low as - default_dynamic - dynamic_as_low_as_price - Catalog, Search - - - - - - - - - - Create default fixed bundle product with as low as price view - Bundle Fixed %isolation% - Fixed - sku_bundle_fixed_%isolation% - bundle-product-%isolation% - Enabled - Fixed - 100 - fixed_as_low_as_price - Taxable Goods - In Stock - Bundle Product Description %isolation% - Bundle product short description %isolation% - As Low as - default_fixed - fixed_as_low_as_price - Catalog, Search - - - - - - - - - - Create fixed bundle product with custom options - BundleProduct %isolation% - Fixed - bundle_sku_%isolation% - bundle-product-%isolation% - Enabled - Fixed - 100 - all_types_bundle_fixed_and_custom_options - Taxable Goods - In Stock - Fixed - 10 - Bundle Product Description %isolation% - Bundle product short description %isolation% - Price Range - Together - all_types_fixed - all_types_bundle_fixed_and_custom_options - all_types - Catalog, Search - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/DeleteBundleProductEntityTest.xml b/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/DeleteBundleProductEntityTest.xml deleted file mode 100644 index c26850fdd51..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/DeleteBundleProductEntityTest.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - bundleProduct::bundle_dynamic_product - - - - - - bundleProduct::bundle_fixed_product - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.xml b/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.xml deleted file mode 100644 index 8a6d27cbc4b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - bundleProduct::bundle_dynamic_product - - - - - - - bundleProduct::bundle_fixed_product - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Mage/Bundle/Test/etc/curl/di.xml deleted file mode 100644 index a0132f4ce69..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/etc/curl/di.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Mage/Bundle/Test/etc/fixture.xml deleted file mode 100644 index c43252ab717..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/etc/fixture.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - eav - catalog_product - bundle - Mage\Bundle\Model\Resource\Product\Collection - sku - - - id - virtual - - - bundle_selections - virtual - 1 - bundle - Mage\Bundle\Test\Fixture\BundleProduct\BundleSelections - - - stock_data - virtual - inventory - - - checkout_data - virtual - 1 - Mage\Bundle\Test\Fixture\BundleProduct\CheckoutData - - - custom_options - virtual - 0 - custom-options - Mage\Catalog\Test\Fixture\CatalogProductSimple\CustomOptions - - - - - bundle - 4 - - product - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/AbstractConfigureBlock.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/AbstractConfigureBlock.php deleted file mode 100644 index 5dc7e8dec92..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/AbstractConfigureBlock.php +++ /dev/null @@ -1,78 +0,0 @@ -blockFactory->create( - 'Mage\Catalog\Test\Block\Product\View\CustomOptions', - ['element' => $this->_rootElement] - ); - } - - /** - * Set quantity. - * - * @param int $qty - * @return void - */ - abstract public function setQty($qty); - - /** - * Replace index fields to name fields in checkout data - * - * @param array $options - * @param array $checkoutData - * @return array - */ - protected function prepareCheckoutData(array $options, array $checkoutData) - { - $result = []; - - foreach ($checkoutData as $checkoutOption) { - $attribute = str_replace('attribute_key_', '', $checkoutOption['title']); - $option = str_replace('option_key_', '', $checkoutOption['value']); - - if (isset($options[$attribute])) { - - $result[] = [ - 'type' => strtolower(preg_replace('/[^a-z]/i', '', explode('/', $options[$attribute]['type']))[1]), - 'title' => isset($options[$attribute]['title']) - ? $options[$attribute]['title'] - : $attribute, - 'value' => isset($options[$attribute]['options'][$option]['title']) - ? $options[$attribute]['options'][$option]['title'] - : $option - ]; - } - } - - return $result; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Category/View.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Category/View.php deleted file mode 100644 index cb2e9de84ee..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Category/View.php +++ /dev/null @@ -1,51 +0,0 @@ -_rootElement->find($this->description)->getText(); - } - - /** - * Get view block text. - * - * @return string - */ - public function getText() - { - return $this->_rootElement->getText(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Layer/View.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Layer/View.php deleted file mode 100644 index 5e388e5924b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Layer/View.php +++ /dev/null @@ -1,84 +0,0 @@ -_rootElement->find(sprintf($this->filterPriceLink, $priceLink), Locator::SELECTOR_XPATH)->click(); - } - - /** - * Select attribute. - * - * @param array $filter - * @return void - */ - public function selectAttribute(array $filter) - { - $selector = sprintf($this->filterAttributeLink, $filter['attribute'], $filter['option']); - $this->_rootElement->find($selector, Locator::SELECTOR_XPATH)->click(); - } - - /** - * Get array of available filters. - * - * @return array - */ - public function getFilters() - { - $options = $this->_rootElement->getElements($this->optionTitle); - $data = []; - foreach ($options as $option) { - $data[] = $option->getText(); - } - return $data; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Msrp/Popup.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Msrp/Popup.php deleted file mode 100644 index de0e9a1bbf5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Msrp/Popup.php +++ /dev/null @@ -1,63 +0,0 @@ -escape($this->_rootElement->find($this->priceBox)->getText()); - } - - /** - * Check if price visible in popup dialog. - * - * @return bool - */ - public function isPriceVisible() - { - return $this->_rootElement->find($this->priceBox)->isVisible(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/Compare/ListCompare.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/Compare/ListCompare.php deleted file mode 100644 index 40b998cba91..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/Compare/ListCompare.php +++ /dev/null @@ -1,211 +0,0 @@ -getCompareProductInfo($index); - if ($attributeKey == 'price') { - return $this->getPrice($infoBlock, $currency); - } else { - return strtolower($infoBlock->find($this->nameSelector, Locator::SELECTOR_XPATH)->getText()); - } - } - - /** - * Get product price. - * - * @param SimpleElement $infoBlock - * @param string $currency - * @return string|array - */ - protected function getPrice(SimpleElement $infoBlock, $currency) - { - if ($infoBlock->find($this->priceFrom, Locator::SELECTOR_XPATH)->isVisible()) { - return [ - 'price_from' => $this->getPriceFromPage($infoBlock, $currency, $this->priceFrom), - 'price_to' => $this->getPriceFromPage($infoBlock, $currency, $this->priceTo) - ]; - } elseif ($infoBlock->find($this->priceFromString, Locator::SELECTOR_XPATH)->isVisible()) { - return ['price_from' => $this->getPriceFromPage($infoBlock, $currency, $this->priceSelector)]; - } elseif ($infoBlock->find($this->priceStartingAtString, Locator::SELECTOR_XPATH)->isVisible()) { - return ['price_starting' => $this->getPriceFromPage($infoBlock, $currency, $this->priceSelector)]; - } else { - return $this->getPriceFromPage($infoBlock, $currency, $this->priceSelector); - } - } - - /** - * Get price from page. - * - * @param SimpleElement $infoBlock - * @param string $currency - * @param string $selector - * @return string - */ - protected function getPriceFromPage(SimpleElement $infoBlock, $currency, $selector) - { - return $this->preparePrice( - $infoBlock->find($selector, Locator::SELECTOR_XPATH)->getText(), - $currency - ); - } - - /** - * Prepare price. - * - * @param string $price - * @param string $currency - * @return string - * @throws \Exception - */ - protected function preparePrice($price, $currency) - { - preg_match('/.(\d+.*)/', $price, $prices); - if (!empty($prices[1])) { - return trim($prices[1], $currency); - } else { - throw new \Exception("Price is absent on price block! \n" . $price); - } - } - - /** - * Get product meta data (sku, description and short description). - * - * @param int $index - * @param string $attributeKey - * @return string - */ - public function getProductMetaData($index, $attributeKey) - { - return strtolower( - $this->_rootElement->find( - sprintf($this->productBlock, $attributeKey, $index), - Locator::SELECTOR_XPATH - )->getText() - ); - } - - /** - * Get item compare product info. - * - * @param int $index - * @return SimpleElement - */ - protected function getCompareProductInfo($index) - { - return $this->_rootElement->find(sprintf($this->productInfo, $index), Locator::SELECTOR_XPATH); - } - - /** - * Check is visible attribute. - * - * @param string $attributeName - * @return bool - */ - public function isAttributeVisible($attributeName) - { - $selector = sprintf($this->attribute, $attributeName); - return $this->_rootElement->find($selector, Locator::SELECTOR_XPATH)->isVisible(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/Compare/Sidebar.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/Compare/Sidebar.php deleted file mode 100644 index b8763aadada..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/Compare/Sidebar.php +++ /dev/null @@ -1,88 +0,0 @@ -_rootElement; - $selector = $this->productName; - $this->_rootElement->waitUntil( - function () use ($rootElement, $selector) { - return $rootElement->find($selector)->isVisible() ? true : null; - } - ); - $elements = $this->_rootElement->getElements($this->productName); - foreach ($elements as $element) { - $result[] = $element->getText(); - } - return $result; - } catch (\Exception $e) { - $isEmpty = $this->_rootElement->find($this->isEmpty); - if ($isEmpty->isVisible()) { - return $isEmpty->getText(); - } else { - throw $e; - } - } - } - - /** - * Click "Clear All" on "My Account" page. - * - * @return void - */ - public function clickClearAll() - { - $this->_rootElement->find($this->clearAll)->click(); - $this->_rootElement->acceptAlert(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ConfigurableProductView.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ConfigurableProductView.php deleted file mode 100644 index 71ce80cce7c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ConfigurableProductView.php +++ /dev/null @@ -1,99 +0,0 @@ -blockFactory->create( - 'Mage\Catalog\Test\Block\Product\View\ConfigurableOptions', - ['element' => $this->_rootElement] - ); - } - - /** - * Fill in the option specified for the product. - * - * @param InjectableFixture $product - * @return void - */ - public function fillOptions(InjectableFixture $product) - { - /** @var ConfigurableProduct $product */ - $attributesData = $product->getConfigurableOptions()['attributes_data']; - $checkoutData = $product->getCheckoutData(); - - // Prepare attribute data - foreach ($attributesData as $attributeKey => $attribute) { - $attributesData[$attributeKey] = [ - 'type' => $attribute['frontend_input'], - 'title' => $attribute['frontend_label'], - 'options' => [], - ]; - - foreach ($attribute['options'] as $optionKey => $option) { - $attributesData[$attributeKey]['options'][$optionKey] = [ - 'title' => $option['label'], - ]; - } - $attributesData[$attributeKey]['options'] = array_values($attributesData[$attributeKey]['options']); - } - $attributesData = array_values($attributesData); - - $configurableCheckoutData = isset($checkoutData['options']['configurable_options']) - ? $checkoutData['options']['configurable_options'] - : []; - $checkoutOptionsData = $this->prepareCheckoutData($attributesData, $configurableCheckoutData); - $this->getConfigurableOptionsBlock()->fillOptions($checkoutOptionsData); - } - - /** - * Return product options. - * - * @param InjectableFixture $product [optional] - * @return array - */ - public function getOptions(InjectableFixture $product = null) - { - $options = ['configurable_options' => $this->getConfigurableOptionsBlock()->getOptions($product)]; - $options += parent::getOptions($product); - - return $options; - } - - /** - * Get text of Stock Availability control. - * - * @return string - */ - public function getConfigurableStockAvailability() - { - return strtolower($this->_rootElement->find($this->stockAvailability)->getText()); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/GroupedProductView.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/GroupedProductView.php deleted file mode 100644 index f1068a8ab64..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/GroupedProductView.php +++ /dev/null @@ -1,120 +0,0 @@ -blockFactory->create( - 'Mage\Catalog\Test\Block\Product\View\GroupedProduct', - ['element' => $this->_rootElement->find($this->groupedProductBlock)] - ); - } - - /** - * Return product options. - * - * @param InjectableFixture $product [optional] - * @return array - */ - public function getOptions(InjectableFixture $product = null) - { - return $this->getGroupedProductBlock()->getOptions($product); - } - - /** - * Get text of Stock Availability control. - * - * @return string - */ - public function getGroupedStockAvailability() - { - return strtolower($this->_rootElement->find($this->stockAvailability)->getText()); - } - - /** - * Change price selector. - * - * @param int $index - * @return void - */ - public function itemPriceProductBlock($index) - { - $this->priceBlock = str_replace('%row-number%', $index, $this->formatSpecialPrice); - } - - /** - * Change tier price selector. - * - * @param int $index - * @return void - */ - public function itemTierPriceProductBlock($index) - { - $this->tierPricesSelector = str_replace('%row-number%', $index, $this->formatTierPrice); - } - - /** - * Fill grouped product options. - * - * @param InjectableFixture $product - * @return void - */ - public function fillOptions(InjectableFixture $product) - { - $checkoutData = $checkoutData = $product->getCheckoutData(); - $associatedProducts = $product->getAssociated(); - if (isset($checkoutData['options'])) { - $groupedBlock = $this->getGroupedProductBlock(); - foreach ($checkoutData['options'] as $key => $option) { - $groupedBlock->getGroupedItemForm($associatedProducts[$key]['name'])->fillOption($option); - } - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ListProduct.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ListProduct.php deleted file mode 100644 index 6a543ea3916..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ListProduct.php +++ /dev/null @@ -1,196 +0,0 @@ -getProductDetailsElement($productName); - return $this->blockFactory->create( - 'Mage\Catalog\Test\Block\Product\Price', - ['element' => $productDetails->find($this->priceBlockClass, Locator::SELECTOR_CLASS_NAME)] - ); - } - - /** - * Check if product with specified name is visible. - * - * @param InjectableFixture $product - * @return bool - */ - public function isProductVisible($product) - { - return $this->getProductNameElement($product->getName())->isVisible(); - } - - /** - * Check if regular price is visible. - * - * @return bool - */ - public function isRegularPriceVisible() - { - return $this->_rootElement->find($this->regularPriceClass)->isVisible(); - } - - /** - * Open product view page by clicking on product name. - * - * @param string $productName - * @return void - */ - public function openProductViewPage($productName) - { - $this->getProductNameElement($productName)->click(); - } - - /** - * This method returns the element representing the product details for the named product. - * - * @param string $productName String containing the name of the product - * @return Element - */ - protected function getProductDetailsElement($productName) - { - return $this->_rootElement->find( - sprintf($this->productDetailsSelector, $productName), - Locator::SELECTOR_XPATH - ); - } - - /** - * This method returns the element on the page associated with the product name. - * - * @param string $productName String containing the name of the product - * @return Element - */ - protected function getProductNameElement($productName) - { - return $this->_rootElement->find(sprintf($this->productTitle, $productName)); - } - - /** - * Get Minimum Advertised Price on Category page. - * - * @return string - */ - public function getOldPriceCategoryPage() - { - return $this->_rootElement->find($this->oldPrice, Locator::SELECTOR_CSS)->getText(); - } - - /** - * Retrieve product price by specified Id. - * - * @param int $productId - * @return string - */ - public function getPrice($productId) - { - return $this->_rootElement->find(sprintf($this->priceBox, $productId), Locator::SELECTOR_CSS)->getText(); - } - - /** - * Check 'Add To Card' button availability. - * - * @return bool - */ - public function checkAddToCardButton() - { - return $this->_rootElement->find($this->addToCard, Locator::SELECTOR_CSS)->isVisible(); - } - - /** - * Get all terms used in sort. - * - * @return array - */ - public function getSortByValues() - { - return explode("\n", $this->_rootElement->find($this->sorter)->getText()); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/Price.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/Price.php deleted file mode 100644 index a1a2b968190..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/Price.php +++ /dev/null @@ -1,228 +0,0 @@ - [ - 'selector' => '.regular-price .price' - ], - 'old_price' => [ - 'selector' => '.old-price .price' - ], - 'special_price' => [ - 'selector' => '.special-price .price' - ], - 'price_from' => [ - 'selector' => 'p.price-from .price', - ], - 'price_to' => [ - 'selector' => 'p.price-to .price', - ], - 'minimal_price' => [ - 'selector' => 'p.minimal-price .price', - ], - 'final_price' => [ - 'selector' => '.price', - ], - 'category_price_excl_tax' => [ - 'selector' => '.price-excluding-tax span.price' - ], - 'category_price_incl_tax' => [ - 'selector' => '.price-including-tax span.price' - ], - 'product_view_price_incl_tax' => [ - 'selector' => '.price-including-tax span.price' - ], - 'product_view_price_excl_tax' => [ - 'selector' => '.price-excluding-tax span.price' - ] - ]; - - /** - * 'Add to Cart' button. - * - * @var string - */ - protected $addToCart = '.action.tocart'; - - /** - * 'Click for price' link selector. - * - * @var string - */ - protected $clickForPrice = '.map-link'; - - /** - * MAP popup selector. - * - * @var string - */ - protected $map = './ancestor::body//*[@id="map-popup"]'; - - /** - * This method returns the price represented by the block. - * - * @param string $currency - * @return string - */ - public function getPrice($currency = '$') - { - return $this->getTypePrice('price', $currency); - } - - /** - * This method returns the regular price represented by the block. - * - * @return string - */ - public function getRegularPrice() - { - // either return the old price (implies special price display or a regular price - $priceElement = $this->getTypePriceElement('old_price'); - if (!$priceElement->isVisible()) { - $priceElement = $this->getTypePriceElement('price')->isVisible() - ? $this->getTypePriceElement('price') - : $this->getTypePriceElement('minimal_price'); - } - // return the actual value of the price - $price = preg_replace('#[^\d\.\s]+#umis', '', $priceElement->getText()); - return number_format(trim($price), 2); - } - - /** - * This method returns the special price represented by the block. - * - * @param string $currency - * @return string - */ - public function getSpecialPrice($currency = '$') - { - return $this->getTypePrice('special_price', $currency); - } - - /** - * Get final price. - * - * @param string $currency - * @return string - */ - public function getFinalPrice($currency = '$') - { - return $this->getTypePrice('final_price', $currency); - } - - /** - * This method returns if the regular price is visible. - * - * @return bool - */ - public function isRegularPriceVisible() - { - return $this->getTypePriceElement('price')->isVisible(); - } - - /** - * Get specify type price. - * - * @param string $type - * @param string $currency [optional] - * @return string|null - */ - protected function getTypePrice($type, $currency = '$') - { - $typePriceElement = $this->getTypePriceElement($type); - return $typePriceElement->isVisible() ? $this->escape($typePriceElement->getText(), $currency) : null; - } - - /** - * Get specify type price element. - * - * @param string $type - * @return Element - */ - public function getTypePriceElement($type) - { - $mapTypePrice = $this->mapTypePrices[$type]; - return $this->_rootElement->find( - $mapTypePrice['selector'], - isset($mapTypePrice['strategy']) ? $mapTypePrice['strategy'] : Locator::SELECTOR_CSS - ); - } - - /** - * Escape currency and separator for price. - * - * @param string $price - * @param string $currency - * @return string - */ - protected function escape($price, $currency = '$') - { - return str_replace([',', $currency], '', $price); - } - - /** - * Click on 'Click for price' link. - * - * @return void - */ - public function clickForPrice() - { - $this->_rootElement->find($this->clickForPrice)->click(); - } - - /** - * Get MAP popup block. - * - * @return Popup - */ - public function getMapBlock() - { - return $this->blockFactory->create( - 'Mage\Catalog\Test\Block\Msrp\Popup', - [ - 'element' => $this->_rootElement->find($this->map, Locator::SELECTOR_XPATH) - ] - ); - } - - /** - * Get Result price. - * - * @return string - */ - public function getResultPrice() - { - return ($this->getTypePriceElement('price')->isVisible()) - ? $this->getTypePrice('price') - : $this->getTypePrice('special_price'); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/BottomToolbar.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/BottomToolbar.php deleted file mode 100644 index e93bc364dfe..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/BottomToolbar.php +++ /dev/null @@ -1,47 +0,0 @@ -_rootElement->find($this->nextPageSelector); - - if ($nextPageItem->isVisible()) { - $nextPageItem->click(); - return true; - } - return false; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/Compare.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/Compare.php deleted file mode 100644 index 7c68fd51f39..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/Compare.php +++ /dev/null @@ -1,139 +0,0 @@ -_rootElement->find($this->compareButton)->click(); - } - - /** - * Get the number of products added to compare list. - * - * @return string - */ - public function getQtyInCompareList() - { - $compareProductLink = $this->_rootElement->find($this->qtyCompareProducts); - preg_match('/.*(\d+)/', $compareProductLink->getText(), $matches); - - return $matches[1]; - } - - /** - * Get url from compare link. - * - * @return string - */ - public function getCompareLinkUrl() - { - $link = $this->_rootElement->find($this->compareButton)->getAttribute('onclick'); - return trim($link); - } - - /** - * Get compare products block content. - * - * @throws \Exception - * @return array|string - */ - public function getProducts() - { - try { - $result = []; - $rootElement = $this->_rootElement; - $selector = $this->productName; - $this->_rootElement->waitUntil( - function () use ($rootElement, $selector) { - return $rootElement->find($selector)->isVisible() ? true : null; - } - ); - $elements = $this->_rootElement->getElements($this->productName); - foreach ($elements as $element) { - $result[] = strtolower($element->getText()); - } - return $result; - } catch (\Exception $e) { - $isEmpty = $this->_rootElement->find($this->isEmpty); - if ($isEmpty->isVisible()) { - return $isEmpty->getText(); - } else { - throw $e; - } - } - } - - /** - * Click "Clear All". - * - * @return void - */ - public function clickClearAll() - { - if ($this->_rootElement->find($this->clearAll, Locator::SELECTOR_XPATH)->isVisible()) { - $this->_rootElement->find($this->clearAll, Locator::SELECTOR_XPATH)->click(); - $this->browser->acceptAlert(); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/Crosssell.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/Crosssell.php deleted file mode 100644 index aa1d73e36f9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/Crosssell.php +++ /dev/null @@ -1,53 +0,0 @@ -blockFactory->create( - 'Mage\Catalog\Test\Block\Product\ProductList\Crosssell\Item', - [ - 'element' => $this->_rootElement->find( - sprintf($this->crosssellProduct, $product->getName()), - Locator::SELECTOR_XPATH - ) - ] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/Crosssell/Item.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/Crosssell/Item.php deleted file mode 100644 index a9ad12e6097..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/Crosssell/Item.php +++ /dev/null @@ -1,41 +0,0 @@ -_rootElement->find($this->addToCart)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/Related.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/Related.php deleted file mode 100644 index 92b2a9f894e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/Related.php +++ /dev/null @@ -1,54 +0,0 @@ -blockFactory->create( - 'Mage\Catalog\Test\Block\Product\ProductList\Related\Item', - [ - 'element' => $this->_rootElement->find( - sprintf($this->relatedProduct, $product->getName()), - Locator::SELECTOR_XPATH - ) - ] - ); - } - -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/Related/Item.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/Related/Item.php deleted file mode 100644 index f3995a0fcc0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/Related/Item.php +++ /dev/null @@ -1,41 +0,0 @@ -_rootElement->find($this->productName)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/TopToolbar.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/TopToolbar.php deleted file mode 100644 index d5ca055cbf4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/TopToolbar.php +++ /dev/null @@ -1,41 +0,0 @@ -_rootElement->find($this->sorter)->getText()); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/Upsell.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/Upsell.php deleted file mode 100644 index f0ab953c3b5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/Upsell.php +++ /dev/null @@ -1,54 +0,0 @@ -blockFactory->create( - 'Mage\Catalog\Test\Block\Product\ProductList\Upsell\Item', - [ - 'element' => $this->_rootElement->find( - sprintf($this->upsellProduct, $product->getName()), - Locator::SELECTOR_XPATH - ) - ] - ); - } - -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/Upsell/Item.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/Upsell/Item.php deleted file mode 100644 index 833e1a89ef8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/Upsell/Item.php +++ /dev/null @@ -1,41 +0,0 @@ -_rootElement->find($this->productName)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View.php deleted file mode 100644 index f3deb07219a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View.php +++ /dev/null @@ -1,389 +0,0 @@ -blockFactory->create( - 'Mage\Catalog\Test\Block\Product\Price', - ['element' => $this->_rootElement->find($this->priceBlock, Locator::SELECTOR_XPATH)] - ); - } - - /** - * Add product to shopping cart. - * - * @param InjectableFixture $product - * @return void - */ - public function addToCart(InjectableFixture $product) - { - $this->configureProduct($product); - $this->clickAddToCart(); - } - - /** - * Configure product. - * - * @param InjectableFixture $product - * @return void - */ - protected function configureProduct(InjectableFixture $product) - { - /** @var CatalogProductSimple $product */ - $checkoutData = $product->getCheckoutData(); - if (isset($checkoutData['options'])) { - $this->fillOptions($product); - } - if (isset($checkoutData['qty'])) { - $this->setQty($checkoutData['qty']); - } - } - - /** - * Fill in the option specified for the product. - * - * @param InjectableFixture $product - * @return void - * - * @SuppressWarnings(PHPMD.NPathComplexity) - */ - public function fillOptions(InjectableFixture $product) - { - $dataConfig = $product->getDataConfig(); - $typeId = isset($dataConfig['type_id']) ? $dataConfig['type_id'] : null; - $checkoutData = null; - - /** @var CatalogProductSimple $product */ - if ($this->hasRender($typeId)) { - $this->callRender($typeId, 'fillOptions', ['product' => $product]); - } - /** @var CatalogProductSimple $product */ - $checkoutData = $product->getCheckoutData(); - if (!isset($checkoutData['options']['custom_options'])) { - return; - } - $customOptions = $product->getCustomOptions(); - if (isset($customOptions)) { - $checkoutCustomOptions = $this->prepareCheckoutData( - $customOptions, - $checkoutData['options']['custom_options'] - ); - $this->getCustomOptionsBlock()->fillCustomOptions($checkoutCustomOptions); - } - } - - /** - * Return product options. - * - * @param InjectableFixture $product - * @return array - */ - public function getOptions(InjectableFixture $product) - { - $dataConfig = $product->getDataConfig(); - $typeId = isset($dataConfig['type_id']) ? $dataConfig['type_id'] : null; - - return $this->hasRender($typeId) - ? $this->callRender($typeId, 'getOptions', ['product' => $product]) - : $this->getCustomOptionsBlock()->getOptions($product); - } - - /** - * Click add to card button. - * - * @return void - */ - public function clickAddToCart() - { - $this->_rootElement->find($this->addToCart)->click(); - } - - /** - * Check add to card button. - * - * @return bool - */ - public function checkAddToCartButton() - { - return $this->_rootElement->find($this->addToCart)->isVisible(); - } - - /** - * Set quantity. - * - * @param int $qty - * @return void - */ - public function setQty($qty) - { - $this->browser->selectWindow(); - $this->_rootElement->find($this->qty)->setValue($qty); - $this->_rootElement->click(); - } - - /** - * Get product name displayed on page. - * - * @return string - */ - public function getProductName() - { - return $this->_rootElement->find($this->productName)->getText(); - } - - /** - * Return product short description on page. - * - * @return string|null - */ - public function getProductShortDescription() - { - if ($this->_rootElement->find($this->productShortDescription)->isVisible()) { - return $this->_rootElement->find($this->productShortDescription)->getText(); - } - return null; - } - - /** - * Return product description on page. - * - * @return string|null - */ - public function getProductDescription() - { - if ($this->_rootElement->find($this->productDescription)->isVisible()) { - return $this->_rootElement->find($this->productDescription)->getText(); - } - return null; - } - - /** - * Get text of Stock Availability control. - * - * @param InjectableFixture $product - * @return string - */ - public function getStockAvailability(InjectableFixture $product) - { - $dataConfig = $product->getDataConfig(); - $typeId = isset($dataConfig['type_id']) ? $dataConfig['type_id'] : null; - - return $this->hasRender($typeId) - ? $this->callRender($typeId, 'get' . ucfirst($typeId) . 'StockAvailability') - : strtolower($this->_rootElement->find($this->stockAvailability)->getText()); - } - - /** - * This method return array tier prices. - * - * @param int $lineNumber [optional] - * @return array - */ - public function getTierPrices($lineNumber = 1) - { - return $this->_rootElement->find(sprintf($this->tierPricesSelector, $lineNumber), Locator::SELECTOR_XPATH) - ->getText(); - } - - /** - * Add product to Wishlist. - * - * @param InjectableFixture $product - * @return void - */ - public function addToWishlist(InjectableFixture $product) - { - $this->configureProduct($product); - $this->clickAddToWishlist(); - } - - /** - * Update product in Wishlist. - * - * @param InjectableFixture $product - * @return void - */ - public function updateWishlist(InjectableFixture $product) - { - $this->configureProduct($product); - $this->clickUpdateWishlist(); - } - - /** - * Click "Add to Wishlist" button. - * - * @return void - */ - public function clickAddToWishlist() - { - $this->_rootElement->find($this->addToWishlist)->click(); - } - - /** - * Click "Update Wishlist" button. - * - * @return void - */ - protected function clickUpdateWishlist() - { - $this->_rootElement->find($this->updateWishlist)->click(); - } - - /** - * Click "Add to Compare" button. - * - * @return void - */ - public function clickAddToCompare() - { - /** @var \Mage\Core\Test\Block\Messages $messageBlock */ - $messageBlock = $this->blockFactory->create( - 'Mage\Core\Test\Block\Messages', - ['element' => $this->browser->find($this->messageBlock)] - ); - $this->_rootElement->find($this->clickAddToCompare, Locator::SELECTOR_CSS)->click(); - $messageBlock->waitSuccessMessage(); - } - - /** - * Open custom information tab. - * - * @param string $tabName - * @return void - */ - public function openCustomInformationTab($tabName) - { - $this->_rootElement->find(sprintf($this->customInformationTab, $tabName), Locator::SELECTOR_XPATH)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View/ConfigurableOptions.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View/ConfigurableOptions.php deleted file mode 100644 index b14c52e5e51..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View/ConfigurableOptions.php +++ /dev/null @@ -1,126 +0,0 @@ -hasData('configurable_options') - ? $product->getConfigurableOptions()['attributes_data'] - : []; - $listOptions = $this->getListOptions(); - $result = []; - - foreach ($attributesData as $option) { - $title = $option['label']; - if (!isset($listOptions[$title])) { - throw new \Exception("Can't find option: \"{$title}\""); - } - - /** @var Element $optionElement */ - $result[$title] = $this->getOptionsData($listOptions, $option, $title); - - if (!empty($result) && $this->_rootElement->find('#attribute' . $option['attribute_id'])->isDisabled()) { - $availableOptionData = current($result); - foreach($availableOptionData['options'] as $optionKey => $value) { - $availableOptionData['type'] = 'dropdown'; - $availableOptionData['value'] = $availableOptionData['options'][$optionKey]['title']; - $fillOption[0] = $availableOptionData; - unset($fillOption[0]['options'], $fillOption[0]['is_require']); - $this->fillOptions($fillOption); - $disableOptionData[$optionKey] = $this->getOptionsData($listOptions, $option, $title); - $result[$title]['options'][$optionKey] = $disableOptionData[$optionKey]['options'][0]; - } - } - } - - return $result; - } - - /** - * Get options data. - * - * @param $listOptions - * @param $option - * @param $title - * @return Element - */ - protected function getOptionsData($listOptions, $option, $title) - { - $optionElement = $listOptions[$title]; - $type = $option['frontend_input']; - $option['frontend_input'] = explode('/', $option['frontend_input'])[1]; - $typeMethod = preg_replace('/[^a-zA-Z]/', '', $option['frontend_input']); - $getTypeData = 'get' . ucfirst(strtolower($typeMethod)) . 'Data'; - - $optionData = $this->$getTypeData($optionElement); - $optionData['title'] = $title; - $optionData['type'] = $type; - $isRequire = $this->_rootElement->find(sprintf($this->required, $title), Locator::SELECTOR_XPATH) - ->isVisible(); - $optionData['is_require'] = $isRequire ? 'Yes' : 'No'; - - return $optionData; - } - - /** - * Get options context. - * - * @return Element - */ - protected function getOptionsContext() - { - return $this->_rootElement->find(sprintf($this->optionsContext, 1), Locator::SELECTOR_XPATH); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View/ConfigurableOptions.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View/ConfigurableOptions.xml deleted file mode 100644 index 66920cd658a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View/ConfigurableOptions.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - .//select - select - xpath - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View/CustomOptions.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View/CustomOptions.php deleted file mode 100644 index 9396f88c5af..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View/CustomOptions.php +++ /dev/null @@ -1,504 +0,0 @@ -hasData('custom_options') ? $product->getCustomOptions() : []; - if (empty($dataOptions)) { - return $dataOptions; - } - $listCustomOptions = $this->getListOptions(); - $result = []; - - foreach ($dataOptions as $option) { - $title = $option['title']; - if (!isset($listCustomOptions[$title])) { - throw new \Exception("Can't find option: \"{$title}\""); - } - - /** @var Element $optionElement */ - $optionElement = $listCustomOptions[$title]; - $option['type'] = explode('/', $option['type'])[1]; - $typeMethod = preg_replace('/[^a-zA-Z]/', '', $option['type']); - $getTypeData = 'get' . ucfirst(strtolower($typeMethod)) . 'Data'; - - $optionData = $this->$getTypeData($optionElement); - $optionData['title'] = $title; - $optionData['type'] = $option['type']; - $optionData['is_require'] = $optionElement['title']->find($this->required, Locator::SELECTOR_XPATH) - ->isVisible() - ? 'Yes' - : 'No'; - - $result[$title] = $optionData; - } - - return ['custom_options' => $result]; - } - - /** - * Get list custom options. - * - * @return array - */ - protected function getListOptions() - { - $customOptions = []; - $context = $this->getOptionsContext(); - $count = 1; - $optionElementTitle = $context->find(sprintf($this->optionElementTitle, $count), Locator::SELECTOR_XPATH); - $optionElement = $context->find(sprintf($this->optionElement, $count), Locator::SELECTOR_XPATH); - while ($optionElementTitle->isVisible()) { - $title = $optionElementTitle->find($this->title)->getText(); - $customOptions[$title]['title'] = $optionElementTitle; - $customOptions[$title]['content'] = $optionElement; - ++$count; - $optionElementTitle = $context->find(sprintf($this->optionElementTitle, $count), Locator::SELECTOR_XPATH); - $optionElement = $context->find(sprintf($this->optionElement, $count), Locator::SELECTOR_XPATH); - } - return $customOptions; - } - - /** - * Get options context. - * - * @return Element - */ - protected function getOptionsContext() - { - return $this->_rootElement->find(sprintf($this->optionsContext, 2), Locator::SELECTOR_XPATH)->isVisible() - ? $this->_rootElement->find(sprintf($this->optionsContext, 2), Locator::SELECTOR_XPATH) - : $this->_rootElement->find(sprintf($this->optionsContext, 1), Locator::SELECTOR_XPATH); - } - - /** - * Get data of "Field" custom option. - * - * @param array $option - * @return array - */ - protected function getFieldData(array $option) - { - $price = $this->getOptionPriceNotice($option['title']); - $maxCharacters = $option['content']->find($this->maxCharacters, Locator::SELECTOR_XPATH); - return [ - 'options' => [ - 'price' => floatval($price), - 'max_characters' => $maxCharacters->isVisible() ? $maxCharacters->getText() : null, - ] - ]; - } - - /** - * Get data of "Area" custom option. - * - * @param array $option - * @return array - */ - protected function getAreaData(array $option) - { - return $this->getFieldData($option); - } - - /** - * Get data of "File" custom option. - * - * @param array $option - * @return array - */ - protected function getFileData(array $option) - { - $price = $this->getOptionPriceNotice($option['title']); - - return [ - 'options' => [ - 'price' => floatval($price), - 'file_extension' => $this->getOptionNotice($option['content'], 1), - 'image_size_x' => preg_replace('/[^0-9]/', '', $this->getOptionNotice($option['content'], 2)), - 'image_size_y' => preg_replace('/[^0-9]/', '', $this->getOptionNotice($option['content'], 3)), - ] - ]; - } - - /** - * Get data of "Drop-down" custom option. - * - * @param array $option - * @return array - */ - protected function getDropdownData(array $option) - { - $select = $option['content']->find($this->selectOption, Locator::SELECTOR_XPATH, 'select'); - // Skip "Choose option ..."(option #1) - return $this->getSelectOptionsData($select, 2); - } - - /** - * Get data of "Multiple Select" custom option. - * - * @param array $option - * @return array - */ - protected function getMultipleSelectData(array $option) - { - $multiSelect = $option['content']->find($this->selectOption, Locator::SELECTOR_XPATH, 'multiselect'); - return $this->getSelectOptionsData($multiSelect, 1); - } - - /** - * Get data of "Radio Buttons" custom option. - * - * @param array $option - * @return array - */ - protected function getRadioButtonsData(array $option) - { - $listOptions = []; - - $count = 1; - $optionLabel = $option['content']->find(sprintf($this->optionLabel, $count), Locator::SELECTOR_XPATH); - while ($optionLabel->isVisible()) { - $listOptions[] = $this->parseOptionText($optionLabel->getText()); - ++$count; - $optionLabel = $option['content']->find(sprintf($this->optionLabel, $count), Locator::SELECTOR_XPATH); - } - - return [ - 'options' => $listOptions - ]; - } - - /** - * Get data of "Checkbox" custom option. - * - * @param array $option - * @return array - */ - protected function getCheckboxData(array $option) - { - return $this->getRadioButtonsData($option); - } - - /** - * Get data of "Date" custom option. - * - * @param array $option - * @return array - */ - protected function getDateData(array $option) - { - $price = $this->getOptionPriceNotice($option['title']); - - return [ - 'options' => [ - 'price' => floatval($price) - ] - ]; - } - - /** - * Get data of "Date & Time" custom option. - * - * @param array $option - * @return array - */ - protected function getDateTimeData(array $option) - { - return $this->getDateData($option); - } - - /** - * Get data of "Time" custom option. - * - * @param array $option - * @return array - */ - protected function getTimeData(array $option) - { - return $this->getDateData($option); - } - - /** - * Get data from option of select and multiselect. - * - * @param Element $element - * @param int $firstOption - * @return array - */ - protected function getSelectOptionsData(Element $element, $firstOption = 1) - { - $listOptions = []; - - $count = $firstOption; - $selectOption = $element->find(sprintf($this->option, $count), Locator::SELECTOR_XPATH); - while ($selectOption->isVisible()) { - $listOptions[] = $this->parseOptionText($selectOption->getText()); - ++$count; - $selectOption = $element->find(sprintf($this->option, $count), Locator::SELECTOR_XPATH); - } - - return ['options' => $listOptions]; - } - - /** - * Get price from price-notice of custom option. - * - * @param Element $option - * @return array - */ - protected function getOptionPriceNotice(Element $option) - { - $priceNotice = $option->find($this->priceNotice, Locator::SELECTOR_XPATH); - if (!$priceNotice->isVisible()) { - return null; - } - return preg_replace('/[^0-9\.]/', '', $priceNotice->getText()); - } - - /** - * Get notice of option by number. - * - * @param Element $option - * @param int $number - * @return mixed - */ - protected function getOptionNotice(Element $option, $number) - { - $note = $option->find(sprintf($this->noteByNumber, $number), Locator::SELECTOR_XPATH); - return $note->isVisible() ? $note->getText() : null; - } - - /** - * Parse option text to title and price. - * - * @param string $optionText - * @return array - */ - protected function parseOptionText($optionText) - { - preg_match('`^(.*?)\+\$(\d.*?)$`', $optionText, $match); - $optionPrice = isset($match[2]) ? str_replace(',', '', $match[2]) : 0; - $optionTitle = isset($match[1]) ? trim($match[1]) : $optionText; - - return [ - 'title' => $optionTitle, - 'price' => $optionPrice - ]; - } - - /** - * Fill custom options. - * - * @param array $checkoutData - * @return void - */ - public function fillCustomOptions(array $checkoutData) - { - $checkoutOptions = $this->prepareOptions($checkoutData); - $this->fillOptions($checkoutOptions); - } - - /** - * Prepare composite fields in checkout options data. - * - * @param array $options - * @return array - */ - protected function prepareOptions(array $options) - { - $result = []; - - foreach ($options as $key => $option) { - switch ($option['type']) { - case 'datetime': - list($day, $month, $year, $hour, $minute, $dayPart) = explode('/', $option['value']); - $option['value'] = [ - 'day' => $day, - 'month' => $month, - 'year' => $year, - 'hour' => $hour, - 'minute' => $minute, - 'day_part' => $dayPart - ]; - break; - case 'date': - list($day, $month, $year) = explode('/', $option['value']); - $option['value'] = [ - 'day' => $day, - 'month' => $month, - 'year' => $year, - ]; - break; - case 'time': - list($hour, $minute, $dayPart) = explode('/', $option['value']); - $option['value'] = [ - 'hour' => $hour, - 'minute' => $minute, - 'day_part' => $dayPart - ]; - break; - } - - $result[$key] = $option; - } - - return $result; - } - - /** - * Fill product options. - * - * @param array $options - * @return void - */ - public function fillOptions(array $options) - { - foreach ($options as $option) { - $optionBlock = $this->_rootElement->find( - sprintf($this->optionByName, $option['title']), - Locator::SELECTOR_XPATH - ); - $type = $option['type']; - $mapping = $this->dataMapping([$type => $option['value']]); - - if ('radiobuttons' == $type || 'checkbox' == $type) { - $mapping[$type]['selector'] = str_replace( - '%option_name%', - $mapping[$type]['value'], - $mapping[$type]['selector'] - ); - $mapping[$type]['value'] = 'Yes'; - } - $this->_fill($mapping, $optionBlock); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View/CustomOptions.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View/CustomOptions.xml deleted file mode 100644 index b28194a408a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View/CustomOptions.xml +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - .//select - select - xpath - - - .//select - multiselect - xpath - - - .//div[label[span[contains(text(), "%option_name%")]]]/input - checkbox - xpath - - - .//div[label[span[contains(text(), "%option_name%")]]]/input - checkbox - xpath - - - - [name$="[month]"] - select - - - [name$="[day]"] - select - - - [name$="[year]"] - select - - - - - [name$="[month]"] - select - - - [name$="[day]"] - select - - - [name$="[year]"] - select - - - [name$="[hour]"] - select - - - [name$="[minute]"] - select - - - [name$="[day_part]"] - select - - - - - .//textarea - xpath - - - .//input - xpath - - - .//input - xpath - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View/GroupedItemForm.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View/GroupedItemForm.php deleted file mode 100644 index 3b2e6e24a9d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View/GroupedItemForm.php +++ /dev/null @@ -1,37 +0,0 @@ -dataMapping($option); - $this->_fill($mapping); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View/GroupedItemForm.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View/GroupedItemForm.xml deleted file mode 100644 index cff94ae49b3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View/GroupedItemForm.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - .qty - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View/GroupedProduct.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View/GroupedProduct.php deleted file mode 100644 index ac25fbe43af..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View/GroupedProduct.php +++ /dev/null @@ -1,87 +0,0 @@ -getAssociated(); - - foreach ($associatedProducts as $product) { - $subProductBlock = $this->_rootElement->find( - sprintf($this->subProductByName, $product['name']), - Locator::SELECTOR_XPATH - ); - - $options[] = [ - 'name' => $subProductBlock->find($this->productName)->getText(), - 'qty' => $subProductBlock->find($this->qty)->getValue(), - ]; - } - - return $options; - } - - /** - * Get grouped item block. - * - * @param string $key - * @return GroupedItemForm - */ - public function getGroupedItemForm($key) - { - return $this->blockFactory->create( - 'Mage\Catalog\Test\Block\Product\View\GroupedItemForm', - ['element' => $this->_rootElement->find(sprintf($this->subProductByName, $key), Locator::SELECTOR_XPATH)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Search.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Search.php deleted file mode 100644 index 9ca4c0187e9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Search.php +++ /dev/null @@ -1,100 +0,0 @@ -fillSearch($keyword); - $this->_rootElement->find($this->searchButton, Locator::SELECTOR_CSS)->click(); - } - - /** - * Fills the search field - * - * @param string $text - * @return void - */ - public function fillSearch($text) - { - $this->_rootElement->find($this->searchInput, Locator::SELECTOR_CSS)->setValue($text); - } - - /** - * Checking block visibility "Suggest Search" - * - * @param string $text - * @param int|null $amount - * @return bool - */ - public function isSuggestSearchVisible($text, $amount = null) - { - $searchAutocomplete = sprintf($this->searchAutocomplete, $text); - if ($amount !== null) { - $searchAutocomplete .= sprintf($this->searchItemAmount, $amount); - } - - $rootElement = $this->_rootElement; - return (bool)$this->_rootElement->waitUntil( - function () use ($rootElement, $searchAutocomplete) { - return $rootElement->find($searchAutocomplete, Locator::SELECTOR_XPATH)->isVisible() ? true : null; - } - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AbstractAssertPriceOnGroupedProductPage.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AbstractAssertPriceOnGroupedProductPage.php deleted file mode 100644 index 0c2b924b19b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AbstractAssertPriceOnGroupedProductPage.php +++ /dev/null @@ -1,78 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - $groupedData = $product->getDataFieldConfig('associated')['source']->getProducts(); - foreach ($groupedData as $key => $subProduct) { - $catalogProductView->getGroupedProductViewBlock()->{'item' . $typePrice . 'PriceProductBlock'}(++$key); - $object->setErrorMessage(sprintf($this->errorMessage, $subProduct->getName())); - $object->assertPrice($subProduct, $catalogProductView->getGroupedProductViewBlock(), 'Grouped'); - } - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return $this->successfulMessage; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AbstractAssertProductsVisibleOnCategoryPageShopByFilter.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AbstractAssertProductsVisibleOnCategoryPageShopByFilter.php deleted file mode 100644 index 0def27b3f20..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AbstractAssertProductsVisibleOnCategoryPageShopByFilter.php +++ /dev/null @@ -1,47 +0,0 @@ - $product) { - $isProductVisible = $catalogCategoryView->getListProductBlock()->isProductVisible($product); - while (!$isProductVisible && $catalogCategoryView->getBottomToolbar()->nextPage()) { - $isProductVisible = $catalogCategoryView->getListProductBlock()->isProductVisible($product); - } - $expected = in_array($key, $searchProductsIndexes) ? true : false; - \PHPUnit_Framework_Assert::assertEquals($expected, $isProductVisible); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertAddToCartButtonPresent.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertAddToCartButtonPresent.php deleted file mode 100644 index 8a22b5502b8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertAddToCartButtonPresent.php +++ /dev/null @@ -1,54 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - \PHPUnit_Framework_Assert::assertTrue( - $catalogProductView->getViewBlock()->checkAddToCartButton(), - 'Add to Cart button is absent on product page' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Add to Cart button is present on product page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertAddedProductAttributeOnProductForm.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertAddedProductAttributeOnProductForm.php deleted file mode 100644 index 26301f87265..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertAddedProductAttributeOnProductForm.php +++ /dev/null @@ -1,66 +0,0 @@ -open(); - $productGrid->getProductGrid()->searchAndOpen(['sku' => $product->getSku()]); - - \PHPUnit_Framework_Assert::assertTrue( - $productEdit->getProductForm()->checkAttributeLabel($attribute->getData()), - "Product Attribute is absent on Product form." - ); - } - - /** - * Returns string representation of object. - * - * @return string - */ - public function toString() - { - return 'Product Attribute is present on Product form.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertAttributeForm.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertAttributeForm.php deleted file mode 100644 index 3e519db3935..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertAttributeForm.php +++ /dev/null @@ -1,70 +0,0 @@ - $attribute->getAttributeCode()]; - $catalogProductAttributeIndex->open()->getGrid()->searchAndOpen($filter); - - $dataFixture = $attribute->getData(); - $dataForm = $catalogProductAttributeEdit->getAttributeForm()->getData($attribute); - $errors = $this->verifyData($dataFixture, $dataForm); - \PHPUnit_Framework_Assert::assertEmpty($errors, $errors); - } - - /** - * Returns string representation of object. - * - * @return string - */ - public function toString() - { - return 'Displayed attribute data on edit page equals passed from fixture.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertAttributeOptionsOnProductForm.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertAttributeOptionsOnProductForm.php deleted file mode 100644 index ed10d30efe7..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertAttributeOptionsOnProductForm.php +++ /dev/null @@ -1,69 +0,0 @@ -getOptions(); - $attributeOptionsFromFixture = []; - foreach ($options as $option) { - $attributeOptionsFromFixture[] = $option['admin']; - } - $catalogProductIndex->open()->getProductGrid()->searchAndOpen(['sku' => $product->getSku()]); - $productForm = $catalogProductEdit->getProductForm(); - $attributeOptions = $productForm->getAttributeElement($attribute)->getValues(); - - \PHPUnit_Framework_Assert::assertEquals($attributeOptionsFromFixture, $attributeOptions); - } - - /** - * Return string representation of object. - * - * @return string - */ - public function toString() - { - return "Configurable options are available on configurable product Edit form."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategoryAbsenceOnBackend.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategoryAbsenceOnBackend.php deleted file mode 100644 index 02b80487a9f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategoryAbsenceOnBackend.php +++ /dev/null @@ -1,52 +0,0 @@ -open(); - \PHPUnit_Framework_Assert::assertFalse( - $catalogCategoryIndex->getTreeCategories()->isCategoryVisible($category), - 'Category is displayed in backend catalog category tree.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Category is not displayed in backend catalog category tree.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategoryAbsenceOnFrontend.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategoryAbsenceOnFrontend.php deleted file mode 100644 index 5a52a3f37ef..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategoryAbsenceOnFrontend.php +++ /dev/null @@ -1,70 +0,0 @@ -open($_ENV['app_frontend_url'] . $category->getUrlKey() . '.html'); - $notFoundMessage = ($notFoundMessage !== null) ? $notFoundMessage : self::NOT_FOUND_MESSAGE; - \PHPUnit_Framework_Assert::assertContains( - $notFoundMessage, - $categoryView->getViewBlock()->getText(), - 'Category is present on frontend.' - ); - } - - /** - * Returns string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Category is absent on frontend.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategoryForAssignedProducts.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategoryForAssignedProducts.php deleted file mode 100644 index 59d4784845c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategoryForAssignedProducts.php +++ /dev/null @@ -1,64 +0,0 @@ -open($_ENV['app_frontend_url'] . strtolower($category->getUrlKey()) . '.html'); - $products = $category->getDataFieldConfig('category_products')['source']->getProducts(); - foreach ($products as $productFixture) { - \PHPUnit_Framework_Assert::assertTrue( - $categoryView->getListProductBlock()->isProductVisible($productFixture), - "Products '{$productFixture->getName()}' is not find." - ); - } - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Displayed assigned products on category page equal to passed from fixture.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategoryForm.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategoryForm.php deleted file mode 100644 index 9811ad7a16f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategoryForm.php +++ /dev/null @@ -1,71 +0,0 @@ -getData(); - $catalogCategoryIndex->open(); - $catalogCategoryIndex->getTreeCategories()->selectCategory($category); - $dataForm = $catalogCategoryIndex->getCategoryForm()->getDataCategory($category); - $error = $this->verifyData($data, $dataForm); - \PHPUnit_Framework_Assert::assertEmpty($error, $error); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Displayed category data on edit page(backend) equals to passed from fixture.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategoryPage.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategoryPage.php deleted file mode 100644 index 943e6d7a14d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategoryPage.php +++ /dev/null @@ -1,110 +0,0 @@ -createByCode( - 'catalogProductSimple', - [ - 'dataset' => 'default', - 'data' => [ - 'category_ids' => [ - 'category' => $initialCategory - ] - ] - ] - ); - $categoryData = array_merge($initialCategory->getData(), $category->getData()); - $product->persist(); - $url = $_ENV['app_frontend_url'] . strtolower($category->getUrlKey()) . '.html'; - $browser->open($url); - \PHPUnit_Framework_Assert::assertEquals( - $url, - $browser->getUrl(), - 'Wrong page URL.' - ); - - if (isset($categoryData['name'])) { - \PHPUnit_Framework_Assert::assertEquals( - strtoupper($categoryData['name']), - $categoryView->getTitleBlock()->getTitle(), - 'Wrong page title.' - ); - } - - if (isset($categoryData['description'])) { - \PHPUnit_Framework_Assert::assertEquals( - $categoryData['description'], - $categoryView->getViewBlock()->getDescription(), - 'Wrong category description.' - ); - } - - if (isset($categoryData['default_sort_by'])) { - $sortBy = strtolower($categoryData['default_sort_by']); - $sortType = $categoryView->getTopToolbar()->getSelectSortType(); - \PHPUnit_Framework_Assert::assertEquals( - $sortBy, - $sortType, - 'Wrong sorting type.' - ); - } - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Category data on category page equals to passed from fixture.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategoryRedirect.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategoryRedirect.php deleted file mode 100644 index 0f02bebf7f9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategoryRedirect.php +++ /dev/null @@ -1,65 +0,0 @@ -open(str_replace('index', 'cron', $_ENV['app_frontend_url'])); - $browser->open($_ENV['app_frontend_url'] . $initialCategory->getUrlKey() . '.html'); - \PHPUnit_Framework_Assert::assertEquals( - $catalogCategoryView->getTitleBlock()->getTitle(), - strtoupper($category->getName()), - 'Old category URL does not lead to appropriate Category in frontend.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Old category URL lead to appropriate Category in frontend.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategorySaveMessage.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategorySaveMessage.php deleted file mode 100644 index bb700376df6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategorySaveMessage.php +++ /dev/null @@ -1,63 +0,0 @@ -getMessagesBlock()->getSuccessMessages(); - \PHPUnit_Framework_Assert::assertEquals( - self::SUCCESS_MESSAGE, - $actualMessage, - 'Wrong success message is displayed.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Success message is displayed.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategorySuccessDeleteMessage.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategorySuccessDeleteMessage.php deleted file mode 100644 index 867485a1d11..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategorySuccessDeleteMessage.php +++ /dev/null @@ -1,54 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Return string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Category success delete message is displayed.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertConfigurableProductForm.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertConfigurableProductForm.php deleted file mode 100644 index 0cfd5c0745b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertConfigurableProductForm.php +++ /dev/null @@ -1,110 +0,0 @@ - $attribute) { - foreach ($attribute['options'] as $optionKey => $option) { - $attribute['options'][$optionKey] = array_diff_key($option, array_flip($this->skippedOptionFields)); - } - $attribute['options'] = $this->sortDataByPath($attribute['options'], '::admin'); - $attributeData[$attributeKey] = array_diff_key($attribute, array_flip($this->skippedAttributeFields)); - } - $data['configurable_options']['attributes_data'] = $this->sortDataByPath( - $attributeData, - '::frontend_label' - ); - } - - return parent::prepareFixtureData($data, $sortFields); - } - - /** - * Prepares form data for comparison. - * - * @param array $data - * @param array $sortFields [optional] - * @return array - */ - protected function prepareFormData(array $data, array $sortFields = []) - { - // prepare attributes data - if (isset($data['configurable_options'])) { - $attributeData = $data['configurable_options']['attributes_data']; - foreach ($attributeData as $attributeKey => $attribute) { - $attribute['options'] = $this->sortDataByPath($attribute['options'], '::admin'); - $attributeData[$attributeKey] = $attribute; - } - $data['configurable_options']['attributes_data'] = $this->sortDataByPath( - $attributeData, - '::frontend_label' - ); - - foreach ($sortFields as $path) { - $data = $this->sortDataByPath($data, $path); - } - } - return $data; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertConfigurableProductInCart.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertConfigurableProductInCart.php deleted file mode 100644 index 1fee5eab6f5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertConfigurableProductInCart.php +++ /dev/null @@ -1,69 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - $catalogProductView->getViewBlock()->addToCart($product); - $checkoutData = $product->getCheckoutData(); - $price = $checkoutCart->getCartBlock()->getCartItem($product)->getCartItemTypePrice('price'); - \PHPUnit_Framework_Assert::assertEquals( - $checkoutData['cartItem']['price'], - $price, - 'Product price in shopping cart is not correct.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product price in shopping cart is correct.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertConfigurableProductPage.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertConfigurableProductPage.php deleted file mode 100644 index b59be9eafa1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertConfigurableProductPage.php +++ /dev/null @@ -1,131 +0,0 @@ -verifyAttributes(); - - return array_filter($errors); - } - - /** - * Verify displayed product attributes on product page(front-end) equals passed from fixture. - * - * @return string|null - */ - protected function verifyAttributes() - { - $formOptions = $this->sortOptions($this->productView->getOptions($this->product)['configurable_options']); - $fixtureOptions = $this->prepareFixtureOptions(); - $errors = $this->verifyData($fixtureOptions, $formOptions, true, false); - return empty($errors) ? null : $this->prepareErrors($errors, 'Error configurable options:'); - } - - /** - * Prepare fixture options data. - * - * @return array - */ - protected function prepareFixtureOptions() - { - $configurableOptions = []; - $attributesData = $this->product->getConfigurableOptions()['attributes_data']; - $countAttributes = count($attributesData); - for ($i = 0; $i < $countAttributes; $i++) { - $attributeKey = 'attribute_key_' . $i; - $configurableOptions[$attributesData[$attributeKey]['frontend_label']] = [ - 'title' => $attributesData[$attributeKey]['frontend_label'], - 'type' => $attributesData[$attributeKey]['frontend_input'], - 'is_require' => 'Yes', - 'options' => $this->getOptionsData($attributesData[$attributeKey]['options']) - ]; - } - - return $this->sortOptions($configurableOptions); - } - - /** - * Get options data. - * - * @param array $options - * @return array - */ - protected function getOptionsData(array $options) - { - $optionsData = []; - foreach ($options as $option) { - $optionsData[] = [ - 'title' => $option['label'], - 'price' => $this->getOptionPrice($option) - ]; - } - - return $optionsData; - } - - /** - * Options sort. - * - * @param array $options - * @return array - */ - protected function sortOptions(array $options) - { - $options = $this->sortDataByPath($options, '::title'); - foreach ($options as $key => $option) { - $options[$key] = $this->sortDataByPath($option, 'options::title'); - } - - return $options; - } - - /** - * Get price for option. - * - * @param array $optionData - * @return string - */ - protected function getOptionPrice(array $optionData) - { - $price = ('Percentage' == $optionData['price_type']) - ? ($this->product->getPrice() * $optionData['price']) / 100 - : $optionData['price']; - - return number_format($price, 2); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCrossSellProducts.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCrossSellProducts.php deleted file mode 100644 index 8254bb1a3e9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCrossSellProducts.php +++ /dev/null @@ -1,135 +0,0 @@ -open()->getCartBlock()->clearShoppingCart(); - - $index = $crossSellProductsData['firstProduct']['productIndex']; - $productCheck = $productsData[$index]['product']; - $crossSellProducts = $productsData[$index]['crossSellProducts']['cross_sell_products']['value']; - $browser->open($_ENV['app_frontend_url'] . $productCheck->getUrlKey() . '.html'); - $catalogProductView->getViewBlock()->addToCart($productCheck); - $this->assertCrossSellSection($checkoutCart, $crossSellProducts); - - $index = $crossSellProductsData['secondProduct']['productIndex']; - $productCheck = $productsData[$index]['product']; - $crossSellProducts = $productsData[$index]['crossSellProducts']['cross_sell_products']['value']; - $this->addToCartFromCrossSell($catalogProductView, $checkoutCart, $productCheck); - unset($crossSellProducts[$crossSellProductsData['firstProduct']['productIndex']]); - $this->assertCrossSellSection($checkoutCart, $crossSellProducts); - - $index = $crossSellProductsData['thirdProduct']['productIndex']; - $productCheck = $productsData[$index]['product']; - $this->addToCartFromCrossSell($catalogProductView, $checkoutCart, $productCheck); - $this->assertCrossSellSectionAbsent($checkoutCart); - } - - /** - * Add to cart. - * - * @param CatalogProductView $catalogProductView - * @param CheckoutCart $checkoutCart - * @param InjectableFixture $productCheck - * @return void - */ - protected function addToCartFromCrossSell( - CatalogProductView $catalogProductView, - CheckoutCart $checkoutCart, - InjectableFixture $productCheck - ) { - $crossSellBlock = $checkoutCart->getCrosssellBlock(); - $crossSellBlock->getItemBlock($productCheck)->addToCart(); - if ($catalogProductView->getViewBlock()->isVisible()) { - $catalogProductView->getViewBlock()->addToCart($productCheck); - } - } - - /** - * Check products on crossSell section. - * - * @param CheckoutCart $checkoutCart - * @param array $crossSellProducts - * @return void - */ - protected function assertCrossSellSection(CheckoutCart $checkoutCart, array $crossSellProducts) - { - $errors = []; - $crossSellBlock = $checkoutCart->getCrosssellBlock(); - foreach ($crossSellProducts as $crossSellProduct) { - if (!$crossSellBlock->getItemBlock($crossSellProduct)->isVisible()) { - $errors[] = "Product {$crossSellProduct->getName()} is absent in cross-sell section."; - } - } - - \PHPUnit_Framework_Assert::assertEmpty($errors, implode("\n", $errors)); - } - - /** - * Check that crossSell section is absent. - * - * @param CheckoutCart $checkoutCart - * @return void - */ - protected function assertCrossSellSectionAbsent(CheckoutCart $checkoutCart) - { - \PHPUnit_Framework_Assert::assertFalse($checkoutCart->getCrosssellBlock()->isVisible()); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Products are displayed in crossSell section.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCrossSellProductsSection.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCrossSellProductsSection.php deleted file mode 100644 index 6e998d7db72..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCrossSellProductsSection.php +++ /dev/null @@ -1,75 +0,0 @@ -open()->getCartBlock()->clearShoppingCart(); - - $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - $catalogProductView->getViewBlock()->addToCart($product); - $errors = []; - $crosssellBlock = $checkoutCart->getCrosssellBlock(); - foreach ($crossSellProducts as $crossSellProduct) { - if (!$crosssellBlock->getItemBlock($crossSellProduct)->isVisible()) { - $errors[] = "Product {$crossSellProduct->getName()} is absent in cross-sell section."; - } - } - - \PHPUnit_Framework_Assert::assertEmpty($errors, implode(" ", $errors)); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Products are displayed in cross-sell section.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertGroupedPriceOnGroupedProductPage.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertGroupedPriceOnGroupedProductPage.php deleted file mode 100644 index eeb098422bf..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertGroupedPriceOnGroupedProductPage.php +++ /dev/null @@ -1,62 +0,0 @@ -processAssertPrice($product, $catalogProductView, $groupedPrice, $browser); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertGroupedProductsDefaultQty.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertGroupedProductsDefaultQty.php deleted file mode 100644 index 99486a531dc..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertGroupedProductsDefaultQty.php +++ /dev/null @@ -1,93 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - $pageOptions = $groupedProductView->getViewBlock()->getOptions($product); - - $fixtureQtyData = $this->prepareFixtureQtyData($product); - $pageQtyData = $this->prepareFormQtyData($pageOptions); - $error = $this->verifyData($fixtureQtyData, $pageQtyData); - \PHPUnit_Framework_Assert::assertEmpty($error, $error); - } - - /** - * Prepare form's qty data. - * - * @param array $options - * @return array - */ - protected function prepareFormQtyData(array $options) - { - $qtyData = []; - foreach ($options as $option) { - $qtyData[] = ['name' => $option['name'], 'qty' => $option['qty']]; - } - - return $this->sortDataByPath($qtyData, '::name'); - } - - /** - * Prepare fixture's qty data. - * - * @param GroupedProduct $product - * @return array - */ - protected function prepareFixtureQtyData(GroupedProduct $product) - { - $qtyData = []; - $associatedProducts = $product->getDataFieldConfig('associated')['source']->getProducts(); - foreach ($product->getAssociated() as $key => $option) { - $qtyData[] = ['name' => $associatedProducts[$key]->getName(), 'qty' => $option['qty']]; - } - - return $this->sortDataByPath($qtyData, '::name'); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Default qty for sub products in grouped product displays according to dataset on product page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertPriceOnProductPageInterface.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertPriceOnProductPageInterface.php deleted file mode 100644 index 8dba3e97c10..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertPriceOnProductPageInterface.php +++ /dev/null @@ -1,42 +0,0 @@ -hasData('cross_sell_products') - ? $product->getDataFieldConfig('cross_sell_products')['source']->getProducts() - : []; - } - - $checkoutCart->open(); - $checkoutCart->getCartBlock()->clearShoppingCart(); - - $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - $catalogProductView->getViewBlock()->addToCart($product); - $checkoutCart->open(); - foreach ($promotedProducts as $promotedProduct) { - \PHPUnit_Framework_Assert::assertFalse( - $checkoutCart->getCrosssellBlock()->getItemBlock($promotedProduct)->isVisible(), - 'Product \'' . $promotedProduct->getName() . '\' is exist in cross-sell section.' - ); - } - } - - /** - * Text success product is not displayed in cross-sell section. - * - * @return string - */ - public function toString() - { - return 'Product is not displayed in cross-sell section.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAbsentRelatedProducts.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAbsentRelatedProducts.php deleted file mode 100644 index 76bde86f564..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAbsentRelatedProducts.php +++ /dev/null @@ -1,72 +0,0 @@ -hasData('related_products') - ? $product->getDataFieldConfig('related_products')['source']->getProducts() - : []; - } - - $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - foreach ($promotedProducts as $promotedProduct) { - \PHPUnit_Framework_Assert::assertFalse( - $catalogProductView->getRelatedProductBlock()->getItemBlock($promotedProduct)->isVisible(), - "Product {$promotedProduct->getName()} is exist in related products." - ); - } - } - - /** - * Text success product is not displayed in related products section. - * - * @return string - */ - public function toString() - { - return 'Product is not displayed in related products section.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAbsentUpSells.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAbsentUpSells.php deleted file mode 100644 index e9a02c1ea01..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAbsentUpSells.php +++ /dev/null @@ -1,68 +0,0 @@ -hasData('up_sell_products') - ? $product->getDataFieldConfig('up_sell_products')['source']->getProducts() - : []; - } - - $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - foreach ($promotedProducts as $promotedProduct) { - \PHPUnit_Framework_Assert::assertFalse( - $catalogProductView->getUpsellBlock()->getItemBlock($promotedProduct)->isVisible(), - 'Product \'' . $promotedProduct->getName() . '\' is exist in up-sells products.' - ); - } - } - - /** - * Text success product is not displayed in up-sell section. - * - * @return string - */ - public function toString() - { - return 'Product is not displayed in up-sell section.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeDisplayingOnSearchForm.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeDisplayingOnSearchForm.php deleted file mode 100644 index 6546a077e5a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeDisplayingOnSearchForm.php +++ /dev/null @@ -1,60 +0,0 @@ -open(); - $formLabels = $advancedSearch->getForm()->getFormlabels(); - $label = $attribute->hasData('manage_frontend_label') - ? $attribute->getManageFrontendLabel() - : $attribute->getFrontendLabel(); - \PHPUnit_Framework_Assert::assertTrue( - in_array($label, $formLabels), - 'Attribute is absent on advanced search form.' - ); - } - - /** - * Returns string representation of object. - * - * @return string - */ - public function toString() - { - return 'Attribute is present on advanced search form.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeInGrid.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeInGrid.php deleted file mode 100644 index bdd39db8d4c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeInGrid.php +++ /dev/null @@ -1,57 +0,0 @@ -open(); - $code = $attribute->getAttributeCode(); - \PHPUnit_Framework_Assert::assertTrue( - $attributeIndexPage->getGrid()->isRowVisible(['attribute_code' => $code]), - 'Attribute with attribute code "' . $code . '" is absent in attribute grid.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product attribute is present in attribute grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeIsComparable.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeIsComparable.php deleted file mode 100644 index 5208d644304..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeIsComparable.php +++ /dev/null @@ -1,73 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - $catalogProductView->getViewBlock()->clickAddToCompare(); - $catalogProductCompare->open(); - $label = $attribute->hasData('manage_frontend_label') - ? $attribute->getManageFrontendLabel() - : $attribute->getFrontendLabel(); - - \PHPUnit_Framework_Assert::assertTrue( - $catalogProductCompare->getCompareProductsBlock()->isAttributeVisible($label), - 'Attribute is absent on product compare page.' - ); - } - - /** - * Return string representation of object. - * - * @return string - */ - public function toString() - { - return 'Attribute is present on product compare page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeIsFilterable.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeIsFilterable.php deleted file mode 100644 index 36e3bbfd8d5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeIsFilterable.php +++ /dev/null @@ -1,67 +0,0 @@ -open()->getTopmenu()->selectCategory($product->getCategoryIds()[0]); - $label = $attribute->hasData('manage_frontend_label') - ? $attribute->getManageFrontendLabel() - : $attribute->getFrontendLabel(); - \PHPUnit_Framework_Assert::assertTrue( - in_array(strtoupper($label), $catalogCategoryView->getLayeredNavigationBlock()->getFilters()), - 'Attribute is absent in layered navigation on category page.' - ); - } - - /** - * Return string representation of object. - * - * @return string - */ - public function toString() - { - return 'Attribute is present in layered navigation on category page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeIsFilterableInSearch.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeIsFilterableInSearch.php deleted file mode 100644 index 9aa1317deb7..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeIsFilterableInSearch.php +++ /dev/null @@ -1,67 +0,0 @@ -open()->getSearchBlock()->search($product->getName()); - $label = $attribute->hasData('manage_frontend_label') - ? $attribute->getManageFrontendLabel() - : $attribute->getFrontendLabel(); - \PHPUnit_Framework_Assert::assertTrue( - in_array(strtoupper($label), $catalogsearchResult->getLayeredNavigationBlock()->getFilters()), - 'Attribute is absent in layered navigation on search page.' - ); - } - - /** - * Return string representation of object. - * - * @return string - */ - public function toString() - { - return 'Attribute is present in layered navigation on search page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeIsGlobal.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeIsGlobal.php deleted file mode 100644 index 5013ed15322..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeIsGlobal.php +++ /dev/null @@ -1,58 +0,0 @@ -open(); - $code = $attribute->getAttributeCode(); - $filter = ['attribute_code' => $code, 'is_global' => $attribute->getIsGlobal()]; - \PHPUnit_Framework_Assert::assertTrue( - $attributeIndexPage->getGrid()->isRowVisible($filter), - "Attribute with attribute code '$code' isn't global." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Attribute is global.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeIsRequired.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeIsRequired.php deleted file mode 100644 index e4d7d1e4c28..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeIsRequired.php +++ /dev/null @@ -1,76 +0,0 @@ -open()->getProductGrid()->searchAndOpen(['sku' => $product->getSku()]); - $productForm = $catalogProductEdit->getProductForm(); - $productForm->getAttributeElement($attribute)->setValue(''); - $catalogProductEdit->getFormPageActions()->save(); - $failedAttributes = $productForm->getRequireNoticeAttributes($product); - $actualMessage = $failedAttributes['general'][$attribute->getFrontendLabel()]; - - \PHPUnit_Framework_Assert::assertEquals( - self::REQUIRE_MESSAGE, - $actualMessage, - 'JS error notice on product edit page is not equal to expected.' - ); - } - - /** - * Return string representation of object. - * - * @return string - */ - public function toString() - { - return "The attribute is mandatory."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeIsUnique.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeIsUnique.php deleted file mode 100644 index fa469c01066..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeIsUnique.php +++ /dev/null @@ -1,68 +0,0 @@ -open(); - $catalogProductAttributeIndex->getPageActionsBlock()->addNew(); - $attributeNew->getAttributeForm()->fill($attribute); - $attributeNew->getPageActions()->saveAndContinue(); - - $actualMessage = $attributeNew->getMessagesBlock()->getErrorMessages(); - \PHPUnit_Framework_Assert::assertEquals(self::UNIQUE_MESSAGE, $actualMessage); - } - - /** - * Return string representation of object. - * - * @return string - */ - public function toString() - { - return 'Attribute is unique.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeIsUsedInSortOnFrontend.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeIsUsedInSortOnFrontend.php deleted file mode 100644 index bab3ac89a8b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeIsUsedInSortOnFrontend.php +++ /dev/null @@ -1,68 +0,0 @@ -open()->getSearchBlock()->search($product->getName()); - $label = $attribute->hasData('manage_frontend_label') - ? $attribute->getManageFrontendLabel() - : $attribute->getFrontendLabel(); - - \PHPUnit_Framework_Assert::assertTrue( - in_array($label, $catalogsearchResult->getListProductBlock()->getSortByValues()), - 'Attribute is absent in sort dropdown on search results page on frontend.' - ); - } - - /** - * Return string representation of object. - * - * @return string - */ - public function toString() - { - return 'Attribute is present in sort dropdown on search results page on frontend.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeSearchableByLabel.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeSearchableByLabel.php deleted file mode 100644 index e6bd31460b3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeSearchableByLabel.php +++ /dev/null @@ -1,95 +0,0 @@ -open(); - $filter = $this->prepareFilter($product, $attribute); - $cmsIndex->getSearchBlock()->search($filter); - $isProductVisible = $catalogSearchResult->getListProductBlock()->isProductVisible($product); - while (!$isProductVisible && $catalogSearchResult->getBottomToolbar()->nextPage()) { - $isProductVisible = $catalogSearchResult->getListProductBlock()->isProductVisible($product); - } - - \PHPUnit_Framework_Assert::assertTrue($isProductVisible, 'Product was not found by option label.'); - } - - /** - * Prepare filter for search. - * - * @param InjectableFixture $product - * @param CatalogProductAttribute $attribute - * @return string - */ - protected function prepareFilter(InjectableFixture $product, CatalogProductAttribute $attribute) - { - $filter = ''; - $attributesFillData = $product->getAttributes(); - $attributeOptions = $attribute->getOptions(); - foreach ($attributesFillData['dataset'] as $optionsFillData) { - foreach ($optionsFillData as $optionKey) { - $optionKey = str_replace('option_key_', '', $optionKey); - $filter .= isset($attributeOptions[$optionKey]['view']) - ? $attributeOptions[$optionKey]['view'] - : $attributeOptions[$optionKey]['admin']; - } - } - - return $filter; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return "Product is searchable by attribute label."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCanNotAddToCart.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCanNotAddToCart.php deleted file mode 100644 index 5a16a48983b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCanNotAddToCart.php +++ /dev/null @@ -1,62 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - \PHPUnit_Framework_Assert::assertFalse( - $catalogProductView->getViewBlock()->checkAddToCartButton(), - 'Add to Cart button is present on product page' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Add to Cart button is absent on product page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCompareBlockOnCmsPage.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCompareBlockOnCmsPage.php deleted file mode 100644 index 2cdda0a6e6c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCompareBlockOnCmsPage.php +++ /dev/null @@ -1,67 +0,0 @@ -createByCode('cmsPage', ['dataset' => '3_column_template']); - $newCmsPage->persist(); - $browser->open($_ENV['app_frontend_url'] . $newCmsPage->getIdentifier()); - foreach ($products as &$product) { - $product = strtolower($product->getName()); - } - \PHPUnit_Framework_Assert::assertEquals( - $products, - $cmsIndex->getCompareBlock()->getProducts(), - 'Compare product block contains NOT valid information about compared products.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Compare product block contains valid information about compared products.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCompareItemsLink.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCompareItemsLink.php deleted file mode 100644 index 99a89705985..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCompareItemsLink.php +++ /dev/null @@ -1,68 +0,0 @@ -open(); - \PHPUnit_Framework_Assert::assertEquals( - count($products), - $cmsIndex->getCompareBlock()->getQtyInCompareList(), - 'Qty is not correct in "Compare Products" link.' - ); - - \PHPUnit_Framework_Assert::assertTrue( - str_contains($cmsIndex->getCompareBlock()->getCompareLinkUrl(), $this->compareProductUrl), - 'Compare product link isn\'t lead to Compare Product Page.' - ); - } - - /** - * Returns a string representation of the object - * - * @return string - */ - public function toString() - { - return '"Compare Products..." link on top menu of page is correct.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCompareItemsLinkIsAbsent.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCompareItemsLinkIsAbsent.php deleted file mode 100644 index 5e8e5a05021..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCompareItemsLinkIsAbsent.php +++ /dev/null @@ -1,52 +0,0 @@ -getLinksBlock()->isLinkVisible("Compare Products"), - 'The link "Compare Products..." is visible at the top of page.' - ); - } - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'The link is NOT visible at the top of page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductComparePage.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductComparePage.php deleted file mode 100644 index 9b169564f23..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductComparePage.php +++ /dev/null @@ -1,124 +0,0 @@ - 'SKU', - 'description' => 'Description', - 'short_description' => 'Short Description', - ]; - - /** - * Catalog product compare page. - * - * @var CatalogProductCompare - */ - protected $comparePage; - - /** - * Assert that "Compare Product" page contains product(s) that was added: - * - Product name - * - Price - * - SKU - * - Description (if exists, else text "No") - * - Short Description (if exists, else text "No") - * - * @param CatalogProductCompare $comparePage - * @param array $products - * @return void - * - * @SuppressWarnings(PHPMD.NPathComplexity) - */ - public function processAssert(CatalogProductCompare $comparePage, array $products) - { - $this->comparePage = $comparePage; - $comparePage->open(); - foreach ($products as $key => $product) { - $attributeData = $this->prepareAttributeData($product, $key); - \PHPUnit_Framework_Assert::assertEquals( - $attributeData['attributeValues'], - $attributeData['attributeValuesFromPage'], - "Product {$product->getName()} is not equals with data from fixture." - ); - } - } - - /** - * Prepare attribute data. - * - * @param InjectableFixture $product - * @param int $key - * @return array - */ - protected function prepareAttributeData(InjectableFixture $product, $key) - { - $data = []; - foreach ($this->attributeProduct as $attributeKey => $attribute) { - $value = $attribute; - $attribute = is_numeric($attributeKey) ? $attribute : $attributeKey; - - $attributeValue = $attribute != 'price' - ? ($product->hasData($attribute) - ? $product->getData($attribute) - : 'N/A') - : ($product->getDataFieldConfig('price')['source']->getPriceData() !== null - ? $product->getDataFieldConfig('price')['source']->getPriceData() - : number_format($product->getPrice(), 2)); - - $data['attributeValues'][$attribute] = !is_array($attributeValue) ? strtolower( - $attributeValue - ) : $attributeValue; - $attributeName = ($value === 'name' || $value === 'price') ? 'Info' : 'MetaData'; - $data['attributeValuesFromPage'][$attribute] = $this->comparePage->getCompareProductsBlock( - )->{'getProduct' . $attributeName}( - $key + 1, - $value - ); - } - - return $data; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return '"Compare Product" page has valid data for all products.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCompareSuccessAddMessage.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCompareSuccessAddMessage.php deleted file mode 100644 index ca4d938dd85..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCompareSuccessAddMessage.php +++ /dev/null @@ -1,59 +0,0 @@ -getName()); - $actualMessage = $catalogProductView->getMessagesBlock()->getSuccessMessages(); - \PHPUnit_Framework_Assert::assertEquals($successMessage, $actualMessage); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return "Product has been added to compare products list."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCompareSuccessRemoveAllProductsMessage.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCompareSuccessRemoveAllProductsMessage.php deleted file mode 100644 index 621d9adaca9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCompareSuccessRemoveAllProductsMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Compare Product success message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCrossSells.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCrossSells.php deleted file mode 100644 index c7ef11f5a6f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCrossSells.php +++ /dev/null @@ -1,82 +0,0 @@ -hasData('cross_sell_products') - ? $product->getDataFieldConfig('cross_sell_products')['source']->getProducts() - : []; - } - - $checkoutCart->open(); - $checkoutCart->getCartBlock()->clearShoppingCart(); - - $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - $catalogProductView->getViewBlock()->addToCart($product); - $checkoutCart->open(); - foreach ($promotedProducts as $promotedProduct) { - if (!$checkoutCart->getCrosssellBlock()->getItemBlock($promotedProduct)->isVisible()) { - $errors[] = 'Product \'' . $promotedProduct->getName() . '\' is absent in cross-sell section.'; - } - } - - \PHPUnit_Framework_Assert::assertEmpty($errors, implode(" ", $errors)); - } - - /** - * Text success product is displayed in cross-sell section. - * - * @return string - */ - public function toString() - { - return 'Product is displayed in cross-sell section.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCustomOptionsOnProductPage.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCustomOptionsOnProductPage.php deleted file mode 100644 index 67ecd4f9a51..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCustomOptionsOnProductPage.php +++ /dev/null @@ -1,136 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - $fixtureCustomOptions = $this->prepareOptions($product); - $formCustomOptions = $catalogProductView->getViewBlock()->getOptions($product)['custom_options']; - $error = $this->verifyData($fixtureCustomOptions, $formCustomOptions); - \PHPUnit_Framework_Assert::assertEmpty($error, $error); - } - - /** - * Preparation options before comparing. - * - * @param InjectableFixture $product - * @return array - * - * @SuppressWarnings(PHPMD.NPathComplexity) - */ - protected function prepareOptions(InjectableFixture $product) - { - $result = []; - $customOptions = $product->getCustomOptions(); - $actualPrice = $this->getProductActualPrice($product); - foreach ($customOptions as $customOption) { - $customOptionsPriceType = isset($customOption['options']['price_type']) - ? $customOption['options']['price_type'] - : null; - if ($customOptionsPriceType) { - if ($customOptionsPriceType === 'Percent') { - $customOptionPrice = $customOption['options']['price']; - $customOption['options']['price'] = $this->calculatePrice($actualPrice, $customOptionPrice); - } - $customOption['options'] = array_diff_key( - $customOption['options'], - array_flip($this->skippedFieldOptions) - ); - } else { - foreach ($customOption['options'] as &$option) { - if ('Percent' === $option['price_type']) { - $option['price'] = $this->calculatePrice($actualPrice, $option['price']); - } - $option = array_diff_key($option, array_flip($this->skippedFieldOptions)); - } - } - $customOption['type'] = explode('/', $customOption['type'])[1]; - $result[$customOption['title']] = $customOption; - } - - return $result; - } - - /** - * Calculate price. - * - * @param int $actualPrice - * @param int $customOptionPrice - * @return int - */ - protected function calculatePrice($actualPrice, $customOptionPrice) - { - return round((($actualPrice * $customOptionPrice) / 100), 2); - } - - /** - * Get product actual price. - * - * @param InjectableFixture $product - * @return int - */ - protected function getProductActualPrice(InjectableFixture $product) - { - return $product->hasData('special_price') ? $product->getSpecialPrice() : $product->getPrice(); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Value of custom option on the page is correct.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductDuplicateForm.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductDuplicateForm.php deleted file mode 100644 index de53d5782b2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductDuplicateForm.php +++ /dev/null @@ -1,147 +0,0 @@ - [ - 'decimals' => 2, - 'dec_point' => '.', - 'thousands_sep' => '', - ], - 'qty' => [ - 'decimals' => 4, - 'dec_point' => '.', - 'thousands_sep' => '', - ], - 'weight' => [ - 'decimals' => 4, - 'dec_point' => '.', - 'thousands_sep' => '', - ], - ]; - - /** - * Format for url key field. - * - * @var string - */ - protected $urlKeyFormat; - - /** - * Assert form data equals fixture data. - * - * @param InjectableFixture $product - * @param CatalogProduct $productGrid - * @param CatalogProductEdit $productPage - * @param string $urlKeyFormat [optional] - * @return void - */ - public function processAssert( - InjectableFixture $product, - CatalogProduct $productGrid, - CatalogProductEdit $productPage, - $urlKeyFormat = '%s' - ) { - $this->product = $product; - $this->urlKeyFormat = $urlKeyFormat; - $this->catalogProductEdit = $productPage; - $filter = ['name' => $product->getName(), 'status' => 'Disabled']; - $productGrid->open()->getProductGrid()->searchAndOpen($filter); - - $formData = $productPage->getProductForm()->getData($product); - $fixtureData = $this->prepareFixtureData($product->getData()); - - $errors = $this->verifyData($fixtureData, $formData); - \PHPUnit_Framework_Assert::assertEmpty($errors, $errors); - } - - /** - * Prepares fixture data for comparison. - * - * @param array $data - * @param array $sortFields [optional] - * @return array - */ - protected function prepareFixtureData(array $data, array $sortFields = []) - { - $compareData = array_filter($data); - - array_walk_recursive( - $compareData, - function (&$item, $key, $formattingOptions) { - if (isset($formattingOptions[$key])) { - $item = number_format( - $item, - $formattingOptions[$key]['decimals'], - $formattingOptions[$key]['dec_point'], - $formattingOptions[$key]['thousands_sep'] - ); - } - }, - $this->formattingOptions - ); - - if (isset($compareData['status'])) { - $compareData['status'] = 'Disabled'; - } - if (isset($compareData['stock_data']['qty'])) { - $compareData['stock_data'] = ['qty' => 0, 'is_in_stock' => 'Out of Stock']; - } - $compareData['sku'] = ''; - $compareData['url_key'] = sprintf($this->urlKeyFormat, $compareData['url_key']); - - return parent::prepareFixtureData($compareData, $sortFields); - } - - /** - * Prepare url key. - * - * @param string $urlKey - * @return string - */ - protected function prepareUrlKey($urlKey) - { - return $urlKey; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Form data equals to fixture data of duplicated product.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductDuplicateIsNotDisplayingOnFrontend.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductDuplicateIsNotDisplayingOnFrontend.php deleted file mode 100644 index 0812f3937bc..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductDuplicateIsNotDisplayingOnFrontend.php +++ /dev/null @@ -1,58 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '-1' . '.html'); - \PHPUnit_Framework_Assert::assertFalse( - $catalogProductView->getViewBlock()->isVisible(), - 'Duplicate Product is displayed on frontend.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'The product does not appear on the frontend.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductDuplicateMessage.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductDuplicateMessage.php deleted file mode 100644 index dfef3530646..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductDuplicateMessage.php +++ /dev/null @@ -1,54 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product duplicated message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductDuplicatedInGrid.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductDuplicatedInGrid.php deleted file mode 100644 index 3a56a4a4944..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductDuplicatedInGrid.php +++ /dev/null @@ -1,61 +0,0 @@ -getDataConfig(); - $filter = [ - 'name' => $product->getName(), - 'visibility' => $product->getVisibility(), - 'status' => 'Disabled', - 'type' => ucfirst($config['create_url_params']['type']) . ' Product', - 'price_to' => number_format($product->getPrice(), 2), - ]; - $productGrid->open()->getProductGrid()->search($filter); - - \PHPUnit_Framework_Assert::assertTrue( - $productGrid->getProductGrid()->isRowVisible($filter, false, false), - 'Product duplicate is absent in Products grid.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'The product has been successfully found, according to the filters.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductForm.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductForm.php deleted file mode 100644 index 662644d94e8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductForm.php +++ /dev/null @@ -1,213 +0,0 @@ -product = $product; - $this->catalogProductEdit = $productPage; - $filter = ['sku' => $product->getSku()]; - $productGrid->open(); - $productGrid->getProductGrid()->searchAndOpen($filter); - - $productData = $product->getData(); - $fixtureData = $this->prepareFixtureData($productData, $this->sortFields); - $formData = $this->prepareFormData($productPage->getProductForm()->getData($product), $this->sortFields); - $error = $this->verifyData($fixtureData, $formData); - \PHPUnit_Framework_Assert::assertTrue(empty($error), $error); - } - - /** - * Prepares fixture data for comparison. - * - * @param array $data - * @param array $sortFields [optional] - * @return array - */ - protected function prepareFixtureData(array $data, array $sortFields = []) - { - $data = array_diff_key($data, array_flip($this->skippedFixtureFields)); - - if (!$this->catalogProductEdit->getProductForm()->getTabElement('websites')->isVisible()) { - unset($data['website_ids']); - } - if (isset($data['website_ids']) && !is_array($data['website_ids'])) { - $data['website_ids'] = [$data['website_ids']]; - } - if (!empty($this->specialArray)) { - $data = $this->prepareSpecialPriceArray($data); - } - if (isset($data['category_ids'])) { - $data['category_ids'] = $this->getFullPathCategories(); - } - - foreach ($sortFields as $path) { - $data = $this->sortDataByPath($data, $path); - } - return $data; - } - - /** - * Get full path for all categories. - * - * @return array - */ - protected function getFullPathCategories() - { - $result = []; - $categories = $this->product->getDataFieldConfig('category_ids')['source']->getCategories(); - foreach ($categories as $key => $itemCategory) { - $fullPath = $this->prepareFullCategoryPath($itemCategory); - $result[$key] = implode('/', $fullPath); - } - - return $result; - } - - /** - * Prepare category path. - * - * @param CatalogCategory $category - * @return array - */ - protected function prepareFullCategoryPath(CatalogCategory $category) - { - $path = []; - $parentCategory = $category->getDataFieldConfig('parent_id')['source']->getParentCategory(); - - if ($parentCategory != null) { - $path = $this->prepareFullCategoryPath($parentCategory); - } - return array_filter(array_merge($path, [$category->getPath(), $category->getName()])); - } - - /** - * Prepare special price array for product. - * - * @param array $fields - * @return array - */ - protected function prepareSpecialPriceArray(array $fields) - { - foreach ($this->specialArray as $key => $value) { - if (array_key_exists($key, $fields)) { - if (isset($value['type']) && $value['type'] == 'date') { - $fields[$key] = vsprintf('%d/%d/%d', explode('/', $fields[$key])); - } - } - } - return $fields; - } - - /** - * Prepares form data for comparison. - * - * @param array $data - * @param array $sortFields [optional] - * @return array - */ - protected function prepareFormData(array $data, array $sortFields = []) - { - foreach ($sortFields as $path) { - $data = $this->sortDataByPath($data, $path); - } - return $data; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Form data equal the fixture data.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductGroupedPriceOnProductPage.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductGroupedPriceOnProductPage.php deleted file mode 100644 index 5004950bb20..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductGroupedPriceOnProductPage.php +++ /dev/null @@ -1,120 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - - //Process assertions - $this->assertPrice($product, $catalogProductView->getViewBlock()); - } - - /** - * Set $errorMessage for grouped price assert. - * - * @param string $errorMessage - * @return void - */ - public function setErrorMessage($errorMessage) - { - $this->errorMessage = $errorMessage; - } - - /** - * Verify product special price on product view page. - * - * @param InjectableFixture $product - * @param View $productViewBlock - * @param string $customerGroup [optional] - * @return void - */ - public function assertPrice(InjectableFixture $product, View $productViewBlock, $customerGroup = 'NOT LOGGED IN') - { - $this->customerGroup = $customerGroup; - $groupPrice = $this->getGroupedPrice($productViewBlock, $product); - \PHPUnit_Framework_Assert::assertEquals($groupPrice['fixture'], $groupPrice['onPage'], $this->errorMessage); - } - - /** - * Get grouped price with fixture product and product page. - * - * @param View $view - * @param InjectableFixture $product - * @return array - */ - protected function getGroupedPrice(View $view, InjectableFixture $product) - { - $fields = $product->getData(); - $groupPrice['onPage'] = $view->getPriceBlock()->getSpecialPrice(); - $groupPrice['fixture'] = number_format( - $fields['group_price'][array_search($this->customerGroup, $fields['group_price'])]['price'], - 2 - ); - - return $groupPrice; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Assert that displayed grouped price on product page equals passed from fixture.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductInCart.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductInCart.php deleted file mode 100644 index 8692f40dfda..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductInCart.php +++ /dev/null @@ -1,133 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - $catalogProductView->getViewBlock()->addToCart($product); - - // Check price - $this->assertOnShoppingCart($product, $checkoutCart); - } - - /** - * Assert prices on the shopping cart. - * - * @param InjectableFixture $product - * @param CheckoutCart $checkoutCart - * @return void - */ - protected function assertOnShoppingCart(InjectableFixture $product, CheckoutCart $checkoutCart) - { - $cartItem = $checkoutCart->getCartBlock()->getCartItem($product); - $formPrice = $cartItem->getCartItemTypePrice('price'); - $fixturePrice = number_format($this->prepareFixturePrice($product), 2); - - \PHPUnit_Framework_Assert::assertEquals( - $fixturePrice, - $formPrice, - 'Product price in shopping cart is not correct.' - ); - } - - /** - * Prepare product price from fixture. - * - * @param InjectableFixture $product - * @return float - */ - protected function prepareFixturePrice(InjectableFixture $product) - { - /** @var CatalogProductSimple $product */ - $customOptions = $product->getCustomOptions(); - $checkoutData = $product->getCheckoutData(); - $checkoutCustomOptions = isset($checkoutData['options']['custom_options']) - ? $checkoutData['options']['custom_options'] - : []; - - if (isset($checkoutData['cartItem'])) { - $fixturePrice = $checkoutData['cartItem']['price']; - } else { - $fixturePrice = $product->getPrice(); - $groupPrice = $product->getGroupPrice(); - $specialPrice = $product->getSpecialPrice(); - if ($groupPrice) { - $groupPrice = reset($groupPrice); - $fixturePrice = $groupPrice['price']; - } - if ($specialPrice) { - $fixturePrice = $specialPrice; - } - foreach ($checkoutCustomOptions as $checkoutOption) { - $attributeKey = str_replace('attribute_key_', '', $checkoutOption['title']); - $optionKey = str_replace('option_key_', '', $checkoutOption['value']); - $option = $customOptions[$attributeKey]['options'][$optionKey]; - - if ('Fixed' == $option['price_type']) { - $fixturePrice += $option['price']; - } else { - $fixturePrice += ($fixturePrice / 100) * $option['price']; - } - } - } - - return $fixturePrice; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product is correctly displayed in cart.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductInCategory.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductInCategory.php deleted file mode 100644 index feceab3f941..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductInCategory.php +++ /dev/null @@ -1,102 +0,0 @@ -getName(); - if ($product->hasData('category_ids')) { - $categoryIds = $product->getCategoryIds(); - $categoryName = is_array($categoryIds) ? reset($categoryIds) : $categoryName; - } - $cmsIndex->open(); - $cmsIndex->getTopmenu()->selectCategory($categoryName); - - $isProductVisible = $catalogCategoryView->getListProductBlock()->isProductVisible($product); - while (!$isProductVisible && $catalogCategoryView->getBottomToolbar()->nextPage()) { - $isProductVisible = $catalogCategoryView->getListProductBlock()->isProductVisible($product); - } - - \PHPUnit_Framework_Assert::assertTrue( - $isProductVisible, - 'Product is absent on category page.' - ); - - //Process price asserts - $this->assertPrice($product, $catalogCategoryView); - } - - /** - * Verify product price on category view page. - * - * @param InjectableFixture $product - * @param CatalogCategoryView $catalogCategoryView - * @return void - */ - protected function assertPrice(InjectableFixture $product, CatalogCategoryView $catalogCategoryView) - { - $price = $catalogCategoryView->getListProductBlock()->getProductPriceBlock($product->getName()) - ->getRegularPrice(); - - \PHPUnit_Framework_Assert::assertEquals( - number_format($product->getPrice(), 2), - $price, - 'Product regular price on category page is not correct.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product price on category page correct.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductInGrid.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductInGrid.php deleted file mode 100644 index bcdb65edf01..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductInGrid.php +++ /dev/null @@ -1,95 +0,0 @@ -product = $product; - $productGrid->open(); - \PHPUnit_Framework_Assert::assertTrue( - $productGrid->getProductGrid()->isRowVisible($this->prepareFilter()), - 'Product \'' . $this->product->getName() . '\' is absent in Products grid.' - ); - } - - /** - * Prepare filter for product grid. - * - * @return array - */ - protected function prepareFilter() - { - $filter = [ - 'type' => $this->getProductType(), - 'sku' => $this->product->getSku(), - 'status' => $this->product->getStatus(), - ]; - - return $filter; - } - - /** - * Get product type - * - * @return string - */ - protected function getProductType() - { - $config = $this->product->getDataConfig(); - - return ucfirst($config['type_id']) . ' Product'; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product is present in products grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductInStock.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductInStock.php deleted file mode 100644 index 5ee428a724c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductInStock.php +++ /dev/null @@ -1,67 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - \PHPUnit_Framework_Assert::assertEquals( - self::STOCK_AVAILABILITY, - $catalogProductView->getViewBlock()->getStockAvailability($product), - 'Control "' . self::STOCK_AVAILABILITY . '" is not visible.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'In stock control is visible.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductIsNotDisplayingOnFrontend.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductIsNotDisplayingOnFrontend.php deleted file mode 100644 index 6faff6752ba..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductIsNotDisplayingOnFrontend.php +++ /dev/null @@ -1,160 +0,0 @@ -browser = $browser; - $this->catalogProductView = $catalogProductView; - $this->cmsIndex = $cmsIndex; - $this->catalogSearchResult = $catalogSearchResult; - $this->catalogCategoryView = $catalogCategoryView; - $this->category = $category; - $products = is_array($product) ? $product : [$product]; - foreach ($products as $product) { - $errors = $this->isNotDisplayingOnFrontendAssert($product); - \PHPUnit_Framework_Assert::assertEmpty( - $errors, - "In the process of checking product availability on the frontend, found the following errors:\n" - . implode("\n", $errors) - ); - } - } - - /** - * Verify product displaying on frontend. - * - * @param InjectableFixture $product - * @return array - */ - protected function isNotDisplayingOnFrontendAssert(InjectableFixture $product) - { - $errors = []; - //Check that product is not available by url - $this->browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - if ($this->catalogProductView->getViewBlock()->isVisible()) { - $errors[] = '- product view block is visible in product page.'; - } - //Check that product can't be found - $this->cmsIndex->open()->getSearchBlock()->search($product->getSku()); - if ($this->catalogSearchResult->getListProductBlock()->isProductVisible($product)) { - $errors[] = '- successful product search.'; - } - //Check that product is not available in category page - $categoryName = $product->hasData('category_ids') ? $product->getCategoryIds()[0] : $this->category->getName(); - $this->cmsIndex->open()->getTopmenu()->selectCategory($categoryName); - $isProductVisible = $this->catalogCategoryView->getListProductBlock()->isProductVisible($product); - $bottomToolBar = $this->catalogCategoryView->getBottomToolbar(); - while (!$isProductVisible && $bottomToolBar->nextPage()) { - $isProductVisible = $this->catalogCategoryView->getListProductBlock() - ->isProductVisible($product); - } - if ($isProductVisible) { - $errors[] = "- product with name '{$product->getName()}' is found in this category."; - } - - return $errors; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product is not displayed on frontend.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductMapAppliedBeforeCheckout.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductMapAppliedBeforeCheckout.php deleted file mode 100644 index b15feb5d2dd..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductMapAppliedBeforeCheckout.php +++ /dev/null @@ -1,122 +0,0 @@ -getCartBlock()->clearShoppingCart(); - $productName = $products[$i]->getName(); - $cmsIndex->open(); - $cmsIndex->getTopmenu()->selectCategory($category->getName()); - - // Check that price is not present on category page. - $listProductBlock = $catalogCategoryView->getListProductBlock(); - $productPriceBlock = $listProductBlock->getProductPriceBlock($productName); - $productPriceBlock->clickForPrice(); - \PHPUnit_Framework_Assert::assertFalse( - $productPriceBlock->getMapBlock()->isPriceVisible(), - 'Price is present in MSRP dialog on category page.' - ); - - // Check that price is not present on product page. - $listProductBlock->openProductViewPage($productName); - \PHPUnit_Framework_Assert::assertFalse( - $catalogProductView->getViewBlock()->getPriceBlock()->isRegularPriceVisible(), - 'Price is present in View block on product page.' - ); - - // Check that price is not present on cart. - $catalogProductView->getViewBlock()->addToCart($products[$i]); - \PHPUnit_Framework_Assert::assertTrue( - $cart->getCartBlock()->getCartItem($products[$i])->isMsrpVisible(), - "MSRP link is not visible in cart." - ); - - // Check that price is present on review block in onepage checkout page. - $cart->getCartBlock()->getProceedToCheckoutBlock()->proceedToCheckout(); - $checkoutMethodBlock = $checkoutOnePage->getLoginBlock(); - $billingBlock = $checkoutOnePage->getBillingBlock(); - $paymentMethodBlock = $checkoutOnePage->getPaymentMethodsBlock(); - $shippingBlock = $checkoutOnePage->getShippingMethodBlock(); - $checkoutMethodBlock->guestCheckout(); - $checkoutMethodBlock->clickContinue(); - $billingBlock->fillBilling($address, $customer); - $billingBlock->clickContinue(); - $shippingBlock->selectShippingMethod(['shipping_service' => 'Flat Rate', 'shipping_method' => 'Fixed']); - $shippingBlock->clickContinue(); - $paymentMethodBlock->selectPaymentMethod(['method' => 'checkmo']); - $paymentMethodBlock->clickContinue(); - \PHPUnit_Framework_Assert::assertEquals( - number_format($products[$i]->getPrice(), 2), - $checkoutOnePage->getReviewBlock()->getTotalBlock()->getData('subtotal'), - "Subtotal in checkout one page for $productName is not equal to expected." - ); - } - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return "Products' MAP has been applied before checkout."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductMapAppliedInCart.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductMapAppliedInCart.php deleted file mode 100644 index c9d349c7d8b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductMapAppliedInCart.php +++ /dev/null @@ -1,94 +0,0 @@ -getCartBlock()->clearShoppingCart(); - $productName = $product->getName(); - $cmsIndex->open(); - $cmsIndex->getTopmenu()->selectCategory($category->getName()); - $listProductBlock = $catalogCategoryView->getListProductBlock(); - - // Check that price is not present on category page. - $productPriceBlock = $listProductBlock->getProductPriceBlock($productName); - $productPriceBlock->clickForPrice(); - \PHPUnit_Framework_Assert::assertFalse( - $productPriceBlock->getMapBlock()->isPriceVisible(), - 'Price is present in MSRP dialog on category page.' - ); - - // Check that price is not present on product page. - $listProductBlock->openProductViewPage($productName); - \PHPUnit_Framework_Assert::assertFalse( - $catalogProductView->getViewBlock()->getPriceBlock()->isRegularPriceVisible(), - 'Price is present in View block on product page.' - ); - - // Check that price is present in cart. - $catalogProductView->getViewBlock()->addToCart($product); - \PHPUnit_Framework_Assert::assertEquals( - number_format($product->getPrice(), 2), - $cart->getCartBlock()->getCartItem($product)->getCartItemTypePrice('price'), - "MAP of $productName product in cart is not equal to product price." - ); - } - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return "Products' MAP has been applied in cart."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductMapAppliedOnGesture.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductMapAppliedOnGesture.php deleted file mode 100644 index 4256e9d88d6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductMapAppliedOnGesture.php +++ /dev/null @@ -1,76 +0,0 @@ -getName(); - $cmsIndex->open(); - $cmsIndex->getTopmenu()->selectCategory($category->getName()); - $listProductBlock = $catalogCategoryView->getListProductBlock(); - - // Check that price is present in MAP popup. - $productPriceBlock = $listProductBlock->getProductPriceBlock($productName); - $productPriceBlock->clickForPrice(); - $msrpPopupBlock = $productPriceBlock->getMapBlock(); - $map = $msrpPopupBlock->isVisible() ? $msrpPopupBlock->getMap() : null; - - \PHPUnit_Framework_Assert::assertEquals( - number_format($product->getPrice(), 2), - $map, - "MAP of $productName product is not visible or not equal to product price." - ); - } - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return "Products' MAP has been applied on gesture."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductNotInGrid.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductNotInGrid.php deleted file mode 100644 index 4eda79bdd87..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductNotInGrid.php +++ /dev/null @@ -1,69 +0,0 @@ -open(); - $this->assert($product, $productGrid); - } - - /** - * Check product on product grid. - * - * @param InjectableFixture $product - * @param CatalogProduct $productGrid - * @return void - */ - public function assert(InjectableFixture $product, CatalogProduct $productGrid) - { - $filter = ['sku' => $product->getSku(), 'name' => $product->getName()]; - \PHPUnit_Framework_Assert::assertFalse( - $productGrid->getProductGrid()->isRowVisible($filter), - "Product with sku {$filter['sku']} and name {$filter['name']} is present in Products grid." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Assertion that product is absent in products grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductNotSearchableBySku.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductNotSearchableBySku.php deleted file mode 100644 index 8ecbe08d811..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductNotSearchableBySku.php +++ /dev/null @@ -1,65 +0,0 @@ -open(); - $cmsIndex->getSearchBlock()->search($product->getSku()); - \PHPUnit_Framework_Assert::assertFalse( - $catalogSearchResult->getListProductBlock()->isProductVisible($product), - 'Product was found by SKU.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return "Product is not searchable by SKU."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductOutOfStock.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductOutOfStock.php deleted file mode 100644 index bdc2e710e98..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductOutOfStock.php +++ /dev/null @@ -1,67 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - \PHPUnit_Framework_Assert::assertEquals( - self::STOCK_AVAILABILITY, - $catalogProductView->getViewBlock()->getStockAvailability($product), - 'Control \'' . self::STOCK_AVAILABILITY . '\' is not visible.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Out of stock control is visible.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductOutOfStockOnCategory.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductOutOfStockOnCategory.php deleted file mode 100644 index 7bfab0514ed..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductOutOfStockOnCategory.php +++ /dev/null @@ -1,68 +0,0 @@ -open(); - $cmsIndex->getTopmenu()->selectCategory($category->getName()); - - $isProductVisible = $catalogCategoryView->getListProductBlock()->isProductVisible($product); - while (!$isProductVisible && $catalogCategoryView->getBottomToolbar()->nextPage()) { - $isProductVisible = $catalogCategoryView->getListProductBlock()->isProductVisible($product); - } - - \PHPUnit_Framework_Assert::assertFalse($isProductVisible, 'Product is present on category page.'); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product is absent in the category page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductOutOfStockVisibleInCategory.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductOutOfStockVisibleInCategory.php deleted file mode 100644 index 591e04f2299..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductOutOfStockVisibleInCategory.php +++ /dev/null @@ -1,73 +0,0 @@ -hasData('category_ids') ? $product->getCategoryIds()[0] : $category->getName(); - $cmsIndex->open(); - $cmsIndex->getTopmenu()->selectCategory($categoryName); - $isProductVisible = $catalogCategoryView->getListProductBlock()->isProductVisible($product); - while (!$isProductVisible && $catalogCategoryView->getBottomToolbar()->nextPage()) { - $isProductVisible = $catalogCategoryView->getListProductBlock()->isProductVisible($product); - } - \PHPUnit_Framework_Assert::assertTrue( - $isProductVisible, - "Product is absent on category page." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return "Out of stock product is visible in the assigned category"; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductPage.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductPage.php deleted file mode 100644 index 5a518cb970e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductPage.php +++ /dev/null @@ -1,211 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - - $this->product = $product; - $this->productView = $catalogProductView->getViewBlock(); - $this->catalogProductView = $catalogProductView; - - $errors = $this->verify(); - \PHPUnit_Framework_Assert::assertEmpty( - $errors, - "\nFound the following errors:\n" . implode(" \n", $errors) - ); - } - - /** - * Verify displayed product data on product page(front-end) equals passed from fixture. - * - * @return array - */ - protected function verify() - { - $errors = []; - - $errors[] = $this->verifyName(); - $errors[] = $this->verifyPrice(); - $errors[] = $this->verifyDescription(); - $errors[] = $this->verifyShortDescription(); - - return array_filter($errors); - } - - /** - * Verify displayed product name on product page(front-end) equals passed from fixture. - * - * @return string|null - */ - protected function verifyName() - { - $fixtureProductName = strtoupper($this->product->getName()); - $formProductName = $this->productView->getProductName(); - - if ($fixtureProductName == $formProductName) { - return null; - } - return "Displayed product name on product page(front-end) not equals passed from fixture. " - . "Actual: {$formProductName}, expected: {$fixtureProductName}."; - } - - /** - * Verify displayed product price on product page(front-end) equals passed from fixture. - * - * @return string|null - */ - protected function verifyPrice() - { - if ($this->product->hasData('price') == false) { - return null; - } - $fixtureProductPrice = number_format($this->product->getPrice(), 2); - $formProductPrice = $this->productView->getPriceBlock()->getRegularPrice(); - if ($fixtureProductPrice == $formProductPrice) { - return null; - } - $error = "Displayed product price on product page(front-end) not equals passed from fixture. " - . "Actual: {$formProductPrice}, expected: {$fixtureProductPrice}."; - - $verifySpecialPriceResult = $this->verifySpecialPrice(); - if ($verifySpecialPriceResult !== null) { - $error .= $verifySpecialPriceResult; - } - - return $error; - } - - /** - * Verify displayed product special price on product page(front-end) equals passed from fixture. - * - * @return string|null - */ - protected function verifySpecialPrice() - { - $fixtureProductSpecialPrice = $this->product->getSpecialPrice(); - if (!$fixtureProductSpecialPrice) { - return null; - } - - $fixtureProductSpecialPrice = number_format($fixtureProductSpecialPrice, 2); - $formProductSpecialPrice = $this->productView->getPriceBlock()->getSpecialPrice(); - if ($fixtureProductSpecialPrice == $formProductSpecialPrice) { - return null; - } - return "\nDisplayed product special price on product page(front-end) not equals passed from fixture. " - . "Actual: {$formProductSpecialPrice}, expected: {$fixtureProductSpecialPrice}."; - } - - /** - * Verify displayed product description on product page(front-end) equals passed from fixture. - * - * @return string|null - */ - protected function verifyDescription() - { - $fixtureProductDescription = $this->product->getDescription(); - $formProductDescription = $this->productView->getProductDescription(); - - if ($fixtureProductDescription == $formProductDescription) { - return null; - } - return "Displayed product description on product page(front-end) not equals passed from fixture. " - . "Actual: {$formProductDescription}, expected: {$fixtureProductDescription}."; - } - - /** - * Verify displayed product short description on product page(front-end) equals passed from fixture. - * - * @return string|null - */ - protected function verifyShortDescription() - { - $fixtureProductShortDescription = $this->product->getShortDescription(); - $formProductShortDescription = $this->productView->getProductShortDescription(); - - if ($fixtureProductShortDescription == $formProductShortDescription) { - return null; - } - return "Displayed product short description on product page(front-end) not equals passed from fixture. " - . "Actual: {$formProductShortDescription}, expected: {$fixtureProductShortDescription}."; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product on product view page is correct.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductRelatedProducts.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductRelatedProducts.php deleted file mode 100644 index 21cbc735acb..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductRelatedProducts.php +++ /dev/null @@ -1,72 +0,0 @@ -hasData('related_products') - ? $product->getDataFieldConfig('related_products')['source']->getProducts() - : []; - } - - $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - foreach ($promotedProducts as $promotedProduct) { - \PHPUnit_Framework_Assert::assertTrue( - $catalogProductView->getRelatedProductBlock()->getItemBlock($promotedProduct)->isVisible(), - "Product {$promotedProduct->getName()} is absent in related products." - ); - } - } - - /** - * Text success product is displayed in related products section. - * - * @return string - */ - public function toString() - { - return 'Product is displayed in related products section.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductSaveMessage.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductSaveMessage.php deleted file mode 100644 index 4da463759b8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductSaveMessage.php +++ /dev/null @@ -1,66 +0,0 @@ -getMessagesBlock()->getSuccessMessages(); - $actualMessages = is_array($actualMessages) ? $actualMessages : [$actualMessages]; - \PHPUnit_Framework_Assert::assertContains( - self::SUCCESS_MESSAGE, - $actualMessages, - 'Wrong success message is displayed.' - . "\nExpected: " . self::SUCCESS_MESSAGE - . "\nActual:\n" . implode("\n - ", $actualMessages) - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product success save message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductSearchable.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductSearchable.php deleted file mode 100644 index 80e1a721e9b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductSearchable.php +++ /dev/null @@ -1,150 +0,0 @@ -filter as $param) { - $this->verifySearchResult($catalogSearchResult, $cmsIndex, $product, $param); - } - } - - /** - * Process assert search result. - * - * @param CatalogsearchResult $catalogSearchResult - * @param CmsIndex $cmsIndex - * @param InjectableFixture $product - * @param string $param - * @throws \Exception - * @return void - * - * @SuppressWarnings(PHPMD.NPathComplexity) - */ - protected function verifySearchResult( - CatalogsearchResult $catalogSearchResult, - CmsIndex $cmsIndex, - InjectableFixture $product, - $param - ) { - $cmsIndex->open(); - $searchValue = ($product->hasData($param) !== false) ? $product->getData($param) : null; - if ($searchValue === null) { - throw new \Exception("Product '$product->getName()' doesn't have '$param' parameter."); - } - $param = strtoupper($param); - $this->errorMessage = sprintf($this->formatForErrorMessage, $param); - $this->successfulMessage = sprintf($this->formatForSuccessfulMessage, $param); - - $cmsIndex->getSearchBlock()->search($searchValue); - - $quantityAndStockStatus = $product->getStockData(); - $stockStatus = isset($quantityAndStockStatus['is_in_stock']) - ? $quantityAndStockStatus['is_in_stock'] - : null; - - $isVisible = $catalogSearchResult->getListProductBlock()->isProductVisible($product); - while (!$isVisible && $catalogSearchResult->getBottomToolbar()->nextPage()) { - $isVisible = $catalogSearchResult->getListProductBlock()->isProductVisible($product); - } - - if ($product->getVisibility() === 'Catalog' || $stockStatus === 'Out of Stock') { - $isVisible = !$isVisible; - list($this->errorMessage, $this->successfulMessage) = [$this->successfulMessage, $this->errorMessage]; - } - - \PHPUnit_Framework_Assert::assertTrue( - $isVisible, - $this->errorMessage - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return $this->successfulMessage; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductSpecialPriceNotLargerActual.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductSpecialPriceNotLargerActual.php deleted file mode 100644 index b6b84fbf82a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductSpecialPriceNotLargerActual.php +++ /dev/null @@ -1,57 +0,0 @@ -getProductForm()->getRequireNoticeAttributes($product); - \PHPUnit_Framework_Assert::assertEquals(self::ERROR_MESSAGE, $errorMessages['prices']['specialprice']); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return "Notice message is displayed in price tab on new product page."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductSpecialPriceOnProductPage.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductSpecialPriceOnProductPage.php deleted file mode 100644 index 9ad7f61503f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductSpecialPriceOnProductPage.php +++ /dev/null @@ -1,95 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - - //Process assertions - $this->assertPrice($product, $catalogProductView->getViewBlock()); - } - - /** - * Set $errorMessage for special price assert. - * - * @param string $errorMessage - * @return void - */ - public function setErrorMessage($errorMessage) - { - $this->errorMessage = $errorMessage; - } - - /** - * Verify product special price on product view page. - * - * @param InjectableFixture $product - * @param View $productViewBlock - * @return void - */ - public function assertPrice(InjectableFixture $product, View $productViewBlock) - { - \PHPUnit_Framework_Assert::assertEquals( - number_format($product->getSpecialPrice(), 2), - $productViewBlock->getPriceBlock()->getSpecialPrice(), - $this->errorMessage - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return "Assert that displayed special price on product page equals passed from fixture."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductTemplateForm.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductTemplateForm.php deleted file mode 100644 index 1af33c10875..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductTemplateForm.php +++ /dev/null @@ -1,77 +0,0 @@ - $attributeSet->getAttributeSetName(), - ]; - $productSet->open(); - $productSet->getGrid()->searchAndOpen($filterAttribute); - \PHPUnit_Framework_Assert::assertEquals( - $filterAttribute['set_name'], - $productSetEdit->getAttributeSetEditBlock()->getAttributeSetName() - ); - if ($productAttribute !== null) { - $attributeLabel = $productAttribute->getFrontendLabel(); - \PHPUnit_Framework_Assert::assertTrue( - $productSetEdit->getAttributeSetEditBlock()->checkProductAttribute($attributeLabel), - "Product Attribute '$attributeLabel' is absent on Product Template Groups." - ); - } - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Data from the Product Template form matched with fixture.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductTemplateInGrid.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductTemplateInGrid.php deleted file mode 100644 index fa97c089e5d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductTemplateInGrid.php +++ /dev/null @@ -1,60 +0,0 @@ - $attributeSet->getAttributeSetName(), - ]; - - $productSetPage->open(); - \PHPUnit_Framework_Assert::assertTrue( - $productSetPage->getGrid()->isRowVisible($filterAttributeSet), - "Attribute Set '{$filterAttributeSet['set_name']}' is absent in Product Template grid." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product template is present in Product Templates grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductTemplateOnProductForm.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductTemplateOnProductForm.php deleted file mode 100644 index a7de660e11a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductTemplateOnProductForm.php +++ /dev/null @@ -1,100 +0,0 @@ -open(); - $productGrid->getGridPageActionBlock()->addNew(); - - /**@var CatalogProductSimple $productSimple */ - $productSimple = $fixtureFactory->createByCode( - 'catalogProductSimple', - [ - 'dataset' => 'default', - 'data' => [ - 'attribute_set_id' => ['attribute_set' => $attributeSet], - ], - ] - ); - $newProductPage->getProductForm()->fill($productSimple); - $newProductPage->getFormPageActions()->saveAndContinue(); - - $attributeSetName = $attributeSet->getAttributeSetName(); - \PHPUnit_Framework_Assert::assertTrue( - $productEdit->getProductForm()->checkAttributeSet($attributeSetName), - "Product isn't in '$attributeSetName' Attribute Set." - ); - - if ($attributeSetOriginal === null) { - $productEdit->getProductForm()->openTab('general'); - - \PHPUnit_Framework_Assert::assertTrue( - $productEdit->getProductForm()->checkAttributeLabel($productAttribute), - "Product Attribute is absent on Product form." - ); - } - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product Attribute and Attribute Set are present on the Product form.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductTemplateSuccessSaveMessage.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductTemplateSuccessSaveMessage.php deleted file mode 100644 index bea3f92a448..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductTemplateSuccessSaveMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product Attribute Set success save message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductTierPriceOnProductPage.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductTierPriceOnProductPage.php deleted file mode 100644 index 1618c4ecfb3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductTierPriceOnProductPage.php +++ /dev/null @@ -1,173 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - - //Process assertions - $this->assertPrice($product, $catalogProductView->getViewBlock()); - } - - /** - * Set error message for tier price assert. - * - * @param string $errorMessage - * @return void - */ - public function setErrorMessage($errorMessage) - { - $this->errorMessage = $errorMessage; - } - - /** - * Verify product tier price on product view page. - * - * @param InjectableFixture $product - * @param View $productViewBlock - * @return void - */ - public function assertPrice(InjectableFixture $product, View $productViewBlock) - { - $errors = []; - $tierPrices = $this->prepareTierPrices($product); - foreach ($tierPrices as $key => $tierPrice) { - $formTierPrice = $productViewBlock->getTierPrices($key + 1); - preg_match($this->pattern, $formTierPrice, $match); - $errors = $this->verifyItemTierPrice($tierPrice, $match); - } - - \PHPUnit_Framework_Assert::assertEmpty($errors, $errors); - } - - /** - * Verify item tier price. - * - * @param array $fixtureTierPrice - * @param array $formTierPrice - * @return string - */ - protected function verifyItemTierPrice(array $fixtureTierPrice, array $formTierPrice) - { - $errors = []; - if (count($formTierPrice) < $this->matchCount) { - $errors[] = "Not all data exist in product page.\n"; - } - foreach ($this->verifyFields as $key => $field) { - if ($formTierPrice[$key + 1] != $fixtureTierPrice[$field]) { - $errors[] = "'$field' in form doesn't equal to fixture:\n" - . "{$formTierPrice[$key + 1]} != {$fixtureTierPrice[$field]}"; - } - } - - return implode("\n", $errors); - } - - /** - * Prepare tier price data. - * - * @param InjectableFixture $product - * @return array - */ - protected function prepareTierPrices(InjectableFixture $product) - { - $tierPrices = $product->getTierPrice(); - $percents = $product->getDataFieldConfig('price')['source']->getPriceData(); - foreach ($tierPrices as $key => $tierPrice) { - $tierPrices[$key]['price'] = number_format($tierPrices[$key]['price'], $this->priceFormat); - $tierPrices[$key]['percent'] = $percents[$key]['percent']; - } - - return $tierPrices; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Tier price is displayed on the product page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductVisibleInCategory.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductVisibleInCategory.php deleted file mode 100644 index 9052f221e72..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductVisibleInCategory.php +++ /dev/null @@ -1,109 +0,0 @@ -hasData('category_ids') ? $product->getCategoryIds()[0] : $category->getName(); - $cmsIndex->open(); - $cmsIndex->getTopmenu()->selectCategory($categoryName); - - $isProductVisible = $catalogCategoryView->getListProductBlock()->isProductVisible($product); - while (!$isProductVisible && $catalogCategoryView->getBottomToolbar()->nextPage()) { - $isProductVisible = $catalogCategoryView->getListProductBlock()->isProductVisible($product); - } - - if (($product->getVisibility() === 'Search') || ($this->getStockStatus($product) === 'Out of Stock')) { - $isProductVisible = !$isProductVisible; - $this->errorMessage = 'Product found in this category.'; - $this->successfulMessage = 'Asserts that the product could not be found in this category.'; - } - - \PHPUnit_Framework_Assert::assertTrue( - $isProductVisible, - $this->errorMessage - ); - } - - /** - * Getting is in stock status. - * - * @param InjectableFixture $product - * @return string|null - */ - protected function getStockStatus(InjectableFixture $product) - { - $quantityAndStockStatus = $product->getStockData(); - return isset($quantityAndStockStatus['is_in_stock']) ? $quantityAndStockStatus['is_in_stock'] : null; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return $this->successfulMessage; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductsIsNotDisplayingOnFrontend.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductsIsNotDisplayingOnFrontend.php deleted file mode 100644 index f427edfd9d6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductsIsNotDisplayingOnFrontend.php +++ /dev/null @@ -1,81 +0,0 @@ -processAssert( - $product, - $browser, - $catalogProductView, - $cmsIndex, - $catalogSearchResult, - $catalogCategoryView, - $category - ); - } - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Products is not displayed on frontend.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductsNotInGrid.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductsNotInGrid.php deleted file mode 100644 index c8d20784fce..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductsNotInGrid.php +++ /dev/null @@ -1,59 +0,0 @@ -open(); - foreach ($products as $product) { - $assertProductNotInGrid->assert($product, $productGrid); - } - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Assertion that products is absent in products grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductsNotVisibleInCategory.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductsNotVisibleInCategory.php deleted file mode 100644 index 1f472b25626..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductsNotVisibleInCategory.php +++ /dev/null @@ -1,70 +0,0 @@ -open(); - $cmsIndex->getTopmenu()->selectCategory($category->getName()); - foreach ($unassignedProducts as $product) { - $isProductVisible = $catalogCategoryView->getListProductBlock()->isProductVisible($product); - while (!$isProductVisible && $catalogCategoryView->getBottomToolbar()->nextPage()) { - $isProductVisible = $catalogCategoryView->getListProductBlock()->isProductVisible($product); - } - \PHPUnit_Framework_Assert::assertFalse( - $isProductVisible, - "Product {$product->getName()} is present in category page." - ); - } - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Products are absent in category page'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductsSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductsSuccessDeleteMessage.php deleted file mode 100644 index 78c7e826447..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductsSuccessDeleteMessage.php +++ /dev/null @@ -1,60 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Assertion that products success delete message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductsVisibleOnCategoryPageShopByAttribute.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductsVisibleOnCategoryPageShopByAttribute.php deleted file mode 100644 index bca222813ad..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductsVisibleOnCategoryPageShopByAttribute.php +++ /dev/null @@ -1,92 +0,0 @@ -open()->getIndexManagementGrid()->massactionForAll('Reindex Data'); - $browser->open($_ENV['app_frontend_url'] . strtolower($category->getUrlKey()) . '.html'); - $filter = $this->prepareFilter($products[$searchProductsIndexes], $filterLink); - $catalogCategoryView->getLayeredNavigationBlock()->selectAttribute($filter); - - $this->verify($catalogCategoryView, $products, $searchProductsIndexes); - } - - /** - * Prepare filter for attribute. - * - * @param ConfigurableProduct $product - * @param string $filterLink - * @return array - */ - protected function prepareFilter(ConfigurableProduct $product, $filterLink) - { - list($attributeKey, $optionKey) = explode('::', $filterLink); - $attributesData = $product->getConfigurableOptions()['attributes_data']; - return [ - 'attribute' => $attributesData[$attributeKey]['frontend_label'], - 'option' => $attributesData[$attributeKey]['options'][$optionKey]['label'] - ]; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product is present in category after filter by attribute.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductsVisibleOnCategoryPageShopByPrice.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductsVisibleOnCategoryPageShopByPrice.php deleted file mode 100644 index 0ee16e6408e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductsVisibleOnCategoryPageShopByPrice.php +++ /dev/null @@ -1,70 +0,0 @@ -open($_ENV['app_frontend_url'] . strtolower($category->getUrlKey()) . '.html'); - $catalogCategoryView->getLayeredNavigationBlock()->selectPrice($filterLink); - - $this->verify($catalogCategoryView, $products, $searchProductsIndexes); - } - - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product is present in category after filter by price.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertRelatedProducts.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertRelatedProducts.php deleted file mode 100644 index 0b76e5180fe..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertRelatedProducts.php +++ /dev/null @@ -1,125 +0,0 @@ -open()->getCartBlock()->clearShoppingCart(); - - $index = $relatedProductsData['firstProduct']['productIndex']; - $productCheck = $productsData[$index]['product']; - $relatedProducts = $productsData[$index]['relatedProducts']['related_products']['value']; - $browser->open($_ENV['app_frontend_url'] . $productCheck->getUrlKey() . '.html'); - $this->assertRelatedSection($catalogProductView, $relatedProducts); - - $index = $relatedProductsData['secondProduct']['productIndex']; - $productCheck = $productsData[$index]['product']; - $relatedProducts = $productsData[$index]['relatedProducts']['related_products']['value']; - $this->openRelatedProduct($catalogProductView, $productCheck); - $this->assertRelatedSection($catalogProductView, $relatedProducts); - - $index = $relatedProductsData['thirdProduct']['productIndex']; - $productCheck = $productsData[$index]['product']; - $this->openRelatedProduct($catalogProductView, $productCheck); - $this->assertRelatedSectionAbsent($catalogProductView); - } - - /** - * Open related product. - * - * @param CatalogProductView $catalogProductView - * @param InjectableFixture $productCheck - * @return void - */ - protected function openRelatedProduct(CatalogProductView $catalogProductView, InjectableFixture $productCheck) - { - $relatedBlock = $catalogProductView->getRelatedProductBlock(); - $relatedBlock->getItemBlock($productCheck)->openProduct(); - } - - /** - * Check products on related section. - * - * @param CatalogProductView $catalogProductView - * @param array $relatedProducts - * @return void - */ - protected function assertRelatedSection(CatalogProductView $catalogProductView, array $relatedProducts) - { - $errors = []; - $relatedBlock = $catalogProductView->getRelatedProductBlock(); - foreach ($relatedProducts as $relatedProduct) { - if (!$relatedBlock->getItemBlock($relatedProduct)->isVisible()) { - $errors[] = "Product {$relatedProduct->getName()} is absent in up-sell section."; - } - } - - \PHPUnit_Framework_Assert::assertEmpty($errors, implode("\n", $errors)); - } - - /** - * Check that related section is absent. - * - * @param CatalogProductView $catalogProductView - * @return void - */ - protected function assertRelatedSectionAbsent(CatalogProductView $catalogProductView) - { - \PHPUnit_Framework_Assert::assertFalse($catalogProductView->getUpsellBlock()->isVisible()); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Products are displayed in related section.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertRelatedProductsSection.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertRelatedProductsSection.php deleted file mode 100644 index 2939b6172d2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertRelatedProductsSection.php +++ /dev/null @@ -1,66 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - foreach ($relatedProducts as $relatedProduct) { - \PHPUnit_Framework_Assert::assertTrue( - $catalogProductView->getRelatedProductBlock()->getItemBlock($relatedProduct)->isVisible(), - "Product {$relatedProduct->getName()} is absent in related products." - ); - } - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product is displayed in related products section.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertSpecialPriceOnGroupedProductPage.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertSpecialPriceOnGroupedProductPage.php deleted file mode 100644 index c6e669f2b7c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertSpecialPriceOnGroupedProductPage.php +++ /dev/null @@ -1,62 +0,0 @@ -processAssertPrice($product, $catalogProductView, $specialPrice, $browser); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertTierPriceOnGroupedProductPage.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertTierPriceOnGroupedProductPage.php deleted file mode 100644 index 27d0f603346..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertTierPriceOnGroupedProductPage.php +++ /dev/null @@ -1,62 +0,0 @@ -processAssertPrice($product, $catalogProductView, $tierPrice, $browser, 'Tier'); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertUpSellProducts.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertUpSellProducts.php deleted file mode 100644 index 73b4bda4cd5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertUpSellProducts.php +++ /dev/null @@ -1,125 +0,0 @@ -open()->getCartBlock()->clearShoppingCart(); - - $index = $upSellProductsData['firstProduct']['productIndex']; - $productCheck = $productsData[$index]['product']; - $upSellProducts = $productsData[$index]['upSellProducts']['up_sell_products']['value']; - $browser->open($_ENV['app_frontend_url'] . $productCheck->getUrlKey() . '.html'); - $this->assertUpSellSection($catalogProductView, $upSellProducts); - - $index = $upSellProductsData['secondProduct']['productIndex']; - $productCheck = $productsData[$index]['product']; - $upSellProducts = $productsData[$index]['upSellProducts']['up_sell_products']['value']; - $this->openUpSellProduct($catalogProductView, $productCheck); - unset($upSellProducts[$upSellProductsData['firstProduct']['productIndex']]); - $this->assertUpSellSection($catalogProductView, $upSellProducts); - - $index = $upSellProductsData['thirdProduct']['productIndex']; - $productCheck = $productsData[$index]['product']; - $this->openUpSellProduct($catalogProductView, $productCheck); - $this->assertUpSellSectionAbsent($catalogProductView); - } - - /** - * Open UpSell product. - * - * @param CatalogProductView $catalogProductView - * @param InjectableFixture $productCheck - * @return void - */ - protected function openUpSellProduct(CatalogProductView $catalogProductView, InjectableFixture $productCheck) - { - $catalogProductView->getUpsellBlock()->getItemBlock($productCheck)->openProduct(); - } - - /** - * Check products on upSell section. - * - * @param CatalogProductView $catalogProductView - * @param array $upSellProducts - * @return void - */ - protected function assertUpSellSection(CatalogProductView $catalogProductView, array $upSellProducts) - { - $errors = []; - $upSellBlock = $catalogProductView->getUpsellBlock(); - foreach ($upSellProducts as $upSellProduct) { - if (!$upSellBlock->getItemBlock($upSellProduct)->isVisible()) { - $errors[] = "Product {$upSellProduct->getName()} is absent in up-sell section."; - } - } - - \PHPUnit_Framework_Assert::assertEmpty($errors, implode("\n", $errors)); - } - - /** - * Check that upSell section is absent. - * - * @param CatalogProductView $catalogProductView - * @return void - */ - protected function assertUpSellSectionAbsent(CatalogProductView $catalogProductView) - { - \PHPUnit_Framework_Assert::assertFalse($catalogProductView->getUpsellBlock()->isVisible()); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Products are displayed in upSell section.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertUpSellProductsSection.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertUpSellProductsSection.php deleted file mode 100644 index 03b6e70ba7b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertUpSellProductsSection.php +++ /dev/null @@ -1,66 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - foreach ($upSellProducts as $upSellProduct) { - \PHPUnit_Framework_Assert::assertTrue( - $catalogProductView->getUpsellBlock()->getItemBlock($upSellProduct)->isVisible(), - "Product {$upSellProduct->getName()} is absent in up-sells products." - ); - } - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Products are displayed in up-sell section.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/ProductConfigurableHandler.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/ProductConfigurableHandler.php deleted file mode 100644 index 4aaef4143ce..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/ProductConfigurableHandler.php +++ /dev/null @@ -1,83 +0,0 @@ -getCheckoutDataOptions($product, 'configurable_options'); - $productKey = $this->getProductKey($options); - $products = $this->getAssignedProducts($product); - - return $products[$productKey]->getSku(); - } - - /** - * Get product options. - * - * @param InjectableFixture $product - * @return array - */ - public function getProductOptions(InjectableFixture $product) - { - $options = $this->getCheckoutDataOptions($product, 'configurable_options'); - $productOptions = $product->getConfigurableOptions()['attributes_data']; - $configurableOptions = (!empty($options) && !empty($productOptions)) - ? $this->getOptions($options, $productOptions, 'label', false) - : []; - - return array_merge(parent::getProductOptions($product), $configurableOptions); - } - - /** - * Get assigned products. - * - * @param InjectableFixture $product - * @return array - */ - protected function getAssignedProducts(InjectableFixture $product) - { - return $product->getDataFieldConfig('configurable_options')['source']->getProducts(); - } - - /** - * Get product key. - * - * @param array $data - * @return string - */ - protected function getProductKey(array $data) - { - $key = ''; - foreach ($data as $itemData) { - $key .= $itemData['title'] . ':' . $itemData['value'] . ' '; - } - - return trim($key); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/ProductHandler.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/ProductHandler.php deleted file mode 100644 index 1b4c4ba0981..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/ProductHandler.php +++ /dev/null @@ -1,136 +0,0 @@ -getSku(); - } - - /** - * Get product options. - * - * @param InjectableFixture $product - * @return array - */ - public function getProductOptions(InjectableFixture $product) - { - $options = $this->getCheckoutDataOptions($product, 'custom_options'); - $productOptions = $product->getCustomOptions(); - - return (!empty($options) && !empty($productOptions)) ? $this->getOptions($options, $productOptions) : []; - } - - /** - * Get options. - * - * @param array $checkoutOptions - * @param array $fixtureOptions - * @param string $key [optional] - * @param bool $prepareKeys [optional] - * @return array - */ - protected function getOptions(array $checkoutOptions, array $fixtureOptions, $key = 'title', $prepareKeys = true) - { - $result = []; - foreach ($checkoutOptions as $option) { - list($attributeKey, $optionKey) = $this->getOptionKeys($option, $prepareKeys); - $result[] = [ - 'title' => $fixtureOptions[$attributeKey][$key], - 'value' => $fixtureOptions[$attributeKey]['options'][$optionKey][$key] - ]; - } - - return $result; - } - - /** - * Get option keys. - * - * @param array $option - * @param bool $prepareKeys - * @return array - */ - protected function getOptionKeys(array $option, $prepareKeys) - { - return [ - $prepareKeys ? $this->getAttributeKey($option['title']) : $option['title'], - $prepareKeys ? $this->getOptionKey($option['value']) : $option['value'] - ]; - } - - /** - * Get attribute key. - * - * @param string $attributeKey - * @return string - */ - protected function getAttributeKey($attributeKey) - { - return $this->getKey($attributeKey, 'attribute_key'); - } - - /** - * Get option key. - * - * @param string $optionKey - * @return string - */ - protected function getOptionKey($optionKey) - { - return $this->getKey($optionKey, 'option_key'); - } - - /** - * Get key. - * - * @param string $key - * @param string $replace - * @return string - */ - protected function getKey($key, $replace) - { - return str_replace($replace . '_', '', $key); - } - - /** - * Get checkout data options. - * - * @param InjectableFixture $product - * @param string $optionKey - * @return array - */ - protected function getCheckoutDataOptions(InjectableFixture $product, $optionKey = '') - { - $checkoutData = $product->getCheckoutData(); - return ($optionKey == '') - ? (isset($checkoutData['options']) ? $checkoutData['options'] : []) - : (isset($checkoutData['options'][$optionKey]) ? $checkoutData['options'][$optionKey] : []); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/Cart/Item.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/Cart/Item.php deleted file mode 100644 index 7c6112299f1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/Cart/Item.php +++ /dev/null @@ -1,67 +0,0 @@ -getCheckoutData(); - $cartItem = isset($checkoutData['cartItem']) ? $checkoutData['cartItem'] : []; - $customOptions = $product->hasData('custom_options') ? $product->getCustomOptions() : []; - $checkoutCustomOptions = isset($checkoutData['options']['custom_options']) - ? $checkoutData['options']['custom_options'] - : []; - - foreach ($checkoutCustomOptions as $key => $checkoutCustomOption) { - $attribute = str_replace('attribute_key_', '', $checkoutCustomOption['title']); - $option = str_replace('option_key_', '', $checkoutCustomOption['value']); - - $checkoutCustomOptions[$key] = [ - 'title' => isset($customOptions[$attribute]['title']) - ? $customOptions[$attribute]['title'] - : $attribute, - 'value' => isset($customOptions[$attribute]['options'][$option]['title']) - ? $customOptions[$attribute]['options'][$option]['title'] - : $option, - ]; - } - - $cartItem['options'] = $checkoutCustomOptions; - $cartItem['qty'] = isset($checkoutData['qty']) - ? $checkoutData['qty'] - : 1; - - $this->data = $cartItem; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogAttributeSet.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogAttributeSet.xml deleted file mode 100644 index ff102e8437e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogAttributeSet.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogAttributeSet/AssignedAttributes.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogAttributeSet/AssignedAttributes.php deleted file mode 100644 index eef87ecc22a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogAttributeSet/AssignedAttributes.php +++ /dev/null @@ -1,76 +0,0 @@ -params = $params; - if (isset($data['dataset']) && is_string($data['dataset'])) { - $dataset = explode(',', $data['dataset']); - foreach ($dataset as $preset) { - /** @var CatalogProductAttribute $attribute */ - $attribute = $fixtureFactory->createByCode('catalogProductAttribute', ['dataset' => $preset]); - $attribute->persist(); - - $this->data[] = $attribute->getAttributeCode(); - $this->attributes[] = $attribute; - } - } elseif (isset($data['attributes']) && is_array($data['attributes'])) { - foreach ($data['attributes'] as $attribute) { - /** @var CatalogProductAttribute $attribute */ - $this->data[] = $attribute->getAttributeCode(); - $this->attributes[] = $attribute; - } - } else { - $this->data = $data; - } - } - - /** - * Get Attributes. - * - * @return array - */ - public function getAttributes() - { - return $this->attributes; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogAttributeSet/SkeletonSet.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogAttributeSet/SkeletonSet.php deleted file mode 100644 index e67ef8f8d80..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogAttributeSet/SkeletonSet.php +++ /dev/null @@ -1,65 +0,0 @@ -params = $params; - if (isset($data['dataset']) && $data['dataset'] !== '-') { - $parentSet = $fixtureFactory->createByCode('catalogAttributeSet', ['dataset' => $data['dataset']]); - if (!$parentSet->hasData('attribute_set_id')) { - $parentSet->persist(); - } - /** @var CatalogAttributeSet $parentSet */ - $this->data = $parentSet->getAttributeSetName(); - $this->attributeSet = $parentSet; - } - } - - /** - * Get Attribute Set. - * - * @return array - */ - public function getAttributeSet() - { - return $this->attributeSet; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogCategory.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogCategory.xml deleted file mode 100644 index d36d9a00a96..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogCategory.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogCategory/CategoryProducts.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogCategory/CategoryProducts.php deleted file mode 100644 index 98db28736c6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogCategory/CategoryProducts.php +++ /dev/null @@ -1,68 +0,0 @@ -params = $params; - if (isset($data['data']) && isset($data['products'])) { - $this->data = $data['data']; - $this->products = $data['products']; - } elseif (isset($data['dataset'])) { - $products = explode(',', $data['dataset']); - foreach ($products as $value) { - $explodeValue = explode('::', $value); - $product = $fixtureFactory->createByCode($explodeValue[0], ['dataset' => $explodeValue[1]]); - if (!$product->getId()) { - $product->persist(); - } - $this->data[] = $product->getSku(); - $this->products[] = $product; - } - } - } - /** - * Return products. - * - * @return array - */ - public function getProducts() - { - return $this->products; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogCategory/ParentId.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogCategory/ParentId.php deleted file mode 100644 index a77c6d86725..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogCategory/ParentId.php +++ /dev/null @@ -1,106 +0,0 @@ -params = $params; - if (isset($data['dataset'])) { - $this->parentCategory = $fixtureFactory->createByCode('catalogCategory', ['dataset' => $data['dataset']]); - if (!$this->parentCategory->hasData('id')) { - $this->parentCategory->persist(); - } - $this->data = $this->parentCategory->getId(); - } elseif (isset($data['data']) && isset($data['parent_category'])) { - $this->data = $data['data']; - $this->parentCategory = $data['parent_category']; - } else { - $this->data = $data; - } - } - - /** - * Persist attribute options. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set. - * - * @param string|null $key - * @return mixed - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings. - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Return entity. - * - * @return CatalogCategory - */ - public function getParentCategory() - { - return $this->parentCategory; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductAttribute.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductAttribute.xml deleted file mode 100644 index 913c0df4f6f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductAttribute.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductAttribute/Options.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductAttribute/Options.php deleted file mode 100644 index 4babe6c2c64..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductAttribute/Options.php +++ /dev/null @@ -1,60 +0,0 @@ -params = $params; - if (isset($data['dataset']) && isset($this->params['repository'])) { - $this->data = $repositoryFactory->get($this->params['repository'])->get($data['dataset']); - } elseif (isset($data['value'])) { - $this->data = $data['value']; - } - - $this->optionsIds = isset($data['optionsIds']) ? $data['optionsIds'] : $this->optionsIds; - } - - /** - * Get options ids. - * - * @return array - */ - public function getOptionsIds() - { - return $this->optionsIds; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple.xml deleted file mode 100644 index bb4311e41f2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple.xml +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - simple - - simple - 4 - - product - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/AbstractRelatedProducts.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/AbstractRelatedProducts.php deleted file mode 100644 index ac96891a4e8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/AbstractRelatedProducts.php +++ /dev/null @@ -1,125 +0,0 @@ -params = $params; - - if (isset($data['presets'])) { - $presets = array_map('trim', explode(',', $data['presets'])); - foreach ($presets as $preset) { - list($fixtureCode, $dataset) = explode('::', $preset); - - /** @var InjectableFixture $product */ - $product = $fixtureFactory->createByCode($fixtureCode, ['dataset' => $dataset]); - if (!$product->hasData('id')) { - $product->persist(); - } - - $this->products[] = $product; - $this->data[] = [ - 'entity_id' => $product->getId(), - 'name' => $product->getName(), - 'sku' => $product->getSku(), - ]; - } - } - - if (isset($data['data'])) { - $this->data = array_replace_recursive($this->data, $data['data']); - } - } - - /** - * Persist related products. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set. - * - * @param string|null $key - * @return array - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings. - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Return related products. - * - * @return array - */ - public function getProducts() - { - return $this->products; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/AttributeSetId.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/AttributeSetId.php deleted file mode 100644 index dc5288a1365..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/AttributeSetId.php +++ /dev/null @@ -1,114 +0,0 @@ -params = $params; - if (isset($data['dataset']) && $data['dataset'] !== '-') { - $attributeSet = $fixtureFactory->createByCode('catalogAttributeSet', ['dataset' => $data['dataset']]); - if (!$attributeSet->hasData('attribute_set_id')) { - $attributeSet->persist(); - } - } - if (isset($data['attribute_set']) && $data['attribute_set'] instanceof CatalogAttributeSet) { - $attributeSet = $data['attribute_set']; - } - /** @var CatalogAttributeSet $attributeSet */ - if (!isset($data['dataset']) && !isset($data['attribute_set'])) { - $this->data = $data; - } else { - $this->data = $attributeSet->getAttributeSetName(); - $this->attributeSet = $attributeSet; - } - } - - /** - * Persist attribute options. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set. - * - * @param string|null $key - * @return mixed - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return Attribute Set fixture. - * - * @return CatalogAttributeSet - */ - public function getAttributeSet() - { - return $this->attributeSet; - } - - /** - * Return data set configuration settings. - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/Attributes.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/Attributes.php deleted file mode 100644 index e6befed0cfb..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/Attributes.php +++ /dev/null @@ -1,42 +0,0 @@ -params = $params; - if (isset($data['dataset'])) { - $this->data['dataset'] = $repositoryFactory->get($this->params['repository'])->get($data['dataset']); - } - if (isset($data['value'])) { - $this->data['value'] = $data['value']; - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/CategoryIds.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/CategoryIds.php deleted file mode 100644 index 4402371d95d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/CategoryIds.php +++ /dev/null @@ -1,113 +0,0 @@ -params = $params; - - if (!empty($data['category']) && empty($data['dataset'])) { - /** @var CatalogCategory $category */ - $category = $data['category']; - if (!$category->hasData('id')) { - $category->persist(); - } - $this->data[] = $category->getName(); - $this->categories[] = $category; - } elseif (isset($data['dataset'])) { - $dataset = explode(',', $data['dataset']); - foreach ($dataset as $preset) { - $category = $fixtureFactory->createByCode('catalogCategory', ['dataset' => $preset]); - $category->persist(); - - /** @var CatalogCategory $category */ - $this->data[] = $category->getName(); - $this->categories[] = $category; - } - } - - if (!empty($this->categories) && count($this->categories) == 1) { - $this->productCategory = $this->categories[0]; - } - } - - /** - * Return category array. - * - * @return array - */ - public function getCategories() - { - return $this->categories; - } - - /** - * Get product category. - * - * @return mixed - */ - public function getProductCategory() - { - return $this->productCategory; - } - - /** - * Get id of categories. - * - * @return array - */ - public function getIds() - { - $ids = []; - foreach ($this->categories as $category) { - $ids[] = $category->getId(); - } - - return $ids; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/CrossSellProducts.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/CrossSellProducts.php deleted file mode 100644 index 02930603c53..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/CrossSellProducts.php +++ /dev/null @@ -1,24 +0,0 @@ -params = $params; - if (isset($data['dataset']) && isset($this->params['repository'])) { - $this->data = $repositoryFactory->get($this->params['repository'])->get($data['dataset']); - $this->customOptions = $this->data; - unset($data['dataset']); - } - $this->data = array_merge_recursive($data, $this->data); - } - - /** - * Replace custom options data. - * - * @param array $data - * @param int $replace - * @return array - */ - protected function replaceData(array $data, $replace) - { - $result = []; - foreach ($data as $key => $value) { - if (is_array($value)) { - $value = $this->replaceData($value, $replace); - } - $result[$key] = str_replace('%isolation%', $replace, $value); - } - - return $result; - } - - - /** - * Return all custom options. - * - * @return array - */ - public function getCustomOptions() - { - return $this->customOptions; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/Fpt.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/Fpt.php deleted file mode 100644 index b42f45ec536..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/Fpt.php +++ /dev/null @@ -1,42 +0,0 @@ -params = $params; - if (isset($data['dataset']) && isset($this->params['repository'])) { - $this->data = $repositoryFactory->get($this->params['repository'])->get($data['dataset']); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/Price.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/Price.php deleted file mode 100644 index b74f6ecb863..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/Price.php +++ /dev/null @@ -1,67 +0,0 @@ -params = $params; - $this->data = (!isset($data['dataset']) && !isset($data['value'])) ? $data : null; - - if (isset($data['value'])) { - $this->data = $data['value']; - } - - if (isset($data['dataset']) && isset($this->params['repository'])) { - $this->priceData = $repositoryFactory->get($this->params['repository'])->get($data['dataset']); - } - } - - /** - * Get price data for different pages. - * - * @return array|null - */ - public function getPriceData() - { - return $this->priceData; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/RelatedProducts.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/RelatedProducts.php deleted file mode 100644 index 199e990af8a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/RelatedProducts.php +++ /dev/null @@ -1,24 +0,0 @@ -params = $params; - $this->configuration = $configuration; - if ((!isset($data['dataset']) && !isset($data['tax_product_class']))) { - $this->data = $data; - return; - } - - if (isset($data['dataset'])) { - $this->taxClass = $fixtureFactory->createByCode('taxClass', ['dataset' => $data['dataset']]); - $this->data = $this->taxClass->getClassName(); - if (!$this->taxClass->hasData('id')) { - $this->taxClass->persist(); - } - } - - if (isset($data['tax_product_class']) && $data['tax_product_class'] instanceof FixtureTaxClass) { - $this->taxClass = $data['tax_product_class']; - $this->data = $this->taxClass->getClassName(); - } - - if ($this->taxClass->hasData('id')) { - $this->taxClassId = $this->taxClass->getId(); - } else { - $this->setTaxClassId($this->data); - } - } - - /** - * Set tax class id. - * - * @param string $taxClassName - * @return void - * @throws \Exception - */ - protected function setTaxClassId($taxClassName) - { - $url = $_ENV['app_backend_url'] . 'tax/rule/new/'; - $curl = new BackendDecorator(new CurlTransport(), $this->configuration); - $curl->addOption(CURLOPT_HEADER, 1); - $curl->write($url); - $response = $curl->read(); - $curl->close(); - - preg_match('~~', $response, $matches); - if (!isset($matches[1]) || empty($matches[1])) { - throw new \Exception('Product tax class id ' . $taxClassName . ' undefined!'); - } - - $this->taxClassId = (int)$matches[1]; - } - - /** - * Persist custom selections tax classes. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set. - * - * @param string|null $key - * @return string - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings. - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Return tax class fixture. - * - * @return FixtureTaxClass - */ - public function getTaxClass() - { - return $this->taxClass; - } - - /** - * Return tax class id. - * - * @return int - */ - public function getTaxClassId() - { - return (int)$this->taxClassId; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/UpSellProducts.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/UpSellProducts.php deleted file mode 100644 index 9279be629f2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/UpSellProducts.php +++ /dev/null @@ -1,24 +0,0 @@ -params = $params; - if (isset($data['datasets'])) { - foreach ($data['datasets'] as $dataset) { - $website = $fixtureFactory->createByCode('website', ['dataset' => $dataset]); - /** @var Website $website */ - if (!$website->getWebsiteId()) { - $website->persist(); - } - $this->websites[] = $website; - $this->data[] = $website->getName(); - } - } - if (isset($data['websites'])) { - foreach ($data['websites'] as $website) { - if ($website instanceof Website && $website->hasData('website_id')) { - $this->websites[] = $website; - $this->data[] = $website->getName(); - } - } - } - } - - /** - * Persist attribute options. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set. - * - * @param string|null $key [optional] - * @return mixed - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings. - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Return Websites fixtures array. - * - * @return array - */ - public function getWebsites() - { - return $this->websites; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductVirtual.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductVirtual.xml deleted file mode 100644 index e4b6bd906b1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductVirtual.xml +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - virtual - - virtual - 4 - - product - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/ConfigurableProduct.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/ConfigurableProduct.xml deleted file mode 100644 index 860ce8992d0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/ConfigurableProduct.xml +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - configurable - - configurable - 4 - - product - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/ConfigurableProduct/Cart/Item.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/ConfigurableProduct/Cart/Item.php deleted file mode 100644 index a0507d27faf..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/ConfigurableProduct/Cart/Item.php +++ /dev/null @@ -1,66 +0,0 @@ -getCheckoutData(); - $cartItem = isset($checkoutData['cartItem']) ? $checkoutData['cartItem'] : []; - $attributesData = $product->getConfigurableOptions()['attributes_data']; - $checkoutConfigurableOptions = isset($checkoutData['options']['configurable_options']) - ? $checkoutData['options']['configurable_options'] - : []; - - foreach ($checkoutConfigurableOptions as $key => $checkoutConfigurableOption) { - $attribute = $checkoutConfigurableOption['title']; - $option = $checkoutConfigurableOption['value']; - - $checkoutConfigurableOptions[$key] = [ - 'title' => isset($attributesData[$attribute]['label']) - ? $attributesData[$attribute]['label'] - : $attribute, - 'value' => isset($attributesData[$attribute]['options'][$option]['label']) - ? $attributesData[$attribute]['options'][$option]['label'] - : $option, - ]; - } - $cartItem['options'] = isset($cartItem['options']) - ? $cartItem['options'] + $checkoutConfigurableOptions - : $checkoutConfigurableOptions; - $this->data = array_merge($this->data, $cartItem); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/ConfigurableProduct/ConfigurableOptions.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/ConfigurableProduct/ConfigurableOptions.php deleted file mode 100644 index f6fdd2291fb..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/ConfigurableProduct/ConfigurableOptions.php +++ /dev/null @@ -1,339 +0,0 @@ -fixtureFactory = $fixtureFactory; - $this->params = $params; - $dataset = []; - $isSetData = false; - if (isset($data['dataset']) && isset($this->params['repository'])) { - $dataset = $repositoryFactory->get($this->params['repository'])->get($data['dataset']); - unset($data['dataset']); - } - - if (isset($data['data'])) { - $this->setData($data['data']); - if (isset($data['data']['data'])) { - $data = $data['data']['data']; - $isSetData = true; - } - unset($data['data']); - } - $this->data = array_replace_recursive($data, $dataset); - if (!empty($this->data)) { - $this->prepareProducts($this->data); - if (!$isSetData) { - $this->prepareData(); - } - } - } - - /** - * Set data to source properties. - * - * @param array $data - * @return void - */ - protected function setData(array $data) - { - $this->products = isset($data['assigned_product']) ? $data['assigned_product'] : []; - $this->attributesData = isset($data['attributes_data']) - ? $data['attributes_data'] - : []; - } - /** - * Prepare products. - * - * @param array $data - * @return void - */ - protected function prepareProducts(array $data) - { - if (empty($this->products)) { - $attributeSetData = $this->prepareAttributesData($data); - foreach ($data['products'] as $key => $product) { - if (is_string($product)) { - list($fixture, $dataset) = explode('::', $product); - $attributeData = ['attributes' => $this->getProductAttributeData($key)]; - $product = $this->fixtureFactory->createByCode( - $fixture, - ['dataset' => $dataset, 'data' => array_merge($attributeSetData, $attributeData)] - ); - } - if (!$product->hasData('id') && $product->getData('isPersist') !== 'No') { - $product->persist(); - } - - $this->products[$key] = $product; - } - } - foreach ($this->products as $key => $product) { - $this->data['products'][$key] = $product->getSku(); - } - } - - /** - * Prepare attributes data. - * - * @param array $data - * @return array - */ - protected function prepareAttributesData(array $data) - { - $attributeSetData = []; - if (isset($data['attributeSet'])) { - if (!isset($this->attributesData['attributeSet'])) { - $this->attributesData['attributeSet'] = $this->createAttributeSet($data['attributeSet']); - } - if ($this->isSetAttributes()) { - $this->attributesData['attributes'] = $this->attributesData['attributeSet'] - ->getDataFieldConfig('assigned_attributes')['source']->getAttributes(); - } - $attributeSetData['attribute_set_id'] = ['attribute_set' => $this->attributesData['attributeSet']]; - } - - return $attributeSetData; - } - - /** - * Check attributes data in source. - * - * @return bool - */ - protected function isSetAttributes() - { - return $this->attributesData['attributeSet']->hasData('assigned_attributes') - && !isset($this->attributesData['attributes']); - } - - /** - * Create attribute set. - * - * @param array $attributeSet - * @return CatalogAttributeSet - */ - protected function createAttributeSet(array $attributeSet) - { - $attributeSet = $this->fixtureFactory->createByCode('catalogAttributeSet', $attributeSet); - $attributeSet->persist(); - - return $attributeSet; - } - - /** - * Get prepared attribute data for persist product. - * - * @param string $key - * @return array - */ - protected function getProductAttributeData($key) - { - $compositeKeys = explode(' ', $key); - $data = []; - - foreach ($compositeKeys as $compositeKey) { - $attributeId = $this->getAttributeOptionId($compositeKey); - if ($attributeId) { - $compositeKey = explode(':', $compositeKey); - $attributeKey = $this->getKey($compositeKey[0]); - $data[$this->attributesData['attributes'][$attributeKey]->getAttributeCode()] = $attributeId; - } - } - - return ['value' => $data]; - } - - /** - * Get id of attribute option by composite key. - * - * @param string $compositeKey - * @return int|null - */ - protected function getAttributeOptionId($compositeKey) - { - $compositeKey = explode(':', $compositeKey); - $attributeKey = $this->getKey($compositeKey[0]); - $optionKey = $this->getKey($compositeKey[1]); - - $attributeOptions = $this->attributesData['attributes'][$attributeKey]->getOptions(); - return isset($attributeOptions[$optionKey]['id']) - ? $attributeOptions[$optionKey]['id'] - : null; - } - - /** - * Prepare data from source. - * - * @return void - */ - protected function prepareData() - { - $attributeFields = [ - 'frontend_label', - 'label', - 'frontend_input', - 'attribute_code', - 'attribute_id', - 'is_required', - 'options', - ]; - $optionFields = [ - 'admin', - 'label', - 'price', - 'price_type', - 'include', - ]; - $resultData = [ - 'attributes_data', - 'products' - ]; - - foreach ($this->attributesData['attributes'] as $attributeIndex => $attribute) { - $attribute = $attribute->getData(); - $attributeKey = 'attribute_key_' . $attributeIndex; - $options = []; - foreach ($attribute['options'] as $optionIndex => $option) { - $option['label'] = isset($option['view']) ? $option['view'] : $option['label']; - $optionKey = 'option_key_' . $optionIndex; - if (isset($this->data['attributes_data'][$attributeKey]['options'][$optionKey])) { - $options[$optionKey] = array_intersect_key($option, array_flip($optionFields)); - } - } - $attribute['options'] = $options; - $attribute['label'] = isset($attribute['label']) - ? $attribute['label'] - : (isset($attribute['frontend_label']) ? $attribute['frontend_label'] : null); - $attribute = array_intersect_key($attribute, array_flip($attributeFields)); - - $this->data['attributes_data'][$attributeKey] = array_merge_recursive( - $this->data['attributes_data'][$attributeKey], - $attribute - ); - } - - $this->data = array_intersect_key($this->data, array_flip($resultData)); - } - - /** - * Get prepared products. - * - * @return array - */ - public function getProducts() - { - return $this->products; - } - - /** - * Get data by key. - * - * @param null $key - * @return array - */ - public function getData($key = null) - { - if ($key === null) { - return $this->data; - } else { - return $this->data[$key]; - } - } - - /** - * Get attribute set. - * - * @return CatalogAttributeSet - */ - public function getAttributeSet() - { - return $this->attributesData['attributeSet']; - } - - /** - * Prepare key for array. - * - * @param string $key - * @return int - */ - protected function getKey($key) - { - return str_replace(['attribute_key_', 'option_key_'], '', $key); - } - - /** - * Get attribute set. - * - * @return array - */ - public function getAttributesData() - { - return $this->attributesData['attributes']; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/GroupedProduct.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/GroupedProduct.xml deleted file mode 100644 index 177c18ef3fd..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/GroupedProduct.xml +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - grouped - - grouped - 4 - - product - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/GroupedProduct/Associated.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/GroupedProduct/Associated.php deleted file mode 100644 index 050fd7fe946..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/GroupedProduct/Associated.php +++ /dev/null @@ -1,90 +0,0 @@ -objectManager = $objectManager; - $this->params = $params; - $associatedData = isset($data['dataset']) - ? $repositoryFactory->get($this->params['repository'])->get($data['dataset']) - : $data; - if ($associatedData) { - $this->products = $this->createProducts($associatedData['products'])['products']; - foreach ($this->products as $key => $product) { - $this->data[] = - [ - 'id' => $product->getId(), - 'name' => $product->getName(), - 'qty' => $associatedData['assigned_products'][$key]['qty'], - 'position' => $key + 1 - ]; - } - } - } - - /** - * Create products. - * - * @param string $products - * @return array - */ - protected function createProducts($products) - { - return $this->objectManager->create('Mage\Catalog\Test\TestStep\CreateProductsStep', ['products' => $products]) - ->run(); - } - - /** - * Return products' fixtures. - * - * @return array - */ - public function getProducts() - { - return $this->products; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/GroupedProduct/Cart/Item.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/GroupedProduct/Cart/Item.php deleted file mode 100644 index dd05d2cdd1b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/GroupedProduct/Cart/Item.php +++ /dev/null @@ -1,97 +0,0 @@ -getCheckoutData(); - $this->data = isset($checkoutData['cartItem']) ? $checkoutData['cartItem'] : []; - $products = $product->getDataFieldConfig('associated')['source']->getProducts(); - $cartItem = []; - $associatedProducts = []; - - foreach ($products as $key => $product) { - $key = 'product_key_' . $key; - $associatedProducts[$key] = $product; - } - - // Replace key in checkout data - foreach ($this->data as $fieldName => $fieldValues) { - foreach ($fieldValues as $key => $value) { - $cartItem[$fieldName][$associatedProducts[$key]->getSku()] = $value; - } - } - - // Add empty "options" field - foreach ($associatedProducts as $product) { - $cartItem['options'][] = [ - 'title' => $product->getName(), - 'value' => $cartItem['qty'][$product->getSku()], - ]; - } - - $this->data = $cartItem; - } - - /** - * Persist fixture. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set. - * - * @param string $key [optional] - * @return mixed - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings. - * - * @return string - */ - public function getDataConfig() - { - // - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Handler/CatalogAttributeSet/CatalogAttributeSetInterface.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Handler/CatalogAttributeSet/CatalogAttributeSetInterface.php deleted file mode 100644 index 1f219cf8eaf..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Handler/CatalogAttributeSet/CatalogAttributeSetInterface.php +++ /dev/null @@ -1,26 +0,0 @@ -hasData('attribute_set_id') - ? $this->getDefaultAttributeSet($fixture) - : $this->createAttributeSet($fixture); - - $attributeSetId = $fixture->hasData('attribute_set_id') - ? $fixture->getAttributeSetId() - : $this->getData($this->attributeSetId, $response); - - $assignedAttributes = $fixture->hasData('assigned_attributes') - ? $fixture->getDataFieldConfig('assigned_attributes')['source']->getAttributes() - : []; - $dataAttribute = $this->getDataAttributes($response); - - $lastAttribute = array_pop($dataAttribute['attributes']); - - foreach ($assignedAttributes as $key => $assignedAttribute) { - $dataAttribute['attributes'][] = [ - $assignedAttribute->getAttributeId(), - $dataAttribute['groups'][0][0], - ($lastAttribute[2] + ($key + 1)), - null, - ]; - } - - $this->updateAttributeSet($attributeSetId, $dataAttribute); - - return ['attribute_set_id' => $attributeSetId]; - } - - /** - * Create Attribute Set. - * - * @param CatalogAttributeSet $fixture - * @return string - */ - protected function createAttributeSet(CatalogAttributeSet $fixture) - { - $data = $fixture->getData(); - if (!isset($data['gotoEdit'])) { - $data['gotoEdit'] = 1; - } - - $data['skeleton_set'] = $fixture->getDataFieldConfig('skeleton_set')['source']->getAttributeSet() - ->getAttributeSetId(); - - $url = $_ENV['app_backend_url'] . 'catalog_product_set/save/'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->addOption(CURLOPT_HEADER, 1); - $curl->write($url, $data); - $response = $curl->read(); - $curl->close(); - - return $response; - } - - /** - * Get Default Attribute Set page with curl. - * - * @param CatalogAttributeSet $fixture - * @return string - */ - protected function getDefaultAttributeSet(CatalogAttributeSet $fixture) - { - $url = $_ENV['app_backend_url'] . 'catalog_product_set/edit/id/' . $fixture->getAttributeSetId() . '/'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->write($url); - $response = $curl->read(); - $curl->close(); - - return $response; - } - - /** - * Update Attribute Set. - * - * @param int $attributeSetId - * @param array $dataAttribute - * @return void - */ - protected function updateAttributeSet($attributeSetId, array $dataAttribute) - { - $data = ['data' => json_encode($dataAttribute)]; - $url = $_ENV['app_backend_url'] . 'catalog_product_set/save/id/' . $attributeSetId . '/'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->write($url, $data); - $curl->read(); - $curl->close(); - } - - /** - * Get data attributes for curl. - * - * @param string $response - * @return array - */ - protected function getDataAttributes($response) - { - $attributes = $this->getData($this->attributes, $response, true); - $dataAttribute = []; - - $index = 1; - foreach ($attributes as $key => $parentAttributes) { - $dataAttribute['groups'][$key][] = $parentAttributes['id']; - $dataAttribute['groups'][$key][] = $parentAttributes['text']; - $dataAttribute['groups'][$key][] = $key + 1; - - if (isset($parentAttributes['children'])) { - foreach ($parentAttributes['children'] as $attribute) { - $dataAttribute['attributes'][$index][] = $attribute['id']; - $dataAttribute['attributes'][$index][] = $parentAttributes['id']; - $dataAttribute['attributes'][$index][] = $index; - $dataAttribute['attributes'][$index][] = $attribute['entity_id']; - $index++; - } - } - } - $dataAttribute['not_attributes'] = []; - $dataAttribute['removeGroups'] = []; - $dataAttribute['attribute_set_name'] = $this->getData($this->attributeSetName, $response); - - return $dataAttribute; - } - - /** - * Select data from response by regular expression. - * - * @param string $regularExpression - * @param string $response - * @param bool $isJson [optional] - * @return mixed - * @throws \Exception - */ - protected function getData($regularExpression, $response, $isJson = false) - { - preg_match($regularExpression, $response, $matches); - if (!isset($matches[1])) { - throw new \Exception("Can't find data in response by regular expression \"{$regularExpression}\"."); - } - - return $isJson ? json_decode($matches[1], true) : $matches[1]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Handler/CatalogCategory/CatalogCategoryInterface.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Handler/CatalogCategory/CatalogCategoryInterface.php deleted file mode 100644 index fba80d37a47..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Handler/CatalogCategory/CatalogCategoryInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - [ - 'Yes' => 1, - 'No' => 0, - ], - 'is_anchor' => [ - 'Yes' => 1, - 'No' => 0, - ], - 'include_in_menu' => [ - 'Yes' => 1, - 'No' => 0, - ], - 'display_mode' => [ - 'Static block and products' => 'PRODUCTS_AND_PAGE', - 'Static block only' => 'PAGE', - 'Products only' => 'PRODUCTS', - ], - ]; - - /** - * Post request for creating Subcategory. - * - * @param FixtureInterface|null $fixture [optional] - * @return array - */ - public function persist(FixtureInterface $fixture = null) - { - $data['general'] = $this->replaceMappingData($fixture->getData()); - if ($fixture->hasData('landing_page')) { - $data['general']['landing_page'] = $this->getBlockId($fixture->getLandingPage()); - } - if ($fixture->hasData('category_products')) { - $data['category_products'] = $this->prepareCategoryProducts($fixture); - } - - $diff = array_diff($this->dataUseConfig, array_keys($data['general'])); - if (!empty($diff)) { - $data['use_config'] = $diff; - } - $parentCategoryId = $data['general']['parent_id']; - $url = $_ENV['app_backend_url'] . 'catalog_category/save/store/0/parent/' . $parentCategoryId . '/?isAjax=true'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->write($url, $data); - $response = $curl->read(); - $curl->close(); - - preg_match('~http://.+/id/(\d+).+?isAjax~', $response, $matches); - $id = isset($matches[1]) ? (int)$matches[1] : null; - - return ['id' => $id]; - } - - /** - * Prepare assigned products for category. - * - * @param CatalogCategory $category - * @return string - */ - protected function prepareCategoryProducts(CatalogCategory $category) - { - $products = $category->getDataFieldConfig('category_products')['source']->getProducts(); - $productIds = []; - foreach ($products as $product) { - $productIds[] = $product->getId(); - } - - return implode('=&', $productIds); - } - - /** - * Getting block id by name - * - * @param string $landingName - * @return int|null - */ - protected function getBlockId($landingName) - { - $url = $_ENV['app_backend_url'] . 'catalog_category'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->write($url, [], CurlInterface::POST); - $response = $curl->read(); - $curl->close(); - preg_match('~' . preg_quote($landingName, '~') . '~', $response, $matches); - $id = isset($matches[1]) ? (int)$matches[1] : null; - - return $id; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Handler/CatalogProductAttribute/CatalogProductAttributeInterface.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Handler/CatalogProductAttribute/CatalogProductAttributeInterface.php deleted file mode 100644 index 9f9b37d9cd0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Handler/CatalogProductAttribute/CatalogProductAttributeInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - [ - 'Text Field' => 'text', - 'Text Area' => 'textarea', - 'Date' => 'date', - 'Yes/No' => 'boolean', - 'Select/Multiple Select' => 'multiselect', - 'Select/Dropdown' => 'select', - 'Price' => 'price', - 'Media Image' => 'media_image', - 'Fixed Product Tax' => 'weee', - ], - 'is_required' => [ - 'Yes' => 1, - 'No' => 0, - ], - 'is_configurable' => [ - 'Yes' => 1, - 'No' => 0, - ], - 'is_filterable' => [ - 'Filterable (with results)' => 1 - ] - ]; - - /** - * Post request for creating Product Attribute. - * - * @param FixtureInterface|null $fixture - * @return array - * @throws \Exception - */ - public function persist(FixtureInterface $fixture = null) - { - $data = $this->replaceMappingData($fixture->getData()); - $data['frontend_label'] = [0 => $data['frontend_label']]; - - if (isset($data['options'])) { - foreach ($data['options'] as $key => $values) { - if ($values['is_default'] == 'Yes') { - $data['default'][] = $values['view']; - } - $index = 'option_' . $key; - $data['option']['value'][$index] = [$values['admin'], $values['view']]; - $data['option']['order'][$index] = $key; - } - unset($data['options']); - } - - $url = $_ENV['app_backend_url'] . 'catalog_product_attribute/save/back/edit'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->write($url, $data); - $response = $curl->read(); - $curl->close(); - - if (!strpos($response, 'class="success-msg"')) { - throw new \Exception("Product Attribute creating by curl handler was not successful! \n" . $response); - } - - $resultData = []; - $matches = []; - preg_match('#attribute_id[^>]+value="(\d+)"#', $response, $matches); - $resultData['attribute_id'] = $matches[1]; - - $matches = []; - preg_match_all('#"id":"(\d+)"#Umi', $response, $matches); - krsort($matches[1]); - $optionsIds = array_values($matches[1]); - - if ($fixture->hasData('options')) { - $optionsData = $fixture->getData()['options']; - foreach ($optionsIds as $key => $optionId) { - $optionsData[$key]['id'] = $optionId; - } - $resultData['options'] = $optionsData; - } - - return $resultData; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Handler/CatalogProductSimple/CatalogProductSimpleInterface.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Handler/CatalogProductSimple/CatalogProductSimpleInterface.php deleted file mode 100644 index 0e3f1b0a9af..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Handler/CatalogProductSimple/CatalogProductSimpleInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - [ - 'Yes' => 1, - 'No' => 0 - ], - 'use_config_notify_stock_qty' => [ - 'Yes' => 1, - 'No' => 0 - ], - 'is_shareable' => [ - 'Yes' => 1, - 'No' => 0, - 'Use config' => 2 - ], - 'required' => [ - 'Yes' => 1, - 'No' => 0 - ], - 'use_config_manage_stock' => [ - 'Yes' => 1, - 'No' => 0 - ], - 'is_virtual' => [ - 'Yes' => 1 - ], - 'use_config_enable_qty_increments' => [ - 'Yes' => 1, - 'No' => 0 - ], - 'use_config_qty_increments' => [ - 'Yes' => 1, - 'No' => 0 - ], - 'is_in_stock' => [ - 'In Stock' => 1, - 'Out of Stock' => 0 - ], - 'visibility' => [ - 'Not Visible Individually' => 1, - 'Catalog' => 2, - 'Search' => 3, - 'Catalog, Search' => 4 - ], - 'website_ids' => [ - 'Main Website' => 1 - ], - 'status' => [ - 'Disabled' => 2, - 'Enabled' => 1 - ], - 'is_require' => [ - 'Yes' => 1, - 'No' => 0 - ], - 'is_recurring' => [ - 'Yes' => 1, - 'No' => 0 - ], - 'msrp_display_actual_price_type' => [ - 'Use config' => 4, - 'On Gesture' => 1, - 'In Cart' => 2, - 'Before Order Confirmation' => 3 - ], - 'enable_qty_increments' => [ - 'Yes' => 1, - 'No' => 0, - ], - 'msrp_enabled' => [ - 'Yes' => 1, - 'No' => 0, - ], - 'is_anchor' => [ - 'Yes' => 1, - 'No' => 0, - ], - ]; - - /** - * Placeholder for price data sent Curl. - * - * @var array - */ - protected $priceData = [ - 'customer_group' => [ - 'name' => 'cust_group', - 'data' => [ - 'ALL GROUPS' => 32000, - 'NOT LOGGED IN' => 0, - 'General' => 1 - ] - ] - ]; - - /** - * Placeholder for fpt data sent Curl - * - * @var array - */ - protected $fptData = [ - 'website' => [ - 'name' => 'website_id', - 'data' => [ - 'All Websites [USD]' => 0 - ] - ], - 'country_name' => [ - 'name' => 'country', - 'data' => [ - 'United States' => 'US' - ] - ], - 'state_name' => [ - 'name' => 'state', - 'data' => [ - 'California' => 12, - '*' => 0 - ] - ] - ]; - - /** - * Select custom options. - * - * @var array - */ - protected $selectOptions = ['Drop-down', 'Radio Buttons', 'Checkbox', 'Multiple Select']; - - /** - * Post request for creating simple product. - * - * @param FixtureInterface|null $fixture [optional] - * @return array - * - * @SuppressWarnings(PHPMD.NPathComplexity) - * @SuppressWarnings(PHPMD.CyclomaticComplexity) - */ - public function persist(FixtureInterface $fixture = null) - { - /** @var InjectableFixture $fixture */ - $config = $this->prepareConfig($fixture); - $prefix = isset($config['input_prefix']) ? $config['input_prefix'] : null; - $data = $this->prepareData($fixture, $prefix); - return $this->createProduct($data, $config); - } - - /** - * Prepare config data. - * - * @param InjectableFixture $product - * @return array - */ - protected function prepareConfig(InjectableFixture $product) - { - $config = $product->getDataConfig(); - if ($product->hasData('attribute_set_id')) { - $config['create_url_params']['set'] = $product->getDataFieldConfig('attribute_set_id')['source'] - ->getAttributeSet() - ->getAttributeSetId(); - } - - return $config; - } - - /** - * Prepare POST data for creating product request. - * - * @param FixtureInterface $fixture - * @param string|null $prefix [optional] - * @return array - * - * @SuppressWarnings(PHPMD.NPathComplexity) - * @SuppressWarnings(PHPMD.CyclomaticComplexity) - */ - protected function prepareData(FixtureInterface $fixture, $prefix = null) - { - $fields = $this->replaceMappingData($fixture->getData()); - - // Getting Tax class id - if ($fixture->hasData('tax_class_id')) { - $fields['tax_class_id'] = $fixture->getDataFieldConfig('tax_class_id')['source']->getTaxClassId(); - } - - if (isset($fields['tier_price'])) { - $fields['tier_price'] = $this->preparePriceData($fields['tier_price']); - } - if (isset($fields['group_price'])) { - $fields['group_price'] = $this->preparePriceData($fields['group_price']); - } - if (isset($fields['fpt'])) { - $attributeLabel = $fixture->getDataFieldConfig('attribute_set_id')['source'] - ->getAttributeSet()->getDataFieldConfig('assigned_attributes')['source'] - ->getAttributes()[0]->getFrontendLabel(); - $fields[$attributeLabel] = $this->prepareFptData($fields['fpt']); - } - if ($isCustomOptions = isset($fields['custom_options'])) { - $fields = $this->prepareCustomOptionsData($fields); - } - - if (!empty($fields['website_ids'])) { - $result = []; - foreach ($fields['website_ids'] as $key => $value) { - $result[] = isset($this->mappingData['website_ids'][$value]) - ? $this->mappingData['website_ids'][$value] - : $fixture->getDataFieldConfig('website_ids')['source']->getWebsites()[$key]->getWebsiteId(); - } - $fields['website_ids'] = $result; - } - - if (isset($fields['attribute_set_id'])) { - unset($fields['attribute_set_id']); - } - - // Prepare assigned attribute - if (isset($fields['attributes'])) { - $fields = $this->prepareAttributes($fields, $fixture); - } - - if (!empty($fields['category_ids'])) { - $this->withCategory = true; - unset($fields['category_ids']); - } - - $fields = $this->prepareStockData($fields); - $fields = $prefix ? [$prefix => $fields] : $fields; - - if ($this->withCategory) { - foreach ($fixture->getDataFieldConfig('category_ids')['source']->getCategories() as $category) { - $fields['category_ids'][] = $category->getId(); - } - } - - if ($isCustomOptions) { - $fields['affect_product_custom_options'] = 1; - } - - if (isset($fields['product']['weight'])) { - unset($fields['product']['is_virtual']); - } - - return $fields; - } - - /** - * Prepare attributes data. - * - * @param array $data - * @param FixtureInterface $fixture - * @return array - */ - protected function prepareAttributes(array $data, FixtureInterface $fixture) - { - $result = isset($data['attributes']['value']) ? $data['attributes']['value'] : []; - if (isset($data['attributes']['preset'])) { - $attributes = $fixture->getDataFieldConfig('attribute_set_id')['source'] - ->getAttributeSet()->getDataFieldConfig('assigned_attributes')['source'] - ->getAttributes(); - foreach ($data['attributes']['preset'] as $key => $attribute) { - $attributeKey = str_replace('attribute_key_', '', $key); - $options = $attributes[$attributeKey]->getOptions(); - if ($options !== null) { - foreach ($attribute as $optionKey) { - $optionKey = str_replace('option_key_', '', $optionKey); - $option = $options[$optionKey]; - $optionsIds = $attributes[$attributeKey]->getDataFieldConfig('options' )['source'] - ->getOptionsIds(); - if (empty($optionsIds)) { - $optionsData = $attributes[$attributeKey]->getOptions(); - $optionsIds = $this->prepareOptionsIds($optionsData); - } - $result[$attributes[$attributeKey]->getAttributeCode()] = $optionsIds[$option['admin']]; - } - } - } - } - unset($data['attributes']); - - return array_merge($data, $result); - } - - /** - * Prepare options ids. - * - * @param array $options - * @return array - */ - protected function prepareOptionsIds(array $options) - { - $result = []; - foreach ($options as $option) { - $result[$option['admin']] = $option['id']; - } - return $result; - } - - /** - * Preparation of stock data. - * - * @param array $fields - * @return array - */ - protected function prepareStockData(array $fields) - { - if (!isset($fields['stock_data']['manage_stock'])) { - $fields['stock_data']['manage_stock'] = (int)(!empty($fields['stock_data']['qty']) - || !empty($fields['stock_data']['is_in_stock'])); - } - - return $this->filter($fields); - } - - /** - * Preparation of custom options data. - * - * @param array $fields - * @return array - */ - protected function prepareCustomOptionsData(array $fields) - { - $options = []; - foreach ($fields['custom_options'] as $key => $customOption) { - $options[$key] = ['option_id' => 0, 'is_delete' => '']; - foreach ($customOption['options'] as $index => $option) { - $customOption['options'][$index]['is_delete'] = ''; - $customOption['options'][$index]['price_type'] = strtolower($option['price_type']); - } - $customOption['type'] = explode('/', $customOption['type'])[1]; - $options[$key] += in_array($customOption['type'], $this->selectOptions) - ? ['values' => $customOption['options']] - : $customOption['options'][0]; - unset($customOption['options']); - $options[$key] += $customOption; - $options[$key]['type'] = $this->optionNameConvert($customOption['type']); - } - $fields['options'] = $options; - unset($fields['custom_options']); - - return $fields; - } - - /** - * Convert option name. - * - * @param string $optionName - * @return string - */ - protected function optionNameConvert($optionName) - { - $optionName = str_replace(['-', ' & '], "_", trim($optionName)); - $end = strpos($optionName, ' '); - if ($end !== false) { - $optionName = substr($optionName, 0, $end); - } - return strtolower($optionName); - } - - /** - * Preparation of tier price data. - * - * @param array $fields - * @return array - * - * @SuppressWarnings(PHPMD.CyclomaticComplexity) - * @SuppressWarnings(PHPMD.NPathComplexity) - */ - protected function preparePriceData(array $fields) - { - foreach ($fields as &$field) { - foreach ($this->priceData as $key => $data) { - $field[$data['name']] = $this->priceData[$key]['data'][$field[$key]]; - unset($field[$key]); - } - $field['delete'] = ''; - } - return $fields; - } - - /** - * Preparation of fpt data. - * - * @param array $fields - * @return array - */ - protected function prepareFptData(array $fields) - { - foreach ($fields as &$field) { - foreach ($this->fptData as $key => $data) { - $field[$data['name']] = $this->fptData[$key]['data'][$field[$key]]; - unset($field[$key]); - } - $field['delete'] = ''; - } - return $fields; - } - - /** - * Remove items from a null. - * - * @param array $data - * @return array - */ - protected function filter(array $data) - { - foreach ($data as $key => $value) { - if ($value === null) { - unset($data[$key]); - } elseif (is_array($data[$key])) { - $data[$key] = $this->filter($data[$key]); - } - } - return $data; - } - - /** - * Create product via curl. - * - * @param array $data - * @param array $config - * @return array - * @throws \Exception - */ - protected function createProduct(array $data, array $config) - { - $url = $this->getUrl($config); - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->addOption(CURLOPT_HEADER, 1); - $curl->write($url, $data); - $response = $curl->read(); - $curl->close(); - - if (!strpos($response, 'class="success-msg"')) { - throw new \Exception("Product creation by curl handler was not successful! Response: $response"); - } - - return $this->parseResponse($response); - } - - /** - * Parse data in response. - * - * @param string $response - * @return array - */ - protected function parseResponse($response) - { - preg_match('~a href=[^\s]*\/id\/(\d+)~', $response, $matches); - $id = isset($matches[1]) ? $matches[1] : null; - return ['id' => $id]; - } - - /** - * Retrieve URL for request with all necessary parameters. - * - * @param array $config - * @param string $type [optional] - * @return string - */ - protected function getUrl(array $config, $type = 'save') - { - $requestParams = isset($config['create_url_params']) ? $config['create_url_params'] : []; - $params = ''; - foreach ($requestParams as $key => $value) { - $params .= $key . '/' . $value . '/'; - } - - return $_ENV['app_backend_url'] . "catalog_product/$type/{$params}back/edit"; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Handler/CatalogProductVirtual/CatalogProductVirtualInterface.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Handler/CatalogProductVirtual/CatalogProductVirtualInterface.php deleted file mode 100644 index c9e7917410a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Handler/CatalogProductVirtual/CatalogProductVirtualInterface.php +++ /dev/null @@ -1,26 +0,0 @@ -fixtureFactory = $fixtureFactory; - $this->mappingData += [ - 'include' => [ - 'Yes' => 1, - 'No' => 0, - ] - ]; - } - - /** - * Prepare POST data for creating product request. - * - * @param FixtureInterface $product - * @param string|null $prefix [optional] - * @return array - */ - protected function prepareData(FixtureInterface $product, $prefix = null) - { - /** @var ConfigurableProduct $product */ - $valuesIndexes = $this->getIndexValues($product); - $data = parent::prepareData($product, $prefix); - $data['configurable_products_data'] = $this->prepareConfigurableProductData($product, $valuesIndexes); - $data['configurable_attributes_data'] = $this->prepareConfigurableAttributeData($product, $valuesIndexes); - $data['affect_configurable_product_attributes'] = 1; - - return $this->replaceMappingData($data); - } - - /** - * Get configurable product data for curl. - * - * @param ConfigurableProduct $product - * @param array $valuesIndexes - * @return string - */ - protected function prepareConfigurableAttributeData(ConfigurableProduct $product, array $valuesIndexes) - { - $result = []; - $configurableOptions = $product->getConfigurableOptions(); - - foreach ($configurableOptions['attributes_data'] as $attributeKey => $attribute) { - $key = str_replace('attribute_key_', '', $attributeKey); - $result[$key] = [ - 'label' => $attribute['label'], - 'attribute_id' => $attribute['attribute_id'], - 'attribute_code' => $attribute['attribute_code'], - 'frontend_label' => $attribute['frontend_label'], - 'store_label' => $attribute['frontend_label'], - ]; - foreach ($attribute['options'] as $optionKey => $option) { - $result[$key]['values'][] = [ - 'label' => $option['label'], - 'value_index' => $valuesIndexes[$attributeKey . ':' . $optionKey], - 'pricing_value' => $option['price'], - 'is_percent' => ($option['price_type'] == 'Percentage') ? 1 : 0 - ]; - } - } - - return json_encode($result, true); - } - - /** - * Get params of configurable items attributes. - * - * @param ConfigurableProduct $product - * @return array - */ - protected function getIndexValues(ConfigurableProduct $product) - { - $config = $this->prepareConfigDataForNew($product); - $url = $this->getUrl($config, 'new'); - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->write($url, [], CurlInterface::GET); - $response = $curl->read(); - $curl->close(); - - preg_match_all('/class="value-json" value="(.*)"/', $response, $tempResult); - $valueIndexes = []; - krsort($tempResult[1]); - $optionIndex = 0; - foreach ($tempResult[1] as $value) { - $arrayResult = json_decode(str_replace('"', '"', $value), true); - foreach ($arrayResult as $key => $item) { - $valueIndexes['attribute_key_' . $key . ':' . 'option_key_' . $optionIndex] = $item['value_index']; - } - $optionIndex++; - } - - return $valueIndexes; - } - - /** - * Prepare config data. - * - * @param InjectableFixture $product - * @return array - */ - protected function prepareConfig(InjectableFixture $product) - { - $config = parent::prepareConfig($product); - $config['create_url_params']['set'] = $product->getDataFieldConfig('configurable_options')['source'] - ->getAttributeSet() - ->getAttributeSetId(); - - return $config; - } - - /** - * Prepare config data for product. - * - * @param ConfigurableProduct $product - * @return array - */ - protected function prepareConfigDataForNew(ConfigurableProduct $product) - { - $attributeSet = $product->getDataFieldConfig('configurable_options')['source']->getAttributeSet(); - $attributes = $attributeSet->getDataFieldConfig('assigned_attributes')['source']->getAttributes(); - $attributesIds = $this->getAttributesIds($attributes); - - $customUrlParam['create_url_params'] = [ - 'attributes' => $this->codeAttribute($attributesIds), - 'set' => $attributeSet->getAttributeSetId() - ]; - - return array_replace_recursive($product->getDataConfig(), $customUrlParam); - } - - /** - * Prepare attributes ids. - * - * @param array $attributes - * @return string - */ - protected function getAttributesIds(array $attributes) - { - $attributesIds = ""; - foreach ($attributes as $attribute) { - $attributesIds .= $attribute->getAttributeId() . ","; - } - return substr($attributesIds, 0, strlen($attributesIds) - 1); - } - - /** - * Prepare configurable attribute data to GET request. - * - * @param string $attributes - * @return string - */ - protected function codeAttribute($attributes) - { - $res = base64_encode($attributes); - $res = str_replace('/', '%2F', $res); - $res = str_replace('=', '%3D', $res); - - return $res; - } - - /** - * Prepare configurable product data. - * - * @param ConfigurableProduct $product - * @param array $valuesIndexes - * @return string - */ - protected function prepareConfigurableProductData(ConfigurableProduct $product, array $valuesIndexes) - { - $result = []; - $configurableOptions = $product->getConfigurableOptions(); - $configurableOptionsSource = $product->getDataFieldConfig('configurable_options')['source']; - $associatedProducts = $this->splitProducts($configurableOptionsSource->getProducts()); - - foreach ($configurableOptions['attributes_data'] as $attributeKey => $attribute) { - foreach ($attribute['options'] as $optionKey => $option) { - $productId = $associatedProducts[$attributeKey . ':' . $optionKey]->getId(); - $result[$productId][] = [ - 'label' => $option['label'], - 'attribute_id' => $attribute['attribute_id'], - 'value_index' => $valuesIndexes[$attributeKey . ':' . $optionKey], - 'is_percent' => ($option['price_type'] == 'Percentage') ? 1 : 0, - 'pricing_value' => $option['price'] - ]; - } - } - - return json_encode($result, true); - } - - /** - * Split products. - * - * @param array $products - * @return array - */ - protected function splitProducts(array $products) - { - $result = []; - foreach ($products as $key => $product) { - $indexes = explode(' ', $key); - foreach ($indexes as $index) { - $result[$index] = $product; - } - } - - return $result; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Handler/GroupedProduct/Curl.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Handler/GroupedProduct/Curl.php deleted file mode 100644 index 091f35673d0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Handler/GroupedProduct/Curl.php +++ /dev/null @@ -1,52 +0,0 @@ - $data] : $data; - $links = ''; - $fKey = md5('associated'); - foreach ($assignedProducts as $key => $item) { - $links .= $item['id']. '=' . $fKey . '&'; - } - $data['links']['grouped'] = $links; - return $data; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Handler/GroupedProduct/GroupedProductInterface.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Handler/GroupedProduct/GroupedProductInterface.php deleted file mode 100644 index 8823902b842..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Handler/GroupedProduct/GroupedProductInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProduct.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProduct.xml deleted file mode 100644 index c7127b6d0ba..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProduct.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductAttributeEdit.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductAttributeEdit.xml deleted file mode 100644 index 498c050b485..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductAttributeEdit.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductAttributeIndex.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductAttributeIndex.xml deleted file mode 100644 index d1f0cf91327..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductAttributeIndex.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductAttributeNew.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductAttributeNew.xml deleted file mode 100644 index 1f2f0dcb7a2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductAttributeNew.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductEdit.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductEdit.xml deleted file mode 100644 index 94d5834834c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductEdit.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductNew.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductNew.xml deleted file mode 100644 index 50b1cfee468..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductNew.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductSetAdd.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductSetAdd.xml deleted file mode 100644 index b347c4f48bc..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductSetAdd.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductSetEdit.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductSetEdit.xml deleted file mode 100644 index 00182f834c6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductSetEdit.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductSetIndex.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductSetIndex.xml deleted file mode 100644 index ece55c26d57..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductSetIndex.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Category/CatalogCategoryView.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Category/CatalogCategoryView.xml deleted file mode 100644 index 61f1290674a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Category/CatalogCategoryView.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Product/CatalogProductCompare.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Product/CatalogProductCompare.xml deleted file mode 100644 index 6e5fcc23724..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Product/CatalogProductCompare.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Product/CatalogProductView.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Product/CatalogProductView.xml deleted file mode 100644 index 41aa8f284e1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Product/CatalogProductView.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogAttributeSet.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogAttributeSet.xml deleted file mode 100644 index a54a2efbca2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogAttributeSet.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - Default - 4 - - - - Custom_attribute_set%isolation% - - default - - - attribute_type_dropdown,attribute_type_dropdown - - - - - Custom_attribute_set%isolation% - - default - - - - - Filterable_attribute_set%isolation% - - default - - - filterable_attribute,filterable_attribute - - - - - Custom_attribute_set%isolation% - - default - - - attribute_type_fpt - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogCategory.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogCategory.xml deleted file mode 100644 index 970183f8596..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogCategory.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - Category%isolation% - Default Category - category%isolation% - Yes - Yes - 2 - - - - Default Category - 1 - Yes - 2 - - - - DefaultSubcategory%isolation% - default-subcategory-%isolation% - - default_category - - Yes - Yes - - - - RootCategory%isolation% - root-category-%isolation% - 1 - Yes - Yes - - - - AnchorSubcategory%isolation% - anchor-subcategory-%isolation% - - default_category - - Yes - Yes - Yes - - - - DefaultSubcategory%isolation% - default-subcategory-%isolation% - - default_category - - Yes - Yes - - catalogProductSimple::default,catalogProductSimple::default,catalogProductSimple::default - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductAttribute.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductAttribute.xml deleted file mode 100644 index 0f5a9e7cd39..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductAttribute.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - attribute_label%isolation% - attribute_label%isolation% - Text Field - No - - - - attribute_dropdown%isolation% - attribute_dropdown%isolation% - Select/Dropdown - Yes - - with_three_options - - - - - filterable_attribute%isolation% - filterable_attribute%isolation% - Select/Dropdown - Yes - Filterable (with results) - - with_three_options - - - - - fpt_%isolation% - fpt_%isolation% - Fixed Product Tax - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductAttribute/Options.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductAttribute/Options.xml deleted file mode 100644 index e2b20ebeb2a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductAttribute/Options.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - Yes - blue - blue - - - black - black - - - - - - Yes - black - black - - - No - white - white - - - No - green - green - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductConfigurable/CheckoutData.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductConfigurable/CheckoutData.xml deleted file mode 100644 index d6706062265..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductConfigurable/CheckoutData.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - attribute_key_0 - option_key_1 - - - attribute_key_1 - option_key_1 - - - - 2 - - 160.00 - 2 - 320.00 - - - - - - - - attribute_key_0 - option_key_1 - - - attribute_key_1 - option_key_1 - - - - - attribute_key_0 - option_key_0 - - - - 2 - - 194.80 - 2 - 389.60 - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductConfigurable/ConfigurableOptions.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductConfigurable/ConfigurableOptions.xml deleted file mode 100644 index 381801df7bd..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductConfigurable/ConfigurableOptions.xml +++ /dev/null @@ -1,226 +0,0 @@ - - - - - - - custom_attribute_set - - - - - - 12 - Percentage - - - 20 - Percentage - - - 18 - Percentage - - - - - - - 42.00 - Fixed - - - 40.00 - Fixed - - - 48.00 - Fixed - - - - - - catalogProductSimple::default - catalogProductSimple::default - catalogProductSimple::default - - - - - - with_filterable_options - - - - - - 12 - Percentage - - - 20 - Percentage - - - 18 - Percentage - - - - - - - 42.00 - Fixed - - - 40.00 - Fixed - - - 48.00 - Fixed - - - - - - catalogProductSimple::default - catalogProductSimple::default - catalogProductSimple::default - - - - - - - - - 121.00 - Percentage - - - - - - - 412.00 - Fixed - - - - - - catalogProductSimple::quickCreation - - - - - - - - - 11.00 - Percentage - - - - - - - 76.00 - Fixed - - - - - - catalogProductSimple::withoutPersist - - - - - - - - - 33.00 - Percentage - - - - - - - 62.00 - Fixed - - - - - - catalogProductSimple::withoutPersist - - - - - - custom_attribute_set - - - - - - 12 - Percentage - - - 20 - Percentage - - - 18 - Percentage - - - - - - - 42.00 - Fixed - - - 40.00 - Fixed - - - 48.00 - Fixed - - - - - - catalogProductSimple::out_of_stock - catalogProductSimple::out_of_stock - catalogProductSimple::out_of_stock - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductConfigurable/Price.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductConfigurable/Price.xml deleted file mode 100644 index ff976f8dd5e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductConfigurable/Price.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - 86 - - - 77 - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple.xml deleted file mode 100644 index 63d7518a343..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple.xml +++ /dev/null @@ -1,1000 +0,0 @@ - - - - - - Test simple product %isolation% - Simple product description %isolation% - Simple product short description %isolation% - test_simple_sku_%isolation% - 12.0000 - Enabled - test-simple-product-%isolation% - Catalog, Search - - 100.00 - - - Taxable Goods - - - 1000 - In Stock - - - default_subcategory - - - - main_website - - - - default - - - - - Simple Product %isolation% - Description for default Simple product with category - Short description for default Simple product with category - Enabled - Catalog, Search - sku_simple_product_%isolation% - - Taxable Goods - - - 100 - - 12 - - 10 - In Stock - - - default - - - order_default - - - - main_website - - - simple-product-%isolation% - - - - Test simple product %isolation% - Description for Simple product with category - Short description for Simple product with category - Enabled - Catalog, Search - test_simple_sku_%isolation% - - Taxable Goods - - - 100 - - 12 - - 10 - In Stock - - - default_subcategory - - - - main_website - - - test-simple-product-%isolation% - - - - Simple Product for sales rule 1 %isolation% - Description for Simple product for sales rule 1 - Short description for Simple product for sales rule 1. - sku_simple_product_%isolation% - - default - - Enabled - simple - - 666 - In Stock - - - 100 - - 100 - - default_subcategory - - - - main_website - - - simple-product-for-sales-rule-1-%isolation% - - - - Simple Product for sales rule 2 %isolation% - Description for Simple product for sales rule 2 - Short description for Simple product for sales rule 2. - sku_simple_product_%isolation% - - default - - Enabled - simple - - 666 - In Stock - - - 50 - - 50 - - default_subcategory - - - - main_website - - - simple-product-for-sales-rule-2-%isolation% - - - - 100_dollar_product%isolation% - 100_dollar_product%isolation% - Description for 100_dollar_product. - Short description for 100_dollar_product. - simple - - 666 - In Stock - - 1 - - default - - Enabled - - 100 - - - - main_website - - - 100-dollar-product%isolation% - - - - Simple product with special price and category %isolation% - Description for Simple product with special price and category - Short description for Simple product with special price and category - Enabled - Catalog, Search - simple_product_with_special_price_and_category%isolation% - - Taxable Goods - - - default - - - 100 - - 90 - - 10 - In Stock - - 1 - - default_subcategory - - - - main_website - - - simple-product-with-special-price-and-category-%isolation% - - 3 - - - - - Simple Product %isolation% - Description for Simple product with category and one custom option - Short description for Simple product with category and one custom option - Enabled - Catalog, Search - sku_simple_product_%isolation% - - Taxable Goods - - - default - - - 300 - - - 10 - In Stock - - 1 - - drop_down_with_one_option_percent_price - - - drop_down_with_one_option_percent_price - - - default_subcategory - - - - main_website - - - simple-product-%isolation% - - - - Simple Product with default website %isolation%. - Description for default Simple product with default website. - Short description for default Simple product with category. - Enabled - Catalog, Search - sku_simple_product_%isolation% - - Taxable Goods - - - 100 - - 12 - - 10 - In Stock - - - default - - - default - - - - main_website - - - simple-product-with-default-website-%isolation% - - - - 50_dollar_product%isolation% - 50_dollar_product%isolation% - Description for 50_dollar_product. - Short description for 50_dollar_product. - simple - - 666 - In Stock - - 1 - - default - - Enabled - - 50 - - - - main_website - - - 50-dollar-product%isolation% - - - - Test simple product %isolation% - Description for Simple product with category - Short description for Simple product with category - Enabled - Catalog, Search - - - main_website - - - test_simple_sku_%isolation% - - Taxable Goods - - - 100 - - 12 - - 10 - In Stock - - Yes - Use config - test-simple-product-%isolation% - - - - Test simple product %isolation% - Description for Simple product with category - Short description for Simple product with category - Enabled - Catalog, Search - - - main_website - - - test_simple_sku_%isolation% - - Taxable Goods - - - 100 - - 12 - - 10 - In Stock - - Yes - In Cart - test-simple-product-%isolation% - - - - Simple product with group price and category %isolation% - Description for Simple product with group price and category - Short description for Simple product with group price and category - Enabled - Catalog, Search - simple_product_with_group_price_and_category%isolation% - - Taxable Goods - - - default - - - 100 - - - 10 - In Stock - - 1 - - default_subcategory - - - - main_website - - - - for_not_logged_users - - test-simple-product-%isolation% - - 3 - - - - - Simple product with group price and category %isolation% - Description for Simple product with group price and category - Short description for Simple product with group price and category - Enabled - Catalog, Search - simple_product_with_group_price_and_category%isolation% - - Taxable Goods - - - default - - - 100 - - - 10 - In Stock - - 1 - - default_subcategory - - - - main_website - - - - tax_calculation - - test-simple-product-%isolation% - - 3 - - - - - Simple product with tier price and category %isolation% - Description for Simple product with tier price and category - Short description for Simple product with tier price and category - Enabled - Catalog, Search - simple_product_with_tier_price_and_category%isolation% - - Taxable Goods - - - default - - - 300 - with_tier_price - - - 10 - In Stock - - 1 - - default_subcategory - - - - main_website - - - - for_all_groups - - test-simple-product-%isolation% - - 3 - - - - - simple_for_composite_products%isolation% - Description for Simple composite products - Short description for Simple composite products - Enabled - Catalog, Search - simple_for_composite_products%isolation% - - 560 - - - - - default - - - Taxable Goods - - 1 - - - main_website - - - - 10 - In Stock - - simple-for-composite-products%isolation% - - - - Simple Product %isolation% - Description for default Simple product with category - Short description for default Simple product with category - Enabled - Catalog, Search - sku_simple_product_%isolation% - - Taxable Goods - - - 5 - - 12 - - 100 - In Stock - - - default - - - default - - - - main_website - - - simple-product-%isolation% - - - - simple - Simple Product %isolation% - Description for simple product with two custom option - Short description for simple product with two custom option - Enabled - simple-product-%isolation% - sku_simple_product_%isolation% - Catalog, Search - - default - - - 300 - - - 100 - In Stock - - 1 - - - main_website - - - - two_options - - - with_two_custom_option - - - - - simple - Simple Product%isolation% - Description for simple product with category with anchor - Short description for simple product with category with anchor - Enabled - simple-product-with-category-with-anchor%isolation% - sku_simple_product_with_category_with_anchor%isolation% - Catalog, Search - - 100 - In Stock - - 1 - - 100 - - - anchor_category - - - - main_website - - - - Taxable Goods - - - with_one_attribute - - - - - Simple Product %isolation% - Description for default Simple product with category - Short description for default Simple product with category - Enabled - Catalog, Search - sku_simple_product_%isolation% - - Taxable Goods - - - 100 - - 12 - - 3 - In Stock - - - default - - - default - - - - main_website - - - simple-product-%isolation% - - - - Simple Product %isolation% - sku_simple_product_%isolation% - Enabled - Catalog, Search - 12 - - 100 - In Stock - - No - - - - Simple Product %isolation% - Description for default Simple product with category - Short description for default Simple product with category - Enabled - Catalog, Search - sku_simple_product_%isolation% - - Taxable Goods - - - 100 - - 12 - - 100 - In Stock - - - default - - - default - - - - main_website - - - simple-product-%isolation% - No - - - - Out of Stock Simple Product %isolation% - Description for Out of Stock default Simple product with category - Short description for Out of Stock default Simple product with category - Enabled - Catalog, Search - sku_simple_product_%isolation% - - Taxable Goods - - - 100 - - 12 - - 100 - Out of Stock - - - default - - - default - - - - main_website - - - simple-product-%isolation% - - - - Simple Product offline %isolation% - Description for offline default Simple product with category - Short description for offline default Simple product with category - Disabled - Catalog, Search - sku_simple_product_%isolation% - - Taxable Goods - - - 100 - - 12 - - 100 - In Stock - - - default - - - default - - - - main_website - - - simple-product-%isolation% - - - - Simple Product not visible %isolation% - Description for not visible default Simple product with category - Short description for not visible default Simple product with category - Enabled - Not Visible Individually - sku_not_visible_simple_product_%isolation% - - Taxable Goods - - - 100 - - 12 - - 100 - In Stock - - - default - - - default - - - - main_website - - - simple-product-%isolation% - - - - Simple Product with cart limit %isolation% - Description for default Simple product with cart limit and category - Short description for default Simple product cart limit and category - Enabled - Catalog, Search - sku_simple_product_%isolation% - - Taxable Goods - - - 100 - - 12 - - 2 - 5 - - - default - - - default - - - - main_website - - - simple-product-%isolation% - - - - Simple Product with qty increments %isolation% - Description for default Simple product with qty increments and category - Short description for default Simple product with qty increments and category - Enabled - Catalog, Search - sku_simple_product_with_qty_increments_%isolation% - - Taxable Goods - - - 100 - - 12 - - Yes - 2 - - - default - - - default - - - - main_website - - - simple-product-%isolation% - - - - Test simple product %isolation% - Description for Simple product with category - Short description for Simple product with category - Enabled - Catalog, Search - - - main_website - - - test_simple_sku_%isolation% - - Taxable Goods - - - 100 - - 12 - - 10 - In Stock - - Yes - Before Order Confirmation - test-simple-product-%isolation% - - - - - default - - - default_subcategory - - - - main_website - - - Description for Simple product - Short description for Simple product - Enabled - Simple Product With Fpt %isolation% - sku_simple_product_%isolation% - - 70 - - - 10 - In Stock - - 1 - - drop_down_with_one_option_fixed_price - - - drop_down_with_one_option_fixed_price - - simple-product-%isolation% - - one_fpt_for_all_states - - - Taxable Goods - - - - - - default - - - default_subcategory - - - - main_website - - - Description for Simple product - Short description for Simple product - Enabled - Simple Product With Fpt %isolation% - sku_simple_product_%isolation% - - 110 - - - 10 - In Stock - - 100 - 1 - simple-product-%isolation% - - one_fpt_for_all_states - - - Taxable Goods - - - - - simple product %isolation% - Description for default Simple product with category - Short description for default Simple product with category - Enabled - Catalog, Search - sku_simple_product_%isolation% - - Taxable Goods - - - 100 - - 12 - - 10 - In Stock - - - default - - - order_default - - - - main_website - - - simple-product-%isolation% - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple/Attributes.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple/Attributes.xml deleted file mode 100644 index ee769546f39..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple/Attributes.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - option_key_0 - - - - \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple/CheckoutData.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple/CheckoutData.xml deleted file mode 100644 index 59e87857e1e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple/CheckoutData.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - 3 - - 100.00 - 300.00 - - - - - 1 - - 100.00 - 100.00 - - - - - - - - attribute_key_0 - option_key_0 - - - - 2 - - 10034.00 - 20068.00 - - - - - - - - attribute_key_0 - option_key_0 - - - - - - - - - - attribute_key_0 - option_key_0 - - - attribute_key_1 - Content option %isolation% - - - - 1 - - 340 - 340 - - - - - - - - attribute_key_0 - option_key_0 - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple/CustomOptions.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple/CustomOptions.xml deleted file mode 100644 index a8e668d1247..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple/CustomOptions.xml +++ /dev/null @@ -1,262 +0,0 @@ - - - - - - - custom option Drop-down %isolation% - Yes - Select/Drop-down - - - 10 bucks - 10 - Percent - sku_drop_down_row_1 - - - 20 bucks - 20 - Percent - sku_drop_down_row_2 - - - - - - - - custom option Drop-down %isolation% - Yes - Select/Drop-down - - - 30 bucks - 30 - Fixed - sku_drop_down_row_1 - - - 40 bucks - 40 - Percent - sku_drop_down_row_2 - - - - - - - - custom option Drop-down %isolation% - Yes - Select/Drop-down - - - 40 bucks - 40 - Percent - sku_drop_down_row_2 - - - - - - - - custom option item %isolation% - Yes - Text/Field - - 10 - Fixed - sku_item_option_%isolation% - 1024 - - - - custom option Area %isolation% - Yes - Text/Area - - 10 - Fixed - sku_area_row_%isolation% - 10 - - - - custom option File %isolation% - No - File/File - - 10 - Fixed - sku_file_row_%isolation% - jpg - 100 - 100 - - - - custom option Drop-down %isolation% - Yes - Select/Drop-down - - - 10 percent - 10 - Percent - sku_drop_down_row_1_%isolation% - - - 20 percent - 20 - Percent - sku_drop_down_row_2_%isolation% - - - 30 fixed - 30 - Fixed - sku_drop_down_row_3_%isolation% - - - - - custom option Radio Buttons %isolation% - Yes - Select/Radio Buttons - - - 20 percent - 20 - Fixed - sku_radio_buttons_row%isolation% - - - - - custom option Checkbox %isolation% - Yes - Select/Checkbox - - - 20 percent - 20 - Fixed - sku_checkbox_row%isolation% - - - - - custom option Multiple Select %isolation% - Yes - Select/Checkbox - - - 20 fixed - 20 - Fixed - sku_multiple_select_row%isolation% - - - - - custom option Date %isolation% - Yes - Date/Date - - 20 - Fixed - sku_date_row%isolation% - - - - custom option Date & Time %isolation% - Yes - Date/Date & Time - - 20 - Fixed - sku_multiple_select_row%isolation% - - - - custom option Time %isolation% - Yes - Date/Time - - 20 - Fixed - sku_time_row%isolation% - - - - - - - custom option drop down %isolation% - Yes - Select/Drop-down - - - 10 percent - 10 - Percent - sku_drop_down_row_1 - - - 20 percent - 20 - Percent - sku_drop_down_row_2 - - - - - custom option item %isolation% - Yes - Text/Field - - - 10 - Fixed - sku_item_option_%isolation% - 1024 - - - - - - - - custom option drop down %isolation% - Yes - Select/Drop-down - - - 30 bucks - 30 - Fixed - sku_drop_down_row_1 - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple/Fpt.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple/Fpt.xml deleted file mode 100644 index 1984831ef1e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple/Fpt.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - 10 - All Websites [USD] - United States - * - - - - \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple/GroupPriceOptions.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple/GroupPriceOptions.xml deleted file mode 100644 index 49cca4c76e2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple/GroupPriceOptions.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - 90.00 - NOT LOGGED IN - - - - - - 90.99 - All Websites [USD] - General - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple/Price.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple/Price.xml deleted file mode 100644 index da56085eec9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple/Price.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - 95 - - - 92 - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple/TierPriceOptions.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple/TierPriceOptions.xml deleted file mode 100644 index cceefd01935..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple/TierPriceOptions.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - 15.00 - 3 - ALL GROUPS - - - 24.00 - 15 - ALL GROUPS - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductVirtual.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductVirtual.xml deleted file mode 100644 index 3e7d47fea7b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductVirtual.xml +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - Test virtual product %isolation% - test_virtual_sku_%isolation% - - 100.00 - - - 10.0000 - In Stock - - Yes - test-virtual-product-%isolation% - - - main_website - - - - - - Virtual Product %isolation% - Description for default Virtual product with category - Short description for default Virtual product with category - Enabled - Catalog, Search - sku_virtual_product_%isolation% - - Taxable Goods - - - 100 - - Yes - - 10 - In Stock - - - order_default - - - - main_website - - - virtual-product-%isolation% - - - - Virtual Product %isolation% - Description for default Virtual product with category - Short description for default Virtual product with category - Enabled - Catalog, Search - sku_virtual_product_%isolation% - - Taxable Goods - - - 1000 - - Yes - - 10 - In Stock - - - order_default - - - - main_website - - - virtual-product-%isolation% - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductVirtual/CheckoutData.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductVirtual/CheckoutData.xml deleted file mode 100644 index 1f6c496de92..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductVirtual/CheckoutData.xml +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - 3 - - 10 - 3 - 30 - - - - - 1 - - 100.00 - 100.00 - - - - - - - - attribute_key_0 - option_key_0 - - - - 2 - - 120.00 - 240.00 - - - - - 2 - - 10 - 3 - 20 - - - - - 4 - - 15 - 4 - 60 - - - - - 2 - - 90.00 - 180.00 - - - - - - - product_key_0 - 3 - - - product_key_1 - 1 - - - product_key_2 - 2 - - - - - 560 - 40 - 100 - - - 3 - 1 - 2 - - - 1680 - 40 - 200 - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductVirtual/Price.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductVirtual/Price.xml deleted file mode 100644 index 0cbaf235d8d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductVirtual/Price.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - 100.00 - 90.00 - 100.00 - 90.00 - 126.00 - - - - - - 85 - - - 76 - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/ConfigData.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/ConfigData.xml deleted file mode 100644 index 3179abc0da6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/ConfigData.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - catalog - 1 - Manual - manual - - - catalog - 1 - - 10 - - - catalog - 1 - - 10 - - - - - catalog - 1 - Automatic (equalize price ranges) - auto - - - - - cataloginventory - 1 - Yes - 1 - - - - - cataloginventory - 1 - No - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/ConfigurableProduct.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/ConfigurableProduct.xml deleted file mode 100644 index 5bc6fd8f863..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/ConfigurableProduct.xml +++ /dev/null @@ -1,242 +0,0 @@ - - - - - - Configurable Product %isolation% - sku_configurable_product_%isolation% - configurable - - Taxable Goods - - configurable-product-%isolation% - - default - - - 100 - - 12 - - In Stock - - Enabled - Catalog, Search - Description for default Configurable product with category - Short description for default Configurable product with category - - default - - - - main_website - - - - - - Configurable Product %isolation% - sku_configurable_product_%isolation% - configurable - - Taxable Goods - - configurable-product-%isolation% - - default - - - 100 - - 12 - - In Stock - - Enabled - Catalog, Search - - - main_website - - - Description for default Configurable product with category - Short description for default Configurable product with category - Yes - Use config - - - - Configurable Product %isolation% - sku_configurable_product_%isolation% - configurable - - Taxable Goods - - configurable-product-%isolation% - - default - - - 100 - - 12 - - In Stock - - Enabled - Catalog, Search - - - main_website - - - Description for default Configurable product with category - Short description for default Configurable product with category - Yes - In Cart - - - - Configurable Product %isolation% - sku_configurable_product_%isolation% - configurable - - Taxable Goods - - configurable-product-%isolation% - - with_filterable_options - - - 100 - - 12 - - In Stock - - Enabled - Catalog, Search - Description for default Configurable product with category - Short description for default Configurable product with category - - - main_website - - - - - - Configurable Product %isolation% - sku_configurable_product_%isolation% - configurable - - Taxable Goods - - configurable-product-%isolation% - - default - - - 100 - - 12 - - In Stock - - Enabled - Catalog, Search - Description for default Configurable product with category - Short description for default Configurable product with category - - default - - - - main_website - - - - default_subcategory - - - - - Configurable Product %isolation% - sku_configurable_product_%isolation% - configurable - - Taxable Goods - - configurable-product-%isolation% - - with_out_of_stock_items - - - 100 - - 12 - - In Stock - - Enabled - Catalog, Search - Description for Configurable product with out of stock items - Short description for Configurable product with with out of stock items - - default - - - - main_website - - - - - - Configurable Product %isolation% - sku_configurable_product_%isolation% - configurable - - Taxable Goods - - configurable-product-%isolation% - - default - - - 100 - - 10 - 12 - - In Stock - - Enabled - Catalog, Search - Description for default Configurable product with special price - Short description for default Configurable product with special price - - default - - - - main_website - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/GroupedProduct.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/GroupedProduct.xml deleted file mode 100644 index f33670ae9a3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/GroupedProduct.xml +++ /dev/null @@ -1,137 +0,0 @@ - - - - - - Test grouped product %isolation% - test_grouped_sku_%isolation% - - Taxable Goods - - 12.0000 - - 10.0000 - In Stock - - Enabled - - defaultSimpleProducts - - test-grouped-product-%isolation% - - - - Grouped product %isolation% - grouped_product_%isolation% - Catalog, Search - Enabled - - three_simple_products - - - Taxable Goods - - test-grouped-product-%isolation% - 12.0000 - This is description for grouped product with three simple products - This is short description for grouped product with three simple products - - 10.0000 - In Stock - - - - main_website - - - - default - - - three_simple_products - - - default_subcategory - - - - - Grouped product %isolation% - grouped_product_%isolation% - Catalog, Search - Enabled - - three_simple_products - - - Taxable Goods - - test-grouped-product-%isolation% - 12.0000 - This is description for grouped product with three simple products - This is short description for grouped product with three simple products - - 10.0000 - In Stock - - - - main_website - - - - default - - - three_simple_products - - - - - Test grouped product with price %isolation% - sku_test_grouped_product_with_price_%isolation% - Catalog, Search - Enabled - This is description for grouped product with price - This is short description for grouped product with price - - - - starting-100 - - - defaultSimpleProducts - - - Taxable Goods - - test-grouped-product-with-price%isolation% - 12.0000 - - 10.0000 - In Stock - - - - main_website - - - - default - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/GroupedProduct/Associated.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/GroupedProduct/Associated.xml deleted file mode 100644 index b1f58571aa2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/GroupedProduct/Associated.xml +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - - 3 - - - 2 - - - catalogProductSimple::default, - catalogProductSimple::100_dollar_product - - - - - - - 2 - - - 4 - - - - catalogProductSimple::product_with_special_price_and_category,catalogProductSimple::product_with_special_price_and_category - - - - - - - 3 - - - 4 - - - catalogProductSimple::simple_with_group_price, - catalogProductSimple::simple_with_group_price - - - - - - - 4 - - - 3 - - - catalogProductSimple::simple_with_tier_price, - catalogProductSimple::simple_with_tier_price - - - - - - - 4 - - - 2 - - - catalogProductVirtual::order_default, - catalogProductVirtual::order_default - - - - - - - 17 - - - 36 - - - 20 - - - catalogProductSimple::grouped_default, - catalogProductSimple::grouped_default,catalogProductSimple::100_dollar_product - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/GroupedProduct/CheckoutData.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/GroupedProduct/CheckoutData.xml deleted file mode 100644 index 5636f8d3a1c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/GroupedProduct/CheckoutData.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - product_key_0 - 3 - - - product_key_1 - 1 - - - product_key_2 - 2 - - - - - 100 - 100 - 100 - - - 3 - 1 - 2 - - - 300 - 100 - 200 - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/GroupedProduct/Price.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/GroupedProduct/Price.xml deleted file mode 100644 index dd23c857863..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/GroupedProduct/Price.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - 100.00 - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Category/CreateCategoryEntityTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Category/CreateCategoryEntityTest.php deleted file mode 100644 index f27bb4808f5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Category/CreateCategoryEntityTest.php +++ /dev/null @@ -1,71 +0,0 @@ -Categories->Manage Categories. - * 3. Select parent category. - * 4. Click on 'Add Category' button. - * 5. Fill out all data according to data set. - * 6. Save category. - * 7. Perform all assertions. - * - * @group Category_Management_(MX) - * @ZephyrId MPERF-6712 - */ -class CreateCategoryEntityTest extends Injectable -{ - /** - * Catalog category index page. - * - * @var CatalogCategoryIndex - */ - protected $catalogCategoryIndex; - - /** - * Inject page. - * - * @param CatalogCategoryIndex $catalogCategoryIndex - * @return void - */ - public function __inject(CatalogCategoryIndex $catalogCategoryIndex) - { - $this->catalogCategoryIndex = $catalogCategoryIndex; - } - - /** - * Create category. - * - * @param CatalogCategory $category - * @param string $addCategory - * @return void - */ - public function test(CatalogCategory $category, $addCategory) - { - // Steps - $this->catalogCategoryIndex->open(); - $this->catalogCategoryIndex->getTreeCategories()->selectCategory($category, false); - $this->catalogCategoryIndex->getTreeCategories()->$addCategory(); - $this->catalogCategoryIndex->getCategoryForm()->fill($category); - $this->catalogCategoryIndex->getFormPageActions()->save(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Category/CreateCategoryEntityTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Category/CreateCategoryEntityTest.xml deleted file mode 100644 index e51312fade8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Category/CreateCategoryEntityTest.xml +++ /dev/null @@ -1,178 +0,0 @@ - - - - - - addRootCategory - - - RootCategory%isolation% - - - Yes - RootCategory Required - - - - - - - - - - - No - Best Value - Name - Price - - - - - - - main:ce - - - - - addRootCategory - - - RootCategory%isolation% - - - Yes - RootCategory All Fields - RootCategory Page Title - Yes - Static block and products - Yes - No - Best Value - Name - Price - No - Name - - - - - - - addSubcategory - default_category - Subcategory%isolation% - subcategory%isolation% - Yes - Subcategory Required - - - - - - - - - - - Yes - - - - - - - - - - - - - - - - - - addSubcategory - default_category - Subcategory%isolation% - subcategory%isolation% - Yes - Subcategory For Anchor Subcategory - - - Yes - - - - - No - Yes - - - - - - - Yes - - - catalogProductSimple::default,catalogProductSimple::default - - - - - - - addSubcategory - default_category - Subcategory%isolation% - subcategory%isolation% - Yes - Anchor Subcategory All Fields - Subcategory Page Title - Yes - Products only - Yes - No - Best Value - Name - Price - No - Price - catalogProductSimple::default,catalogProductSimple::default - - - - - - - addSubcategory - default_category - Subcategory%isolation% - subcategory%isolation% - Yes - Not active category - - - Yes - - - - - - - Yes - - - - - - - Yes - - - - - - - - - addSubcategory - default_category - Subcategory%isolation% - subcategory%isolation% - Yes - Not included in menu - - - No - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Category/DeleteCategoryEntityTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Category/DeleteCategoryEntityTest.php deleted file mode 100644 index 4e17cbc6118..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Category/DeleteCategoryEntityTest.php +++ /dev/null @@ -1,72 +0,0 @@ - Categories -> Manage Categories. - * 3. Open category created in preconditions. - * 4. Click 'Delete' button. - * 5. Perform all assertions. - * - * @group Category_Management_(MX) - * @ZephyrId MPERF-7330 - */ -class DeleteCategoryEntityTest extends Injectable -{ - /** - * Catalog category index page. - * - * @var CatalogCategoryIndex - */ - protected $catalogCategoryIndex; - - /** - * Injection page. - * - * @param CatalogCategoryIndex $catalogCategoryIndex - * @return void - */ - public function __inject(CatalogCategoryIndex $catalogCategoryIndex) - { - $this->catalogCategoryIndex = $catalogCategoryIndex; - } - - /** - * Delete category. - * - * @param CatalogCategory $category - * @return void - */ - public function test(CatalogCategory $category) - { - // Preconditions: - $category->persist(); - - // Steps: - $this->catalogCategoryIndex->open(); - $this->catalogCategoryIndex->getTreeCategories()->selectCategory($category); - $this->catalogCategoryIndex->getFormPageActions()->deleteAndAcceptAlert(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Category/DeleteCategoryEntityTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Category/DeleteCategoryEntityTest.xml deleted file mode 100644 index ac8d945e344..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Category/DeleteCategoryEntityTest.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - root_category - - - - - default_subcategory - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Category/UpdateCategoryEntityTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Category/UpdateCategoryEntityTest.php deleted file mode 100644 index da207606a0f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Category/UpdateCategoryEntityTest.php +++ /dev/null @@ -1,194 +0,0 @@ -Categories->Manage Categories. - * 3. Open category created in preconditions. - * 4. Update data according to data set. - * 5. Save category. - * 6. Perform all assertions. - * - * @group Category_Management_(MX) - * @ZephyrId MPERF-7032 - */ -class UpdateCategoryEntityTest extends Injectable -{ - /** - * Catalog category index page. - * - * @var CatalogCategoryIndex - */ - protected $catalogCategoryIndex; - - /** - * Fixture factory. - * - * @var FixtureFactory - */ - protected $fixtureFactory; - - /** - * Array unassigned products. - * - * @var array - */ - protected $unassignedProducts = []; - - /** - * Unassigned category products keys. - * - * @var mixed - */ - protected $unassignedProductsKeys; - - /** - * Injection data. - * - * @param CatalogCategoryIndex $catalogCategoryIndex - * @param FixtureFactory $fixtureFactory - * @return void - */ - public function __inject(CatalogCategoryIndex $catalogCategoryIndex, FixtureFactory $fixtureFactory) - { - $this->catalogCategoryIndex = $catalogCategoryIndex; - $this->fixtureFactory = $fixtureFactory; - } - - /** - * Update category. - * - * @param CatalogCategory $category - * @param CatalogCategory $initialCategory - * @param string $unassignedProductsKeys [optional] - * @return array - */ - public function test(CatalogCategory $category, CatalogCategory $initialCategory, $unassignedProductsKeys = '') - { - $this->unassignedProductsKeys = $unassignedProductsKeys; - $initialCategory->persist(); - $this->catalogCategoryIndex->open(); - $this->catalogCategoryIndex->getTreeCategories()->selectCategory($initialCategory); - $category = $this->updateCategoryFixture($initialCategory, $category); - $this->catalogCategoryIndex->getCategoryForm()->fill($category); - $this->catalogCategoryIndex->getFormPageActions()->save(); - - return ['category' => $category, 'unassignedProducts' => $this->unassignedProducts]; - } - - /** - * Update category fixture. - * - * @param CatalogCategory $initialCategory - * @param CatalogCategory $category - * @return CatalogCategory - */ - protected function updateCategoryFixture(CatalogCategory $initialCategory, CatalogCategory $category) - { - $categoryData = $this->prepareCategoryData($initialCategory, $category); - return $this->fixtureFactory->createByCode( - 'catalogCategory', - ['data' => $categoryData] - ); - } - - /** - * Prepare category date. - * - * @param CatalogCategory $initialCategory - * @param CatalogCategory $category - * @return array - */ - protected function prepareCategoryData(CatalogCategory $initialCategory, CatalogCategory $category) - { - $categoryData = array_merge($initialCategory->getData(), $category->getData()); - if (isset($categoryData['category_products'])) { - $categoryData['category_products'] = $this->prepareCategoryProducts($initialCategory, $category); - } - $categoryData['parent_id'] = $this->prepareParentCategory($initialCategory, $category); - unset($categoryData['path']); - - return $categoryData; - } - - /** - * Prepare category products. - * - * @param CatalogCategory $initialCategory - * @param CatalogCategory $category - * @return array - */ - protected function prepareCategoryProducts(CatalogCategory $initialCategory, CatalogCategory $category) - { - $data = []; - $initialCategoryProducts = $this->getCategoryProducts($initialCategory); - $categoryProducts = $this->getCategoryProducts($category); - if ($this->unassignedProductsKeys !== '') { - $this->unassignedProductsKeys = explode(',', $this->unassignedProductsKeys); - foreach ($this->unassignedProductsKeys as $key) { - $key = trim($key); - $this->unassignedProducts[] = $initialCategoryProducts[$key]; - unset($initialCategoryProducts[$key]); - } - } - $resultProducts = array_merge($initialCategoryProducts, $categoryProducts); - foreach ($resultProducts as $product) { - $data[] = $product->getSku(); - } - - return ['data' => $data, 'products' => $resultProducts]; - } - - /** - * Get category products. - * - * @param CatalogCategory $category - * @return array - */ - protected function getCategoryProducts(CatalogCategory $category) - { - return $category->hasData('category_products') - ? $category->getDataFieldConfig('category_products')['source']->getProducts() - : []; - } - - /** - * Prepare parent category data. - * - * @param CatalogCategory $initialCategory - * @param CatalogCategory $category - * @return array - */ - protected function prepareParentCategory(CatalogCategory $initialCategory, CatalogCategory $category) - { - $category = $category->hasData('parent_id') ? $category : $initialCategory; - return [ - 'data' => $category->getParentId(), - 'parent_category' => $category->getDataFieldConfig('parent_id')['source']->getParentCategory() - ]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Category/UpdateCategoryEntityTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Category/UpdateCategoryEntityTest.xml deleted file mode 100644 index b71386ada6c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Category/UpdateCategoryEntityTest.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - Update category name, url_key, include_in_menu fields. - subcategory_with_assigned_products - Name%isolation% - Yes - updated-url-key%isolation% - Yes - Yes - No - Name - - - - - - - Update category description, name, url_key, available_product_listing_config, available_sort_by fields. - subcategory_with_assigned_products - Name%isolation% - Yes - updated-url-key%isolation% - Category Description - Category Title - Yes - No - Name - Price - No - Name - - - - - - - Update category to inactive. - Name%isolation% - No - - - - - Unasigned products from category. - subcategory_with_assigned_products - Name%isolation% - 0,2 - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Layer/FilterProductListTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Layer/FilterProductListTest.php deleted file mode 100644 index 47a84817759..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Layer/FilterProductListTest.php +++ /dev/null @@ -1,129 +0,0 @@ -category = $fixtureFactory->createByCode('catalogCategory', ['dataset' => 'anchor_category']); - $this->category->persist(); - - return ['category' => $this->category]; - } - - /** - * Run filter product list test. - * - * @param string $products - * @return array - */ - public function test($products) - { - // Precondition - $this->setupConfigData(); - return $this->createProducts($products); - } - - /** - * Create products. - * - * @param string $products - * @return array - */ - protected function createProducts($products) - { - return $this->objectManager->create( - 'Mage\Catalog\Test\TestStep\CreateProductsStep', - ['products' => $products, 'data' => $this->prepareProductsData($products)] - )->run(); - } - - /** - * Prepare products data. - * - * @param string $products - * @return array - */ - protected function prepareProductsData($products) - { - $resultData = []; - $productsCount = substr_count($products, ','); - for ($i = 0; $i <= $productsCount; $i++) { - $resultData[] = ['category_ids' => ['category' => $this->category]]; - } - - return $resultData; - } - - /** - * Setup configuration. - * - * @param bool $rollback [optional] - * @return void - */ - protected function setupConfigData($rollback = false) - { - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => 'manual_layered_navigation_mysql', 'rollback' => $rollback] - )->run(); - } - - /** - * Rollback configuration after test. - * - * @return void - */ - public static function tearDownAfterClass() - { - ObjectManager::getInstance()->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => 'manual_layered_navigation_mysql', 'rollback' => true] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Layer/FilterProductListTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Layer/FilterProductListTest.xml deleted file mode 100644 index bda548e1028..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Layer/FilterProductListTest.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - Filter by price - downloadableProduct::with_two_separately_links,catalogProductSimple::50_dollar_product,catalogProductVirtual::order_default - $20.00 - 0 - main:ce - - - - Filter by price - catalogProductSimple::order_default,catalogProductSimple::50_dollar_product,catalogProductVirtual::order_default - $50.00 - 1 - - - - Filter by price - groupedProduct::three_simple_products_without_category,catalogProductSimple::50_dollar_product,catalogProductSimple::50_dollar_product - $100.00 - 0 - - - - Filter by price - bundleProduct::bundle_fixed_product,catalogProductSimple::50_dollar_product,catalogProductVirtual::order_default - $760.00 - 0 - - - - Filter by price - catalogProductSimple::order_default,catalogProductVirtual::order_default_expensive,catalogProductVirtual::order_default - $1,000.00 - 1 - - - - Filter by configurable attribute - catalogProductSimple::order_default,catalogProductVirtual::order_default,configurableProduct::with_filterable_options - attribute_key_0::option_key_0 - 2 - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AbstractAddAppurtenantProductsEntityTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AbstractAddAppurtenantProductsEntityTest.php deleted file mode 100644 index 2359e211eef..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AbstractAddAppurtenantProductsEntityTest.php +++ /dev/null @@ -1,111 +0,0 @@ -fixtureFactory = $fixtureFactory; - } - - /** - * Inject data. - * - * @param CatalogProduct $catalogProductIndex - * @param CatalogProductNew $catalogProductNew - * @return void - */ - public function __inject(CatalogProduct $catalogProductIndex, CatalogProductNew $catalogProductNew) - { - $this->catalogProductIndex = $catalogProductIndex; - $this->catalogProductNew = $catalogProductNew; - } - - /** - * Get product by data. - * - * @param string $productData - * @param array $relatedProductsData - * @return InjectableFixture - */ - protected function getProductByData($productData, array $relatedProductsData) - { - list($fixtureName, $dataset) = explode('::', $productData); - $relatedProductsPresets = []; - foreach ($relatedProductsData as $type => $presets) { - $relatedProductsPresets[$type]['presets'] = $presets; - } - - return $this->fixtureFactory->createByCode( - $fixtureName, - [ - 'dataset' => $dataset, - 'data' => $relatedProductsPresets - ] - ); - } - - /** - * Create and save product. - * - * @param InjectableFixture $product - * @return void - */ - protected function createAndSaveProduct(InjectableFixture $product) - { - $this->catalogProductIndex->open(); - $this->catalogProductIndex->getGridPageActionBlock()->addNew(); - $this->catalogProductNew->getProductForm()->fill($product); - $this->catalogProductNew->getFormPageActions()->save(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AbstractProductsCompareTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AbstractProductsCompareTest.php deleted file mode 100644 index 52d0a36665e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AbstractProductsCompareTest.php +++ /dev/null @@ -1,179 +0,0 @@ -fixtureFactory = $fixtureFactory; - $this->browser = $browser; - $this->assertProductCompareSuccessAddMessage = $assertProductCompareSuccessAddMessage; - $customer->persist(); - $this->customer = $customer; - } - - /** - * Injection data. - * - * @param CmsIndex $cmsIndex - * @param CatalogProductView $catalogProductView - * @param CustomerAccountLogin $customerAccountLogin - * @return void - */ - public function __inject( - CmsIndex $cmsIndex, - CatalogProductView $catalogProductView, - CustomerAccountLogin $customerAccountLogin - ) { - $this->cmsIndex = $cmsIndex; - $this->catalogProductView = $catalogProductView; - $this->customerAccountLogin = $customerAccountLogin; - } - - /** - * Login customer. - * - * @return void - */ - protected function loginCustomer() - { - $this->objectManager->create( - 'Mage\Customer\Test\TestStep\LoginCustomerOnFrontendStep', - ['customer' => $this->customer] - )->run(); - } - - /** - * Create products. - * - * @param string $products - * @return array - */ - protected function createProducts($products) - { - $products = $this->objectManager->create( - 'Mage\Catalog\Test\TestStep\CreateProductsStep', - ['products' => $products] - )->run(); - - return $products['products']; - } - - /** - * Add product to compare list. - * - * @param InjectableFixture $product - * @return void - */ - protected function addProduct(InjectableFixture $product) - { - $this->browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - $this->catalogProductView->getViewBlock()->clickAddToCompare(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AbstractPromoteAppurtenantProductsEntityTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AbstractPromoteAppurtenantProductsEntityTest.php deleted file mode 100644 index ca8788ba5f1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AbstractPromoteAppurtenantProductsEntityTest.php +++ /dev/null @@ -1,177 +0,0 @@ -fixtureFactory = $fixtureFactory; - } - - /** - * Injection pages. - * - * @param CatalogProduct $productGrid - * @param CatalogProductEdit $editProductPage - * @return void - */ - public function __inject(CatalogProduct $productGrid, CatalogProductEdit $editProductPage) - { - $this->productGrid = $productGrid; - $this->editProductPage = $editProductPage; - } - - /** - * Run test promote cross sell products entity. - * - * @param string $products - * @param array $appurtenantProductsData - * @return array - */ - public function test($products, array $appurtenantProductsData) - { - $editProduct = null; - $productsDataResult = []; - $createdProducts = $this->objectManager->create( - 'Mage\Catalog\Test\TestStep\CreateProductsStep', - ['products' => $products] - )->run()['products']; - foreach ($appurtenantProductsData as $productData) { - $appurtenant = $this->prepareAppurtenantProducts($createdProducts, $productData, $this->appurtenantType); - $editProduct = $createdProducts[$productData['productIndex']]; - if ($appurtenant !== false) { - $this->addAppurtenantProducts($editProduct, $appurtenant); - $productsDataResult[] = ['product' => $editProduct, $this->appurtenantType['arrayIndex'] => $appurtenant]; - } else { - $productsDataResult[] = ['product' => $editProduct]; - } - } - - return ['productsData' => $productsDataResult]; - } - - /** - * Get appurtenant products. - * - * @param array $createdProducts - * @param string $appurtenantProductsIndex - * @return array|bool - */ - protected function prepareAppurtenantProducts( - array $createdProducts, - $appurtenantProductsIndex - ) { - if (isset($appurtenantProductsIndex[$this->appurtenantType['arrayIndex']])) { - $appurtenantIndex = explode(',', $appurtenantProductsIndex[$this->appurtenantType['arrayIndex']]); - $result = []; - foreach ($appurtenantIndex as $index) { - $result[$this->appurtenantType['formIndex']]['value'][] = $createdProducts[$index]; - } - return $result; - } else { - return false; - } - } - - /** - * Add appurtenant products and save product. - * - * @param InjectableFixture $product - * @param array $appurtenantData - * @return void - */ - protected function addAppurtenantProducts( - InjectableFixture $product, - array $appurtenantData - ) { - $this->productGrid->open(); - $this->productGrid->getProductGrid()->searchAndOpen(['sku' => $product->getSku()]); - $form = $this->editProductPage->getProductForm(); - $form->openTab($this->tabName); - $appurtenantTab = $form->getTabElement($this->tabName); - $appurtenantData[$this->appurtenantType['formIndex']]['value'] = $this->prepareData( - $appurtenantData[$this->appurtenantType['formIndex']]['value'] - ); - $appurtenantTab->fillFormTab($appurtenantData); - $this->editProductPage->getFormPageActions()->save(); - } - - /** - * Prepare data. - * - * @param array $appurtenantProducts - * @return array - */ - protected function prepareData(array $appurtenantProducts) - { - $data = []; - foreach ($appurtenantProducts as $product) { - $data[] = $product->getData(); - } - return $data; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddCrossSellProductsEntityTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddCrossSellProductsEntityTest.php deleted file mode 100644 index 8268693a4d1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddCrossSellProductsEntityTest.php +++ /dev/null @@ -1,52 +0,0 @@ - Catalog. - * 3. Click Add new product. - * 4. Fill data from dataset. - * 5. Save product. - * 6. Perform all assertions. - * - * @group Cross-sells_(MX) - * @ZephyrId MPERF-6832 - */ -class AddCrossSellProductsEntityTest extends AbstractAddAppurtenantProductsEntityTest -{ - /** - * Run test add cross sell products entity. - * - * @param string $productData - * @param string $crossSellProductsData - * @return array - */ - public function test($productData, $crossSellProductsData) - { - $product = $this->getProductByData($productData, ['cross_sell_products' => $crossSellProductsData]); - $this->createAndSaveProduct($product); - - return [ - 'product' => $product, - 'crossSellProducts' => $product->getDataFieldConfig('cross_sell_products')['source']->getProducts() - ]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddCrossSellProductsEntityTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddCrossSellProductsEntityTest.xml deleted file mode 100644 index 40a47ced56d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddCrossSellProductsEntityTest.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - catalogProductSimple::default - catalogProductSimple::default, catalogProductSimple::default - - - - - - - catalogProductSimple::default - catalogProductSimple::default, configurableProduct::default - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddProductsToCompareTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddProductsToCompareTest.php deleted file mode 100644 index d43dc80e098..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddProductsToCompareTest.php +++ /dev/null @@ -1,89 +0,0 @@ -catalogProductCompare = $catalogProductCompare; - $this->cmsIndex->open(); - if ($isCustomerLoggedIn === 'Yes') { - $this->loginCustomer($this->customer); - } - $this->products = $this->createProducts($products); - foreach ($this->products as $itemProduct) { - $this->addProduct($itemProduct); - $this->assertProductCompareSuccessAddMessage->processAssert($this->catalogProductView, $itemProduct); - } - - return ['products' => $this->products]; - } - - /** - * Clear compare list after test variation. - * - * @return void - */ - public function tearDown() - { - $this->cmsIndex->open(); - $this->cmsIndex->getCompareBlock()->clickClearAll(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddProductsToCompareTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddProductsToCompareTest.xml deleted file mode 100644 index d4018df4774..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddProductsToCompareTest.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - catalogProductSimple::simple_for_composite_products - No - - - - - - catalogProductSimple::simple_for_composite_products,bundleProduct::bundle_dynamic_product - No - - - - - - configurableProduct::default - Yes - - - - - - catalogProductSimple::simple_for_composite_products,catalogProductVirtual::order_default,downloadableProduct::default,groupedProduct::grouped_product_with_price,configurableProduct::default,bundleProduct::bundle_dynamic_product,bundleProduct::bundle_fixed_product - Yes - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddRelatedProductsEntityTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddRelatedProductsEntityTest.php deleted file mode 100644 index b7388e08eff..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddRelatedProductsEntityTest.php +++ /dev/null @@ -1,53 +0,0 @@ - Catalog. - * 3. Press "Add product" button. - * 4. Fill data according to dataset. - * 5. Save product. - * 6. Perform all assertions. - * - * @group Related_Products_(MX) - * @ZephyrId MPERF-6822 - */ -class AddRelatedProductsEntityTest extends AbstractAddAppurtenantProductsEntityTest -{ - /** - * Run test add related products. - * - * @param string $productData - * @param string $relatedProductsData - * @return array - */ - public function test($productData, $relatedProductsData) - { - $product = $this->getProductByData($productData, ['related_products' => $relatedProductsData]); - $this->createAndSaveProduct($product); - - return [ - 'product' => $product, - 'relatedProducts' => $product->getDataFieldConfig('related_products')['source']->getProducts() - ]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddRelatedProductsEntityTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddRelatedProductsEntityTest.xml deleted file mode 100644 index 4eab70970e5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddRelatedProductsEntityTest.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - catalogProductSimple::default - catalogProductSimple::default, catalogProductSimple::default - - - - - - - catalogProductSimple::default - catalogProductSimple::default, configurableProduct::default - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddUpSellProductsEntityTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddUpSellProductsEntityTest.php deleted file mode 100644 index f036a98fe51..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddUpSellProductsEntityTest.php +++ /dev/null @@ -1,53 +0,0 @@ - Catalog. - * 3. Press "Add product" button. - * 4. Fill data according to dataset. - * 5. Save product. - * 6. Perform all assertions. - * - * @group Up-sells_(MX) - * @ZephyrId MPERF-6834 - */ -class AddUpSellProductsEntityTest extends AbstractAddAppurtenantProductsEntityTest -{ - /** - * Run test add up sell products. - * - * @param string $productData - * @param string $upSellProductsData - * @return array - */ - public function test($productData, $upSellProductsData) - { - $product = $this->getProductByData($productData, ['up_sell_products' => $upSellProductsData]); - $this->createAndSaveProduct($product); - - return [ - 'product' => $product, - 'upSellProducts' => $product->getDataFieldConfig('up_sell_products')['source']->getProducts() - ]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddUpSellProductsEntityTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddUpSellProductsEntityTest.xml deleted file mode 100644 index 5b63e721632..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddUpSellProductsEntityTest.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - catalogProductSimple::default - catalogProductSimple::default, catalogProductSimple::default - - - - - - - catalogProductSimple::default - catalogProductSimple::default, configurableProduct::default - - - - - - - configurableProduct::default - catalogProductSimple::default, configurableProduct::default - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/ApplyMapTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/ApplyMapTest.php deleted file mode 100644 index e455552d59e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/ApplyMapTest.php +++ /dev/null @@ -1,108 +0,0 @@ -createByCode('catalogCategory', ['dataset' => 'default_subcategory']); - $category->persist(); - - return ['category' => $category]; - } - - /** - * Run Apply MAP test. - * - * @param CatalogCategory $category - * @param string $products - * @param string $configData - * @return array - */ - public function test(CatalogCategory $category, $products, $configData) - { - // Preconditions: - // Creating products: - $products = $this->objectManager->create('Mage\Catalog\Test\TestStep\CreateProductsStep', - [ - 'products' => $products, - 'data' => $this->prepareProductData($category, $products) - ] - )->run()['products']; - - // Setup configuration: - $this->objectManager->create('Mage\Core\Test\TestStep\SetupConfigurationStep',['configData' => $configData]) - ->run(); - - return ['products' => $products, 'category' => $category]; - } - - /** - * Prepare products data for persist. - * - * @param CatalogCategory $category - * @param $products - * @return array - */ - protected function prepareProductData(CatalogCategory $category, $products) - { - $data = []; - $productsCount = count(explode(',', $products)); - while ($productsCount > 0) { - $data[] = ['category_ids' => ['category' => $category]]; - $productsCount--; - } - - return $data; - } - - /** - * Rollback configuration after test variation. - * - * @return void - */ - public function tearDown() - { - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => $this->currentVariation['arguments']['configData'], 'rollback' => true] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/ApplyMapTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/ApplyMapTest.xml deleted file mode 100644 index 6be4fb7b57f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/ApplyMapTest.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - Apply MAP on gesture in config. Products use config. - catalogProductSimple::product_with_map_use_config - enable_map_on_gesture - - - - Apply MAP in cart in config. Products use config. - catalogProductSimple::product_with_map_use_config - enable_map_in_cart - - - - Apply MAP before order in config. Products use config. - catalogProductSimple::product_with_map_use_config - default_frontend - customer_US - enable_map_before_order - - - - Apply MAP on gesture in config. Products use MAP in cart. - catalogProductSimple::product_with_map_in_cart - enable_map_on_gesture - - - - Apply MAP on gesture in config. Products use config. - catalogProductSimple::product_with_map_use_config, configurableProduct::default_with_map_use_config - enable_map_on_gesture - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/ClearAllCompareProductsTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/ClearAllCompareProductsTest.php deleted file mode 100644 index 0f086743a50..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/ClearAllCompareProductsTest.php +++ /dev/null @@ -1,63 +0,0 @@ -persist(); - $this->products = $this->createProducts($products); - - //Steps - $this->cmsIndex->open(); - $this->loginCustomer($this->customer); - foreach ($this->products as $itemProduct) { - $this->addProduct($itemProduct); - $this->assertProductCompareSuccessAddMessage->processAssert($this->catalogProductView, $itemProduct); - } - $this->cmsIndex->getTopLinksBlock()->openAccount(); - $this->cmsIndex->getLinksBlock()->openLink("My Account"); - $customerAccountIndex->getCompareBlock()->clickClearAll(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/ClearAllCompareProductsTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/ClearAllCompareProductsTest.xml deleted file mode 100644 index da55c20ba28..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/ClearAllCompareProductsTest.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - compare_products - catalogProductSimple::simple_for_composite_products,catalogProductVirtual::order_default,downloadableProduct::default,groupedProduct::grouped_product_with_price,configurableProduct::default,bundleProduct::bundle_dynamic_product,bundleProduct::bundle_fixed_product - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateConfigurableProductEntityTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateConfigurableProductEntityTest.php deleted file mode 100644 index cf8d39780b5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateConfigurableProductEntityTest.php +++ /dev/null @@ -1,101 +0,0 @@ - Manage Products. - * 3. Click "Add Product". - * 4. Select Configurable Product and Attribute set. - * 5. Select attribute. - * 6. Fill in data according to data sets. - * 7. Save product. - * 8. Perform all assertions. - * - * @group Configurable_Product_(MX) - * @ZephyrId MPERF-6685 - */ -class CreateConfigurableProductEntityTest extends Injectable -{ - /** - * Product page with a grid. - * - * @var CatalogProduct - */ - protected $productIndex; - - /** - * Page to create a product. - * - * @var CatalogProductNew - */ - protected $productNew; - - /** - * Prepare data. - * - * @param CatalogCategory $category - * @return array - */ - public function __prepare(CatalogCategory $category) - { - $category->persist(); - - return ['category' => $category]; - } - - /** - * Injection pages. - * - * @param CatalogProduct $productIndex - * @param CatalogProductNew $productNew - * @return void - */ - public function __inject(CatalogProduct $productIndex, CatalogProductNew $productNew) - { - $this->productIndex = $productIndex; - $this->productNew = $productNew; - } - - /** - * Test create catalog Configurable product run. - * - * @param ConfigurableProduct $product - * @param CatalogCategory $category - * @return array - */ - public function test(ConfigurableProduct $product, CatalogCategory $category) - { - // Steps - $this->productIndex->open(); - $this->productIndex->getGridPageActionBlock()->addNew(); - $this->productNew->getProductForm()->fill($product, null, $category); - $this->productNew->getFormPageActions()->save(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateConfigurableProductEntityTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateConfigurableProductEntityTest.xml deleted file mode 100644 index 729204b37f4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateConfigurableProductEntityTest.xml +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - Create Simplified configurable product - default - Enabled - Configurable Product %isolation% - configurable_sku_%isolation% - configurable-product-%isolation% - Taxable Goods - 100 - Default configurable product - Simplified configurable product - 2 - In Stock - default - main:ce - - - - - - - - Create configurable product with special price - default - 52 - 104 - Enabled - Configurable Product %isolation% - configurable_sku_%isolation% - configurable-product-%isolation% - Taxable Goods - 101 - Configurable product with special price - Configurable product with special price - 3 - In Stock - default - 10 - - - - - - - - Create configurable product with group price - default - 148 - 296 - Enabled - Configurable Product %isolation% - configurable_sku_%isolation% - configurable-product-%isolation% - Taxable Goods - 102 - Configurable product with group price - Configurable product with group price - 4 - In Stock - default - for_not_logged_users - - - - - - - - Create configurable product with tier price - default - 58 - 232 - 4 - Enabled - Configurable Product %isolation% - configurable_sku_%isolation% - configurable-product-%isolation% - Taxable Goods - 103 - Configurable product with tier price - Configurable product with tier price - 5 - In Stock - default - for_all_groups - with_tier_price - - - - - - - - Create configurable product with custom options - with_custom_options - Enabled - Configurable Product %isolation% - configurable_sku_%isolation% - configurable-product-%isolation% - Taxable Goods - 104 - Configurable product with custom options - Configurable product with custom options - 6 - In Stock - default - drop_down_with_two_options - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateGroupedProductEntityTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateGroupedProductEntityTest.php deleted file mode 100644 index 5511b0a89ae..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateGroupedProductEntityTest.php +++ /dev/null @@ -1,102 +0,0 @@ - Manage Products. - * 3. Click "Add Product" button. - * 4. Select "Grouped Product" in product type field and click "Continue". - * 5. Fill in data according to attached data set. - * 6. Save Product. - * 7. Perform all assertions. - * - * @group Products_(CS) - * @ZephyrId MPERF-6919 - */ -class CreateGroupedProductEntityTest extends Injectable -{ - /** - * Category fixture. - * - * @var CatalogCategory - */ - protected $category; - - /** - * Product page with a grid. - * - * @var CatalogProduct - */ - protected $productGrid; - - /** - * Page to create a product. - * - * @var CatalogProductNew - */ - protected $newProductPage; - - /** - * Create category. - * - * @param CatalogCategory $category - * @return array - */ - public function __prepare(CatalogCategory $category) - { - $category->persist(); - - return ['category' => $category]; - } - - /** - * Injection pages. - * - * @param CatalogProduct $productGrid - * @param CatalogProductNew $newProductPage - * @return void - */ - public function __inject(CatalogProduct $productGrid, CatalogProductNew $newProductPage) - { - $this->productGrid = $productGrid; - $this->newProductPage = $newProductPage; - } - - /** - * Test create grouped product. - * - * @param GroupedProduct $product - * @param CatalogCategory $category - * @return void - */ - public function test(GroupedProduct $product, CatalogCategory $category) - { - //Steps - $this->productGrid->open(); - $this->productGrid->getGridPageActionBlock()->addNew(); - $this->newProductPage->getProductForm()->fill($product, null, $category); - $this->newProductPage->getFormPageActions()->save(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateGroupedProductEntityTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateGroupedProductEntityTest.xml deleted file mode 100644 index 9febe32d05f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateGroupedProductEntityTest.xml +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - Create default grouped product with assigned simple products - GroupedProduct %isolation% - GroupedProduct_sku%isolation% - grouped-product%isolation% - Enabled - - - In Stock - This is description for grouped product - defaultSimpleProducts - This is short description for grouped product - main:ce - - - - - - Create out of stock grouped product - GroupedProduct %isolation% - GroupedProduct_sku%isolation% - grouped-product%isolation% - Enabled - - - Out of Stock - This is description for grouped product - defaultSimpleProducts - This is short description for grouped product - - - - Create grouped product with assigned product special price) - GroupedProduct %isolation% - GroupedProduct_sku%isolation% - grouped-product%isolation% - Enabled - - - In Stock - This is description for grouped product - defaultSimpleProduct_with_specialPrice - This is short description for grouped product - - - - - - Create grouped product with assigned product group price) - GroupedProduct %isolation% - GroupedProduct_sku%isolation% - grouped-product%isolation% - Enabled - - - In Stock - This is description for grouped product - defaultSimpleProduct_with_groupPrice - This is short description for grouped product - - - - - - Create default grouped product with assigned virtual products - GroupedProduct %isolation% - GroupedProduct_sku%isolation% - grouped-product%isolation% - Enabled - - - In Stock - This is description for grouped product - defaultVirtualProducts - This is short description for grouped product - - - - - Create grouped product with assigned product (tier price) - GroupedProduct %isolation% - GroupedProduct_sku%isolation% - grouped-product%isolation% - Enabled - - - In Stock - This is description for grouped product - defaultSimpleProduct_with_tierPrice - This is short description for grouped product - - - - - - Create grouped product visible in catalog only - GroupedProduct %isolation% - GroupedProduct_sku%isolation% - grouped-product%isolation% - Enabled - Catalog - In Stock - This is description for grouped product - defaultSimpleProducts - This is short description for grouped product - - - - - - Create grouped product visible in search only - GroupedProduct %isolation% - GroupedProduct_sku%isolation% - grouped-product%isolation% - Enabled - Search - In Stock - This is description for grouped product - defaultSimpleProducts - This is short description for grouped product - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.php deleted file mode 100644 index 10fa8aff6b4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.php +++ /dev/null @@ -1,117 +0,0 @@ - Manage Products. - * 3. Click "Add Product". - * 4. Select "Simple Product" in product type field and click "Continue". - * 5. Fill in data according to attached data set. - * 6. Save Product. - * 7. Perform appropriate assertions. - * - * @group Products_(CS) - * @ZephyrId MPERF-6559 - */ -class CreateSimpleProductEntityTest extends Injectable -{ - /** - * Product page with a grid. - * - * @var CatalogProduct - */ - protected $productGrid; - - /** - * Page to create a product. - * - * @var CatalogProductNew - */ - protected $newProductPage; - - /** - * Prepare data. - * - * @param CatalogCategory $category - * @return array - */ - public function __prepare(CatalogCategory $category) - { - $category->persist(); - - return ['category' => $category]; - } - - /** - * Injection data. - * - * @param CatalogProduct $productGrid - * @param CatalogProductNew $newProductPage - * @return void - */ - public function __inject(CatalogProduct $productGrid, CatalogProductNew $newProductPage) - { - $this->productGrid = $productGrid; - $this->newProductPage = $newProductPage; - } - - /** - * Run create product simple entity test. - * - * @param CatalogProductSimple $product - * @param CatalogCategory $category - * @param string $configData - * @return void - */ - public function test(CatalogProductSimple $product, CatalogCategory $category, $configData) - { - // Preconditions - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => $configData] - )->run(); - - // Steps - $this->productGrid->open(); - $this->productGrid->getGridPageActionBlock()->addNew(); - $this->newProductPage->getProductForm()->fill($product, null, $category); - $this->newProductPage->getFormPageActions()->save(); - } - - /** - * Disable enabled config after test. - * - * @return void - */ - public function tearDown() - { - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => $this->currentVariation['arguments']['configData'], 'rollback' => true] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.xml deleted file mode 100644 index e8aa851ad0a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.xml +++ /dev/null @@ -1,289 +0,0 @@ - - - - - - Create Simple default product - Simple Product %isolation% - simple_sku_%isolation% - simple-sku-%isolation% - Taxable Goods - 10000 - - - Enabled - Short description for Default Simple product - Description for Default Simple product - 50 - 657 - In Stock - Catalog, Search - - - main:ce - - - - - - - - - - Create Simple product with Tier price - Simple Product %isolation% - simple_sku_%isolation% - simple-sku-%isolation% - Taxable Goods - 300 - - - Enabled - Short description for Simple Product with Tier price - Description for Simple Product with Tier price - 51 - 658 - In Stock - with_tier_price - with_tier_price - for_all_groups - - - - - - - - - - - - Create Simple product with Special price - Simple Product %isolation% - simple_sku_%isolation% - simple-sku-%isolation% - Taxable Goods - 10001 - 90 - Enabled - Short description for Simple Product with Special price - Description for Simple Product with Special price - 51 - 658 - In Stock - with_special_price - with_special_price - - - - - - - - - - - - Create Simple product with Group price - Simple Product %isolation% - simple_sku_%isolation% - simple-sku-%isolation% - Taxable Goods - 10002 - - - Enabled - Short description for Simple Product with Group price - Description for Simple Product with Group price - 52 - 659 - In Stock - with_group_price - with_group_price - for_not_logged_users - - - - - - - - - - - - - - Create Out of Stock Simple product - Simple Product %isolation% - simple_sku_%isolation% - simple-sku-%isolation% - Taxable Goods - 10003 - - - Enabled - Short description for Out of Stock Simple Product - Description for Out of Stock Simple Product - 53 - - - Out of Stock - - - - - - - - - - - - Create Simple product with Custom options - Simple Product %isolation% - simple_sku_%isolation% - simple-sku-%isolation% - Taxable Goods - 10004 - Enabled - Short description for Simple Product with Custom options - Description for Simple Product with Custom options - 54 - 661 - In Stock - drop_down_with_two_options - with_one_custom_option - - - - - - - - - - - Create Simple product visibility in Catalog only - Simple Product %isolation% - simple_sku_%isolation% - simple-sku-%isolation% - Taxable Goods - 10004 - Enabled - Short description for Simple Product visibility in Catalog only - Description for Simple Product visibility in Catalog only - 54 - 661 - In Stock - Catalog - - - - - - - - - - Create Simple product visibility in Search only - Simple Product %isolation% - simple_sku_%isolation% - simple-sku-%isolation% - Taxable Goods - 10004 - Enabled - Short description for Simple Product visibility in Search only - Description for Simple Product visibility in Search only - 54 - 661 - In Stock - Search - - - - - - - - - - Create Simple product with Tier price and Custom options - Simple Product %isolation% - simple_sku_%isolation% - simple-sku-%isolation% - Taxable Goods - 300 - Enabled - Short description for Simple Product with Tier price and Custom options - Description for Simple Product with Tier price and Custom options - 51 - 658 - In Stock - drop_down_with_two_options - with_tier_price - for_all_groups - - - - - - - Create Simple product with Special price larger than actual - Simple Product %isolation% - simple_sku_%isolation% - simple-sku-%isolation% - Taxable Goods - 101 - 102 - Enabled - Short description for Simple Product with Special price - Description for Simple Product with Special price - 51 - 658 - In Stock - - - - - - Create out of stock Simple product - Simple Product %isolation% - simple_sku_%isolation% - simple-sku-%isolation% - Taxable Goods - 10000 - Enabled - Short description for out of stock Simple product - Description for out of stock Simple product - 50 - 657 - Out of Stock - Catalog, Search - - - - - - - - - - - Create Out of Stock Simple product - Simple Product %isolation% - simple_sku_%isolation% - simple-sku-%isolation% - Taxable Goods - 10003 - Enabled - Short description for Out of Stock Simple Product - Description for Out of Stock Simple Product - 53 - - - Out of Stock - display_out_of_stock_products - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateVirtualProductEntityTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateVirtualProductEntityTest.php deleted file mode 100644 index 3de9e53aeb1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateVirtualProductEntityTest.php +++ /dev/null @@ -1,96 +0,0 @@ - Manage Products. - * 3. Click "Add Product". - * 4. Select "Virtual Product" in product type field and click "Continue". - * 5. Fill in data according to attached data set. - * 6. Save Product. - * 7. Perform appropriate assertions. - * - * @group Virtual_Product_(CS) - * @ZephyrId MPERF-6740 - */ -class CreateVirtualProductEntityTest extends Injectable -{ - /** - * Product page with a grid. - * - * @var CatalogProduct - */ - protected $productGrid; - - /** - * Page to create a product. - * - * @var CatalogProductNew - */ - protected $newProductPage; - - /** - * Prepare data. - * - * @param CatalogCategory $category - * @return array - */ - public function __prepare(CatalogCategory $category) - { - $category->persist(); - - return ['category' => $category]; - } - - /** - * Injection pages. - * - * @param CatalogProduct $productGrid - * @param CatalogProductNew $newProductPage - * @return void - */ - public function __inject(CatalogProduct $productGrid, CatalogProductNew $newProductPage) - { - $this->productGrid = $productGrid; - $this->newProductPage = $newProductPage; - } - - /** - * Run create product virtual entity test. - * - * @param CatalogProductVirtual $product - * @param CatalogCategory $category - * @return void - */ - public function test(CatalogProductVirtual $product, CatalogCategory $category) - { - // Steps - $this->productGrid->open(); - $this->productGrid->getGridPageActionBlock()->addNew(); - $this->newProductPage->getProductForm()->fill($product, null, $category); - $this->newProductPage->getFormPageActions()->save(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateVirtualProductEntityTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateVirtualProductEntityTest.xml deleted file mode 100644 index f771f21f693..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateVirtualProductEntityTest.xml +++ /dev/null @@ -1,202 +0,0 @@ - - - - - - Create default virtual product - VirtualProduct %isolation% - virtual_sku_%isolation% - virtual-sku-%isolation% - Enabled - Description for Default virtual product - Short description for Default virtual product - 10 - - - Taxable Goods - - - - - - - - - - - 12 - In Stock - - - - - default - main:ce - - - - - - - Create virtual product with none tax class - VirtualProduct %isolation% - virtual_sku_%isolation% - virtual-sku-%isolation% - Enabled - Description for virtual product with none tax class - Short description for virtual product with none tax class - 10 - - - None - - - - - - - No - Yes - 999 - In Stock - - - Catalog, Search - - - - - - - - - Create out of stock virtual product - VirtualProduct %isolation% - virtual_sku_%isolation% - virtual-sku-%isolation% - Enabled - Description for out of stock virtual product - Short description for out of stock virtual product - 10 - default - Taxable Goods - - - - - - - - - - - 999 - Out of Stock - - - Search - - - - - - - - Create virtual product with grouped price - VirtualProduct %isolation% - virtual_sku_%isolation% - virtual-sku-%isolation% - Enabled - Description for virtual product with grouped price - Short description for virtual product with grouped price - 100 - - - Taxable Goods - for_not_logged_users - - - - - - - - - 123 - In Stock - - - Catalog - with_grouped_price - - - - - - - - Create virtual product with custom options - VirtualProduct %isolation% - virtual_sku_%isolation% - virtual-sku-%isolation% - Enabled - Description for virtual product with custom options - Short description for virtual product with custom options - 90.00 - - - Taxable Goods - - - - - - - - - - - 123 - In Stock - drop_down_with_two_options - - - with_one_custom_option - - - - - - - - Create virtual product with special perice - VirtualProduct %isolation% - virtual_sku_%isolation% - virtual-sku-%isolation% - Enabled - Description for virtual product with special perice - Short description for virtual product with special perice - 1000 - default - Taxable Goods - - - - - 10 - No - No - - - - - with_special_price - - - - - - - Create virtual product with tier perice - VirtualProduct %isolation% - virtual_sku_%isolation% - virtual-sku-%isolation% - Enabled - Description for virtual product with tier perice - Short description for virtual product with tier perice - 100 - with_tier_price - Taxable Goods - - - for_all_groups - - - - - - - 999 - In Stock - - - - - with_tier_price - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/DeleteProductEntityTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/DeleteProductEntityTest.php deleted file mode 100644 index 53ee7c08576..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/DeleteProductEntityTest.php +++ /dev/null @@ -1,125 +0,0 @@ - Manege Products. - * 3. Select products created in preconditions. - * 4. Select delete from mass-action. - * 5. Submit form. - * 6. Perform all asserts. - * - * @group Products_(MX) - * @ZephyrId MPERF-7327 - */ -class DeleteProductEntityTest extends Injectable -{ - /** - * Product page with a grid. - * - * @var CatalogProduct - */ - protected $catalogProductIndex; - - /** - * Category fixture. - * - * @var CatalogCategory - */ - protected $category; - - /** - * Prepare data. - * - * @param CatalogCategory $category - * @return array - */ - public function __prepare(CatalogCategory $category) - { - $category->persist(); - $this->category = $category; - - return ['category' => $category]; - } - - /** - * Injection data. - * - * @param CatalogProduct $catalogProductIndexPage - * @return void - */ - public function __inject(CatalogProduct $catalogProductIndexPage) - { - $this->catalogProductIndex = $catalogProductIndexPage; - } - - /** - * Run delete product test. - * - * @param string $products - * @return array - */ - public function test($products) - { - //Preconditions - $products = $this->createProducts($products); - $deleteProducts = $this->prepareFilter($products); - //Steps - $this->catalogProductIndex->open(); - $this->catalogProductIndex->getProductGrid()->massaction($deleteProducts, 'Delete', true); - - return ['products' => $products]; - } - - /** - * Create products. - * - * @param string $products - * @return array - */ - protected function createProducts($products) - { - return $this->objectManager->create( - 'Mage\Catalog\Test\TestStep\CreateProductsStep', - ['products' => $products, 'data' => ['category_ids' => ['category' => $this->category]]] - )->run()['products']; - } - - /** - * Prepare filter. - * - * @param array $products - * @return array - */ - protected function prepareFilter(array $products) - { - $deleteProducts = []; - foreach ($products as $product) { - $deleteProducts[] = ['sku' => $product->getSku()]; - } - - return $deleteProducts; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/DeleteProductEntityTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/DeleteProductEntityTest.xml deleted file mode 100644 index 5d4c6c4ca4b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/DeleteProductEntityTest.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - catalogProductSimple::default - main:ce - - - - - - catalogProductVirtual::order_default - - - - - - configurableProduct::default - - - - - - groupedProduct::default - - - - - - catalogProductSimple::default,catalogProductVirtual::order_default - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/DuplicateProductEntityTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/DuplicateProductEntityTest.php deleted file mode 100644 index 0ac0eaf473b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/DuplicateProductEntityTest.php +++ /dev/null @@ -1,134 +0,0 @@ - Manage Products. - * 3. Search and open product. - * 4. Click "Duplicate". - * 5. Perform asserts. - * - * @group Products_(MX) - * @ZephyrId MPERF-7489 - */ -class DuplicateProductEntityTest extends Injectable -{ - /** - * Category fixture. - * - * @var CatalogCategory - */ - protected $category; - - /** - * Product page with a grid. - * - * @var CatalogProduct - */ - protected $productGrid; - - /** - * Page to update a product. - * - * @var CatalogProductEdit - */ - protected $editProductPage; - - /** - * Fixture factory. - * - * @var FixtureFactory - */ - protected $fixtureFactory; - - /** - * Prepare data. - * - * @param CatalogCategory $category - * @param CatalogProduct $productGrid - * @param CatalogProductEdit $editProductPage - * @param FixtureFactory $fixtureFactory - * @return void - */ - public function __prepare( - CatalogCategory $category, - CatalogProduct $productGrid, - CatalogProductEdit $editProductPage, - FixtureFactory $fixtureFactory - ) { - $this->category = $category; - $this->category->persist(); - $this->productGrid = $productGrid; - $this->editProductPage = $editProductPage; - $this->fixtureFactory = $fixtureFactory; - } - - /** - * Run test duplicate product entity. - * - * @param string $productType - * @return array - */ - public function test($productType) - { - // Precondition - $product = $this->createProduct($productType); - - // Steps - $this->productGrid->open(); - $this->productGrid->getProductGrid()->searchAndOpen(['sku' => $product->getSku()]); - $this->editProductPage->getFormPageActions()->duplicate(); - - return ['product' => $product]; - } - - /** - * Creating a product according to the type of. - * - * @param string $productType - * @return InjectableFixture - */ - protected function createProduct($productType) - { - list($fixture, $dataset) = explode('::', $productType); - $product = $this->fixtureFactory->createByCode( - $fixture, - [ - 'dataset' => $dataset, - 'data' => [ - 'category_ids' => [ - 'category' => $this->category, - ], - ] - ] - ); - $product->persist(); - - return $product; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/DuplicateProductEntityTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/DuplicateProductEntityTest.xml deleted file mode 100644 index 6055aa77eb0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/DuplicateProductEntityTest.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - catalogProductSimple::default - main:ce - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/PromoteProductsAsCrossSellsTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/PromoteProductsAsCrossSellsTest.php deleted file mode 100644 index 96771f1e5d2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/PromoteProductsAsCrossSellsTest.php +++ /dev/null @@ -1,66 +0,0 @@ - Manage Products. - * 3. Open config1 product. - * 4. For config1 add as cross-sells: simp1, simp2. - * 5. Save product. - * 6. Open simp1 product. - * 7. For simp1 add as cross-sells: config1, simp2. - * 8. Save product. - * 9. Perform all assertions. - * - * @group Cross-sells_(MX) - * @ZephyrId MPERF-7447 - */ -class PromoteProductsAsCrossSellsTest extends AbstractPromoteAppurtenantProductsEntityTest -{ - /** - * Tab name. - * - * @var string - */ - protected $tabName = 'crosssells'; - - /** - * Appurtenant type. - * - * @var array - */ - protected $appurtenantType = [ - 'arrayIndex' => 'crossSellProducts', - 'formIndex' => 'cross_sell_products' - ]; - - /** - * Run test promote cross sell products entity. - * - * @param string $crossSellProducts - * @param array $crossSellProductsData - * @return array - */ - public function test($crossSellProducts, array $crossSellProductsData) - { - return parent::test($crossSellProducts, $crossSellProductsData); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/PromoteProductsAsCrossSellsTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/PromoteProductsAsCrossSellsTest.xml deleted file mode 100644 index 32353c12372..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/PromoteProductsAsCrossSellsTest.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - 0 - 1,2 - - - 1 - 0,2 - - - 2 - - - catalogProductSimple::default, configurableProduct::default, catalogProductSimple::default - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/PromoteProductsAsRelatedTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/PromoteProductsAsRelatedTest.php deleted file mode 100644 index 35750759f9e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/PromoteProductsAsRelatedTest.php +++ /dev/null @@ -1,66 +0,0 @@ - Manage Products. - * 3. Open simp1 product. - * 4. For simp1 add as related: config1, simp2. - * 5. Save product. - * 6. Open config1 product. - * 7. For config1 add as related: simp2. - * 8. Save product. - * 9. Perform all assertions. - * - * @group Up-sells_(MX) - * @ZephyrId MPERF-7469 - */ -class PromoteProductsAsRelatedTest extends AbstractPromoteAppurtenantProductsEntityTest -{ - /** - * Tab name. - * - * @var string - */ - protected $tabName = 'related-products'; - - /** - * Appurtenant type. - * - * @var array - */ - protected $appurtenantType = [ - 'arrayIndex' => 'relatedProducts', - 'formIndex' => 'related_products' - ]; - - /** - * Run test promote related products entity. - * - * @param string $relatedProducts - * @param array $relatedProductsData - * @return array - */ - public function test($relatedProducts, array $relatedProductsData) - { - return parent::test($relatedProducts, $relatedProductsData); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/PromoteProductsAsRelatedTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/PromoteProductsAsRelatedTest.xml deleted file mode 100644 index 582ba85e2a8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/PromoteProductsAsRelatedTest.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - 0 - 1,2 - - - 1 - 2 - - - 2 - - - catalogProductSimple::default, configurableProduct::default, catalogProductSimple::default - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/PromoteProductsAsUpSellsTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/PromoteProductsAsUpSellsTest.php deleted file mode 100644 index 8120fe565d3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/PromoteProductsAsUpSellsTest.php +++ /dev/null @@ -1,66 +0,0 @@ - Manage Products. - * 3. Open simp1 product. - * 4. For simp1 add as up-sells: config1, simp2. - * 5. Save product. - * 6. Open config1 product. - * 7. For config1 add as up-sells: simp2. - * 8. Save product. - * 9. Perform all assertions. - * - * @group Up-sells_(MX) - * @ZephyrId MPERF-7458 - */ -class PromoteProductsAsUpSellsTest extends AbstractPromoteAppurtenantProductsEntityTest -{ - /** - * Tab name. - * - * @var string - */ - protected $tabName = 'up-sells'; - - /** - * Appurtenant type. - * - * @var array - */ - protected $appurtenantType = [ - 'arrayIndex' => 'upSellProducts', - 'formIndex' => 'up_sell_products' - ]; - - /** - * Run test promote upSell products entity. - * - * @param string $upSellProducts - * @param array $upSellProductsData - * @return array - */ - public function test($upSellProducts, array $upSellProductsData) - { - return parent::test($upSellProducts, $upSellProductsData); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/PromoteProductsAsUpSellsTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/PromoteProductsAsUpSellsTest.xml deleted file mode 100644 index 68efbedf511..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/PromoteProductsAsUpSellsTest.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - 0 - 1,2 - - - 1 - 2 - - - 2 - - - catalogProductSimple::default, configurableProduct::default, catalogProductSimple::default - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/UpdateConfigurableProductEntityTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/UpdateConfigurableProductEntityTest.php deleted file mode 100644 index f66b6693c4d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/UpdateConfigurableProductEntityTest.php +++ /dev/null @@ -1,49 +0,0 @@ - Manage Products. - * 3. Search and open configurable product from preconditions. - * 4. Fill in data according to dataset. - * 5. Save product. - * 6. Perform all assertions. - * - * @group Configurable_Product_(MX) - * @ZephyrId MPERF-7439 - */ -class UpdateConfigurableProductEntityTest extends Scenario -{ - /** - * Update configurable product. - * - * @return array - */ - public function test() - { - $this->executeScenario(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/UpdateConfigurableProductEntityTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/UpdateConfigurableProductEntityTest.xml deleted file mode 100644 index 1ee95339fd2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/UpdateConfigurableProductEntityTest.xml +++ /dev/null @@ -1,189 +0,0 @@ - - - - - - Delete one option and update one options. - - - - - attribute_key_0 - option_key_1 - - - attribute_key_1 - option_key_1 - - - - 2 - - 166 - - - - - 1 - - - - 0 - 0 - - 123 - Fixed - - - - - - - - - - - - Add two options. - - - - - attribute_key_0 - option_key_1 - - - attribute_key_1 - option_key_1 - - - - 2 - - 209 - - - - - 1 - 2 - - - - 1 - - - - 11 - Fixed - - - - - 98 - Fixed - - - - catalogProductSimple::default - - - 2 - - - - 22 - Percentage - - - - - 31 - Percentage - - - - catalogProductSimple::default - - - - - - - - - - - Create new products(all types). - - - - - attribute_key_0 - option_key_0 - - - attribute_key_1 - option_key_0 - - - - 2 - - 633 - - - - - 0 - 1 - 2 - - - - quickCreation - - - createEmpty - - - copyFromConfigurable - - - - - - - - - - - Delete all option. - - - 0 - 1 - 2 - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.php deleted file mode 100644 index 9cb282b2d86..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.php +++ /dev/null @@ -1,105 +0,0 @@ - Manage Products. - * 3. Select a product in the grid. - * 4. Edit test value(s) according to dataset. - * 5. Click "Save". - * 6. Perform asserts. - * - * @group Products_(MX) - * @ZephyrId MPERF-7051 - */ -class UpdateSimpleProductEntityTest extends Injectable -{ - /** - * Product page with a grid. - * - * @var CatalogProduct - */ - protected $productGrid; - - /** - * Page to update a product. - * - * @var CatalogProductEdit - */ - protected $editProductPage; - - /** - * Injection pages. - * - * @param CatalogProduct $productGrid - * @param CatalogProductEdit $editProductPage - * @return void - */ - public function __inject(CatalogProduct $productGrid, CatalogProductEdit $editProductPage) - { - $this->productGrid = $productGrid; - $this->editProductPage = $editProductPage; - } - - /** - * Run update product simple entity test. - * - * @param CatalogProductSimple $initialProduct - * @param CatalogProductSimple $product - * @return array - */ - public function test(CatalogProductSimple $initialProduct, CatalogProductSimple $product) - { - // Preconditions - $initialProduct->persist(); - - // Steps - $this->productGrid->open(); - $this->productGrid->getProductGrid()->searchAndOpen(['sku' => $initialProduct->getSku()]); - $this->editProductPage->getProductForm()->fill($product); - $this->editProductPage->getFormPageActions()->save(); - - return ['category' => $this->getCategory($initialProduct, $product)]; - } - - /** - * Get category. - * - * @param CatalogProductSimple $initialProduct - * @param CatalogProductSimple $product - * @return CatalogCategory|null - */ - protected function getCategory(CatalogProductSimple $initialProduct, CatalogProductSimple $product) - { - return $product->hasData('category_ids') - ? $product->getDataFieldConfig('category_ids')['source']->getProductCategory() - : ($initialProduct->hasData('category_ids') - ? $initialProduct->getDataFieldConfig('category_ids')['source']->getProductCategory() - : null); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.xml deleted file mode 100644 index e114feed8fa..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.xml +++ /dev/null @@ -1,158 +0,0 @@ - - - - - - Default update - - - Test simple product %isolation% - test_simple_product_%isolation% - 245.00 - 200 - - - test-simple-product-%isolation% - 120 - Catalog, Search - - - Description for update simple product %isolation% - Short description for update simple product %isolation% - - - - - - - - Update visibility to Not Visible Individually - - - Test simple product %isolation% - test_simple_product_%isolation% - 325.00 - 123 - - - test-simple-product-%isolation% - 129 - Not Visible Individually - - - Description for update simple product %isolation% - Short description for update simple product %isolation% - - - - - - Update to only catalog searchable - - - Test simple product %isolation% - test_simple_product_%isolation% - 325.01 - 125 - - - test-simple-product-%isolation% - 25 - Catalog - - - Description for update simple product %isolation% - Short description for update simple product %isolation% - - - - - - - - - Update to only search searchable - - - Test simple product %isolation% - test_simple_product_%isolation% - 325.02 - 89 - - - test-simple-product-%isolation% - 89 - Search - - - Description for update simple product %isolation% - Short description for update simple product %isolation% - - - - - - - - - - Update to Out of Stock - - - Test simple product %isolation% - test_simple_product_%isolation% - 325.03 - 25 - Out of Stock - test-simple-product-%isolation% - 125 - - - - - Description for update simple product %isolation% - Short description for update simple product %isolation% - - - - - - - - - Update to status Disabled - - - Test simple product %isolation% - test_simple_product_%isolation% - 74.00 - 87 - - - test-simple-product-%isolation% - 333 - - - Disabled - Description for update simple product %isolation% - Short description for update simple product %isolation% - - - - - - Update category - default_subcategory - Test simple product %isolation% - test_simple_product_%isolation% - 74.00 - 87 - - - test-simple-product-%isolation% - 333 - - - - - Description for update simple product %isolation% - Short description for update simple product %isolation% - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/ProductAttribute/CreateAttributeSetEntityTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/ProductAttribute/CreateAttributeSetEntityTest.php deleted file mode 100644 index 501c0df1f9e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/ProductAttribute/CreateAttributeSetEntityTest.php +++ /dev/null @@ -1,103 +0,0 @@ - Attributes > Manage Attribute Sets. - * 3. Start to create new Attribute Set. - * 4. Fill out fields data according to data set. - * 5. Add created Product Attribute to Attribute Set. - * 6. Save new Attribute Set. - * 7. Verify created Attribute Set. - * - * @group Product_Attributes_(CS) - * @ZephyrId MPERF-6745 - */ -class CreateAttributeSetEntityTest extends Injectable -{ - /** - * Catalog Product Set page. - * - * @var CatalogProductSetIndex - */ - protected $productSetIndex; - - /** - * Catalog Product Set add page. - * - * @var CatalogProductSetAdd - */ - protected $productSetAdd; - - /** - * Catalog Product Set edit page. - * - * @var CatalogProductSetEdit - */ - protected $productSetEdit; - - /** - * Injection pages. - * - * @param CatalogProductSetIndex $productSetIndex - * @param CatalogProductSetAdd $productSetAdd - * @param CatalogProductSetEdit $productSetEdit - * @return void - */ - public function __inject( - CatalogProductSetIndex $productSetIndex, - CatalogProductSetAdd $productSetAdd, - CatalogProductSetEdit $productSetEdit - ) { - $this->productSetIndex = $productSetIndex; - $this->productSetAdd = $productSetAdd; - $this->productSetEdit = $productSetEdit; - } - - /** - * Run CreateAttributeSetEntity test. - * - * @param CatalogAttributeSet $attributeSet - * @param CatalogProductAttribute $productAttribute - * @return void - */ - public function test(CatalogAttributeSet $attributeSet, CatalogProductAttribute $productAttribute) - { - // Precondition - $productAttribute->persist(); - - // Steps: - $this->productSetIndex->open(); - $this->productSetIndex->getPageActionsBlock()->addNew(); - - $this->productSetAdd->getAttributeSetForm()->fill($attributeSet); - $this->productSetAdd->getPageActions()->save(); - $this->productSetEdit->getAttributeSetEditBlock()->moveAttribute($productAttribute->getData()); - $this->productSetEdit->getPageActions()->save(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/ProductAttribute/CreateAttributeSetEntityTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/ProductAttribute/CreateAttributeSetEntityTest.xml deleted file mode 100644 index 284f35526ac..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/ProductAttribute/CreateAttributeSetEntityTest.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - ProductTemplate%isolation% - default - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest.php deleted file mode 100644 index 7760138b1b9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest.php +++ /dev/null @@ -1,67 +0,0 @@ - Attributes > Manage Attributes. - * 3. Click 'Add New Attribute' button. - * 4. Fill out fields data according to data set. - * 5. Save Product Attribute. - * 6. Perform appropriate assertions. - * - * @group Product_Attributes_(CS) - * @ZephyrId MPERF-7278 - */ -class CreateProductAttributeEntityTest extends Scenario -{ - /** - * Run CreateProductAttributeEntity test. - * - * @param string $product - * @return array - */ - public function test($product) - { - $this->executeScenario(); - // Prepare data for asserts - return $this->createProduct($product, $this->localArguments['productTemplate']); - } - - /** - * Create product. - * - * @param string $product - * @param CatalogAttributeSet $attributeSet - * @return array - */ - protected function createProduct($product, CatalogAttributeSet $attributeSet) { - $stepArguments = [ - 'product' => $product, - 'data' => ['attribute_set_id' => ['attribute_set' => $attributeSet]] - ]; - - return $this->objectManager->create('Mage\Catalog\Test\TestStep\CreateProductStep', $stepArguments)->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest.xml deleted file mode 100644 index 88d0aee8717..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest.xml +++ /dev/null @@ -1,207 +0,0 @@ - - - - - - custom_attribute_set_without_attributes - catalogProductSimple::product_with_anchor_category - attr_dropdown_%isolation% - Dropdown - default - Yes - attr_dropdown_%isolation% - Global - No - Yes - Yes - Yes - Filterable (with results) - Yes - Yes - Yes - Yes - Yes - - - - - - - - - - - - - - to_maintain:yes - custom_attribute_set_without_attributes - catalogProductSimple::product_with_anchor_category - Text_Field_Admin_%isolation% - Text Field - No - attr_textfield_%isolation% - default_value_text%isolation% - Global - No - Yes - Yes - Yes - Yes - Yes - Yes - Yes - - - - - - custom_attribute_set_without_attributes - catalogProductSimple::product_with_anchor_category - attr_textarea_%isolation% - Text Area - Yes - attr_textarea_%isolation% - Store View - - - default_value_textarea%isolation% - No - Area_Field%isolation% - Yes - Yes - Yes - - - - - - - - custom_attribute_set_without_attributes - catalogProductSimple::product_with_anchor_category - Date_Admin_%isolation% - Date - No - attr_date_%isolation% - n/j/y - No - Date_Store_View - Yes - Yes - No - Yes - Yes - Yes - - - - - - - custom_attribute_set_without_attributes - catalogProductSimple::product_with_anchor_category - Yes/No_Admin_%isolation% - Yes/No - Yes - attr_yesno_%isolation% - Global - No - Yes/No_Global - - - - - - custom_attribute_set_without_attributes - catalogProductSimple::product_with_anchor_category - attr_multiselect_%isolation% - Multiple Select - default - No - attr_multiselect_%isolation% - Website - Yes - Yes - Yes - Yes - Filterable (with results) - Yes - Yes - Yes - Yes - - - - - - - - - - - custom_attribute_set_without_attributes - catalogProductSimple::product_with_anchor_category - attr_price_%isolation% - Price - No - attr_price_%isolation% - 1000 - No - Price - Yes - Yes - No - Filterable (with results) - Yes - Yes - Yes - - - - - - - - - custom_attribute_set_without_attributes - catalogProductSimple::product_with_anchor_category - attr_fpt_code_%isolation% - Fixed Product Tax - attr_fpt_code_%isolation% - Fixed_Product_Tax_Storeview - - - - - - custom_attribute_set_without_attributes - catalogProductSimple::product_with_anchor_category - Text_Field_Admin_%isolation% - Text Field - Yes - attr_textfield_%isolation% - Store View - default_value_text%isolation% - Yes - Text_Field%isolation% - Yes - Yes - Yes - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/CreateProductAttributeStep.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/CreateProductAttributeStep.php deleted file mode 100644 index 5a23d986a04..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/CreateProductAttributeStep.php +++ /dev/null @@ -1,132 +0,0 @@ -attribute = $productAttribute; - $this->attributeNew = $attributeNew; - $this->attributeEdit = $attributeEdit; - $this->catalogProductAttributeIndex = $catalogProductAttributeIndex; - $this->fixtureFactory = $fixtureFactory; - } - - /** - * Fill attribute form on attribute new page. - * - * @return array - */ - public function run() - { - $this->catalogProductAttributeIndex->open(); - $this->catalogProductAttributeIndex->getPageActionsBlock()->addNew(); - - $this->attributeNew->getAttributeForm()->fill($this->attribute); - $this->attributeNew->getPageActions()->saveAndContinue(); - $this->prepareAttribute(); - - return ['attribute' => $this->attribute, 'templatesData' => ['attributes' => [$this->attribute]]]; - } - - /** - * Prepare attribute fixture. - * - * @return void - */ - protected function prepareAttribute() - { - $data = $this->attribute->getData(); - if (isset($data['options'])) { - $data['options'] = $this->prepareOptionsData($data['options']); - } - $data['attribute_id'] = $this->attributeEdit->getAttributeForm()->getAttributeId(); - $this->attribute = $this->fixtureFactory->createByCode('catalogProductAttribute', ['data' => $data]); - } - - /** - * Prepare options data. - * - * @param array $optionsData - * @return array - */ - protected function prepareOptionsData(array $optionsData) - { - return [ - 'value' => $optionsData, - 'optionsIds' => $this->attributeEdit->getAttributeForm()->getOptionsIds() - ]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/CreateProductStep.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/CreateProductStep.php deleted file mode 100644 index 109538dc7aa..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/CreateProductStep.php +++ /dev/null @@ -1,80 +0,0 @@ -product = $product; - $this->fixtureFactory = $fixtureFactory; - $this->data = $data; - } - - /** - * Create product. - * - * @return array - */ - public function run() - { - list($fixtureClass, $dataset) = explode('::', $this->product); - /** @var FixtureInterface $product */ - $product = $this->fixtureFactory->createByCode( - trim($fixtureClass), - ['dataset' => trim($dataset), 'data' => $this->data] - ); - if ($product->hasData('id') === false) { - $product->persist(); - } - - return ['product' => $product]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/CreateProductTemplateStep.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/CreateProductTemplateStep.php deleted file mode 100644 index 39a09ebb2c1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/CreateProductTemplateStep.php +++ /dev/null @@ -1,79 +0,0 @@ -productTemplate = $productTemplate; - $this->templatesData = $templatesData; - $this->fixtureFactory = $fixtureFactory; - } - - /** - * Create product attribute template. - * - * @return array - */ - public function run() - { - $attributeSet = $this->fixtureFactory->createByCode( - 'catalogAttributeSet', - [ - 'dataset' => $this->productTemplate['dataset'], - 'data' => ['assigned_attributes' => $this->templatesData] - ] - ); - $attributeSet->persist(); - - return ['productTemplate' => $attributeSet]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/CreateProductsStep.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/CreateProductsStep.php deleted file mode 100644 index bcb691e4436..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/CreateProductsStep.php +++ /dev/null @@ -1,101 +0,0 @@ -products = $products; - $this->data = $data; - $this->fixtureFactory = $fixtureFactory; - } - - /** - * Create products. - * - * @return InjectableFixture[] - */ - public function run() - { - $products = []; - $productsdatasets = explode(',', $this->products); - foreach ($productsdatasets as $key => $productdataset) { - list($fixtureClass, $dataset) = $this->resolveProductFixture($productdataset); - $data = isset($this->data[$key]) ? $this->data[$key] : []; - /** @var InjectableFixture[] $products */ - $products[$key] = $this->fixtureFactory->createByCode( - $fixtureClass, - ['dataset' => $dataset, 'data' => $data] - ); - if ($products[$key]->hasData('id') === false) { - $products[$key]->persist(); - } - } - - return ['products' => $products]; - } - - /** - * Get product fixture type and dataset. - * - * @param string $productdataset - * @return array - */ - protected function resolveProductFixture($productdataset) - { - $productdataset = explode('::', $productdataset); - $fixtureClass = trim($productdataset[0]); - $dataset = isset($productdataset[1]) ? trim($productdataset[1]) : ''; - return [$fixtureClass, $dataset]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/OpenProductOnBackendStep.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/OpenProductOnBackendStep.php deleted file mode 100644 index 458bfbf7dc9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/OpenProductOnBackendStep.php +++ /dev/null @@ -1,62 +0,0 @@ -product = $product; - $this->catalogProductIndex = $catalogProductIndex; - } - - /** - * Open products on backend. - * - * @return void - */ - public function run() - { - $this->catalogProductIndex->open(); - $this->catalogProductIndex->getProductGrid()->searchAndOpen(['sku' => $this->product->getSku()]); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/SaveProductStep.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/SaveProductStep.php deleted file mode 100644 index abad9610d76..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/SaveProductStep.php +++ /dev/null @@ -1,51 +0,0 @@ -catalogProductEdit = $catalogProductEdit; - } - - /** - * Save product. - * - * @return void - */ - public function run() - { - $this->catalogProductEdit->getFormPageActions()->save(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep.php deleted file mode 100644 index 45c613d6d0b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep.php +++ /dev/null @@ -1,264 +0,0 @@ -fixtureFactory = $fixtureFactory; - $this->objectManager = $objectManager; - $this->catalogProductEdit = $catalogProductEdit; - $this->product = $product; - $this->configurableOptionsEditData = $configurableOptionsEditData; - $this->currentAssignedProducts = $this->getOriginalProductAssignedProducts(); - $this->currentAttributes = $this->getOriginalProductAttributes(); - $this->currentConfigurableOptionsData = $this->product->getConfigurableOptions()['attributes_data']; - $this->checkoutData = $checkoutData; - } - - /** - * Update configurable product. - * - * @return array - */ - public function run() - { - $this->openConfigurableTab(); - foreach ($this->subSteps as $subStepName) { - if (isset($this->configurableOptionsEditData[$subStepName])) { - $subStep = $this->getSubStep($subStepName); - $subStep->run(); - $this->updateArguments($subStep); - } - } - - return ['product' => $this->prepareResultProduct()]; - } - - /** - * Get sub step. - * - * @param string $subStepName - * @return AbstractSubStep - */ - protected function getSubStep($subStepName) - { - $class = 'Mage\Catalog\Test\TestStep\UpdateConfigurableProductStep\\' . ucfirst($subStepName) . 'SubStep'; - $arguments = [ - 'product' => $this->product, - 'configurableOptionsEditData' => $this->configurableOptionsEditData, - 'currentAssignedProducts' => $this->currentAssignedProducts, - 'currentAttributes' => $this->currentAttributes, - 'currentConfigurableOptionsData' => $this->currentConfigurableOptionsData, - 'checkoutData' => $this->checkoutData - - ]; - - return $this->objectManager->create($class, $arguments); - } - - /** - * Update local arguments. - * - * @param AbstractSubStep $subStep - * @return void - */ - protected function updateArguments(AbstractSubStep $subStep) - { - $returnSubStepArguments = $subStep->returnArguments(); - foreach ($returnSubStepArguments as $argumentName => $value) { - $this->$argumentName = $value; - } - } - - /** - * Prepare result product. - * - * @return ConfigurableProduct - */ - protected function prepareResultProduct() - { - $originalProductData = $this->product->getData(); - $originalProductData['configurable_options'] = $this->getCurrentConfigurableOptions(); - $originalProductData['price'] = ['value' => $this->product->getPrice()]; - if (!empty($this->checkoutData)) { - $originalProductData['checkout_data'] = $this->checkoutData; - } - - return $this->fixtureFactory->createByCode('configurableProduct', ['data' => $originalProductData]); - } - - /** - * Get current configurable options. - * - * @return array - */ - protected function getCurrentConfigurableOptions() - { - return !empty($this->currentAssignedProducts) - ? [ - 'data' => [ - 'data' => ['attributes_data' => $this->currentConfigurableOptionsData], - 'attributes_data' => [ - 'attributes' => $this->currentAttributes, - 'attributeSet' => $this->getOriginalProductOptionsSource()->getAttributeSet() - ], - 'assigned_product' => $this->currentAssignedProducts - ] - ] - : []; - } - - /** - * Open configurable specify tab. - * - * @return void - */ - protected function openConfigurableTab() - { - $this->catalogProductEdit->getProductForm()->openTab('configurable'); - } - - /** - * Get assigned products from original configurable product. - * - * @return InjectableFixture[] - */ - protected function getOriginalProductAssignedProducts() - { - return $this->getOriginalProductOptionsSource()->getProducts(); - } - - /** - * Get attributes' fixtures for original product. - * - * @return CatalogProductAttribute[] - */ - protected function getOriginalProductAttributes() - { - return $this->getOriginalProductOptionsSource()->getAttributesData(); - } - - /** - * Get configurable options source for original product. - * - * @return ConfigurableOptions - */ - protected function getOriginalProductOptionsSource() - { - return $this->product->getDataFieldConfig('configurable_options')['source']; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep/AbstractSubStep.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep/AbstractSubStep.php deleted file mode 100644 index f43e93ae416..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep/AbstractSubStep.php +++ /dev/null @@ -1,220 +0,0 @@ -objectManager = $objectManager; - $this->fixtureFactory = $fixtureFactory; - $this->catalogProductEdit = $catalogProductEdit; - $this->product = $product; - $this->configurableOptionsEditData = $configurableOptionsEditData; - $this->currentAssignedProducts = $currentAssignedProducts; - $this->currentAttributes = $currentAttributes; - $this->currentConfigurableOptionsData = $currentConfigurableOptionsData; - $this->checkoutData = $checkoutData; - } - - /** - * Fill attributes data. - * - * @param array $attributes - * @return void - */ - protected function fillAttributes(array $attributes) - { - $this->getConfigurableProductTab()->fillAttributes($attributes); - } - - /** - * Select products. - * - * @param array $products - * @return void - */ - protected function selectProducts(array $products) - { - $filter = []; - foreach ($products as $product) { - $filter[] = $product->getSku(); - } - $this->getConfigurableProductTab()->selectProducts($filter); - } - - /** - * Update configurable options. - * - * @param array $newData - * @return void - */ - protected function updateConfigurableOptionsData(array $newData) - { - foreach ($newData as $attributeKey => $itemAttribute) { - foreach ($itemAttribute['options'] as $optionKey => $option) { - $originalData = isset($this->currentConfigurableOptionsData[$attributeKey]['options'][$optionKey]) - ? $this->currentConfigurableOptionsData[$attributeKey]['options'][$optionKey] - : []; - $this->currentConfigurableOptionsData[$attributeKey]['options'][$optionKey] = array_merge( - $originalData, - $option - ); - } - } - } - - /** - * Get special tab for configurable product. - * - * @return ConfigurableTab - */ - protected function getConfigurableProductTab() - { - return $this->catalogProductEdit->getProductForm()->getTabElement('configurable'); - } - - /** - * Get assigned products from original configurable product. - * - * @return InjectableFixture[] - */ - protected function getOriginalProductAssignedProducts() - { - return $this->getOriginalProductOptionsSource()->getProducts(); - } - - /** - * Get configurable options source for original product. - * - * @return ConfigurableOptions - */ - protected function getOriginalProductOptionsSource() - { - return $this->product->getDataFieldConfig('configurable_options')['source']; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep/AddOptionsSubStep.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep/AddOptionsSubStep.php deleted file mode 100644 index c41bd7d1d6f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep/AddOptionsSubStep.php +++ /dev/null @@ -1,139 +0,0 @@ -prepareNewProducts(); - $this->selectProducts($newProducts); - $configurableOptionsData = $this->prepareOptions(); - $this->updateConfigurableOptionsData($configurableOptionsData); - $this->fillAttributes($this->currentConfigurableOptionsData); - } - - /** - * Return arguments from sub step. - * - * @return array - */ - public function returnArguments() - { - return [ - 'currentAssignedProducts' => $this->currentAssignedProducts, - 'currentConfigurableOptionsData' => $this->currentConfigurableOptionsData - ]; - } - - /** - * Prepare new products. - * - * @return array - */ - protected function prepareNewProducts() - { - $newProducts = []; - foreach ($this->configurableOptionsEditData['addOptions'] as $addOption) { - $productKey = $this->getProductKeyByOptionIndex($addOption['optionIndex']); - $newProducts[$productKey] = $this->createNewProduct($addOption); - } - $this->currentAssignedProducts = array_merge($this->currentAssignedProducts, $newProducts); - - return $newProducts; - } - - /** - * Get product key by option index. - * - * @param int $optionIndex - * @return string - */ - protected function getProductKeyByOptionIndex($optionIndex) - { - return "attribute_key_0:option_key_$optionIndex " . "attribute_key_1:option_key_$optionIndex"; - } - - /** - * Create new product. - * - * @param array $data - * @return InjectableFixture - */ - protected function createNewProduct(array $data) - { - list($fixtureClass, $dataset) = explode('::', $data['product']); - $productData = $this->prepareProductCreateData($data); - $product = $this->fixtureFactory->createByCode($fixtureClass, ['dataset' => $dataset, 'data' => $productData]); - $product->persist(); - - return $product; - } - - /** - * Prepare product create data. - * - * @param array $data - * @return array - */ - protected function prepareProductCreateData(array $data) - { - $attributeSet = $this->getOriginalProductOptionsSource()->getAttributeSet(); - $value = []; - foreach ($this->currentAttributes as $attribute) { - $value[$attribute->getAttributeCode()] = $attribute->getOptions()[$data['optionIndex']]['id']; - } - - return [ - 'attribute_set_id' => ['attribute_set' => $attributeSet], - 'attributes' => [ - 'value' => $value - ] - ]; - } - - /** - * Prepare options data. - * - * @return array - */ - protected function prepareOptions() - { - $result = []; - $originalData = $this->product->getConfigurableOptions(); - foreach ($this->configurableOptionsEditData['addOptions'] as $option) { - foreach ($option['data'] as $attributeKey => $itemData) { - $optionKey = 'option_key_' . $option['optionIndex']; - $originalOptionData = isset($originalData['attributes_data'][$attributeKey]['options'][$optionKey]) - ? $originalData['attributes_data'][$attributeKey]['options'][$optionKey] - : []; - $result[$attributeKey]['options'][$optionKey] = array_merge($originalOptionData, $itemData['value']); - } - } - - return $result; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep/CreateProductSubStep.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep/CreateProductSubStep.php deleted file mode 100644 index 3960fc82e44..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep/CreateProductSubStep.php +++ /dev/null @@ -1,163 +0,0 @@ -configurableOptionsEditData['createProduct'] as $createType => $itemCreate) { - $data = $this->getCreationData($createType); - $source = $this->createConfigurableOptionsSource($data); - $newData = $source->getData('attributes_data'); - $newProducts = $source->getProducts(); - $this->$createType($newProducts); - $this->fillAttributes($newData); - $this->updateConfigurableOptionsData($newData); - $this->updateAssignedProducts($newProducts); - } - } - - /** - * Return arguments from sub step. - * - * @return array - */ - public function returnArguments() - { - return [ - 'currentAssignedProducts' => $this->currentAssignedProducts, - 'currentConfigurableOptionsData' => $this->currentConfigurableOptionsData - ]; - } - - /** - * Create product via 'Create Empty' button. - * - * @param array $newProducts - * @return void - */ - protected function createEmpty(array $newProducts) - { - foreach ($newProducts as $product) { - $this->getConfigurableProductTab()->getSimpleAssociatedProductBlock()->clickCreateEmpty(); - $this->fillNewProduct($product); - } - } - - /** - * Create product via 'Copy From Configurable' button. - * - * @param array $newProducts - * @return void - */ - protected function copyFromConfigurable(array $newProducts) - { - foreach ($newProducts as $product) { - $this->getConfigurableProductTab()->getSimpleAssociatedProductBlock()->clickCopyFromConfigurable(); - $this->fillNewProduct($product); - } - } - - /** - * Quick creation products. - * - * @param array $newProducts - * @return void - */ - protected function quickCreation(array $newProducts) - { - foreach ($newProducts as $product) { - $this->getConfigurableProductTab()->getQuickCreationBlock()->create($product); - } - } - - /** - * Fill new product. - * - * @param InjectableFixture $product - * @return void - */ - protected function fillNewProduct(InjectableFixture $product) - { - $this->getConfigurableProductTab()->getNewProductPopup()->fill($product); - $this->getConfigurableProductTab()->getNewProductPopup()->getFormPageActions()->save(); - $this->getConfigurableProductTab()->getNewProductPopup()->close(); - } - - /** - * Get creation data. - * - * @param string $creationType - * @return array - */ - protected function getCreationData($creationType) - { - return [ - 'dataset' => $this->configurableOptionsEditData['createProduct'][$creationType]['dataset'], - 'data' => [ - 'attributes_data' => [ - 'attributes' => $this->currentAttributes, - 'attributeSet' => $this->getOriginalProductOptionsSource()->getAttributeSet() - ], - ] - ]; - } - - /** - * Update assigned products. - * - * @param array $newProducts - * @return void - */ - protected function updateAssignedProducts(array $newProducts) - { - $this->currentAssignedProducts = array_merge($this->currentAssignedProducts, $newProducts); - } - - /** - * Create configurable options source. - * - * @param array $data - * @return ConfigurableOptions - */ - protected function createConfigurableOptionsSource(array $data) - { - return $this->objectManager->create( - 'Mage\Catalog\Test\Fixture\ConfigurableProduct\ConfigurableOptions', - [ - 'data' => $data, - 'params' => [ - 'is_required' => '0', - 'group' => 'configurable', - 'source' => 'Mage\Catalog\Test\Fixture\ConfigurableProduct\ConfigurableOptions', - 'repository' => 'Mage\Catalog\Test\Repository\CatalogProductConfigurable\ConfigurableOptions' - ] - ] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep/DeleteOptionsSubStep.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep/DeleteOptionsSubStep.php deleted file mode 100644 index 16d05ab359c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep/DeleteOptionsSubStep.php +++ /dev/null @@ -1,110 +0,0 @@ -unsetProductsKeys(); - $this->unsetAttributeOptions(); - $this->getConfigurableProductTab()->unselectAllProducts(); - if (!empty($this->currentAssignedProducts)) { - $this->selectProducts($this->currentAssignedProducts); - $this->fillAttributes($this->currentConfigurableOptionsData); - } - } - - /** - * Return arguments from sub step. - * - * @return array - */ - public function returnArguments() - { - return [ - 'currentAssignedProducts' => $this->currentAssignedProducts, - 'currentConfigurableOptionsData' => $this->currentConfigurableOptionsData - ]; - } - - /** - * Unset products. - * - * @return void - */ - protected function unsetProductsKeys() - { - $deleteProductsKey = $this->prepareDeleteProductsKeys(); - foreach ($deleteProductsKey as $key) { - unset($this->currentAssignedProducts[$key]); - } - } - - /** - * Prepare delete products keys. - * - * @return array - */ - protected function prepareDeleteProductsKeys() - { - $keys = []; - foreach ($this->configurableOptionsEditData['deleteOptions'] as $option) { - $keys = array_merge($keys, $this->searchKeysForOption($option)); - } - return $keys; - } - - /** - * Search keys for option index. - * - * @param int $optionIndex - * @return array - */ - protected function searchKeysForOption($optionIndex) - { - $keys = []; - $originalProductAssignedProducts = $this->getOriginalProductAssignedProducts(); - foreach (array_keys($originalProductAssignedProducts) as $key) { - if (strpos($key, 'option_key_' . $optionIndex) !== false) { - $keys[] = $key; - } - } - return $keys; - } - - /** - * Unset attribute options. - * - * @return void - */ - protected function unsetAttributeOptions() - { - foreach ($this->configurableOptionsEditData['deleteOptions'] as $option) { - foreach ($this->currentConfigurableOptionsData as &$attribute) { - unset($attribute['options']['option_key_' . $option]); - } - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep/UpdateOptionsSubStep.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep/UpdateOptionsSubStep.php deleted file mode 100644 index bad785c4123..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep/UpdateOptionsSubStep.php +++ /dev/null @@ -1,62 +0,0 @@ -prepareOptionsForEdit(); - $this->fillAttributes($this->currentConfigurableOptionsData); - } - - /** - * Return arguments from sub step. - * - * @return array - */ - public function returnArguments() - { - return [ - 'currentConfigurableOptionsData' => $this->currentConfigurableOptionsData - ]; - } - - /** - * Prepare options for edit. - * - * @return void - */ - protected function prepareOptionsForEdit() - { - foreach ($this->configurableOptionsEditData['updateOptions'] as $editOption) { - $attributeKey = 'attribute_key_' . $editOption['attributeIndex']; - $optionKey = 'option_key_' . $editOption['optionIndex']; - $this->currentConfigurableOptionsData[$attributeKey]['options'][$optionKey] = array_replace( - $this->currentConfigurableOptionsData[$attributeKey]['options'][$optionKey], - $editOption['value'] - ); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/etc/curl/di.xml deleted file mode 100644 index c462c0f666e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/etc/curl/di.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/etc/fixture.xml deleted file mode 100644 index aec00f57a53..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/etc/fixture.xml +++ /dev/null @@ -1,199 +0,0 @@ - - - - - eav - catalog_product - simple - Mage\Catalog\Model\Resource\Product\Collection - sku - - - id - virtual - - - type_id - virtual - - - attribute_set_id - virtual - Mage\Catalog\Test\Fixture\CatalogProductSimple\AttributeSetId - - - custom_options - virtual - Mage\Catalog\Test\Fixture\CatalogProductSimple\CustomOptions - - - custom_options - virtual - Mage\Catalog\Test\Fixture\CatalogProductSimple\CheckoutData - - - attributes - virtual - - - - - eav - catalog_category - Mage\Catalog\Model\Resource\Category\Collection - - - eav - catalog_product - configurable - sku - - - stock_data - virtual - inventory - - - id - virtual - - - type_id - virtual - - - attribute_set_id - virtual - null - Mage\Catalog\Test\Fixture\CatalogProductSimple\AttributeSetId - null - - - configurable_options - virtual - 0 - configurable - Mage\Catalog\Test\Fixture\ConfigurableProduct\ConfigurableOptions - - - - - composite - - eav_attribute - catalog_eav_attribute - - - options - smallint - Mage\Catalog\Test\Fixture\CatalogProductAttribute\Options - - - - flat - eav_attribute_set - - - skeleton_set - virtual - - - assigned_attributes - virtual - Mage\Catalog\Test\Fixture\CatalogAttributeSet\AssignedAttributes - - - - - eav - catalog_product - virtual - Mage\Catalog\Model\Resource\Product\Collection - sku - - - id - virtual - - - type_id - virtual - - - attribute_set_id - virtual - null - Mage\Catalog\Test\Fixture\CatalogProductSimple\AttributeSetId - - - custom_options - virtual - custom-options - Mage\Catalog\Test\Fixture\CatalogProductSimple\CustomOptions - - - custom_options - virtual - Mage\Catalog\Test\Fixture\CatalogProductVirtual\CheckoutData - - - price - prices - Mage\Catalog\Test\Fixture\CatalogProductSimple\Price - - - - - eav - catalog_product - grouped - Mage\Catalog\Model\Resource\Product\Collection - sku - - - id - virtual - - - type_id - virtual - - - attribute_set_id - virtual - null - Mage\Catalog\Test\Fixture\CatalogProductSimple\AttributeSetId - - - custom_options - virtual - custom-options - Mage\Catalog\Test\Fixture\CatalogProductSimple\CustomOptions - - - custom_options - virtual - Mage\Catalog\Test\Fixture\CatalogProductVirtual\CheckoutData - - - associated - associated - Mage\Catalog\Test\Fixture\GroupedProduct\Associated - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/etc/testcase.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/etc/testcase.xml deleted file mode 100644 index bb9276c588b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/etc/testcase.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedInCatalogPage.php b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedInCatalogPage.php deleted file mode 100644 index b8becee5364..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedInCatalogPage.php +++ /dev/null @@ -1,107 +0,0 @@ -open(); - $cmsIndex->getTopmenu()->selectCategory($product->getCategoryIds()[0]); - $formPrices = $this->getFormPrices($product, $catalogCategoryView); - $fixturePrices = $this->prepareFixturePrices($prices); - $diff = $this->verifyData($fixturePrices, $formPrices); - \PHPUnit_Framework_Assert::assertEmpty($diff, $diff . "\n On: " . date('l jS \of F Y h:i:s A')); - } - - /** - * Prepare fixture prices. - * - * @param array $prices - * @return array - */ - protected function prepareFixturePrices(array $prices) - { - return array_intersect_key($prices, array_flip($this->verifyFields)); - } - - /** - * Get form prices. - * - * @param InjectableFixture $product - * @param CatalogCategoryView $catalogCategoryView - * @return array - */ - protected function getFormPrices(InjectableFixture $product, CatalogCategoryView $catalogCategoryView) - { - $productPriceBlock = $catalogCategoryView->getListProductBlock()->getProductPriceBlock($product->getName()); - $actualPrices = [ - 'regular' => $productPriceBlock->getRegularPrice(), - 'special' => $productPriceBlock->getSpecialPrice() - ]; - $actualPrices['discount_amount'] = number_format($actualPrices['regular'] - $actualPrices['special'], 2); - - return $actualPrices; - } - - /** - * Returns a string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return 'Catalog Price Rule is applied for product(s) in Catalog according to Priority.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedInProductPage.php b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedInProductPage.php deleted file mode 100644 index 6d0ff6942a7..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedInProductPage.php +++ /dev/null @@ -1,70 +0,0 @@ -open(); - $cmsIndex->getTopmenu()->selectCategory($product->getCategoryIds()[0]); - $catalogCategoryView->getListProductBlock()->openProductViewPage($product->getName()); - $productPriceBlock = $pageCatalogProductView->getViewBlock()->getPriceBlock(); - $actualPrices['regular'] = $productPriceBlock->getRegularPrice(); - $actualPrices['special'] = $productPriceBlock->getSpecialPrice(); - $actualPrices['discount_amount'] = number_format($actualPrices['regular'] - $actualPrices['special'], 2);; - $diff = $this->verifyData($actualPrices, $prices); - \PHPUnit_Framework_Assert::assertEmpty($diff, $diff); - } - - /** - * Returns a string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return "Catalog Price Rule is applied & it impacts on product's discount price on Product page."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedInShoppingCart.php b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedInShoppingCart.php deleted file mode 100644 index 5e3b042adf1..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedInShoppingCart.php +++ /dev/null @@ -1,72 +0,0 @@ -open(); - $cmsIndex->getTopmenu()->selectCategory($product->getCategoryIds()[0]); - $catalogCategoryView->getListProductBlock()->openProductViewPage($product->getName()); - $pageCatalogProductView->getViewBlock()->addToCart($product); - $actualGrandTotal = $pageCheckoutCart->getCartBlock()->getCartItem($product)->getCartItemTypePrice('price'); - \PHPUnit_Framework_Assert::assertEquals($prices['grand_total'], $actualGrandTotal); - } - - /** - * Returns a string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return 'Catalog Price Rule is applied for product(s) in Shopping Cart according to Priority.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleForm.php b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleForm.php deleted file mode 100644 index e97a01ffc09..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleForm.php +++ /dev/null @@ -1,102 +0,0 @@ -getName(); - - $pageCatalogRuleIndex->open(); - $pageCatalogRuleIndex->getCatalogRuleGrid()->searchAndOpen($filter); - $formData = $this->prepareFormData($catalogRuleEdit->getEditForm()->getData($catalogPriceRule)); - $fixtureData = $this->prepareFixtureData($catalogPriceRule->getData()); - $diff = $this->verifyData($formData, $fixtureData); - - \PHPUnit_Framework_Assert::assertEmpty($diff, $diff); - } - - /** - * Prepare fixture data. - * - * @param array $fixtureData - * @return array - */ - protected function prepareFixtureData(array $fixtureData) - { - if (isset($fixtureData['discount_amount'])) { - $fixtureData['discount_amount'] = floatval($fixtureData['discount_amount']); - } - - return $fixtureData; - } - - /** - * Prepare form data. - * - * @param array $formData - * @return array - */ - protected function prepareFormData(array $formData) - { - if (isset($formData['discount_amount'])) { - $formData['discount_amount'] = floatval($formData['discount_amount']); - } - - return $formData; - } - - /** - * Returns a string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return 'Displayed catalog price rule data on edit page(backend) equals to passed from fixture.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleInGrid.php b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleInGrid.php deleted file mode 100644 index 2c8bd449878..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleInGrid.php +++ /dev/null @@ -1,76 +0,0 @@ -getData(); - $filter = [ - 'name' => $data['name'], - 'is_active' => $data['is_active'], - ]; - //add ruleWebsite to filter if there is one - if ($catalogPriceRule->hasData('website_ids')) { - $ruleWebsite = $catalogPriceRule->getWebsiteIds(); - $ruleWebsite = is_array($ruleWebsite) ? reset($ruleWebsite) : $ruleWebsite; - $filter['rule_website'] = $ruleWebsite; - } - //add from_date & to_date to filter if there are ones - if (isset($data['from_date']) && isset($data['to_date'])) { - $dateArray['from_date'] = date("M j, Y", strtotime($catalogPriceRule->getFromDate())); - $dateArray['to_date'] = date("M j, Y", strtotime($catalogPriceRule->getToDate())); - $filter = array_merge($filter, $dateArray); - } - - $pageCatalogRuleIndex->open(); - $errorMessage = implode(', ', $filter); - \PHPUnit_Framework_Assert::assertTrue( - $pageCatalogRuleIndex->getCatalogRuleGrid()->isRowVisible($filter), - 'Catalog Price Rule with following data: \'' . $errorMessage . '\' ' - . 'is absent in Catalog Price Rule grid.' - ); - } - - /** - * Returns a string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return 'Catalog Price Rule is present in Catalog Rule grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleNotInGrid.php b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleNotInGrid.php deleted file mode 100644 index df5cca5114e..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleNotInGrid.php +++ /dev/null @@ -1,59 +0,0 @@ - $catalogPriceRule->getId(), - 'name' => $catalogPriceRule->getName(), - ]; - $catalogRuleIndex->open(); - \PHPUnit_Framework_Assert::assertFalse( - $catalogRuleIndex->getCatalogRuleGrid()->isRowVisible($filter), - "Catalog Price Rule {$filter['rule_id']} with name {$filter['name']} is present in Catalog Price Rule grid." - ); - } - - /** - * Returns a string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return 'Catalog Price Rule is NOT present in Catalog Rule grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleNotInProductPage.php b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleNotInProductPage.php deleted file mode 100644 index 36f17b08aa3..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleNotInProductPage.php +++ /dev/null @@ -1,62 +0,0 @@ -persist(); - - $browser->open($_ENV['app_frontend_url'] . $productSimple->getUrlKey() . '.html'); - $productPriceFromFixture = $productSimple->getPrice(); - $productPrice = number_format($catalogProductView->getViewBlock()->getPriceBlock()->getPrice(), 2); - \PHPUnit_Framework_Assert::assertEquals($productPrice, $productPriceFromFixture); - } - - /** - * Returns a string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return 'Price stored in fixture equals to product price on product page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleNoticeMessage.php b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleNoticeMessage.php deleted file mode 100644 index 295cdeb30e4..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleNoticeMessage.php +++ /dev/null @@ -1,65 +0,0 @@ -getMessagesBlock()->getNoticeMessages() - ); - } - - /** - * Returns a string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return 'Assert that notice message is displayed'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleSuccessDeleteMessage.php deleted file mode 100644 index 1c92d868329..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleSuccessDeleteMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return 'Assert that success delete message is displayed.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleSuccessSaveMessage.php b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleSuccessSaveMessage.php deleted file mode 100644 index db3cf37dfbc..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleSuccessSaveMessage.php +++ /dev/null @@ -1,60 +0,0 @@ -getMessagesBlock()->getSuccessMessages(); - $actualMessages = is_array($actualMessages) ? $actualMessages : [$actualMessages]; - \PHPUnit_Framework_Assert::assertContains( - self::SUCCESS_MESSAGE, - $actualMessages - ); - } - - /** - * Returns a string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return 'Assert that success message is displayed'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Fixture/CatalogRule.xml b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Fixture/CatalogRule.xml deleted file mode 100644 index 1c294887682..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Fixture/CatalogRule.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Handler/CatalogRule/CatalogRuleInterface.php b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Handler/CatalogRule/CatalogRuleInterface.php deleted file mode 100644 index c512fcaca88..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Handler/CatalogRule/CatalogRuleInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - [ - 'type' => 'catalogrule/rule_condition_combine', - 'aggregator' => 'all', - 'value' => 1, - ], - 'Category' => [ - 'type' => 'catalogrule/rule_condition_product', - 'attribute' => 'category_ids', - ], - ]; - - /** - * Mapping values for data. - * - * @var array - */ - protected $mappingData = [ - 'simple_action' => [ - 'By Percentage of the Original Price' => 'by_percent', - 'By Fixed Amount' => 'by_fixed', - 'To Percentage of the Original Price' => 'to_percent', - 'To Fixed Amount' => 'to_fixed', - ], - 'is_active' => [ - 'Active' => 1, - 'Inactive' => 0, - ], - 'stop_rules_processing' => [ - 'Yes' => 1, - 'No' => 0, - ], - ]; - - /** - * Mapping values for Websites. - * - * @var array - */ - protected $websiteIds = [ - 'Main Website' => 1, - ]; - - /** - * Mapping values for Customer Groups. - * - * @var array - */ - protected $customerGroupIds = [ - 'NOT LOGGED IN' => 0, - 'General' => 1, - 'Wholesale' => 2, - 'Retailer' => 3, - ]; - - /** - * POST request for creating Catalog Price Rule. - * - * @param FixtureInterface $fixture - * @return mixed|void - * @throws \Exception - */ - public function persist(FixtureInterface $fixture = null) - { - $data = $this->prepareData($fixture); - $url = $_ENV['app_backend_url'] . 'promo_catalog/save/'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->addOption(CURLOPT_HEADER, 1); - $curl->write($url, $data); - $response = $curl->read(); - $curl->close(); - - if (!strpos($response, 'id="messages"')) { - throw new \Exception( - "Catalog Price Rule entity creating by curl handler was not successful! Response: $response" - ); - } - - return ['id' => $this->getCategoryPriceRuleId()]; - } - - /** - * Prepare data from text to values. - * - * @param FixtureInterface $fixture - * @return array - */ - protected function prepareData($fixture) - { - $data = $this->replaceMappingData($fixture->getData()); - if (isset($data['website_ids'])) { - $websiteIds = []; - foreach ($data['website_ids'] as $websiteId) { - $websiteIds[] = isset($this->websiteIds[$websiteId]) ? $this->websiteIds[$websiteId] : $websiteId; - } - $data['website_ids'] = $websiteIds; - } - if (isset($data['customer_group_ids'])) { - $customerGroupIds = []; - foreach ($data['customer_group_ids'] as $customerGroupId) { - $customerGroupIds[] = isset($this->customerGroupIds[$customerGroupId]) - ? $this->customerGroupIds[$customerGroupId] - : $customerGroupId; - } - $data['customer_group_ids'] = $customerGroupIds; - } - if (!isset($data['stop_rules_processing'])) { - $data['stop_rules_processing'] = 0; - } - - if (!isset($data['rule'])) { - $data['rule'] = null; - } - $data['rule'] = ['conditions' => $this->prepareCondition($data['rule'])]; - - return $data; - } - - /** - * Get id after creating Category Price Rule. - * - * @return int - * @throws \Exception - */ - public function getCategoryPriceRuleId() - { - // Sort data in grid to define category price rule id if more than 20 items in grid - $url = $_ENV['app_backend_url'] . 'promo_catalog/index/sort/rule_id/dir/desc'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->write($url); - $response = $curl->read(); - $curl->close(); - - preg_match('~title="http[^\s]*\/id\/(\d+)~', $response, $matches); - if (empty($matches)) { - throw new \Exception('Cannot find Category Price Rule id'); - } - - return $matches[1]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Page/Adminhtml/CatalogRuleEdit.xml b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Page/Adminhtml/CatalogRuleEdit.xml deleted file mode 100644 index 2380acf09f1..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Page/Adminhtml/CatalogRuleEdit.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Page/Adminhtml/CatalogRuleIndex.xml b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Page/Adminhtml/CatalogRuleIndex.xml deleted file mode 100644 index adfb8b51405..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Page/Adminhtml/CatalogRuleIndex.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Repository/CatalogRule.xml b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Repository/CatalogRule.xml deleted file mode 100644 index 3057d52570d..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Repository/CatalogRule.xml +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - CatalogPriceRule %isolation% - Catalog Price Rule Description - - - main_website - - - - NOT LOGGED IN - - By Percentage of the Original Price - 50 - - - - catalog_price_rule_priority_0 %isolation% - -50% of price, Priority = 0 - Active - - - main_website - - - - NOT LOGGED IN - - 0 - By Percentage of the Original Price - 50 - - - - catalog_price_rule_priority_1_stop_further_rules %isolation% - Priority 1, -5 By fixed amount - Active - - - main_website - - - - NOT LOGGED IN - - 1 - By Fixed Amount - 5 - Yes - - - - catalog_price_rule_priority_2 %isolation% - Priority 2, -10 By fixed amount - Active - - - main_website - - - - NOT LOGGED IN - - 2 - By Fixed Amount - 10 - - - - Active Catalog Rule with conditions %isolation% - Rule Description - Active - - - main_website - - - - NOT LOGGED IN - General - Wholesale - Retailer - - [Category|is|2] - By Percentage of the Original Price - 10 - - - diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestCase/AbstractCatalogRuleEntityTest.php b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestCase/AbstractCatalogRuleEntityTest.php deleted file mode 100644 index af95ca20d7a..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestCase/AbstractCatalogRuleEntityTest.php +++ /dev/null @@ -1,93 +0,0 @@ -objectManager->create('Mage\CatalogRule\Test\TestStep\DeleteAllCatalogRulesStep')->run(); - } - - /** - * Injection data. - * - * @param CatalogRuleIndex $catalogRuleIndex - * @param CatalogRuleEdit $catalogRuleEdit - * @param FixtureFactory $fixtureFactory - * @return void - */ - public function __inject( - CatalogRuleIndex $catalogRuleIndex, - CatalogRuleEdit $catalogRuleEdit, - FixtureFactory $fixtureFactory - ) { - $this->catalogRuleIndex = $catalogRuleIndex; - $this->catalogRuleEdit = $catalogRuleEdit; - $this->fixtureFactory = $fixtureFactory; - } - - /** - * Clear data after test. - * - * @return void - */ - public function tearDown() - { - $this->objectManager->create('Mage\CatalogRule\Test\TestStep\DeleteAllCatalogRulesStep')->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestCase/ApplySeveralCatalogPriceRuleEntityTest.php b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestCase/ApplySeveralCatalogPriceRuleEntityTest.php deleted file mode 100644 index 713b81cfb7d..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestCase/ApplySeveralCatalogPriceRuleEntityTest.php +++ /dev/null @@ -1,72 +0,0 @@ -catalogRuleIndex->open(); - foreach ($catalogRulesOriginal as $key => $catalogPriceRule) { - if ($catalogPriceRule === '-') { - continue; - } - $this->catalogRules[$key] = $this->fixtureFactory->createByCode( - 'catalogRule', - ['dataset' => $catalogPriceRule] - ); - $this->catalogRules[$key]->persist(); - - $filter = [ - 'name' => $this->catalogRules[$key]->getName(), - 'rule_id' => $this->catalogRules[$key]->getId(), - ]; - $this->catalogRuleIndex->getCatalogRuleGrid()->searchAndOpen($filter); - $this->catalogRuleEdit->getFormPageActions()->saveAndApply(); - } - // Create product - $productSimple = $this->fixtureFactory->createByCode( - 'catalogProductSimple', - ['dataset' => 'simple_for_salesrule_1'] - ); - $productSimple->persist(); - - return ['product' => $productSimple]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestCase/ApplySeveralCatalogPriceRuleEntityTest.xml b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestCase/ApplySeveralCatalogPriceRuleEntityTest.xml deleted file mode 100644 index 7ad69197135..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestCase/ApplySeveralCatalogPriceRuleEntityTest.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - catalog_price_rule_priority_0 - - - catalog_price_rule_priority_2 - 100 - 40 - 60 - 40 - 100 - main:ce - - - - - - catalog_price_rule_priority_0 - catalog_price_rule_priority_1_stop_further_rules - catalog_price_rule_priority_2 - 100 - 45 - 55 - 45 - 100 - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestCase/CreateCatalogPriceRuleEntityTest.php b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestCase/CreateCatalogPriceRuleEntityTest.php deleted file mode 100644 index cb2aef281ca..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestCase/CreateCatalogPriceRuleEntityTest.php +++ /dev/null @@ -1,49 +0,0 @@ - Catalog Price Rules. - * 3. Click "Add New Rule" button. - * 4. Fill in data according to dataset. - * 5. Save catalog price rule. - * 6. Perform all assertions. - * - * @group Catalog_Price_Rules_(MX) - * @ZephyrId MPERF-6774 - */ -class CreateCatalogPriceRuleEntityTest extends AbstractCatalogRuleEntityTest -{ - /** - * Create Catalog Price Rule test. - * - * @param CatalogRule $catalogPriceRule - * @return void - */ - public function test(CatalogRule $catalogPriceRule) - { - // Steps: - $this->catalogRuleIndex->open(); - $this->catalogRuleIndex->getGridPageActions()->addNew(); - $this->catalogRuleEdit->getEditForm()->fill($catalogPriceRule); - $this->catalogRuleEdit->getFormPageActions()->save(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestCase/CreateCatalogPriceRuleEntityTest.xml b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestCase/CreateCatalogPriceRuleEntityTest.xml deleted file mode 100644 index 67152c721ac..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestCase/CreateCatalogPriceRuleEntityTest.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - CatalogPriceRule %isolation% - Catalog Price Rule Description - Active - Wholesale - By Percentage of the Original Price - 50 - - - - - - - CatalogPriceRule %isolation% - Catalog Price Rule Description - Inactive - General - By Fixed Amount - 10 - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestCase/DeleteCatalogPriceRuleEntityTest.php b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestCase/DeleteCatalogPriceRuleEntityTest.php deleted file mode 100644 index c6e571ab37b..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestCase/DeleteCatalogPriceRuleEntityTest.php +++ /dev/null @@ -1,86 +0,0 @@ - Catalog Price Rules. - * 3. Select required catalog price rule from preconditions. - * 4. Click on the "Delete" button. - * 5. Perform all assertions. - * - * @group Catalog_Price_Rules_(MX) - * @ZephyrId MPERF-7033 - */ -class DeleteCatalogPriceRuleEntityTest extends Injectable -{ - /** - * Catalog Rule index page. - * - * @var CatalogRuleIndex - */ - protected $catalogRuleIndex; - - /** - * Catalog Rule edit page. - * - * @var CatalogRuleEdit - */ - protected $catalogRuleEdit; - - /** - * Injection data. - * - * @param CatalogRuleIndex $catalogRuleIndex - * @param CatalogRuleEdit $catalogRuleEdit - * @return void - */ - public function __inject(CatalogRuleIndex $catalogRuleIndex, CatalogRuleEdit $catalogRuleEdit) - { - $this->catalogRuleIndex = $catalogRuleIndex; - $this->catalogRuleEdit = $catalogRuleEdit; - } - - /** - * Delete Catalog Price Rule test. - * - * @param CatalogRule $catalogPriceRule - * @return void - */ - public function test(CatalogRule $catalogPriceRule) - { - // Precondition - $catalogPriceRule->persist(); - - $filter = [ - 'name' => $catalogPriceRule->getName(), - 'rule_id' => $catalogPriceRule->getId(), - ]; - // Steps - $this->catalogRuleIndex->open(); - $this->catalogRuleIndex->getCatalogRuleGrid()->searchAndOpen($filter); - $this->catalogRuleEdit->getFormPageActions()->delete(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestCase/DeleteCatalogPriceRuleEntityTest.xml b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestCase/DeleteCatalogPriceRuleEntityTest.xml deleted file mode 100644 index c1eb11fd992..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestCase/DeleteCatalogPriceRuleEntityTest.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - active_catalog_price_rule_with_conditions - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestStep/CreateCatalogRuleStep.php b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestStep/CreateCatalogRuleStep.php deleted file mode 100644 index 7b3fff2bcf0..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestStep/CreateCatalogRuleStep.php +++ /dev/null @@ -1,70 +0,0 @@ -fixtureFactory = $fixtureFactory; - $this->catalogRule = empty($catalogRule) ? null : $catalogRule; - } - - /** - * Create catalog rule - * - * @return array - */ - public function run() - { - $result['catalogRule'] = null; - if (!empty($this->catalogRule) && $this->catalogRule != '-') { - $catalogRule = $this->fixtureFactory->createByCode( - 'catalogRule', - ['dataset' => $this->catalogRule] - ); - $catalogRule->persist(); - $result['catalogRule'] = $catalogRule; - } - - return $result; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestStep/DeleteAllCatalogRulesStep.php b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestStep/DeleteAllCatalogRulesStep.php deleted file mode 100644 index c09cf7e10e5..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestStep/DeleteAllCatalogRulesStep.php +++ /dev/null @@ -1,66 +0,0 @@ -catalogRuleIndex = $catalogRuleIndex; - $this->catalogRuleEdit = $catalogRuleEdit; - } - - /** - * Delete Catalog Rule on backend. - * - * @return array - */ - public function run() - { - $this->catalogRuleIndex->open(); - $this->catalogRuleIndex->getCatalogRuleGrid()->resetFilter(); - while ($this->catalogRuleIndex->getCatalogRuleGrid()->isFirstRowVisible()) { - $this->catalogRuleIndex->getCatalogRuleGrid()->openFirstRow(); - $this->catalogRuleEdit->getFormPageActions()->delete(); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestStep/SaveAndApplyCatalogRuleStep.php b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestStep/SaveAndApplyCatalogRuleStep.php deleted file mode 100644 index 4c91dcea1ad..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestStep/SaveAndApplyCatalogRuleStep.php +++ /dev/null @@ -1,75 +0,0 @@ -catalogRuleIndex = $catalogRuleIndex; - $this->catalogRuleEdit = $catalogRuleEdit; - $this->catalogRuleId = $catalogRuleId; - } - - /** - * Save and apply catalog rule on backend. - * - * @return void - */ - public function run() - { - $this->catalogRuleIndex->open(); - $this->catalogRuleIndex->getCatalogRuleGrid()->searchAndOpen(['rule_id' => $this->catalogRuleId]); - $this->catalogRuleEdit->getFormPageActions()->saveAndApply(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/etc/curl/di.xml deleted file mode 100644 index 089ff52bcf0..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/etc/curl/di.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/etc/fixture.xml deleted file mode 100644 index 06a6e56dabe..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/etc/fixture.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - flat - catalogrule - Mage\CatalogRule\Model\Resource\Rule\Product\Price\Collection - - diff --git a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Block/Advanced/Form.php b/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Block/Advanced/Form.php deleted file mode 100644 index 91adc94cad4..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Block/Advanced/Form.php +++ /dev/null @@ -1,51 +0,0 @@ -_rootElement->getElements($this->fieldSelector); - foreach ($elements as $element) { - $labels[] = $element->find($this->labelSelector)->getText(); - } - return $labels; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Constraint/AssertSearchTermForm.php b/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Constraint/AssertSearchTermForm.php deleted file mode 100644 index 56e2edcee97..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Constraint/AssertSearchTermForm.php +++ /dev/null @@ -1,66 +0,0 @@ -open()->getGrid()->searchAndOpen(['search_query' => $searchTerm->getQueryText()]); - \PHPUnit_Framework_Assert::assertEquals( - $searchTerm->getData(), - $editPage->getForm()->getData($searchTerm), - 'This form "Search Term" does not match the fixture data.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Search Term form correspond to the data passed from fixture.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Constraint/AssertSearchTermInGrid.php b/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Constraint/AssertSearchTermInGrid.php deleted file mode 100644 index 8e6771c1833..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Constraint/AssertSearchTermInGrid.php +++ /dev/null @@ -1,68 +0,0 @@ -open(); - $filters = [ - 'search_query' => $searchTerm->getQueryText(), - 'synonym_for' => $searchTerm->getSynonymFor(), - 'redirect' => $searchTerm->getRedirect(), - 'display_in_terms' => $searchTerm->getDisplayInTerms(), - ]; - - $indexPage->getGrid()->search($filters); - \PHPUnit_Framework_Assert::assertTrue( - $indexPage->getGrid()->isRowVisible($filters, false), - 'Row terms according to the filters is not found.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Row term according to the filters is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Constraint/AssertSearchTermOnFrontend.php b/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Constraint/AssertSearchTermOnFrontend.php deleted file mode 100644 index c7afb603f03..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Constraint/AssertSearchTermOnFrontend.php +++ /dev/null @@ -1,108 +0,0 @@ -searchBlock = $cmsIndex->open()->getSearchBlock(); - - if ($searchTerm->hasData('display_in_terms') && $searchTerm->getDisplayInTerms() === 'Yes') { - $errors = (!$this->isSugestSearchisVisible( - $searchTerm - )) ? '- block "Suggest Search" when searching was not found' : []; - } - - $this->searchBlock->search($searchTerm->getQueryText()); - $windowUrl = $browser->getUrl(); - $redirectUrl = $searchTerm->getRedirect(); - if ($windowUrl !== $redirectUrl) { - $errors[] = '- url window (' . $windowUrl . ') does not match the url redirect(' . $redirectUrl . ')'; - } - - \PHPUnit_Framework_Assert::assertEmpty($errors, $errors); - } - - /** - * Check suggest block visibility. - * - * @param CatalogSearchQuery $searchTerm - * @return bool - */ - protected function isSugestSearchIsVisible(CatalogSearchQuery $searchTerm) - { - $queryText = $searchTerm->getQueryText(); - $this->searchBlock->fillSearch($queryText); - if ($searchTerm->hasData('num_results')) { - $isVisible = $this->searchBlock->isSuggestSearchVisible( - $queryText, - $searchTerm->getNumResults() - ); - } else { - $isVisible = $this->searchBlock->isSuggestSearchVisible($queryText); - } - - return $isVisible; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Checking "Search terms" on frontend successful.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Constraint/AssertSearchTermSuccessSaveMessage.php b/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Constraint/AssertSearchTermSuccessSaveMessage.php deleted file mode 100644 index b27e53f709b..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Constraint/AssertSearchTermSuccessSaveMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Search term success save message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Constraint/AssertSearchTermSynonymOnFrontend.php b/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Constraint/AssertSearchTermSynonymOnFrontend.php deleted file mode 100644 index 1a86895fcd3..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Constraint/AssertSearchTermSynonymOnFrontend.php +++ /dev/null @@ -1,59 +0,0 @@ -open()->getSearchBlock()->search($searchTerm->getSynonymFor()); - \PHPUnit_Framework_Assert::assertEquals( - $searchTerm->getRedirect(), - $browser->getUrl(), - 'Redirect by synonym was not executed.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Redirect by synonym executed successfully.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Constraint/AssertSuggestSearchingResult.php b/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Constraint/AssertSuggestSearchingResult.php deleted file mode 100644 index 4aea30bc157..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Constraint/AssertSuggestSearchingResult.php +++ /dev/null @@ -1,58 +0,0 @@ -open(); - $searchBlock = $cmsIndex->getSearchBlock(); - $queryText = $catalogSearch->getQueryText(); - $searchBlock->fillSearch($queryText); - - $isVisible = $catalogSearch->hasData('num_results') - ? $searchBlock->isSuggestSearchVisible($queryText, $catalogSearch->getNumResults()) - : $searchBlock->isSuggestSearchVisible($queryText); - - \PHPUnit_Framework_Assert::assertTrue($isVisible, 'Block "Suggest Search" when searching was not found.'); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Asserts that window contains requested entity and quantity.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Fixture/CatalogSearchQuery.xml b/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Fixture/CatalogSearchQuery.xml deleted file mode 100644 index a3bc1568464..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Fixture/CatalogSearchQuery.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Fixture/CatalogSearchQuery/QueryText.php b/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Fixture/CatalogSearchQuery/QueryText.php deleted file mode 100644 index e3cc1a534af..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Fixture/CatalogSearchQuery/QueryText.php +++ /dev/null @@ -1,114 +0,0 @@ -params = $params; - $explodeValue = explode('::', $data['value']); - if (!empty($explodeValue) && count($explodeValue) > 1) { - $fixtureCode = $explodeValue[0]; - $dataset = isset($explodeValue[2]) ? $explodeValue[1] : ''; - $searchValue = isset($explodeValue[2]) ? $explodeValue[2] : $explodeValue[1]; - $this->product = $fixtureFactory->createByCode($fixtureCode, ['dataset' => $dataset]); - if (!$this->product->hasData('id')) { - $this->product->persist(); - } - if ($this->product->hasData($searchValue)) { - $getProperty = 'get' . str_replace(' ', '', ucwords(str_replace('_', ' ', $searchValue))); - $this->data = $this->product->$getProperty(); - } else { - $this->data = $searchValue; - } - } else { - $this->data = strval($data['value']); - } - } - - /** - * Persist catalog search query. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data. - * - * @param string|null $key - * @return string - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings. - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Get product fixture to search. - * - * @return InjectableFixture - */ - public function getProduct() - { - return $this->product; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Page/Adminhtml/CatalogSearchEdit.xml b/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Page/Adminhtml/CatalogSearchEdit.xml deleted file mode 100644 index 574384b771d..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Page/Adminhtml/CatalogSearchEdit.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Page/Adminhtml/CatalogSearchIndex.xml b/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Page/Adminhtml/CatalogSearchIndex.xml deleted file mode 100644 index 344da335419..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Page/Adminhtml/CatalogSearchIndex.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Page/CatalogsearchAdvanced.xml b/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Page/CatalogsearchAdvanced.xml deleted file mode 100644 index fa7e93757b5..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Page/CatalogsearchAdvanced.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Page/CatalogsearchResult.xml b/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Page/CatalogsearchResult.xml deleted file mode 100644 index dbb9db343f8..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Page/CatalogsearchResult.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/TestCase/CreateSearchTermEntityTest.php b/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/TestCase/CreateSearchTermEntityTest.php deleted file mode 100644 index cb2f63cca41..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/TestCase/CreateSearchTermEntityTest.php +++ /dev/null @@ -1,81 +0,0 @@ - Search Terms. - * 5. Click "Add New Search Term" button. - * 6. Fill out all data according to dataset. - * 7. Save the Search Term. - * 8. Perform all assertions. - * - * @group Search_Terms_(MX) - * @ZephyrId MPERF-7591 - */ -class CreateSearchTermEntityTest extends Injectable -{ - /** - * Search term page. - * - * @var CatalogSearchIndex - */ - protected $indexPage; - - /** - * Search term edit page. - * - * @var CatalogSearchEdit - */ - protected $editPage; - - /** - * Inject pages. - * - * @param CatalogSearchIndex $indexPage - * @param CatalogSearchEdit $editPage - * @return void - */ - public function __inject(CatalogSearchIndex $indexPage, CatalogSearchEdit $editPage) - { - $this->indexPage = $indexPage; - $this->editPage = $editPage; - } - - /** - * Run create search term test. - * - * @param CatalogSearchQuery $searchTerm - * @return void - */ - public function test(CatalogSearchQuery $searchTerm) - { - // Steps - $this->indexPage->open(); - $this->indexPage->getGridPageActions()->addNew(); - $this->editPage->getForm()->fill($searchTerm); - $this->editPage->getFormPageActions()->save(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/TestCase/CreateSearchTermEntityTest.xml b/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/TestCase/CreateSearchTermEntityTest.xml deleted file mode 100644 index a9350c446ae..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/TestCase/CreateSearchTermEntityTest.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - catalogProductSimple::sku - Search Term Synonym %isolation% - http://example.com/ - No - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/TestCase/SuggestSearchingResultEntityTest.php b/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/TestCase/SuggestSearchingResultEntityTest.php deleted file mode 100644 index 881e8b2005d..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/TestCase/SuggestSearchingResultEntityTest.php +++ /dev/null @@ -1,49 +0,0 @@ -open(); - $cmsIndex->getSearchBlock()->search($catalogSearch->getQueryText()); - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/TestCase/SuggestSearchingResultEntityTest.xml b/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/TestCase/SuggestSearchingResultEntityTest.xml deleted file mode 100644 index e3267a7088a..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/TestCase/SuggestSearchingResultEntityTest.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - catalogProductSimple::name - main:ce - - - - catalogProductSimple::sku - 1 - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/AbstractItem.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/AbstractItem.php deleted file mode 100644 index a236537a8ed..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/AbstractItem.php +++ /dev/null @@ -1,179 +0,0 @@ - ['selector' => '.product-cart-price .cart-price .price'], - 'subtotal' => ['selector' => '.product-cart-total .cart-price .price'], - 'cart_item_price' => ['selector' => '.product-cart-price .cart-price .price'], - 'cart_item_subtotal' => ['selector' => '.product-cart-total .cart-price .price'], - 'cart_item_price_excl_tax' => ['selector' => '.product-cart-price[data-rwd-tax-label="Excl. Tax"]'], - 'cart_item_price_incl_tax' => ['selector' => '.product-cart-price[data-rwd-tax-label="Incl. Tax"]'], - 'cart_item_subtotal_excl_tax' => [ - 'selector' => '//td[@class="product-cart-total"][1]//*[@class="cart-price"]//span[@class="price"]', - 'strategy' => Locator::SELECTOR_XPATH - ], - 'cart_item_subtotal_incl_tax' => [ - 'selector' => '//td[@class="product-cart-total"][2]//*[@class="cart-price"]//span[@class="price"]', - 'strategy' => Locator::SELECTOR_XPATH - ] - ]; - - /** - * Selector for product name. - * - * @var string - */ - protected $productName = '.product-name > a'; - - /** - * Quantity input selector. - * - * @var string - */ - protected $qty = '.input-text.qty'; - - /** - * Selector for options block. - * - * @var string - */ - protected $optionsBlock = 'dl.item-options'; - - /** - * Get product name. - * - * @return string - */ - public function getProductName() - { - return $this->_rootElement->find($this->productName)->getText(); - } - - /** - * Get product quantity. - * - * @return string - */ - public function getQty() - { - return $this->_rootElement->find($this->qty)->getValue(); - } - - /** - * Set product quantity. - * - * @param int $qty - * @return void - */ - public function setQty($qty) - { - $this->_rootElement->find($this->qty)->setValue($qty); - } - - /** - * Get price type. - * - * @param string $priceType - * @return string - */ - public function getCartItemTypePrice($priceType) - { - $strategy = isset($this->pricesType[$priceType]['strategy']) - ? $this->pricesType[$priceType]['strategy'] - : Locator::SELECTOR_CSS; - $selector = $this->prepareSelector($priceType); - $price = $this->_rootElement->find($selector, $strategy)->getText(); - - return $this->escapeCurrency($price); - } - - /** - * Get product options from cart. - * - * @param ElementInterface $element - * @return array - */ - public function getOptions(ElementInterface $element = null) - { - $element = ($element == null) ? $this->_rootElement : $element; - $optionsBlock = $element->find($this->optionsBlock); - $options = []; - - if ($optionsBlock->isVisible()) { - $titles = $optionsBlock->getElements('./dt', Locator::SELECTOR_XPATH); - $values = $optionsBlock->getElements('./dd', Locator::SELECTOR_XPATH); - - foreach ($titles as $key => $title) { - $value = $values[$key]->getText(); - $options[] = [ - 'title' => str_replace(':', '', $title->getText()), - 'value' => $this->escapeCurrencyForOption($value), - ]; - } - } - - return $options; - } - - /** - * Escape currency in option label. - * - * @param string $label - * @return string - */ - protected function escapeCurrencyForOption($label) - { - return preg_replace('/^(\d+) x (\w+) \W([\d\.,]+)$/', '$1 x $2 $3', $label); - } - - /** - * Prepare selector for field. - * - * @param string $field - * @return string - */ - protected function prepareSelector($field) - { - return $this->pricesType[$field]['selector']; - } - - /** - * Escape currency in price. - * - * @param string $price - * @return string|null - */ - protected function escapeCurrency($price) - { - preg_match("/^\\D*\\s*([\\d,\\.]+)\\s*\\D*$/", $price, $matches); - return (isset($matches[1])) ? $matches[1] : null; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Cart.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Cart.php deleted file mode 100644 index c64bac8935d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Cart.php +++ /dev/null @@ -1,195 +0,0 @@ -getDataConfig(); - $typeId = isset($dataConfig['type_id']) ? $dataConfig['type_id'] : null; - $cartItem = null; - - if ($this->hasRender($typeId)) { - $cartItem = $this->callRender($typeId, 'getCartItem', ['product' => $product]); - } else { - $cartItemBlock = $this->_rootElement->find( - sprintf($this->cartItemByProductName, $product->getName()), - Locator::SELECTOR_XPATH - ); - $cartItem = $this->blockFactory->create( - $this->cartItemClass, - ['element' => $cartItemBlock] - ); - } - - return $cartItem; - } - - /** - * Check if a product has been successfully added to the cart. - * - * @param InjectableFixture $product - * @return boolean - */ - public function isProductInShoppingCart(InjectableFixture $product) - { - return $this->getCartItem($product)->isVisible(); - } - - /** - * Clear shopping cart. - * - * @return void - */ - public function clearShoppingCart() - { - if (!$this->_rootElement->find($this->emptyShoppingCart)->isVisible()){ - $clearShoppingCart = $this->_rootElement->find($this->clearShoppingCart); - if ($clearShoppingCart->isVisible()) { - $clearShoppingCart->click(); - } - } - } - - /** - * Get Proceed to checkout block. - * - * @return Link - */ - public function getProceedToCheckoutBlock() - { - return $this->blockFactory->create( - 'Mage\Checkout\Test\Block\Onepage\Link', - ['element' => $this->_rootElement->find($this->proceedToCheckoutButton)] - ); - } - - /** - * Get express shortcut block. - * - * @return Shortcut - */ - public function getExpressShortcutBlock() - { - return $this->blockFactory->create( - 'Mage\Paypal\Test\Block\Express\Shortcut', - ['element' => $this->_rootElement->find($this->payPalExpressCheckout)] - ); - } - - /** - * Update shopping cart. - * - * @return void - */ - public function updateShoppingCart() - { - $this->_rootElement->find($this->updateShoppingCart)->click(); - } - - /** - * Click on 'Checkout with Multiple Addresses' link. - * - * @return void - */ - public function clickCheckoutWithMultiAddress() - { - $this->_rootElement->find($this->checkoutWithMultiAddress)->click(); - } - - /** - * Check that empty cart block is visible. - * - * @return bool - */ - public function emptyCartBlockIsVisible() - { - return $this->_rootElement->find($this->emptyShoppingCart)->isVisible(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Cart/CartItem.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Cart/CartItem.php deleted file mode 100644 index 6625996e06f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Cart/CartItem.php +++ /dev/null @@ -1,92 +0,0 @@ -_rootElement->find($this->msrp)->isVisible(); - } - - /** - * Check that edit button visible. - * - * @return bool - */ - public function isEditButtonVisible() - { - return $this->_rootElement->find($this->edit)->isVisible(); - } - - /** - * Click on move to wishlist button. - * - * @return void - */ - public function moveToWishlist() - { - $this->_rootElement->find($this->wishlistButton)->click(); - } - - /** - * Remove product item from cart. - * - * @return void - */ - public function removeItem() - { - $this->_rootElement->find($this->removeItem)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Cart/DiscountCodes.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Cart/DiscountCodes.php deleted file mode 100644 index 797a4c7dcf9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Cart/DiscountCodes.php +++ /dev/null @@ -1,51 +0,0 @@ -_rootElement->find($this->couponCode, Locator::SELECTOR_CSS)->setValue($code); - $this->_rootElement->find($this->applyButton, Locator::SELECTOR_CSS)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Cart/Shipping.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Cart/Shipping.php deleted file mode 100644 index b83f88b466c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Cart/Shipping.php +++ /dev/null @@ -1,82 +0,0 @@ -_rootElement->find($this->estimateButton)->click(); - } - - /** - * Select shipping method. - * - * @param array $shipping - * @return void - */ - public function selectShippingMethod(array $shipping) - { - $selector = sprintf($this->shippingMethod, $shipping['shipping_service'], $shipping['shipping_method']); - $this->_rootElement->find($selector, Locator::SELECTOR_XPATH)->click(); - $this->_rootElement->find($this->updateTotalSelector, Locator::SELECTOR_CSS)->click(); - } - - /** - * Fill shipping and tax form. - * - * @param Address $address - * @return void - */ - public function fillEstimateShippingAndTax(Address $address) - { - $this->fill($address); - $this->clickEstimate(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Cart/Shipping.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Cart/Shipping.xml deleted file mode 100644 index 4c97b44f79d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Cart/Shipping.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - select - - - select - - - - #postcode - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Cart/Sidebar.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Cart/Sidebar.php deleted file mode 100644 index 57f77b5dc51..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Cart/Sidebar.php +++ /dev/null @@ -1,38 +0,0 @@ - [ - 'selector' => '//tr[normalize-space(td)="Grand Total"]//span', - 'is_required' - ], - 'subtotal' => [ - 'selector' => '//tr[normalize-space(td)="Subtotal"]//span', - 'is_required' - ], - 'subtotal_excl_tax' => [ - 'selector' => '//tr[normalize-space(td)="Subtotal (Excl. Tax)"]//span', - 'is_required' - ], - 'subtotal_incl_tax' => [ - 'selector' => '//tr[normalize-space(td)="Subtotal (Incl. Tax)"]//span', - 'is_required' - ], - 'discount' => [ - 'selector' => '//tr[td[contains(text(),"Discount")]]//span' - ], - 'shipping_excl_tax' => [ - 'selector' => '//tr[.//*[contains(.,"Shipping") and contains(.,"Excl. Tax")]]//span' - ], - 'shipping_incl_tax' => [ - 'selector' => '//tr[.//*[contains(.,"Shipping") and contains(.,"Incl. Tax")]]//span' - ], - 'tax' => [ - 'selector' => '//tr[normalize-space(td)="Tax"]//span', - 'is_required' - ], - 'grand_total_excl_tax' => [ - 'selector' => '//tr[.//*[contains(.,"Grand Total") and contains(.,"Excl. Tax")]]//span', - 'is_required' - ], - 'grand_total_incl_tax' => [ - 'selector' => '//tr[.//*[contains(.,"Grand Total") and contains(.,"Incl. Tax")]]//span', - 'is_required' - ], - 'shipping_price' => [ - 'selector' => '//td[contains(.,"Shipping &")]/following-sibling::td/span[contains(@class,"price")]', - 'is_required' - ] - ]; - - /** - * Shipping price block selector. - * - * @var string - */ - protected $shippingPriceBlockSelector = '//td[contains(.,"Shipping & Handling")]'; - - /** - * Get data from block. - * - * @param string $type - * @return null|string - */ - public function getData($type) - { - $selector = $this->prepareSelector($type); - $element = $this->_rootElement->find($selector, Locator::SELECTOR_XPATH); - return isset($this->fieldType[$type]['is_required']) - ? $this->escapeCurrency($element->getText()) - : ($element->isVisible() ? $this->escapeCurrency($element->getText()) : null); - } - - /** - * Prepare selector. - * - * @param string $type - * @return string - */ - protected function prepareSelector($type) - { - return $this->fieldType[$type]['selector']; - } - - /** - * Method that escapes currency symbols. - * - * @param string $price - * @return string|null - */ - protected function escapeCurrency($price) - { - preg_match("/^\\D*\\s*([\\d,\\.]+)\\s*\\D*$/", $price, $matches); - return (isset($matches[1])) ? $matches[1] : null; - } - - /** - * Check that shipping price block is visible. - * - * @return bool - */ - public function isVisibleShippingPriceBlock() - { - return $this->_rootElement->find($this->shippingPriceBlockSelector, Locator::SELECTOR_XPATH)->isVisible(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/GroupedProductCart.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/GroupedProductCart.php deleted file mode 100644 index 6a8f7ede568..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/GroupedProductCart.php +++ /dev/null @@ -1,65 +0,0 @@ -blockFactory->create( - 'Mage\Checkout\Test\Block\GroupedProductCart\CartItem', - [ - 'element' => $this->_rootElement, - 'config' => [ - 'associated_cart_items' => $this->getAssociatedItems($product), - ] - ] - ); - } - - /** - * Get associated items for grouped product. - * - * @param InjectableFixture $product - * @return array - */ - protected function getAssociatedItems(InjectableFixture $product) - { - $cartItems = []; - - /** @var GroupedProduct $product */ - $associatedProducts = $product->getDataFieldConfig('associated')['source']->getProducts(); - foreach ($associatedProducts as $product) { - $cartItems[$product->getSku()] = parent::getCartItem($product); - } - - return $cartItems; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/GroupedProductCart/CartItem.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/GroupedProductCart/CartItem.php deleted file mode 100644 index 9a172481cdf..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/GroupedProductCart/CartItem.php +++ /dev/null @@ -1,158 +0,0 @@ -config['associated_cart_items'] as $productSku => $cartItem) { - /** @var CheckoutCartItem $cartItem */ - $result[$productSku] = $cartItem->getPrice(); - } - - return $result; - } - - /** - * Set product quantity. - * - * @param array $data - * @return void - */ - public function setQty($data) - { - foreach ($data as $productSku => $qty) { - /** @var CheckoutCartItem $cartItem */ - $cartItem = $this->config['associated_cart_items'][$productSku]; - $cartItem->setQty($qty); - } - } - - /** - * Get product quantity. - * - * @return string - */ - public function getQty() - { - $result = []; - foreach ($this->config['associated_cart_items'] as $productSku => $cartItem) { - /** @var CheckoutCartItem $cartItem */ - $result[$productSku] = $cartItem->getQty(); - } - - return $result; - } - - /** - * Get sub-total for the specified item in the cart. - * - * @return string - */ - public function getSubtotalPrice() - { - $result = []; - foreach ($this->config['associated_cart_items'] as $productSku => $cartItem) { - /** @var CheckoutCartItem $cartItem */ - $result[$productSku] = $cartItem->getSubtotalPrice(); - } - - return $result; - } - - /** - * Get product options in the cart. - * - * @param ElementInterface $element - * @return string - */ - public function getOptions(ElementInterface $element = null) - { - $result = []; - foreach ($this->config['associated_cart_items'] as $cartItem) { - /** @var CheckoutCartItem $cartItem */ - $result[] = [ - 'title' => strtolower($cartItem->getProductName()), - 'value' => $cartItem->getQty(), - ]; - } - - return $result; - } - - /** - * Get products sku. - * - * @return array - */ - public function getProductsSku() - { - $elementsData = []; - $elements = $this->_rootElement->getElements($this->productSku); - foreach ($elements as $element) { - $elementsData[] = str_replace('SKU: ', '', $element->getText()); - } - - return $elementsData; - } - - /** - * Get price type. - * - * @param string $priceType - * @return string - */ - public function getCartItemTypePrice($priceType) - { - $result = []; - foreach ($this->config['associated_cart_items'] as $key => $cartItem) { - $result[$key] = $cartItem->getCartItemTypePrice($priceType); - } - return $result; - } - - /** - * Remove product item from cart. - * - * @return void - */ - public function removeItem() - { - foreach ($this->config['associated_cart_items'] as $key => $cartItem) { - $this->_rootElement->find($this->removeItem)->click(); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/AbstractMultishipping.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/AbstractMultishipping.php deleted file mode 100644 index 975862b619d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/AbstractMultishipping.php +++ /dev/null @@ -1,68 +0,0 @@ -blockFactory->create($this->getItemsClass(), ['element' => $this->getItemsBlockElement()]); - } - - /** - * Click on 'Continue' button. - * - * @return void - */ - public function clickContinueButton() - { - $this->_rootElement->find($this->continue)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/AbstractMultishipping/AbstractItems.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/AbstractMultishipping/AbstractItems.php deleted file mode 100644 index 133856b94f0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/AbstractMultishipping/AbstractItems.php +++ /dev/null @@ -1,59 +0,0 @@ -blockFactory->create( - $this->getItemBlockClass(), - ['element' => $this->getItemBlockElement($entity, $itemIndex)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Addresses.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Addresses.php deleted file mode 100644 index fd73893d954..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Addresses.php +++ /dev/null @@ -1,76 +0,0 @@ -_rootElement->find($this->enterNewAddress)->click(); - } - - /** - * Get path for items class. - * - * @return string - */ - protected function getItemsClass() - { - return 'Mage\Checkout\Test\Block\Multishipping\Addresses\Items'; - } - - /** - * Get items block element. - * - * @return ElementInterface - */ - protected function getItemsBlockElement() - { - return $this->_rootElement->find($this->itemsBlock); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Addresses/Items.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Addresses/Items.php deleted file mode 100644 index 5429e10b6ed..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Addresses/Items.php +++ /dev/null @@ -1,78 +0,0 @@ -itemBlock, $product->getName()); - ++$itemIndex; - $itemBlockElement = $this->_rootElement->find($itemBlockSelector . "[$itemIndex]", Locator::SELECTOR_XPATH); - if (!$itemBlockElement->isVisible()) { - $itemBlockElement = $this->_rootElement->find($itemBlockSelector, Locator::SELECTOR_XPATH); - } - - return $itemBlockElement; - } - - /** - * Get path for items class. - * - * @return string - */ - protected function getItemBlockClass() - { - return 'Mage\Checkout\Test\Block\Multishipping\Addresses\Items\Item'; - } - - /** - * Click on 'Update Qty & Addresses' button. - */ - public function updateData() - { - $this->_rootElement->find($this->updateDataButton)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Addresses/Items/Item.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Addresses/Items/Item.php deleted file mode 100644 index 9e91356f05b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Addresses/Items/Item.php +++ /dev/null @@ -1,58 +0,0 @@ -prepareAddressData($address); - $this->_rootElement->find($this->address, Locator::SELECTOR_CSS, 'select')->setValue($value); - } - - /** - * Prepare address data. - * - * @param Address $address - * @return string - */ - protected function prepareAddressData(Address $address) - { - return $address->getFirstname() . ' ' . $address->getLastname() . ', ' . $address->getStreet() . ', ' - . $address->getCity() . ', ' . $address->getRegionId() . ' ' . $address->getPostcode() . ', ' - . $address->getCountryId(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Billing.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Billing.php deleted file mode 100644 index 90fc5b092a5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Billing.php +++ /dev/null @@ -1,41 +0,0 @@ -_rootElement->find($this->continue)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Overview.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Overview.php deleted file mode 100644 index 14473ff3e77..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Overview.php +++ /dev/null @@ -1,41 +0,0 @@ -_rootElement->find($this->placeOrder)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Register.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Register.php deleted file mode 100644 index 1d2df8bcbae..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Register.php +++ /dev/null @@ -1,65 +0,0 @@ -getData(); - unset($customerData['address']); - $mapping = $this->dataMapping($customerData); - $this->_fill($mapping); - $address = $customer->getDataFieldConfig('address')['source']->getAddresses()[0]; - $this->fillAddress($address); - $this->_rootElement->find($this->submit)->click(); - } - - /** - * Fill address data. - * - * @param Address $address - * @return void - */ - protected function fillAddress(Address $address) - { - $skipFields = ['email', 'default_shipping']; - $addressData = $address->getData(); - $addressData = array_flip(array_diff(array_flip($addressData), $skipFields)); - $mapping = $this->dataMapping($addressData); - $this->_fill($mapping); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Register.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Register.xml deleted file mode 100644 index d6aaa8cd27f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Register.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - #street_1 - - - - select - - - select - - - - checkbox - - - #confirmation - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Shipping.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Shipping.php deleted file mode 100644 index f8d79526ca3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Shipping.php +++ /dev/null @@ -1,51 +0,0 @@ -_rootElement; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Shipping/Items.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Shipping/Items.php deleted file mode 100644 index c3503e76c05..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Shipping/Items.php +++ /dev/null @@ -1,76 +0,0 @@ -addressFields as $field) { - $conditions[] = "contains(., '{$address->getData($field)}')"; - } - $itemBlockSelector = sprintf($this->itemBlock, implode(' and ', $conditions)); - return $this->_rootElement->find($itemBlockSelector, Locator::SELECTOR_XPATH); - } - - /** - * Get path for items class. - * - * @return string - */ - protected function getItemBlockClass() - { - return 'Mage\Checkout\Test\Block\Multishipping\Shipping\Items\Item'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Shipping/Items/Item.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Shipping/Items/Item.php deleted file mode 100644 index 24ad2550bab..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Shipping/Items/Item.php +++ /dev/null @@ -1,65 +0,0 @@ -_rootElement->find( - sprintf($this->shippingMethodInput, $method['shipping_service'], $method['shipping_method']), - Locator::SELECTOR_XPATH - ); - if ($shippingInput->isVisible()) { - $shippingInput->click(); - } else { - $shippingLabel = $this->_rootElement->find( - sprintf($this->shippingMethodLabel, $method['shipping_method']), - Locator::SELECTOR_XPATH - ); - if (!$shippingLabel->isVisible()) { - throw new \Exception("{$method['shipping_service']} shipping doesn't exist."); - } - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Success.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Success.php deleted file mode 100644 index 4c511be0587..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Success.php +++ /dev/null @@ -1,47 +0,0 @@ -_rootElement->getElements($this->ordersIds); - foreach ($ordersIdsElements as $orderIdElement) { - $ordersIds[] = $orderIdElement->getText(); - } - - return $ordersIds; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/AbstractOnepage.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/AbstractOnepage.php deleted file mode 100644 index 146ff9bbadb..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/AbstractOnepage.php +++ /dev/null @@ -1,71 +0,0 @@ -continue)) { - $this->_rootElement->find($this->continue)->click(); - $this->waitLoader(); - } else { - throw new \Exception('Selector for continue button must be set!'); - } - } - - /** - * Wait for checkout loader. - * - * @return void - */ - protected function waitLoader() - { - $selector = $this->waiterSelector; - $browser = $this->_rootElement; - $browser->waitUntil( - function () use ($browser, $selector) { - $element = $browser->find($selector); - return $element->isVisible() == false ? true : null; - } - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Billing.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Billing.php deleted file mode 100644 index 2bf7c69c2f2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Billing.php +++ /dev/null @@ -1,69 +0,0 @@ -fill($billingAddress); - } - if ($customer) { - if($this->browser->find('[id=\'billing:email\']')->isVisible() && ($customer->getData('email') != null)) { - $this->fill($customer); - } - } - if ($isShippingAddress) { - $this->_rootElement->find($this->useForShipping)->click(); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Billing.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Billing.xml deleted file mode 100644 index 9ea1076a985..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Billing.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - billing - - - - - - - [id='billing:street1'] - - - - select - - - - select - - - - [name='billing[customer_password]'] - - - [name='billing[confirm_password]'] - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Link.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Link.php deleted file mode 100644 index 9cebe3df602..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Link.php +++ /dev/null @@ -1,34 +0,0 @@ -_rootElement->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Login.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Login.php deleted file mode 100644 index 2cbfb16f5b0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Login.php +++ /dev/null @@ -1,85 +0,0 @@ -_rootElement->find($this->guestCheckout)->click(); - } - - /** - * Register customer during checkout. - * - * @return void - */ - public function registerCustomer() - { - $this->_rootElement->find($this->registerCustomer)->click(); - } - - /** - * Login customer during checkout. - * - * @param Customer $customer - * @return void - */ - public function loginCustomer(Customer $customer) - { - $this->fill($customer); - $this->_rootElement->find($this->login)->click(); - $this->waitLoader(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Login.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Login.xml deleted file mode 100644 index 51f28e75355..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Login.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - login - - - [name='login[username]'] - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Payment/Methods.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Payment/Methods.php deleted file mode 100644 index 193e57a58f3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Payment/Methods.php +++ /dev/null @@ -1,110 +0,0 @@ -_rootElement->find(sprintf($this->paymentMethodInput, $payment['method'])); - if ($paymentMethod->isVisible()) { - $paymentMethod->click(); - } else { - $paymentCount = count($this->_rootElement->getElements($this->paymentMethodLabels)); - $paymentMethodLabel = $this->_rootElement->find(sprintf($this->paymentMethodLabel, $payment['method'])); - if ($paymentCount !== 1 && !$paymentMethodLabel->isVisible()) { - throw new \Exception('Such payment method is absent.'); - } - } - if ($payment['method'] == "purchaseorder") { - $this->_rootElement->find($this->purchaseOrderNumber)->setValue($payment['po_number']); - } - if (isset($payment['cc']) && !isset($payment['iframe'])) { - $this->fillCreditCard($payment); - } - } - - /** - * Fill credit card. - * - * @param array $payment - * @return void - */ - protected function fillCreditCard(array $payment) - { - /** @var Cc $formBlock */ - $formBlock = $this->blockFactory->create( - 'Mage\Payment\Test\Block\Form\Cc', - ['element' => $this->_rootElement->find('#payment_form_' . $payment['method'])] - ); - $formBlock->fill($payment['cc']); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Review.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Review.php deleted file mode 100644 index 536a2182c04..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Review.php +++ /dev/null @@ -1,199 +0,0 @@ -hasRender($productType) - ? $this->callRender($productType, 'getItemsBlock') - : $this->blockFactory->create($this->itemsBlock, ['element' => $this->_rootElement->find($this->items)]); - } - - /** - * Get items product block. - * - * @return Totals - */ - public function getTotalBlock() - { - return $this->blockFactory->create( - 'Mage\Checkout\Test\Block\Onepage\Review\Totals', - ['element' => $this->_rootElement->find($this->total)] - ); - } - - /** - * Get 3D secure Form. - * - * @return Centinel - */ - public function getCentinelForm() - { - return $this->blockFactory->create( - 'Mage\Paypal\Test\Block\Form\Centinel', - ['element' => $this->_rootElement->find($this->centinelForm)] - ); - } - - /** - * Get verification response text. - * - * @return string - */ - public function getVerificationResponseText() - { - $this->browser->switchToFrame(new Locator($this->iFrameSelector)); - $responseText = $this->browser->find($this->body)->getText(); - $this->browser->switchToFrame(); - return $responseText; - } - - /** - * Get alert massage. - * - * @return string - */ - protected function getAlertMassage() - { - try { - $alertText = $this->browser->getAlertText(); - } catch (\Exception $e) { - $alertText = ''; - } - return $alertText; - } - - /** - * Set agreement. - * - * @param CheckoutAgreement $agreement - * @param string $value - * @return void - */ - public function setAgreement(CheckoutAgreement $agreement, $value) - { - $agreementsInputSelector = sprintf($this->agreementCheckbox, $agreement->getCheckboxText()); - $this->_rootElement->find($agreementsInputSelector, Locator::SELECTOR_XPATH, 'checkbox')->setValue($value); - } - - /** - * Check agreement. - * - * @param CheckoutAgreement $agreement - * @return bool - */ - public function checkAgreement(CheckoutAgreement $agreement) - { - return $this->_rootElement - ->find(sprintf($this->agreement, $agreement->getCheckboxText()), Locator::SELECTOR_XPATH) - ->isVisible(); - } - - /** - * Click continue button. - * - * @return string - */ - public function clickContinue() - { - $this->_rootElement->find($this->continue)->click(); - $alertText = $this->getAlertMassage(); - $this->waitLoader(); - - return $alertText; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Review/Items.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Review/Items.php deleted file mode 100644 index d2f60652bf9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Review/Items.php +++ /dev/null @@ -1,31 +0,0 @@ - [ - 'selector' => '[data-rwd-label="Price (Excl. Tax)"] span.price' - ], - 'cart_item_price_incl_tax' => [ - 'selector' => '[data-rwd-label="Price (Incl. Tax)"] span.price' - ], - 'cart_item_subtotal_excl_tax' => [ - 'selector' => '[data-rwd-label="Subtotal (Excl. Tax)"] span.price' - ], - 'cart_item_subtotal_incl_tax' => [ - 'selector' => '[data-rwd-label="Subtotal (Incl. Tax)"] span.price' - ], - 'cart_item_price' => ['selector' => '[data-rwd-label="Price"] .cart-price .price'], - 'cart_item_subtotal' => ['selector' => '[data-rwd-label="Subtotal"] .cart-price .price'] - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Review/Totals.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Review/Totals.php deleted file mode 100644 index a86cd8588b1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Review/Totals.php +++ /dev/null @@ -1,24 +0,0 @@ -waitForElementVisible($this->shippingForm); - $shippingInput = $this->_rootElement->find( - sprintf($this->shippingMethodInput, $method['shipping_service'], $method['shipping_method']), - Locator::SELECTOR_XPATH - ); - if ($shippingInput->isVisible()) { - $shippingInput->click(); - } else { - $shippingLabel = $this->_rootElement->find( - sprintf($this->shippingMethodLabel, $method['shipping_method']), - Locator::SELECTOR_XPATH - ); - if (!$shippingLabel->isVisible()) { - throw new \Exception("{$method['shipping_service']} shipping doesn't exist."); - } - } - } - - /** - * Click continue button. - * - * @return void - */ - public function clickContinue() - { - $this->waitForElementNotVisible($this->disableButton); - parent::clickContinue(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Success.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Success.php deleted file mode 100644 index 02d575081a9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Success.php +++ /dev/null @@ -1,62 +0,0 @@ -waitForElementVisible($this->orderIdGuest, Locator::SELECTOR_XPATH); - $orderString = $this->_rootElement->find($this->orderIdGuest, Locator::SELECTOR_XPATH)->getText(); - preg_match('/[\d]+/', $orderString, $orderId); - return end($orderId); - } - - /** - * Click order id link. - * - * @return void - */ - public function openOrder() - { - $this->_rootElement->find($this->orderId, Locator::SELECTOR_CSS)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AbstractAssertProductInShoppingCart.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AbstractAssertProductInShoppingCart.php deleted file mode 100644 index 5bbfc43511f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AbstractAssertProductInShoppingCart.php +++ /dev/null @@ -1,111 +0,0 @@ -open(); - /** @var Items $sourceProducts */ - $sourceProducts = $cart->getDataFieldConfig('items')['source']; - $products = $sourceProducts->getProducts(); - $items = $cart->getItems(); - $productsData = []; - $cartData = []; - - foreach ($items as $key => $item) { - /** @var CatalogProductSimple $product */ - $product = $products[$key]; - $data = isset($verifyData[$key]) ? $verifyData[$key] : []; - $productName = $product->getName(); - /** @var FixtureInterface $item */ - $checkoutItem = $item->getData(); - $cartItem = $checkoutCart->getCartBlock()->getCartItem($product); - - $productsData[$productName] = $this->getProductData($checkoutItem, $data); - $cartData[$productName] = $this->getCartData($cartItem); - } - - $error = $this->verifyContainsData($productsData, $cartData); - \PHPUnit_Framework_Assert::assertEmpty($error, $error); - } - - /** - * Verify product data. - * - * @param array $productsData - * @param array $cartData - * @return array|string - */ - protected function verifyContainsData(array $productsData, array $cartData) - { - return $this->verifyData($productsData, $cartData, true); - } - - /** - * Get cart data. - * - * @param CartItem $cartItem - * @return array - */ - protected function getCartData(CartItem $cartItem) - { - return [$this->dataType => $cartItem->getCartItemTypePrice($this->dataType)]; - } - - /** - * Get product data. - * - * @param array $checkoutItem - * @param array $verifyData - * @return array - */ - protected function getProductData(array $checkoutItem, array $verifyData) - { - return [ - $this->dataType => isset($verifyData[$this->dataType]) - ? $verifyData[$this->dataType] - : $checkoutItem[$this->dataType] - ]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertAbstractOrderAddressSameAsPaypal.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertAbstractOrderAddressSameAsPaypal.php deleted file mode 100644 index 0188eecb957..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertAbstractOrderAddressSameAsPaypal.php +++ /dev/null @@ -1,123 +0,0 @@ - ['city', 'region', 'region_id', 'postcode'], - ['country_id'], - ['telephone'] - ]; - - /** - * Assert that address on order page in backend is same as address in PayPal. - * - * @param SalesOrderIndex $salesOrderIndex - * @param SalesOrderView $salesOrderView - * @param PaypalCustomer $paypalCustomer - * @param string $orderId - * @return void - */ - public function processAssert( - SalesOrderIndex $salesOrderIndex, - SalesOrderView $salesOrderView, - PaypalCustomer $paypalCustomer, - $orderId - ) - { - $addressBlock = "get{$this->addressType}AddressBlock"; - $salesOrderIndex->open()->getSalesOrderGrid()->searchAndOpen(['id' => $orderId]); - /** @var Info $informationTab */ - $informationTab = $salesOrderView->getOrderForm()->getTabElement('information'); - $orderAddress = $informationTab->$addressBlock()->getAddress(); - $payPalShippingAddress = $this->prepareCustomerAddress($paypalCustomer, $orderAddress); - - \PHPUnit_Framework_Assert::assertEquals($payPalShippingAddress, $orderAddress); - } - - /** - * Prepare customer address for assert. - * - * @param PaypalCustomer $customer - * @param $orderAddress - * @return string - */ - protected function prepareCustomerAddress(PaypalCustomer $customer, $orderAddress) - { - /** @var PaypalAddress $customerAddress */ - $customerAddress = $customer->getDataFieldConfig('address')['source']->getAddresses()[0]; - - $availableFields = []; - foreach ($this->addressPattern as $key => $lineItems) { - foreach ($lineItems as $lineItem) { - if ($customerAddress->hasData($lineItem)) { - $availableFields[$key][] = $customerAddress->getData($lineItem); - } - } - $availableFields[$key] = ($key === 'implode_with_comma') - ? implode(', ', $availableFields[$key]) - : implode(' ', $availableFields[$key]); - - } - $availableFields = $this->prepareCustomerPhone($availableFields, $orderAddress); - $availableFields = implode("\n", $availableFields); - - return $availableFields; - } - - /** - * Remove customer telephone number, if telephone number isn't sent from PayPal side - * - * @param $availableFields - * @param $orderAddress - * @return mixed - * @internal param $customerPhone - * @internal param $orderBillingAddress - * @internal param $payPalShippingAddress - */ - protected function prepareCustomerPhone($availableFields, $orderAddress) - { - if (strpos($orderAddress, $availableFields[3]) == false) { - unset($availableFields[3]); - } - return $availableFields; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertCartIsEmpty.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertCartIsEmpty.php deleted file mode 100644 index 528ca75f9c2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertCartIsEmpty.php +++ /dev/null @@ -1,55 +0,0 @@ -open(); - \PHPUnit_Framework_Assert::assertTrue( - $checkoutCart->getCartBlock()->emptyCartBlockIsVisible(), - "Shopping cart is not empty." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Shopping cart is empty.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertCartItemsOptions.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertCartItemsOptions.php deleted file mode 100644 index de307372d5b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertCartItemsOptions.php +++ /dev/null @@ -1,164 +0,0 @@ -dataType => $this->sortDataByPath($cartItem->getOptions(), '::title'),]; - } - - /** - * Get product data. - * - * @param array $checkoutItem - * @param array $verifyData - * @return array - */ - protected function getProductData(array $checkoutItem, array $verifyData) - { - return [$this->dataType => $this->sortDataByPath($checkoutItem[$this->dataType], '::title')]; - } - - /** - * Verify form data contains in fixture data. - * - * @param array $fixtureData - * @param array $formData - * @param bool $isStrict [optional] - * @param bool $isPrepareError [optional] - * @return array|string - */ - protected function verifyContainsData( - array $fixtureData, - array $formData, - $isStrict = false, - $isPrepareError = true - ) { - $errors = []; - - foreach ($fixtureData as $key => $value) { - if (in_array($key, $this->skippedFields)) { - continue; - } - - $formValue = isset($formData[$key]) ? $formData[$key] : null; - if ($formValue && !is_array($formValue)) { - $formValue = trim($formValue, '. '); - } - - if (null === $formValue) { - $errors[] = '- field "' . $key . '" is absent in form'; - } elseif (is_array($value) && is_array($formValue)) { - $valueErrors = $this->verifyContainsData($value, $formValue, true, false); - if (!empty($valueErrors)) { - $errors[$key] = $valueErrors; - } - } elseif (($key == 'value') && $this->equals($fixtureData['value'], $formData['value'])) { - $errors[] = $this->errorFormat($value, $formValue, $key); - } elseif (null === strpos($value, $formValue)) { - $errors[] = $this->errorFormat($value, $formValue, $key); - } - } - - if ($isStrict) { - $diffData = array_diff(array_keys($formData), array_keys($fixtureData)); - if ($diffData) { - $errors[] = '- fields ' . implode(', ', $diffData) . ' is absent in fixture'; - } - } - - if ($isPrepareError) { - return $this->prepareErrors($errors); - } - return $errors; - } - - /** - * Check that params are equals. - * - * @param mixed $expected - * @param mixed $actual - * @return bool - */ - protected function equals($expected, $actual) - { - return (null === strpos($expected, $actual)); - } - - /** - * Format error. - * - * @param mixed $value - * @param mixed $formValue - * @param mixed $key - * @return string - */ - protected function errorFormat($value, $formValue, $key) - { - if (is_array($value)) { - $value = $this->arrayToString($value); - } - if (is_array($formValue)) { - $formValue = $this->arrayToString($formValue); - } - - return sprintf($this->errorMessage, $key, $formValue, $value); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product options on the page match.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertGrandTotalInShoppingCart.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertGrandTotalInShoppingCart.php deleted file mode 100644 index d94e87e3a83..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertGrandTotalInShoppingCart.php +++ /dev/null @@ -1,75 +0,0 @@ -login($customer); - } - $checkoutCart->open(); - \PHPUnit_Framework_Assert::assertEquals( - number_format($cart->getGrandTotal(), 2), - $checkoutCart->getTotalsBlock()->getData('grand_total') - ); - } - - /** - * Login customer in frontend. - * - * @param Customer $customer - * @return void - */ - protected function login(Customer $customer) - { - $this->objectManager->create( - 'Mage\Customer\Test\TestStep\LoginCustomerOnFrontendStep', - ['customer' => $customer] - )->run(); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Grand total price in the shopping cart equals to expected grand total price from data set.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertOrderBillingAddressSameAsPaypalShipping.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertOrderBillingAddressSameAsPaypalShipping.php deleted file mode 100644 index fc6bbdf84dc..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertOrderBillingAddressSameAsPaypalShipping.php +++ /dev/null @@ -1,43 +0,0 @@ -getTitleBlock()->getTitle() - ); - } - - /** - * Returns string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return 'Success message on Checkout onepage success page is correct.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertOrderWithMultishippingSuccessPlacedMessage.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertOrderWithMultishippingSuccessPlacedMessage.php deleted file mode 100644 index 9177c09684e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertOrderWithMultishippingSuccessPlacedMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getTitleBlock()->getTitle() - ); - } - - /** - * Returns string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return 'Success message on Checkout onepage success page is correct.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertPriceInShoppingCart.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertPriceInShoppingCart.php deleted file mode 100644 index 5c96bbc8bb4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertPriceInShoppingCart.php +++ /dev/null @@ -1,43 +0,0 @@ -getCartBlock()->getCartItem($product)->isEditButtonVisible(), - 'Added product is editable.' - ); - } - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Added products by sku to shopping cart are not editable.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertProductQtyInMiniShoppingCart.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertProductQtyInMiniShoppingCart.php deleted file mode 100644 index 7bb03d8cbb3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertProductQtyInMiniShoppingCart.php +++ /dev/null @@ -1,74 +0,0 @@ -open()->getTopLinksBlock()->openMiniCart(); - /** @var Items $sourceProducts */ - $products = $cart->getDataFieldConfig('items')['source']->getProducts(); - $items = $cart->getItems(); - $productsData = []; - $miniCartData = []; - - foreach ($items as $key => $item) { - /** @var CatalogProductSimple $product */ - $product = $products[$key]; - $productName = $product->getName(); - /** @var FixtureInterface $item */ - $checkoutItem = $item->getData(); - - $productsData[$productName] = ['qty' => $checkoutItem['qty']]; - $miniCartData[$productName] = ['qty' => $cmsIndex->getCartSidebarBlock()->getCartItem($product)->getQty()]; - } - - $error = $this->verifyData($productsData, $miniCartData, true); - \PHPUnit_Framework_Assert::assertEmpty($error, $error); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Quantity in the mini shopping cart equals to expected quantity from data set.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertProductQtyInShoppingCart.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertProductQtyInShoppingCart.php deleted file mode 100644 index b7ce3709610..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertProductQtyInShoppingCart.php +++ /dev/null @@ -1,56 +0,0 @@ -dataType => $cartItem->getQty()]; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Quantity in the shopping cart equals to expected quantity from data set.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertProductsPresentInShoppingCart.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertProductsPresentInShoppingCart.php deleted file mode 100644 index 08ed4b1f327..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertProductsPresentInShoppingCart.php +++ /dev/null @@ -1,57 +0,0 @@ -open(); - foreach ($products as $product) { - \PHPUnit_Framework_Assert::assertTrue( - $checkoutCart->getCartBlock()->getCartItem($product)->isVisible(), - "Product '{$product->getName()}' is absent in shopping cart." - ); - } - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'All expected products are present in shopping cart.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertSubtotalInShoppingCart.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertSubtotalInShoppingCart.php deleted file mode 100644 index fef43625d24..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertSubtotalInShoppingCart.php +++ /dev/null @@ -1,43 +0,0 @@ -open(); - \PHPUnit_Framework_Assert::assertTrue( - $agreementIndex->getAgreementGridBlock()->isRowVisible(['name' => $checkoutAgreement->getName()]), - 'Checkout Agreement "' . $checkoutAgreement->getName() . '" is absent in agreement grid.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Checkout Agreement is present in agreement grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertTermOnCheckout.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertTermOnCheckout.php deleted file mode 100644 index efbb9190ed2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertTermOnCheckout.php +++ /dev/null @@ -1,171 +0,0 @@ -objectManager = $objectManager; - $products = $this->createProducts($products); - $this->addToCart($products); - $this->startCheckout(); - $this->processCheckout($checkoutMethod, $billingAddress, $shipping, $payment); - $alertText = $checkoutOnepage->getReviewBlock()->clickContinue(); - - \PHPUnit_Framework_Assert::assertEquals( - self::NOTIFICATION_MESSAGE, - $alertText, - 'Notification required message of Terms and Conditions is absent.' - ); - - $checkoutOnepage->getReviewBlock()->setAgreement($checkoutAgreement, 'Yes'); - $checkoutOnepage->getReviewBlock()->clickContinue(); - $assertOrderSuccessPlacedMessage->processAssert($checkoutOnepageSuccess); - } - - /** - * Create products. - * - * @param string $products - * @return array - */ - protected function createProducts($products) - { - return $this->objectManager->create( - 'Mage\Catalog\Test\TestStep\CreateProductsStep', - ['products' => $products] - )->run()['products']; - } - - /** - * Add products to cart. - * - * @param array $products - * @return void - */ - protected function addToCart(array $products) - { - $this->objectManager->create( - 'Mage\Checkout\Test\TestStep\AddProductsToTheCartStep', - ['products' => $products] - )->run(); - } - - /** - * Start checkout. - * - * @return void - */ - protected function startCheckout() - { - $this->objectManager->create('Mage\Checkout\Test\TestStep\ProceedToCheckoutStep')->run(); - } - - /** - * Process checkout. - * - * @param string $checkoutMethod - * @param Address $billingAddress - * @param array $shipping - * @param array $payment - * @return void - */ - protected function processCheckout($checkoutMethod, Address $billingAddress, array $shipping, array $payment) - { - $this->objectManager->create( - 'Mage\Checkout\Test\TestStep\SelectCheckoutMethodStep', - ['checkoutMethod' => $checkoutMethod] - )->run(); - $this->objectManager->create( - 'Mage\Checkout\Test\TestStep\FillBillingInformationStep', - ['billingAddress' => $billingAddress] - )->run(); - $this->objectManager->create( - 'Mage\Checkout\Test\TestStep\FillShippingMethodStep', - ['shipping' => $shipping] - )->run(); - $this->objectManager->create( - 'Mage\Checkout\Test\TestStep\SelectPaymentMethodStep', - ['payment' => $payment] - )->run(); - - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Order was placed with checkout agreement successfully.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertTermRequireMessageOnMultishippingCheckout.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertTermRequireMessageOnMultishippingCheckout.php deleted file mode 100644 index 1a4cfc30971..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertTermRequireMessageOnMultishippingCheckout.php +++ /dev/null @@ -1,207 +0,0 @@ -stepFactory = $stepFactory; - $customer->persist(); - $products = $this->createProducts($products); - $this->login($customer); - $this->addToCart($products); - $this->startCheckout(); - $this->processCheckoutWithMultishipping( - $customer, - $products, - $fillItemsData, - $shippingData, - $payment, - $newAddresses - ); - - $alertText = $checkoutMultishippingOverview->getOverviewBlock()->clickContinue(); - \PHPUnit_Framework_Assert::assertEquals( - self::NOTIFICATION_MESSAGE, - $alertText, - 'Notification required message of Terms and Conditions is absent.' - ); - - $checkoutMultishippingOverview->getOverviewBlock()->setAgreement($checkoutAgreement, 'Yes'); - $checkoutMultishippingOverview->getOverviewBlock()->clickContinue(); - } - - /** - * Create products. - * - * @param string $products - * @return array - */ - protected function createProducts($products) - { - return $this->stepFactory->create('\Mage\Catalog\Test\TestStep\CreateProductsStep', ['products' => $products]) - ->run()['products']; - } - - /** - * Login customer on frontend. - * - * @param Customer $customer - * @return void - */ - protected function login(Customer $customer) - { - $this->stepFactory - ->create('\Mage\Customer\Test\TestStep\LoginCustomerOnFrontendStep', ['customer' => $customer]) - ->run(); - - } - - /** - * Add products to cart. - * - * @param array $products - * @return void - */ - protected function addToCart(array $products) - { - $this->stepFactory->create( - '\Mage\Checkout\Test\TestStep\AddProductsToTheCartStep', - ['products' => $products] - )->run(); - } - - /** - * Start checkout with multishipping. - * - * @return void - */ - protected function startCheckout() - { - $this->stepFactory->create('\Mage\Checkout\Test\TestStep\ProceedToCheckoutWithMultishippingStep')->run(); - } - - /** - * Process checkout with multishipping. - * - * @param Customer $customer - * @param array $products - * @param array $fillItemsData - * @param array $shippingData - * @param array $payment - * @param string $newAddresses - * @return void - */ - protected function processCheckoutWithMultishipping( - Customer $customer, - array $products, - array $fillItemsData, - array $shippingData, - array $payment, - $newAddresses - ) { - $newAddresses = $this->stepFactory->create( - '\Mage\Customer\Test\TestStep\CreateNewAddressesFixturesStep', - ['newAddresses' => $newAddresses] - )->run()['newAddresses']; - - $addresses = $this->stepFactory->create( - '\Mage\Checkout\Test\TestStep\EnterNewAddressesStep', - ['newAddresses' => $newAddresses, 'customer' => $customer] - )->run()['addresses']; - - $addresses = $this->stepFactory->create( - '\Mage\Checkout\Test\TestStep\SelectAddressesStep', - [ - 'products' => $products, - 'customer' => $customer, - 'fillItemsData' => $fillItemsData, - 'addresses' => $addresses - ] - )->run()['addresses']; - - $this->stepFactory->create( - '\Mage\Checkout\Test\TestStep\FillShippingMethodWithMultishippingStep', - ['shippingData' => $shippingData, 'addresses' => $addresses] - )->run(); - - $this->stepFactory->create( - '\Mage\Checkout\Test\TestStep\SelectPaymentMethodWithMultishippingStep', - ['payment' => $payment] - )->run(); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Validation error message for terms and conditions checkbox is present on multishipping checkout.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertTermSuccessSaveMessage.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertTermSuccessSaveMessage.php deleted file mode 100644 index 8206556ec03..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertTermSuccessSaveMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Terms and Conditions success create message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Fixture/Cart.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Fixture/Cart.xml deleted file mode 100644 index 5e39b06f1c4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Fixture/Cart.xml +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Fixture/Cart/Items.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Fixture/Cart/Items.php deleted file mode 100644 index 683814fedc5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Fixture/Cart/Items.php +++ /dev/null @@ -1,86 +0,0 @@ - 'Mage\Catalog\Test\Fixture\Cart\Item', - 'configurable' => 'Mage\Catalog\Test\Fixture\ConfigurableProduct\Cart\Item', - 'downloadable' => 'Mage\Downloadable\Test\Fixture\Cart\Item', - 'virtual' => 'Mage\Catalog\Test\Fixture\Cart\Item', - 'grouped' => 'Mage\Catalog\Test\Fixture\GroupedProduct\Cart\Item', - 'bundle' => 'Mage\Bundle\Test\Fixture\Cart\Item' - ]; - - /** - * List fixture products. - * - * @var FixtureInterface[] - */ - protected $products; - - /** - * @constructor - * @param array $params - * @param array $data - */ - public function __construct(array $params, array $data = []) - { - $this->params = $params; - $this->products = isset($data['products']) ? $data['products'] : []; - foreach ($this->products as $product) { - $this->data[] = $this->getCartItemClass($product); - } - } - - /** - * Get module name from fixture. - * - * @param FixtureInterface $product - * @return string - */ - protected function getCartItemClass(FixtureInterface $product) - { - $typeId = $product->getDataConfig()['type_id']; - return ObjectManager::getInstance()->create($this->itemRender[$typeId], ['product' => $product]); - } - - /** - * Get source products. - * - * @return array - */ - public function getProducts() - { - return $this->products; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Fixture/CheckoutAgreement.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Fixture/CheckoutAgreement.xml deleted file mode 100644 index f6ff0ad84bd..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Fixture/CheckoutAgreement.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Fixture/CheckoutAgreement/Stores.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Fixture/CheckoutAgreement/Stores.php deleted file mode 100644 index 8e7a2237b7e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Fixture/CheckoutAgreement/Stores.php +++ /dev/null @@ -1,65 +0,0 @@ -params = $params; - if (isset($data['datasets'])) { - foreach ($data['datasets'] as $store) { - $store = $fixtureFactory->createByCode('store', ['dataset' => $store]); - /** @var Store $store */ - if (!$store->getStoreId()) { - $store->persist(); - } - $this->stores[] = $store; - $this->data[] = $store->getGroupId() . '/' . $store->getName(); - } - } - } - - /** - * Return array of stores fixtures. - * - * @return Store[] - */ - public function getStores() - { - return $this->stores; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/Adminhtml/CheckoutAgreementEdit.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/Adminhtml/CheckoutAgreementEdit.xml deleted file mode 100644 index 513d9581438..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/Adminhtml/CheckoutAgreementEdit.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/Adminhtml/CheckoutAgreementIndex.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/Adminhtml/CheckoutAgreementIndex.xml deleted file mode 100644 index 404049561d5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/Adminhtml/CheckoutAgreementIndex.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/Adminhtml/CheckoutAgreementNew.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/Adminhtml/CheckoutAgreementNew.xml deleted file mode 100644 index 50f3e81eeba..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/Adminhtml/CheckoutAgreementNew.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutCart.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutCart.xml deleted file mode 100644 index 4ef3f8251d5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutCart.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingAddressNewShipping.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingAddressNewShipping.xml deleted file mode 100644 index e23acc42783..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingAddressNewShipping.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingAddresses.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingAddresses.xml deleted file mode 100644 index 8a42de4aa38..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingAddresses.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingBilling.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingBilling.xml deleted file mode 100644 index 0ccf545d94e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingBilling.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingLogin.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingLogin.xml deleted file mode 100644 index 8245e447141..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingLogin.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingOverview.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingOverview.xml deleted file mode 100644 index c0b04506b27..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingOverview.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingRegister.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingRegister.xml deleted file mode 100644 index 3c3e45a73b4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingRegister.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingShipping.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingShipping.xml deleted file mode 100644 index f6f8f9c90ad..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingShipping.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingSuccess.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingSuccess.xml deleted file mode 100644 index e055cfce445..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingSuccess.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutOnepage.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutOnepage.xml deleted file mode 100644 index 5e92750871c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutOnepage.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutOnepageSuccess.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutOnepageSuccess.xml deleted file mode 100644 index 5000ab5e501..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutOnepageSuccess.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CmsIndex.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CmsIndex.xml deleted file mode 100644 index 3357d6526f8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CmsIndex.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Repository/CheckoutAgreement.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Repository/CheckoutAgreement.xml deleted file mode 100644 index 149f707cf2d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Repository/CheckoutAgreement.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - checkout_agreement %isolation% - TestMessage%isolation% - test_checkbox%isolation% - Enabled - Text - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Repository/ConfigData.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Repository/ConfigData.xml deleted file mode 100644 index 4fb2a4f4eee..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Repository/ConfigData.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - shipping - 1 - Yes - 1 - - - - - checkout - 1 - Yes - 1 - - - - - checkout - 1 - No - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest.php deleted file mode 100644 index 8e034f2785d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest.php +++ /dev/null @@ -1,54 +0,0 @@ -objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - } - - /** - * Run test add products to shopping cart. - * - * @return array - */ - public function test() - { - $this->executeScenario(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest.xml deleted file mode 100644 index 3fffb3b52ba..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - configurableProduct::default - 320 - - - - - - - - catalogProductSimple::with_two_custom_option - 340 - - - - - - - - downloadableProduct::with_two_separately_links - 22.43 - - - - - - - - catalogProductVirtual::order_default - 100.00 - - - - - - - - groupedProduct::three_simple_products - 600.00 - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/CheckoutWithMultishippingTest.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/CheckoutWithMultishippingTest.php deleted file mode 100644 index 386d65e28f1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/CheckoutWithMultishippingTest.php +++ /dev/null @@ -1,94 +0,0 @@ -customerAccountLogout = $customerAccountLogout; - $this->objectManager->create('\Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - } - - /** - * Runs checkout with multishipping test. - * - * @param Customer $customer - * @return array - */ - public function test(Customer $customer) - { - $this->executeScenario(); - return ['billingAddress' => $this->getBillingAddress($customer)]; - } - - /** - * Get billing address for asserts. - * - * @param Customer $customer - * @return null|Address - */ - protected function getBillingAddress(Customer $customer) - { - return $customer->hasData('address') - ? $customer->getDataFieldConfig('address')['source']->getAddresses()[0] - : null; - } - - /** - * Logout after variation. - * - * @return void - */ - public function tearDown() - { - $this->customerAccountLogout->open(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/CheckoutWithMultishippingTest.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/CheckoutWithMultishippingTest.xml deleted file mode 100644 index a10ca2f5b5f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/CheckoutWithMultishippingTest.xml +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - enable_multishipping, default_tax_configuration - catalogProductSimple::order_default,catalogProductSimple::order_default - johndoe_unique - login - customer_US_login - - - 0 - 0 - - - 1 - 1 - - - - - Flat Rate - Fixed - - - Flat Rate - Fixed - - - checkmo - 2 - - 105.00 - 105.00 - - - - - - - - - enable_multishipping - catalogProductSimple::order_default,catalogProductSimple::order_default - frontend_register_multiship_address - No - register - customer_US_login - - - 0 - 0 - - - 1 - 1 - - - - - Flat Rate - Fixed - - - Flat Rate - Fixed - - - checkmo - 2 - - 105.00 - 105.00 - - - - - - - enable_multishipping - catalogProductSimple::default - johndoe_unique - login - - - Flat Rate - Fixed - - - checkmo - 1 - - 315.00 - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/CreateTermEntityTest.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/CreateTermEntityTest.php deleted file mode 100644 index 9b6b0a5a7ec..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/CreateTermEntityTest.php +++ /dev/null @@ -1,69 +0,0 @@ - Terms and conditions. - * 2. Click "Add New Condition". - * 3. Fill data from dataset. - * 4. Click "Save Condition". - * 5. Perform all assertions. - * - * @group Terms_and_Conditions_(CS) - * @ZephyrId MPERF-7583 - */ -class CreateTermEntityTest extends Scenario -{ - /** - * Create Term Entity test. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } - - /** - * Clear data after test variation. - * - * @return void - */ - public function tearDown() - { - $this->objectManager->create('Mage\Checkout\Test\TestStep\DeleteAllTermsEntityStep')->run(); - } - - /** - * Clear data after test suite. - * - * @return void - */ - public static function tearDownAfterClass() - { - ObjectManager::getInstance()->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => 'checkout_term_condition', 'rollback' => true] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/CreateTermEntityTest.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/CreateTermEntityTest.xml deleted file mode 100644 index c549b7da92b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/CreateTermEntityTest.xml +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - Create enabled term entity with text value - checkout_term_condition - default - name%isolation% - Enabled - Text - test_checkbox%isolation% - TestMessage%isolation% - catalogProductSimple::default - US_address_for_checkout - guest - Flat Rate - Fixed - checkmo - - - - - - Create enabled term entity with HTML value - checkout_term_condition - name%isolation% - Enabled - HTML - test_checkbox%isolation% - html - catalogProductSimple::default - US_address_for_checkout - guest - Flat Rate - Fixed - checkmo - - - - - - Create enabled term entity with text value - checkout_term_condition - name%isolation% - Enabled - Text - test_checkbox%isolation% - TestMessage%isolation% - catalogProductSimple::default - US_address_for_checkout - guest - Flat Rate - Fixed - checkmo - - - - - - Create disabled term entity - checkout_term_condition - name%isolation% - Disabled - Text - test_checkbox%isolation% - TestMessage%isolation% - catalogProductSimple::default - US_address_for_checkout - guest - Flat Rate - Fixed - checkmo - - - - - - Create enabled term, check with multishipping - checkout_term_condition, enable_multishipping - name%isolation% - Enabled - Text - test_checkbox%isolation% - TestMessage%isolation% - catalogProductSimple::default - johndoe_unique - customer_US_for_checkout - - - 0 - 0 - - - 0 - 1 - - - 0 - 0 - - - - - Flat Rate - Fixed - - - Flat Rate - Fixed - - - checkmo - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/DeleteProductsFromShoppingCartTest.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/DeleteProductsFromShoppingCartTest.php deleted file mode 100644 index 5a86f2766dd..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/DeleteProductsFromShoppingCartTest.php +++ /dev/null @@ -1,150 +0,0 @@ -browser = $browser; - $this->fixtureFactory = $fixtureFactory; - $this->catalogProductView = $catalogProductView; - $this->cartPage = $cartPage; - } - - /** - * Run test add products to shopping cart. - * - * @param string $productsData - * @return void - */ - public function test($productsData) - { - // Preconditions - $products = $this->prepareProducts($productsData); - - // Steps - $this->addToCart($products); - $this->removeProducts($products); - } - - /** - * Create products. - * - * @param string $productList - * @return InjectableFixture[] - */ - protected function prepareProducts($productList) - { - $createProductsStep = ObjectManager::getInstance()->create( - 'Mage\Catalog\Test\TestStep\CreateProductsStep', - ['products' => $productList] - ); - $result = $createProductsStep->run(); - - return $result['products']; - } - - /** - * Add products to cart. - * - * @param array $products - * @return void - */ - protected function addToCart(array $products) - { - $addToCartStep = ObjectManager::getInstance()->create( - 'Mage\Checkout\Test\TestStep\AddProductsToTheCartStep', - ['products' => $products] - ); - $addToCartStep->run(); - } - - /** - * Remove products form cart. - * - * @param array $products - * @return void - */ - protected function removeProducts(array $products) - { - $this->cartPage->open(); - foreach ($products as $product) { - $this->cartPage->getCartBlock()->getCartItem($product)->removeItem(); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/DeleteProductsFromShoppingCartTest.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/DeleteProductsFromShoppingCartTest.xml deleted file mode 100644 index f33f7d651cf..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/DeleteProductsFromShoppingCartTest.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - bundleProduct::bundle_dynamic_product - main:ce - - - - bundleProduct::bundle_fixed_product - - - - catalogProductSimple::with_two_custom_option - - - - catalogProductVirtual::order_default - - - - configurableProduct::default - - - - downloadableProduct::with_two_separately_links - - - - groupedProduct::three_simple_products - - - - catalogProductSimple::with_two_custom_option, catalogProductVirtual::order_default, downloadableProduct::with_two_separately_links, groupedProduct::three_simple_products, configurableProduct::default, bundleProduct::bundle_dynamic_product, bundleProduct::bundle_dynamic_product - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/OnePageCheckoutTest.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/OnePageCheckoutTest.php deleted file mode 100644 index b846147296f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/OnePageCheckoutTest.php +++ /dev/null @@ -1,85 +0,0 @@ -customerAccountLogout = $customerAccountLogout; - $this->objectManager->create('\Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - } - - /** - * Runs one page checkout test. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } - - /** - * Disable enabled config after test. - * - * @return void - */ - public function tearDown() - { - $this->customerAccountLogout->open(); - if (isset($this->currentVariation['arguments']['configData'])) { - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => $this->currentVariation['arguments']['configData'], 'rollback' => true] - )->run(); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/OnePageCheckoutTest.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/OnePageCheckoutTest.xml deleted file mode 100644 index 04380f664a9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/OnePageCheckoutTest.xml +++ /dev/null @@ -1,216 +0,0 @@ - - - - - - catalogProductVirtual::order_default - active_sales_rule_for_not_logged_users - default_frontend - customer_UK - guest - no - - - - - 50.00 - checkmo - - - Pending - Back, Cancel, Send Email, Hold, Invoice, Edit - - - - - - - catalogProductSimple::order_default - - - default_frontend_new - no - customer_UK - register - no - Flat Rate - Fixed - 105.00 - cashondelivery - - - Pending - Back, Reorder, Cancel, Send Email, Hold, Invoice, Ship, Edit - cashondelivery - - - - - - - catalogProductVirtual::order_default - active_sales_rule_for_not_logged_users - default_frontend - customer_UK - guest - no - - - - - 50.00 - checkmo - - - Pending - Back, Cancel, Send Email, Hold, Invoice, Edit - checkmo_specificcountry_gb - - - - - - - catalogProductSimple::order_default - active_sales_rule_for_all_groups - default_frontend_new - customer_UK - register - no - Flat Rate - Fixed - 55.00 - checkmo - - - Pending - Back, Reorder, Cancel, Send Email, Hold, Invoice, Ship, Edit - - - - - - - catalogProductVirtual::order_default - - - default_frontend - customer_UK - guest - no - - - - - 100.00 - checkmo - - - Pending - Back, Cancel, Send Email, Hold, Invoice, Edit - - - - - - - - - catalogProductSimple::order_default - active_sales_rule_for_all_groups - default_frontend_new - customer_UK - register - no - Flat Rate - Fixed - 55.00 - banktransfer - - - Pending - Back, Cancel, Send Email, Hold, Reorder, Invoice, Edit - banktransfer - - - - - - - catalogProductVirtual::order_default - active_sales_rule_for_not_logged_users - default_frontend - customer_UK - guest - no - - - - - 50.00 - checkmo - - - Pending - Back, Cancel, Send Email, Hold, Invoice, Edit - - - - - - - - - catalogProductSimple::order_default - - - default_frontend_new - customer_UK - register - no - Flat Rate - Fixed - 105.00 - purchaseorder - %isolation% - Pending - Back, Cancel, Send Email, Hold, Invoice, Reorder, Edit - purchaseorder - - - - - - - catalogProductSimple::order_default - active_sales_rule_for_all_groups - default_frontend_new - customer_US_login - login - Flat Rate - Fixed - 55.00 - cashondelivery - Pending - Back, Reorder, Cancel, Hold, Invoice, Ship, Edit - cashondelivery - - - - - - - Checkout by configurable product with special price. - configurableProduct::default_with_special_price - active_sales_rule_for_all_groups - default_frontend_new - customer_US_login - login - Flat Rate - Fixed - 62.00 - cashondelivery - Pending - Back, Reorder, Cancel, Hold, Invoice, Ship, Edit - cashondelivery - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/OnePageCheckoutWithinDhlShippingMethod.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/OnePageCheckoutWithinDhlShippingMethod.php deleted file mode 100644 index bccf639f301..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/OnePageCheckoutWithinDhlShippingMethod.php +++ /dev/null @@ -1,80 +0,0 @@ - $this->objectManager->create( - 'Mage\Catalog\Test\TestStep\CreateProductsStep', - ['products' => 'catalogProductSimple::order_default'] - )->run()['products']]; - } - - /** - * Runs one page checkout test. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } - - /** - * Disable enabled config after test. - * - * @return void - */ - public function tearDown() - { - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => $this->currentVariation['arguments']['configData'], 'rollback' => true] - )->run(); - - $this->objectManager->create( - 'Mage\CurrencySymbol\Test\TestStep\ApplyCurrencyInConfigStep', - ['currencySymbols' => 'usd'] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/OnePageCheckoutWithinDhlShippingMethod.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/OnePageCheckoutWithinDhlShippingMethod.xml deleted file mode 100644 index 36a987be29b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/OnePageCheckoutWithinDhlShippingMethod.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - DHL shipping from UK to US - default_frontend - customer_US - guest - DHL - Express worldwide - checkmo - dhl_eu, shipping_origin_gb - usd, gbp - - - - DHL shipping from UK to UK - default_frontend - customer_UK - guest - DHL - Domestic express - checkmo - dhl_eu, shipping_origin_gb - usd, gbp - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/OnePageCheckoutWithinOnlineShippingMethods.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/OnePageCheckoutWithinOnlineShippingMethods.php deleted file mode 100644 index dfe083b58d8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/OnePageCheckoutWithinOnlineShippingMethods.php +++ /dev/null @@ -1,80 +0,0 @@ - $this->objectManager->create( - 'Mage\Catalog\Test\TestStep\CreateProductsStep', - ['products' => 'catalogProductSimple::order_default'] - )->run()['products']]; - } - - /** - * Runs one page checkout test. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } - - /** - * Disable enabled config after test. - * - * @return void - */ - public function tearDown() - { - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => $this->currentVariation['arguments']['configData'], 'rollback' => true] - )->run(); - - $this->objectManager->create( - 'Mage\CurrencySymbol\Test\TestStep\ApplyCurrencyInConfigStep', - ['currencySymbols' => 'usd'] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/OnePageCheckoutWithinOnlineShippingMethods.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/OnePageCheckoutWithinOnlineShippingMethods.xml deleted file mode 100644 index 92e5dad9fec..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/OnePageCheckoutWithinOnlineShippingMethods.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - UPS shipping from US to US - default_frontend - customer_US - guest - United Parcel Service - UPS Ground - checkmo - ups, shipping_origin - - - main:ce - - - - UPS shipping from US to UK - default_frontend - customer_UK - guest - United Parcel Service - UPS Worldwide Expedited - checkmo - ups, shipping_origin - - - - - - USPS shipping from US to US - default_frontend - customer_US - guest - United States Postal Service - Priority Mail 1-Day - checkmo - usps, shipping_origin - - - - - - USPS shipping from US to UK - default_frontend - customer_UK - guest - United States Postal Service - Priority Mail International - checkmo - usps, shipping_origin - - - - - - FedEx shipping from US to US - default_frontend - customer_US - guest - Federal Express - Ground - checkmo - fedex, shipping_origin - - - - - - FedEx shipping from US to DE - default_frontend - customer_DE - guest - Federal Express - International Economy - checkmo - fedex, shipping_origin - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/UpdateShoppingCartTest.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/UpdateShoppingCartTest.php deleted file mode 100644 index d99b3673ae6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/UpdateShoppingCartTest.php +++ /dev/null @@ -1,148 +0,0 @@ -browser = $browser; - $this->fixtureFactory = $fixtureFactory; - } - - /** - * Inject data. - * - * @param CatalogProductView $catalogProductView - * @param CheckoutCart $checkoutCart - * @return void - */ - public function __inject(CatalogProductView $catalogProductView, CheckoutCart $checkoutCart) - { - $this->catalogProductView = $catalogProductView; - $this->checkoutCart = $checkoutCart; - } - - /** - * Update Shopping Cart. - * - * @param CatalogProductSimple $product - * @param int $qty - * @return array - */ - public function test(CatalogProductSimple $product, $qty) - { - // Preconditions - $product->persist(); - $this->checkoutCart->getCartBlock()->clearShoppingCart(); - - // Steps - $this->addProductToCart($product, $qty); - $this->updateShoppingCart($product); - - $cart['data']['items'] = ['products' => [$product]]; - return ['cart' => $this->fixtureFactory->createByCode('cart', $cart)]; - } - - /** - * Add product to cart. - * - * @param CatalogProductSimple $product - * @param int $qty - * @return void - */ - protected function addProductToCart(CatalogProductSimple $product, $qty) - { - $this->browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - $productView = $this->catalogProductView->getViewBlock(); - $productView->fillOptions($product); - $productView->setQty($qty); - $productView->clickAddToCart(); - $this->catalogProductView->getMessagesBlock()->waitSuccessMessage(); - } - - /** - * Update shopping cart. - * - * @param CatalogProductSimple $product - * @return void - */ - protected function updateShoppingCart(CatalogProductSimple $product) - { - $qty = $product->getCheckoutData()['qty']; - $this->checkoutCart->open(); - $this->checkoutCart->getCartBlock()->getCartItem($product)->setQty($qty); - $this->checkoutCart->getCartBlock()->updateShoppingCart(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/UpdateShoppingCartTest.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/UpdateShoppingCartTest.xml deleted file mode 100644 index c65bc735108..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/UpdateShoppingCartTest.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - 1 - default - 100 - 300 - - - - - - - 3 - with_two_custom_option - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/AddNewCheckoutAgreementStep.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/AddNewCheckoutAgreementStep.php deleted file mode 100644 index f4945de4d17..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/AddNewCheckoutAgreementStep.php +++ /dev/null @@ -1,52 +0,0 @@ -agreementIndex = $agreementIndex; - } - - /** - * Add new checkout agreement step. - * - * @return void - */ - public function run() - { - $this->agreementIndex->open(); - $this->agreementIndex->getPageActionsBlock()->addNew(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/AddProductsToTheCartStep.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/AddProductsToTheCartStep.php deleted file mode 100644 index c830c8b47ab..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/AddProductsToTheCartStep.php +++ /dev/null @@ -1,91 +0,0 @@ -products = $products; - $this->catalogProductView = $catalogProductView; - $this->checkoutCart = $checkoutCart; - $this->browser = $browser; - } - - /** - * Add products to the cart. - * - * @return void - */ - public function run() - { - // Ensure that shopping cart is empty - $this->checkoutCart->open()->getCartBlock()->clearShoppingCart(); - - foreach ($this->products as $product) { - $this->browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - $this->catalogProductView->getViewBlock()->addToCart($product); - $this->catalogProductView->getMessagesBlock()->waitSuccessMessage(); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/CreateCartItemStep.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/CreateCartItemStep.php deleted file mode 100644 index dc50baa0240..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/CreateCartItemStep.php +++ /dev/null @@ -1,61 +0,0 @@ -fixtureFactory = $fixtureFactory; - $this->cart = array_merge_recursive($cart, ['data' => ['items' => ['products' => $products]]]); - } - - /** - * Create cart item. - * - * @return array - */ - public function run() - { - return ['cart' => $this->fixtureFactory->createByCode('cart', $this->cart)]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/DeleteAllTermsEntityStep.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/DeleteAllTermsEntityStep.php deleted file mode 100644 index 8eb2f87a5f0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/DeleteAllTermsEntityStep.php +++ /dev/null @@ -1,65 +0,0 @@ -agreementEdit = $agreementEdit; - $this->agreementIndex = $agreementIndex; - } - - /** - * Delete all terms on backend. - * - * @return void - */ - public function run() - { - $this->agreementIndex->open(); - while ($this->agreementIndex->getAgreementGridBlock()->isFirstRowVisible()) { - $this->agreementIndex->getAgreementGridBlock()->openFirstRow(); - $this->agreementEdit->getPageActionsBlock()->deleteAndAcceptAlert(); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/EnterNewAddressesStep.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/EnterNewAddressesStep.php deleted file mode 100644 index 5f0ab22491c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/EnterNewAddressesStep.php +++ /dev/null @@ -1,94 +0,0 @@ -checkoutMultishippingAddresses = $checkoutMultishippingAddresses; - $this->checkoutMultishippingAddressNewShipping = $checkoutMultishippingAddressNewShipping; - $this->newAddresses = $newAddresses; - $this->customer = $customer; - } - - /** - * Enter new addresses. - * - * @return array - */ - public function run() - { - if (empty($this->newAddresses)) { - return []; - } - foreach ($this->newAddresses as $address) { - $this->checkoutMultishippingAddresses->getAddressesBlock()->clickEnterNewAddress(); - $this->checkoutMultishippingAddressNewShipping->getAddressEditBlock()->fill($address); - $this->checkoutMultishippingAddressNewShipping->getAddressEditBlock()->save(); - } - - return ['addresses' => $this->newAddresses]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/FillAndSaveCheckoutAgreementStep.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/FillAndSaveCheckoutAgreementStep.php deleted file mode 100644 index 0169872649c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/FillAndSaveCheckoutAgreementStep.php +++ /dev/null @@ -1,64 +0,0 @@ -agreementNew = $agreementNew; - $this->checkoutAgreement = $checkoutAgreement; - } - - /** - * Fill and save checkout agreement step. - * - * @return array - */ - public function run() - { - $this->agreementNew->getAgreementsForm()->fill($this->checkoutAgreement); - $this->agreementNew->getPageActionsBlock()->save(); - - return ['checkoutAgreement' => $this->checkoutAgreement]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/FillBillingInformationStep.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/FillBillingInformationStep.php deleted file mode 100644 index a2734ab399b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/FillBillingInformationStep.php +++ /dev/null @@ -1,72 +0,0 @@ -checkoutOnepage = $checkoutOnepage; - $this->billingAddress = $billingAddress; - $this->customer = $customer; - } - - /** - * Fill billing address. - * - * @return void - */ - public function run() - { - $this->checkoutOnepage->getBillingBlock()->fillBilling($this->billingAddress, $this->customer); - $this->checkoutOnepage->getBillingBlock()->clickContinue(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/FillShippingMethodStep.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/FillShippingMethodStep.php deleted file mode 100644 index 7d7925f5609..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/FillShippingMethodStep.php +++ /dev/null @@ -1,63 +0,0 @@ -checkoutOnepage = $checkoutOnepage; - $this->shipping = $shipping; - } - - /** - * Select shipping method. - * - * @return void - */ - public function run() - { - if ($this->shipping['shipping_service'] !== '-') { - $this->checkoutOnepage->getShippingMethodBlock()->selectShippingMethod($this->shipping); - $this->checkoutOnepage->getShippingMethodBlock()->clickContinue(); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/FillShippingMethodWithMultishippingStep.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/FillShippingMethodWithMultishippingStep.php deleted file mode 100644 index 043c3ec9382..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/FillShippingMethodWithMultishippingStep.php +++ /dev/null @@ -1,78 +0,0 @@ -checkoutMultishippingShipping = $checkoutMultishippingShipping; - $this->shippingData = $shippingData; - $this->addresses = $addresses; - } - - /** - * Select shipping method. - * - * @return void - */ - public function run() - { - if ($this->shippingData !== null) { - foreach ($this->addresses as $key => $address) { - $this->checkoutMultishippingShipping->getShippingBlock()->getItemsBlock()->getItemBlock($address, $key) - ->fillShippingMethod($this->shippingData[$key]); - } - } - $this->checkoutMultishippingShipping->getShippingBlock()->clickContinueButton(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/PlaceOrderStep.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/PlaceOrderStep.php deleted file mode 100644 index c4498035fa5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/PlaceOrderStep.php +++ /dev/null @@ -1,129 +0,0 @@ -checkoutOnepage = $checkoutOnepage; - $this->checkoutOnepageSuccess = $checkoutOnepageSuccess; - $this->positiveCase = $positiveCase; - $this->fixtureFactory = $fixtureFactory; - $this->customer = $customer; - $this->products = $products; - } - - /** - * Place order after checking order totals on review step. - * - * @return mixed - */ - public function run() - { - $orderId = null; - if ($this->positiveCase) { - $this->checkoutOnepage->getReviewBlock()->clickContinue(); - $orderId = $this->checkoutOnepageSuccess->getSuccessBlock()->getGuestOrderId(); - } - - return ['orderId' => $orderId, 'order' => $this->createOrderFixture($orderId)]; - } - - /** - * Create order fixture. - * - * @param string $id - * @return Order - */ - protected function createOrderFixture($id) - { - $data = [ - 'id' => $id, - 'customer_id' => ['customer' => $this->customer], - 'entity_id' => ['products' => $this->products] - ]; - - return $this->fixtureFactory->createByCode('order', ['data' => $data]); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/PlaceOrderWithMultishippingStep.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/PlaceOrderWithMultishippingStep.php deleted file mode 100644 index cc309664ea0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/PlaceOrderWithMultishippingStep.php +++ /dev/null @@ -1,66 +0,0 @@ -checkoutMultishippingOverview = $checkoutMultishippingOverview; - $this->checkoutMultishippingSuccess = $checkoutMultishippingSuccess; - } - - /** - * Place order with multishipping. - * - * @return mixed - */ - public function run() - { - $this->checkoutMultishippingOverview->getOverviewBlock()->clickPlaceOrder(); - $ordersIds = $this->checkoutMultishippingSuccess->getSuccessBlock()->getOrdersIds(); - - return ['ordersIds' => $ordersIds]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/ProceedToCheckoutStep.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/ProceedToCheckoutStep.php deleted file mode 100644 index ef4f1c55051..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/ProceedToCheckoutStep.php +++ /dev/null @@ -1,51 +0,0 @@ -checkoutCart = $checkoutCart; - } - - /** - * Proceed to checkout. - * - * @return void - */ - public function run() - { - $this->checkoutCart->getCartBlock()->getProceedToCheckoutBlock()->proceedToCheckout(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/ProceedToCheckoutWithMultishippingStep.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/ProceedToCheckoutWithMultishippingStep.php deleted file mode 100644 index 3e653cb8d1b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/ProceedToCheckoutWithMultishippingStep.php +++ /dev/null @@ -1,51 +0,0 @@ -checkoutCart = $checkoutCart; - } - - /** - * Proceed to checkout with multi address. - * - * @return void - */ - public function run() - { - $this->checkoutCart->getCartBlock()->clickCheckoutWithMultiAddress(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/SelectAddressesStep.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/SelectAddressesStep.php deleted file mode 100644 index 44e3be54201..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/SelectAddressesStep.php +++ /dev/null @@ -1,119 +0,0 @@ -checkoutMultishippingAddresses = $checkoutMultishippingAddresses; - $this->products = $products; - $this->addresses = $addresses; - $this->customer = $customer; - $this->fillItemsData = $fillItemsData; - } - - /** - * Select addresses. - * - * @return array - */ - public function run() - { - $addresses = $this->getAddresses(); - if (!empty($this->fillItemsData)) { - foreach ($this->fillItemsData as $key => $itemData) { - $this->checkoutMultishippingAddresses->getAddressesBlock()->getItemsBlock() - ->getItemBlock($this->products[$itemData['productIndex']], $key) - ->fillItem($addresses[$itemData['addressIndex']]); - } - $this->checkoutMultishippingAddresses->getAddressesBlock()->getItemsBlock()->updateData(); - } - $this->checkoutMultishippingAddresses->getAddressesBlock()->clickContinueButton(); - - return ['addresses' => $addresses]; - } - - /** - * Get addresses. - * - * @return array - */ - protected function getAddresses() - { - $addresses = []; - if ($this->customer->hasData('address')) { - $addresses = $this->customer->getDataFieldConfig('address')['source']->getAddresses(); - } - return array_merge($addresses, $this->addresses); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/SelectCheckoutMethodStep.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/SelectCheckoutMethodStep.php deleted file mode 100644 index d4f789d5a48..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/SelectCheckoutMethodStep.php +++ /dev/null @@ -1,87 +0,0 @@ -checkoutOnepage = $checkoutOnepage; - $this->checkoutMethod = $checkoutMethod; - $this->customer = $customer; - } - - /** - * Run step that selecting checkout method. - * - * @return void - * @throws \Exception - */ - public function run() - { - $checkoutMethodBlock = $this->checkoutOnepage->getLoginBlock(); - switch ($this->checkoutMethod) { - case 'guest': - $checkoutMethodBlock->guestCheckout(); - $checkoutMethodBlock->clickContinue(); - break; - case 'register': - $checkoutMethodBlock->registerCustomer(); - $checkoutMethodBlock->clickContinue(); - break; - case 'login': - $checkoutMethodBlock->loginCustomer($this->customer); - break; - default: - throw new \Exception("Undefined checkout method."); - break; - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/SelectCheckoutMethodWithMultishippingStep.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/SelectCheckoutMethodWithMultishippingStep.php deleted file mode 100644 index 09af6280e38..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/SelectCheckoutMethodWithMultishippingStep.php +++ /dev/null @@ -1,97 +0,0 @@ -checkoutMultishippingLogin = $checkoutMultishippingLogin; - $this->checkoutMultishippingRegister = $checkoutMultishippingRegister; - $this->checkoutMethod = $checkoutMethod; - $this->customer = $customer; - } - - /** - * Run step that selecting checkout method. - * - * @return void - * @throws \Exception - */ - public function run() - { - $checkoutMethodBlock = $this->checkoutMultishippingLogin->getLoginBlock(); - switch ($this->checkoutMethod) { - case 'register': - $checkoutMethodBlock->createNewAccount(); - $this->checkoutMultishippingRegister->getRegisterForm()->registerCustomer($this->customer); - break; - case 'login': - $checkoutMethodBlock->login($this->customer); - break; - default: - throw new \Exception("Undefined checkout method."); - break; - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/SelectPaymentMethodStep.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/SelectPaymentMethodStep.php deleted file mode 100644 index fee007152ba..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/SelectPaymentMethodStep.php +++ /dev/null @@ -1,72 +0,0 @@ -checkoutOnepage = $checkoutOnepage; - if (isset($payment['cc']) && !($payment['cc'] instanceof Cc)) { - $payment['cc'] = $fixtureFactory->create('Mage\Payment\Test\Fixture\Cc', ['dataset' => $payment['cc']]); - } - $this->payment = $payment; - } - - /** - * Run step that selecting payment method. - * - * @return array - */ - public function run() - { - if ($this->payment['method'] !== 'free') { - $this->checkoutOnepage->getPaymentMethodsBlock()->selectPaymentMethod($this->payment); - } - $this->checkoutOnepage->getPaymentMethodsBlock()->clickContinue(); - - return ['payment' => $this->payment]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/SelectPaymentMethodWithMultishippingStep.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/SelectPaymentMethodWithMultishippingStep.php deleted file mode 100644 index bcb19337b93..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/SelectPaymentMethodWithMultishippingStep.php +++ /dev/null @@ -1,74 +0,0 @@ -checkoutMultishippingBilling = $checkoutMultishippingBilling; - if (isset($payment['cc']) && !($payment['cc'] instanceof Cc)) { - $payment['cc'] = $fixtureFactory->create('Mage\Payment\Test\Fixture\Cc', ['dataset' => $payment['cc']]); - } - $this->payment = $payment; - } - - /** - * Select payment method. - * - * @return array - */ - public function run() - { - if ($this->payment['method'] !== 'free') { - $this->checkoutMultishippingBilling->getBillingBlock()->selectPaymentMethod($this->payment); - } - $this->checkoutMultishippingBilling->getBillingBlock()->clickContinue(); - - return ['payment' => $this->payment]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/etc/fixture.xml deleted file mode 100644 index 7599fe182d2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/etc/fixture.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - flat - sales_flat_quote - Mage\Checkout\Model\Resource\Cart - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/etc/testcase.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/etc/testcase.xml deleted file mode 100644 index ccde1ea7872..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/etc/testcase.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Block/Page.php b/dev/tests/functional/tests/app/Mage/Cms/Test/Block/Page.php deleted file mode 100644 index b9efcb2d20a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Block/Page.php +++ /dev/null @@ -1,135 +0,0 @@ - './/*/a[contains(.,"%s")]', - ]; - - /** - * Get page content. - * - * @param SimpleElement|null $element - * @return string - */ - public function getPageContent(SimpleElement $element = null) - { - $element = ($element === null) ? $this->_rootElement : $element; - $this->waitForElementVisible($this->cmsPageContent); - return $element->find($this->cmsPageContent)->getText(); - } - - /** - * Get page title. - * - * @param SimpleElement|null $element - * @return string - */ - public function getPageTitle(SimpleElement $element = null) - { - $element = ($element === null) ? $this->_rootElement : $element; - return $element->find($this->cmsPageTitle)->getText(); - } - - /** - * Get page head title. - * - * @return string - */ - public function getPageHeadTitle() - { - return $this->_rootElement->find($this->cmsPageHeadTitle)->getText(); - } - - /** - * Wait for text is visible in the block. - * - * @param string $text - * @return void - */ - public function waitUntilTextIsVisible($text) - { - $textSelector = sprintf($this->textSelector, $text); - $browser = $this->browser; - $this->_rootElement->waitUntil( - function () use ($browser, $textSelector) { - $blockText = $browser->find($textSelector, Locator::SELECTOR_XPATH); - return $blockText->isVisible() == true ? false : null; - } - ); - } - - /** - * Check is visible widget selector. - * - * @param array $widgetData - * @return bool - * @throws \Exception - */ - public function isWidgetVisible($widgetData) - { - if (isset($this->widgetSelectors[$widgetData['widget_type']])) { - return $this->_rootElement->find( - sprintf($this->widgetSelectors[$widgetData['widget_type']], $widgetData['anchor_text']), - Locator::SELECTOR_XPATH - )->isVisible(); - } else { - throw new \Exception('Determine how to find the widget on the page.'); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsBlockInGrid.php b/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsBlockInGrid.php deleted file mode 100644 index ed4ce18c73a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsBlockInGrid.php +++ /dev/null @@ -1,60 +0,0 @@ -open(); - $data = $cmsBlock->getData(); - $filter = [ - 'title' => $data['title'], - 'identifier' => $data['identifier'], - 'is_active' => $data['is_active'], - ]; - - $cmsBlockIndex->getCmsBlockGrid()->search($filter); - - \PHPUnit_Framework_Assert::assertTrue( - $cmsBlockIndex->getCmsBlockGrid()->isRowVisible($filter, false, false) - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'CMS Block is present in grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsBlockNotOnCategoryPage.php b/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsBlockNotOnCategoryPage.php deleted file mode 100644 index 34683828ef9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsBlockNotOnCategoryPage.php +++ /dev/null @@ -1,71 +0,0 @@ -createByCode( - 'catalogCategory', - [ - 'dataset' => 'default_subcategory', - 'data' => [ - 'display_mode' => 'Static block and products', - 'landing_page' => $cmsBlock->getTitle(), - ] - ] - ); - $category->persist(); - $cmsIndex->open(); - $cmsIndex->getTopmenu()->selectCategory($category->getName()); - $categoryViewContent = $catalogCategoryView->getViewBlock()->getText(); - $cmsBlockContent = explode("\n", $categoryViewContent); - \PHPUnit_Framework_Assert::assertNotContains($cmsBlock->getContent(), $cmsBlockContent); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'CMS block description is absent on Category page (frontend).'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsBlockOnCategoryPage.php b/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsBlockOnCategoryPage.php deleted file mode 100644 index a544c32f002..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsBlockOnCategoryPage.php +++ /dev/null @@ -1,72 +0,0 @@ - Display settings> CMS Block). - * - * @param CmsIndex $cmsIndex - * @param CmsBlock $cmsBlock - * @param CatalogCategoryView $catalogCategoryView - * @param FixtureFactory $fixtureFactory - * @return void - */ - public function processAssert( - CmsIndex $cmsIndex, - CmsBlock $cmsBlock, - CatalogCategoryView $catalogCategoryView, - FixtureFactory $fixtureFactory - ) { - $category = $fixtureFactory->createByCode( - 'catalogCategory', - [ - 'dataset' => 'default_subcategory', - 'data' => [ - 'display_mode' => 'Static block and products', - 'landing_page' => $cmsBlock->getTitle(), - ] - ] - ); - $category->persist(); - $cmsIndex->open(); - $cmsIndex->getTopmenu()->selectCategory($category->getName()); - $categoryViewContent = $catalogCategoryView->getViewBlock()->getText(); - $cmsBlockContent = explode("\n", $categoryViewContent); - \PHPUnit_Framework_Assert::assertContains($cmsBlock->getContent(), $cmsBlockContent); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'CMS block description is present on Category page (frontend).'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsBlockSuccessSaveMessage.php b/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsBlockSuccessSaveMessage.php deleted file mode 100644 index c6a074926df..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsBlockSuccessSaveMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'CMS Block success create message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPageDeleteMessage.php b/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPageDeleteMessage.php deleted file mode 100644 index 9d9146faf39..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPageDeleteMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Cms page success delete message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPageDisabledOnFrontend.php b/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPageDisabledOnFrontend.php deleted file mode 100644 index a56a81af624..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPageDisabledOnFrontend.php +++ /dev/null @@ -1,70 +0,0 @@ -open($_ENV['app_frontend_url'] . $cms->getIdentifier()); - \PHPUnit_Framework_Assert::assertContains( - $notFoundMessage, - $frontendCmsPage->getCmsPageContentBlock()->getPageContent(), - 'Wrong page is displayed.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Created CMS page with status "disabled" displays with error message on frontend.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPageDisabledOnUnassignedStoreView.php b/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPageDisabledOnUnassignedStoreView.php deleted file mode 100644 index d30f7ef16ad..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPageDisabledOnUnassignedStoreView.php +++ /dev/null @@ -1,74 +0,0 @@ -open($_ENV['app_frontend_url'] . $cms->getIdentifier()); - $notFoundMessage = ($notFoundMessage !== null) ? $notFoundMessage : self::ERROR_MESSAGE; - $cmsIndex->getHeaderBlock()->selectStore('Default Store View'); - \PHPUnit_Framework_Assert::assertContains( - $notFoundMessage, - $frontendCmsPage->getCmsPageContentBlock()->getPageContent(), - 'Wrong page content is displayed.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Created CMS page displays with error message on unassigned store views on frontend.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPageForm.php b/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPageForm.php deleted file mode 100644 index f18ea84af7c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPageForm.php +++ /dev/null @@ -1,67 +0,0 @@ -open(); - $cmsPageIndex->getCmsPageGridBlock()->searchAndOpen(['title' => $cms->getTitle()]); - $cmsFormData = $cmsPageNew->getPageForm()->getData($cms); - $errors = $this->verifyData($cms->getData(), $cmsFormData); - \PHPUnit_Framework_Assert::assertEmpty($errors, $errors); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'CMS page data on edit page equals data from fixture.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPageInGrid.php b/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPageInGrid.php deleted file mode 100644 index bddc1966d4c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPageInGrid.php +++ /dev/null @@ -1,57 +0,0 @@ -open(); - $cmsTitle = $cms->getTitle(); - \PHPUnit_Framework_Assert::assertTrue( - $cmsPageIndex->getCmsPageGridBlock()->isRowVisible(['title' => $cmsTitle]), - "Cms page '$cmsTitle' is not present in pages grid." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Cms page is present in pages grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPageNotInGrid.php b/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPageNotInGrid.php deleted file mode 100644 index 89e3e23a09a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPageNotInGrid.php +++ /dev/null @@ -1,67 +0,0 @@ -open(); - $filter = [ - 'title' => $cmsPage->getTitle(), - 'identifier' => $cmsPage->getIdentifier(), - 'is_active' => $cmsPage->getIsActive() - ]; - \PHPUnit_Framework_Assert::assertFalse( - $cmsIndex->getCmsPageGridBlock()->isRowVisible($filter), - "Cms page {$cmsPage->getTitle()} is present in pages grid." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Cms page is not present in pages grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPagePreview.php b/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPagePreview.php deleted file mode 100644 index 340228b619b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPagePreview.php +++ /dev/null @@ -1,125 +0,0 @@ -open(); - $cmsPageIndex->getCmsPageGridBlock()->searchAndReview(['title' => $cms->getTitle()]); - $browser->selectWindow(); - if ($isIFrame) { - $this->switchToFrame($browser); - } - $element = $browser->find('body'); - - $fixtureContent = $cms->getContent(); - \PHPUnit_Framework_Assert::assertContains( - $fixtureContent['content'], - $frontendCmsPage->getCmsPageContentBlock()->getPageContent($element), - 'Wrong content is displayed.' - ); - if ($cms->getContentHeading()) { - \PHPUnit_Framework_Assert::assertEquals( - strtolower($cms->getContentHeading()), - strtolower($frontendCmsPage->getCmsPageContentBlock()->getPageTitle($element)), - 'Wrong title is displayed.' - ); - } - if (isset($fixtureContent['widget'])) { - foreach ($fixtureContent['widget']['preset'] as $widget) { - \PHPUnit_Framework_Assert::assertTrue( - $frontendCmsPage->getCmsPageContentBlock()->isWidgetVisible($widget), - "Widget '{$widget['widget_type']}' is not displayed." - ); - } - } - $browser->closeWindow(); - $browser->selectWindow(); - $browser->switchToFrame(); - } - - /** - * Switch to frame. - * - * @param Browser $browser - * @return void - */ - protected function switchToFrame(Browser $browser) - { - $selector = $this->loader; - $browser->waitUntil( - function () use ($browser, $selector) { - return $browser->find($selector)->isVisible() == false ? true : null; - } - ); - $browser->switchToFrame(new Locator($this->iFrameSelector)); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'CMS Page content equals to data from fixture.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPageSuccessSaveMessage.php b/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPageSuccessSaveMessage.php deleted file mode 100644 index 08cac42095b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPageSuccessSaveMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Success message is displayed after save a CMS page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Fixture/CmsBlock.xml b/dev/tests/functional/tests/app/Mage/Cms/Test/Fixture/CmsBlock.xml deleted file mode 100644 index 920d716c0f1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Fixture/CmsBlock.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Fixture/CmsBlock/Stores.php b/dev/tests/functional/tests/app/Mage/Cms/Test/Fixture/CmsBlock/Stores.php deleted file mode 100644 index 4c23069c6e6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Fixture/CmsBlock/Stores.php +++ /dev/null @@ -1,75 +0,0 @@ -params = $params; - if (isset($data['datasets'])) { - $datasets = explode(',', $data['datasets']); - foreach ($datasets as $dataset) { - /** @var Store $store */ - $store = $fixtureFactory->createByCode('store', ['dataset' => $dataset]); - if (!$store->hasData('store_id')) { - $store->persist(); - } - $this->stores[] = $store; - $this->data[] = $store->getGroupId() . '/' . $store->getName(); - } - } - } - - /** - * Get stores. - * - * @return Store[] - */ - public function getStores() - { - return $this->stores; - } - - public function setData($data) { - $this->data = $data; - } - - public function setStores($stores) { - $this->stores = $stores; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Fixture/CmsBlockMultiStore.xml b/dev/tests/functional/tests/app/Mage/Cms/Test/Fixture/CmsBlockMultiStore.xml deleted file mode 100644 index 3e7b8807167..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Fixture/CmsBlockMultiStore.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Fixture/CmsPage.xml b/dev/tests/functional/tests/app/Mage/Cms/Test/Fixture/CmsPage.xml deleted file mode 100644 index af9b4702417..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Fixture/CmsPage.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Fixture/CmsPage/Content.php b/dev/tests/functional/tests/app/Mage/Cms/Test/Fixture/CmsPage/Content.php deleted file mode 100644 index 94accf04b50..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Fixture/CmsPage/Content.php +++ /dev/null @@ -1,76 +0,0 @@ -fixtureFactory = $fixtureFactory; - $this->params = $params; - $this->data = $data; - if (isset($data['widget']['preset'])) { - $this->data['widget']['preset'] = $this->getPreset($data['widget']['preset']); - } - } - - /** - * Preset for Widgets. - * - * @param string $name - * @return array|null - */ - protected function getPreset($name) - { - $presets = [ - 'default' => [ - 'widget_1' => [ - 'widget_type' => 'CMS Page Link', - 'anchor_text' => 'CMS Page Link anchor_text_%isolation%', - 'title' => 'CMS Page Link anchor_title_%isolation%', - 'template' => 'CMS Page Link Block Template', - 'chosen_option' => [ - 'filter_url_key' => 'home', - ], - ], - ], - ]; - if (!isset($presets[$name])) { - return null; - } - return $presets[$name]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Fixture/CmsPage/StoreId.php b/dev/tests/functional/tests/app/Mage/Cms/Test/Fixture/CmsPage/StoreId.php deleted file mode 100644 index a6295bb36ca..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Fixture/CmsPage/StoreId.php +++ /dev/null @@ -1,66 +0,0 @@ -params = $params; - if (isset($data['dataset'])) { - foreach ($data['dataset'] as $dataset) { - $store = $fixtureFactory->createByCode('store', ['dataset' => $dataset]); - /** @var Store $store */ - if (!$store->getStoreId()) { - $store->persist(); - } - $this->store[] = $store; - $this->data[] = $store->getGroupId() . '/' . $store->getName(); - } - } - } - - /** - * Return Store fixture. - * - * @return Store - */ - public function getStore() - { - return $this->store; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Fixture/CmsPageMultiStore.xml b/dev/tests/functional/tests/app/Mage/Cms/Test/Fixture/CmsPageMultiStore.xml deleted file mode 100644 index e69858f288d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Fixture/CmsPageMultiStore.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Handler/CmsPage/CmsPageInterface.php b/dev/tests/functional/tests/app/Mage/Cms/Test/Handler/CmsPage/CmsPageInterface.php deleted file mode 100644 index 9c78145a09f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Handler/CmsPage/CmsPageInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - [ - 'Published' => 1, - 'Disabled' => 0, - 'Enabled' => 1 - ], - 'store_id' => [ - 'Main Website/Main Website Store/Default Store View' => 1 - ], - 'page_layout' => [ - '1 column' => '1column', - '2 columns with left bar' => '2columns-left', - '2 columns with right bar' => '2columns-right', - '3 columns' => '3columns', - ], - 'under_version_control' => [ - 'Yes' => 1, - 'No' => 0, - ], - ]; - - /** - * Url for save cms page. - * - * @var string - */ - protected $url = 'cms_page/save'; - - /** - * Post request for creating a cms page. - * - * @param FixtureInterface $fixture - * @return array - * @throws \Exception - */ - public function persist(FixtureInterface $fixture = null) - { - $url = $_ENV['app_backend_url'] . $this->url; - $data = $this->replaceMappingData($fixture->getData()); - $data = $this->prepareData($data); - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->addOption(CURLOPT_HEADER, 1); - $curl->write($url, $data); - $response = $curl->read(); - $curl->close(); - if (!strpos($response, 'class="success-msg"')) { - throw new \Exception("Cms page entity creating by curl handler was not successful! Response: $response"); - } - $id = $this->getCmsPageId($response); - - return ['page_id' => $id]; - } - - /** - * Prepare data. - * - * @param array $data - * @return array - */ - protected function prepareData(array $data) - { - $resultStore = []; - foreach ($data['store_id'] as $key => $store) { - $resultStore['store_id'][$key] = $this->mappingData['store_id'][$store]; - } - $data['stores'] = $resultStore['store_id']; - unset($data['store_id']); - $data['content'] = $data['content']['content']; - if (!isset($data['is_active'])) { - $data['is_active'] = 1; - } - return $data; - } - - /** - * Return saved cms page id. - * - * @param string $response - * @return int|null - * @throws \Exception - */ - protected function getCmsPageId($response) - { - preg_match_all('~tr title=[^\s]*\/page_id\/(\d+)~', $response, $matches); - if (empty($matches[1])) { - throw new \Exception('Cannot find Cms Page id'); - } - - return max($matches[1]); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Page/Adminhtml/CmsBlockEdit.xml b/dev/tests/functional/tests/app/Mage/Cms/Test/Page/Adminhtml/CmsBlockEdit.xml deleted file mode 100644 index 8ed0b776885..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Page/Adminhtml/CmsBlockEdit.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Page/Adminhtml/CmsBlockIndex.xml b/dev/tests/functional/tests/app/Mage/Cms/Test/Page/Adminhtml/CmsBlockIndex.xml deleted file mode 100644 index 71a4183a7d2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Page/Adminhtml/CmsBlockIndex.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Page/Adminhtml/CmsBlockNew.xml b/dev/tests/functional/tests/app/Mage/Cms/Test/Page/Adminhtml/CmsBlockNew.xml deleted file mode 100644 index e62571e210f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Page/Adminhtml/CmsBlockNew.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Page/Adminhtml/CmsPageEdit.xml b/dev/tests/functional/tests/app/Mage/Cms/Test/Page/Adminhtml/CmsPageEdit.xml deleted file mode 100644 index 00a7b6222c9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Page/Adminhtml/CmsPageEdit.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Page/Adminhtml/CmsPageIndex.xml b/dev/tests/functional/tests/app/Mage/Cms/Test/Page/Adminhtml/CmsPageIndex.xml deleted file mode 100644 index f57bb6cfacd..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Page/Adminhtml/CmsPageIndex.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Page/Adminhtml/CmsPageNew.xml b/dev/tests/functional/tests/app/Mage/Cms/Test/Page/Adminhtml/CmsPageNew.xml deleted file mode 100644 index 3a13654d05c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Page/Adminhtml/CmsPageNew.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Page/CmsIndex.xml b/dev/tests/functional/tests/app/Mage/Cms/Test/Page/CmsIndex.xml deleted file mode 100644 index 8d946126630..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Page/CmsIndex.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Page/CmsPage.xml b/dev/tests/functional/tests/app/Mage/Cms/Test/Page/CmsPage.xml deleted file mode 100644 index c4c49dd5cf1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Page/CmsPage.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Repository/CmsBlock.xml b/dev/tests/functional/tests/app/Mage/Cms/Test/Repository/CmsBlock.xml deleted file mode 100644 index 40557e52ae9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Repository/CmsBlock.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - cms-block-title-%isolation% - cms-block-identifier-%isolation% - - cms block text content - - Enabled - - - diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Repository/CmsPage.xml b/dev/tests/functional/tests/app/Mage/Cms/Test/Repository/CmsPage.xml deleted file mode 100644 index d5dcb80670f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Repository/CmsPage.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - test-%isolation% - test-%isolation% - - - default - - - - text content - - Test-%isolation% - 1 column - - - - page-compare-%isolation% - page-compare-%isolation% - - - default - - - - Test Content - - 3 columns - - - diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/CreateCmsBlockEntityTest.php b/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/CreateCmsBlockEntityTest.php deleted file mode 100644 index 2ed6583a8dc..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/CreateCmsBlockEntityTest.php +++ /dev/null @@ -1,77 +0,0 @@ - Static Blocks. - * 3. Click "Add New Block" button. - * 4. Fill data according to dataset. - * 5. Perform all assertions. - * - * @group CMS_Content_(PS) - * @ZephyrId MPERF-7430 - */ -class CreateCmsBlockEntityTest extends Injectable -{ - /** - * Page CmsBlockIndex. - * - * @var CmsBlockIndex - */ - protected $cmsBlockIndex; - - /** - * Page CmsBlockNew. - * - * @var CmsBlockNew - */ - protected $cmsBlockNew; - - /** - * Injection data. - * - * @param CmsBlockIndex $cmsBlockIndex - * @param CmsBlockNew $cmsBlockNew - * @return void - */ - public function __inject(CmsBlockIndex $cmsBlockIndex, CmsBlockNew $cmsBlockNew) - { - $this->cmsBlockIndex = $cmsBlockIndex; - $this->cmsBlockNew = $cmsBlockNew; - } - - /** - * Create CMS Block. - * - * @param CmsBlock $cmsBlock - * @return void - */ - public function test(CmsBlock $cmsBlock) - { - // Steps - $this->cmsBlockIndex->open(); - $this->cmsBlockIndex->getGridPageActions()->addNew(); - $this->cmsBlockNew->getBlockForm()->fill($cmsBlock); - $this->cmsBlockNew->getFormPageActions()->save(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/CreateCmsBlockEntityTest.xml b/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/CreateCmsBlockEntityTest.xml deleted file mode 100644 index f74212512ca..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/CreateCmsBlockEntityTest.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - block_%isolation% - identifier_%isolation% - default - Enabled - description_%isolation% - - - - - - block_%isolation% - identifier_%isolation% - default - Disabled - description_%isolation% - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/CreateCmsPageEntityTest.php b/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/CreateCmsPageEntityTest.php deleted file mode 100644 index 7957ea68007..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/CreateCmsPageEntityTest.php +++ /dev/null @@ -1,148 +0,0 @@ - Pages > Manage Content. - * 3. Click "Add New Page" button. - * 4. Fill data according to data set. - * 5. Click "Save Page" button. - * 6. Perform all assertions. - * - * @group CMS Content (PS) - * @ZephyrId MPERF-6686 - */ -class CreateCmsPageEntityTest extends Injectable -{ - /** - * CmsIndex page. - * - * @var CmsPageIndex - */ - protected $cmsPageIndex; - - /** - * CmsNew page. - * - * @var CmsPageNew - */ - protected $cmsPageNew; - - /** - * Page StoreIndex. - * - * @var StoreIndex - */ - protected $storeIndex; - - /** - * Cms page fixture. - * - * @var CmsPage - */ - protected $cms; - - /** - * Page EditStore. - * - * @var EditStore - */ - protected $editStore; - - /** - * Page DeleteStore. - * - * @var DeleteStore - */ - protected $deleteStore; - - /** - * Inject data. - * - * @param CmsPageIndex $cmsPageIndex - * @param CmsPageNew $cmsPageNew - * @param StoreIndex $storeIndex - * @param EditStore $editStore - * @param DeleteStore $deleteStore - * @return void - */ - public function __inject( - CmsPageIndex $cmsPageIndex, - CmsPageNew $cmsPageNew, - StoreIndex $storeIndex, - EditStore $editStore, - DeleteStore $deleteStore - ) { - $this->cmsPageIndex = $cmsPageIndex; - $this->cmsPageNew = $cmsPageNew; - $this->storeIndex = $storeIndex; - $this->editStore = $editStore; - $this->deleteStore = $deleteStore; - } - - /** - * Creating Cms page. - * - * @param CmsPage $cms - * return void - */ - public function test(CmsPage $cms) - { - $this->cms = $cms; - - // Steps - $this->cmsPageIndex->open(); - $this->cmsPageIndex->getPageActionsBlock()->addNew(); - $this->cmsPageNew->getPageForm()->fill($cms); - $this->cmsPageNew->getPageMainActions()->save(); - } - - /** - * Delete store. - * - * @return void - */ - public function tearDown() - { - if (!$this->cms->hasData('store_id')) { - return; - } - $stores = $this->cms->getStoreId(); - if ($stores) { - $stores = $this->cms->getDataFieldConfig('store_id')['source']->getStore(); - foreach ($stores as $store) { - $this->storeIndex->open(); - $this->storeIndex->getStoreGrid()->openStore($store); - $this->editStore->getFormPageActions()->delete(); - $deleteStoreFormPageActions = $this->deleteStore->getFormPageActions(); - if ($deleteStoreFormPageActions->isVisible()) { - $this->deleteStore->getForm()->fillForm(); - $deleteStoreFormPageActions->delete(); - } - } - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/CreateCmsPageEntityTest.xml b/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/CreateCmsPageEntityTest.xml deleted file mode 100644 index 38064ecb75d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/CreateCmsPageEntityTest.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - NewCmsPage%isolation% - new_cms_page%isolation% - cms_page_text_content_heading%isolation% - cms_page_text_content%isolation% - - - - - - - NewCmsPage%isolation% - new_cms_page%isolation% - Disabled - cms_page_text_content_heading%isolation% - cms_page_text_content%isolation% - - - - - - - NewCmsPage%isolation% - new_cms_page%isolation% - custom - cms_page_text_content_heading%isolation% - cms_page_text_content%isolation% - - - - - - - - NewCmsPage%isolation% - new_cms_page%isolation% - cms_page_text_content_heading%isolation% - cms_page_text_content%isolation% - default - General Contact Name - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/DeleteCmsPageEntityTest.php b/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/DeleteCmsPageEntityTest.php deleted file mode 100644 index cd8b5f0ab1b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/DeleteCmsPageEntityTest.php +++ /dev/null @@ -1,83 +0,0 @@ - Pages -> Manage Content. - * 3. Select CMS Page from precondition. - * 4. Click "Delete Page" button. - * 5. Perform all assertions. - * - * @group CMS_Content_(PS) - * @ZephyrId MPERF-7326 - */ -class DeleteCmsPageEntityTest extends Injectable -{ - /** - * CMS Index page. - * - * @var CmsPageIndex - */ - protected $cmsIndex; - - /** - * Edit CMS page. - * - * @var CmsPageEdit - */ - protected $cmsEdit; - - /** - * Inject pages. - * - * @param CmsPageIndex $cmsIndex - * @param CmsPageEdit $cmsEdit - * @return void - */ - public function __inject(CmsPageIndex $cmsIndex, CmsPageEdit $cmsEdit) - { - $this->cmsIndex = $cmsIndex; - $this->cmsEdit = $cmsEdit; - } - - /** - * Delete CMS Page. - * - * @param CmsPageMultiStore $cmsPage - * @return void - */ - public function test(CmsPageMultiStore $cmsPage) - { - // Preconditions - $cmsPage->persist(); - - // Steps - $this->cmsIndex->open(); - $this->cmsIndex->getCmsPageGridBlock()->searchAndOpen(['title' => $cmsPage->getTitle()]); - $this->cmsEdit->getPageMainActions()->deleteAndAcceptAlert(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/DeleteCmsPageEntityTest.xml b/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/DeleteCmsPageEntityTest.xml deleted file mode 100644 index 05da5e8387b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/DeleteCmsPageEntityTest.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - default - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/UpdateCmsPageEntityTest.php b/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/UpdateCmsPageEntityTest.php deleted file mode 100644 index 1a4c3326c14..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/UpdateCmsPageEntityTest.php +++ /dev/null @@ -1,109 +0,0 @@ - Pages > Manage Content. - * 3. Select CMS Page from precondition. - * 4. Edit CMS Page according to data set. - * 5. Click 'Save Page'. - * 6. Perform all assertions. - * - * @group CMS_Content_(PS) - * @ZephyrId MPERF-7512 - */ -class UpdateCmsPageEntityTest extends Injectable -{ - /** - * CMS Index page. - * - * @var CmsPageIndex - */ - protected $cmsIndex; - - /** - * Edit CMS page. - * - * @var CmsPageEdit - */ - protected $cmsEdit; - - /** - * Fixture Factory. - * - * @var FixtureFactory - */ - protected $factory; - - /** - * Inject page. - * - * @param CmsPageIndex $cmsIndex - * @param CmsPageEdit $cmsEdit - * @param CmsPageMultiStore $cmsOriginal - * @param FixtureFactory $factory - * @return array - */ - public function __inject( - CmsPageIndex $cmsIndex, - CmsPageEdit $cmsEdit, - CmsPageMultiStore $cmsOriginal, - FixtureFactory $factory - ) { - $cmsOriginal->persist(); - $this->cmsIndex = $cmsIndex; - $this->cmsEdit = $cmsEdit; - $this->factory = $factory; - - return ['cmsOriginal' => $cmsOriginal]; - } - - /** - * Update CMS Page test. - * - * @param CmsPageMultiStore $cms - * @param CmsPageMultiStore $cmsOriginal - * @return array - */ - public function test(CmsPageMultiStore $cms, CmsPageMultiStore $cmsOriginal) - { - // Steps - $this->cmsIndex->open(); - $filter = ['title' => $cmsOriginal->getTitle()]; - $this->cmsIndex->getCmsPageGridBlock()->searchAndOpen($filter); - $this->cmsEdit->getPageForm()->fill($cms); - $this->cmsEdit->getPageMainActions()->save(); - - return [ - 'cms' => $this->factory->createByCode( - 'cmsPage', - ['data' => array_merge($cmsOriginal->getData(), $cms->getData())] - ) - ]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/UpdateCmsPageEntityTest.xml b/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/UpdateCmsPageEntityTest.xml deleted file mode 100644 index 3a8c507a808..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/UpdateCmsPageEntityTest.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - default - CmsPageEdited%isolation% - Disabled - cms_page_text_content_after_edit - - - - - default - CmsPageEdited%isolation% - cms_page_url_edited_%isolation% - Content Heading TexEdited - cms_page_text_content_after_edit - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Mage/Cms/Test/etc/curl/di.xml deleted file mode 100644 index c247af71e71..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/etc/curl/di.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Mage/Cms/Test/etc/fixture.xml deleted file mode 100644 index b2b89b28f9d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/etc/fixture.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - flat - cms_page - - diff --git a/dev/tests/functional/tests/app/Mage/Core/Test/Block/Messages.php b/dev/tests/functional/tests/app/Mage/Core/Test/Block/Messages.php deleted file mode 100644 index f98c1b97766..00000000000 --- a/dev/tests/functional/tests/app/Mage/Core/Test/Block/Messages.php +++ /dev/null @@ -1,176 +0,0 @@ -waitForElementVisible($this->successMessage); - } - - /** - * Wait for error message. - * - * @return bool - */ - public function waitErrorMessage() - { - return $this->waitForElementVisible($this->errorMessage); - } - - /** - * Get all success messages which are present on the page. - * - * @return string|array - */ - public function getSuccessMessages() - { - $this->waitForElementVisible($this->successMessage); - $elements = $this->_rootElement->getElements($this->successMessage); - - return $this->getTextFromElements($elements); - } - - /** - * Get all error messages which are present on the page. - * - * @return string|array - */ - public function getErrorMessages() - { - $this->waitForElementVisible($this->errorMessage); - $elements = $this->_rootElement->getElements($this->errorMessage); - - return $this->getTextFromElements($elements); - } - - /** - * Get text from specified elements. - * - * @param Element[] $elements - * @return string|array - */ - protected function getTextFromElements(array $elements) - { - $messages = []; - /** Element $element */ - foreach ($elements as $key => $element) { - $messages[$key] = $element->getText(); - } - - return count($messages) > 1 ? $messages : $messages[0]; - } - - /** - * Check is visible messages - * - * @param string $messageType - * @return bool - */ - public function isVisibleMessage($messageType) - { - return $this->_rootElement - ->find($this->{$messageType . 'Message'}, Locator::SELECTOR_CSS) - ->isVisible(); - } - - /** - * Get warning message which is present on the page - * - * @return string - */ - public function getWarningMessages() - { - $this->waitForElementVisible($this->warningMessage); - return $this->_rootElement->find($this->warningMessage)->getText(); - } - - /** - * Click on link in the messages which are present on the page. - * - * @param string $messageType - * @param string $linkText - * @return void - */ - public function clickLinkInMessages($messageType, $linkText) - { - if ($this->isVisibleMessage($messageType)) { - $this->_rootElement - ->find($this->{$messageType . 'Message'}, Locator::SELECTOR_CSS) - ->find(sprintf($this->messageLink, $linkText), Locator::SELECTOR_XPATH) - ->click(); - } - } - - /** - * Get notice message which is present on the page. - * - * @return string - */ - public function getNoticeMessages() - { - $this->waitForElementVisible($this->noticeMessage); - return $this->_rootElement->find($this->noticeMessage)->getText(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Core/Test/Fixture/ConfigData.xml b/dev/tests/functional/tests/app/Mage/Core/Test/Fixture/ConfigData.xml deleted file mode 100644 index 16446f32753..00000000000 --- a/dev/tests/functional/tests/app/Mage/Core/Test/Fixture/ConfigData.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Core/Test/Fixture/Date.php b/dev/tests/functional/tests/app/Mage/Core/Test/Fixture/Date.php deleted file mode 100644 index 09a648e6afe..00000000000 --- a/dev/tests/functional/tests/app/Mage/Core/Test/Fixture/Date.php +++ /dev/null @@ -1,53 +0,0 @@ -params = $params; - if (isset($data['pattern']) && $data['pattern'] !== '-') { - $matches = []; - $delta = ''; - if (preg_match_all('/(\+|-)\d+.+/', $data['pattern'], $matches)) { - $delta = $matches[0][0]; - } - $timestamp = $delta === '' ? time() : strtotime($delta); - if (!$timestamp) { - throw new \Exception('Invalid date format for "' . $this->params['attribute_code'] . '" field'); - } - $date = date(str_replace($delta, '', $data['pattern']), $timestamp); - if (!$date) { - $date = date('m/d/Y'); - } - $this->data = trim($date); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Core/Test/Handler/ConfigData/ConfigDataInterface.php b/dev/tests/functional/tests/app/Mage/Core/Test/Handler/ConfigData/ConfigDataInterface.php deleted file mode 100644 index d5ec953e126..00000000000 --- a/dev/tests/functional/tests/app/Mage/Core/Test/Handler/ConfigData/ConfigDataInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - [ - 'Website' => 'website', - 'Store' => 'group', - 'Store View' => 'store', - ], - ]; - - /** - * Post request for setting configuration. - * - * @param FixtureInterface|null $fixture [optional] - * @return void - */ - public function persist(FixtureInterface $fixture = null) - { - $data = $this->prepareData($fixture); - foreach ($data as $scope => $item) { - $this->applyConfigSettings($item, $scope); - } - } - - /** - * Prepare POST data for setting configuration. - * - * @param FixtureInterface $fixture - * @return array - */ - protected function prepareData(FixtureInterface $fixture) - { - $result = []; - $fields = $fixture->getData(); - if (isset($fields['section'])) { - foreach ($fields['section'] as $key => $itemSection) { - if (is_array($itemSection)) { - $itemSection['path'] = $key; - } - parse_str($this->prepareConfigPath($itemSection), $configPath); - $result = array_merge_recursive($result, $configPath); - } - } - return $result; - } - - /** - * Prepare config path. - * - * From payment/cashondelivery/active to ['payment']['groups']['cashondelivery']['fields']['active'] - * - * @param array $input - * @return string - */ - protected function prepareConfigPath(array $input) - { - $resultArray = ''; - $InputValue = isset($input['value']) ? $input['value'] : null; - $path = explode('/', $input['path']); - foreach ($path as $position => $subPath) { - if ($position === 0) { - $resultArray .= $subPath; - continue; - } elseif ($position === (count($path) - 1)) { - $resultArray .= '[fields]'; - } else { - $resultArray .= '[groups]'; - } - $resultArray .= '[' . $subPath . ']'; - } - $resultArray .= '[value]'; - if (is_array($InputValue)) { - $values = []; - foreach ($InputValue as $key => $value) { - $values[] = $resultArray . "[$key]=$value"; - } - $resultArray = implode('&', $values); - } elseif(!empty($InputValue)) { - $resultArray .= '=' . $InputValue; - } - return $resultArray; - } - - /** - * Apply config settings via curl. - * - * @param array $data - * @param string $section - * @throws \Exception - */ - protected function applyConfigSettings(array $data, $section) - { - $url = $this->getUrl($section); - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->addOption(CURLOPT_HEADER, 1); - $curl->write($url, $data); - $response = $curl->read(); - $curl->close(); - - if (strpos($response, 'class="success-msg"') === false) { - throw new \Exception("Settings are not applied! Response: $response"); - } - } - - /** - * Retrieve URL for request. - * - * @param string $section - * @return string - */ - protected function getUrl($section) - { - return $_ENV['app_backend_url'] . 'system_config/save/section/' . $section; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Core/Test/Repository/ConfigData.xml b/dev/tests/functional/tests/app/Mage/Core/Test/Repository/ConfigData.xml deleted file mode 100644 index 8fcd8ffed51..00000000000 --- a/dev/tests/functional/tests/app/Mage/Core/Test/Repository/ConfigData.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - default - 0 - general - - - diff --git a/dev/tests/functional/tests/app/Mage/Core/Test/TestStep/SetupConfigurationStep.php b/dev/tests/functional/tests/app/Mage/Core/Test/TestStep/SetupConfigurationStep.php deleted file mode 100644 index 2e8aaf6215d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Core/Test/TestStep/SetupConfigurationStep.php +++ /dev/null @@ -1,87 +0,0 @@ -fixtureFactory = $fixtureFactory; - $this->configData = $configData; - $this->rollback = $rollback; - } - - /** - * Set config. - * - * @return array - */ - public function run() - { - if ($this->configData == '-' || $this->configData === null) { - return []; - } - $prefix = ($this->rollback == false) ? '' : '_rollback'; - - $configData = array_map('trim', explode(',', $this->configData)); - $result = []; - - foreach ($configData as $configdataset) { - $config = $this->fixtureFactory->createByCode('configData', ['dataset' => $configdataset . $prefix]); - if ($config->hasData('section')) { - $config->persist(); - $result[] = $config; - } - } - - return ['config' => $result]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Core/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Mage/Core/Test/etc/curl/di.xml deleted file mode 100644 index 2d0b8eb4df3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Core/Test/etc/curl/di.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Core/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Mage/Core/Test/etc/fixture.xml deleted file mode 100644 index 07a7dc06b04..00000000000 --- a/dev/tests/functional/tests/app/Mage/Core/Test/etc/fixture.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - Mage_Core - flat - core_config_data - Mage\Core\Model\Resource\Config\Data\Collection - -
        - section - virtual -
        -
        -
        -
        diff --git a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/Constraint/AssertCurrencySymbolOnCatalogPage.php b/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/Constraint/AssertCurrencySymbolOnCatalogPage.php deleted file mode 100644 index 87e7e3f0c9f..00000000000 --- a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/Constraint/AssertCurrencySymbolOnCatalogPage.php +++ /dev/null @@ -1,75 +0,0 @@ -getCategoryIds()[0]; - $cmsIndex->open(); - $cmsIndex->getCurrencyBlock()->switchCurrency($currencySymbol); - $cmsIndex->getTopmenu()->selectCategory($categoryName); - $price = $catalogCategoryView->getListProductBlock()->getPrice($product->getId()); - preg_match('`(.*?)\d`', $price, $matches); - - $symbolOnPage = isset($matches[1]) ? $matches[1] : null; - \PHPUnit_Framework_Assert::assertEquals( - $currencySymbol->getCustomCurrencySymbol(), - $symbolOnPage, - 'Wrong Currency Symbol is displayed on Category page.' - ); - } - - /** - * Returns a string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return "Currency Symbol has been changed on Catalog page."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/Constraint/AssertCurrencySymbolOnProductPage.php b/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/Constraint/AssertCurrencySymbolOnProductPage.php deleted file mode 100644 index 6ee5e261f6e..00000000000 --- a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/Constraint/AssertCurrencySymbolOnProductPage.php +++ /dev/null @@ -1,85 +0,0 @@ -open(); - $adminCache->getPageActions()->flushCacheStorage(); - $adminCache->getMessagesBlock()->waitSuccessMessage(); - - $cmsIndex->open(); - $cmsIndex->getCurrencyBlock()->switchCurrency($currencySymbol); - $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - $price = $catalogProductView->getViewBlock()->getPriceBlock()->getPrice(); - preg_match('`(.*?)\d`', $price, $matches); - - $symbolOnPage = isset($matches[1]) ? $matches[1] : null; - \PHPUnit_Framework_Assert::assertEquals( - $currencySymbol->getCustomCurrencySymbol(), - $symbolOnPage, - 'Wrong Currency Symbol is displayed on Product page.' - ); - } - - /** - * Returns a string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return "Currency Symbol has been changed on Product Details page."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/Constraint/AssertCurrencySymbolSuccessSaveMessage.php b/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/Constraint/AssertCurrencySymbolSuccessSaveMessage.php deleted file mode 100644 index ba3018b1c0b..00000000000 --- a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/Constraint/AssertCurrencySymbolSuccessSaveMessage.php +++ /dev/null @@ -1,62 +0,0 @@ -getMessagesBlock()->getSuccessMessages(), - 'Wrong success message is displayed.' - ); - } - - /** - * Returns a string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return 'Currency Symbol success save message is correct.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/Fixture/CurrencySymbolEntity.xml b/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/Fixture/CurrencySymbolEntity.xml deleted file mode 100644 index 14b9b7ba2fd..00000000000 --- a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/Fixture/CurrencySymbolEntity.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/Page/Adminhtml/SystemCurrencyIndex.xml b/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/Page/Adminhtml/SystemCurrencyIndex.xml deleted file mode 100644 index 22a753414d3..00000000000 --- a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/Page/Adminhtml/SystemCurrencyIndex.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/Page/Adminhtml/SystemCurrencySymbolIndex.xml b/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/Page/Adminhtml/SystemCurrencySymbolIndex.xml deleted file mode 100644 index 70113fcba53..00000000000 --- a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/Page/Adminhtml/SystemCurrencySymbolIndex.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/Repository/ConfigData.xml b/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/Repository/ConfigData.xml deleted file mode 100644 index dadb2eb140f..00000000000 --- a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/Repository/ConfigData.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - currency - 1 - - - USD - UAH - - - - - - currency - 1 - - - USD - - - - - - currency - 1 - - - - - currency - 1 - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/TestCase/EditCurrencySymbolEntityTest.php b/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/TestCase/EditCurrencySymbolEntityTest.php deleted file mode 100644 index 92e625b86a4..00000000000 --- a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/TestCase/EditCurrencySymbolEntityTest.php +++ /dev/null @@ -1,181 +0,0 @@ -Manage Currency->Rates and click to Import button. - * 3. Create simple product. - * - * Steps: - * 1. Login to backend. - * 2. Navigate to Stores->Manage Currency->Symbols. - * 3. Make changes according to dataset. - * 4. Click 'Save Currency Symbols' button. - * 5. Perform all asserts. - * - * @group Currency_(PS) - * @ZephyrId MPERF-6679 - */ -class EditCurrencySymbolEntityTest extends Injectable -{ - /** - * System Currency Symbol grid page. - * - * @var SystemCurrencySymbolIndex - */ - protected $currencySymbolIndex; - - /** - * System currency rates page. - * - * @var SystemCurrencyIndex - */ - protected $currencyRatesIndex; - - /** - * Fixture Factory. - * - * @var FixtureFactory - */ - protected $fixtureFactory; - - /** - * Prepare data. - * - * @param FixtureFactory $fixtureFactory - * @return void - */ - public function __prepare(FixtureFactory $fixtureFactory) - { - $this->fixtureFactory = $fixtureFactory; - } - - /** - * Injection pages. - * - * @param SystemCurrencySymbolIndex $currencySymbolIndex - * @param SystemCurrencyIndex $currencyRatesIndex - * @return void - */ - public function __inject( - SystemCurrencySymbolIndex $currencySymbolIndex, - SystemCurrencyIndex $currencyRatesIndex - ) { - $this->currencySymbolIndex = $currencySymbolIndex; - $this->currencyRatesIndex = $currencyRatesIndex; - } - - /** - * Edit Currency Symbol Entity test. - * - * @param CurrencySymbolEntity $currencySymbol - * @return CatalogProductSimple[] - */ - public function test(CurrencySymbolEntity $currencySymbol) - { - // Preconditions: - $this->applyCurrencyInConfig(); - $this->applyCurrencyConverterCredentials(); - $this->importCurrencyRates(); - $product = $this->createSimpleProductWithCategory(); - - // Steps: - $this->currencySymbolIndex->open(); - $this->currencySymbolIndex->getCurrencySymbolForm()->fill($currencySymbol); - $this->currencySymbolIndex->getPageActions()->save(); - - return ['product' => $product]; - } - - /** - * Apply custom currency in Config. - * - * @return void - */ - protected function applyCurrencyInConfig() - { - $config = $this->fixtureFactory->createByCode( - 'configData', - ['dataset' => 'config_currency_symbols_usd_and_uah'] - ); - $config->persist(); - } - - /** - * Set currency converter credentials - * - * @return void - */ - protected function applyCurrencyConverterCredentials() - { - $config = $this->fixtureFactory->createByCode( - 'configData', - ['dataset' => 'config_currency_converters'] - ); - $config->persist(); - } - - /** - * Create simple product with category. - * - * @return CatalogProductSimple - */ - protected function createSimpleProductWithCategory() - { - /**@var CatalogProductSimple $catalogProductSimple */ - $product = $this->fixtureFactory->createByCode('catalogProductSimple', ['dataset' => 'product_with_category']); - $product->persist(); - return $product; - } - - /** - * Import currency rates for applied currencies. - * - * @return void - */ - protected function importCurrencyRates() - { - $this->currencyRatesIndex->open(); - $this->currencyRatesIndex->getGridPageActions()->clickImportButton(); - $this->currencyRatesIndex->getGridPageActions()->saveCurrentRate(); - } - - /** - * Disabling currency which has been added. - * - * @return void - */ - public function tearDown() - { - $config = $this->fixtureFactory->createByCode('configData', ['dataset' => 'config_currency_symbols_usd']); - /** @var InjectableFixture $config */ - $config->persist(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/TestCase/EditCurrencySymbolEntityTest.xml b/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/TestCase/EditCurrencySymbolEntityTest.xml deleted file mode 100644 index e41b1b49d11..00000000000 --- a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/TestCase/EditCurrencySymbolEntityTest.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - UAH - No - custom - - - - - - UAH - No - & - - - - - - UAH - No - % - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/TestStep/ApplyCurrencyInConfigStep.php b/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/TestStep/ApplyCurrencyInConfigStep.php deleted file mode 100644 index 1ac50b3da70..00000000000 --- a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/TestStep/ApplyCurrencyInConfigStep.php +++ /dev/null @@ -1,80 +0,0 @@ - [ - 'scope' => 'currency', - 'scope_id' => '1' - ] - ]; - - /** - * Fixture Factory. - * - * @var FixtureFactory - */ - protected $fixtureFactory; - - /** - * Currency symbols. - * - * @var string - */ - protected $currencySymbols; - - /** - * @constructor - * @param FixtureFactory $fixtureFactory - * @param string $currencySymbols - */ - public function __construct(FixtureFactory $fixtureFactory, $currencySymbols) - { - $this->fixtureFactory = $fixtureFactory; - $this->currencySymbols = $currencySymbols; - } - - /** - * Apply currency in config step. - * - * @return void - */ - public function run() - { - if ($this->currencySymbols !== '-') { - $symbols = explode(',', $this->currencySymbols); - foreach ($symbols as &$symbol) { - $symbol = strtoupper(trim($symbol)); - } - $this->data['currency/options/allow']['value'] = $symbols; - $config = $this->fixtureFactory->createByCode('configData', ['data' => $this->data]); - $config->persist(); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/TestStep/ImportCurrencyRatesStep.php b/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/TestStep/ImportCurrencyRatesStep.php deleted file mode 100644 index 8b6d4e0d474..00000000000 --- a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/TestStep/ImportCurrencyRatesStep.php +++ /dev/null @@ -1,57 +0,0 @@ -currencyRatesIndex = $currencyRatesIndex; - $this->currencySymbols = $currencySymbols; - } - - /** - * Import currency rates step. - * - * @return void - */ - public function run() - { - if ($this->currencySymbols !== '-') { - $this->currencyRatesIndex->open(); - $this->currencyRatesIndex->getGridPageActions()->clickImportButton(); - $this->currencyRatesIndex->getGridPageActions()->saveCurrentRate(); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/TestStep/SetupCurrencyRatesStep.php b/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/TestStep/SetupCurrencyRatesStep.php deleted file mode 100644 index d8e77fb3e45..00000000000 --- a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/TestStep/SetupCurrencyRatesStep.php +++ /dev/null @@ -1,57 +0,0 @@ -currencyRatesIndex = $currencyRatesIndex; - $this->currencySymbols = $currencySymbols; - } - - /** - * Set up currency rate step. - * - * @return void - */ - public function run() - { - if ($this->currencySymbols !== '-') { - $this->currencyRatesIndex->open(); - $this->currencyRatesIndex->getCurrencyGrid()->setupGbpRate(); - $this->currencyRatesIndex->getGridPageActions()->saveCurrentRate(); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/etc/fixture.xml deleted file mode 100644 index 1f842866da6..00000000000 --- a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/etc/fixture.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - flat - core_config_data - - - inherit_custom_currency_symbol - virtual - checkbox - - - custom_currency_symbol - virtual - - - code - virtual - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Account/Address/AdditionalAddress.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Account/Address/AdditionalAddress.php deleted file mode 100644 index 6b8c7e4d94c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Account/Address/AdditionalAddress.php +++ /dev/null @@ -1,71 +0,0 @@ -addressItem, $address->getStreet()); - $addressItem = $this->_rootElement->find($addressItemSelector, Locator::SELECTOR_XPATH); - $addressItem->find($this->deleteAddress)->click(); - $this->browser->acceptAlert(); - } - - /** - * Get block text. - * - * @return string - */ - public function getBlockText() - { - return $this->_rootElement->find($this->blockText)->getText(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Account/Address/Book.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Account/Address/Book.php deleted file mode 100644 index 6da39a7c3b5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Account/Address/Book.php +++ /dev/null @@ -1,44 +0,0 @@ -blockFactory->create( - 'Mage\Customer\Test\Block\Account\Address\AdditionalAddress', - ['element' => $this->_rootElement->find($this->additionalAddress)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Account/Dashboard/Info.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Account/Dashboard/Info.php deleted file mode 100644 index c33d0445535..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Account/Dashboard/Info.php +++ /dev/null @@ -1,41 +0,0 @@ -_rootElement->find($this->contactInfoChangePasswordLink)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Account/Navigation.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Account/Navigation.php deleted file mode 100644 index 9fb10168de5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Account/Navigation.php +++ /dev/null @@ -1,43 +0,0 @@ -_rootElement->find(sprintf($this->navigationItem, $link), Locator::SELECTOR_XPATH)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Address/Edit.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Address/Edit.php deleted file mode 100644 index 67fd2de2bce..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Address/Edit.php +++ /dev/null @@ -1,42 +0,0 @@ -_rootElement->find($this->save)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Address/Edit.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Address/Edit.xml deleted file mode 100644 index ac60f15aedf..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Address/Edit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - #street_1 - - - - select - - - - select - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Address/Renderer.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Address/Renderer.php deleted file mode 100644 index 9220f37a3df..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Address/Renderer.php +++ /dev/null @@ -1,142 +0,0 @@ -address = $address; - $this->type = $type; - } - - /** - * Returns pattern according to address type. - * - * @return string - */ - protected function getPattern() - { - $region = $this->resolveRegion(); - switch ($this->type) { - case "html": - $outputPattern = "{{depend}}{{prefix}} {{/depend}}{{firstname}} {{depend}}{{middlename}} {{/depend}}" - . "{{lastname}}{{depend}} {{suffix}}{{/depend}}\n{{depend}}{{company}}\n{{/depend}}{{street}}\n" - . "{{city}}, {{{$region}}}, {{postcode}}\n{{country_id}}\n{{depend}}T: {{telephone}}{{/depend}}" - . "{{depend}}\nF: {{fax}}{{/depend}}{{depend}}\nVAT: {{vat_id}}{{/depend}}"; - break; - case "oneline": - default: - $outputPattern = "{{depend}}{{prefix}} {{/depend}}{{firstname}} {{depend}}{{middlename}} {{/depend}}" - . "{{lastname}}{{depend}} {{suffix}}{{/depend}}, {{street}}, " - . "{{city}}, {{{$region}}} {{postcode}}, {{country_id}}"; - break; - } - return $outputPattern; - } - - /** - * Render address according to format type. - * - * @return string - */ - public function render() - { - $outputPattern = $this->getPattern(); - $fields = $this->getFieldsArray($outputPattern); - $output = $this->preparePattern(); - $output = str_replace(['{{depend}}', '{{/depend}}', '{', '}'], '', $output); - - foreach ($fields as $field) { - $data = $this->address->getData($field); - $output = str_replace($field, $data, $output); - } - - return $output; - } - - /** - * Get an array of necessary fields from pattern. - * - * @param string $outputPattern - * @return mixed - */ - protected function getFieldsArray($outputPattern) - { - $fieldsArray = []; - preg_match_all('@\{\{(\w+)\}\}@', $outputPattern, $matches); - foreach ($matches[1] as $item) { - if ($item != 'depend') { - $fieldsArray[] = $item; - } - } - return $fieldsArray; - } - - /** - * Purge fields from pattern which are not present in fixture. - * - * @return string - */ - protected function preparePattern() - { - $outputPattern = $this->getPattern(); - preg_match_all('@\{\{depend\}\}(.*?)\{\{.depend\}\}@siu', $outputPattern, $matches); - foreach ($matches[1] as $key => $dependPart) { - preg_match_all('@\{\{(\w+)\}\}@', $dependPart, $depends); - foreach ($depends[1] as $depend) { - if ($this->address->getData(trim($depend)) === null) { - $outputPattern = str_replace($matches[0][$key], "", $outputPattern); - } - } - } - return $outputPattern; - } - - /** - * Check necessary field to retrieve according to address country. - * - * @return string - */ - protected function resolveRegion() - { - return $this->address->hasData('region') ? 'region' : 'region_id'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Form/CustomerForm.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Form/CustomerForm.php deleted file mode 100644 index e59e868824b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Form/CustomerForm.php +++ /dev/null @@ -1,77 +0,0 @@ -_rootElement->find($this->saveButton)->click(); - } - - /** - * Get all error validation messages for fields. - * - * @param Customer $customer - * @return array - */ - public function getValidationMessages(Customer $customer) - { - $messages = []; - foreach (array_keys($customer->getData()) as $field) { - $element = $this->_rootElement->find( - sprintf($this->validationText, 'advice-validate-c' . str_replace('_', '-', $field)) - ); - if ($element->isVisible()) { - $messages[$field] = $element->getText(); - } - } - return $messages; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Form/CustomerForm.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Form/CustomerForm.xml deleted file mode 100644 index 9927c024f41..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Form/CustomerForm.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - #confirmation - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Form/Login.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Form/Login.php deleted file mode 100644 index be3d27dcdea..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Form/Login.php +++ /dev/null @@ -1,72 +0,0 @@ -fill($customer); - $this->submit(); - $this->waitForElementNotVisible($this->loginButton, Locator::SELECTOR_CSS); - } - - /** - * Submit login form. - */ - public function submit() - { - $this->_rootElement->find($this->loginButton, Locator::SELECTOR_CSS)->click(); - } - - /** - * Click on 'Create an Account' button. - * - * @return void - */ - public function createNewAccount() - { - $this->_rootElement->find($this->newAccount)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Form/Login.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Form/Login.xml deleted file mode 100644 index 51f28e75355..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Form/Login.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - login - - - [name='login[username]'] - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Form/Register.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Form/Register.php deleted file mode 100644 index f5aaa2e45f3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Form/Register.php +++ /dev/null @@ -1,47 +0,0 @@ -dataMapping($fixture->getData()); - unset($mapping['id']); - $this->_fill($mapping); - $this->_rootElement->find($this->submit, Locator::SELECTOR_CSS)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Form/Register.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Form/Register.xml deleted file mode 100644 index b170e4f3dc3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Form/Register.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - checkbox - - - #confirmation - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertAddressDeletedBackend.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertAddressDeletedBackend.php deleted file mode 100644 index 3d6cbc88b74..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertAddressDeletedBackend.php +++ /dev/null @@ -1,77 +0,0 @@ -open()->getPageActionsBlock()->addNew(); - $orderCreateIndex->getCustomerGrid()->selectCustomer($customer); - $orderCreateIndex->getStoreBlock()->selectStoreView(); - \PHPUnit_Framework_Assert::assertNotContains( - $this->prepareAddress($deletedAddress), - $orderCreateIndex->getCreateBlock()->getBillingAddressForm()->getExistingAddresses(), - 'Deleted address is present on backend during order creation' - ); - } - - /** - * Prepare address for assertion. - * - * @param Address $address - * @return string - */ - protected function prepareAddress(Address $address) - { - /** @var Renderer $renderer */ - $renderer = $this->objectManager->create('Mage\Customer\Test\Block\Address\Renderer', ['address' => $address]); - return $renderer->render(); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Deleted address is absent on backend during order creation'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertAddressDeletedFrontend.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertAddressDeletedFrontend.php deleted file mode 100644 index 0ca4a539b91..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertAddressDeletedFrontend.php +++ /dev/null @@ -1,63 +0,0 @@ -open(); - $customerAccountIndex->getAccountNavigationBlock()->openNavigationItem('Address Book'); - \PHPUnit_Framework_Assert::assertEquals( - self::EXPECTED_MESSAGE, - $customerAddress->getBookBlock()->getAdditionalAddressBlock()->getBlockText(), - 'Expected text is absent in Additional Address block.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Deleted address is absent in "Additional Address Entries" block.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertChangePasswordFailMessage.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertChangePasswordFailMessage.php deleted file mode 100644 index bbbf8c3a962..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertChangePasswordFailMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessages()->getErrorMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Fail message is displayed.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerFailRegisterMessage.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerFailRegisterMessage.php deleted file mode 100644 index 913ad22b07e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerFailRegisterMessage.php +++ /dev/null @@ -1,59 +0,0 @@ -getMessagesBlock()->getErrorMessages(), - "Actual error message doesn't match expected error message." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Error message is displayed after creation existing customer.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerForm.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerForm.php deleted file mode 100644 index 7f64e8b26f4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerForm.php +++ /dev/null @@ -1,145 +0,0 @@ -prepareData($customer, $initialCustomer, $address); - $filter['email'] = $data['customer']['email']; - - $pageCustomerIndex->open(); - $pageCustomerIndex->getCustomerGridBlock()->searchAndOpen($filter); - $dataForm = $pageCustomerEdit->getCustomerForm()->getDataCustomer($customer, $address); - $dataDiff = $this->verify($data, $dataForm); - \PHPUnit_Framework_Assert::assertTrue( - empty($dataDiff), - 'Customer data on edit page(backend) not equals to passed from fixture.' - . "\nFailed values: " . implode(', ', $dataDiff) - ); - } - - /** - * Prepare data. - * - * @param Customer $customer - * @param Customer $initialCustomer [optional] - * @param Address $address [optional] - * @return array - */ - protected function prepareData(Customer $customer, Customer $initialCustomer = null, Address $address = null) - { - if ($initialCustomer) { - $data['customer'] = $customer->hasData() - ? array_merge($initialCustomer->getData(), $customer->getData()) - : $initialCustomer->getData(); - } else { - $data['customer'] = $customer->getData(); - } - if ($address) { - $data['addresses'][1] = $address->hasData() ? $address->getData() : []; - } else { - $data['addresses'] = []; - } - - return $data; - } - - /** - * Verify data in form equals to passed from fixture. - * - * @param array $dataFixture - * @param array $dataForm - * @return array - */ - protected function verify(array $dataFixture, array $dataForm) - { - $result = []; - - $customerDiff = array_diff_assoc($dataFixture['customer'], $dataForm['customer']); - foreach ($customerDiff as $name => $value) { - if (in_array($name, $this->customerSkippedFields)) { - continue; - } - $result[] = "\ncustomer {$name}: \"{$dataForm['customer'][$name]}\" instead of \"{$value}\""; - } - foreach ($dataFixture['addresses'] as $key => $address) { - $addressDiff = array_diff($address, $dataForm['addresses'][$key]); - foreach ($addressDiff as $name => $value) { - $result[] = "\naddress #{$key} {$name}: \"{$dataForm['addresses'][$key][$name]}" - . "\" instead of \"{$value}\""; - } - } - - return $result; - } - - /** - * Text success verify Customer form. - * - * @return string - */ - public function toString() - { - return 'Displayed customer data on edit page(backend) equals to passed from fixture.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerGroupAlreadyExists.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerGroupAlreadyExists.php deleted file mode 100644 index ab54cdd251a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerGroupAlreadyExists.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getErrorMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Customer group already exist error message is displayed.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerGroupInGrid.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerGroupInGrid.php deleted file mode 100644 index 9d440c7cd56..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerGroupInGrid.php +++ /dev/null @@ -1,57 +0,0 @@ -open(); - $customerGroupCode = $customerGroup->getCustomerGroupCode(); - \PHPUnit_Framework_Assert::assertTrue( - $customerGroupIndex->getCustomerGroupGrid()->isRowVisible(['code' => $customerGroupCode]), - "Group '{$customerGroupCode}' is absent in customer groups grid." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Customer group is present in customer groups grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerGroupOnCustomerForm.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerGroupOnCustomerForm.php deleted file mode 100644 index 2775dd66016..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerGroupOnCustomerForm.php +++ /dev/null @@ -1,58 +0,0 @@ -open(); - $formCustomerGroups = $customerNew->getCustomerForm()->getCustomerGroups(); - $customerGroupCode = $customerGroup->getCustomerGroupCode(); - \PHPUnit_Framework_Assert::assertTrue( - in_array($customerGroupCode, $formCustomerGroups), - "Customer group '{$customerGroupCode}' is absent on customer account information page" - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Customer group find on customer account information page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerGroupSuccessSaveMessage.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerGroupSuccessSaveMessage.php deleted file mode 100644 index 325ac6524c1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerGroupSuccessSaveMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Customer group success save message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerInGrid.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerInGrid.php deleted file mode 100644 index e02b0516960..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerInGrid.php +++ /dev/null @@ -1,96 +0,0 @@ -prepareData($customer, $initialCustomer); - $filter = ['name' => $data[0], 'email' => $data[1]['email']]; - - $pageCustomerIndex->open(); - \PHPUnit_Framework_Assert::assertTrue( - $pageCustomerIndex->getCustomerGridBlock()->isRowVisible($filter), - 'Customer with ' - . 'name \'' . $filter['name'] . '\', ' - . 'email \'' . $filter['email'] . '\' ' - . 'is absent in Customer grid.' - ); - } - - /** - * Prepare data. - * - * @param Customer $customer - * @param Customer $initialCustomer [optional] - * @return string - */ - protected function prepareData(Customer $customer, Customer $initialCustomer = null) - { - if ($initialCustomer) { - $customer = $customer->hasData() - ? array_merge($initialCustomer->getData(), $customer->getData()) - : $initialCustomer->getData(); - } else { - $customer = $customer->getData(); - } - $name = (isset($customer['prefix']) ? $customer['prefix'] . ' ' : '') - . $customer['firstname'] - . (isset($customer['middlename']) ? ' ' . $customer['middlename'] : '') - . ' ' . $customer['lastname'] - . (isset($customer['suffix']) ? ' ' . $customer['suffix'] : ''); - - return [$name, $customer]; - } - - /** - * Text success exist Customer in grid. - * - * @return string - */ - public function toString() - { - return 'Customer is present in Customer grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerInfoSuccessSavedMessage.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerInfoSuccessSavedMessage.php deleted file mode 100644 index e9aafdd36a7..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerInfoSuccessSavedMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns success message if equals to expected message. - * - * @return string - */ - public function toString() - { - return 'Success customer info save message on customer account index page is correct.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerInvalidEmail.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerInvalidEmail.php deleted file mode 100644 index afedf9940b2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerInvalidEmail.php +++ /dev/null @@ -1,68 +0,0 @@ -getEmail(), self::ERROR_EMAIL_MESSAGE); - $message = $pageCustomerNew->getMessagesBlock()->getErrorMessages(); - $actualMessage = explode("\n", $message[0]); - - \PHPUnit_Framework_Assert::assertEquals( - $expectMessage, - $actualMessage[0], - 'Wrong error message is displayed.' - ); - } - - /** - * Text success display error message - * - * @return string - */ - public function toString() - { - return 'Assert that error message is displayed.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerPasswordChanged.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerPasswordChanged.php deleted file mode 100644 index 512de914fec..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerPasswordChanged.php +++ /dev/null @@ -1,76 +0,0 @@ -createByCode( - 'customer', - [ - 'data' => [ - 'email' => $initialCustomer->getEmail(), - 'password' => $customer->getPassword(), - 'password_confirmation' => $customer->getPassword(), - ], - ] - ); - $this->objectManager->create( - 'Mage\Customer\Test\TestStep\LoginCustomerOnFrontendStep', - ['customer' => $customer] - )->run(); - \PHPUnit_Framework_Assert::assertTrue( - $customerAccountIndex->getAccountNavigationBlock()->isVisible(), - 'Customer Account Dashboard is not visible.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Customer password was changed.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerSuccessRegisterMessage.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerSuccessRegisterMessage.php deleted file mode 100644 index 08133994807..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerSuccessRegisterMessage.php +++ /dev/null @@ -1,62 +0,0 @@ -getMessagesBlock()->getSuccessMessages(), - 'Wrong success message is displayed.' - ); - } - - /** - * Text of success register message is displayed. - * - * @return string - */ - public function toString() - { - return "Customer is successfully registered."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerSuccessSaveMessage.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerSuccessSaveMessage.php deleted file mode 100644 index c7eaca3f405..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerSuccessSaveMessage.php +++ /dev/null @@ -1,61 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Text success save message is displayed. - * - * @return string - */ - public function toString() - { - return 'Assert that success message is displayed.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertWrongPassConfirmationMessage.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertWrongPassConfirmationMessage.php deleted file mode 100644 index d61af617a4f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertWrongPassConfirmationMessage.php +++ /dev/null @@ -1,61 +0,0 @@ -getAccountInfoForm()->getValidationMessages($customer)['password_confirmation'], - 'Wrong password confirmation validation text message.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Password confirmation validation text message is displayed.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/FrontendActionsForCustomer.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/FrontendActionsForCustomer.php deleted file mode 100644 index 42a880d8cb6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/FrontendActionsForCustomer.php +++ /dev/null @@ -1,90 +0,0 @@ - 'Mage\Customer\Test\Page\CustomerAccountIndex' - ]; - - /** - * @constructor - */ - public function __construct() - { - foreach ($this->pages as $key => $page) { - $this->$key = $this->createPage($page); - } - } - - /** - * Create page. - * - * @param string $page - * @return PageInterface - */ - protected function createPage($page) - { - return ObjectManager::getInstance()->create($page); - } - - /** - * Login customer to frontend. - * - * @param Customer $customer - * @return void - */ - public function loginCustomer(Customer $customer) - { - $loginCustomerOnFrontendStep = ObjectManager::getInstance()->create( - 'Mage\Customer\Test\TestStep\LoginCustomerOnFrontendStep', - ['customer' => $customer] - ); - $loginCustomerOnFrontendStep->run(); - } - - /** - * Open customer tab. - * - * @param string $tabName - * @return void - */ - public function openCustomerTab($tabName) - { - $this->customerAccountIndex->getAccountNavigationBlock()->openNavigationItem($tabName); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Fixture/Address.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/Fixture/Address.xml deleted file mode 100644 index b295d50c5ed..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Fixture/Address.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Fixture/Customer.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/Fixture/Customer.xml deleted file mode 100644 index a9296919724..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Fixture/Customer.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Fixture/Customer/Address.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Fixture/Customer/Address.php deleted file mode 100644 index 406af6e5ead..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Fixture/Customer/Address.php +++ /dev/null @@ -1,70 +0,0 @@ -params = $params; - - if (isset($data['dataset'])) { - $data['dataset'] = explode(',', $data['dataset']); - foreach ($data['dataset'] as $value) { - /** @var AddressFixture $fixture */ - $addresses = $fixtureFactory->createByCode('address', ['dataset' => $value]); - $this->data[] = $addresses->getData(); - $this->addressesFixture[] = $addresses; - } - } elseif (empty($data['dataset']) && !empty($data['addresses'])) { - foreach ($data['addresses'] as $addresses) { - /** @var AddressFixture $addresses */ - $this->data[] = $addresses->getData(); - $this->addressesFixture[] = $addresses; - } - } - } - - /** - * Getting addresses fixture. - * - * @return array - */ - public function getAddresses() - { - return $this->addressesFixture; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Fixture/Customer/GroupId.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Fixture/Customer/GroupId.php deleted file mode 100644 index ed3c7ef8383..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Fixture/Customer/GroupId.php +++ /dev/null @@ -1,113 +0,0 @@ -params = $params; - if (isset($data['dataset'])) { - /** @var CustomerGroup $customerGroup */ - $customerGroup = $fixtureFactory->createByCode('customerGroup', ['dataset' => $data['dataset']]); - if (!$customerGroup->hasData('customer_group_id')) { - $customerGroup->persist(); - } - $this->data = $customerGroup->getCustomerGroupCode(); - $this->customerGroupFixture = $customerGroup; - } - if (isset($data['customerGroup']) && $data['customerGroup'] instanceof CustomerGroup) { - $this->data = $data['customerGroup']->getCustomerGroupCode(); - $this->customerGroupFixture = $data['customerGroup']; - } - } - - /** - * Persists prepared data into application. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set. - * - * @param int|null $key [optional] - * @return array - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings. - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Getting customerGroup fixture. - * - * @return array - */ - public function getCustomerGroup() - { - return $this->customerGroupFixture; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Fixture/CustomerGroup.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/Fixture/CustomerGroup.xml deleted file mode 100644 index 39a99c0463e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Fixture/CustomerGroup.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Fixture/CustomerGroup/TaxClassIds.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Fixture/CustomerGroup/TaxClassIds.php deleted file mode 100644 index e34bbd3bd4e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Fixture/CustomerGroup/TaxClassIds.php +++ /dev/null @@ -1,106 +0,0 @@ -params = $params; - if (isset($data['dataset'])) { - /** @var TaxClass $taxClass */ - $taxClass = $fixtureFactory->createByCode('taxClass', ['dataset' => $data['dataset']]); - if (!$taxClass->hasData('id')) { - $taxClass->persist(); - } - $this->data = $taxClass->getClassName(); - $this->taxClass = $taxClass; - } - } - - /** - * Persist Tax class. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set. - * - * @param $key [optional] - * @return mixed - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return TaxClass fixture. - * - * @return TaxClass - */ - public function getTaxClass() - { - return $this->taxClass; - } - - /** - * Return data set configuration settings. - * - * @return string - */ - public function getDataConfig() - { - return $this->params; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Handler/Customer/Curl.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Handler/Customer/Curl.php deleted file mode 100644 index 23d27ff801b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Handler/Customer/Curl.php +++ /dev/null @@ -1,257 +0,0 @@ - [ - 'United States' => 'US', - 'United Kingdom' => 'GB' - ], - 'region_id' => [ - 'California' => 12, - 'New York' => 43, - 'Texas' => 57, - ], - 'gender' => [ - 'Male' => 1, - 'Female' => 2 - ], - ]; - - /** - * Curl mapping data. - * - * @var array - */ - protected $curlMapping = [ - 'account' => [ - 'group_id', - 'firstname', - 'lastname', - 'email', - 'dob', - 'taxvat', - 'gender' - ], - 'customerbalance' => [ - 'amount_delta' - ], - ]; - - /** - * Array of fields are needing to be updated via updateCustomer() method. - * - * @var array - */ - protected $updatingFields = [ - 'address', - 'dob', - 'gender', - 'amount_delta' - ]; - - /** - * Post request for creating customer in frontend. - * - * @param FixtureInterface|null $customer - * @return array - * @throws \Exception - */ - public function persist(FixtureInterface $customer = null) - { - $result = []; - /** @var Customer $customer */ - $url = $_ENV['app_frontend_url'] . 'customer/account/createpost/?nocookie=true'; - $data = $customer->getData(); - $data['group_id'] = $this->getCustomerGroup($customer); - - if ($customer->hasData('address')) { - $data['address'] = http_build_query($data['address']); - } - - $curl = new CurlTransport(); - $curl->write($url, $data); - $response = $curl->read(); - $curl->close(); - if (!strpos($response, 'class="success-msg"')) { - throw new \Exception("Customer entity creating by curl handler was not successful! Response: $response"); - } - - $result['id'] = $this->getCustomerId($customer->getEmail()); - $data['customer_id'] = $result['id']; - - if ($this->checkForUpdateData($data)) { - parse_str($data['address'], $data['address']); - $this->updateCustomer($data); - } - - return $result; - } - - /** - * Check if customer needs to update data during curl creation. - * - * @param array $data - * @return bool - */ - protected function checkForUpdateData(array $data) - { - foreach (array_keys($data) as $key) { - if (in_array($key, $this->updatingFields)) { - return true; - } - } - return false; - } - - /** - * Get customer id by email. - * - * @param string $email - * @return int|null - */ - protected function getCustomerId($email) - { - $url = $_ENV['app_backend_url'] . 'customer/index/grid/filter/' . $this->encodeFilter(['email' => $email]); - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - - $curl->write($url, [], CurlInterface::GET); - $response = $curl->read(); - $curl->close(); - - preg_match('~a href=[^\s]*\/id\/(\d+)~', $response, $match); - return empty($match[1]) ? null : $match[1]; - } - - /** - * Prepare customer for curl. - * - * @param FixtureInterface $customer - * @return string - */ - protected function getCustomerGroup(FixtureInterface $customer) - { - return $customer->hasData('group_id') - ? $customer->getDataFieldConfig('group_id')['source']->getCustomerGroup()->getCustomerGroupId() - : self::GENERAL_GROUP; - } - - /** - * Update customer account. - * - * @param array $data - * @return void - * @throws \Exception - */ - protected function updateCustomer(array $data) - { - $curlData = []; - $url = $_ENV['app_backend_url'] . 'customer/save'; - foreach ($data as $key => $value) { - foreach ($this->curlMapping as $prefix => $prefixValues) { - if (in_array($key, $prefixValues)) { - $curlData[$prefix][$key] = $value; - unset($data[$key]); - } - } - } - unset($data['password'], $data['confirmation']); - - $curlData = $this->replaceMappingData(array_merge($curlData, $data)); - $curlData = $this->prepareAddressData($curlData); - - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->write($url, $curlData); - $response = $curl->read(); - $curl->close(); - - if (!strpos($response, 'class="success-msg"')) { - throw new \Exception('Failed to assign an address to the customer!'); - } - } - - /** - * Preparing address data for curl. - * - * @param array $curlData - * @return array - */ - protected function prepareAddressData(array $curlData) - { - $address = []; - foreach (array_keys($curlData['address']) as $key) { - $curlData['address'][$key]['_deleted'] = ''; - $curlData['address'][$key]['region'] = ''; - if (!is_array($curlData['address'][$key]['street'])) { - $street = $curlData['address'][$key]['street']; - $curlData['address'][$key]['street'] = []; - $curlData['address'][$key]['street'][] = $street; - } - $newKey = '_item' . ($key); - if (isset($curlData['address'][$key]['default_billing'])) { - $value = $curlData['address'][$key]['default_billing'] === 'Yes' ? $newKey : ''; - $curlData['account']['default_billing'] = $value; - } - if (isset($curlData['address'][$key]['default_shipping'])) { - $value = $curlData['address'][$key]['default_shipping'] === 'Yes' ? $newKey : ''; - $curlData['account']['default_shipping'] = $value; - } - $address[$newKey] = $curlData['address'][$key]; - } - $curlData['address'] = $address; - - return $curlData; - } - - /** - * Encoded filter parameters. - * - * @param array $filter - * @return string - */ - protected function encodeFilter(array $filter) - { - $result = []; - foreach ($filter as $name => $value) { - $result[] = "{$name}={$value}"; - } - $result = implode('&', $result); - - return base64_encode($result); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Handler/Customer/CustomerInterface.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Handler/Customer/CustomerInterface.php deleted file mode 100644 index d09c4810236..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Handler/Customer/CustomerInterface.php +++ /dev/null @@ -1,26 +0,0 @@ -prepareData($fixture); - $url = $_ENV['app_backend_url'] . $this->saveUrl . "?" . http_build_query($data); - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->write($url, [], CurlInterface::GET); - $response = $curl->read(); - $curl->close(); - - if (!strpos($response, 'class="success-msg"')) { - throw new \Exception( - "Customer Group entity creating by curl handler was not successful! Response: $response" - ); - } - - return ['customer_group_id' => $this->getCustomerGroupId($data, $response)]; - } - - /** - * Get id after creating Customer Group. - * - * @param array $data - * @return string|null - */ - public function getCustomerGroupId(array $data) - { - $regExp = '/.*id\/(\d+)\/.*' . $data['code'] . '/siu'; - - $url = $_ENV['app_backend_url'] . 'customer_group/index/sort/time/dir/desc/'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->write($url, [], CurlInterface::GET); - $response = $curl->read(); - $curl->close(); - preg_match($regExp, $response, $matches); - - return empty($matches[1]) ? null : $matches[1]; - } - - /** - * Prepare fixture data. - * - * @param FixtureInterface $fixture - * @return array - */ - protected function prepareData(FixtureInterface $fixture) - { - /** @var CustomerGroup $fixture */ - return [ - 'code' => $fixture->getCustomerGroupCode(), - 'tax_class' => $fixture->getDataFieldConfig('tax_class_id')['source']->getTaxClass()->getId() - ]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Handler/CustomerGroup/CustomerGroupInterface.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Handler/CustomerGroup/CustomerGroupInterface.php deleted file mode 100644 index 8fed3b77ab3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Handler/CustomerGroup/CustomerGroupInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Page/Adminhtml/CustomerGroupIndex.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/Page/Adminhtml/CustomerGroupIndex.xml deleted file mode 100644 index b6876860d42..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Page/Adminhtml/CustomerGroupIndex.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Page/Adminhtml/CustomerGroupNew.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/Page/Adminhtml/CustomerGroupNew.xml deleted file mode 100644 index 2d1bac7825e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Page/Adminhtml/CustomerGroupNew.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Page/Adminhtml/CustomerIndex.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/Page/Adminhtml/CustomerIndex.xml deleted file mode 100644 index 4170ad77ddb..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Page/Adminhtml/CustomerIndex.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Page/Adminhtml/CustomerNew.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/Page/Adminhtml/CustomerNew.xml deleted file mode 100644 index 5d3911ed23a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Page/Adminhtml/CustomerNew.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Page/CustomerAccountCreate.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/Page/CustomerAccountCreate.xml deleted file mode 100644 index 054db62a7a5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Page/CustomerAccountCreate.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Page/CustomerAccountEdit.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/Page/CustomerAccountEdit.xml deleted file mode 100644 index edc0a69d589..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Page/CustomerAccountEdit.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Page/CustomerAccountIndex.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/Page/CustomerAccountIndex.xml deleted file mode 100644 index 28e6dc0a277..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Page/CustomerAccountIndex.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Page/CustomerAccountLogin.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/Page/CustomerAccountLogin.xml deleted file mode 100644 index 6ce15e5e9da..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Page/CustomerAccountLogin.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Page/CustomerAccountLogout.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/Page/CustomerAccountLogout.xml deleted file mode 100644 index f0bd4b281cc..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Page/CustomerAccountLogout.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Page/CustomerAddress.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/Page/CustomerAddress.xml deleted file mode 100644 index 98364be9bca..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Page/CustomerAddress.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Repository/Address.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/Repository/Address.xml deleted file mode 100644 index 8d8824c8c9d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Repository/Address.xml +++ /dev/null @@ -1,196 +0,0 @@ - - - - - - John - Doe - JohnDoe_%isolation%@example.com - Magento %isolation% - Culver City - 6161 West Centinela Avenue - 90230 - United States - California - 555-55-555-55 - 555-55-555-55 - - - - John - Doe - Magento %isolation% - Culver City - 6161 West Centinela Avenue - 90230 - United States - California - 555-55-555-55 - 555-55-555-55 - - - - John - Doe - Magento %isolation% - 3222 Cliffside Drive - Binghamton - New York - 13901 - United States - 607-481-7802 - - - - John - Doe - John.Doe%isolation%@example.com - Magento %isolation% - 3222 Cliffside Drive - Binghamton - New York - 13901 - United States - 607-481-7802 - Yes - Yes - - - - New York - 13901 - United States - - - - John - Doe - John.Doe%isolation%@example.com - Magento %isolation% - 7700 W. Parmer Lane Bldg. D - Austin - Texas - 78729 - United States - 512-691-4400 - Yes - Yes - - - - Jane - Jansen - JaneJansen%isolation%@example.com - Magento %isolation% - Berlin - Augsburger Strabe 41 - 10789 - Germany - Berlin - 333-33-333-33 - - - - Jane - Doe - Magento %isolation% - London - 172, Westminster Bridge Rd - SE1 7RW - United Kingdom - 444-44-444-44 - - - - Jane - Doe - Magento %isolation% - London - 172, Westminster Bridge Rd - SE1 7RW - United Kingdom - 444-44-444-44 - 584451913 - Yes - - - - John - Doe - Magento %isolation% - 6161 West Centinela Avenue - Culver City - California - 90230 - United States - 555-55-555-55 - - - - John - Doe - John.Doe%isolation%@example.com - Magento %isolation% - 6161 West Centinela Avenue - Culver City - California - 90230 - United States - 555-55-555-55 - Yes - Yes - - - - John - Doe - John.Doe%isolation%@example.com - Magento %isolation% - 6161 West Centinela Avenue - Culver City - California - 90230 - United States - 555-55-555-55 - - - - John - Doe - Magento %isolation% - 6161 West Centinela Avenue - Culver City - California - 90230 - United States - 555-55-555-55 - - - - John - Doe - Magento %isolation% - Culver City - 6161 West Centinela Avenue - 90230 - United States - California - 555-55-555-55 - 555-55-555-55 - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Repository/ConfigData.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/Repository/ConfigData.xml deleted file mode 100644 index f71cbad6063..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Repository/ConfigData.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - customer - 1 - Yes - 1 - - - customer - 1 - Billing Address - billing - - - customer - 1 - Yes - 1 - - - - - customer - 1 - No - 0 - - - customer - 1 - No - 0 - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Repository/Customer.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/Repository/Customer.xml deleted file mode 100644 index e46788cb0e2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Repository/Customer.xml +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - John - Doe - - General - - JohnDoe_%isolation%@example.com - 123123q - 123123q - - - - John - Doe - JohnDoe_%isolation%@example.com - - - - John - Doe - JohnDoe_%isolation%@example.com - 123123q - 123123q - - - - John - Doe - JohnDoe_%isolation%@example.com - 123123q - 123123q - - customer_US_login_miltiship - - - - - John - Doe%isolation% - - General - - JohnDoe_%isolation%@example.com - 123123q - 123123q - - US_address_NY - - - - - John - Doe%isolation% - - General - - JohnDoe_%isolation%@example.com - 123123q - 123123q - - US_address_TX - - - - - John - Doe - - Retailer - - JohnDoe_%isolation%@example.com - 123123q - 123123q - - US_address_NY - - 01/01/1990 - Male - - - - John - Doe - - General - - JohnDoe_%isolation%@example.com - 123123q - 123123q - - US_address_NY,US_address_TX - - - - - John - Doe - - General - - JohnDoe_%isolation%@example.com - 123123q - 123123q - - US_address - - - - - John - Doe - - General - - JohnDoe_%isolation%@example.com - 123123q - 123123q - - customer_UK_with_vat - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Repository/CustomerGroup.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/Repository/CustomerGroup.xml deleted file mode 100644 index b8840f8bd36..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Repository/CustomerGroup.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 1 - General - - Retail Customer - - - - 3 - Retailer - - Retail Customer - - - - 2 - Wholesale - - Retail Customer - - - - 0 - All Customer Groups - - - 0 - NOT LOGGED IN - - Retail Customer - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/ChangeCustomerPasswordTest.php b/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/ChangeCustomerPasswordTest.php deleted file mode 100644 index 2541fae07f8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/ChangeCustomerPasswordTest.php +++ /dev/null @@ -1,135 +0,0 @@ -cmsIndex = $cmsIndex; - $this->customerAccountLogin = $customerAccountLogin; - $this->customerAccountIndex = $customerAccountIndex; - $this->customerAccountEdit = $customerAccountEdit; - } - - /** - * Run Change customer password test. - * - * @param Customer $initialCustomer - * @param Customer $customer - * @return void - */ - public function test(Customer $initialCustomer, Customer $customer) - { - // Preconditions - $initialCustomer->persist(); - - // Steps - $this->objectManager->create( - 'Mage\Customer\Test\TestStep\LoginCustomerOnFrontendStep', - ['customer' => $initialCustomer] - )->run(); - - $this->cmsIndex->getTopLinksBlock()->openAccount(); - $this->cmsIndex->getLinksBlock()->openLink('My Account'); - $this->customerAccountIndex->getInfoBlock()->openChangePassword(); - $this->customerAccountEdit->getAccountInfoForm()->fill($customer); - $this->customerAccountEdit->getAccountInfoForm()->submit(); - $this->cmsIndex->getTopLinksBlock()->openAccount(); - if ( - !$this->customerAccountIndex->getMessagesBlock()->isVisibleMessage('success') - && $this->cmsIndex->getLinksBlock()->isLinkVisible('Log In') - ) { - $fixtureFactory = $this->objectManager->create('Magento\Mtf\Fixture\FixtureFactory'); - $customer = $fixtureFactory->createByCode( - 'customer', - [ - 'data' => [ - 'email' => $initialCustomer->getEmail(), - 'password' => $customer->getPassword(), - 'password_confirmation' => $customer->getPassword(), - ], - ] - ); - $this->objectManager->create( - 'Mage\Customer\Test\TestStep\LoginCustomerOnFrontendStep', - ['customer' => $customer] - )->run(); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/ChangeCustomerPasswordTest.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/ChangeCustomerPasswordTest.xml deleted file mode 100644 index 308e1d9bfa8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/ChangeCustomerPasswordTest.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - default - 123123q - 123123a - 123123a - - - - default - 123123z - 123123a - 123123a - - - - default - 123123q - 123123a - 123123z - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/CreateCustomerFromBackendTest.php b/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/CreateCustomerFromBackendTest.php deleted file mode 100644 index 8e98b2d891c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/CreateCustomerFromBackendTest.php +++ /dev/null @@ -1,83 +0,0 @@ - All Customers. - * 3. Press "Add New Customer" button. - * 4. Fill form. - * 5. Click "Save Customer" button. - * 6. Perform all assertions. - * - * @group ACL_(MX) - * @ZephyrId MPERF-6600 - */ -class CreateCustomerFromBackendTest extends Injectable -{ - /** - * Customer index page. - * - * @var CustomerIndex - */ - protected $pageCustomerIndex; - - /** - * Customer new page. - * - * @var CustomerNew - */ - protected $pageCustomerIndexNew; - - /** - * Injection pages. - * - * @param CustomerIndex $pageCustomerIndex - * @param CustomerNew $pageCustomerIndexNew - * @return void - */ - public function __inject(CustomerIndex $pageCustomerIndex, CustomerNew $pageCustomerIndexNew) - { - $this->pageCustomerIndex = $pageCustomerIndex; - $this->pageCustomerIndexNew = $pageCustomerIndexNew; - } - - /** - * Creation customer from backend. - * - * @param Customer $customer - * @param Address $address - * @return void - */ - public function test(Customer $customer, Address $address) - { - // Prepare data - $address = $address->hasData() ? $address : null; - - // Steps - $this->pageCustomerIndex->open(); - $this->pageCustomerIndex->getPageActionsBlock()->addNew(); - $this->pageCustomerIndexNew->getCustomerForm()->fillCustomer($customer, $address); - $this->pageCustomerIndexNew->getPageActionsBlock()->save(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/CreateCustomerFromBackendTest.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/CreateCustomerFromBackendTest.xml deleted file mode 100644 index d3d67598106..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/CreateCustomerFromBackendTest.xml +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - Main Website - General - John%isolation% - Doe%isolation% - JohnDoe%isolation%@example.com - - - 123123q - - - - - - - - - - - - - - - - - main:ce - - - - - - Main Website - General - John%isolation% - Doe%isolation% - JohnDoe%isolation%@example.com - - - 123123q - Joe - Doe - 1 Main Street - Culver City - United States - California - 90230 - 3109450345 - - - - - - Main Website - Retailer - John%isolation% - Doe%isolation% - JohnDoe%isolation%@example.ccc - - - 123123q - - - - - - - - - - - - - - - - - - - - Main Website - General - Thomas%isolation% - Oster%isolation% - Thomas%isolation%@example.com - 5250008057 - 123123q - Thomas - Oster - Chmielna 113 - Bielsko-Biala - Poland - - - 43-310 - 799885616 - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/CreateCustomerGroupEntityTest.php b/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/CreateCustomerGroupEntityTest.php deleted file mode 100644 index 54ddc39b192..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/CreateCustomerGroupEntityTest.php +++ /dev/null @@ -1,79 +0,0 @@ - Customer Groups. - * 3. Start to create new Customer Group. - * 4. Fill in all data according to data set. - * 5. Click "Save Customer Group" button. - * 6. Perform all assertions. - * - * @group Customer_Groups_(CS) - * @ZephyrId MPERF-7420 - */ -class CreateCustomerGroupEntityTest extends Injectable -{ - /** - * Customer group index page. - * - * @var CustomerGroupIndex - */ - protected $customerGroupIndex; - - /** - * New customer group page. - * - * @var CustomerGroupNew - */ - protected $customerGroupNew; - - /** - * Inject data. - * - * @param CustomerGroupIndex $customerGroupIndex - * @param CustomerGroupNew $customerGroupNew - */ - public function __inject( - CustomerGroupIndex $customerGroupIndex, - CustomerGroupNew $customerGroupNew - ) { - $this->customerGroupIndex = $customerGroupIndex; - $this->customerGroupNew = $customerGroupNew; - } - - /** - * Create customer group. - * - * @param CustomerGroup $customerGroup - * @return void - */ - public function test(CustomerGroup $customerGroup) - { - // Steps - $this->customerGroupIndex->open(); - $this->customerGroupIndex->getGridPageActions()->addNew(); - $this->customerGroupNew->getCustomerGroupForm()->fill($customerGroup); - $this->customerGroupNew->getPageActionsBlock()->save(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/CreateCustomerGroupEntityTest.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/CreateCustomerGroupEntityTest.xml deleted file mode 100644 index bfa641eb00e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/CreateCustomerGroupEntityTest.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - Retail Customer - GroupName%isolation% - - - - - - Retail Customer - General - - - - customer_tax_class - GroupName%isolation% - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/CreateExistingCustomerFrontendEntity.php b/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/CreateExistingCustomerFrontendEntity.php deleted file mode 100644 index 1d5f3177e0b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/CreateExistingCustomerFrontendEntity.php +++ /dev/null @@ -1,118 +0,0 @@ - Register link. - * 3. Fill registry form. - * 4. Click "Register" button. - * 5. Perform assertions. - * - * @group Customer_Account_(CS) - * @ZephyrId MPERF-7554 - */ -class CreateExistingCustomerFrontendEntity extends Injectable -{ - /** - * Customer account create page. - * - * @var CustomerAccountCreate - */ - protected $customerAccountCreate; - - /** - * Customer account logout page. - * - * @var CustomerAccountLogout - */ - protected $customerAccountLogout; - - /** - * Cms index page. - * - * @var CmsIndex - */ - protected $cmsIndex; - - /** - * Prepare customer. - * - * @param FixtureFactory $fixtureFactory - * @return array - */ - public function __prepare(FixtureFactory $fixtureFactory) - { - $customer = $fixtureFactory->createByCode('customer', ['dataset' => 'default_frontend_new']); - $customer->persist(); - - return ['customer' => $customer]; - } - - /** - * Injection data - * - * @param CustomerAccountCreate $customerAccountCreate - * @param CustomerAccountLogout $customerAccountLogout - * @param CmsIndex $cmsIndex - * @return void - */ - public function __inject( - CustomerAccountCreate $customerAccountCreate, - CustomerAccountLogout $customerAccountLogout, - CmsIndex $cmsIndex - ) { - $this->customerAccountLogout = $customerAccountLogout; - $this->customerAccountCreate = $customerAccountCreate; - $this->cmsIndex = $cmsIndex; - } - - /** - * Run create existing customer account on frontend test. - * - * @param Customer $customer - * @return void - */ - public function test(Customer $customer) - { - //Steps - $this->cmsIndex->open(); - $this->cmsIndex->getTopLinksBlock()->openAccount(); - $this->cmsIndex->getLinksBlock()->openLink('Register'); - $this->customerAccountCreate->getRegisterForm()->registerCustomer($customer); - } - - /** - * Logout customer from frontend account. - * - * @return void - */ - public function tearDown() - { - $this->customerAccountLogout->open(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/CreateExistingCustomerFrontendEntity.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/CreateExistingCustomerFrontendEntity.xml deleted file mode 100644 index 48058198e70..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/CreateExistingCustomerFrontendEntity.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - main:ce - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/DeleteCustomerAddressEntityTest.php b/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/DeleteCustomerAddressEntityTest.php deleted file mode 100644 index 762a294b8ed..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/DeleteCustomerAddressEntityTest.php +++ /dev/null @@ -1,87 +0,0 @@ - Additional Address Entries. - * 3. Click 'Delete Address' button for second address. - * 4. Perform assertions. - * - * @group Customer_Account_(CS) - * @ZephyrId MPERF-7496 - */ -class DeleteCustomerAddressEntityTest extends Injectable -{ - /** - * CustomerAccountIndex page. - * - * @var CustomerAccountIndex - */ - protected $customerAccountIndex; - - /** - * Customer address page. - * - * @var CustomerAddress - */ - protected $customerAddress; - - /** - * Injection pages. - * - * @param CustomerAccountIndex $customerAccountIndex - * @param CustomerAddress $customerAddress - * @return void - */ - public function __inject(CustomerAccountIndex $customerAccountIndex, CustomerAddress $customerAddress) - { - $this->customerAccountIndex = $customerAccountIndex; - $this->customerAddress = $customerAddress; - } - - /** - * Run delete customer address entity test. - * - * @param Customer $customer - * @return array - */ - public function test(Customer $customer) - { - // Preconditions: - $customer->persist(); - $addressToDelete = $customer->getDataFieldConfig('address')['source']->getAddresses()[0]; - - // Steps: - $this->objectManager->create( - 'Mage\Customer\Test\TestStep\LoginCustomerOnFrontendStep', - ['customer' => $customer] - )->run(); - $this->customerAccountIndex->getAccountNavigationBlock()->openNavigationItem('Address Book'); - $this->customerAddress->getBookBlock()->getAdditionalAddressBlock()->deleteAddress($addressToDelete); - - return ['deletedAddress' => $addressToDelete]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/DeleteCustomerAddressEntityTest.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/DeleteCustomerAddressEntityTest.xml deleted file mode 100644 index f0d76b524a4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/DeleteCustomerAddressEntityTest.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - customer_with_two_addresses - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/RegisterCustomerFrontendEntityTest.php b/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/RegisterCustomerFrontendEntityTest.php deleted file mode 100644 index 668766f8e9a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/RegisterCustomerFrontendEntityTest.php +++ /dev/null @@ -1,100 +0,0 @@ -customerAccountCreate = $customerAccountCreate; - $this->cmsIndex = $cmsIndex; - $this->customerAccountLogout = $customerAccountLogout; - } - - /** - * Create Customer account on frontend. - * - * @param Customer $customer - * @return void - */ - public function test(Customer $customer) - { - //Steps - $this->cmsIndex->open(); - $this->cmsIndex->getTopLinksBlock()->openAccount(); - $this->cmsIndex->getLinksBlock()->openLink('Register'); - $this->customerAccountCreate->getRegisterForm()->registerCustomer($customer); - } - - /** - * Logout customer from frontend account. - * - * @return void - */ - public function tearDown() - { - $this->customerAccountLogout->open(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/RegisterCustomerFrontendEntityTest.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/RegisterCustomerFrontendEntityTest.xml deleted file mode 100644 index dee7ed5bb43..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/RegisterCustomerFrontendEntityTest.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - john - doe - johndoe%isolation%@example.com - No - 123123q - 123123q - main:ce - - - - - john - doe - johndoe%isolation%@example.com - Yes - 123123q - 123123q - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/TestStep/CreateCustomerStep.php b/dev/tests/functional/tests/app/Mage/Customer/Test/TestStep/CreateCustomerStep.php deleted file mode 100644 index e28861d884f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/TestStep/CreateCustomerStep.php +++ /dev/null @@ -1,64 +0,0 @@ -customer = $customer; - $this->persistCustomer = $customerPersist; - } - - /** - * Create customer. - * - * @return array - */ - public function run() - { - if ($this->persistCustomer == 'yes') { - $this->customer->persist(); - } - - return ['customer' => $this->customer]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/TestStep/CreateNewAddressesFixturesStep.php b/dev/tests/functional/tests/app/Mage/Customer/Test/TestStep/CreateNewAddressesFixturesStep.php deleted file mode 100644 index b2f1c393836..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/TestStep/CreateNewAddressesFixturesStep.php +++ /dev/null @@ -1,70 +0,0 @@ -newAddresses = $newAddresses; - $this->fixtureFactory = $fixtureFactory; - } - - /** - * Create addresses. - * - * @return array - */ - public function run() - { - if ($this->newAddresses === null) { - return []; - } - $newAddressesFixtures = []; - $datasets = explode(',', $this->newAddresses); - foreach ($datasets as $dataset) { - $newAddressesFixtures[] = $this->fixtureFactory->createByCode('address', ['dataset' => $dataset]); - } - - return ['newAddresses' => $newAddressesFixtures]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/TestStep/CreateOrderFromCustomerAccountStep.php b/dev/tests/functional/tests/app/Mage/Customer/Test/TestStep/CreateOrderFromCustomerAccountStep.php deleted file mode 100644 index 415d853d8b8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/TestStep/CreateOrderFromCustomerAccountStep.php +++ /dev/null @@ -1,51 +0,0 @@ -customerIndexEdit = $customerIndexEdit; - } - - /** - * Create new order from customer. - * - * @return void - */ - public function run() - { - $this->customerIndexEdit->getPageActionsBlock()->createOrder(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/TestStep/LoginCustomerOnFrontendStep.php b/dev/tests/functional/tests/app/Mage/Customer/Test/TestStep/LoginCustomerOnFrontendStep.php deleted file mode 100644 index 4fdd025cd39..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/TestStep/LoginCustomerOnFrontendStep.php +++ /dev/null @@ -1,82 +0,0 @@ -cmsIndex = $cmsIndex; - $this->customerAccountLogin = $customerAccountLogin; - $this->customer = $customer; - } - - /** - * Login customer. - * - * @return void - */ - public function run() - { - $this->cmsIndex->open(); - $this->cmsIndex->getTopLinksBlock()->openAccount(); - if ($this->cmsIndex->getLinksBlock()->isLinkVisible("Log Out")) { - $this->cmsIndex->getLinksBlock()->openLink("Log Out"); - $this->cmsIndex->getCmsPageBlock()->waitUntilTextIsVisible('Home Page'); - $this->cmsIndex->getTopLinksBlock()->openAccount(); - } - $this->cmsIndex->getLinksBlock()->openLink("Log In"); - $this->customerAccountLogin->getLoginBlock()->login($this->customer); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/TestStep/LogoutCustomerStep.php b/dev/tests/functional/tests/app/Mage/Customer/Test/TestStep/LogoutCustomerStep.php deleted file mode 100644 index 82027216eba..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/TestStep/LogoutCustomerStep.php +++ /dev/null @@ -1,51 +0,0 @@ -customerAccountLogout = $customerAccountLogout; - } - - /** - * Logout customer. - * - * @return void - */ - public function run() - { - $this->customerAccountLogout->open(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/TestStep/OpenCustomerOnBackendStep.php b/dev/tests/functional/tests/app/Mage/Customer/Test/TestStep/OpenCustomerOnBackendStep.php deleted file mode 100644 index 94feca12086..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/TestStep/OpenCustomerOnBackendStep.php +++ /dev/null @@ -1,62 +0,0 @@ -customer = $customer; - $this->customerIndex = $customerIndex; - } - - /** - * Open customer account. - * - * @return void - */ - public function run() - { - $this->customerIndex->open(); - $this->customerIndex->getCustomerGridBlock()->searchAndOpen(['email' => $this->customer->getEmail()]); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/etc/curl/di.xml deleted file mode 100644 index 5c15c9992df..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/etc/curl/di.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/etc/fixture.xml deleted file mode 100644 index 724dc29132f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/etc/fixture.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - - eav - customer - Mage\Customer\Model\Resource\Customer\Collection - email - -
        - address - virtual - Mage\Customer\Test\Fixture\Customer\Address - addresses -
        - - is_subscribed - virtual - - - password - virtual - account_information - - - password_confirmation - virtual - - - id - virtual - - - current_password - virtual - -
        -
        -
        - eav - customer_address - Mage\Customer\Model\Resource\Address\Collection - - - email - virtual - - -
        - - flat - customer_group - Mage\Customer\Model\Resource\Group\Collection - - - customer_group_id - virtual - - - -
        diff --git a/dev/tests/functional/tests/app/Mage/Directory/Test/Block/Currency/Switcher.php b/dev/tests/functional/tests/app/Mage/Directory/Test/Block/Currency/Switcher.php deleted file mode 100644 index 241e0d78894..00000000000 --- a/dev/tests/functional/tests/app/Mage/Directory/Test/Block/Currency/Switcher.php +++ /dev/null @@ -1,57 +0,0 @@ -waitForElementVisible($this->currencySwitch); - $customCurrencySwitch = explode(" - ", $this->_rootElement->find($this->currencySwitchSelected)->getText()); - $currencyCode = $currencySymbol->getCode(); - if ($customCurrencySwitch[1] !== $currencyCode) { - $this->_rootElement->find($this->currencySwitch, Locator::SELECTOR_CSS, 'select') - ->setValue($currencyCode); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable.php b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable.php deleted file mode 100644 index ed01657ea38..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable.php +++ /dev/null @@ -1,101 +0,0 @@ -_rootElement; - return $this->blockFactory->create( - 'Mage\Downloadable\Test\Block\Adminhtml\Catalog\Product\Edit\Tab\Downloadable\\' . $type, - ['element' => $element->find($this->downloadableBlock)] - ); - } - - /** - * Get data to fields on downloadable tab. - * - * @param array|null $fields - * @param Element|null $element - * @return array - */ - public function getDataFormTab($fields = null, Element $element = null) - { - $resultFields = []; - if (isset($fields['downloadable_sample']['value'])) { - $resultFields['downloadable_sample'] = $this->getDownloadableBlock('Samples')->getDataSamples( - $fields['downloadable_sample']['value'] - ); - } - if (isset($fields['downloadable_links']['value'])) { - $resultFields['downloadable_links'] = $this->getDownloadableBlock('Links')->getDataLinks( - $fields['downloadable_links']['value'] - ); - } - - return $resultFields; - } - - /** - * Fill downloadable information. - * - * @param array $fields - * @param Element|null $element - * @return $this - */ - public function fillFormTab(array $fields, Element $element = null) - { - if (isset($fields['downloadable_sample']['value'])) { - $this->getDownloadableBlock('Samples')->fillSamples($fields['downloadable_sample']['value']); - } - - if (isset($fields['downloadable_links']['value'])) { - $this->getDownloadableBlock('Links')->fillLinks($fields['downloadable_links']['value']); - } - - return $this; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/LinkRow.php b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/LinkRow.php deleted file mode 100644 index 42d295bf90f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/LinkRow.php +++ /dev/null @@ -1,65 +0,0 @@ -dataMapping($fields); - $this->_fill($mapping); - } - - /** - * Get data item link. - * - * @param array $fields - * @return array - */ - public function getDataLinkRow(array $fields) - { - $mapping = $this->dataMapping($fields); - return $this->_getData($mapping); - } - - /** - * Click delete button. - * - * @return void - */ - public function clickDeleteButton() - { - $this->_rootElement->find($this->deleteButton)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/LinkRow.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/LinkRow.xml deleted file mode 100644 index 7d8180b85bc..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/LinkRow.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - <selector>[name$='[title]']</selector> - <strategy>css selector</strategy> - - - [name$='[price]'] - css selector - - - [name$='[number_of_downloads]'] - css selector - - - [name$='[is_unlimited]'] - css selector - checkbox - - - [name$='[is_shareable]'] - css selector - select - - - - [value='url'][name$='[sample][type]'] - css selector - checkbox - - - [value='file'][name$='[sample][type]'] - css selector - checkbox - - - [name$='[sample][url]'] - css selector - - - - [value='url'][name*='[type]']:not([name*='[sample]']) - css selector - checkbox - - - [value='file'][name*='[type]']:not([name*='[sample]']) - css selector - checkbox - - - [name$='[link_url]'] - css selector - - - [name$='[sort_order]'] - css selector - - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php deleted file mode 100644 index 6d39b82b0c7..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php +++ /dev/null @@ -1,137 +0,0 @@ -_rootElement; - return $this->blockFactory->create( - 'Mage\Downloadable\Test\Block\Adminhtml\Catalog\Product\Edit\Tab\Downloadable\LinkRow', - ['element' => $element->find(sprintf($this->rowBlock, ++$index), Locator::SELECTOR_XPATH)] - ); - } - - /** - * Fill links block. - * - * @param array $fields - * @param Element|null $element - * @return void - */ - public function fillLinks(array $fields, Element $element = null) - { - $element = $element ?: $this->_rootElement; - if (!$element->find($this->title)->isVisible()) { - $element->find($this->showLinks)->click(); - } - $mapping = $this->dataMapping( - ['title' => $fields['title'], 'links_purchased_separately' => $fields['links_purchased_separately']] - ); - $this->_fill($mapping); - foreach ($fields['downloadable']['link'] as $index => $link) { - $rowBlock = $this->getRowBlock($index, $element); - if (!$rowBlock->isVisible()) { - $element->find($this->addNewLinkRow)->click(); - } - $rowBlock->fillLinkRow($link); - } - } - - /** - * Get data links block. - * - * @param array|null $fields - * @param Element|null $element - * @return array - */ - public function getDataLinks(array $fields = null, Element $element = null) - { - $element = $element ?: $this->_rootElement; - if (!$element->find($this->title)->isVisible()) { - $element->find($this->showLinks)->click(); - } - $mapping = $this->dataMapping( - ['title' => $fields['title'], 'links_purchased_separately' => $fields['links_purchased_separately']] - ); - $newFields = $this->_getData($mapping); - foreach ($fields['downloadable']['link'] as $index => $link) { - $newFields['downloadable']['link'][$index] = $this->getRowBlock($index, $element) - ->getDataLinkRow($link); - } - return $newFields; - } - - /** - * Delete all links and clear title. - * - * @return void - */ - public function clearDownloadableData() - { - $this->_rootElement->find($this->title)->setValue(''); - $index = 1; - while ($this->_rootElement->find(sprintf($this->rowBlock, $index), Locator::SELECTOR_XPATH)->isVisible()) { - $rowBlock = $this->getRowBlock($index - 1); - $rowBlock->clickDeleteButton(); - ++$index; - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.xml deleted file mode 100644 index 6c3db271f6d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - <selector>[name="product[links_title]"]</selector> - <strategy>css selector</strategy> - - - [name="product[links_purchased_separately]"] - css selector - select - - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/SampleRow.php b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/SampleRow.php deleted file mode 100644 index 90d116e64e6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/SampleRow.php +++ /dev/null @@ -1,48 +0,0 @@ -dataMapping($fields); - $this->_fill($mapping); - } - - /** - * Get data item sample. - * - * @param array $fields - * @return array - */ - public function getDataSampleRow(array $fields) - { - $mapping = $this->dataMapping($fields); - return $this->_getData($mapping); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/SampleRow.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/SampleRow.xml deleted file mode 100644 index af6504b0f73..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/SampleRow.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - <selector>[name$='[title]']</selector> - <strategy>css selector</strategy> - - - [value='file'][name$='[type]'] - css selector - checkbox - - - [value='url'][name$='[type]'] - css selector - checkbox - - - [name$='[sample_url]'] - css selector - - - [name$='[sort_order]'] - css selector - - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Samples.php b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Samples.php deleted file mode 100644 index 69ae960b55b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Samples.php +++ /dev/null @@ -1,114 +0,0 @@ -_rootElement; - return $this->blockFactory->create( - 'Mage\Downloadable\Test\Block\Adminhtml\Catalog\Product\Edit\Tab\Downloadable\SampleRow', - ['element' => $element->find(sprintf($this->rowBlock, ++$index), Locator::SELECTOR_XPATH)] - ); - } - - /** - * Fill samples block. - * - * @param array|null $fields - * @param Element|null $element - * @return void - */ - public function fillSamples(array $fields = null, Element $element = null) - { - $element = $element ?: $this->_rootElement; - if (!$element->find($this->samplesTitle, Locator::SELECTOR_XPATH)->isVisible()) { - $element->find($this->showSample)->click(); - } - $mapping = $this->dataMapping(['title' => $fields['title']]); - $this->_fill($mapping); - foreach ($fields['downloadable']['sample'] as $index => $sample) { - $element->find($this->addNewSampleRow)->click(); - $this->getRowBlock($index, $element)->fillSampleRow($sample); - } - } - - /** - * Get data samples block. - * - * @param array|null $fields - * @param Element|null $element - * @return array - */ - public function getDataSamples(array $fields = null, Element $element = null) - { - $element = $element ?: $this->_rootElement; - if (!$element->find($this->samplesTitle, Locator::SELECTOR_XPATH)->isVisible()) { - $element->find($this->showSample)->click(); - } - $mapping = $this->dataMapping(['title' => $fields['title']]); - $result = $this->_getData($mapping); - foreach ($fields['downloadable']['sample'] as $index => $sample) { - $result['downloadable']['sample'][$index] = $this->getRowBlock($index, $element) - ->getDataSampleRow($sample); - } - return $result; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Samples.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Samples.xml deleted file mode 100644 index f168e08f0fc..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Samples.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - <selector>[name="product[samples_title]"]</selector> - <strategy>css selector</strategy> - - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/ProductForm.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/ProductForm.xml deleted file mode 100644 index 5c1a1e3ecb5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/ProductForm.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - \Mage\Downloadable\Test\Block\Adminhtml\Catalog\Product\Edit\Tab\Downloadable - #product_info_tabs_downloadable_items - css selector - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Catalog/Product/View.php b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Catalog/Product/View.php deleted file mode 100644 index f60e7cb5948..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Catalog/Product/View.php +++ /dev/null @@ -1,135 +0,0 @@ -blockFactory->create( - 'Mage\Downloadable\Test\Block\Catalog\Product\View\Links', - ['element' => $this->_rootElement->find($this->blockDownloadableLinks)] - ); - } - - /** - * Get downloadable samples block. - * - * @return Samples - */ - public function getDownloadableSamplesBlock() - { - return $this->blockFactory->create( - 'Mage\Downloadable\Test\Block\Catalog\Product\View\Samples', - ['element' => $this->_rootElement->find($this->blockDownloadableSamples)] - ); - } - - /** - * Filling the options specified for the product. - * - * @param InjectableFixture $product - * @return void - * - * @SuppressWarnings(PHPMD.NPathComplexity) - */ - public function fillOptions(InjectableFixture $product) - { - /** @var DownloadableProduct $product */ - $downloadableLinks = isset($product->getDownloadableLinks()['downloadable']['link']) - ? $product->getDownloadableLinks()['downloadable']['link'] - : []; - $checkoutData = $product->getCheckoutData(); - - if (isset($checkoutData['options'])) { - foreach ($checkoutData['options']['links'] as $key => $linkData) { - $linkKey = str_replace('link_', '', $linkData['label']); - $linkData['label'] = $downloadableLinks[$linkKey]['title']; - $checkoutData['options']['links'][$key] = $linkData; - } - $this->getDownloadableLinksBlock()->fill($checkoutData['options']['links']); - } - - parent::fillOptions($product); - } - - /** - * Return product options. - * - * @param InjectableFixture $product - * @return array - */ - public function getOptions(InjectableFixture $product) - { - $downloadableOptions = []; - - if ($this->_rootElement->find($this->blockDownloadableLinks)->isVisible()) { - $downloadableOptions['downloadable_links'] = [ - 'title' => $this->getDownloadableLinksBlock()->getTitle(), - 'downloadable' => [ - 'link' => $this->getDownloadableLinksBlock()->getLinks(), - ], - ]; - } - if ($this->_rootElement->find($this->blockDownloadableSamples)->isVisible()) { - $downloadableOptions['downloadable_sample'] = [ - 'title' => $this->getDownloadableSamplesBlock()->getTitle(), - 'downloadable' => [ - 'sample' => $this->getDownloadableSamplesBlock()->getLinks(), - ], - ]; - } - - return ['downloadable_options' => $downloadableOptions] + parent::getOptions($product); - } - - /** - * Get text of Stock Availability control. - * - * @return string - */ - public function getDownloadableStockAvailability() - { - return strtolower($this->_rootElement->find($this->stockAvailability)->getText()); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Catalog/Product/View/Links.php b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Catalog/Product/View/Links.php deleted file mode 100644 index efed0b44cdc..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Catalog/Product/View/Links.php +++ /dev/null @@ -1,152 +0,0 @@ -label:first-child'; - - /** - * Checkbox selector item links. - * - * @var string - */ - protected $sampleLinkForChoice = 'li span>a'; - - /** - * Checkbox selector item links. - * - * @var string - */ - protected $priceForChoice = '.price-notice'; - - /** - * Checkbox selector item links. - * - * @var string - */ - protected $priceAdjustmentsForChoice = '.price-adjustments .price'; - - /** - * Get title for links block. - * - * @return string - */ - public function getTitle() - { - return $this->_rootElement->find($this->title, Locator::SELECTOR_XPATH)->getText(); - } - - /** - * Fill links on product view page. - * - * @param array $data - * @return void - */ - public function fill(array $data) - { - foreach ($data as $linkData) { - $selector = sprintf($this->linkByLabel, $linkData['label']); - $this->_rootElement->find($selector, Locator::SELECTOR_XPATH, 'checkbox')->setValue($linkData['value']); - } - } - - /** - * Return links data on product page view. - * - * @return array - */ - public function getLinks() - { - $linksData = []; - - $choiceLinks = $this->_rootElement->getElements($this->choiceLink, Locator::SELECTOR_XPATH); - foreach ($choiceLinks as $choiceLink) { - $link = $choiceLink->find($this->linkForChoice); - $sample = $choiceLink->find($this->sampleLinkForChoice); - $price = $choiceLink->find($this->priceForChoice); - $priceAdjustments = $choiceLink->find($this->priceAdjustmentsForChoice); - - $linkData = [ - 'links_purchased_separately' => $choiceLink->find($this->separatelyForChoice)->isVisible() - ? 'Yes' - : 'No', - 'title' => $link->isVisible() ? $link->getText() : null, - 'sample' => $sample->isVisible() ? $sample->getText() : null, - 'price' => $price->isVisible() ? $this->escapePrice($price->getText()) : null, - 'price_adjustments' => $priceAdjustments->isVisible() - ? $this->escapePrice($priceAdjustments->getText()) - : null, - ]; - - $linksData[] = array_filter($linkData); - } - - return $linksData; - } - - /** - * Escape currency for price. - * - * @param string $price - * @return string - */ - protected function escapePrice($price) - { - return preg_replace('/[^0-9\.,]/', '', $price); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Catalog/Product/View/Samples.php b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Catalog/Product/View/Samples.php deleted file mode 100644 index ec5a8117c23..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Catalog/Product/View/Samples.php +++ /dev/null @@ -1,67 +0,0 @@ -_rootElement->find($this->titleBlock)->getText(); - } - - /** - * Get sample links. - * - * @return array - */ - public function getLinks() - { - $links = $this->_rootElement->getElements($this->linkTitle); - $linksData = []; - - foreach ($links as $link) { - $linksData[] = [ - 'title' => $link->getText(), - ]; - } - - return $linksData; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Checkout/Onepage/Review.php b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Checkout/Onepage/Review.php deleted file mode 100644 index 07c7fb4b9b3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Checkout/Onepage/Review.php +++ /dev/null @@ -1,31 +0,0 @@ - [ - 'selector' => '//*[contains(@data-rwd-label,"Price")][1]//span[@class="price"]', - 'strategy' => Locator::SELECTOR_XPATH - ], - 'cart_item_price_incl_tax' => [ - 'selector' => '//*[contains(@data-rwd-label,"Price")][2]//span[@class="price"]', - 'strategy' => Locator::SELECTOR_XPATH - ], - 'cart_item_subtotal_excl_tax' => [ - 'selector' => '//*[contains(@data-rwd-label,"Subtotal")][1]//span[@class="price"]', - 'strategy' => Locator::SELECTOR_XPATH - ], - 'cart_item_subtotal_incl_tax' => [ - 'selector' => '//*[contains(@data-rwd-label,"Subtotal")][2]//span[@class="price"]', - 'strategy' => Locator::SELECTOR_XPATH - ] - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Constraint/AssertDownloadableLinksData.php b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Constraint/AssertDownloadableLinksData.php deleted file mode 100644 index 03adf340aa3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Constraint/AssertDownloadableLinksData.php +++ /dev/null @@ -1,122 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - - $fixtureDownloadableLinks = $this->prepareFixtureData($product); - $pageOptions = $catalogProductView->getViewBlock()->getOptions($product); - $pageDownloadableLinks = $this->preparePageData($pageOptions['downloadable_options']['downloadable_links']); - $error = $this->verifyData($fixtureDownloadableLinks, $pageDownloadableLinks); - \PHPUnit_Framework_Assert::assertEmpty($error, $error); - } - - /** - * Prepare fixture data for verify. - * - * @param DownloadableProduct $product - * @return array - */ - protected function prepareFixtureData(DownloadableProduct $product) - { - $data = $this->sortDataByPath($product->getDownloadableLinks(), 'downloadable/link::sort_order'); - - foreach ($data['downloadable']['link'] as $key => $link) { - $link['links_purchased_separately'] = $data['links_purchased_separately']; - $link = array_intersect_key($link, array_flip($this->linkField)); - - $data['downloadable']['link'][$key] = $link; - } - $data = array_intersect_key($data, array_flip($this->downloadableLinksField)); - - return $data; - } - - /** - * Prepare page data for verify. - * - * @param array $data - * @return array - */ - protected function preparePageData(array $data) - { - foreach ($data['downloadable']['link'] as $key => $link) { - $link = array_intersect_key($link, array_flip($this->linkField)); - $data['downloadable']['link'][$key] = $link; - } - $data = array_intersect_key($data, array_flip($this->downloadableLinksField)); - - return $data; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Links for downloadable product are present on product page'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Constraint/AssertDownloadableProductDetailsInWishlist.php b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Constraint/AssertDownloadableProductDetailsInWishlist.php deleted file mode 100644 index 8b096206fe2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Constraint/AssertDownloadableProductDetailsInWishlist.php +++ /dev/null @@ -1,44 +0,0 @@ - 'LINKS', - 'value' => $itemData['value'] - ]; - } - - return $this->sortDataByPath($result, '::title'); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Constraint/AssertDownloadableProductForm.php b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Constraint/AssertDownloadableProductForm.php deleted file mode 100644 index ccfb39f41c8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Constraint/AssertDownloadableProductForm.php +++ /dev/null @@ -1,34 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - - $fixtureSampleLinks = $this->prepareFixtureData($product); - $pageOptions = $productView->getViewBlock()->getOptions($product); - $pageSampleLinks = isset($pageOptions['downloadable_options']['downloadable_sample']) - ? $this->preparePageData($pageOptions['downloadable_options']['downloadable_sample']) - : []; - $error = $this->verifyData($fixtureSampleLinks, $pageSampleLinks); - \PHPUnit_Framework_Assert::assertEmpty($error, $error); - } - - /** - * Prepare fixture data for verify. - * - * @param DownloadableProduct $product - * @return array - */ - protected function prepareFixtureData(DownloadableProduct $product) - { - $data = $this->sortDataByPath($product->getDownloadableSample(), 'downloadable/sample::sort_order'); - - foreach ($data['downloadable']['sample'] as $key => $link) { - $link = array_intersect_key($link, array_flip($this->linkField)); - $data['downloadable']['sample'][$key] = $link; - } - $data = array_intersect_key($data, array_flip($this->downloadableSampleField)); - - return $data; - } - - /** - * Prepare page data for verify. - * - * @param array $data - * @return array - */ - protected function preparePageData(array $data) - { - foreach ($data['downloadable']['sample'] as $key => $link) { - $link = array_intersect_key($link, array_flip($this->linkField)); - $data['downloadable']['sample'][$key] = $link; - } - $data = array_intersect_key($data, array_flip($this->downloadableSampleField)); - - return $data; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Sample links for downloadable product are present on product page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Constraint/AssertOrderTaxOnBackendDownloadableExcludingIncludingTax.php b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Constraint/AssertOrderTaxOnBackendDownloadableExcludingIncludingTax.php deleted file mode 100644 index 5f648d3cbcd..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Constraint/AssertOrderTaxOnBackendDownloadableExcludingIncludingTax.php +++ /dev/null @@ -1,38 +0,0 @@ -getCheckoutData(); - $downloadableOptions = $product->getDownloadableLinks(); - foreach ($checkoutData['options']['links'] as $link) { - $keyLink = str_replace('link_', '', $link['label']); - $checkoutDownloadableOptions[] = [ - 'title' => $downloadableOptions['title'], - 'value' => $downloadableOptions['downloadable']['link'][$keyLink]['title'], - ]; - } - $this->data['options'] += $checkoutDownloadableOptions; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Fixture/DownloadableProduct.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Fixture/DownloadableProduct.xml deleted file mode 100644 index 6d2b43ad0dd..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Fixture/DownloadableProduct.xml +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - downloadable - - downloadable - 4 - - product - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Handler/Curl.php b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Handler/Curl.php deleted file mode 100644 index 23dc17fd073..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Handler/Curl.php +++ /dev/null @@ -1,256 +0,0 @@ - [ - 'links_title', - 'links_purchased_separately' - ], - 'samples' => [ - 'samples_title' - ] - ]; - - /** - * Fields for link. - * - * @var array - */ - protected $linkFields = [ - 'title', - 'type', - 'link_url' => 'file_link_url', - 'price', - 'number_of_downloads', - 'is_shareable', - 'sort_order', - 'sample' => [ - 'type', - 'url' => 'sample_url' - ] - ]; - - /** - * Fields for sample. - * - * @var array - */ - protected $sampleFields = [ - 'title', - 'type', - 'sample_url', - 'sort_order' - ]; - - /** - * @constructor - * @param DataInterface $configuration - * @param EventManagerInterface $eventManager - */ - public function __construct(DataInterface $configuration, EventManagerInterface $eventManager) - { - parent::__construct($configuration, $eventManager); - - $this->mappingData += [ - 'links_purchased_separately' => [ - 'Yes' => 1, - 'No' => 0, - ], - 'is_shareable' => [ - 'Yes' => 1, - 'No' => 0, - 'Use config' => 2, - ], - ]; - } - - /** - * Prepare POST data for creating product request. - * - * @param FixtureInterface $fixture - * @param string|null $prefix [optional] - * @return array - */ - protected function prepareData(FixtureInterface $fixture, $prefix = null) - { - $originalData = parent::prepareData($fixture, $prefix); - $downloadableData = []; - $data = ($prefix == null) ? $originalData : $originalData[$prefix]; - - foreach ($this->downloadableTypes as $type => $fields) { - if (!empty($data['downloadable_' . $type])) { - $downloadableTypeData = $this->{'prepare' . ucfirst($type) . 'Data'}($data['downloadable_' . $type]); - $data = array_merge_recursive($data, array_intersect_key($downloadableTypeData, array_flip($fields))); - $downloadableData = array_merge_recursive($downloadableData, $downloadableTypeData); - unset($downloadableTypeData['downloadable']); - if ($prefix == null) { - $originalData = array_merge($originalData, $downloadableTypeData); - } else { - $originalData[$prefix] = array_merge($originalData[$prefix], $downloadableTypeData); - } - } - } - - $data = array_merge_recursive($originalData, $downloadableData); - - return $this->replaceMappingData($data); - } - - /** - * Prepare links data. - * - * @param array $linksData - * @return array - */ - protected function prepareLinksData(array $linksData) - { - return [ - 'links_title' => $linksData['title'], - 'links_purchased_separately' => $linksData['links_purchased_separately'], - 'downloadable' => [ - 'link' => $this->prepareLinksItemsData($linksData['downloadable']['link']) - ] - ]; - } - - /** - * Prepare samples data. - * - * @param array $samplesData - * @return array - */ - protected function prepareSamplesData(array $samplesData) - { - return [ - 'samples_title' => $samplesData['title'], - 'downloadable' => [ - 'sample' => $this->prepareSamplesItemsData($samplesData['downloadable']['sample']) - ] - ]; - } - - /** - * Prepare samples items data. - * - * @param array $samples - * @return array - */ - protected function prepareSamplesItemsData(array $samples) - { - $resultSamples = []; - foreach ($samples as $key => $sample) { - $resultLinks[$key] = $this->prepareItem($sample, 'sample'); - } - - return $resultSamples; - } - - /** - * Prepare links items data. - * - * @param array $links - * @return array - */ - protected function prepareLinksItemsData(array $links) - { - $resultLinks = []; - foreach ($links as $key => $link) { - $resultLinks[$key] = $this->prepareItem($link, 'link'); - } - - return $resultLinks; - } - - /** - * Prepare item data. - * - * @param array $link - * @param string $type - * @param string|null $key - * @return array - */ - protected function prepareItem(array $link, $type, $key = null) - { - $result = []; - $fields = ($key == null) ? $this->{$type . 'Fields'} : $this->{$type . 'Fields'}[$key]; - foreach ($fields as $key => $value) { - if ($key === 'type' || $value === 'type') { - $result['type'] = 'url'; - } else { - if (is_string($key)) { - if (is_array($value)) { - $result[$key] = $this->prepareItem($link[$key], $type, $key); - } else { - $result[$key] = $link[$value]; - } - } else { - $result[$value] = $link[$value]; - } - } - } - - return $result; - } - - /** - * Create product via curl - * - * @param array $data - * @param array $config - * @return array - * @throws \Exception - */ - protected function createProduct(array $data, array $config) - { - $url = $this->getUrl($config); - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->addOption(CURLOPT_HEADER, 1); - $curl->write($url, $data); - $response = $curl->read(); - $curl->close(); - if (!strpos($response, 'class="success-msg"')) { - throw new \Exception("Product creation by curl handler was not successful! Response: $response"); - } - $id = $this->parseResponse($response); - $checkoutData = isset($data['product']['checkout_data']) ? $data['product']['checkout_data'] : null; - foreach ($data['downloadable']['link'] as $key => $link) { - preg_match('`"link_id":"(\d*?)","title":"' . $link['title'] . '"`', $response, $linkId); - if (isset($checkoutData['options']['links'][$key]['label'])) { - $checkoutData['options']['links'][$key]['id'] = $linkId[1]; - } - } - - return ['id' => $id['id'], 'checkout_data' => $checkoutData]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Handler/DownloadableProductInterface.php b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Handler/DownloadableProductInterface.php deleted file mode 100644 index b6490d40c18..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Handler/DownloadableProductInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Page/Product/CatalogProductView.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Page/Product/CatalogProductView.xml deleted file mode 100644 index e36067e5683..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Page/Product/CatalogProductView.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Repository/DownloadableProduct.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Repository/DownloadableProduct.xml deleted file mode 100644 index 8933e94b25f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Repository/DownloadableProduct.xml +++ /dev/null @@ -1,217 +0,0 @@ - - - - - - DownloadableProduct_%isolation% - DownloadableProduct_%isolation% - Catalog, Search - Enabled - downloadable-product-%isolation% - - 100.00 - - - Taxable Goods - - This is description for downloadable product. - This is short description for downloadable product. - - 1.0000 - In Stock - - Yes - - default - - - default - - - default_subcategory - - - - main_website - - - - - - Downloadable product %isolation% - downloadable_product_%isolation% - Catalog, Search - Enabled - downloadable-product-%isolation% - - 20 - - - Taxable Goods - - This is description for downloadable product with two separately - links - - This is short description for downloadable product with - two separately links - - - 111 - In Stock - - Yes - - with_two_separately_links - - - default - - - with_two_separately_links - - - - main_website - - - - - - Downloadable product %isolation% - downloadable_product_%isolation% - downloadable-product-%isolation% - - 30 - - 20 - - Taxable Goods - - - 1111 - In Stock - - This is description for downloadable product with special - price - - This is short description for downloadable product with - special price - - Enabled - - default_subcategory - - Catalog, Search - Yes - - - main_website - - - - with_two_separately_links - - - with_two_bought_links - - - - - Downloadable product %isolation% - downloadable_product_%isolation% - downloadable-product-%isolation% - - 30 - - - downloadable_with_tax - - - Taxable Goods - - - 1111 - In Stock - - This is description for downloadable product with group price - - This is short description for downloadable product with - group price - - Enabled - - default_subcategory - - Catalog, Search - Yes - - - main_website - - - - with_two_separately_links - - - with_two_bought_links - - - - - Downloadable product %isolation% - downloadable_product_%isolation% - downloadable-product-%isolation% - - 20 - - - Taxable Goods - - - 1111 - In Stock - - This is description for downloadable product with custom - options - - This is short description for downloadable product with - custom options - - Enabled - - default_subcategory - - Catalog, Search - Yes - - - main_website - - - - with_two_separately_links - - - drop_down_with_one_option_percent_price - - - one_custom_option_and_downloadable_link - - - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Repository/DownloadableProduct/CheckoutData.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Repository/DownloadableProduct/CheckoutData.xml deleted file mode 100644 index e9b698c072f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Repository/DownloadableProduct/CheckoutData.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - link_0 - Yes - - - - - 22.43 - 22.43 - - 1 - - - - - - - link_0 - Yes - - - link_1 - Yes - - - - 23 - 23 - - - 1 - - - - - - - attribute_key_0 - option_key_0 - - - - - link_0 - Yes - - - - 1 - - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Repository/DownloadableProduct/GroupPriceOptions.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Repository/DownloadableProduct/GroupPriceOptions.xml deleted file mode 100644 index 7b5737d406d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Repository/DownloadableProduct/GroupPriceOptions.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - 90 - NOT LOGGED IN - - - - - - 20 - General - - - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Repository/DownloadableProduct/Links.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Repository/DownloadableProduct/Links.xml deleted file mode 100644 index fab6e1b6385..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Repository/DownloadableProduct/Links.xml +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - Links%isolation% - Yes - - - - link1%isolation% - 2.43 - 2 - - Yes - http://example.com - - Yes - http://example.com - No - 1 - - - link2%isolation% - 3 - 3 - - Yes - http://example.net - - Yes - http://example.net - Yes - 0 - - - - - - - Links%isolation% - Yes - - - - link1%isolation% - 2.43 - 2 - No - - Yes - http://example.com/sample - - Yes - http://example.com - 0 - - - link2%isolation% - 3 - 3 - Yes - - Yes - http://example.net/sample2 - - Yes - http://example.net/ - 1 - - - - - - - Links%isolation% - Yes - - - - link1%isolation% - 2.43 - 2 - - Yes - http://example.com - - Yes - http://example.com - No - 0 - - - link2%isolation% - 3 - 3 - - Yes - http://example.net - - Yes - http://example.net - Yes - 1 - - - link3%isolation% - 5.43 - 5 - - Yes - http://example.net - - Yes - http://example.net - Yes - 2 - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Repository/DownloadableProduct/Price.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Repository/DownloadableProduct/Price.xml deleted file mode 100644 index 86bfa7c2fc2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Repository/DownloadableProduct/Price.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - 94 - - - 91 - - - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Repository/DownloadableProduct/Samples.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Repository/DownloadableProduct/Samples.xml deleted file mode 100644 index 6f0e600518e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Repository/DownloadableProduct/Samples.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - Samples%isolation% - - - - sample1%isolation% - Yes - http://example.com - 0 - - - sample2%isolation% - Yes - http://example2.com - 1 - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/AddProductToWishlistEntityTest.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/AddProductToWishlistEntityTest.xml deleted file mode 100644 index 6eaaf19c366..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/AddProductToWishlistEntityTest.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - Add Downloadable product to Wishlist - downloadableProduct::with_two_separately_links - false - main:ce - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.xml deleted file mode 100644 index c9fe247f30e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - downloadableProduct::with_two_separately_links - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.xml deleted file mode 100644 index 11e4380100c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - downloadableProduct::with_two_separately_links - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest.php b/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest.php deleted file mode 100644 index f5da619e422..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest.php +++ /dev/null @@ -1,93 +0,0 @@ - Manage Products. - * 3. Start to create new Downloadable product. - * 4. Fill in data according to data set. - * 5. Save product. - * 6. Perform all assertions. - * - * @group Downloadable_Product_(CS) - * @ZephyrId MPERF-6884 - */ -class CreateDownloadableProductEntityTest extends Injectable -{ - /** - * Product page with a grid. - * - * @var CatalogProduct - */ - protected $catalogProductIndex; - - /** - * New product page on backend. - * - * @var CatalogProductNew - */ - protected $catalogProductNew; - - /** - * Persist category. - * - * @param CatalogCategory $category - * @return array - */ - public function __prepare(CatalogCategory $category) - { - $category->persist(); - - return ['category' => $category]; - } - - /** - * Filling objects of the class. - * - * @param CatalogProduct $catalogProductIndexNewPage - * @param CatalogProductNew $catalogProductNewPage - * @return void - */ - public function __inject(CatalogProduct $catalogProductIndexNewPage, CatalogProductNew $catalogProductNewPage) - { - $this->catalogProductIndex = $catalogProductIndexNewPage; - $this->catalogProductNew = $catalogProductNewPage; - } - - /** - * Test create downloadable product. - * - * @param DownloadableProduct $product - * @param CatalogCategory $category - * @return void - */ - public function test(DownloadableProduct $product, CatalogCategory $category) - { - // Steps - $this->catalogProductIndex->open(); - $this->catalogProductIndex->getGridPageActionBlock()->addNew(); - $this->catalogProductNew->getProductForm()->fill($product, null, $category); - $this->catalogProductNew->getFormPageActions()->save(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest.xml deleted file mode 100644 index 9ca1419914a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest.xml +++ /dev/null @@ -1,370 +0,0 @@ - - - - - - Create downloadable product with downloadable samples - DownloadableProduct_%isolation% - downloadable-product-%isolation% - Catalog, Search - DownloadableProduct_%isolation% - Taxable Goods - 1 - - - - - Enabled - This is description for downloadable product - This is short description for downloadable product - 10 - In Stock - Yes - - - - - default - default - - - - - - - - - - - - - - - Create downloadable product with two downloadable links, downloadable samples and custom options - DownloadableProduct_%isolation% - downloadable-product-%isolation% - Catalog, Search - DownloadableProduct_%isolation% - Taxable Goods - 65 - - - - - Enabled - This is description for downloadable product - This is short description for downloadable product - 11 - In Stock - Yes - - - - - default - with_two_separately_links - default - - - - - - - - - - - - - - Create downloadable product with downloadable links without tax class - DownloadableProduct_%isolation% - downloadable-product-%isolation% - Catalog, Search - DownloadableProduct_%isolation% - None - 98 - - - - - Enabled - This is description for downloadable product - This is short description for downloadable product - 5 - In Stock - Yes - - - - - - - default - - - - - - - - - - - - - Create downloadable product with custom options - DownloadableProduct_%isolation% - downloadable-product-%isolation% - Catalog, Search - DownloadableProduct_%isolation% - Taxable Goods - 33 - - - - - Enabled - This is description for downloadable product - This is short description for downloadable product - 10 - In Stock - Yes - - - - - - - default - default - - - - - - - - - - - - - Create downloadable product with downloadable links and tax class - DownloadableProduct_%isolation% - downloadable-product-%isolation% - Catalog, Search - DownloadableProduct_%isolation% - Taxable Goods - 100 - - - - - Enabled - This is description for downloadable product - This is short description for downloadable product - 1 - In Stock - Yes - - - - - - - default - - - - - - - - - - - - - - - Create downloadable product with stock data min qty - DownloadableProduct_%isolation% - downloadable-product-%isolation% - Catalog, Search - DownloadableProduct_%isolation% - Taxable Goods - 9999 - - - - - Enabled - This is description for downloadable product - This is short description for downloadable product - - - - - Yes - No - 123 - - - default - - - - - - - - - - - - - Create downloadable product with downloadable links - DownloadableProduct_%isolation% - downloadable-product-%isolation% - Catalog, Search - DownloadableProduct_%isolation% - Taxable Goods - 100 - - - - - Enabled - This is description for downloadable product - This is short description for downloadable product - 50 - In Stock - Yes - - - - - - - default - - - - - - - - - - - - - Create downloadable product with three downloadable links, downloadable samples and custom options - DownloadableProduct_%isolation% - downloadable-product-%isolation% - Catalog, Search - DownloadableProduct_%isolation% - Taxable Goods - 65 - - - - - Enabled - This is description for downloadable product - This is short description for downloadable product - 11 - In Stock - Yes - - - - - default - with_three_links - default - - - - - - - - - - - - - Create downloadable product out of stock - DownloadableProduct_%isolation% - downloadable-product-%isolation% - Catalog, Search - DownloadableProduct_%isolation% - Taxable Goods - 100 - - - - - Enabled - This is description for downloadable product - This is short description for downloadable product - 50 - Out of Stock - Yes - - - - - - - default - - - - - - - - - - - - - Create downloadable product with special price - DownloadableProduct_%isolation% - downloadable-product-%isolation% - Catalog, Search - DownloadableProduct_%isolation% - Taxable Goods - 10 - - - 5 - Enabled - This is description for downloadable product - This is short description for downloadable product - 10 - In Stock - Yes - - - - - - - default - - - - - - - - - - - - - - Create downloadable product with group price - DownloadableProduct_%isolation% - downloadable-product-%isolation% - Catalog, Search - DownloadableProduct_%isolation% - Taxable Goods - 365 - - - - - Enabled - This is description for downloadable product - This is short description for downloadable product - 23 - In Stock - Yes - - - - - - - default - - - for_not_logged_users - - - - - - - - - - Create downloadable product with tier price - DownloadableProduct_%isolation% - downloadable-product-%isolation% - Catalog, Search - DownloadableProduct_%isolation% - Taxable Goods - 250 - with_tier_price - - - Enabled - This is description for downloadable product - This is short description for downloadable product - 65 - In Stock - Yes - - - - - - - default - - - - - for_all_groups - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/DeleteDownloadableProductEntityTest.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/DeleteDownloadableProductEntityTest.xml deleted file mode 100644 index 4b115a79aef..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/DeleteDownloadableProductEntityTest.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - downloadableProduct::with_two_separately_links - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.xml deleted file mode 100644 index 39ee30ad48c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - downloadableProduct::with_two_separately_links - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/TaxCalculationForDownloadableProductTest.php b/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/TaxCalculationForDownloadableProductTest.php deleted file mode 100644 index 95f51fa272a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/TaxCalculationForDownloadableProductTest.php +++ /dev/null @@ -1,41 +0,0 @@ - Taxes > Tax Rules. - * 3. Click 'Add New Tax Rule' button. - * 4. Assign default rates to rule. - * 5. Save Tax Rate. - * 6. Go to Products > Catalog. - * 7. Add new downloadable product. - * 8. Fill data according to dataset. - * 9. Save product. - * 10. Go to Stores > Configuration. - * 11. Fill Tax configuration according to data set. - * 12. Save tax configuration. - * 13. Perform all assertions. - * - * @group Tax_(CS) - * @ZephyrId MPERF-7057 - */ -class TaxCalculationForDownloadableProductTest extends TaxCalculationTest -{ - // -} diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/TaxCalculationForDownloadableProductTest.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/TaxCalculationForDownloadableProductTest.xml deleted file mode 100644 index b396794ff6a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/TaxCalculationForDownloadableProductTest.xml +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - Downloadable product with sales rule, customer tax equals store tax and catalog price excluding tax - shipping_tax_class_taxable_goods, total_cat_excl_ship_incl_after_disc_on_incl, display_excluding_including_tax - downloadableProduct::with_two_separately_links_special_price_and_category - active_sales_rule_for_all_groups_no_coupon - - - customer_equals_store_rate - johndoe_unique - 20.00 - 21.65 - 25.43 - 27.53 - 25.43 - 27.53 - 25.43 - 27.53 - 25.43 - 27.53 - 13.77 - 0.96 - 11.66 - 12.62 - checkmo - - - - - - Downloadable product with catalog rule, customer tax greater than store tax and catalog price excluding tax - shipping_tax_class_taxable_goods, total_cat_excl_ship_incl_after_disc_on_incl, display_including_tax - downloadableProduct::with_two_separately_links_special_price_and_category - - - default - customer_greater_store_rate - johndoe_unique - 2.13 - 25.43 - 27.56 - 21.68 - 27.56 - 27.56 - 27.56 - 27.56 - checkmo - - - - - - Downloadable product with sales rule, customer tax less than store tax and catalog price excluding tax - shipping_tax_class_taxable_goods, total_cat_excl_ship_incl_after_disc_on_incl - downloadableProduct::with_two_separately_links_group_price_and_category - active_sales_rule_for_all_groups_no_coupon - - - customer_less_store_rate - johndoe_unique - 13.77 - 0.96 - 20.00 - 25.43 - 25.43 - 25.43 - 25.43 - 12.62 - checkmo - - - - - - Downloadable product with catalog rule, customer tax greater than store tax and catalog price including tax - shipping_tax_class_taxable_goods, total_cat_incl_ship_excl_before_disc_on_excl, display_excluding_including_tax - downloadableProduct::with_two_separately_links_custom_options_and_category - - - default - customer_greater_store_rate - johndoe_unique - 18.47 - 20.02 - 28.11 - 30.47 - 28.12 - 30.47 - 28.12 - 30.47 - 28.12 - 30.47 - 2.35 - 28.12 - 30.47 - checkmo - - - - - - Downloadable product with sales rule, customer tax less than store tax and catalog price including tax - shipping_tax_class_taxable_goods, total_cat_incl_ship_excl_before_disc_on_excl, display_including_tax - downloadableProduct::with_two_separately_links_group_price_and_category - active_sales_rule_for_all_groups_no_coupon - - - customer_less_store_rate - johndoe_unique - 11.73 - 1.94 - 11.73 - 13.67 - 19.98 - 25.40 - 25.40 - 25.40 - 25.40 - checkmo - - - - - - Downloadable product with catalog rule, customer tax equals store tax and catalog price including tax - shipping_tax_class_taxable_goods, total_cat_incl_ship_excl_before_disc_on_excl - downloadableProduct::with_two_separately_links_custom_options_and_category - - - default - customer_equals_store_rate - johndoe_unique - 2.32 - 30.43 - 18.48 - 28.11 - 28.11 - 28.11 - 28.11 - checkmo - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/etc/curl/di.xml deleted file mode 100644 index 607a3f3c40c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/etc/curl/di.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/etc/fixture.xml deleted file mode 100644 index 5c3e5d4fb58..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/etc/fixture.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - eav - catalog_product - downloadable - Mage\Catalog\Model\Resource\Product\Collection - sku - - - custom_options - virtual - Mage\Catalog\Test\Fixture\CatalogProductSimple\CustomOptions - custom-options - - - id - virtual - - - website_ids - virtual - Main Website - websites - Mage\Catalog\Test\Fixture\CatalogProductSimple\WebsiteIds - - - downloadable_items - virtual - downloadable_information - Mage\Downloadable\Test\Fixture\DownloadableProduct\Links - - - downloadable_sample - virtual - downloadable_information - Mage\Downloadable\Test\Fixture\DownloadableProduct\Samples - - - checkout_data - virtual - Mage\Downloadable\Test\Repository\DownloadableProduct\CheckoutData - - - stock_data - virtual - inventory - - - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/etc/testcase.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/etc/testcase.xml deleted file mode 100644 index 78639514896..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/etc/testcase.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Block/Message/Inline.php b/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Block/Message/Inline.php deleted file mode 100644 index e5a6e702880..00000000000 --- a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Block/Message/Inline.php +++ /dev/null @@ -1,187 +0,0 @@ -waitForElementVisible($this->giftOptionsForm); - $this->addGiftMessage($giftMessage); - - if ($giftMessage->getAllowGiftMessagesForOrder() === 'Yes') { - $this->fillGiftMessageForOrder($giftMessage); - } - - if ($giftMessage->getAllowGiftOptionsForItems() === 'Yes') { - $this->fillGiftGiftOptionsForItems($giftMessage, $products); - } - } - - /** - * @param $giftMessage - * @throws \Exception - */ - protected function addGiftMessage($giftMessage) - { - $giftMessageData = $giftMessage->getData(); - unset( - $giftMessageData['sender'], - $giftMessageData['recipient'], - $giftMessageData['message'], - $giftMessageData['items'] - ); - $mapping = $this->dataMapping($giftMessageData); - $this->_fill($mapping); - } - - /** - * Fill gift gift options for items. - * - * @param GiftMessage $giftMessage - * @param array $products - * @return void - */ - protected function fillGiftGiftOptionsForItems(GiftMessage $giftMessage, array $products) - { - $giftMessageItems = $giftMessage->getItems(); - foreach ($giftMessageItems as $key => $itemGiftMessage) { - $this->clickGiftMassageItem($products[$key]); - $this->getGiftMessageItemForm($products[$key])->fill($itemGiftMessage); - } - } - - /** - * Fill gift message for order. - * - * @param GiftMessage $giftMessage - * @return void - */ - protected function fillGiftMessageForOrder(GiftMessage $giftMessage) - { - if ($this->_rootElement->find($this->giftMessageOrderButton)->isVisible()) { - $this->_rootElement->find($this->giftMessageOrderButton)->click(); - } else { - $this->_rootElement->find($this->allowGiftMessagesForItems)->click(); - } - $messageData = $giftMessage->getData(); - unset($messageData['allow_gift_options'], $messageData['allow_gift_messages_for_order']); - $mapping = $this->getGiftMessageOrderForm()->dataMapping($messageData); - $this->getGiftMessageOrderForm()->_fill($mapping); - } - - /** - * Click gift message item block. - * - * @param InjectableFixture $product - * @return void - */ - protected function clickGiftMassageItem(InjectableFixture $product) - { - $giftMessageItemSelector = sprintf($this->giftMessageItemButton, $product->getName()); - if ($this->_rootElement->find($giftMessageItemSelector, Locator::SELECTOR_XPATH)->isVisible()) { - $this->_rootElement->find($giftMessageItemSelector, Locator::SELECTOR_XPATH)->click(); - } - } - - /** - * Get gift message order form. - * - * @return GiftMessageForm - */ - protected function getGiftMessageOrderForm() - { - return $this->blockFactory->create( - 'Mage\GiftMessage\Test\Block\Message\Inline\GiftMessageForm', - ['element' => $this->_rootElement->find($this->giftMessageOrderForm)] - ); - } - - /** - * Get gift message item form. - * - * @param InjectableFixture $product - * @return GiftMessageForm - */ - protected function getGiftMessageItemForm(InjectableFixture $product) - { - $selector = sprintf($this->giftMessageItemForm, $product->getName()); - $this->waitForElementVisible($selector, Locator::SELECTOR_XPATH); - - return $this->blockFactory->create( - 'Mage\GiftMessage\Test\Block\Message\Inline\GiftMessageForm', - ['element' => $this->_rootElement->find($selector, Locator::SELECTOR_XPATH)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Block/Message/Inline.xml b/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Block/Message/Inline.xml deleted file mode 100644 index 08190788e7e..00000000000 --- a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Block/Message/Inline.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - .//*/input[@id = 'allow_gift_messages']|.//*/input[@id= 'allow_gift_options'] - xpath - checkbox - - - .//*/input[@id = 'allow_gift_messages_for_order']|.//*/input[@id= 'allow_gift_options_for_order'] - xpath - checkbox - - - .//*/input[@id = 'allow_gift_messages_for_items']|.//*/input[@id= 'allow_gift_options_for_items'] - xpath - checkbox - - - diff --git a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Block/Message/Inline/GiftMessageForm.php b/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Block/Message/Inline/GiftMessageForm.php deleted file mode 100644 index 4ba929c3548..00000000000 --- a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Block/Message/Inline/GiftMessageForm.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - [id^='gift-message'][name$='[from]'] - - - [id^='gift-message'][name$='[to]'] - - - [id^='gift-message'][name$='[message]'] - - - diff --git a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Block/Message/Order/Items/View.php b/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Block/Message/Order/Items/View.php deleted file mode 100644 index e5e6a545185..00000000000 --- a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Block/Message/Order/Items/View.php +++ /dev/null @@ -1,77 +0,0 @@ -getGiftMessageElement($giftItem); - return $this->getGiftMessage($giftMessageElement); - } - - /** - * Get gift message element. - * - * @param InjectableFixture $giftItem - * @return Element - */ - protected function getGiftMessageElement(InjectableFixture $giftItem) - { - $itemName = $giftItem->getName(); - $this->showGiftMessageElement($itemName); - - return $this->_rootElement->find(sprintf($this->giftMessageForItem, $itemName), Locator::SELECTOR_XPATH); - } - - /** - * Click "Gift Message" for special item. - * - * @param string $itemName - * @return void - */ - protected function showGiftMessageElement($itemName) - { - $this->_rootElement->find(sprintf($this->giftMessageButton, $itemName), Locator::SELECTOR_XPATH)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Block/Message/Order/View.php b/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Block/Message/Order/View.php deleted file mode 100644 index 82de2536915..00000000000 --- a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Block/Message/Order/View.php +++ /dev/null @@ -1,55 +0,0 @@ - './/dt[1]', - 'recipient' => './/dt[2]', - 'message' => './/dd' - ]; - - /** - * Get gift message. - * - * @param SimpleElement|null $giftMessageElement - * @return array - */ - public function getGiftMessage(SimpleElement $giftMessageElement = null) - { - $message = []; - $element = ($giftMessageElement !== null) ? $giftMessageElement : $this->_rootElement; - foreach ($this->giftMessageFields as $key => $field) { - $value = $element->find($field, Locator::SELECTOR_XPATH)->getText(); - $value = preg_match('`\w+: (.*)`', $value, $matches) ? $matches[1] : $value; - $message[$key] = $value; - } - - return $message; - } -} diff --git a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Constraint/AbstractAssertGiftMessageOnFrontend.php b/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Constraint/AbstractAssertGiftMessageOnFrontend.php deleted file mode 100644 index afed93a1e2a..00000000000 --- a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Constraint/AbstractAssertGiftMessageOnFrontend.php +++ /dev/null @@ -1,68 +0,0 @@ -open(); - $orderHistory->getOrderHistoryBlock()->openOrderById($orderId); - } - - /** - * Prepare expected data. - * - * @param GiftMessage $giftMessage - * @return array - */ - protected function prepareExpectedData(GiftMessage $giftMessage) - { - return [ - 'sender' => $giftMessage->getSender(), - 'recipient' => $giftMessage->getRecipient(), - 'message' => $giftMessage->getMessage(), - ]; - } - - /** - * Login customer on frontend. - * - * @param Customer $customer - * @return void - */ - protected function loginOnFrontend(Customer $customer) - { - $this->objectManager->create( - 'Mage\Customer\Test\TestStep\LoginCustomerOnFrontendStep', - ['customer' => $customer] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrder.php b/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrder.php deleted file mode 100644 index 00627c98411..00000000000 --- a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrder.php +++ /dev/null @@ -1,72 +0,0 @@ -loginOnFrontend($customer); - $this->openOrderPage($orderHistory, $orderId); - $expectedData = $this->prepareExpectedData($giftMessage); - - \PHPUnit_Framework_Assert::assertEquals( - $expectedData, - $orderView->getGiftMessageForOrderBlock()->getGiftMessage() - ); - $customerAccountLogout->open(); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return "Gift message is displayed on order view page on frontend correctly."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrderItems.php b/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrderItems.php deleted file mode 100644 index f67d6f4e064..00000000000 --- a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrderItems.php +++ /dev/null @@ -1,111 +0,0 @@ -loginOnFrontend($customer); - $this->openOrderPage($orderHistory, $orderId); - $expectedData = $this->prepareExpectedData($giftMessage); - $actualData = $this->prepareActualData($orderView, $products); - - \PHPUnit_Framework_Assert::assertEquals($expectedData, $actualData); - - $customerAccountLogout->open(); - } - - /** - * Prepare actual data. - * - * @param OrderView $orderView - * @param array $products - * @return array - */ - protected function prepareActualData(OrderView $orderView, array $products) - { - $result = []; - foreach ($products as $key => $product) { - $result[$key] = $orderView->getGiftMessageForItemBlock()->getItemGiftMessage($product); - } - - return $result; - } - - /** - * Prepare expected data. - * - * @param GiftMessage $giftMessage - * @return array - */ - protected function prepareExpectedData(GiftMessage $giftMessage) - { - $result = []; - if ($giftMessage->hasData('items')) { - $giftMessageItems = $giftMessage->getItems(); - foreach ($giftMessageItems as $key => $itemGiftMessage) { - $result[$key] = parent::prepareExpectedData($itemGiftMessage); - } - } else { - $result = parent::prepareExpectedData($giftMessage); - } - - return $result; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return "Gift message is displayed for each items on order view page on frontend correctly."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Fixture/GiftMessage.xml b/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Fixture/GiftMessage.xml deleted file mode 100644 index fda9014a43c..00000000000 --- a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Fixture/GiftMessage.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Fixture/GiftMessage/Items.php b/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Fixture/GiftMessage/Items.php deleted file mode 100644 index 7edc7c79a29..00000000000 --- a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Fixture/GiftMessage/Items.php +++ /dev/null @@ -1,44 +0,0 @@ -params = $params; - if (isset($data['datasets'])) { - $datasets = explode(',', $data['datasets']); - foreach ($datasets as $dataset) { - $this->data[] = $fixtureFactory->createByCode('giftMessage', ['dataset' => trim($dataset)]); - } - } else { - $this->data = $data; - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Page/CheckoutOnepage.xml b/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Page/CheckoutOnepage.xml deleted file mode 100644 index 577ed2c8990..00000000000 --- a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Page/CheckoutOnepage.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Page/OrderView.xml b/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Page/OrderView.xml deleted file mode 100644 index 7ab48add37e..00000000000 --- a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Page/OrderView.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Repository/GiftMessage.xml b/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Repository/GiftMessage.xml deleted file mode 100644 index b18aa05aa31..00000000000 --- a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Repository/GiftMessage.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - John Doe - Jane Doe - text_%isolation% - - - diff --git a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.php b/dev/tests/functional/tests/app/Mage/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.php deleted file mode 100644 index 7b66f6a886a..00000000000 --- a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.php +++ /dev/null @@ -1,59 +0,0 @@ -executeScenario(); - } - - /** - * Disable enabled config after test. - * - * @return void - */ - public function tearDown() - { - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => $this->currentVariation['arguments']['configData'], 'rollback' => true] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.xml b/dev/tests/functional/tests/app/Mage/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.xml deleted file mode 100644 index 5a37515712e..00000000000 --- a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - cashondelivery, enableGiftMessages - Create gift message for items - catalogProductSimple::default, catalogProductSimple::default - default - customer_US_login - login - Flat Rate - Fixed - cashondelivery - Yes - Yes - default,default - - - - - diff --git a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/TestStep/AddGiftMessageStep.php b/dev/tests/functional/tests/app/Mage/GiftMessage/Test/TestStep/AddGiftMessageStep.php deleted file mode 100644 index 4409788fb36..00000000000 --- a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/TestStep/AddGiftMessageStep.php +++ /dev/null @@ -1,72 +0,0 @@ -checkoutOnepage = $checkoutOnepage; - $this->giftMessage = $giftMessage; - $this->products = $products; - } - - /** - * Add gift message to order. - * - * @return array - */ - public function run() - { - $this->checkoutOnepage->getGiftMessagesBlock()->fillGiftMessage($this->giftMessage, $this->products); - - return ['giftMessage' => $this->giftMessage]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Mage/GiftMessage/Test/etc/fixture.xml deleted file mode 100644 index 11fa94045f3..00000000000 --- a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/etc/fixture.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - flat - gift_message - Mage\GiftMessage\Model\Resource\Message\Collection - gift_message_id - - - allow_gift_options - virtual - - - allow_gift_messages_for_order - virtual - - - allow_gift_options_for_items - virtual - - - items - virtual - Mage\GiftMessage\Test\Fixture\GiftMessage\Items - - - - diff --git a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/etc/testcase.xml b/dev/tests/functional/tests/app/Mage/GiftMessage/Test/etc/testcase.xml deleted file mode 100644 index 343530e9e85..00000000000 --- a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/etc/testcase.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Block/Configuration.php b/dev/tests/functional/tests/app/Mage/Install/Test/Block/Configuration.php deleted file mode 100644 index 94c31e12a38..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/Block/Configuration.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - [name="config[db_model]"] - select - - - [name="connection[mysql4][db_host]"] - - - [name="connection[mysql4][db_name]"] - - - [name="connection[mysql4][db_user]"] - - - [name="connection[mysql4][db_pass]"] - - - [name="connection[mysql4][db_prefix]"] - - - [name="config[unsecure_base_url]"] - - - [name="config[admin_frontname]"] - - - [name="config[enable_charts]"] - checkbox - - - [name="skip_base_url_validation"] - checkbox - - - [name="config[use_rewrites]"] - checkbox - - - [name="config[use_secure]"] - checkbox - - - [name="config[secure_base_url]"] - - - [name="config[use_secure_admin]"] - checkbox - - - [name="skip_url_validation"] - checkbox - - - [name="config[session_save]"] - select - - - diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Block/ContinueBlock.php b/dev/tests/functional/tests/app/Mage/Install/Test/Block/ContinueBlock.php deleted file mode 100644 index 3db3fccd4c9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/Block/ContinueBlock.php +++ /dev/null @@ -1,41 +0,0 @@ -_rootElement->find($this->continue)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Block/License.php b/dev/tests/functional/tests/app/Mage/Install/Test/Block/License.php deleted file mode 100644 index b051afee4e0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/Block/License.php +++ /dev/null @@ -1,59 +0,0 @@ -_rootElement->find($this->license)->getText(); - } - - /** - * Accept license agreements. - * - * @return void - */ - public function acceptLicenseAgreement() - { - $this->_rootElement->find($this->agree, Locator::SELECTOR_CSS, 'checkbox')->setValue('Yes'); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Block/Localization.php b/dev/tests/functional/tests/app/Mage/Install/Test/Block/Localization.php deleted file mode 100644 index fe87c76cf96..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/Block/Localization.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - config - - - select - - - select - - - select - - - diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Block/Main.php b/dev/tests/functional/tests/app/Mage/Install/Test/Block/Main.php deleted file mode 100644 index 1f093c00a19..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/Block/Main.php +++ /dev/null @@ -1,58 +0,0 @@ -_rootElement->find($this->title)->getText(); - } - - /** - * Get license text. - * - * @return string - */ - public function getDeployStatus() - { - return $this->_rootElement->find($this->deployStatus)->getText(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Block/PersonalInformation.php b/dev/tests/functional/tests/app/Mage/Install/Test/Block/PersonalInformation.php deleted file mode 100644 index b902069ee10..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/Block/PersonalInformation.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - [name="admin[firstname]"] - - - [name="admin[lastname]"] - - - [name="admin[email]"] - - - [name="admin[username]"] - - - [name="admin[new_password]"] - - - [name="admin[password_confirmation]"] - - - [name="admin[password_confirmation]"] - - - [name="encryption_key"] - - - diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Block/Welcome.php b/dev/tests/functional/tests/app/Mage/Install/Test/Block/Welcome.php deleted file mode 100644 index a759303ef41..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/Block/Welcome.php +++ /dev/null @@ -1,42 +0,0 @@ -h3'; - - /** - * Get wizard text. - * - * @return string - */ - public function getWizardTitle() - { - return $this->_rootElement->find($this->wizardTitle)->getText(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertAgreementTextPresent.php b/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertAgreementTextPresent.php deleted file mode 100644 index 1b7b4b37551..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertAgreementTextPresent.php +++ /dev/null @@ -1,55 +0,0 @@ -getLicenseBlock()->getLicense(), - 'License agreement text is absent.' - ); - } - - /** - * Returns a string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return "License agreement text is present on Terms & Agreement page."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertCurrencySelected.php b/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertCurrencySelected.php deleted file mode 100644 index 395a18d7151..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertCurrencySelected.php +++ /dev/null @@ -1,51 +0,0 @@ -open(); - \PHPUnit_Framework_Assert::assertTrue( - str_contains($dashboard->getMainBlock()->getRevenuePrice(), $currencySymbol), - 'Selected currency symbol not displays on dashboard.' - ); - } - - /** - * Returns a string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return 'Selected language currently displays on frontend.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertLanguageSelected.php b/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertLanguageSelected.php deleted file mode 100644 index f6de5d75adf..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertLanguageSelected.php +++ /dev/null @@ -1,55 +0,0 @@ -open(); - \PHPUnit_Framework_Assert::assertEquals( - strtolower($cmsIndex->getTopLinksBlock()->getAccountLabelText()), - self::EXPECTED_TEXT - ); - } - - /** - * Returns a string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return 'Selected language currently displays on frontend.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertRewritesEnabled.php b/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertRewritesEnabled.php deleted file mode 100644 index 5c2250317d6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertRewritesEnabled.php +++ /dev/null @@ -1,55 +0,0 @@ -persist(); - $homePage->open(); - $homePage->getTopmenu()->selectCategory($category->getName()); - \PHPUnit_Framework_Assert::assertTrue( - !str_contains($browser->getUrl(), 'index.php'), - 'Apache redirect for category does not work.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Apache redirect works correct.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertSecureUrlEnabled.php b/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertSecureUrlEnabled.php deleted file mode 100644 index 220bda8bb96..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertSecureUrlEnabled.php +++ /dev/null @@ -1,52 +0,0 @@ -open(); - \PHPUnit_Framework_Assert::assertTrue( - str_contains($browser->getUrl(), 'https://'), - 'Secure Url is not displayed on backend.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Secure Urls are displayed successful.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertSuccessInstall.php b/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertSuccessInstall.php deleted file mode 100644 index 6d52d59042c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertSuccessInstall.php +++ /dev/null @@ -1,55 +0,0 @@ -getMainBlock()->getTitle()); - - // Check if header block on CmsIndex page is visible. - $cmsIndex->open(); - \PHPUnit_Framework_Assert::assertTrue($cmsIndex->getHeaderBlock()->isVisible()); - } - - /** - * Returns a string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return "Install successfully finished."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Fixture/Install.xml b/dev/tests/functional/tests/app/Mage/Install/Test/Fixture/Install.xml deleted file mode 100644 index cef615bda62..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/Fixture/Install.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Fixture/InstallLocale.xml b/dev/tests/functional/tests/app/Mage/Install/Test/Fixture/InstallLocale.xml deleted file mode 100644 index 81a5592a266..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/Fixture/InstallLocale.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Page/Install.xml b/dev/tests/functional/tests/app/Mage/Install/Test/Page/Install.xml deleted file mode 100644 index 7c1dba776d6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/Page/Install.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Page/InstallWizardAdministrator.xml b/dev/tests/functional/tests/app/Mage/Install/Test/Page/InstallWizardAdministrator.xml deleted file mode 100644 index f2caea26607..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/Page/InstallWizardAdministrator.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Page/InstallWizardConfig.xml b/dev/tests/functional/tests/app/Mage/Install/Test/Page/InstallWizardConfig.xml deleted file mode 100644 index 14832c15abe..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/Page/InstallWizardConfig.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Page/InstallWizardEnd.xml b/dev/tests/functional/tests/app/Mage/Install/Test/Page/InstallWizardEnd.xml deleted file mode 100644 index 32f117f3021..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/Page/InstallWizardEnd.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Page/InstallWizardLocale.xml b/dev/tests/functional/tests/app/Mage/Install/Test/Page/InstallWizardLocale.xml deleted file mode 100644 index a3b3daa52c3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/Page/InstallWizardLocale.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/InstallTest.php b/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/InstallTest.php deleted file mode 100644 index 9b8878c8297..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/InstallTest.php +++ /dev/null @@ -1,197 +0,0 @@ -fixtureFactory = $fixtureFactory; - $config = ObjectManagerFactory::getObjectManager()->get('Magento\Mtf\Config\DataInterface'); - // Prepare config data - $configData['db_host'] = $config->get('install/0/host/0/value'); - $configData['db_user'] = $config->get('install/0/user/0/value'); - $configData['db_pass'] = $config->get('install/0/password/0/value'); - $configData['db_name'] = $config->get('install/0/dbName/0/value'); - $configData['unsecure_base_url'] = $config->get('install/0/baseUrl/0/value'); - - return ['configData' => $configData]; - } - - /** - * Injection data. - * - * @param InstallPage $installPage - * @param InstallWizardLocale $installWizardLocale - * @param InstallWizardConfig $installWizardConfig - * @param InstallWizardAdministrator $installWizardAdministrator - * @return void - */ - public function __inject( - InstallPage $installPage, - InstallWizardLocale $installWizardLocale, - InstallWizardConfig $installWizardConfig, - InstallWizardAdministrator $installWizardAdministrator - ) { - $this->installPage = $installPage; - $this->installWizardLocale = $installWizardLocale; - $this->installWizardConfig = $installWizardConfig; - $this->installWizardAdministrator = $installWizardAdministrator; - } - - /** - * Install Magento via web interface. - * - * @param AssertAgreementTextPresent $assertLicense - * @param array $configData - * @param array $install [optional] - * @param array $installLocale [optional] - * @return array - */ - public function test( - AssertAgreementTextPresent $assertLicense, - array $configData, - array $install = [], - array $installLocale = [] - ) - { - // Preconditions: - $installConfig = $this->prepareInstallFixture($configData, $install); - if (isset($install['use_rewrites'])) { - $user = $this->fixtureFactory->createByCode('user', ['dataset' => 'admin_install_admin']); - } else { - $user = $this->fixtureFactory->createByCode('user', ['dataset' => 'admin_for_installation']); - } - // Steps: - $this->installPage->open(); - $this->installPage->getLicenseBlock()->acceptLicenseAgreement(); - // Verify license agreement. - $assertLicense->processAssert($this->installPage); - $this->installPage->getContinueBlock()->continueInstallation(); - if (!empty($installLocale)) { - $locale = $this->prepareInstallLocaleFixture($installLocale); - $this->installWizardLocale->getLocalizationForm()->fill($locale); - } - $this->installWizardLocale->getContinueBlock()->continueInstallation(); - $this->installWizardConfig->getConfigurationForm()->fill($installConfig); - $this->installWizardConfig->getContinueBlock()->continueInstallation(); - $this->installWizardAdministrator->getPersonalInformationForm()->fill($user); - $this->installWizardAdministrator->getContinueBlock()->continueInstallation(); - - return ['user' => $user]; - } - - /** - * Prepare install locale fixture for test. - * - * @param array $install - * @return Install - */ - protected function prepareInstallLocaleFixture(array $install) - { - return $this->fixtureFactory->createByCode('installLocale', ['data' => $install]); - } - - /** - * Prepare install fixture for test. - * - * @param array $configData - * @return Install - */ - protected function prepareInstallFixture(array $configData, array $install) - { - $dataConfig = array_merge($install, $configData); - $dataConfig['unsecure_base_url'] = str_replace('index.php/', '', $dataConfig['unsecure_base_url']); - $dataConfig['unsecure_base_url'] = isset($dataConfig['use_secure']) - ? str_replace('http', 'https', $dataConfig['unsecure_base_url']) - : $dataConfig['unsecure_base_url']; - return $this->fixtureFactory->createByCode('install', ['data' => $dataConfig]); - } - -} diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/InstallTest.xml b/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/InstallTest.xml deleted file mode 100644 index 81206bed1ae..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/InstallTest.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - Install with default values - You're All Set! - test_type:install_ce - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/InstallTest2.php b/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/InstallTest2.php deleted file mode 100644 index 530998877c7..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/InstallTest2.php +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - Install with custom admin path - custom - You're All Set! - test_type:install_ce - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/InstallTest3.php b/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/InstallTest3.php deleted file mode 100644 index 7a65035da5c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/InstallTest3.php +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - Install with custom encryption key and changed currency. - Euro - - You're All Set! - test_type:install_ce - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/InstallTest4.php b/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/InstallTest4.php deleted file mode 100644 index 29fd72f9e0d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/InstallTest4.php +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - Install with table prefix. - prefix1_ - You're All Set! - test_type:install_ce - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/InstallTest5.php b/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/InstallTest5.php deleted file mode 100644 index 4685bfa15d9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/InstallTest5.php +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - Install with apache url rewrites. - Yes - You're All Set! - test_type:install_ce - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/InstallTest6.php b/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/InstallTest6.php deleted file mode 100644 index 308d80c95c4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/InstallTest6.php +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - Install with enabled secure urls. - Yes - Yes - You're All Set! - test_type:install_ce - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Newsletter/Test/Constraint/AssertCustomerIsSubscribedToNewsletter.php b/dev/tests/functional/tests/app/Mage/Newsletter/Test/Constraint/AssertCustomerIsSubscribedToNewsletter.php deleted file mode 100644 index 5cd983d60ec..00000000000 --- a/dev/tests/functional/tests/app/Mage/Newsletter/Test/Constraint/AssertCustomerIsSubscribedToNewsletter.php +++ /dev/null @@ -1,66 +0,0 @@ - $customer->getEmail(), - 'firstname' => $customer->getFirstname(), - 'lastname' => $customer->getLastname(), - 'status' => 'Subscribed' - ]; - - $subscriberIndex->open(); - \PHPUnit_Framework_Assert::assertTrue( - $subscriberIndex->getSubscriberGrid()->isRowVisible($filter), - "Customer with email " . $customer->getEmail() . " is absent in Newsletter Subscribers grid." - ); - } - - /** - * Text of successful customer's subscription to newsletter. - * - * @return string - */ - public function toString() - { - return "Customer is subscribed to newsletter."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Newsletter/Test/Page/Adminhtml/SubscriberIndex.xml b/dev/tests/functional/tests/app/Mage/Newsletter/Test/Page/Adminhtml/SubscriberIndex.xml deleted file mode 100644 index e42c8d695de..00000000000 --- a/dev/tests/functional/tests/app/Mage/Newsletter/Test/Page/Adminhtml/SubscriberIndex.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Page/Test/Block/Html/Footer.php b/dev/tests/functional/tests/app/Mage/Page/Test/Block/Html/Footer.php deleted file mode 100644 index 7d0f244386c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Page/Test/Block/Html/Footer.php +++ /dev/null @@ -1,92 +0,0 @@ -_rootElement->find($this->storeGroupSwitch)->getText()); - $storeGroupName = explode('/', $store->getGroupId())[1]; - - return in_array($storeGroupName, $availableGroups); - } - - /** - * Check if store group switcher is visible. - * - * @return bool - */ - public function isStoreGroupSwitcherVisible() - { - return $this->_rootElement->find($this->storeGroupSwitch)->isVisible(); - } - - /** - * Select store group. - * - * @param Store $store - * @return void - */ - public function selectStoreGroup(Store $store) - { - $storeGroupName = explode("/", $store->getGroupId())[1]; - $this->_rootElement->find($this->storeGroupSwitch, Locator::SELECTOR_CSS, 'select')->setValue($storeGroupName); - } - - /** - * Click on link by name. - * - * @param string $linkName - * @return void - * @throws \Exception - */ - public function clickLink($linkName) - { - $link = $this->_rootElement->find(sprintf($this->linkSelector, $linkName), Locator::SELECTOR_XPATH); - if (!$link->isVisible()) { - throw new \Exception(sprintf('"%s" link is not visible', $linkName)); - } - $link->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Page/Test/Block/Html/Header.php b/dev/tests/functional/tests/app/Mage/Page/Test/Block/Html/Header.php deleted file mode 100644 index 990eb555235..00000000000 --- a/dev/tests/functional/tests/app/Mage/Page/Test/Block/Html/Header.php +++ /dev/null @@ -1,80 +0,0 @@ -_rootElement->find($this->storeSwitcher)->getText()); - - return in_array(strtoupper($store->getName()), $availableStores); - } - - /** - * Check if StoreView dropdown is visible. - * - * @return bool - */ - public function isStoreViewDropdownVisible() - { - return $this->_rootElement->find($this->storeSwitcher)->isVisible(); - } - - /** - * Select store. - * - * @param string $store - * @param SimpleElement|null $element - * @return void - */ - public function selectStore($store, SimpleElement $element = null) - { - $element = ($element === null) ? $this->_rootElement : $element; - $storeSwitcher = $element->find($this->storeSwitcher, Locator::SELECTOR_CSS, 'select'); - if ($storeSwitcher->isVisible()) { - $storeSwitcher->setValue($store); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Page/Test/Block/Html/Title.php b/dev/tests/functional/tests/app/Mage/Page/Test/Block/Html/Title.php deleted file mode 100644 index bc0751507e4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Page/Test/Block/Html/Title.php +++ /dev/null @@ -1,34 +0,0 @@ -_rootElement->getText(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Page/Test/Block/Html/Topmenu.php b/dev/tests/functional/tests/app/Mage/Page/Test/Block/Html/Topmenu.php deleted file mode 100644 index 83391fdd5d5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Page/Test/Block/Html/Topmenu.php +++ /dev/null @@ -1,54 +0,0 @@ -_rootElement->find(sprintf($this->category, $categoryName), Locator::SELECTOR_XPATH)->click(); - } - - /** - * Check is visible category in top menu by name. - * - * @param string $categoryName - * @return bool - */ - public function isCategoryVisible($categoryName) - { - return $this->_rootElement->find(sprintf($this->category, $categoryName), Locator::SELECTOR_XPATH)->isVisible(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Payment/Test/Block/Form/Cc.php b/dev/tests/functional/tests/app/Mage/Payment/Test/Block/Form/Cc.php deleted file mode 100644 index ccea21aa703..00000000000 --- a/dev/tests/functional/tests/app/Mage/Payment/Test/Block/Form/Cc.php +++ /dev/null @@ -1,24 +0,0 @@ - - - - payment - - - select - - - - select - - - select - - - - diff --git a/dev/tests/functional/tests/app/Mage/Payment/Test/Constraint/Assert3DSecureVerificationFailed.php b/dev/tests/functional/tests/app/Mage/Payment/Test/Constraint/Assert3DSecureVerificationFailed.php deleted file mode 100644 index 16cee6c7208..00000000000 --- a/dev/tests/functional/tests/app/Mage/Payment/Test/Constraint/Assert3DSecureVerificationFailed.php +++ /dev/null @@ -1,58 +0,0 @@ -getReviewBlock()->getVerificationResponseText() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return '3D secure verification failed.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Payment/Test/Fixture/Cc.xml b/dev/tests/functional/tests/app/Mage/Payment/Test/Fixture/Cc.xml deleted file mode 100644 index dc1f384fee5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Payment/Test/Fixture/Cc.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Payment/Test/Fixture/ValidationPassword.xml b/dev/tests/functional/tests/app/Mage/Payment/Test/Fixture/ValidationPassword.xml deleted file mode 100644 index d901ca47fdb..00000000000 --- a/dev/tests/functional/tests/app/Mage/Payment/Test/Fixture/ValidationPassword.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Payment/Test/Repository/Cc.xml b/dev/tests/functional/tests/app/Mage/Payment/Test/Repository/Cc.xml deleted file mode 100644 index 26e100aef74..00000000000 --- a/dev/tests/functional/tests/app/Mage/Payment/Test/Repository/Cc.xml +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - Visa - %CC_VISA_1% - 01 - January - 2022 - 123 - - - Visa - %CC_VISA_2% - 01 - January - 2022 - 123 - - - Visa - %CC_VISA_3% - 01 - January - 2022 - 123 - - - Visa - %CC_VISA_3% - 01 - January - 2022 - - - Visa - %CC_VISA_4% - 01 - January - 2022 - 123 - - - Visa - %CC_VISA_4% - 01 - January - 2022 - 123 - - - Visa - %CC_VISA_4% - 01 - January - 2022 - - - Visa - %CC_VISA_1% - 01 - 2022 - 123 - - - Visa - %CC_VISA_2% - 01 - 2022 - 123 - - - Visa - %CC_VISA_2% - 01 - 2022 - 123 - - - diff --git a/dev/tests/functional/tests/app/Mage/Payment/Test/Repository/ConfigData.xml b/dev/tests/functional/tests/app/Mage/Payment/Test/Repository/ConfigData.xml deleted file mode 100644 index 18aea40600e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Payment/Test/Repository/ConfigData.xml +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - payment - 1 - Yes - 1 - - - - - payment - 1 - No - 0 - - - - - payment - 1 - Yes - 1 - - - - - payment - 1 - No - 0 - - - - - payment - 1 - Yes - 1 - - - - - payment - 1 - No - 0 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Specific Countries - 1 - - - payment - 1 - United Kingdom - GB - - - - - payment - 1 - No - 0 - - - - - payment_services - 1 - - - - - payment_services - 1 - - - - - payment_services - 1 - - - - - payment_services - 1 - Yes - 1 - - - payment_services - 1 - Yes - 1 - - - - diff --git a/dev/tests/functional/tests/app/Mage/Payment/Test/Repository/ValidationPassword.xml b/dev/tests/functional/tests/app/Mage/Payment/Test/Repository/ValidationPassword.xml deleted file mode 100644 index 67023d3eac0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Payment/Test/Repository/ValidationPassword.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - %VALIDATION_PASSWORD% - - - %VALIDATION_PASSWORD% - - - %VALIDATION_PASSWORD% - - - diff --git a/dev/tests/functional/tests/app/Mage/Payment/Test/TestStep/Fill3DSecureCreditCardValidationStep.php b/dev/tests/functional/tests/app/Mage/Payment/Test/TestStep/Fill3DSecureCreditCardValidationStep.php deleted file mode 100644 index 2a1d3b46ae8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Payment/Test/TestStep/Fill3DSecureCreditCardValidationStep.php +++ /dev/null @@ -1,64 +0,0 @@ -checkoutOnepage = $checkoutOnepage; - $this->validationPassword = $validationPassword; - } - - /** - * Fill 3D secure credit card validation. - * - * @return void - */ - public function run() - { - $centinelForm = $this->checkoutOnepage->getReviewBlock()->getCentinelForm(); - $centinelForm->fillPass($this->validationPassword); - $centinelForm->submitCode(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/AbstractReview.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/AbstractReview.php deleted file mode 100644 index 353b77fb1c8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/AbstractReview.php +++ /dev/null @@ -1,155 +0,0 @@ -_rootElement->find($this->continue)->click(); - } - - /** - * Log out from Pay Pal account. - * - * @return void - */ - public function logOut() - { - $this->waitLoader(); - $logoutButton = $this->_rootElement->find($this->logoutButton); - if ($logoutButton->isVisible()) { - $logoutButton->click(); - $this->waitLoader(); - } - } - - /** - * Check change shipping button. - * - * @return bool - */ - public function checkChangeShippingButton() - { - return $this->_rootElement->find($this->changeShipping)->isVisible(); - } - - /** - * Check for shipping notification. - * - * @return bool - */ - protected function checkShippingNotification() - { - return $this->_rootElement->find($this->shipNotification)->isVisible(); - } - - /** - * Click change shipping button. - * - * @return void - */ - public function clickChangeShippingButton() - { - $this->_rootElement->find($this->changeShipping)->click(); - } - - /** - * Wait loader. - * - * @return void - */ - public function waitLoader() - { - $this->waitForElementNotVisible($this->loader); - } - - /** - * Check change address ability. - * - * @return bool - */ - public function checkChangeAddressAbility() - { - $this->waitLoader(); - if ($this->checkChangeShippingButton()) { - $this->clickChangeShippingButton(); - $this->waitLoader(); - return !$this->checkShippingNotification(); - } else { - return false; - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Addresses.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Addresses.php deleted file mode 100644 index 53556ca14aa..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Addresses.php +++ /dev/null @@ -1,51 +0,0 @@ -hasData($criteria)) { - $addressSelector = sprintf($this->addressSelector, $address->getData($criteria)); - $this->_rootElement->find($addressSelector, Locator::SELECTOR_XPATH)->click(); - } else { - throw new \Exception("$criteria field is absent in provided address fixture."); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Express/Review.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Express/Review.php deleted file mode 100644 index fd76bc99379..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Express/Review.php +++ /dev/null @@ -1,72 +0,0 @@ -waitForElementNotVisible($this->loaderForButton); - $this->_rootElement->find($this->placeOrder)->click(); - $this->waitForElementNotVisible($this->loaderForButton); - } - - /** - * Select shipping method. - * - * @param string $shippingMethod - * @return void - */ - public function selectShippingMethod($shippingMethod) - { - $this->waitForElementVisible($this->shippingMethod); - list($service, $method) = explode('/', $shippingMethod); - $this->_rootElement->find($this->shippingMethod, Locator::SELECTOR_CSS, 'optgroupselect') - ->setValue($service . "/" . $method); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Express/Shortcut.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Express/Shortcut.php deleted file mode 100644 index f9d91d0e60d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Express/Shortcut.php +++ /dev/null @@ -1,34 +0,0 @@ -_rootElement->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Form/Centinel.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Form/Centinel.php deleted file mode 100644 index cf3b211241d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Form/Centinel.php +++ /dev/null @@ -1,88 +0,0 @@ -browser->find($this->sentinelSubmit)->click(); - try { - $this->browser->acceptAlert(); - } catch (\PHPUnit_Extensions_Selenium2TestCase_WebDriverException $e) { - } - $this->waitForElementNotVisible($this->centinel); - $this->browser->switchToFrame(); - } - - /** - * Fill credit card. - * - * @param ValidationPassword $pass - */ - public function fillPass(ValidationPassword $pass) - { - $this->waitForElementVisible($this->centinel); - $this->browser->switchToFrame(new Locator($this->centinel)); - $element = $this->getRootElement(); - parent::fill($pass, $element); - } - - /** - * Get root element. - * - * @return ElementInterface - */ - protected function getRootElement() - { - return $this->browser->find($this->body); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Form/Centinel.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Form/Centinel.xml deleted file mode 100644 index 8fc6189aa7e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Form/Centinel.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - [name="external.field.password"] - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Hosted/Pro/Form.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Hosted/Pro/Form.php deleted file mode 100644 index 5ca4ab5aec4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Hosted/Pro/Form.php +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - select - #credit_card_type - - - #credit_card_number - - - [name="expiryMonth"] - - - [name="expiryYear"] - - - #cvv2 - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Login.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Login.php deleted file mode 100644 index f3e8fbeb46b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Login.php +++ /dev/null @@ -1,129 +0,0 @@ -findRootElement(); - $rootElement->find($this->submitButton)->click(); - } - - /** - * Find root element for "Log In" button. - * - * @return \Magento\Mtf\Client\ElementInterface - */ - public function findRootElement() - { - return $rootElement = ($this->browser->find($this->frameBody)->isVisible()) - ? $this->browser->find($this->frameBody) - : $this->_rootElement; - } - - /** - * Select window of PayPal Express checkout iFrame, if need. - * - * @param null $element - * @return \Magento\Mtf\Client\ElementInterface|null - */ - public function switchOnPayPalFrame($element = null) - { - if ($this->browser->find($this->iFrame)->isVisible()) { - $this->browser->switchToFrame(new Locator($this->iFrame)); - $element = $this->browser->find($this->frameBody); - } - - return $element; - } - - /** - * Select window of PayPal Express checkout, if iFrame had been selected - */ - public function switchOffPayPalFrame() - { - $this->browser->switchToFrame(); - } - - /** - * Fill the root form. - * - * @param FixtureInterface $customer - * @param Element|null $element - * @return $this - */ - public function fill(FixtureInterface $customer, Element $element = null) - { - $this->waitForElementNotVisible($this->loader); - return parent::fill($customer, $this->switchOnPayPalFrame($element)); - } - - /** - * Check is block active - * - * @return bool - */ - public function isBlockActive() - { - if ($this->browser->find($this->mapping['password']['selector'])->isVisible()) { - return true; - } - - return false; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Login.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Login.xml deleted file mode 100644 index e2954900098..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Login.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - [type="email"] - - - [type="password"] - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/NewLogin.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/NewLogin.php deleted file mode 100644 index 3030342d0c8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/NewLogin.php +++ /dev/null @@ -1,117 +0,0 @@ -mapping; - - $this->waitForElementNotVisible($this->loader); - $this->_rootElement = $this->browser->find('.main'); - - $this->overrideMapping($this->getFormSplitMapping('email')); - parent::fill($customer, $this->switchOnPayPalFrame($element)); - - if (!$this->browser->find($fullMapping['password']['selector'])->isVisible()) { - $this->clickToElement($this->nextButton); - } - $this->overrideMapping($this->getFormSplitMapping('password')); - parent::fill($customer, $this->switchOnPayPalFrame($element)); - - return $this; - } - - public function clickToElement($selector) - { - $rootElement = $this->findRootElement(); - $rootElement->find($selector)->click(); - } - - /** - * Check is block active - * - * @return bool - */ - public function isBlockActive() - { - if (!$this->browser->find($this->mapping['password']['selector'])->isVisible()) { - return true; - } - - return false; - } - - /** - * Override mapping to the form - * - * @param array $mapping - * @return void - */ - protected function overrideMapping(array $mapping) - { - $this->mapping = $mapping; - } - - /** - * Get mapping to the form by key - * - * @return array - */ - protected function getFormSplitMapping($key) - { - $mapping = $this->getFormMapping(); - if (empty($mapping)) { - return []; - } - - return isset($mapping['fields'][$key]) ? [$key => $mapping['fields'][$key]] : []; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/NewLogin.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/NewLogin.xml deleted file mode 100644 index 5fedd52a083..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/NewLogin.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - [name='login_email'] - - - [name='login_password'] - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/NewLoginPassword.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/NewLoginPassword.xml deleted file mode 100644 index 5d5b5097534..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/NewLoginPassword.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - [name='login_password'] - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/OldAddresses.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/OldAddresses.php deleted file mode 100644 index 10a04851736..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/OldAddresses.php +++ /dev/null @@ -1,59 +0,0 @@ -hasData($criteria)) { - $addressSelector = sprintf($this->addressSelector, $address->getData($criteria)); - $this->_rootElement->find($addressSelector, Locator::SELECTOR_XPATH, 'checkbox')->setValue('Yes'); - $this->_rootElement->find($this->saveButton)->click(); - } else { - throw new \Exception("$criteria field is absent in provided address fixture."); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/OldLogin.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/OldLogin.php deleted file mode 100644 index 836b1b3faac..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/OldLogin.php +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - [name='login_email'] - - - [name='login_password'] - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/OldReview.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/OldReview.php deleted file mode 100644 index 364810e8fe2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/OldReview.php +++ /dev/null @@ -1,56 +0,0 @@ -blockFactory->create( - 'Mage\Paypal\Test\Block\OldAddresses', - ['element' => $this->_rootElement->find($this->addresses)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Payflow/Advanced/Form.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Payflow/Advanced/Form.php deleted file mode 100644 index cbfd4fa8552..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Payflow/Advanced/Form.php +++ /dev/null @@ -1,50 +0,0 @@ -find($this->continue)->click(); - $this->browser->selectWindow(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Payflow/Advanced/Form.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Payflow/Advanced/Form.xml deleted file mode 100644 index e013f3916fe..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Payflow/Advanced/Form.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - #cc_number - - - #expdate_month - - - #expdate_year - - - #cvv2_number - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Payflow/Link/Form.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Payflow/Link/Form.php deleted file mode 100644 index 9ee6221bc19..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Payflow/Link/Form.php +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - #cc_number - - - #expdate_month - - - #expdate_year - - - #cvv2_number - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Product/View.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Product/View.php deleted file mode 100644 index 63f75858b4b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Product/View.php +++ /dev/null @@ -1,51 +0,0 @@ -getCheckoutData(); - if (isset($checkoutData['options'])) { - $this->fillOptions($product); - } - if (isset($checkoutData['qty'])) { - $this->setQty($checkoutData['qty']); - } - $this->_rootElement->find($this->paypalCheckout)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Review.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Review.php deleted file mode 100644 index 129d5c093b7..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Review.php +++ /dev/null @@ -1,77 +0,0 @@ -blockFactory->create( - 'Mage\Paypal\Test\Block\Addresses', - ['element' => $this->_rootElement->find($this->addresses)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Constraint/AssertTransaction.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/Constraint/AssertTransaction.php deleted file mode 100644 index 13e4f722a51..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Constraint/AssertTransaction.php +++ /dev/null @@ -1,105 +0,0 @@ - $orderId, 'transaction_type' => $transactionType]; - - $salesOrderIndex->open()->getSalesOrderGrid()->searchAndOpen(['id' => $orderId]); - $orderForm = $salesOrderView->getOrderForm(); - - /** Check if transaction present in comments block. */ - /** @var Info $informationTab */ - $informationTab = $orderForm->getTabElement('information'); - $text = $this->prepareSearchedText($grandTotal); - \PHPUnit_Framework_Assert::assertTrue( - $informationTab->getCommentsBlock()->isCommentPresent($text), - 'Searched text is not present in order comments.' - ); - - \PHPUnit_Framework_Assert::assertTrue( - $informationTab->getCommentsBlock()->isCommentPresent($paymentAction), - 'Order has a wrong payment action.' - ); - - /** Check if transaction present in transactions Grid. */ - $orderForm->openTab('transactions'); - /** @var Transactions $transactionsTab */ - $transactionsTab = $orderForm->getTabElement('transactions'); - \PHPUnit_Framework_Assert::assertTrue( - $transactionsTab->getGrid()->isRowVisible($filter), - 'Searched transaction is not present in transaction grid.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return "Transaction is present in transaction grid and order's comments."; - } - - /** - * Prepare text for search. - * - * @param string $grandTotal - * @param string $currency - * @return string - */ - protected function prepareSearchedText($grandTotal, $currency = '$') - { - $amount = number_format(is_array($grandTotal) ? array_sum($grandTotal) : $grandTotal, 2); - return "amount of " . $currency . $amount; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Fixture/PaypalAddress.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/Fixture/PaypalAddress.xml deleted file mode 100644 index ea85c4f1dca..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Fixture/PaypalAddress.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Fixture/PaypalCustomer.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/Fixture/PaypalCustomer.xml deleted file mode 100644 index 9b835d0eab2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Fixture/PaypalCustomer.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Fixture/PaypalCustomer/Address.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/Fixture/PaypalCustomer/Address.php deleted file mode 100644 index d204df73b0f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Fixture/PaypalCustomer/Address.php +++ /dev/null @@ -1,118 +0,0 @@ -params = $params; - - if (isset($data['presets'])) { - $data['presets'] = explode(',', $data['presets']); - foreach ($data['presets'] as $value) { - /** @var AddressFixture $fixture */ - $addresses = $fixtureFactory->create( - 'Mage\Paypal\Test\Fixture\PaypalAddress', - ['dataset' => $value] - ); - $this->data[] = $addresses->getData(); - $this->addressesFixture[] = $addresses; - } - } elseif (empty($data['presets']) && !empty($data['addresses'])) { - foreach ($data['addresses'] as $addresses) { - /** @var AddressFixture $addresses */ - $this->data[] = $addresses->getData(); - $this->addressesFixture[] = $addresses; - } - } - } - - /** - * Persists prepared data into application. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set. - * - * @param int|null $key [optional] - * @return array - */ - public function getData($key = null) - { - return isset($this->data[$key]) ? $this->data[$key] : $this->data; - } - - /** - * Return data set configuration settings. - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Getting addresses fixture. - * - * @return array - */ - public function getAddresses() - { - return $this->addressesFixture; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Page/Paypal.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/Page/Paypal.php deleted file mode 100644 index 27afc1d5afc..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Page/Paypal.php +++ /dev/null @@ -1,117 +0,0 @@ - [ - 'class' => 'Mage\Paypal\Test\Block\Login', - 'locator' => '#login', // previous locator = #contents - 'strategy' => 'css selector', - ], - 'oldLoginBlock' => [ - 'class' => 'Mage\Paypal\Test\Block\OldLogin', - 'locator' => '#loginModule', - 'strategy' => 'css selector', - ], - 'reviewBlock' => [ - 'class' => 'Mage\Paypal\Test\Block\Review', - 'locator' => '.outerWrapper', - 'strategy' => 'css selector', - ], - 'oldReviewBlock' => [ - 'class' => 'Mage\Paypal\Test\Block\OldReview', - 'locator' => '#content', - 'strategy' => 'css selector', - ], - 'newLoginBlock' => [ - 'class' => 'Mage\Paypal\Test\Block\NewLogin', - 'locator' => '#login', - 'strategy' => 'css selector', - ], - ]; - - /** - * Custom initialization. - * - * @return void - */ - protected function _init() - { - $this->_url = 'https://www.sandbox.paypal.com/cgi-bin/'; - } - - /** - * @return Login - */ - public function getLoginBlock() - { - return $this->getBlockInstance('loginBlock'); - } - - /** - * @return Review - */ - public function getReviewBlock() - { - return $this->getBlockInstance('reviewBlock'); - } - - /** - * @return OldLogin - */ - public function getOldLoginBlock() - { - return $this->getBlockInstance('oldLoginBlock'); - } - - /** - * @return OldReview - */ - public function getOldReviewBlock() - { - return $this->getBlockInstance('oldReviewBlock'); - } - - /** - * @return NewLogin - */ - public function getNewLoginBlock() - { - return $this->getBlockInstance('newLoginBlock'); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Page/PaypalExpressReview.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/Page/PaypalExpressReview.xml deleted file mode 100644 index f9e21b714df..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Page/PaypalExpressReview.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Page/Product/CatalogProductView.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/Page/Product/CatalogProductView.xml deleted file mode 100644 index 771a2f3ba2c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Page/Product/CatalogProductView.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Repository/ConfigData.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/Repository/ConfigData.xml deleted file mode 100644 index 8b9edeef097..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Repository/ConfigData.xml +++ /dev/null @@ -1,1842 +0,0 @@ - - - - - - - payment - 1 - - PayPal - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - No - 0 - - - payment - 1 - No - - - - - - payment - 1 - No - - - - payment - 1 - No - - - - payment - 1 - No - - - - - - payment - 1 - - PayPal - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - Specific Countries - 1 - - - payment - 1 - - - US - - - - payment - 1 - No - - - - - - payment - 1 - No - - - - payment - 1 - No - - - - payment - 1 - All Allowed Countries - - - - - - payment - 1 - - PayPal - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Sale - Sale - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - - - payment - 1 - No - - - - payment - 1 - No - - - - payment - 1 - Authorization - Authorization - - - - - payment - 1 - - PayPal - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - Specific Countries - 1 - - - payment - 1 - - - US - - - - payment - 1 - No - - - - - - payment - 1 - No - - - - payment - 1 - No - - - - payment - 1 - All Allowed Countries - - - - - - payment - 1 - - - - - payment - 1 - API Signature - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - payment - 1 - Yes - 1 - - - payment - 1 - Specific Countries - 1 - - - payment - 1 - - - US - - - - payment - 1 - Yes - 1 - - - payment - 1 - No - Mark - - - payment - 1 - No - - - - - - payment - 1 - Yes - 1 - - - payment - 1 - All Allowed Countries - - - - payment - 1 - No - - - - payment - 1 - No - Mark - - - - - payment - 1 - - - - - payment - 1 - API Signature - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - payment - 1 - Authorization - Authorization - - - payment - 1 - No - 0 - - - - - payment - 1 - No - - - - payment - 1 - No - - - - payment - 1 - No - - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - payment - 1 - Yes - 1 - - - - - payment - 1 - No - - - - payment - 1 - Yes - - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - Authorization - Authorization - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - - - payment - 1 - No - - - - payment - 1 - No - - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - Sale - Sale - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - - - payment - 1 - No - - - - payment - 1 - No - - - - - - payment - 1 - - - - - payment - 1 - - PayPal - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - Authorization - Authorization - - - payment - 1 - All Allowed Countries - - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - - - payment - 1 - No - - - - payment - 1 - No - - - - - - payment - 1 - - - - - payment - 1 - - PayPal - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - Sale - Sale - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - - - payment - 1 - No - - - - payment - 1 - No - - - - - - payment - 1 - - PayPal - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - Authorization - Authorization - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - - - payment - 1 - No - - - - - - payment - 1 - - PayPal - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - Sale - Sale - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - - - payment - 1 - No - - - - - - payment - 1 - - PayPal - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - - Credit Card (PayPal Advanced) - - - payment - 1 - Authorization - Authorization - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - payment - 1 - Authorization - Authorization - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - - - payment - 1 - No - - - - payment - 1 - No - - - - - - payment - 1 - - PayPal - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - - Credit Card (PayPal Advanced) - - - payment - 1 - Sale - Sale - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - payment - 1 - Authorization - Authorization - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - - - payment - 1 - No - - - - payment - 1 - No - - - - - - payment - 1 - United Kingdom - GB - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - Authorization - Authorization - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - - - payment - 1 - United States - US - - - payment - 1 - No - - - - - - payment - 1 - United Kingdom - GB - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - Sale - Sale - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - - - payment - 1 - United States - US - - - payment - 1 - No - - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - Authorization - Authorization - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - payment - 1 - No - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - - - payment - 1 - No - - - - payment - 1 - No - - - - payment - 1 - No - - - - payment - 1 - No - - - - payment - 1 - Yes - 1 - - - - - payment - 1 - - - - - payment - 1 - - PayPal - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - Authorization - Authorization - - - payment - 1 - All Allowed Countries - - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - - - payment - 1 - No - - - - payment - 1 - No - - - - payment - 1 - No - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Repository/PaypalAddress.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/Repository/PaypalAddress.xml deleted file mode 100644 index dd747231050..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Repository/PaypalAddress.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - Dmytro - Aponasenko - 1 Main St - Culver City - California - 90230 - United States - T: 408-618-6006 - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Repository/PaypalCustomer.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/Repository/PaypalCustomer.xml deleted file mode 100644 index 5ed199d09e0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Repository/PaypalCustomer.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - Dmytro - Aponasenko - %PAYPAL_EMAIL% - %PAYPAL_PASSWORD% - - customer_US - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/AbstractCreateSalesEntityForOnlinePaymentMethodsTest.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/AbstractCreateSalesEntityForOnlinePaymentMethodsTest.php deleted file mode 100644 index 2ca9dfdc925..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/AbstractCreateSalesEntityForOnlinePaymentMethodsTest.php +++ /dev/null @@ -1,64 +0,0 @@ -objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - $magentoCustomer = $fixtureFactory->create('Mage\Customer\Test\Fixture\Customer', ['dataset' => 'default']); - $magentoCustomer->persist(); - - return ['customer' => $magentoCustomer]; - } - - /** - * Runs one page checkout test. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } - - /** - * Disable including config and delete all tax rules after test. - * - * @return void - */ - public function tearDown() - { - $this->objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => $this->currentVariation['arguments']['configData'], 'rollback' => true] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/AbstractCreateSalesEntityForPaypalExpressCheckoutTest.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/AbstractCreateSalesEntityForPaypalExpressCheckoutTest.php deleted file mode 100644 index 0e85956424b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/AbstractCreateSalesEntityForPaypalExpressCheckoutTest.php +++ /dev/null @@ -1,39 +0,0 @@ -create('Mage\Paypal\Test\Fixture\PaypalCustomer', ['dataset' => 'default']); - - return ['paypalCustomer' => $paypalCustomer, 'customer' => $magentoCustomer['customer']]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateInvoiceForPaypalExpressCheckoutTest.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateInvoiceForPaypalExpressCheckoutTest.php deleted file mode 100644 index 4735860a57b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateInvoiceForPaypalExpressCheckoutTest.php +++ /dev/null @@ -1,44 +0,0 @@ - Orders. - * 7. Select created order in the grid and open it. - * 8. Click 'Invoice' button. - * 9. Fill data according to dataset. - * 10. Click 'Submit Invoice' button. - * 11. Perform asserts. - * - * @group Payment_Methods_(CS), PayPal_(CS) - * @ZephyrId MPERF-7201 - */ -class CreateInvoiceForPaypalExpressCheckoutTest extends AbstractCreateSalesEntityForPaypalExpressCheckoutTest -{ - /* tags */ - const TEST_TYPE = '3rd_party_test'; - /* end tags */ -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateInvoiceForPaypalExpressCheckoutTest.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateInvoiceForPaypalExpressCheckoutTest.xml deleted file mode 100644 index 6981212f97b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateInvoiceForPaypalExpressCheckoutTest.xml +++ /dev/null @@ -1,332 +0,0 @@ - - - - - - Create full online invoice with shipment for paypal express checkout with line items mark require billing address - catalogProductSimple::default - paypal_express_order_line_items_mark_require_billing_address - Flat Rate/Fixed - comments for invoice - Yes - 315.00 - 315.00 - Shipped - 100.00 - 300.00 - 300.00 - Complete - payment_method:paypal - - - - - - - - - - Create partial online invoice for payflow express authorization line items - catalogProductSimple::default - payflow_express_authorization_line_items - Flat Rate/Fixed - 1 - comments for invoice - 115.00 - 115.00 - 1 - 100.00 - 100.00 - 100.00 - Processing - payment_method:paypal - - - - - - - - - Create full online invoice for payflow express authorization specific country us - catalogProductSimple::default - payflow_express_authorization_specificcountry_us - Flat Rate/Fixed - comments for invoice - 315.00 - 315.00 - 100.00 - 300.00 - 300.00 - Processing - payment_method:paypal - - - - - - - - - - Create full online invoice for payflow express sale specific country gb line items - catalogProductSimple::default - payflow_express_sale_specificcountry_gb_line_items - Flat Rate/Fixed - comments for invoice - 315.00 - 315.00 - 100.00 - 300.00 - 300.00 - Processing - payment_method:paypal - - - - - - - - - - Create online full invoice for paypal express sale specific country us shipping options mark - catalogProductSimple::default - paypal_express_sale_specificcountry_us_shipping_options_mark - Flat Rate/Fixed - comments for invoice - 315.00 - 315.00 - 100.00 - 300.00 - 300.00 - Processing - payment_method:paypal - - - - - - - - - - Create full online invoice for paypal express sale specific country us shipping options mark - catalogProductSimple::default - paypal_express_sale_specificcountry_us_shipping_options_mark - Flat Rate/Fixed - comments for invoice - 315.00 - 315.00 - 100.00 - 300.00 - 300.00 - Processing - payment_method:paypal - - - - - - - - - - Create full online invoice with 2 products and taxes for payflow express authorization line items - catalogProductSimple::default,catalogProductSimple::default - default - payflow_express_authorization_line_items, tax_calculation_base_on_shipping_origin - Flat Rate/Fixed - comments for invoice - 679.50 - 679.50 - 100.00 - 300.00 - 24.75 - 324.75 - 100.00 - 300.00 - 24.75 - 324.75 - Processing - payment_method:paypal - - - - - - - - - - Create full online invoice with configurable product for payflow express authorization line items - configurableProduct::default - payflow_express_authorization_line_items - Flat Rate/Fixed - comments for invoice - 330.00 - 330.00 - 160.00 - 320.00 - 320.00 - Processing - payment_method:paypal - - - - - - - - - - Create full offline invoice with shipment for paypal express checkout with line items mark require billing address - catalogProductSimple::default - paypal_express_order_line_items_mark_require_billing_address - Flat Rate/Fixed - comments for invoice - Yes - Capture Offline - 315.00 - 315.00 - Shipped - 100.00 - 300.00 - 300.00 - Complete - payment_method:paypal - - - - - - - - - - Create partial offline invoice for payflow express authorization line items - catalogProductSimple::default - payflow_express_authorization_line_items - Flat Rate/Fixed - 1 - comments for invoice - Capture Offline - 115.00 - 115.00 - 1 - 100.00 - 100.00 - 100.00 - Processing - payment_method:paypal - - - - - - - - - Create full offline invoice for payflow express authorization specific country us - catalogProductSimple::default - payflow_express_authorization_specificcountry_us - Flat Rate/Fixed - comments for invoice - Capture Offline - 315.00 - 315.00 - 100.00 - 300.00 - 300.00 - Processing - payment_method:paypal - - - - - - - - - - Create full offline invoice for payflow express sale specific country gb line items - catalogProductSimple::default - payflow_express_sale_specificcountry_gb_line_items - Flat Rate/Fixed - comments for invoice - Capture Offline - 315.00 - 315.00 - 100.00 - 300.00 - 300.00 - Processing - payment_method:paypal - - - - - - - - - - Create full offline invoice for paypal express sale specific country us shipping options mark - catalogProductSimple::default - paypal_express_sale_specificcountry_us_shipping_options_mark - Flat Rate/Fixed - comments for invoice - Capture Offline - 315.00 - 315.00 - 100.00 - 300.00 - 300.00 - Processing - payment_method:paypal - - - - - - - - - - Create full offline invoice for paypal express sale specific country us shipping options mark - catalogProductSimple::default - paypal_express_sale_specificcountry_us_shipping_options_mark - Flat Rate/Fixed - comments for invoice - Capture Offline - 315.00 - 315.00 - 100.00 - 300.00 - 300.00 - Processing - payment_method:paypal - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOfflineInvoiceForOnlinePaymentsMethodsWithIFrameTest.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOfflineInvoiceForOnlinePaymentsMethodsWithIFrameTest.php deleted file mode 100644 index a0dc04cb7d6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOfflineInvoiceForOnlinePaymentsMethodsWithIFrameTest.php +++ /dev/null @@ -1,93 +0,0 @@ - Orders. - * 10. Select created order in the grid and open it. - * 11. Click 'Invoice' button. - * 12. Fill data according to dataset. - * 13. Click 'Submit Invoice' button. - * 14. Perform assertions. - * - * @group Order_Management_(CS) - * @ZephyrId MPERF-7231 - */ -class CreateOfflineInvoiceForOnlinePaymentsMethodsWithIFrameTest extends Scenario -{ - /* tags */ - const TEST_TYPE = '3rd_party_test'; - /* end tags */ - - /** - * Customer logout page. - * - * @var CustomerAccountLogout - */ - protected $customerAccountLogout; - - /** - * Prepare environment for test. - * - * @param CustomerAccountLogout $customerAccountLogout - * @return void - */ - public function __prepare(CustomerAccountLogout $customerAccountLogout) - { - $this->objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - $this->customerAccountLogout = $customerAccountLogout; - } - - /** - * Create offline invoice with online payments methods with i-frame. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } - - /** - * Disable included config after test. - * - * @return void - */ - public function tearDown() - { - $this->customerAccountLogout->open(); - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => $this->currentVariation['arguments']['configData'], 'rollback' => true] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOfflineInvoiceForOnlinePaymentsMethodsWithIFrameTest.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOfflineInvoiceForOnlinePaymentsMethodsWithIFrameTest.xml deleted file mode 100644 index a60aa1a9477..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOfflineInvoiceForOnlinePaymentsMethodsWithIFrameTest.xml +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - Create full invoice with shipment for paypal payflow link - paypal_payflow_link - catalogProductSimple::default - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - payflow_link - for_iframe - yes - Yes - comments for invoice - Capture Offline - 315.00 - 315.00 - Shipped - 100.00 - 300.00 - 300.00 - Complete - payment_method:paypal, paypal:payflow_link - - - - - - - - - - Create partial invoice for paypal advanced - paypal_advanced - catalogProductSimple::default - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - payflow_advanced - for_iframe - yes - comments for invoice - 1 - Capture Offline - 115.00 - 115.00 - 1 - 100.00 - 100.00 - 100.00 - Processing - payment_method:paypal, paypal:advanced - - - - - - - - - Create full invoice for paypal advanced action sale - paypal_advanced_action_sale - catalogProductSimple::default - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - payflow_advanced - for_iframe - yes - false - comments for invoice - Capture Offline - 315.00 - 315.00 - 100.00 - 300.00 - 300.00 - Processing - payment_method:paypal, paypal:advanced - - - - - - - - - Create full invoice for paypal hosted solution - paypal_hosted_solution - catalogProductSimple::default - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - hosted_pro - hosted_pro - yes - comments for invoice - Yes - Capture Offline - 315.00 - 315.00 - Shipped - 100.00 - 300.00 - 300.00 - Complete - payment_method:paypal, paypal:hosted_solution - - - - - - - - - - Create full invoice for paypal hosted solution action sale - paypal_hosted_solution_action_sale - catalogProductSimple::default - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - hosted_pro - hosted_pro - yes - false - comments for invoice - Capture Offline - 315.00 - 315.00 - 100.00 - 300.00 - 300.00 - Processing - payment_method:paypal, paypal:hosted_solution - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOfflineInvoiceForOnlinePaymentsMethodsWithoutIFrameTest.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOfflineInvoiceForOnlinePaymentsMethodsWithoutIFrameTest.php deleted file mode 100644 index c52e7a19b8a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOfflineInvoiceForOnlinePaymentsMethodsWithoutIFrameTest.php +++ /dev/null @@ -1,93 +0,0 @@ - Orders. - * 10. Select created order in the grid and open it. - * 11. Click 'Invoice' button. - * 12. Fill data according to dataset. - * 13. Click 'Submit Invoice' button. - * 14. Perform assertions. - * - * @group Order_Management_(CS) - * @ZephyrId MPERF-7211 - */ -class CreateOfflineInvoiceForOnlinePaymentsMethodsWithoutIFrameTest extends Scenario -{ - /* tags */ - const TEST_TYPE = '3rd_party_test'; - /* end tags */ - - /** - * Customer logout page. - * - * @var CustomerAccountLogout - */ - protected $customerAccountLogout; - - /** - * Prepare environment for test. - * - * @param CustomerAccountLogout $customerAccountLogout - * @return void - */ - public function __prepare(CustomerAccountLogout $customerAccountLogout) - { - $this->customerAccountLogout = $customerAccountLogout; - $this->objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - } - - /** - * Create offline invoice with online payments methods without i-frame. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } - - /** - * Disable enabled config after test. - * - * @return void - */ - public function tearDown() - { - $this->customerAccountLogout->open(); - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => $this->currentVariation['arguments']['configData'], 'rollback' => true] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOfflineInvoiceForOnlinePaymentsMethodsWithoutIFrameTest.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOfflineInvoiceForOnlinePaymentsMethodsWithoutIFrameTest.xml deleted file mode 100644 index 04c2083f75d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOfflineInvoiceForOnlinePaymentsMethodsWithoutIFrameTest.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - Create full invoice with shipment for paypal payments pro. - paypal_payments_pro - catalogProductSimple::default - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - paypal_direct - payments_pro - comments for invoice - Yes - Capture Offline - 315.00 - 315.00 - Shipped - 100.00 - 300.00 - 300.00 - Complete - payment_method:paypal, paypal:payments_pro - - - - - - - - - - Create full invoice with shipment for paypal payments pro. - paypal_payflow_pro - catalogProductSimple::5_dollar_product_for_payments - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - verisign - default - comments for invoice - Yes - Capture Offline - 30.00 - 30.00 - Shipped - 5.00 - 15.00 - 15.00 - Complete - payment_method:paypal, paypal:payflow_pro - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineInvoiceForOnlinePaymentsMethodsWithIFrameTest.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineInvoiceForOnlinePaymentsMethodsWithIFrameTest.php deleted file mode 100644 index 7b93e54c60d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineInvoiceForOnlinePaymentsMethodsWithIFrameTest.php +++ /dev/null @@ -1,93 +0,0 @@ - Orders. - * 10. Select created order in the grid and open it. - * 11. Click 'Invoice' button. - * 12. Fill data according to dataset. - * 13. Click 'Submit Invoice' button. - * 14. Perform assertions. - * - * @group Order_Management_(CS) - * @ZephyrId MPERF-7231 - */ -class CreateOnlineInvoiceForOnlinePaymentsMethodsWithIFrameTest extends Scenario -{ - /* tags */ - const TEST_TYPE = '3rd_party_test'; - /* end tags */ - - /** - * Customer logout page. - * - * @var CustomerAccountLogout - */ - protected $customerAccountLogout; - - /** - * Prepare environment for test. - * - * @param CustomerAccountLogout $customerAccountLogout - * @return void - */ - public function __prepare(CustomerAccountLogout $customerAccountLogout) - { - $this->objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - $this->customerAccountLogout = $customerAccountLogout; - } - - /** - * Create online invoice with online payments methods with i-frame. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } - - /** - * Disable included config after test. - * - * @return void - */ - public function tearDown() - { - $this->customerAccountLogout->open(); - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => $this->currentVariation['arguments']['configData'], 'rollback' => true] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineInvoiceForOnlinePaymentsMethodsWithIFrameTest.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineInvoiceForOnlinePaymentsMethodsWithIFrameTest.xml deleted file mode 100644 index 0b2bc0bd429..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineInvoiceForOnlinePaymentsMethodsWithIFrameTest.xml +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - Create full invoice with shipment for paypal payflow link - paypal_payflow_link - catalogProductSimple::default - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - payflow_link - for_iframe - yes - comments for invoice - Yes - 315.00 - 315.00 - Shipped - 100.00 - 300.00 - 300.00 - Complete - payment_method:paypal_direct, paypal:payflow_link - - - - - - - - - Create partial invoice for paypal advanced - paypal_advanced - catalogProductSimple::default - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - payflow_advanced - for_iframe - yes - comments for invoice - 1 - 115.00 - 115.00 - 1 - 100.00 - 100.00 - 100.00 - Processing - payment_method:paypal_direct, paypal:advanced - - - - - - - - - Create full invoice for paypal hosted solution - paypal_hosted_solution - catalogProductSimple::default - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - hosted_pro - hosted_pro - yes - comments for invoice - 315.00 - 315.00 - 100.00 - 300.00 - 300.00 - Processing - payment_method:paypal_direct, paypal:hosted_solution - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineInvoiceForOnlinePaymentsMethodsWithoutIFrameTest.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineInvoiceForOnlinePaymentsMethodsWithoutIFrameTest.php deleted file mode 100644 index c9e5c26127b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineInvoiceForOnlinePaymentsMethodsWithoutIFrameTest.php +++ /dev/null @@ -1,93 +0,0 @@ - Orders. - * 10. Select created order in the grid and open it. - * 11. Click 'Invoice' button. - * 12. Fill data according to dataset. - * 13. Click 'Submit Invoice' button. - * 14. Perform assertions. - * - * @group Order_Management_(CS) - * @ZephyrId MPERF-7211 - */ -class CreateOnlineInvoiceForOnlinePaymentsMethodsWithoutIFrameTest extends Scenario -{ - /* tags */ - const TEST_TYPE = '3rd_party_test'; - /* end tags */ - - /** - * Customer logout page. - * - * @var CustomerAccountLogout - */ - protected $customerAccountLogout; - - /** - * Prepare environment for test. - * - * @param CustomerAccountLogout $customerAccountLogout - * @return void - */ - public function __prepare(CustomerAccountLogout $customerAccountLogout) - { - $this->customerAccountLogout = $customerAccountLogout; - $this->objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - } - - /** - * Create online invoice with online payments methods without i-frame. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } - - /** - * Disable enabled config after test. - * - * @return void - */ - public function tearDown() - { - $this->customerAccountLogout->open(); - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => $this->currentVariation['arguments']['configData'], 'rollback' => true] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineInvoiceForOnlinePaymentsMethodsWithoutIFrameTest.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineInvoiceForOnlinePaymentsMethodsWithoutIFrameTest.xml deleted file mode 100644 index 9a7742b076c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineInvoiceForOnlinePaymentsMethodsWithoutIFrameTest.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - Create full invoice with shipment for paypal payments pro. - paypal_payments_pro - catalogProductSimple::default - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - paypal_direct - payments_pro - comments for invoice - Yes - 315.00 - 315.00 - Shipped - 100.00 - 300.00 - 300.00 - Complete - payment_method:paypal, paypal:payments_pro - - - - - - - - - - Create full invoice with shipment for paypal payments pro. - paypal_payflow_pro - catalogProductSimple::5_dollar_product_for_payments - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - verisign - default - comments for invoice - Yes - 30.00 - 30.00 - Shipped - 5.00 - 15.00 - 15.00 - Complete - payment_method:paypal, paypal:payflow_pro - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineRefundForOnlinePaymentsMethodsWithIFrameTest.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineRefundForOnlinePaymentsMethodsWithIFrameTest.php deleted file mode 100644 index ef62a8f68f2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineRefundForOnlinePaymentsMethodsWithIFrameTest.php +++ /dev/null @@ -1,95 +0,0 @@ - Orders. - * 5. Select created order in the grid and open it. - * 6. Click 'Ship' button. - * 7. Fill data according to dataset. - * 8. Click 'Submit Ship' button. - * 9. Click 'Invoice' button. - * 10. Fill data according to dataset. - * 11. Click 'Submit Invoice' button. - * 12. Click 'Credit memo' button. - * 13. Fill data according to dataset. - * 14. Click 'Submit credit memo' button. - * 15. Perform asserts. - * - * @group Order_Management_(CS) - * @ZephyrId MPERF-7277 - */ -class CreateOnlineRefundForOnlinePaymentsMethodsWithIFrameTest extends Scenario -{ - /* tags */ - const TEST_TYPE = '3rd_party_test'; - /* end tags */ - - /** - * Customer logout page. - * - * @var CustomerAccountLogout - */ - protected $customerAccountLogout; - - /** - * Prepare environment for test. - * - * @param CustomerAccountLogout $customerAccountLogout - * @return void - */ - public function __prepare(CustomerAccountLogout $customerAccountLogout) - { - $this->objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - $this->customerAccountLogout = $customerAccountLogout; - } - - /** - * Create online refund with online payments methods with i-frame. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } - - /** - * Disable included config, delete all tax rules and logout after test. - * - * @return void - */ - public function tearDown() - { - $this->objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - $this->customerAccountLogout->open(); - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => $this->currentVariation['arguments']['configData'], 'rollback' => true] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineRefundForOnlinePaymentsMethodsWithIFrameTest.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineRefundForOnlinePaymentsMethodsWithIFrameTest.xml deleted file mode 100644 index 5f7d847c4ad..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineRefundForOnlinePaymentsMethodsWithIFrameTest.xml +++ /dev/null @@ -1,179 +0,0 @@ - - - - - - Create full refund with two products for paypal advanced - paypal_advanced - catalogProductSimple::default, catalogProductSimple::default - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - payflow_advanced - for_iframe - yes - comments for credit memo - 630.00 - 630.00 - 100.00 - 300.00 - 300.00 - 100.00 - 300.00 - 300.00 - Closed - payment_method:paypal_direct, paypal:advanced - - - - - - - - - - Create partial refund with partial invoice for paypal advanced - paypal_advanced - catalogProductSimple::default - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - payflow_advanced - for_iframe - yes - comments for credit memo - 2 - 1 - 1 - 115.00 - 115.00 - 100.00 - 100.00 - 100.00 - Processing - payment_method:paypal_direct, paypal:advanced - - - - - - - - - - Create full refund with partial invoice for paypal payflow link - paypal_payflow_link - catalogProductSimple::default - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - payflow_link - for_iframe - yes - comments for credit memo - 2 - 2 - 2 - 215.00 - 215.00 - 100.00 - 200.00 - 200.00 - Processing - payment_method:paypal_direct, paypal:payflow_link - - - - - - - - - - Create full refund with taxes for paypal payflow link action sale - paypal_payflow_link_action_sale - catalogProductSimple::default - default - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - payflow_link - for_iframe - yes - comments for credit memo - false - 339.75 - 339.75 - 100.00 - 300.00 - 24.75 - 324.75 - Closed - payment_method:paypal_direct, paypal:payflow_link - - - - - - - - - - Create full refund with two products for paypal advanced action sale - paypal_advanced_action_sale - configurableProduct::default - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - payflow_advanced - for_iframe - yes - false - comments for credit memo - 2 - 330.00 - 330.00 - 160.00 - 320.00 - 320.00 - Closed - payment_method:paypal_direct, paypal:advanced - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineRefundForOnlinePaymentsMethodsWithoutIFrameTest.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineRefundForOnlinePaymentsMethodsWithoutIFrameTest.php deleted file mode 100644 index f7870bdb58f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineRefundForOnlinePaymentsMethodsWithoutIFrameTest.php +++ /dev/null @@ -1,94 +0,0 @@ - Orders. - * 5. Select created order in the grid and open it. - * 6. Click 'Ship' button. - * 7. Fill data according to dataset. - * 8. Click 'Submit Ship' button. - * 9. Click 'Invoice' button. - * 10. Fill data according to dataset. - * 11. Click 'Submit Invoice' button. - * 12. Click 'Credit memo' button. - * 13. Fill data according to dataset. - * 14. Click 'Submit credit memo' button. - * 15. Perform asserts. - * - * @group Order_Management_(CS) - * @ZephyrId MPERF-7239 - */ -class CreateOnlineRefundForOnlinePaymentsMethodsWithoutIFrameTest extends Scenario -{ - /* tags */ - const TEST_TYPE = '3rd_party_test'; - /* end tags */ - - /** - * Customer logout page. - * - * @var CustomerAccountLogout - */ - protected $customerAccountLogout; - - /** - * Prepare environment for test. - * - * @param CustomerAccountLogout $customerAccountLogout - * @return void - */ - public function __prepare(CustomerAccountLogout $customerAccountLogout) - { - $this->objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - $this->customerAccountLogout = $customerAccountLogout; - } - - /** - * Create online refund with online payments methods without i-frame. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } - - /** - * Disable included config and logout after test. - * - * @return void - */ - public function tearDown() - { - $this->customerAccountLogout->open(); - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => $this->currentVariation['arguments']['configData'], 'rollback' => true] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineRefundForOnlinePaymentsMethodsWithoutIFrameTest.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineRefundForOnlinePaymentsMethodsWithoutIFrameTest.xml deleted file mode 100644 index bda4c52fbaf..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineRefundForOnlinePaymentsMethodsWithoutIFrameTest.xml +++ /dev/null @@ -1,169 +0,0 @@ - - - - - - Create full refund for paypal payments pro - catalogProductSimple::default - paypal_payments_pro - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - paypal_direct - payments_pro - comments for credit memo - 315.00 - 315.00 - 100.00 - 300.00 - 300.00 - Closed - payment_method:paypal, paypal:payments_pro - - - - - - - - - - Create partial credit memo for paypal payments pro action sale - catalogProductSimple::default - paypal_payments_pro_action_sale - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - paypal_direct - payments_pro - false - 1 - comments for credit memo - 115.00 - 115.00 - 1 - 100.00 - 100.00 - 100.00 - Complete - payment_method:paypal, paypal:payments_pro - - - - - - - - - Create full credit memo with partial invoice for paypal payflow pro - catalogProductSimple::5_dollar_product_for_payments - paypal_payflow_pro - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - verisign - default - comments for credit memo - 2 - 25.00 - 25.00 - 2 - 5.00 - 10.00 - 10.00 - Processing - payment_method:paypal, paypal:payflow_pro - - - - - - - - - - Create partial credit memo with partial invoice for paypal payflow pro - catalogProductSimple::5_dollar_product_for_payments - paypal_payflow_pro - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - verisign - default - comments for credit memo - 2 - 1 - 20.00 - 20.00 - 1 - 5.00 - 5.00 - 5.00 - Processing - payment_method:paypal, paypal:payflow_pro - - - - - - - - - - Create partial credit memo for paypal payflow pro action sale - catalogProductSimple::5_dollar_product_for_payments - paypal_payflow_pro_action_sale - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - verisign - default - comments for credit memo - false - 1 - 20.00 - 20.00 - 1 - 5.00 - 5.00 - 5.00 - Complete - payment_method:paypal, paypal:payflow_pro - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineRefundForPaypalExpressCheckoutTest.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineRefundForPaypalExpressCheckoutTest.php deleted file mode 100644 index 74772b53512..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineRefundForPaypalExpressCheckoutTest.php +++ /dev/null @@ -1,50 +0,0 @@ - Orders. - * 7. Select created order in the grid and open it. - * 8. Click 'Ship' button. - * 9. Fill data according to dataset. - * 10. Click 'Submit Ship' button. - * 11. Click 'Invoice' button. - * 12. Fill data according to dataset. - * 13. Click 'Submit Invoice' button. - * 14. Click 'Credit memo' button. - * 15. Fill data according to dataset. - * 16. Click 'Submit credit memo' button. - * 17. Perform asserts. - * - * @group Payment_Methods_(CS), PayPal_(CS) - * @ZephyrId MPERF-7216 - */ -class CreateOnlineRefundForPaypalExpressCheckoutTest extends AbstractCreateSalesEntityForPaypalExpressCheckoutTest -{ - /* tags */ - const TEST_TYPE = '3rd_party_test'; - /* end tags */ -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineRefundForPaypalExpressCheckoutTest.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineRefundForPaypalExpressCheckoutTest.xml deleted file mode 100644 index dbcc91dcda5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineRefundForPaypalExpressCheckoutTest.xml +++ /dev/null @@ -1,229 +0,0 @@ - - - - - - Create full refund for paypal express checkout with line items mark require billing address - catalogProductSimple::default - paypal_express_order_line_items_mark_require_billing_address - Flat Rate/Fixed - comments for credit memo - 315.00 - 315.00 - 100.00 - 300.00 - 300.00 - Closed - payment_method:paypal - - - - - - - - - - Create partial credit memo for payflow express authorization line items - catalogProductSimple::default - payflow_express_authorization_line_items - Flat Rate/Fixed - 1 - comments for credit memo - 115.00 - 115.00 - 1 - 100.00 - 100.00 - 100.00 - Complete - payment_method:paypal - - - - - - - - - Create full credit memo with partial invoice for payflow express authorization specific country us - catalogProductSimple::default - payflow_express_authorization_specificcountry_us - Flat Rate/Fixed - comments for credit memo - 2 - 215.00 - 215.00 - 2 - 100.00 - 200.00 - 200.00 - Processing - payment_method:paypal - - - - - - - - - - Create partial credit memo with partial invoice for payflow express authorization specific country us - catalogProductSimple::default - payflow_express_authorization_specificcountry_us - Flat Rate/Fixed - comments for credit memo - 2 - 1 - 115.00 - 115.00 - 1 - 100.00 - 100.00 - 100.00 - Processing - payment_method:paypal - - - - - - - - - Create full credit memo for payflow express sale - catalogProductSimple::default - payflow_express_sale - Flat Rate/Fixed - comments for credit memo - 5 - false - 315.00 - 315.00 - 3 - 100.00 - 300.00 - 300.00 - Closed - payment_method:paypal - - - - - - - - - - Create full credit memo for payflow express sale specific country gb line items - catalogProductSimple::default - payflow_express_sale_specificcountry_gb_line_items - Flat Rate/Fixed - comments for credit memo - 5 - 315.00 - 315.00 - 3 - 100.00 - 300.00 - 300.00 - Closed - payment_method:paypal - - - - - - - - - - Create full credit memo for paypal express sale specific country us shipping options mark - catalogProductSimple::default - paypal_express_sale_specificcountry_us_shipping_options_mark - Flat Rate/Fixed - comments for credit memo - 5 - 315.00 - 315.00 - 3 - 100.00 - 300.00 - 300.00 - Closed - payment_method:paypal - - - - - - - - - - Create full credit memo for paypal express sale specific country us shipping options mark with two products and taxes - catalogProductSimple::default,catalogProductSimple::default - default - paypal_express_sale_specificcountry_us_shipping_options_mark, tax_calculation_base_on_shipping_origin - Flat Rate/Fixed - comments for credit memo - 6 - 679.50 - 679.50 - 100.00 - 300.00 - 24.75 - 324.75 - 100.00 - 300.00 - 24.75 - 324.75 - Closed - payment_method:paypal - - - - - - - - - - Create full credit memo for paypal express sale specific country us shipping options mark with configurable product - configurableProduct::default - paypal_express_sale_specificcountry_us_shipping_options_mark - Flat Rate/Fixed - comments for credit memo - 2 - 330.00 - 330.00 - 160.00 - 320.00 - 320.00 - Closed - payment_method:paypal - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOrderWithOnlinePaymentsMethodsWith3DSecureTest.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOrderWithOnlinePaymentsMethodsWith3DSecureTest.php deleted file mode 100644 index 063ad5c20b4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOrderWithOnlinePaymentsMethodsWith3DSecureTest.php +++ /dev/null @@ -1,87 +0,0 @@ -customerAccountLogout = $customerAccountLogout; - $this->objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - } - - /** - * Runs one page checkout with online payments methods with 3D secure test. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } - - /** - * Disable enabled config after test. - * - * @return void - */ - public function tearDown() - { - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => $this->currentVariation['arguments']['configData'], 'rollback' => true] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOrderWithOnlinePaymentsMethodsWith3DSecureTest.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOrderWithOnlinePaymentsMethodsWith3DSecureTest.xml deleted file mode 100644 index 501c9276b9b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOrderWithOnlinePaymentsMethodsWith3DSecureTest.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - paypal_payflow_pro_3d_secure, enable_3d_secure - catalogProductSimple::order_default - default_frontend - guest - no - customer_US - Flat Rate - Fixed - verisign - visa_3d_secure_positive - visa_3d_secure_positive - 105.00 - true - payment_method:paypal, paypal:payflow_pro - - - - - - paypal_payflow_pro_3d_secure, enable_3d_secure - catalogProductSimple::order_default - default_frontend - guest - no - customer_US - Flat Rate - Fixed - verisign - visa_3d_secure_negative - visa_3d_secure_positive - 105.00 - false - payment_method:paypal, paypal:payflow_pro - - - - paypal_payments_pro_3d_secure, enable_3d_secure - catalogProductSimple::order_default - default_frontend - guest - no - customer_US - Flat Rate - Fixed - paypal_direct - visa_3d_secure_positive_without_pass - visa_3d_secure_positive - 105.00 - true - payment_method:paypal, paypal:payments_pro - - - - - - paypal_payments_pro_3d_secure, enable_3d_secure - catalogProductSimple::order_default - default_frontend - guest - no - customer_US - Flat Rate - Fixed - paypal_direct - visa_3d_secure_negative_without_pass - visa_3d_secure_positive - 105.00 - false - payment_method:paypal, paypal:payments_pro - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOrderWithOnlinePaymentsMethodsWithIFrameTest.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOrderWithOnlinePaymentsMethodsWithIFrameTest.php deleted file mode 100644 index 56b5ee23b71..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOrderWithOnlinePaymentsMethodsWithIFrameTest.php +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - paypal_payflow_link - catalogProductSimple::order_default - default_frontend_new - register - no - customer_US - Flat Rate - Fixed - payflow_link - for_iframe - yes - Authorization - Authorized - 105 - payment_method:paypal_direct, paypal:payflow_link - - - - - - - paypal_payflow_link_action_sale - catalogProductSimple::order_default - default_frontend_new - login - customer_US_login - Flat Rate - Fixed - payflow_link - for_iframe - yes - Capture - captured - 105 - payment_method:paypal_direct, paypal:payflow_link - - - - - - - paypal_advanced - catalogProductSimple::order_default - default_frontend - guest - no - customer_US - Flat Rate - Fixed - payflow_advanced - for_iframe - yes - Authorization - Authorized - 105 - payment_method:paypal_direct, paypal:advanced - - - - - - - paypal_advanced_action_sale - catalogProductSimple::order_default - default_frontend_new - register - no - customer_US - Flat Rate - Fixed - payflow_advanced - for_iframe - yes - Capture - captured - 105 - payment_method:paypal_direct, paypal:advanced - - - - - - - paypal_hosted_solution - catalogProductSimple::order_default - default_frontend_new - login - customer_UK - Flat Rate - Fixed - hosted_pro - hosted_pro - yes - Authorization - Authorized - 105 - payment_method:paypal_direct, paypal:hosted_solution - - - - - - - paypal_hosted_solution_action_sale - catalogProductSimple::order_default - default_frontend - guest - no - customer_US - Flat Rate - Fixed - hosted_pro - hosted_pro_action_sale - yes - Capture - captured - 105 - payment_method:paypal_direct, paypal:hosted_solution - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOrderWithOnlinePaymentsMethodsWithoutIFrameTest.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOrderWithOnlinePaymentsMethodsWithoutIFrameTest.php deleted file mode 100644 index a2cc00062c0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOrderWithOnlinePaymentsMethodsWithoutIFrameTest.php +++ /dev/null @@ -1,89 +0,0 @@ -objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - $this->customerAccountLogout = $customerAccountLogout; - } - - /** - * Create order with online payments methods without i-frame. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } - - /** - * Disable enabled config after test. - * - * @return void - */ - public function tearDown() - { - $this->customerAccountLogout->open(); - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => $this->currentVariation['arguments']['configData'], 'rollback' => true] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOrderWithOnlinePaymentsMethodsWithoutIFrameTest.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOrderWithOnlinePaymentsMethodsWithoutIFrameTest.xml deleted file mode 100644 index 52c0ce9aba8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOrderWithOnlinePaymentsMethodsWithoutIFrameTest.xml +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - paypal_payments_pro - catalogProductSimple::order_default - default_frontend - guest - no - customer_US - Flat Rate - Fixed - paypal_direct - payments_pro - Authorization - Authorized - 105 - payment_method:paypal, paypal:payments_pro - - - - - - - paypal_payments_pro - catalogProductSimple::order_default - default_frontend_new - login - customer_US_login - Flat Rate - Fixed - paypal_direct - payments_pro - Authorization - Authorized - 105 - payment_method:paypal, paypal:payments_pro - - - - - - - paypal_payments_pro_action_sale - catalogProductSimple::order_default - default_frontend_new - register - no - customer_US - Flat Rate - Fixed - paypal_direct - payments_pro - Capture - Captured - 105 - payment_method:paypal, paypal:payments_pro - - - - - - - paypal_payflow_pro - catalogProductSimple::order_default - default_frontend - guest - no - customer_US - Flat Rate - Fixed - verisign - default - Authorization - Authoriz - 105 - payment_method:paypal, paypal:payflow_pro - - - - - - - paypal_payflow_pro - catalogProductSimple::order_default - default_frontend_new - login - customer_US_login - Flat Rate - Fixed - verisign - default - Authorization - Authoriz - 105 - payment_method:paypal, paypal:payflow_pro - - - - - - - paypal_payflow_pro_action_sale - catalogProductSimple::order_default - default_frontend_new - register - no - customer_US - Flat Rate - Fixed - verisign - default - Capture - Captur - 105 - payment_method:paypal, paypal:payflow_pro - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOrderWithPayPalStandardTest.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOrderWithPayPalStandardTest.php deleted file mode 100644 index 87ea55a7556..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOrderWithPayPalStandardTest.php +++ /dev/null @@ -1,95 +0,0 @@ -objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - - // Create US tax rule - $taxRule = $fixtureFactory->createByCode('taxRule', ['dataset' => 'us_tax_rule']); - $taxRule->persist(); - } - - /** - * Create order with PayPal standard test. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } - - /** - * Disable enabled config after test. - * - * @return void - */ - public function tearDown() - { - // Rollback configuration. - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => $this->currentVariation['arguments']['configData'], 'rollback' => true] - )->run(); - } - - /** - * Delete all tax rules after test. - * - * @return void - */ - public static function tearDownAfterClass() - { - ObjectManager::getInstance()->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOrderWithPayPalStandardTest.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOrderWithPayPalStandardTest.xml deleted file mode 100644 index 3f7488d6d6c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOrderWithPayPalStandardTest.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - Simple product one page checkout within Pay Pal standard payment method - catalogProductSimple::order_default - paypal_standard - guest - customer_US - default_frontend - no - Flat Rate - Fixed - paypal_express - 113.25 - payment_method:paypal - paypal:standard - - - - - Bundle product one page checkout within Pay Pal standard payment method - bundleProduct::bundle_fixed_product - paypal_standard - guest - customer_US - default_frontend - no - Flat Rate - Fixed - paypal_express - 836.36 - payment_method:paypal, paypal:standard - - - - - Grouped product one page checkout within Pay Pal standard payment method - groupedProduct::three_simple_products_without_category - paypal_standard - guest - customer_US - default_frontend - no - Flat Rate - Fixed - paypal_express - 663.00 - payment_method:paypal, paypal:standard - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateShipmentForOnlinePaymentMethodsWithIFrameTest.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateShipmentForOnlinePaymentMethodsWithIFrameTest.php deleted file mode 100644 index 01e748df1cf..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateShipmentForOnlinePaymentMethodsWithIFrameTest.php +++ /dev/null @@ -1,88 +0,0 @@ - Orders. - * 5. Select created order in the grid and open it. - * 6. Click 'Ship' button. - * 7. Fill data according to dataset. - * 8. Click 'Submit Shipment' button. - * 9. Perform asserts. - * - * @group Payment_Methods_(CS), PayPal_(CS) - * @ZephyrId MPERF-7200 - */ -class CreateShipmentForOnlinePaymentMethodsWithIFrameTest extends Scenario -{ - /* tags */ - const TEST_TYPE = '3rd_party_test'; - /* end tags */ - - /** - * Customer logout page. - * - * @var CustomerAccountLogout - */ - protected $customerAccountLogout; - - /** - * Prepare environment for test. - * - * @param CustomerAccountLogout $customerAccountLogout - * @return void - */ - public function __prepare(CustomerAccountLogout $customerAccountLogout) - { - $this->objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - $this->customerAccountLogout = $customerAccountLogout; - } - - /** - * Create online invoice with online payments methods without i-frame. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } - - /** - * Disable included config after test. - * - * @return void - */ - public function tearDown() - { - $this->customerAccountLogout->open(); - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => $this->currentVariation['arguments']['configData'], 'rollback' => true] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateShipmentForOnlinePaymentMethodsWithIFrameTest.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateShipmentForOnlinePaymentMethodsWithIFrameTest.xml deleted file mode 100644 index 435faccedc0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateShipmentForOnlinePaymentMethodsWithIFrameTest.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - Create full shipment for paypal payflow link - catalogProductSimple::default - paypal_payflow_link - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - payflow_link - for_iframe - yes - comments for shipment - 3 - 3 - Processing - payment_method:paypal_direct, paypal:payflow_link - - - - - - - - - - Create full shipment for paypal advanced - catalogProductSimple::default - paypal_advanced - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - payflow_advanced - for_iframe - yes - comments for shipment - 3 - 3 - Processing - payment_method:paypal_direct, paypal:advanced - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateShipmentForOnlinePaymentMethodsWithoutIFrameTest.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateShipmentForOnlinePaymentMethodsWithoutIFrameTest.php deleted file mode 100644 index 0094e94ead9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateShipmentForOnlinePaymentMethodsWithoutIFrameTest.php +++ /dev/null @@ -1,88 +0,0 @@ - Orders. - * 5. Select created order in the grid and open it. - * 6. Click 'Ship' button. - * 7. Fill data according to dataset. - * 8. Click 'Submit Shipment' button. - * 9. Perform asserts. - * - * @group Payment_Methods_(CS), PayPal_(CS) - * @ZephyrId MPERF-7200 - */ -class CreateShipmentForOnlinePaymentMethodsWithoutIFrameTest extends Scenario -{ - /* tags */ - const TEST_TYPE = '3rd_party_test'; - /* end tags */ - - /** - * Customer logout page. - * - * @var CustomerAccountLogout - */ - protected $customerAccountLogout; - - /** - * Prepare environment for test. - * - * @param CustomerAccountLogout $customerAccountLogout - * @return void - */ - public function __prepare(CustomerAccountLogout $customerAccountLogout) - { - $this->objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - $this->customerAccountLogout = $customerAccountLogout; - } - - /** - * Create online invoice with online payments methods without i-frame. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } - - /** - * Disable enabled config after test. - * - * @return void - */ - public function tearDown() - { - $this->customerAccountLogout->open(); - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => $this->currentVariation['arguments']['configData'], 'rollback' => true] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateShipmentForOnlinePaymentMethodsWithoutIFrameTest.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateShipmentForOnlinePaymentMethodsWithoutIFrameTest.xml deleted file mode 100644 index 5974aed7bfc..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateShipmentForOnlinePaymentMethodsWithoutIFrameTest.xml +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - Create full shipment for paypal payments pro - catalogProductSimple::default - paypal_payments_pro - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - paypal_direct - payments_pro - comments for shipment - 3 - 3 - Processing - payment_method:paypal, paypal:payments_pro - - - - - - - - - - Create full shipment for paypal payments pro action sale - catalogProductSimple::default - paypal_payments_pro_action_sale - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - paypal_direct - payments_pro - comments for shipment - 3 - 3 - Complete - payment_method:paypal, paypal:payments_pro - - - - - - - - - - Create full shipment for paypal payflow pro - catalogProductSimple::5_dollar_product_for_payments - paypal_payflow_pro - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - verisign - default - comments for shipment - 3 - 3 - Processing - payment_method:paypal, paypal:payflow_pro - - - - - - - - - - Create full shipment for paypal payflow pro action sale - catalogProductSimple::5_dollar_product_for_payments - paypal_payflow_pro_action_sale - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - verisign - default - comments for shipment - 3 - 3 - Complete - payment_method:paypal, paypal:payflow_pro - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateShipmentForPaypalExpressCheckoutTest.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateShipmentForPaypalExpressCheckoutTest.php deleted file mode 100644 index 5fa67850d26..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateShipmentForPaypalExpressCheckoutTest.php +++ /dev/null @@ -1,44 +0,0 @@ - Orders. - * 7. Select created order in the grid and open it. - * 8. Click 'Ship' button. - * 9. Fill data according to dataset. - * 10. Click 'Submit Shipment' button. - * 11. Perform asserts. - * - * @group Payment_Methods_(CS), PayPal_(CS) - * @ZephyrId MPERF-7154 - */ -class CreateShipmentForPaypalExpressCheckoutTest extends AbstractCreateSalesEntityForPaypalExpressCheckoutTest -{ - /* tags */ - const TEST_TYPE = '3rd_party_test'; - /* end tags */ -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateShipmentForPaypalExpressCheckoutTest.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateShipmentForPaypalExpressCheckoutTest.xml deleted file mode 100644 index 0942a3155ce..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateShipmentForPaypalExpressCheckoutTest.xml +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - Create full shipment for paypal express checkout with line items mark require billing address - catalogProductSimple::default - paypal_express_order_line_items_mark_require_billing_address - Flat Rate/Fixed - comments for shipment - Custom Value - title - 199 - 3 - 3 - Processing - payment_method:paypal - - - - - - - - - - Create partial shipment for payflow express authorization line items - catalogProductSimple::order_default - payflow_express_authorization_line_items - Flat Rate/Fixed - 1 - comments for shipment - 1 - 1 - 1 - Processing - payment_method:paypal - - - - - - - - - Create full shipment for payflow express authorization specific country us - catalogProductSimple::default - payflow_express_authorization_specificcountry_us - Flat Rate/Fixed - comments for shipment - 3 - 3 - Processing - payment_method:paypal - - - - - - - - - - Create full shipment for payflow express sale - catalogProductSimple::default - payflow_express_sale - Flat Rate/Fixed - comments for shipment - 3 - 3 - Complete - payment_method:paypal - - - - - - - - - - Create full shipment for payflow express sale specific country gb line items - catalogProductSimple::default - payflow_express_sale_specificcountry_gb_line_items - Flat Rate/Fixed - comments for shipment - 3 - 3 - Processing - payment_method:paypal - - - - - - - - - - Create full shipment for paypal express sale specific country us shipping options mark - catalogProductSimple::default - paypal_express_sale_specificcountry_us_shipping_options_mark - Flat Rate/Fixed - comments for shipment - 3 - 3 - Processing - payment_method:paypal - - - - - - - - - - Create full shipment for paypal express sale specific country us shipping options mark - catalogProductSimple::default - paypal_express_sale_specificcountry_us_shipping_options_mark - Flat Rate/Fixed - comments for shipment - 3 - 3 - Processing - payment_method:paypal - - - - - - - - - - Create full shipment for paypal express sale specific country us shipping options mark with taxes and two products - catalogProductSimple::default,catalogProductSimple::default - default - paypal_express_sale_specificcountry_us_shipping_options_mark, tax_calculation_base_on_shipping_origin - Flat Rate/Fixed - comments for shipment - 6 - 6 - Processing - payment_method:paypal - - - - - - - - - - Create full shipment for paypal express sale specific country us shipping options mark with configurable product - configurableProduct::default - paypal_express_sale_specificcountry_us_shipping_options_mark - Flat Rate/Fixed - comments for shipment - 2 - 2 - Processing - payment_method:paypal - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/TestCreationForExpressCheckoutWithinPayPalButtonFromProductPageTest.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/TestCreationForExpressCheckoutWithinPayPalButtonFromProductPageTest.php deleted file mode 100644 index be5a72e8578..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/TestCreationForExpressCheckoutWithinPayPalButtonFromProductPageTest.php +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - Paypal express order line items mark require billing address - catalogProductSimple::default - active_sales_rule_for_all_groups - paypal_express_order_line_items_mark_require_billing_address - Flat Rate/Fixed - 315 - Processing - Authorization - - - Back, Edit, Cancel, Send Email, Void, Hold, Invoice, Ship - Authorized - payment_method:paypal - - - - - - - - - Payflow express authorization line items - catalogProductVirtual::order_default - active_sales_rule_for_all_groups - payflow_express_authorization_line_items - - - 100 - Processing - Authorization - - - Back, Edit, Cancel, Send Email, Void, Hold, Invoice - Authorized - payment_method:paypal - - - - - - - - Payflow express authorization specificcountry us - catalogProductVirtual::order_default_expensive - active_sales_rule_for_all_groups - payflow_express_authorization_specificcountry_us - - - 1000 - Processing - Authorization - - - Back, Edit, Cancel, Send Email, Void, Hold, Invoice - Authorized - payment_method:paypal - - - - - - - - Payflow express sale - catalogProductSimple::order_default - - - payflow_express_sale - Flat Rate/Fixed - 105 - Processing - Capture - Completed - Back, Edit, Send Email, Hold, Ship - Captured - 105 - 105 - payment_method:paypal - - - - - - - - - - Payflow express sale specificcountry gb line items - catalogProductSimple::order_default - - - payflow_express_sale_specificcountry_gb_line_items - Flat Rate/Fixed - 105 - Processing - Authorization - Completed - Back, Edit, Cancel, Send Email, Void, Hold, Invoice, Ship - Authorized - payment_method:paypal - - - - - - - - - Paypal express sale specificcountry us shipping options mark for simple product and without sales rule - catalogProductSimple::default - - - paypal_express_sale_specificcountry_us_shipping_options_mark - Flat Rate/Fixed - 315 - Processing - Authorization - Completed - Back, Edit, Cancel, Send Email, Void, Hold, Invoice, Ship - Authorized - payment_method:paypal - - - - - - - - - Paypal express sale specificcountry us shipping options mark for virtual product and with sales rule - catalogProductVirtual::order_default_expensive - active_sales_rule_for_all_groups - paypal_express_sale_specificcountry_us_shipping_options_mark - - - 1000 - Processing - Authorization - Completed - Back, Edit, Cancel, Send Email, Void, Hold, Invoice - Authorized - payment_method:paypal - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/TestCreationForExpressCheckoutWithinPayPalButtonTest.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/TestCreationForExpressCheckoutWithinPayPalButtonTest.php deleted file mode 100644 index 015f0d3003b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/TestCreationForExpressCheckoutWithinPayPalButtonTest.php +++ /dev/null @@ -1,82 +0,0 @@ -objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - $paypalCustomer = $fixtureFactory->create('Mage\Paypal\Test\Fixture\PaypalCustomer', ['dataset' => 'default']); - - return ['paypalCustomer' => $paypalCustomer]; - } - - /** - * Runs one page checkout test. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } - - /** - * Disable enabled config and delete all sales, tax and catalog rules after test. - * - * @return void - */ - public function tearDown() - { - $this->objectManager->create('\Mage\SalesRule\Test\TestStep\DeleteAllSalesRuleStep')->run(); - $this->objectManager->create('\Mage\CatalogRule\Test\TestStep\DeleteAllCatalogRulesStep')->run(); - $this->objectManager->create('\Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => $this->currentVariation['arguments']['configData'], 'rollback' => true] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/TestCreationForExpressCheckoutWithinPayPalButtonTest.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/TestCreationForExpressCheckoutWithinPayPalButtonTest.xml deleted file mode 100644 index 6894f3d0069..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/TestCreationForExpressCheckoutWithinPayPalButtonTest.xml +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - catalogProductVirtual::order_default,catalogProductSimple::default - active_sales_rule_for_all_groups - paypal_express_order_line_items_mark_require_billing_address - Flat Rate/Fixed - 215 - Processing - Authorization - - - Back, Edit, Cancel, Send Email, Void, Hold, Invoice, Ship - Authorized - payment_method:paypal - - - - - - - - - catalogProductVirtual::order_default,catalogProductSimple::order_default - active_sales_rule_for_all_groups - payflow_express_authorization_line_items - Flat Rate/Fixed - 105 - Processing - Authorization - - - Back, Edit, Cancel, Send Email, Void, Hold, Invoice, Ship - Authorized - payment_method:paypal - - - - - - - - - catalogProductVirtual::order_default_expensive - active_sales_rule_for_all_groups - payflow_express_authorization_specificcountry_us - - - 500 - Processing - Authorization - - - Back, Edit, Cancel, Send Email, Void, Hold, Invoice - Authorized - payment_method:paypal - - - - - - - - catalogProductSimple::order_default - - - payflow_express_sale - Flat Rate/Fixed - 105 - Processing - Capture - Completed - Back, Edit, Send Email, Hold, Ship - Captured - 105 - 105 - payment_method:paypal - - - - - - - - - - catalogProductVirtual::order_default,catalogProductSimple::order_default - - - payflow_express_sale_specificcountry_gb_line_items - Flat Rate/Fixed - 205 - Processing - Authorization - Completed - Back, Edit, Cancel, Send Email, Void, Hold, Invoice, Ship - Authorized - payment_method:paypal - - - - - - - - - catalogProductSimple::default - - - paypal_express_sale_specificcountry_us_shipping_options_mark - Flat Rate/Fixed - 315 - Processing - Authorization - Completed - Back, Edit, Cancel, Send Email, Void, Hold, Invoice, Ship - Authorized - payment_method:paypal - - - - - - - - - catalogProductVirtual::order_default_expensive - active_sales_rule_for_all_groups - paypal_express_sale_specificcountry_us_shipping_options_mark - - - 500 - Processing - Authorization - Completed - Back, Edit, Cancel, Send Email, Void, Hold, Invoice - Authorized - payment_method:paypal - - - - - - - - With two product and taxes - catalogProductSimple::default,configurableProduct::default - for_all_states - paypal_express_sale_specificcountry_us_shipping_options_mark, tax_calculation_base_on_shipping_origin - Flat Rate/Fixed - 696.15 - Processing - Authorization - Completed - Back, Edit, Cancel, Send Email, Void, Hold, Invoice, Ship - Authorized - payment_method:paypal - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestStep/CheckoutWithPayPalFromProductPageStep.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestStep/CheckoutWithPayPalFromProductPageStep.php deleted file mode 100644 index bef9276767e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestStep/CheckoutWithPayPalFromProductPageStep.php +++ /dev/null @@ -1,71 +0,0 @@ -catalogProductView = $catalogProductView; - $this->products = $products; - $this->browser = $browser; - } - - /** - * Pay Pal checkout from product page. - * - * @return void - */ - public function run() - { - $this->browser->open($_ENV['app_frontend_url'] . $this->products[0]->getUrlKey() . '.html'); - $this->catalogProductView->getPaypalViewBlock()->paypalCheckout($this->products[0]); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestStep/CheckoutWithPayPalStep.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestStep/CheckoutWithPayPalStep.php deleted file mode 100644 index a4344382e08..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestStep/CheckoutWithPayPalStep.php +++ /dev/null @@ -1,51 +0,0 @@ -checkoutCart = $checkoutCart; - } - - /** - * Checkout with Pay Pal. - * - * @return void - */ - public function run() - { - $this->checkoutCart->getCartBlock()->getExpressShortcutBlock()->checkoutWithPayPal(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestStep/ContinuePayPalCheckoutStep.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestStep/ContinuePayPalCheckoutStep.php deleted file mode 100644 index 80a59d5dc85..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestStep/ContinuePayPalCheckoutStep.php +++ /dev/null @@ -1,112 +0,0 @@ -paypalPage = $paypalPage; - $this->checkoutOnepageSuccess = $checkoutOnepageSuccess; - $this->customer = $paypalCustomer; - } - - /** - * Continue Pay Pal checkout. - * - * @return array|null - */ - public function run() - { - $reviewBlockIsPresent = false; - $sleepingTime = 0; - while (!$reviewBlockIsPresent and $sleepingTime <= 60) { - sleep(1); - $reviewBlockIsPresent = $this->paypalPage->getReviewBlock()->isVisible() - || $this->paypalPage->getOldReviewBlock()->isVisible(); - $sleepingTime++; - } - $this->reviewBlock = $this->paypalPage->getReviewBlock()->isVisible() - ? $this->paypalPage->getReviewBlock() - : $this->paypalPage->getOldReviewBlock(); - $this->selectCustomerAddress($this->customer); - $this->reviewBlock->continueCheckout(); - $successBlock = $this->checkoutOnepageSuccess->getSuccessBlock(); - - return ['orderId' => $successBlock->isVisible() ? $successBlock->getGuestOrderId() : null]; - } - - /** - * Select customer address. - * - * @param PaypalCustomer $customer - * @return void - */ - protected function selectCustomerAddress(PaypalCustomer $customer) - { - if ($this->reviewBlock->checkChangeAddressAbility()) { - $address = $customer->getDataFieldConfig('address')['source']->getAddresses()[0]; - $this->reviewBlock->getAddressesBlock()->selectAddress($address); - $this->reviewBlock->waitLoader(); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestStep/FillCreditCardInIFrameStep.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestStep/FillCreditCardInIFrameStep.php deleted file mode 100644 index 796070a49a5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestStep/FillCreditCardInIFrameStep.php +++ /dev/null @@ -1,108 +0,0 @@ -checkoutOnepage = $checkoutOnepage; - $this->checkoutOnepageSuccess = $checkoutOnepageSuccess; - $this->browser = $browser; - if (isset($payment['cc']) && !($payment['cc'] instanceof Cc)) { - $payment['cc'] = $fixtureFactory->create('Mage\Payment\Test\Fixture\Cc', ['dataset' => $payment['cc']]); - } - $this->payment = $payment; - } - - /** - * Fill credit card in i-frame step. - * - * @return array - */ - public function run() - { - $this->checkoutOnepage->getReviewBlock()->clickContinue(); - $this->browser->switchToFrame(new Locator($this->iFrameSelector)); - $methodName = 'get' . str_replace(' ', '', ucwords(str_replace('_', ' ', $this->payment['method']))) . 'Form'; - $form = $this->checkoutOnepage->$methodName(); - $element = $this->browser->find('body'); - $form->fill($this->payment['cc'], $element); - $form->clickPayNow($element); - $this->browser->switchToFrame(); - - return ['orderId' => $this->checkoutOnepageSuccess->getSuccessBlock()->getGuestOrderId()]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestStep/LoginToPayPalStep.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestStep/LoginToPayPalStep.php deleted file mode 100644 index e846a25a8cd..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestStep/LoginToPayPalStep.php +++ /dev/null @@ -1,115 +0,0 @@ -browser = $browser; - $this->paypalPage = $paypalPage; - $this->customer = $paypalCustomer; - } - - /** - * Login to Pay Pal. - * - * @return void - */ - public function run() - { - $reviewBlockIsPresent = false; - $sleepingTime = 0; - while (!$reviewBlockIsPresent and $sleepingTime <= 60) - { - sleep(1); - $reviewBlockIsPresent = $this->paypalPage->getReviewBlock()->isVisible() - || $this->paypalPage->getOldReviewBlock()->isVisible(); - $sleepingTime++; - } - /** Log out from previous session. */ - $reviewBlock = $this->paypalPage->getReviewBlock()->isVisible() - ? $this->paypalPage->getReviewBlock() - : $this->paypalPage->getOldReviewBlock(); - $reviewBlock->logOut(); - - $reviewBlock->waitLoader(); - $payPalLoginBlock = $this->getActualBlock(); - $payPalLoginBlock->fill($this->customer); - $payPalLoginBlock->submit(); - $payPalLoginBlock->switchOffPayPalFrame(); - $reviewBlock->waitLoader(); - } - - /** - * Returns actual login block by selector - * - * @return \Mage\Paypal\Test\Block\NewLogin|\Mage\Paypal\Test\Block\Login|\Mage\Paypal\Test\Block\OldLogin - */ - protected function getActualBlock() - { - if ($this->paypalPage->getNewLoginBlock()->isBlockActive()) { - $returnBlock = $this->paypalPage->getNewLoginBlock(); - } elseif ($this->paypalPage->getLoginBlock()->isBlockActive()) { - $returnBlock = $this->paypalPage->getLoginBlock(); - } else { - $returnBlock = $this->paypalPage->getOldLoginBlock(); - } - return $returnBlock; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestStep/PlaceOrderStep.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestStep/PlaceOrderStep.php deleted file mode 100644 index aba78df2e63..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestStep/PlaceOrderStep.php +++ /dev/null @@ -1,78 +0,0 @@ -paypalExpressReview = $paypalExpressReview; - $this->checkoutOnepageSuccess = $checkoutOnepageSuccess; - $this->shippingMethod = $shippingMethod; - } - - /** - * Place order after checking order totals on review step. - * - * @return array - */ - public function run() - { - $orderReviewBlock = $this->paypalExpressReview->getReviewBlock(); - if ('-' !== $this->shippingMethod) { - $orderReviewBlock->selectShippingMethod($this->shippingMethod); - } - $orderReviewBlock->placeOrder(); - return ['orderId' => $this->checkoutOnepageSuccess->getSuccessBlock()->getGuestOrderId()]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/etc/testcase.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/etc/testcase.xml deleted file mode 100644 index 09523f332d2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/etc/testcase.xml +++ /dev/null @@ -1,243 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Rating/Test/Constraint/AssertProductRatingInProductPage.php b/dev/tests/functional/tests/app/Mage/Rating/Test/Constraint/AssertProductRatingInProductPage.php deleted file mode 100644 index 68c384f2972..00000000000 --- a/dev/tests/functional/tests/app/Mage/Rating/Test/Constraint/AssertProductRatingInProductPage.php +++ /dev/null @@ -1,73 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - $catalogProductView->getViewBlock()->openCustomInformationTab('Reviews'); - $catalogProductView->getReviewsBlock()->clickAddReviewLink(); - $reviewForm = $reviewProductList->getReviewFormBlock(); - $ratings = $review->getDataFieldConfig('ratings')['source']->getRatings(); - foreach($ratings as $rating){ - \PHPUnit_Framework_Assert::assertTrue( - $reviewForm->isVisibleRating($rating), - 'Product rating "' . $rating->getRatingCode() . '" is not displayed on review product page.' - ); - } - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product rating is displayed on review product page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Rating/Test/Constraint/AssertProductRatingOnReviewPage.php b/dev/tests/functional/tests/app/Mage/Rating/Test/Constraint/AssertProductRatingOnReviewPage.php deleted file mode 100644 index 26fbf0a6e43..00000000000 --- a/dev/tests/functional/tests/app/Mage/Rating/Test/Constraint/AssertProductRatingOnReviewPage.php +++ /dev/null @@ -1,63 +0,0 @@ -open(); - $reviewIndex->getReviewGrid()->searchAndOpen(['title' => $review->getTitle()]); - $ratingReview = $this->sortDataByPath($review->getRatings(), '::title'); - $ratingForm = $this->sortDataByPath($reviewEdit->getReviewForm()->getData()['ratings'], '::title'); - $error = $this->verifyData($ratingReview, $ratingForm); - - \PHPUnit_Framework_Assert::assertEmpty($error, $error); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product rating is displayed on edit review page(backend).'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Rating/Test/Fixture/Rating.xml b/dev/tests/functional/tests/app/Mage/Rating/Test/Fixture/Rating.xml deleted file mode 100644 index 7dce3dcafda..00000000000 --- a/dev/tests/functional/tests/app/Mage/Rating/Test/Fixture/Rating.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Rating/Test/Fixture/Rating/Stores.php b/dev/tests/functional/tests/app/Mage/Rating/Test/Fixture/Rating/Stores.php deleted file mode 100644 index 3bf16c0e42e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Rating/Test/Fixture/Rating/Stores.php +++ /dev/null @@ -1,112 +0,0 @@ - 'Main Website/Main Website Store/Default Store View'] - * - * @var array - */ - protected $data = []; - - /** - * The created stores. - * - * @var Store[] - */ - protected $stores = []; - - /** - * @constructor - * @param FixtureFactory $fixtureFactory - * @param array $params - * @param array $data [optional] - */ - public function __construct(FixtureFactory $fixtureFactory, array $params, array $data = []) - { - $this->params = $params; - if (isset($data['datasets'])) { - $datasets = explode(',', $data['datasets']); - foreach ($datasets as $dataset) { - /** @var Store $store */ - $store = $fixtureFactory->createByCode('store', ['dataset' => $dataset]); - if (!$store->hasData('store_id')) { - $store->persist(); - } - $this->stores[] = $store; - $this->data[] = $store->getGroupId() . '/' . $store->getName(); - } - } - } - - /** - * Persist data. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return id of the created entity. - * - * @param string|null $key [optional] - * @return int - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings. - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Get stores. - * - * @return array - */ - public function getStores() - { - return $this->stores; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Rating/Test/Handler/Curl.php b/dev/tests/functional/tests/app/Mage/Rating/Test/Handler/Curl.php deleted file mode 100644 index 5758832f6a7..00000000000 --- a/dev/tests/functional/tests/app/Mage/Rating/Test/Handler/Curl.php +++ /dev/null @@ -1,110 +0,0 @@ - 1, - ]; - - /** - * Rating options. - * - * @var array - */ - protected $options = [ - 'add_1' => 1, - 'add_2' => 2, - 'add_3' => 3, - 'add_4' => 4, - 'add_5' => 5, - ]; - - /** - * Post request for creating product Rating in backend. - * - * @param FixtureInterface|null $rating - * @return array - * @throws \Exception - */ - public function persist(FixtureInterface $rating = null) - { - $url = $_ENV['app_backend_url'] . 'rating/save'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $data = $this->replaceMappingData($this->prepareData($rating->getData())); - $curl->write($url, $data); - $response = $curl->read(); - $curl->close(); - if (!strpos($response, 'class="success-msg"')) { - throw new \Exception( - 'Product Rating entity creating by curl handler was not successful! Response:' . $response - ); - } - - return ['rating_id' => $this->getProductRatingId()]; - } - - /** - * Prepare POST data for creating rating request. - * - * @param array $data - * @return array - */ - protected function prepareData(array $data) - { - if (isset($data['stores'])) { - foreach ($data['stores'] as $key => $store) { - if (isset($this->mappingStores[$store])) { - $data['stores'][$key] = $this->mappingStores[$store]; - } - } - } - $data['option_title'] = $this->options; - - return $data; - } - - /** - * Get product Rating id. - * - * @return mixed - */ - protected function getProductRatingId() - { - $url = 'rating/index/sort/rating_id/dir/desc/'; - $regex = '`rating\/edit\/id\/(\d+)`'; - $extractor = new Extractor($url, $regex); - $match = $extractor->getData(); - - return empty($match[1]) ? null : $match[1]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Rating/Test/Handler/RatingInterface.php b/dev/tests/functional/tests/app/Mage/Rating/Test/Handler/RatingInterface.php deleted file mode 100644 index e2de80ef206..00000000000 --- a/dev/tests/functional/tests/app/Mage/Rating/Test/Handler/RatingInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Rating/Test/Page/Adminhtml/RatingIndex.xml b/dev/tests/functional/tests/app/Mage/Rating/Test/Page/Adminhtml/RatingIndex.xml deleted file mode 100644 index c126eaee418..00000000000 --- a/dev/tests/functional/tests/app/Mage/Rating/Test/Page/Adminhtml/RatingIndex.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Rating/Test/Repository/Rating.xml b/dev/tests/functional/tests/app/Mage/Rating/Test/Repository/Rating.xml deleted file mode 100644 index 119c88db479..00000000000 --- a/dev/tests/functional/tests/app/Mage/Rating/Test/Repository/Rating.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - rating_%isolation% - - default - - Yes - - - diff --git a/dev/tests/functional/tests/app/Mage/Rating/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Mage/Rating/Test/etc/curl/di.xml deleted file mode 100644 index c1fea638c83..00000000000 --- a/dev/tests/functional/tests/app/Mage/Rating/Test/etc/curl/di.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/Block/Product/View.php b/dev/tests/functional/tests/app/Mage/Review/Test/Block/Product/View.php deleted file mode 100644 index edcedb508bb..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/Block/Product/View.php +++ /dev/null @@ -1,58 +0,0 @@ -_rootElement->find($this->viewReviewLinkSelector); - } - - /** - * Get 'add review link'. - * - * @return ElementInterface - */ - public function getAddReviewLink() - { - return $this->_rootElement->find($this->addReviewLinkSelector); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/Block/Product/View/Form.php b/dev/tests/functional/tests/app/Mage/Review/Test/Block/Product/View/Form.php deleted file mode 100644 index 5675e89054e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/Block/Product/View/Form.php +++ /dev/null @@ -1,124 +0,0 @@ -_rootElement->find($this->submit)->click(); - } - - /** - * Fill the root form. - * - * @param FixtureInterface $review - * @param SimpleElement|null $element - * @return $this - */ - public function fill(FixtureInterface $review, SimpleElement $element = null) - { - if ($review->hasData('ratings')) { - $this->fillRatings($review); - } - return parent::fill($review, $element); - } - - /** - * Fill ratings on the review form. - * - * @param ReviewFixture $review - * @return void - */ - protected function fillRatings(ReviewFixture $review) - { - $ratingsData = $review->getRatings(); - $ratingsFixture = $review->getDataFieldConfig('ratings')['source']->getRatings(); - foreach ($ratingsData as $key => $value) { - $this->setRating($ratingsFixture[$key], $value['rating']); - } - } - - /** - * Set rating vote by rating code. - * - * @param Rating $rating - * @param int $ratingVote - * @return void - */ - protected function setRating(Rating $rating, $ratingVote) - { - $ratingValueSelector = sprintf($this->ratingVoteLabel, $rating->getRatingCode(), $ratingVote); - $this->getRating($rating)->find($ratingValueSelector, Locator::SELECTOR_CSS, 'checkbox')->setValue('Yes'); - } - - /** - * Check rating element is visible. - * - * @param Rating $rating - * @return bool - */ - public function isVisibleRating(Rating $rating) - { - return $this->getRating($rating)->isVisible(); - } - - /** - * Get single product rating. - * - * @param Rating $rating - * @return SimpleElement - */ - protected function getRating(Rating $rating) - { - return $this->_rootElement->find(sprintf($this->rating, $rating->getRatingCode()), Locator::SELECTOR_XPATH); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/Block/Product/View/Form.xml b/dev/tests/functional/tests/app/Mage/Review/Test/Block/Product/View/Form.xml deleted file mode 100644 index 7a92c769959..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/Block/Product/View/Form.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - #review_field - - - <selector>#summary_field</selector> - - - #nickname_field - - - diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/Block/Product/View/Review.php b/dev/tests/functional/tests/app/Mage/Review/Test/Block/Product/View/Review.php deleted file mode 100644 index f83f498981a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/Block/Product/View/Review.php +++ /dev/null @@ -1,246 +0,0 @@ -getAddReviewLink()->click(); - } - - /** - * Is visible review items. - * - * @return bool - */ - public function isVisibleReviewItems() - { - return $this->_rootElement->find($this->itemsSelector)->isVisible(); - } - - /** - * Get add review link. - * - * @return ElementInterface - */ - public function getAddReviewLink() - { - return $this->_rootElement->find($this->addReviewLink); - } - - /** - * Get all reviews. - * - * @return array - */ - public function getItems() - { - $items = []; - if (!$this->_rootElement->find($this->itemsSelector)->isVisible()) { - return []; - } - $reviewsTitles = $this->_rootElement->getElements($this->itemsSelector); - foreach ($reviewsTitles as $title) { - $reviewTitle = $this->getReviewTitle($title);; - $items[] = [ - 'title' => $reviewTitle, - 'detail' => $this->getReviewText($reviewTitle), - 'nickname' => $this->getReviewAuthor($reviewTitle), - 'ratings' => $this->getReviewRatings($reviewTitle) - ]; - } - - return $items; - } - - /** - * Get review ratings. - * - * @param string $reviewTitle - * @return array|null - */ - protected function getReviewRatings($reviewTitle) - { - $ratings = []; - $ratingsSelector = $this->getRatingsSelector($reviewTitle); - if (!$this->_rootElement->find($ratingsSelector, Locator::SELECTOR_XPATH)->isVisible()) { - return null; - } - $ratingsElements = $this->_rootElement->getElements($ratingsSelector, Locator::SELECTOR_XPATH); - foreach ($ratingsElements as $itemRating) { - $ratings[] = [ - 'title' => strtolower($itemRating->getText()), - 'rating' => $this->getRatingValue($itemRating) - ]; - } - - return $ratings; - } - - /** - * Get ratings selector. - * - * @param string $reviewTitle - * @return string - */ - protected function getRatingsSelector($reviewTitle) - { - return $this->getReviewSelector($reviewTitle, 'Ratings'); - } - - /** - * Get rating value. - * - * @param ElementInterface $itemRating - * @return string - */ - protected function getRatingValue(ElementInterface $itemRating) - { - $ratingValue = $itemRating->find($this->ratingValue)->getAttribute('style'); - preg_match('`(\d+)%`', $ratingValue, $matches); - return isset($matches[1]) ? $matches[1] / 20 : null; - } - - /** - * Get review's title. - * - * @param ElementInterface $titleElement - * @return string - */ - protected function getReviewTitle(ElementInterface $titleElement) - { - return strtolower($titleElement->getText()); - } - - /** - * Get review's author. - * - * @param string $reviewTitle - * @return string - */ - protected function getReviewAuthor($reviewTitle) - { - $reviewAuthor = $this->_rootElement->find($this->getReviewAuthorSelector($reviewTitle), Locator::SELECTOR_XPATH) - ->getText(); - - return strtolower(trim(str_replace('REVIEW BY', '', explode('/', $reviewAuthor)[0]))); - } - - /** - * Get review's text. - * - * @param string $reviewTitle - * @return string - */ - protected function getReviewText($reviewTitle) - { - $reviewText = $this->_rootElement->find($this->getReviewTextSelector($reviewTitle), Locator::SELECTOR_XPATH) - ->getText(); - return explode("\n", $reviewText)[0]; - } - - /** - * Get review text selector. - * - * @param string $reviewTitle - * @return string - */ - protected function getReviewTextSelector($reviewTitle) - { - return $this->getReviewSelector($reviewTitle, 'Text'); - } - - /** - * Get review author selector. - * - * @param string $reviewTitle - * @return string - */ - protected function getReviewAuthorSelector($reviewTitle) - { - return $this->getReviewSelector($reviewTitle, 'Author'); - } - - /** - * Get review entity selector. - * - * @param string $reviewTitle - * @param string $type - * @return string - */ - protected function getReviewSelector($reviewTitle, $type) - { - $property = 'item' . $type; - $specifySelector = property_exists($this, $property) ? $this->$property : ''; - return sprintf($this->itemRowSelector . $specifySelector, $reviewTitle); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertProductReviewForm.php b/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertProductReviewForm.php deleted file mode 100644 index a6b4c83bc22..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertProductReviewForm.php +++ /dev/null @@ -1,91 +0,0 @@ -open(); - $reviewIndex->getReviewGrid()->searchAndOpen(['title' => $review->getTitle()]); - $fixtureData = $this->prepareFixtureData($review, $status); - $formData = $reviewEdit->getReviewForm()->getData(); - $error = $this->verifyData($fixtureData, $formData); - - \PHPUnit_Framework_Assert::assertEmpty($error, $error); - } - - /** - * Prepare fixture data. - * - * @param Review $review - * @param string $status - * @return array - */ - protected function prepareFixtureData(Review $review, $status) - { - $reviewData = $review->getData(); - if ($status !== '') { - $reviewData['status_id'] = $status; - } - - return $reviewData; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Review data equals passed from fixture on edit page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertProductReviewInGrid.php b/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertProductReviewInGrid.php deleted file mode 100644 index 047b19fef9f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertProductReviewInGrid.php +++ /dev/null @@ -1,111 +0,0 @@ -open(); - $filter = $this->prepareFilter($product, $review->getData(), $gridStatus); - \PHPUnit_Framework_Assert::assertTrue( - $reviewIndex->getReviewGrid()->isRowVisible($filter), - 'Review is absent in Review grid.' - ); - } - - /** - * Prepare filter for assert - * - * @param InjectableFixture $product - * @param array $review - * @param string $gridStatus [optional] - * @return array - */ - public function prepareFilter(InjectableFixture $product, array $review, $gridStatus = '') - { - $filter = []; - foreach ($this->filter as $field) { - switch ($field) { - case 'name': - case 'sku': - $value = $product->getData($field); - break; - case 'status_id': - $value = $gridStatus !== '' ? $gridStatus : (isset($review[$field]) ? $review[$field] : null); - break; - default: - $value = isset($review[$field]) ? $review[$field] : null; - break; - } - if ($value !== null) { - $filter += [$field => $value]; - } - } - return $filter; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Review is present in grid on product reviews tab.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertProductReviewIsAbsentOnProductPage.php b/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertProductReviewIsAbsentOnProductPage.php deleted file mode 100644 index a02d5fdb177..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertProductReviewIsAbsentOnProductPage.php +++ /dev/null @@ -1,85 +0,0 @@ -catalogProductView = $catalogProductView; - } - - /** - * Assert that product doesn't have a review on product page. - * - * @return void - */ - public function processAssert() - { - $this->catalogProductView->getViewBlock()->openCustomInformationTab('Reviews'); - - \PHPUnit_Framework_Assert::assertFalse( - $this->catalogProductView->getReviewsBlock()->isVisibleReviewItems(), - 'No reviews below the form required.' - ); - \PHPUnit_Framework_Assert::assertEquals( - self::NO_REVIEW_LINK_TEXT, - trim($this->catalogProductView->getReviewsBlock()->getAddReviewLink()->getText()), - sprintf('"%s" link is not available', self::NO_REVIEW_LINK_TEXT) - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product do not have a review on product page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertProductReviewOnProductPage.php b/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertProductReviewOnProductPage.php deleted file mode 100644 index 8335fce4bb3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertProductReviewOnProductPage.php +++ /dev/null @@ -1,79 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - $reviewBlock = $catalogProductView->getReviewsBlock(); - $catalogProductView->getViewBlock()->openCustomInformationTab('Reviews'); - $formReview = $reviewBlock->getItems()[0]; - $fixtureReview = $this->prepareReview($review); - $errors = $this->verifyData($fixtureReview, $formReview); - - \PHPUnit_Framework_Assert::assertEmpty($errors, $errors); - } - - /** - * Prepare fixture review data. - * - * @param Review $review - * @return array - */ - protected function prepareReview(Review $review) - { - return [ - 'title' => $review->getTitle(), - 'detail' => $review->getDetail(), - 'nickname' => $review->getNickname(), - 'ratings' => $review->getRatings() - ]; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product review is displayed correct.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertReviewCreationSuccessMessage.php b/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertReviewCreationSuccessMessage.php deleted file mode 100644 index 359657df0db..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertReviewCreationSuccessMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Review success create message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertReviewLinksIsPresentOnProductPage.php b/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertReviewLinksIsPresentOnProductPage.php deleted file mode 100644 index 2c876bf639c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertReviewLinksIsPresentOnProductPage.php +++ /dev/null @@ -1,81 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - - // Verify add review link - \PHPUnit_Framework_Assert::assertTrue( - $catalogProductView->getReviewViewBlock()->getAddReviewLink()->isVisible(), - 'Add review link is not visible on product page.' - ); - - // Verify view review link - $viewReviewLink = $catalogProductView->getReviewViewBlock()->getViewReviewLink($review); - \PHPUnit_Framework_Assert::assertTrue( - $viewReviewLink->isVisible(), - 'View review link is not visible on product page.' - ); - \PHPUnit_Framework_Assert::assertContains( - '1', - $viewReviewLink->getText(), - 'There is more than 1 approved review.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Add and view review links are present on product page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertReviewSuccessSaveMessage.php b/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertReviewSuccessSaveMessage.php deleted file mode 100644 index cc39dcb7d45..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertReviewSuccessSaveMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Review success save message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertSetApprovedProductReview.php b/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertSetApprovedProductReview.php deleted file mode 100644 index be7bcf5442a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertSetApprovedProductReview.php +++ /dev/null @@ -1,69 +0,0 @@ -open()->getReviewGrid()->searchAndOpen(['title' => $review->getTitle()]); - $reviewEdit->getReviewForm()->setApproveReview(); - $reviewEdit->getFormPageActions()->save(); - $assertReviewSuccessSaveMessage->processAssert($reviewIndex); - $cachePage->open()->getPageActions()->flushCacheStorage(); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Review status is change to approve.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/Fixture/Review.xml b/dev/tests/functional/tests/app/Mage/Review/Test/Fixture/Review.xml deleted file mode 100644 index 23fa5efca90..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/Fixture/Review.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/Fixture/Review/EntityId.php b/dev/tests/functional/tests/app/Mage/Review/Test/Fixture/Review/EntityId.php deleted file mode 100644 index 109ac49e8cb..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/Fixture/Review/EntityId.php +++ /dev/null @@ -1,108 +0,0 @@ -params = $params; - if (isset($data['dataset'])) { - list($typeFixture, $dataset) = explode('::', $data['dataset']); - $fixture = $fixtureFactory->createByCode($typeFixture, ['dataset' => $dataset]); - if (!$fixture->hasData('id')) { - $fixture->persist(); - } - $this->entity = $fixture; - $this->data = $fixture->getId(); - } - } - - /** - * Persist data. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return id of the created entity. - * - * @param string|null $key [optional] - * @return int - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings. - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Get entity. - * - * @return FixtureInterface|null - */ - public function getEntity() - { - return $this->entity; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/Fixture/Review/Ratings.php b/dev/tests/functional/tests/app/Mage/Review/Test/Fixture/Review/Ratings.php deleted file mode 100644 index 8b296eab89a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/Fixture/Review/Ratings.php +++ /dev/null @@ -1,73 +0,0 @@ -params = $params; - /** @var Rating $fixtureRating */ - $fixtureRating = null; - foreach ($data as $rating) { - if (isset($rating['dataset'])) { - $fixtureRating = $fixtureFactory->createByCode('rating', ['dataset' => $rating['dataset']]); - if (!$fixtureRating->hasData('rating_id')) { - $fixtureRating->persist(); - } - } elseif (isset($rating['fixtureRating']) && $rating['fixtureRating'] instanceof Rating) { - $fixtureRating = $rating['fixtureRating']; - } - if ($fixtureRating != null) { - $this->ratings[] = $fixtureRating; - $this->data[] = [ - 'title' => $fixtureRating->getRatingCode(), - 'rating' => $rating['rating'] - ]; - } - } - } - - /** - * Get ratings. - * - * @return array - */ - public function getRatings() - { - return $this->ratings; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/Page/Adminhtml/CatalogProductReview.xml b/dev/tests/functional/tests/app/Mage/Review/Test/Page/Adminhtml/CatalogProductReview.xml deleted file mode 100644 index bb25089eb0b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/Page/Adminhtml/CatalogProductReview.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/Page/Adminhtml/CatalogProductReviewEdit.xml b/dev/tests/functional/tests/app/Mage/Review/Test/Page/Adminhtml/CatalogProductReviewEdit.xml deleted file mode 100644 index 7d0809d068a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/Page/Adminhtml/CatalogProductReviewEdit.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/Page/Product/CatalogProductView.xml b/dev/tests/functional/tests/app/Mage/Review/Test/Page/Product/CatalogProductView.xml deleted file mode 100644 index dd7880c7b47..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/Page/Product/CatalogProductView.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/Page/Product/ReviewProductList.xml b/dev/tests/functional/tests/app/Mage/Review/Test/Page/Product/ReviewProductList.xml deleted file mode 100644 index 0720aa78a5d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/Page/Product/ReviewProductList.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/TestCase/CreateProductReviewFrontendEntityTest.php b/dev/tests/functional/tests/app/Mage/Review/Test/TestCase/CreateProductReviewFrontendEntityTest.php deleted file mode 100644 index 9548536c3d9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/TestCase/CreateProductReviewFrontendEntityTest.php +++ /dev/null @@ -1,56 +0,0 @@ -executeScenario(); - } - - /** - * Delete all ratings after test. - * - * @return void - */ - public function tearDown() - { - $this->objectManager->create('Mage\Review\Test\TestStep\DeleteAllRatingsStep')->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/TestCase/CreateProductReviewFrontendEntityTest.xml b/dev/tests/functional/tests/app/Mage/Review/Test/TestCase/CreateProductReviewFrontendEntityTest.xml deleted file mode 100644 index fde9c87667e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/TestCase/CreateProductReviewFrontendEntityTest.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - Create product review with rating - Guest - name_%isolation% - title_%isolation% - review_%isolation% - visibleOnDefaultWebsite - 4 - catalogProductSimple::default - true - Pending - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/TestStep/AddFrontendReviewStep.php b/dev/tests/functional/tests/app/Mage/Review/Test/TestStep/AddFrontendReviewStep.php deleted file mode 100644 index 2b97dd452e0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/TestStep/AddFrontendReviewStep.php +++ /dev/null @@ -1,117 +0,0 @@ -catalogProductView = $catalogProductView; - $this->reviewProductList = $reviewProductList; - $this->review = $review; - $this->browser = $browser; - $this->assertProductReviewIsAbsentOnProductPage = $assertProductReviewIsAbsentOnProductPage; - $this->isFirstReview = $isFirstReview; - } - - /** - * Add review to product via frontend. - * - * @return array - */ - public function run() - { - $product = $this->review->getDataFieldConfig('entity_id')['source']->getEntity(); - $this->browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - if ($this->isFirstReview) { - $this->assertProductReviewIsAbsentOnProductPage->processAssert(); - } - $this->catalogProductView->getViewBlock()->openCustomInformationTab('Reviews'); - $this->catalogProductView->getReviewsBlock()->clickAddReviewLink(); - $reviewForm = $this->reviewProductList->getReviewFormBlock(); - $reviewForm->fill($this->review); - $reviewForm->submit(); - - return ['product' => $product, 'review' => $this->review]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/TestStep/DeleteAllRatingsStep.php b/dev/tests/functional/tests/app/Mage/Review/Test/TestStep/DeleteAllRatingsStep.php deleted file mode 100644 index a4b939fc824..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/TestStep/DeleteAllRatingsStep.php +++ /dev/null @@ -1,65 +0,0 @@ -ratingEdit = $ratingEdit; - $this->ratingIndex = $ratingIndex; - } - - /** - * Delete all ratings. - * - * @return void - */ - public function run() - { - $this->ratingIndex->open(); - while ($this->ratingIndex->getRatingGrid()->isFirstRowVisible()) { - $this->ratingIndex->getRatingGrid()->openFirstRow(); - $this->ratingEdit->getPageActions()->deleteAndAcceptAlert(); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/etc/testcase.xml b/dev/tests/functional/tests/app/Mage/Review/Test/etc/testcase.xml deleted file mode 100644 index 5bee5e66019..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/etc/testcase.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/AbstractProductView.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/AbstractProductView.php deleted file mode 100644 index 616005755f2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/AbstractProductView.php +++ /dev/null @@ -1,26 +0,0 @@ -blockFactory->create( - $this->itemEntityClass, - ['element' => $this->_rootElement, 'config' => ['id' => $this->prepareSalesEntityId($id)]] - ); - } - - /** - * Set store view id. - * - * @param int $storeViewId - * @return void - */ - public function setStoreViewId($storeViewId) - { - $this->storeViewId = $storeViewId; - } - - /** - * Prepare sales entity id. - * - * @param string $entityId - * @return int - */ - protected function prepareSalesEntityId($entityId) - { - return $entityId - sprintf($this->idFormat, $this->storeViewId); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/AbstractSalesEntities/SalesEntity.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/AbstractSalesEntities/SalesEntity.php deleted file mode 100644 index 764d105efff..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/AbstractSalesEntities/SalesEntity.php +++ /dev/null @@ -1,51 +0,0 @@ -blockFactory->create( - $this->salesEntityItemsBlockClass, - ['element' => $this->_rootElement->find(sprintf($this->itemsSelector, $this->config['id']))] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/AbstractSalesEntities/SalesEntity/Items/Product.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/AbstractSalesEntities/SalesEntity/Items/Product.php deleted file mode 100644 index 605d4f2c2d1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/AbstractSalesEntities/SalesEntity/Items/Product.php +++ /dev/null @@ -1,38 +0,0 @@ - [ - 'selector' => '.product-name' - ], - 'options' => [ - 'selector' => '.item-options' - ] - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/CreditMemos.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/CreditMemos.php deleted file mode 100644 index 12d3279a37e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/CreditMemos.php +++ /dev/null @@ -1,29 +0,0 @@ -tr'; -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/CreditMemos/CreditMemo/Items/Product.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/CreditMemos/CreditMemo/Items/Product.php deleted file mode 100644 index aeb18d6a6a4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/CreditMemos/CreditMemo/Items/Product.php +++ /dev/null @@ -1,37 +0,0 @@ - ['col_name' => 'Product Name'], - 'product_sku' => ['col_name' => 'SKU'], - 'item_price' => ['col_name' => 'Price'], - 'item_qty' => ['col_name' => 'Qty'], - 'item_subtotal' => ['col_name' => 'Subtotal'], - 'item_discount' => ['col_name' => 'Discount Amount'], - 'item_row_total' => ['col_name' => 'Row Total'], - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/History.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/History.php deleted file mode 100644 index 03d0d9603c9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/History.php +++ /dev/null @@ -1,75 +0,0 @@ -_rootElement->find(sprintf($this->itemOrder, $id), Locator::SELECTOR_XPATH); - } - - /** - * Open item order. - * - * @param string $id - * @return void - */ - public function openOrderById($id) - { - $this->searchOrderById($id)->find($this->viewButton)->click(); - } - - /** - * Check if order is visible. - * - * @param Order|string $order - * @return bool - */ - public function isOrderVisible($order) - { - $orderId = $order instanceof Order ? $order->getId() : $order; - return $this->searchOrderById($orderId)->isVisible(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/Invoices.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/Invoices.php deleted file mode 100644 index e7229a59b7b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/Invoices.php +++ /dev/null @@ -1,29 +0,0 @@ -tr'; -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/Invoices/Invoice/Items/Product.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/Invoices/Invoice/Items/Product.php deleted file mode 100644 index 8624dca28c0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/Invoices/Invoice/Items/Product.php +++ /dev/null @@ -1,35 +0,0 @@ - ['col_name' => 'Product Name'], - 'product_sku' => ['col_name' => 'SKU'], - 'item_price' => ['col_name' => 'Price'], - 'item_qty' => ['col_name' => 'Qty Invoiced', 'replace' => ['Invoiced:']], - 'item_subtotal' => ['col_name' => 'Subtotal'] - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/OrderPrint/View.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/OrderPrint/View.php deleted file mode 100644 index 9851ef783fc..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/OrderPrint/View.php +++ /dev/null @@ -1,128 +0,0 @@ -_rootElement->find($this->billingAddress, Locator::SELECTOR_XPATH)->getText(); - } - - /** - * Get order grand total. - * - * @return string - */ - public function getGrandTotal() - { - return $this->escapeCurrency($this->_rootElement->find($this->grandTotal)->getText()); - } - - /** - * Method that escapes currency symbols. - * - * @param string $price - * @return string|null - */ - protected function escapeCurrency($price) - { - preg_match("/^\\D*\\s*([\\d,\\.]+)\\s*\\D*$/", $price, $matches); - return (isset($matches[1])) ? $matches[1] : null; - } - - /** - * Get order payment method. - * - * @return string - */ - public function getPaymentMethod() - { - return $this->_rootElement->find($this->paymentMethod, Locator::SELECTOR_XPATH)->getText(); - } - - /** - * Get order shipping method. - * - * @param array $shipping - * @return bool - */ - public function isShippingMethodVisible(array $shipping) - { - return strpos( - $this->_rootElement->find($this->shippingMethod, Locator::SELECTOR_XPATH)->getText(), - sprintf("%s - %s",$shipping['shipping_service'], $shipping['shipping_method'])) != false; - } - - /** - * Is item product visible. - * - * @param InjectableFixture $product - * @return bool - */ - public function isItemVisible(InjectableFixture $product) - { - $productName = strtolower($product->getName()); - return $this->_rootElement->find(sprintf($this->itemProduct, $productName))->isVisible(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/View.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/View.php deleted file mode 100644 index 566c9e875b2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/View.php +++ /dev/null @@ -1,43 +0,0 @@ -_rootElement->find(sprintf($this->link, $name), Locator::SELECTOR_XPATH)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/View/ActionsToolbar.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/View/ActionsToolbar.php deleted file mode 100644 index 2dd9d065415..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/View/ActionsToolbar.php +++ /dev/null @@ -1,48 +0,0 @@ -_rootElement->find(sprintf($this->linkSelector, $linkName), Locator::SELECTOR_XPATH); - if (!$link->isVisible()) { - throw new \Exception(sprintf('"%s" link is not visible', $linkName)); - } - $link->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/View/Items.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/View/Items.php deleted file mode 100644 index 0be5f539162..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/View/Items.php +++ /dev/null @@ -1,31 +0,0 @@ -prepareData($fixture, $isSearchByEmail); - - $fields = isset($data['fields']) ? $data['fields'] : $data; - $mapping = $this->dataMapping($fields); - $this->_fill($mapping, $element); - - return $this; - } - - /** - * Prepare data. - * - * @param FixtureInterface $fixture - * @param $isSearchByEmail - * @return array - */ - protected function prepareData(FixtureInterface $fixture, $isSearchByEmail) - { - /** @var Order $fixture */ - /** @var Customer $customer */ - $customer = $fixture->getDataFieldConfig('customer_id')['source']->getCustomer(); - $data = [ - 'order_id' => $fixture->getId(), - 'billing_last_name' => $customer->getLastname(), - ]; - if ($isSearchByEmail) { - $data['find_order_by'] = 'Email'; - $data['email_address'] = $customer->getEmail(); - } else { - $data['find_order_by'] = 'ZIP Code'; - $data['billing_zip_code'] = $fixture->getDataFieldConfig('billing_address_id')['source']->getPostcode(); - } - - return $data; - } - - /** - * Submit search form. - * - * @return void - */ - public function submit() - { - $this->_rootElement->find($this->searchButtonSelector)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Widget/Guest/Form.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Widget/Guest/Form.xml deleted file mode 100644 index 67a3182276b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Widget/Guest/Form.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - [name='oar_order_id'] - - - [name='oar_billing_lastname'] - - - [name='oar_type'] - select - - - [name='oar_email'] - - - [name='oar_zip'] - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AbstractAssertItems.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AbstractAssertItems.php deleted file mode 100644 index 9d38f1b2e25..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AbstractAssertItems.php +++ /dev/null @@ -1,259 +0,0 @@ -setFields($order, $orderId, $products, $verifyData); - $this->openPage(); - $this->assert($ids); - } - - /** - * Set fields for assert. - * - * @param Order|null $order - * @param string|null $orderId - * @param array|null $products - * @param array|null $verifyData - */ - protected function setFields(Order $order = null, $orderId = null, array $products = null, array $verifyData = null) - { - $this->orderId = ($orderId == null) ? $order->getId() : $orderId; - $this->products = ($products == null) ? $order->getEntityId()['products'] : $products; - $this->verifyData = $verifyData; - $this->productHandlerClass = $this->getProductHandlerClass(); - } - - /** - * Open verify page. - * - * @return void - */ - protected function openPage() - { - $this->salesTypePage->open(); - } - - /** - * Process assert. - * - * @param array $ids - */ - protected function assert(array $ids) - { - $productsData = $this->prepareItemsData($this->products, $this->verifyData); - foreach ($ids[$this->entityType . 'Ids'] as $entityId) { - $itemsData = $this->getItemsBlock($entityId)->getData(); - $error = $this->verifyData($productsData, $itemsData); - \PHPUnit_Framework_Assert::assertEmpty($error, $error); - } - } - - /** - * Get items block. - * - * @param string|null $entityId - * @return Items - */ - protected function getItemsBlock($entityId) - { - $this->openItemEntity($entityId); - return $this->salesTypeViewPage->getItemsBlock(); - } - - /** - * Open item entity. - * - * @param string $entityId - * @return void - */ - protected function openItemEntity($entityId) - { - $this->salesTypePage->getGrid()->searchAndOpen(['order_id' => $this->orderId, 'id' => $entityId,]); - } - - /** - * Prepare items data. - * - * @param array $products - * @param array|null $data - * @return array - */ - protected function prepareItemsData(array $products, array $data = null) - { - $productsData = []; - foreach ($products as $key => $product) { - $verifyData = isset($data['items_data'][$key]) ? $data['items_data'][$key] : null; - $productsData[] = array_merge( - $this->getDefaultItemData($product, $verifyData), - $this->getSpecialItemData($verifyData) - ); - } - - return $productsData; - } - - /** - * Prepare special item data. - * - * @param array|null $verifyData - * @return array - */ - protected function getSpecialItemData($verifyData = null) - { - $result = []; - if ($verifyData == null) { - return $result; - } - foreach ($this->specialFields as $field) { - if (isset($verifyData[$field])) { - $result[$field] = $verifyData[$field]; - } - } - - return $result; - } - - /** - * Get default item data. - * - * @param InjectableFixture $product - * @param array|null $verifyData - * @return array - */ - protected function getDefaultItemData(InjectableFixture $product, array $verifyData = null) - { - /** @var CatalogProductSimple $product */ - $checkoutData = $product->getCheckoutData(); - $defaultData['item_qty'] = (isset($verifyData['qty'])) ? $verifyData['qty'] : $checkoutData['qty']; - $defaultData = array_merge($defaultData, $this->getProductData($product)); - - return $defaultData; - } - - /** - * Get product data. - * - * @param InjectableFixture $product - * @return array - */ - protected function getProductData(InjectableFixture $product) - { - $productData['product'] = [ - 'name' => $this->getProductName($product), - 'sku' => $this->productHandlerClass->getProductSku($product) - ]; - $productOptions = $this->productHandlerClass->getProductOptions($product); - if ($productOptions != null) { - $productData['product']['options'] = $productOptions; - } - - return $productData; - } - - /** - * Get product name. - * - * @param InjectableFixture $product - * @return string - */ - protected function getProductName(InjectableFixture $product) - { - return $product->getName(); - } - - /** - * Get product handler class. - * - * @return ProductHandler - */ - protected function getProductHandlerClass() - { - return $this->objectManager->create($this->productHandlerPath); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AbstractAssertNoButtonOnOrderPage.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AbstractAssertNoButtonOnOrderPage.php deleted file mode 100644 index 0698efe2865..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AbstractAssertNoButtonOnOrderPage.php +++ /dev/null @@ -1,58 +0,0 @@ -open(); - $orderId = ($orderId == null) ? $order->getId() : $orderId; - $orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $orderId]); - \PHPUnit_Framework_Assert::assertFalse( - $salesOrderView->getPageActions()->isActionButtonVisible($this->buttonName), - "'$this->buttonName' button is present on order view page." - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AbstractAssertOrdersAddress.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AbstractAssertOrdersAddress.php deleted file mode 100644 index d69cc3fcc93..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AbstractAssertOrdersAddress.php +++ /dev/null @@ -1,70 +0,0 @@ -open()->getSalesOrderGrid()->searchAndOpen(['id' => $orderId]); - \PHPUnit_Framework_Assert::assertEquals($addressData, $this->getFormAddress($salesOrderView)); - } - - /** - * Prepare address data. - * - * @param Address $address - * @return string - */ - protected function prepareAddressData(Address $address) - { - $result = $address->getFirstname() . " ". $address->getLastname() . "\n" - . $address->getCompany() . "\n" - . $address->getStreet() . "\n" - . $address->getCity() . ", " . $address->getRegionId() . ", " . $address->getPostcode() . "\n" - . $address->getCountryId() . "\n" - . "T: " . $address->getTelephone(); - if ($address->hasData('fax')) { - $result .= "\nF: " . $address->getFax(); - } - return $result; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AbstractAssertSales.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AbstractAssertSales.php deleted file mode 100644 index 76499968b74..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AbstractAssertSales.php +++ /dev/null @@ -1,60 +0,0 @@ -order = $order; - $this->ids = $ids; - $this->verifyData = $verifyData; - $this->orderId = ($orderId == null) ? $order->getId() : $orderId; - - // Process assert - $this->openPage(); - $grid = $this->getGrid(); - $filters = $this->prepareFilters(); - $this->assert($filters, $grid); - } - - /** - * Process assert. - * - * @param array $filters - * @param Grid $grid - */ - protected function assert(array $filters, $grid) - { - foreach ($filters as $filter) { - \PHPUnit_Framework_Assert::assertTrue( - $this->isItemInGridVisible($grid, $filter), - $this->errorMessage - ); - } - } - - /** - * Check visible item in grid. - * - * @param Grid $grid - * @param array $filter - * @return bool - */ - protected function isItemInGridVisible($grid, array $filter) - { - return $grid->isRowVisible($filter); - } - - /** - * Prepare filters for assert. - * - * @return array - */ - protected function prepareFilters() - { - $filters = []; - if (!empty($this->ids)) { - foreach ($this->ids[$this->entityType . 'Ids'] as $key => $entityId) { - $filters[] = array_merge($this->getDefaultFilter($entityId), $this->getSpecialFilter($key)); - } - } else { - $filters[] = $this->getSpecialFilter(); - } - - return $filters; - } - - /** - * Get special filter. - * - * @param int $key [optional] - * @param Order|null $order - * @return array - */ - protected function getSpecialFilter($key = 0, Order $order = null) - { - $result = []; - foreach ($this->specialFilterFields as $fieldKey => $fields) { - foreach ($fields as $field) { - $result[$field] = isset($this->verifyData[$fieldKey][$this->entityType . 's'][$key][$field]) - ? $this->verifyData[$fieldKey][$this->entityType . 's'][$key][$field] - : $order->{'get' . ucfirst($fieldKey)}()[$this->entityType . 's'][$key][$field]; - } - } - - return $result; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AbstractAssertSalesEntityInSalesEntityGrid.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AbstractAssertSalesEntityInSalesEntityGrid.php deleted file mode 100644 index fe3623c8693..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AbstractAssertSalesEntityInSalesEntityGrid.php +++ /dev/null @@ -1,64 +0,0 @@ -salesEntityIndexPage->open(); - } - - /** - * Get grid for assert. - * - * @return Grid - */ - protected function getGrid() - { - return $this->salesEntityIndexPage->getGrid(); - } - - /** - * Get default filter. - * - * @param string $entityId - * @return array - */ - protected function getDefaultFilter($entityId) - { - return ['id' => $entityId, 'order_id' => $this->orderId]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AbstractAssertSalesEntityInSalesEntityTab.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AbstractAssertSalesEntityInSalesEntityTab.php deleted file mode 100644 index 2ed8ee1026c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AbstractAssertSalesEntityInSalesEntityTab.php +++ /dev/null @@ -1,94 +0,0 @@ -salesOrderView = $salesOrderView; - $this->orderIndex = $orderIndex; - } - - /** - * Open page for assert. - * - * @return void - */ - protected function openPage() - { - $this->orderIndex->open(); - $this->orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $this->orderId]); - $this->salesOrderView->getOrderForm()->openTab($this->entityType . 's'); - } - - /** - * Get grid for assert. - * - * @return Grid - */ - protected function getGrid() - { - return $this->salesOrderView->getOrderForm()->getTabElement($this->entityType . 's')->getGrid(); - } - - /** - * Get default filter. - * - * @param string $entityId - * @return array - */ - protected function getDefaultFilter($entityId) - { - return ['id' => $entityId]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AbstractAssertSalesEntityItemsOnFrontend.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AbstractAssertSalesEntityItemsOnFrontend.php deleted file mode 100644 index abe2df0630f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AbstractAssertSalesEntityItemsOnFrontend.php +++ /dev/null @@ -1,134 +0,0 @@ -setFields($order, $orderId, $products, $verifyData, $customer); - $this->openPage(); - $this->assert($ids); - } - - /** - * Get items block. - * - * @param string $entityId - * @return AbstractItem - */ - protected function getItemsBlock($entityId) - { - return $this->salesTypeViewPage->getEntitiesBlock()->getBlock($entityId)->getItemsBlock(); - } - - /** - * Set fields for assert. - * - * @param Order|null $order - * @param string|null $orderId - * @param array|null $products - * @param array|null $verifyData - * @param Customer|null $customer - */ - protected function setFields( - Order $order = null, - $orderId = null, - array $products = null, - array $verifyData = null, - Customer $customer = null - ) { - parent::setFields($order, $orderId, $products, $verifyData); - $this->customer = ($customer == null) - ? $order->getDataFieldConfig('customer_id')['source']->getCustomer() - : $customer; - } - - /** - * Open verify page. - * - * @return void - */ - protected function openPage() - { - $frontendAction = new FrontendActionsForSalesAssert(); - $frontendAction->loginCustomerAndOpenOrderPage($this->customer); - $frontendAction->openEntityTab($this->orderId, $this->entityType); - } - - /** - * Get product name. - * - * @param InjectableFixture $product - * @return string - */ - protected function getProductName(InjectableFixture $product) - { - return strtoupper($product->getName()); - } - - /** - * Get product data. - * - * @param InjectableFixture $product - * @return array - */ - protected function getProductData(InjectableFixture $product) - { - $productData = parent::getProductData($product); - $productData['product_sku'] = $productData['product']['sku']; - unset($productData['product']['sku']); - - return $productData; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertConfigurableProductInItemsOrderedGrid.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertConfigurableProductInItemsOrderedGrid.php deleted file mode 100644 index e01ea985397..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertConfigurableProductInItemsOrderedGrid.php +++ /dev/null @@ -1,52 +0,0 @@ -getPrice(); - if (!$this->productsIsConfigured) { - return $price; - } - $checkoutData = $product->getCheckoutData(); - if ($checkoutData === null) { - return 0; - } - $attributesData = $product->getConfigurableOptions()['attributes_data']; - foreach ($checkoutData['options']['configurable_options'] as $option) { - $itemOption = $attributesData[$option['title']]['options'][$option['value']]; - $price += $itemOption['price_type'] == 'Fixed' - ? $itemOption['price'] - : $product->getPrice() / 100 * $itemOption['price']; - } - - return $price; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertCreditMemoConfigurableItems.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertCreditMemoConfigurableItems.php deleted file mode 100644 index 6addf5916fd..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertCreditMemoConfigurableItems.php +++ /dev/null @@ -1,33 +0,0 @@ - [ - 'from', - 'to' - ] - ]; - - /** - * @constructor - * @param ObjectManager $objectManager - * @param EventManagerInterface $eventManager - * @param SalesCreditMemo $salesCreditMemo - */ - public function __construct( - ObjectManager $objectManager, - EventManagerInterface $eventManager, - SalesCreditMemo $salesCreditMemo - ) - { - parent::__construct($objectManager, $eventManager); - $this->salesEntityIndexPage = $salesCreditMemo; - } - - /** - * Check visible item in grid. - * - * @param Grid $grid - * @param array $filter - * @return bool - */ - protected function isItemInGridVisible($grid, array $filter) - { - return $grid->isRowVisible($filter, true, false); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Credit memo is present in the credit memo grid with correct total qty on credit memo index page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertCreditMemoInCreditMemosTab.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertCreditMemoInCreditMemosTab.php deleted file mode 100644 index d427b7b8cf0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertCreditMemoInCreditMemosTab.php +++ /dev/null @@ -1,76 +0,0 @@ - [ - 'from', - 'to' - ] - ]; - - /** - * Check visible item in grid. - * - * @param Grid $grid - * @param array $filter - * @return bool - */ - protected function isItemInGridVisible($grid, array $filter) - { - return $grid->isRowVisible($filter, true, false); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Credit memo is present on credit memos tab.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertCreditMemoItems.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertCreditMemoItems.php deleted file mode 100644 index d83c93a5ca7..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertCreditMemoItems.php +++ /dev/null @@ -1,79 +0,0 @@ -salesTypePage = $creditMemoIndex; - $this->salesTypeViewPage = $orderCreditMemoView; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'All credit memo products are present in credit memo page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertCreditMemoItemsOnFrontend.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertCreditMemoItemsOnFrontend.php deleted file mode 100644 index 2f3d638423e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertCreditMemoItemsOnFrontend.php +++ /dev/null @@ -1,76 +0,0 @@ -salesTypeViewPage = $creditMemoView; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Credit memo items quantity is equal to data from fixture on "My Account" page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertCreditMemoSuccessCreateMessage.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertCreditMemoSuccessCreateMessage.php deleted file mode 100644 index 28404bce839..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertCreditMemoSuccessCreateMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Success credit memo create message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertInvoiceConfigurableItems.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertInvoiceConfigurableItems.php deleted file mode 100644 index 72ba2113469..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertInvoiceConfigurableItems.php +++ /dev/null @@ -1,33 +0,0 @@ - [ - 'from', - 'to' - ] - ]; - - /** - * @constructor - * @param ObjectManager $objectManager - * @param EventManagerInterface $eventManager - * @param SalesInvoice $salesInvoice - */ - public function __construct( - ObjectManager $objectManager, - EventManagerInterface $eventManager, - SalesInvoice $salesInvoice) - { - parent::__construct($objectManager, $eventManager); - $this->salesEntityIndexPage = $salesInvoice; - } - - /** - * Check visible item in grid. - * - * @param Grid $grid - * @param array $filter - * @return bool - */ - protected function isItemInGridVisible($grid, array $filter) - { - return $grid->isRowVisible($filter, true, false); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Invoice is present in the invoice grid with correct total qty on invoice index page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertInvoiceInInvoicesTab.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertInvoiceInInvoicesTab.php deleted file mode 100644 index f3903c31938..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertInvoiceInInvoicesTab.php +++ /dev/null @@ -1,76 +0,0 @@ - [ - 'from', - 'to' - ] - ]; - - /** - * Check visible item in grid. - * - * @param Grid $grid - * @param array $filter - * @return bool - */ - protected function isItemInGridVisible($grid, array $filter) - { - return $grid->isRowVisible($filter, true, false); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Invoice is present on invoices tab.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertInvoiceItems.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertInvoiceItems.php deleted file mode 100644 index 4a2b912adca..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertInvoiceItems.php +++ /dev/null @@ -1,79 +0,0 @@ -salesTypePage = $invoiceIndex; - $this->salesTypeViewPage = $orderInvoiceView; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'All invoices products are present in invoice page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertInvoiceItemsOnFrontend.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertInvoiceItemsOnFrontend.php deleted file mode 100644 index a2ba90dda39..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertInvoiceItemsOnFrontend.php +++ /dev/null @@ -1,73 +0,0 @@ -salesTypeViewPage = $invoiceView; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Invoice items quantity is equal to data from fixture on "My Account" page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertInvoiceSuccessCreateMessage.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertInvoiceSuccessCreateMessage.php deleted file mode 100644 index 64b4c4738d2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertInvoiceSuccessCreateMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object - * - * @return string - */ - public function toString() - { - return 'Success invoice create message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertInvoiceWithShipmentSuccessMessage.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertInvoiceWithShipmentSuccessMessage.php deleted file mode 100644 index 3c13f2e291c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertInvoiceWithShipmentSuccessMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Success invoice and shipment create message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertItemsOrderedBlockIsEmpty.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertItemsOrderedBlockIsEmpty.php deleted file mode 100644 index c180e9ea1de..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertItemsOrderedBlockIsEmpty.php +++ /dev/null @@ -1,53 +0,0 @@ -getCreateBlock()->getItemsBlock()->isEmptyBlockVisible(), - "Items ordered block is not empty" - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Items ordered block is empty'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertNoCreditMemoButton.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertNoCreditMemoButton.php deleted file mode 100644 index 5b479915a4e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertNoCreditMemoButton.php +++ /dev/null @@ -1,43 +0,0 @@ -open()->getSalesOrderGrid()->searchAndOpen(['id' => $orderId]); - $absentButtons = $this->getAbsentButtons($salesOrderView, $orderButtonsAvailable); - - \PHPUnit_Framework_Assert::assertEmpty( - $absentButtons, - "Next buttons was not found on page: \n" . implode(";\n", $absentButtons) - ); - } - - /** - * Get absent buttons. - * - * @param SalesOrderView $salesOrderView - * @param string $orderButtonsAvailable - * @return array - */ - protected function getAbsentButtons(SalesOrderView $salesOrderView, $orderButtonsAvailable) - { - $buttons = explode(',', $orderButtonsAvailable); - $absentButtons = []; - $actionsBlock = $salesOrderView->getPageActions(); - foreach ($buttons as $button) { - if (!$actionsBlock->isActionButtonVisible(trim($button))) { - $absentButtons[] = $button; - } - } - return $absentButtons; - } - - /** - * Returns string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return "All buttons are available on order page."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrderCancelSuccessMessage.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrderCancelSuccessMessage.php deleted file mode 100644 index a5007ca6c51..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrderCancelSuccessMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Sales order success cancel message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrderCreateSuccessMessage.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrderCreateSuccessMessage.php deleted file mode 100644 index 661674ae435..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrderCreateSuccessMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Sales order success created message is present on sales order view page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrderGrandTotal.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrderGrandTotal.php deleted file mode 100644 index 0d6c204e711..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrderGrandTotal.php +++ /dev/null @@ -1,59 +0,0 @@ -open()->getSalesOrderGrid()->searchAndOpen(['id' => $orderId]); - $expected = number_format(is_array($grandTotal) ? array_sum($grandTotal) : $grandTotal, 2); - $actual = $salesOrderView->getOrderForm()->getTabElement('information')->getOrderTotalsBlock() - ->getData('grand_total'); - - \PHPUnit_Framework_Assert::assertEquals($expected, $actual, "Expected: $expected; Actual: $actual"); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Grand Total price equals to price from data set.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrderInOrdersGrid.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrderInOrdersGrid.php deleted file mode 100644 index 748a4bdd546..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrderInOrdersGrid.php +++ /dev/null @@ -1,54 +0,0 @@ -open()->getSalesOrderGrid()->isRowVisible(['id' => $orderId]), - "Order with id $orderId is absent in orders grid on backend." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Order is present in orders grid on backend.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrderInOrdersGridOnFrontend.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrderInOrdersGridOnFrontend.php deleted file mode 100644 index 6a23cd94cf6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrderInOrdersGridOnFrontend.php +++ /dev/null @@ -1,68 +0,0 @@ -objectManager->create( - 'Mage\Customer\Test\TestStep\LoginCustomerOnFrontendStep', - ['customer' => $customer] - )->run(); - $customerAccountIndex->getAccountNavigationBlock()->openNavigationItem('My Orders'); - \PHPUnit_Framework_Assert::assertTrue( - $orderHistory->getOrderHistoryBlock()->isOrderVisible($order), - "Order with following id {$order->getId()} is absent in Orders block on frontend." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Sales order is present in orders grid on frontend.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrderStatusIsCorrect.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrderStatusIsCorrect.php deleted file mode 100644 index 8fb680ccd5a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrderStatusIsCorrect.php +++ /dev/null @@ -1,59 +0,0 @@ -open()->getSalesOrderGrid()->searchAndOpen(['id' => $orderId]); - - \PHPUnit_Framework_Assert::assertEquals( - $status, - $salesOrderView->getOrderForm()->getTabElement('information')->getOrderInfoBlock()->getOrderStatus() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Order status is correct.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrdersBillingAddress.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrdersBillingAddress.php deleted file mode 100644 index e51542e33c4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrdersBillingAddress.php +++ /dev/null @@ -1,72 +0,0 @@ -prepareAddressData($billingAddress); - foreach ($ordersIds as $orderId) { - $this->assert($salesOrder, $salesOrderView, $orderId, $addressData); - } - } - - /** - * Get shipping address data from order form. - * - * @param SalesOrderView $salesOrderView - * @return string - */ - protected function getFormAddress(SalesOrderView $salesOrderView) - { - return $salesOrderView->getOrderForm()->getTabElement('information')->getBillingAddressBlock()->getAddress(); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Orders were created with a right billing addresses.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrdersCount.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrdersCount.php deleted file mode 100644 index 5f6efbafa86..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrdersCount.php +++ /dev/null @@ -1,50 +0,0 @@ - $orderId) { - $assertOrderGrandTotal->processAssert($salesOrder, $salesOrderView, $grandTotal[$key], $orderId); - } - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Grand Total prices equals to prices from data set for orders.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrdersShippingAddress.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrdersShippingAddress.php deleted file mode 100644 index 01f928652f2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrdersShippingAddress.php +++ /dev/null @@ -1,71 +0,0 @@ - $orderId) { - $addressData = $this->prepareAddressData($addresses[$key]); - $this->assert($salesOrder, $salesOrderView, $orderId, $addressData); - } - } - - /** - * Get shipping address data from order form. - * - * @param SalesOrderView $salesOrderView - * @return string - */ - protected function getFormAddress(SalesOrderView $salesOrderView) - { - return $salesOrderView->getOrderForm()->getTabElement('information')->getShippingAddressBlock()->getAddress(); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Orders were created with a right shipping addresses.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertProductInItemsOrderedGrid.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertProductInItemsOrderedGrid.php deleted file mode 100644 index 00da134d5e4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertProductInItemsOrderedGrid.php +++ /dev/null @@ -1,133 +0,0 @@ - '', 'price' => '', 'checkout_data' => ['qty' => '']]; - - /** - * Check configured products. - * - * @var bool - */ - protected $productsIsConfigured; - - /** - * Assert product was added to Items Ordered grid in customer account on Order creation page backend. - * - * @param SalesOrderCreateIndex $orderCreatePage - * @param array $products - * @param bool $productsIsConfigured - * @return void - */ - public function processAssert(SalesOrderCreateIndex $orderCreatePage, array $products, $productsIsConfigured = true) - { - $this->productsIsConfigured = $productsIsConfigured; - $data = $this->prepareData($products, $orderCreatePage->getCreateBlock()->getItemsBlock()); - - \PHPUnit_Framework_Assert::assertEquals( - $data['fixtureData'], - $data['pageData'], - 'Product data on order create page not equals to passed from fixture.' - ); - } - - /** - * Prepare data. - * - * @param array $data - * @param Items $itemsBlock - * @return array - */ - protected function prepareData(array $data, Items $itemsBlock) - { - $fixtureData = []; - foreach ($data as $product) { - $checkoutData = $product->getCheckoutData(); - $fixtureData[] = [ - 'name' => $product->getName(), - 'price' => number_format($this->getProductPrice($product), 2), - 'checkout_data' => [ - 'qty' => $this->productsIsConfigured && isset($checkoutData['qty']) ? $checkoutData['qty'] : 1, - ], - ]; - } - $pageData = $itemsBlock->getProductsDataByFields($this->fields); - $preparePageData = $this->arraySort($fixtureData, $pageData); - - return ['fixtureData' => $fixtureData, 'pageData' => $preparePageData]; - } - - /** - * Sort of array. - * - * @param array $fixtureData - * @param array $pageData - * @return array - */ - protected function arraySort(array $fixtureData, array $pageData) - { - $result = []; - foreach ($fixtureData as $key => $value) { - foreach ($pageData as $pageDataKey => $pageDataValue) { - if ($value['name'] == $pageDataValue['name']) { - $result[$key] = $pageDataValue; - unset($pageData[$pageDataKey]); - break; - } - } - } - - return array_merge($result, $pageData); - } - - /** - * Get product price. - * - * @param InjectableFixture $product - * @return int - */ - protected function getProductPrice(InjectableFixture $product) - { - return isset($product->getCheckoutData()['cartItem']['price']) - ? $product->getCheckoutData()['cartItem']['price'] - : $product->getPrice(); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product is added to Items Ordered grid from "Last Ordered Items" section on Order creation page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertProductsVisibilityInItemsOrderedBlock.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertProductsVisibilityInItemsOrderedBlock.php deleted file mode 100644 index 664a1b89f06..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertProductsVisibilityInItemsOrderedBlock.php +++ /dev/null @@ -1,58 +0,0 @@ -getName(); - if (!$orderCreatePage->getCreateBlock()->getItemsBlock()->getItemProduct($productName)->isVisible()) { - $productsVisibility[] = "'{$productName}' is not visible in items order block."; - } - } - \PHPUnit_Framework_Assert::assertEmpty($productsVisibility, $productsVisibility); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Products are visible in items order block.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertReorderedOrderStatusIsCorrect.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertReorderedOrderStatusIsCorrect.php deleted file mode 100644 index dec6c6bf6d6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertReorderedOrderStatusIsCorrect.php +++ /dev/null @@ -1,65 +0,0 @@ -open()->getSalesOrderGrid()->searchAndOpen(['id' => $order->getId()]); - - \PHPUnit_Framework_Assert::assertEquals( - $previousOrderStatus, - $salesOrderView->getOrderForm()->getTabElement('information')->getOrderInfoBlock()->getOrderStatus(), - 'Order status is incorrect on order page in backend.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Order status is correct.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertSalesPrintOrderBillingAddress.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertSalesPrintOrderBillingAddress.php deleted file mode 100644 index f960bef52b9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertSalesPrintOrderBillingAddress.php +++ /dev/null @@ -1,57 +0,0 @@ -objectManager->create( - 'Mage\Customer\Test\Block\Address\Renderer', - ['address' => $billingAddress, 'type' => 'html'] - ); - $expectedBillingAddress = $addressRenderer->render(); - \PHPUnit_Framework_Assert::assertEquals( - $expectedBillingAddress, - $salesGuestPrint->getViewBlock()->getBillingAddress(), - "Billing address was printed incorrectly." - ); - } - - /** - * Returns a string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return "Billing address printed correctly."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertSalesPrintOrderGrandTotal.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertSalesPrintOrderGrandTotal.php deleted file mode 100644 index 43fe71c2c18..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertSalesPrintOrderGrandTotal.php +++ /dev/null @@ -1,51 +0,0 @@ -getViewBlock()->getGrandTotal(), - "Grand total was printed incorrectly." - ); - } - - /** - * Returns a string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return "Grand total was printed correctly."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertSalesPrintOrderPaymentMethod.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertSalesPrintOrderPaymentMethod.php deleted file mode 100644 index 57896e25ec5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertSalesPrintOrderPaymentMethod.php +++ /dev/null @@ -1,51 +0,0 @@ -getViewBlock()->getPaymentMethod(), - "Payment method was printed incorrect on sales guest print page." - ); - } - - /** - * Returns a string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return "Payment method was printed correctly."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertSalesPrintOrderProducts.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertSalesPrintOrderProducts.php deleted file mode 100644 index dff51ab68df..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertSalesPrintOrderProducts.php +++ /dev/null @@ -1,60 +0,0 @@ -getViewBlock()->isItemVisible($product)) { - $errors .= sprintf(self::ERROR_MESSAGE, $product->getName()); - } - } - - \PHPUnit_Framework_Assert::assertEmpty($errors, $errors); - } - - /** - * Returns a string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return "Products were printed correctly."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/FrontendActionsForSalesAssert.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/FrontendActionsForSalesAssert.php deleted file mode 100644 index 7328f82a4ee..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/FrontendActionsForSalesAssert.php +++ /dev/null @@ -1,87 +0,0 @@ - 'Mage\Customer\Test\Page\CustomerAccountIndex', - 'orderHistory' => 'Mage\Sales\Test\Page\OrderHistory', - 'customerOrderView' => 'Mage\Sales\Test\Page\OrderView' - ]; - - /** - * @constructor - */ - public function __construct() - { - foreach ($this->pages as $key => $page) { - $this->$key = $this->createPage($page); - } - } - - /** - * Login customer and open Order page. - * - * @param Customer $customer - * @return void - */ - public function loginCustomerAndOpenOrderPage(Customer $customer) - { - $this->loginCustomer($customer); - $this->customerAccountIndex->open()->getAccountNavigationBlock()->openNavigationItem('My Orders'); - } - - /** - * Open entity tab. - * - * @param string $orderId - * @param string $entityType - * @return void - */ - public function openEntityTab($orderId, $entityType) - { - $this->orderHistory->getOrderHistoryBlock()->openOrderById($orderId); - $this->customerOrderView->getOrderViewBlock()->openLinkByName(ucfirst($entityType) . 's'); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Fixture/Order.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/Fixture/Order.xml deleted file mode 100644 index 39afa31a23e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Fixture/Order.xml +++ /dev/null @@ -1,226 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Fixture/Order/BillingAddressId.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Fixture/Order/BillingAddressId.php deleted file mode 100644 index ad8cfbfb85d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Fixture/Order/BillingAddressId.php +++ /dev/null @@ -1,92 +0,0 @@ -params = $params; - if (isset($data['dataset'])) { - $addresses = $fixtureFactory->createByCode('address', ['dataset' => $data['dataset']]); - $this->data = $addresses->getData(); - $this->data['street'] = [$this->data['street']]; - } - if (isset($data['billingAddress']) && $data['billingAddress'] instanceof Address) { - $this->data = $data['billingAddress']->getData(); - $this->data['street'] = [$this->data['street']]; - } - } - - /** - * Persist order billing address. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set. - * - * @param string $key [optional] - * @return mixed - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings. - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Fixture/Order/CustomerId.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Fixture/Order/CustomerId.php deleted file mode 100644 index cdbd01d5446..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Fixture/Order/CustomerId.php +++ /dev/null @@ -1,105 +0,0 @@ -params = $params; - if (isset($data['customer']) && $data['customer'] instanceof Customer) { - $this->data = $data['customer']; - return; - } - if (isset($data['dataset'])) { - $customer = $fixtureFactory->createByCode('customer', ['dataset' => $data['dataset']]); - if ($customer->hasData('id') === false) { - $customer->persist(); - } - $this->data = $customer; - } - } - - /** - * Persist order customer. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set. - * - * @param string|null $key [optional] - * @return Customer - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings. - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Get customer fixture. - * - * @return Customer - */ - public function getCustomer() - { - return $this->data; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Fixture/Order/EntityId.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Fixture/Order/EntityId.php deleted file mode 100644 index d78137d89c8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Fixture/Order/EntityId.php +++ /dev/null @@ -1,97 +0,0 @@ -params = $params; - if (!isset($data['products'])) { - return; - } - if (is_string($data['products'])) { - $products = explode(',', $data['products']); - foreach ($products as $product) { - list($fixture, $dataset) = explode('::', $product); - $product = $fixtureFactory->createByCode($fixture, ['dataset' => $dataset]); - $product->persist(); - $this->data['products'][] = $product; - } - } elseif (is_array($data['products'])) { - $this->data['products'] = $data['products']; - } - } - - /** - * Persist order products. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set. - * - * @param string $key [optional] - * @return mixed - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings. - * - * @return string - */ - public function getDataConfig() - { - return $this->params; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Fixture/Order/StoreId.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Fixture/Order/StoreId.php deleted file mode 100644 index 2c05aab7740..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Fixture/Order/StoreId.php +++ /dev/null @@ -1,114 +0,0 @@ -params = $params; - $storeData = isset($data['dataset']) ? ['dataset' => $data['dataset']] : []; - if (isset($data['data'])) { - $storeData = array_merge($storeData, $data); - } - if ($storeData) { - $store = $fixtureFactory->createByCode('store', $storeData); - /** @var Store $store */ - if (!$store->getStoreId()) { - $store->persist(); - } - $this->store = $store; - $this->data = $store->getStoreId(); - } - } - - /** - * Persists prepared data. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set. - * - * @param string|null $key [optional] - * @return mixed - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings. - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Return Store fixture. - * - * @return Store - */ - public function getStore() - { - return $this->store; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Handler/Order/Curl.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Handler/Order/Curl.php deleted file mode 100644 index 75dc44aef8e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Handler/Order/Curl.php +++ /dev/null @@ -1,346 +0,0 @@ - [ - 'California' => '12', - ], - 'country_id' => [ - 'United States' => 'US', - ], - ]; - - /** - * Steps for create order on backend. - * - * @var array - */ - protected $steps = [ - 'customer_choice' => 'header,data', - 'products_choice' => 'search,items,shipping_method,totals,giftmessage,billing_method', - 'apply_coupon_code' => 'items,shipping_method,totals,billing_method', - 'shipping_data_address' => 'shipping_method,billing_method,shipping_address,totals,giftmessage', - 'shipping_data_method_get' => 'shipping_method,totals', - 'shipping_data_method_set' => 'shipping_method,totals,billing_method', - ]; - - /** - * Post request for creating order. - * - * @param FixtureInterface|null $fixture [optional] - * @return array - */ - public function persist(FixtureInterface $fixture = null) - { - $this->order = $fixture; - $this->customer = $fixture->getDataFieldConfig('customer_id')['source']->getCustomer(); - $data = $this->replaceMappingData($this->prepareData($fixture)); - return ['id' => $this->createOrder($data)]; - } - - /** - * Prepare POST data for creating product request. - * - * @param FixtureInterface $fixture - * @return array - */ - protected function prepareData(FixtureInterface $fixture) - { - $result = []; - $data = $fixture->getData(); - $result['customer_choice'] = $this->prepareCustomerData($data); - $result['products_choice'] = $this->prepareProductsData($data['entity_id']); - $result['order_data'] = $this->prepareOrderData($data); - $result['shipping_data_address'] = $this->prepareShippingData($result['order_data']); - $result['shipping_data_method_get'] = [ - 'payment' => $data['payment_auth_expiration'], - 'collect_shipping_rates' => 1, - ]; - $result['shipping_data_method_set'] = [ - 'order' => ['shipping_method' => $data['shipping_method']], - 'payment' => $data['payment_auth_expiration'], - ]; - - return $result; - } - - /** - * Prepare shipping data. - * - * @param array $data - * @return array - */ - protected function prepareShippingData(array $data) - { - $result = [ - 'order' => [ - 'billing_address' => $data['billing_address'], - ], - 'payment' => $this->order->getPaymentAuthExpiration(), - 'reset_shipping' => 1, - 'shipping_as_billing' => 1, - ]; - return $result; - } - - /** - * Prepare products data. - * - * @param array $data - * @return array - */ - protected function prepareProductsData(array $data) - { - $result['item'] = []; - foreach ($data['products'] as $value) { - if (!$value->hasData('checkout_data')) { - continue; - } - $methodName = 'prepare' . ucfirst($value->getDataConfig()['type_id']) . 'Data'; - if (!method_exists($this, $methodName)) { - $methodName = 'prepareSimpleData'; - } - $result['item'][$value->getId()] = $this->$methodName($value); - } - return $result; - } - - /** - * Prepare data for configurable product. - * - * @param ConfigurableProduct $product - * @return array - */ - protected function prepareConfigurableData(ConfigurableProduct $product) - { - $result = []; - $checkoutData = $product->getCheckoutData(); - $result['qty'] = $checkoutData['qty']; - $attributesData = $product->hasData('configurable_options') - ? $product->getDataFieldConfig('configurable_options')['source']->getAttributesData() - : null; - if ($attributesData == null) { - return $result; - } - - foreach ($checkoutData['options']['configurable_options'] as $key => $option) { - $attributeId = $attributesData[$key]->getAttributeId(); - $optionId = $attributesData[$key]->getOptions()[substr($option['value'], -1)]['id']; - $result['super_attribute'][$attributeId] = $optionId; - } - - return $result; - } - - /** - * Prepare data for bundle product. - * - * @param BundleProduct $product - * @return array - * - * @SuppressWarnings(PHPMD.UnusedLocalVariable) - */ - protected function prepareBundleData(BundleProduct $product) - { - $result = []; - $checkoutData = $product->getCheckoutData(); - $bundleOptions = isset($checkoutData['options']['bundle_options']) - ? $checkoutData['options']['bundle_options'] - : []; - $bundleSelections = $product->getBundleSelections(); - $bundleSelectionsData = []; - $result['qty'] = $checkoutData['qty']; - - foreach ($bundleSelections as $option) { - foreach ($option['assigned_products'] as $productData) { - $bundleSelectionsData[] = [ - 'selection_id' => $productData['selection_id'], - 'option_id' => $productData['option_id'], - ]; - } - } - - foreach ($bundleOptions as $option) { - $key = substr($option['value']['name'], -1); - if (isset($bundleSelectionsData[$key])) { - $optionId = $bundleSelectionsData[$key]['option_id']; - $selectionId = $bundleSelectionsData[$key]['selection_id']; - $result['bundle_option'][$optionId] = $selectionId; - } - } - - return $result; - } - - /** - * Prepare data for simple product. - * - * @param FixtureInterface $product - * @return array - */ - protected function prepareSimpleData(FixtureInterface $product) - { - return ['qty' => $product->getCheckoutData()['qty']]; - } - - /** - * Prepare order data. - * - * @param array $data - * @return array - */ - protected function prepareOrderData(array $data) - { - $customerGroupId = $this->customer->hasData('group_id') - ? $this->customer->getDataFieldConfig('group_id')['source']->getCustomerGroup()->getCustomerGroupId() - : 1; - $result = [ - 'name' => $this->customer->getFirstname(), - 'order' => [ - 'currency' => $data['order_currency_code'], - 'account' => [ - 'group_id' => $customerGroupId, - 'email' => $this->customer->getEmail(), - ], - 'shipping_method' => $data['shipping_method'], - ], - 'item' => $this->prepareOrderProductsData($data['entity_id']), - 'billing_address' => $this->prepareBillingAddress($data['billing_address_id']), - 'shipping_same_as_billing' => 'on', - 'payment' => $data['payment_auth_expiration'], - - ]; - - return $result; - } - - /** - * Prepare customer data. - * - * @param array $data - * @return array - */ - protected function prepareCustomerData(array $data) - { - return [ - 'currency_id' => $data['base_currency_code'], - 'customer_id' => $this->customer->getData('id'), - 'payment' => $data['payment_authorization_amount'], - 'store_id' => $this->order->getDataFieldConfig('store_id')['source']->store->getStoreId() - ]; - } - - /** - * Prepare order products data. - * - * @param array $data - * @return array - */ - protected function prepareOrderProductsData(array $data) - { - $result = []; - foreach ($data['products'] as $value) { - if (isset($value->getCheckoutData()['qty'])) { - $result[$value->getId()] = ['qty' => ['qty' => $value->getCheckoutData()['qty']]]; - } - } - - return $result; - } - - /** - * Prepare billing address data. - * - * @param array $data - * @return array - */ - protected function prepareBillingAddress(array $data) - { - $result = $data; - $result['firstname'] = $this->customer->getFirstname(); - $result['lastname'] = $this->customer->getLastname(); - - return $result; - } - - /** - * Create order via curl. - * - * @param array $data - * @return int|null - * @throws \Exception - */ - protected function createOrder(array $data) - { - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - foreach ($this->steps as $key => $step) { - if (!isset($data[$key])) { - continue; - } - $url = $_ENV['app_backend_url'] . 'sales_order_create/loadBlock/block/' . $step . '?isAjax=true'; - $curl->write($url, $data[$key]); - $curl->read(); - } - $url = $_ENV['app_backend_url'] . 'sales_order_create/save'; - $curl->addOption(CURLOPT_HEADER, 1); - $curl->write($url, $data['order_data']); - $response = $curl->read(); - $curl->close(); - - if (!strpos($response, 'class="success-msg"')) { - throw new \Exception("Order creation by curl handler was not successful! Response: $response"); - } - preg_match("@Order\s#\s(\d+)@", $response, $matches); - - return isset($matches[1]) ? $matches[1] : null; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Handler/Order/OrderInterface.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Handler/Order/OrderInterface.php deleted file mode 100644 index 34ac4f539db..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Handler/Order/OrderInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesCreditMemoView.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesCreditMemoView.xml deleted file mode 100644 index 674f0147900..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesCreditMemoView.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesInvoice.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesInvoice.xml deleted file mode 100644 index 5cb200f8ec1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesInvoice.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesInvoiceView.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesInvoiceView.xml deleted file mode 100644 index 55136dea532..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesInvoiceView.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesOrderCreateIndex.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesOrderCreateIndex.xml deleted file mode 100644 index 8d12519f2c4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesOrderCreateIndex.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesOrderCreditMemoNew.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesOrderCreditMemoNew.xml deleted file mode 100644 index 70a2849610e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesOrderCreditMemoNew.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesOrderIndex.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesOrderIndex.xml deleted file mode 100644 index 466aa65a6e6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesOrderIndex.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesOrderInvoiceNew.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesOrderInvoiceNew.xml deleted file mode 100644 index ded05c1139b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesOrderInvoiceNew.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesOrderView.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesOrderView.xml deleted file mode 100644 index e82fc5c4704..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesOrderView.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/CreditMemoView.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/Page/CreditMemoView.xml deleted file mode 100644 index fc4239a0199..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/CreditMemoView.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/InvoiceView.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/Page/InvoiceView.xml deleted file mode 100644 index a9ab5e9bd5e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/InvoiceView.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/OrderHistory.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/Page/OrderHistory.xml deleted file mode 100644 index a38097adc01..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/OrderHistory.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/OrderView.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/Page/OrderView.xml deleted file mode 100644 index 14dfc01629a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/OrderView.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/SalesGuestForm.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/Page/SalesGuestForm.xml deleted file mode 100644 index a8e5a2c34a2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/SalesGuestForm.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/SalesGuestPrint.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/Page/SalesGuestPrint.xml deleted file mode 100644 index fb8b9a3ee63..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/SalesGuestPrint.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/SalesGuestView.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/Page/SalesGuestView.xml deleted file mode 100644 index 7e43cc90031..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/SalesGuestView.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Repository/ConfigData.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/Repository/ConfigData.xml deleted file mode 100644 index 03577546127..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Repository/ConfigData.xml +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - - sales - 1 - Yes - 1 - - - sales - 1 - Yes - 1 - - - sales - 1 - On Gesture - 1 - - - - - sales - 1 - No - - - - sales - 1 - No - - - - - - sales - 1 - Yes - 1 - - - sales - 1 - Yes - 1 - - - sales - 1 - In Cart - 2 - - - - - sales - 1 - No - - - - sales - 1 - No - - - - - - sales - 1 - Yes - 1 - - - sales - 1 - Yes - 1 - - - sales - 1 - Before Order Confirmation - 3 - - - - - sales - 1 - No - - - - sales - 1 - No - - - - - - sales - 1 - Yes - 1 - - - sales - 1 - Yes - 1 - - - - - sales - 1 - No - - - - sales - 1 - No - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Repository/Order.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/Repository/Order.xml deleted file mode 100644 index 1b479dc7aa5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Repository/Order.xml +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - - default - - false - - default - - USD - flatrate_flatrate - - checkmo - - - free - - - US_address - - - catalogProductSimple::default - - - - - default - - false - - default - - USD - flatrate_flatrate - - checkmo - - - free - - - US_address - - - configurableProduct::default - - - - - default - - false - - default - - USD - flatrate_flatrate - - checkmo - - - free - - - US_address - - - bundleProduct::bundle_fixed_product - - - - - default - - false - - default - - USD - flatrate_flatrate - - checkmo - - - free - - - US_address - - - catalogProductSimple::wit_qty_3 - - - - - default - - false - - default - - USD - flatrate_flatrate - - checkmo - - - free - - - US_address - - - bundleProduct::bundle_fixed_product,configurableProduct::default - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/CancelCreatedOrderTest.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/CancelCreatedOrderTest.php deleted file mode 100644 index 65c1a3d6265..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/CancelCreatedOrderTest.php +++ /dev/null @@ -1,88 +0,0 @@ - Orders. - * 3. Open the created order. - * 4. Do cancel Order. - * 5. Perform all assertions. - * - * @group Order_Management_(CS) - * @ZephyrId MPERF-7350 - */ -class CancelCreatedOrderTest extends Injectable -{ - /** - * Orders index page. - * - * @var SalesOrderIndex - */ - protected $orderIndex; - - /** - * Order view page. - * - * @var SalesOrderView - */ - protected $salesOrderView; - - /** - * Injection data. - * - * @param SalesOrderIndex $orderIndex - * @param SalesOrderView $salesOrderView - * @return void - */ - public function __inject(SalesOrderIndex $orderIndex, SalesOrderView $salesOrderView) - { - $this->orderIndex = $orderIndex; - $this->salesOrderView = $salesOrderView; - } - - /** - * Cancel created order. - * - * @param Order $order - * @return array - */ - public function test(Order $order) - { - // Preconditions - $order->persist(); - - // Steps - $this->orderIndex->open(); - $this->orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $order->getId()]); - $this->salesOrderView->getPageActions()->cancel(); - - return [ - 'customer' => $order->getDataFieldConfig('customer_id')['source']->getCustomer(), - 'orderId' => $order->getId(), - 'product' => $order->getEntityId()['products'][0] - ]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/CancelCreatedOrderTest.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/CancelCreatedOrderTest.xml deleted file mode 100644 index e82b21d4745..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/CancelCreatedOrderTest.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - Cancel order and check status on the frontend. - with_simple_qty_3 - Canceled - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/CreateOrderFromBackendCustomerPageTest.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/CreateOrderFromBackendCustomerPageTest.php deleted file mode 100644 index 7444deb04ca..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/CreateOrderFromBackendCustomerPageTest.php +++ /dev/null @@ -1,43 +0,0 @@ - Manage Customers. - * 3. Select customer created in preconditions. - * 4. Click Create Order button. - * 5. Add Products according to dataset. - * 6. Fill data according dataset. - * 7. Click Update Product qty. - * 8. Fill data according dataset. - * 9. Click Get Shipping Method and rates. - * 10. Fill data according dataset. - * 11. Submit Order. - * 12. Perform all assertions. - * - * @group Order_Management_(CS) - * @ZephyrId MPERF-7419 - */ -class CreateOrderFromBackendCustomerPageTest extends CreateOrderFromBackendWithinOfflinePaymentMethodsTest -{ - // -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/CreateOrderFromBackendCustomerPageTest.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/CreateOrderFromBackendCustomerPageTest.xml deleted file mode 100644 index f45829d354f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/CreateOrderFromBackendCustomerPageTest.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - Create backend order with simple product for existing customer. - default_tax_configuration - catalogProductSimple::default - default - customer_US_login - Flat Rate - Fixed - 315.00 - checkmo - Pending - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/CreateOrderFromBackendWithinOfflinePaymentMethodsTest.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/CreateOrderFromBackendWithinOfflinePaymentMethodsTest.php deleted file mode 100644 index 4a19938d933..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/CreateOrderFromBackendWithinOfflinePaymentMethodsTest.php +++ /dev/null @@ -1,64 +0,0 @@ - Orders. - * 3. Click Create New Order. - * 4. Select Customer created in preconditions. - * 5. Add Products according to dataset. - * 6. Fill data according dataset. - * 7. Click Update Product qty. - * 8. Fill data according dataset. - * 9. Click Get Shipping Method and rates. - * 10. Fill data according dataset. - * 11. Submit Order. - * 12. Perform all assertions. - * - * @group Order_Management_(CS) - * @ZephyrId MPERF-7098 - */ -class CreateOrderFromBackendWithinOfflinePaymentMethodsTest extends Scenario -{ - /** - * Prepare environment for test. - * - * @return void - */ - public function __prepare() - { - // Delete existing tax rules. - $this->objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - } - - /** - * Run Create order from backend within offline payment methods test. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/CreateOrderFromBackendWithinOfflinePaymentMethodsTest.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/CreateOrderFromBackendWithinOfflinePaymentMethodsTest.xml deleted file mode 100644 index 5b2f17c4608..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/CreateOrderFromBackendWithinOfflinePaymentMethodsTest.xml +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - Create backend order with simple product for existing customer. - catalogProductSimple::default - default - US_address_without_email - Flat Rate - Fixed - 315.00 - checkmo - Pending - - - johndoe_unique - - - - - - - - - - Create backend order with simple product for existing customer. - catalogProductSimple::default - default - US_address_without_email - Flat Rate - Fixed - 315.00 - checkmo - Pending - - - johndoe_unique - - - - - - - - - - Create backend order with simple product for existing customer and discount coupon. - catalogProductSimple::default - default - US_address_without_email - Flat Rate - Fixed - 165.00 - checkmo - Pending - - - johndoe_unique - active_sales_rule_for_all_groups - - - - - - - - Create backend order with simple product for existing customer and apply discount coupon. - catalogProductSimple::default - default - US_address_without_email - Flat Rate - Fixed - 165.00 - checkmo - Pending - - - johndoe_unique - active_sales_rule_for_all_groups - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/MoveShoppingCartProductsOnOrderPageTest.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/MoveShoppingCartProductsOnOrderPageTest.php deleted file mode 100644 index 8a80f61f234..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/MoveShoppingCartProductsOnOrderPageTest.php +++ /dev/null @@ -1,48 +0,0 @@ - All Customers. - * 2. Search and open customer from preconditions. - * 3. Click Create Order. - * 4. Check product in Shopping Cart section. - * 5. Click Update Changes. - * 6. Perform all assertions. - * - * @group Order_Management_(CS) - * @ZephyrId MPERF-7553 - */ -class MoveShoppingCartProductsOnOrderPageTest extends Scenario -{ - /** - * Create order from customer page(cartActions). - * - * @return array - */ - public function test() - { - $this->executeScenario(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/MoveShoppingCartProductsOnOrderPageTest.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/MoveShoppingCartProductsOnOrderPageTest.xml deleted file mode 100644 index 2dd9c14fcab..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/MoveShoppingCartProductsOnOrderPageTest.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - catalogProductSimple::default - johndoe_unique - 100.00 - - - - configurableProduct::default - johndoe_unique - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/ReorderOrderEntityTest.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/ReorderOrderEntityTest.php deleted file mode 100644 index 0c63fb5a42f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/ReorderOrderEntityTest.php +++ /dev/null @@ -1,57 +0,0 @@ - Orders. - * 3. Open the created order. - * 4. Do 'Reorder' for placed order. - * 5. Perform all assertions. - * - * @group Order_Management_(CS) - * @ZephyrId MPERF-7655 - */ -class ReorderOrderEntityTest extends Scenario -{ - /** - * Delete all tax rules. - * - * @return void - */ - public function __prepare() - { - $this->objectManager->create('\Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - } - - /** - * Reorder created order. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/ReorderOrderEntityTest.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/ReorderOrderEntityTest.xml deleted file mode 100644 index f201b462dd6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/ReorderOrderEntityTest.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - Reorder placed order (update products, billing address). - default_tax_configuration - default - customer_US - customer_US_login - Flat Rate - Fixed - 315.00 - checkmo - Pending - Pending - Back, Reorder, Cancel, Hold, Invoice, Ship, Edit - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/AbstractCreateRefundStep.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/AbstractCreateRefundStep.php deleted file mode 100644 index eb1879e030f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/AbstractCreateRefundStep.php +++ /dev/null @@ -1,85 +0,0 @@ -objectManager->create('Mage\Sales\Test\Page\Adminhtml\SalesOrderCreditMemoNew'); - } - - /** - * Create offline refund. - * - * @return void - */ - protected function salesEntityAction() - { - $orderForm = $this->salesOrderView->getOrderForm(); - $orderForm->openTab('invoices'); - $this->invoiceViewPage = $this->objectManager->create('Mage\Sales\Test\Page\Adminhtml\SalesInvoiceView'); - $orderForm->getTabElement('invoices')->getGrid()->searchAndOpen(['id' => $this->currentInvoiceId]); - $this->invoiceViewPage->getPageActions()->creditMemo(); - } - - /** - * Process offline credit memo step. - * - * @param int $index [optional] - * @return void - */ - protected function processStep($index = 0) - { - $invoiceIds = $this->getEntityIds('invoice'); - foreach ($invoiceIds as $key => $id){ - $this->currentInvoiceId = $id; - parent::processStep($key); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/AbstractCreateSalesEntityStep.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/AbstractCreateSalesEntityStep.php deleted file mode 100644 index 7e5c2963d59..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/AbstractCreateSalesEntityStep.php +++ /dev/null @@ -1,216 +0,0 @@ -objectManager = $objectManager; - $this->orderIndex = $orderIndex; - $this->salesOrderView = $salesOrderView; - $this->orderSalesEntityNew = $this->getSalesEntityNewPage(); - $this->order = $order; - $this->data = $data; - $this->action = $action; - $this->orderId = ($orderId == null) ? $this->order->getId() : $orderId; - $this->products = ($products == null) ? $this->order->getEntityId()['products'] : $products; - } - - /** - * Create sales entity for order on backend. - * - * @return array - */ - public function run() - { - $this->orderIndex->open(); - $this->orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $this->orderId]); - $this->processStep(); - - return ['ids' => [$this->entityType . 'Ids' => $this->getEntityIds($this->entityType)]]; - } - - /** - * Process step. - * - * @param int $index [optional] - * @return void - */ - protected function processStep($index = 0) - { - if (isset($this->action[$this->entityType][$index]) && $this->action[$this->entityType][$index] == false) { - return; - } - $this->salesEntityAction(); - $this->fillData($index); - $this->salesEntitySubmit(); - } - - /** - * Fill data for step. - * - * @param int $index - * @return void - */ - protected function fillData($index) - { - if (!empty($this->data[$this->entityType][$index])) { - $data = $this->data[$this->entityType][$index]; - $this->orderSalesEntityNew->getFormBlock()->fillData($data, $this->products); - } - } - - /** - * Sales entity submit. - * - * @return void - */ - protected function salesEntitySubmit() - { - $this->orderSalesEntityNew->getFormBlock()->submit(); - } - - /** - * Sales entity action. - * - * @return void - */ - protected function salesEntityAction() - { - $this->salesOrderView->getPageActions()->{$this->entityType}(); - } - - /** - * Get sales entity id. - * - * @param string $entity - * @return array - */ - public function getEntityIds($entity) - { - $this->salesOrderView->getOrderForm()->openTab($entity . 's'); - return $this->salesOrderView->getOrderForm()->getTabElement($entity . 's')->getGrid()->getIds(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/AddProductsStep.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/AddProductsStep.php deleted file mode 100644 index 61e02851a38..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/AddProductsStep.php +++ /dev/null @@ -1,68 +0,0 @@ -salesOrderCreateIndex = $salesOrderCreateIndex; - $this->products = $products; - } - - /** - * Add products to order during creating backend order. - * - * @return void - */ - public function run() - { - $createBlock = $this->salesOrderCreateIndex->getCreateBlock(); - $createBlock->getItemsBlock()->clickAddProducts(); - $productsGrid = $createBlock->getSearchBlock()->getSearchGrid(); - foreach ($this->products as $product) { - $productsGrid->searchAndSelect(['sku' => $product->getSku()]); - } - $createBlock->getSearchBlock()->addSelectedProductsToOrder(); - $createBlock->getTemplateBlock()->waitLoader(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/CreateInvoiceStep.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/CreateInvoiceStep.php deleted file mode 100644 index 16a545b6b7d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/CreateInvoiceStep.php +++ /dev/null @@ -1,41 +0,0 @@ -objectManager->create('Mage\Sales\Test\Page\Adminhtml\SalesOrderInvoiceNew'); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/CreateNewOrderStep.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/CreateNewOrderStep.php deleted file mode 100644 index 1309d19d214..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/CreateNewOrderStep.php +++ /dev/null @@ -1,51 +0,0 @@ -orderIndex = $orderIndex; - } - - /** - * Create new order. - * - * @return void - */ - public function run() - { - $this->orderIndex->getPageActionsBlock()->addNew(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/CreateNewOrderViaCurlStep.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/CreateNewOrderViaCurlStep.php deleted file mode 100644 index 5fb044f991d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/CreateNewOrderViaCurlStep.php +++ /dev/null @@ -1,65 +0,0 @@ -fixtureFactory = $fixtureFactory; - $this->dataset = $orderdataset; - } - - /** - * Create new order via curl. - * - * @return array - */ - public function run() - { - /** @var Order $order */ - $order = $this->fixtureFactory->createByCode('order', ['dataset' => $this->orderdataset]); - $order->persist(); - - return ['order' => $order]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/CreateOfflineRefundStep.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/CreateOfflineRefundStep.php deleted file mode 100644 index 3bcbcb12d70..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/CreateOfflineRefundStep.php +++ /dev/null @@ -1,32 +0,0 @@ -orderSalesEntityNew->getFormBlock()->offlineRefund(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/CreateOnlineRefundStep.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/CreateOnlineRefundStep.php deleted file mode 100644 index 24de170d83c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/CreateOnlineRefundStep.php +++ /dev/null @@ -1,32 +0,0 @@ -orderSalesEntityNew->getFormBlock()->onlineRefund(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/FillBillingAddressStep.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/FillBillingAddressStep.php deleted file mode 100644 index 489a1290d3b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/FillBillingAddressStep.php +++ /dev/null @@ -1,63 +0,0 @@ -salesOrderCreateIndex = $salesOrderCreateIndex; - $this->billingAddress = $billingAddress; - } - - /** - * Fill Billing address. - * - * @return Address - */ - public function run() - { - $this->salesOrderCreateIndex->getCreateBlock()->getBillingAddressForm()->fill($this->billingAddress); - - return ['billingAddress' => $this->billingAddress]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/MoveProductsFromShoppingCartSidebarStep.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/MoveProductsFromShoppingCartSidebarStep.php deleted file mode 100644 index 1d785bd4be4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/MoveProductsFromShoppingCartSidebarStep.php +++ /dev/null @@ -1,61 +0,0 @@ -orderCreateIndex = $orderCreateIndex; - $this->products = $products; - } - - /** - * Move products from shopping cart sidebar on create order page. - * - * @return void - */ - public function run() - { - $this->orderCreateIndex->getCustomerActivitiesBlock()->getShoppingCartItemsBlock()->addToOrder($this->products); - $this->orderCreateIndex->getCustomerActivitiesBlock()->updateChanges(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/OpenOrderStep.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/OpenOrderStep.php deleted file mode 100644 index c4d77c6b6ae..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/OpenOrderStep.php +++ /dev/null @@ -1,62 +0,0 @@ -orderIndex = $orderIndex; - $this->order = $order; - } - - /** - * Open order. - * - * @return void - */ - public function run() - { - $this->orderIndex->open(); - $this->orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $this->order->getId()]); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/OpenSalesOrderOnFrontendForGuestStep.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/OpenSalesOrderOnFrontendForGuestStep.php deleted file mode 100644 index 34cc1f4a844..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/OpenSalesOrderOnFrontendForGuestStep.php +++ /dev/null @@ -1,88 +0,0 @@ -customerAccountLogout = $customerAccountLogout; - $this->cmsIndex = $cmsIndex; - $this->salesGuestForm = $salesGuestForm; - $this->order = $order; - } - - /** - * Run step. - * - * @return void - */ - public function run() - { - $this->customerAccountLogout->open(); - $this->cmsIndex->getFooterBlock()->clickLink('Orders and Returns'); - $this->salesGuestForm->getSearchForm()->fill($this->order); - $this->salesGuestForm->getSearchForm()->submit(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/OpenSalesOrdersStep.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/OpenSalesOrdersStep.php deleted file mode 100644 index 066bd30b248..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/OpenSalesOrdersStep.php +++ /dev/null @@ -1,51 +0,0 @@ -orderIndex = $orderIndex; - } - - /** - * Open Sales order. - * - * @return void - */ - public function run() - { - $this->orderIndex->open(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/PrintOrderOnFrontendStep.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/PrintOrderOnFrontendStep.php deleted file mode 100644 index 05d82806698..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/PrintOrderOnFrontendStep.php +++ /dev/null @@ -1,62 +0,0 @@ -salesGuestView = $salesGuestView; - $this->browser = $browser; - } - - /** - * Click on "Print Order" button. - * - * @return void - */ - public function run() - { - $this->salesGuestView->getActionsToolbar()->clickLink('Print Order'); - $this->browser->selectWindow(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/ReorderOrderStep.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/ReorderOrderStep.php deleted file mode 100644 index 0a0d409180e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/ReorderOrderStep.php +++ /dev/null @@ -1,51 +0,0 @@ -salesOrderView = $salesOrderView; - } - - /** - * Click reorder. - * - * @return void - */ - public function run() - { - $this->salesOrderView->getPageActions()->reorder(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/SelectCustomerOrderStep.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/SelectCustomerOrderStep.php deleted file mode 100644 index 265d94a9d58..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/SelectCustomerOrderStep.php +++ /dev/null @@ -1,61 +0,0 @@ -orderCreateIndex = $orderCreateIndex; - $this->customer = $customer; - } - - /** - * Select Customer for Order. - * - * @return void - */ - public function run() - { - $this->orderCreateIndex->getCustomerGrid()->selectCustomer($this->customer); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/SelectPaymentMethodForOrderStep.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/SelectPaymentMethodForOrderStep.php deleted file mode 100644 index f0e519e0acf..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/SelectPaymentMethodForOrderStep.php +++ /dev/null @@ -1,60 +0,0 @@ -salesOrderCreateIndex = $salesOrderCreateIndex; - $this->payment = $payment; - } - - /** - * Fill Payment data. - * - * @return void - */ - public function run() - { - $this->salesOrderCreateIndex->getCreateBlock()->getPaymentBlock()->selectPaymentMethod($this->payment); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/SelectShippingMethodForOrderStep.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/SelectShippingMethodForOrderStep.php deleted file mode 100644 index 80af637390a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/SelectShippingMethodForOrderStep.php +++ /dev/null @@ -1,62 +0,0 @@ -salesOrderCreateIndex = $salesOrderCreateIndex; - $this->shipping = $shipping; - } - - /** - * Fill Shipping Data. - * - * @return array - */ - public function run() - { - if ($this->shipping['shipping_service'] != '-') { - $this->salesOrderCreateIndex->getCreateBlock()->getShippingBlock()->selectShippingMethod($this->shipping); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/SelectStoreOnCreateOrderStep.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/SelectStoreOnCreateOrderStep.php deleted file mode 100644 index b5aa3f1e7f3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/SelectStoreOnCreateOrderStep.php +++ /dev/null @@ -1,61 +0,0 @@ -orderCreateIndex = $orderCreateIndex; - $this->store = $store; - } - - /** - * Select Store on create order page. - * - * @return void - */ - public function run() - { - $this->orderCreateIndex->getStoreBlock()->selectStoreView($this->store); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/SubmitOrderStep.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/SubmitOrderStep.php deleted file mode 100644 index b00067e6695..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/SubmitOrderStep.php +++ /dev/null @@ -1,125 +0,0 @@ -salesOrderCreateIndex = $salesOrderCreateIndex; - $this->salesOrderView = $salesOrderView; - $this->fixtureFactory = $fixtureFactory; - $this->customer = $customer; - $this->billingAddress = $billingAddress; - $this->products = $products; - $this->order = $order; - } - - /** - * Fill Sales Data. - * - * @return array - */ - public function run() - { - $this->salesOrderCreateIndex->getCreateBlock()->submitOrder(); - $this->salesOrderView->getMessagesBlock()->waitSuccessMessage(); - $orderId = $this->salesOrderView->getTitleBlock()->getOrderId(); - $order = $this->createOrderFixture($orderId); - - return ['orderId' => $orderId, 'order' => $order]; - } - - /** - * Create order fixture. - * - * @param string $orderId - * @return Order - */ - protected function createOrderFixture($orderId) - { - return ($this->order !== null) - ? $this->order - : $this->fixtureFactory->createByCode( - 'order', - [ - 'data' => [ - 'id' => $orderId, - 'customer_id' => ['customer' => $this->customer], - 'entity_id' => ['products' => $this->products], - 'billing_address_id' => ['billingAddress' => $this->billingAddress], - ] - ] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/UpdateProductsDataStep.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/UpdateProductsDataStep.php deleted file mode 100644 index 7064917f373..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/UpdateProductsDataStep.php +++ /dev/null @@ -1,60 +0,0 @@ -salesOrderCreateIndex = $salesOrderCreateIndex; - $this->products = $products; - } - - /** - * Fill product data. - * - * @return void - */ - public function run() - { - $this->salesOrderCreateIndex->getCreateBlock()->getItemsBlock()->updateProductsData($this->products); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/etc/curl/di.xml deleted file mode 100644 index 5dddb56ee95..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/etc/curl/di.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/etc/fixture.xml deleted file mode 100644 index 14fcc28778a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/etc/fixture.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - flat - sales_order - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/etc/testcase.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/etc/testcase.xml deleted file mode 100644 index 346581b72d6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/etc/testcase.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AbstractCartPriceRuleApplying.php b/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AbstractCartPriceRuleApplying.php deleted file mode 100644 index 24799cb4cc0..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AbstractCartPriceRuleApplying.php +++ /dev/null @@ -1,242 +0,0 @@ -checkoutCart = $checkoutCart; - $this->cmsIndex = $cmsIndex; - $this->customerAccountLogin = $customerAccountLogin; - $this->customerAccountLogout = $customerAccountLogout; - $this->catalogCategoryView = $catalogCategoryView; - $this->catalogProductView = $catalogProductView; - $this->customer = $customer; - $this->browser = $browser; - $this->productForSalesRule1 = $productForSalesRule1; - $this->productForSalesRule2 = $productForSalesRule2; - $isLoggedIn ? $this->login() : $this->customerAccountLogout->open(); - $this->checkoutCart->open()->getCartBlock()->clearShoppingCart(); - $this->addProductsToCart($productQuantity); - if ($address->hasData('country_id')) { - $this->checkoutCart->getShippingBlock()->fillEstimateShippingAndTax($address); - if (!empty($shipping)) { - $this->checkoutCart->getShippingBlock()->selectShippingMethod($shipping); - } - } - if ($salesRule->getCouponCode()) { - $this->checkoutCart->getDiscountCodesBlock()->applyCouponCode($salesRule->getCouponCode()); - } - $this->assert(); - } - - /** - * Log in customer. - * - * @return void - */ - protected function login() - { - $this->objectManager->create( - 'Mage\Customer\Test\TestStep\LoginCustomerOnFrontendStep', - ['customer' => $this->customer] - )->run(); - } - - /** - * Add products to cart. - * - * @param array $productQuantity - * @return void - */ - protected function addProductsToCart(array $productQuantity) - { - foreach ($productQuantity as $product => $quantity) { - if ($quantity > 0) { - $this->browser->open($_ENV['app_frontend_url'] . $this->$product->getUrlKey() . '.html'); - $this->catalogProductView->getViewBlock()->setQty($quantity); - $this->catalogProductView->getViewBlock()->clickAddToCart(); - } - } - } - - /** - * Get totals from total block in shopping cart. - * - * @return array - */ - protected function getTotals() - { - $totals = []; - $totals['subtotal'] = $this->checkoutCart->getTotalsBlock()->getData('subtotal'); - $totals['grandTotal'] = $this->checkoutCart->getTotalsBlock()->getData('grand_total'); - if ($this->checkoutCart->getTotalsBlock()->isVisibleShippingPriceBlock()) { - $shippingPrice = $this->checkoutCart->getTotalsBlock()->getData('shipping_price'); - $totals['grandTotal'] = number_format(($totals['grandTotal'] - $shippingPrice), 2); - } - - return $totals; - } -} diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleConditionIsApplied.php b/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleConditionIsApplied.php deleted file mode 100644 index 5e43dbd2b15..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleConditionIsApplied.php +++ /dev/null @@ -1,52 +0,0 @@ -getTotals(); - \PHPUnit_Framework_Assert::assertNotEquals( - $totals['subtotal'], - $totals['grandTotal'], - "Shopping cart subtotal: " . $totals['subtotal'] . " equals with grand total: " . $totals['grandTotal'] - . ".\nPrice rule hasn't been applied." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return "Shopping cart subtotal doesn't equal to grand total - price rule has been applied."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleConditionIsNotApplied.php b/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleConditionIsNotApplied.php deleted file mode 100644 index b06f0a6e3f0..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleConditionIsNotApplied.php +++ /dev/null @@ -1,52 +0,0 @@ -getTotals(); - \PHPUnit_Framework_Assert::assertEquals( - $totals['subtotal'], - $totals['grandTotal'], - "Shopping cart subtotal: " . $totals['subtotal'] . " not equals with grand total: " . $totals['grandTotal'] - . ".\nPrice rule has been applied." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return "Shopping cart subtotal equals with grand total - price rule hasn't been applied."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleForm.php b/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleForm.php deleted file mode 100644 index d9ab692b698..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleForm.php +++ /dev/null @@ -1,68 +0,0 @@ -open(); - $promoQuoteIndex->getPromoQuoteGrid()->searchAndOpen(['name' => $salesRule->getName()]); - $formData = $promoQuoteEdit->getSalesRuleForm()->getData($salesRule); - $errors = $this->verifyData($salesRule->getData(), $formData); - \PHPUnit_Framework_Assert::assertEmpty($errors, $errors); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Displayed sales rule data on edit page equals to passed from fixture.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleFreeShippingIsApplied.php b/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleFreeShippingIsApplied.php deleted file mode 100644 index 2dbf092d8f2..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleFreeShippingIsApplied.php +++ /dev/null @@ -1,55 +0,0 @@ -checkoutCart->getTotalsBlock()->getData('shipping_price'), - self::FREE_SHIPPING_PRICE, - "Free shipping hasn't been applied." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Free shipping is applied.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleIsAppliedToShipping.php b/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleIsAppliedToShipping.php deleted file mode 100644 index b7cf0cc3b15..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleIsAppliedToShipping.php +++ /dev/null @@ -1,56 +0,0 @@ -checkoutCart->getTotalsBlock()->getData('subtotal'); - $grandTotal = $this->checkoutCart->getTotalsBlock()->getData('grand_total'); - $shippingPrice = $this->checkoutCart->getTotalsBlock()->getData('shipping_price'); - $discount = $this->checkoutCart->getTotalsBlock()->getData('discount'); - $calculatedGrandTotal = number_format(((float)$subTotal + (float)$shippingPrice - (float)$discount), 2); - \PHPUnit_Framework_Assert::assertEquals( - $calculatedGrandTotal, - $grandTotal, - "Calculated grand total: '$calculatedGrandTotal' not equals with grand total: '$grandTotal' \n" - . "Price rule hasn't been applied to shipping amount." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return "Price rule is applied to shipping amount."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleIsNotPresentedInGrid.php b/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleIsNotPresentedInGrid.php deleted file mode 100644 index 1e9caf86c01..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleIsNotPresentedInGrid.php +++ /dev/null @@ -1,52 +0,0 @@ -open(); - \PHPUnit_Framework_Assert::assertFalse( - $promoQuoteIndex->getPromoQuoteGrid()->isRowVisible(['name' => $salesRule->getName()]), - "Sales rule {$salesRule->getName()} is present in cart price rules grid." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Sales rule is not present in cart price rules grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleSuccessDeleteMessage.php deleted file mode 100644 index 2b2b6a6709b..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleSuccessDeleteMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Sales rule success delete message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleSuccessSaveMessage.php b/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleSuccessSaveMessage.php deleted file mode 100644 index ede63299be8..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleSuccessSaveMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Sales rule success save message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Fixture/SalesRule.xml b/dev/tests/functional/tests/app/Mage/SalesRule/Test/Fixture/SalesRule.xml deleted file mode 100644 index 716e596c195..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Fixture/SalesRule.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Fixture/SalesRule/WebsiteIds.php b/dev/tests/functional/tests/app/Mage/SalesRule/Test/Fixture/SalesRule/WebsiteIds.php deleted file mode 100644 index f1e8d851857..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Fixture/SalesRule/WebsiteIds.php +++ /dev/null @@ -1,64 +0,0 @@ -params = $params; - foreach ($data as $dataset) { - $website = $fixtureFactory->createByCode('website', ['dataset' => trim($dataset)]); - /** @var Website $website */ - if (!$website->hasData('website_id')) { - $website->persist(); - } - $this->websites[] = $website; - $this->data[] = $website->getName(); - } - } - - /** - * Return Websites array. - * - * @return Website[] - */ - public function getWebsites() - { - return $this->websites; - } -} diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Handler/SalesRule/Curl.php b/dev/tests/functional/tests/app/Mage/SalesRule/Test/Handler/SalesRule/Curl.php deleted file mode 100644 index 795f80f266e..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Handler/SalesRule/Curl.php +++ /dev/null @@ -1,184 +0,0 @@ - [ - 'Active' => 1, - 'Inactive' => 0, - ], - 'coupon_type' => [ - 'No Coupon' => 1, - 'Specific Coupon' => 2, - 'Auto' => 3, - ], - 'is_rss' => [ - 'Yes' => 1, - 'No' => 2, - ], - 'simple_action' => [ - 'Percent of product price discount' => 'by_percent', - 'Fixed amount discount' => 'by_fixed', - 'Fixed amount discount for whole cart' => 'cart_fixed', - 'Buy X get Y free (discount amount is Y)' => 'buy_x_get_y', - ], - 'apply_to_shipping' => [ - 'Yes' => 1, - 'No' => 2, - ], - 'stop_rules_processing' => [ - 'Yes' => 1, - 'No' => 2, - ], - 'simple_free_shipping' => [ - 'No' => 0, - 'For matching items only' => 1, - 'For shipment with matching items' => 2, - ], - 'website_ids' => [ - 'Main Website' => 1 - ] - ]; - - /** - * Map of type parameter. - * - * @var array - */ - protected $mapTypeParams = [ - 'Conditions combination' => [ - 'type' => 'salesrule/rule_condition_combine', - 'aggregator' => 'all', - 'value' => '1', - ], - 'Category' => [ - 'type' => 'salesrule/rule_condition_product', - 'attribute' => 'category_ids', - ] - ]; - - /** - * Mapping values for customer group. - * - * @var array - */ - protected $customerIds = [ - 'NOT LOGGED IN' => 0, - 'General' => 1, - 'Wholesale' => 2, - 'Retailer' => 3, - ]; - - /** - * Post request for creating sales rule. - * - * @param FixtureInterface $fixture [optional] - * @return array - * @throws \Exception - */ - public function persist(FixtureInterface $fixture = null) - { - $url = $_ENV['app_backend_url'] . 'promo_quote/save/'; - $data = $this->replaceMappingData($fixture->getData()); - $data['customer_group_ids'] = $this->prepareCustomerGroup($data); - $data['website_ids'] = $this->prepareWebsiteIds($fixture); - if (isset($data['conditions_serialized'])) { - $data['rule']['conditions'] = $this->prepareCondition($data['conditions_serialized']); - unset($data['conditions_serialized']); - } - - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->write($url, $data); - $response = $curl->read(); - $curl->close(); - if (!strpos($response, 'class="messages"')) { - throw new \Exception("Sales rule entity creating by curl handler was not successful! Response: $response"); - } - $id = $this->getSalesRuleId($response); - - return ['rule_id' => $id]; - } - - /** - * Prepare website ids for curl. - * - * @param SalesRule $fixture - * @return array - */ - protected function prepareWebsiteIds(SalesRule $fixture) - { - $websites = $fixture->getDataFieldConfig('website_ids')['source']->getWebsites(); - $data = []; - /** @var Website $website */ - foreach ($websites as $website) { - $data[] = $website->getWebsiteId(); - } - return $data; - } - - /** - * Prepare customer group data for curl. - * - * @param array $data - * @return array - */ - protected function prepareCustomerGroup(array $data) - { - $groupIds = []; - if (!empty($data['customer_group_ids'])) { - foreach ($data['customer_group_ids'] as $name) { - $groupIds[] = isset($this->customerIds[$name]) ? $this->customerIds[$name] : $name; - } - } - - return $groupIds; - } - - /** - * Return saved sales rule id. - * - * @param string $response - * @return int|null - * @throws \Exception - */ - protected function getSalesRuleId($response) - { - preg_match_all('~promo_quote/edit[^\s]*\/id\/(\d+)~', $response, $matches); - if (empty($matches)) { - throw new \Exception('Cannot find Sales Rule id'); - } - - return max(empty($matches[1]) ? null : $matches[1]); - } -} diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Handler/SalesRule/SalesRuleInterface.php b/dev/tests/functional/tests/app/Mage/SalesRule/Test/Handler/SalesRule/SalesRuleInterface.php deleted file mode 100644 index dc927400c81..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Handler/SalesRule/SalesRuleInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Page/Adminhtml/PromoQuoteIndex.xml b/dev/tests/functional/tests/app/Mage/SalesRule/Test/Page/Adminhtml/PromoQuoteIndex.xml deleted file mode 100644 index de0530714e1..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Page/Adminhtml/PromoQuoteIndex.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Page/Adminhtml/PromoQuoteNew.xml b/dev/tests/functional/tests/app/Mage/SalesRule/Test/Page/Adminhtml/PromoQuoteNew.xml deleted file mode 100644 index 2958e525e79..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Page/Adminhtml/PromoQuoteNew.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Repository/SalesRule.xml b/dev/tests/functional/tests/app/Mage/SalesRule/Test/Repository/SalesRule.xml deleted file mode 100644 index a2153df4b5d..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Repository/SalesRule.xml +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - Shopping Cart Price Rule %isolation% - Active - - NOT LOGGED IN - General - Wholesale - Retailer - - - main_website - - No Coupon - Percent of product price discount - 50 - - - - Shopping Cart Price Rule with Specific Coupon %isolation% - Description for Cart Price Rule - Active - - main_website - - - NOT LOGGED IN - - Specific Coupon - 123-abc-ABC-987-%isolation% - Percent of product price discount - 50 - - Shopping Cart price Rule with Specific Coupon - Shopping Cart price Rule with Specific Coupon - - - - - Shopping Cart Price Rule with Specific Coupon %isolation% - Description for Cart Price Rule - Active - - main_website - - - NOT LOGGED IN - General - Wholesale - Retailer - - Specific Coupon - 123-abc-ABC-987-%isolation% - Percent of product price discount - 50 - - Shopping Cart price Rule with Specific Coupon - Shopping Cart price Rule with Specific Coupon - - - - - Shopping Cart Price Rule with Specific Coupon %isolation% - Description for Cart Price Rule - Active - - main_website - - - NOT LOGGED IN - General - Wholesale - Retailer - - No Coupon - Percent of product price discount - 50 - - - - Shopping Cart Price Rule with with conditions %isolation% - Shopping Cart Price Rule with conditions - Active - - main_website - - - NOT LOGGED IN - General - Wholesale - Retailer - - Specific Coupon - 123-abc-ABC-987-%isolation% - 13 - 63 - - 3/25/2014 - - - 6/29/2024 - - 1 - Yes - [Category|is|2] - Percent of product price discount - 50 - 0 - Yes - Yes - For matching items only - - Shopping Cart Price Rule with conditions - Shopping Cart Price Rule with conditions - - - - Inactive Cart Price Rule %isolation% - Inactive - - main_website - - - NOT LOGGED IN - - No Coupon - Percent of product price discount - 50 - - - diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestCase/CreateSalesRuleEntityTest.php b/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestCase/CreateSalesRuleEntityTest.php deleted file mode 100644 index d8c39983427..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestCase/CreateSalesRuleEntityTest.php +++ /dev/null @@ -1,166 +0,0 @@ - Shopping Cart Price Rules. - * 3. Click "Add new rule" button. - * 4. Fill form according to data set. - * 5. Click "Save" button. - * 6. Perform asserts. - * - * @group Shopping_Cart_Price_Rules_(CS) - * @ZephyrId MPERF-6748 - */ -class CreateSalesRuleEntityTest extends Injectable -{ - /** - * Page PromoQuoteNew. - * - * @var PromoQuoteNew - */ - protected $promoQuoteNew; - - /** - * Page PromoQuoteEdit. - * - * @var PromoQuoteEdit - */ - protected $promoQuoteEdit; - - /** - * Page PromoQuoteIndex. - * - * @var PromoQuoteIndex - */ - protected $promoQuoteIndex; - - /** - * Sales rule name. - * - * @var string - */ - protected $salesRuleName; - - /** - * Fixture factory. - * - * @var FixtureFactory - */ - protected $fixtureFactory; - - /** - * Create customer and 2 simple products with categories before run test. - * - * @param FixtureFactory $fixtureFactory - * @param Customer $customer - * @return array - */ - public function __prepare(FixtureFactory $fixtureFactory, Customer $customer) - { - $this->fixtureFactory = $fixtureFactory; - $customer->persist(); - $products = $this->createProducts(['simple_for_salesrule_1', 'simple_for_salesrule_2']); - - return [ - 'customer' => $customer, - 'productForSalesRule1' => $products[0], - 'productForSalesRule2' => $products[1] - ]; - } - - /** - * Inject data. - * - * @param PromoQuoteIndex $promoQuoteIndex - * @param PromoQuoteNew $promoQuoteNew - * @param PromoQuoteEdit $promoQuoteEdit - * @return void - */ - public function __inject( - PromoQuoteIndex $promoQuoteIndex, - PromoQuoteNew $promoQuoteNew, - PromoQuoteEdit $promoQuoteEdit - ) { - $this->promoQuoteIndex = $promoQuoteIndex; - $this->promoQuoteNew = $promoQuoteNew; - $this->promoQuoteEdit = $promoQuoteEdit; - } - - /** - * Create Sales Rule. - * - * @param SalesRule $salesRule - * @return void - */ - public function test(SalesRule $salesRule) - { - // Prepare data for tearDown - $this->salesRuleName = $salesRule->getName(); - - // Steps - $this->promoQuoteIndex->open(); - $this->promoQuoteIndex->getGridPageActions()->addNew(); - $this->promoQuoteNew->getSalesRuleForm()->fill($salesRule); - $this->promoQuoteNew->getFormPageActions()->save(); - } - - /** - * Create products. - * - * @param array $productsdatasets - * @return array - */ - protected function createProducts(array $productsdatasets) - { - $products = []; - foreach ($productsdatasets as $dataset){ - $product = $this->fixtureFactory->createByCode('catalogProductSimple', ['dataset' => $dataset]); - $product->persist(); - $products[] = $product; - } - return $products; - } - - /** - * Delete sales rule. - * - * @return void - */ - public function tearDown() - { - if ($this->salesRuleName !== null) { - $this->promoQuoteIndex->open(); - $this->promoQuoteIndex->getPromoQuoteGrid()->searchAndOpen(['name' => $this->salesRuleName]); - $this->promoQuoteEdit->getFormPageActions()->delete(); - $this->salesRuleName = null; - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestCase/CreateSalesRuleEntityTest.xml b/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestCase/CreateSalesRuleEntityTest.xml deleted file mode 100644 index 32eb69c7e25..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestCase/CreateSalesRuleEntityTest.xml +++ /dev/null @@ -1,293 +0,0 @@ - - - - - - Sales rule with discount 50%. - 0 - 1 - 0 - Shopping Cart Price Rule1 %isolation% - Shopping Cart Price Rule Description %isolation% - Active - NOT LOGGED IN - No Coupon - Percent of product price discount - 50 - No - No - Sales Cart Rule labels - - - - - - Sales rule with coupon code and fixed amount discount. - 0 - 2 - 0 - Shopping Cart Price Rule2 %isolation% - Shopping Cart Price Rule Description %isolation% - Active - NOT LOGGED IN - Specific Coupon - 1A2B3C-456-zxc-%isolation% - Fixed amount discount - 35 - No - No - Coupon code+fixed amount discount - - - - - - Sales rule with coupon code and fixed amount discount for whole cart. - 0 - 3 - 0 - Shopping Cart Price Rule3 %isolation% - Shopping Cart Price Rule Description %isolation% - Active - NOT LOGGED IN - Specific Coupon - Lorem ipsum dolor sit amet, consectetur adipiscing elit - %isolation% - Fixed amount discount for whole cart - 60 - No - No - Coupon code+Fixed amount discount for whole cart - - - - - - Sales rule with buy X get Y free. - 0 - 4 - 0 - Shopping Cart Price Rule4 %isolation% - Shopping Cart Price Rule Description %isolation% - Active - NOT LOGGED IN - Specific Coupon - 1A2B3C-456-zxc-%isolation% - Buy X get Y free (discount amount is Y) - 1 - 3 - No - No - Buy X get Y free - - - - - - Sales rule with discount quantity and logged user. - 1 - 3 - 0 - Shopping Cart Price Rule5 %isolation% - Shopping Cart Price Rule Description %isolation% - Active - General - No Coupon - Percent of product price discount - 50 - 2 - No - No - - - - - - Sales rule with applying discount to shipping amount. - United States - California - 95814 - Flat Rate - Fixed - 0 - 1 - 1 - Shopping Cart Price Rule6 %isolation% - Shopping Cart Price Rule Description %isolation% - Active - NOT LOGGED IN - No Coupon - Percent of product price discount - 50 - Yes - No - Apply discount to Shipping Amount - - - - - - Sales rule with free shipping. - United States - California - 95814 - Flat Rate - Fixed - 0 - 1 - 1 - Shopping Cart Price Rule7 %isolation% - Shopping Cart Price Rule Description %isolation% - Active - NOT LOGGED IN - No Coupon - Percent of product price discount - 50 - No - For matching items only - Free Shipping in conditions - - - - - - - Sales rule with condition: [Subtotal|is|150]. - 0 - 1 - 1 - Shopping Cart Price Rule8 %isolation% - Shopping Cart Price Rule Description %isolation% - Active - NOT LOGGED IN - No Coupon - [Subtotal|is|150] - Percent of product price discount - 50 - No - No - Sales Cart Rule labels - - - - - - Sales rule with wrong condition. - 0 - 2 - 0 - Shopping Cart Price Rule9 %isolation% - Shopping Cart Price Rule Description %isolation% - Active - NOT LOGGED IN - No Coupon - [Subtotal|is|150] - Percent of product price discount - 50 - No - No - Subtotal Action-Condition test - - - - - - Sales rule with condition: [Total Items Quantity|is|2]. - 0 - 2 - 0 - Shopping Cart Price Rule10 %isolation% - Shopping Cart Price Rule Description %isolation% - Active - NOT LOGGED IN - No Coupon - [Total Items Quantity|is|2] - Percent of product price discount - 50 - No - No - Total Items Quantity is 2 - - - - - - Sales rule with condition: [Total Weight|is|150]. - 0 - 1 - 1 - Shopping Cart Price Rule11 %isolation% - Shopping Cart Price Rule Description %isolation% - Active - NOT LOGGED IN - No Coupon - [Total Weight|is|150] - Percent of product price discount - 50 - No - No - Total Weight is 150 - - - - - - Sales rule with conditions combination. - United States - California - 95814 - Flat Rate - Fixed - 0 - 1 - 1 - Shopping Cart Price Rule12 %isolation% - Shopping Cart Price Rule Description %isolation% - Active - NOT LOGGED IN - No Coupon - {Conditions combination:[[Shipping Postcode|is|95814][Shipping State/Province|is|California][Shipping Country|is|United States]]} - Percent of product price discount - 50 - No - No - Rule applied conditions combination - - - - - - Sales rule with condition: {Product attribute combination:[Attribute Set|is|Default]}. - 0 - 1 - 0 - Shopping Cart Price Rule13 %isolation% - Shopping Cart Price Rule Description %isolation% - Active - NOT LOGGED IN - No Coupon - {Product attribute combination:[Attribute Set|is|Default]} - Percent of product price discount - 50 - No - No - Product attribute discount - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestCase/DeleteSalesRuleEntityTest.php b/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestCase/DeleteSalesRuleEntityTest.php deleted file mode 100644 index b54e6e3538d..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestCase/DeleteSalesRuleEntityTest.php +++ /dev/null @@ -1,81 +0,0 @@ - Shopping Cart Price Rules. - * 3. Open shopping cart price rule from preconditions. - * 4. Click 'Delete' button. - * 5. Perform asserts. - * - * @group Shopping_Cart_Price_Rules_(MX) - * @ZephyrId MPERF-7632 - */ -class DeleteSalesRuleEntityTest extends Injectable -{ - /** - * Page PromoQuoteEdit. - * - * @var PromoQuoteEdit - */ - protected $promoQuoteEdit; - - /** - * Page PromoQuoteIndex. - * - * @var PromoQuoteIndex - */ - protected $promoQuoteIndex; - - /** - * Inject data. - * - * @param PromoQuoteIndex $promoQuoteIndex - * @param PromoQuoteEdit $promoQuoteEdit - * @return void - */ - public function __inject(PromoQuoteIndex $promoQuoteIndex, PromoQuoteEdit $promoQuoteEdit) - { - $this->promoQuoteIndex = $promoQuoteIndex; - $this->promoQuoteEdit = $promoQuoteEdit; - } - - /** - * Delete Sales Rule Entity test. - * - * @param SalesRule $salesRule - * @return void - */ - public function test(SalesRule $salesRule) - { - // Preconditions: - $salesRule->persist(); - // Steps: - $this->promoQuoteIndex->open(); - $this->promoQuoteIndex->getPromoQuoteGrid()->searchAndOpen(['name' => $salesRule->getName()]); - $this->promoQuoteEdit->getFormPageActions()->delete(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestCase/DeleteSalesRuleEntityTest.xml b/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestCase/DeleteSalesRuleEntityTest.xml deleted file mode 100644 index 7116703f546..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestCase/DeleteSalesRuleEntityTest.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - active_sales_rule_for_all_groups - - - - - active_sales_rule_with_conditions - - - - - inactive_sales_rule - - - - - diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestCase/ReorderOrderEntityTest.xml b/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestCase/ReorderOrderEntityTest.xml deleted file mode 100644 index 663b3daec8b..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestCase/ReorderOrderEntityTest.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - active_sales_rule_for_all_groups - -150.00 - - - diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestStep/ApplySalesRuleOnBackendStep.php b/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestStep/ApplySalesRuleOnBackendStep.php deleted file mode 100644 index b9ef5861d60..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestStep/ApplySalesRuleOnBackendStep.php +++ /dev/null @@ -1,65 +0,0 @@ -salesRule = $salesRule; - $this->orderCreateIndex = $orderCreateIndex; - } - - /** - * Apply sales rule during backend order creation. - * - * @return void - */ - public function run() - { - if ($this->salesRule !== null) { - if ($this->salesRule->hasData('coupon_code')) { - $this->orderCreateIndex->getCreateBlock()->getCouponsBlock()->applyCouponsCode($this->salesRule); - } - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestStep/ApplySalesRuleOnFrontendStep.php b/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestStep/ApplySalesRuleOnFrontendStep.php deleted file mode 100644 index 73235fcf532..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestStep/ApplySalesRuleOnFrontendStep.php +++ /dev/null @@ -1,63 +0,0 @@ -checkoutCart = $checkoutCart; - $this->salesRule = $salesRule; - } - - /** - * Apply sales rule before one page checkout. - * - * @return void - */ - public function run() - { - if ($this->salesRule !== null) { - $this->checkoutCart->getDiscountCodesBlock()->applyCouponCode($this->salesRule->getCouponCode()); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestStep/CreateSalesRuleStep.php b/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestStep/CreateSalesRuleStep.php deleted file mode 100644 index 219416219eb..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestStep/CreateSalesRuleStep.php +++ /dev/null @@ -1,73 +0,0 @@ -fixtureFactory = $fixtureFactory; - $this->salesRule = $salesRule; - } - - /** - * Run create sales rule step. - * - * @return array - */ - public function run() - { - return ['salesRule' => $this->salesRule != '-' ? $this->createSalesRule() : null]; - } - - /** - * Create sales rule. - * - * @return SalesRule - */ - protected function createSalesRule() - { - $salesRule = $this->fixtureFactory->createByCode('salesRule', ['dataset' => $this->salesRule]); - $salesRule->persist(); - return $salesRule; - } -} diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestStep/DeleteAllSalesRuleStep.php b/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestStep/DeleteAllSalesRuleStep.php deleted file mode 100644 index 8adb95e9a53..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestStep/DeleteAllSalesRuleStep.php +++ /dev/null @@ -1,66 +0,0 @@ -promoQuoteIndex = $promoQuoteIndex; - $this->promoQuoteEdit = $promoQuoteEdit; - } - - /** - * Delete all sales rules on backend. - * - * @return array - */ - public function run() - { - $this->promoQuoteIndex->open(); - $this->promoQuoteIndex->getPromoQuoteGrid()->resetFilter(); - while ($this->promoQuoteIndex->getPromoQuoteGrid()->isFirstRowVisible()) { - $this->promoQuoteIndex->getPromoQuoteGrid()->openFirstRow(); - $this->promoQuoteEdit->getFormPageActions()->delete(); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Mage/SalesRule/Test/etc/curl/di.xml deleted file mode 100644 index 41087351f3b..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/etc/curl/di.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Mage/SalesRule/Test/etc/fixture.xml deleted file mode 100644 index 829ea216ea0..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/etc/fixture.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - flat - salesrule - Mage\SalesRule\Model\Resource\Rule\Collection - - - customer_group_ids - virtual - rule_information - - - store_labels - virtual - labels - - - coupon_code - virtual - rule_information - - - website_ids - virtual - rule_information - Mage\SalesRule\Test\Fixture\SalesRule\WebsiteIds - - - - diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/etc/testcase.xml b/dev/tests/functional/tests/app/Mage/SalesRule/Test/etc/testcase.xml deleted file mode 100644 index 225fcc37216..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/etc/testcase.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Shipping/Test/Block/Sales/Order/Shipments.php b/dev/tests/functional/tests/app/Mage/Shipping/Test/Block/Sales/Order/Shipments.php deleted file mode 100644 index 31b89db6271..00000000000 --- a/dev/tests/functional/tests/app/Mage/Shipping/Test/Block/Sales/Order/Shipments.php +++ /dev/null @@ -1,31 +0,0 @@ -blockFactory->create( - 'Mage\Shipping\Test\Block\Sales\Order\Shipments\Shipment\Items', - ['element' => $this->_rootElement->find(sprintf($this->itemsSelector, $this->config['id']))] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Shipping/Test/Block/Sales/Order/Shipments/Shipment/Items.php b/dev/tests/functional/tests/app/Mage/Shipping/Test/Block/Sales/Order/Shipments/Shipment/Items.php deleted file mode 100644 index 3441126a781..00000000000 --- a/dev/tests/functional/tests/app/Mage/Shipping/Test/Block/Sales/Order/Shipments/Shipment/Items.php +++ /dev/null @@ -1,38 +0,0 @@ -tr'; -} diff --git a/dev/tests/functional/tests/app/Mage/Shipping/Test/Block/Sales/Order/Shipments/Shipment/Items/Product.php b/dev/tests/functional/tests/app/Mage/Shipping/Test/Block/Sales/Order/Shipments/Shipment/Items/Product.php deleted file mode 100644 index f05a310bc84..00000000000 --- a/dev/tests/functional/tests/app/Mage/Shipping/Test/Block/Sales/Order/Shipments/Shipment/Items/Product.php +++ /dev/null @@ -1,33 +0,0 @@ - ['col_name' => 'Product Name'], - 'product_sku' => ['col_name' => 'SKU'], - 'item_qty' => ['col_name' => 'Qty Shipped'] - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Shipping/Test/Constraint/AssertNoShipButton.php b/dev/tests/functional/tests/app/Mage/Shipping/Test/Constraint/AssertNoShipButton.php deleted file mode 100644 index 17c3b680a58..00000000000 --- a/dev/tests/functional/tests/app/Mage/Shipping/Test/Constraint/AssertNoShipButton.php +++ /dev/null @@ -1,45 +0,0 @@ - [ - 'total_qty_from', - 'total_qty_to' - ] - ]; - - /** - * @constructor - * @param ObjectManager $objectManager - * @param EventManagerInterface $eventManager - * @param SalesShipment $salesShipment - */ - public function __construct( - ObjectManager $objectManager, - EventManagerInterface $eventManager, - SalesShipment $salesShipment - ) - { - parent::__construct($objectManager, $eventManager); - $this->salesEntityIndexPage = $salesShipment; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Shipment is present in the shipment grid with correct total qty on shipment index page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Shipping/Test/Constraint/AssertShipmentInShipmentsTab.php b/dev/tests/functional/tests/app/Mage/Shipping/Test/Constraint/AssertShipmentInShipmentsTab.php deleted file mode 100644 index b455b6f5100..00000000000 --- a/dev/tests/functional/tests/app/Mage/Shipping/Test/Constraint/AssertShipmentInShipmentsTab.php +++ /dev/null @@ -1,65 +0,0 @@ - [ - 'total_qty_from', - 'total_qty_to' - ] - ]; - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Shipment is present on shipments tab.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Shipping/Test/Constraint/AssertShipmentItems.php b/dev/tests/functional/tests/app/Mage/Shipping/Test/Constraint/AssertShipmentItems.php deleted file mode 100644 index 92f21ade108..00000000000 --- a/dev/tests/functional/tests/app/Mage/Shipping/Test/Constraint/AssertShipmentItems.php +++ /dev/null @@ -1,67 +0,0 @@ -salesTypePage = $shipmentIndex; - $this->salesTypeViewPage = $orderShipmentView; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'All shipment products are present in shipment page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Shipping/Test/Constraint/AssertShipmentItemsOnFrontend.php b/dev/tests/functional/tests/app/Mage/Shipping/Test/Constraint/AssertShipmentItemsOnFrontend.php deleted file mode 100644 index 93d4b08d838..00000000000 --- a/dev/tests/functional/tests/app/Mage/Shipping/Test/Constraint/AssertShipmentItemsOnFrontend.php +++ /dev/null @@ -1,64 +0,0 @@ -salesTypeViewPage = $shipmentView; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Shipped items quantity is equal to data from fixture on My Account page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Shipping/Test/Constraint/AssertShipmentSuccessCreateMessage.php b/dev/tests/functional/tests/app/Mage/Shipping/Test/Constraint/AssertShipmentSuccessCreateMessage.php deleted file mode 100644 index 8c70da84eef..00000000000 --- a/dev/tests/functional/tests/app/Mage/Shipping/Test/Constraint/AssertShipmentSuccessCreateMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Shipment success create message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Shipping/Test/Constraint/AssertShippingMethodOnPrintOrder.php b/dev/tests/functional/tests/app/Mage/Shipping/Test/Constraint/AssertShippingMethodOnPrintOrder.php deleted file mode 100644 index a433d10094d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Shipping/Test/Constraint/AssertShippingMethodOnPrintOrder.php +++ /dev/null @@ -1,50 +0,0 @@ -getViewBlock()->isShippingMethodVisible($shipping), - "Shipping method was printed incorrectly." - ); - } - - /** - * Returns a string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return "Shipping method was printed correctly."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Shipping/Test/Page/Adminhtml/SalesOrderShipmentNew.xml b/dev/tests/functional/tests/app/Mage/Shipping/Test/Page/Adminhtml/SalesOrderShipmentNew.xml deleted file mode 100644 index d9950921c4a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Shipping/Test/Page/Adminhtml/SalesOrderShipmentNew.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Shipping/Test/Page/Adminhtml/SalesShipment.xml b/dev/tests/functional/tests/app/Mage/Shipping/Test/Page/Adminhtml/SalesShipment.xml deleted file mode 100644 index 4c9325cb659..00000000000 --- a/dev/tests/functional/tests/app/Mage/Shipping/Test/Page/Adminhtml/SalesShipment.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Shipping/Test/Page/Adminhtml/SalesShipmentView.xml b/dev/tests/functional/tests/app/Mage/Shipping/Test/Page/Adminhtml/SalesShipmentView.xml deleted file mode 100644 index 4ff0be64bf3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Shipping/Test/Page/Adminhtml/SalesShipmentView.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Shipping/Test/Page/ShipmentView.xml b/dev/tests/functional/tests/app/Mage/Shipping/Test/Page/ShipmentView.xml deleted file mode 100644 index 6303a281f96..00000000000 --- a/dev/tests/functional/tests/app/Mage/Shipping/Test/Page/ShipmentView.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Shipping/Test/Repository/ConfigData.xml b/dev/tests/functional/tests/app/Mage/Shipping/Test/Repository/ConfigData.xml deleted file mode 100644 index b5912ff07d6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Shipping/Test/Repository/ConfigData.xml +++ /dev/null @@ -1,513 +0,0 @@ - - - - - - - carriers - 1 - Yes - 1 - - - carriers - 1 - United Parcel Service XML - UPS_XML - - - carriers - 1 - - - - - carriers - 1 - - - - - carriers - 1 - Development - 0 - - - carriers - 1 - - https://wwwcie.ups.com/ups.app/xml/Rate - - - carriers - 1 - - Shipments Originating in United States - - - carriers - 1 - - - - - carriers - 1 - - - - - carriers - 1 - - - - - carriers - 1 - Customer Packaging - CP - - - carriers - 1 - Residential - RES - - - carriers - 1 - - https://wwwcie.ups.com/ups.app/xml/Track - - - carriers - 1 - LBS - LBS - - - carriers - 1 - - - 11 - 12 - 14 - 54 - 59 - 65 - 01 - 02 - 03 - 07 - 08 - - - - carriers - 1 - All Allowed Countries - 0 - - - carriers - 1 - Yes - 1 - - - carriers - 1 - Yes - 1 - - - - - carriers - 1 - No - 0 - - - - - carriers - 1 - Yes - 1 - - - carriers - 1 - - http://production.shippingapis.com/ShippingAPI.dll - - - carriers - 1 - - https://secure.shippingapis.com/ShippingAPI.dll - - - carriers - 1 - - - - - carriers - 1 - - - - - - - carriers - 1 - No - 0 - - - - - carriers - 1 - Yes - 1 - - - carriers - 1 - - - - - carriers - 1 - - - - - carriers - 1 - - - - - carriers - 1 - - - - - carriers - 1 - - 1 - - - carriers - 1 - LB - LB - - - carriers - 1 - - - EUROPE_FIRST_INTERNATIONAL_PRIORITY - FEDEX_1_DAY_FREIGHT - FEDEX_2_DAY_FREIGHT - FEDEX_2_DAY - FEDEX_2_DAY_AM - FEDEX_3_DAY_FREIGHT - FEDEX_EXPRESS_SAVER - FEDEX_GROUND - FIRST_OVERNIGHT - GROUND_HOME_DELIVERY - INTERNATIONAL_ECONOMY - INTERNATIONAL_ECONOMY_FREIGHT - INTERNATIONAL_FIRST - INTERNATIONAL_GROUND - INTERNATIONAL_PRIORITY - INTERNATIONAL_PRIORITY_FREIGHT - PRIORITY_OVERNIGHT - SMART_POST - STANDARD_OVERNIGHT - FEDEX_FREIGHT - FEDEX_NATIONAL_FREIGHT - - - - carriers - 1 - Yes - 1 - - - carriers - 1 - Yes - 1 - - - - - carriers - 1 - No - 0 - - - - - shipping - 1 - United States - US - - - shipping - 1 - California - 12 - - - shipping - 1 - - 90232 - - - shipping - 1 - - Culver City - - - shipping - 1 - - 10441 Jefferson Blvd - - - shipping - 1 - - Suite 200 - - - - - shipping - 1 - United States - US - - - shipping - 1 - California - 12 - - - shipping - 1 - - 90034 - - - shipping - 1 - - - - - shipping - 1 - - - - - shipping - 1 - - - - - - - shipping - 1 - United Kingdom - GB - - - shipping - 1 - - SE1 7RW - - - shipping - 1 - - London - - - shipping - 1 - - 172, WestminsterBridge Rd - - - shipping - 1 - - - - - - - shipping - 1 - United States - US - - - shipping - 1 - California - 12 - - - shipping - 1 - - 90034 - - - shipping - 1 - - - - - shipping - 1 - - - - - shipping - 1 - - - - - - - carriers - 1 - Yes - 1 - - - carriers - 1 - - https://xmlpi-ea.dhl.com/XMLShippingServlet - - - carriers - 1 - - - - - carriers - 1 - - - - - carriers - 1 - Documents - D - - - carriers - 1 - - - - - carriers - 1 - Yes - 1 - - - carriers - 1 - Yes - 1 - - - carriers - 1 - - - 2 - 5 - 6 - 7 - 9 - B - C - D - U - K - L - G - W - I - N - O - R - S - T - X - - - - - - carriers - 1 - No - 0 - - - - diff --git a/dev/tests/functional/tests/app/Mage/Shipping/Test/TestStep/CreateShipmentStep.php b/dev/tests/functional/tests/app/Mage/Shipping/Test/TestStep/CreateShipmentStep.php deleted file mode 100644 index b10e801082f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Shipping/Test/TestStep/CreateShipmentStep.php +++ /dev/null @@ -1,42 +0,0 @@ -objectManager->create('Mage\Shipping\Test\Page\Adminhtml\SalesOrderShipmentNew'); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sitemap/Test/Constraint/AssertSitemapContent.php b/dev/tests/functional/tests/app/Mage/Sitemap/Test/Constraint/AssertSitemapContent.php deleted file mode 100644 index 4adfcb3accd..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sitemap/Test/Constraint/AssertSitemapContent.php +++ /dev/null @@ -1,99 +0,0 @@ -open()->getSitemapGrid()->sortGridByField('sitemap_id'); - $filter = [ - 'sitemap_filename' => $sitemap->getSitemapFilename(), - 'sitemap_path' => $sitemap->getSitemapPath(), - ]; - $sitemapIndex->getSitemapGrid()->search($filter); - $content = file_get_contents($sitemapIndex->getSitemapGrid()->getLinkForGoogle()); - $frontendUrl = str_replace('index.php/', '', $_ENV['app_frontend_url']); - $urls = [ - $frontendUrl . $product->getUrlKey() . '.html', - $frontendUrl . $category->getUrlKey() . '.html', - $frontendUrl . $cmsPage->getIdentifier(), - ]; - \PHPUnit_Framework_Assert::assertTrue( - $this->checkContent($content, $urls), - "File '{$sitemap->getSitemapFilename()}' does not contains correct content." - ); - } - - /** - * Check content for the presence urls. - * - * @param string $content - * @param array $urls - * @return bool - */ - protected function checkContent($content, $urls) - { - foreach ($urls as $url) { - if (!str_contains($content, $url)) { - return false; - } - } - return true; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'File sitemap contains correct content.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sitemap/Test/Constraint/AssertSitemapFailFolderSaveMessage.php b/dev/tests/functional/tests/app/Mage/Sitemap/Test/Constraint/AssertSitemapFailFolderSaveMessage.php deleted file mode 100644 index e5872ef2480..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sitemap/Test/Constraint/AssertSitemapFailFolderSaveMessage.php +++ /dev/null @@ -1,60 +0,0 @@ -getSitemapPath()), - $sitemapIndex->getMessagesBlock()->getErrorMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Error message after creating sitemap with wrong folder is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sitemap/Test/Constraint/AssertSitemapFailPathSaveMessage.php b/dev/tests/functional/tests/app/Mage/Sitemap/Test/Constraint/AssertSitemapFailPathSaveMessage.php deleted file mode 100644 index 8a1aad35f96..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sitemap/Test/Constraint/AssertSitemapFailPathSaveMessage.php +++ /dev/null @@ -1,60 +0,0 @@ -getSitemapFilename()), - $sitemapIndex->getMessagesBlock()->getErrorMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Error message after creating sitemap with wrong path is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sitemap/Test/Constraint/AssertSitemapInGrid.php b/dev/tests/functional/tests/app/Mage/Sitemap/Test/Constraint/AssertSitemapInGrid.php deleted file mode 100644 index f02cd2bf69b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sitemap/Test/Constraint/AssertSitemapInGrid.php +++ /dev/null @@ -1,60 +0,0 @@ -open()->getSitemapGrid()->sortGridByField('sitemap_id'); - $filter = [ - 'sitemap_filename' => $sitemap->getSitemapFilename(), - 'sitemap_path' => $sitemap->getSitemapPath(), - ]; - \PHPUnit_Framework_Assert::assertTrue( - $sitemapIndex->getSitemapGrid()->isRowVisible($filter), - 'Sitemap is absent in grid.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Sitemap is present in grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sitemap/Test/Constraint/AssertSitemapSuccessSaveAndGenerateMessages.php b/dev/tests/functional/tests/app/Mage/Sitemap/Test/Constraint/AssertSitemapSuccessSaveAndGenerateMessages.php deleted file mode 100644 index f7360d94be5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sitemap/Test/Constraint/AssertSitemapSuccessSaveAndGenerateMessages.php +++ /dev/null @@ -1,67 +0,0 @@ -getMessagesBlock()->getSuccessMessages(); - \PHPUnit_Framework_Assert::assertTrue( - in_array(self::SUCCESS_SAVE_MESSAGE, $actualMessages) && - in_array(sprintf(self::SUCCESS_GENERATE_MESSAGE, $sitemap->getSitemapFilename()), $actualMessages), - "The messages about the successful sitemap creation and generation are not present." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Sitemap success generate and save messages are present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sitemap/Test/Constraint/AssertSitemapSuccessSaveMessage.php b/dev/tests/functional/tests/app/Mage/Sitemap/Test/Constraint/AssertSitemapSuccessSaveMessage.php deleted file mode 100644 index 307069b53d6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sitemap/Test/Constraint/AssertSitemapSuccessSaveMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Sitemap success create message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sitemap/Test/Fixture/Sitemap.xml b/dev/tests/functional/tests/app/Mage/Sitemap/Test/Fixture/Sitemap.xml deleted file mode 100644 index f747c3a64c0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sitemap/Test/Fixture/Sitemap.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sitemap/Test/Page/Adminhtml/SitemapIndex.xml b/dev/tests/functional/tests/app/Mage/Sitemap/Test/Page/Adminhtml/SitemapIndex.xml deleted file mode 100644 index 58bc3aab598..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sitemap/Test/Page/Adminhtml/SitemapIndex.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sitemap/Test/Page/Adminhtml/SitemapNew.xml b/dev/tests/functional/tests/app/Mage/Sitemap/Test/Page/Adminhtml/SitemapNew.xml deleted file mode 100644 index a0e6c32089f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sitemap/Test/Page/Adminhtml/SitemapNew.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sitemap/Test/Repository/Sitemap.xml b/dev/tests/functional/tests/app/Mage/Sitemap/Test/Repository/Sitemap.xml deleted file mode 100644 index eafb23daf73..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sitemap/Test/Repository/Sitemap.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - sitemap.xml - / - - 0 - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sitemap/Test/TestCase/CreateSitemapEntityTest.php b/dev/tests/functional/tests/app/Mage/Sitemap/Test/TestCase/CreateSitemapEntityTest.php deleted file mode 100644 index c2f315cb5f1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sitemap/Test/TestCase/CreateSitemapEntityTest.php +++ /dev/null @@ -1,78 +0,0 @@ - Google Sitemap. - * 3. Click "Add Sitemap" button. - * 4. Fill out all data according to data set. - * 5. Click "Save" button. - * 6. Perform all assertions. - * - * @group XML_Sitemap_(PS) - * @ZephyrId MPERF-7060 - */ -class CreateSitemapEntityTest extends Injectable -{ - /** - * Sitemap index page. - * - * @var SitemapIndex - */ - protected $sitemapIndex; - - /** - * Sitemap new page. - * - * @var SitemapNew - */ - protected $sitemapNew; - - /** - * Injection pages. - * - * @param SitemapIndex $sitemapIndex - * @param SitemapNew $sitemapNew - * @return void - */ - public function __inject(SitemapIndex $sitemapIndex, SitemapNew $sitemapNew) - { - $this->sitemapIndex = $sitemapIndex; - $this->sitemapNew = $sitemapNew; - } - - /** - * Create sitemap. - * - * @param Sitemap $sitemap - * @return void - */ - public function test(Sitemap $sitemap) - { - // Steps - $this->sitemapIndex->open(); - $this->sitemapIndex->getGridPageActions()->addNew(); - $this->sitemapNew->getSitemapForm()->fill($sitemap); - $this->sitemapNew->getFormPageActions()->save(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sitemap/Test/TestCase/CreateSitemapEntityTest.xml b/dev/tests/functional/tests/app/Mage/Sitemap/Test/TestCase/CreateSitemapEntityTest.xml deleted file mode 100644 index ff0ea3b8f4d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sitemap/Test/TestCase/CreateSitemapEntityTest.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - Create default sitemap. - sitemap.xml - / - - - - - Create sitemap with wrong path. - %isolation% - / - - - - Create sitemap with wrong folder. - sitemap.xml - /%isolation% - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sitemap/Test/TestCase/GenerateSitemapEntityTest.php b/dev/tests/functional/tests/app/Mage/Sitemap/Test/TestCase/GenerateSitemapEntityTest.php deleted file mode 100644 index 86d4f968658..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sitemap/Test/TestCase/GenerateSitemapEntityTest.php +++ /dev/null @@ -1,94 +0,0 @@ - Google Sitemap. - * 3. Click "Add Sitemap" button. - * 4. Fill out all data according to data set. - * 5. Click "Save & Generate" button. - * 6. Perform all assertions. - * - * @group XML_Sitemap_(PS) - * @ZephyrId MPERF-7491 - */ -class GenerateSitemapEntityTest extends Injectable -{ - /** - * Sitemap index page. - * - * @var SitemapIndex - */ - protected $sitemapIndex; - - /** - * Sitemap new page. - * - * @var SitemapNew - */ - protected $sitemapNew; - - /** - * Inject data. - * - * @param SitemapIndex $sitemapIndex - * @param SitemapNew $sitemapNew - * @return void - */ - public function __inject(SitemapIndex $sitemapIndex, SitemapNew $sitemapNew) - { - $this->sitemapIndex = $sitemapIndex; - $this->sitemapNew = $sitemapNew; - } - - /** - * Generate sitemap test. - * - * @param Sitemap $sitemap - * @param CatalogProductSimple $product - * @param CatalogCategory $category - * @param CmsPage $cmsPage - * @return void - */ - public function test(Sitemap $sitemap, CatalogProductSimple $product, CatalogCategory $category, CmsPage $cmsPage) - { - // Preconditions - $product->persist(); - $category->persist(); - $cmsPage->persist(); - - // Steps - $this->sitemapIndex->open(); - $this->sitemapIndex->getGridPageActions()->addNew(); - $this->sitemapNew->getSitemapForm()->fill($sitemap); - $this->sitemapNew->getFormPageActions()->saveAndGenerate(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sitemap/Test/TestCase/GenerateSitemapEntityTest.xml b/dev/tests/functional/tests/app/Mage/Sitemap/Test/TestCase/GenerateSitemapEntityTest.xml deleted file mode 100644 index ea7f5788674..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sitemap/Test/TestCase/GenerateSitemapEntityTest.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - sitemap.xml - / - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sitemap/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Mage/Sitemap/Test/etc/fixture.xml deleted file mode 100644 index fab3103d0a5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sitemap/Test/etc/fixture.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - flat - sitemap - - diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AbstractAssertOrderTaxOnBackend.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AbstractAssertOrderTaxOnBackend.php deleted file mode 100644 index 3c7cc46f9a6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AbstractAssertOrderTaxOnBackend.php +++ /dev/null @@ -1,205 +0,0 @@ - 'Order', - 'invoice_prices' => 'InvoiceNew', - 'credit_memo_prices' => 'CreditMemoNew' - ]; - - /** - * Order view page. - * - * @var SalesOrderInvoiceNew - */ - protected $orderInvoiceNew; - - /** - * Order view page. - * - * @var SalesOrderCreditMemoNew - */ - protected $orderCreditMemoNew; - - /** - * Order index page. - * - * @var SalesOrderIndex - */ - protected $salesOrder; - - /** - * Implementation for get invoice creation page total prices function. - * - * @return array - */ - abstract protected function getInvoiceNewTotals(); - - /** - * Implementation for get credit memo creation page total prices function. - * - * @return array - */ - abstract protected function getCreditMemoNewTotals(); - - /** - * @constructor - * @param ObjectManager $objectManager - * @param EventManagerInterface $eventManager - * @param \Mage\Sales\Test\Page\Adminhtml\SalesOrderView $salesOrderView - * @param SalesOrderIndex $orderIndex - * @param SalesOrderInvoiceNew $orderInvoiceNew - * @param SalesOrderCreditMemoNew $orderCreditMemoNew - * @param CheckoutOnepage $checkoutOnepage - * @param CheckoutOnepageSuccess $checkoutOnepageSuccess - * @param OrderView $orderView - */ - public function __construct( - ObjectManager $objectManager, - EventManagerInterface $eventManager, - SalesOrderView $salesOrderView, - SalesOrderIndex $orderIndex, - SalesOrderInvoiceNew $orderInvoiceNew, - SalesOrderCreditMemoNew $orderCreditMemoNew, - CheckoutOnepage $checkoutOnepage, - CheckoutOnepageSuccess $checkoutOnepageSuccess, - OrderView $orderView - ) { - parent::__construct($objectManager, $eventManager, $checkoutOnepage, $checkoutOnepageSuccess, $orderView); - $this->orderView = $salesOrderView; - $this->orderInvoiceNew = $orderInvoiceNew; - $this->orderCreditMemoNew = $orderCreditMemoNew; - $this->orderIndex = $orderIndex; - } - - /** - * Assert that specified prices are actual on order, invoice and refund pages. - * - * @param InjectableFixture $product - * @param array $prices - * @param array $arguments [optional] - * @return void - */ - public function processAssert(InjectableFixture $product, array $prices, array $arguments = null) - { - $prices = $this->prepareVerifyFields($prices); - - $this->orderIndex->open()->getSalesOrderGrid()->openFirstRow(); - $this->assertOrderPrices($product, $prices); - - $this->assertInvoicePrices($product, $prices); - - //Check prices after invoice on order page - $this->orderInvoiceNew->getFormBlock()->submit(); - $this->assertOrderPrices($product, $prices); - - $this->assertCreditMemoPrices($product, $prices); - - //Check prices after refund on order page - $this->orderCreditMemoNew->getFormBlock()->submit(); - $this->assertOrderPrices($product, $prices); - } - - /** - * Assert credit memo prices. - * - * @param InjectableFixture $product - * @param array $prices - * @return void - */ - protected function assertCreditMemoPrices(InjectableFixture $product, array $prices) - { - $this->orderView->getPageActions()->refund(); - $error = $this->verifyData( - $this->preparePricesCreditMemo($prices), - $this->getActualPrices($product, 'credit_memo_prices') - ); - \PHPUnit_Framework_Assert::assertTrue(empty($error), $error); - } - - /** - * Assert invoice prices. - * - * @param InjectableFixture $product - * @param array $prices - * @return void - */ - protected function assertInvoicePrices(InjectableFixture $product, array $prices) - { - $this->orderView->getPageActions()->invoice(); - $error = $this->verifyData($prices, $this->getActualPrices($product, 'invoice_prices')); - \PHPUnit_Framework_Assert::assertTrue(empty($error), $error); - } - - /** - * Prepare prices for credit memo. - * - * @param array $prices - * @return array - */ - protected function preparePricesCreditMemo(array $prices) - { - unset($prices['shipping_excl_tax']); - unset($prices['shipping_incl_tax']); - return $prices; - } - - /** - * Get invoice new product prices. - * - * @param InjectableFixture $product - * @return array - */ - public function getInvoiceNewPrices(InjectableFixture $product) - { - $productBlock = $this->orderInvoiceNew->getFormBlock()->getItemsBlock()->getItemProductBlock($product); - return $this->getTypePrices($productBlock); - } - - /** - * Get Credit Memo new product prices. - * - * @param InjectableFixture $product - * @return array - */ - public function getCreditMemoNewPrices(InjectableFixture $product) - { - $productBlock = $this->orderCreditMemoNew->getFormBlock()->getItemsBlock()->getItemProductBlock($product); - return $this->getTypePrices($productBlock); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AbstractAssertTax.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AbstractAssertTax.php deleted file mode 100644 index 6891b274282..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AbstractAssertTax.php +++ /dev/null @@ -1,186 +0,0 @@ - 'Order']; - - /** - * Order view page on backend. - * - * @var SalesOrderView - */ - protected $orderView; - - /** - * Assert order prices. - * - * @param InjectableFixture $product - * @param array $prices - * @return void - */ - protected function assertOrderPrices(InjectableFixture $product, array $prices) - { - $error = $this->verifyData($prices, $this->getActualPrices($product, 'order_prices')); - \PHPUnit_Framework_Assert::assertTrue(empty($error), $error); - } - - /** - * Get actual prices. - * - * @param InjectableFixture $product - * @param string $pricesType - * @return array - */ - protected function getActualPrices(InjectableFixture $product, $pricesType) - { - return array_merge( - $this->{'get' . $this->priceTypes[$pricesType] . 'Prices'}($product), - $this->{'get' . $this->priceTypes[$pricesType] . 'Totals'}() - ); - } - - /** - * Unset category and product page expected prices. - * - * @param array $prices - * @return array - */ - protected function preparePrices(array $prices) - { - $resultTotalPrices = array_intersect_key($prices, array_flip($this->verifyFields)); - $resultItemPrices = array_intersect_key($prices, array_flip($this->cartItemVerifiableFields)); - - return array_merge($resultTotalPrices, $resultItemPrices); - } - - /** - * Get order product prices. - * - * @param InjectableFixture $product - * @return array - */ - public function getOrderPrices(InjectableFixture $product) - { - $viewBlock = $this->orderView->getItemsOrderedBlock()->getItemProductBlock($product); - return $this->getTypePrices($viewBlock); - } - - /** - * Get order totals. - * - * @return array - */ - public function getOrderTotals() - { - $totalsBlock = $this->orderView->getOrderTotalsBlock(); - return $this->getTypeBlockData($totalsBlock); - } - - /** - * Get type prices. - * - * @param AbstractItem $block - * @return array - */ - protected function getTypePrices(AbstractItem $block) - { - $result = []; - foreach ($this->cartItemVerifiableFields as $field) { - $result[$field] = $block->getCartItemTypePrice($field); - } - - return $result; - } - - /** - * Get data from block. - * - * @param Totals $block - * @return array - */ - protected function getTypeBlockData(Totals $block) - { - $result = []; - foreach ($this->verifyFields as $field) { - $result[$field] = $block->getData($field); - } - - return $result; - } - - /** - * Prepare verify fields for assert. - * - * @param array $prices - * @return array - */ - protected function prepareVerifyFields(array $prices) - { - $prices = $this->preparePrices($prices); - foreach ($this->verifyFields as $field) { - if(!isset($prices[$field])) { - $this->verifyFields = array_diff($this->verifyFields, [$field]); - } - } - - return $prices; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AbstractAssertTaxCalculationAfterCheckout.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AbstractAssertTaxCalculationAfterCheckout.php deleted file mode 100644 index 09c7bf94e3a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AbstractAssertTaxCalculationAfterCheckout.php +++ /dev/null @@ -1,191 +0,0 @@ - ['class' => 'ProceedToCheckout'], - 'billing_information' => ['class' => 'FillBillingInformation'], - 'shipping_method' => ['class' => 'FillShippingMethod', 'arguments' => ['shipping']], - 'payment_method' => ['class' => 'SelectPaymentMethod', 'arguments' => ['payment']], - 'place_order' => ['class' => 'PlaceOrder'] - ]; - - /** - * @constructor - * @param ObjectManager $objectManager - * @param EventManagerInterface $eventManager - * @param CheckoutOnepage $checkoutOnepage - * @param CheckoutOnepageSuccess $checkoutOnepageSuccess - * @param OrderView $orderView - */ - public function __construct( - ObjectManager $objectManager, - EventManagerInterface $eventManager, - CheckoutOnepage $checkoutOnepage, - CheckoutOnepageSuccess $checkoutOnepageSuccess, - OrderView $orderView - ) { - parent::__construct($objectManager, $eventManager); - $this->checkoutOnepage = $checkoutOnepage; - $this->checkoutOnepageSuccess = $checkoutOnepageSuccess; - $this->orderView = $orderView; - } - - /** - * Assert that prices on order review and customer order pages are equal to specified in dataset. - * - * @param InjectableFixture $product - * @param array $prices - * @param array $arguments [optional] - * @return void - */ - public function processAssert(InjectableFixture $product, array $prices, array $arguments = null) - { - $this->priceTypes['review_prices'] = 'Review'; - $prices = $this->prepareVerifyFields($prices); - - $this->checkoutStep('proceed_to_checkout'); - $this->checkoutStep('billing_information'); - if (isset($arguments['shipping'])) { - $this->checkoutStep('shipping_method', $arguments); - } - $this->checkoutStep('payment_method', $arguments); - - $this->assertReviewPrices($product, $prices); - - $this->checkoutStep('place_order'); - $this->checkoutOnepageSuccess->getSuccessBlock()->openOrder(); - - $this->assertOrderPrices($product, $prices); - } - - /** - * Assert order prices. - * - * @param InjectableFixture $product - * @param array $prices - * @return void - */ - protected function assertReviewPrices(InjectableFixture $product, array $prices) - { - $error = $this->verifyData($prices, $this->getActualPrices($product, 'review_prices')); - \PHPUnit_Framework_Assert::assertTrue(empty($error), $error); - } - - /** - * Run checkout step. - * - * @param string $type - * @param array $arguments [optional] - * @return array - */ - protected function checkoutStep($type, array $arguments = null) - { - $className = "Mage\\Checkout\\Test\\TestStep\\{$this->steps[$type]['class']}Step"; - $arguments = isset($this->steps[$type]['arguments']) - ? $this->prepareArgumentsForStep($this->steps[$type]['arguments'], $arguments) - : []; - - return $this->objectManager->create($className, $arguments)->run(); - } - - /** - * Prepare arguments for step. - * - * @param array $arguments - * @param array $argumentsData - * @return array - */ - protected function prepareArgumentsForStep(array $arguments, array $argumentsData) - { - $result = []; - foreach ($arguments as $argument) { - $result[$argument] = $argumentsData[$argument]; - } - - return $result; - } - - /** - * Get review product prices. - * - * @param InjectableFixture $product - * @return array - */ - public function getReviewPrices(InjectableFixture $product) - { - $reviewBlock = $this->checkoutOnepage->getReviewBlock()->getItemsBlock($this->productType) - ->getItemProductBlock($product); - return $this->getTypePrices($reviewBlock); - } - - /** - * Get review totals. - * - * @return array - */ - public function getReviewTotals() - { - $totalBlock = $this->checkoutOnepage->getReviewBlock()->getTotalBlock(); - return $this->getTypeBlockData($totalBlock); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AbstractAssertTaxRuleIsAppliedToAllPrices.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AbstractAssertTaxRuleIsAppliedToAllPrices.php deleted file mode 100644 index dc72aa2c63b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AbstractAssertTaxRuleIsAppliedToAllPrices.php +++ /dev/null @@ -1,241 +0,0 @@ -open()->getPageActions()->flushCacheStorage(); - $this->cmsIndex = $cmsIndex; - $this->catalogCategoryView = $catalogCategoryView; - $this->catalogProductView = $catalogProductView; - $this->checkoutCart = $checkoutCart; - $prices = $this->prepareVerifyFields($prices); - - //Assertion steps - $productName = $product->getName(); - $this->cmsIndex->open()->getTopmenu()->selectCategory($product->getCategoryIds()[0]); - $actualPrices = $this->getCategoryPrices($product); - $catalogCategoryView->getListProductBlock()->openProductViewPage($productName); - $this->fillCheckoutData($product); - $actualPrices = array_merge($actualPrices, $this->getProductPagePrices()); - $catalogProductView->getViewBlock()->clickAddToCart(); - if (isset($arguments['shipping'])) { - $this->fillEstimateBlock($address, $arguments['shipping']); - } - $actualPrices = array_merge($actualPrices, $this->getCartPrices($product), $this->getTotals($actualPrices)); - - //Prices verification - $error = $this->verifyData($prices, $actualPrices); - \PHPUnit_Framework_Assert::assertTrue(empty($error), $error); - } - - /** - * Unset category and product page expected prices. - * - * @param array $prices - * @return array - */ - protected function preparePrices(array $prices) - { - $generalPrices = parent::preparePrices($prices); - $categoryPrices = array_intersect_key($prices, array_flip($this->categoryPrices)); - $productPrices = array_intersect_key($prices, array_flip($this->productPrices)); - - return array_merge($generalPrices, $categoryPrices, $productPrices); - } - - /** - * Get prices on category page. - * - * @param InjectableFixture $product - * @return array - */ - protected function getCategoryPrices(InjectableFixture $product) - { - $result = []; - $priceBlock = $this->catalogCategoryView->getListProductBlock()->getProductPriceBlock($product->getName()); - foreach ($this->categoryPrices as $item) { - $result[$item] = $this->getPrice($priceBlock, $item); - } - - return $result; - } - - /** - * Get product view prices. - * - * @return array - */ - protected function getProductPagePrices() - { - $result = []; - $viewBlock = $this->catalogProductView->getViewBlock()->getPriceBlock(); - foreach ($this->productPrices as $item) { - $result[$item] = (count($this->categoryPrices) == 1) - ? $this->getPrice($viewBlock, 'special_price') - : $this->getPrice($viewBlock, $item); - } - return $result; - } - - /** - * Get price. - * - * @param Price $block - * @param string $type - * @param string $currency - * @return string|null - */ - protected function getPrice(Price $block, $type, $currency = '$') - { - $price = $block->getTypePriceElement($type); - return $price->isVisible() ? trim($price->getText(), $currency) : null; - } - - /** - * Get totals. - * - * @return array - */ - protected function getTotals() - { - $totalsBlock = $this->checkoutCart->getTotalsBlock(); - return $this->getTypeBlockData($totalsBlock); - } - - /** - * Fill checkout data. - * - * @param InjectableFixture $product - * @return void - */ - protected function fillCheckoutData(InjectableFixture $product) - { - $qty = $product->getCheckoutData()['qty']; - $this->catalogProductView->getViewBlock()->fillOptions($product); - $this->catalogProductView->getViewBlock()->setQty($qty); - } - - /** - * Get cart prices. - * - * @param InjectableFixture $product - * @return array - */ - protected function getCartPrices(InjectableFixture $product) - { - $cartItemData = $this->checkoutCart->getCartBlock()->getCartItem($product); - return $this->getTypePrices($cartItemData); - } - - /** - * Fill estimate block. - * - * @param Address $address - * @param array $shipping - * @return void - */ - protected function fillEstimateBlock(Address $address, array $shipping) - { - $this->checkoutCart->getShippingBlock()->fillEstimateShippingAndTax($address); - $this->checkoutCart->getShippingBlock()->selectShippingMethod($shipping); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AbstractAssertTaxWithCrossBorderApplying.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AbstractAssertTaxWithCrossBorderApplying.php deleted file mode 100644 index 94aa3dd3728..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AbstractAssertTaxWithCrossBorderApplying.php +++ /dev/null @@ -1,221 +0,0 @@ -cmsIndex = $cmsIndex; - $this->catalogCategoryView = $catalogCategoryView; - $this->catalogProductView = $catalogProductView; - $this->checkoutCart = $checkoutCart; - $actualPrices = $this->getPricesForCustomers($product, $customers, $browser); - $this->assert($actualPrices); - } - - /** - * Login with each provided customer and get product prices. - * - * @param CatalogProductSimple $product - * @param array $customers - * @param Browser $browser - * @return array - */ - protected function getPricesForCustomers(CatalogProductSimple $product, array $customers, Browser $browser) - { - $prices = []; - foreach ($customers as $customer) { - $this->loginCustomer($customer); - $this->openCategory($product); - $actualPrices = []; - $actualPrices = $this->getCategoryPrice($product->getName(), $actualPrices); - $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - $actualPrices = $this->addToCart($product, $actualPrices); - $actualPrices = $this->getCartPrice($product, $actualPrices); - $prices[] = $actualPrices; - $this->clearShoppingCart(); - } - return $prices; - } - - /** - * Open product category. - * - * @param CatalogProductSimple $product - * @return void - */ - protected function openCategory(CatalogProductSimple $product) - { - $this->cmsIndex->open(); - $this->cmsIndex->getTopmenu()->selectCategory($product->getCategoryIds()[0]); - } - - /** - * Get prices on category page. - * - * @param string $productName - * @param array $actualPrices - * @return array - */ - protected function getCategoryPrice($productName, array $actualPrices) - { - $priceBlock = $this->catalogCategoryView->getListProductBlock()->getProductPriceBlock($productName); - $actualPrices['category_price_incl_tax'] = $this->getPrice($priceBlock, 'category_price_incl_tax'); - return $actualPrices; - } - - /** - * Get price. - * - * @param Price $block - * @param string $type - * @param string $currency - * @return string|null - */ - public function getPrice(Price $block, $type, $currency = '$') - { - $price = $block->getTypePriceElement($type); - return $price->isVisible() ? trim($price->getText(), $currency) : null; - } - - /** - * Get price after fill product options, and add product to cart. - * - * @param CatalogProductSimple $product - * @param array $actualPrices - * @return array - */ - protected function addToCart(CatalogProductSimple $product, array $actualPrices) - { - $this->catalogProductView->getViewBlock()->fillOptions($product); - $priceBlock = $this->catalogProductView->getViewBlock()->getPriceBlock(); - $actualPrices['product_view_price_incl_tax'] = $this->getPrice($priceBlock, 'product_view_price_incl_tax'); - $this->catalogProductView->getViewBlock()->clickAddToCart(); - return $actualPrices; - } - - /** - * Get cart prices. - * - * @param CatalogProductSimple $product - * @param array $actualPrices - * @return array - */ - protected function getCartPrice(CatalogProductSimple $product, array $actualPrices) - { - $actualPrices['cart_item_price_incl_tax'] = $this->checkoutCart->getCartBlock()->getCartItem($product) - ->getCartItemTypePrice('cart_item_price_incl_tax'); - $actualPrices['cart_item_subtotal_incl_tax'] = $this->checkoutCart->getCartBlock()->getCartItem($product) - ->getCartItemTypePrice('cart_item_subtotal_incl_tax'); - $actualPrices['grand_total'] = $this->checkoutCart->getTotalsBlock()->getData('grand_total_incl_tax'); - return $actualPrices; - } - - /** - * Login customer. - * - * @param Customer $customer - * @return void - */ - protected function loginCustomer(Customer $customer) - { - $this->objectManager->create( - '\Mage\Customer\Test\TestStep\LoginCustomerOnFrontendStep', - ['customer' => $customer] - )->run(); - } - - /** - * Clear shopping cart. - * - * @return void - */ - protected function clearShoppingCart() - { - $this->checkoutCart->open(); - $this->checkoutCart->getCartBlock()->clearShoppingCart(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertOrderTaxOnBackendExcludingIncludingTax.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertOrderTaxOnBackendExcludingIncludingTax.php deleted file mode 100644 index acb67d0dae7..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertOrderTaxOnBackendExcludingIncludingTax.php +++ /dev/null @@ -1,58 +0,0 @@ -orderInvoiceNew->getTotalsBlock(); - return $this->getTypeBlockData($totalsBlock); - } - - /** - * Get Credit Memo new totals. - * - * @return array - */ - public function getCreditMemoNewTotals() - { - $totalsBlock = $this->orderCreditMemoNew->getTotalsBlock(); - return $this->getTypeBlockData($totalsBlock); - } - - /** - * Returns string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Prices on backend after order creation is correct.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertOrderTaxOnBackendExcludingTax.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertOrderTaxOnBackendExcludingTax.php deleted file mode 100644 index c206b5b71c8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertOrderTaxOnBackendExcludingTax.php +++ /dev/null @@ -1,67 +0,0 @@ -prepareData($taxRate->getData()); - - $taxRateIndex->open()->getTaxRatesGrid()->searchAndOpen(['code' => $data['code']]); - $formData = $taxRateNew->getTaxRateForm()->getData($taxRate); - $errors = $this->verifyData($data, $formData); - - \PHPUnit_Framework_Assert::assertEmpty($errors, $errors); - } - - /** - * Preparing data for verification. - * - * @param array $data - * @return array - */ - protected function prepareData(array $data) - { - if ($data['zip_is_range'] === 'Yes') { - unset($data['tax_postcode']); - } else { - unset($data['zip_from'], $data['zip_to']); - } - $data['rate'] = number_format($data['rate'], 4); - - return $data; - } - - /** - * Returns string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Tax Rate form was filled correctly.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRateInGrid.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRateInGrid.php deleted file mode 100644 index c724f0b4615..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRateInGrid.php +++ /dev/null @@ -1,66 +0,0 @@ -getData(); - $filter = [ - 'code' => $data['code'], - 'tax_country_id' => $data['tax_country_id'], - 'tax_postcode' => $data['zip_is_range'] === 'No' - ? $data['tax_postcode'] - : $data['zip_from'] . '-' . $data['zip_to'] - ]; - - $taxRateIndexPage->open(); - - \PHPUnit_Framework_Assert::assertTrue( - $taxRateIndexPage->getTaxRatesGrid()->isRowVisible($filter), - "Tax Rate {$filter['code']} is absent in Tax Rate grid." - ); - } - - /** - * Returns string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Tax rate is present in grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRateInTaxRule.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRateInTaxRule.php deleted file mode 100644 index 5157fb3e965..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRateInTaxRule.php +++ /dev/null @@ -1,60 +0,0 @@ -getCode(); - $taxRuleIndex->open()->getPageActionsBlock()->addNew(); - - \PHPUnit_Framework_Assert::assertTrue( - $taxRuleNew->getTaxRuleForm()->isTaxRateAvailable($taxRateCode), - "$taxRateCode is not present in Tax Rates multiselect on TaxRuleEdit page." - ); - } - - /** - * Returns string representation of object. - * - * @return string - */ - public function toString() - { - return "Necessary tax rate is present in Tax Rule Information on TaxRuleEdit page."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRateIsInCorrectRange.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRateIsInCorrectRange.php deleted file mode 100644 index 874d55532ab..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRateIsInCorrectRange.php +++ /dev/null @@ -1,61 +0,0 @@ -getCode(); - $taxRateIndex->open()->getTaxRatesGrid()->searchAndOpen(['code' => $taxRateCode]); - $ratePercentage = $taxRateEdit->getTaxRateForm()->getTaxRatePercentage(); - - \PHPUnit_Framework_Assert::assertTrue( - $ratePercentage >= 0 && $ratePercentage <= 100, - "$taxRateCode rate percent $ratePercentage is not in correct range between 0 and 100." - ); - } - - /** - * Returns string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Necessary tax rate percent is in correct range between 0 and 100.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRateNotInGrid.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRateNotInGrid.php deleted file mode 100644 index 0dc116410f6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRateNotInGrid.php +++ /dev/null @@ -1,56 +0,0 @@ - $taxRate->getCode()]; - $taxRateIndex->open(); - \PHPUnit_Framework_Assert::assertFalse( - $taxRateIndex->getTaxRatesGrid()->isRowVisible($filter), - 'Tax Rate \'' . $filter['code'] . '\' is present in Tax Rate grid.' - ); - } - - /** - * Returns string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Tax rate is absent in grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRateNotInTaxRule.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRateNotInTaxRule.php deleted file mode 100644 index aeedad424d4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRateNotInTaxRule.php +++ /dev/null @@ -1,56 +0,0 @@ -open(); - $taxCode = $taxRate->getCode(); - \PHPUnit_Framework_Assert::assertFalse( - $taxRuleNew->getTaxRuleForm()->isTaxRateAvailable($taxCode), - "Tax Rate '$taxCode' is present in Tax Rule form." - ); - } - - /** - * Returns string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Tax rate is absent in tax rule from.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRateSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRateSuccessDeleteMessage.php deleted file mode 100644 index 1432838d5ea..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRateSuccessDeleteMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Tax rate success delete message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRateSuccessSaveMessage.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRateSuccessSaveMessage.php deleted file mode 100644 index 93d93ff74ab..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRateSuccessSaveMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Tax rate success create message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRuleForm.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRuleForm.php deleted file mode 100644 index 525cc0b8013..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRuleForm.php +++ /dev/null @@ -1,93 +0,0 @@ -getData(); - $taxRuleIndex->open(); - $taxRuleIndex->getTaxRuleGrid()->searchAndOpen(['code' => $taxRule->getCode()]); - $formData = $taxRuleNew->getTaxRuleForm()->getData($taxRule); - $dataDiff = $this->verifyForm($formData, $fixtureData); - - \PHPUnit_Framework_Assert::assertEmpty($dataDiff, implode($dataDiff)); - } - - /** - * Verifying that form is filled right. - * - * @param array $formData - * @param array $fixtureData - * @return array $errorMessage - */ - protected function verifyForm(array $formData, array $fixtureData) - { - $errorMessage = []; - - foreach ($fixtureData as $key => $value) { - if (is_array($value)) { - $diff = array_diff($value, $formData[$key]); - $diff = array_merge($diff, array_diff($formData[$key], $value)); - if (!empty($diff)) { - $errorMessage[] = "Data in " . $key . " field not equal." - . "\nExpected: " . implode(", ", $value) - . "\nActual: " . implode(", ", $formData[$key]); - } - } else { - if ($value !== $formData[$key]) { - $errorMessage[] = "Data in " . $key . " field not equal." - . "\nExpected: " . $value - . "\nActual: " . $formData[$key]; - } - } - } - - return $errorMessage; - } - - /** - * Returns string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Tax Rule form has been filled right.'; - } -} - diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRuleInGrid.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRuleInGrid.php deleted file mode 100644 index 0f083a829d7..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRuleInGrid.php +++ /dev/null @@ -1,58 +0,0 @@ - $taxRule->getCode()]; - - $taxRuleIndex->open(); - \PHPUnit_Framework_Assert::assertTrue( - $taxRuleIndex->getTaxRuleGrid()->isRowVisible($filter), - "Tax Rule '{$filter['code']}' is absent in Tax Rule grid." - ); - } - - /** - * Returns string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Tax rule is present in grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRuleIsAppliedToAllPricesExcludingIncludingTax.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRuleIsAppliedToAllPricesExcludingIncludingTax.php deleted file mode 100644 index 21d1b39e37f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRuleIsAppliedToAllPricesExcludingIncludingTax.php +++ /dev/null @@ -1,36 +0,0 @@ - $this->catalogCategoryView - ->getListProductBlock() - ->getProductPriceBlock($product->getName()) - ->getResultPrice() - ]; - } - - /** - * Get product view prices. - * - * @return array - */ - protected function getProductPagePrices() - { - return ['product_view_price' => $this->catalogProductView->getViewBlock()->getPriceBlock()->getResultPrice()]; - } - - /** - * Returns string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Prices excl tax on category, product and cart pages are equal to specified in dataset.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRuleIsAppliedToAllPricesIncludingTax.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRuleIsAppliedToAllPricesIncludingTax.php deleted file mode 100644 index 87855ccd7aa..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRuleIsAppliedToAllPricesIncludingTax.php +++ /dev/null @@ -1,102 +0,0 @@ - $this->catalogCategoryView - ->getListProductBlock() - ->getProductPriceBlock($product->getName()) - ->getResultPrice() - ]; - } - - /** - * Get product view prices. - * - * @return array - */ - protected function getProductPagePrices() - { - return ['product_view_price' => $this->catalogProductView->getViewBlock()->getPriceBlock()->getResultPrice()]; - } - - /** - * Returns string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Prices incl tax on category, product and cart pages are equal to specified in dataset.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRuleSuccessSaveMessage.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRuleSuccessSaveMessage.php deleted file mode 100644 index 32e5ca8fa3a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRuleSuccessSaveMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Tax rule success create message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxWithCrossBorderApplied.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxWithCrossBorderApplied.php deleted file mode 100644 index 6aee1b07b54..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxWithCrossBorderApplied.php +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Fixture/TaxRate.xml b/dev/tests/functional/tests/app/Mage/Tax/Test/Fixture/TaxRate.xml deleted file mode 100644 index 59e08c0743b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Fixture/TaxRate.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Fixture/TaxRule.xml b/dev/tests/functional/tests/app/Mage/Tax/Test/Fixture/TaxRule.xml deleted file mode 100644 index fdac0987828..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Fixture/TaxRule.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Fixture/TaxRule/TaxClass.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Fixture/TaxRule/TaxClass.php deleted file mode 100644 index 6a2c351a788..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Fixture/TaxRule/TaxClass.php +++ /dev/null @@ -1,69 +0,0 @@ -params = $params; - if (isset($data['dataset'])) { - foreach ($data['dataset'] as $dataset) { - if ($dataset !== '-') { - /** @var \Mage\Tax\Test\Fixture\TaxClass $taxClass */ - $taxClass = $fixtureFactory->createByCode('taxClass', ['dataset' => $dataset]); - if (!$taxClass->hasData('id')) { - $taxClass->persist(); - } - $this->fixtures[] = $taxClass; - $this->data[] = $taxClass->getClassName(); - } - } - } - } - - /** - * Return tax class fixtures - * - * @return array - */ - public function getFixtures() - { - return $this->fixtures; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Fixture/TaxRule/TaxRate.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Fixture/TaxRule/TaxRate.php deleted file mode 100644 index 22016acbc2c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Fixture/TaxRule/TaxRate.php +++ /dev/null @@ -1,70 +0,0 @@ -params = $params; - if (isset($data['dataset'])) { - foreach ($data['dataset'] as $dataset) { - if ($dataset !== '-') { - /** @var \Mage\Tax\Test\Fixture\TaxRate $taxRate */ - $taxRate = $fixtureFactory->createByCode('taxRate', ['dataset' => $dataset]); - if (!$taxRate->hasData('id')) { - $taxRate->persist(); - } - $this->fixtures[] = $taxRate; - $this->data[] = $taxRate->getCode(); - } - } - } - } - - /** - * Return tax rate fixtures. - * - * @return array - */ - public function getFixtures() - { - return $this->fixtures; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Handler/TaxClass/Curl.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Handler/TaxClass/Curl.php deleted file mode 100644 index 66c879ddd61..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Handler/TaxClass/Curl.php +++ /dev/null @@ -1,66 +0,0 @@ -getData(); - - $url = $_ENV['app_backend_url'] . 'tax_class/save'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->write($url, $data); - $response = $curl->read(); - $curl->close(); - - if (!strpos($response, 'id="messages"')) { - throw new \Exception('Tax rate creation by curl handler was not successful!'); - } - - $id = $this->getClassId($response); - return ['id' => $id]; - } - - /** - * Return saved class id if saved. - * - * @param $response - * @return int|null - */ - protected function getClassId($response) - { - preg_match_all('~tax_class[^\s]*\/id\/(\d+)~', $response, $match); - - return max(empty($match[1]) ? null : $match[1]); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Handler/TaxClass/TaxClassInterface.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Handler/TaxClass/TaxClassInterface.php deleted file mode 100644 index 5f949820534..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Handler/TaxClass/TaxClassInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - 'Australia', - 'US' => 'United States', - 'GB' => 'United Kingdom', - ]; - - /** - * Mapping for regions. - * - * @var array - */ - protected $regionId = [ - '0' => '*', - '12' => 'California', - '43' => 'New York', - '57' => 'Texas', - ]; - - /** - * Post request for creating tax rate. - * - * @param FixtureInterface $fixture [optional] - * @return array - * @throws \Exception - */ - public function persist(FixtureInterface $fixture = null) - { - $data = $fixture->getData(); - $data['tax_country_id'] = array_search($data['tax_country_id'], $this->countryId); - if (isset($data['tax_region_id'])) { - $data['tax_region_id'] = array_search($data['tax_region_id'], $this->regionId); - } - - $url = $_ENV['app_backend_url'] . 'tax_rate/save'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->write($url, $data); - $response = $curl->read(); - $curl->close(); - - if (!strpos($response, 'success-msg')) { - throw new \Exception('Tax rate creation by curl handler was not successful!'); - } - - $url = $_ENV['app_backend_url'] . 'tax_rate/index/limit/200'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->write($url, $data); - $response = $curl->read(); - $curl->close(); - - $id = $this->getTaxRateId($response); - return ['id' => $id]; - } - - /** - * Return saved tax rate id. - * - * @param $response - * @return int|null - */ - protected function getTaxRateId($response) - { - preg_match_all('~tax_rate/edit[^\s]*\/rate\/(\d+)~', $response, $match); - - return max(empty($match[1]) ? null : $match[1]); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Handler/TaxRate/TaxRateInterface.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Handler/TaxRate/TaxRateInterface.php deleted file mode 100644 index 8460a8e14fb..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Handler/TaxRate/TaxRateInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - 3, // Retail Customer - 'tax_product_class' => 2, // Taxable Goods - ]; - - /** - * Post request for creating tax rule. - * - * @param FixtureInterface $fixture [optional] - * @return array - * @throws \Exception - */ - public function persist(FixtureInterface $fixture = null) - { - $data = $this->prepareData($fixture); - - $url = $_ENV['app_backend_url'] . 'tax_rule/save/?back=1'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->addOption(CURLOPT_HEADER, 1); - $curl->write($url, $data); - $response = $curl->read(); - $curl->close(); - - if (!strpos($response, 'success-msg')) { - throw new \Exception("Tax rule creation by curl handler was not successful!\nResponse:\n$response"); - } - $id = $this->getTaxRuleId($response); - - return ['id' => $id]; - } - - /** - * Returns data for curl POST params. - * - * @param FixtureInterface $fixture - * @return mixed - * - * @SuppressWarnings(PHPMD.UnusedLocalVariable) - */ - protected function prepareData(FixtureInterface $fixture) - { - $data = $fixture->getData(); - $fields = [ - 'tax_rate', - 'tax_customer_class', - 'tax_product_class', - ]; - - foreach ($fields as $field) { - if (!array_key_exists($field, $data)) { - $data[$field][] = $this->defaultTaxClasses[$field]; - continue; - } - $fieldFixture = $fixture->getDataFieldConfig($field); - $fieldFixture = $fieldFixture['source']->getFixtures(); - foreach ($data[$field] as $key => $value) { - $id = $fieldFixture[$key]->getId(); - if ($id === null) { - $fieldFixture[$key]->persist(); - $id = $fieldFixture[$key]->getId(); - } - $data[$field][$key] = $id; - } - } - - return $data; - } - - /** - * Return saved tax rule id. - * - * @param string $response - * @return int|null - */ - protected function getTaxRuleId($response) - { - preg_match_all('~tax_rule/edit[^\s]*\/rule\/(\d+)~', $response, $match); - - return max(empty($match[1]) ? null : $match[1]); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Handler/TaxRule/TaxRuleInterface.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Handler/TaxRule/TaxRuleInterface.php deleted file mode 100644 index 4b004b2eeed..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Handler/TaxRule/TaxRuleInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Page/Adminhtml/TaxRateIndex.xml b/dev/tests/functional/tests/app/Mage/Tax/Test/Page/Adminhtml/TaxRateIndex.xml deleted file mode 100644 index 12d363695f9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Page/Adminhtml/TaxRateIndex.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Page/Adminhtml/TaxRateNew.xml b/dev/tests/functional/tests/app/Mage/Tax/Test/Page/Adminhtml/TaxRateNew.xml deleted file mode 100644 index 45e81c1ebb3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Page/Adminhtml/TaxRateNew.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Page/Adminhtml/TaxRuleIndex.xml b/dev/tests/functional/tests/app/Mage/Tax/Test/Page/Adminhtml/TaxRuleIndex.xml deleted file mode 100644 index 1acd761f3c9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Page/Adminhtml/TaxRuleIndex.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Page/Adminhtml/TaxRuleNew.xml b/dev/tests/functional/tests/app/Mage/Tax/Test/Page/Adminhtml/TaxRuleNew.xml deleted file mode 100644 index 9955a27be4c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Page/Adminhtml/TaxRuleNew.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Repository/ConfigData.xml b/dev/tests/functional/tests/app/Mage/Tax/Test/Repository/ConfigData.xml deleted file mode 100644 index ef1729fec3d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Repository/ConfigData.xml +++ /dev/null @@ -1,970 +0,0 @@ - - - - - - - tax - 1 - Taxable Goods - 2 - - - - - - tax - 1 - None - - - - - - - tax - 1 - Shipping Origin - origin - - - - - - tax - 1 - Shipping Address - shipping - - - - - - tax - 1 - Total - TOTAL_BASE_CALCULATION - - - tax - 1 - Including Tax - 1 - - - tax - 1 - Including Tax - 1 - - - tax - 1 - Before Discount - - - - tax - 1 - Including Tax - 1 - - - tax - 1 - Including Tax - 2 - - - tax - 1 - Including Tax - 2 - - - tax - 1 - Including Tax - 2 - - - tax - 1 - Including Tax - 2 - - - tax - 1 - Including Tax - 2 - - - tax - 1 - No - - - - tax - 1 - No - - - - tax - 1 - Yes - 1 - - - tax - 1 - No - - - - tax - 1 - Including FPT and FPT description - 1 - - - tax - 1 - Including FPT and FPT description - 1 - - - tax - 1 - Including FPT and FPT description - 1 - - - tax - 1 - Not Taxed - - - - tax - 1 - No - - - - - - - tax - 1 - Total - TOTAL_BASE_CALCULATION - - - tax - 1 - Excluding Tax - - - - tax - 1 - Including Tax - 1 - - - tax - 1 - Before Discount - - - - tax - 1 - Excluding Tax - - - - tax - 1 - Including Tax - 2 - - - tax - 1 - Including Tax - 2 - - - tax - 1 - Including Tax - 2 - - - tax - 1 - Including Tax - 2 - - - tax - 1 - Including Tax - 2 - - - tax - 1 - No - - - - tax - 1 - No - - - - tax - 1 - Yes - 1 - - - tax - 1 - No - - - - tax - 1 - Including FPT and FPT description - 1 - - - tax - 1 - Including FPT and FPT description - 1 - - - tax - 1 - Including FPT and FPT description - 1 - - - tax - 1 - Not Taxed - - - - tax - 1 - No - - - - - - - tax - 1 - Total - TOTAL_BASE_CALCULATION - - - tax - 1 - Excluding Tax - - - - tax - 1 - Excluding Tax - - - - tax - 1 - Before Discount - - - - tax - 1 - Excluding Tax - - - - tax - 1 - No - - - - tax - 1 - Excluding Tax - 1 - - - tax - 1 - Excluding Tax - 1 - - - tax - 1 - Excluding Tax - 1 - - - tax - 1 - Excluding Tax - 1 - - - tax - 1 - Excluding Tax - 1 - - - tax - 1 - No - - - - tax - 1 - No - - - - tax - 1 - Excluding Tax - 1 - - - tax - 1 - Excluding Tax - 1 - - - tax - 1 - Excluding Tax - 1 - - - tax - 1 - No - - - - tax - 1 - No - - - - tax - 1 - No - - - - tax - 1 - No - - - - tax - 1 - Including FPT and FPT description - 1 - - - tax - 1 - Including FPT and FPT description - 1 - - - tax - 1 - Including FPT and FPT description - 1 - - - tax - 1 - Not Taxed - - - - tax - 1 - No - - - - - - - tax - 1 - Including Tax - 2 - - - tax - 1 - Including Tax - 2 - - - tax - 1 - Including Tax - 2 - - - tax - 1 - Including Tax - 2 - - - tax - 1 - Including Tax - 2 - - - tax - 1 - Yes - 1 - - - tax - 1 - No - - - - tax - 1 - Including Tax - 2 - - - tax - 1 - Including Tax - 2 - - - tax - 1 - Including Tax - 2 - - - tax - 1 - Yes - 1 - - - - - - tax - 1 - Including and Excluding Tax - 3 - - - tax - 1 - Including and Excluding Tax - 3 - - - tax - 1 - Including and Excluding Tax - 3 - - - tax - 1 - Including and Excluding Tax - 3 - - - tax - 1 - Including and Excluding Tax - 3 - - - tax - 1 - Yes - 1 - - - tax - 1 - No - - - - tax - 1 - Including and Excluding Tax - 3 - - - tax - 1 - Including and Excluding Tax - 3 - - - tax - 1 - Including and Excluding Tax - 3 - - - tax - 1 - Yes - 1 - - - - - - tax - 1 - Row Total - ROW_BASE_CALCULATION - - - tax - 1 - Including Tax - 1 - - - tax - 1 - Excluding Tax - - - - tax - 1 - After Discount - 1 - - - tax - 1 - Excluding Tax - - - - tax - 1 - No - - - - - - - tax - 1 - Row Total - ROW_BASE_CALCULATION - - - tax - 1 - Excluding Tax - - - - tax - 1 - Including Tax - 1 - - - tax - 1 - Before Discount - - - - tax - 1 - Including Tax - 1 - - - tax - 1 - No - - - - - - - tax - 1 - Total - TOTAL_BASE_CALCULATION - - - tax - 1 - Excluding Tax - - - - tax - 1 - Including Tax - 1 - - - tax - 1 - After Discount - 1 - - - tax - 1 - Excluding Tax - - - - tax - 1 - No - - - - - - - tax - 1 - Row Total - ROW_BASE_CALCULATION - - - tax - 1 - Including Tax - 1 - - - tax - 1 - Excluding Tax - - - - tax - 1 - Before Discount - - - - tax - 1 - Including Tax - 1 - - - tax - 1 - No - - - - - - - tax - 1 - - UNIT_BASE_CALCULATION - - - tax - 1 - Including Tax - 1 - - - tax - 1 - Including Tax - 1 - - - tax - 1 - Before Discount - - - - tax - 1 - Including Tax - 1 - - - tax - 1 - No - - - - - - - tax - 1 - Total - TOTAL_BASE_CALCULATION - - - tax - 1 - Excluding Tax - - - - tax - 1 - Including Tax - 1 - - - tax - 1 - Before Discount - - - - tax - 1 - Including Tax - 1 - - - tax - 1 - No - - - - - - - tax - 1 - Unit Price - UNIT_BASE_CALCULATION - - - tax - 1 - Excluding Tax - - - - tax - 1 - Excluding Tax - - - - tax - 1 - After Discount - 1 - - - tax - 1 - Excluding Tax - - - - tax - 1 - No - - - - - - - tax - 1 - Total - TOTAL_BASE_CALCULATION - - - tax - 1 - Including Tax - 1 - - - tax - 1 - Excluding Tax - - - - tax - 1 - Before Discount - - - - tax - 1 - Excluding Tax - - - - tax - 1 - No - - - - - - - tax - 1 - Total - TOTAL_BASE_CALCULATION - - - tax - 1 - Excluding Tax - - - - tax - 1 - Including Tax - 1 - - - tax - 1 - After Discount - 1 - - - tax - 1 - Including Tax - 1 - - - tax - 1 - No - - - - - - - tax - 1 - Unit Price - UNIT_BASE_CALCULATION - - - tax - 1 - Excluding Tax - - - - tax - 1 - Including Tax - 1 - - - tax - 1 - After Discount - 1 - - - tax - 1 - Excluding Tax - - - - tax - 1 - No - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Repository/TaxClass.xml b/dev/tests/functional/tests/app/Mage/Tax/Test/Repository/TaxClass.xml deleted file mode 100644 index 457df2bc86f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Repository/TaxClass.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 2 - Taxable Goods - PRODUCT - 2 - Taxable Goods - - - - None - PRODUCT - 0 - - - - 3 - Retail Customer - CUSTOMER - 3 - Retail Customer - - - - Customer Tax Class %isolation% - CUSTOMER - - - - Product Tax Class %isolation% - PRODUCT - - - diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Repository/TaxRate.xml b/dev/tests/functional/tests/app/Mage/Tax/Test/Repository/TaxRate.xml deleted file mode 100644 index 277b5dee5c6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Repository/TaxRate.xml +++ /dev/null @@ -1,156 +0,0 @@ - - - - - - Tax Rate %isolation% - 10 - United States - * - California - - - - TaxIdentifier%isolation% - * - Australia - 20 - - - - TaxIdentifier%isolation% - United States - * - * - 8.2500 - - - - 1 - United States - 12 - * - US-CA-*-Rate 1 - 8.2500 - 1 - US-CA-*-Rate 1 - - - - 2 - United States - 43 - * - US-NY-*-Rate 1 - 8.3750 - 2 - US-NY-*-Rate 1 - - - - TaxIdentifier%isolation% - Yes - 90001 - 96162 - United States - California - 15.5 - - - - TaxIdentifierTexas%isolation% - * - United States - Texas - 10 - - - - TaxIdentifierNewYork%isolation% - * - United States - New York - 20 - - - - TaxIdentifierCalifornia%isolation% - * - United States - California - 30 - - - - Tax Rate %isolation% - 8.25 - United States - 90230 - California - - - - Tax Rate %isolation% - 8.25 - United States - * - California - - - - Tax Rate %isolation% - 8.375 - United States - * - California - - - - Tax Rate %isolation% - 8.375 - United States - New York - * - - - - Tax Rate %isolation% - 8.25 - United States - New York - * - - - - 1 - United States - California - * - US-CA-*-Rate 1 - 8.2500 - US-CA-*-Rate 1 - 1 - - - - UK full tax %isolation% - 20 - United Kingdom - * - - - diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Repository/TaxRule.xml b/dev/tests/functional/tests/app/Mage/Tax/Test/Repository/TaxRule.xml deleted file mode 100644 index ba680a00355..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Repository/TaxRule.xml +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - DefaultTaxRule%isolation% - - - US-CA-*-Rate 1 - US-NY-*-Rate 1 - - - - - - TaxIdentifier%isolation% - - - for_all_states - - - 0 - - - - TaxIdentifier%isolation% - - - tx_rate_10 - ny_rate_20 - ca_rate_30 - - - 0 - 0 - - - - TaxIdentifier%isolation% - - - us_ca_rate_8_25_no_zip - us_ny_rate_8_25 - - - 0 - 0 - - - - TaxIdentifier%isolation% - - - us_ca_rate_8_25_no_zip - us_ny_rate_8_375 - - - 0 - 0 - - - - TaxIdentifier%isolation% - - - us_ca_rate_8_375 - us_ny_rate_8_25 - - - 0 - 0 - - - - TaxIdentifier%isolation% - - - us_ca_rate_8_25 - us_ny_rate_8_375 - - - 0 - 0 - - - - TaxIdentifier%isolation% - - - US-CA-Rate_1 - - - - - Retail Customer - - - - - Taxable Goods - - - 1 - 1 - - - - TaxIdentifier%isolation% - - - uk-full-tax - - - 0 - 0 - - - diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/AutomaticTaxApplyingBasedOnVatIdTest.php b/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/AutomaticTaxApplyingBasedOnVatIdTest.php deleted file mode 100644 index 30aa73674a7..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/AutomaticTaxApplyingBasedOnVatIdTest.php +++ /dev/null @@ -1,64 +0,0 @@ -executeScenario(); - } - - /** - * Delete all tax rules after test and rollback configuration. - * - * @return void - */ - public static function tearDownAfterClass() - { - $objectManager = ObjectManager::getInstance(); - $objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - $objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => 'enable_vat_rollback'] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/AutomaticTaxApplyingBasedOnVatIdTest.xml b/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/AutomaticTaxApplyingBasedOnVatIdTest.xml deleted file mode 100644 index 1338ad395a5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/AutomaticTaxApplyingBasedOnVatIdTest.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - enable_vat - uk_with_vat - uk_tax_rule - catalogProductSimple::order_default - Flat Rate - Fixed - checkmo - 125.00 - - - - diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/CreateTaxRateEntityTest.php b/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/CreateTaxRateEntityTest.php deleted file mode 100644 index a11e906ffc5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/CreateTaxRateEntityTest.php +++ /dev/null @@ -1,78 +0,0 @@ - Tax > Manage Tax Zones and Rates. - * 3. Click 'Add New Tax Rate' button. - * 4. Fill in data according to dataset - * 5. Save Tax Rate. - * 6. Perform all assertions. - * - * @group Tax_(CS) - * @ZephyrId MPERF-6757 - */ -class CreateTaxRateEntityTest extends Injectable -{ - /** - * Tax Rate grid page. - * - * @var TaxRateIndex - */ - protected $taxRateIndexPage; - - /** - * Tax Rate new/edit page. - * - * @var TaxRateNew - */ - protected $taxRateNewPage; - - /** - * Injection data. - * - * @param TaxRateIndex $taxRateIndexPage - * @param TaxRateNew $taxRateNewPage - * @return void - */ - public function __inject(TaxRateIndex $taxRateIndexPage, TaxRateNew $taxRateNewPage) - { - $this->taxRateIndexPage = $taxRateIndexPage; - $this->taxRateNewPage = $taxRateNewPage; - } - - /** - * Create Tax Rate Entity test. - * - * @param TaxRate $taxRate - * @return void - */ - public function test(TaxRate $taxRate) - { - // Steps: - $this->taxRateIndexPage->open(); - $this->taxRateIndexPage->getPageActionsBlock()->addNew(); - $this->taxRateNewPage->getTaxRateForm()->fill($taxRate); - $this->taxRateNewPage->getFormPageActions()->save(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/CreateTaxRateEntityTest.xml b/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/CreateTaxRateEntityTest.xml deleted file mode 100644 index 95c08d4b5de..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/CreateTaxRateEntityTest.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - TaxIdentifier%isolation% - No - - - - - * - Australia - 20 - - - - - - - TaxIdentifier%isolation% - Yes - 90001 - 96162 - - - United States - California - 15.5 - - - - - - - TaxIdentifier%isolation% - No - - - - - 180 - Canada - * - 25 - - - - - - - TaxIdentifier%isolation% - Yes - 0 - 7800935 - - - United Kingdom - 7.75 - - - - diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/CreateTaxRuleEntityTest.php b/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/CreateTaxRuleEntityTest.php deleted file mode 100644 index d821a653e8f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/CreateTaxRuleEntityTest.php +++ /dev/null @@ -1,89 +0,0 @@ - Tax -> Manage Tax Rules. - * 3. Click 'Add New Tax Rule' button. - * 4. Fill in data according to dataset. - * 5. Save Tax Rule. - * 6. Perform all assertions. - * - * @group Tax_(CS) - * @ZephyrId MPERF-6767 - */ -class CreateTaxRuleEntityTest extends Injectable -{ - /** - * Tax rule index page. - * - * @var TaxRuleIndex - */ - protected $taxRuleIndexPage; - - /** - * Tax rule form page. - * - * @var TaxRuleNew - */ - protected $taxRuleNewPage; - - /** - * Injection data. - * - * @param TaxRuleIndex $taxRuleIndexPage - * @param TaxRuleNew $taxRuleNewPage - * @return void - */ - public function __inject(TaxRuleIndex $taxRuleIndexPage, TaxRuleNew $taxRuleNewPage) - { - $this->taxRuleIndexPage = $taxRuleIndexPage; - $this->taxRuleNewPage = $taxRuleNewPage; - } - - /** - * Test create tax rule. - * - * @param TaxRule $taxRule - * @return void - */ - public function test(TaxRule $taxRule) - { - // Steps - $this->taxRuleIndexPage->open(); - $this->taxRuleIndexPage->getPageActionsBlock()->addNew(); - $this->taxRuleNewPage->getTaxRuleForm()->fill($taxRule); - $this->taxRuleNewPage->getFormPageActions()->save(); - } - - /** - * Delete all tax rules. - * - * @return void - */ - public function tearDown() - { - $this->objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/CreateTaxRuleEntityTest.xml b/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/CreateTaxRuleEntityTest.xml deleted file mode 100644 index 2fbddc13c85..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/CreateTaxRuleEntityTest.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - TaxIdentifier%isolation% - US-CA-*-Rate 1 - US-NY-*-Rate 1 - - - customer_tax_class - - - product_tax_class - - - 1 - 1 - - - - - - TaxIdentifier%isolation% - default - - - - - Retail Customer - customer_tax_class - Taxable Goods - - - - - 1 - - - - - - TaxIdentifier%isolation% - withZipRange - default - - - Retail Customer - customer_tax_class - Taxable Goods - product_tax_class - 1 - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/DeleteTaxRateEntityTest.php b/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/DeleteTaxRateEntityTest.php deleted file mode 100644 index 7f80a002309..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/DeleteTaxRateEntityTest.php +++ /dev/null @@ -1,82 +0,0 @@ - Tax -> Manage Tax Zones and Rates. - * 3. Open created tax rate. - * 4. Click "Delete Rate" button. - * 5. Perform all assertions. - * - * @group Tax_(CS) - * @ZephyrId MPERF-7656 - */ -class DeleteTaxRateEntityTest extends Injectable -{ - /** - * Tax Rate grid page. - * - * @var TaxRateIndex - */ - protected $taxRateIndex; - - /** - * Tax Rate edit page. - * - * @var TaxRateEdit - */ - protected $taxRateEdit; - - /** - * Injection data. - * - * @param TaxRateIndex $taxRateIndex - * @param TaxRateEdit $taxRateEdit - * @return void - */ - public function __inject(TaxRateIndex $taxRateIndex, TaxRateEdit $taxRateEdit) - { - $this->taxRateIndex = $taxRateIndex; - $this->taxRateEdit = $taxRateEdit; - } - - /** - * Delete Tax Rate Entity test. - * - * @param TaxRate $taxRate - * @return void - */ - public function testDeleteTaxRate(TaxRate $taxRate) - { - // Precondition - $taxRate->persist(); - - // Steps - $this->taxRateIndex->open(); - $this->taxRateIndex->getTaxRatesGrid()->searchAndOpen(['code' => $taxRate->getCode()]); - $this->taxRateEdit->getFormPageActions()->deleteAndAcceptAlert(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/DeleteTaxRateEntityTest.xml b/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/DeleteTaxRateEntityTest.xml deleted file mode 100644 index 4618b3bc1ad..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/DeleteTaxRateEntityTest.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - default - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/TaxCalculationTest.php b/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/TaxCalculationTest.php deleted file mode 100644 index 974e3c49aed..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/TaxCalculationTest.php +++ /dev/null @@ -1,99 +0,0 @@ - Taxes > Tax Rules. - * 3. Click 'Add New Tax Rule' button. - * 4. Assign default rates to rule. - * 5. Save Tax Rate. - * 6. Go to Products > Catalog. - * 7. Add new product. - * 8. Fill data according to dataset. - * 9. Save product. - * 10. Go to Stores > Configuration. - * 11. Fill Tax configuration according to data set. - * 12. Save tax configuration. - * 13. Perform all assertions. - * - * @group Tax_(CS) - * @ZephyrId MPERF-6987 - */ -class TaxCalculationTest extends Scenario -{ - /** - * Delete all tax rules. - * - * @return void - */ - public function __prepare() - { - $this->objectManager->create('\Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => 'default_tax_configuration'] - )->run(); - } - - /** - * Runs tax calculation test. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } - - /** - * Tear down after each test. - * - * @return void - */ - public function tearDown() - { - $this->objectManager->create('\Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - $this->objectManager->create('\Mage\SalesRule\Test\TestStep\DeleteAllSalesRuleStep')->run(); - $this->objectManager->create('\Mage\CatalogRule\Test\TestStep\DeleteAllCatalogRulesStep')->run(); - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => 'default_tax_configuration'] - )->run(); - } - - /** - * Setup default configuration after test. - * - * @return void - */ - public static function tearDownAfterClass() - { - $objectManager = ObjectManager::getInstance(); - $objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => 'default_tax_configuration'] - )->run(); - $objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => 'shipping_tax_class_taxable_goods', 'rollback' => true] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/TaxCalculationTest.xml b/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/TaxCalculationTest.xml deleted file mode 100644 index 540bcafa693..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/TaxCalculationTest.xml +++ /dev/null @@ -1,330 +0,0 @@ - - - - - - Simple product tier price with sales rule, customer tax equals store tax and catalog price including tax - shipping_tax_class_taxable_goods, row_cat_incl_ship_excl_after_disc_on_excl, display_excluding_including_tax - catalogProductSimple::simple_with_tier_price - active_sales_rule_for_all_groups_no_coupon - customer_equals_store_rate - johndoe_unique - 277.14 - 300.00 - 277.14 - 300.00 - 13.86 - 15.00 - 41.57 - 45.00 - 41.57 - 45.00 - 20.79 - 15.00 - 16.24 - 3.09 - 37.36 - 40.45 - Flat Rate - Fixed - checkmo - Estimate_US_address_NY - - - - - - Simple product group price with sales rule, customer tax greater than store tax and catalog price excluding tax - shipping_tax_class_taxable_goods, row_cat_excl_ship_incl_before_disc_on_incl, display_excluding_including_tax - catalogProductSimple::simple_with_group_price_and_category - active_sales_rule_for_all_groups_no_coupon - customer_greater_store_rate - johndoe_unique - 90.99 - 98.61 - 90.99 - 98.61 - 90.99 - 98.61 - 272.97 - 295.83 - 272.97 - 295.83 - 147.92 - 13.86 - 15.02 - 24.02 - 138.91 - 162.93 - Flat Rate - Fixed - checkmo - Estimate_US_address_NY - - - - - - Simple product group price with sales rule, customer tax less than store tax and catalog price excluding tax - shipping_tax_class_taxable_goods, total_cat_excl_ship_incl_after_disc_on_excl, display_excluding_including_tax - catalogProductSimple::simple_with_group_price_and_category - active_sales_rule_for_all_groups_no_coupon - customer_less_store_rate - johndoe_unique - 90.99 - 98.50 - 90.99 - 98.50 - 90.99 - 98.50 - 272.97 - 295.49 - 272.97 - 295.49 - 136.49 - 13.84 - 14.98 - 12.40 - 150.32 - 162.72 - Flat Rate - Fixed - checkmo - Estimate_US_address_NY - - - - - - Simple product special price with sales rule, customer tax less than store tax and catalog price including tax - shipping_tax_class_taxable_goods, row_cat_incl_ship_excl_before_disc_on_incl, display_excluding_including_tax - catalogProductSimple::product_with_special_price_and_category - active_sales_rule_for_all_groups_no_coupon - customer_less_store_rate - johndoe_unique - 83.05 - 89.90 - 83.05 - 89.90 - 83.05 - 89.90 - 249.15 - 269.70 - 249.15 - 269.70 - 134.85 - 15.00 - 16.24 - 21.79 - 129.30 - 151.09 - Flat Rate - Fixed - checkmo - Estimate_US_address_NY - - - - - - Simple product tier price with sales rule, customer tax less than store tax and catalog price including tax - shipping_tax_class_taxable_goods, unit_cat_incl_ship_incl_before_disc_on_incl, display_excluding_including_tax - catalogProductSimple::simple_with_tier_price - active_sales_rule_for_all_groups_no_coupon - customer_less_store_rate - johndoe_unique - 276.81 - 299.65 - 276.81 - 299.65 - 13.84 - 14.98 - 41.52 - 44.94 - 41.52 - 44.94 - 22.47 - 13.84 - 14.98 - 4.56 - 32.89 - 37.45 - Flat Rate - Fixed - checkmo - Estimate_US_address_NY - - - - - - Simple product special price with sales rule, customer tax equals store tax and catalog price excluding tax - shipping_tax_class_taxable_goods, total_cat_excl_ship_incl_before_disc_on_incl, display_excluding_including_tax - catalogProductSimple::product_with_special_price_and_category - active_sales_rule_for_all_groups_no_coupon - customer_equals_store_rate - johndoe_unique - 90.00 - 97.43 - 90.00 - 97.43 - 90.00 - 97.43 - 270.00 - 292.28 - 270.00 - 292.28 - 146.14 - 13.86 - 15.00 - 23.42 - 137.72 - 161.14 - Flat Rate - Fixed - checkmo - Estimate_US_address_NY - - - - - - Simple product group price with sales rule, customer tax equals store tax and catalog price excluding tax - shipping_tax_class_taxable_goods, unit_cat_excl_ship_excl_after_disc_on_excl, display_excluding_including_tax - catalogProductSimple::simple_with_group_price_and_category - active_sales_rule_for_all_groups_no_coupon - customer_equals_store_rate - johndoe_unique - 90.99 - 98.50 - 90.99 - 98.50 - 90.99 - 98.50 - 272.97 - 295.50 - 272.97 - 295.50 - 136.49 - 15.00 - 16.24 - 12.49 - 151.48 - 163.97 - Flat Rate - Fixed - checkmo - Estimate_US_address_NY - - - - - - Simple product special price with sales rule, customer tax greater than store tax and catalog price including tax - shipping_tax_class_taxable_goods, total_cat_incl_ship_excl_before_disc_on_excl, display_excluding_including_tax - catalogProductSimple::simple_with_group_price_and_category - active_sales_rule_for_all_groups_no_coupon - customer_greater_store_rate - johndoe_unique - 84.06 - 91.10 - 84.06 - 91.10 - 84.06 - 91.10 - 252.18 - 273.30 - 252.18 - 273.30 - 126.09 - 15.00 - 16.26 - 22.38 - 141.09 - 163.47 - Flat Rate - Fixed - checkmo - Estimate_US_address_NY - - - - - - Simple product tier price with sales rule, customer tax greater than store tax and catalog price excluding tax - shipping_tax_class_taxable_goods, total_cat_excl_ship_incl_after_disc_on_incl, display_excluding_including_tax - catalogProductSimple::simple_with_tier_price - active_sales_rule_for_all_groups_no_coupon - customer_greater_store_rate - johndoe_unique - 300.00 - 325.13 - 300.00 - 325.13 - 15.00 - 16.26 - 45.00 - 48.77 - 45.00 - 48.77 - 24.39 - 13.86 - 15.02 - 2.89 - 34.47 - 37.36 - Flat Rate - Fixed - checkmo - Estimate_US_address_NY - - - - - - Simple product special price with sales rule, customer tax greater than store tax and catalog price excluding tax - shipping_tax_class_taxable_goods, unit_cat_excl_ship_incl_after_disc_on_excl, display_excluding_including_tax - catalogProductSimple::product_with_special_price_and_category - active_sales_rule_for_all_groups_no_coupon - customer_greater_store_rate - johndoe_unique - 90.00 - 97.54 - 90.00 - 97.54 - 90.00 - 97.54 - 270.00 - 292.62 - 270.00 - 292.62 - 135.00 - 13.86 - 15.02 - 12.47 - 148.86 - 161.33 - Flat Rate - Fixed - checkmo - Estimate_US_address_NY - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/TaxWithCrossBorderTest.php b/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/TaxWithCrossBorderTest.php deleted file mode 100644 index 02dff819096..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/TaxWithCrossBorderTest.php +++ /dev/null @@ -1,214 +0,0 @@ -objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - } - - /** - * Injection data. - * - * @param PromoQuoteIndex $promoQuoteIndex - * @param PromoQuoteEdit $promoQuoteEdit - * @param CatalogRuleIndex $catalogRuleIndex - * @param CatalogRuleEdit $catalogRuleEdit - * @param FixtureFactory $fixtureFactory - * @return array - */ - public function __inject( - PromoQuoteIndex $promoQuoteIndex, - PromoQuoteEdit $promoQuoteEdit, - CatalogRuleIndex $catalogRuleIndex, - CatalogRuleEdit $catalogRuleEdit, - FixtureFactory $fixtureFactory - ) { - $this->promoQuoteIndex = $promoQuoteIndex; - $this->promoQuoteEdit = $promoQuoteEdit; - $this->catalogRuleIndex = $catalogRuleIndex; - $this->catalogRuleEdit = $catalogRuleEdit; - $this->fixtureFactory = $fixtureFactory; - - $taxRule = $fixtureFactory->createByCode('taxRule', ['dataset' => 'cross_border_tax_rule']); - $taxRule->persist(); - - return ['customers' => $this->createCustomers()]; - } - - /** - * Create customers. - * - * @return array - */ - protected function createCustomers() - { - $customersData = ['johndoe_unique_TX', 'johndoe_unique']; - $customers = []; - foreach ($customersData as $customerData) { - $customer = $this->fixtureFactory->createByCode('customer', ['dataset' => $customerData]); - $customer->persist(); - $customers[] = $customer; - } - - return $customers; - } - - /** - * Test product prices with tax. - * - * @param CatalogProductSimple $product - * @param string $config - * @param string $salesRule - * @param string $catalogRule - * @return void - */ - public function test(CatalogProductSimple $product, $config, $salesRule, $catalogRule) - { - // Steps: - if ($salesRule !== "-") { - $salesRule = $this->fixtureFactory->createByCode('salesRule', ['dataset' => $salesRule]); - $salesRule->persist(); - $this->salesRule = $salesRule; - } - if ($catalogRule !== "-") { - $catalogRule = $this->fixtureFactory->createByCode('catalogRule', ['dataset' => $catalogRule]); - $catalogRule->persist(); - $this->catalogRule = $catalogRule; - } - $this->objectManager->create('Mage\Core\Test\TestStep\SetupConfigurationStep', ['configData' => $config]) - ->run(); - $product->persist(); - } - - /** - * Delete sales rule, catalog rule, all tax rules and setup default tax configuration. - * - * @return void - */ - public function tearDown() - { - if (isset($this->salesRule)) { - $this->promoQuoteIndex->open(); - $this->promoQuoteIndex->getPromoQuoteGrid()->searchAndOpen(['name' => $this->salesRule->getName()]); - $this->promoQuoteEdit->getFormPageActions()->delete(); - $this->salesRule = null; - } - if (isset($this->catalogRule)) { - $this->catalogRuleIndex->open(); - $this->catalogRuleIndex->getCatalogRuleGrid()->searchAndOpen(['name' => $this->catalogRule->getName()]); - $this->catalogRuleEdit->getFormPageActions()->delete(); - $this->catalogRule = null; - } - $this->objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - } - - /** - * Rollback default configuration. - * - * @return void - */ - public static function tearDownAfterClass() - { - $objectManager = ObjectManager::getInstance(); - $objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => 'default_tax_configuration'] - )->run(); - $objectManager->create('\Mage\Tax\Test\TestStep\CreateTaxRuleStep', ['taxRule' => 'default'])->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/TaxWithCrossBorderTest.xml b/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/TaxWithCrossBorderTest.xml deleted file mode 100644 index 77f1152c29c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/TaxWithCrossBorderTest.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - Cross border include tax - product_with_special_price_and_category - - - - - cross_border_enabled_price_incl_tax, display_excluding_including_tax - - - - Cross border include tax and with Catalog rule - product_with_category - catalog_price_rule_priority_0 - - - cross_border_enabled_price_incl_tax, display_excluding_including_tax - - - - - Cross border include tax and with Sales rule - product_with_category - - - cart_rule - cross_border_enabled_price_incl_tax, display_excluding_including_tax - - - - Cross border include tax and product with custom options - with_one_custom_option_and_category - - - - - cross_border_enabled_price_incl_tax, display_excluding_including_tax - - - - Cross border exclude tax - product_with_category - - - - - cross_border_enabled_price_excl_tax, display_excluding_including_tax - - - - diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/TestStep/CreateTaxRuleStep.php b/dev/tests/functional/tests/app/Mage/Tax/Test/TestStep/CreateTaxRuleStep.php deleted file mode 100644 index 47fd1da7abd..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/TestStep/CreateTaxRuleStep.php +++ /dev/null @@ -1,66 +0,0 @@ -fixtureFactory = $fixtureFactory; - $this->taxRule = $taxRule; - } - - /** - * Create tax rule. - * - * @return array - */ - public function run() - { - $result['taxRule'] = null; - if ($this->taxRule != '-') { - $taxRule = $this->fixtureFactory->createByCode('taxRule', ['dataset' => $this->taxRule]); - $taxRule->persist(); - $result['taxRule'] = $taxRule; - } - return $result; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/TestStep/DeleteAllTaxRulesStep.php b/dev/tests/functional/tests/app/Mage/Tax/Test/TestStep/DeleteAllTaxRulesStep.php deleted file mode 100644 index 67609b6e68b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/TestStep/DeleteAllTaxRulesStep.php +++ /dev/null @@ -1,66 +0,0 @@ -taxRuleIndexPage = $taxRuleIndexPage; - $this->taxRuleNewPage = $taxRuleNewPage; - } - - /** - * Delete all Tax Rules on backend. - * - * @return array - */ - public function run() - { - $this->taxRuleIndexPage->open(); - $this->taxRuleIndexPage->getTaxRuleGrid()->resetFilter(); - while ($this->taxRuleIndexPage->getTaxRuleGrid()->isFirstRowVisible()) { - $this->taxRuleIndexPage->getTaxRuleGrid()->openFirstRow(); - $this->taxRuleNewPage->getFormPageActions()->delete(); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Mage/Tax/Test/etc/curl/di.xml deleted file mode 100644 index ecf91e67e6d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/etc/curl/di.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Mage/Tax/Test/etc/fixture.xml deleted file mode 100644 index ba3e5118592..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/etc/fixture.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - flat - tax_class - Mage\Tax\Model\Resource\Class\Collection - - - id - virtual - - - - - flat - tax_calculation_rate - Mage\Tax\Model\Resource\Calculation\Rate\Collection - code - - - id - virtual - - - - - flat - tax_calculation_rule - Mage\Tax\Model\Resource\Calculation\Rule\Collection - code - - - tax_rate - virtual - Mage\Tax\Test\Fixture\TaxRule\TaxRate - - - tax_customer_class - virtual - Mage\Tax\Test\Fixture\TaxRule\TaxClass - - - tax_product_class - virtual - Mage\Tax\Test\Fixture\TaxRule\TaxClass - - - - diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/etc/testcase.xml b/dev/tests/functional/tests/app/Mage/Tax/Test/etc/testcase.xml deleted file mode 100644 index bd202d845a8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/etc/testcase.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Theme/Test/Block/Links.php b/dev/tests/functional/tests/app/Mage/Theme/Test/Block/Links.php deleted file mode 100644 index 33de5f02a08..00000000000 --- a/dev/tests/functional/tests/app/Mage/Theme/Test/Block/Links.php +++ /dev/null @@ -1,53 +0,0 @@ -_rootElement->find(sprintf($this->linkSelector, $linkTitle))->click(); - } - - /** - * Check is link is visible. - * - * @param string $linkTitle - * @return bool - */ - public function isLinkVisible($linkTitle) - { - return $this->_rootElement->find(sprintf($this->linkSelector, $linkTitle))->isVisible(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Theme/Test/Block/Title.php b/dev/tests/functional/tests/app/Mage/Theme/Test/Block/Title.php deleted file mode 100644 index 4bb2bf177bb..00000000000 --- a/dev/tests/functional/tests/app/Mage/Theme/Test/Block/Title.php +++ /dev/null @@ -1,34 +0,0 @@ -_rootElement->getText(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Theme/Test/Block/TopLinks.php b/dev/tests/functional/tests/app/Mage/Theme/Test/Block/TopLinks.php deleted file mode 100644 index c322f3223b9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Theme/Test/Block/TopLinks.php +++ /dev/null @@ -1,117 +0,0 @@ -_rootElement->find($this->cartContent)->isVisible()) { - $this->_rootElement->find($this->cartLink)->click(); - } - } - - /** - * Open Account Link. - * - * @return void - */ - public function openAccount() - { - $this->_rootElement->find($this->accountLink)->click(); - } - - /** - * Get account label text. - * - * @return string - */ - public function getAccountLabelText() - { - return $this->_rootElement->find($this->accountLabel)->getText(); - } - - /** - * Open account's links. - * - * @param string $linkTitle - * @return void - */ - public function openAccountLink($linkTitle) - { - $this->openAccount(); - $this->getAccountLinksBlock()->openLink($linkTitle); - } - - /** - * Get accounts link block. - * - * @return Links - */ - protected function getAccountLinksBlock() - { - return $this->blockFactory->create( - 'Mage\Theme\Test\Block\Links', - ['element' => $this->_rootElement->find($this->accountLinksBlock, Locator::SELECTOR_XPATH)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Weee/Test/Block/Cart.php b/dev/tests/functional/tests/app/Mage/Weee/Test/Block/Cart.php deleted file mode 100644 index 053d7a638b0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Weee/Test/Block/Cart.php +++ /dev/null @@ -1,31 +0,0 @@ - [ - 'selector' => '.product-cart-price .cart-price .price' - ], - 'subtotal' => [ - 'selector' => '.product-cart-total .cart-price .price' - ], - 'cart_item_price' => [ - 'selector' => '.product-cart-price .cart-price .price' - ], - 'cart_item_subtotal' => [ - 'selector' => '.product-cart-total .cart-price .price' - ], - 'price_fpt' => [ - 'selector' => '.product-cart-price .weee .price' - ], - 'price_fpt_total' => [ - 'selector' => '.product-cart-price .cart-tax-total .weee .price' - ], - 'subtotal_fpt' => [ - 'selector' => '.product-cart-total .weee .price' - ], - 'subtotal_fpt_total' => [ - 'selector' => '.product-cart-total .cart-tax-total .weee .price' - ], - 'cart_item_subtotal_incl_tax' => [ - 'selector' => '.product-cart-total .cart-tax-total .price' - ], - 'cart_item_price_incl_tax' => [ - 'selector' => '.product-cart-price[data-rwd-tax-label="Incl. Tax"] .cart-tax-total .price' - ] - ]; - - /** - * Open fpt blocks. - * - * @return void - */ - public function openFpt() - { - $fptBlocks = $this->_rootElement->getElements($this->fpt); - $fptPricesBlocks = $this->_rootElement->getElements($this->price); - foreach ($fptBlocks as $key => $fptBlock) { - if (!$fptBlock->isVisible()) { - $fptPricesBlocks[$key]->click(); - } - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Weee/Test/Block/Product/ListProduct.php b/dev/tests/functional/tests/app/Mage/Weee/Test/Block/Product/ListProduct.php deleted file mode 100644 index f59f555bcd6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Weee/Test/Block/Product/ListProduct.php +++ /dev/null @@ -1,48 +0,0 @@ -productItem, $product->getName()); - return $this->blockFactory->create( - 'Mage\Weee\Test\Block\Product\ProductList\ProductItem', - ['element' => $this->_rootElement->find($locator, Locator::SELECTOR_XPATH)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Weee/Test/Block/Product/Price.php b/dev/tests/functional/tests/app/Mage/Weee/Test/Block/Product/Price.php deleted file mode 100644 index 5a750c60490..00000000000 --- a/dev/tests/functional/tests/app/Mage/Weee/Test/Block/Product/Price.php +++ /dev/null @@ -1,54 +0,0 @@ - [ - 'selector' => '.regular-price .price' - ], - 'special_price' => [ - 'selector' => '.special-price .price' - ], - 'category_price_excl_tax' => [ - 'selector' => '.price-excluding-tax span.price' - ], - 'category_price_incl_tax' => [ - 'selector' => '.price-including-tax span.price' - ], - 'product_view_price_incl_tax' => [ - 'selector' => '.price-including-tax span.price' - ], - 'product_view_price_excl_tax' => [ - 'selector' => '.price-excluding-tax span.price' - ], - 'fpt_price' => [ - 'selector' => '.weee .price' - ], - 'final_price' => [ - 'selector' => '[id^="product-price-weee"] .price' - ] - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Weee/Test/Block/Product/ProductList/ProductItem.php b/dev/tests/functional/tests/app/Mage/Weee/Test/Block/Product/ProductList/ProductItem.php deleted file mode 100644 index 4bb91fbca12..00000000000 --- a/dev/tests/functional/tests/app/Mage/Weee/Test/Block/Product/ProductList/ProductItem.php +++ /dev/null @@ -1,45 +0,0 @@ -blockFactory->create( - 'Mage\Weee\Test\Block\Product\Price', - ['element' => $this->_rootElement->find($this->priceBlockClass)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Weee/Test/Block/Product/View.php b/dev/tests/functional/tests/app/Mage/Weee/Test/Block/Product/View.php deleted file mode 100644 index d9cb75510a6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Weee/Test/Block/Product/View.php +++ /dev/null @@ -1,42 +0,0 @@ -blockFactory->create( - 'Mage\Weee\Test\Block\Product\Price', - ['element' => $this->_rootElement->find($this->priceBox)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Weee/Test/Constraint/AssertFptApplied.php b/dev/tests/functional/tests/app/Mage/Weee/Test/Constraint/AssertFptApplied.php deleted file mode 100644 index baf99e0e016..00000000000 --- a/dev/tests/functional/tests/app/Mage/Weee/Test/Constraint/AssertFptApplied.php +++ /dev/null @@ -1,248 +0,0 @@ -open()->getPageActions()->flushCacheStorage(); - $this->product = $product; - $this->expectedPrices = $prices; - $this->cmsIndex = $cmsIndex; - $this->catalogCategoryView = $catalogCategoryView; - $this->catalogProductView = $catalogProductView; - $this->checkoutCart = $checkoutCart; - $this->fptLabel = $this->getFptLabel($product); - $this->clearShoppingCart(); - - $error = $this->verifyData($prices, $this->getPrices()); - \PHPUnit_Framework_Assert::assertEmpty($error, $error); - } - - /** - * Get fpt label. - * - * @param InjectableFixture $product - * @return string - */ - protected function getFptLabel(InjectableFixture $product) - { - return $product->getDataFieldConfig('attribute_set_id')['source'] - ->getAttributeSet()->getDataFieldConfig('assigned_attributes')['source'] - ->getAttributes()[0]->getFrontendLabel(); - } - - /** - * Clear shopping cart. - * - * @return void - */ - protected function clearShoppingCart() - { - $this->checkoutCart->open(); - $this->checkoutCart->getCartBlock()->clearShoppingCart(); - } - - /** - * Get prices with fpt on category, product and cart pages. - * - * @return array - */ - protected function getPrices() - { - $actualPrices = []; - foreach (array_keys($this->expectedPrices) as $priceType) { - $actualPrices[$priceType] = $this->{'get' . ucfirst($priceType) . 'Price'}(); - } - - return $actualPrices; - } - - /** - * Get prices on category page. - * - * @return array - */ - protected function getCategoryPrice() - { - $prices = []; - $this->cmsIndex->open(); - $this->cmsIndex->getTopmenu()->selectCategory($this->product->getCategoryIds()[0]); - $priceBlock = $this->catalogCategoryView->getWeeeListProductBlock()->getProductItem($this->product) - ->getPriceBlock(); - foreach ($this->expectedPrices['category'] as $key => $type) { - $prices[$key] = $this->getPrice($priceBlock, $key); - } - - return $prices; - } - - /** - * Get price. - * - * @param Price $block - * @param string $type - * @param string $currency - * @return string|null - */ - protected function getPrice(Price $block, $type, $currency = '$') - { - $price = $block->getTypePriceElement($type); - return $price->isVisible() ? trim($price->getText(), $currency) : null; - } - - /** - * Fill options, get price and add to cart. - * - * @return array - */ - protected function getProductPrice() - { - $prices = []; - $this->catalogCategoryView->getListProductBlock()->openProductViewPage($this->product->getName()); - $priceBlock = $this->catalogProductView->getWeeeViewBlock()->getPriceBlock(); - $this->catalogProductView->getViewBlock()->fillOptions($this->product); - foreach ($this->expectedPrices['product'] as $key => $type) { - $prices[$key] = $this->getPrice($priceBlock, $key); - } - - return $prices; - } - - /** - * Get cart prices. - * - * @return array - */ - protected function getCartItemPrice() - { - $prices = []; - $this->catalogProductView->getViewBlock()->clickAddToCart(); - $productWeeeItem = $this->checkoutCart->getWeeeCartBlock()->getCartItem($this->product); - $productWeeeItem->openFpt(); - foreach ($this->expectedPrices['cartItem'] as $key => $type) { - $prices[$key] = $productWeeeItem->getCartItemTypePrice($key); - } - - return $prices; - } - - /** - * Get grand total. - * - * @return array - */ - protected function getTotalPrice() - { - $prices = []; - foreach ($this->expectedPrices['total'] as $key => $type) { - $prices[$key] = $this->checkoutCart->getTotalsBlock()->getData($key); - } - - return $prices; - } - - /** - * Text of fpt is applied. - * - * @return string - */ - public function toString() - { - return 'FPT is applied to product.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Weee/Test/Page/Category/CatalogCategoryView.xml b/dev/tests/functional/tests/app/Mage/Weee/Test/Page/Category/CatalogCategoryView.xml deleted file mode 100644 index 670a80a554d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Weee/Test/Page/Category/CatalogCategoryView.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Weee/Test/Page/CheckoutCart.xml b/dev/tests/functional/tests/app/Mage/Weee/Test/Page/CheckoutCart.xml deleted file mode 100644 index 3f8cb3ab3a8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Weee/Test/Page/CheckoutCart.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Weee/Test/Page/Product/CatalogProductView.xml b/dev/tests/functional/tests/app/Mage/Weee/Test/Page/Product/CatalogProductView.xml deleted file mode 100644 index a531ffb454b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Weee/Test/Page/Product/CatalogProductView.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Weee/Test/Repository/ConfigData.xml b/dev/tests/functional/tests/app/Mage/Weee/Test/Repository/ConfigData.xml deleted file mode 100644 index 31280cee68f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Weee/Test/Repository/ConfigData.xml +++ /dev/null @@ -1,650 +0,0 @@ - - - - - - - tax - 1 - No - - - - tax - 1 - Including FPT and FPT description - 1 - - - tax - 1 - Including FPT and FPT description - 1 - - - tax - 1 - Including FPT and FPT description - 1 - - - tax - 1 - No - - - - tax - 1 - No - - - - - - tax - 1 - Total - TOTAL_BASE_CALCULATION - - - tax - 1 - Excluding Tax - - - - tax - 1 - Excluding Tax - - - - tax - 1 - After Discount - 1 - - - tax - 1 - Excluding Tax - - - - tax - 1 - No - - - - tax - 1 - Yes - 1 - - - tax - 1 - Excluding FPT, FPT description, final price - 2 - - - tax - 1 - Excluding FPT, FPT description, final price - 2 - - - tax - 1 - Excluding FPT, FPT description, final price - 2 - - - tax - 1 - Yes - 1 - - - tax - 1 - Yes - 1 - - - - - tax - 1 - Total - TOTAL_BASE_CALCULATION - - - tax - 1 - Excluding Tax - - - - tax - 1 - Excluding Tax - - - - tax - 1 - - - - - tax - 1 - Including Tax - 1 - - - tax - 1 - No - - - - tax - 1 - Yes - 1 - - - tax - 1 - Including FPT and FPT description - 1 - - - tax - 1 - Including FPT and FPT description - 1 - - - tax - 1 - Including FPT and FPT description - 1 - - - tax - 1 - Yes - 1 - - - tax - 1 - Yes - 1 - - - - - tax - 1 - Total - TOTAL_BASE_CALCULATION - - - tax - 1 - Including Tax - 1 - - - tax - 1 - Including Tax - 1 - - - tax - 1 - After Discount - 1 - - - tax - 1 - Excluding Tax - - - - tax - 1 - No - - - - tax - 1 - Yes - 1 - - - tax - 1 - Excluding FPT, FPT description, final price - 2 - - - tax - 1 - Excluding FPT, FPT description, final price - 2 - - - tax - 1 - Excluding FPT, FPT description, final price - 2 - - - tax - 1 - Yes - 1 - - - tax - 1 - Yes - 1 - - - - - tax - 1 - Total - TOTAL_BASE_CALCULATION - - - tax - 1 - Including Tax - 1 - - - tax - 1 - Including Tax - 1 - - - tax - 1 - - - - - tax - 1 - Including Tax - 1 - - - tax - 1 - No - - - - tax - 1 - Yes - 1 - - - tax - 1 - Including FPT and FPT description - 1 - - - tax - 1 - Including FPT and FPT description - 1 - - - tax - 1 - Including FPT and FPT description - 1 - - - tax - 1 - Yes - 1 - - - tax - 1 - Yes - 1 - - - - - tax - 1 - Total - TOTAL_BASE_CALCULATION - - - tax - 1 - Excluding Tax - - - - tax - 1 - Excluding Tax - - - - tax - 1 - After Discount - 1 - - - tax - 1 - Excluding Tax - - - - tax - 1 - No - - - - tax - 1 - Yes - 1 - - - tax - 1 - Excluding FPT, FPT description, final price - 2 - - - tax - 1 - Excluding FPT, FPT description, final price - 2 - - - tax - 1 - Excluding FPT, FPT description, final price - 2 - - - tax - 1 - No - - - - tax - 1 - Yes - 1 - - - - - tax - 1 - Total - TOTAL_BASE_CALCULATION - - - tax - 1 - Excluding Tax - - - - tax - 1 - Excluding Tax - - - - tax - 1 - - - - - tax - 1 - Including Tax - 1 - - - tax - 1 - No - - - - tax - 1 - Yes - 1 - - - tax - 1 - Excluding FPT, FPT description, final price - 2 - - - tax - 1 - Excluding FPT, FPT description, final price - 2 - - - tax - 1 - Excluding FPT, FPT description, final price - 2 - - - tax - 1 - No - - - - tax - 1 - Yes - 1 - - - - - tax - 1 - Total - TOTAL_BASE_CALCULATION - - - tax - 1 - Including Tax - 1 - - - tax - 1 - Including Tax - 1 - - - tax - 1 - After Discount - 1 - - - tax - 1 - Excluding Tax - - - - tax - 1 - No - - - - tax - 1 - Yes - 1 - - - tax - 1 - Excluding FPT, FPT description, final price - 2 - - - tax - 1 - Excluding FPT, FPT description, final price - 2 - - - tax - 1 - Excluding FPT, FPT description, final price - 2 - - - tax - 1 - No - - - - tax - 1 - Yes - 1 - - - - - tax - 1 - Total - TOTAL_BASE_CALCULATION - - - tax - 1 - Including Tax - 1 - - - tax - 1 - Including Tax - 1 - - - tax - 1 - - - - - tax - 1 - Including Tax - 1 - - - tax - 1 - No - - - - tax - 1 - Yes - 1 - - - tax - 1 - Including FPT and FPT description - 1 - - - tax - 1 - Including FPT and FPT description - 1 - - - tax - 1 - Including FPT and FPT description - 1 - - - tax - 1 - No - - - - tax - 1 - Yes - 1 - - - - diff --git a/dev/tests/functional/tests/app/Mage/Weee/Test/TestCase/CreateTaxWithFptTest.php b/dev/tests/functional/tests/app/Mage/Weee/Test/TestCase/CreateTaxWithFptTest.php deleted file mode 100644 index a39c43d513b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Weee/Test/TestCase/CreateTaxWithFptTest.php +++ /dev/null @@ -1,90 +0,0 @@ -objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => 'default_tax_configuration'] - )->run(); - $customer = $fixtureFactory->createByCode('customer', ['dataset' => 'johndoe_with_addresses']); - $customer->persist(); - $taxRule = $fixtureFactory->createByCode('taxRule', ['dataset' => 'tax_rule_default']); - $taxRule->persist(); - $productTemplate = $fixtureFactory->createByCode( - 'catalogAttributeSet', - ['dataset' => 'custom_attribute_set_with_fpt'] - ); - $productTemplate->persist(); - - return [ - 'customer' => $customer, - 'data' => ['attribute_set_id' => ['attribute_set' => $productTemplate]] - ]; - } - - /** - * Run create tax with Fpt test. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } - - /** - * Revert configuration to default. - * - * @return void - */ - public function tearDown() - { - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => 'default_tax_configuration,shipping_tax_class_taxable_goods_rollback'] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Weee/Test/TestCase/CreateTaxWithFptTest.xml b/dev/tests/functional/tests/app/Mage/Weee/Test/TestCase/CreateTaxWithFptTest.xml deleted file mode 100644 index 545db9c6f1b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Weee/Test/TestCase/CreateTaxWithFptTest.xml +++ /dev/null @@ -1,221 +0,0 @@ - - - - - - Check with next configuration "not taxed FPT display set to Excluding, Description and Including FPT on product with custom option catalog price Excluding Tax" - shipping_tax_class_taxable_goods,tax_with_fpt_cat_excl_disc_on_excl - catalogProductSimple::with_custom_option_and_fpt - 70.00 - 10.00 - 80.00 - 70.00 - 10.00 - 100.00 - 100 - 110 - 10.00 - 100 - 110 - 10.00 - 118.25 - - - - Check with next configuration "not taxed FPT display set to Including FPT and Description on product with custom option catalog price Excluding Tax" - shipping_tax_class_taxable_goods,tax_with_fpt_cat_excl_disc_on_incl, display_including_tax - catalogProductSimple::with_custom_option_and_fpt - 75.78 - 10.00 - 85.78 - 75.78 - 10.00 - 118.25 - 108.25 - 118.25 - 10.00 - 108.25 - 118.25 - 10.00 - 118.25 - 110 - - - - Check with next configuration "not taxed FPT display set to Excluding, Description and Including FPT on product with special price catalog price Excluding Tax" - shipping_tax_class_taxable_goods,tax_with_fpt_cat_excl_disc_on_incl, display_including_tax - catalogProductSimple::with_special_price_and_fpt - 118.25 - 108.25 - 10.00 - 118.25 - 108.25 - 10.00 - 108.25 - 118.25 - 10.00 - 108.25 - 118.25 - 10.00 - 118.25 - - - - Check with next configuration "not taxed FPT display set to Including FPT and Description on product with special price catalog price Excluding Tax" - shipping_tax_class_taxable_goods,tax_with_fpt_cat_excl_disc_on_excl - catalogProductSimple::with_special_price_and_fpt - 110 - 100 - 10.00 - 110 - 100 - 10.00 - 100 - 110 - 10.00 - 100 - 110 - 10.00 - 118.25 - - - - Check with next configuration "taxed FPT display set to Excluding, Description and Including FPT on product with with custom option catalog price Excluding Tax" - shipping_tax_class_taxable_goods,tax_with_fpt_taxed_cat_excl_disc_on_excl - catalogProductSimple::with_custom_option_and_fpt - 70.00 - 10.00 - 80.00 - 70.00 - 10.00 - 100.00 - 100 - 110 - 10.00 - 100 - 110 - 10.00 - 119.08 - - - - Check with next configuration "taxed FPT display set to Including FPT and Description on product with with custom option catalog price Excluding Tax" - shipping_tax_class_taxable_goods,tax_with_fpt_taxed_cat_excl_disc_on_incl, display_including_tax - catalogProductSimple::with_custom_option_and_fpt - 86.61 - 10.83 - 119.08 - 10.83 - 119.08 - 10.83 - 119.08 - 10.83 - 110 - 119.08 - - - - Check with next configuration "taxed FPT display set to Excluding, Description and Including FPT on product with special price catalog price Excluding Tax" - shipping_tax_class_taxable_goods,tax_with_fpt_taxed_cat_excl_disc_on_incl, display_including_tax - catalogProductSimple::with_special_price_and_fpt - 119.08 - 10 - 119.08 - 10 - 119.08 - 10.83 - 119.08 - 10.83 - 110 - 119.08 - - - - Check with next configuration "taxed FPT display set to Including FPT and Description on product with special price catalog price Excluding Tax" - shipping_tax_class_taxable_goods,tax_with_fpt_taxed_cat_excl_disc_on_excl - catalogProductSimple::with_special_price_and_fpt - 110.83 - 100 - 10.00 - 110.83 - 100 - 10.00 - 100 - 110 - 10.00 - 100 - 110 - 10.00 - 119.08 - - - - Check with next configuration "taxed FPT display set to Excluding, Description and Including FPT on product with with special price and catalog price Including Tax" - shipping_tax_class_taxable_goods,tax_with_fpt_taxed_cat_incl_disc_on_excl - catalogProductSimple::with_special_price_and_fpt - 110.83 - 92.38 - 10.00 - 110.83 - 92.38 - 10.00 - 92.38 - 102.38 - 10.00 - 92.38 - 102.38 - 10.00 - 110.83 - - - - Check with next configuration "taxed FPT display set to Including FPT and Description on product with with special price and catalog price Including Tax" - shipping_tax_class_taxable_goods,tax_with_fpt_taxed_cat_incl_disc_on_incl, display_including_tax - catalogProductSimple::with_special_price_and_fpt - 110.83 - 10 - 110.83 - 10 - 110.83 - 10.83 - 110.83 - 10.83 - 102.38 - 110.83 - - - - Check with next configuration "taxed FPT display set to Excluding, Description and Including FPT on product with with custom option and catalog price Including Tax" - shipping_tax_class_taxable_goods,tax_with_fpt_taxed_cat_incl_disc_on_excl - catalogProductSimple::with_custom_option_and_fpt - 64.67 - 10.00 - 74.67 - 64.67 - 10.00 - 92.38 - 92.38 - 102.38 - 10.00 - 92.38 - 102.38 - 10.00 - 110.83 - - - - diff --git a/dev/tests/functional/tests/app/Mage/Weee/Test/etc/testcase.xml b/dev/tests/functional/tests/app/Mage/Weee/Test/etc/testcase.xml deleted file mode 100644 index e1da97258d6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Weee/Test/etc/testcase.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/FormPageActions.php b/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/FormPageActions.php deleted file mode 100644 index afe5b174f68..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/FormPageActions.php +++ /dev/null @@ -1,33 +0,0 @@ -_rootElement->find($this->deleteButton)->click(); - $this->browser->acceptAlert(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/ChosenOption.php b/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/ChosenOption.php deleted file mode 100644 index aa0634d62d1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/ChosenOption.php +++ /dev/null @@ -1,87 +0,0 @@ - '\Mage\Adminhtml\Test\Block\Cms\Page\Widget\Chooser', - ]; - - /** - * Select widget options. - * - * @param array $value - * @return void - */ - public function setValue($value) - { - $this->clickSelectButton(); - if (isset($value['filter_url_key'])) { - $grid = $this->getClassBlock($this->chooserClasses['page']); - $grid->searchAndOpen(['chooser_identifier' => $value['filter_url_key']]); - } - } - - /** - * Clicking to select button. - * - * @return void - */ - protected function clickSelectButton() - { - $this->find($this->selectButton, Locator::SELECTOR_XPATH)->click(); - } - - /** - * Get block by class. - * - * @param string $class - * @return mixed - */ - protected function getClassBlock($class) - { - return \Magento\Mtf\ObjectManager::getInstance()->create( - $class, - ['element' => $this->driver->find($this->selectBlock, Locator::SELECTOR_XPATH)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/LayoutUpdates.php b/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/LayoutUpdates.php deleted file mode 100644 index c1d08962693..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/LayoutUpdates.php +++ /dev/null @@ -1,128 +0,0 @@ - $field) { - $this->addLayoutUpdates(); - /** @var LayoutForm $layoutForm */ - $layoutForm = $this->getLayoutForm($field['page_group'], $key); - $layoutForm->fillForm($field); - } - return $this; - } - - /** - * Get layout form. - * - * @param string $field - * @param string $key - * - * @return BlockInterface - */ - protected function getLayoutForm($field, $key) - { - $path = 'Mage\Widget\Test\Block\Adminhtml\Widget\Instance\Edit\Tab\LayoutUpdatesType\\'; - $pageGroup = explode('/', $field); - /** @var LayoutForm $layoutForm */ - return $this->blockFactory->create( - $path . str_replace(" ", "", $pageGroup[0]), - ['element' => $this->_rootElement->find(sprintf($this->formSelector, $key), Locator::SELECTOR_XPATH)] - ); - } - - /** - * Click Add Layout Updates button. - * - * @return void - */ - protected function addLayoutUpdates() - { - $this->_rootElement->find($this->addLayoutUpdates)->click(); - } - - /** - * Get template block. - * - * @return Template - */ - protected function getTemplateBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Template', - ['element' => $this->_rootElement->find($this->templateBlock, Locator::SELECTOR_XPATH)] - ); - } - - /** - * Get data of content tab. - * - * @param array|null $fields - * @param Element|null $element - * @return array|null - */ - public function getDataFormTab($fields = null, Element $element = null) - { - $data = []; - foreach ($fields['layout'] as $key => $layout) { - $layoutForm = $this->getLayoutForm($layout['page_group'], $key); - $data['layout'][] = $layoutForm->getDataFormTab($layout, $element); - } - - return $data; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/LayoutUpdatesType/GenericPages.php b/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/LayoutUpdatesType/GenericPages.php deleted file mode 100644 index a63a598129c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/LayoutUpdatesType/GenericPages.php +++ /dev/null @@ -1,38 +0,0 @@ -dataMapping($fields); - - return $this->_getData($dataMapping, $element); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/LayoutUpdatesType/GenericPages.xml b/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/LayoutUpdatesType/GenericPages.xml deleted file mode 100644 index 348122ada0d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/LayoutUpdatesType/GenericPages.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - .page_group_select - optgroupselect - - - .block_reference select - select - - - - diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/LayoutUpdatesType/LayoutForm.php b/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/LayoutUpdatesType/LayoutForm.php deleted file mode 100644 index 6d7d0e5fe75..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/LayoutUpdatesType/LayoutForm.php +++ /dev/null @@ -1,92 +0,0 @@ -_rootElement : $element; - $mapping = $this->dataMapping($layoutFields); - foreach ($mapping as $key => $values) { - $this->_fill([$key => $values], $element); - $this->getTemplateBlock()->waitLoader(); - } - } - - /** - * Getting options data form on the product form. - * - * @param array $fields [optional] - * @param Element $element [optional] - * @return array - */ - public function getDataOptions(array $fields = null, Element $element = null) - { - $element = $element === null ? $this->_rootElement : $element; - $mapping = $this->dataMapping($fields); - return $this->_getData($mapping, $element); - } - - /** - * Get template block. - * - * @return Template - */ - protected function getTemplateBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Template', - ['element' => $this->_rootElement->find($this->templateBlock, Locator::SELECTOR_XPATH)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/LayoutUpdatesType/Product/Grid.php b/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/LayoutUpdatesType/Product/Grid.php deleted file mode 100644 index 73a03727d5b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/LayoutUpdatesType/Product/Grid.php +++ /dev/null @@ -1,51 +0,0 @@ - [ - 'selector' => 'input[name="chooser_name"]', - ], - 'sku' => [ - 'selector' => 'input[name="chooser_sku"]', - ], - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/LayoutUpdatesType/Products.php b/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/LayoutUpdatesType/Products.php deleted file mode 100644 index 6994463b545..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/LayoutUpdatesType/Products.php +++ /dev/null @@ -1,126 +0,0 @@ -dataMapping($widgetOptionsFields); - $fields = array_diff_key($mapping, ['entities' => '']); - foreach ($fields as $key => $field) { - $this->_fill([$key => $field], $this->_rootElement); - $this->getTemplateBlock()->waitLoader(); - } - if (isset($mapping['entities'])) { - $this->selectEntitiesInGrid($mapping['entities']); - } - } - - /** - * Select entities in grid on layout tab. - * - * @param array $entities - * @return void - */ - protected function selectEntitiesInGrid(array $entities) - { - foreach($entities['value'] as $entity) { - $this->_rootElement->find($this->chooser, Locator::SELECTOR_XPATH)->click(); - $this->getTemplateBlock()->waitLoader(); - /** @var Grid $productGrid */ - $productGrid = $this->getProductGrid(); - $productGrid->searchAndSelect(['name' => $entity['name']]); - $this->getTemplateBlock()->waitLoader(); - $this->_rootElement->find($this->apply, Locator::SELECTOR_XPATH)->click(); - } - } - - /** - * Get product grid. - * - * @return BlockInterface - */ - protected function getProductGrid() - { - return $this->blockFactory->create( - 'Mage\Widget\Test\Block\Adminhtml\Widget\Instance\Edit\Tab\LayoutUpdatesType\Product\Grid', - [ - 'element' => $this->_rootElement->find($this->productGrid, Locator::SELECTOR_XPATH) - ] - ); - } - - /** - * Get data of tab. - * - * @param array|null $fields - * @param Element|null $element - * @return array - */ - public function getDataFormTab($fields = null, Element $element = null) - { - $dataMapping = $this->dataMapping($fields); - $data = $this->_getData($dataMapping, $element); - if (isset($dataMapping['entities'])) { - $data['entities'] = $this->getProducts($dataMapping['entities']['value']); - } - return $data; - } - - /** - * Get products. - * - * @param array $products - * @return array - */ - protected function getProducts(array $products) - { - $result = []; - /** @var Grid $productGrid */ - $productGrid = $this->getProductGrid(); - foreach ($products as $key => $product) { - $this->_rootElement->find($this->chooser, Locator::SELECTOR_XPATH)->click(); - $this->getTemplateBlock()->waitLoader(); - if ($productGrid->isSelect(['sku' => $product['sku']])) { - $result[$key]['name'] = $product['name']; - } - } - return $result; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/LayoutUpdatesType/Products.xml b/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/LayoutUpdatesType/Products.xml deleted file mode 100644 index 453abf5cc4e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/LayoutUpdatesType/Products.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - .page_group_select - optgroupselect - - - //div[@class="products group_container"]//*[@class="radio for_specific"] - xpath - checkbox - - - .chooser - - - .block_reference select - select - - - - diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/Settings.php b/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/Settings.php deleted file mode 100644 index ac8c445ced4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/Settings.php +++ /dev/null @@ -1,55 +0,0 @@ -_rootElement->find($this->continueButton)->click(); - } - - /** - * Fill data to fields on tab. - * - * @param array $fields - * @param Element|null $element - * @return $this - */ - public function fillFormTab(array $fields, Element $element = null) - { - parent::fillFormTab($fields, $element); - $this->clickContinue(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/WidgetOptions.php b/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/WidgetOptions.php deleted file mode 100644 index 60f670adb61..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/WidgetOptions.php +++ /dev/null @@ -1,74 +0,0 @@ -path . ucfirst($fields['widgetOptions']['value']['type_id']); - unset($fields['widgetOptions']['value']['type_id']); - foreach ($fields['widgetOptions']['value'] as $field) { - /** @var WidgetOptionsForm $widgetOptionsForm */ - $widgetOptionsForm = $this->getWidgetOptionsForm($path); - $widgetOptionsForm->fillForm($field); - } - return $this; - } - - /** - * Get widget options form. - * - * @param string $path - * @return BlockInterface - */ - protected function getWidgetOptionsForm($path) - { - return $this->blockFactory->create( - $path, - ['element' => $this->_rootElement->find($this->formSelector)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/WidgetOptionsType/WidgetOptionsForm.php b/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/WidgetOptionsType/WidgetOptionsForm.php deleted file mode 100644 index be87acc56c8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/WidgetOptionsType/WidgetOptionsForm.php +++ /dev/null @@ -1,150 +0,0 @@ -_rootElement : $element; - $mapping = $this->dataMapping($widgetOptionsFields); - $fields = array_diff_key($mapping, ['entities' => '']); - $this->_fill($fields, $element); - if (isset($mapping['entities'])) { - $this->selectEntities($mapping['entities']); - } - } - - /** - * Getting options data form on the widget options form. - * - * @param array $fields - * @param Element $element [optional] - * @return $this - */ - public function getDataOptions(array $fields = null, Element $element = null) - { - $element = $element === null ? $this->_rootElement : $element; - $mapping = $this->dataMapping($fields); - return $this->_getData($mapping, $element); - } - - /** - * Select entities on widget options tab. - * - * @param array $entities - * @return void - */ - protected function selectEntities(array $entities) - { - foreach ($entities['value'] as $entity) { - $this->_rootElement->find($this->selectBlock)->click(); - $this->getTemplateBlock()->waitLoader(); - $grid = $this->getGridBlock(); - $filter = $this->prepareFilter($entity); - $grid->searchAndSelect($filter); - } - } - - /** - * Get grid block. - * - * @return BlockInterface - */ - protected function getGridBlock() - { - return $this->blockFactory->create( - $this->pathToGrid, - ['element' => $this->_rootElement->find($this->gridBlock, Locator::SELECTOR_XPATH)] - ); - } - - /** - * Prepare filter for grid. - * - * @param InjectableFixture $entity - * @return array - */ - protected function prepareFilter(InjectableFixture $entity) - { - return ['title' => $entity->getTitle()]; - } - - /** - * Get template block. - * - * @return Template - */ - public function getTemplateBlock() - { - return $this->blockFactory->create( - 'Magento\Backend\Test\Block\Template', - ['element' => $this->_rootElement->find($this->template, Locator::SELECTOR_XPATH)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/WidgetForm.php b/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/WidgetForm.php deleted file mode 100644 index ab7f7e275fc..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/WidgetForm.php +++ /dev/null @@ -1,87 +0,0 @@ -getFieldsByTabs($widget); - $this->fillTabs(['settings' => $tabs['settings']]); - unset($tabs['settings']); - $this->fillStoreView($widget); - return $this->fillTabs($tabs, $element); - } - - /** - * Fill store view. - * - * @param Widget $widget - * @return void - */ - protected function fillStoreView(Widget $widget) - { - $this->openTab('frontend_properties'); - $storeViewField = $this->_rootElement->find($this->storeView, Locator::SELECTOR_CSS, 'multiselectgrouplist'); - if($storeViewField->isVisible() && !$widget->hasData('store_ids')) { - $storeViewField->setValue('All Store Views'); - } - } - - /** - * Get data of the tabs. - * - * @param FixtureInterface|null $fixture - * @param Element|null $element - * @return array - */ - public function getData(FixtureInterface $fixture = null, Element $element = null) - { - $widgetType = $fixture->getWidgetOptions()['type_id']; - if ($this->hasRender($widgetType) && $widgetType != 'bannerRotator') { - return $this->callRender($widgetType, 'getData', ['InjectableFixture' => $fixture, 'Element' => $element]); - } elseif ($widgetType == 'bannerRotator') { - $fixtureData = $fixture->getData(); - unset($fixtureData['widgetOptions'][0]['entities']); - return $fixtureData; - } else { - return parent::getData($fixture, $element); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/WidgetForm.xml b/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/WidgetForm.xml deleted file mode 100644 index 0aecc6f17a5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/WidgetForm.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - \Mage\Widget\Test\Block\Adminhtml\Widget\Instance\Edit\Tab\Settings - #widget_instace_tabs_settings_section - css selector - - - select - - - select - - - - - \Mage\Adminhtml\Test\Block\Widget\Tab - #widget_instace_tabs_main_section - css selector - - - <store_ids> - <input>multiselectgrouplist</input> - <selector>[id="store_ids"]</selector> - </store_ids> - </fields> - </frontend_properties> - <widget_options> - <class>\Mage\Widget\Test\Block\Adminhtml\Widget\Instance\Edit\Tab\WidgetOptions</class> - <selector>#widget_instace_tabs_properties_section</selector> - <strategy>css selector</strategy> - </widget_options> - <layout_updates> - <class>\Mage\Widget\Test\Block\Adminhtml\Widget\Instance\Edit\Tab\LayoutUpdates</class> - <selector>#widget_instace_tabs_main_section</selector> - <strategy>css selector</strategy> - </layout_updates> -</tabs> diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/WidgetGrid.php b/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/WidgetGrid.php deleted file mode 100644 index 80abf9e1fc1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/WidgetGrid.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Widget\Test\Block\Adminhtml\Widget; - -/** - * Widget grid on the Widget Instance Index page. - */ -class WidgetGrid extends \Mage\Adminhtml\Test\Block\Widget\Grid -{ - /** - * Locator value for link in action column. - * - * @var string - */ - protected $editLink = 'td.last'; - - /** - * Filters array mapping. - * - * @var array - */ - protected $filters = [ - 'title' => [ - 'selector' => 'input[name="title"]', - ], - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/WidgetForm.php b/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/WidgetForm.php deleted file mode 100644 index e6f584d084c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/WidgetForm.php +++ /dev/null @@ -1,97 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Widget\Test\Block\Adminhtml; - -use Magento\Mtf\Block\Form; -use Magento\Mtf\Client\Locator; -use Mage\Adminhtml\Test\Block\Template; - -/** - * Backend add widget form. - */ -class WidgetForm extends Form -{ - /** - * Widget type selector. - * - * @var string - */ - protected $widgetType = '[name="widget_type"]'; - - /** - * Insert widget button selector. - * - * @var string - */ - protected $insertButton = '#insert_button'; - - /** - * Template block. - * - * @var string - */ - protected $templateBlock = './ancestor::body'; - - /** - * Add widgets. - * - * @param array $widget - * @return void - */ - public function addWidget(array $widget) - { - $this->selectWidgetType($widget['widget_type']); - $mapping = $this->dataMapping($widget); - $this->_fill($mapping); - $this->insertWidget(); - } - - /** - * Select widget type. - * - * @param string $type - * @return void - */ - protected function selectWidgetType($type) - { - $this->_rootElement->find($this->widgetType, Locator::SELECTOR_CSS, 'select')->setValue($type); - $this->getTemplateBlock()->waitLoader(); - } - - /** - * Click Insert Widget button. - * - * @return void - */ - protected function insertWidget() - { - $this->_rootElement->find($this->insertButton)->click(); - $this->getTemplateBlock()->waitLoader(); - } - - /** - * Get template block. - * - * @return Template - */ - protected function getTemplateBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Template', - ['element' => $this->_rootElement->find($this->templateBlock, Locator::SELECTOR_XPATH)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/WidgetForm.xml b/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/WidgetForm.xml deleted file mode 100644 index d5370242737..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/WidgetForm.xml +++ /dev/null @@ -1,43 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<mapping strict="0"> - <wrapper>parameters</wrapper> - <fields> - <widget_type> - <selector>#select_widget_type</selector> - <input>select</input> - </widget_type> - <anchor_text /> - <title /> - <template> - <input>select</input> - </template> - <chosen_option> - <selector>.btn-chooser</selector> - <class>\Mage\Widget\Test\Block\Adminhtml\Widget\ChosenOption</class> - </chosen_option> - <display_type> - <input>select</input> - </display_type> - <show_pager> - <input>select</input> - </show_pager> - <products_count /> - <cache_lifetime /> - <page_size /> - </fields> -</mapping> diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/WidgetView.php b/dev/tests/functional/tests/app/Mage/Widget/Test/Block/WidgetView.php deleted file mode 100644 index 52ce160bcd1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/WidgetView.php +++ /dev/null @@ -1,126 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Widget\Test\Block; - -use Mage\Widget\Test\Fixture\Widget; -use Magento\Mtf\Block\Block; -use Magento\Mtf\Client\Locator; - -/** - * Widget block on the frontend. - */ -class WidgetView extends Block -{ - /** - * Widgets selectors. - * - * @var array - */ - protected $widgetSelectors = []; - - /** - * Check widget. - * - * @param Widget $widget - * @param string $pageName - * @return array - * @throws \Exception - */ - public function checkWidget(Widget $widget, $pageName) - { - $error = []; - $widgetType = $widget->getWidgetOptions()['type_id']; - if ($this->hasRender($widgetType)) { - return $this->callRender($widgetType, 'checkWidget', ['widget' => $widget, 'pageName' => $pageName]); - } elseif (isset($this->widgetSelectors[$widgetType])) { - $widgetOptions = $widget->getWidgetOptions(); - unset($widgetOptions['type_id']); - foreach ($widgetOptions as $widgetOption) { - $error[] = array_filter($this->checkEntities($widget, $widgetOption, $pageName, $widgetType)); - } - return array_filter($error); - } else { - throw new \Exception('Determine how to find the widget on the page.'); - } - } - - /** - * Check widget entities. - * - * @param Widget $widget - * @param array $widgetOption - * @param string $pageName - * @param string $widgetType - * @return array - */ - protected function checkEntities(Widget $widget, $widgetOption, $pageName, $widgetType) - { - $error = []; - if (isset($widgetOption['entities'])) { - foreach ($widgetOption['entities'] as $entity) { - $widgetText = $entity->getStoreContents()['store_content']; - $visibility = $this->isWidgetVisible($widget, $pageName, $widgetType, $widgetText); - if ($visibility !== null) { - $error[] = $visibility; - } - } - } else { - $error[] = $this->isWidgetVisible($widget, $pageName, $widgetType, $pageName); - } - - return $error; - } - - /** - * Check is visible widget selector. - * - * @param Widget $widget - * @param string $pageName - * @param string $widgetType - * @param string $widgetText - * @return string|null - */ - protected function isWidgetVisible(Widget $widget, $pageName, $widgetType, $widgetText) - { - $widgetSelector = sprintf($this->widgetSelectors[$widgetType], $widgetText); - return $this->_rootElement->find($widgetSelector, Locator::SELECTOR_XPATH)->isVisible() - ? null - : "Widget with title {$widget->getTitle()} is absent on {$pageName} page."; - } - - /** - * Click to widget selector. - * - * @param Widget $widget - * @param string $widgetText - * @return void - * @throws \Exception - */ - public function clickToWidget(Widget $widget, $widgetText) - { - $widgetType = $widget->getWidgetOptions()['type_id']; - if ($this->hasRender($widgetType)) { - $this->callRender($widgetType, 'clickToWidget', ['widget' => $widget, 'widgetText' => $widgetText]); - } elseif (isset($this->widgetSelectors[$widgetType])) { - $this->_rootElement->find( - sprintf($this->widgetSelectors[$widgetType], $widgetText), - Locator::SELECTOR_XPATH - )->click(); - } else { - throw new \Exception('Determine how to find the widget on the page.'); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Constraint/AssertWidgetInGrid.php b/dev/tests/functional/tests/app/Mage/Widget/Test/Constraint/AssertWidgetInGrid.php deleted file mode 100644 index 434c3db558d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Constraint/AssertWidgetInGrid.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Widget\Test\Constraint; - -use Mage\Widget\Test\Fixture\Widget; -use Mage\Widget\Test\Page\Adminhtml\WidgetInstanceIndex; -use Magento\Mtf\Constraint\AbstractConstraint; - -/** - * Assert widget availability in widget grid. - */ -class AssertWidgetInGrid extends AbstractConstraint -{ - /* tags */ - const SEVERITY = 'high'; - /* end tags */ - - /** - * Assert widget availability in widget grid. - * - * @param Widget $widget - * @param WidgetInstanceIndex $widgetInstanceIndex - * @return void - */ - public function processAssert(Widget $widget, WidgetInstanceIndex $widgetInstanceIndex) - { - $widgetInstanceIndex->open(); - $widgetTitle = $widget->getTitle(); - \PHPUnit_Framework_Assert::assertTrue( - $widgetInstanceIndex->getWidgetGrid()->isRowVisible(['title' => $widgetTitle]), - "Widget with title $widgetTitle is absent in Widget grid." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Widget is present in widget grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Constraint/AssertWidgetSuccessSaveMessage.php b/dev/tests/functional/tests/app/Mage/Widget/Test/Constraint/AssertWidgetSuccessSaveMessage.php deleted file mode 100644 index abbf4bd219a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Constraint/AssertWidgetSuccessSaveMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Widget\Test\Constraint; - -use Mage\Widget\Test\Page\Adminhtml\WidgetInstanceIndex; -use Magento\Mtf\Constraint\AbstractConstraint; - -/** - * Check that success message is displayed after widget saved. - */ -class AssertWidgetSuccessSaveMessage extends AbstractConstraint -{ - /* tags */ - const SEVERITY = 'low'; - /* end tags */ - - /** - * Text value to be checked. - */ - const SUCCESS_MESSAGE = 'The widget instance has been saved.'; - - /** - * Assert that success message is displayed after widget saved. - * - * @param WidgetInstanceIndex $widgetInstanceIndex - * @return void - */ - public function processAssert(WidgetInstanceIndex $widgetInstanceIndex) - { - \PHPUnit_Framework_Assert::assertEquals( - self::SUCCESS_MESSAGE, - $widgetInstanceIndex->getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Widget success create message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Fixture/Widget.xml b/dev/tests/functional/tests/app/Mage/Widget/Test/Fixture/Widget.xml deleted file mode 100644 index 4828a2ebe45..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Fixture/Widget.xml +++ /dev/null @@ -1,37 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="widget" module="Mage_Widget" type="flat" entity_type="widget_instance" - collection="Mage\Widget\Model\Resource\Widget\Instance\Collection" identifier="parameters" - repository_class="Mage\Widget\Test\Repository\Widget" - handler_interface="Mage\Widget\Test\Handler\Widget\WidgetInterface" - class="Mage\Widget\Test\Fixture\Widget"> - <field name="instance_id" is_required="1"/> - <field name="instance_type" is_required="0"/> - <field name="package_theme" is_required="0" group="settings"/> - <field name="title" is_required="0" group="frontend_properties"/> - <field name="store_ids" source="Mage\Widget\Test\Fixture\Widget\StoreIds"/> - <field name="parameters" is_required="0"/> - <field name="sort_order" is_required="0"/> - <field name="type" group="settings"/> - <field name="widget_instance"/> - <field name="id"/> - <field name="page_id"/> - <field name="layout" group="layout_updates" source="Mage\Widget\Test\Fixture\Widget\LayoutUpdates" repository="Mage\Widget\Test\Repository\Widget\LayoutUpdates"/> - <field name="widgetOptions" group="widget_options" source="Mage\Widget\Test\Fixture\Widget\WidgetOptions" repository="Mage\Widget\Test\Repository\Widget"/> - </fixture> -</config> diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Fixture/Widget/LayoutUpdates.php b/dev/tests/functional/tests/app/Mage/Widget/Test/Fixture/Widget/LayoutUpdates.php deleted file mode 100644 index d5f25013c0a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Fixture/Widget/LayoutUpdates.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Widget\Test\Fixture\Widget; - -use Magento\Mtf\Fixture\DataSource; -use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Mtf\Repository\RepositoryFactory; - -/** - * Prepare Layout Updates for widget. - */ -class LayoutUpdates extends DataSource -{ - /** - * @constructor - * @param RepositoryFactory $repositoryFactory - * @param FixtureFactory $fixtureFactory - * @param array $params - * @param array $data [optional] - */ - public function __construct(RepositoryFactory $repositoryFactory, FixtureFactory $fixtureFactory, array $params, array $data = []) - { - $this->params = $params; - if (isset($data['dataset']) && isset($this->params['repository'])) { - $this->data = $repositoryFactory->get($this->params['repository'])->get($data['dataset']); - foreach ($this->data as $index => $layouts) { - if (isset($layouts['entities'])) { - foreach ($layouts['entities'] as $key => $layout) { - $explodeValue = explode('::', $layout); - $fixture = $fixtureFactory->createByCode($explodeValue[0], ['dataset' => $explodeValue[1]]); - $fixture->persist(); - $this->data[$index]['entities'][$key] = $fixture->getData(); - } - } - } - } else { - $this->data = $data; - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Fixture/Widget/StoreIds.php b/dev/tests/functional/tests/app/Mage/Widget/Test/Fixture/Widget/StoreIds.php deleted file mode 100644 index 2e346a78948..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Fixture/Widget/StoreIds.php +++ /dev/null @@ -1,115 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Widget\Test\Fixture\Widget; - -use Mage\Adminhtml\Test\Fixture\Store; -use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Mtf\Fixture\FixtureInterface; - -/** - * Prepare Store. - */ -class StoreIds implements FixtureInterface -{ - /** - * Data set configuration settings. - * - * @var array - */ - protected $params = []; - - /** - * Resource data. - * - * @var array - */ - protected $data = []; - - /** - * Return stores. - * - * @var Store - */ - protected $stores = []; - - /** - * @constructor - * @param FixtureFactory $fixtureFactory - * @param array $params - * @param array $data [optional] - */ - public function __construct(FixtureFactory $fixtureFactory, array $params, array $data = []) - { - $this->params = $params; - if (isset($data['dataset'])) { - $dataset = explode(',', $data['dataset']); - foreach ($dataset as $store) { - /** @var Store $store */ - $store = $fixtureFactory->createByCode('store', ['dataset' => $store]); - if (!$store->hasData('store_id')) { - $store->persist(); - } - $this->stores[] = $store; - $this->data[] = $store->getName(); - } - } else { - $this->data[] = null; - } - } - - /** - * Persist Store. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data. - * - * @param string|null $key - * @return string - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings. - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Return stores. - * - * @return Store - */ - public function getStores() - { - return $this->stores; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Fixture/Widget/WidgetOptions.php b/dev/tests/functional/tests/app/Mage/Widget/Test/Fixture/Widget/WidgetOptions.php deleted file mode 100644 index 46d1f14a0fb..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Fixture/Widget/WidgetOptions.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Widget\Test\Fixture\Widget; - -use Magento\Mtf\Fixture\DataSource; -use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Mtf\Repository\RepositoryFactory; - -/** - * Prepare Widget options for widget. - */ -class WidgetOptions extends DataSource -{ - /** - * @constructor - * @param RepositoryFactory $repositoryFactory - * @param FixtureFactory $fixtureFactory - * @param array $params - * @param array $data [optional] - */ - public function __construct(RepositoryFactory $repositoryFactory, FixtureFactory $fixtureFactory, array $params, array $data = []) - { - $this->params = $params; - if (isset($data['dataset']) && isset($this->params['repository'])) { - $this->data = $repositoryFactory->get($this->params['repository'])->get($data['dataset']); - foreach ($this->data as $key => $value) { - $this->data['type_id'] = $data['dataset']; - if (isset($value['entities'])) { - foreach ($value['entities'] as $index => $entity) { - $explodeValue = explode('::', $entity); - $fixture = $fixtureFactory->createByCode($explodeValue[0], ['dataset' => $explodeValue[1]]); - $fixture->persist(); - $this->data[$key]['entities'][$index] = $fixture; - } - } - } - } else { - $this->data = $data; - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Handler/Widget/Curl.php b/dev/tests/functional/tests/app/Mage/Widget/Test/Handler/Widget/Curl.php deleted file mode 100644 index af008220442..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Handler/Widget/Curl.php +++ /dev/null @@ -1,219 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Widget\Test\Handler\Widget; - -use Magento\Mtf\Fixture\FixtureInterface; -use Magento\Mtf\Handler\Curl as AbstractCurl; -use Magento\Mtf\Util\Protocol\CurlInterface; -use Magento\Mtf\Util\Protocol\CurlTransport; -use Magento\Mtf\Util\Protocol\CurlTransport\BackendDecorator; - -/** - * Curl handler for creating widgetInstance/frontendApp. - */ -class Curl extends AbstractCurl -{ - /** - * Mapping values for data. - * - * @var array - */ - protected $mappingData = [ - 'package_theme' => [ - 'Magento Blank' => 2, - ], - 'type' => [ - 'CMS Page Link' => 'cms_page_link', - ], - 'block' => [ - 'Main Content Area' => 'content', - 'Sidebar Additional' => 'sidebar.additional', - 'Sidebar Main' => 'sidebar.main', - ], - 'page_group' => [ - 'All Pages' => 'all_pages', - 'Specified Page' => 'pages', - 'Page Layouts' => 'page_layouts', - 'Non-Anchor Categories' => 'notanchor_categories', - ], - 'template' => [ - 'CMS Page Link Block Template' => 'widget/link/link_block.phtml', - ], - 'layout_handle' => [ - 'Shopping Cart' => 'checkout_cart_index', - ], - ]; - - /** - * Widget Instance Template. - * - * @var string - */ - protected $widgetInstanceTemplate = ''; - - /** - * Post request for creating widget instance. - * - * @param FixtureInterface $fixture [optional] - * @throws \Exception - * @return array - */ - public function persist(FixtureInterface $fixture = null) - { - $data = $this->prepareData($fixture); - $url = $_ENV['app_backend_url'] . 'widget_instance/save/type/' - . $data['type'] . '/package/' . $this->prepareTheme($data['package_theme']); - - if (isset($data['page_id'])) { - $data['parameters']['page_id'] = $data['page_id'][0]; - unset($data['page_id']); - } - if ($fixture->hasData('store_ids')) { - $stores = $fixture->getDataFieldConfig('store_ids')['source']->getStores(); - foreach ($stores as $store) { - $data['store_ids'][] = $store->getStoreId(); - } - } - $data['parameters']['unique_id'] = isset($data['parameters']['unique_id']) ? uniqid() : ''; - unset($data['type']); - unset($data['package_theme']); - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->write($url, $data); - $response = $curl->read(); - $curl->close(); - - if (!strpos($response, 'class="success-msg"')) { - throw new \Exception("Widget instance creation by curl handler was not successful! Response: $response"); - } - $id = $this->getWidgetId($response); - - return ['id' => $id]; - } - - /** - * Return saved widget id. - * - * @param string $response - * @return int|null - * @throws \Exception - */ - protected function getWidgetId($response) - { - preg_match_all('~tr title=[^\s]*\/instance_id\/(\d+)~', $response, $matches); - if (empty($matches[1])) { - throw new \Exception('Cannot find Widget id'); - } - - return max($matches[1]); - } - - /** - * Prepare theme. - * - * @param string $theme - * @return string - */ - protected function prepareTheme($theme) - { - $data = explode('/', $theme); - - return $data[0] . '/theme/' . $data[1]; - } - - /** - * Prepare data for create widget. - * - * @param FixtureInterface $widget - * @return array - */ - protected function prepareData(FixtureInterface $widget) - { - $data = $this->replaceMappingData($widget->getData()); - - return $this->prepareWidgetInstance($data); - } - - /** - * Prepare Widget Instance data. - * - * @param array $data - * @throws \Exception - * @return array - */ - protected function prepareWidgetInstance($data) - { - foreach ($data['widget_instance'] as $key => $widgetInstance) { - $pageGroup = $widgetInstance['page_group']; - - if (!isset($widgetInstance[$pageGroup]['page_id'])) { - $widgetInstance[$pageGroup]['page_id'] = 0; - } - $method = 'prepare' . str_replace(' ', '', ucwords(str_replace('_', ' ', $pageGroup))) . 'Group'; - if (!method_exists(__CLASS__, $method)) { - throw new \Exception('Method for prepare page group "' . $method . '" is not exist.'); - } - $widgetInstance[$pageGroup] = $this->$method($widgetInstance[$pageGroup]); - $data['widget_instance'][$key] = $widgetInstance; - } - - return $data; - } - - /** - * Prepare All Page Group. - * - * @param array $widgetInstancePageGroup - * @return array - */ - protected function prepareAllPagesGroup(array $widgetInstancePageGroup) - { - $widgetInstancePageGroup['layout_handle'] = 'default'; - $widgetInstancePageGroup['for'] = 'all'; - if (!isset($widgetInstancePageGroup['template'])) { - $widgetInstancePageGroup['template'] = $this->widgetInstanceTemplate; - } - - return $widgetInstancePageGroup; - } - - /** - * Prepare Non-Anchor Categories Page Group. - * - * @param array $widgetInstancePageGroup - * @return array - */ - protected function prepareNotanchorCategoriesGroup(array $widgetInstancePageGroup) - { - $widgetInstancePageGroup['is_anchor_only'] = 0; - $widgetInstancePageGroup['for'] = 'all'; - $widgetInstancePageGroup['layout_handle'] = 'catalog_category_view_type_default'; - - return $widgetInstancePageGroup; - } - - /** - * Prepare Specified Page Group. - * - * @param array $widgetInstancePageGroup - * @return array - */ - protected function preparePagesGroup(array $widgetInstancePageGroup) - { - $widgetInstancePageGroup['for'] = 'all'; - - return $widgetInstancePageGroup; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Handler/Widget/WidgetInterface.php b/dev/tests/functional/tests/app/Mage/Widget/Test/Handler/Widget/WidgetInterface.php deleted file mode 100644 index 4268257e1e3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Handler/Widget/WidgetInterface.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Widget\Test\Handler\Widget; - -use Magento\Mtf\Handler\HandlerInterface; - -/** - * Widget Interface. - */ -interface WidgetInterface extends HandlerInterface -{ - // -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Page/Adminhtml/WidgetInstanceEdit.xml b/dev/tests/functional/tests/app/Mage/Widget/Test/Page/Adminhtml/WidgetInstanceEdit.xml deleted file mode 100644 index 94c76e7e3c6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Page/Adminhtml/WidgetInstanceEdit.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd"> - <page name="WidgetInstanceEdit" area="Adminhtml" mca="widget_instance/edit" module="Mage_Widget"> - <block name="widgetForm" class="Mage\Widget\Test\Block\Adminhtml\Widget\Instance\Edit\WidgetForm" locator="[id='page:main-container']" strategy="css selector"/> - <block name="pageActionsBlock" class="Mage\Widget\Test\Block\Adminhtml\FormPageActions" locator=".form-buttons" strategy="css selector"/> - <block name="templateBlock" class="Mage\Adminhtml\Test\Block\Template" locator="body" strategy="css selector"/> - </page> -</config> diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Page/Adminhtml/WidgetInstanceIndex.xml b/dev/tests/functional/tests/app/Mage/Widget/Test/Page/Adminhtml/WidgetInstanceIndex.xml deleted file mode 100644 index 537832ce25a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Page/Adminhtml/WidgetInstanceIndex.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd"> - <page name="WidgetInstanceIndex" area="Adminhtml" mca="widget_instance/index" module="Mage_Widget"> - <block name="pageActionsBlock" class="Mage\Adminhtml\Test\Block\GridPageActions" locator=".form-buttons" strategy="css selector"/> - <block name="widgetGrid" class="Mage\Widget\Test\Block\Adminhtml\Widget\WidgetGrid" locator="#widgetInstanceGrid" strategy="css selector"/> - <block name="messagesBlock" class="Mage\Core\Test\Block\Messages" locator="#messages" strategy="css selector"/> - </page> -</config> diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Page/Adminhtml/WidgetInstanceNew.xml b/dev/tests/functional/tests/app/Mage/Widget/Test/Page/Adminhtml/WidgetInstanceNew.xml deleted file mode 100644 index c83813d9d4f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Page/Adminhtml/WidgetInstanceNew.xml +++ /dev/null @@ -1,21 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd"> - <page name="WidgetInstanceNew" area="Adminhtml" mca="widget_instance/new" module="Mage_Widget"> - <block name="widgetForm" class="Mage\Widget\Test\Block\Adminhtml\Widget\Instance\Edit\WidgetForm" locator="[id='page:main-container']" strategy="css selector"/> - </page> -</config> diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Page/CmsIndex.xml b/dev/tests/functional/tests/app/Mage/Widget/Test/Page/CmsIndex.xml deleted file mode 100644 index 3ae327f117a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Page/CmsIndex.xml +++ /dev/null @@ -1,21 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/pages.xsd"> - <page name="CmsIndex" mca="cms/index"> - <block name="widgetView" class="Mage\Widget\Test\Block\WidgetView" locator=".widget" strategy="css selector" /> - </page> -</config> diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Repository/Widget.xml b/dev/tests/functional/tests/app/Mage/Widget/Test/Repository/Widget.xml deleted file mode 100644 index 25887876eaa..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Repository/Widget.xml +++ /dev/null @@ -1,72 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> - <repository class="Mage\Widget\Test\Repository\Widget"> - <dataset name="default"> - <field name="title" xsi:type="string">Test Frontend App</field> - <field name="store_ids" xsi:type="array"> - <item name="dataset" xsi:type="string">default</item> - </field> - <field name="widget_instance" xsi:type="array"> - <item name="0" xsi:type="array"> - <item name="page_group" xsi:type="string">all_pages</item> - <item name="all_pages" xsi:type="array"> - <item name="layout_handle" xsi:type="string">default</item> - <item name="for" xsi:type="string">all</item> - <item name="block" xsi:type="string">content</item> - <item name="template" xsi:type="string">widget/block.phtml</item> - </item> - </item> - </field> - <field name="parameters" xsi:type="array"> - <item name="display_mode" xsi:type="string">catalogrule</item> - </field> - <field name="theme_id" xsi:type="string">2</field> - </dataset> - - <dataset name="cms_page_link"> - <field name="code" xsi:type="string">CMS Page Link</field> - <field name="title" xsi:type="string">Cms Page Link %isolation%</field> - <field name="store_ids" xsi:type="array"> - <item name="dataset" xsi:type="string">default</item> - </field> - <field name="widget_instance" xsi:type="array"> - <item name="0" xsi:type="array"> - <item name="page_group" xsi:type="string">All Pages</item> - <item name="all_pages" xsi:type="array"> - <item name="block" xsi:type="string">Main Content Area</item> - <item name="template" xsi:type="string">CMS Page Link Block Template</item> - </item> - </item> - </field> - <field name="parameters" xsi:type="array"> - <item name="display_mode" xsi:type="string">fixed</item> - <item name="anchor_text" xsi:type="string">text</item> - <item name="title" xsi:type="string">anchor title</item> - </field> - <field name="page_id" xsi:type="array"> - <item name="dataset" xsi:type="string">default</item> - </field> - <field name="theme_id" xsi:type="string">Magento Blank</field> - <field name="widgetOptions" xsi:type="array"> - <item name="0" xsi:type="array"> - <item name="type_id" xsi:type="string">cmsPageLink</item> - </item> - </field> - </dataset> - </repository> -</config> diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Repository/Widget/LayoutUpdates.xml b/dev/tests/functional/tests/app/Mage/Widget/Test/Repository/Widget/LayoutUpdates.xml deleted file mode 100644 index 1131979d37b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Repository/Widget/LayoutUpdates.xml +++ /dev/null @@ -1,27 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> - <repository class="Mage\Widget\Test\Repository\Widget\LayoutUpdates"> - <dataset name="all_pages"> - <field name="0" xsi:type="array"> - <item name="page_group" xsi:type="string">Generic Pages/All Pages</item> - <item name="block" xsi:type="string">Main Content Area</item> - </field> - </dataset> - </repository> -</config> \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/TestCase/AbstractCreateWidgetEntityTest.php b/dev/tests/functional/tests/app/Mage/Widget/Test/TestCase/AbstractCreateWidgetEntityTest.php deleted file mode 100644 index a17bcf04d52..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/TestCase/AbstractCreateWidgetEntityTest.php +++ /dev/null @@ -1,77 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Widget\Test\TestCase; - -use Mage\Widget\Test\Fixture\Widget; -use Mage\Widget\Test\Page\Adminhtml\WidgetInstanceEdit; -use Mage\Widget\Test\Page\Adminhtml\WidgetInstanceIndex; -use Mage\Widget\Test\Page\Adminhtml\WidgetInstanceNew; -use Magento\Mtf\TestCase\Injectable; - -/** - * Test Creation for New Instance of WidgetEntity. - */ -abstract class AbstractCreateWidgetEntityTest extends Injectable -{ - /** - * WidgetInstanceIndex page. - * - * @var WidgetInstanceIndex - */ - protected $widgetInstanceIndex; - - /** - * WidgetInstanceNew page. - * - * @var WidgetInstanceNew - */ - protected $widgetInstanceNew; - - /** - * WidgetInstanceEdit page. - * - * @var WidgetInstanceEdit - */ - protected $widgetInstanceEdit; - - /** - * Injection data. - * - * @param WidgetInstanceIndex $widgetInstanceIndex - * @param WidgetInstanceNew $widgetInstanceNew - * @param WidgetInstanceEdit $widgetInstanceEdit - * @return void - */ - public function __inject( - WidgetInstanceIndex $widgetInstanceIndex, - WidgetInstanceNew $widgetInstanceNew, - WidgetInstanceEdit $widgetInstanceEdit - ) { - $this->widgetInstanceIndex = $widgetInstanceIndex; - $this->widgetInstanceNew = $widgetInstanceNew; - $this->widgetInstanceEdit = $widgetInstanceEdit; - } - - /** - * Delete all widgets. - * - * @return void - */ - public function tearDown() - { - $this->objectManager->create('Mage\Widget\Test\TestStep\DeleteAllWidgetsStep')->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/TestStep/DeleteAllWidgetsStep.php b/dev/tests/functional/tests/app/Mage/Widget/Test/TestStep/DeleteAllWidgetsStep.php deleted file mode 100644 index 3ad9d636f6b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/TestStep/DeleteAllWidgetsStep.php +++ /dev/null @@ -1,67 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Widget\Test\TestStep; - -use Mage\Widget\Test\Page\Adminhtml\WidgetInstanceEdit; -use Mage\Widget\Test\Page\Adminhtml\WidgetInstanceIndex; -use Magento\Mtf\TestStep\TestStepInterface; - -/** - * Delete all widgets on backend. - */ -class DeleteAllWidgetsStep implements TestStepInterface -{ - /** - * WidgetInstanceIndex page. - * - * @var WidgetInstanceIndex - */ - protected $widgetInstanceIndex; - - /** - * WidgetInstanceEdit page. - * - * @var WidgetInstanceEdit - */ - protected $widgetInstanceEdit; - - /** - * @constructor - * @param WidgetInstanceIndex $widgetInstanceIndex - * @param WidgetInstanceEdit $widgetInstanceEdit - */ - public function __construct(WidgetInstanceIndex $widgetInstanceIndex, WidgetInstanceEdit $widgetInstanceEdit) - { - $this->widgetInstanceIndex = $widgetInstanceIndex; - $this->widgetInstanceEdit = $widgetInstanceEdit; - } - - /** - * Delete Widget on backend. - * - * @return void - */ - public function run() - { - $this->widgetInstanceIndex->open(); - $this->widgetInstanceIndex->getWidgetGrid()->resetFilter(); - while ($this->widgetInstanceIndex->getWidgetGrid()->isFirstRowVisible()) { - $this->widgetInstanceIndex->getWidgetGrid()->openFirstRow(); - $this->widgetInstanceEdit->getTemplateBlock()->waitLoader(); - $this->widgetInstanceEdit->getPageActionsBlock()->delete(); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Mage/Widget/Test/etc/curl/di.xml deleted file mode 100644 index 2c6d48f3ec7..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/etc/curl/di.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/Magento/Mtf/ObjectManager/etc/config.xsd"> - <preference for="Mage\Widget\Test\Handler\Widget\WidgetInterface" type="\Mage\Widget\Test\Handler\Widget\Curl" /> -</config> diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Mage/Widget/Test/etc/fixture.xml deleted file mode 100644 index 39e73328e36..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/etc/fixture.xml +++ /dev/null @@ -1,60 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<fixture> - <widget module="Mage_Widget"> - <type>flat</type> - <entity_type>widget_instance</entity_type> - <collection>Mage\Widget\Model\Resource\Widget\Instance\Collection</collection> - <identifier>parameters</identifier> - <fields> - <type> - <attribute_code>type</attribute_code> - <backend_type>virtual</backend_type> - <group>settings</group> - </type> - <store_ids> - <attribute_code>store_ids</attribute_code> - <backend_type>virtual</backend_type> - <source>Mage\Widget\Test\Fixture\Widget\StoreIds</source> - </store_ids> - <widget_instance> - <attribute_code>widget_instance</attribute_code> - <backend_type>virtual</backend_type> - </widget_instance> - <id> - <attribute_code>id</attribute_code> - <backend_type>virtual</backend_type> - </id> - <page_id> - <attribute_code>page_id</attribute_code> - <backend_type>virtual</backend_type> - </page_id> - <layout> - <attribute_code>layout</attribute_code> - <backend_type>virtual</backend_type> - <group>layout_updates</group> - <source>Mage\Widget\Test\Fixture\Widget\LayoutUpdates</source> - </layout> - <widgetOptions> - <attribute_code>widgetOptions</attribute_code> - <backend_type>virtual</backend_type> - <group>widget_options</group> - <source>Mage\Widget\Test\Fixture\Widget\WidgetOptions</source> - </widgetOptions> - </fields> - </widget> -</fixture> diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Block/Customer/Wishlist.php b/dev/tests/functional/tests/app/Mage/Wishlist/Test/Block/Customer/Wishlist.php deleted file mode 100644 index d5a24b8d3a2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Block/Customer/Wishlist.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Wishlist\Test\Block\Customer; - -use Magento\Mtf\Block\Block; - -/** - * Wish list details block in "My Wish List" page. - */ -class Wishlist extends Block -{ - /** - * Button 'Update Wish List' css selector. - * - * @var string - */ - protected $updateButton = '.buttons-set2 .btn-update'; - - /** - * Empty block css selector. - * - * @var string - */ - protected $empty = '.wishlist-empty'; - - /** - * Click button 'Update Wish List'. - * - * @return void - */ - public function clickUpdateWishlist() - { - $this->_rootElement->find($this->updateButton)->click(); - } - - /** - * Check empty block visible. - * - * @return bool - */ - public function isEmptyBlockVisible() - { - return $this->_rootElement->find($this->empty)->isVisible(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Block/Customer/Wishlist/Items.php b/dev/tests/functional/tests/app/Mage/Wishlist/Test/Block/Customer/Wishlist/Items.php deleted file mode 100644 index 236f1909e60..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Block/Customer/Wishlist/Items.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Wishlist\Test\Block\Customer\Wishlist; - -use Mage\Wishlist\Test\Block\Customer\Wishlist\Items\Product; -use Magento\Mtf\Block\Block; -use Magento\Mtf\Client\Locator; -use Magento\Mtf\Fixture\InjectableFixture; - -/** - * Customer wishlist items block on frontend. - */ -class Items extends Block -{ - /** - * Item product block. - * - * @var string - */ - protected $itemProductBlock = '//tbody//tr[.//h3[@class="product-name" and *[text()="%s"]]]'; - - /** - * Get item product block. - * - * @param InjectableFixture $product - * @return Product - */ - public function getItemProductBlock(InjectableFixture $product) - { - $selector = sprintf($this->itemProductBlock, $product->getName()); - return $this->blockFactory->create( - 'Mage\Wishlist\Test\Block\Customer\Wishlist\Items\Product', - ['element' => $this->_rootElement->find($selector, Locator::SELECTOR_XPATH)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Block/Customer/Wishlist/Items/Product.php b/dev/tests/functional/tests/app/Mage/Wishlist/Test/Block/Customer/Wishlist/Items/Product.php deleted file mode 100644 index 761a69fb2bc..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Block/Customer/Wishlist/Items/Product.php +++ /dev/null @@ -1,119 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Wishlist\Test\Block\Customer\Wishlist\Items; - -use Magento\Mtf\Block\Form; - -/** - * Wishlist item product form. - */ -class Product extends Form -{ - /** - * Selector for 'View Details' element. - * - * @var string - */ - protected $viewDetails = '.details'; - - /** - * Selector for option's label. - * - * @var string - */ - protected $optionLabel = 'dl dt'; - - /** - * Selector for option's value. - * - * @var string - */ - protected $optionValue = 'dl dd'; - - /** - * Selector for 'Add to Cart' button. - * - * @var string - */ - protected $addToCart = '.btn-cart'; - - /** - * Edit button css selector. - * - * @var string - */ - protected $edit = '.link-edit'; - - /** - * Get product options. - * - * @return array|null - */ - public function getOptions() - { - $viewDetails = $this->_rootElement->find($this->viewDetails); - if ($viewDetails->isVisible()) { - $viewDetails->click(); - $labels = $this->_rootElement->getElements($this->optionLabel); - $values = $this->_rootElement->getElements($this->optionValue); - $data = []; - foreach ($labels as $key => $label) { - if (!$label->isVisible()) { - $viewDetails->click(); - } - $data[] = [ - 'title' => $label->getText(), - 'value' => str_replace('$', '', $values[$key]->getText()), - ]; - } - return $data; - } else { - return null; - } - } - - /** - * Fill item product details. - * - * @param array $fields - * @return void - */ - public function fillProduct(array $fields) - { - $mapping = $this->dataMapping($fields); - $this->_fill($mapping); - } - - /** - * Click button 'Add To Cart' - * - * @return void - */ - public function clickAddToCart() - { - $this->_rootElement->find($this->addToCart)->click(); - } - - /** - * Click edit button. - * - * @return void - */ - public function clickEdit() - { - $this->_rootElement->find($this->edit)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Block/Customer/Wishlist/Items/Product.xml b/dev/tests/functional/tests/app/Mage/Wishlist/Test/Block/Customer/Wishlist/Items/Product.xml deleted file mode 100644 index 7007a51531c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Block/Customer/Wishlist/Items/Product.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<mapping strict="0"> - <fields> - <qty> - <selector>[name^="qty["]</selector> - </qty> - </fields> -</mapping> diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertAddProductToWishlistSuccessMessage.php b/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertAddProductToWishlistSuccessMessage.php deleted file mode 100644 index ba0ee718857..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertAddProductToWishlistSuccessMessage.php +++ /dev/null @@ -1,60 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Wishlist\Test\Constraint; - -use Mage\Wishlist\Test\Page\WishlistIndex; -use Magento\Mtf\Constraint\AbstractConstraint; -use Magento\Mtf\Fixture\InjectableFixture; - -/** - * Assert that success message appears on My Wish List page after adding product to wishlist. - */ -class AssertAddProductToWishlistSuccessMessage extends AbstractConstraint -{ - /* tags */ - const SEVERITY = 'low'; - /* end tags */ - - /** - * Success add message. - */ - const SUCCESS_MESSAGE = "%s has been added to your wishlist. Click here to continue shopping."; - - /** - * Assert that success message appears on My Wish List page after adding product to wishlist. - * - * @param WishlistIndex $wishlistIndex - * @param InjectableFixture $product - * @return void - */ - public function processAssert(WishlistIndex $wishlistIndex, InjectableFixture $product) - { - \PHPUnit_Framework_Assert::assertEquals( - sprintf(self::SUCCESS_MESSAGE, $product->getName()), - $wishlistIndex->getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Success message appears on My Wish List page after adding product to wishlist.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertAddProductsToWishlistSuccessMessage.php b/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertAddProductsToWishlistSuccessMessage.php deleted file mode 100644 index 69e0c81c32c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertAddProductsToWishlistSuccessMessage.php +++ /dev/null @@ -1,63 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Wishlist\Test\Constraint; - -use Mage\Wishlist\Test\Page\WishlistIndex; -use Magento\Mtf\Constraint\AbstractConstraint; -use Magento\Mtf\Fixture\InjectableFixture; - -/** - * Assert that success message appears on My Wish List page after adding products to wishlist. - */ -class AssertAddProductsToWishlistSuccessMessage extends AbstractConstraint -{ - /* tags */ - const SEVERITY = 'low'; - /* end tags */ - - /** - * Success add message. - */ - const SUCCESS_MESSAGE = "%s has been added to your wishlist. Click here to continue shopping."; - - /** - * Assert that success message appears on My Wish List page after adding products to wishlist. - * - * @param WishlistIndex $wishlistIndex - * @param AssertAddProductToWishlistSuccessMessage $addProductToWishlistSuccessMessage - * @param InjectableFixture[] $products - * @return void - */ - public function processAssert( - WishlistIndex $wishlistIndex, - AssertAddProductToWishlistSuccessMessage $addProductToWishlistSuccessMessage, - array $products - ) { - foreach ($products as $product) { - $addProductToWishlistSuccessMessage->processAssert($wishlistIndex, $product); - } - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Success message appears on My Wish List page after adding products to wishlist.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertMoveProductToWishlistSuccessMessage.php b/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertMoveProductToWishlistSuccessMessage.php deleted file mode 100644 index 5200194750c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertMoveProductToWishlistSuccessMessage.php +++ /dev/null @@ -1,61 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Wishlist\Test\Constraint; - -use Mage\Wishlist\Test\Page\WishlistIndex; -use Magento\Mtf\Constraint\AbstractConstraint; -use Magento\Mtf\Fixture\InjectableFixture; - -/** - * Assert that success message appears on Checkout Cart page after moving product to wishlist. - */ -class AssertMoveProductToWishlistSuccessMessage extends AbstractConstraint -{ - /* tags */ - const SEVERITY = 'low'; - /* end tags */ - - /** - * Success add message. - */ - const SUCCESS_MESSAGE = "%s has been moved to wishlist Wishlist"; - - /** - * Assert that success message appears on My Wish List page after moving product to wishlist. - * - * @param WishlistIndex $wishlistIndex - * @param InjectableFixture $product - * @return void - */ - public function processAssert(WishlistIndex $wishlistIndex, InjectableFixture $product) - { - \PHPUnit_Framework_Assert::assertEquals( - sprintf(self::SUCCESS_MESSAGE, $product->getName()), - $wishlistIndex->getMessagesBlock()->getSuccessMessages(), - "Expected success move to wish list message doesn't match actual." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Success message appears on Checkout Cart page after moving product to wishlist.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertProductDetailsInWishlist.php b/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertProductDetailsInWishlist.php deleted file mode 100644 index 4b8dde1f30d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertProductDetailsInWishlist.php +++ /dev/null @@ -1,87 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Wishlist\Test\Constraint; - -use Mage\Checkout\Test\Fixture\Cart; -use Mage\Cms\Test\Page\CmsIndex; -use Mage\Wishlist\Test\Page\WishlistIndex; -use Magento\Mtf\Constraint\AbstractAssertForm; -use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Mtf\Fixture\InjectableFixture; - -/** - * Assert that the correct option details are displayed on the "View Details" tool tip. - */ -class AssertProductDetailsInWishlist extends AbstractAssertForm -{ - /* tags */ - const SEVERITY = 'low'; - /* end tags */ - - /** - * Assert that the correct option details are displayed on the "View Details" tool tip. - * - * @param CmsIndex $cmsIndex - * @param WishlistIndex $wishlistIndex - * @param InjectableFixture $product - * @param FixtureFactory $fixtureFactory - * @return void - */ - public function processAssert( - CmsIndex $cmsIndex, - WishlistIndex $wishlistIndex, - InjectableFixture $product, - FixtureFactory $fixtureFactory - ) { - $cmsIndex->getTopLinksBlock()->openAccount(); - $cmsIndex->getLinksBlock()->openLink("My Wishlist"); - $actualOptions = $wishlistIndex->getItemsBlock()->getItemProductBlock($product)->getOptions(); - $cartFixture = $fixtureFactory->createByCode('cart', ['data' => ['items' => ['products' => [$product]]]]); - $expectedOptions = $this->prepareOptions($cartFixture); - - $errors = $this->verifyData($expectedOptions, $this->sortDataByPath($actualOptions, '::title')); - \PHPUnit_Framework_Assert::assertEmpty($errors, $errors); - } - - /** - * Prepare options. - * - * @param Cart $cart - * @return array - */ - protected function prepareOptions(Cart $cart) - { - $data = []; - $options = $cart->getItems()[0]->getData()['options']; - foreach ($options as $key => $option) { - foreach ($option as $index => $value){ - $data[$key][$index] = strtoupper($value); - } - } - - return $this->sortDataByPath($data, '::title'); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return "Expected product options are equal to actual."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertProductIsPresentInCustomerBackendWishlist.php b/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertProductIsPresentInCustomerBackendWishlist.php deleted file mode 100644 index 8c5e6b4a601..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertProductIsPresentInCustomerBackendWishlist.php +++ /dev/null @@ -1,71 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Wishlist\Test\Constraint; - -use Mage\Customer\Test\Fixture\Customer; -use Mage\Customer\Test\Page\Adminhtml\CustomerIndex; -use Mage\Customer\Test\Page\Adminhtml\CustomerEdit; -use Magento\Mtf\Constraint\AbstractConstraint; -use Magento\Mtf\Fixture\InjectableFixture; -use Mage\Adminhtml\Test\Block\Wishlist\Customer\Edit\Tab\Wishlist\Grid; - -/** - * Assert that product added to wishlist is present on Customers account on backend - * - in section Customer Activities - Wishlist. - */ -class AssertProductIsPresentInCustomerBackendWishlist extends AbstractConstraint -{ - /* tags */ - const SEVERITY = 'low'; - /* end tags */ - - /** - * Assert that products added to wishlist are present on Customers account on backend. - * - * @param CustomerIndex $customerIndex - * @param Customer $customer - * @param CustomerEdit $customerEdit - * @param InjectableFixture $product - * @return void - */ - public function processAssert( - CustomerIndex $customerIndex, - Customer $customer, - CustomerEdit $customerEdit, - InjectableFixture $product - ) { - $customerIndex->open(); - $customerIndex->getCustomerGridBlock()->searchAndOpen(['email' => $customer->getEmail()]); - $customerEdit->getCustomerForm()->openTab('wishlist'); - /** @var Grid $wishlistGrid */ - $wishlistGrid = $customerEdit->getCustomerForm()->getTabElement('wishlist')->getSearchGridBlock(); - - \PHPUnit_Framework_Assert::assertTrue( - $wishlistGrid->isRowVisible(['product_name' => $product->getName()], true, false), - $product->getName() . " is not visible in customer wishlist on backend." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return "Product is visible in customer wishlist on backend."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertProductIsPresentInWishlist.php b/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertProductIsPresentInWishlist.php deleted file mode 100644 index 01b9db40924..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertProductIsPresentInWishlist.php +++ /dev/null @@ -1,60 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Wishlist\Test\Constraint; - -use Mage\Cms\Test\Page\CmsIndex; -use Mage\Wishlist\Test\Page\WishlistIndex; -use Magento\Mtf\Constraint\AbstractConstraint; -use Magento\Mtf\Fixture\InjectableFixture; - -/** - * Assert that product is present in default wishlist. - */ -class AssertProductIsPresentInWishlist extends AbstractConstraint -{ - /* tags */ - const SEVERITY = 'low'; - /* end tags */ - - /** - * Assert that product is present in default wishlist. - * - * @param CmsIndex $cmsIndex - * @param WishlistIndex $wishlistIndex - * @param InjectableFixture $product - * @return void - */ - public function processAssert(CmsIndex $cmsIndex, WishlistIndex $wishlistIndex, InjectableFixture $product) - { - $cmsIndex->getTopLinksBlock()->openAccount(); - $cmsIndex->getLinksBlock()->openLink("My Wishlist"); - - \PHPUnit_Framework_Assert::assertTrue( - $wishlistIndex->getItemsBlock()->getItemProductBlock($product)->isVisible(), - $product->getName() . ' is not visible on wishlist page.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product is present in default wishlist.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertProductsArePresentInCustomerBackendWishlist.php b/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertProductsArePresentInCustomerBackendWishlist.php deleted file mode 100644 index 539da869343..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertProductsArePresentInCustomerBackendWishlist.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Wishlist\Test\Constraint; - -use Mage\Customer\Test\Fixture\Customer; -use Mage\Customer\Test\Page\Adminhtml\CustomerIndex; -use Mage\Customer\Test\Page\Adminhtml\CustomerEdit; -use Magento\Mtf\Constraint\AbstractConstraint; -use Magento\Mtf\Fixture\InjectableFixture; - -/** - * Assert that products added to wishlist are present on Customers account on backend - * - in section Customer Activities - Wishlist. - */ -class AssertProductsArePresentInCustomerBackendWishlist extends AbstractConstraint -{ - /* tags */ - const SEVERITY = 'low'; - /* end tags */ - - /** - * Assert that products added to wishlist are present on Customers account on backend. - * - * @param CustomerIndex $customerIndex - * @param Customer $customer - * @param CustomerEdit $customerEdit - * @param AssertProductIsPresentInCustomerBackendWishlist $assertProductIsPresentInBackendWishlist - * @param array $products - * @return void - */ - public function processAssert( - CustomerIndex $customerIndex, - Customer $customer, - CustomerEdit $customerEdit, - AssertProductIsPresentInCustomerBackendWishlist $assertProductIsPresentInBackendWishlist, - array $products - ) { - foreach ($products as $product) { - $assertProductIsPresentInBackendWishlist->processAssert($customerIndex, $customer, $customerEdit, $product); - } - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return "Products are visible in customer wishlist on backend."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertProductsIsAbsentInWishlist.php b/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertProductsIsAbsentInWishlist.php deleted file mode 100644 index 32bba6981a2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertProductsIsAbsentInWishlist.php +++ /dev/null @@ -1,71 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Wishlist\Test\Constraint; - -use Mage\Cms\Test\Page\CmsIndex; -use Mage\Customer\Test\Fixture\Customer; -use Mage\Wishlist\Test\Page\WishlistIndex; -use Magento\Mtf\Constraint\AbstractConstraint; -use Magento\Mtf\Fixture\InjectableFixture; -use Mage\Customer\Test\Constraint\FrontendActionsForCustomer; - -/** - * Assert products is absent in Wishlist on frontend. - */ -class AssertProductsIsAbsentInWishlist extends AbstractConstraint -{ - /* tags */ - const SEVERITY = 'low'; - /* end tags */ - - /** - * Assert that product is not present in Wishlist on frontend. - * - * @param WishlistIndex $wishlistIndex - * @param CmsIndex $cmsIndex - * @param Customer $customer - * @param FrontendActionsForCustomer $frontendActionsForCustomer - * @param InjectableFixture[] $products - * @return void - */ - public function processAssert( - WishlistIndex $wishlistIndex, - CmsIndex $cmsIndex, - Customer $customer, - FrontendActionsForCustomer $frontendActionsForCustomer, - array $products - ) { - $frontendActionsForCustomer->loginCustomer($customer); - $cmsIndex->getTopLinksBlock()->openAccountLink("My Wishlist"); - $itemBlock = $wishlistIndex->getItemsBlock(); - foreach ($products as $itemProduct) { - \PHPUnit_Framework_Assert::assertFalse( - $itemBlock->getItemProductBlock($itemProduct)->isVisible(), - "Product '{$itemProduct->getName()}' is present in Wishlist on frontend." - ); - } - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product is absent in Wishlist on frontend.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertWishlistIsEmpty.php b/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertWishlistIsEmpty.php deleted file mode 100644 index defcfae97af..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertWishlistIsEmpty.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Wishlist\Test\Constraint; - -use Mage\Cms\Test\Page\CmsIndex; -use Mage\Wishlist\Test\Page\WishlistIndex; -use Magento\Mtf\Constraint\AbstractConstraint; - -/** - * Assert wish list is empty on 'My Account' page. - */ -class AssertWishlistIsEmpty extends AbstractConstraint -{ - /* tags */ - const SEVERITY = 'low'; - /* end tags */ - - /** - * Assert wish list is empty. - * - * @param CmsIndex $cmsIndex - * @param WishlistIndex $wishlistIndex - * @return void - */ - public function processAssert(CmsIndex $cmsIndex, WishlistIndex $wishlistIndex) - { - $cmsIndex->getTopLinksBlock()->openAccountLink("My Wishlist"); - \PHPUnit_Framework_Assert::assertTrue( - $wishlistIndex->getWishlistBlock()->isEmptyBlockVisible(), - 'Wish list is not empty.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Wish list is empty.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Page/WishlistIndex.xml b/dev/tests/functional/tests/app/Mage/Wishlist/Test/Page/WishlistIndex.xml deleted file mode 100644 index 46889c82611..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Page/WishlistIndex.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/pages.xsd"> - <page name="WishlistIndex" mca="wishlist/index/index" module="Mage_Wishlist"> - <block name="messagesBlock" class="Mage\Core\Test\Block\Messages" locator=".messages" strategy="css selector"/> - <block name="wishlistBlock" class="Mage\Wishlist\Test\Block\Customer\Wishlist" locator="#wishlist-view-form" strategy="css selector"/> - <block name="itemsBlock" class="Mage\Wishlist\Test\Block\Customer\Wishlist\Items" locator="#wishlist-table" strategy="css selector"/> - </page> -</config> diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/AbstractWishlistTest.php b/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/AbstractWishlistTest.php deleted file mode 100644 index 2ec36eb2ca9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/AbstractWishlistTest.php +++ /dev/null @@ -1,139 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Wishlist\Test\TestCase; - -use Mage\Catalog\Test\Page\Product\CatalogProductView; -use Mage\Cms\Test\Page\CmsIndex; -use Mage\Customer\Test\Fixture\Customer; -use Mage\Wishlist\Test\Page\WishlistIndex; -use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Mtf\ObjectManager; -use Magento\Mtf\TestCase\Injectable; -use Magento\Mtf\Fixture\InjectableFixture; - -/** - * Abstract class for wish list tests. - */ -abstract class AbstractWishlistTest extends Injectable -{ - /** - * Object Manager. - * - * @var ObjectManager - */ - protected $objectManager; - - /** - * Cms index page. - * - * @var CmsIndex - */ - protected $cmsIndex; - - /** - * Product view page. - * - * @var CatalogProductView - */ - protected $catalogProductView; - - /** - * Fixture factory. - * - * @var FixtureFactory - */ - protected $fixtureFactory; - - /** - * Wishlist index page. - * - * @var WishlistIndex - */ - protected $wishlistIndex; - - /** - * Injection data. - * - * @param CmsIndex $cmsIndex - * @param CatalogProductView $catalogProductView - * @param FixtureFactory $fixtureFactory - * @param WishlistIndex $wishlistIndex - * @param ObjectManager $objectManager - * @param Customer $customer - * @return array - */ - public function __inject( - CmsIndex $cmsIndex, - CatalogProductView $catalogProductView, - FixtureFactory $fixtureFactory, - WishlistIndex $wishlistIndex, - ObjectManager $objectManager, - Customer $customer - ) { - $this->cmsIndex = $cmsIndex; - $this->catalogProductView = $catalogProductView; - $this->fixtureFactory = $fixtureFactory; - $this->wishlistIndex = $wishlistIndex; - $this->objectManager = $objectManager; - $customer->persist(); - - return ['customer' => $customer]; - } - - /** - * Login customer. - * - * @param Customer $customer - * @return void - */ - protected function loginCustomer(Customer $customer) - { - $this->objectManager->create( - 'Mage\Customer\Test\TestStep\LoginCustomerOnFrontendStep', - ['customer' => $customer] - )->run(); - } - - /** - * Create products. - * - * @param string $products - * @return array - */ - protected function createProducts($products) - { - return $this->objectManager->create( - 'Mage\Catalog\Test\TestStep\CreateProductsStep', - ['products' => $products] - )->run()['products']; - } - - /** - * Add products to wish list. - * - * @param InjectableFixture|InjectableFixture[] $products - * @param bool $configure [optional] - * @return void - */ - protected function addToWishlist($products, $configure = false) - { - $products = is_array($products) ? $products : [$products]; - $this->objectManager->create( - 'Mage\Wishlist\Test\TestStep\AddProductsToWishlistStep', - ['products' => $products, 'configure' => $configure] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/AddProductToWishlistEntityTest.php b/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/AddProductToWishlistEntityTest.php deleted file mode 100644 index 8dfbde432fa..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/AddProductToWishlistEntityTest.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Wishlist\Test\TestCase; - -use Mage\Customer\Test\Fixture\Customer; - -/** - * Preconditions: - * 1. Customer is registered. - * 2. Product is created. - * - * Steps: - * 1. Login as a customer. - * 2. Navigate to catalog page. - * 3. Add created product to Wishlist according to dataset. - * 4. Perform all assertions. - * - * @group Wishlist_(CS) - * @ZephyrId MPERF-6997 - */ -class AddProductToWishlistEntityTest extends AbstractWishlistTest -{ - /** - * Run Add Product To Wishlist test. - * - * @param Customer $customer - * @param string $product - * @param bool $configure - * @return array - */ - public function test(Customer $customer, $product, $configure) - { - $product = $this->createProducts($product)[0]; - - // Steps: - $this->loginCustomer($customer); - $this->addToWishlist([$product], $configure); - - return ['product' => $product]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/AddProductToWishlistEntityTest.xml b/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/AddProductToWishlistEntityTest.xml deleted file mode 100644 index c2a8521ab5c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/AddProductToWishlistEntityTest.xml +++ /dev/null @@ -1,52 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Mage\Wishlist\Test\TestCase\AddProductToWishlistEntityTest" summary="AddProductToWishlistEntityTest"> - <variation name="AddProductToWishlistEntityTestVariation1" method="test"> - <data name="descriptions" xsi:type="string">Add Simple product to Wishlist</data> - <data name="product" xsi:type="string">catalogProductSimple::default</data> - <data name="configure" xsi:type="string">false</data> - <constraint name="Mage\Wishlist\Test\Constraint\AssertAddProductToWishlistSuccessMessage" /> - <constraint name="Mage\Wishlist\Test\Constraint\AssertProductIsPresentInWishlist" /> - <constraint name="Mage\Wishlist\Test\Constraint\AssertProductIsPresentInCustomerBackendWishlist" /> - </variation> - <variation name="AddProductToWishlistEntityTestVariation2" method="test"> - <data name="descriptions" xsi:type="string">Add Virtual product to Wishlist</data> - <data name="product" xsi:type="string">catalogProductVirtual::order_default</data> - <data name="configure" xsi:type="string">false</data> - <constraint name="Mage\Wishlist\Test\Constraint\AssertAddProductToWishlistSuccessMessage" /> - <constraint name="Mage\Wishlist\Test\Constraint\AssertProductIsPresentInWishlist" /> - <constraint name="Mage\Wishlist\Test\Constraint\AssertProductIsPresentInCustomerBackendWishlist" /> - </variation> - <variation name="AddProductToWishlistEntityTestVariation4" method="test"> - <data name="descriptions" xsi:type="string">Add Configurable product to Wishlist</data> - <data name="product" xsi:type="string">configurableProduct::default</data> - <data name="configure" xsi:type="string">false</data> - <constraint name="Mage\Wishlist\Test\Constraint\AssertAddProductToWishlistSuccessMessage" /> - <constraint name="Mage\Wishlist\Test\Constraint\AssertProductIsPresentInWishlist" /> - <constraint name="Mage\Wishlist\Test\Constraint\AssertProductIsPresentInCustomerBackendWishlist" /> - </variation> - <variation name="AddProductToWishlistEntityTestVariation5" method="test"> - <data name="descriptions" xsi:type="string">Add Grouped product to Wishlist</data> - <data name="product" xsi:type="string">groupedProduct::three_simple_products</data> - <data name="configure" xsi:type="string">false</data> - <constraint name="Mage\Wishlist\Test\Constraint\AssertAddProductToWishlistSuccessMessage" /> - <constraint name="Mage\Wishlist\Test\Constraint\AssertProductIsPresentInWishlist" /> - <constraint name="Mage\Wishlist\Test\Constraint\AssertProductIsPresentInCustomerBackendWishlist" /> - </variation> - </testCase> -</config> diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.php b/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.php deleted file mode 100644 index 3517fa85358..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.php +++ /dev/null @@ -1,98 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Wishlist\Test\TestCase; - -use Mage\Checkout\Test\Fixture\Cart; -use Mage\Customer\Test\Fixture\Customer; - -/** - * Preconditions: - * 1. Create customer and login to frontend. - * 2. Create products. - * 3. Add products to customer's wishlist. - * - * Steps: - * 1. Navigate to My Account -> My Wishlist. - * 2. Fill qty and update wish list. - * 3. Click "Add to Cart". - * 4. Perform asserts. - * - * @group Wishlist_(CS) - * @ZephyrId MPERF-7293 - */ -class AddProductsToCartFromCustomerWishlistOnFrontendTest extends AbstractWishlistTest -{ - /** - * Run add products to cart from customer wishlist on frontend test. - * - * @param Customer $customer - * @param string $products - * @param int|null $qty - * @return array - */ - public function test(Customer $customer, $products, $qty = null) - { - // Preconditions - $this->loginCustomer($customer); - $products = $this->createProducts($products); - $this->addToWishlist($products); - - // Steps - $this->addToCart($products, $qty); - - // Prepare data for asserts - $cart = $this->createCart($products, $qty); - - return ['products' => $products, 'customer' => $customer, 'cart' => $cart]; - } - - /** - * Add products from wish list to cart. - * - * @param array $products - * @param int|null $qty - * @return void - */ - protected function addToCart(array $products, $qty) - { - foreach ($products as $product) { - $this->cmsIndex->getTopLinksBlock()->openAccountLink("My Wishlist"); - $itemProductBlock = $this->wishlistIndex->getItemsBlock()->getItemProductBlock($product); - if ($qty !== null) { - $itemProductBlock->fillProduct(['qty' => $qty]); - $this->wishlistIndex->getWishlistBlock()->clickUpdateWishlist(); - } - $itemProductBlock->clickAddToCart(); - $productViewBlock = $this->catalogProductView->getViewBlock(); - if ($productViewBlock->isVisible()) { - $productViewBlock->fillOptions($product); - $productViewBlock->clickAddToCart(); - $this->catalogProductView->getMessagesBlock()->waitSuccessMessage(); - } - } - } - - /** - * Create cart fixture. - * - * @param array $products - * @return Cart - */ - protected function createCart(array $products) - { - return $this->fixtureFactory->createByCode('cart', ['data' => ['items' => ['products' => $products]]]); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.xml b/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.xml deleted file mode 100644 index 73002276b0b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.xml +++ /dev/null @@ -1,48 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Mage\Wishlist\Test\TestCase\AddProductsToCartFromCustomerWishlistOnFrontendTest" summary="AddProductsToCartFromCustomerWishlistOnFrontendTest"> - <variation name="AddProductsToCartFromCustomerWishlistOnFrontendTestVariation1" method="test"> - <data name="products" xsi:type="string">catalogProductSimple::default</data> - <data name="qty" xsi:type="string">2</data> - <data name="verifyData/0/qty" xsi:type="string">2</data> - <constraint name="Mage\Checkout\Test\Constraint\AssertProductQtyInShoppingCart" /> - <constraint name="Mage\Wishlist\Test\Constraint\AssertProductsIsAbsentInWishlist" /> - </variation> - <variation name="AddProductsToCartFromCustomerWishlistOnFrontendTestVariation3" method="test"> - <data name="products" xsi:type="string">catalogProductSimple::default,catalogProductVirtual::order_default,catalogProductSimple::default,catalogProductVirtual::order_default</data> - <data name="verifyData/0/qty" xsi:type="string">1</data> - <data name="verifyData/1/qty" xsi:type="string">1</data> - <data name="verifyData/2/qty" xsi:type="string">1</data> - <data name="verifyData/3/qty" xsi:type="string">1</data> - <constraint name="Mage\Checkout\Test\Constraint\AssertProductQtyInShoppingCart" /> - <constraint name="Mage\Wishlist\Test\Constraint\AssertWishlistIsEmpty" /> - </variation> - <variation name="AddProductsToCartFromCustomerWishlistOnFrontendTestVariation4" method="test"> - <data name="products" xsi:type="string">groupedProduct::three_simple_products</data> - <constraint name="Mage\Checkout\Test\Constraint\AssertProductQtyInShoppingCart" /> - <constraint name="Mage\Wishlist\Test\Constraint\AssertProductsIsAbsentInWishlist" /> - </variation> - <variation name="AddProductsToCartFromCustomerWishlistOnFrontendTestVariation6" method="test"> - <data name="products" xsi:type="string">configurableProduct::default</data> - <data name="qty" xsi:type="string">3</data> - <data name="verifyData/0/qty" xsi:type="string">3</data> - <constraint name="Mage\Checkout\Test\Constraint\AssertProductQtyInShoppingCart" /> - <constraint name="Mage\Wishlist\Test\Constraint\AssertProductsIsAbsentInWishlist" /> - </variation> - </testCase> -</config> diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.php b/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.php deleted file mode 100644 index 1f3c4a8522d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.php +++ /dev/null @@ -1,60 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Wishlist\Test\TestCase; - -use Mage\Customer\Test\Fixture\Customer; - -/** - * Preconditions: - * 1. Create customer. - * 2. Create composite products. - * 3. Log in to frontend. - * 4. Add products to the customer's wish list (unconfigured). - * - * Steps: - * 1. Open Wish list. - * 2. Click 'Edit' for the product. - * 3. Fill data. - * 4. Click 'Ok'. - * 5. Perform assertions. - * - * @group Wishlist_(CS) - * @ZephyrId MPERF-7630 - */ -class ConfigureProductInCustomerWishlistOnFrontendTest extends AbstractWishlistTest -{ - /** - * Configure customer wish list on frontend. - * - * @param Customer $customer - * @param string $product - * @return array - */ - public function test(Customer $customer, $product) - { - // Preconditions - $product = $this->createProducts($product)[0]; - $this->loginCustomer($customer); - $this->addToWishlist($product); - - // Steps - $this->cmsIndex->getTopLinksBlock()->openAccountLink('My Wishlist'); - $this->wishlistIndex->getItemsBlock()->getItemProductBlock($product)->clickEdit(); - $this->catalogProductView->getViewBlock()->updateWishlist($product); - - return ['product' => $product]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.xml b/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.xml deleted file mode 100644 index 33cfddbadbf..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.xml +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Mage\Wishlist\Test\TestCase\ConfigureProductInCustomerWishlistOnFrontendTest" summary="ConfigureProductInCustomerWishlistOnFrontendTest"> - <variation name="ConfigureProductInCustomerWishlistOnFrontendTestVariation1"> - <data name="product" xsi:type="string">catalogProductSimple::with_two_custom_option</data> - <constraint name="Mage\Wishlist\Test\Constraint\AssertProductIsPresentInWishlist" /> - <constraint name="Mage\Wishlist\Test\Constraint\AssertProductDetailsInWishlist" /> - </variation> - <variation name="ConfigureProductInCustomerWishlistOnFrontendTestVariation2"> - <data name="product" xsi:type="string">configurableProduct::default</data> - <constraint name="Mage\Wishlist\Test\Constraint\AssertProductIsPresentInWishlist" /> - <constraint name="Mage\Wishlist\Test\Constraint\AssertProductDetailsInWishlist" /> - </variation> - <variation name="ConfigureProductInCustomerWishlistOnFrontendTestVariation5"> - <data name="product" xsi:type="string">groupedProduct::three_simple_products</data> - <constraint name="Mage\Wishlist\Test\Constraint\AssertProductIsPresentInWishlist" /> - <constraint name="Mage\Wishlist\Test\Constraint\AssertProductDetailsInWishlist" /> - </variation> - </testCase> -</config> diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.php b/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.php deleted file mode 100644 index 9624eb1063d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.php +++ /dev/null @@ -1,68 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Wishlist\Test\TestCase; - -use Mage\Checkout\Test\Page\CheckoutCart; -use Mage\Customer\Test\Fixture\Customer; -use Magento\Mtf\Fixture\FixtureInterface; - -/** - * Preconditions: - * 1. Test products are created. - * 2. Create customer and login on frontend. - * - * Steps: - * 1. Add product to Shopping Cart. - * 2. Click 'Move to Wishlist' button from Shopping Cart for added product. - * 3. Perform asserts. - * - * @group Shopping_Cart_(CS) - * @ZephyrId MPERF-7605 - */ -class MoveProductFromShoppingCartToWishlistTest extends AbstractWishlistTest -{ - /** - * Run Move from ShoppingCard to Wishlist test. - * - * @param Customer $customer - * @param CheckoutCart $checkoutCart - * @param string $product - * @return array - */ - public function test(Customer $customer, CheckoutCart $checkoutCart, $product) { - // Preconditions: - $product = $this->createProducts($product)[0]; - $this->loginCustomer($customer); - - // Steps: - $this->addToCart($product); - $checkoutCart->open()->getCartBlock()->getCartItem($product)->moveToWishlist(); - - return ['product' => $product]; - } - - /** - * Add product to cart. - * - * @param FixtureInterface $product - * @return void - */ - protected function addToCart(FixtureInterface $product) - { - $this->objectManager->create('Mage\Checkout\Test\TestStep\AddProductsToTheCartStep', ['products' => [$product]]) - ->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.xml b/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.xml deleted file mode 100644 index 071eb6b6864..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.xml +++ /dev/null @@ -1,39 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Mage\Wishlist\Test\TestCase\MoveProductFromShoppingCartToWishlistTest" summary="MoveProductFromShoppingCartToWishlistTest"> - <variation name="MoveProductFromShoppingCartToWishlistTestVariation1" method="test"> - <data name="product" xsi:type="string">catalogProductSimple::default</data> - <constraint name="Mage\Wishlist\Test\Constraint\AssertMoveProductToWishlistSuccessMessage" /> - <constraint name="Mage\Wishlist\Test\Constraint\AssertProductIsPresentInWishlist" /> - <constraint name="Mage\Checkout\Test\Constraint\AssertCartIsEmpty" /> - </variation> - <variation name="MoveProductFromShoppingCartToWishlistTestVariation2" method="test"> - <data name="product" xsi:type="string">catalogProductVirtual::order_default</data> - <constraint name="Mage\Wishlist\Test\Constraint\AssertMoveProductToWishlistSuccessMessage" /> - <constraint name="Mage\Wishlist\Test\Constraint\AssertProductIsPresentInWishlist" /> - <constraint name="Mage\Checkout\Test\Constraint\AssertCartIsEmpty" /> - </variation> - <variation name="MoveProductFromShoppingCartToWishlistTestVariation4" method="test"> - <data name="product" xsi:type="string">configurableProduct::default</data> - <constraint name="Mage\Wishlist\Test\Constraint\AssertMoveProductToWishlistSuccessMessage" /> - <constraint name="Mage\Wishlist\Test\Constraint\AssertProductIsPresentInWishlist" /> - <constraint name="Mage\Checkout\Test\Constraint\AssertCartIsEmpty" /> - <constraint name="Mage\Wishlist\Test\Constraint\AssertProductDetailsInWishlist" /> - </variation> - </testCase> -</config> diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestStep/AddProductsToWishlistStep.php b/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestStep/AddProductsToWishlistStep.php deleted file mode 100644 index bf64b198366..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestStep/AddProductsToWishlistStep.php +++ /dev/null @@ -1,87 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Wishlist\Test\TestStep; - -use Mage\Catalog\Test\Page\Product\CatalogProductView; -use Magento\Mtf\Client\Browser; -use Magento\Mtf\TestStep\TestStepInterface; - -/** - * Adding created products to the wish list. - */ -class AddProductsToWishlistStep implements TestStepInterface -{ - /** - * Array with products. - * - * @var array - */ - protected $products; - - /** - * Frontend product view page. - * - * @var CatalogProductView - */ - protected $catalogProductView; - - /** - * Interface Browser. - * - * @var Browser - */ - protected $browser; - - /** - * Configure flag. - * - * @var bool - */ - protected $configure; - - /** - * @constructor - * @param CatalogProductView $catalogProductView - * @param Browser $browser - * @param array $products - * @param bool $configure [optional] - */ - public function __construct( - CatalogProductView $catalogProductView, - Browser $browser, - array $products, - $configure = false - ) { - $this->products = $products; - $this->catalogProductView = $catalogProductView; - $this->browser = $browser; - $this->configure = $configure; - } - - /** - * Add products to the wish list. - * - * @return void - */ - public function run() - { - foreach ($this->products as $product) { - $this->browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - $viewBlock = $this->catalogProductView->getViewBlock(); - $this->configure ? $viewBlock->addToWishlist($product) : $viewBlock->clickAddToWishlist(); - } - } -} diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests.php b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests.php deleted file mode 100644 index e87f3c29d91..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests.php +++ /dev/null @@ -1,125 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Magento\Mtf\TestSuite; - -use Magento\Mtf\ObjectManager; -use Magento\Mtf\ObjectManagerFactory; - -/** - * Injectable tests class. - */ -class InjectableTests extends \PHPUnit_Framework_TestSuite -{ - /** - * Object manager. - * - * @var ObjectManager - */ - protected $objectManager; - - /** - * Test suite. - * - * @var \PHPUnit_Framework_TestSuite - */ - protected $suite; - - /** - * Test result - * - * @var \PHPUnit_Framework_TestResult - */ - protected $result; - - /** - * Run collected tests. - * - * @param \PHPUnit_Framework_TestResult $result - * @param bool $filter - * @param array $groups - * @param array $excludeGroups - * @param bool $processIsolation - * @return \PHPUnit_Framework_TestResult|void - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function run( - \PHPUnit_Framework_TestResult $result = null, - $filter = false, - array $groups = [], - array $excludeGroups = [], - $processIsolation = false - ) { - if ($result === null) { - $this->result = $this->createResult(); - } - } - - /** - * Prepare test suite. - * - * @return mixed - */ - public static function suite() - { - $suite = new self(); - return $suite->prepareSuite(); - } - - /** - * Prepare test suite and apply application state. - * - * @return AppState - */ - public function prepareSuite() - { - $this->init(); - return $this->objectManager->create('Magento\Mtf\TestSuite\AppState'); - } - - /** - * Call the initialization of ObjectManager. - * - * @return void - */ - public function init() - { - $this->initObjectManager(); - } - - /** - * Initialize ObjectManager. - * - * @return void - */ - private function initObjectManager() - { - if (!isset($this->objectManager)) { - $objectManagerFactory = new ObjectManagerFactory(); - - $configFileName = isset($_ENV['testsuite_rule']) ? $_ENV['testsuite_rule'] : 'basic'; - $configFilePath = realpath(MTF_BP . '/testsuites/' . $_ENV['testsuite_rule_path']); - - /** @var \Magento\Mtf\Config\DataInterface $configData */ - $configData = $objectManagerFactory->getObjectManager()->create('Magento\Mtf\Config\TestRunner'); - $configData->setFileName($configFileName . '.xml')->load($configFilePath); - - $this->objectManager = $objectManagerFactory->create( - ['Magento\Mtf\Config\TestRunner' => $configData] - ); - } - } -} diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/3rdParty.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/3rdParty.xml deleted file mode 100644 index dfbab34e4eb..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/3rdParty.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="testcase"> - <allow> - <tag group="test_type" value="3rd_party_test" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/authorizenet.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/authorizenet.xml deleted file mode 100644 index a74f189dce1..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/authorizenet.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="variation"> - <allow> - <tag group="payment_method" value="authorize_net" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/authorizenetdp.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/authorizenetdp.xml deleted file mode 100644 index fa07a695c43..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/authorizenetdp.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="variation"> - <allow> - <tag group="payment_method" value="authorize_net_dp" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/basic.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/basic.xml deleted file mode 100644 index eb059f9cf9b..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/basic.xml +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="testcase"> - <deny> - <tag group="test_type" value="3rd_party_test" /> - </deny> - </rule> - <rule scope="variation"> - <deny> - <tag group="test_type" value="install" /> - </deny> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/ce_main.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/ce_main.xml deleted file mode 100644 index 342f397a7fd..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/ce_main.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="variation"> - <allow> - <tag group="main" value="ce" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/installationce.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/installationce.xml deleted file mode 100644 index 379e14ae59c..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/installationce.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="testsuite"> - <allow> - <class value="Mage\Install\Test\TestCase\InstallTest" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/installationce2.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/installationce2.xml deleted file mode 100644 index 848440a3d84..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/installationce2.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="testsuite"> - <allow> - <class value="Mage\Install\Test\TestCase\InstallTest2" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/installationce3.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/installationce3.xml deleted file mode 100644 index 9d4298296bb..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/installationce3.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="testsuite"> - <allow> - <class value="Mage\Install\Test\TestCase\InstallTest3" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/installationce4.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/installationce4.xml deleted file mode 100644 index 41fc27257de..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/installationce4.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="testsuite"> - <allow> - <class value="Mage\Install\Test\TestCase\InstallTest4" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/installationce5.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/installationce5.xml deleted file mode 100644 index 667dbd89e35..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/installationce5.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="testsuite"> - <allow> - <class value="Mage\Install\Test\TestCase\InstallTest5" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/installationce6.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/installationce6.xml deleted file mode 100644 index 8d1f3cb38a4..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/installationce6.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="testsuite"> - <allow> - <class value="Mage\Install\Test\TestCase\InstallTest6" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypal.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypal.xml deleted file mode 100644 index e0ec0057d22..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypal.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="variation"> - <allow> - <tag group="payment_method" value="paypal" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypal1.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypal1.xml deleted file mode 100644 index 1072725e09f..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypal1.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="testsuite"> - <allow> - <class value="Mage\Paypal\Test\TestCase\CreateInvoiceForPaypalExpressCheckoutTest" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypaladvanced.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypaladvanced.xml deleted file mode 100644 index a5e39783144..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypaladvanced.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="variation"> - <allow> - <tag group="paypal" value="advanced" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypaldirect.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypaldirect.xml deleted file mode 100644 index c339a1663aa..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypaldirect.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="variation"> - <allow> - <tag group="payment_method" value="paypal_direct" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalecbutton.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalecbutton.xml deleted file mode 100644 index 6b978e52883..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalecbutton.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="testsuite"> - <allow> - <class value="Mage\Paypal\Test\TestCase\TestCreationForExpressCheckoutWithinPayPalButtonTest" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalecbuttonproduct.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalecbuttonproduct.xml deleted file mode 100644 index 14b1cdd83a5..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalecbuttonproduct.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="testsuite"> - <allow> - <class value="Mage\Paypal\Test\TestCase\TestCreationForExpressCheckoutWithinPayPalButtonFromProductPageTest" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalecinvoice.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalecinvoice.xml deleted file mode 100644 index 1072725e09f..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalecinvoice.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="testsuite"> - <allow> - <class value="Mage\Paypal\Test\TestCase\CreateInvoiceForPaypalExpressCheckoutTest" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalecrefund.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalecrefund.xml deleted file mode 100644 index d595aa50484..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalecrefund.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="testsuite"> - <allow> - <class value="Mage\Paypal\Test\TestCase\CreateOnlineRefundForPaypalExpressCheckoutTest" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalecshipment.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalecshipment.xml deleted file mode 100644 index 47dfd6500a9..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalecshipment.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="testsuite"> - <allow> - <class value="Mage\Paypal\Test\TestCase\CreateShipmentForPaypalExpressCheckoutTest" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalhostedsolution.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalhostedsolution.xml deleted file mode 100644 index 83152b71ca1..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalhostedsolution.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="variation"> - <allow> - <tag group="paypal" value="hosted_solution" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalpayflowlink.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalpayflowlink.xml deleted file mode 100644 index ec8c231df4e..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalpayflowlink.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="variation"> - <allow> - <tag group="paypal" value="payflow_link" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalpayflowpro.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalpayflowpro.xml deleted file mode 100644 index aeace134b65..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalpayflowpro.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="variation"> - <allow> - <tag group="paypal" value="payflow_pro" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalpaymentspro.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalpaymentspro.xml deleted file mode 100644 index dc4e6fc9a34..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalpaymentspro.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="variation"> - <allow> - <tag group="paypal" value="payments_pro" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalstandard.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalstandard.xml deleted file mode 100644 index 260a0dd5abc..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalstandard.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="variation"> - <allow> - <tag group="paypal" value="standard" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/suite1.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/suite1.xml deleted file mode 100644 index 22f9be10a0f..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/suite1.xml +++ /dev/null @@ -1,38 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="testsuite"> - <allow> - <class value="Mage\Admin\Test\TestCase\CreateAdminUserEntityTest" /> - <class value="Mage\Admin\Test\TestCase\CreateAdminUserRoleEntityTest" /> - <class value="Mage\Admin\Test\TestCase\UseAclRoleWithRestrictedGwsScopeTest" /> - <class value="Mage\Adminhtml\Test\TestCase\CreateStoreEntityTest" /> - <class value="Mage\Adminhtml\Test\TestCase\CreateStoreGroupEntityTest" /> - <class value="Mage\Adminhtml\Test\TestCase\CreateWebsiteEntityTest" /> - <class value="Mage\Bundle\Test\TestCase\CreateBundleProductEntityTest" /> - <class value="Mage\Catalog\Test\TestCase\Product\CreateConfigurableProductEntityTest" /> - <class value="Mage\Catalog\Test\TestCase\Product\CreateGroupedProductEntityTest" /> - <class value="Mage\Catalog\Test\TestCase\Product\CreateSimpleProductEntityTest" /> - - <class value="Mage\Catalog\Test\TestCase\Product\CreateVirtualProductEntityTest" /> - <class value="Mage\Catalog\Test\TestCase\Product\DeleteProductEntityTest" /> - <class value="Mage\Catalog\Test\TestCase\Product\UpdateConfigurableProductEntityTest" /> - <class value="Mage\Catalog\Test\TestCase\Product\UpdateSimpleProductEntityTest" /> - <class value="Mage\Sales\Test\TestCase\CreateOrderFromBackendWithinOfflinePaymentMethodsTest" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/suite2.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/suite2.xml deleted file mode 100644 index a392f0b81e2..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/suite2.xml +++ /dev/null @@ -1,77 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="testsuite"> - <allow> - <class value="Mage\Catalog\Test\TestCase\Category\CreateCategoryEntityTest" /> - <class value="Mage\Catalog\Test\TestCase\Category\DeleteCategoryEntityTest" /> - <class value="Mage\Catalog\Test\TestCase\Category\UpdateCategoryEntityTest" /> - <class value="Mage\Catalog\Test\TestCase\Layer\FilterProductListTest" /> - <class value="Mage\Catalog\Test\TestCase\Product\AddCrossSellProductsEntityTest" /> - <class value="Mage\Catalog\Test\TestCase\Product\AddProductsToCompareTest" /> - <class value="Mage\Catalog\Test\TestCase\Product\AddRelatedProductsEntityTest" /> - <class value="Mage\Catalog\Test\TestCase\Product\AddUpSellProductsEntityTest" /> - <class value="Mage\Catalog\Test\TestCase\Product\ApplyMapTest" /> - <class value="Mage\Catalog\Test\TestCase\Product\ClearAllCompareProductsTest" /> - - <class value="Mage\Catalog\Test\TestCase\Product\DuplicateProductEntityTest" /> - <class value="Mage\Catalog\Test\TestCase\Product\PromoteProductsAsCrossSellsTest" /> - <class value="Mage\Catalog\Test\TestCase\Product\PromoteProductsAsRelatedTest" /> - <class value="Mage\Catalog\Test\TestCase\Product\PromoteProductsAsUpSellsTest" /> - <class value="Mage\Catalog\Test\TestCase\ProductAttribute\CreateAttributeSetEntityTest" /> - <class value="Mage\Catalog\Test\TestCase\ProductAttribute\CreateProductAttributeEntityTest" /> - <class value="Mage\CatalogRule\Test\TestCase\ApplySeveralCatalogPriceRuleEntityTest" /> - <class value="Mage\CatalogRule\Test\TestCase\CreateCatalogPriceRuleEntityTest" /> - <class value="Mage\CatalogRule\Test\TestCase\DeleteCatalogPriceRuleEntityTest" /> - <class value="Mage\CatalogSearch\Test\TestCase\CreateSearchTermEntityTest" /> - - <class value="Mage\CatalogSearch\Test\TestCase\SuggestSearchingResultEntityTest" /> - <class value="Mage\Checkout\Test\TestCase\AddProductsToShoppingCartEntityTest" /> - <class value="Mage\Checkout\Test\TestCase\CheckoutWithMultishippingTest" /> - <class value="Mage\Checkout\Test\TestCase\CreateTermEntityTest" /> - <class value="Mage\Checkout\Test\TestCase\DeleteProductsFromShoppingCartTest" /> - <class value="Mage\Checkout\Test\TestCase\UpdateShoppingCartTest" /> - <class value="Mage\Cms\Test\TestCase\CreateCmsBlockEntityTest" /> - <class value="Mage\Cms\Test\TestCase\CreateCmsPageEntityTest" /> - <class value="Mage\Cms\Test\TestCase\DeleteCmsPageEntityTest" /> - <class value="Mage\Cms\Test\TestCase\UpdateCmsPageEntityTest" /> - - <class value="Mage\CurrencySymbol\Test\TestCase\EditCurrencySymbolEntityTest" /> - <class value="Mage\Customer\Test\TestCase\ChangeCustomerPasswordTest" /> - <class value="Mage\Customer\Test\TestCase\CreateCustomerFromBackendTest" /> - <class value="Mage\Customer\Test\TestCase\CreateCustomerGroupEntityTest" /> - <class value="Mage\Customer\Test\TestCase\CreateExistingCustomerFrontendEntity" /> - <class value="Mage\Customer\Test\TestCase\DeleteCustomerAddressEntityTest" /> - <class value="Mage\Customer\Test\TestCase\RegisterCustomerFrontendEntityTest" /> - <class value="Mage\GiftMessage\Test\TestCase\CheckoutWithGiftMessagesTest" /> - <class value="Mage\Review\Test\TestCase\CreateProductReviewFrontendEntityTest" /> - <class value="Mage\Sales\Test\TestCase\CancelCreatedOrderTest" /> - - <class value="Mage\Sales\Test\TestCase\CreateOrderFromBackendCustomerPageTest" /> - <class value="Mage\Sales\Test\TestCase\MoveShoppingCartProductsOnOrderPageTest" /> - <class value="Mage\Sales\Test\TestCase\ReorderOrderEntityTest" /> - <class value="Mage\SalesRule\Test\TestCase\DeleteSalesRuleEntityTest" /> - <class value="Mage\Sitemap\Test\TestCase\CreateSitemapEntityTest" /> - <class value="Mage\Sitemap\Test\TestCase\GenerateSitemapEntityTest" /> - <class value="Mage\Tax\Test\TestCase\AutomaticTaxApplyingBasedOnVatIdTest" /> - <class value="Mage\Tax\Test\TestCase\CreateTaxRateEntityTest" /> - <class value="Mage\Tax\Test\TestCase\CreateTaxRuleEntityTest" /> - - <class value="Mage\Tax\Test\TestCase\DeleteTaxRateEntityTest" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/suite3.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/suite3.xml deleted file mode 100644 index c94469a1824..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/suite3.xml +++ /dev/null @@ -1,36 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="testsuite"> - <allow> - <class value="Mage\Checkout\Test\TestCase\OnePageCheckoutTest" /> - <class value="Mage\Checkout\Test\TestCase\OnePageCheckoutWithinOnlineShippingMethods" /> - <class value="Mage\Checkout\Test\TestCase\OnePageCheckoutWithinDhlShippingMethod" /> - <class value="Mage\Downloadable\Test\TestCase\CreateDownloadableProductEntityTest" /> - <class value="Mage\Downloadable\Test\TestCase\TaxCalculationForDownloadableProductTest" /> - <class value="Mage\SalesRule\Test\TestCase\CreateSalesRuleEntityTest" /> - <class value="Mage\Tax\Test\TestCase\TaxCalculationTest" /> - <class value="Mage\Tax\Test\TestCase\TaxWithCrossBorderTest" /> - <class value="Mage\Weee\Test\TestCase\CreateTaxWithFptTest" /> - <class value="Mage\Wishlist\Test\TestCase\AddProductsToCartFromCustomerWishlistOnFrontendTest" /> - <class value="Mage\Wishlist\Test\TestCase\AddProductToWishlistEntityTest" /> - - <class value="Mage\Wishlist\Test\TestCase\ConfigureProductInCustomerWishlistOnFrontendTest" /> - <class value="Mage\Wishlist\Test\TestCase\MoveProductFromShoppingCartToWishlistTest" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/utils/bootstrap.php b/dev/tests/functional/utils/bootstrap.php deleted file mode 100644 index 9c3ec84ce68..00000000000 --- a/dev/tests/functional/utils/bootstrap.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ -umask(0); - -$mtfRoot = dirname(__DIR__); -$mtfRoot = str_replace('\\', '/', $mtfRoot); -define('MTF_BP', $mtfRoot); -define('MTF_TESTS_PATH', MTF_BP . '/tests/app/'); - -$appRoot = dirname(dirname(dirname(dirname(__DIR__)))); -require __DIR__ . '/../vendor/autoload.php'; - -$objectManager = \Magento\Mtf\ObjectManagerFactory::getObjectManager(); -\Magento\Mtf\ObjectManagerFactory::configure($objectManager); diff --git a/dev/tests/functional/utils/generate.php b/dev/tests/functional/utils/generate.php deleted file mode 100644 index 3998809974e..00000000000 --- a/dev/tests/functional/utils/generate.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ -require_once __DIR__ . '/' . 'bootstrap.php'; - -$objectManager->create('Magento\Mtf\Util\Generate\Page')->launch(); -$objectManager->create('Magento\Mtf\Util\Generate\Fixture')->launch(); -$objectManager->create('Magento\Mtf\Util\Generate\Repository')->launch(); - -\Magento\Mtf\Util\Generate\GenerateResult::displayResults(); diff --git a/dev/tests/functional/utils/generate/fixture.php b/dev/tests/functional/utils/generate/fixture.php deleted file mode 100644 index 07d9e47f94a..00000000000 --- a/dev/tests/functional/utils/generate/fixture.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ -require_once dirname(__DIR__) . '/' . 'bootstrap.php'; - -$objectManager->create('Magento\Mtf\Util\Generate\Fixture')->launch(); -\Magento\Mtf\Util\Generate\GenerateResult::displayResults(); diff --git a/dev/tests/functional/utils/generate/handler.php b/dev/tests/functional/utils/generate/handler.php deleted file mode 100644 index 35ff417b5d1..00000000000 --- a/dev/tests/functional/utils/generate/handler.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ -require_once dirname(__DIR__) . '/' . 'bootstrap.php'; - -$objectManager->create('Magento\Mtf\Util\Generate\Handler')->launch(); -\Magento\Mtf\Util\Generate\GenerateResult::displayResults(); diff --git a/dev/tests/functional/utils/generate/page.php b/dev/tests/functional/utils/generate/page.php deleted file mode 100644 index 78d9efc12dc..00000000000 --- a/dev/tests/functional/utils/generate/page.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ -require_once dirname(__DIR__) . '/' . 'bootstrap.php'; -$objectManager->create('Magento\Mtf\Util\Generate\Page')->launch(); -\Magento\Mtf\Util\Generate\GenerateResult::displayResults(); diff --git a/dev/tests/functional/utils/generate/repository.php b/dev/tests/functional/utils/generate/repository.php deleted file mode 100644 index 324c6a8ede0..00000000000 --- a/dev/tests/functional/utils/generate/repository.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ -require_once dirname(__DIR__) . '/' . 'bootstrap.php'; - -$objectManager->create('Magento\Mtf\Util\Generate\Repository')->launch(); -\Magento\Mtf\Util\Generate\GenerateResult::displayResults(); diff --git a/js/mage/adminhtml/wysiwyg/tinymce/setup.js b/js/mage/adminhtml/wysiwyg/tinymce/setup.js index 482d01ccdef..91089a91185 100644 --- a/js/mage/adminhtml/wysiwyg/tinymce/setup.js +++ b/js/mage/adminhtml/wysiwyg/tinymce/setup.js @@ -90,6 +90,7 @@ tinyMceWysiwygSetup.prototype = automatic_uploads: false, branding: false, promotion: false, + convert_unsafe_embeds: true, // default in TinyMCE v7.0 convert_urls: false, relative_urls: true, skin: this.config.skin, diff --git a/lib/Mage/Archive/Helper/File.php b/lib/Mage/Archive/Helper/File.php index 928d9eed77e..88a772d532f 100644 --- a/lib/Mage/Archive/Helper/File.php +++ b/lib/Mage/Archive/Helper/File.php @@ -95,7 +95,7 @@ public function open($mode = 'w+', $chmod = 0666) } if (is_file($this->_filePath) && !is_writable($this->_filePath)) { - throw new Mage_Exception("Can't open file " . $this->_fileName . " for writing. Permission denied."); + throw new Mage_Exception("Can't open file " . $this->_fileName . ' for writing. Permission denied.'); } } diff --git a/lib/Mage/Archive/Tar.php b/lib/Mage/Archive/Tar.php index afc48a9fc67..443d0746d87 100644 --- a/lib/Mage/Archive/Tar.php +++ b/lib/Mage/Archive/Tar.php @@ -362,12 +362,12 @@ protected function _composeHeader($long = false) $header = []; $header['100-name'] = $long ? '././@LongLink' : substr($nameFile, 0, 100); $header['8-mode'] = $long ? ' ' - : str_pad(substr(sprintf("%07o", $infoFile['mode']), -4), 6, '0', STR_PAD_LEFT); - $header['8-uid'] = $long || $infoFile['uid'] == 0 ? "\0\0\0\0\0\0\0" : sprintf("%07o", $infoFile['uid']); - $header['8-gid'] = $long || $infoFile['gid'] == 0 ? "\0\0\0\0\0\0\0" : sprintf("%07o", $infoFile['gid']); - $header['12-size'] = $long ? sprintf("%011o", strlen($nameFile)) : sprintf("%011o", is_dir($file) + : str_pad(substr(sprintf('%07o', $infoFile['mode']), -4), 6, '0', STR_PAD_LEFT); + $header['8-uid'] = $long || $infoFile['uid'] == 0 ? "\0\0\0\0\0\0\0" : sprintf('%07o', $infoFile['uid']); + $header['8-gid'] = $long || $infoFile['gid'] == 0 ? "\0\0\0\0\0\0\0" : sprintf('%07o', $infoFile['gid']); + $header['12-size'] = $long ? sprintf('%011o', strlen($nameFile)) : sprintf('%011o', is_dir($file) ? 0 : filesize($file)); - $header['12-mtime'] = $long ? '00000000000' : sprintf("%011o", $infoFile['mtime']); + $header['12-mtime'] = $long ? '00000000000' : sprintf('%011o', $infoFile['mtime']); $header['8-check'] = sprintf('% 8s', ''); $header['1-type'] = $long ? 'L' : (is_link($file) ? 2 : (is_dir($file) ? 5 : 0)); $header['100-symlink'] = is_link($file) ? readlink($file) : ''; @@ -392,7 +392,7 @@ protected function _composeHeader($long = false) for ($i = 0; $i < 512; $i++) { $checksum += ord(substr($packedHeader, $i, 1)); } - $packedHeader = substr_replace($packedHeader, sprintf("%07o", $checksum) . "\0", 148, 8); + $packedHeader = substr_replace($packedHeader, sprintf('%07o', $checksum) . "\0", 148, 8); return $longHeader . $packedHeader; } @@ -423,7 +423,7 @@ protected function _unpackCurrentTar($destination) $currentFile = $destination . $header['name']; $dirname = dirname($currentFile); - if (in_array($header['type'], ["0",chr(0), ''])) { + if (in_array($header['type'], ['0',chr(0), ''])) { if (!file_exists($dirname)) { $mkdirResult = @mkdir($dirname, 0777, true); @@ -477,7 +477,7 @@ protected function _parseHeader(&$pointer) $header['mtime'] = octdec($header['mtime']); $header['checksum'] = octdec($header['checksum']); - if ($header['type'] == "5") { + if ($header['type'] == '5') { $header['size'] = 0; } @@ -532,7 +532,7 @@ protected function _extractFileHeader() $header['mtime'] = octdec($header['mtime']); $header['checksum'] = octdec($header['checksum']); - if ($header['type'] == "5") { + if ($header['type'] == '5') { $header['size'] = 0; } diff --git a/lib/Mage/DB/Mysqli.php b/lib/Mage/DB/Mysqli.php index ffb86bd3d01..f987ddaf3f1 100644 --- a/lib/Mage/DB/Mysqli.php +++ b/lib/Mage/DB/Mysqli.php @@ -340,11 +340,11 @@ public function unsafeQuery($sql) public function insertAssocOne($table, array $data, $replace = false) { $keys = $this->escapeFieldNames(array_keys($data)); - $keys = "(" . implode(",", $keys) . ")"; + $keys = '(' . implode(',', $keys) . ')'; $table = $this->escapeTableName($table); $sql = $replace ? "REPLACE INTO {$table} " : "INSERT INTO {$table} "; $values = $this->escapeFieldValues(array_values($data)); - $values = " VALUES (" . implode(",", $values) . ")"; + $values = ' VALUES (' . implode(',', $values) . ')'; $sql .= $keys . $values; return $this->query($sql); } @@ -371,30 +371,30 @@ public function insertAssocMultiple($table, array $data, $replace = false, $excl } $keys = $this->escapeFieldNames($keys); - $sql .= " ( "; + $sql .= ' ( '; for ($i = 0, $c = count($keys); $i < $c; $i++) { $sql .= $keys[$i]; if ($i != $c - 1) { - $sql .= ","; + $sql .= ','; } } - $sql .= " ) VALUES "; + $sql .= ' ) VALUES '; for ($i = 0, $c = count($data); $i < $c; $i++) { $row = $data[$i]; for ($j = 0, $jc = count($excluded); $j < $jc; $j++) { unset($data[$excluded[$j]]); } $values = $this->escapeFieldValues(array_values($row)); - $sql .= "( "; + $sql .= '( '; for ($j = 0, $jc = count($values); $j < $jc; $j++) { $sql .= $values[$j]; if ($j != $jc - 1) { - $sql .= ","; + $sql .= ','; } } - $sql .= " )"; + $sql .= ' )'; if ($i != $c - 1) { - $sql .= ","; + $sql .= ','; } } return $this->query($sql); @@ -414,9 +414,9 @@ public function updateAssoc($table, array $data, $condition = '1=1') foreach ($data as $k => $v) { $k = $this->escapeFieldName($k); $v = $this->escapeFieldValue($v); - $set[] = $k . " = " . $v; + $set[] = $k . ' = ' . $v; } - $set = implode(",", $set); + $set = implode(',', $set); $sql = "UPDATE {$table} SET {$set} WHERE {$condition}"; return $this->query($sql); } @@ -438,9 +438,9 @@ public function updateAssocByKey($table, array $data, $value, $key = 'id') foreach ($data as $k => $v) { $k = $this->escapeFieldName($k); $v = $this->escapeFieldValue($v); - $set[] = $k . " = " . $v; + $set[] = $k . ' = ' . $v; } - $set = implode(",", $set); + $set = implode(',', $set); $sql = "UPDATE {$table} SET {$set} WHERE {$key} = {$value}"; return $this->query($sql); } @@ -459,7 +459,7 @@ public function idsToString($ids) foreach ($ids as $id) { $out .= $this->escapeFieldValue($id); } - return implode(",", $out); + return implode(',', $out); } /** @@ -508,7 +508,7 @@ public function simpleCount($table, $condition) public function lastInsertId() { - $sql = "SELECT LAST_INSERT_ID() as `id`"; + $sql = 'SELECT LAST_INSERT_ID() as `id`'; $data = $this->fetchOne($sql); return $data['id']; } diff --git a/lib/Mage/HTTP/Client.php b/lib/Mage/HTTP/Client.php index a7ec0641b46..b9a3f397be0 100644 --- a/lib/Mage/HTTP/Client.php +++ b/lib/Mage/HTTP/Client.php @@ -40,10 +40,10 @@ public static function getInstance($frontend = false) $frontend = self::detectFrontend(); } if (false === $frontend) { - throw new Exception("Cannot find frontend automatically, set it manually"); + throw new Exception('Cannot find frontend automatically, set it manually'); } - $class = __CLASS__ . "_" . str_replace(' ', DIRECTORY_SEPARATOR, ucwords(str_replace('_', ' ', $frontend))); + $class = __CLASS__ . '_' . str_replace(' ', DIRECTORY_SEPARATOR, ucwords(str_replace('_', ' ', $frontend))); $obj = new $class(); return $obj; } @@ -56,11 +56,11 @@ public static function getInstance($frontend = false) */ protected static function detectFrontend() { - if (function_exists("curl_init")) { - return "curl"; + if (function_exists('curl_init')) { + return 'curl'; } - if (function_exists("fsockopen")) { - return "socket"; + if (function_exists('fsockopen')) { + return 'socket'; } return false; } diff --git a/lib/Mage/HTTP/Client/Curl.php b/lib/Mage/HTTP/Client/Curl.php index 6cef1705467..57edac17b35 100644 --- a/lib/Mage/HTTP/Client/Curl.php +++ b/lib/Mage/HTTP/Client/Curl.php @@ -166,7 +166,7 @@ public function removeHeader($name) public function setCredentials($login, $pass) { $val = base64_encode("$login:$pass"); - $this->addHeader("Authorization", "Basic $val"); + $this->addHeader('Authorization', "Basic $val"); } /** @@ -215,7 +215,7 @@ public function removeCookies() */ public function get($uri) { - $this->makeRequest("GET", $uri); + $this->makeRequest('GET', $uri); } /** @@ -224,7 +224,7 @@ public function get($uri) */ public function post($uri, $params) { - $this->makeRequest("POST", $uri, $params); + $this->makeRequest('POST', $uri, $params); } /** @@ -259,7 +259,7 @@ public function getCookies() } $out = []; foreach ($this->_responseHeaders['Set-Cookie'] as $row) { - $values = explode("; ", $row); + $values = explode('; ', $row); $c = count($values); if (!$c) { continue; @@ -285,7 +285,7 @@ public function getCookiesFull() } $out = []; foreach ($this->_responseHeaders['Set-Cookie'] as $row) { - $values = explode("; ", $row); + $values = explode('; ', $row); $c = count($values); if (!$c) { continue; @@ -301,7 +301,7 @@ public function getCookiesFull() continue; } for ($i = 0; $i < $c; $i++) { - list($subkey, $val) = explode("=", $values[$i]); + list($subkey, $val) = explode('=', $values[$i]); $out[trim($key)][trim($subkey)] = trim($val); } } @@ -330,7 +330,7 @@ protected function makeRequest($method, $uri, $params = []) if ($method == 'POST') { $this->curlOption(CURLOPT_POST, 1); $this->curlOption(CURLOPT_POSTFIELDS, is_array($params) ? http_build_query($params) : $params); - } elseif ($method == "GET") { + } elseif ($method == 'GET') { $this->curlOption(CURLOPT_HTTPGET, 1); } else { $this->curlOption(CURLOPT_CUSTOMREQUEST, $method); @@ -349,7 +349,7 @@ protected function makeRequest($method, $uri, $params = []) foreach ($this->_cookies as $k => $v) { $cookies[] = "$k=$v"; } - $this->curlOption(CURLOPT_COOKIE, implode(";", $cookies)); + $this->curlOption(CURLOPT_COOKIE, implode(';', $cookies)); } if ($this->_timeout) { diff --git a/lib/Mage/HTTP/Client/Socket.php b/lib/Mage/HTTP/Client/Socket.php index 421b426bde8..e0cd7ef6977 100644 --- a/lib/Mage/HTTP/Client/Socket.php +++ b/lib/Mage/HTTP/Client/Socket.php @@ -172,7 +172,7 @@ public function removeHeader($name) public function setCredentials($login, $pass) { $val = base64_encode("$login:$pass"); - $this->addHeader("Authorization", "Basic $val"); + $this->addHeader('Authorization', "Basic $val"); } /** @@ -221,7 +221,7 @@ public function removeCookies() */ public function get($uri) { - $this->makeRequest("GET", $this->parseUrl($uri)); + $this->makeRequest('GET', $this->parseUrl($uri)); } /** @@ -253,7 +253,7 @@ protected function parseUrl($uri) throw new InvalidArgumentException("Uri doesn't contain path part"); } if (!empty($parts['query'])) { - $requestUri .= "?" . $parts['query']; + $requestUri .= '?' . $parts['query']; } return $requestUri; } @@ -263,7 +263,7 @@ protected function parseUrl($uri) */ public function post($uri, $params) { - $this->makeRequest("POST", $this->parseUrl($uri), $params); + $this->makeRequest('POST', $this->parseUrl($uri), $params); } /** @@ -298,7 +298,7 @@ public function getCookies() } $out = []; foreach ($this->_responseHeaders['Set-Cookie'] as $row) { - $values = explode("; ", $row); + $values = explode('; ', $row); $c = count($values); if (!$c) { continue; @@ -324,7 +324,7 @@ public function getCookiesFull() } $out = []; foreach ($this->_responseHeaders['Set-Cookie'] as $row) { - $values = explode("; ", $row); + $values = explode('; ', $row); $c = count($values); if (!$c) { continue; @@ -340,7 +340,7 @@ public function getCookiesFull() continue; } for ($i = 0; $i < $c; $i++) { - list($subkey, $val) = explode("=", $values[$i]); + list($subkey, $val) = explode('=', $values[$i]); $out[trim($key)][trim($subkey)] = trim($val); } } @@ -360,13 +360,13 @@ protected function processResponseHeaders() return; } $name = $value = ''; - $out = explode(": ", trim($line), 2); + $out = explode(': ', trim($line), 2); if (count($out) == 2) { $name = $out[0]; $value = $out[1]; } if (!empty($value)) { - if ($name == "Set-Cookie") { + if ($name == 'Set-Cookie') { if (!isset($this->_responseHeaders[$name])) { $this->_responseHeaders[$name] = []; } @@ -400,9 +400,9 @@ protected function processResponse() $response = ''; $responseLine = trim(fgets($this->_sock, 1024)); - $line = explode(" ", $responseLine, 3); + $line = explode(' ', $responseLine, 3); if (count($line) != 3) { - return $this->doError("Invalid response line returned from server: " . $responseLine); + return $this->doError('Invalid response line returned from server: ' . $responseLine); } $this->_responseStatus = (int) $line[1]; $this->processResponseHeaders(); @@ -442,11 +442,11 @@ protected function makeRequest($method, $uri, $params = []) $errno = $errstr = ''; $this->_sock = @fsockopen($this->_host, $this->_port, $errno, $errstr, $this->_timeout); if (!$this->_sock) { - return $this->doError(sprintf("[errno: %d] %s", $errno, $errstr)); + return $this->doError(sprintf('[errno: %d] %s', $errno, $errstr)); } $crlf = "\r\n"; - $isPost = $method == "POST"; + $isPost = $method == 'POST'; $appendHeaders = []; $paramsStr = false; @@ -487,8 +487,8 @@ public function doError($string) protected function headersToString($append = []) { $headers = []; - $headers["Host"] = $this->_host; - $headers['Connection'] = "close"; + $headers['Host'] = $this->_host; + $headers['Connection'] = 'close'; $headers = array_merge($headers, $this->_headers, $append); $str = []; foreach ($headers as $k => $v) { diff --git a/lib/Mage/System/Ftp.php b/lib/Mage/System/Ftp.php index ff2b1aebbe1..99a2c61bbfd 100644 --- a/lib/Mage/System/Ftp.php +++ b/lib/Mage/System/Ftp.php @@ -37,7 +37,7 @@ class Mage_System_Ftp protected function checkConnected() { if (!$this->_conn) { - throw new Exception(__CLASS__ . " - no connection established with server"); + throw new Exception(__CLASS__ . ' - no connection established with server'); } } @@ -67,13 +67,13 @@ public function mdkir($name) public function mkdirRecursive($path, $mode = 0777) { $this->checkConnected(); - $dir = explode("/", $path); - $path = ""; + $dir = explode('/', $path); + $path = ''; $ret = true; for ($i = 0; $i < count($dir); $i++) { - $path .= "/" . $dir[$i]; + $path .= '/' . $dir[$i]; if (!@ftp_chdir($this->_conn, $path)) { - @ftp_chdir($this->_conn, "/"); + @ftp_chdir($this->_conn, '/'); if (!@ftp_mkdir($this->_conn, $path)) { $ret = false; break; @@ -95,12 +95,12 @@ public function mkdirRecursive($path, $mode = 0777) * * @SuppressWarnings(PHPMD.ErrorControlOperator) */ - public function login($login = "anonymous", $password = "test@gmail.com") + public function login($login = 'anonymous', $password = 'test@gmail.com') { $this->checkConnected(); $res = @ftp_login($this->_conn, $login, $password); if (!$res) { - throw new Exception("Invalid login credentials"); + throw new Exception('Invalid login credentials'); } return $res; } @@ -195,8 +195,8 @@ public function put($remoteFile, $localFile, $mode = FTP_BINARY, $startPos = 0) */ public function getcwd() { - $d = $this->raw("pwd"); - $data = explode(" ", $d[0], 3); + $d = $this->raw('pwd'); + $data = explode(' ', $d[0], 3); if (empty($data[1])) { return false; } @@ -204,8 +204,8 @@ public function getcwd() return false; } $out = trim($data[1], '"'); - if ($out !== "/") { - $out = rtrim($out, "/"); + if ($out !== '/') { + $out = rtrim($out, '/'); } return $out; } @@ -250,16 +250,16 @@ public function upload($remote, $local, $dirMode = 0777, $ftpMode = FTP_BINARY) throw new Exception("Directory given instead of file: {$local}"); } - $globalPathMode = substr($remote, 0, 1) == "/"; + $globalPathMode = substr($remote, 0, 1) == '/'; $dirname = dirname($remote); $cwd = $this->getcwd(); if (false === $cwd) { - throw new Exception("Server returns something awful on PWD command"); + throw new Exception('Server returns something awful on PWD command'); } if (!$globalPathMode) { - $dirname = $cwd . "/" . $dirname; - $remote = $cwd . "/" . $remote; + $dirname = $cwd . '/' . $dirname; + $remote = $cwd . '/' . $remote; } $res = $this->mkdirRecursive($dirname, $dirMode); $this->chdir($cwd); @@ -380,7 +380,7 @@ public function get($localFile, $remoteFile, $fileMode = FTP_BINARY, $resumeOffs * * @SuppressWarnings(PHPMD.ErrorControlOperator) */ - public function nlist($dir = "/") + public function nlist($dir = '/') { $this->checkConnected(); $dir = $this->correctFilePath($dir); @@ -396,7 +396,7 @@ public function nlist($dir = "/") * * @SuppressWarnings(PHPMD.ErrorControlOperator) */ - public function rawlist($dir = "/", $recursive = false) + public function rawlist($dir = '/', $recursive = false) { $this->checkConnected(); $dir = $this->correctFilePath($dir); @@ -440,10 +440,10 @@ public static function chmodnum($chmod) public function fileExists($path, $excludeIfIsDir = true) { $path = $this->correctFilePath($path); - $globalPathMode = substr($path, 0, 1) == "/"; + $globalPathMode = substr($path, 0, 1) == '/'; $file = basename($path); - $dir = $globalPathMode ? dirname($path) : $this->getcwd() . "/" . $path; + $dir = $globalPathMode ? dirname($path) : $this->getcwd() . '/' . $path; $data = $this->ls($dir); foreach ($data as $row) { if ($file == $row['name']) { @@ -463,7 +463,7 @@ public function fileExists($path, $excludeIfIsDir = true) * @param bool $recursive * @return array */ - public function ls($dir = "/", $recursive = false) + public function ls($dir = '/', $recursive = false) { $dir = $this->correctFilePath($dir); $rawfiles = (array) $this->rawlist($dir, $recursive); @@ -504,8 +504,8 @@ public function ls($dir = "/", $recursive = false) */ public function correctFilePath($str) { - $str = str_replace("\\", "/", $str); - $str = preg_replace("/^.\//", "", $str); + $str = str_replace('\\', '/', $str); + $str = preg_replace("/^.\//", '', $str); return $str; } diff --git a/lib/Magento/Db/Sql/Trigger.php b/lib/Magento/Db/Sql/Trigger.php index c2426b15d1f..5ca9af0fbdf 100644 --- a/lib/Magento/Db/Sql/Trigger.php +++ b/lib/Magento/Db/Sql/Trigger.php @@ -288,10 +288,10 @@ public function getBody() public function assemble() { $this->_validateIsComplete(); - return "CREATE TRIGGER " + return 'CREATE TRIGGER ' . $this->getName() . "\n" - . $this->_parts[self::TIME] . " " . $this->_parts[self::EVENT] . "\n" - . "ON " . $this->_parts[self::TARGET] . " " . $this->_parts[self::SCOPE] . "\n" + . $this->_parts[self::TIME] . ' ' . $this->_parts[self::EVENT] . "\n" + . 'ON ' . $this->_parts[self::TARGET] . ' ' . $this->_parts[self::SCOPE] . "\n" . "BEGIN\n" . implode("\n", $this->_parts[self::BODY]) . "\n" . "END;\n"; diff --git a/lib/Varien/Cache/Backend/Memcached.php b/lib/Varien/Cache/Backend/Memcached.php index a1dbc9a403b..b67c7c4c0f8 100644 --- a/lib/Varien/Cache/Backend/Memcached.php +++ b/lib/Varien/Cache/Backend/Memcached.php @@ -42,7 +42,7 @@ public function __construct(array $options = []) if (!isset($options['slab_size']) || !is_numeric($options['slab_size'])) { if (isset($options['slab_size'])) { - throw new Varien_Exception("Invalid value for the node <slab_size>. Expected to be positive integer."); + throw new Varien_Exception('Invalid value for the node <slab_size>. Expected to be positive integer.'); } $this->_options['slab_size'] = self::DEFAULT_SLAB_SIZE; diff --git a/lib/Varien/Cache/Core.php b/lib/Varien/Cache/Core.php index ac1f61166e8..f61973ad7c8 100644 --- a/lib/Varien/Cache/Core.php +++ b/lib/Varien/Cache/Core.php @@ -37,7 +37,7 @@ public function __construct($options = []) { parent::__construct($options); if (!is_numeric($this->getOption('slab_size'))) { - throw new Varien_Exception("Invalid value for the node <slab_size>. Expected to be integer."); + throw new Varien_Exception('Invalid value for the node <slab_size>. Expected to be integer.'); } } diff --git a/lib/Varien/Convert/Container/Abstract.php b/lib/Varien/Convert/Container/Abstract.php index 242472caee6..38dbea0e989 100644 --- a/lib/Varien/Convert/Container/Abstract.php +++ b/lib/Varien/Convert/Container/Abstract.php @@ -83,7 +83,7 @@ public function validateDataString($data = null) $data = $this->getData(); } if (!is_string($data)) { - $this->addException("Invalid data type, expecting string.", Varien_Convert_Exception::FATAL); + $this->addException('Invalid data type, expecting string.', Varien_Convert_Exception::FATAL); } return true; } @@ -94,7 +94,7 @@ public function validateDataArray($data = null) $data = $this->getData(); } if (!is_array($data)) { - $this->addException("Invalid data type, expecting array.", Varien_Convert_Exception::FATAL); + $this->addException('Invalid data type, expecting array.', Varien_Convert_Exception::FATAL); } return true; } @@ -108,7 +108,7 @@ public function validateDataGrid($data = null) if (count($data) == 0) { return true; } - $this->addException("Invalid data type, expecting 2D grid array.", Varien_Convert_Exception::FATAL); + $this->addException('Invalid data type, expecting 2D grid array.', Varien_Convert_Exception::FATAL); } return true; } diff --git a/lib/Varien/Convert/Parser/Xml/Excel.php b/lib/Varien/Convert/Parser/Xml/Excel.php index 4b8ecd8036d..0f1399c2ccd 100644 --- a/lib/Varien/Convert/Parser/Xml/Excel.php +++ b/lib/Varien/Convert/Parser/Xml/Excel.php @@ -199,9 +199,9 @@ public function getRowXml(array $row) $this->_xmlElement->row = htmlspecialchars($value); $value = str_replace($xmlHeader, '', $this->_xmlElement->asXML()); $value = preg_replace($xmlRegexp, '\\1', $value); - $dataType = "String"; + $dataType = 'String'; if (is_numeric($value)) { - $dataType = "Number"; + $dataType = 'Number'; // is_numeric(' 96000') returns true, but Excel argues about space $value = trim($value); } diff --git a/lib/Varien/Convert/Profile/Abstract.php b/lib/Varien/Convert/Profile/Abstract.php index dfd2d76a856..c7554d6e80e 100644 --- a/lib/Varien/Convert/Profile/Abstract.php +++ b/lib/Varien/Convert/Profile/Abstract.php @@ -93,7 +93,7 @@ public function addException(Varien_Convert_Exception $e) public function run() { if (!$this->_actions) { - $e = new Varien_Convert_Exception("Could not find any actions for this profile"); + $e = new Varien_Convert_Exception('Could not find any actions for this profile'); $e->setLevel(Varien_Convert_Exception::FATAL); $this->addException($e); return; diff --git a/lib/Varien/Data/Collection/Db.php b/lib/Varien/Data/Collection/Db.php index a35fc1ecd7f..a78999460fc 100644 --- a/lib/Varien/Data/Collection/Db.php +++ b/lib/Varien/Data/Collection/Db.php @@ -236,7 +236,7 @@ public function getSelectCountSql() $group = array_map(function ($token) { return $this->getSelect()->getAdapter()->quoteIdentifier($token, true); }, $group); - $countSelect->columns("COUNT(DISTINCT " . implode(", ", $group) . ")"); + $countSelect->columns('COUNT(DISTINCT ' . implode(', ', $group) . ')'); } else { $countSelect->columns('COUNT(*)'); diff --git a/lib/Varien/Data/Form/Element/Editor.php b/lib/Varien/Data/Form/Element/Editor.php index 43d40074109..3656de319fc 100644 --- a/lib/Varien/Data/Form/Element/Editor.php +++ b/lib/Varien/Data/Form/Element/Editor.php @@ -194,7 +194,7 @@ protected function _getPluginButtonsHtml($visible = true) if ($this->getConfig('add_widgets')) { $buttonsHtml .= $this->_getButtonHtml([ 'title' => $this->translate('Insert Widget...'), - 'onclick' => "widgetTools.openDialog('" . $this->getConfig('widget_window_url') . "widget_target_id/" + 'onclick' => "widgetTools.openDialog('" . $this->getConfig('widget_window_url') . 'widget_target_id/' . $this->getHtmlId() . "')", 'class' => 'add-widget plugin', 'style' => $visible ? '' : 'display:none', @@ -207,7 +207,7 @@ protected function _getPluginButtonsHtml($visible = true) 'title' => $this->translate('Insert Image...'), 'onclick' => "MediabrowserUtility.openDialog('" . $this->getConfig('files_browser_window_url') . - "target_element_id/" . $this->getHtmlId() . "/" . + 'target_element_id/' . $this->getHtmlId() . '/' . ((null !== $this->getConfig('store_id')) ? ('store/' . $this->getConfig('store_id') . '/') : '') . diff --git a/lib/Varien/Data/Form/Element/Textarea.php b/lib/Varien/Data/Form/Element/Textarea.php index 23108c984d3..98f4ec32e48 100644 --- a/lib/Varien/Data/Form/Element/Textarea.php +++ b/lib/Varien/Data/Form/Element/Textarea.php @@ -53,7 +53,7 @@ public function getElementHtml() $this->addClass('textarea'); $html = '<textarea id="' . $this->getHtmlId() . '" name="' . $this->getName() . '" ' . $this->serialize($this->getHtmlAttributes()) . ' >'; $html .= $this->getEscapedValue(); - $html .= "</textarea>"; + $html .= '</textarea>'; $html .= $this->getAfterElementHtml(); return $html; } diff --git a/lib/Varien/Db/Adapter/Pdo/Mysql.php b/lib/Varien/Db/Adapter/Pdo/Mysql.php index 93412dad7c6..1e8d20bafca 100644 --- a/lib/Varien/Db/Adapter/Pdo/Mysql.php +++ b/lib/Varien/Db/Adapter/Pdo/Mysql.php @@ -277,7 +277,7 @@ public function getTransactionLevel() * Convert date to DB format * * @param int|string|Zend_Date $date - * @return string + * @return Zend_Db_Expr */ public function convertDate($date) { @@ -288,11 +288,11 @@ public function convertDate($date) * Convert date and time to DB format * * @param int|string|Zend_Date $datetime - * @return string + * @return Zend_Db_Expr */ public function convertDateTime($datetime) { - return $this->formatDate($datetime, true); + return $this->formatDate($datetime); } /** @@ -580,13 +580,13 @@ public function proccessBindCallback($matches) protected function _unQuote($string) { $translate = [ - "\\000" => "\000", - "\\n" => "\n", - "\\r" => "\r", - "\\\\" => "\\", + '\\000' => "\000", + '\\n' => "\n", + '\\r' => "\r", + '\\\\' => '\\', "\'" => "'", - "\\\"" => "\"", - "\\032" => "\032" + '\\"' => '"', + '\\032' => "\032" ]; return strtr($string, $translate); } @@ -828,7 +828,7 @@ public function purgeOrphanRecords( || $onDelete == Varien_Db_Adapter_Interface::FK_ACTION_RESTRICT ) { $sql = sprintf( - "DELETE p.* FROM %s AS p LEFT JOIN %s AS r ON p.%s = r.%s WHERE r.%s IS NULL", + 'DELETE p.* FROM %s AS p LEFT JOIN %s AS r ON p.%s = r.%s WHERE r.%s IS NULL', $this->quoteIdentifier($tableName), $this->quoteIdentifier($refTableName), $this->quoteIdentifier($columnName), @@ -838,7 +838,7 @@ public function purgeOrphanRecords( $this->raw_query($sql); } elseif ($onDelete == Varien_Db_Adapter_Interface::FK_ACTION_SET_NULL) { $sql = sprintf( - "UPDATE %s AS p LEFT JOIN %s AS r ON p.%s = r.%s SET p.%s = NULL WHERE r.%s IS NULL", + 'UPDATE %s AS p LEFT JOIN %s AS r ON p.%s = r.%s SET p.%s = NULL WHERE r.%s IS NULL', $this->quoteIdentifier($tableName), $this->quoteIdentifier($refTableName), $this->quoteIdentifier($columnName), @@ -931,7 +931,7 @@ public function addColumn($tableName, $columnName, $definition, $schemaName = nu if (is_array($definition)) { $definition = array_change_key_case($definition, CASE_UPPER); if (empty($definition['COMMENT'])) { - throw new Zend_Db_Exception("Impossible to create a column without comment."); + throw new Zend_Db_Exception('Impossible to create a column without comment.'); } if (!empty($definition['PRIMARY'])) { $primaryKey = sprintf(', ADD PRIMARY KEY (%s)', $this->quoteIdentifier($columnName)); @@ -2194,7 +2194,7 @@ public function insertIgnore($table, array $bind) } // build the statement - $sql = "INSERT IGNORE INTO " + $sql = 'INSERT IGNORE INTO ' . $this->quoteIdentifier($table, true) . ' (' . implode(', ', $cols) . ') ' . 'VALUES (' . implode(', ', $vals) . ')'; @@ -2252,7 +2252,7 @@ public function createTable(Varien_Db_Ddl_Table $table) $columns = $table->getColumns(); foreach ($columns as $columnEntry) { if (empty($columnEntry['COMMENT'])) { - throw new Zend_Db_Exception("Cannot create table without columns comments"); + throw new Zend_Db_Exception('Cannot create table without columns comments'); } } @@ -2266,7 +2266,7 @@ public function createTable(Varien_Db_Ddl_Table $table) "CREATE TABLE %s (\n%s\n) %s", $this->quoteIdentifier($table->getName()), implode(",\n", $sqlFragment), - implode(" ", $tableOptions) + implode(' ', $tableOptions) ); return $this->query($sql); @@ -2291,7 +2291,7 @@ public function createTemporaryTable(Varien_Db_Ddl_Table $table) "CREATE TEMPORARY TABLE %s (\n%s\n) %s", $this->quoteIdentifier($table->getName()), implode(",\n", $sqlFragment), - implode(" ", $tableOptions) + implode(' ', $tableOptions) ); return $this->query($sql); @@ -2951,7 +2951,7 @@ public function formatDate($date, $includeTime = true) public function startSetup() { $this->raw_query("SET SQL_MODE=''"); - $this->raw_query("SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0"); + $this->raw_query('SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0'); $this->raw_query("SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO'"); return $this; @@ -2965,7 +2965,7 @@ public function startSetup() public function endSetup() { $this->raw_query("SET SQL_MODE=IFNULL(@OLD_SQL_MODE,'')"); - $this->raw_query("SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS=0, 0, 1)"); + $this->raw_query('SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS=0, 0, 1)'); return $this; } @@ -3003,23 +3003,23 @@ public function endSetup() public function prepareSqlCondition($fieldName, $condition) { $conditionKeyMap = [ - 'eq' => "{{fieldName}} = ?", - 'neq' => "{{fieldName}} != ?", - 'like' => "{{fieldName}} LIKE ?", - 'nlike' => "{{fieldName}} NOT LIKE ?", - 'in' => "{{fieldName}} IN(?)", - 'nin' => "{{fieldName}} NOT IN(?)", - 'is' => "{{fieldName}} IS ?", - 'notnull' => "{{fieldName}} IS NOT NULL", - 'null' => "{{fieldName}} IS NULL", - 'gt' => "{{fieldName}} > ?", - 'lt' => "{{fieldName}} < ?", - 'gteq' => "{{fieldName}} >= ?", - 'lteq' => "{{fieldName}} <= ?", - 'finset' => "FIND_IN_SET(?, {{fieldName}})", - 'regexp' => "{{fieldName}} REGEXP ?", - 'from' => "{{fieldName}} >= ?", - 'to' => "{{fieldName}} <= ?", + 'eq' => '{{fieldName}} = ?', + 'neq' => '{{fieldName}} != ?', + 'like' => '{{fieldName}} LIKE ?', + 'nlike' => '{{fieldName}} NOT LIKE ?', + 'in' => '{{fieldName}} IN(?)', + 'nin' => '{{fieldName}} NOT IN(?)', + 'is' => '{{fieldName}} IS ?', + 'notnull' => '{{fieldName}} IS NOT NULL', + 'null' => '{{fieldName}} IS NULL', + 'gt' => '{{fieldName}} > ?', + 'lt' => '{{fieldName}} < ?', + 'gteq' => '{{fieldName}} >= ?', + 'lteq' => '{{fieldName}} <= ?', + 'finset' => 'FIND_IN_SET(?, {{fieldName}})', + 'regexp' => '{{fieldName}} REGEXP ?', + 'from' => '{{fieldName}} >= ?', + 'to' => '{{fieldName}} <= ?', 'seq' => null, 'sneq' => null ]; @@ -3189,9 +3189,9 @@ public function prepareColumnValue(array $column, $value) public function getCheckSql($expression, $true, $false) { if ($expression instanceof Zend_Db_Expr || $expression instanceof Zend_Db_Select) { - $expression = sprintf("IF((%s), %s, %s)", $expression, $true, $false); + $expression = sprintf('IF((%s), %s, %s)', $expression, $true, $false); } else { - $expression = sprintf("IF(%s, %s, %s)", $expression, $true, $false); + $expression = sprintf('IF(%s, %s, %s)', $expression, $true, $false); } return new Zend_Db_Expr($expression); @@ -3207,9 +3207,9 @@ public function getCheckSql($expression, $true, $false) public function getIfNullSql($expression, $value = '0') { if ($expression instanceof Zend_Db_Expr || $expression instanceof Zend_Db_Select) { - $expression = sprintf("IFNULL((%s), %s)", $expression, $value); + $expression = sprintf('IFNULL((%s), %s)', $expression, $value); } else { - $expression = sprintf("IFNULL(%s, %s)", $expression, $value); + $expression = sprintf('IFNULL(%s, %s)', $expression, $value); } return new Zend_Db_Expr($expression); diff --git a/lib/Varien/Debug.php b/lib/Varien/Debug.php index 7a772a5c120..367b29e63fc 100644 --- a/lib/Varien/Debug.php +++ b/lib/Varien/Debug.php @@ -153,7 +153,7 @@ protected static function _formatCalledArgument($arg) { $out = ''; if (is_object($arg)) { - $out .= sprintf("&%s#%s#", get_class($arg), spl_object_hash($arg)); + $out .= sprintf('&%s#%s#', get_class($arg), spl_object_hash($arg)); } elseif (is_resource($arg)) { $out .= '#[' . get_resource_type($arg) . ']'; } elseif (is_array($arg)) { @@ -180,7 +180,7 @@ protected static function _formatCalledArgument($arg) $out .= $arg; } elseif (is_string($arg)) { if (strlen($arg) > self::$argLength) { - $arg = substr($arg, 0, self::$argLength) . "..."; + $arg = substr($arg, 0, self::$argLength) . '...'; } $arg = strtr($arg, ["\t" => '\t', "\r" => '\r', "\n" => '\n', "'" => '\\\'']); $out .= "'" . $arg . "'"; diff --git a/lib/Varien/Directory/Collection.php b/lib/Varien/Directory/Collection.php index a531cf07b4e..f24d0c115b6 100644 --- a/lib/Varien/Directory/Collection.php +++ b/lib/Varien/Directory/Collection.php @@ -145,7 +145,7 @@ public function lastDir() */ public static function getLastDir($path) { - $last = strrpos($path, "/"); + $last = strrpos($path, '/'); return substr($path, $last + 1); } /** diff --git a/lib/Varien/Directory/Factory.php b/lib/Varien/Directory/Factory.php index 83025ee94ac..8231eb6c622 100644 --- a/lib/Varien/Directory/Factory.php +++ b/lib/Varien/Directory/Factory.php @@ -20,8 +20,8 @@ * @package Varien_Directory */ -require_once("Varien/Directory/Collection.php"); -require_once("Varien/File/Object.php"); +require_once('Varien/Directory/Collection.php'); +require_once('Varien/File/Object.php'); class Varien_Directory_Factory { diff --git a/lib/Varien/File/Object.php b/lib/Varien/File/Object.php index 48e10b8db2f..55dab25cbae 100644 --- a/lib/Varien/File/Object.php +++ b/lib/Varien/File/Object.php @@ -20,7 +20,7 @@ * @package Varien_File */ -require_once("Varien/Object.php"); +require_once('Varien/Object.php'); require_once('Varien/Directory/IFactory.php'); class Varien_File_Object extends SplFileObject implements IFactory @@ -180,8 +180,8 @@ public function getExtension() public static function getExt($fileName) { $path_parts = pathinfo($fileName); - if (isset($path_parts["extension"])) { - return $path_parts["extension"]; + if (isset($path_parts['extension'])) { + return $path_parts['extension']; } else { return ''; } diff --git a/lib/Varien/File/Transfer/Adapter/Http.php b/lib/Varien/File/Transfer/Adapter/Http.php index 63e6c3755f7..bac95988909 100644 --- a/lib/Varien/File/Transfer/Adapter/Http.php +++ b/lib/Varien/File/Transfer/Adapter/Http.php @@ -78,7 +78,7 @@ public function send($options = null) } elseif (is_array($options)) { $filepath = $options['filepath']; } else { - throw new Exception("Filename is not set."); + throw new Exception('Filename is not set.'); } if (!is_file($filepath) || !is_readable($filepath)) { diff --git a/lib/Varien/File/Uploader/Image.php b/lib/Varien/File/Uploader/Image.php index c2a6f0ae91c..6402884e482 100644 --- a/lib/Varien/File/Uploader/Image.php +++ b/lib/Varien/File/Uploader/Image.php @@ -74,7 +74,7 @@ public function rotate($degrees = null) * @access public * @param string $type */ - public function flip($type = "h") + public function flip($type = 'h') { $this->uploader->image_flip = $type; } @@ -115,7 +115,7 @@ public function crop($crop = 0) * Default value is 'jpeg' * */ - public function convert($format = "jpeg") + public function convert($format = 'jpeg') { $this->uploader->image_convert = $format; } @@ -147,7 +147,7 @@ public function convert($format = "jpeg") * If a negative value is used, it will represent the distance between the right of the image and the watermark * */ - public function addWatermark($fileName = null, $position = "BL", $absoluteX = null, $absoluteY = null) + public function addWatermark($fileName = null, $position = 'BL', $absoluteX = null, $absoluteY = null) { if (!isset($fileName)) { return; @@ -178,7 +178,7 @@ public function addWatermark($fileName = null, $position = "BL", $absoluteX = nu * Value is an integer between 0 (no opacity) and 100 (full opacity). * */ - public function addReflection($height = "10%", $space = 0, $color = "#FFFFFF", $opacity = 60) + public function addReflection($height = '10%', $space = 0, $color = '#FFFFFF', $opacity = 60) { if ((int) $height == 0) { return; @@ -195,9 +195,9 @@ public function addReflection($height = "10%", $space = 0, $color = "#FFFFFF", $ * * Value is a string, any text. Text will not word-wrap, although you can use breaklines in your text "\n" */ - public function addText($string = "") + public function addText($string = '') { - if (trim($string) == "") { + if (trim($string) == '') { return; } @@ -234,7 +234,7 @@ public function setTextFont($font) $this->uploader->image_text_font = $font; } - public function setTextPosition($position = "TR") + public function setTextPosition($position = 'TR') { $this->uploader->image_text_position = $position; } @@ -299,7 +299,7 @@ public function colorInvert() * $percent value is a percentage, as an integer between 0 and 100 * */ - public function colorOverlay($color = "#FFFFFF", $percent = 50) + public function colorOverlay($color = '#FFFFFF', $percent = 50) { $this->uploader->image_overlay_color = $color; $this->uploader->image_overlay_percent = $percent; @@ -345,7 +345,7 @@ public function setJpegQuality($value = 85) * Is generally used when cropping an image with negative margins * */ - public function setBgColor($color = "#000000") + public function setBgColor($color = '#000000') { $this->uploader->image_background_color = $color; } diff --git a/lib/Varien/Filter/Template.php b/lib/Varien/Filter/Template.php index 45df4772644..a58c90c0ad4 100644 --- a/lib/Varien/Filter/Template.php +++ b/lib/Varien/Filter/Template.php @@ -272,7 +272,7 @@ protected function _getIncludeParameters($value) */ protected function _getVariable($value, $default = '{no_value_defined}') { - Varien_Profiler::start("email_template_proccessing_variables"); + Varien_Profiler::start('email_template_proccessing_variables'); $tokenizer = new Varien_Filter_Template_Tokenizer_Variable(); $tokenizer->setString($value); $stackVars = $tokenizer->tokenize(); @@ -314,7 +314,7 @@ protected function _getVariable($value, $default = '{no_value_defined}') // If value for construction exists set it $result = $stackVars[$last]['variable']; } - Varien_Profiler::stop("email_template_proccessing_variables"); + Varien_Profiler::stop('email_template_proccessing_variables'); return $result; } diff --git a/lib/Varien/Image/Adapter/Gd2.php b/lib/Varien/Image/Adapter/Gd2.php index 8f99a6c9cab..791c16e9c27 100644 --- a/lib/Varien/Image/Adapter/Gd2.php +++ b/lib/Varien/Image/Adapter/Gd2.php @@ -15,7 +15,7 @@ class Varien_Image_Adapter_Gd2 extends Varien_Image_Adapter_Abstract { - protected $_requiredExtensions = ["gd"]; + protected $_requiredExtensions = ['gd']; private static $_callbacks = [ IMAGETYPE_WEBP => ['output' => 'imagewebp', 'create' => 'imagecreatefromwebp'], IMAGETYPE_GIF => ['output' => 'imagegif', 'create' => 'imagecreatefromgif'], @@ -129,13 +129,13 @@ public function save($destination = null, $newName = null) $fileName = (!isset($destination)) ? $this->_fileName : $destination; if (isset($destination) && isset($newName)) { - $fileName = $destination . "/" . $newName; + $fileName = $destination . '/' . $newName; } elseif (isset($destination) && !isset($newName)) { $info = pathinfo($destination); $fileName = $destination; $destination = $info['dirname']; } elseif (!isset($destination) && isset($newName)) { - $fileName = $this->_fileSrcPath . "/" . $newName; + $fileName = $this->_fileSrcPath . '/' . $newName; } else { $fileName = $this->_fileSrcPath . $this->_fileSrcName; } @@ -209,7 +209,7 @@ public function save($destination = null, $newName = null) public function display() { - header("Content-type: " . $this->getMimeTypeWithOutFileType()); + header('Content-type: ' . $this->getMimeTypeWithOutFileType()); call_user_func($this->_getCallback('output'), $this->_imageHandler); } diff --git a/lib/Varien/Io/Abstract.php b/lib/Varien/Io/Abstract.php index 09dd9663db9..f7ee9410433 100644 --- a/lib/Varien/Io/Abstract.php +++ b/lib/Varien/Io/Abstract.php @@ -63,9 +63,9 @@ public function getCleanPath($path) return './'; } - $path = trim(preg_replace("/\\\\/", "/", (string)$path)); + $path = trim(preg_replace('/\\\\/', '/', (string)$path)); - if (!preg_match("/(\.\w{1,4})$/", $path) && !preg_match("/\?[^\\/]+$/", $path) && !preg_match("/\\/$/", $path)) { + if (!preg_match("/(\.\w{1,4})$/", $path) && !preg_match("/\?[^\\/]+$/", $path) && !preg_match('/\\/$/', $path)) { $path .= '/'; } @@ -76,16 +76,16 @@ public function getCleanPath($path) $pathTokR = $matches[0][1]; $pathTokP = $matches[0][2]; - $pathTokP = preg_replace(["/^\\/+/", "/\\/+/"], ["", "/"], $pathTokP); + $pathTokP = preg_replace(['/^\\/+/', '/\\/+/'], ['', '/'], $pathTokP); - $pathParts = explode("/", $pathTokP); + $pathParts = explode('/', $pathTokP); $realPathParts = []; for ($i = 0, $realPathParts = []; $i < count($pathParts); $i++) { if ($pathParts[$i] == '.') { continue; } elseif ($pathParts[$i] == '..') { - if ((isset($realPathParts[0]) && $realPathParts[0] != '..') || ($pathTokR != "")) { + if ((isset($realPathParts[0]) && $realPathParts[0] != '..') || ($pathTokR != '')) { array_pop($realPathParts); continue; } diff --git a/lib/Varien/Io/File.php b/lib/Varien/Io/File.php index 30a71a6444e..ca8658391fb 100644 --- a/lib/Varien/Io/File.php +++ b/lib/Varien/Io/File.php @@ -409,7 +409,7 @@ public static function rmdirRecursive($dir, $recursive = true) if (!strcmp($item, '.') || !strcmp($item, '..')) { continue; } - self::rmdirRecursive($dir . "/" . $item, $recursive); + self::rmdirRecursive($dir . '/' . $item, $recursive); } $result = @rmdir($dir); } elseif (file_exists($dir)) { @@ -898,13 +898,13 @@ protected function _parsePermissions($mode) /* Adjust for SUID, SGID and sticky bit */ if ($mode & 0x800) { - $owner["execute"] = ($owner['execute'] == 'x') ? 's' : 'S'; + $owner['execute'] = ($owner['execute'] == 'x') ? 's' : 'S'; } if ($mode & 0x400) { - $group["execute"] = ($group['execute'] == 'x') ? 's' : 'S'; + $group['execute'] = ($group['execute'] == 'x') ? 's' : 'S'; } if ($mode & 0x200) { - $world["execute"] = ($world['execute'] == 'x') ? 't' : 'T'; + $world['execute'] = ($world['execute'] == 'x') ? 't' : 'T'; } $s = sprintf('%1s', $type); diff --git a/lib/Varien/Io/Sftp.php b/lib/Varien/Io/Sftp.php index 6c71da2c54b..024140880b1 100644 --- a/lib/Varien/Io/Sftp.php +++ b/lib/Varien/Io/Sftp.php @@ -53,7 +53,7 @@ public function open(array $args = []) } $this->_connection = new \phpseclib3\Net\SFTP($host, $port, $args['timeout']); if (!$this->_connection->login($args['username'], $args['password'])) { - throw new Exception(sprintf(__("Unable to open SFTP connection as %s@%s", $args['username'], $args['host']))); + throw new Exception(sprintf(__('Unable to open SFTP connection as %s@%s', $args['username'], $args['host']))); } } diff --git a/lib/Varien/Object.php b/lib/Varien/Object.php index 968d5b0fc02..292708805c0 100644 --- a/lib/Varien/Object.php +++ b/lib/Varien/Object.php @@ -635,7 +635,7 @@ public function __call($method, $args) //Varien_Profiler::stop('HAS: '.get_class($this).'::'.$method); return isset($this->_data[$key]); } - throw new Varien_Exception("Invalid method " . get_class($this) . "::" . $method . "(" . print_r($args, 1) . ")"); + throw new Varien_Exception('Invalid method ' . get_class($this) . '::' . $method . '(' . print_r($args, 1) . ')'); } /** @@ -690,7 +690,7 @@ protected function _underscore($name) return self::$_underscoreCache[$name]; } #Varien_Profiler::start('underscore'); - $result = strtolower(preg_replace('/([A-Z])/', "_$1", lcfirst($name))); + $result = strtolower(preg_replace('/([A-Z])/', '_$1', lcfirst($name))); #Varien_Profiler::stop('underscore'); self::$_underscoreCache[$name] = $result; return $result; diff --git a/lib/Varien/Profiler.php b/lib/Varien/Profiler.php index 0153bbc9bcc..e2308ff6201 100644 --- a/lib/Varien/Profiler.php +++ b/lib/Varien/Profiler.php @@ -162,11 +162,11 @@ public static function getSqlProfiler($res) } } - $out .= 'Executed ' . $queryCount . ' queries in ' . $totalTime . ' seconds' . "<br>"; - $out .= 'Average query length: ' . $totalTime / $queryCount . ' seconds' . "<br>"; - $out .= 'Queries per second: ' . $queryCount / $totalTime . "<br>"; - $out .= 'Longest query length: ' . $longestTime . "<br>"; - $out .= 'Longest query: <br>' . $longestQuery . "<hr>"; + $out .= 'Executed ' . $queryCount . ' queries in ' . $totalTime . ' seconds' . '<br>'; + $out .= 'Average query length: ' . $totalTime / $queryCount . ' seconds' . '<br>'; + $out .= 'Queries per second: ' . $queryCount / $totalTime . '<br>'; + $out .= 'Longest query length: ' . $longestTime . '<br>'; + $out .= 'Longest query: <br>' . $longestQuery . '<hr>'; } return $out; } diff --git a/lib/Varien/Simplexml/Config.php b/lib/Varien/Simplexml/Config.php index 12f1a424805..ef4f5aeebc8 100644 --- a/lib/Varien/Simplexml/Config.php +++ b/lib/Varien/Simplexml/Config.php @@ -72,7 +72,7 @@ class Varien_Simplexml_Config * * @example <allResources extends="/config/modules//resource"/> */ - protected $_xpathExtends = "//*[@extends]"; + protected $_xpathExtends = '//*[@extends]'; /** * Constructor diff --git a/lib/Varien/Simplexml/Element.php b/lib/Varien/Simplexml/Element.php index 6f19de595ee..e07d39e6b77 100644 --- a/lib/Varien/Simplexml/Element.php +++ b/lib/Varien/Simplexml/Element.php @@ -128,7 +128,7 @@ public function addChild($name, $value=null, $namespace=null) * @todo Do we need to make it xpath look-a-like? * @todo Check if we still need all this and revert to plain XPath if this makes any sense * @todo param string $path Subset of xpath. Example: "child/grand[@attrName='attrValue']/subGrand" - * @param string $path Example: "child/grand@attrName=attrValue/subGrand" (to make it faster without regex) + * @param array|string $path Example: "child/grand@attrName=attrValue/subGrand" (to make it faster without regex) * @return Varien_Simplexml_Element|false */ public function descend($path) @@ -141,10 +141,10 @@ public function descend($path) // Simple exploding by / does not suffice, // as an attribute value may contain a / inside // Note that there are three matches for different kinds of attribute values specification - if (strpos($path, "@") === false) { + if (strpos($path, '@') === false) { $pathArr = explode('/', $path); } else { - $regex = "#([^@/\\\"]+(?:@[^=/]+=(?:\\\"[^\\\"]*\\\"|[^/]*))?)/?#"; + $regex = '#([^@/\\"]+(?:@[^=/]+=(?:\\"[^\\"]*\\"|[^/]*))?)/?#'; $pathArr = $pathMatches = []; if (preg_match_all($regex, $path, $pathMatches)) { $pathArr = $pathMatches[1]; diff --git a/phpstan.dist.baseline.neon b/phpstan.dist.baseline.neon index 52c437a2709..128b912c3b8 100644 --- a/phpstan.dist.baseline.neon +++ b/phpstan.dist.baseline.neon @@ -480,16 +480,6 @@ parameters: count: 1 path: app/code/core/Mage/Adminhtml/Model/Config/Data.php - - - message: "#^Method Mage_Adminhtml_Model_Config_Data\\:\\:getConfigRoot\\(\\) should return Mage_Core_Model_Config_Element but returns Varien_Simplexml_Element\\|false\\.$#" - count: 1 - path: app/code/core/Mage/Adminhtml/Model/Config/Data.php - - - - message: "#^Property Mage_Adminhtml_Model_Config_Data\\:\\:\\$_configRoot \\(Mage_Core_Model_Config_Element\\|null\\) does not accept Varien_Simplexml_Element\\|false\\.$#" - count: 1 - path: app/code/core/Mage/Adminhtml/Model/Config/Data.php - - message: "#^Method Mage_Eav_Model_Entity_Abstract\\:\\:load\\(\\) invoked with 1 parameter, 2\\-3 required\\.$#" count: 1 @@ -565,11 +555,6 @@ parameters: count: 1 path: app/code/core/Mage/Adminhtml/controllers/Customer/Wishlist/Product/Composite/WishlistController.php - - - message: "#^Call to an undefined method Varien_Simplexml_Element\\:\\:getClassName\\(\\)\\.$#" - count: 1 - path: app/code/core/Mage/Adminhtml/controllers/IndexController.php - - message: "#^Variable \\$id in isset\\(\\) always exists and is not nullable\\.$#" count: 1 @@ -2170,11 +2155,6 @@ parameters: count: 1 path: app/code/core/Mage/Checkout/controllers/OnepageController.php - - - message: "#^Method Mage_Cms_Model_Wysiwyg_Images_Storage\\:\\:getConfig\\(\\) should return Mage_Core_Model_Config_Element but returns Varien_Simplexml_Element\\|false\\.$#" - count: 1 - path: app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage.php - - message: "#^Method Mage_Eav_Model_Entity_Attribute_Source_Interface\\:\\:getAllOptions\\(\\) invoked with 2 parameters, 0 required\\.$#" count: 1 @@ -2185,11 +2165,6 @@ parameters: count: 2 path: app/code/core/Mage/ConfigurableSwatches/Model/Resource/Catalog/Product/Type/Configurable/Product/Collection.php - - - message: "#^Method Mage_Core_Block_Abstract\\:\\:_getUrlModel\\(\\) should return Mage_Core_Model_Url but returns Mage_Core_Model_Abstract\\|false\\.$#" - count: 1 - path: app/code/core/Mage/Core/Block/Abstract.php - - message: "#^Method Mage_Core_Block_Abstract\\:\\:getHelper\\(\\) should return \\$this\\(Mage_Core_Block_Abstract\\) but returns Mage_Core_Block_Abstract\\.$#" count: 1 @@ -2210,11 +2185,6 @@ parameters: count: 1 path: app/code/core/Mage/Core/Controller/Front/Router.php - - - message: "#^Call to an undefined method Varien_Simplexml_Element\\:\\:is\\(\\)\\.$#" - count: 1 - path: app/code/core/Mage/Core/Controller/Varien/Action.php - - message: "#^Constructor of class Mage_Core_Controller_Varien_Action has an unused parameter \\$invokeArgs\\.$#" count: 1 @@ -2285,11 +2255,6 @@ parameters: count: 1 path: app/code/core/Mage/Core/Helper/Abstract.php - - - message: "#^Property Mage_Core_Helper_String\\:\\:\\$_arrayHelper \\(Mage_Core_Helper_Array\\) does not accept Mage_Core_Helper_Abstract\\.$#" - count: 1 - path: app/code/core/Mage/Core/Helper/String.php - - message: "#^Property Mage_Core_Model_Abstract\\:\\:\\$_cacheTag \\(string\\|true\\) does not accept default value of type false\\.$#" count: 1 @@ -2330,28 +2295,13 @@ parameters: count: 1 path: app/code/core/Mage/Core/Model/Cache.php - - - message: "#^Call to an undefined method SimpleXMLElement\\:\\:getClassName\\(\\)\\.$#" - count: 1 - path: app/code/core/Mage/Core/Model/Config.php - - - - message: "#^Call to an undefined method Varien_Simplexml_Element\\:\\:getClassName\\(\\)\\.$#" - count: 2 - path: app/code/core/Mage/Core/Model/Config.php - - - - message: "#^Call to an undefined method Varien_Simplexml_Element\\:\\:is\\(\\)\\.$#" - count: 1 - path: app/code/core/Mage/Core/Model/Config.php - - message: "#^Method Mage_Core_Model_Config\\:\\:cleanCache\\(\\) should return \\$this\\(Mage_Core_Model_Config\\) but returns Mage_Core_Model_Config\\.$#" count: 1 path: app/code/core/Mage/Core/Model/Config.php - - message: "#^Method Mage_Core_Model_Config\\:\\:getNodeClassInstance\\(\\) should return bool but returns object\\.$#" + message: "#^Method Mage_Core_Model_Config\\:\\:getNode\\(\\) should return Mage_Core_Model_Config_Element but returns Varien_Simplexml_Element\\|false\\.$#" count: 1 path: app/code/core/Mage/Core/Model/Config.php @@ -2575,21 +2525,11 @@ parameters: count: 1 path: app/code/core/Mage/Core/Model/Resource/Iterator.php - - - message: "#^Call to an undefined method Varien_Simplexml_Element\\:\\:getClassName\\(\\)\\.$#" - count: 2 - path: app/code/core/Mage/Core/Model/Resource/Setup.php - - message: "#^Property Mage_Core_Model_Resource_Setup\\:\\:\\$_conn \\(Varien_Db_Adapter_Pdo_Mysql\\) does not accept Varien_Db_Adapter_Interface\\|false\\.$#" count: 1 path: app/code/core/Mage/Core/Model/Resource/Setup.php - - - message: "#^Property Mage_Core_Model_Resource_Setup\\:\\:\\$_moduleConfig \\(Mage_Core_Model_Config_Element\\) does not accept SimpleXMLElement\\.$#" - count: 1 - path: app/code/core/Mage/Core/Model/Resource/Setup.php - - message: "#^Property Mage_Core_Model_Resource_Setup\\:\\:\\$_resourceConfig \\(Mage_Core_Model_Config_Element\\) does not accept SimpleXMLElement\\.$#" count: 1 @@ -2625,11 +2565,6 @@ parameters: count: 1 path: app/code/core/Mage/Core/Model/Store.php - - - message: "#^Method Mage_Core_Model_Store\\:\\:formatPrice\\(\\) should return string but returns float\\.$#" - count: 1 - path: app/code/core/Mage/Core/Model/Store.php - - message: "#^PHPDoc type bool of property Mage_Core_Model_Store\\:\\:\\$_cacheTag is not covariant with PHPDoc type string\\|true of overridden property Mage_Core_Model_Abstract\\:\\:\\$_cacheTag\\.$#" count: 1 @@ -2675,16 +2610,6 @@ parameters: count: 1 path: app/code/core/Mage/Core/Model/Url/Rewrite/Request.php - - - message: "#^Function mageCoreErrorHandler\\(\\) never returns void so it can be removed from the return type\\.$#" - count: 1 - path: app/code/core/Mage/Core/functions.php - - - - message: "#^Function mageDebugBacktrace\\(\\) never returns void so it can be removed from the return type\\.$#" - count: 1 - path: app/code/core/Mage/Core/functions.php - - message: "#^Variable \\$arguments might not be defined\\.$#" count: 1 @@ -3560,11 +3485,6 @@ parameters: count: 1 path: app/code/core/Mage/Payment/Model/Method/Abstract.php - - - message: "#^Loose comparison using \\!\\= between ''\\|'OT' and 'SS' will always evaluate to true\\.$#" - count: 1 - path: app/code/core/Mage/Payment/Model/Method/Cc.php - - message: "#^Method Mage_Payment_Model_Recurring_Profile\\:\\:exportStartDatetime\\(\\) should return string\\|Zend_Date but empty return statement found\\.$#" count: 1 @@ -4195,11 +4115,6 @@ parameters: count: 3 path: app/code/core/Mage/Sales/Model/Quote/Address.php - - - message: "#^Call to an undefined method Varien_Simplexml_Element\\:\\:getClassName\\(\\)\\.$#" - count: 1 - path: app/code/core/Mage/Sales/Model/Quote/Address/Total/Collector.php - - message: "#^Return type \\(\\$this\\(Mage_Sales_Model_Quote_Address_Total_Discount\\)\\) of method Mage_Sales_Model_Quote_Address_Total_Discount\\:\\:fetch\\(\\) should be compatible with return type \\(array\\) of method Mage_Sales_Model_Quote_Address_Total_Abstract\\:\\:fetch\\(\\)$#" count: 1 @@ -4485,56 +4400,11 @@ parameters: count: 1 path: app/code/core/Mage/Sitemap/Model/Resource/Catalog/Abstract.php - - - message: "#^Method Mage_Tag_Model_Resource_Tag_Collection\\:\\:addPopularity\\(\\) invoked with 2 parameters, 0\\-1 required\\.$#" - count: 1 - path: app/code/core/Mage/Tag/Block/Customer/Tags.php - - - - message: "#^Method Mage_Tag_Block_Product_List\\:\\:_beforeToHtml\\(\\) should return \\$this\\(Mage_Tag_Block_Product_List\\) but returns false\\.$#" - count: 1 - path: app/code/core/Mage/Tag/Block/Product/List.php - - - - message: "#^Property Mage_Tag_Block_Product_Result\\:\\:\\$_productCollection \\(Mage_Tag_Model_Resource_Tag_Collection\\|null\\) does not accept Mage_Tag_Model_Resource_Product_Collection\\.$#" - count: 1 - path: app/code/core/Mage/Tag/Block/Product/Result.php - - - - message: "#^Variable \\$result might not be defined\\.$#" - count: 1 - path: app/code/core/Mage/Tag/Model/Api.php - - - - message: "#^Parameter \\#1 \\$data \\(object\\) of method Mage_Tag_Model_Api_V2\\:\\:_prepareDataForAdd\\(\\) should be compatible with parameter \\$data \\(array\\) of method Mage_Tag_Model_Api\\:\\:_prepareDataForAdd\\(\\)$#" - count: 1 - path: app/code/core/Mage/Tag/Model/Api/V2.php - - - - message: "#^Parameter \\#1 \\$data \\(object\\) of method Mage_Tag_Model_Api_V2\\:\\:_prepareDataForUpdate\\(\\) should be compatible with parameter \\$data \\(array\\) of method Mage_Tag_Model_Api\\:\\:_prepareDataForUpdate\\(\\)$#" - count: 1 - path: app/code/core/Mage/Tag/Model/Api/V2.php - - - - message: "#^Return type \\(object\\) of method Mage_Tag_Model_Api_V2\\:\\:info\\(\\) should be compatible with return type \\(array\\) of method Mage_Tag_Model_Api\\:\\:info\\(\\)$#" - count: 1 - path: app/code/core/Mage/Tag/Model/Api/V2.php - - message: "#^Access to an undefined property Mage_Tag_Model_Entity_Customer_Collection\\:\\:\\$_read\\.$#" count: 1 path: app/code/core/Mage/Tag/Model/Entity/Customer/Collection.php - - - message: "#^Variable \\$productsSku might not be defined\\.$#" - count: 1 - path: app/code/core/Mage/Tag/Model/Resource/Customer/Collection.php - - - - message: "#^Variable \\$result might not be defined\\.$#" - count: 1 - path: app/code/core/Mage/Tag/Model/Tag.php - - message: "#^Call to an undefined method Mage_Tax_Block_Sales_Order_Tax\\:\\:addTotal\\(\\)\\.$#" count: 7 diff --git a/phpstan.dist.neon b/phpstan.dist.neon index d82c837f678..c95f0f64594 100644 --- a/phpstan.dist.neon +++ b/phpstan.dist.neon @@ -50,9 +50,6 @@ parameters: - app/code/core/Mage/Paypal/Model/Report/Settlement.php - lib/Varien/Io/Sftp.php - # Class backup/db was not found while trying to analyse it - - app/code/core/Mage/Adminhtml/controllers/System/BackupController.php - # Dataflow/Model/Convert/Iterator.php - app/code/core/Mage/Dataflow/Model/Convert/Iterator.php @@ -70,6 +67,9 @@ parameters: checkFunctionNameCase: true checkInternalClassCaseSensitivity: true treatPhpDocTypesAsCertain: false - + # For v1.12+ with "bleeding edge" + ignoreErrors: + - + identifier: missingType.iterableValue # universalObjectCratesClasses: # - Varien_Object diff --git a/shell/indexer.php b/shell/indexer.php index 47d0494e4ca..929820ec06c 100644 --- a/shell/indexer.php +++ b/shell/indexer.php @@ -160,7 +160,7 @@ public function run() $resultTime = microtime(true) - $startTime; Mage::dispatchEvent($process->getIndexerCode() . '_shell_reindex_after'); echo $process->getIndexer()->getName() - . " index was rebuilt successfully in " . gmdate('H:i:s', ceil($resultTime)) . "\n"; + . ' index was rebuilt successfully in ' . gmdate('H:i:s', ceil($resultTime)) . "\n"; } catch (Mage_Core_Exception $e) { echo $e->getMessage() . "\n"; } catch (Exception $e) {