diff --git a/app/code/Magento/Authorizenet/Controller/Directpost/Payment/Place.php b/app/code/Magento/Authorizenet/Controller/Directpost/Payment/Place.php index fa5c22731a7a0f5b6d34471d08b9a2da463f3610..64c63ca4a11269eae341938f29784d75c0867a7c 100644 --- a/app/code/Magento/Authorizenet/Controller/Directpost/Payment/Place.php +++ b/app/code/Magento/Authorizenet/Controller/Directpost/Payment/Place.php @@ -1,6 +1,5 @@ <?php /** - * * Copyright © 2015 Magento. All rights reserved. * See COPYING.txt for license details. */ @@ -10,7 +9,8 @@ use Magento\Authorizenet\Controller\Directpost\Payment; use Magento\Authorizenet\Helper\DataFactory; use Magento\Checkout\Model\Type\Onepage; use Magento\Framework\App\Action\Context; -use Magento\Framework\Event\ManagerInterface; +use Magento\Framework\App\Response\Http; +use Magento\Framework\Json\Helper\Data as JsonHelper; use Magento\Framework\Object; use Magento\Framework\Registry; use Magento\Payment\Model\IframeConfigProvider; @@ -24,29 +24,45 @@ use Magento\Quote\Api\CartManagementInterface; class Place extends Payment { /** - * @var CartManagementInterface + * @var \Magento\Quote\Api\CartManagementInterface */ protected $cartManagement; /** - * @var ManagerInterface + * @var \Magento\Framework\Event\ManagerInterface */ protected $eventManager; + /** + * @var \Magento\Checkout\Model\Type\Onepage + */ + protected $onepageCheckout; + + /** + * @var \Magento\Framework\Json\Helper\Data + */ + protected $jsonHelper; + /** * @param Context $context * @param Registry $coreRegistry * @param DataFactory $dataFactory * @param CartManagementInterface $cartManagement + * @param Onepage $onepageCheckout + * @param JsonHelper $jsonHelper */ public function __construct( Context $context, Registry $coreRegistry, DataFactory $dataFactory, - CartManagementInterface $cartManagement + CartManagementInterface $cartManagement, + Onepage $onepageCheckout, + JsonHelper $jsonHelper ) { $this->eventManager = $context->getEventManager(); $this->cartManagement = $cartManagement; + $this->onepageCheckout = $onepageCheckout; + $this->jsonHelper = $jsonHelper; parent::__construct($context, $coreRegistry, $dataFactory); } @@ -59,20 +75,23 @@ class Place extends Payment { $paymentParam = $this->getRequest()->getParam('payment'); $controller = $this->getRequest()->getParam('controller'); + $response = $this->getResponse(); if (isset($paymentParam['method'])) { $this->_getDirectPostSession()->setQuoteId($this->_getCheckout()->getQuote()->getId()); - $this->_getCheckout()->getQuote()->setCheckoutMethod($this->getCheckoutMethod()); + /** + * Current workaround depends on Onepage checkout model defect + * Method Onepage::getCheckoutMethod performs setCheckoutMethod + */ + $this->onepageCheckout->getCheckoutMethod(); if ($controller == IframeConfigProvider::CHECKOUT_IDENTIFIER) { return $this->placeCheckoutOrder(); } - $params = $this->_objectManager->get( - 'Magento\Authorizenet\Helper\Data' - )->getSaveOrderUrlParams( - $controller - ); + $params = $this->dataFactory + ->create(DataFactory::AREA_FRONTEND) + ->getSaveOrderUrlParams($controller); $this->_forward( $params['action'], $params['controller'], @@ -81,32 +100,10 @@ class Place extends Payment ); } else { $result = ['error_messages' => __('Please choose a payment method.'), 'goto_section' => 'payment']; - $this->getResponse()->representJson($this->getJsonHelper()->jsonEncode($result)); - } - } - - /** - * Get quote checkout method - * - * @return string - */ - protected function getCheckoutMethod() - { - $checkoutMethod = $this->_getCheckout()->getQuote()->getCheckoutMethod(); - - if ($this->getCustomerSession()->isLoggedIn()) { - $checkoutMethod = Onepage::METHOD_CUSTOMER; - } - - if (!$checkoutMethod) { - if ($this->getCheckoutHelper()->isAllowedGuestCheckout($this->_getCheckout()->getQuote())) { - $checkoutMethod = Onepage::METHOD_GUEST; - } else { - $checkoutMethod = Onepage::METHOD_REGISTER; + if ($response instanceof Http) { + $response->representJson($this->jsonHelper->jsonEncode($result)); } } - - return $checkoutMethod; } /** @@ -117,6 +114,7 @@ class Place extends Payment protected function placeCheckoutOrder() { $result = new Object(); + $response = $this->getResponse(); try { $this->cartManagement->placeOrder($this->_getCheckout()->getQuote()->getId()); $result->setData('success', true); @@ -131,30 +129,8 @@ class Place extends Payment $result->setData('error', true); $result->setData('error_messages', __('Cannot place order.')); } - $this->getResponse()->representJson($this->getJsonHelper()->jsonEncode($result)); - } - - /** - * @return \Magento\Customer\Model\Session - */ - protected function getCustomerSession() - { - return $this->_objectManager->get('Magento\Checkout\Model\Cart')->getCustomerSession(); - } - - /** - * @return \Magento\Checkout\Helper\Data - */ - protected function getCheckoutHelper() - { - return $this->_objectManager->get('Magento\Checkout\Helper\Data'); - } - - /** - * @return \Magento\Framework\Json\Helper\Data - */ - protected function getJsonHelper() - { - return $this->_objectManager->get('Magento\Framework\Json\Helper\Data'); + if ($response instanceof Http) { + $response->representJson($this->jsonHelper->jsonEncode($result)); + } } } diff --git a/app/code/Magento/Authorizenet/Helper/DataFactory.php b/app/code/Magento/Authorizenet/Helper/DataFactory.php index 9e2bb3ef195ebc3b10f27ee6f5b86501b1d1c6d2..8a337c492916765eb1065216eeba4ed74729bd3e 100644 --- a/app/code/Magento/Authorizenet/Helper/DataFactory.php +++ b/app/code/Magento/Authorizenet/Helper/DataFactory.php @@ -13,6 +13,8 @@ use Magento\Framework\ObjectManagerInterface; */ class DataFactory { + const AREA_FRONTEND = 'frontend'; + const AREA_BACKEND = 'adminhtml'; /** * @var ObjectManagerInterface */ @@ -22,8 +24,8 @@ class DataFactory * @var array */ protected $helperMap = [ - 'frontend' => 'Magento\Authorizenet\Helper\Data', - 'adminhtml' => 'Magento\Authorizenet\Helper\Backend\Data' + self::AREA_FRONTEND => 'Magento\Authorizenet\Helper\Data', + self::AREA_BACKEND => 'Magento\Authorizenet\Helper\Backend\Data' ]; /** diff --git a/app/code/Magento/Authorizenet/Model/Directpost/Session.php b/app/code/Magento/Authorizenet/Model/Directpost/Session.php index d9f6f6f85576f9cb64542f62c4164ad3e6be0659..e4f2af809aab5c11e385253c4b972da8dd722308 100644 --- a/app/code/Magento/Authorizenet/Model/Directpost/Session.php +++ b/app/code/Magento/Authorizenet/Model/Directpost/Session.php @@ -5,10 +5,12 @@ */ namespace Magento\Authorizenet\Model\Directpost; +use Magento\Framework\Session\SessionManager; + /** * Authorize.net DirectPost session model */ -class Session extends \Magento\Framework\Session\SessionManager +class Session extends SessionManager { /** * Add order IncrementId to session @@ -60,4 +62,16 @@ class Session extends \Magento\Framework\Session\SessionManager } return false; } + + /** + * Set quote id to session + * + * @param int|string $id + * @return $this + */ + public function setQuoteId($id) + { + $this->storage->setQuoteId($id); + return $this; + } } diff --git a/app/code/Magento/Authorizenet/Test/Unit/Controller/Directpost/Payment/PlaceTest.php b/app/code/Magento/Authorizenet/Test/Unit/Controller/Directpost/Payment/PlaceTest.php index 43a6b6bfd9eba3294053361b7a6cae9af99de7a6..af25f301b3134be039019638df0fa6c43404bbc3 100644 --- a/app/code/Magento/Authorizenet/Test/Unit/Controller/Directpost/Payment/PlaceTest.php +++ b/app/code/Magento/Authorizenet/Test/Unit/Controller/Directpost/Payment/PlaceTest.php @@ -8,16 +8,15 @@ namespace Magento\Authorizenet\Test\Unit\Controller\Directpost\Payment; use Magento\Authorizenet\Controller\Directpost\Payment\Place; use Magento\Authorizenet\Helper\DataFactory; use Magento\Authorizenet\Model\Directpost\Session as DirectpostSession; -use Magento\Checkout\Model\Cart; use Magento\Checkout\Model\Session as CheckoutSession; -use Magento\Customer\Model\Session as CustomerSession; +use Magento\Checkout\Model\Type\Onepage; use Magento\Framework\App\Action\Context; use Magento\Framework\App\RequestInterface; -use Magento\Framework\App\ResponseInterface; -use Magento\Framework\Event\ManagerInterface; +use Magento\Framework\App\Response\Http; use Magento\Framework\Json\Helper\Data; use Magento\Framework\ObjectManagerInterface; use Magento\Framework\Registry; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use Magento\Payment\Model\IframeConfigProvider; use Magento\Quote\Api\CartManagementInterface; use Magento\Quote\Model\Quote; @@ -30,6 +29,10 @@ use Magento\Quote\Model\Quote; */ class PlaceTest extends \PHPUnit_Framework_TestCase { + /** + * @var ObjectManager + */ + protected $objectManager; /** * @var Place */ @@ -55,13 +58,23 @@ class PlaceTest extends \PHPUnit_Framework_TestCase */ protected $cartManagementMock; + /** + * @var Onepage|\PHPUnit_Framework_MockObject_MockObject + */ + protected $onepageCheckout; + + /** + * @var Data|\PHPUnit_Framework_MockObject_MockObject + */ + protected $jsonHelperMock; + /** * @var RequestInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $requestMock; /** - * @var ResponseInterface|\PHPUnit_Framework_MockObject_MockObject + * @var Http|\PHPUnit_Framework_MockObject_MockObject */ protected $responseMock; @@ -75,76 +88,26 @@ class PlaceTest extends \PHPUnit_Framework_TestCase */ protected $directpostSessionMock; - /** - * @var CheckoutSession|\PHPUnit_Framework_MockObject_MockObject - */ - protected $checkoutSessionMock; - - /** - * @var CustomerSession|\PHPUnit_Framework_MockObject_MockObject - */ - protected $customerSessionMock; - /** * @var Quote|\PHPUnit_Framework_MockObject_MockObject */ protected $quoteMock; /** - * @var ManagerInterface|\PHPUnit_Framework_MockObject_MockObject - */ - protected $eventManagerMock; - - /** - * @var Data|\PHPUnit_Framework_MockObject_MockObject - */ - protected $jsonHelperMock; - - /** - * @var Cart|\PHPUnit_Framework_MockObject_MockObject + * @var CheckoutSession|\PHPUnit_Framework_MockObject_MockObject */ - protected $cartMock; + protected $checkoutSessionMock; public function setUp() { - $this->cartMock = $this - ->getMockBuilder('Magento\Checkout\Model\Cart') - ->disableOriginalConstructor() - ->getMock(); - $this->requestMock = $this - ->getMockBuilder('Magento\Framework\App\RequestInterface') - ->getMockForAbstractClass(); - $this->responseMock = $this - ->getMockBuilder('Magento\Framework\App\ResponseInterface') - ->setMethods(['representJson']) - ->getMockForAbstractClass(); - $this->responseMock->expects($this->any()) - ->method('representJson'); - $this->jsonHelperMock = $this - ->getMockBuilder('Magento\Framework\Json\Helper\Data') - ->disableOriginalConstructor() - ->getMock(); $this->directpostSessionMock = $this ->getMockBuilder('Magento\Authorizenet\Model\Directpost\Session') - ->setMethods(['setQuoteId']) ->disableOriginalConstructor() ->getMock(); - $this->directpostSessionMock->expects($this->any()) - ->method('setQuoteId'); $this->quoteMock = $this ->getMockBuilder('Magento\Quote\Model\Quote') ->disableOriginalConstructor() ->getMock(); - $this->customerSessionMock = $this - ->getMockBuilder('Magento\Customer\Model\Session') - ->disableOriginalConstructor() - ->getMock(); - $this->eventManagerMock = $this - ->getMockBuilder('Magento\Framework\Event\ManagerInterface') - ->getMockForAbstractClass(); - $this->eventManagerMock->expects($this->any()) - ->method('dispatch') - ->with('checkout_directpost_placeOrder'); $this->checkoutSessionMock = $this ->getMockBuilder('Magento\Checkout\Model\Session') ->disableOriginalConstructor() @@ -160,25 +123,7 @@ class PlaceTest extends \PHPUnit_Framework_TestCase ->willReturnMap([ ['Magento\Authorizenet\Model\Directpost\Session', $this->directpostSessionMock], ['Magento\Checkout\Model\Session', $this->checkoutSessionMock], - ['Magento\Framework\Json\Helper\Data', $this->jsonHelperMock], - ['Magento\Checkout\Model\Cart', $this->cartMock], ]); - $this->contextMock = $this - ->getMockBuilder('Magento\Framework\App\Action\Context') - ->disableOriginalConstructor() - ->getMock(); - $this->contextMock->expects($this->any()) - ->method('getRequest') - ->will($this->returnValue($this->requestMock)); - $this->contextMock->expects($this->any()) - ->method('getResponse') - ->will($this->returnValue($this->responseMock)); - $this->contextMock->expects($this->any()) - ->method('getObjectManager') - ->will($this->returnValue($this->objectManagerMock)); - $this->contextMock->expects($this->any()) - ->method('getEventManager') - ->will($this->returnValue($this->eventManagerMock)); $this->coreRegistryMock = $this ->getMockBuilder('Magento\Framework\Registry') ->disableOriginalConstructor() @@ -191,11 +136,35 @@ class PlaceTest extends \PHPUnit_Framework_TestCase ->getMockBuilder('Magento\Quote\Api\CartManagementInterface') ->disableOriginalConstructor() ->getMock(); - $this->placeOrderController = new Place( - $this->contextMock, - $this->coreRegistryMock, - $this->dataFactoryMock, - $this->cartManagementMock + $this->onepageCheckout = $this + ->getMockBuilder('Magento\Checkout\Model\Type\Onepage') + ->disableOriginalConstructor() + ->getMock(); + $this->jsonHelperMock = $this + ->getMockBuilder('Magento\Framework\Json\Helper\Data') + ->disableOriginalConstructor() + ->getMock(); + $this->requestMock = $this + ->getMockBuilder('Magento\Framework\App\RequestInterface') + ->getMockForAbstractClass(); + $this->responseMock = $this + ->getMockBuilder('Magento\Framework\App\Response\Http') + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $this->objectManager = new ObjectManager($this); + $this->placeOrderController = $this->objectManager->getObject( + 'Magento\Authorizenet\Controller\Directpost\Payment\Place', + [ + 'request' => $this->requestMock, + 'response' => $this->responseMock, + 'objectManager' => $this->objectManagerMock, + 'coreRegistry' => $this->coreRegistryMock, + 'dataFactory' => $this->dataFactoryMock, + 'cartManagement' => $this->cartManagementMock, + 'onepageCheckout' => $this->onepageCheckout, + 'jsonHelper' => $this->jsonHelperMock, + ] ); } @@ -203,7 +172,6 @@ class PlaceTest extends \PHPUnit_Framework_TestCase * @param $paymentMethod * @param $controller * @param $quoteId - * @param $isLoggedIn * @param $orderId * @param $result * @dataProvider textExecuteDataProvider @@ -212,7 +180,6 @@ class PlaceTest extends \PHPUnit_Framework_TestCase $paymentMethod, $controller, $quoteId, - $isLoggedIn, $orderId, $result ) { @@ -230,14 +197,6 @@ class PlaceTest extends \PHPUnit_Framework_TestCase ->method('getId') ->will($this->returnValue($quoteId)); - $this->cartMock->expects($this->any()) - ->method('getCustomerSession') - ->will($this->returnValue($this->customerSessionMock)); - - $this->customerSessionMock->expects($this->any()) - ->method('isLoggedIn') - ->will($this->returnValue($isLoggedIn)); - $this->cartManagementMock->expects($this->any()) ->method('placeOrder') ->will($this->returnValue($orderId)); @@ -253,15 +212,13 @@ class PlaceTest extends \PHPUnit_Framework_TestCase * @param $paymentMethod * @param $controller * @param $quoteId - * @param $isLoggedIn * @param $result * @dataProvider textExecuteFailedPlaceOrderDataProvider */ - public function testExecuteFailePlaceOrder( + public function testExecuteFailedPlaceOrder( $paymentMethod, $controller, $quoteId, - $isLoggedIn, $result ) { $this->requestMock->expects($this->at(0)) @@ -278,14 +235,6 @@ class PlaceTest extends \PHPUnit_Framework_TestCase ->method('getId') ->will($this->returnValue($quoteId)); - $this->cartMock->expects($this->any()) - ->method('getCustomerSession') - ->will($this->returnValue($this->customerSessionMock)); - - $this->customerSessionMock->expects($this->any()) - ->method('isLoggedIn') - ->will($this->returnValue($isLoggedIn)); - $this->cartManagementMock->expects($this->once()) ->method('placeOrder') ->willThrowException(new \Exception()); @@ -310,7 +259,6 @@ class PlaceTest extends \PHPUnit_Framework_TestCase ['method' => null], IframeConfigProvider::CHECKOUT_IDENTIFIER, 1, - true, 1, ['error_messages' => __('Please choose a payment method.'), 'goto_section' => 'payment'] ], @@ -318,7 +266,6 @@ class PlaceTest extends \PHPUnit_Framework_TestCase ['method' => 'authorizenet_directpost'], IframeConfigProvider::CHECKOUT_IDENTIFIER, 1, - true, 1, $objectSuccess ], @@ -339,7 +286,6 @@ class PlaceTest extends \PHPUnit_Framework_TestCase ['method' => 'authorizenet_directpost'], IframeConfigProvider::CHECKOUT_IDENTIFIER, 1, - true, $objectFailed ], ]; diff --git a/app/code/Magento/Authorizenet/Test/Unit/Model/Directpost/SessionTest.php b/app/code/Magento/Authorizenet/Test/Unit/Model/Directpost/SessionTest.php new file mode 100644 index 0000000000000000000000000000000000000000..f77de6a5ccb8b731dc49c5c3c17949d6106b709c --- /dev/null +++ b/app/code/Magento/Authorizenet/Test/Unit/Model/Directpost/SessionTest.php @@ -0,0 +1,58 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Authorizenet\Test\Unit\Model\Directpost; + +use Magento\Authorizenet\Model\Directpost\Session; +use Magento\Framework\Session\StorageInterface; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; + +class SessionTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var ObjectManager + */ + protected $objectManager; + + /** + * @var Session + */ + protected $session; + + /** + * @var StorageInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $storageMock; + + public function setUp() + { + $this->storageMock = $this + ->getMockBuilder('Magento\Framework\Session\StorageInterface') + ->setMethods(['setQuoteId']) + ->getMockForAbstractClass(); + + $this->objectManager = new ObjectManager($this); + $this->session = $this->objectManager->getObject( + 'Magento\Authorizenet\Model\Directpost\Session', + [ + 'storage' => $this->storageMock, + ] + ); + } + + public function testSetQuoteId() + { + $quoteId = 1; + + $this->storageMock->expects($this->once()) + ->method('setQuoteId') + ->with($quoteId); + + $this->assertInstanceOf( + 'Magento\Authorizenet\Model\Directpost\Session', + $this->session->setQuoteId($quoteId) + ); + } +} diff --git a/app/code/Magento/Backend/etc/module.xml b/app/code/Magento/Backend/etc/module.xml index 91d3eee738c3f6576430ee2e1775a237a2fc9ac6..a2d0faca404afe3d83623d72bee424ce4bcd2236 100644 --- a/app/code/Magento/Backend/etc/module.xml +++ b/app/code/Magento/Backend/etc/module.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> - <module name="Magento_Backend" setup_version="2.0.0.0"> + <module name="Magento_Backend" setup_version="2.0.0"> <sequence> <module name="Magento_Directory"/> </sequence> diff --git a/app/code/Magento/Backup/etc/module.xml b/app/code/Magento/Backup/etc/module.xml index f43decfdbd42c554c838d57412550fc263898245..80d19293753e874c3d835847ad9914bf7fae3811 100644 --- a/app/code/Magento/Backup/etc/module.xml +++ b/app/code/Magento/Backup/etc/module.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> - <module name="Magento_Backup" setup_version="1.6.0.0"> + <module name="Magento_Backup" setup_version="2.0.0"> <sequence> <module name="Magento_Store"/> </sequence> diff --git a/app/code/Magento/Catalog/Api/ProductRepositoryInterface.php b/app/code/Magento/Catalog/Api/ProductRepositoryInterface.php index 18cf0bdec693cf4913c73285185bd01933ed40e6..6fddee979e07f89879312fa6ed317acff6acba27 100644 --- a/app/code/Magento/Catalog/Api/ProductRepositoryInterface.php +++ b/app/code/Magento/Catalog/Api/ProductRepositoryInterface.php @@ -72,10 +72,4 @@ interface ProductRepositoryInterface * @return \Magento\Catalog\Api\Data\ProductSearchResultsInterface */ public function getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria); - - /** - * @param \Magento\Framework\Api\Search\SearchCriteriaInterface $searchCriteria - * @return \Magento\Framework\Api\Search\SearchResultInterface - */ - public function search(\Magento\Framework\Api\Search\SearchCriteriaInterface $searchCriteria); } diff --git a/app/code/Magento/Catalog/Helper/Product/Composite.php b/app/code/Magento/Catalog/Helper/Product/Composite.php index 971d6c6b10de0be0702ade569305c64f53adc400..7655807bcc7a74f70a2956640dd258a21386870d 100644 --- a/app/code/Magento/Catalog/Helper/Product/Composite.php +++ b/app/code/Magento/Catalog/Helper/Product/Composite.php @@ -12,7 +12,6 @@ use Magento\Framework\Exception\NoSuchEntityException; use Magento\Catalog\Helper\Product; use Magento\Store\Model\StoreManagerInterface; use Magento\Customer\Controller\RegistryConstants; -use Magento\Customer\Api\CustomerRepositoryInterface; use Magento\Framework\Registry; /** @@ -52,11 +51,6 @@ class Composite extends \Magento\Framework\App\Helper\AbstractHelper */ protected $productRepository; - /** - * @var CustomerRepositoryInterface - */ - protected $customerRepository; - /** * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Store\Model\StoreManagerInterface $storeManager @@ -64,7 +58,6 @@ class Composite extends \Magento\Framework\App\Helper\AbstractHelper * @param Registry $coreRegistry * @param LayoutFactory $resultLayoutFactory * @param ProductRepositoryInterface $productRepository - * @param CustomerRepositoryInterface $customerRepository */ public function __construct( Context $context, @@ -72,15 +65,13 @@ class Composite extends \Magento\Framework\App\Helper\AbstractHelper Product $catalogProduct, Registry $coreRegistry, LayoutFactory $resultLayoutFactory, - ProductRepositoryInterface $productRepository, - CustomerRepositoryInterface $customerRepository + ProductRepositoryInterface $productRepository ) { $this->_storeManager = $storeManager; $this->_coreRegistry = $coreRegistry; $this->_catalogProduct = $catalogProduct; $this->resultLayoutFactory = $resultLayoutFactory; $this->productRepository = $productRepository; - $this->customerRepository = $customerRepository; parent::__construct($context); } @@ -160,11 +151,6 @@ class Composite extends \Magento\Framework\App\Helper\AbstractHelper // Register customer we're working with $customerId = (int)$configureResult->getCurrentCustomerId(); - // TODO: Remove the customer model from the registry once all readers are refactored - if ($customerId) { - $customerData = $this->customerRepository->getById($customerId); - $this->_coreRegistry->register(RegistryConstants::CURRENT_CUSTOMER, $customerData); - } $this->_coreRegistry->register(RegistryConstants::CURRENT_CUSTOMER_ID, $customerId); // Prepare buy request values diff --git a/app/code/Magento/Catalog/Model/Product/Attribute/Backend/GroupPrice/AbstractGroupPrice.php b/app/code/Magento/Catalog/Model/Product/Attribute/Backend/GroupPrice/AbstractGroupPrice.php index 4ff34b45814607a812e60d48202115cb5a1a5ee6..56631b4a8faf65ffa2a0b6360ced631e2098ab59 100644 --- a/app/code/Magento/Catalog/Model/Product/Attribute/Backend/GroupPrice/AbstractGroupPrice.php +++ b/app/code/Magento/Catalog/Model/Product/Attribute/Backend/GroupPrice/AbstractGroupPrice.php @@ -432,4 +432,14 @@ abstract class AbstractGroupPrice extends Price return $data; } + + /** + * Get resource model instance + * + * @return \Magento\Catalog\Model\Resource\Product\Attribute\Backend\GroupPrice + */ + public function getResource() + { + return $this->_getResource(); + } } diff --git a/app/code/Magento/Catalog/Model/Product/Attribute/Repository.php b/app/code/Magento/Catalog/Model/Product/Attribute/Repository.php index 07096562de9558c15220200a24082eb976f3f1e3..1cc9d446e5428a0221cf6c5063ca224df2e37a34 100644 --- a/app/code/Magento/Catalog/Model/Product/Attribute/Repository.php +++ b/app/code/Magento/Catalog/Model/Product/Attribute/Repository.php @@ -49,11 +49,6 @@ class Repository implements \Magento\Catalog\Api\ProductAttributeRepositoryInter */ protected $searchCriteriaBuilder; - /** - * @var \Magento\Framework\Api\FilterBuilder - */ - protected $filterBuilder; - /** * @param \Magento\Catalog\Model\Resource\Attribute $attributeResource * @param \Magento\Catalog\Helper\Product $productHelper @@ -62,8 +57,6 @@ class Repository implements \Magento\Catalog\Api\ProductAttributeRepositoryInter * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Eav\Model\Adminhtml\System\Config\Source\Inputtype\ValidatorFactory $validatorFactory * @param \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder - * @param \Magento\Framework\Api\FilterBuilder $filterBuilder - * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\Catalog\Model\Resource\Attribute $attributeResource, @@ -72,8 +65,7 @@ class Repository implements \Magento\Catalog\Api\ProductAttributeRepositoryInter \Magento\Eav\Api\AttributeRepositoryInterface $eavAttributeRepository, \Magento\Eav\Model\Config $eavConfig, \Magento\Eav\Model\Adminhtml\System\Config\Source\Inputtype\ValidatorFactory $validatorFactory, - \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder, - \Magento\Framework\Api\FilterBuilder $filterBuilder + \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder ) { $this->attributeResource = $attributeResource; $this->productHelper = $productHelper; @@ -82,7 +74,6 @@ class Repository implements \Magento\Catalog\Api\ProductAttributeRepositoryInter $this->eavConfig = $eavConfig; $this->inputtypeValidatorFactory = $validatorFactory; $this->searchCriteriaBuilder = $searchCriteriaBuilder; - $this->filterBuilder = $filterBuilder; } /** @@ -209,19 +200,7 @@ class Repository implements \Magento\Catalog\Api\ProductAttributeRepositoryInter */ public function getCustomAttributesMetadata($dataObjectClassName = null) { - $defaultAttributeSetId = $this->eavConfig - ->getEntityType(\Magento\Catalog\Api\Data\ProductAttributeInterface::ENTITY_TYPE_CODE) - ->getDefaultAttributeSetId(); - $searchCriteria = $this->searchCriteriaBuilder->addFilters( - [ - $this->filterBuilder - ->setField('attribute_set_id') - ->setValue($defaultAttributeSetId) - ->create(), - ] - ); - - return $this->getList($searchCriteria->create())->getItems(); + return $this->getList($this->searchCriteriaBuilder->create())->getItems(); } /** diff --git a/app/code/Magento/Catalog/Model/ProductRepository.php b/app/code/Magento/Catalog/Model/ProductRepository.php index 6b71af37b08a5d14cfb79ee1174c6e21e6a3c24f..28e8e25dfaa6b8273b50b984f0d0ec265a21aa34 100644 --- a/app/code/Magento/Catalog/Model/ProductRepository.php +++ b/app/code/Magento/Catalog/Model/ProductRepository.php @@ -95,11 +95,6 @@ class ProductRepository implements \Magento\Catalog\Api\ProductRepositoryInterfa */ protected $metadataService; - /** - * @var \Magento\Eav\Model\Config - */ - protected $eavConfig; - /** * @var \Magento\Framework\Api\ExtensibleDataObjectConverter */ @@ -140,25 +135,6 @@ class ProductRepository implements \Magento\Catalog\Api\ProductRepositoryInterfa */ protected $extensionAttributesJoinProcessor; - /** - * @var \Magento\Framework\Search\Request\Builder - */ - private $requestBuilder; - - /** - * @var \Magento\Framework\Search\SearchEngineInterface - */ - private $searchEngine; - - /** - * @var SearchResponseBuilder - */ - private $searchResponseBuilder; - /** - * @var \Magento\Framework\App\Config\ScopeConfigInterface - */ - private $scopeConfig; - /** * @param ProductFactory $productFactory * @param \Magento\Catalog\Controller\Adminhtml\Product\Initialization\Helper $initializationHelper @@ -181,10 +157,6 @@ class ProductRepository implements \Magento\Catalog\Api\ProductRepositoryInterfa * @param \Magento\Eav\Model\Config $eavConfig * @param ImageProcessorInterface $imageProcessor * @param \Magento\Framework\Api\ExtensionAttribute\JoinProcessorInterface $extensionAttributesJoinProcessor - * @param \Magento\Framework\Search\Request\Builder $requestBuilder - * @param \Magento\Framework\Search\SearchEngineInterface $searchEngine - * @param SearchResponseBuilder $searchResponseBuilder - * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -206,13 +178,8 @@ class ProductRepository implements \Magento\Catalog\Api\ProductRepositoryInterfa ImageContentValidatorInterface $contentValidator, ImageContentInterfaceFactory $contentFactory, MimeTypeExtensionMap $mimeTypeExtensionMap, - \Magento\Eav\Model\Config $eavConfig, ImageProcessorInterface $imageProcessor, - \Magento\Framework\Api\ExtensionAttribute\JoinProcessorInterface $extensionAttributesJoinProcessor, - \Magento\Framework\Search\Request\Builder $requestBuilder, - \Magento\Framework\Search\SearchEngineInterface $searchEngine, - SearchResponseBuilder $searchResponseBuilder, - \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig + \Magento\Framework\Api\ExtensionAttribute\JoinProcessorInterface $extensionAttributesJoinProcessor ) { $this->productFactory = $productFactory; $this->collectionFactory = $collectionFactory; @@ -232,13 +199,8 @@ class ProductRepository implements \Magento\Catalog\Api\ProductRepositoryInterfa $this->contentValidator = $contentValidator; $this->contentFactory = $contentFactory; $this->mimeTypeExtensionMap = $mimeTypeExtensionMap; - $this->eavConfig = $eavConfig; $this->imageProcessor = $imageProcessor; $this->extensionAttributesJoinProcessor = $extensionAttributesJoinProcessor; - $this->requestBuilder = $requestBuilder; - $this->searchEngine = $searchEngine; - $this->searchResponseBuilder = $searchResponseBuilder; - $this->scopeConfig = $scopeConfig; } /** @@ -680,19 +642,8 @@ class ProductRepository implements \Magento\Catalog\Api\ProductRepositoryInterfa /** @var \Magento\Catalog\Model\Resource\Product\Collection $collection */ $collection = $this->collectionFactory->create(); $this->extensionAttributesJoinProcessor->process($collection); - $defaultAttributeSetId = $this->eavConfig - ->getEntityType(\Magento\Catalog\Api\Data\ProductAttributeInterface::ENTITY_TYPE_CODE) - ->getDefaultAttributeSetId(); - $extendedSearchCriteria = $this->searchCriteriaBuilder->addFilters( - [ - $this->filterBuilder - ->setField('attribute_set_id') - ->setValue($defaultAttributeSetId) - ->create(), - ] - ); - foreach ($this->metadataService->getList($extendedSearchCriteria->create())->getItems() as $metadata) { + foreach ($this->metadataService->getList($this->searchCriteriaBuilder->create())->getItems() as $metadata) { $collection->addAttributeToSelect($metadata->getAttributeCode()); } $collection->joinAttribute('status', 'catalog_product/status', 'entity_id', null, 'inner'); @@ -721,45 +672,6 @@ class ProductRepository implements \Magento\Catalog\Api\ProductRepositoryInterfa return $searchResult; } - /** - * @param \Magento\Framework\Api\Search\SearchCriteriaInterface $searchCriteria - * @return \Magento\Framework\Api\Search\SearchResultInterface - */ - public function search(\Magento\Framework\Api\Search\SearchCriteriaInterface $searchCriteria) - { - $this->requestBuilder->setRequestName($searchCriteria->getRequestName()); - - $searchTerm = $searchCriteria->getSearchTerm(); - if (!empty($searchTerm)) { - $this->requestBuilder->bind('search_term', $searchTerm); - } - - $storeId = $this->storeManager->getStore(true)->getId(); - $this->requestBuilder->bindDimension('scope', $storeId); - - foreach ($searchCriteria->getFilterGroups() as $filterGroup) { - foreach ($filterGroup->getFilters() as $filter) { - $this->addFieldToFilter($filter->getField(), $filter->getValue()); - } - } - - $priceRangeCalculation = $this->scopeConfig->getValue( - \Magento\Catalog\Model\Layer\Filter\Dynamic\AlgorithmFactory::XML_PATH_RANGE_CALCULATION, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ); - if ($priceRangeCalculation) { - $this->requestBuilder->bind('price_dynamic_algorithm', $priceRangeCalculation); - } - - $this->requestBuilder->setFrom($searchCriteria->getCurrentPage() * $searchCriteria->getPageSize()); - $this->requestBuilder->setSize($searchCriteria->getPageSize()); - $request = $this->requestBuilder->create(); - $searchResponse = $this->searchEngine->search($request); - - return $this->searchResponseBuilder->build($searchResponse) - ->setSearchCriteria($searchCriteria); - } - /** * Helper function that adds a FilterGroup to the collection. * @@ -780,26 +692,4 @@ class ProductRepository implements \Magento\Catalog\Api\ProductRepositoryInterfa $collection->addFieldToFilter($fields); } } - - /** - * Apply attribute filter to facet collection - * - * @param string $field - * @param null $condition - * @return $this - */ - private function addFieldToFilter($field, $condition = null) - { - if (!is_array($condition) || !in_array(key($condition), ['from', 'to'])) { - $this->requestBuilder->bind($field, $condition); - } else { - if (!empty($condition['from'])) { - $this->requestBuilder->bind("{$field}.from", $condition['from']); - } - if (!empty($condition['to'])) { - $this->requestBuilder->bind("{$field}.to", $condition['to']); - } - } - return $this; - } } diff --git a/app/code/Magento/Catalog/Setup/InstallData.php b/app/code/Magento/Catalog/Setup/InstallData.php index 3f18ed575e087e0c6ebcddf89f6e9016d6c3ea00..e77013106a2377d7e9744026380e94e8b140c4f2 100644 --- a/app/code/Magento/Catalog/Setup/InstallData.php +++ b/app/code/Magento/Catalog/Setup/InstallData.php @@ -301,5 +301,17 @@ class InstallData implements InstallDataInterface '1' ); } + $categorySetup->updateAttribute( + \Magento\Catalog\Model\Category::ENTITY, + 'custom_design_from', + 'attribute_model', + 'Magento\Catalog\Model\Resource\Eav\Attribute' + ); + $categorySetup->updateAttribute( + \Magento\Catalog\Model\Category::ENTITY, + 'custom_design_from', + 'frontend_model', + 'Magento\Eav\Model\Entity\Attribute\Frontend\Datetime' + ); } } diff --git a/app/code/Magento/Catalog/Setup/InstallSchema.php b/app/code/Magento/Catalog/Setup/InstallSchema.php index 833ea7cf4dbbd2e99ac09704146c8b27310895f6..adc00706d70791e163480d7dffccb8df173f61e8 100644 --- a/app/code/Magento/Catalog/Setup/InstallSchema.php +++ b/app/code/Magento/Catalog/Setup/InstallSchema.php @@ -37,13 +37,6 @@ class InstallSchema implements InstallSchemaInterface ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true], 'Entity ID' ) - ->addColumn( - 'entity_type_id', - \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, - null, - ['unsigned' => true, 'nullable' => false, 'default' => '0'], - 'Entity Type ID' - ) ->addColumn( 'attribute_set_id', \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, @@ -93,10 +86,6 @@ class InstallSchema implements InstallSchemaInterface [], 'Update Time' ) - ->addIndex( - $installer->getIdxName('catalog_product_entity', ['entity_type_id']), - ['entity_type_id'] - ) ->addIndex( $installer->getIdxName('catalog_product_entity', ['attribute_set_id']), ['attribute_set_id'] @@ -117,13 +106,6 @@ class InstallSchema implements InstallSchemaInterface 'attribute_set_id', \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE ) - ->addForeignKey( - $installer->getFkName('catalog_product_entity', 'entity_type_id', 'eav_entity_type', 'entity_type_id'), - 'entity_type_id', - $installer->getTable('eav_entity_type'), - 'entity_type_id', - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE - ) ->setComment('Catalog Product Table'); $installer->getConnection()->createTable($table); @@ -139,13 +121,6 @@ class InstallSchema implements InstallSchemaInterface ['identity' => true, 'nullable' => false, 'primary' => true], 'Value ID' ) - ->addColumn( - 'entity_type_id', - \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, - null, - ['unsigned' => true, 'nullable' => false, 'default' => '0'], - 'Entity Type ID' - ) ->addColumn( 'attribute_id', \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, @@ -237,13 +212,6 @@ class InstallSchema implements InstallSchemaInterface ['identity' => true, 'nullable' => false, 'primary' => true], 'Value ID' ) - ->addColumn( - 'entity_type_id', - \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, - null, - ['unsigned' => true, 'nullable' => false, 'default' => '0'], - 'Entity Type ID' - ) ->addColumn( 'attribute_id', \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, @@ -335,13 +303,6 @@ class InstallSchema implements InstallSchemaInterface ['identity' => true, 'nullable' => false, 'primary' => true], 'Value ID' ) - ->addColumn( - 'entity_type_id', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['unsigned' => true, 'nullable' => false, 'default' => '0'], - 'Entity Type ID' - ) ->addColumn( 'attribute_id', \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, @@ -423,13 +384,6 @@ class InstallSchema implements InstallSchemaInterface ['identity' => true, 'nullable' => false, 'primary' => true], 'Value ID' ) - ->addColumn( - 'entity_type_id', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['unsigned' => true, 'nullable' => false, 'default' => '0'], - 'Entity Type ID' - ) ->addColumn( 'attribute_id', \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, @@ -521,13 +475,6 @@ class InstallSchema implements InstallSchemaInterface ['identity' => true, 'nullable' => false, 'primary' => true], 'Value ID' ) - ->addColumn( - 'entity_type_id', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['unsigned' => true, 'nullable' => false, 'default' => '0'], - 'Entity Type ID' - ) ->addColumn( 'attribute_id', \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, @@ -619,13 +566,6 @@ class InstallSchema implements InstallSchemaInterface ['identity' => true, 'nullable' => false, 'primary' => true], 'Value ID' ) - ->addColumn( - 'entity_type_id', - \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, - null, - ['unsigned' => true, 'nullable' => false, 'default' => '0'], - 'Entity Type ID' - ) ->addColumn( 'attribute_id', \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, @@ -664,10 +604,10 @@ class InstallSchema implements InstallSchemaInterface ->addIndex( $installer->getIdxName( 'catalog_product_entity_gallery', - ['entity_type_id', 'entity_id', 'attribute_id', 'store_id'], + ['entity_id', 'attribute_id', 'store_id'], \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE ), - ['entity_type_id', 'entity_id', 'attribute_id', 'store_id'], + ['entity_id', 'attribute_id', 'store_id'], ['type' => \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE] ) ->addIndex( @@ -728,13 +668,6 @@ class InstallSchema implements InstallSchemaInterface ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true], 'Entity ID' ) - ->addColumn( - 'entity_type_id', - \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, - null, - ['unsigned' => true, 'nullable' => false, 'default' => '0'], - 'Entity Type ID' - ) ->addColumn( 'attribute_set_id', \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, @@ -810,13 +743,6 @@ class InstallSchema implements InstallSchemaInterface ['identity' => true, 'nullable' => false, 'primary' => true], 'Value ID' ) - ->addColumn( - 'entity_type_id', - \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, - null, - ['unsigned' => true, 'nullable' => false, 'default' => '0'], - 'Entity Type ID' - ) ->addColumn( 'attribute_id', \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, @@ -848,10 +774,10 @@ class InstallSchema implements InstallSchemaInterface ->addIndex( $installer->getIdxName( 'catalog_category_entity_datetime', - ['entity_type_id', 'entity_id', 'attribute_id', 'store_id'], + ['entity_id', 'attribute_id', 'store_id'], \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE ), - ['entity_type_id', 'entity_id', 'attribute_id', 'store_id'], + ['entity_id', 'attribute_id', 'store_id'], ['type' => \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE] ) ->addIndex( @@ -912,13 +838,6 @@ class InstallSchema implements InstallSchemaInterface ['identity' => true, 'nullable' => false, 'primary' => true], 'Value ID' ) - ->addColumn( - 'entity_type_id', - \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, - null, - ['unsigned' => true, 'nullable' => false, 'default' => '0'], - 'Entity Type ID' - ) ->addColumn( 'attribute_id', \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, @@ -950,10 +869,10 @@ class InstallSchema implements InstallSchemaInterface ->addIndex( $installer->getIdxName( 'catalog_category_entity_decimal', - ['entity_type_id', 'entity_id', 'attribute_id', 'store_id'], + [ 'entity_id', 'attribute_id', 'store_id'], \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE ), - ['entity_type_id', 'entity_id', 'attribute_id', 'store_id'], + ['entity_id', 'attribute_id', 'store_id'], ['type' => \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE] ) ->addIndex( @@ -1014,13 +933,6 @@ class InstallSchema implements InstallSchemaInterface ['identity' => true, 'nullable' => false, 'primary' => true], 'Value ID' ) - ->addColumn( - 'entity_type_id', - \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, - null, - ['unsigned' => true, 'nullable' => false, 'default' => '0'], - 'Entity Type ID' - ) ->addColumn( 'attribute_id', \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, @@ -1052,10 +964,10 @@ class InstallSchema implements InstallSchemaInterface ->addIndex( $installer->getIdxName( 'catalog_category_entity_int', - ['entity_type_id', 'entity_id', 'attribute_id', 'store_id'], + ['entity_id', 'attribute_id', 'store_id'], \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE ), - ['entity_type_id', 'entity_id', 'attribute_id', 'store_id'], + ['entity_id', 'attribute_id', 'store_id'], ['type' => \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE] ) ->addIndex( @@ -1111,13 +1023,6 @@ class InstallSchema implements InstallSchemaInterface ['identity' => true, 'nullable' => false, 'primary' => true], 'Value ID' ) - ->addColumn( - 'entity_type_id', - \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, - null, - ['unsigned' => true, 'nullable' => false, 'default' => '0'], - 'Entity Type ID' - ) ->addColumn( 'attribute_id', \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, @@ -1149,10 +1054,10 @@ class InstallSchema implements InstallSchemaInterface ->addIndex( $installer->getIdxName( 'catalog_category_entity_text', - ['entity_type_id', 'entity_id', 'attribute_id', 'store_id'], + ['entity_id', 'attribute_id', 'store_id'], \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE ), - ['entity_type_id', 'entity_id', 'attribute_id', 'store_id'], + ['entity_id', 'attribute_id', 'store_id'], ['type' => \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE] ) ->addIndex( @@ -1208,13 +1113,6 @@ class InstallSchema implements InstallSchemaInterface ['identity' => true, 'nullable' => false, 'primary' => true], 'Value ID' ) - ->addColumn( - 'entity_type_id', - \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, - null, - ['unsigned' => true, 'nullable' => false, 'default' => '0'], - 'Entity Type ID' - ) ->addColumn( 'attribute_id', \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, @@ -1246,10 +1144,10 @@ class InstallSchema implements InstallSchemaInterface ->addIndex( $installer->getIdxName( 'catalog_category_entity_varchar', - ['entity_type_id', 'entity_id', 'attribute_id', 'store_id'], + ['entity_id', 'attribute_id', 'store_id'], \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE ), - ['entity_type_id', 'entity_id', 'attribute_id', 'store_id'], + ['entity_id', 'attribute_id', 'store_id'], ['type' => \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE] ) ->addIndex( @@ -4659,7 +4557,6 @@ class InstallSchema implements InstallSchemaInterface ); $installer->getConnection() ->createTable($table); - $installer->endSetup(); } diff --git a/app/code/Magento/Catalog/Setup/UpgradeData.php b/app/code/Magento/Catalog/Setup/UpgradeData.php deleted file mode 100644 index 1459f4a31d681d6365462323cdb5a900e5745373..0000000000000000000000000000000000000000 --- a/app/code/Magento/Catalog/Setup/UpgradeData.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Catalog\Setup; - -use Magento\Framework\Setup\UpgradeDataInterface; -use Magento\Framework\Setup\ModuleContextInterface; -use Magento\Framework\Setup\ModuleDataSetupInterface; -use Magento\Catalog\Model\Category; - -/** - * @codeCoverageIgnore - */ -class UpgradeData implements UpgradeDataInterface -{ - /** - * @var Category - */ - protected $category; - - /** - * @param Category $category - */ - public function __construct(Category $category) - { - $this->category = $category; - } - - /** - * {@inheritdoc} - */ - public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context) - { - if (version_compare($context->getVersion(), '2.0.0.2') < 0) { - $newBackendModel = 'Magento\Catalog\Model\Attribute\Backend\Startdate'; - $connection = $setup->getConnection(); - $connection->startSetup(); - $connection->update( - $setup->getTable('eav_attribute'), - ['backend_model' => $newBackendModel], - ['backend_model = ?' => 'Magento\Catalog\Model\Product\Attribute\Backend\Startdate'] - ); - /** @var \Magento\Catalog\Model\Resource\Eav\Attribute $attribute */ - foreach ($this->category->getAttributes() as $attribute) { - if ($attribute->getAttributeCode() == 'custom_design_from') { - $attribute->setBackendModel($newBackendModel); - $attribute->save(); - break; - } - } - $connection->endSetup(); - } - } -} diff --git a/app/code/Magento/Catalog/Setup/UpgradeSchema.php b/app/code/Magento/Catalog/Setup/UpgradeSchema.php deleted file mode 100644 index 2f37f84191ac24a2cb89d6a076673d4246500894..0000000000000000000000000000000000000000 --- a/app/code/Magento/Catalog/Setup/UpgradeSchema.php +++ /dev/null @@ -1,105 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Catalog\Setup; - -use Magento\Framework\Setup\UpgradeSchemaInterface; -use Magento\Framework\Setup\ModuleContextInterface; -use Magento\Framework\Setup\SchemaSetupInterface; - -/** - * @codeCoverageIgnore - */ -class UpgradeSchema implements UpgradeSchemaInterface -{ - /** - * {@inheritdoc} - */ - public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context) - { - if (version_compare($context->getVersion(), '2.0.0.1') < 0) { - $installer = $setup; - - $installer->startSetup(); - - $connection = $installer->getConnection(); - $connection->dropForeignKey( - $installer->getTable('catalog_product_entity'), - 'FK_CAT_PRD_ENTT_ENTT_TYPE_ID_EAV_ENTT_TYPE_ENTT_TYPE_ID' - ); - - $dropTablesColumn = [ - 'catalog_product_entity', - 'catalog_product_entity_datetime', - 'catalog_product_entity_decimal', - 'catalog_product_entity_gallery', - 'catalog_product_entity_int', - 'catalog_product_entity_text', - 'catalog_product_entity_varchar', - 'catalog_category_entity', - 'catalog_category_entity_datetime', - 'catalog_category_entity_decimal', - 'catalog_category_entity_int', - 'catalog_category_entity_text', - 'catalog_category_entity_varchar' - ]; - foreach ($dropTablesColumn as $table) { - $connection->dropIndex( - $installer->getTable($table), - $installer->getIdxName( - $table, - 'entity_type_id', - \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_INDEX - ) - ); - $connection->dropColumn($installer->getTable($table), 'entity_type_id'); - } - - $installer->endSetup(); - } - - if (version_compare($context->getVersion(), '2.0.0.3') < 0) { - $setup->startSetup(); - - $connection = $setup->getConnection(); - $connection->addColumn( - $setup->getTable('catalog_eav_attribute'), - 'is_used_in_grid', - [ - 'type' => \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Is Used In Grid' - ] - ); - $connection->addColumn( - $setup->getTable('catalog_eav_attribute'), - 'is_visible_in_grid', - [ - 'type' => \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Is Visible in Grid' - ] - ); - $connection->addColumn( - $setup->getTable('catalog_eav_attribute'), - 'is_filterable_in_grid', - [ - 'type' => \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Is Filterable in Grid' - ] - ); - - $setup->endSetup(); - } - } -} diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/RepositoryTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/RepositoryTest.php index ae38586c74cefc9aa804180c8cd85435afdd6886..533a4196a749947440ba69efeaf029447168b186 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/RepositoryTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/RepositoryTest.php @@ -58,11 +58,6 @@ class RepositoryTest extends \PHPUnit_Framework_TestCase */ protected $searchCriteriaBuilderMock; - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $filterBuilderMock; - /** * @var \PHPUnit_Framework_MockObject_MockObject */ @@ -89,8 +84,6 @@ class RepositoryTest extends \PHPUnit_Framework_TestCase false); $this->searchCriteriaBuilderMock = $this->getMock('Magento\Framework\Api\SearchCriteriaBuilder', [], [], '', false); - $this->filterBuilderMock = - $this->getMock('Magento\Framework\Api\FilterBuilder', [], [], '', false); $this->searchResultMock = $this->getMock( '\Magento\Framework\Api\SearchResultsInterface', @@ -114,8 +107,7 @@ class RepositoryTest extends \PHPUnit_Framework_TestCase $this->eavAttributeRepositoryMock, $this->eavConfigMock, $this->validatorFactoryMock, - $this->searchCriteriaBuilderMock, - $this->filterBuilderMock + $this->searchCriteriaBuilderMock ); } @@ -169,20 +161,6 @@ class RepositoryTest extends \PHPUnit_Framework_TestCase public function testGetCustomAttributesMetadata() { - $filterMock = $this->getMock('Magento\Framework\Service\V1\Data\Filter', [], [], '', false); - $this->filterBuilderMock->expects($this->once()) - ->method('setField') - ->with('attribute_set_id') - ->willReturnSelf(); - $this->filterBuilderMock->expects($this->once()) - ->method('setValue') - ->with(4) - ->willReturnSelf(); - $this->filterBuilderMock->expects($this->once())->method('create')->willReturn($filterMock); - $this->searchCriteriaBuilderMock->expects($this->once()) - ->method('addFilters') - ->with([$filterMock]) - ->willReturnSelf(); $searchCriteriaMock = $this->getMock('Magento\Framework\Api\SearchCriteria', [], [], '', false); $this->searchCriteriaBuilderMock->expects($this->once())->method('create')->willReturn($searchCriteriaMock); $itemMock = $this->getMock('Magento\Catalog\Api\Data\ProductInterface'); diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ProductRepositoryTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ProductRepositoryTest.php index 030c464a6222881a91a23cf69475cb0ece646d20..ad8341e86cfdd703d5379a82366c40fd386afef0 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ProductRepositoryTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ProductRepositoryTest.php @@ -130,26 +130,6 @@ class ProductRepositoryTest extends \PHPUnit_Framework_TestCase */ protected $objectManager; - /** - * @var \Magento\Framework\Search\Request\Builder|\PHPUnit_Framework_MockObject_MockObject - */ - protected $requestBuilder; - - /** - * @var \Magento\Search\Model\SearchEngine|\PHPUnit_Framework_MockObject_MockObject - */ - protected $searchEngine; - - /** - * @var \Magento\Catalog\Model\SearchResponseBuilder|\PHPUnit_Framework_MockObject_MockObject - */ - protected $searchResponseBuilder; - - /** - * @var \Magento\Framework\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject - */ - protected $scopeConfig; - /** * @var \Magento\Store\Model\StoreManagerInterface|\PHPUnit_Framework_MockObject_MockObject */ @@ -216,9 +196,6 @@ class ProductRepositoryTest extends \PHPUnit_Framework_TestCase false ); $this->resourceModelMock = $this->getMock('\Magento\Catalog\Model\Resource\Product', [], [], '', false); - $this->eavConfigMock = $this->getMock('Magento\Eav\Model\Config', [], [], '', false); - $this->eavConfigMock->expects($this->any())->method('getEntityType') - ->willReturn(new \Magento\Framework\Object(['default_attribute_set_id' => 4])); $this->objectManager = new ObjectManager($this); $this->extensibleDataObjectConverterMock = $this ->getMockBuilder('\Magento\Framework\Api\ExtensibleDataObjectConverter') @@ -229,7 +206,13 @@ class ProductRepositoryTest extends \PHPUnit_Framework_TestCase ->disableOriginalConstructor()->getMock(); $this->mimeTypeExtensionMapMock = $this->getMockBuilder('Magento\Catalog\Model\Product\Gallery\MimeTypeExtensionMap')->getMock(); - $this->contentFactoryMock = $this->getMock('Magento\Framework\Api\Data\ImageContentInterfaceFactory', ['create'], [], '', false); + $this->contentFactoryMock = $this->getMock( + 'Magento\Framework\Api\Data\ImageContentInterfaceFactory', + ['create'], + [], + '', + false + ); $this->contentValidatorMock = $this->getMockBuilder('Magento\Framework\Api\ImageContentValidatorInterface') ->disableOriginalConstructor() ->getMock(); @@ -238,22 +221,6 @@ class ProductRepositoryTest extends \PHPUnit_Framework_TestCase ['getLinkTypes'], [], '', false); $this->imageProcessorMock = $this->getMock('Magento\Framework\Api\ImageProcessorInterface', [], [], '', false); - $this->requestBuilder = $this->getMockBuilder('Magento\Framework\Search\Request\Builder') - ->disableOriginalConstructor() - ->getMock(); - - $this->searchEngine = $this->getMockBuilder('Magento\Search\Model\SearchEngine') - ->disableOriginalConstructor() - ->getMock(); - - $this->searchResponseBuilder = $this->getMockBuilder('Magento\Catalog\Model\SearchResponseBuilder') - ->disableOriginalConstructor() - ->getMock(); - - $this->scopeConfig = $this->getMockBuilder('Magento\Framework\App\Config\ScopeConfigInterface') - ->disableOriginalConstructor() - ->getMockForAbstractClass(); - $this->storeManager = $this->getMockBuilder('Magento\Store\Model\StoreManagerInterface') ->disableOriginalConstructor() ->getMockForAbstractClass(); @@ -271,17 +238,12 @@ class ProductRepositoryTest extends \PHPUnit_Framework_TestCase 'searchResultsFactory' => $this->searchResultsFactoryMock, 'extensibleDataObjectConverter' => $this->extensibleDataObjectConverterMock, 'optionConverter' => $optionConverter, - 'eavConfig' => $this->eavConfigMock, 'contentValidator' => $this->contentValidatorMock, 'fileSystem' => $this->fileSystemMock, 'contentFactory' => $this->contentFactoryMock, 'mimeTypeExtensionMap' => $this->mimeTypeExtensionMapMock, 'linkTypeProvider' => $this->linkTypeProviderMock, 'imageProcessor' => $this->imageProcessorMock, - 'requestBuilder' => $this->requestBuilder, - 'searchEngine' => $this->searchEngine, - 'searchResponseBuilder' => $this->searchResponseBuilder, - 'scopeConfig' => $this->scopeConfig, 'storeManager' => $this->storeManager, ] ); @@ -595,8 +557,6 @@ class ProductRepositoryTest extends \PHPUnit_Framework_TestCase $searchCriteriaMock = $this->getMock('\Magento\Framework\Api\SearchCriteriaInterface', [], [], '', false); $attributeCode = 'attribute_code'; $collectionMock = $this->getMock('\Magento\Catalog\Model\Resource\Product\Collection', [], [], '', false); - $filterMock = $this->getMock('\Magento\Framework\Api\Filter', [], [], '', false); - $searchCriteriaBuilderMock = $this->getMock('\Magento\Framework\Api\SearchCriteriaBuilder', [], [], '', false); $extendedSearchCriteriaMock = $this->getMock('\Magento\Framework\Api\SearchCriteria', [], [], '', false); $productAttributeSearchResultsMock = $this->getMockForAbstractClass( '\Magento\Catalog\Api\Data\ProductAttributeInterface', @@ -620,15 +580,8 @@ class ProductRepositoryTest extends \PHPUnit_Framework_TestCase $itemsMock = $this->getMock('\Magento\Framework\Object', [], [], '', false); $this->collectionFactoryMock->expects($this->once())->method('create')->willReturn($collectionMock); - $this->filterBuilderMock->expects($this->any())->method('setField')->with('attribute_set_id') - ->will($this->returnSelf()); - $this->filterBuilderMock->expects($this->once())->method('create')->willReturn($filterMock); - $this->filterBuilderMock->expects($this->once())->method('setValue') - ->with(4) - ->willReturn($this->filterBuilderMock); - $this->searchCriteriaBuilderMock->expects($this->once())->method('addFilters')->with([$filterMock]) - ->willReturn($searchCriteriaBuilderMock); - $searchCriteriaBuilderMock->expects($this->once())->method('create')->willReturn($extendedSearchCriteriaMock); + $this->searchCriteriaBuilderMock->expects($this->once())->method('create') + ->willReturn($extendedSearchCriteriaMock); $this->metadataServiceMock->expects($this->once())->method('getList')->with($extendedSearchCriteriaMock) ->willReturn($productAttributeSearchResultsMock); $productAttributeSearchResultsMock->expects($this->once())->method('getItems') @@ -1243,98 +1196,4 @@ class ProductRepositoryTest extends \PHPUnit_Framework_TestCase $this->model->save($this->productMock); $this->assertEquals($expectedResult, $this->initializedProductMock->getMediaGallery('images')); } - - public function testSearch() - { - $requestName = 'requestName'; - $searchTerm = 'searchTerm'; - $storeId = 333; - $filterField = 'filterField'; - $filterValue = 'filterValue'; - $priceRangeCalculation = 'auto'; - - $filter = $this->getMockBuilder('Magento\Framework\Api\Filter') - ->disableOriginalConstructor() - ->getMock(); - $filter->expects($this->once()) - ->method('getField') - ->willReturn($filterField); - $filter->expects($this->once()) - ->method('getValue') - ->willReturn($filterValue); - - $filterGroup = $this->getMockBuilder('Magento\Framework\Api\Search\FilterGroup') - ->disableOriginalConstructor() - ->getMock(); - $filterGroup->expects($this->once()) - ->method('getFilters') - ->willReturn([$filter]); - - $searchCriteria = $this->getMockBuilder('Magento\Framework\Api\Search\SearchCriteriaInterface') - ->disableOriginalConstructor() - ->getMockForAbstractClass(); - $searchCriteria->expects($this->once()) - ->method('getRequestName') - ->willReturn($requestName); - $searchCriteria->expects($this->once()) - ->method('getSearchTerm') - ->willReturn($searchTerm); - $searchCriteria->expects($this->once()) - ->method('getFilterGroups') - ->willReturn([$filterGroup]); - - $store = $this->getMockBuilder('Magento\Store\Model\Store') - ->disableOriginalConstructor() - ->getMock(); - $store->expects($this->once()) - ->method('getId') - ->willReturn($storeId); - - $searchResult = $this->getMockBuilder('Magento\Framework\Api\Search\SearchResult') - ->disableOriginalConstructor() - ->getMockForAbstractClass(); - - $request = $this->getMockBuilder('Magento\Framework\Search\RequestInterface') - ->disableOriginalConstructor() - ->getMockForAbstractClass(); - - $response = $this->getMockBuilder('Magento\Framework\Search\ResponseInterface') - ->disableOriginalConstructor() - ->getMockForAbstractClass(); - - $this->requestBuilder->expects($this->once()) - ->method('setRequestName') - ->with($requestName); - $this->requestBuilder->expects($this->once()) - ->method('bindDimension') - ->with('scope', $storeId); - $this->requestBuilder->expects($this->any()) - ->method('bind');; - $this->requestBuilder->expects($this->once()) - ->method('create') - ->willReturn($request); - - $this->searchEngine->expects($this->once()) - ->method('search') - ->with($request) - ->willReturn($response); - - $this->searchResponseBuilder->expects($this->once()) - ->method('build') - ->with($response) - ->willReturn($searchResult); - - $this->storeManager->expects($this->once()) - ->method('getStore') - ->willReturn($store); - - $this->scopeConfig->expects($this->once()) - ->method('getValue') - ->with(AlgorithmFactory::XML_PATH_RANGE_CALCULATION, ScopeInterface::SCOPE_STORE) - ->willReturn($priceRangeCalculation); - - $searchResult = $this->model->search($searchCriteria); - - $this->assertInstanceOf('Magento\Framework\Api\Search\SearchResultInterface', $searchResult); - } } diff --git a/app/code/Magento/Catalog/etc/module.xml b/app/code/Magento/Catalog/etc/module.xml index 93ec513556e088965ce9a2ebeeb6dccca4734a0f..ed2f204b24e5c220997f4a0b4ba0922bfe407d9f 100644 --- a/app/code/Magento/Catalog/etc/module.xml +++ b/app/code/Magento/Catalog/etc/module.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> - <module name="Magento_Catalog" setup_version="2.0.0.3"> + <module name="Magento_Catalog" setup_version="2.0.0"> <sequence> <module name="Magento_Eav"/> <module name="Magento_Cms"/> diff --git a/app/code/Magento/Catalog/etc/webapi.xml b/app/code/Magento/Catalog/etc/webapi.xml index 8ba7b4635b30aad4fd4c94e9e1229b602468c25d..ec8458cd8c9a7ebeda59b7dfdbde2fbb77b05bf6 100644 --- a/app/code/Magento/Catalog/etc/webapi.xml +++ b/app/code/Magento/Catalog/etc/webapi.xml @@ -39,12 +39,6 @@ <resource ref="anonymous" /> </resources> </route> - <route url="/V1/products/search" method="GET"> - <service class="Magento\Catalog\Api\ProductRepositoryInterface" method="search"/> - <resources> - <resource ref="anonymous" /> - </resources> - </route> <route url="/V1/products/attributes/types" method="GET"> <service class="Magento\Catalog\Api\ProductAttributeTypesListInterface" method="getItems"/> diff --git a/app/code/Magento/Catalog/view/frontend/web/js/catalog-add-to-cart.js b/app/code/Magento/Catalog/view/frontend/web/js/catalog-add-to-cart.js index 02898a8e87fff11dbfb6607fd39224bcdf9d3395..b774dd8090d1474c4ebf777b83a1c9da7cca66f1 100644 --- a/app/code/Magento/Catalog/view/frontend/web/js/catalog-add-to-cart.js +++ b/app/code/Magento/Catalog/view/frontend/web/js/catalog-add-to-cart.js @@ -74,8 +74,8 @@ define([ $('body').trigger(self.options.processStop); } - if (res.backUrl) { - window.location = res.backUrl; + if (res.redirect) { + window.location = res.redirect; return; } if (res.messages) { diff --git a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php index cef79f4f73706fba4969a990a42bc5836f244701..ef70bb6fc518f2f6c8d0319b75721350d6b60e3b 100755 --- a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php +++ b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php @@ -612,6 +612,17 @@ class IndexBuilder $select->where('rp.product_id=?', $productId); } + /** + * Join group price to result + */ + $groupPriceAttr = $this->eavConfig->getAttribute(Product::ENTITY, 'group_price'); + $select->joinLeft( + ['gp' => $groupPriceAttr->getBackend()->getResource()->getMainTable()], + 'gp.entity_id=rp.product_id AND gp.customer_group_id=rp.customer_group_id AND ' + . $this->getReadAdapter()->getCheckSql('gp.website_id=0', 'TRUE', 'gp.website_id=rp.website_id'), + 'value' + ); + /** * Join default price and websites prices to result */ @@ -653,7 +664,10 @@ class IndexBuilder [] ); $select->columns([ - 'default_price' => $this->getReadAdapter()->getIfNullSql($tableAlias . '.value', 'pp_default.value'), + 'default_price' => $this->getReadAdapter()->getIfNullSql( + 'gp.value', + $this->getReadAdapter()->getIfNullSql($tableAlias . '.value', 'pp_default.value') + ), ]); return $read->query($select); diff --git a/app/code/Magento/CatalogRule/Test/Unit/Model/Indexer/IndexBuilderTest.php b/app/code/Magento/CatalogRule/Test/Unit/Model/Indexer/IndexBuilderTest.php index 8c41a3c24276dcad12e5733216b5eb2a21cc3640..3687d55d4710fba30b24b144e14c0691e972730f 100644 --- a/app/code/Magento/CatalogRule/Test/Unit/Model/Indexer/IndexBuilderTest.php +++ b/app/code/Magento/CatalogRule/Test/Unit/Model/Indexer/IndexBuilderTest.php @@ -148,7 +148,7 @@ class IndexBuilderTest extends \PHPUnit_Framework_TestCase $this->priceCurrency = $this->getMock('Magento\Framework\Pricing\PriceCurrencyInterface'); $this->dateFormat = $this->getMock('Magento\Framework\Stdlib\DateTime', [], [], '', false); $this->dateTime = $this->getMock('Magento\Framework\Stdlib\DateTime\DateTime', [], [], '', false); - $this->eavConfig = $this->getMock('Magento\Eav\Model\Config', [], [], '', false); + $this->eavConfig = $this->getMock('Magento\Eav\Model\Config', ['getAttribute'], [], '', false); $this->product = $this->getMock('Magento\Catalog\Model\Product', [], [], '', false); $this->productFactory = $this->getMock('Magento\Catalog\Model\ProductFactory', ['create'], [], '', false); @@ -182,7 +182,6 @@ class IndexBuilderTest extends \PHPUnit_Framework_TestCase $this->combine->expects($this->any())->method('validate')->will($this->returnValue(true)); $this->attribute->expects($this->any())->method('getBackend')->will($this->returnValue($this->backend)); - $this->eavConfig->expects($this->any())->method('getAttribute')->will($this->returnValue($this->attribute)); $this->productFactory->expects($this->any())->method('create')->will($this->returnValue($this->product)); $this->indexBuilder = new \Magento\CatalogRule\Model\Indexer\IndexBuilder( @@ -206,6 +205,45 @@ class IndexBuilderTest extends \PHPUnit_Framework_TestCase */ public function testUpdateCatalogRuleGroupWebsiteData() { + $groupPriceAttrMock = $this->getMock( + 'Magento\Catalog\Model\Entity\Attribute', + ['getBackend'], + [], + '', + false + ); + $backendModelMock = $this->getMock( + 'Magento\Catalog\Model\Product\Attribute\Backend\GroupPrice', + ['getResource'], + [], + '', + false + ); + $resourceMock = $this->getMock( + 'Magento\Catalog\Model\Resource\Product\Attribute\Backend\GroupPrice', + ['getMainTable'], + [], + '', + false + ); + $resourceMock->expects($this->once()) + ->method('getMainTable') + ->will($this->returnValue('catalog_product_entity_group_price')); + $backendModelMock->expects($this->once()) + ->method('getResource') + ->will($this->returnValue($resourceMock)); + $groupPriceAttrMock->expects($this->once()) + ->method('getBackend') + ->will($this->returnValue($backendModelMock)); + $this->eavConfig->expects($this->at(0)) + ->method('getAttribute') + ->with(\Magento\Catalog\Model\Product::ENTITY, 'group_price') + ->will($this->returnValue($groupPriceAttrMock)); + $this->eavConfig->expects($this->at(1)) + ->method('getAttribute') + ->with(\Magento\Catalog\Model\Product::ENTITY, 'price') + ->will($this->returnValue($this->attribute)); + $this->select->expects($this->once())->method('insertFromSelect')->with('catalogrule_group_website'); $this->indexBuilder->reindexByIds([1]); diff --git a/app/code/Magento/CatalogSearch/Model/Indexer/IndexStructure.php b/app/code/Magento/CatalogSearch/Model/Indexer/IndexStructure.php index 2f3320648ad62b043412713649868ec794284d71..4c0166ea9c0fb4bff54aa8456c62d41c6b9ea8b5 100644 --- a/app/code/Magento/CatalogSearch/Model/Indexer/IndexStructure.php +++ b/app/code/Magento/CatalogSearch/Model/Indexer/IndexStructure.php @@ -10,7 +10,7 @@ use Magento\Framework\App\Resource; use Magento\Framework\DB\Adapter\AdapterInterface; use Magento\Framework\DB\Ddl\Table; use Magento\Framework\Search\Request\Dimension; -use Magento\Search\Model\ScopeResolver\IndexScopeResolver; +use Magento\Indexer\Model\ScopeResolver\IndexScopeResolver; class IndexStructure { diff --git a/app/code/Magento/CatalogSearch/Model/Indexer/IndexerHandler.php b/app/code/Magento/CatalogSearch/Model/Indexer/IndexerHandler.php index 47d49900ef231036e3f0406bda471f8d4f513fe5..cbaeb578ac1220fb02fb443ddc6bd43bbb3ea748 100644 --- a/app/code/Magento/CatalogSearch/Model/Indexer/IndexerHandler.php +++ b/app/code/Magento/CatalogSearch/Model/Indexer/IndexerHandler.php @@ -12,7 +12,7 @@ use Magento\Framework\IndexerInterface; use Magento\Framework\Search\Request\Dimension; use Magento\Framework\Search\Request\IndexScopeResolverInterface; use Magento\Indexer\Model\SaveHandler\Batch; -use Magento\Search\Model\ScopeResolver\IndexScopeResolver; +use Magento\Indexer\Model\ScopeResolver\IndexScopeResolver; class IndexerHandler implements IndexerInterface { @@ -61,7 +61,7 @@ class IndexerHandler implements IndexerInterface * @param Resource|Resource $resource * @param Config $eavConfig * @param Batch $batch - * @param IndexScopeResolver $indexScopeResolver + * @param \Magento\Indexer\Model\ScopeResolver\IndexScopeResolver $indexScopeResolver * @param array $data * @param int $batchSize */ diff --git a/app/code/Magento/CatalogSearch/Model/Indexer/Mview/Action.php b/app/code/Magento/CatalogSearch/Model/Indexer/Mview/Action.php new file mode 100644 index 0000000000000000000000000000000000000000..03f0fb14eadced11386b44cf80806db7afe29e3f --- /dev/null +++ b/app/code/Magento/CatalogSearch/Model/Indexer/Mview/Action.php @@ -0,0 +1,42 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\CatalogSearch\Model\Indexer\Mview; + + +use Magento\CatalogSearch\Model\Indexer\Fulltext; +use Magento\Framework\Mview\ActionInterface; +use Magento\Indexer\Model\IndexerInterfaceFactory; + +class Action implements ActionInterface +{ + /** + * @var IndexerInterfaceFactory + */ + private $indexerFactory; + + /** + * @param IndexerInterfaceFactory $indexerFactory + */ + public function __construct(IndexerInterfaceFactory $indexerFactory) + { + $this->indexerFactory = $indexerFactory; + } + + /** + * Execute materialization on ids entities + * + * @param int[] $ids + * @return void + * @api + */ + public function execute($ids) + { + /** @var \Magento\Indexer\Model\IndexerInterface $indexer */ + $indexer = $this->indexerFactory->create()->load(Fulltext::INDEXER_ID); + $indexer->reindexList($ids); + } +} diff --git a/app/code/Magento/CatalogSearch/Model/Resource/Engine.php b/app/code/Magento/CatalogSearch/Model/Resource/Engine.php index 74c767a5ab9942454d18f89f666acf2ab80c38d7..a3c39528a1d0f16a8e65b3cac43a0e5b94339725 100644 --- a/app/code/Magento/CatalogSearch/Model/Resource/Engine.php +++ b/app/code/Magento/CatalogSearch/Model/Resource/Engine.php @@ -27,7 +27,7 @@ class Engine implements EngineInterface protected $catalogProductVisibility; /** - * @var \Magento\Search\Model\ScopeResolver\IndexScopeResolver + * @var \Magento\Indexer\Model\ScopeResolver\IndexScopeResolver */ private $indexScopeResolver; @@ -35,11 +35,11 @@ class Engine implements EngineInterface * Construct * * @param \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility - * @param \Magento\Search\Model\ScopeResolver\IndexScopeResolver $indexScopeResolver + * @param \Magento\Indexer\Model\ScopeResolver\IndexScopeResolver $indexScopeResolver */ public function __construct( \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility, - \Magento\Search\Model\ScopeResolver\IndexScopeResolver $indexScopeResolver + \Magento\Indexer\Model\ScopeResolver\IndexScopeResolver $indexScopeResolver ) { $this->catalogProductVisibility = $catalogProductVisibility; $this->indexScopeResolver = $indexScopeResolver; diff --git a/app/code/Magento/CatalogSearch/Model/Search/IndexBuilder.php b/app/code/Magento/CatalogSearch/Model/Search/IndexBuilder.php index 4e6648b6f5c0805fa270b1ba20a4c1e862a6ee20..6ae4e1ba0cf88ac0a3a9f747c83ae6e1f57f7fa8 100644 --- a/app/code/Magento/CatalogSearch/Model/Search/IndexBuilder.php +++ b/app/code/Magento/CatalogSearch/Model/Search/IndexBuilder.php @@ -12,11 +12,10 @@ use Magento\Framework\DB\Select; use Magento\Framework\Search\Adapter\Mysql\ConditionManager; use Magento\Framework\Search\Adapter\Mysql\IndexBuilderInterface; use Magento\Framework\Search\Request\Dimension; -use Magento\Framework\Search\Request\Query\Bool; use Magento\Framework\Search\Request\QueryInterface; use Magento\Framework\Search\Request\QueryInterface as RequestQueryInterface; use Magento\Framework\Search\RequestInterface; -use Magento\Search\Model\ScopeResolver\IndexScopeResolver; +use Magento\Indexer\Model\ScopeResolver\IndexScopeResolver; use Magento\Store\Model\ScopeInterface; use Magento\Store\Model\StoreManagerInterface; diff --git a/app/code/Magento/CatalogSearch/Setup/InstallSchema.php b/app/code/Magento/CatalogSearch/Setup/InstallSchema.php index b9e718318b7ef7cc4ed8f2eb46dc8d06f404b05f..e5e2bf8f91ca5b9572c857914da9562adf2e39f9 100644 --- a/app/code/Magento/CatalogSearch/Setup/InstallSchema.php +++ b/app/code/Magento/CatalogSearch/Setup/InstallSchema.php @@ -21,68 +21,7 @@ class InstallSchema implements InstallSchemaInterface public function install(SchemaSetupInterface $setup, ModuleContextInterface $context) { $installer = $setup; - $installer->startSetup(); - - /** - * Create table 'catalogsearch_fulltext' - */ - $table = $installer->getConnection() - ->newTable($installer->getTable('catalogsearch_fulltext')) - ->addColumn( - 'fulltext_id', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true], - 'Entity ID' - ) - ->addColumn( - 'product_id', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['unsigned' => true, 'nullable' => false], - 'Product ID' - ) - ->addColumn( - 'store_id', - \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, - null, - ['unsigned' => true, 'nullable' => false], - 'Store ID' - ) - ->addColumn( - 'data_index', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - '4g', - [], - 'Data index' - ) - ->addIndex( - $installer->getIdxName( - 'catalogsearch_fulltext', - ['product_id', 'store_id'], - \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE - ), - ['product_id', 'store_id'], - ['type' => \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE] - ) - ->addIndex( - $installer->getIdxName( - 'catalogsearch_fulltext', - 'data_index', - \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_FULLTEXT - ), - 'data_index', - ['type' => \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_FULLTEXT] - ) - ->setOption( - 'type', - 'InnoDB' - ) - ->setComment('Catalog search result table'); - - $installer->getConnection()->createTable($table); - $installer->getConnection()->addColumn( $installer->getTable('catalog_eav_attribute'), 'search_weight', @@ -94,8 +33,6 @@ class InstallSchema implements InstallSchemaInterface 'comment' => 'Search Weight' ] ); - $installer->endSetup(); - } } diff --git a/app/code/Magento/CatalogSearch/Setup/UpgradeSchema.php b/app/code/Magento/CatalogSearch/Setup/UpgradeSchema.php deleted file mode 100644 index bd950bd1f826652e7447bc0583539f06bbf1d23a..0000000000000000000000000000000000000000 --- a/app/code/Magento/CatalogSearch/Setup/UpgradeSchema.php +++ /dev/null @@ -1,74 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\CatalogSearch\Setup; - - -use Magento\Framework\DB\Adapter\AdapterInterface; -use Magento\Framework\DB\Ddl\Table; -use Magento\Framework\Setup\UpgradeSchemaInterface; -use Magento\Framework\Setup\ModuleContextInterface; -use Magento\Framework\Setup\SchemaSetupInterface; - -/** - * @codeCoverageIgnore - */ -class UpgradeSchema implements UpgradeSchemaInterface -{ - /** - * {@inheritdoc} - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) - * @SuppressWarnings(PHPMD.CyclomaticComplexity) - * @SuppressWarnings(PHPMD.NPathComplexity) - */ - public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context) - { - $installer = $setup; - $connection = $installer->getConnection(); - if (version_compare($context->getVersion(), '2.0.1') < 0) { - $connection->dropTable($installer->getTable('catalogsearch_fulltext')); - $table = $connection->newTable($installer->getTable('catalogsearch_fulltext_index_default')) - ->addColumn( - 'FTS_DOC_ID', - Table::TYPE_BIGINT, - null, - ['unsigned' => true, 'nullable' => false, 'auto_increment' => true, 'primary' => true], - 'Entity ID' - )->addColumn( - 'product_id', - Table::TYPE_INTEGER, - 10, - ['unsigned' => true, 'nullable' => false], - 'Product ID' - )->addColumn( - 'attribute_id', - Table::TYPE_INTEGER, - 10, - ['unsigned' => true, 'nullable' => false] - )->addColumn( - 'store_id', - \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, - null, - ['unsigned' => true, 'nullable' => false], - 'Store ID' - )->addColumn( - 'data_index', - Table::TYPE_TEXT, - '4g', - ['nullable' => true], - 'Data index' - )->addIndex( - 'FTI_CATALOGSEARCH_FULLTEXT_DATA_INDEX', - ['data_index'], - ['type' => AdapterInterface::INDEX_TYPE_FULLTEXT] - ); - $connection->createTable($table); - } - if (version_compare($context->getVersion(), '2.0.2') < 0) { - $connection->dropTable('catalogsearch_fulltext_index_default'); - } - } -} diff --git a/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/IndexBuilderTest.php b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/IndexBuilderTest.php index 33ca04f2b95d2d435131ae19b30cba5676eaabb4..5e93d20132e38849d704ccd9d48dc58b83563659 100644 --- a/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/IndexBuilderTest.php +++ b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/IndexBuilderTest.php @@ -84,7 +84,7 @@ class IndexBuilderTest extends \PHPUnit_Framework_TestCase $this->storeManager = $this->getMockBuilder('Magento\Store\Model\StoreManagerInterface')->getMock(); - $this->scopeResolver = $this->getMockBuilder('\Magento\Search\Model\ScopeResolver\IndexScopeResolver') + $this->scopeResolver = $this->getMockBuilder('\Magento\Indexer\Model\ScopeResolver\IndexScopeResolver') ->disableOriginalConstructor() ->getMock(); diff --git a/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/Indexer/IndexStructureTest.php b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/Indexer/IndexStructureTest.php index a589de77d66c63b267260970eba6c4898a6ef8d3..1acbcbc51d1e93e6f8c4e8bcca1960cc0abd9f42 100644 --- a/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/Indexer/IndexStructureTest.php +++ b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/Indexer/IndexStructureTest.php @@ -16,7 +16,7 @@ use \Magento\Framework\TestFramework\Unit\Helper\ObjectManager; class IndexStructureTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Search\Model\ScopeResolver\IndexScopeResolver|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Indexer\Model\ScopeResolver\IndexScopeResolver|\PHPUnit_Framework_MockObject_MockObject */ private $indexScopeResolver; /** @@ -46,11 +46,11 @@ class IndexStructureTest extends \PHPUnit_Framework_TestCase ->method('getConnection') ->with(\Magento\Framework\App\Resource::DEFAULT_WRITE_RESOURCE) ->willReturn($this->adapter); - $this->indexScopeResolver = $this->getMockBuilder('\Magento\Search\Model\ScopeResolver\IndexScopeResolver') + $this->indexScopeResolver = $this->getMockBuilder('\Magento\Indexer\Model\ScopeResolver\IndexScopeResolver') ->setMethods(['resolve']) ->disableOriginalConstructor() ->getMock(); - $this->flatScopeResolver = $this->getMockBuilder('\Magento\Search\Model\ScopeResolver\FlatScopeResolver') + $this->flatScopeResolver = $this->getMockBuilder('\Magento\Indexer\Model\ScopeResolver\FlatScopeResolver') ->setMethods(['resolve']) ->disableOriginalConstructor() ->getMock(); diff --git a/app/code/Magento/CatalogSearch/etc/module.xml b/app/code/Magento/CatalogSearch/etc/module.xml index 64e6b45ef808e5a1b55df7ac9d2505f7f19fba46..269b6462350b0291650c8acd6cc06019b0a54993 100644 --- a/app/code/Magento/CatalogSearch/etc/module.xml +++ b/app/code/Magento/CatalogSearch/etc/module.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> - <module name="Magento_CatalogSearch" setup_version="2.0.2"> + <module name="Magento_CatalogSearch" setup_version="2.0.0"> <sequence> <module name="Magento_Search"/> <module name="Magento_Catalog"/> diff --git a/app/code/Magento/CatalogSearch/etc/mview.xml b/app/code/Magento/CatalogSearch/etc/mview.xml index dac32882981e509d2df360180f9754f818352fa6..8e9fb605186ddb7392a5d87ff38efac9df69f7f4 100644 --- a/app/code/Magento/CatalogSearch/etc/mview.xml +++ b/app/code/Magento/CatalogSearch/etc/mview.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Mview/etc/mview.xsd"> - <view id="catalogsearch_fulltext" class="Magento\CatalogSearch\Model\Indexer\Fulltext" group="indexer"> + <view id="catalogsearch_fulltext" class="\Magento\CatalogSearch\Model\Indexer\Mview\Action" group="indexer"> <subscriptions> <table name="catalog_product_entity" entity_column="entity_id" /> <table name="catalog_product_entity_int" entity_column="entity_id" /> diff --git a/app/code/Magento/Checkout/Block/Registration.php b/app/code/Magento/Checkout/Block/Registration.php index 9ba1c23b9f91831a91474bc1685628c29648184e..a54c576873982ac8c8d40a710f53dd288d6b78e2 100644 --- a/app/code/Magento/Checkout/Block/Registration.php +++ b/app/code/Magento/Checkout/Block/Registration.php @@ -24,11 +24,17 @@ class Registration extends \Magento\Framework\View\Element\Template */ protected $registration; + /** + * @var \Magento\Customer\Api\AccountManagementInterface + */ + protected $accountManagement; + /** * @param Template\Context $context * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Customer\Model\Registration $registration + * @param \Magento\Customer\Api\AccountManagementInterface $accountManagement * @param array $data */ public function __construct( @@ -36,11 +42,13 @@ class Registration extends \Magento\Framework\View\Element\Template \Magento\Checkout\Model\Session $checkoutSession, \Magento\Customer\Model\Session $customerSession, \Magento\Customer\Model\Registration $registration, + \Magento\Customer\Api\AccountManagementInterface $accountManagement, array $data = [] ) { $this->checkoutSession = $checkoutSession; $this->customerSession = $customerSession; $this->registration = $registration; + $this->accountManagement = $accountManagement; parent::__construct($context, $data); } @@ -69,7 +77,11 @@ class Registration extends \Magento\Framework\View\Element\Template */ public function toHtml() { - if ($this->customerSession->isLoggedIn() || !$this->registration->isAllowed()) { + if ( + $this->customerSession->isLoggedIn() + || !$this->registration->isAllowed() + || !$this->accountManagement->isEmailAvailable($this->getEmailAddress()) + ) { return ''; } return parent::toHtml(); diff --git a/app/code/Magento/Checkout/Controller/Cart/Add.php b/app/code/Magento/Checkout/Controller/Cart/Add.php index 05bafe1daa1ae6d614fadff393de49607e1194ba..97c2a346efc987f653bfec9d76659ebc9b080824 100644 --- a/app/code/Magento/Checkout/Controller/Cart/Add.php +++ b/app/code/Magento/Checkout/Controller/Cart/Add.php @@ -169,7 +169,7 @@ class Add extends \Magento\Checkout\Controller\Cart $result = []; if ($backUrl || $backUrl = $this->getBackUrl()) { - $result['backUrl'] = $backUrl; + $result['redirect'] = $backUrl; } else { if ($product && !$product->getIsSalable()) { $result['product'] = [ diff --git a/app/code/Magento/Checkout/etc/frontend/sections.xml b/app/code/Magento/Checkout/etc/frontend/sections.xml index 22817f7d6197073c69c5caabc6686a11dcab588d..30546be368a766207fdafcf68a14f2d2695730a0 100644 --- a/app/code/Magento/Checkout/etc/frontend/sections.xml +++ b/app/code/Magento/Checkout/etc/frontend/sections.xml @@ -40,10 +40,10 @@ <action name="checkout/onepage/saveOrder"> <section name="last-ordered-items"/> </action> - <action name="rest/*/V1/carts/*/order"> + <action name="rest/*/V1/carts/*/payment-information"> <section name="cart"/> </action> - <action name="rest/*/V1/guest-carts/*/order"> + <action name="rest/*/V1/guest-carts/*/payment-information"> <section name="cart"/> </action> </config> diff --git a/app/code/Magento/Checkout/view/frontend/web/js/action/set-payment-information.js b/app/code/Magento/Checkout/view/frontend/web/js/action/set-payment-information.js index a2ba6ecb34cd0eef638a677d7bd557b9d450c37c..f7e3c7468ea19cd7ba0a0e921ca589929368ac3b 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/action/set-payment-information.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/action/set-payment-information.js @@ -22,8 +22,8 @@ define( * Checkout for guest and registered customer. */ if (!customer.isLoggedIn()) { - serviceUrl = urlBuilder.createUrl('/guest-carts/:quoteId/set-payment-information', { - quoteId: quote.getQuoteId() + serviceUrl = urlBuilder.createUrl('/guest-carts/:cartId/set-payment-information', { + cartId: quote.getQuoteId() }); payload = { cartId: quote.getQuoteId(), diff --git a/app/code/Magento/Cms/Setup/InstallSchema.php b/app/code/Magento/Cms/Setup/InstallSchema.php index 00c2eba7289fe191a41b801fc3c8ad0749a4c20a..de6853122eba70c341d6ac3883c91fcab3e01207 100644 --- a/app/code/Magento/Cms/Setup/InstallSchema.php +++ b/app/code/Magento/Cms/Setup/InstallSchema.php @@ -9,6 +9,7 @@ namespace Magento\Cms\Setup; use Magento\Framework\Setup\InstallSchemaInterface; use Magento\Framework\Setup\ModuleContextInterface; use Magento\Framework\Setup\SchemaSetupInterface; +use Magento\Framework\DB\Adapter\AdapterInterface; /** * @codeCoverageIgnore @@ -272,7 +273,26 @@ class InstallSchema implements InstallSchemaInterface ); $installer->getConnection()->createTable($table); + $installer->getConnection()->addIndex( + $installer->getTable('cms_page'), + $setup->getIdxName( + $installer->getTable('cms_page'), + ['title', 'meta_keywords', 'meta_description', 'identifier', 'content'], + AdapterInterface::INDEX_TYPE_FULLTEXT + ), + ['title', 'meta_keywords', 'meta_description', 'identifier', 'content'], + AdapterInterface::INDEX_TYPE_FULLTEXT + ); + $installer->getConnection()->addIndex( + $installer->getTable('cms_block'), + $setup->getIdxName( + $installer->getTable('cms_block'), + ['title', 'identifier', 'content'], + AdapterInterface::INDEX_TYPE_FULLTEXT + ), + ['title', 'identifier', 'content'], + AdapterInterface::INDEX_TYPE_FULLTEXT + ); $installer->endSetup(); - } } diff --git a/app/code/Magento/Cms/Setup/UpgradeSchema.php b/app/code/Magento/Cms/Setup/UpgradeSchema.php deleted file mode 100644 index a4811055a0796b7639b52f41206a2569edf538e5..0000000000000000000000000000000000000000 --- a/app/code/Magento/Cms/Setup/UpgradeSchema.php +++ /dev/null @@ -1,52 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Cms\Setup; - -use Magento\Framework\DB\Adapter\AdapterInterface; -use Magento\Framework\Setup\UpgradeSchemaInterface; -use Magento\Framework\Setup\ModuleContextInterface; -use Magento\Framework\Setup\SchemaSetupInterface; - -/** - * @codeCoverageIgnore - */ -class UpgradeSchema implements UpgradeSchemaInterface -{ - /** - * {@inheritdoc} - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) - * @SuppressWarnings(PHPMD.CyclomaticComplexity) - * @SuppressWarnings(PHPMD.NPathComplexity) - */ - public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context) - { - $installer = $setup; - $connection = $installer->getConnection(); - if (version_compare($context->getVersion(), '2.0.1') < 0) { - $connection->addIndex( - $installer->getTable('cms_page'), - $setup->getIdxName( - $installer->getTable('cms_page'), - ['title', 'meta_keywords', 'meta_description', 'identifier', 'content'], - AdapterInterface::INDEX_TYPE_FULLTEXT - ), - ['title', 'meta_keywords', 'meta_description', 'identifier', 'content'], - AdapterInterface::INDEX_TYPE_FULLTEXT - ); - $connection->addIndex( - $installer->getTable('cms_block'), - $setup->getIdxName( - $installer->getTable('cms_block'), - ['title', 'identifier', 'content'], - AdapterInterface::INDEX_TYPE_FULLTEXT - ), - ['title', 'identifier', 'content'], - AdapterInterface::INDEX_TYPE_FULLTEXT - ); - } - } -} diff --git a/app/code/Magento/Cms/etc/module.xml b/app/code/Magento/Cms/etc/module.xml index 4303db7c6ae4c4a306c09bf1cb65877e48f153b4..9103575c3a6b146e2e8fa1559ac1eeb91fd4625c 100644 --- a/app/code/Magento/Cms/etc/module.xml +++ b/app/code/Magento/Cms/etc/module.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> - <module name="Magento_Cms" setup_version="2.0.1"> + <module name="Magento_Cms" setup_version="2.0.0"> <sequence> <module name="Magento_Store"/> <module name="Magento_Theme"/> diff --git a/app/code/Magento/Cms/view/adminhtml/ui_component/cms_page_listing.xml b/app/code/Magento/Cms/view/adminhtml/ui_component/cms_page_listing.xml index 06396855cc8eaefb8843dfd1bcda5f669a35b116..c6e57282e4739b5e4910be3d43647edfe7a649ca 100644 --- a/app/code/Magento/Cms/view/adminhtml/ui_component/cms_page_listing.xml +++ b/app/code/Magento/Cms/view/adminhtml/ui_component/cms_page_listing.xml @@ -250,6 +250,108 @@ </argument> </filterDate> </filterRange> + <filterRange name="custom_theme_from" class="Magento\Ui\Component\Filters\Type\DateRange"> + <argument name="data" xsi:type="array"> + <item name="config" xsi:type="array"> + <item name="dataScope" xsi:type="string">custom_theme_from</item> + <item name="label" xsi:type="string" translate="true">Custom design from</item> + <item name="childDefaults" xsi:type="array"> + <item name="provider" xsi:type="string">cms_page_listing.cms_page_listing.listing_top.listing_filters</item> + </item> + </item> + </argument> + <filterDate name="from"> + <argument name="data" xsi:type="array"> + <item name="config" xsi:type="array"> + <item name="dataScope" xsi:type="string">from</item> + <item name="label" xsi:type="string" translate="true">from</item> + <item name="placeholder" xsi:type="string" translate="true">From</item> + <item name="dateFormat" xsi:type="string" translate="true">MM/dd/YYYY</item> + </item> + </argument> + </filterDate> + <filterDate name="to"> + <argument name="data" xsi:type="array"> + <item name="config" xsi:type="array"> + <item name="dataScope" xsi:type="string">to</item> + <item name="label" xsi:type="string" translate="true">to</item> + <item name="placeholder" xsi:type="string" translate="true">To</item> + <item name="dateFormat" xsi:type="string" translate="true">MM/dd/YYYY</item> + </item> + </argument> + </filterDate> + </filterRange> + <filterRange name="custom_theme_to" class="Magento\Ui\Component\Filters\Type\DateRange"> + <argument name="data" xsi:type="array"> + <item name="config" xsi:type="array"> + <item name="dataScope" xsi:type="string">custom_theme_to</item> + <item name="label" xsi:type="string" translate="true">Custom design to</item> + <item name="childDefaults" xsi:type="array"> + <item name="provider" xsi:type="string">cms_page_listing.cms_page_listing.listing_top.listing_filters</item> + </item> + </item> + </argument> + <filterDate name="from"> + <argument name="data" xsi:type="array"> + <item name="config" xsi:type="array"> + <item name="dataScope" xsi:type="string">from</item> + <item name="label" xsi:type="string" translate="true">from</item> + <item name="placeholder" xsi:type="string" translate="true">From</item> + <item name="dateFormat" xsi:type="string" translate="true">MM/dd/YYYY</item> + </item> + </argument> + </filterDate> + <filterDate name="to"> + <argument name="data" xsi:type="array"> + <item name="config" xsi:type="array"> + <item name="dataScope" xsi:type="string">to</item> + <item name="label" xsi:type="string" translate="true">to</item> + <item name="placeholder" xsi:type="string" translate="true">To</item> + <item name="dateFormat" xsi:type="string" translate="true">MM/dd/YYYY</item> + </item> + </argument> + </filterDate> + </filterRange> + <filterSelect name="custom_theme"> + <argument name="optionsProvider" xsi:type="configurableObject"> + <argument name="class" xsi:type="string">Magento\Cms\Model\Page\Source\Theme</argument> + </argument> + <argument name="data" xsi:type="array"> + <item name="config" xsi:type="array"> + <item name="dataScope" xsi:type="string">custom_theme</item> + <item name="caption" xsi:type="string" translate="true">Select...</item> + <item name="label" xsi:type="string" translate="true">Custom Theme</item> + </item> + </argument> + </filterSelect> + <filterSelect name="custom_root_template"> + <argument name="optionsProvider" xsi:type="configurableObject"> + <argument name="class" xsi:type="string">Magento\Cms\Model\Page\Source\PageLayout</argument> + </argument> + <argument name="data" xsi:type="array"> + <item name="config" xsi:type="array"> + <item name="dataScope" xsi:type="string">custom_root_template</item> + <item name="caption" xsi:type="string" translate="true">Select...</item> + <item name="label" xsi:type="string" translate="true">Custom Layout</item> + </item> + </argument> + </filterSelect> + <filterInput name="meta_keywords"> + <argument name="data" xsi:type="array"> + <item name="config" xsi:type="array"> + <item name="dataScope" xsi:type="string">meta_keywords</item> + <item name="label" xsi:type="string" translate="true">Meta Keywords</item> + </item> + </argument> + </filterInput> + <filterInput name="meta_description"> + <argument name="data" xsi:type="array"> + <item name="config" xsi:type="array"> + <item name="dataScope" xsi:type="string">meta_description</item> + <item name="label" xsi:type="string" translate="true">Meta Description</item> + </item> + </argument> + </filterInput> </filters> <massaction name="listing_massaction"> <argument name="data" xsi:type="array"> diff --git a/app/code/Magento/ConfigurableProduct/etc/module.xml b/app/code/Magento/ConfigurableProduct/etc/module.xml index 22393b16759b2da0732c097c4684f649a05404a3..193c0adb48ca30fddfaad582ac09a792904ff361 100644 --- a/app/code/Magento/ConfigurableProduct/etc/module.xml +++ b/app/code/Magento/ConfigurableProduct/etc/module.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> - <module name="Magento_ConfigurableProduct" setup_version="2.0.1"> + <module name="Magento_ConfigurableProduct" setup_version="2.0.0"> <sequence> <module name="Magento_Catalog"/> <module name="Magento_Msrp"/> diff --git a/app/code/Magento/CurrencySymbol/etc/module.xml b/app/code/Magento/CurrencySymbol/etc/module.xml index 30fab952ed73f8d10307fe621b9d2af2087c69da..97cf5f60eefb333e86154d3dd5535e5b3484c5c7 100644 --- a/app/code/Magento/CurrencySymbol/etc/module.xml +++ b/app/code/Magento/CurrencySymbol/etc/module.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> - <module name="Magento_CurrencySymbol" setup_version="1.0.0.0.0"> + <module name="Magento_CurrencySymbol" setup_version="2.0.0"> <sequence> <module name="Magento_Widget"/> </sequence> diff --git a/app/code/Magento/Customer/Api/Data/CustomerInterface.php b/app/code/Magento/Customer/Api/Data/CustomerInterface.php index fa6cc7fb97a82fcc3985e5fe77280a01bc826b73..3a125e7231a6a71295487cf766aa2887c516bc1b 100644 --- a/app/code/Magento/Customer/Api/Data/CustomerInterface.php +++ b/app/code/Magento/Customer/Api/Data/CustomerInterface.php @@ -218,7 +218,7 @@ interface CustomerInterface extends \Magento\Framework\Api\CustomAttributesDataI * * @api * @param string $lastname - * @return string + * @return $this */ public function setLastname($lastname); diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Newsletter.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Newsletter.php index 7e84b670e96cc42a1d0230f19dc8a52d8c487491..88c547452536a42de1d28a6c1d3758311d71c086 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Newsletter.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Newsletter.php @@ -154,15 +154,17 @@ class Newsletter extends \Magento\Backend\Block\Widget\Form\Generic implements T [ 'label' => __('Subscribed to Newsletter'), 'name' => 'subscription', - 'data-form-part' => $this->getData('target_form') + 'data-form-part' => $this->getData('target_form'), + 'onchange' => 'this.value = this.checked;' ] ); if ($this->customerAccountManagement->isReadOnly($customerId)) { $form->getElement('subscription')->setReadonly(true, true); } - - $form->getElement('subscription')->setIsChecked($subscriber->isSubscribed()); + $isSubscribed = $subscriber->isSubscribed(); + $form->setValues(['subscription' => $isSubscribed ? 'true' : 'false']); + $form->getElement('subscription')->setIsChecked($isSubscribed); $changedDate = $this->getStatusChangedDate(); if ($changedDate) { @@ -170,7 +172,7 @@ class Newsletter extends \Magento\Backend\Block\Widget\Form\Generic implements T 'change_status_date', 'label', [ - 'label' => $subscriber->isSubscribed() ? __('Last Date Subscribed') : __('Last Date Unsubscribed'), + 'label' => $isSubscribed ? __('Last Date Subscribed') : __('Last Date Unsubscribed'), 'value' => $changedDate, 'bold' => true ] diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index.php b/app/code/Magento/Customer/Controller/Adminhtml/Index.php index 2d84f59c80f84d81d66000c07bb485f694816b39..ef5976c4f4bcbef8c923b457da66bb87f031b9b1 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index.php @@ -229,20 +229,16 @@ class Index extends \Magento\Backend\App\Action /** * Customer initialization * - * @param string $idFieldName * @return string customer id */ - protected function _initCustomer($idFieldName = 'id') + protected function initCurrentCustomer() { - $customerId = (int)$this->getRequest()->getParam($idFieldName); - $customer = $this->_objectManager->create('Magento\Customer\Model\Customer'); + $customerId = (int)$this->getRequest()->getParam('id'); + if ($customerId) { - $customer->load($customerId); $this->_coreRegistry->register(RegistryConstants::CURRENT_CUSTOMER_ID, $customerId); } - // TODO: Investigate if any piece of code still relies on this; remove if not. - $this->_coreRegistry->register(RegistryConstants::CURRENT_CUSTOMER, $customer); return $customerId; } diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index/Cart.php b/app/code/Magento/Customer/Controller/Adminhtml/Index/Cart.php index 3050408cda037c5efa53dc02f43684c56211ac5a..e1c4dd68c9cdedc61beaf09a035d0ba84ad83084 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index/Cart.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index/Cart.php @@ -16,7 +16,7 @@ class Cart extends \Magento\Customer\Controller\Adminhtml\Index */ public function execute() { - $this->_initCustomer(); + $customerId = $this->initCurrentCustomer(); $websiteId = $this->getRequest()->getParam('website_id'); // delete an item from cart @@ -26,9 +26,7 @@ class Cart extends \Magento\Customer\Controller\Adminhtml\Index $quoteRepository = $this->_objectManager->create('Magento\Quote\Model\QuoteRepository'); /** @var \Magento\Quote\Model\Quote $quote */ try { - $quote = $quoteRepository->getForCustomer( - $this->_coreRegistry->registry(RegistryConstants::CURRENT_CUSTOMER_ID) - ); + $quote = $quoteRepository->getForCustomer($customerId); } catch (\Magento\Framework\Exception\NoSuchEntityException $e) { $quote = $quoteRepository->create(); } diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index/Carts.php b/app/code/Magento/Customer/Controller/Adminhtml/Index/Carts.php index 37cb09d45a64a6b5ab0e38ee9f41df842a19268a..4c4cb77fa3bd55adc8efa5d9e581b6d5d6c4cd0d 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index/Carts.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index/Carts.php @@ -14,7 +14,7 @@ class Carts extends \Magento\Customer\Controller\Adminhtml\Index */ public function execute() { - $this->_initCustomer(); + $this->initCurrentCustomer(); $resultLayout = $this->resultLayoutFactory->create(); return $resultLayout; } diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index/Delete.php b/app/code/Magento/Customer/Controller/Adminhtml/Index/Delete.php index 03fdd7af98f901f50c8619525cceffd12b2a2d1e..51afccd016346ed11bc370784b45c9354a5f6752 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index/Delete.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index/Delete.php @@ -5,7 +5,6 @@ */ namespace Magento\Customer\Controller\Adminhtml\Index; -use Magento\Customer\Controller\RegistryConstants; use Magento\Framework\Controller\ResultFactory; class Delete extends \Magento\Customer\Controller\Adminhtml\Index @@ -17,8 +16,7 @@ class Delete extends \Magento\Customer\Controller\Adminhtml\Index */ public function execute() { - $this->_initCustomer(); - $customerId = $this->_coreRegistry->registry(RegistryConstants::CURRENT_CUSTOMER_ID); + $customerId = $this->initCurrentCustomer(); if (!empty($customerId)) { try { $this->_customerRepository->deleteById($customerId); diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index/Edit.php b/app/code/Magento/Customer/Controller/Adminhtml/Index/Edit.php index 7a0fa4df782dc926d4e7240ef69144c73cb043c1..64af44a9bb84e52306062e71950f59aea2441755 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index/Edit.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index/Edit.php @@ -20,7 +20,7 @@ class Edit extends \Magento\Customer\Controller\Adminhtml\Index */ public function execute() { - $customerId = $this->_initCustomer(); + $customerId = $this->initCurrentCustomer(); $customerData = []; $customerData['account'] = []; diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index/LastOrders.php b/app/code/Magento/Customer/Controller/Adminhtml/Index/LastOrders.php index eb9e594860d227c3599d7ab185958ba955dc318e..fa0dcca712a90e36a35e3df03c6facb44bb31c65 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index/LastOrders.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index/LastOrders.php @@ -14,7 +14,7 @@ class LastOrders extends \Magento\Customer\Controller\Adminhtml\Index */ public function execute() { - $this->_initCustomer(); + $this->initCurrentCustomer(); $resultLayout = $this->resultLayoutFactory->create(); return $resultLayout; } diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index/Newsletter.php b/app/code/Magento/Customer/Controller/Adminhtml/Index/Newsletter.php index cd0db70daa4b2311cf0fec87da897b77793a47c1..6c27c0a46bd8f1ce3e3b62049bc89e70e364ed9f 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index/Newsletter.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index/Newsletter.php @@ -5,8 +5,6 @@ */ namespace Magento\Customer\Controller\Adminhtml\Index; -use Magento\Customer\Controller\RegistryConstants; - class Newsletter extends \Magento\Customer\Controller\Adminhtml\Index { /** @@ -16,8 +14,7 @@ class Newsletter extends \Magento\Customer\Controller\Adminhtml\Index */ public function execute() { - $this->_initCustomer(); - $customerId = $this->_coreRegistry->registry(RegistryConstants::CURRENT_CUSTOMER_ID); + $customerId = $this->initCurrentCustomer(); /** @var \Magento\Newsletter\Model\Subscriber $subscriber */ $subscriber = $this->_objectManager ->create('Magento\Newsletter\Model\Subscriber') diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index/Orders.php b/app/code/Magento/Customer/Controller/Adminhtml/Index/Orders.php index 649c0c649ec8a8a747d6fbf75a94d3ceee080b67..c825e5c24a85b8f8e83e1a8bf101fbc648e8fc58 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index/Orders.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index/Orders.php @@ -14,7 +14,7 @@ class Orders extends \Magento\Customer\Controller\Adminhtml\Index */ public function execute() { - $this->_initCustomer(); + $this->initCurrentCustomer(); $resultLayout = $this->resultLayoutFactory->create(); return $resultLayout; } diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index/ProductReviews.php b/app/code/Magento/Customer/Controller/Adminhtml/Index/ProductReviews.php index b6a2e0072a06426e19ce4605146190b93633344f..effaa2618f25a46c66b7d59d5cf50f44277614bb 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index/ProductReviews.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index/ProductReviews.php @@ -5,8 +5,6 @@ */ namespace Magento\Customer\Controller\Adminhtml\Index; -use Magento\Customer\Controller\RegistryConstants; - class ProductReviews extends \Magento\Customer\Controller\Adminhtml\Index { /** @@ -16,11 +14,10 @@ class ProductReviews extends \Magento\Customer\Controller\Adminhtml\Index */ public function execute() { - $this->_initCustomer(); + $customerId = $this->initCurrentCustomer(); $resultLayout = $this->resultLayoutFactory->create(); $block = $resultLayout->getLayout()->getBlock('admin.customer.reviews'); - $block->setCustomerId($this->_coreRegistry->registry(RegistryConstants::CURRENT_CUSTOMER_ID)) - ->setUseAjax(true); + $block->setCustomerId($customerId)->setUseAjax(true); return $resultLayout; } } diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index/Save.php b/app/code/Magento/Customer/Controller/Adminhtml/Index/Save.php index 7e5dfa946452313a05977bd4a94d0870246e782a..ca03623385b968619ce412b8898b2f7d7c6bcb74 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index/Save.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index/Save.php @@ -74,7 +74,7 @@ class Save extends \Magento\Customer\Controller\Adminhtml\Index \Magento\Customer\Model\Metadata\Form $metadataForm = null ) { if ($metadataForm === null) { - $metadataForm = $this->_objectManager->get('Magento\Customer\Model\Metadata\FormFactory')->create( + $metadataForm = $this->_formFactory->create( $entityType, $formCode, [], @@ -236,14 +236,16 @@ class Save extends \Magento\Customer\Controller\Adminhtml\Index $customerId = $customer->getId(); } - $isSubscribed = false; + $isSubscribed = null; if ($this->_authorization->isAllowed(null)) { - $isSubscribed = $this->getRequest()->getPost('subscription') !== null; + $isSubscribed = $this->getRequest()->getPost('subscription'); } - if ($isSubscribed) { - $this->_subscriberFactory->create()->subscribeCustomerById($customerId); - } else { - $this->_subscriberFactory->create()->unsubscribeCustomerById($customerId); + if ($isSubscribed !== null) { + if ($isSubscribed !== 'false') { + $this->_subscriberFactory->create()->subscribeCustomerById($customerId); + } else { + $this->_subscriberFactory->create()->unsubscribeCustomerById($customerId); + } } // After save diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index/ViewCart.php b/app/code/Magento/Customer/Controller/Adminhtml/Index/ViewCart.php index 9dc52176624afaf492189d8eb4d5c552f6619461..ee95065596c0aff229956b2b9b14eeabc44dc04d 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index/ViewCart.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index/ViewCart.php @@ -14,7 +14,7 @@ class ViewCart extends \Magento\Customer\Controller\Adminhtml\Index */ public function execute() { - $this->_initCustomer(); + $this->initCurrentCustomer(); $resultLayout = $this->resultLayoutFactory->create(); $resultLayout->getLayout()->getBlock('admin.customer.view.cart')->setWebsiteId( (int)$this->getRequest()->getParam('website_id') diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index/ViewWishlist.php b/app/code/Magento/Customer/Controller/Adminhtml/Index/ViewWishlist.php index b4ba61be29f66d6b06415e28ff4448e3e8e53e32..34fa6b66a1187bc68a069db5da9ea1cf3386c8dc 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index/ViewWishlist.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index/ViewWishlist.php @@ -14,7 +14,7 @@ class ViewWishlist extends \Magento\Customer\Controller\Adminhtml\Index */ public function execute() { - $this->_initCustomer(); + $this->initCurrentCustomer(); $resultLayout = $this->resultLayoutFactory->create(); return $resultLayout; } diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index/Wishlist.php b/app/code/Magento/Customer/Controller/Adminhtml/Index/Wishlist.php index ee767b848796a4bd6a63d3f8b1c844266343050d..6f7e0e3bfbd81934b39cff712c45c6e83ab3271f 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index/Wishlist.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index/Wishlist.php @@ -5,8 +5,6 @@ */ namespace Magento\Customer\Controller\Adminhtml\Index; -use Magento\Customer\Controller\RegistryConstants; - class Wishlist extends \Magento\Customer\Controller\Adminhtml\Index { /** @@ -16,8 +14,7 @@ class Wishlist extends \Magento\Customer\Controller\Adminhtml\Index */ public function execute() { - $this->_initCustomer(); - $customerId = $this->_coreRegistry->registry(RegistryConstants::CURRENT_CUSTOMER_ID); + $customerId = $this->initCurrentCustomer(); $itemId = (int)$this->getRequest()->getParam('delete'); if ($customerId && $itemId) { try { diff --git a/app/code/Magento/Customer/Controller/RegistryConstants.php b/app/code/Magento/Customer/Controller/RegistryConstants.php index 809bfe539c73468469a7b14533e0d5b0848448c8..53d3a4454f16fc5ec2f4c4091d10b1ed651d379a 100644 --- a/app/code/Magento/Customer/Controller/RegistryConstants.php +++ b/app/code/Magento/Customer/Controller/RegistryConstants.php @@ -11,12 +11,6 @@ namespace Magento\Customer\Controller; */ class RegistryConstants { - /** - * Registry key where current customer DTO stored - * @todo switch to use ID instead and remove after refactoring of all occurrences - */ - const CURRENT_CUSTOMER = 'current_customer'; - /** * Registry key where current customer ID is stored */ diff --git a/app/code/Magento/Customer/Model/Customer.php b/app/code/Magento/Customer/Model/Customer.php index 6cc9db5d12676b11ee38d47310a7a4a9d225d844..9d5282327fd1794a7e6bfef76e9a7100c37651e4 100644 --- a/app/code/Magento/Customer/Model/Customer.php +++ b/app/code/Magento/Customer/Model/Customer.php @@ -11,7 +11,6 @@ use Magento\Customer\Model\Config\Share; use Magento\Customer\Model\Resource\Address\CollectionFactory; use Magento\Customer\Model\Resource\Customer as ResourceCustomer; use Magento\Customer\Api\Data\CustomerInterfaceFactory; -use Magento\Customer\Model\Data\Customer as CustomerData; use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\Reflection\DataObjectProcessor; use Magento\Framework\Exception\EmailNotConfirmedException; @@ -394,52 +393,6 @@ class Customer extends \Magento\Framework\Model\AbstractModel return $this; } - /** - * Processing object before save data - * - * @return $this - */ - public function beforeSave() - { - parent::beforeSave(); - - $storeId = $this->getStoreId(); - if ($storeId === null) { - $this->setStoreId($this->_storeManager->getStore()->getId()); - } - - $this->getGroupId(); - return $this; - } - - /** - * {@inheritdoc} - */ - public function afterSave() - { - $customerData = (array)$this->getData(); - $customerData[CustomerData::ID] = $this->getId(); - $dataObject = $this->customerDataFactory->create(); - $this->dataObjectHelper->populateWithArray( - $dataObject, - $customerData, - '\Magento\Customer\Api\Data\CustomerInterface' - ); - $customerOrigData = (array)$this->getOrigData(); - $customerOrigData[CustomerData::ID] = $this->getId(); - $origDataObject = $this->customerDataFactory->create(); - $this->dataObjectHelper->populateWithArray( - $origDataObject, - $customerOrigData, - '\Magento\Customer\Api\Data\CustomerInterface' - ); - $this->_eventManager->dispatch( - 'customer_save_after_data_object', - ['customer_data_object' => $dataObject, 'orig_customer_data_object' => $origDataObject] - ); - return parent::afterSave(); - } - /** * Change customer password * diff --git a/app/code/Magento/Customer/Model/Resource/Address.php b/app/code/Magento/Customer/Model/Resource/Address.php index d45f79f9a662574a3ca5c5db2cefadfe299c1274..2b1adcc1259f561054fa731cfa97fed19a056a86 100644 --- a/app/code/Magento/Customer/Model/Resource/Address.php +++ b/app/code/Magento/Customer/Model/Resource/Address.php @@ -7,8 +7,6 @@ */ namespace Magento\Customer\Model\Resource; -use Magento\Framework\Exception\InputException; - class Address extends \Magento\Eav\Model\Entity\VersionControl\AbstractEntity { /** @@ -17,16 +15,16 @@ class Address extends \Magento\Eav\Model\Entity\VersionControl\AbstractEntity protected $_validatorFactory; /** - * @var \Magento\Customer\Model\CustomerFactory + * @var \Magento\Customer\Api\CustomerRepositoryInterface */ - protected $_customerFactory; + protected $customerRepository; /** * @param \Magento\Eav\Model\Entity\Context $context * @param \Magento\Framework\Model\Resource\Db\VersionControl\Snapshot $entitySnapshot, * @param \Magento\Framework\Model\Resource\Db\VersionControl\RelationComposite $entityRelationComposite, * @param \Magento\Framework\Validator\Factory $validatorFactory - * @param \Magento\Customer\Model\CustomerFactory $customerFactory + * @param \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository * @param array $data */ public function __construct( @@ -34,11 +32,11 @@ class Address extends \Magento\Eav\Model\Entity\VersionControl\AbstractEntity \Magento\Framework\Model\Resource\Db\VersionControl\Snapshot $entitySnapshot, \Magento\Framework\Model\Resource\Db\VersionControl\RelationComposite $entityRelationComposite, \Magento\Framework\Validator\Factory $validatorFactory, - \Magento\Customer\Model\CustomerFactory $customerFactory, + \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository, $data = [] ) { + $this->customerRepository = $customerRepository; $this->_validatorFactory = $validatorFactory; - $this->_customerFactory = $customerFactory; parent::__construct($context, $entitySnapshot, $entityRelationComposite, $data); } @@ -102,14 +100,6 @@ class Address extends \Magento\Eav\Model\Entity\VersionControl\AbstractEntity } } - /** - * @return \Magento\Customer\Model\Customer - */ - protected function _createCustomer() - { - return $this->_customerFactory->create(); - } - /** * {@inheritdoc} */ @@ -126,14 +116,14 @@ class Address extends \Magento\Eav\Model\Entity\VersionControl\AbstractEntity protected function _afterDelete(\Magento\Framework\Object $address) { if ($address->getId()) { - $customer = $this->_createCustomer()->load($address->getCustomerId()); + $customer = $this->customerRepository->getById($address->getCustomerId()); if ($customer->getDefaultBilling() == $address->getId()) { $customer->setDefaultBilling(null); } if ($customer->getDefaultShipping() == $address->getId()) { $customer->setDefaultShipping(null); } - $customer->save(); + $this->customerRepository->save($customer); } return parent::_afterDelete($address); } diff --git a/app/code/Magento/Customer/Model/Resource/Customer.php b/app/code/Magento/Customer/Model/Resource/Customer.php index 16666b61689da0ccd4a50124c4128410b3bea0db..7a793a489aca8e401d03d608ba6552a958ff5320 100644 --- a/app/code/Magento/Customer/Model/Resource/Customer.php +++ b/app/code/Magento/Customer/Model/Resource/Customer.php @@ -31,6 +31,11 @@ class Customer extends \Magento\Eav\Model\Entity\VersionControl\AbstractEntity */ protected $dateTime; + /** + * @var \Magento\Store\Model\StoreManagerInterface + */ + protected $storeManager; + /** * @param \Magento\Eav\Model\Entity\Context $context * @param \Magento\Framework\Model\Resource\Db\VersionControl\Snapshot $entitySnapshot @@ -38,6 +43,7 @@ class Customer extends \Magento\Eav\Model\Entity\VersionControl\AbstractEntity * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Framework\Validator\Factory $validatorFactory * @param \Magento\Framework\Stdlib\DateTime $dateTime + * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param array $data */ public function __construct( @@ -47,12 +53,14 @@ class Customer extends \Magento\Eav\Model\Entity\VersionControl\AbstractEntity \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Framework\Validator\Factory $validatorFactory, \Magento\Framework\Stdlib\DateTime $dateTime, + \Magento\Store\Model\StoreManagerInterface $storeManager, $data = [] ) { parent::__construct($context, $entitySnapshot, $entityRelationComposite, $data); $this->_scopeConfig = $scopeConfig; $this->_validatorFactory = $validatorFactory; $this->dateTime = $dateTime; + $this->storeManager = $storeManager; $this->setType('customer'); $this->setConnection('customer_read', 'customer_write'); } @@ -79,10 +87,17 @@ class Customer extends \Magento\Eav\Model\Entity\VersionControl\AbstractEntity * @param \Magento\Framework\Object $customer * @return $this * @throws \Magento\Framework\Exception\LocalizedException + * @SuppressWarnings(PHPMD.CyclomaticComplexity) + * @SuppressWarnings(PHPMD.NPathComplexity) */ protected function _beforeSave(\Magento\Framework\Object $customer) { /** @var \Magento\Customer\Model\Customer $customer */ + if ($customer->getStoreId() === null) { + $customer->setStoreId($this->storeManager->getStore()->getId()); + } + $customer->getGroupId(); + parent::_beforeSave($customer); if (!$customer->getEmail()) { diff --git a/app/code/Magento/Customer/Setup/InstallSchema.php b/app/code/Magento/Customer/Setup/InstallSchema.php index fc3458c5fdc5dac291626b636daebee3389da34f..a96527bb9807387283b90d3554b995769f485026 100644 --- a/app/code/Magento/Customer/Setup/InstallSchema.php +++ b/app/code/Magento/Customer/Setup/InstallSchema.php @@ -35,18 +35,6 @@ class InstallSchema implements InstallSchemaInterface null, ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true], 'Entity Id' - )->addColumn( - 'entity_type_id', - \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, - null, - ['unsigned' => true, 'nullable' => false, 'default' => '0'], - 'Entity Type Id' - )->addColumn( - 'attribute_set_id', - \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, - null, - ['unsigned' => true, 'nullable' => false, 'default' => '0'], - 'Attribute Set Id' )->addColumn( 'website_id', \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, @@ -192,9 +180,6 @@ class InstallSchema implements InstallSchemaInterface )->addIndex( $installer->getIdxName('customer_entity', ['store_id']), ['store_id'] - )->addIndex( - $installer->getIdxName('customer_entity', ['entity_type_id']), - ['entity_type_id'] )->addIndex( $installer->getIdxName( 'customer_entity', @@ -240,18 +225,6 @@ class InstallSchema implements InstallSchemaInterface null, ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true], 'Entity Id' - )->addColumn( - 'entity_type_id', - \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, - null, - ['unsigned' => true, 'nullable' => false, 'default' => '0'], - 'Entity Type Id' - )->addColumn( - 'attribute_set_id', - \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, - null, - ['unsigned' => true, 'nullable' => false, 'default' => '0'], - 'Attribute Set Id' )->addColumn( 'increment_id', \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, @@ -422,12 +395,6 @@ class InstallSchema implements InstallSchemaInterface null, ['identity' => true, 'nullable' => false, 'primary' => true], 'Value Id' - )->addColumn( - 'entity_type_id', - \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, - null, - ['unsigned' => true, 'nullable' => false, 'default' => '0'], - 'Entity Type Id' )->addColumn( 'attribute_id', \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, @@ -454,9 +421,6 @@ class InstallSchema implements InstallSchemaInterface ), ['entity_id', 'attribute_id'], ['type' => \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE] - )->addIndex( - $installer->getIdxName('customer_address_entity_datetime', ['entity_type_id']), - ['entity_type_id'] )->addIndex( $installer->getIdxName('customer_address_entity_datetime', ['attribute_id']), ['attribute_id'] @@ -480,17 +444,6 @@ class InstallSchema implements InstallSchemaInterface $installer->getTable('customer_address_entity'), 'entity_id', \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE - )->addForeignKey( - $installer->getFkName( - 'customer_address_entity_datetime', - 'entity_type_id', - 'eav_entity_type', - 'entity_type_id' - ), - 'entity_type_id', - $installer->getTable('eav_entity_type'), - 'entity_type_id', - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE )->setComment( 'Customer Address Entity Datetime' ); @@ -507,12 +460,6 @@ class InstallSchema implements InstallSchemaInterface null, ['identity' => true, 'nullable' => false, 'primary' => true], 'Value Id' - )->addColumn( - 'entity_type_id', - \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, - null, - ['unsigned' => true, 'nullable' => false, 'default' => '0'], - 'Entity Type Id' )->addColumn( 'attribute_id', \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, @@ -539,9 +486,6 @@ class InstallSchema implements InstallSchemaInterface ), ['entity_id', 'attribute_id'], ['type' => \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE] - )->addIndex( - $installer->getIdxName('customer_address_entity_decimal', ['entity_type_id']), - ['entity_type_id'] )->addIndex( $installer->getIdxName('customer_address_entity_decimal', ['attribute_id']), ['attribute_id'] @@ -565,17 +509,6 @@ class InstallSchema implements InstallSchemaInterface $installer->getTable('customer_address_entity'), 'entity_id', \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE - )->addForeignKey( - $installer->getFkName( - 'customer_address_entity_decimal', - 'entity_type_id', - 'eav_entity_type', - 'entity_type_id' - ), - 'entity_type_id', - $installer->getTable('eav_entity_type'), - 'entity_type_id', - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE )->setComment( 'Customer Address Entity Decimal' ); @@ -592,12 +525,6 @@ class InstallSchema implements InstallSchemaInterface null, ['identity' => true, 'nullable' => false, 'primary' => true], 'Value Id' - )->addColumn( - 'entity_type_id', - \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, - null, - ['unsigned' => true, 'nullable' => false, 'default' => '0'], - 'Entity Type Id' )->addColumn( 'attribute_id', \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, @@ -624,9 +551,6 @@ class InstallSchema implements InstallSchemaInterface ), ['entity_id', 'attribute_id'], ['type' => \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE] - )->addIndex( - $installer->getIdxName('customer_address_entity_int', ['entity_type_id']), - ['entity_type_id'] )->addIndex( $installer->getIdxName('customer_address_entity_int', ['attribute_id']), ['attribute_id'] @@ -645,12 +569,6 @@ class InstallSchema implements InstallSchemaInterface $installer->getTable('customer_address_entity'), 'entity_id', \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE - )->addForeignKey( - $installer->getFkName('customer_address_entity_int', 'entity_type_id', 'eav_entity_type', 'entity_type_id'), - 'entity_type_id', - $installer->getTable('eav_entity_type'), - 'entity_type_id', - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE )->setComment( 'Customer Address Entity Int' ); @@ -667,12 +585,6 @@ class InstallSchema implements InstallSchemaInterface null, ['identity' => true, 'nullable' => false, 'primary' => true], 'Value Id' - )->addColumn( - 'entity_type_id', - \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, - null, - ['unsigned' => true, 'nullable' => false, 'default' => '0'], - 'Entity Type Id' )->addColumn( 'attribute_id', \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, @@ -699,9 +611,6 @@ class InstallSchema implements InstallSchemaInterface ), ['entity_id', 'attribute_id'], ['type' => \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE] - )->addIndex( - $installer->getIdxName('customer_address_entity_text', ['entity_type_id']), - ['entity_type_id'] )->addIndex( $installer->getIdxName('customer_address_entity_text', ['attribute_id']), ['attribute_id'] @@ -717,17 +626,6 @@ class InstallSchema implements InstallSchemaInterface $installer->getTable('customer_address_entity'), 'entity_id', \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE - )->addForeignKey( - $installer->getFkName( - 'customer_address_entity_text', - 'entity_type_id', - 'eav_entity_type', - 'entity_type_id' - ), - 'entity_type_id', - $installer->getTable('eav_entity_type'), - 'entity_type_id', - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE )->setComment( 'Customer Address Entity Text' ); @@ -744,12 +642,6 @@ class InstallSchema implements InstallSchemaInterface null, ['identity' => true, 'nullable' => false, 'primary' => true], 'Value Id' - )->addColumn( - 'entity_type_id', - \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, - null, - ['unsigned' => true, 'nullable' => false, 'default' => '0'], - 'Entity Type Id' )->addColumn( 'attribute_id', \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, @@ -776,9 +668,6 @@ class InstallSchema implements InstallSchemaInterface ), ['entity_id', 'attribute_id'], ['type' => \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE] - )->addIndex( - $installer->getIdxName('customer_address_entity_varchar', ['entity_type_id']), - ['entity_type_id'] )->addIndex( $installer->getIdxName('customer_address_entity_varchar', ['attribute_id']), ['attribute_id'] @@ -802,17 +691,6 @@ class InstallSchema implements InstallSchemaInterface $installer->getTable('customer_address_entity'), 'entity_id', \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE - )->addForeignKey( - $installer->getFkName( - 'customer_address_entity_varchar', - 'entity_type_id', - 'eav_entity_type', - 'entity_type_id' - ), - 'entity_type_id', - $installer->getTable('eav_entity_type'), - 'entity_type_id', - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE )->setComment( 'Customer Address Entity Varchar' ); @@ -829,12 +707,6 @@ class InstallSchema implements InstallSchemaInterface null, ['identity' => true, 'nullable' => false, 'primary' => true], 'Value Id' - )->addColumn( - 'entity_type_id', - \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, - null, - ['unsigned' => true, 'nullable' => false, 'default' => '0'], - 'Entity Type Id' )->addColumn( 'attribute_id', \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, @@ -861,9 +733,6 @@ class InstallSchema implements InstallSchemaInterface ), ['entity_id', 'attribute_id'], ['type' => \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE] - )->addIndex( - $installer->getIdxName('customer_entity_datetime', ['entity_type_id']), - ['entity_type_id'] )->addIndex( $installer->getIdxName('customer_entity_datetime', ['attribute_id']), ['attribute_id'] @@ -882,12 +751,6 @@ class InstallSchema implements InstallSchemaInterface $installer->getTable('customer_entity'), 'entity_id', \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE - )->addForeignKey( - $installer->getFkName('customer_entity_datetime', 'entity_type_id', 'eav_entity_type', 'entity_type_id'), - 'entity_type_id', - $installer->getTable('eav_entity_type'), - 'entity_type_id', - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE )->setComment( 'Customer Entity Datetime' ); @@ -904,12 +767,6 @@ class InstallSchema implements InstallSchemaInterface null, ['identity' => true, 'nullable' => false, 'primary' => true], 'Value Id' - )->addColumn( - 'entity_type_id', - \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, - null, - ['unsigned' => true, 'nullable' => false, 'default' => '0'], - 'Entity Type Id' )->addColumn( 'attribute_id', \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, @@ -936,9 +793,6 @@ class InstallSchema implements InstallSchemaInterface ), ['entity_id', 'attribute_id'], ['type' => \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE] - )->addIndex( - $installer->getIdxName('customer_entity_decimal', ['entity_type_id']), - ['entity_type_id'] )->addIndex( $installer->getIdxName('customer_entity_decimal', ['attribute_id']), ['attribute_id'] @@ -957,12 +811,6 @@ class InstallSchema implements InstallSchemaInterface $installer->getTable('customer_entity'), 'entity_id', \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE - )->addForeignKey( - $installer->getFkName('customer_entity_decimal', 'entity_type_id', 'eav_entity_type', 'entity_type_id'), - 'entity_type_id', - $installer->getTable('eav_entity_type'), - 'entity_type_id', - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE )->setComment( 'Customer Entity Decimal' ); @@ -979,12 +827,6 @@ class InstallSchema implements InstallSchemaInterface null, ['identity' => true, 'nullable' => false, 'primary' => true], 'Value Id' - )->addColumn( - 'entity_type_id', - \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, - null, - ['unsigned' => true, 'nullable' => false, 'default' => '0'], - 'Entity Type Id' )->addColumn( 'attribute_id', \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, @@ -1011,9 +853,6 @@ class InstallSchema implements InstallSchemaInterface ), ['entity_id', 'attribute_id'], ['type' => \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE] - )->addIndex( - $installer->getIdxName('customer_entity_int', ['entity_type_id']), - ['entity_type_id'] )->addIndex( $installer->getIdxName('customer_entity_int', ['attribute_id']), ['attribute_id'] @@ -1032,12 +871,6 @@ class InstallSchema implements InstallSchemaInterface $installer->getTable('customer_entity'), 'entity_id', \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE - )->addForeignKey( - $installer->getFkName('customer_entity_int', 'entity_type_id', 'eav_entity_type', 'entity_type_id'), - 'entity_type_id', - $installer->getTable('eav_entity_type'), - 'entity_type_id', - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE )->setComment( 'Customer Entity Int' ); @@ -1054,12 +887,6 @@ class InstallSchema implements InstallSchemaInterface null, ['identity' => true, 'nullable' => false, 'primary' => true], 'Value Id' - )->addColumn( - 'entity_type_id', - \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, - null, - ['unsigned' => true, 'nullable' => false, 'default' => '0'], - 'Entity Type Id' )->addColumn( 'attribute_id', \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, @@ -1086,9 +913,6 @@ class InstallSchema implements InstallSchemaInterface ), ['entity_id', 'attribute_id'], ['type' => \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE] - )->addIndex( - $installer->getIdxName('customer_entity_text', ['entity_type_id']), - ['entity_type_id'] )->addIndex( $installer->getIdxName('customer_entity_text', ['attribute_id']), ['attribute_id'] @@ -1104,12 +928,6 @@ class InstallSchema implements InstallSchemaInterface $installer->getTable('customer_entity'), 'entity_id', \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE - )->addForeignKey( - $installer->getFkName('customer_entity_text', 'entity_type_id', 'eav_entity_type', 'entity_type_id'), - 'entity_type_id', - $installer->getTable('eav_entity_type'), - 'entity_type_id', - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE )->setComment( 'Customer Entity Text' ); @@ -1126,12 +944,6 @@ class InstallSchema implements InstallSchemaInterface null, ['identity' => true, 'nullable' => false, 'primary' => true], 'Value Id' - )->addColumn( - 'entity_type_id', - \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, - null, - ['unsigned' => true, 'nullable' => false, 'default' => '0'], - 'Entity Type Id' )->addColumn( 'attribute_id', \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, @@ -1158,9 +970,6 @@ class InstallSchema implements InstallSchemaInterface ), ['entity_id', 'attribute_id'], ['type' => \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE] - )->addIndex( - $installer->getIdxName('customer_entity_varchar', ['entity_type_id']), - ['entity_type_id'] )->addIndex( $installer->getIdxName('customer_entity_varchar', ['attribute_id']), ['attribute_id'] @@ -1179,12 +988,6 @@ class InstallSchema implements InstallSchemaInterface $installer->getTable('customer_entity'), 'entity_id', \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE - )->addForeignKey( - $installer->getFkName('customer_entity_varchar', 'entity_type_id', 'eav_entity_type', 'entity_type_id'), - 'entity_type_id', - $installer->getTable('eav_entity_type'), - 'entity_type_id', - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE )->setComment( 'Customer Entity Varchar' ); @@ -1385,6 +1188,12 @@ class InstallSchema implements InstallSchemaInterface null, ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true], 'Visitor ID' + )->addColumn( + 'customer_id', + \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + null, + [], + 'Customer Id' )->addColumn( 'session_id', \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, @@ -1397,11 +1206,72 @@ class InstallSchema implements InstallSchemaInterface null, ['nullable' => false], 'Last Visit Time' + )->addIndex( + $installer->getIdxName('customer_visitor', ['customer_id']), + ['customer_id'] )->setComment( 'Visitor Table' ); $installer->getConnection()->createTable($table); + $table = $installer->getConnection() + ->newTable( + $installer->getTable('customer_log') + ) + ->addColumn( + 'log_id', + \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + null, + [ + 'nullable' => false, + 'identity' => true, + 'primary' => true + ], + 'Log ID' + ) + ->addColumn( + 'customer_id', + \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + null, + [ + 'nullable' => false + ], + 'Customer ID' + ) + ->addColumn( + 'last_login_at', + \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, + null, + [ + 'nullable' => true, + 'default' => null + ], + 'Last Login Time' + ) + ->addColumn( + 'last_logout_at', + \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, + null, + [ + 'nullable' => true, + 'default' => null + ], + 'Last Logout Time' + ) + ->addIndex( + $installer->getIdxName( + $installer->getTable('customer_log'), + ['customer_id'], + \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE + ), + ['customer_id'], + [ + 'type' => \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE + ] + ) + ->setComment('Customer Log Table'); + $installer->getConnection()->createTable($table); + $installer->endSetup(); } diff --git a/app/code/Magento/Customer/Setup/UpgradeSchema.php b/app/code/Magento/Customer/Setup/UpgradeSchema.php deleted file mode 100644 index 1094a6d1d3d4e2d01f90a514267432aec26be7af..0000000000000000000000000000000000000000 --- a/app/code/Magento/Customer/Setup/UpgradeSchema.php +++ /dev/null @@ -1,156 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Customer\Setup; - -use Magento\Framework\DB\Ddl\Table; -use Magento\Framework\DB\Adapter\AdapterInterface; -use Magento\Framework\Setup\UpgradeSchemaInterface; -use Magento\Framework\Setup\ModuleContextInterface; -use Magento\Framework\Setup\SchemaSetupInterface; - -/** - * @codeCoverageIgnore - */ -class UpgradeSchema implements UpgradeSchemaInterface -{ - /** - * {@inheritdoc} - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) - */ - public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context) - { - $setup->startSetup(); - - if (version_compare($context->getVersion(), '2.0.0.1') < 0) { - $installer = $setup; - $connection = $installer->getConnection(); - - $tableNames = [ - 'customer_address_entity_varchar', 'customer_address_entity_datetime', - 'customer_address_entity_decimal', 'customer_address_entity_int', 'customer_address_entity_text', - 'customer_entity_varchar', 'customer_entity_datetime', - 'customer_entity_decimal', 'customer_entity_int', 'customer_entity_text' - ]; - - foreach ($tableNames as $table) { - $connection->dropForeignKey( - $installer->getTable($table), - $installer->getFkName($table, 'entity_type_id', 'eav_entity_type', 'entity_type_id') - ); - $connection->dropIndex( - $installer->getTable($table), - $installer->getIdxName( - $installer->getTable($table), - ['entity_type_id'], - \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_INDEX - ) - ); - $connection->dropColumn($installer->getTable($table), 'entity_type_id'); - } - - $connection->dropColumn($installer->getTable('customer_address_entity'), 'entity_type_id'); - $connection->dropColumn($installer->getTable('customer_address_entity'), 'attribute_set_id'); - - $connection->dropIndex( - $installer->getTable('customer_entity'), - $installer->getIdxName('customer_entity', ['entity_type_id']) - ); - $connection->dropColumn($installer->getTable('customer_entity'), 'entity_type_id'); - $connection->dropColumn($installer->getTable('customer_entity'), 'attribute_set_id'); - } - - if (version_compare($context->getVersion(), '2.0.0.2') < 0) { - /** - * Update 'customer_visitor' table. - */ - $setup->getConnection() - ->addColumn( - $setup->getTable('customer_visitor'), - 'customer_id', - [ - 'type' => Table::TYPE_INTEGER, - 'after' => 'visitor_id', - 'comment' => 'Customer ID' - ] - ); - - $setup->getConnection() - ->addIndex( - $setup->getTable('customer_visitor'), - $setup->getIdxName( - $setup->getTable('customer_visitor'), - ['customer_id'] - ), - 'customer_id' - ); - - /** - * Create 'customer_log' table. - */ - $table = $setup->getConnection() - ->newTable( - $setup->getTable('customer_log') - ) - ->addColumn( - 'log_id', - Table::TYPE_INTEGER, - null, - [ - 'nullable' => false, - 'identity' => true, - 'primary' => true - ], - 'Log ID' - ) - ->addColumn( - 'customer_id', - Table::TYPE_INTEGER, - null, - [ - 'nullable' => false - ], - 'Customer ID' - ) - ->addColumn( - 'last_login_at', - Table::TYPE_TIMESTAMP, - null, - [ - 'nullable' => true, - 'default' => null - ], - 'Last Login Time' - ) - ->addColumn( - 'last_logout_at', - Table::TYPE_TIMESTAMP, - null, - [ - 'nullable' => true, - 'default' => null - ], - 'Last Logout Time' - ) - ->addIndex( - $setup->getIdxName( - $setup->getTable('customer_log'), - ['customer_id'], - AdapterInterface::INDEX_TYPE_UNIQUE - ), - ['customer_id'], - [ - 'type' => AdapterInterface::INDEX_TYPE_UNIQUE - ] - ) - ->setComment('Customer Log Table'); - - $setup->getConnection()->createTable($table); - } - - $setup->endSetup(); - } -} diff --git a/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Edit/Tab/NewsletterTest.php b/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Edit/Tab/NewsletterTest.php new file mode 100644 index 0000000000000000000000000000000000000000..ea31301b7a7e2c5b2f21173f1007d3e21bd91fe8 --- /dev/null +++ b/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Edit/Tab/NewsletterTest.php @@ -0,0 +1,111 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Customer\Test\Unit\Block\Adminhtml\Edit\Tab; + +use Magento\Customer\Controller\RegistryConstants; + +class NewsletterTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Customer\Block\Adminhtml\Edit\Tab\Newsletter + */ + protected $model; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $contextMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $registryMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $formFactoryMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $subscriberFactoryMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $accountManagementMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $urlBuilderMock; + + public function setUp() + { + $this->contextMock = $this->getMock('\Magento\Backend\Block\Template\Context', [], [], '', false); + $this->registryMock = $this->getMock('\Magento\Framework\Registry', [], [], '', false); + $this->formFactoryMock = $this->getMock('\Magento\Framework\Data\FormFactory', [], [], '', false); + $this->subscriberFactoryMock = $this->getMock( + '\Magento\Newsletter\Model\SubscriberFactory', + ['create'], + [], + '', + false + ); + $this->accountManagementMock = $this->getMock( + '\Magento\Customer\Api\AccountManagementInterface', + [], + [], + '', + false + ); + $this->urlBuilderMock = $this->getMock('\Magento\Framework\UrlInterface', [], [], '', false); + $this->contextMock->expects($this->once())->method('getUrlBuilder')->willReturn($this->urlBuilderMock); + + $this->model = new \Magento\Customer\Block\Adminhtml\Edit\Tab\Newsletter( + $this->contextMock, + $this->registryMock, + $this->formFactoryMock, + $this->subscriberFactoryMock, + $this->accountManagementMock + ); + } + + public function testInitFormCanNotShowTab() + { + $this->registryMock->expects($this->once())->method('registry')->with(RegistryConstants::CURRENT_CUSTOMER_ID) + ->willReturn(false); + $this->assertSame($this->model, $this->model->initForm()); + } + + public function testInitForm() + { + $subscriberMock = $this->getMock('\Magento\Newsletter\Model\Subscriber', [], [], '', false); + $fieldsetMock = $this->getMock('\Magento\Framework\Data\Form\Element\Fieldset', [], [], '', false); + $elementMock = $this->getMock('\Magento\Framework\Data\Form\Element\AbstractElement', [], [], '', false); + $formMock = $this->getMock( + '\Magento\Framework\Data\Form', + ['setHtmlIdPrefix', 'addFieldset', 'setValues', 'getElement', 'setForm', 'setParent', 'setBaseUrl'], + [], + '', + false + ); + $this->registryMock->expects($this->atLeastOnce())->method('registry')->willReturn($subscriberMock); + $this->formFactoryMock->expects($this->once())->method('create')->willReturn($formMock); + $formMock->expects($this->once())->method('setHtmlIdPrefix')->with('_newsletter'); + $this->subscriberFactoryMock->expects($this->once())->method('create')->willReturn($subscriberMock); + $subscriberMock->expects($this->once())->method('loadByCustomerId')->with($subscriberMock)->willReturnSelf(); + $this->registryMock->expects($this->once())->method('register')->with('subscriber', $subscriberMock); + $formMock->expects($this->once())->method('addFieldset')->willReturn($fieldsetMock); + $this->accountManagementMock->expects($this->once())->method('isReadOnly')->with($subscriberMock) + ->willReturn(false); + $subscriberMock->expects($this->once())->method('isSubscribed')->willReturn(true); + $formMock->expects($this->once())->method('getElement')->willReturn($elementMock); + $this->urlBuilderMock->expects($this->once())->method('getBaseUrl')->willReturn('domain.com'); + $this->assertSame($this->model, $this->model->initForm()); + } +} diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/NewsletterTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/NewsletterTest.php index 71925c695d16e05d1faeac73b026cdc22ff10d42..97599618c34b0e19a95ca2cbc101a96a35bbb7ad 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/NewsletterTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/NewsletterTest.php @@ -249,10 +249,10 @@ class NewsletterTest extends \PHPUnit_Framework_TestCase $subscriberMock->expects($this->once()) ->method('loadByCustomerId'); $this->_objectManager - ->expects($this->at(1)) + ->expects($this->any()) ->method('create') ->with('Magento\Newsletter\Model\Subscriber') - ->will($this->returnValue($subscriberMock)); + ->willReturn($subscriberMock); $this->assertInstanceOf( 'Magento\Framework\View\Result\Layout', diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/SaveTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/SaveTest.php new file mode 100644 index 0000000000000000000000000000000000000000..a8fe33e93c9852c162d1d628cdfec7e4c3da5862 --- /dev/null +++ b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/SaveTest.php @@ -0,0 +1,993 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Customer\Test\Unit\Controller\Adminhtml\Index; + +use Magento\Customer\Api\Data\AttributeMetadataInterface; +use Magento\Framework\Controller\Result\Redirect; + +/** + * @SuppressWarnings(PHPMD.TooManyFields) + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + * @covers \Magento\Customer\Controller\Adminhtml\Index\Save + * @TODO: Add coverage code with addresses logic + */ +class SaveTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Customer\Controller\Adminhtml\Index\Save + */ + protected $model; + + /** + * @var \Magento\Backend\App\Action\Context + */ + protected $context; + + /** + * @var \Magento\Framework\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $requestMock; + + /** + * @var \Magento\Backend\Model\View\Result\ForwardFactory|\PHPUnit_Framework_MockObject_MockObject + */ + protected $resultForwardFactoryMock; + + /** + * @var \Magento\Backend\Model\View\Result\Forward|\PHPUnit_Framework_MockObject_MockObject + */ + protected $resultForwardMock; + + /** + * @var \Magento\Framework\View\Result\PageFactory|\PHPUnit_Framework_MockObject_MockObject + */ + protected $resultPageFactoryMock; + + /** + * @var \Magento\Framework\View\Result\Page|\PHPUnit_Framework_MockObject_MockObject + */ + protected $resultPageMock; + + /** + * @var \Magento\Framework\View\Page\Config|\PHPUnit_Framework_MockObject_MockObject + */ + protected $pageConfigMock; + + /** + * @var \Magento\Framework\View\Page\Title|\PHPUnit_Framework_MockObject_MockObject + */ + protected $pageTitleMock; + + /** + * @var \Magento\Backend\Model\Session|\PHPUnit_Framework_MockObject_MockObject + */ + protected $sessionMock; + + /** + * @var \Magento\Customer\Model\Metadata\FormFactory|\PHPUnit_Framework_MockObject_MockObject + */ + protected $formFactoryMock; + + /** + * @var \Magento\Framework\ObjectFactory|\PHPUnit_Framework_MockObject_MockObject + */ + protected $objectFactoryMock; + + /** + * @var \Magento\Customer\Api\Data\CustomerInterfaceFactory|\PHPUnit_Framework_MockObject_MockObject + */ + protected $customerDataFactoryMock; + + /** + * @var \Magento\Customer\Api\CustomerRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $customerRepositoryMock; + + /** + * @var \Magento\Customer\Model\Customer\Mapper|\PHPUnit_Framework_MockObject_MockObject + */ + protected $customerMapperMock; + + /** + * @var \Magento\Framework\Api\DataObjectHelper|\PHPUnit_Framework_MockObject_MockObject + */ + protected $dataHelperMock; + + /** + * @var \Magento\Framework\AuthorizationInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $authorizationMock; + + /** + * @var \Magento\Newsletter\Model\SubscriberFactory|\PHPUnit_Framework_MockObject_MockObject + */ + protected $subscriberFactoryMock; + + /** + * @var \Magento\Framework\Registry|\PHPUnit_Framework_MockObject_MockObject + */ + protected $registryMock; + + /** + * @var \Magento\Framework\Message\ManagerInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $messageManagerMock; + + /** + * @var \Magento\Backend\Model\View\Result\RedirectFactory|\PHPUnit_Framework_MockObject_MockObject + */ + protected $redirectFactoryMock; + + /** + * @var \Magento\Customer\Api\AccountManagementInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $managementMock; + + protected function setUp() + { + $this->requestMock = $this->getMockBuilder('Magento\Framework\App\Request\Http') + ->disableOriginalConstructor() + ->getMock(); + $this->resultForwardFactoryMock = $this->getMockBuilder('Magento\Backend\Model\View\Result\ForwardFactory') + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $this->resultForwardMock = $this->getMockBuilder('Magento\Backend\Model\View\Result\Forward') + ->disableOriginalConstructor() + ->getMock(); + $this->resultPageFactoryMock = $this->getMockBuilder('Magento\Framework\View\Result\PageFactory') + ->disableOriginalConstructor() + ->getMock(); + $this->resultPageMock = $this->getMockBuilder('Magento\Framework\View\Result\Page') + ->disableOriginalConstructor() + ->setMethods(['setActiveMenu', 'getConfig', 'addBreadcrumb']) + ->getMock(); + $this->pageConfigMock = $this->getMockBuilder('Magento\Framework\View\Page\Config') + ->disableOriginalConstructor() + ->getMock(); + $this->pageTitleMock = $this->getMockBuilder('Magento\Framework\View\Page\Title') + ->disableOriginalConstructor() + ->getMock(); + $this->sessionMock = $this->getMockBuilder('Magento\Backend\Model\Session') + ->disableOriginalConstructor() + ->setMethods(['unsCustomerData', 'setCustomerData']) + ->getMock(); + $this->formFactoryMock = $this->getMockBuilder('Magento\Customer\Model\Metadata\FormFactory') + ->disableOriginalConstructor() + ->getMock(); + $this->objectFactoryMock = $this->getMockBuilder('Magento\Framework\ObjectFactory') + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $this->customerDataFactoryMock = $this->getMockBuilder('Magento\Customer\Api\Data\CustomerInterfaceFactory') + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $this->customerRepositoryMock = $this->getMockBuilder('Magento\Customer\Api\CustomerRepositoryInterface') + ->disableOriginalConstructor() + ->getMock(); + $this->customerMapperMock = $this->getMockBuilder('Magento\Customer\Model\Customer\Mapper') + ->disableOriginalConstructor() + ->getMock(); + $this->dataHelperMock = $this->getMockBuilder('Magento\Framework\Api\DataObjectHelper') + ->disableOriginalConstructor() + ->getMock(); + $this->authorizationMock = $this->getMockBuilder('Magento\Framework\AuthorizationInterface') + ->disableOriginalConstructor() + ->getMock(); + $this->subscriberFactoryMock = $this->getMockBuilder('Magento\Newsletter\Model\SubscriberFactory') + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $this->registryMock = $this->getMockBuilder('Magento\Framework\Registry') + ->disableOriginalConstructor() + ->getMock(); + $this->messageManagerMock = $this->getMockBuilder('Magento\Framework\Message\ManagerInterface') + ->disableOriginalConstructor() + ->getMock(); + $this->redirectFactoryMock = $this->getMockBuilder('Magento\Backend\Model\View\Result\RedirectFactory') + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $this->managementMock = $this->getMockBuilder('Magento\Customer\Api\AccountManagementInterface') + ->disableOriginalConstructor() + ->getMock(); + + $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); + $this->context = $objectManager->getObject( + 'Magento\Backend\App\Action\Context', + [ + 'request' => $this->requestMock, + 'session' => $this->sessionMock, + 'authorization' => $this->authorizationMock, + 'messageManager' => $this->messageManagerMock, + 'resultRedirectFactory' => $this->redirectFactoryMock, + ] + ); + $this->model = $objectManager->getObject( + 'Magento\Customer\Controller\Adminhtml\Index\Save', + [ + 'context' => $this->context, + 'resultForwardFactory' => $this->resultForwardFactoryMock, + 'resultPageFactory' => $this->resultPageFactoryMock, + 'formFactory' => $this->formFactoryMock, + 'objectFactory' => $this->objectFactoryMock, + 'customerDataFactory' => $this->customerDataFactoryMock, + 'customerRepository' => $this->customerRepositoryMock, + 'customerMapper' => $this->customerMapperMock, + 'dataObjectHelper' => $this->dataHelperMock, + 'subscriberFactory' => $this->subscriberFactoryMock, + 'coreRegistry' => $this->registryMock, + 'customerAccountManagement' => $this->managementMock, + ] + ); + } + + /** + * @covers \Magento\Customer\Controller\Adminhtml\Index\Index::execute + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + */ + public function testExecuteWithExistentCustomerAndNoAddresses() + { + $customerId = 22; + $subscription = 'true'; + $postValue = [ + 'customer' => [ + 'entity_id' => $customerId, + 'coolness' => false, + 'disable_auto_group_change' => 'false', + ], + 'subscription' => $subscription, + ]; + $filteredData = [ + 'entity_id' => $customerId, + 'coolness' => false, + 'disable_auto_group_change' => 'false', + ]; + $savedData = [ + 'entity_id' => $customerId, + 'darkness' => true, + 'name' => 'Name', + ]; + $mergedData = [ + 'entity_id' => $customerId, + 'darkness' => true, + 'name' => 'Name', + 'disable_auto_group_change' => 0, + \Magento\Customer\Api\Data\CustomerInterface::DEFAULT_BILLING => false, + \Magento\Customer\Api\Data\CustomerInterface::DEFAULT_SHIPPING => false, + 'confirmation' => false, + 'sendemail' => false, + 'id' => $customerId, + ]; + + /** @var AttributeMetadataInterface|\PHPUnit_Framework_MockObject_MockObject $formMock */ + $attributeMock = $this->getMockBuilder('Magento\Customer\Api\Data\AttributeMetadataInterface') + ->disableOriginalConstructor() + ->getMock(); + $attributeMock->expects($this->once()) + ->method('getAttributeCode') + ->willReturn('coolness'); + $attributeMock->expects($this->once()) + ->method('getFrontendInput') + ->willReturn('int'); + $attributes = [$attributeMock]; + + $this->requestMock->expects($this->exactly(2)) + ->method('getPostValue') + ->willReturn($postValue); + $this->requestMock->expects($this->exactly(3)) + ->method('getPost') + ->willReturnMap( + [ + ['customer', null, $postValue['customer']], + ['address', null, null], + ['subscription', null, $subscription], + ] + ); + + /** @var \Magento\Customer\Model\Metadata\Form|\PHPUnit_Framework_MockObject_MockObject $formMock */ + $formMock = $this->getMockBuilder('Magento\Customer\Model\Metadata\Form') + ->disableOriginalConstructor() + ->getMock(); + + $this->formFactoryMock->expects($this->once()) + ->method('create') + ->with( + \Magento\Customer\Api\CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER, + 'adminhtml_customer', + [], + false, + \Magento\Customer\Model\Metadata\Form::DONT_IGNORE_INVISIBLE + )->willReturn($formMock); + + $formMock->expects($this->once()) + ->method('extractData') + ->with($this->requestMock, 'customer') + ->willReturn($filteredData); + + /** @var \Magento\Framework\Object|\PHPUnit_Framework_MockObject_MockObject $objectMock */ + $objectMock = $this->getMockBuilder('Magento\Framework\Object') + ->disableOriginalConstructor() + ->getMock(); + + $this->objectFactoryMock->expects($this->once()) + ->method('create') + ->with(['data' => $postValue]) + ->willReturn($objectMock); + + $objectMock->expects($this->once()) + ->method('getData') + ->with('customer') + ->willReturn($postValue['customer']); + + $formMock->expects($this->once()) + ->method('getAttributes') + ->willReturn($attributes); + + /** @var \Magento\Customer\Api\Data\CustomerInterface|\PHPUnit_Framework_MockObject_MockObject $customerMock */ + $customerMock = $this->getMockBuilder('Magento\Customer\Api\Data\CustomerInterface') + ->disableOriginalConstructor() + ->getMock(); + + $this->customerDataFactoryMock->expects($this->once()) + ->method('create') + ->willReturn($customerMock); + + $this->customerRepositoryMock->expects($this->once()) + ->method('getById') + ->with($customerId) + ->willReturn($customerMock); + + $this->customerMapperMock->expects($this->once()) + ->method('toFlatArray') + ->with($customerMock) + ->willReturn($savedData); + + $this->dataHelperMock->expects($this->once()) + ->method('populateWithArray') + ->with($customerMock, $mergedData, '\Magento\Customer\Api\Data\CustomerInterface') + ->willReturnSelf(); + + $this->customerRepositoryMock->expects($this->once()) + ->method('save') + ->with($customerMock) + ->willReturnSelf(); + + $this->authorizationMock->expects($this->once()) + ->method('isAllowed') + ->with(null) + ->willReturn(true); + + /** @var \Magento\Newsletter\Model\Subscriber|\PHPUnit_Framework_MockObject_MockObject $subscriberMock */ + $subscriberMock = $this->getMockBuilder('Magento\Newsletter\Model\Subscriber') + ->disableOriginalConstructor() + ->getMock(); + + $this->subscriberFactoryMock->expects($this->once()) + ->method('create') + ->with() + ->willReturn($subscriberMock); + + $subscriberMock->expects($this->once()) + ->method('subscribeCustomerById') + ->with($customerId); + $subscriberMock->expects($this->never()) + ->method('unsubscribeCustomerById'); + + $this->sessionMock->expects($this->once()) + ->method('unsCustomerData'); + + $this->registryMock->expects($this->once()) + ->method('register') + ->with(\Magento\Customer\Controller\RegistryConstants::CURRENT_CUSTOMER_ID, $customerId); + + $this->messageManagerMock->expects($this->once()) + ->method('addSuccess') + ->with(__('You saved the customer.')) + ->willReturnSelf(); + + $this->requestMock->expects($this->once()) + ->method('getParam') + ->with('back', false) + ->willReturn(true); + + /** @var Redirect|\PHPUnit_Framework_MockObject_MockObject $redirectMock */ + $redirectMock = $this->getMockBuilder('Magento\Framework\Controller\Result\Redirect') + ->disableOriginalConstructor() + ->getMock(); + + $this->redirectFactoryMock->expects($this->once()) + ->method('create') + ->with([]) + ->willReturn($redirectMock); + + $redirectMock->expects($this->once()) + ->method('setPath') + ->with('customer/*/edit', ['id' => $customerId, '_current' => true]) + ->willReturn(true); + + $this->assertEquals($redirectMock, $this->model->execute()); + } + + /** + * @covers \Magento\Customer\Controller\Adminhtml\Index\Index::execute + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + */ + public function testExecuteWithNewCustomerAndNoAddresses() + { + $customerId = 22; + $subscription = 'false'; + $postValue = [ + 'customer' => [ + 'coolness' => false, + 'disable_auto_group_change' => 'false', + ], + 'subscription' => $subscription, + ]; + $filteredData = [ + 'coolness' => false, + 'disable_auto_group_change' => 'false', + ]; + + /** @var AttributeMetadataInterface|\PHPUnit_Framework_MockObject_MockObject $formMock */ + $attributeMock = $this->getMockBuilder('Magento\Customer\Api\Data\AttributeMetadataInterface') + ->disableOriginalConstructor() + ->getMock(); + $attributeMock->expects($this->once()) + ->method('getAttributeCode') + ->willReturn('coolness'); + $attributeMock->expects($this->once()) + ->method('getFrontendInput') + ->willReturn('int'); + $attributes = [$attributeMock]; + + $this->requestMock->expects($this->exactly(2)) + ->method('getPostValue') + ->willReturn($postValue); + $this->requestMock->expects($this->exactly(3)) + ->method('getPost') + ->willReturnMap( + [ + ['customer', null, $postValue['customer']], + ['address', null, null], + ['subscription', null, $subscription], + ] + ); + + /** @var \Magento\Customer\Model\Metadata\Form|\PHPUnit_Framework_MockObject_MockObject $formMock */ + $formMock = $this->getMockBuilder('Magento\Customer\Model\Metadata\Form') + ->disableOriginalConstructor() + ->getMock(); + + $this->formFactoryMock->expects($this->once()) + ->method('create') + ->with( + \Magento\Customer\Api\CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER, + 'adminhtml_customer', + [], + false, + \Magento\Customer\Model\Metadata\Form::DONT_IGNORE_INVISIBLE + )->willReturn($formMock); + + $formMock->expects($this->once()) + ->method('extractData') + ->with($this->requestMock, 'customer') + ->willReturn($filteredData); + + /** @var \Magento\Framework\Object|\PHPUnit_Framework_MockObject_MockObject $objectMock */ + $objectMock = $this->getMockBuilder('Magento\Framework\Object') + ->disableOriginalConstructor() + ->getMock(); + + $this->objectFactoryMock->expects($this->once()) + ->method('create') + ->with(['data' => $postValue]) + ->willReturn($objectMock); + + $objectMock->expects($this->once()) + ->method('getData') + ->with('customer') + ->willReturn($postValue['customer']); + + $formMock->expects($this->once()) + ->method('getAttributes') + ->willReturn($attributes); + + /** @var \Magento\Customer\Api\Data\CustomerInterface|\PHPUnit_Framework_MockObject_MockObject $customerMock */ + $customerMock = $this->getMockBuilder('Magento\Customer\Api\Data\CustomerInterface') + ->disableOriginalConstructor() + ->getMock(); + + $this->customerDataFactoryMock->expects($this->once()) + ->method('create') + ->willReturn($customerMock); + + $this->managementMock->expects($this->once()) + ->method('createAccount') + ->with($customerMock, null, '') + ->willReturn($customerMock); + + $customerMock->expects($this->once()) + ->method('getId') + ->willReturn($customerId); + + $this->authorizationMock->expects($this->once()) + ->method('isAllowed') + ->with(null) + ->willReturn(true); + + /** @var \Magento\Newsletter\Model\Subscriber|\PHPUnit_Framework_MockObject_MockObject $subscriberMock */ + $subscriberMock = $this->getMockBuilder('Magento\Newsletter\Model\Subscriber') + ->disableOriginalConstructor() + ->getMock(); + + $this->subscriberFactoryMock->expects($this->once()) + ->method('create') + ->with() + ->willReturn($subscriberMock); + + $subscriberMock->expects($this->once()) + ->method('unsubscribeCustomerById') + ->with($customerId); + $subscriberMock->expects($this->never()) + ->method('subscribeCustomerById'); + + $this->sessionMock->expects($this->once()) + ->method('unsCustomerData'); + + $this->registryMock->expects($this->once()) + ->method('register') + ->with(\Magento\Customer\Controller\RegistryConstants::CURRENT_CUSTOMER_ID, $customerId); + + $this->messageManagerMock->expects($this->once()) + ->method('addSuccess') + ->with(__('You saved the customer.')) + ->willReturnSelf(); + + $this->requestMock->expects($this->once()) + ->method('getParam') + ->with('back', false) + ->willReturn(false); + + /** @var Redirect|\PHPUnit_Framework_MockObject_MockObject $redirectMock */ + $redirectMock = $this->getMockBuilder('Magento\Framework\Controller\Result\Redirect') + ->disableOriginalConstructor() + ->getMock(); + + $this->redirectFactoryMock->expects($this->once()) + ->method('create') + ->willReturn($redirectMock); + + $redirectMock->expects($this->once()) + ->method('setPath') + ->with('customer/index', []) + ->willReturnSelf(); + + $this->assertEquals($redirectMock, $this->model->execute()); + } + + /** + * @covers \Magento\Customer\Controller\Adminhtml\Index\Index::execute + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + */ + public function testExecuteWithNewCustomerAndValidationException() + { + $subscription = 'false'; + $postValue = [ + 'customer' => [ + 'coolness' => false, + 'disable_auto_group_change' => 'false', + ], + 'subscription' => $subscription, + ]; + $filteredData = [ + 'coolness' => false, + 'disable_auto_group_change' => 'false', + ]; + + /** @var AttributeMetadataInterface|\PHPUnit_Framework_MockObject_MockObject $formMock */ + $attributeMock = $this->getMockBuilder('Magento\Customer\Api\Data\AttributeMetadataInterface') + ->disableOriginalConstructor() + ->getMock(); + $attributeMock->expects($this->once()) + ->method('getAttributeCode') + ->willReturn('coolness'); + $attributeMock->expects($this->once()) + ->method('getFrontendInput') + ->willReturn('int'); + $attributes = [$attributeMock]; + + $this->requestMock->expects($this->exactly(2)) + ->method('getPostValue') + ->willReturn($postValue); + $this->requestMock->expects($this->exactly(2)) + ->method('getPost') + ->willReturnMap( + [ + ['customer', null, $postValue['customer']], + ['address', null, null], + ] + ); + + /** @var \Magento\Customer\Model\Metadata\Form|\PHPUnit_Framework_MockObject_MockObject $formMock */ + $formMock = $this->getMockBuilder('Magento\Customer\Model\Metadata\Form') + ->disableOriginalConstructor() + ->getMock(); + + $this->formFactoryMock->expects($this->once()) + ->method('create') + ->with( + \Magento\Customer\Api\CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER, + 'adminhtml_customer', + [], + false, + \Magento\Customer\Model\Metadata\Form::DONT_IGNORE_INVISIBLE + )->willReturn($formMock); + + $formMock->expects($this->once()) + ->method('extractData') + ->with($this->requestMock, 'customer') + ->willReturn($filteredData); + + /** @var \Magento\Framework\Object|\PHPUnit_Framework_MockObject_MockObject $objectMock */ + $objectMock = $this->getMockBuilder('Magento\Framework\Object') + ->disableOriginalConstructor() + ->getMock(); + + $this->objectFactoryMock->expects($this->once()) + ->method('create') + ->with(['data' => $postValue]) + ->willReturn($objectMock); + + $objectMock->expects($this->once()) + ->method('getData') + ->with('customer') + ->willReturn($postValue['customer']); + + $formMock->expects($this->once()) + ->method('getAttributes') + ->willReturn($attributes); + + /** @var \Magento\Customer\Api\Data\CustomerInterface|\PHPUnit_Framework_MockObject_MockObject $customerMock */ + $customerMock = $this->getMockBuilder('Magento\Customer\Api\Data\CustomerInterface') + ->disableOriginalConstructor() + ->getMock(); + + $this->customerDataFactoryMock->expects($this->once()) + ->method('create') + ->willReturn($customerMock); + + $this->managementMock->expects($this->once()) + ->method('createAccount') + ->with($customerMock, null, '') + ->willThrowException(new \Magento\Framework\Validator\Exception(__('Validator Exception'))); + + $customerMock->expects($this->never()) + ->method('getId'); + + $this->authorizationMock->expects($this->never()) + ->method('isAllowed'); + + $this->subscriberFactoryMock->expects($this->never()) + ->method('create'); + + $this->sessionMock->expects($this->never()) + ->method('unsCustomerData'); + + $this->registryMock->expects($this->never()) + ->method('register'); + + $this->messageManagerMock->expects($this->never()) + ->method('addSuccess'); + + $this->messageManagerMock->expects($this->once()) + ->method('addMessage') + ->with(new \Magento\Framework\Message\Error('Validator Exception')); + + $this->sessionMock->expects($this->once()) + ->method('setCustomerData') + ->with($postValue); + + /** @var Redirect|\PHPUnit_Framework_MockObject_MockObject $redirectMock */ + $redirectMock = $this->getMockBuilder('Magento\Framework\Controller\Result\Redirect') + ->disableOriginalConstructor() + ->getMock(); + + $this->redirectFactoryMock->expects($this->once()) + ->method('create') + ->with([]) + ->willReturn($redirectMock); + + $redirectMock->expects($this->once()) + ->method('setPath') + ->with('customer/*/new', ['_current' => true]) + ->willReturn(true); + + $this->assertEquals($redirectMock, $this->model->execute()); + } + + /** + * @covers \Magento\Customer\Controller\Adminhtml\Index\Index::execute + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + */ + public function testExecuteWithNewCustomerAndLocalizedException() + { + $subscription = 'false'; + $postValue = [ + 'customer' => [ + 'coolness' => false, + 'disable_auto_group_change' => 'false', + ], + 'subscription' => $subscription, + ]; + $filteredData = [ + 'coolness' => false, + 'disable_auto_group_change' => 'false', + ]; + + /** @var AttributeMetadataInterface|\PHPUnit_Framework_MockObject_MockObject $formMock */ + $attributeMock = $this->getMockBuilder('Magento\Customer\Api\Data\AttributeMetadataInterface') + ->disableOriginalConstructor() + ->getMock(); + $attributeMock->expects($this->once()) + ->method('getAttributeCode') + ->willReturn('coolness'); + $attributeMock->expects($this->once()) + ->method('getFrontendInput') + ->willReturn('int'); + $attributes = [$attributeMock]; + + $this->requestMock->expects($this->exactly(2)) + ->method('getPostValue') + ->willReturn($postValue); + $this->requestMock->expects($this->exactly(2)) + ->method('getPost') + ->willReturnMap( + [ + ['customer', null, $postValue['customer']], + ['address', null, null], + ] + ); + + /** @var \Magento\Customer\Model\Metadata\Form|\PHPUnit_Framework_MockObject_MockObject $formMock */ + $formMock = $this->getMockBuilder('Magento\Customer\Model\Metadata\Form') + ->disableOriginalConstructor() + ->getMock(); + + $this->formFactoryMock->expects($this->once()) + ->method('create') + ->with( + \Magento\Customer\Api\CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER, + 'adminhtml_customer', + [], + false, + \Magento\Customer\Model\Metadata\Form::DONT_IGNORE_INVISIBLE + )->willReturn($formMock); + + $formMock->expects($this->once()) + ->method('extractData') + ->with($this->requestMock, 'customer') + ->willReturn($filteredData); + + /** @var \Magento\Framework\Object|\PHPUnit_Framework_MockObject_MockObject $objectMock */ + $objectMock = $this->getMockBuilder('Magento\Framework\Object') + ->disableOriginalConstructor() + ->getMock(); + + $this->objectFactoryMock->expects($this->once()) + ->method('create') + ->with(['data' => $postValue]) + ->willReturn($objectMock); + + $objectMock->expects($this->once()) + ->method('getData') + ->with('customer') + ->willReturn($postValue['customer']); + + $formMock->expects($this->once()) + ->method('getAttributes') + ->willReturn($attributes); + + /** @var \Magento\Customer\Api\Data\CustomerInterface|\PHPUnit_Framework_MockObject_MockObject $customerMock */ + $customerMock = $this->getMockBuilder('Magento\Customer\Api\Data\CustomerInterface') + ->disableOriginalConstructor() + ->getMock(); + + $this->customerDataFactoryMock->expects($this->once()) + ->method('create') + ->willReturn($customerMock); + + $this->managementMock->expects($this->once()) + ->method('createAccount') + ->with($customerMock, null, '') + ->willThrowException(new \Magento\Framework\Exception\LocalizedException(__('Localized Exception'))); + + $customerMock->expects($this->never()) + ->method('getId'); + + $this->authorizationMock->expects($this->never()) + ->method('isAllowed'); + + $this->subscriberFactoryMock->expects($this->never()) + ->method('create'); + + $this->sessionMock->expects($this->never()) + ->method('unsCustomerData'); + + $this->registryMock->expects($this->never()) + ->method('register'); + + $this->messageManagerMock->expects($this->never()) + ->method('addSuccess'); + + $this->messageManagerMock->expects($this->once()) + ->method('addMessage') + ->with(new \Magento\Framework\Message\Error('Localized Exception')); + + $this->sessionMock->expects($this->once()) + ->method('setCustomerData') + ->with($postValue); + + /** @var Redirect|\PHPUnit_Framework_MockObject_MockObject $redirectMock */ + $redirectMock = $this->getMockBuilder('Magento\Framework\Controller\Result\Redirect') + ->disableOriginalConstructor() + ->getMock(); + + $this->redirectFactoryMock->expects($this->once()) + ->method('create') + ->with([]) + ->willReturn($redirectMock); + + $redirectMock->expects($this->once()) + ->method('setPath') + ->with('customer/*/new', ['_current' => true]) + ->willReturn(true); + + $this->assertEquals($redirectMock, $this->model->execute()); + } + + /** + * @covers \Magento\Customer\Controller\Adminhtml\Index\Index::execute + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + */ + public function testExecuteWithNewCustomerAndException() + { + $subscription = 'false'; + $postValue = [ + 'customer' => [ + 'coolness' => false, + 'disable_auto_group_change' => 'false', + ], + 'subscription' => $subscription, + ]; + $filteredData = [ + 'coolness' => false, + 'disable_auto_group_change' => 'false', + ]; + + /** @var AttributeMetadataInterface|\PHPUnit_Framework_MockObject_MockObject $formMock */ + $attributeMock = $this->getMockBuilder('Magento\Customer\Api\Data\AttributeMetadataInterface') + ->disableOriginalConstructor() + ->getMock(); + $attributeMock->expects($this->once()) + ->method('getAttributeCode') + ->willReturn('coolness'); + $attributeMock->expects($this->once()) + ->method('getFrontendInput') + ->willReturn('int'); + $attributes = [$attributeMock]; + + $this->requestMock->expects($this->exactly(2)) + ->method('getPostValue') + ->willReturn($postValue); + $this->requestMock->expects($this->exactly(2)) + ->method('getPost') + ->willReturnMap( + [ + ['customer', null, $postValue['customer']], + ['address', null, null], + ] + ); + + /** @var \Magento\Customer\Model\Metadata\Form|\PHPUnit_Framework_MockObject_MockObject $formMock */ + $formMock = $this->getMockBuilder('Magento\Customer\Model\Metadata\Form') + ->disableOriginalConstructor() + ->getMock(); + + $this->formFactoryMock->expects($this->once()) + ->method('create') + ->with( + \Magento\Customer\Api\CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER, + 'adminhtml_customer', + [], + false, + \Magento\Customer\Model\Metadata\Form::DONT_IGNORE_INVISIBLE + )->willReturn($formMock); + + $formMock->expects($this->once()) + ->method('extractData') + ->with($this->requestMock, 'customer') + ->willReturn($filteredData); + + /** @var \Magento\Framework\Object|\PHPUnit_Framework_MockObject_MockObject $objectMock */ + $objectMock = $this->getMockBuilder('Magento\Framework\Object') + ->disableOriginalConstructor() + ->getMock(); + + $this->objectFactoryMock->expects($this->once()) + ->method('create') + ->with(['data' => $postValue]) + ->willReturn($objectMock); + + $objectMock->expects($this->once()) + ->method('getData') + ->with('customer') + ->willReturn($postValue['customer']); + + $formMock->expects($this->once()) + ->method('getAttributes') + ->willReturn($attributes); + + /** @var \Magento\Customer\Api\Data\CustomerInterface|\PHPUnit_Framework_MockObject_MockObject $customerMock */ + $customerMock = $this->getMockBuilder('Magento\Customer\Api\Data\CustomerInterface') + ->disableOriginalConstructor() + ->getMock(); + + $this->customerDataFactoryMock->expects($this->once()) + ->method('create') + ->willReturn($customerMock); + + $exception = new \Exception(__('Exception')); + $this->managementMock->expects($this->once()) + ->method('createAccount') + ->with($customerMock, null, '') + ->willThrowException($exception); + + $customerMock->expects($this->never()) + ->method('getId'); + + $this->authorizationMock->expects($this->never()) + ->method('isAllowed'); + + $this->subscriberFactoryMock->expects($this->never()) + ->method('create'); + + $this->sessionMock->expects($this->never()) + ->method('unsCustomerData'); + + $this->registryMock->expects($this->never()) + ->method('register'); + + $this->messageManagerMock->expects($this->never()) + ->method('addSuccess'); + + $this->messageManagerMock->expects($this->once()) + ->method('addException') + ->with($exception, __('Something went wrong while saving the customer.')); + + $this->sessionMock->expects($this->once()) + ->method('setCustomerData') + ->with($postValue); + + /** @var Redirect|\PHPUnit_Framework_MockObject_MockObject $redirectMock */ + $redirectMock = $this->getMockBuilder('Magento\Framework\Controller\Result\Redirect') + ->disableOriginalConstructor() + ->getMock(); + + $this->redirectFactoryMock->expects($this->once()) + ->method('create') + ->with([]) + ->willReturn($redirectMock); + + $redirectMock->expects($this->once()) + ->method('setPath') + ->with('customer/*/new', ['_current' => true]) + ->willReturn(true); + + $this->assertEquals($redirectMock, $this->model->execute()); + } +} diff --git a/app/code/Magento/Customer/etc/di.xml b/app/code/Magento/Customer/etc/di.xml index cc98e7676b3fa9f7825da52d2d647966661a0978..bf8b44c4f76b68a2c7290ac0358f1470905a8add 100644 --- a/app/code/Magento/Customer/etc/di.xml +++ b/app/code/Magento/Customer/etc/di.xml @@ -70,6 +70,13 @@ </argument> </arguments> </type> + <type name="Magento\Customer\Model\Resource\Address"> + <arguments> + <argument name="customerRepository" xsi:type="object">Magento\Customer\Api\CustomerRepositoryInterface\Proxy</argument> + <argument name="entitySnapshot" xsi:type="object">EavVersionControlSnapshot</argument> + <argument name="entityRelationComposite" xsi:type="object">CustomerAddressRelationsComposite</argument> + </arguments> + </type> <type name="Magento\Customer\Model\Address\Config"> <arguments> <argument name="reader" xsi:type="object">Magento\Customer\Model\Address\Config\Reader\Proxy</argument> @@ -156,12 +163,6 @@ <argument name="entitySnapshot" xsi:type="object">EavVersionControlSnapshot</argument> </arguments> </type> - <type name="Magento\Customer\Model\Resource\Address"> - <arguments> - <argument name="entitySnapshot" xsi:type="object">EavVersionControlSnapshot</argument> - <argument name="entityRelationComposite" xsi:type="object">CustomerAddressRelationsComposite</argument> - </arguments> - </type> <type name="Magento\Customer\Model\Resource\Address\Collection"> <arguments> <argument name="entitySnapshot" xsi:type="object">EavVersionControlSnapshot</argument> diff --git a/app/code/Magento/Customer/etc/module.xml b/app/code/Magento/Customer/etc/module.xml index 973c14db73d61034756a46694f3abab1856ed480..3b30bbb64414228c72a08e505c1b8405dffac019 100644 --- a/app/code/Magento/Customer/etc/module.xml +++ b/app/code/Magento/Customer/etc/module.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> - <module name="Magento_Customer" setup_version="2.0.0.2"> + <module name="Magento_Customer" setup_version="2.0.0"> <sequence> <module name="Magento_Eav"/> <module name="Magento_Directory"/> diff --git a/app/code/Magento/Customer/view/frontend/web/js/customer-data.js b/app/code/Magento/Customer/view/frontend/web/js/customer-data.js index 45a742005048f3965aaaa7fadd513cf500381750..3fc839a52be45cbd2cf3aa9e67fa1be27c052875 100644 --- a/app/code/Magento/Customer/view/frontend/web/js/customer-data.js +++ b/app/code/Magento/Customer/view/frontend/web/js/customer-data.js @@ -45,7 +45,7 @@ define([ getFromServer: function (sectionNames) { var parameters = _.isArray(sectionNames) ? {sections: sectionNames.join(',')} : []; return $.getJSON(options.sectionLoadUrl, parameters).fail(function(jqXHR) { - throw new Error(jqXHR.responseJSON.message); + throw new Error(jqXHR); }); } }; @@ -134,6 +134,10 @@ define([ var sections = sectionConfig.getAffectedSections(settings.url); if (sections) { customerData.invalidate(sections); + var redirects = ['redirect']; + if (_.isObject(xhr.responseJSON) && !_.isEmpty(_.pick(xhr.responseJSON, redirects))) { + return ; + } customerData.reload(sections); } } diff --git a/app/code/Magento/Eav/Model/Entity/AbstractEntity.php b/app/code/Magento/Eav/Model/Entity/AbstractEntity.php index c4969c8a280d0373513797e8ee6c34ca1f6a210e..cad13566790df2a0385c7394e5bbc04d84db9c39 100755 --- a/app/code/Magento/Eav/Model/Entity/AbstractEntity.php +++ b/app/code/Magento/Eav/Model/Entity/AbstractEntity.php @@ -1413,7 +1413,7 @@ abstract class AbstractEntity extends \Magento\Framework\Model\Resource\Abstract */ protected function _processSaveData($saveData) { - extract($saveData); + extract($saveData, EXTR_SKIP); /** * Import variables into the current symbol table from save data array * diff --git a/app/code/Magento/ImportExport/Setup/InstallSchema.php b/app/code/Magento/ImportExport/Setup/InstallSchema.php index beb4abc065cc120205665d5c9213512e74b28cd7..3e85a986899c97ae92950f8e2834f003c5ce1107 100644 --- a/app/code/Magento/ImportExport/Setup/InstallSchema.php +++ b/app/code/Magento/ImportExport/Setup/InstallSchema.php @@ -59,6 +59,56 @@ class InstallSchema implements InstallSchemaInterface ->setComment('Import Data Table'); $installer->getConnection()->createTable($table); + /** + * Create 'import_history' table. + */ + $table = $installer->getConnection() + ->newTable($installer->getTable('import_history')) + ->addColumn( + 'history_id', + \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + null, + ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true], + 'History record Id' + ) + ->addColumn( + 'started_at', + \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, + null, + ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT], + 'Started at' + ) + ->addColumn( + 'user_id', + \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + null, + ['unsigned' => true, 'nullable' => false, 'default' => '0'], + 'User ID' + ) + ->addColumn( + 'imported_file', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + 255, + ['nullable' => true], + 'Imported file' + ) + ->addColumn( + 'execution_time', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + 255, + ['nullable' => true], + 'Execution time' + ) + ->addColumn( + 'summary', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + 255, + ['nullable' => true], + 'Summary' + ) + ->setComment('Import history table'); + $installer->getConnection()->createTable($table); + $installer->endSetup(); } diff --git a/app/code/Magento/ImportExport/Setup/UpgradeSchema.php b/app/code/Magento/ImportExport/Setup/UpgradeSchema.php deleted file mode 100644 index 900c2ed39be6b279675c545c3c0e60e413cbea74..0000000000000000000000000000000000000000 --- a/app/code/Magento/ImportExport/Setup/UpgradeSchema.php +++ /dev/null @@ -1,85 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\ImportExport\Setup; - -use Magento\Framework\Setup\UpgradeSchemaInterface; -use Magento\Framework\Setup\ModuleContextInterface; -use Magento\Framework\Setup\SchemaSetupInterface; - -/** - * @codeCoverageIgnore - */ -class UpgradeSchema implements UpgradeSchemaInterface -{ - /** - * Upgrades DB schema for a module - * - * @param SchemaSetupInterface $setup - * @param ModuleContextInterface $context - * @return void - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) - */ - public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context) - { - $setup->startSetup(); - - if (version_compare($context->getVersion(), '2.0.0.1') < 0) { - /** - * Create 'import_history' table. - */ - $table = $setup->getConnection() - ->newTable($setup->getTable('import_history')) - ->addColumn( - 'history_id', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true], - 'History record Id' - ) - ->addColumn( - 'started_at', - \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, - null, - ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT], - 'Started at' - ) - ->addColumn( - 'user_id', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['unsigned' => true, 'nullable' => false, 'default' => '0'], - 'User ID' - ) - ->addColumn( - 'imported_file', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 255, - ['nullable' => true], - 'Imported file' - ) - ->addColumn( - 'execution_time', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 255, - ['nullable' => true], - 'Execution time' - ) - ->addColumn( - 'summary', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 255, - ['nullable' => true], - 'Summary' - ) - ->setComment('Import history table'); - - $setup->getConnection()->createTable($table); - } - - $setup->endSetup(); - } -} diff --git a/app/code/Magento/ImportExport/etc/module.xml b/app/code/Magento/ImportExport/etc/module.xml index e072148a1dd4b61376b2398dae5f3012e8d60da4..4dad36db350381b41ad6504c974a1a8918a4c7d1 100644 --- a/app/code/Magento/ImportExport/etc/module.xml +++ b/app/code/Magento/ImportExport/etc/module.xml @@ -6,6 +6,6 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> - <module name="Magento_ImportExport" setup_version="2.0.1"> + <module name="Magento_ImportExport" setup_version="2.0.0"> </module> </config> diff --git a/app/code/Magento/Indexer/Model/IndexStructure.php b/app/code/Magento/Indexer/Model/IndexStructure.php index d7c673cf504654d05eae352fb49e2d67d19cf887..0443b6deecd771009f0905145464c067c71bf34d 100644 --- a/app/code/Magento/Indexer/Model/IndexStructure.php +++ b/app/code/Magento/Indexer/Model/IndexStructure.php @@ -11,8 +11,8 @@ use Magento\Framework\App\Resource; use Magento\Framework\DB\Adapter\AdapterInterface; use Magento\Framework\DB\Ddl\Table; use Magento\Framework\Search\Request\Dimension; -use Magento\Search\Model\ScopeResolver\FlatScopeResolver; -use Magento\Search\Model\ScopeResolver\IndexScopeResolver; +use Magento\Indexer\Model\ScopeResolver\FlatScopeResolver; +use Magento\Indexer\Model\ScopeResolver\IndexScopeResolver; class IndexStructure { @@ -21,7 +21,7 @@ class IndexStructure */ private $resource; /** - * @var IndexScopeResolver + * @var \Magento\Indexer\Model\ScopeResolver\IndexScopeResolver */ private $indexScopeResolver; /** @@ -41,7 +41,7 @@ class IndexStructure /** * @param Resource|Resource $resource * @param IndexScopeResolver $indexScopeResolver - * @param FlatScopeResolver $flatScopeResolver + * @param \Magento\Indexer\Model\ScopeResolver\FlatScopeResolver $flatScopeResolver * @param array $columnTypesMap */ public function __construct( diff --git a/app/code/Magento/Indexer/Model/SaveHandler/IndexerHandler.php b/app/code/Magento/Indexer/Model/SaveHandler/IndexerHandler.php index 9059a96aadf5659a1e227e336bd85c7a550c318f..37257f1f560714816e3b61637141ad44a4c65c89 100644 --- a/app/code/Magento/Indexer/Model/SaveHandler/IndexerHandler.php +++ b/app/code/Magento/Indexer/Model/SaveHandler/IndexerHandler.php @@ -11,8 +11,8 @@ use Magento\Framework\IndexerInterface; use Magento\Indexer\Model\IndexStructure; use Magento\Framework\Search\Request\Dimension; use Magento\Framework\Search\Request\IndexScopeResolverInterface; -use Magento\Search\Model\ScopeResolver\FlatScopeResolver; -use Magento\Search\Model\ScopeResolver\IndexScopeResolver; +use Magento\Indexer\Model\ScopeResolver\FlatScopeResolver; +use Magento\Indexer\Model\ScopeResolver\IndexScopeResolver; class IndexerHandler implements IndexerInterface { @@ -60,8 +60,8 @@ class IndexerHandler implements IndexerInterface * @param IndexStructure $indexStructure * @param Resource $resource * @param Batch $batch - * @param IndexScopeResolver $indexScopeResolver - * @param FlatScopeResolver $flatScopeResolver + * @param \Magento\Indexer\Model\ScopeResolver\IndexScopeResolver $indexScopeResolver + * @param \Magento\Indexer\Model\ScopeResolver\FlatScopeResolver $flatScopeResolver * @param array $data * @param int $batchSize */ diff --git a/app/code/Magento/Search/Model/ScopeResolver/FlatScopeResolver.php b/app/code/Magento/Indexer/Model/ScopeResolver/FlatScopeResolver.php similarity index 89% rename from app/code/Magento/Search/Model/ScopeResolver/FlatScopeResolver.php rename to app/code/Magento/Indexer/Model/ScopeResolver/FlatScopeResolver.php index 98241dae0b2e6ccb8715c84cf16c9ab6827b14c5..8e415be17131e8340e5ccbc0b30722469dc825ca 100644 --- a/app/code/Magento/Search/Model/ScopeResolver/FlatScopeResolver.php +++ b/app/code/Magento/Indexer/Model/ScopeResolver/FlatScopeResolver.php @@ -4,10 +4,11 @@ * See COPYING.txt for license details. */ -namespace Magento\Search\Model\ScopeResolver; +namespace Magento\Indexer\Model\ScopeResolver; use Magento\Framework\Search\Request\Dimension; use Magento\Framework\Search\Request\IndexScopeResolverInterface; +use Magento\Indexer\Model\ScopeResolver\IndexScopeResolver; class FlatScopeResolver implements IndexScopeResolverInterface { diff --git a/app/code/Magento/Search/Model/ScopeResolver/IndexScopeResolver.php b/app/code/Magento/Indexer/Model/ScopeResolver/IndexScopeResolver.php similarity index 97% rename from app/code/Magento/Search/Model/ScopeResolver/IndexScopeResolver.php rename to app/code/Magento/Indexer/Model/ScopeResolver/IndexScopeResolver.php index 381f20c79ed97310fb9afb2c3ba3cf0954f2e428..696d6af0041b2dd1695b56b5a49c08a7f21ca7ce 100644 --- a/app/code/Magento/Search/Model/ScopeResolver/IndexScopeResolver.php +++ b/app/code/Magento/Indexer/Model/ScopeResolver/IndexScopeResolver.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\Search\Model\ScopeResolver; +namespace Magento\Indexer\Model\ScopeResolver; use Magento\Framework\App\Resource; diff --git a/app/code/Magento/Indexer/Setup/UpgradeData.php b/app/code/Magento/Indexer/Setup/InstallData.php similarity index 62% rename from app/code/Magento/Indexer/Setup/UpgradeData.php rename to app/code/Magento/Indexer/Setup/InstallData.php index 880e8c26413a7dcebfa152f4aead878bbeaee571..c2fbcace85baab25b813277d566e588cf39e903b 100644 --- a/app/code/Magento/Indexer/Setup/UpgradeData.php +++ b/app/code/Magento/Indexer/Setup/InstallData.php @@ -9,19 +9,19 @@ namespace Magento\Indexer\Setup; use Magento\Framework\Encryption\Encryptor; use Magento\Framework\Encryption\EncryptorInterface; use Magento\Framework\Json\EncoderInterface; -use Magento\Framework\Setup\UpgradeDataInterface; use Magento\Framework\Setup\ModuleContextInterface; use Magento\Framework\Setup\ModuleDataSetupInterface; use Magento\Indexer\Model\ConfigInterface; use Magento\Indexer\Model\Resource\Indexer\State\CollectionFactory; use Magento\Indexer\Model\Indexer\State; use Magento\Indexer\Model\Indexer\StateFactory; +use Magento\Framework\Setup\InstallDataInterface; /** * @codeCoverageIgnore * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class UpgradeData implements UpgradeDataInterface +class InstallData implements InstallDataInterface { /** * Indexer collection factory @@ -80,30 +80,28 @@ class UpgradeData implements UpgradeDataInterface * @SuppressWarnings(PHPMD.ExcessiveMethodLength) * @SuppressWarnings(PHPMD.NPathComplexity) */ - public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context) + public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context) { - if (version_compare($context->getVersion(), '2.0.1') < 0) { - /** @var State[] $stateIndexers */ - $stateIndexers = []; - $states = $this->statesFactory->create(); - foreach ($states->getItems() as $state) { - /** @var State $state */ - $stateIndexers[$state->getIndexerId()] = $state; - } + /** @var State[] $stateIndexers */ + $stateIndexers = []; + $states = $this->statesFactory->create(); + foreach ($states->getItems() as $state) { + /** @var State $state */ + $stateIndexers[$state->getIndexerId()] = $state; + } - foreach ($this->config->getIndexers() as $indexerId => $indexerConfig) { - $hash = $this->encryptor->hash($this->encoder->encode($indexerConfig), Encryptor::HASH_VERSION_MD5); - if (isset($stateIndexers[$indexerId])) { - $stateIndexers[$indexerId]->setHashConfig($hash); - $stateIndexers[$indexerId]->save(); - } else { - /** @var State $state */ - $state = $this->stateFactory->create(); - $state->loadByIndexer($indexerId); - $state->setHashConfig($hash); - $state->setStatus(State::STATUS_INVALID); - $state->save(); - } + foreach ($this->config->getIndexers() as $indexerId => $indexerConfig) { + $hash = $this->encryptor->hash($this->encoder->encode($indexerConfig), Encryptor::HASH_VERSION_MD5); + if (isset($stateIndexers[$indexerId])) { + $stateIndexers[$indexerId]->setHashConfig($hash); + $stateIndexers[$indexerId]->save(); + } else { + /** @var State $state */ + $state = $this->stateFactory->create(); + $state->loadByIndexer($indexerId); + $state->setHashConfig($hash); + $state->setStatus(State::STATUS_INVALID); + $state->save(); } } } diff --git a/app/code/Magento/Indexer/Setup/InstallSchema.php b/app/code/Magento/Indexer/Setup/InstallSchema.php index a3cc46c6e022a5ef52d52558e9384bb1c209fb9e..44fbe6f37fe80afefc5172a3a51d94023633f391 100644 --- a/app/code/Magento/Indexer/Setup/InstallSchema.php +++ b/app/code/Magento/Indexer/Setup/InstallSchema.php @@ -58,6 +58,13 @@ class InstallSchema implements InstallSchemaInterface [], 'Indexer Status' ) + ->addColumn( + 'hash_config', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + 32, + ['nullable' => false], + 'Hash of indexer config' + ) ->addIndex( $installer->getIdxName('indexer_state', ['indexer_id']), ['indexer_id'] diff --git a/app/code/Magento/Indexer/Setup/Recurring.php b/app/code/Magento/Indexer/Setup/Recurring.php index da4e6f2932df02898420aa1fc9719e254c3de770..e453e18bc7d9f798e66962af468f3351c06a6720 100644 --- a/app/code/Magento/Indexer/Setup/Recurring.php +++ b/app/code/Magento/Indexer/Setup/Recurring.php @@ -78,35 +78,33 @@ class Recurring implements InstallSchemaInterface */ public function install(SchemaSetupInterface $setup, ModuleContextInterface $context) { - if (version_compare($context->getVersion(), '2.0.1') >= 0) { - /** @var State[] $stateIndexers */ - $stateIndexers = []; - $states = $this->statesFactory->create(); - foreach ($states->getItems() as $state) { - /** @var State $state */ - $stateIndexers[$state->getIndexerId()] = $state; - } + /** @var State[] $stateIndexers */ + $stateIndexers = []; + $states = $this->statesFactory->create(); + foreach ($states->getItems() as $state) { + /** @var State $state */ + $stateIndexers[$state->getIndexerId()] = $state; + } - foreach ($this->config->getIndexers() as $indexerId => $indexerConfig) { - $expectedHashConfig = $this->encryptor->hash( - $this->encoder->encode($indexerConfig), - Encryptor::HASH_VERSION_MD5 - ); + foreach ($this->config->getIndexers() as $indexerId => $indexerConfig) { + $expectedHashConfig = $this->encryptor->hash( + $this->encoder->encode($indexerConfig), + Encryptor::HASH_VERSION_MD5 + ); - if (isset($stateIndexers[$indexerId])) { - if ($stateIndexers[$indexerId]->getHashConfig() != $expectedHashConfig) { - $stateIndexers[$indexerId]->setStatus(State::STATUS_INVALID); - $stateIndexers[$indexerId]->setHashConfig($expectedHashConfig); - $stateIndexers[$indexerId]->save(); - } - } else { - /** @var State $state */ - $state = $this->stateFactory->create(); - $state->loadByIndexer($indexerId); - $state->setHashConfig($expectedHashConfig); - $state->setStatus(State::STATUS_INVALID); - $state->save(); + if (isset($stateIndexers[$indexerId])) { + if ($stateIndexers[$indexerId]->getHashConfig() != $expectedHashConfig) { + $stateIndexers[$indexerId]->setStatus(State::STATUS_INVALID); + $stateIndexers[$indexerId]->setHashConfig($expectedHashConfig); + $stateIndexers[$indexerId]->save(); } + } else { + /** @var State $state */ + $state = $this->stateFactory->create(); + $state->loadByIndexer($indexerId); + $state->setHashConfig($expectedHashConfig); + $state->setStatus(State::STATUS_INVALID); + $state->save(); } } } diff --git a/app/code/Magento/Indexer/Setup/UpgradeSchema.php b/app/code/Magento/Indexer/Setup/UpgradeSchema.php deleted file mode 100644 index 2288e2963d3df07af16e5d7b3bbd1ff6b1257954..0000000000000000000000000000000000000000 --- a/app/code/Magento/Indexer/Setup/UpgradeSchema.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Indexer\Setup; - -use Magento\Framework\DB\Ddl\Table; -use Magento\Framework\Setup\UpgradeSchemaInterface; -use Magento\Framework\Setup\ModuleContextInterface; -use Magento\Framework\Setup\SchemaSetupInterface; - -/** - * @codeCoverageIgnore - */ -class UpgradeSchema implements UpgradeSchemaInterface -{ - /** - * {@inheritdoc} - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) - * @SuppressWarnings(PHPMD.CyclomaticComplexity) - * @SuppressWarnings(PHPMD.NPathComplexity) - */ - public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context) - { - $installer = $setup; - $connection = $installer->getConnection(); - if (version_compare($context->getVersion(), '2.0.1') < 0) { - /** - * Add hash column of indexer_state table. - */ - $table = $setup->getTable('indexer_state'); - $connection->addColumn( - $table, - 'hash_config', - [ - 'type' => Table::TYPE_TEXT, - 'length' => 32, - 'nullable' => false, - 'comment' => 'Hash of indexer config', - ] - ); - } - } -} diff --git a/app/code/Magento/Indexer/Test/Unit/Model/IndexStructureTest.php b/app/code/Magento/Indexer/Test/Unit/Model/IndexStructureTest.php index a6884d22d03bf136b28200a0df6e8ace767bf9a3..aa002ea18a56c384eccbf2c121d2e4e691a6cd79 100644 --- a/app/code/Magento/Indexer/Test/Unit/Model/IndexStructureTest.php +++ b/app/code/Magento/Indexer/Test/Unit/Model/IndexStructureTest.php @@ -16,12 +16,12 @@ use \Magento\Framework\TestFramework\Unit\Helper\ObjectManager; class IndexStructureTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Search\Model\ScopeResolver\IndexScopeResolver|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Indexer\Model\ScopeResolver\IndexScopeResolver|\PHPUnit_Framework_MockObject_MockObject */ private $indexScopeResolver; /** - * @var \Magento\Search\Model\ScopeResolver\FlatScopeResolver|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Indexer\Model\ScopeResolver\FlatScopeResolver|\PHPUnit_Framework_MockObject_MockObject */ private $flatScopeResolver; @@ -53,11 +53,11 @@ class IndexStructureTest extends \PHPUnit_Framework_TestCase ->method('getConnection') ->with('write') ->willReturn($this->adapter); - $this->indexScopeResolver = $this->getMockBuilder('\Magento\Search\Model\ScopeResolver\IndexScopeResolver') + $this->indexScopeResolver = $this->getMockBuilder('\Magento\Indexer\Model\ScopeResolver\IndexScopeResolver') ->setMethods(['resolve']) ->disableOriginalConstructor() ->getMock(); - $this->flatScopeResolver = $this->getMockBuilder('\Magento\Search\Model\ScopeResolver\FlatScopeResolver') + $this->flatScopeResolver = $this->getMockBuilder('\Magento\Indexer\Model\ScopeResolver\FlatScopeResolver') ->setMethods(['resolve']) ->disableOriginalConstructor() ->getMock(); diff --git a/app/code/Magento/Search/Test/Unit/Model/ScopeResolver/IndexScopeResolverTest.php b/app/code/Magento/Indexer/Test/Unit/Model/ScopeResolver/IndexScopeResolverTest.php similarity index 93% rename from app/code/Magento/Search/Test/Unit/Model/ScopeResolver/IndexScopeResolverTest.php rename to app/code/Magento/Indexer/Test/Unit/Model/ScopeResolver/IndexScopeResolverTest.php index 9c3dc151b999884c0348e29d5d9b3c90029955d3..a64005d658ebac18cc46d6cdaf3f1b300c44c54e 100644 --- a/app/code/Magento/Search/Test/Unit/Model/ScopeResolver/IndexScopeResolverTest.php +++ b/app/code/Magento/Indexer/Test/Unit/Model/ScopeResolver/IndexScopeResolverTest.php @@ -4,13 +4,13 @@ * See COPYING.txt for license details. */ -namespace Magento\Search\Test\Unit\Model\ScopeResolver; +namespace Magento\Indexer\Test\Unit\Model\ScopeResolver; use Magento\Framework\Search\Request\Dimension; use \Magento\Framework\TestFramework\Unit\Helper\ObjectManager; /** - * Test for \Magento\Search\Model\ScopeResolver\IndexScopeResolver + * Test for \Magento\Indexer\Model\ScopeResolver\IndexScopeResolver */ class IndexScopeResolverTest extends \PHPUnit_Framework_TestCase { @@ -25,7 +25,7 @@ class IndexScopeResolverTest extends \PHPUnit_Framework_TestCase private $resource; /** - * @var \Magento\Search\Model\ScopeResolver\IndexScopeResolver + * @var \Magento\Indexer\Model\ScopeResolver\IndexScopeResolver */ private $target; @@ -45,7 +45,7 @@ class IndexScopeResolverTest extends \PHPUnit_Framework_TestCase $objectManager = new ObjectManager($this); $this->target = $objectManager->getObject( - '\Magento\Search\Model\ScopeResolver\IndexScopeResolver', + '\Magento\Indexer\Model\ScopeResolver\IndexScopeResolver', [ 'resource' => $this->resource, 'scopeResolver' => $this->scopeResolver diff --git a/app/code/Magento/Indexer/composer.json b/app/code/Magento/Indexer/composer.json index b3d895056ef1cdccd1e683a3d5477c78a2fb738a..b7f27e0e6bf74fb4f9739d465afb670ca251651c 100644 --- a/app/code/Magento/Indexer/composer.json +++ b/app/code/Magento/Indexer/composer.json @@ -5,7 +5,6 @@ "php": "~5.5.0|~5.6.0", "magento/module-store": "0.74.0-beta16", "magento/module-backend": "0.74.0-beta16", - "magento/module-search": "0.74.0-beta16", "magento/module-page-cache": "0.74.0-beta16", "magento/framework": "0.74.0-beta16", "magento/magento-composer-installer": "*" diff --git a/app/code/Magento/Indexer/etc/module.xml b/app/code/Magento/Indexer/etc/module.xml index 2edd82416ca5f2c865910915dabe1ddaa73da964..f03aca19f0cc4ce32b6ce1b4b168d3d1ab391c37 100644 --- a/app/code/Magento/Indexer/etc/module.xml +++ b/app/code/Magento/Indexer/etc/module.xml @@ -6,10 +6,9 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> - <module name="Magento_Indexer" setup_version="2.0.1"> + <module name="Magento_Indexer" setup_version="2.0.0"> <sequence> <module name="Magento_Store"/> - <module name="Magento_Search"/> </sequence> </module> </config> diff --git a/app/code/Magento/Multishipping/etc/module.xml b/app/code/Magento/Multishipping/etc/module.xml index b6ea0b6ce80cad9020365e8fc77bfe09629ddbb9..1e60e1c6f7c73c6d659502dab1ac634fb389ed02 100644 --- a/app/code/Magento/Multishipping/etc/module.xml +++ b/app/code/Magento/Multishipping/etc/module.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> - <module name="Magento_Multishipping" setup_version="2.0.0.0"> + <module name="Magento_Multishipping" setup_version="2.0.0"> <sequence> <module name="Magento_Store"/> <module name="Magento_Catalog"/> diff --git a/app/code/Magento/OfflinePayments/view/frontend/web/template/payment/banktransfer.html b/app/code/Magento/OfflinePayments/view/frontend/web/template/payment/banktransfer.html index 66cf873c311eb639b8ce0bfba6e43228c5cb915e..fd14f3799a7e8ef6039569a9a830159ff1c0167e 100644 --- a/app/code/Magento/OfflinePayments/view/frontend/web/template/payment/banktransfer.html +++ b/app/code/Magento/OfflinePayments/view/frontend/web/template/payment/banktransfer.html @@ -19,7 +19,7 @@ <!-- ko template: getTemplate() --><!-- /ko --> <!--/ko--> </div> - <p data-bind="text: getInstructions()"></p> + <p data-bind="html: getInstructions()"></p> <div class="checkout-agreements-block"> <!-- ko foreach: $parent.getRegion('before-place-order') --> <!-- ko template: getTemplate() --><!-- /ko --> @@ -42,4 +42,3 @@ </div> </div> </div> - \ No newline at end of file diff --git a/app/code/Magento/OfflinePayments/view/frontend/web/template/payment/cashondelivery.html b/app/code/Magento/OfflinePayments/view/frontend/web/template/payment/cashondelivery.html index 10287d8090d4129e8ddc02880e42c704354478d3..524d7b769b416a6d00b287e0e034f8b2dfc57c1c 100644 --- a/app/code/Magento/OfflinePayments/view/frontend/web/template/payment/cashondelivery.html +++ b/app/code/Magento/OfflinePayments/view/frontend/web/template/payment/cashondelivery.html @@ -19,7 +19,7 @@ <!-- ko template: getTemplate() --><!-- /ko --> <!--/ko--> </div> - <p data-bind="text: getInstructions()"></p> + <p data-bind="html: getInstructions()"></p> <div class="checkout-agreements-block"> <!-- ko foreach: $parent.getRegion('before-place-order') --> <!-- ko template: getTemplate() --><!-- /ko --> @@ -43,4 +43,3 @@ </div> </div> - \ No newline at end of file diff --git a/app/code/Magento/PageCache/etc/events.xml b/app/code/Magento/PageCache/etc/events.xml index e368daf233a14f993694a1f7613f85ffb840c471..d4513d05cccf77f259236bf93d3221a6460a1c8b 100644 --- a/app/code/Magento/PageCache/etc/events.xml +++ b/app/code/Magento/PageCache/etc/events.xml @@ -21,9 +21,6 @@ <event name="adminhtml_cache_flush_all"> <observer name="magento_all_pagecache" instance="Magento\PageCache\Model\Observer\FlushAllCache" method="execute" /> </event> - <event name="adminhtml_cache_refresh_type"> - <observer name="flush_all_pagecache" instance="Magento\PageCache\Model\Observer\FlushAllCache" method="execute" /> - </event> <event name="clean_media_cache_after"> <observer name="flush_all_pagecache" instance="Magento\PageCache\Model\Observer\InvalidateCache" method="execute" /> </event> diff --git a/app/code/Magento/PageCache/etc/module.xml b/app/code/Magento/PageCache/etc/module.xml index bd152d0a9e584b886647f50874c10a515eccd8d6..8a461081663b3a62de597e0ca36abb10115da917 100644 --- a/app/code/Magento/PageCache/etc/module.xml +++ b/app/code/Magento/PageCache/etc/module.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> - <module name="Magento_PageCache" setup_version="1.6.0.0"> + <module name="Magento_PageCache" setup_version="2.0.0"> <sequence> <module name="Magento_Store"/> </sequence> diff --git a/app/code/Magento/Paypal/Block/Adminhtml/Customer/Edit/Tab/Agreement.php b/app/code/Magento/Paypal/Block/Adminhtml/Customer/Edit/Tab/Agreement.php index a038948331ab1f99902b49bce03dc5a6628b528b..2952167ac681fa75bcc6a5e053f10d5d1b68be36 100644 --- a/app/code/Magento/Paypal/Block/Adminhtml/Customer/Edit/Tab/Agreement.php +++ b/app/code/Magento/Paypal/Block/Adminhtml/Customer/Edit/Tab/Agreement.php @@ -150,10 +150,7 @@ class Agreement extends \Magento\Paypal\Block\Adminhtml\Billing\Agreement\Grid i */ protected function _prepareCollection() { - $customerId = $this->_coreRegistry->registry('current_customer_id'); - if (!$customerId) { - $customerId = $this->_coreRegistry->registry('current_customer')->getId(); - } + $customerId = $this->_coreRegistry->registry(RegistryConstants::CURRENT_CUSTOMER_ID); $collection = $this->_agreementFactory->create()->addFieldToFilter( 'customer_id', $customerId diff --git a/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement/CustomerGrid.php b/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement/CustomerGrid.php index 5029599750e5badc3c32ec8056618aa72342d9cb..0c157101b70656897442a3878a2bebd6d26a2b16 100644 --- a/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement/CustomerGrid.php +++ b/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement/CustomerGrid.php @@ -6,6 +6,8 @@ */ namespace Magento\Paypal\Controller\Adminhtml\Billing\Agreement; +use Magento\Customer\Controller\RegistryConstants; + class CustomerGrid extends \Magento\Paypal\Controller\Adminhtml\Billing\Agreement { /** @@ -13,11 +15,11 @@ class CustomerGrid extends \Magento\Paypal\Controller\Adminhtml\Billing\Agreemen * * @return $this */ - protected function _initCustomer() + protected function initCurrentCustomer() { $customerId = (int)$this->getRequest()->getParam('id'); if ($customerId) { - $this->_coreRegistry->register('current_customer_id', $customerId); + $this->_coreRegistry->register(RegistryConstants::CURRENT_CUSTOMER_ID, $customerId); } return $this; } @@ -29,7 +31,7 @@ class CustomerGrid extends \Magento\Paypal\Controller\Adminhtml\Billing\Agreemen */ public function execute() { - $this->_initCustomer(); + $this->initCurrentCustomer(); $this->_view->loadLayout(false); $this->_view->renderLayout(); } diff --git a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/PlaceOrder.php b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/PlaceOrder.php index f760294d0ca6c6b8f36c214ed2efc47ed618f34f..44cd56531af469e2b8a80a734fcfeaa9400b27fc 100644 --- a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/PlaceOrder.php +++ b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/PlaceOrder.php @@ -40,7 +40,8 @@ class PlaceOrder extends \Magento\Paypal\Controller\Express\AbstractExpress $order = $this->_checkout->getOrder(); if ($order) { $this->_getCheckoutSession()->setLastOrderId($order->getId()) - ->setLastRealOrderId($order->getIncrementId()); + ->setLastRealOrderId($order->getIncrementId()) + ->setLastOrderStatus($order->getStatus()); } $this->_eventManager->dispatch( diff --git a/app/code/Magento/Paypal/view/frontend/web/js/action/set-payment-method.js b/app/code/Magento/Paypal/view/frontend/web/js/action/set-payment-method.js index ffae21860511e483f79b59db7b4b4c10bd02d5eb..b7118b886ea7674890f97a724adbc6c287ef5ffc 100644 --- a/app/code/Magento/Paypal/view/frontend/web/js/action/set-payment-method.js +++ b/app/code/Magento/Paypal/view/frontend/web/js/action/set-payment-method.js @@ -24,7 +24,7 @@ define( */ if (!customer.isLoggedIn()) { serviceUrl = urlBuilder.createUrl('/guest-carts/:cartId/selected-payment-method', { - quoteId: quote.getQuoteId() + cartId: quote.getQuoteId() }); payload = { cartId: quote.getQuoteId(), diff --git a/app/code/Magento/Paypal/view/frontend/web/template/payment/payflowpro-form.html b/app/code/Magento/Paypal/view/frontend/web/template/payment/payflowpro-form.html index d13040292a458a943d6279407cfc4593c7905ade..0292ef42cfd55d0cff8b7b7944c97595e7c6c00d 100644 --- a/app/code/Magento/Paypal/view/frontend/web/template/payment/payflowpro-form.html +++ b/app/code/Magento/Paypal/view/frontend/web/template/payment/payflowpro-form.html @@ -16,7 +16,6 @@ </div> <div class="payment-method-content"> - <div class="payment-method-note"><!-- ko text: $t('We\'ll ask for your payment details before you place an order.') --><!-- /ko --></div> <div class="payment-method-billing-address"> <!-- ko foreach: $parent.getRegion(getBillingAddressFormName()) --> <!-- ko template: getTemplate() --><!-- /ko --> diff --git a/app/code/Magento/Quote/Model/Observer/Backend/CustomerQuote.php b/app/code/Magento/Quote/Model/Observer/Backend/CustomerQuote.php index f5221834db63d89e126d5015afac357c7035eb78..168f5dc060a6b380133b61e51a4cf67edc963628 100644 --- a/app/code/Magento/Quote/Model/Observer/Backend/CustomerQuote.php +++ b/app/code/Magento/Quote/Model/Observer/Backend/CustomerQuote.php @@ -55,28 +55,26 @@ class CustomerQuote { /** @var \Magento\Customer\Api\Data\CustomerInterface $customer */ $customer = $observer->getEvent()->getCustomerDataObject(); - /** @var \Magento\Customer\Api\Data\CustomerInterface $origCustomer */ - $origCustomer = $observer->getEvent()->getOrigCustomerDataObject(); - if ($customer->getGroupId() !== $origCustomer->getGroupId()) { - /** - * It is needed to process customer's quotes for all websites - * if customer accounts are shared between all of them - */ - /** @var $websites \Magento\Store\Model\Website[] */ - $websites = $this->config->isWebsiteScope() - ? [$this->storeManager->getWebsite($customer->getWebsiteId())] - : $this->storeManager->getWebsites(); + try { + $quote = $this->quoteRepository->getForCustomer($customer->getId()); + if ($customer->getGroupId() !== $quote->getCustomerGroupId()) { + /** + * It is needed to process customer's quotes for all websites + * if customer accounts are shared between all of them + */ + /** @var $websites \Magento\Store\Model\Website[] */ + $websites = $this->config->isWebsiteScope() + ? [$this->storeManager->getWebsite($customer->getWebsiteId())] + : $this->storeManager->getWebsites(); - foreach ($websites as $website) { - try { - $quote = $this->quoteRepository->getForCustomer($customer->getId()); + foreach ($websites as $website) { $quote->setWebsite($website); $quote->setCustomerGroupId($customer->getGroupId()); $quote->collectTotals(); $this->quoteRepository->save($quote); - } catch (\Magento\Framework\Exception\NoSuchEntityException $e) { } } + } catch (\Magento\Framework\Exception\NoSuchEntityException $e) { } } } diff --git a/app/code/Magento/Quote/Test/Unit/Model/Observer/Backend/CustomerQuoteTest.php b/app/code/Magento/Quote/Test/Unit/Model/Observer/Backend/CustomerQuoteTest.php index 7528b7793904084b77dd56134cbf542afc3eeb4f..c32b3c533209f77483789bab98a1ef22c94024f0 100644 --- a/app/code/Magento/Quote/Test/Unit/Model/Observer/Backend/CustomerQuoteTest.php +++ b/app/code/Magento/Quote/Test/Unit/Model/Observer/Backend/CustomerQuoteTest.php @@ -57,7 +57,7 @@ class CustomerQuoteTest extends \PHPUnit_Framework_TestCase ->getMock(); $this->eventMock = $this->getMockBuilder('Magento\Framework\Event') ->disableOriginalConstructor() - ->setMethods(['getOrigCustomerDataObject', 'getCustomerDataObject']) + ->setMethods(['getCustomerDataObject']) ->getMock(); $this->observerMock->expects($this->any())->method('getEvent')->will($this->returnValue($this->eventMock)); $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); @@ -91,8 +91,9 @@ class CustomerQuoteTest extends \PHPUnit_Framework_TestCase $this->eventMock->expects($this->any()) ->method('getOrigCustomerDataObject') ->will($this->returnValue($origCustomerDataObjectMock)); - $this->quoteRepositoryMock->expects($this->never()) - ->method('getForCustomer'); + $this->quoteRepositoryMock->expects($this->once()) + ->method('getForCustomer') + ->willThrowException(new \Magento\Framework\Exception\NoSuchEntityException()); $this->customerQuote->dispatch($this->observerMock); } @@ -100,10 +101,9 @@ class CustomerQuoteTest extends \PHPUnit_Framework_TestCase /** * @param bool $isWebsiteScope * @param array $websites - * @param int $quoteId * @dataProvider dispatchDataProvider */ - public function testDispatch($isWebsiteScope, $websites, $quoteId) + public function testDispatch($isWebsiteScope, $websites) { $this->configMock->expects($this->once()) ->method('isWebsiteScope') @@ -128,18 +128,9 @@ class CustomerQuoteTest extends \PHPUnit_Framework_TestCase ->method('getWebsites') ->will($this->returnValue($websites)); } - $origCustomerDataObjectMock = $this->getMockBuilder('Magento\Customer\Api\Data\CustomerInterface') - ->disableOriginalConstructor() - ->getMock(); - $origCustomerDataObjectMock->expects($this->any()) - ->method('getGroupId') - ->will($this->returnValue(2)); $this->eventMock->expects($this->any()) ->method('getCustomerDataObject') ->will($this->returnValue($customerDataObjectMock)); - $this->eventMock->expects($this->any()) - ->method('getOrigCustomerDataObject') - ->will($this->returnValue($origCustomerDataObjectMock)); /** @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Quote\Model\Quote $quoteMock */ $quoteMock = $this->getMockBuilder( 'Magento\Quote\Model\Quote' @@ -147,52 +138,38 @@ class CustomerQuoteTest extends \PHPUnit_Framework_TestCase [ 'setWebsite', 'setCustomerGroupId', + 'getCustomerGroupId', 'collectTotals', '__wakeup', ] )->disableOriginalConstructor( )->getMock(); $websiteCount = count($websites); - if ($quoteId) { - $this->quoteRepositoryMock->expects($this->exactly($websiteCount)) - ->method('getForCustomer') - ->will($this->returnValue($quoteMock)); - $quoteMock->expects($this->exactly($websiteCount)) - ->method('setWebsite'); - $quoteMock->expects($this->exactly($websiteCount)) - ->method('setCustomerGroupId'); - $quoteMock->expects($this->exactly($websiteCount)) - ->method('collectTotals'); - $this->quoteRepositoryMock->expects($this->exactly($websiteCount)) - ->method('save') - ->with($quoteMock); - } else { - $this->quoteRepositoryMock->expects($this->exactly($websiteCount)) - ->method('getForCustomer') - ->willThrowException( - new \Magento\Framework\Exception\NoSuchEntityException() - ); - $quoteMock->expects($this->never()) - ->method('setCustomerGroupId'); - $quoteMock->expects($this->never()) - ->method('collectTotals'); - $this->quoteRepositoryMock->expects($this->never()) - ->method('save'); - } + $this->quoteRepositoryMock->expects($this->once()) + ->method('getForCustomer') + ->will($this->returnValue($quoteMock)); + $quoteMock->expects($this->exactly($websiteCount)) + ->method('setWebsite'); + $quoteMock->expects($this->exactly($websiteCount)) + ->method('setCustomerGroupId'); + $quoteMock->expects($this->exactly($websiteCount)) + ->method('collectTotals'); + $this->quoteRepositoryMock->expects($this->exactly($websiteCount)) + ->method('save') + ->with($quoteMock); + $quoteMock->expects($this->once()) + ->method('getCustomerGroupId') + ->willReturn(2); $this->customerQuote->dispatch($this->observerMock); } public function dispatchDataProvider() { return [ - [true, ['website1'], 3], - [true, ['website1', 'website2'], 3], - [false, ['website1'], 3], - [false, ['website1', 'website2'], 3], - [true, ['website1'], null], - [true, ['website1', 'website2'], null], - [false, ['website1'], null], - [false, ['website1', 'website2'], null], + [true, ['website1']], + [true, ['website1', 'website2']], + [false, ['website1']], + [false, ['website1', 'website2']], ]; } } diff --git a/app/code/Magento/RequireJs/etc/module.xml b/app/code/Magento/RequireJs/etc/module.xml index 05927da66756a94298bbff643a206a34428d3097..e9545774fa3ab06e7872fa04fce409941126efda 100644 --- a/app/code/Magento/RequireJs/etc/module.xml +++ b/app/code/Magento/RequireJs/etc/module.xml @@ -6,5 +6,5 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> - <module name="Magento_RequireJs" setup_version="1.0.0.0"/> + <module name="Magento_RequireJs" setup_version="2.0.0"/> </config> diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/Create/Items.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/Create/Items.php index 05b96498e8cac0c0ebe07934a54e1baa1cf7f9b8..e07c8d24c23d9dfabe1a54c76fa7d596046ec0ff 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/Create/Items.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/Create/Items.php @@ -63,7 +63,7 @@ class Items extends \Magento\Sales\Block\Adminhtml\Items\AbstractItems 'Magento\Backend\Block\Widget\Button', [ 'label' => __('Refund'), - 'class' => 'save submit-button refund', + 'class' => 'save submit-button refund primary', 'onclick' => 'disableElements(\'submit-button\');submitCreditMemo()' ] ); @@ -73,7 +73,7 @@ class Items extends \Magento\Sales\Block\Adminhtml\Items\AbstractItems 'Magento\Backend\Block\Widget\Button', [ 'label' => __('Refund Offline'), - 'class' => 'save submit-button', + 'class' => 'save submit-button primary', 'onclick' => 'disableElements(\'submit-button\');submitCreditMemoOffline()' ] ); diff --git a/app/code/Magento/Sales/Model/Order/Customer/Management.php b/app/code/Magento/Sales/Model/Order/Customer/Management.php index 9521dfa77701705ff11c4cb56ace448ef9581314..2fd0890b7fd15cd7ed5878eb4abb95d1faf6881f 100644 --- a/app/code/Magento/Sales/Model/Order/Customer/Management.php +++ b/app/code/Magento/Sales/Model/Order/Customer/Management.php @@ -24,6 +24,11 @@ class Management implements \Magento\Sales\Api\OrderCustomerManagementInterface */ protected $addressFactory; + /** + * @var \Magento\Customer\Api\Data\RegionInterfaceFactory + */ + protected $regionFactory; + /** * @var \Magento\Sales\Api\OrderRepositoryInterface */ @@ -39,6 +44,7 @@ class Management implements \Magento\Sales\Api\OrderCustomerManagementInterface * @param \Magento\Customer\Api\AccountManagementInterface $accountManagement * @param \Magento\Customer\Api\Data\CustomerInterfaceFactory $customerFactory * @param \Magento\Customer\Api\Data\AddressInterfaceFactory $addressFactory + * @param \Magento\Customer\Api\Data\RegionInterfaceFactory $regionFactory * @param \Magento\Sales\Api\OrderRepositoryInterface $orderRepository */ public function __construct( @@ -46,6 +52,7 @@ class Management implements \Magento\Sales\Api\OrderCustomerManagementInterface \Magento\Customer\Api\AccountManagementInterface $accountManagement, \Magento\Customer\Api\Data\CustomerInterfaceFactory $customerFactory, \Magento\Customer\Api\Data\AddressInterfaceFactory $addressFactory, + \Magento\Customer\Api\Data\RegionInterfaceFactory $regionFactory, \Magento\Sales\Api\OrderRepositoryInterface $orderRepository ) { $this->objectCopyService = $objectCopyService; @@ -53,6 +60,7 @@ class Management implements \Magento\Sales\Api\OrderCustomerManagementInterface $this->orderRepository = $orderRepository; $this->customerFactory = $customerFactory; $this->addressFactory = $addressFactory; + $this->regionFactory = $regionFactory; } /** @@ -78,7 +86,17 @@ class Management implements \Magento\Sales\Api\OrderCustomerManagementInterface $address, [] ); - $customerData['addresses'][] = $this->addressFactory->create(['data' => $addressData]); + /** @var \Magento\Customer\Api\Data\AddressInterface $customerAddress */ + $customerAddress = $this->addressFactory->create(['data' => $addressData]); + if (is_string($address->getRegion())) { + /** @var \Magento\Customer\Api\Data\RegionInterface $region */ + $region = $this->regionFactory->create(); + $region->setRegion($address->getRegion()); + $region->setRegionCode($address->getRegionCode()); + $region->setRegionId($address->getRegionId()); + $customerAddress->setRegion($region); + } + $customerData['addresses'][] = $customerAddress; } /** @var \Magento\Customer\Api\Data\CustomerInterface $customer */ diff --git a/app/code/Magento/Sales/Setup/InstallSchema.php b/app/code/Magento/Sales/Setup/InstallSchema.php index afa4460d56fa6d084051b95f1bb19afb60b2c95b..8e44a50adf15560144cd21fbad180e603a4f6a89 100644 --- a/app/code/Magento/Sales/Setup/InstallSchema.php +++ b/app/code/Magento/Sales/Setup/InstallSchema.php @@ -473,6 +473,12 @@ class InstallSchema implements InstallSchemaInterface null, ['unsigned' => true], 'Email Sent' + )->addColumn( + 'send_email', + \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, + null, + ['unsigned' => true], + 'Send Email' )->addColumn( 'forced_shipment_with_invoice', \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, @@ -759,7 +765,7 @@ class InstallSchema implements InstallSchemaInterface 'updated_at', \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, null, - ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_UPDATE], + ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT_UPDATE], 'Updated At' )->addColumn( 'total_item_count', @@ -851,10 +857,10 @@ class InstallSchema implements InstallSchemaInterface )->addIndex( $installer->getIdxName( 'sales_order', - ['increment_id'], + ['increment_id', 'store_id'], \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE ), - ['increment_id'], + ['increment_id', 'store_id'], ['type' => \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE] )->addIndex( $installer->getIdxName('sales_order', ['created_at']), @@ -871,6 +877,12 @@ class InstallSchema implements InstallSchemaInterface )->addIndex( $installer->getIdxName('sales_order', ['updated_at']), ['updated_at'] + )->addIndex( + $installer->getIdxName('sales_order', ['send_email']), + ['send_email'] + )->addIndex( + $installer->getIdxName('sales_order', ['email_sent']), + ['email_sent'] )->addForeignKey( $installer->getFkName('sales_order', 'customer_id', 'customer_entity', 'entity_id'), 'customer_id', @@ -1070,10 +1082,10 @@ class InstallSchema implements InstallSchemaInterface )->addIndex( $installer->getIdxName( 'sales_order_grid', - ['increment_id'], + ['increment_id', 'store_id'], \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE ), - ['increment_id'], + ['increment_id', 'store_id'], ['type' => \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE] )->addIndex( $installer->getIdxName('sales_order_grid', ['shipping_name']), @@ -1309,7 +1321,7 @@ class InstallSchema implements InstallSchemaInterface 'created_at', \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, null, - [], + ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT], 'Created At' )->addColumn( 'entity_name', @@ -2149,6 +2161,12 @@ class InstallSchema implements InstallSchemaInterface null, ['unsigned' => true], 'Email Sent' + )->addColumn( + 'send_email', + \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, + null, + ['unsigned' => true], + 'Send Email' )->addColumn( 'order_id', \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, @@ -2189,13 +2207,13 @@ class InstallSchema implements InstallSchemaInterface 'created_at', \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, null, - [], + ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT], 'Created At' )->addColumn( 'updated_at', \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, null, - [], + ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT_UPDATE], 'Updated At' )->addColumn( 'packages', @@ -2209,6 +2227,18 @@ class InstallSchema implements InstallSchemaInterface '2m', [], 'Shipping Label Content' + )->addColumn( + 'customer_note', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + null, + [], + 'Customer Note' + )->addColumn( + 'customer_note_notify', + \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, + null, + ['unsigned' => true], + 'Customer Note Notify' )->addIndex( $installer->getIdxName('sales_shipment', ['store_id']), ['store_id'] @@ -2218,10 +2248,10 @@ class InstallSchema implements InstallSchemaInterface )->addIndex( $installer->getIdxName( 'sales_shipment', - ['increment_id'], + ['increment_id', 'store_id'], \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE ), - ['increment_id'], + ['increment_id', 'store_id'], ['type' => \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE] )->addIndex( $installer->getIdxName('sales_shipment', ['order_id']), @@ -2232,6 +2262,12 @@ class InstallSchema implements InstallSchemaInterface )->addIndex( $installer->getIdxName('sales_shipment', ['updated_at']), ['updated_at'] + )->addIndex( + $installer->getIdxName('sales_shipment', ['send_email']), + ['send_email'] + )->addIndex( + $installer->getIdxName('sales_shipment', ['email_sent']), + ['email_sent'] )->addForeignKey( $installer->getFkName('sales_shipment', 'order_id', 'sales_order', 'entity_id'), 'order_id', @@ -2420,6 +2456,9 @@ class InstallSchema implements InstallSchemaInterface )->addIndex( $installer->getIdxName('sales_shipment_grid', ['created_at']), ['created_at'] + )->addIndex( + $installer->getIdxName('sales_shipment_grid', ['updated_at']), + ['updated_at'] )->addIndex( $installer->getIdxName('sales_shipment_grid', ['order_created_at']), ['order_created_at'] @@ -2612,13 +2651,13 @@ class InstallSchema implements InstallSchemaInterface 'created_at', \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, null, - [], + ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT], 'Created At' )->addColumn( 'updated_at', \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, null, - [], + ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT_UPDATE], 'Updated At' )->addIndex( $installer->getIdxName('sales_shipment_track', ['parent_id']), @@ -2679,7 +2718,7 @@ class InstallSchema implements InstallSchemaInterface 'created_at', \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, null, - [], + ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT], 'Created At' )->addIndex( $installer->getIdxName('sales_shipment_comment', ['created_at']), @@ -2853,6 +2892,12 @@ class InstallSchema implements InstallSchemaInterface null, ['unsigned' => true], 'Email Sent' + )->addColumn( + 'send_email', + \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, + null, + ['unsigned' => true], + 'Send Email' )->addColumn( 'can_void_flag', \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, @@ -2911,13 +2956,13 @@ class InstallSchema implements InstallSchemaInterface 'created_at', \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, null, - [], + ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT], 'Created At' )->addColumn( 'updated_at', \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, null, - [], + ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT_UPDATE], 'Updated At' )->addColumn( 'discount_tax_compensation_amount', @@ -2967,6 +3012,18 @@ class InstallSchema implements InstallSchemaInterface 255, [], 'Discount Description' + )->addColumn( + 'customer_note', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + null, + [], + 'Customer Note' + )->addColumn( + 'customer_note_notify', + \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, + null, + ['unsigned' => true], + 'Customer Note Notify' )->addIndex( $installer->getIdxName('sales_invoice', ['store_id']), ['store_id'] @@ -2982,14 +3039,23 @@ class InstallSchema implements InstallSchemaInterface )->addIndex( $installer->getIdxName( 'sales_invoice', - ['increment_id'], + ['increment_id', 'store_id'], \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE ), - ['increment_id'], + ['increment_id', 'store_id'], ['type' => \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE] )->addIndex( $installer->getIdxName('sales_invoice', ['created_at']), ['created_at'] + )->addIndex( + $installer->getIdxName('sales_invoice', ['updated_at']), + ['updated_at'] + )->addIndex( + $installer->getIdxName('sales_invoice', ['send_email']), + ['send_email'] + )->addIndex( + $installer->getIdxName('sales_invoice', ['email_sent']), + ['email_sent'] )->addForeignKey( $installer->getFkName('sales_invoice', 'order_id', 'sales_order', 'entity_id'), 'order_id', @@ -3156,6 +3222,12 @@ class InstallSchema implements InstallSchemaInterface null, [], 'Created At' + )->addColumn( + 'updated_at', + \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, + null, + [], + 'Updated At' )->addIndex( $installer->getIdxName('sales_invoice_grid', ['store_id']), ['store_id'] @@ -3182,6 +3254,9 @@ class InstallSchema implements InstallSchemaInterface )->addIndex( $installer->getIdxName('sales_invoice_grid', ['created_at']), ['created_at'] + )->addIndex( + $installer->getIdxName('sales_invoice_grid', ['updated_at']), + ['updated_at'] )->addIndex( $installer->getIdxName('sales_invoice_grid', ['order_created_at']), ['order_created_at'] @@ -3425,7 +3500,7 @@ class InstallSchema implements InstallSchemaInterface 'created_at', \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, null, - [], + ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT], 'Created At' )->addIndex( $installer->getIdxName('sales_invoice_comment', ['created_at']), @@ -3617,6 +3692,12 @@ class InstallSchema implements InstallSchemaInterface null, ['unsigned' => true], 'Email Sent' + )->addColumn( + 'send_email', + \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, + null, + ['unsigned' => true], + 'Send Email' )->addColumn( 'creditmemo_status', \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, @@ -3687,13 +3768,13 @@ class InstallSchema implements InstallSchemaInterface 'created_at', \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, null, - [], + ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT], 'Created At' )->addColumn( 'updated_at', \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, null, - [], + ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT_UPDATE], 'Updated At' )->addColumn( 'discount_tax_compensation_amount', @@ -3737,6 +3818,18 @@ class InstallSchema implements InstallSchemaInterface 255, [], 'Discount Description' + )->addColumn( + 'customer_note', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + null, + [], + 'Customer Note' + )->addColumn( + 'customer_note_notify', + \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, + null, + ['unsigned' => true], + 'Customer Note Notify' )->addIndex( $installer->getIdxName('sales_creditmemo', ['store_id']), ['store_id'] @@ -3749,10 +3842,10 @@ class InstallSchema implements InstallSchemaInterface )->addIndex( $installer->getIdxName( 'sales_creditmemo', - ['increment_id'], + ['increment_id', 'store_id'], \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE ), - ['increment_id'], + ['increment_id', 'store_id'], ['type' => \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE] )->addIndex( $installer->getIdxName('sales_creditmemo', ['state']), @@ -3760,6 +3853,15 @@ class InstallSchema implements InstallSchemaInterface )->addIndex( $installer->getIdxName('sales_creditmemo', ['created_at']), ['created_at'] + )->addIndex( + $installer->getIdxName('sales_creditmemo', ['updated_at']), + ['updated_at'] + )->addIndex( + $installer->getIdxName('sales_creditmemo', ['send_email']), + ['send_email'] + )->addIndex( + $installer->getIdxName('sales_creditmemo', ['email_sent']), + ['email_sent'] )->addForeignKey( $installer->getFkName('sales_creditmemo', 'order_id', 'sales_order', 'entity_id'), 'order_id', @@ -3800,6 +3902,12 @@ class InstallSchema implements InstallSchemaInterface null, [], 'Created At' + )->addColumn( + 'updated_at', + \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, + null, + [], + 'Updated At' )->addColumn( 'order_id', \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, @@ -3937,6 +4045,9 @@ class InstallSchema implements InstallSchemaInterface )->addIndex( $installer->getIdxName('sales_creditmemo_grid', ['created_at']), ['created_at'] + )->addIndex( + $installer->getIdxName('sales_creditmemo_grid', ['updated_at']), + ['updated_at'] )->addIndex( $installer->getIdxName('sales_creditmemo_grid', ['order_created_at']), ['order_created_at'] @@ -4198,7 +4309,7 @@ class InstallSchema implements InstallSchemaInterface 'created_at', \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, null, - [], + ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT], 'Created At' )->addIndex( $installer->getIdxName('sales_creditmemo_comment', ['created_at']), @@ -4596,7 +4707,7 @@ class InstallSchema implements InstallSchemaInterface 'created_at', \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, null, - [], + ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT], 'Created At' )->addIndex( $installer->getIdxName( diff --git a/app/code/Magento/Sales/Setup/UpgradeSchema.php b/app/code/Magento/Sales/Setup/UpgradeSchema.php deleted file mode 100644 index 58d07c9d1bba2e1348a1218895e7bc6e16f9888e..0000000000000000000000000000000000000000 --- a/app/code/Magento/Sales/Setup/UpgradeSchema.php +++ /dev/null @@ -1,229 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Sales\Setup; - -use Magento\Framework\DB\Ddl\Table; -use Magento\Framework\Setup\UpgradeSchemaInterface; -use Magento\Framework\Setup\ModuleContextInterface; -use Magento\Framework\Setup\SchemaSetupInterface; - -/** - * @codeCoverageIgnore - */ -class UpgradeSchema implements UpgradeSchemaInterface -{ - /** - * {@inheritdoc} - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) - * @SuppressWarnings(PHPMD.CyclomaticComplexity) - * @SuppressWarnings(PHPMD.NPathComplexity) - */ - public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context) - { - $installer = $setup; - $connection = $installer->getConnection(); - if (version_compare($context->getVersion(), '2.0.1') < 0) { - - $installer = $setup; - - /** - * update columns created_at and updated_at in sales entities tables - */ - - $tables = [ - 'sales_creditmemo', - 'sales_creditmemo_comment', - 'sales_invoice', - 'sales_invoice_comment', - 'sales_order', - 'sales_order_item', - 'sales_order_status_history', - 'sales_payment_transaction', - 'sales_shipment', - 'sales_shipment_comment', - 'sales_shipment_track' - ]; - /** @var \Magento\Framework\DB\Adapter\AdapterInterface $connection */ - $connection = $installer->getConnection(); - foreach ($tables as $table) { - $columns = $connection->describeTable($installer->getTable($table)); - if (isset($columns['created_at'])) { - $createdAt = $columns['created_at']; - $createdAt['DEFAULT'] = Table::TIMESTAMP_INIT; - $createdAt['TYPE'] = Table::TYPE_TIMESTAMP; - $connection->modifyColumn($installer->getTable($table), 'created_at', $createdAt); - } - if (isset($columns['updated_at'])) { - $updatedAt = $columns['updated_at']; - $updatedAt['DEFAULT'] = Table::TIMESTAMP_UPDATE; - $updatedAt['TYPE'] = Table::TYPE_TIMESTAMP; - $connection->modifyColumn($installer->getTable($table), 'updated_at', $updatedAt); - } - } - } - - if (version_compare($context->getVersion(), '2.0.2') < 0) { - - /** - * Adding 'updated_at' columns. - */ - - $tables = ['sales_shipment_grid', 'sales_invoice_grid', 'sales_creditmemo_grid']; - - foreach ($tables as $table) { - $table = $setup->getTable($table); - - $setup->getConnection() - ->addColumn( - $table, - 'updated_at', - [ - 'type' => Table::TYPE_TIMESTAMP, - 'after' => 'created_at', - 'comment' => 'Updated At' - ] - ); - - $setup->getConnection() - ->addIndex($table, $setup->getIdxName($table, ['updated_at']), 'updated_at'); - } - - /** - * Modifying default value of 'updated_at' columns. - */ - - $tables = ['sales_order', 'sales_shipment', 'sales_invoice', 'sales_creditmemo']; - - foreach ($tables as $table) { - $table = $setup->getTable($table); - - $setup->getConnection() - ->modifyColumn( - $table, - 'updated_at', - [ - 'type' => Table::TYPE_TIMESTAMP, - 'default' => Table::TIMESTAMP_INIT_UPDATE - ] - ); - } - } - - if (version_compare($context->getVersion(), '2.0.3') < 0) { - $dropIncrementIndexTables = [ - 'sales_creditmemo', - 'sales_invoice', - 'sales_order', - 'sales_shipment', - 'sales_order_grid', - ]; - foreach ($dropIncrementIndexTables as $table) { - $connection->dropIndex( - $installer->getTable($table), - $installer->getIdxName( - $installer->getTable($table), - ['increment_id'], - \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE - ) - ); - } - $createIncrementIndexTables = [ - 'sales_creditmemo', - 'sales_invoice', - 'sales_order', - 'sales_shipment', - 'sales_order_grid', - ]; - foreach ($createIncrementIndexTables as $table) { - $connection->addIndex( - $installer->getTable($table), - $installer->getIdxName( - $installer->getTable($table), - ['increment_id', 'store_id'], - \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE - ), - ['increment_id', 'store_id'], - \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE - ); - } - } - - if (version_compare($context->getVersion(), '2.0.4') < 0) { - - /** - * Adding 'send_email' columns. - */ - - $tables = ['sales_order', 'sales_invoice', 'sales_shipment', 'sales_creditmemo']; - - foreach ($tables as $table) { - $table = $setup->getTable($table); - - $setup->getConnection() - ->addColumn( - $table, - 'send_email', - [ - 'type' => Table::TYPE_SMALLINT, - 'after' => 'email_sent', - 'comment' => 'Send Email', - 'unsigned' => true - ] - ); - - $setup->getConnection() - ->addIndex($table, $setup->getIdxName($table, ['email_sent']), 'email_sent'); - - $setup->getConnection() - ->addIndex($table, $setup->getIdxName($table, ['send_email']), 'send_email'); - } - - /** - * Adding 'customer_note' columns. - */ - - $tables = ['sales_invoice', 'sales_shipment', 'sales_creditmemo']; - - foreach ($tables as $table) { - $table = $setup->getTable($table); - - $setup->getConnection() - ->addColumn( - $table, - 'customer_note', - [ - 'type' => Table::TYPE_TEXT, - 'after' => 'updated_at', - 'comment' => 'Customer Note' - ] - ); - } - - /** - * Adding 'customer_note_notify' columns. - */ - - $tables = ['sales_invoice', 'sales_shipment', 'sales_creditmemo']; - - foreach ($tables as $table) { - $table = $setup->getTable($table); - - $setup->getConnection() - ->addColumn( - $table, - 'customer_note_notify', - [ - 'type' => Table::TYPE_SMALLINT, - 'after' => 'customer_note', - 'comment' => 'Customer Note Notify', - 'unsigned' => true - ] - ); - } - } - } -} diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Customer/ManagementTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Customer/ManagementTest.php index 07ce63f99c675a1b0ddeed485e12734add2ae06a..a837fd66e86b93ad5e92e3f98733a1f92c655f74 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Customer/ManagementTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Customer/ManagementTest.php @@ -35,6 +35,11 @@ class ManagementTest extends \PHPUnit_Framework_TestCase */ protected $orderRepository; + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $regionFactory; + /** * @var \Magento\Sales\Model\Order\Customer\Management */ @@ -58,6 +63,13 @@ class ManagementTest extends \PHPUnit_Framework_TestCase '', false ); + $this->regionFactory = $this->getMock( + 'Magento\Customer\Api\Data\RegionInterfaceFactory', + ['create'], + [], + '', + false + ); $this->orderRepository = $this->getMock('\Magento\Sales\Api\OrderRepositoryInterface'); $this->service = new \Magento\Sales\Model\Order\Customer\Management( @@ -65,6 +77,7 @@ class ManagementTest extends \PHPUnit_Framework_TestCase $this->accountManagement, $this->customerFactory, $this->addressFactory, + $this->regionFactory, $this->orderRepository ); } @@ -85,14 +98,15 @@ class ManagementTest extends \PHPUnit_Framework_TestCase $orderMock = $this->getMock('\Magento\Sales\Api\Data\OrderInterface'); $orderMock->expects($this->once())->method('getCustomerId')->will($this->returnValue(null)); $orderMock->expects($this->any())->method('getBillingAddress')->will($this->returnValue('billing_address')); - $addresses = ['order_address_data', 'order_address_data']; + $orderAddress = $this->getMock('\Magento\Sales\Api\Data\OrderAddressInterface'); + $addresses = [$orderAddress, $orderAddress]; $orderMock->expects($this->any())->method('getAddresses')->will($this->returnValue($addresses)); $this->orderRepository->expects($this->once())->method('get')->with(1)->will($this->returnValue($orderMock)); $this->objectCopyService->expects($this->any())->method('copyFieldsetToTarget')->will($this->returnValueMap( [ ['order_address', 'to_customer', 'billing_address', [], 'global', ['customer_data' => []]], - ['order_address', 'to_customer_address', 'order_address_data', [], 'global', 'address_data'] + ['order_address', 'to_customer_address', $orderAddress, [], 'global', 'address_data'] ] )); $addressMock = $this->getMock('\Magento\Customer\Api\Data\CustomerAddressInterface'); diff --git a/app/code/Magento/Sales/Ui/Component/Listing/Column/PaymentMethod.php b/app/code/Magento/Sales/Ui/Component/Listing/Column/PaymentMethod.php index fa8011a7bb5640950d7a12adc1afcc60a705e50d..2e245ab41cb9bbdecdeed1e56893895a73eb6a7d 100644 --- a/app/code/Magento/Sales/Ui/Component/Listing/Column/PaymentMethod.php +++ b/app/code/Magento/Sales/Ui/Component/Listing/Column/PaymentMethod.php @@ -50,8 +50,13 @@ class PaymentMethod extends Column { if (isset($dataSource['data']['items'])) { foreach ($dataSource['data']['items'] as & $item) { - $item[$this->getData('name')] = $this->paymentHelper->getMethodInstance($item[$this->getData('name')]) - ->getTitle(); + try { + $item[$this->getData('name')] = $this->paymentHelper + ->getMethodInstance($item[$this->getData('name')]) + ->getTitle(); + } catch (\UnexpectedValueException $exception) { + //Displaying payment code (with no changes) if payment method is not available in system + } } } } diff --git a/app/code/Magento/Sales/etc/module.xml b/app/code/Magento/Sales/etc/module.xml index 931f2ab5884d8cb48936375b141eaba64c35d37e..294eb87cb25482a436b551daaa0adf30639299b8 100644 --- a/app/code/Magento/Sales/etc/module.xml +++ b/app/code/Magento/Sales/etc/module.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> - <module name="Magento_Sales" setup_version="2.0.4"> + <module name="Magento_Sales" setup_version="2.0.0"> <sequence> <module name="Magento_Rule"/> <module name="Magento_Catalog"/> diff --git a/app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js b/app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js index cad2d7505b8e5d01b3db70842b9ee45ccc482a90..da408242575901a134ea5af0fbd6cc7f550b4d1a 100644 --- a/app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js +++ b/app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js @@ -1131,6 +1131,7 @@ AdminOrder.prototype = { disableElements('save'); jQuery('#edit_form').on('invalid-form.validate', function() { enableElements('save'); + jQuery('#edit_form').trigger('processStop'); jQuery('#edit_form').off('invalid-form.validate'); }); jQuery('#edit_form').triggerHandler('save'); diff --git a/app/code/Magento/SalesSequence/etc/module.xml b/app/code/Magento/SalesSequence/etc/module.xml index c948c4a55aadc433a6aa587d82f2162f7b0bb40a..77c87265e8f427f66210447f4de96c2b443ef476 100644 --- a/app/code/Magento/SalesSequence/etc/module.xml +++ b/app/code/Magento/SalesSequence/etc/module.xml @@ -6,6 +6,6 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> - <module name="Magento_SalesSequence" setup_version="2.0.1"> + <module name="Magento_SalesSequence" setup_version="2.0.0"> </module> </config> diff --git a/app/code/Magento/Search/Api/SearchInterface.php b/app/code/Magento/Search/Api/SearchInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..4e53ba17fde129c834b3f319c96c3fc14494440f --- /dev/null +++ b/app/code/Magento/Search/Api/SearchInterface.php @@ -0,0 +1,20 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Search\Api; + +/** + * @api + */ +interface SearchInterface +{ + /** + * Make Full Text Search and return found Documents + * + * @param \Magento\Framework\Api\Search\SearchCriteriaInterface $searchCriteria + * @return \Magento\Framework\Api\Search\SearchResultInterface + */ + public function search(\Magento\Framework\Api\Search\SearchCriteriaInterface $searchCriteria); +} diff --git a/app/code/Magento/Search/Model/Search.php b/app/code/Magento/Search/Model/Search.php new file mode 100644 index 0000000000000000000000000000000000000000..58f6d2a6c39d48e5d8fa0e8390875a091d62877c --- /dev/null +++ b/app/code/Magento/Search/Model/Search.php @@ -0,0 +1,102 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Search\Model; + +use Magento\Framework\Api\Search\SearchCriteriaInterface; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\Search\Request\Builder; +use Magento\Framework\Search\SearchEngineInterface; +use Magento\Search\Api\SearchInterface; +use Magento\Store\Model\ScopeInterface; +use Magento\Store\Model\StoreManagerInterface; + +class Search implements SearchInterface +{ + /** + * @var Builder + */ + private $requestBuilder; + + /** + * @var StoreManagerInterface + */ + private $storeManager; + + /** + * @var SearchEngineInterface + */ + private $searchEngine; + + /** + * @var SearchResponseBuilder + */ + private $searchResponseBuilder; + + /** + * @param Builder $requestBuilder + * @param StoreManagerInterface $storeManager + * @param SearchEngineInterface $searchEngine + * @param SearchResponseBuilder $searchResponseBuilder + */ + public function __construct( + Builder $requestBuilder, + StoreManagerInterface $storeManager, + SearchEngineInterface $searchEngine, + SearchResponseBuilder $searchResponseBuilder + ) { + $this->requestBuilder = $requestBuilder; + $this->storeManager = $storeManager; + $this->searchEngine = $searchEngine; + $this->searchResponseBuilder = $searchResponseBuilder; + } + + /** + * {@inheritdoc} + */ + public function search(SearchCriteriaInterface $searchCriteria) + { + $this->requestBuilder->setRequestName($searchCriteria->getRequestName()); + + $storeId = $this->storeManager->getStore(true)->getId(); + $this->requestBuilder->bindDimension('scope', $storeId); + + foreach ($searchCriteria->getFilterGroups() as $filterGroup) { + foreach ($filterGroup->getFilters() as $filter) { + $this->addFieldToFilter($filter->getField(), $filter->getValue()); + } + } + + $this->requestBuilder->setFrom($searchCriteria->getCurrentPage() * $searchCriteria->getPageSize()); + $this->requestBuilder->setSize($searchCriteria->getPageSize()); + $request = $this->requestBuilder->create(); + $searchResponse = $this->searchEngine->search($request); + + return $this->searchResponseBuilder->build($searchResponse) + ->setSearchCriteria($searchCriteria); + } + + /** + * Apply attribute filter to facet collection + * + * @param string $field + * @param null $condition + * @return $this + */ + private function addFieldToFilter($field, $condition = null) + { + if (!is_array($condition) || !in_array(key($condition), ['from', 'to'])) { + $this->requestBuilder->bind($field, $condition); + } else { + if (!empty($condition['from'])) { + $this->requestBuilder->bind("{$field}.from", $condition['from']); + } + if (!empty($condition['to'])) { + $this->requestBuilder->bind("{$field}.to", $condition['to']); + } + } + return $this; + } +} diff --git a/app/code/Magento/Catalog/Model/SearchResponseBuilder.php b/app/code/Magento/Search/Model/SearchResponseBuilder.php similarity index 98% rename from app/code/Magento/Catalog/Model/SearchResponseBuilder.php rename to app/code/Magento/Search/Model/SearchResponseBuilder.php index 36e552b32409e908a1a71e79902a26582f7aeeb7..bf827763ebb6987848f82b772fe2c1747f8ea543 100644 --- a/app/code/Magento/Catalog/Model/SearchResponseBuilder.php +++ b/app/code/Magento/Search/Model/SearchResponseBuilder.php @@ -3,7 +3,7 @@ * Copyright © 2015 Magento. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\Catalog\Model; +namespace Magento\Search\Model; use Magento\Framework\Api\Search\SearchResultInterface; use Magento\Framework\Api\Search\DocumentFactory; diff --git a/app/code/Magento/Search/Setup/InstallSchema.php b/app/code/Magento/Search/Setup/InstallSchema.php index d58c0da9a8946015c721e96229746d6beae6703a..34dd3d93895f98b9038447e8fa0acfa094bf3acb 100644 --- a/app/code/Magento/Search/Setup/InstallSchema.php +++ b/app/code/Magento/Search/Setup/InstallSchema.php @@ -115,6 +115,10 @@ class InstallSchema implements InstallSchemaInterface $installer->getIdxName('search_query', 'store_id'), 'store_id' ) + ->addIndex( + $installer->getIdxName('search_query', 'is_processed'), + 'is_processed' + ) ->addIndex( $installer->getIdxName('search_query', 'synonym_for'), 'synonym_for' diff --git a/app/code/Magento/Search/Setup/UpgradeSchema.php b/app/code/Magento/Search/Setup/UpgradeSchema.php deleted file mode 100644 index 461c7fd3d3d2367961a2715936ec9383b25bf8ea..0000000000000000000000000000000000000000 --- a/app/code/Magento/Search/Setup/UpgradeSchema.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Search\Setup; - - -use Magento\Framework\Module\ModuleListInterface; -use Magento\Framework\Setup\ModuleContextInterface; -use Magento\Framework\Setup\SchemaSetupInterface; -use Magento\Framework\Setup\UpgradeSchemaInterface; - -class UpgradeSchema implements UpgradeSchemaInterface -{ - - /** - * @var ModuleListInterface - */ - private $moduleList; - - /** - * @param ModuleListInterface $moduleList - */ - public function __construct(ModuleListInterface $moduleList) - { - $this->moduleList = $moduleList; - } - - /** - * Upgrades DB schema for a module - * - * @param SchemaSetupInterface $setup - * @param ModuleContextInterface $context - * @return void - */ - public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context) - { - if (version_compare($context->getVersion(), '2.0.0.1') < 0) { - $setup->startSetup(); - $connection = $setup->getConnection(); - $tableName = $setup->getTable('search_query'); - $idxName = $setup->getIdxName('search_query', ['is_processed']); - $connection->addIndex($tableName, $idxName, ['is_processed']); - $setup->endSetup(); - } - } -} diff --git a/app/code/Magento/Catalog/Test/Unit/Model/SearchResponseBuilderTest.php b/app/code/Magento/Search/Test/Unit/Model/SearchResponseBuilderTest.php similarity index 96% rename from app/code/Magento/Catalog/Test/Unit/Model/SearchResponseBuilderTest.php rename to app/code/Magento/Search/Test/Unit/Model/SearchResponseBuilderTest.php index 72021021884e68fbe193b6eb6177b2608742d558..d0e3b7f183d0c8be2f540144826fe02b5ce25206 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/SearchResponseBuilderTest.php +++ b/app/code/Magento/Search/Test/Unit/Model/SearchResponseBuilderTest.php @@ -3,7 +3,7 @@ * Copyright © 2015 Magento. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\Catalog\Test\Unit\Model; +namespace Magento\Search\Test\Unit\Model; use Magento\Framework\Api\Search\SearchResultInterface; use Magento\Framework\Search\Response\QueryResponse; @@ -12,7 +12,7 @@ use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; class SearchResponseBuilderTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Catalog\Model\SearchResponseBuilder + * @var \Magento\Search\Model\SearchResponseBuilder */ private $model; @@ -36,7 +36,7 @@ class SearchResponseBuilderTest extends \PHPUnit_Framework_TestCase ->disableOriginalConstructor() ->getMock(); - $this->model = (new ObjectManager($this))->getObject('Magento\Catalog\Model\SearchResponseBuilder', [ + $this->model = (new ObjectManager($this))->getObject('Magento\Search\Model\SearchResponseBuilder', [ 'documentFactory' => $this->documentFactory, 'searchResultFactory' => $this->searchResultFactory, ]); diff --git a/app/code/Magento/Search/Test/Unit/Model/SearchTest.php b/app/code/Magento/Search/Test/Unit/Model/SearchTest.php new file mode 100644 index 0000000000000000000000000000000000000000..02af8490fcc954117b6b555f3573a0a2ee9859ec --- /dev/null +++ b/app/code/Magento/Search/Test/Unit/Model/SearchTest.php @@ -0,0 +1,150 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Search\Test\Unit\Model; + +use Magento\Catalog\Model\Layer\Filter\Dynamic\AlgorithmFactory; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Store\Model\ScopeInterface; + +class SearchTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Search\Model\Search + */ + protected $model; + + /** + * @var \Magento\Framework\Search\Request\Builder|\PHPUnit_Framework_MockObject_MockObject + */ + protected $requestBuilder; + + /** + * @var \Magento\Search\Model\SearchEngine|\PHPUnit_Framework_MockObject_MockObject + */ + protected $searchEngine; + + /** + * @var \Magento\Search\Model\SearchResponseBuilder|\PHPUnit_Framework_MockObject_MockObject + */ + protected $searchResponseBuilder; + + /** + * @var \Magento\Store\Model\StoreManagerInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $storeManager; + + protected function setUp() + { + $objectManager = new ObjectManager($this); + + $this->requestBuilder = $this->getMockBuilder('Magento\Framework\Search\Request\Builder') + ->disableOriginalConstructor() + ->getMock(); + + $this->searchEngine = $this->getMockBuilder('Magento\Search\Model\SearchEngine') + ->disableOriginalConstructor() + ->getMock(); + + $this->searchResponseBuilder = $this->getMockBuilder('Magento\Search\Model\SearchResponseBuilder') + ->disableOriginalConstructor() + ->getMock(); + + $this->storeManager = $this->getMockBuilder('Magento\Store\Model\StoreManagerInterface') + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $this->model = $objectManager->getObject('Magento\Search\Model\Search', [ + 'requestBuilder' => $this->requestBuilder, + 'searchEngine' => $this->searchEngine, + 'searchResponseBuilder' => $this->searchResponseBuilder, + 'storeManager' => $this->storeManager, + ]); + } + + public function testSearch() + { + $requestName = 'requestName'; + $storeId = 333; + $filterField = 'filterField'; + $filterValue = 'filterValue'; + + $filter = $this->getMockBuilder('Magento\Framework\Api\Filter') + ->disableOriginalConstructor() + ->getMock(); + $filter->expects($this->once()) + ->method('getField') + ->willReturn($filterField); + $filter->expects($this->once()) + ->method('getValue') + ->willReturn($filterValue); + + $filterGroup = $this->getMockBuilder('Magento\Framework\Api\Search\FilterGroup') + ->disableOriginalConstructor() + ->getMock(); + $filterGroup->expects($this->once()) + ->method('getFilters') + ->willReturn([$filter]); + + $searchCriteria = $this->getMockBuilder('Magento\Framework\Api\Search\SearchCriteriaInterface') + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + $searchCriteria->expects($this->once()) + ->method('getRequestName') + ->willReturn($requestName); + $searchCriteria->expects($this->once()) + ->method('getFilterGroups') + ->willReturn([$filterGroup]); + + $store = $this->getMockBuilder('Magento\Store\Model\Store') + ->disableOriginalConstructor() + ->getMock(); + $store->expects($this->once()) + ->method('getId') + ->willReturn($storeId); + + $searchResult = $this->getMockBuilder('Magento\Framework\Api\Search\SearchResult') + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $request = $this->getMockBuilder('Magento\Framework\Search\RequestInterface') + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $response = $this->getMockBuilder('Magento\Framework\Search\ResponseInterface') + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $this->requestBuilder->expects($this->once()) + ->method('setRequestName') + ->with($requestName); + $this->requestBuilder->expects($this->once()) + ->method('bindDimension') + ->with('scope', $storeId); + $this->requestBuilder->expects($this->any()) + ->method('bind'); + $this->requestBuilder->expects($this->once()) + ->method('create') + ->willReturn($request); + + $this->searchEngine->expects($this->once()) + ->method('search') + ->with($request) + ->willReturn($response); + + $this->searchResponseBuilder->expects($this->once()) + ->method('build') + ->with($response) + ->willReturn($searchResult); + + $this->storeManager->expects($this->once()) + ->method('getStore') + ->willReturn($store); + + $searchResult = $this->model->search($searchCriteria); + + $this->assertInstanceOf('Magento\Framework\Api\Search\SearchResultInterface', $searchResult); + } +} diff --git a/app/code/Magento/Search/etc/di.xml b/app/code/Magento/Search/etc/di.xml index a8b7dfd5bc687879ef00d13673fae36764758d81..26f8d94c1a502521dd3787da8069527f823471cd 100644 --- a/app/code/Magento/Search/etc/di.xml +++ b/app/code/Magento/Search/etc/di.xml @@ -7,6 +7,7 @@ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> + <preference for="Magento\Search\Api\SearchInterface" type="Magento\Search\Model\Search"/> <type name="Magento\Framework\Module\Setup\Migration"> <arguments> <argument name="compositeModules" xsi:type="array"> diff --git a/app/code/Magento/Search/etc/module.xml b/app/code/Magento/Search/etc/module.xml index 2648b158b50422ec541c7b18072a7dbc23b658c6..8719bbd18c2cfe380703f4db4afc52520d5b0f94 100644 --- a/app/code/Magento/Search/etc/module.xml +++ b/app/code/Magento/Search/etc/module.xml @@ -7,7 +7,7 @@ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> - <module name="Magento_Search" setup_version="2.0.0.1"> + <module name="Magento_Search" setup_version="2.0.0"> <sequence> <module name="Magento_Backend" /> </sequence> diff --git a/app/code/Magento/Search/etc/webapi.xml b/app/code/Magento/Search/etc/webapi.xml new file mode 100644 index 0000000000000000000000000000000000000000..d06beccfa8d80ad2d498bbbaaaa41047d800e3a5 --- /dev/null +++ b/app/code/Magento/Search/etc/webapi.xml @@ -0,0 +1,18 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../../../../../app/code/Magento/Webapi/etc/webapi.xsd"> + + <route url="/V1/search" method="GET"> + <service class="Magento\Search\Api\SearchInterface" method="search"/> + <resources> + <resource ref="anonymous" /> + </resources> + </route> + +</routes> diff --git a/app/code/Magento/TaxImportExport/etc/module.xml b/app/code/Magento/TaxImportExport/etc/module.xml index 64d6d6544460df7d1928f958abc1395cca78590a..3fc38c0ae9612818050f6dde3d40dce046c24407 100644 --- a/app/code/Magento/TaxImportExport/etc/module.xml +++ b/app/code/Magento/TaxImportExport/etc/module.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> - <module name="Magento_TaxImportExport" setup_version="1.0.0.0"> + <module name="Magento_TaxImportExport" setup_version="2.0.0"> <sequence> <module name="Magento_Tax"/> </sequence> diff --git a/app/code/Magento/Theme/Setup/InstallSchema.php b/app/code/Magento/Theme/Setup/InstallSchema.php index b7f6d0edb3775a0f668233ab6bf758beea3ff807..c1ed22a79523f9d8769fbb5bbc1426849630a739 100644 --- a/app/code/Magento/Theme/Setup/InstallSchema.php +++ b/app/code/Magento/Theme/Setup/InstallSchema.php @@ -51,12 +51,6 @@ class InstallSchema implements InstallSchemaInterface 255, ['nullable' => true], 'Theme Path' - )->addColumn( - 'theme_version', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 255, - ['nullable' => false], - 'Theme Version' )->addColumn( 'theme_title', \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, diff --git a/app/code/Magento/Theme/Setup/UpgradeSchema.php b/app/code/Magento/Theme/Setup/UpgradeSchema.php deleted file mode 100644 index 3df76719134e77debfcf028e3627770a175c6d70..0000000000000000000000000000000000000000 --- a/app/code/Magento/Theme/Setup/UpgradeSchema.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Theme\Setup; - -use Magento\Framework\Setup\UpgradeSchemaInterface; -use Magento\Framework\Setup\ModuleContextInterface; -use Magento\Framework\Setup\SchemaSetupInterface; - -/** - * @codeCoverageIgnore - */ -class UpgradeSchema implements UpgradeSchemaInterface -{ - /** - * {@inheritdoc} - */ - public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context) - { - if (version_compare($context->getVersion(), '2.0.1') < 0) { - $installer = $setup; - - $installer->startSetup(); - $connection = $installer->getConnection(); - - /** - * Remove column 'theme_version' from 'core_theme' - */ - $connection->dropColumn( - $installer->getTable('theme'), - 'theme_version' - ); - - $installer->endSetup(); - } - } -} diff --git a/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Wysiwyg/Files/DeleteFilesTest.php b/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Wysiwyg/Files/DeleteFilesTest.php new file mode 100644 index 0000000000000000000000000000000000000000..2a69f64be343ee3f155b2862cc2f227b5ad3b1b5 --- /dev/null +++ b/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Wysiwyg/Files/DeleteFilesTest.php @@ -0,0 +1,104 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Theme\Test\Unit\Controller\Adminhtml\System\Design\Wysiwyg\Files; + +class DeleteFilesTest extends \PHPUnit_Framework_TestCase +{ + /** @var \Magento\Theme\Controller\Adminhtml\System\Design\Wysiwyg\Files */ + protected $controller; + + /** @var \PHPUnit_Framework_MockObject_MockObject|\PHPUnit_Framework_MockObject_MockObject*/ + protected $objectManager; + + /** @var \Magento\Theme\Helper\Storage|\PHPUnit_Framework_MockObject_MockObject */ + protected $storage; + + /** @var \Magento\Framework\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject */ + protected $request; + + /** @var \Magento\Framework\App\Response\Http|\PHPUnit_Framework_MockObject_MockObject */ + protected $response; + + public function setUp() + { + $this->objectManager = $this->getMock('Magento\Framework\ObjectManagerInterface'); + $this->storage = $this->getMock('Magento\Theme\Model\Wysiwyg\Storage', [], [], '', false); + $this->response = $this->getMock('Magento\Framework\App\Response\Http', [], [], '', false); + $this->request = $this->getMockForAbstractClass( + 'Magento\Framework\App\RequestInterface', + [], + '', + false, + false, + true, + ['isPost', 'getParam'] + ); + + $helper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); + $this->controller = $helper->getObject( + 'Magento\Theme\Controller\Adminhtml\System\Design\Wysiwyg\Files\DeleteFiles', + [ + 'objectManager' => $this->objectManager, + 'request' => $this->request, + 'response' => $this->response, + ] + ); + } + + public function testExecuteWithWrongRequest() + { + $this->request->expects($this->once()) + ->method('isPost') + ->willReturn(false); + + $jsonData = $this->getMock('Magento\Framework\Json\Helper\Data', [], [], '', false); + $jsonData->expects($this->once()) + ->method('jsonEncode') + ->with(['error' => true, 'message' => 'Wrong request']) + ->willReturn('{"error":"true","message":"Wrong request"}'); + + $this->objectManager->expects($this->once()) + ->method('get') + ->with('Magento\Framework\Json\Helper\Data') + ->willReturn($jsonData); + + $this->response->expects($this->once()) + ->method('representJson') + ->with('{"error":"true","message":"Wrong request"}'); + + $this->controller->execute(); + } + + public function testExecute() + { + $this->request->expects($this->once()) + ->method('isPost') + ->willReturn(true); + $this->request->expects($this->once()) + ->method('getParam') + ->with('files') + ->willReturn('{"files":"file"}'); + + $jsonData = $this->getMock('Magento\Framework\Json\Helper\Data', [], [], '', false); + $jsonData->expects($this->once()) + ->method('jsonDecode') + ->with('{"files":"file"}') + ->willReturn(['files' => 'file']); + $this->objectManager->expects($this->at(0)) + ->method('get') + ->with('Magento\Framework\Json\Helper\Data') + ->willReturn($jsonData); + $this->objectManager->expects($this->at(1)) + ->method('get') + ->with('Magento\Theme\Model\Wysiwyg\Storage') + ->willReturn($this->storage); + $this->storage->expects($this->once()) + ->method('deleteFile') + ->with('file'); + + $this->controller->execute(); + } +} diff --git a/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Wysiwyg/Files/DeleteFolderTest.php b/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Wysiwyg/Files/DeleteFolderTest.php new file mode 100644 index 0000000000000000000000000000000000000000..9bd042cfe2e5864a6f86e5afa848ad63b9ca1a79 --- /dev/null +++ b/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Wysiwyg/Files/DeleteFolderTest.php @@ -0,0 +1,71 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Theme\Test\Unit\Controller\Adminhtml\System\Design\Wysiwyg\Files; + +class DeleteFolderTest extends \PHPUnit_Framework_TestCase +{ + /** @var \Magento\Theme\Controller\Adminhtml\System\Design\Wysiwyg\Files */ + protected $controller; + + /** @var \PHPUnit_Framework_MockObject_MockObject|\PHPUnit_Framework_MockObject_MockObject*/ + protected $objectManager; + + /** @var \Magento\Framework\App\Response\Http|\PHPUnit_Framework_MockObject_MockObject */ + protected $response; + + /** @var \Magento\Theme\Helper\Storage|\PHPUnit_Framework_MockObject_MockObject */ + protected $storage; + + /** @var \Magento\Theme\Helper\Storage|\PHPUnit_Framework_MockObject_MockObject */ + protected $storageHelper; + + public function setUp() + { + $this->objectManager = $this->getMock('Magento\Framework\ObjectManagerInterface'); + $this->response = $this->getMock('Magento\Framework\App\Response\Http', [], [], '', false); + $this->storage = $this->getMock('Magento\Theme\Model\Wysiwyg\Storage', [], [], '', false); + $this->storageHelper = $this->getMock('Magento\Theme\Helper\Storage', [], [], '', false); + + $helper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); + $this->controller = $helper->getObject( + 'Magento\Theme\Controller\Adminhtml\System\Design\Wysiwyg\Files\DeleteFolder', + [ + 'objectManager' => $this->objectManager, + 'response' => $this->response, + 'storage' => $this->storageHelper + ] + ); + } + + public function testExecute() + { + $this->storageHelper->expects($this->once()) + ->method('getCurrentPath') + ->willReturn('/current/path/'); + + $this->objectManager->expects($this->at(0)) + ->method('get') + ->with('Magento\Theme\Model\Wysiwyg\Storage') + ->willReturn($this->storage); + $this->storage->expects($this->once()) + ->method('deleteDirectory') + ->with('/current/path/') + ->willThrowException(new \Exception('Message')); + + $jsonData = $this->getMock('Magento\Framework\Json\Helper\Data', [], [], '', false); + $jsonData->expects($this->once()) + ->method('jsonEncode') + ->with(['error' => true, 'message' => 'Message']) + ->willReturn('{"error":"true","message":"Message"}'); + + $this->objectManager->expects($this->at(1)) + ->method('get') + ->with('Magento\Framework\Json\Helper\Data') + ->willReturn($jsonData); + + $this->controller->execute(); + } +} diff --git a/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Wysiwyg/Files/IndexTest.php b/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Wysiwyg/Files/IndexTest.php new file mode 100644 index 0000000000000000000000000000000000000000..63884649f39f4baf66a5886619757abb381a529a --- /dev/null +++ b/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Wysiwyg/Files/IndexTest.php @@ -0,0 +1,39 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Theme\Test\Unit\Controller\Adminhtml\System\Design\Wysiwyg\Files; + +class IndexTest extends \PHPUnit_Framework_TestCase +{ + /** @var \Magento\Theme\Controller\Adminhtml\System\Design\Wysiwyg\Files */ + protected $controller; + + /** @var \Magento\Framework\App\ViewInterface|\PHPUnit_Framework_MockObject_MockObject */ + protected $view; + + public function setUp() + { + $this->view = $this->getMock('\Magento\Framework\App\ViewInterface', [], [], '', false); + + $helper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); + $this->controller = $helper->getObject( + 'Magento\Theme\Controller\Adminhtml\System\Design\Wysiwyg\Files\Index', + [ + 'view' => $this->view, + ] + ); + } + + public function testExecute() + { + $this->view ->expects($this->once()) + ->method('loadLayout') + ->with('overlay_popup'); + $this->view ->expects($this->once()) + ->method('renderLayout'); + + $this->controller->execute(); + } +} diff --git a/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Wysiwyg/Files/OnInsertTest.php b/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Wysiwyg/Files/OnInsertTest.php new file mode 100644 index 0000000000000000000000000000000000000000..0061013ed728c00cc216b889f9dcd4ec2b4e28c4 --- /dev/null +++ b/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Wysiwyg/Files/OnInsertTest.php @@ -0,0 +1,59 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Theme\Test\Unit\Controller\Adminhtml\System\Design\Wysiwyg\Files; + +class OnInsertTest extends \PHPUnit_Framework_TestCase +{ + /** @var \Magento\Theme\Controller\Adminhtml\System\Design\Wysiwyg\Files */ + protected $controller; + + /** @var \Magento\Framework\App\ViewInterface|\PHPUnit_Framework_MockObject_MockObject */ + protected $view; + + /** @var \PHPUnit_Framework_MockObject_MockObject|\PHPUnit_Framework_MockObject_MockObject */ + protected $objectManager; + + /** @var \Magento\Theme\Helper\Storage|\PHPUnit_Framework_MockObject_MockObject */ + protected $storageHelper; + + /** @var \Magento\Framework\App\Response\Http|\PHPUnit_Framework_MockObject_MockObject */ + protected $response; + + public function setUp() + { + $this->objectManager = $this->getMock('Magento\Framework\ObjectManagerInterface'); + $this->view = $this->getMock('\Magento\Framework\App\ViewInterface', [], [], '', false); + $this->storageHelper = $this->getMock('Magento\Theme\Helper\Storage', [], [], '', false); + $this->response = $this->getMock('Magento\Framework\App\Response\Http', ['setBody'], [], '', false); + + $helper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); + $this->controller = $helper->getObject( + 'Magento\Theme\Controller\Adminhtml\System\Design\Wysiwyg\Files\OnInsert', + [ + 'objectManager' => $this->objectManager, + 'view' => $this->view, + 'response' => $this->response + ] + ); + } + + public function testExecute() + { + $this->objectManager->expects($this->once()) + ->method('get') + ->with('Magento\Theme\Helper\Storage') + ->willReturn($this->storageHelper); + $this->storageHelper + ->expects($this->once()) + ->method('getRelativeUrl') + ->willReturn('http://relative.url/'); + $this->response->expects($this->once()) + ->method('setBody') + ->with('http://relative.url/'); + + $this->controller->execute(); + } +} diff --git a/app/code/Magento/Theme/etc/module.xml b/app/code/Magento/Theme/etc/module.xml index e6744b59cb8c2f7c3e27117b3e1bac698c035985..742926c80c22477e93836c45364b0e203898f3a7 100644 --- a/app/code/Magento/Theme/etc/module.xml +++ b/app/code/Magento/Theme/etc/module.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> - <module name="Magento_Theme" setup_version="2.0.1"> + <module name="Magento_Theme" setup_version="2.0.0"> <sequence> <module name="Magento_Store"/> </sequence> diff --git a/app/code/Magento/User/Setup/InstallSchema.php b/app/code/Magento/User/Setup/InstallSchema.php index abda317b7bc8a2d4270812cccb4a52f5a72c5f21..3527f70c4198ba2858c747f33ef707142ebfdeb8 100644 --- a/app/code/Magento/User/Setup/InstallSchema.php +++ b/app/code/Magento/User/Setup/InstallSchema.php @@ -124,7 +124,7 @@ class InstallSchema implements InstallSchemaInterface )->addColumn( 'interface_locale', \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 5, + 16, ['nullable' => false, 'default' => 'en_US'], 'Backend interface locale' )->addIndex( diff --git a/app/code/Magento/User/Setup/UpgradeSchema.php b/app/code/Magento/User/Setup/UpgradeSchema.php deleted file mode 100644 index bab95673a66a016e03e2c0e8cc56db1a97fb6ab6..0000000000000000000000000000000000000000 --- a/app/code/Magento/User/Setup/UpgradeSchema.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\User\Setup; - -use Magento\Framework\DB\Ddl\Table; -use Magento\Framework\Setup\UpgradeSchemaInterface; -use Magento\Framework\Setup\ModuleContextInterface; -use Magento\Framework\Setup\SchemaSetupInterface; - -/** - * @codeCoverageIgnore - */ -class UpgradeSchema implements UpgradeSchemaInterface -{ - /** - * {@inheritdoc} - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) - * @SuppressWarnings(PHPMD.CyclomaticComplexity) - * @SuppressWarnings(PHPMD.NPathComplexity) - */ - public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context) - { - $installer = $setup; - $connection = $installer->getConnection(); - if (version_compare($context->getVersion(), '2.0.1') < 0) { - /** - * Modifying length of 'interface_locale' column of admin_user table. - */ - $table = $setup->getTable('admin_user'); - $connection->modifyColumn( - $table, - 'interface_locale', - [ - 'type' => Table::TYPE_TEXT, - 'length' => 16, - 'nullable' => false, - 'default' => 'en_US', - 'comment' => 'Backend interface locale', - ] - ); - } - } -} diff --git a/app/code/Magento/User/etc/module.xml b/app/code/Magento/User/etc/module.xml index 8bb2b470ccf553f51f260f94097338440af5a64b..d0467cb70e860606c563d75a4deb29b59967ab6a 100644 --- a/app/code/Magento/User/etc/module.xml +++ b/app/code/Magento/User/etc/module.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> - <module name="Magento_User" setup_version="2.0.1"> + <module name="Magento_User" setup_version="2.0.0"> <sequence> <module name="Magento_Backend"/> </sequence> diff --git a/app/code/Magento/Weee/etc/module.xml b/app/code/Magento/Weee/etc/module.xml index 19658377fc4a7f3608483c5a03e18cba47ba750b..48f7754d1356e9533b7339da4bcc25102d3f3fb9 100644 --- a/app/code/Magento/Weee/etc/module.xml +++ b/app/code/Magento/Weee/etc/module.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> - <module name="Magento_Weee" setup_version="2.0.0.1"> + <module name="Magento_Weee" setup_version="2.0.0"> <sequence> <module name="Magento_Catalog"/> <module name="Magento_Tax"/> diff --git a/app/code/Magento/Wishlist/Test/Unit/Model/ItemTest.php b/app/code/Magento/Wishlist/Test/Unit/Model/ItemTest.php index 76b46f13538da68b31514bce752b669cda2b9194..f31a0ced59d6143fc7f1db6a97f1f3d6338f2423 100644 --- a/app/code/Magento/Wishlist/Test/Unit/Model/ItemTest.php +++ b/app/code/Magento/Wishlist/Test/Unit/Model/ItemTest.php @@ -165,7 +165,7 @@ class ItemTest extends \PHPUnit_Framework_TestCase $this->model->addOption($option); $this->assertEquals(1, count($this->model->getOptions())); $this->model->removeOption($code); - $actualOptions = $this->model->getOptions(); + $actualOptions = $this->model->getOptions(); $actualOption = array_pop($actualOptions); $this->assertTrue($actualOption->isDeleted()); } @@ -185,7 +185,7 @@ class ItemTest extends \PHPUnit_Framework_TestCase ->getMock(); return [ ['first_key', ['code' => 'first_key', 'value' => 'first_data']], - ['second_key',$optionMock], + ['second_key', $optionMock], ['third_key', new \Magento\Framework\Object(['code' => 'third_key', 'product' => $productMock])], ]; } @@ -262,4 +262,63 @@ class ItemTest extends \PHPUnit_Framework_TestCase $this->assertFalse($result); } + + public function testSetAndSaveItemOptions() + { + $this->assertEmpty($this->model->getOptions()); + $firstOptionMock = $this->getMockBuilder('Magento\Wishlist\Model\Item\Option') + ->disableOriginalConstructor() + ->setMethods(['getCode', 'isDeleted', 'delete', '__wakeup']) + ->getMock(); + $firstOptionMock->expects($this->any()) + ->method('getCode') + ->willReturn('first_code'); + $firstOptionMock->expects($this->any()) + ->method('isDeleted') + ->willReturn(true); + $firstOptionMock->expects($this->once()) + ->method('delete'); + + $secondOptionMock = $this->getMockBuilder('Magento\Wishlist\Model\Item\Option') + ->disableOriginalConstructor() + ->setMethods(['getCode', 'save', '__wakeup']) + ->getMock(); + $secondOptionMock->expects($this->any()) + ->method('getCode') + ->willReturn('second_code'); + $secondOptionMock->expects($this->once()) + ->method('save'); + + $this->model->setOptions([$firstOptionMock, $secondOptionMock]); + $this->assertNull($this->model->isOptionsSaved()); + $this->model->saveItemOptions(); + $this->assertTrue($this->model->isOptionsSaved()); + } + + public function testGetProductWithException() + { + $this->setExpectedException('Magento\Framework\Exception\LocalizedException', __('Cannot specify product.')); + $this->model->getProduct(); + } + + public function testGetProduct() + { + $productId = 1; + $storeId = 0; + $this->model->setData('product_id', $productId); + $this->model->setData('store_id', $storeId); + $productMock = $this->getMockBuilder('Magento\Catalog\Model\Product') + ->disableOriginalConstructor() + ->getMock(); + $productMock->expects($this->any()) + ->method('setFinalPrice') + ->with(null); + $productMock->expects($this->any()) + ->method('setCustomOprtions') + ->with([]); + $this->productRepository->expects($this->once()) + ->method('getById') + ->willReturn($productMock); + $this->assertEquals($productMock, $this->model->getProduct()); + } } diff --git a/app/design/adminhtml/Magento/backend/Magento_Sales/web/css/source/module/order/_total.less b/app/design/adminhtml/Magento/backend/Magento_Sales/web/css/source/module/order/_total.less index 950359226555349589879000807c7198e39888d0..6d022d065ab11bb77bd5aa736da714ffaaad89c1 100644 --- a/app/design/adminhtml/Magento/backend/Magento_Sales/web/css/source/module/order/_total.less +++ b/app/design/adminhtml/Magento/backend/Magento_Sales/web/css/source/module/order/_total.less @@ -31,4 +31,9 @@ .action-default { &:extend(.abs-action-l all); } + .primary { + + .primary { + margin-left: @indent__s; + } + } } diff --git a/app/design/adminhtml/Magento/backend/web/app/setup/styles/less/setup.less b/app/design/adminhtml/Magento/backend/web/app/setup/styles/less/setup.less index 2515bec96dcc9c59eb70d608f8a94218a0f3daf7..793cf5b4d2f58f7e95977408c08e750b6e2f08ce 100644 --- a/app/design/adminhtml/Magento/backend/web/app/setup/styles/less/setup.less +++ b/app/design/adminhtml/Magento/backend/web/app/setup/styles/less/setup.less @@ -12,17 +12,17 @@ // --------------------------------------------- // Global lib -@import '/lib/web/css/source/lib/_lib.less'; +//@import '/lib/web/css/source/lib/_lib.less'; ToDo UI: deploy link to module // Inherit Backend lib (sources) -@import '../../../../../web/css/source/_variables.less'; -@import '../../../../../web/css/source/_utilities.less'; -@import '../../../../../web/css/source/_extends.less'; -@import '../../../../../web/css/source/_reset.less'; -@import '../../../../../web/css/source/_typography.less'; -@import '../../../../../web/css/source/_lists.less'; -@import '../../../../../web/css/source/_structure.less'; -@import '../../../../../web/css/source/_grid.less'; +@import '../../../../css/source/_variables.less'; +@import '../../../../css/source/_utilities.less'; +@import '../../../../css/source/_extends.less'; +@import '../../../../css/source/_reset.less'; +@import '../../../../css/source/_typography.less'; +@import '../../../../css/source/_lists.less'; +@import '../../../../css/source/_structure.less'; +@import '../../../../css/source/_grid.less'; // Setup lib (sources) @import 'lib/_variables.less'; @@ -48,20 +48,20 @@ // --------------------------------------------- // Inherit Lib components -@import '/lib/web/css/source/components/_modals.less'; +//@import '/lib/web/css/source/components/_modals.less'; ToDo UI: deploy link to module // Inherit Backend components -@import '../../../../../web/css/source/_actions.less'; -@import '../../../../../web/css/source/components/_messages.less'; -@import '../../../../../web/css/source/components/_modals_extend.less'; +@import '../../../../css/source/_actions.less'; +@import '../../../../css/source/components/_messages.less'; +@import '../../../../css/source/components/_modals_extend.less'; -@import '../../../../../Magento_Backend/web/css/source/module/_header.less'; -@import '../../../../../Magento_Backend/web/css/source/module/_menu.less'; +//@import '../../../../../Magento_Backend/web/css/source/module/_header.less'; ToDo UI: deploy link to module +//@import '../../../../../Magento_Backend/web/css/source/module/_menu.less'; ToDo UI: deploy link to module -@import '../../../../../Magento_Ui/web/css/source/module/_data-grid.less'; -@import (reference) '../../../../../web/css/source/forms/_extends.less'; -@import '../../../../../web/css/source/forms/_controls.less'; -@import '../../../../../web/css/source/forms/_fields.less'; +//@import '../../../../../Magento_Ui/web/css/source/module/_data-grid.less'; ToDo UI: deploy link to module +@import (reference) '../../../../css/source/forms/_extends.less'; +@import '../../../../css/source/forms/_controls.less'; +@import '../../../../css/source/forms/_fields.less'; // Setup components @import 'components/_messages.less'; @@ -101,4 +101,4 @@ // Media queries collector // --------------------------------------------- -@import '../../../../../web/css/source/_responsive.less'; +@import '../../../../css/source/_responsive.less'; diff --git a/app/design/frontend/Magento/blank/Magento_Catalog/web/css/source/_module.less b/app/design/frontend/Magento/blank/Magento_Catalog/web/css/source/_module.less index 7009f22f35d2a5a2222686fa2dee3ee6f399e149..20c0ccb23a45a3e333c16d428a919cf021c79e37 100644 --- a/app/design/frontend/Magento/blank/Magento_Catalog/web/css/source/_module.less +++ b/app/design/frontend/Magento/blank/Magento_Catalog/web/css/source/_module.less @@ -34,399 +34,406 @@ @import 'module/_toolbar.less'; // -// Common -//-------------------------------------- +// Common +// _____________________________________________ & when (@media-common = true) { -// -// Category view -//-------------------------------------- -.old-price, -.old.price { - text-decoration: line-through; -} + // + // Category view + // --------------------------------------------- -.price-tier_price { - .price-including-tax + .price-excluding-tax { - &:before { - content: "(" attr(data-label) ": "; + .old-price, + .old.price { + text-decoration: line-through; + } + + .price-tier_price { + .price-including-tax + .price-excluding-tax { + &:before { + content: "(" attr(data-label) ": "; + } + &:last-child:after { + content: ")"; + } } - &:last-child:after { - content: ")"; + + .weee[data-label] { + display: inline; + .price { + .font-size(11); + } + &:before { + content: " +" attr(data-label) ": "; + } } } - .weee[data-label] { - display: inline; - .price { - .font-size(11); + .actual-price { + font-weight: @font-weight__bold; + } + + .product.name a { + &:extend(.abs-product-link all); + } + + .category { + &-image { + .image { + max-width: 100%; + height: auto; + display: block; + } } - &:before { - content: " +" attr(data-label) ": "; + &-image, + &-description { + margin-bottom: @indent__base; } } -} -.actual-price { - font-weight: @font-weight__bold; -} - -.product.name a { - &:extend(.abs-product-link all); -} + // + // Product images general container + // --------------------------------------------- -.category { - &-image { - .image { + .product-image { + &-container { + display: inline-block; max-width: 100%; - height: auto; + } + &-wrapper { + height: 0; display: block; + position: relative; + z-index: 1; + overflow: hidden; + } + &-photo { + display: block; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + margin: auto; + height: auto; + max-width: 100%; } } - &-image, - &-description { - margin-bottom: @indent__base; - } -} -// -// Product images general container -//-------------------------------------- -.product-image { - &-container { - display: inline-block; - max-width: 100%; - } - &-wrapper { - height: 0; - display: block; - position: relative; - z-index: 1; - overflow: hidden; - } - &-photo { - display: block; - position: absolute; - top: 0; - bottom: 0; - left: 0; - right: 0; - margin: auto; - height: auto; - max-width: 100%; - } -} + // + // Product view + // --------------------------------------------- -// -// Product view -//-------------------------------------- -.product.media { - .product.photo .photo.image { - &:extend(.abs-adaptive-images-centered); - } - .placeholder .photo.container { - max-width: 100%; - } - .notice { - margin: @indent__s 0; - .css(color, @text__color__muted); - .font-size(@font-size__s); - } - .product.thumbs { - margin: @indent__base 0 @indent__l; - } - .items.thumbs { - .list-inline(); - .active { - display: block; - line-height: 1; + .product.media { + .product.photo .photo.image { + &:extend(.abs-adaptive-images-centered); + } + .placeholder .photo.container { + max-width: 100%; + } + .notice { + margin: @indent__s 0; + .css(color, @text__color__muted); + .font-size(@font-size__s); + } + .product.thumbs { + margin: @indent__base 0 @indent__l; + } + .items.thumbs { + .list-inline(); + .active { + display: block; + line-height: 1; + } } } -} -.product.info.detailed { - clear: both; - margin-bottom: 30px; - .additional-attributes { - width: auto; - .table-resize( + .product.info.detailed { + clear: both; + margin-bottom: 30px; + .additional-attributes { + width: auto; + .table-resize( @_th-padding-left: 0, @_th-padding-right: @indent__l, @_th-padding-bottom: @indent__s, @_td-padding-bottom: @indent__s - ); - } -} - -.product-info-main { - .page-title-wrapper { - .page-title { - margin-bottom: @indent__s; - line-height: @line-height__base; + ); } } - .stock { - &.available, - &.unavailable { - display: inline-block; - font-weight: @font-weight__bold; - margin-right: @indent__base; - text-transform: uppercase; - vertical-align: top; + + .product-info-main { + .page-title-wrapper { + .page-title { + margin-bottom: @indent__s; + line-height: @line-height__base; + } } - } - .product { - &.attibute { - &.sku { + .stock { + &.available, + &.unavailable { display: inline-block; + font-weight: @font-weight__bold; + margin-right: @indent__base; + text-transform: uppercase; vertical-align: top; - .css(color, @text__color__muted); - > .value { + } + } + .product { + &.attibute { + &.sku { display: inline-block; vertical-align: top; + .css(color, @text__color__muted); + > .value { + display: inline-block; + vertical-align: top; + } + .type { + margin-right: @indent__xs; + } } - .type { - margin-right: @indent__xs; + &.overview { + margin: @indent__base 0; } } - &.overview { - margin: @indent__base 0; + &.alert { + margin: @indent__s 0; } } - &.alert { - margin: @indent__s 0; + .price-box { + margin-top: @indent__s; + } + .product-reviews-summary .reviews-actions { + .font-size(@font-size__base); } } - .price-box { - margin-top: @indent__s; - } - .product-reviews-summary .reviews-actions { - .font-size(@font-size__base); - } -} -.product-options-wrapper { - .fieldset-product-options-inner { - .legend { - border: none; - .css(font-weight, @font-weight__bold); - .css(margin, 0 0 @indent__xs); - display: inline-block; - .font-size(14px); - float: none; - padding: 0; - } - &.required { + .product-options-wrapper { + .fieldset-product-options-inner { .legend { - &:after { - content: '*'; - .typography( - @_font-size: @form-field-label-asterisk__font-size, - @_color: @form-field-label-asterisk__color, - @_font-family: @form-field-label-asterisk__font-family, - @_font-weight: @form-field-label-asterisk__font-weight, - @_line-height: @form-field-label-asterisk__line-height, - @_font-style: @form-field-label-asterisk__font-style - ); - .css(margin, @form-field-label-asterisk__margin); + border: none; + .css(font-weight, @font-weight__bold); + .css(margin, 0 0 @indent__xs); + display: inline-block; + .font-size(14px); + float: none; + padding: 0; + } + &.required { + .legend { + &:after { + content: '*'; + .typography( + @_font-size: @form-field-label-asterisk__font-size, + @_color: @form-field-label-asterisk__color, + @_font-family: @form-field-label-asterisk__font-family, + @_font-weight: @form-field-label-asterisk__font-weight, + @_line-height: @form-field-label-asterisk__line-height, + @_font-style: @form-field-label-asterisk__font-style + ); + .css(margin, @form-field-label-asterisk__margin); + } } } } - } - .field { - .note { - display: block; + .field { + .note { + display: block; + } } } -} -.product-info-main, -.product-options-bottom { - .price-box { - .price-including-tax + .price-excluding-tax, - .weee + .price-excluding-tax, - .weee { - .font-size(12); - margin-bottom: @indent__xs; - line-height: 14px; - .price { + .product-info-main, + .product-options-bottom { + .price-box { + .price-including-tax + .price-excluding-tax, + .weee + .price-excluding-tax, + .weee { .font-size(12); + margin-bottom: @indent__xs; + line-height: 14px; + .price { + .font-size(12); + font-weight: @font-weight__bold; + } + } + .price-wrapper .price { + .font-size(18); font-weight: @font-weight__bold; } } - .price-wrapper .price { - .font-size(18); - font-weight: @font-weight__bold; - } - } - .special-price { - display: block; - margin: @indent__s 0; - .price-container { - .font-size(14); + .special-price { + display: block; + margin: @indent__s 0; + .price-container { + .font-size(14); + } + .price-label + .price-wrapper { + display: inline-block; + } } - .price-label + .price-wrapper { - display: inline-block; + .old-price, + .special-price { + .price-label { + &:after { + content: ": "; + } + } } - } - .old-price, - .special-price { - .price-label { - &:after { - content: ": "; + .box-tocart { + margin: @indent__base 0; + .field.qty { + padding-right: .75 * @indent__base; + } + .input-text.qty { + @tocart-input-size: @button__line-height__l + 28px; + width: @tocart-input-size + 2px; + height: @tocart-input-size + 2px; + text-align: center; + } + .actions { + text-align: center; + } + .action.tocart { + &:extend(.abs-button-l all); } } - } - .box-tocart { - margin: @indent__base 0; - .field.qty { - padding-right: .75 * @indent__base; + .product-addto-links { + margin: @indent__base 0; } - .input-text.qty { - @tocart-input-size: @button__line-height__l + 28px; - width: @tocart-input-size + 2px; - height: @tocart-input-size + 2px; - text-align: center; + .action.tocompare { + &:extend(.abs-action-addto-product all); + vertical-align: top; } - .actions { - text-align: center; + } + + .prices-tier { + &:extend(.abs-reset-list all); + .css(background, @sidebar__background-color); + padding: @indent__s (.75 * @indent__base); + margin: @indent__s 0; + .price-tier_price { + display: inline-block; } - .action.tocart { - &:extend(.abs-button-l all); + .price-including-tax, + .price-excluding-tax, + .weee { + display: inline-block; + .price { + .font-size(14); + font-weight: @font-weight__bold; + } } } - .product-addto-links { - margin: @indent__base 0; - } - .action.tocompare { - &:extend(.abs-action-addto-product all); - vertical-align: top; - } -} -.prices-tier { - &:extend(.abs-reset-list all); - .css(background, @sidebar__background-color); - padding: @indent__s (.75 * @indent__base); - margin: @indent__s 0; - .price-tier_price { - display: inline-block; + .ui-dialog-titlebar-close { + .button-as-link(); } - .price-including-tax, - .price-excluding-tax, - .weee { - display: inline-block; - .price { - .font-size(14); - font-weight: @font-weight__bold; + + .block.related { + .action.select { + margin: 0 @indent__xs; } } -} -.ui-dialog-titlebar-close { - .button-as-link(); -} - -.block.related { - .action.select { - margin: 0 @indent__xs; - } -} + // + // Sidebar product view + // --------------------------------------------- -// -// Sidebar product view -//-------------------------------------- -.sidebar { - .product-items { - .product-item { - margin-bottom: @indent__base; - position: relative; - &-info { + .sidebar { + .product-items { + .product-item { + margin-bottom: @indent__base; position: relative; - width: auto; - .product-item-photo { - position: absolute; - left: 0; - top: 0; + &-info { + position: relative; + width: auto; + .product-item-photo { + position: absolute; + left: 0; + top: 0; + } + } + &-name { + margin-top: 0; + } + &-details { + margin: 0 0 0 85px; + } + &-actions { + display: block; + margin-top: @indent__s; } } - &-name { - margin-top: 0; + .price-box { + display: block; + margin: 7px 0; } - &-details { - margin: 0 0 0 85px; + .text { + margin-right: 8px; } - &-actions { - display: block; - margin-top: @indent__s; + .counter { + .css(color, @primary__color__lighter); + .font-size(12); + white-space: nowrap; } - } - .price-box { - display: block; - margin: 7px 0; - } - .text { - margin-right: 8px; - } - .counter { - .css(color, @primary__color__lighter); - .font-size(12); - white-space: nowrap; - } - .minilist { - .price { - display: inline; - padding: 0; + .minilist { + .price { + display: inline; + padding: 0; + } + .weee:before { + display: inline-block; + } } - .weee:before { - display: inline-block; + } + .action { + &.delete { + &:extend(.abs-remove-button-for-blocks all); + position: absolute; + right: 0; + top: 0; } } - } - .action { - &.delete { - &:extend(.abs-remove-button-for-blocks all); - position: absolute; - right: 0; - top: 0; + .subtitle { + &:extend(.abs-no-display all); } - } - .subtitle { - &:extend(.abs-no-display all); - } - // - // Product images only - //-------------------------------------- - .product-items-images { - &:extend(.abs-add-clearfix all); - margin-left: -@indent__xs; - .product-item { - &:extend(.abs-add-box-sizing all); - float: left; - padding-left: @indent__xs; - } - } + // + // Product images only + // --------------------------------------------- - // - // Product names only - //-------------------------------------- - .product-items-names { - .product-item { - margin-bottom: @indent__s; + .product-items-images { + &:extend(.abs-add-clearfix all); + margin-left: -@indent__xs; + .product-item { + &:extend(.abs-add-box-sizing all); + float: left; + padding-left: @indent__xs; + } } - .product-item-name { - margin: 0; + + // + // Product names only + // --------------------------------------------- + + .product-items-names { + .product-item { + margin-bottom: @indent__s; + } + .product-item-name { + margin: 0; + } } } -} } // -// Mobile -//-------------------------------------- +// Mobile +// _____________________________________________ + .media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) { .catalog-product-view { .column.main { @@ -450,11 +457,19 @@ display: block; } } + + .compare, + .product-addto-links .action.tocompare, + .product-item-actions .actions-secondary > .action.tocompare, + [class*="block-compare"] { + display: none; + } } // -// Desktop -//-------------------------------------- +// Desktop +// _____________________________________________ + .media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) { .product-info-main, .product-options-bottom { @@ -505,12 +520,12 @@ .product-add-form { &:extend(.abs-revert-field-type-desktop all); } - } // -// Desktop large -//-------------------------------------- +// Desktop large +// _____________________________________________ + .media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__xl) { .sidebar { .product-items { @@ -533,8 +548,9 @@ } // -// Category page layout -//-------------------------------------- +// Category page layout +// --------------------------------------------- + .media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) { .product-info-main { float: right; @@ -562,154 +578,153 @@ } } - // -// Common -//-------------------------------------- +// Common +// _____________________________________________ & when (@media-common = true) { -// -// Compare Products Page -//-------------------------------------- -body.catalog-product-compare-index { - .action.print { - float: right; - margin: 15px 0; - } -} - -.table-wrapper.comparison { - clear: both; -} - -.table-comparison { - table-layout: fixed; + // + // Compare Products Page + // --------------------------------------------- - .cell.label.remove, - .cell.label.product { - span { - &:extend(.abs-visually-hidden all); + body.catalog-product-compare-index { + .action.print { + float: right; + margin: 15px 0; } } - .cell.label, - td:last-child { - border-right: @table__border-width @table__border-style @table__border-color; + .table-wrapper.comparison { + clear: both; } - .cell { - width: 140px; - padding: 15px; - .attibute.value { - width: 100%; - overflow: hidden; + .table-comparison { + table-layout: fixed; + + .cell.label.remove, + .cell.label.product { + span { + &:extend(.abs-visually-hidden all); + } } - &.product.info, - &.product.label { - border-bottom: @table__border-width @table__border-style @table__border-color; + .cell.label, + td:last-child { + border-right: @table__border-width @table__border-style @table__border-color; } - &.label { - .attribute.label { - display: block; + + .cell { + width: 140px; + padding: 15px; + .attibute.value { width: 100%; - word-wrap: break-word; + overflow: hidden; } - } - &.attribute { - .font-size(13); - img { - max-width: 100%; - height: auto; + + &.product.info, + &.product.label { + border-bottom: @table__border-width @table__border-style @table__border-color; + } + &.label { + .attribute.label { + display: block; + width: 100%; + word-wrap: break-word; + } + } + &.attribute { + .font-size(13); + img { + max-width: 100%; + height: auto; + } } } - } - .product-item-photo { - display: block; - margin: 0 auto 15px; - } - .product-image-photo { - margin-left: 0; - } + .product-item-photo { + display: block; + margin: 0 auto 15px; + } + .product-image-photo { + margin-left: 0; + } - .product-item-actions, - .price-box, - .product.rating, - .product-item-name { - display: block; - margin: 15px 0; - } + .product-item-actions, + .price-box, + .product.rating, + .product-item-name { + display: block; + margin: 15px 0; + } - .product-addto-links { - margin-top: 15px; + .product-addto-links { + margin-top: 15px; - .action.split, - .action.toggle { - .button-s(); - } + .action.split, + .action.toggle { + .button-s(); + } - .action.toggle { - padding: 0; + .action.toggle { + padding: 0; + } } - } - .cell.remove { - padding-top: 0; - padding-bottom: 0; - text-align: right; - .action.delete { - &:extend(.abs-remove-button-for-blocks all); + .cell.remove { + padding-top: 0; + padding-bottom: 0; + text-align: right; + .action.delete { + &:extend(.abs-remove-button-for-blocks all); + } } - } - .product-item-actions { - > .actions-primary { - + .actions-secondary { - margin-top: @indent__s; + .product-item-actions { + > .actions-primary { + + .actions-secondary { + margin-top: @indent__s; + } } } - } - .action { - &.tocart { - white-space: nowrap; + .action { + &.tocart { + white-space: nowrap; + } } } -} - -.comparison.headings { - position: absolute; - z-index: 2; - top: 0; - left: 0; - width: auto; - .css(background, @page__background-color); -} -.block-compare { - .block-title { - &:extend(.abs-block-title all); - } - .product-item .product-item-name { - margin-left: 22px; + .comparison.headings { + position: absolute; + z-index: 2; + top: 0; + left: 0; + width: auto; + .css(background, @page__background-color); } - .action { - &.delete { - &:extend(.abs-remove-button-for-blocks all); - position: absolute; - left: -6px; - top: 0; + + .block-compare { + .block-title { + &:extend(.abs-block-title all); } - &.compare { - &:extend(.abs-revert-secondary-color all); + .product-item .product-item-name { + margin-left: 22px; + } + .action { + &.delete { + &:extend(.abs-remove-button-for-blocks all); + position: absolute; + left: -6px; + top: 0; + } + &.compare { + &:extend(.abs-revert-secondary-color all); + } + } + .counter { + &:extend(.abs-block-items-counter all); + } + .actions-toolbar { + margin: 17px 0 0; } } - .counter { - &:extend(.abs-block-items-counter all); - } - .actions-toolbar { - margin: 17px 0 0; - } -} - } diff --git a/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/checkout/_payment-options.less b/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/checkout/_payment-options.less index ce48ebcb01e4d1ba87f9223e5c071d0f5da8604c..5d29639a89d289df9a509b119701e0ca3885f288 100644 --- a/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/checkout/_payment-options.less +++ b/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/checkout/_payment-options.less @@ -98,7 +98,6 @@ -webkit-filter: grayscale(100%); // For Webkit browsers -webkit-transition: all .6s ease; // Fade to color for Chrome and Safari filter: grayscale(100%); - filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); // Firefox 10+, Firefox on Android filter: gray; // For IE 6 - 9 } } diff --git a/app/design/frontend/Magento/blank/web/css/source/components/_modals_extend.less b/app/design/frontend/Magento/blank/web/css/source/components/_modals_extend.less index 2d63705c1a1353a9e951e95a258fdf2af899e313..093ff416e14d2413be22ae634d7989189e21b708 100644 --- a/app/design/frontend/Magento/blank/web/css/source/components/_modals_extend.less +++ b/app/design/frontend/Magento/blank/web/css/source/components/_modals_extend.less @@ -91,6 +91,19 @@ right: 0; top: 0; } + + body { + &._has-modal-custom { + .modal-custom-overlay { + height: 100vh; + left: 0; + position: fixed; + top: 0; + width: 100vw; + z-index: @overlay__z-index; + } + } + } } // @@ -113,18 +126,14 @@ min-height: 100%; } } - body._has-modal-custom { - height: 100vh; - overflow: hidden; - width: 100vw; - .modal-custom-overlay { - .css(background-color, @modal-overlay__background-color); + body { + &._has-modal-custom { height: 100vh; - left: 0; - position: fixed; - top: 0; + overflow: hidden; width: 100vw; - z-index: @overlay__z-index; + .modal-custom-overlay { + .css(background-color, @modal-overlay__background-color); + } } } } diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRepositoryInterfaceTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRepositoryInterfaceTest.php index 8adda8f9d9b7322f3683bf5aba9bc6d56219b0c1..d33e1456bc363e80830d3d1a32229fbccaaebc69 100644 --- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRepositoryInterfaceTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRepositoryInterfaceTest.php @@ -36,48 +36,6 @@ class ProductRepositoryInterfaceTest extends WebapiAbstract ], ]; - /** - * @magentoApiDataFixture Magento/Catalog/_files/product_simple.php - */ - public function testSearch() - { - $searchCriteria = [ - 'searchCriteria' => [ - 'search_term' => 'simple', - 'request_name' => 'quick_search_container', - 'filter_groups' => [], - 'page_size' => 20000000000000, - 'current_page' => 1, - ], - ]; - - $serviceInfo = [ - 'rest' => [ - 'resourcePath' => self::RESOURCE_PATH . '/search' . '?' . http_build_query($searchCriteria), - 'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_GET, - ], - 'soap' => [ - 'service' => self::SERVICE_NAME, - 'serviceVersion' => self::SERVICE_VERSION, - 'operation' => self::SERVICE_NAME . 'Search', - ], - ]; - - $response = $this->_webApiCall($serviceInfo, $searchCriteria); - - $this->assertArrayHasKey('search_criteria', $response); - $this->assertArrayHasKey('total_count', $response); - $this->assertArrayHasKey('items', $response); - - $this->assertEquals($searchCriteria['searchCriteria'], $response['search_criteria']); - $this->assertTrue($response['total_count'] > 0); - $this->assertTrue(count($response['items']) > 0); - - $this->assertNotNull($response['items'][0]['id']); - $this->assertEquals('relevance', $response['items'][0]['custom_attributes'][0]['attribute_code']); - $this->assertTrue($response['items'][0]['custom_attributes'][0]['value'] > 0); - } - /** * @magentoApiDataFixture Magento/Catalog/_files/products_related.php */ diff --git a/dev/tests/api-functional/testsuite/Magento/Search/Api/SearchTest.php b/dev/tests/api-functional/testsuite/Magento/Search/Api/SearchTest.php new file mode 100644 index 0000000000000000000000000000000000000000..ae6fd1cfc39eb5b9577675a77ff15dd5a24cd802 --- /dev/null +++ b/dev/tests/api-functional/testsuite/Magento/Search/Api/SearchTest.php @@ -0,0 +1,70 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Search\Api; + +use Magento\TestFramework\TestCase\WebapiAbstract; + +class SearchTest extends WebapiAbstract +{ + const SERVICE_NAME = 'searchV1'; + const SERVICE_VERSION = 'V1'; + const RESOURCE_PATH = '/V1/search'; + + /** + * @magentoApiDataFixture Magento/Catalog/_files/product_simple.php + * @covers \Magento\Search\Model\Search::search + */ + public function testCatalogSearch() + { + $searchCriteria = [ + 'searchCriteria' => [ + 'request_name' => 'quick_search_container', + 'filter_groups' => [ + [ + 'filters' => [ + [ + 'field' => 'search_term', + 'value' => 'simple', + ], + [ + 'field' => 'price_dynamic_algorithm', + 'value' => 'auto', + ] + ] + ] + ], + 'page_size' => 20000000000000, + 'current_page' => 1, + ], + ]; + + $serviceInfo = [ + 'rest' => [ + 'resourcePath' => self::RESOURCE_PATH . '?' . http_build_query($searchCriteria), + 'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_GET, + ], + 'soap' => [ + 'service' => self::SERVICE_NAME, + 'serviceVersion' => self::SERVICE_VERSION, + 'operation' => self::SERVICE_NAME . 'Search', + ], + ]; + + $response = $this->_webApiCall($serviceInfo, $searchCriteria); + + $this->assertArrayHasKey('search_criteria', $response); + $this->assertArrayHasKey('total_count', $response); + $this->assertArrayHasKey('items', $response); + + $this->assertEquals($searchCriteria['searchCriteria'], $response['search_criteria']); + $this->assertTrue($response['total_count'] > 0); + $this->assertTrue(count($response['items']) > 0); + + $this->assertNotNull($response['items'][0]['id']); + $this->assertEquals('relevance', $response['items'][0]['custom_attributes'][0]['attribute_code']); + $this->assertTrue($response['items'][0]['custom_attributes'][0]['value'] > 0); + } +} diff --git a/dev/tests/functional/composer.json b/dev/tests/functional/composer.json index ca4b3bc7f79e43c04109d7162163832f89340ec8..73c97a88158780fcbb55a2a3c994e29a0a0df33b 100644 --- a/dev/tests/functional/composer.json +++ b/dev/tests/functional/composer.json @@ -1,6 +1,6 @@ { "require": { - "magento/mtf": "1.0.0-rc27", + "magento/mtf": "1.0.0-rc28", "php": "~5.5.0|~5.6.0", "phpunit/phpunit": "4.1.0", "phpunit/phpunit-selenium": ">=1.2", diff --git a/dev/tests/functional/lib/Magento/Mtf/Fixture/DataSource.php b/dev/tests/functional/lib/Magento/Mtf/Fixture/DataSource.php deleted file mode 100644 index abd0c0b1627fce7353acf00d1133dcd8d1263dc6..0000000000000000000000000000000000000000 --- a/dev/tests/functional/lib/Magento/Mtf/Fixture/DataSource.php +++ /dev/null @@ -1,62 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Mtf\Fixture; - -use Magento\Mtf\Fixture\FixtureInterface; - -/** - * Parent fixture data source class. - */ -class DataSource implements FixtureInterface -{ - /** - * Data set configuration settings. - * - * @var array - */ - protected $params; - - /** - * Value data. - * - * @var array - */ - protected $data; - - /** - * Persist entity. - * - * @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/phpunit.xml.dist b/dev/tests/functional/phpunit.xml.dist index a88d4b922b6436a27856a7249239805d362043c4..ec1748e20b13556da45e875c29870dcdd70f72b1 100755 --- a/dev/tests/functional/phpunit.xml.dist +++ b/dev/tests/functional/phpunit.xml.dist @@ -29,8 +29,8 @@ </listeners> <php> - <env name="app_frontend_url" value="http://localhost/index.php/" /> - <env name="app_backend_url" value="http://localhost/index.php/backend/" /> + <env name="app_frontend_url" value="http://localhost/" /> + <env name="app_backend_url" value="http://localhost/backend/" /> <env name="testsuite_rule" value="basic" /> <env name="testsuite_rule_path" value="Magento/Mtf/TestSuite/InjectableTests" /> <env name="log_directory" value="var/log" /> diff --git a/dev/tests/functional/tests/app/Magento/Authorizenet/Test/TestCase/OnePageCheckoutTest.xml b/dev/tests/functional/tests/app/Magento/Authorizenet/Test/TestCase/OnePageCheckoutTest.xml index 7adf887baa967267ee63cf94dd55eb057a1acc51..03cebd5af2798caf75b6fcbca9e34fb3c13afa0f 100644 --- a/dev/tests/functional/tests/app/Magento/Authorizenet/Test/TestCase/OnePageCheckoutTest.xml +++ b/dev/tests/functional/tests/app/Magento/Authorizenet/Test/TestCase/OnePageCheckoutTest.xml @@ -11,8 +11,8 @@ <data name="description" xsi:type="string">MAGETWO-12832 - Check Out as a Guest with Authorize.Net and Offline Shipping method</data> <data name="products" xsi:type="string">catalogProductSimple::product_10_dollar, configurableProduct::with_one_option, bundleProduct::bundle_fixed_100_dollar_product</data> <data name="taxRule" xsi:type="string">us_ca_ny_rule</data> - <data name="customer/dataSet" xsi:type="string">default</data> - <data name="billingAddress/dataSet" xsi:type="string">US_address_1</data> + <data name="customer/dataset" xsi:type="string">default</data> + <data name="billingAddress/dataset" xsi:type="string">US_address_1</data> <data name="checkoutMethod" xsi:type="string">guest</data> <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data> <data name="shipping/shipping_method" xsi:type="string">Fixed</data> @@ -20,7 +20,7 @@ <item name="grandTotal" xsi:type="string">156.81</item> </data> <data name="payment/method" xsi:type="string">authorizenet</data> - <data name="creditCard/dataSet" xsi:type="string">visa_default</data> + <data name="creditCard/dataset" xsi:type="string">visa_default</data> <data name="configData" xsi:type="string">authorizenet</data> <data name="tag" xsi:type="string">test_type:3rd_party_test</data> <constraint name="Magento\Checkout\Test\Constraint\AssertOrderSuccessPlacedMessage"/> diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/Grid.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/Grid.php index 6e6d66e7b0ee0294744389bc78711dbebc4d84c7..76509dfa40663b0bb84584766f7564084acffb39 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/Grid.php +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/Grid.php @@ -186,7 +186,7 @@ abstract class Grid extends Block * * @var string */ - protected $rowPattern = '//tr[%s]'; + protected $rowPattern = '//tbody/tr[%s]'; /** * Get backend abstract block diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Fixture/GlobalSearch.xml b/dev/tests/functional/tests/app/Magento/Backend/Test/Fixture/GlobalSearch.xml index 7b1c3f2aeac1d2d0f6e9be43c3dab50609066d32..f5831a6ba958a9bb65cc67533cd49968a563e470 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Fixture/GlobalSearch.xml +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Fixture/GlobalSearch.xml @@ -6,10 +6,9 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="globalSearch" module="Magento_Backend" class="Magento\Backend\Test\Fixture\GlobalSearch"> - <dataset name="default"> - <field name="query" xsi:type="string">catalogProductSimple::default::name</field> - </dataset> - <field name="query" source="Magento\Backend\Test\Fixture\GlobalSearch\Query"/> - </fixture> + <fixture name="globalSearch" + module="Magento_Backend" + class="Magento\Backend\Test\Fixture\GlobalSearch"> + <field name="query" source="Magento\Backend\Test\Fixture\GlobalSearch\Query" /> + </fixture> </config> diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Fixture/GlobalSearch/Query.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Fixture/GlobalSearch/Query.php index 3f14768fb4511a5233a1e4038d693bed751acd32..3a4fd33ceba98ae2a624fbfa88b7fa277201e5cd 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Fixture/GlobalSearch/Query.php +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Fixture/GlobalSearch/Query.php @@ -6,40 +6,23 @@ namespace Magento\Backend\Test\Fixture\GlobalSearch; +use Magento\Mtf\Fixture\DataSource; use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Mtf\Fixture\FixtureInterface; use Magento\Mtf\Fixture\InjectableFixture; /** - * Class Query - * Global Search query data provider + * Global Search query data provider. */ -class Query implements FixtureInterface +class Query extends DataSource { /** - * Prepared dataSet data - * - * @var array - */ - protected $data; - - /** - * Data set configuration settings - * - * @var array - */ - protected $params; - - /** - * Data source entity + * Data source entity. * * @var InjectableFixture */ protected $entity = null; /** - * Constructor - * * @constructor * @param FixtureFactory $fixtureFactory * @param string $data @@ -54,8 +37,8 @@ class Query implements FixtureInterface $this->data = $explodedData[0]; break; case 3: - list($fixture, $dataSet, $field) = $explodedData; - $entity = $fixtureFactory->createByCode($fixture, ['dataSet' => $dataSet]); + list($fixture, $dataset, $field) = $explodedData; + $entity = $fixtureFactory->createByCode($fixture, ['dataset' => $dataset]); if (!$entity->hasData('id')) { $entity->persist(); } @@ -63,8 +46,8 @@ class Query implements FixtureInterface $this->entity = $entity; break; case 4: - list($fixture, $dataSet, $source, $field) = $explodedData; - $entity = $fixtureFactory->createByCode($fixture, ['dataSet' => $dataSet]); + list($fixture, $dataset, $source, $field) = $explodedData; + $entity = $fixtureFactory->createByCode($fixture, ['dataset' => $dataset]); if (!$entity->hasData('id')) { $entity->persist(); } @@ -76,30 +59,7 @@ class Query implements FixtureInterface } /** - * 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; - } - - /** - * Get entity for global search + * Get entity for global search. * * @return InjectableFixture */ @@ -107,14 +67,4 @@ class Query implements FixtureInterface { return $this->entity; } - - /** - * Return data set configuration settings - * - * @return string - */ - public function getDataConfig() - { - return $this->params; - } } diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Fixture/Source/Date.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Fixture/Source/Date.php index 2b5d6e994d403c68c26c9666a9d450746aa4ea9b..5a9141b524060ad64a7fd61ad01ba41e1ef58534 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Fixture/Source/Date.php +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Fixture/Source/Date.php @@ -6,24 +6,18 @@ namespace Magento\Backend\Test\Fixture\Source; -use Magento\Mtf\Fixture\FixtureInterface; +use Magento\Mtf\Fixture\DataSource; /** - * Class Date + * Class Date. * * Data keys: * - pattern (Format a local time/date with delta, e.g. 'm-d-Y -3 days' = current day - 3 days) */ -class Date implements FixtureInterface +class Date extends DataSource { /** - * Date for fill on form - * - * @var string - */ - protected $data; - - /** + * @constructor * @param array $params * @param array $data * @throws \Exception @@ -48,37 +42,4 @@ class Date implements FixtureInterface $this->data = $date; } } - - /** - * Persists prepared data into application - * - * @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 data set configuration settings - * - * @return string - */ - public function getDataConfig() - { - return $this->params; - } } diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/GlobalSearchEntityTest.php b/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/GlobalSearchEntityTest.php index 9624a9398b6ac7c7bb2f25f47b49bfde089978f5..836103161525eff28072aaddb1db4567d0941ec8 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/GlobalSearchEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/GlobalSearchEntityTest.php @@ -19,7 +19,7 @@ use Magento\Mtf\TestCase\Injectable; * Steps: * 1. Login to backend * 2. Click on Search button on the top of page - * 3. Fill in data according dataSet + * 3. Fill in data according dataset * 4. Perform assertions * * @group Search_Core_(MX) @@ -58,7 +58,7 @@ class GlobalSearchEntityTest extends Injectable */ public function test(GlobalSearch $search) { - //Steps: + // Steps: $this->dashboard->open(); $this->dashboard->getAdminPanelHeader()->search($search->getQuery()); } diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleInCategory.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleInCategory.php index 30a4b7747c40e86c69e215b9e6fd56e8ec041f02..a70183ca9d5ddaabfa396dfcc60801dbbd0fe327 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleInCategory.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleInCategory.php @@ -27,7 +27,7 @@ class AssertBundleInCategory extends AssertProductInCategory protected function assertPrice(FixtureInterface $bundle, CatalogCategoryView $catalogCategoryView) { /** @var BundleProduct $bundle */ - $priceData = $bundle->getDataFieldConfig('price')['source']->getPreset(); + $priceData = $bundle->getDataFieldConfig('price')['source']->getPriceData(); //Price from/to verification $priceBlock = $catalogCategoryView->getListProductBlock()->getProductItem($bundle)->getPriceBlock(); diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleItemsOnProductPage.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleItemsOnProductPage.php index 143320dbbba2d08ce53d6ba9519d0cdff5086a7d..d0e6e7a7f2f695378a3a185f11f782be2257a45f 100755 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleItemsOnProductPage.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleItemsOnProductPage.php @@ -12,13 +12,12 @@ use Magento\Mtf\Client\BrowserInterface; use Magento\Mtf\Constraint\AbstractAssertForm; /** - * Class AssertBundleItemsOnProductPage - * Assert that displayed product bundle items data on product page equals passed from fixture preset + * Assert that displayed product bundle items data on product page equals passed from fixture */ class AssertBundleItemsOnProductPage extends AbstractAssertForm { /** - * Assert that displayed product bundle items data on product page equals passed from fixture preset + * Assert that displayed product bundle items data on product page equals passed from fixture. * * @param CatalogProductView $catalogProductView * @param BundleProduct $product @@ -48,7 +47,7 @@ class AssertBundleItemsOnProductPage extends AbstractAssertForm } /** - * Prepare bundle options + * Prepare bundle options. * * @param BundleProduct $product * @return array @@ -89,12 +88,12 @@ class AssertBundleItemsOnProductPage extends AbstractAssertForm } /** - * Return Text if displayed on frontend equals with fixture + * 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.'; + return 'Bundle options data on product page equals to passed from fixture dataset.'; } } diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundlePriceType.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundlePriceType.php index 77c2e21ce5831c2729ef128b0c13bbf203d2d15e..a4346357991c559920ba7494fa539968f547fb1f 100755 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundlePriceType.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundlePriceType.php @@ -112,7 +112,7 @@ class AssertBundlePriceType extends AbstractConstraint 'Bundle item ' . ($index + 1) . ' options on frontend don\'t equal to fixture.' ); } - $sumOptionsPrice = $product->getDataFieldConfig('price')['source']->getPreset()['cart_price']; + $sumOptionsPrice = $product->getDataFieldConfig('price')['source']->getPriceData()['cart_price']; $subTotal = number_format($cartItem->getPrice(), 2); \PHPUnit_Framework_Assert::assertEquals( diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundlePriceView.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundlePriceView.php index e5323013d26b59b083e9d921919975575b534b71..3a714a0115e867e49a19116f3df2b8b39ccb96bc 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundlePriceView.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundlePriceView.php @@ -45,7 +45,7 @@ class AssertBundlePriceView extends AbstractConstraint */ protected function assertPrice(BundleProduct $product, CatalogProductView $catalogProductView) { - $priceData = $product->getDataFieldConfig('price')['source']->getPreset(); + $priceData = $product->getDataFieldConfig('price')['source']->getPriceData(); $priceView = $product->getPriceView(); $priceBlock = $catalogProductView->getViewBlock()->getPriceBlock(); diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleProductForm.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleProductForm.php index 38ab1c7f295baa98df4d808eaa0fd456e2352f01..a1f9b3e23a4f0ccfb453de2c4faec1c07897e6d2 100755 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleProductForm.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleProductForm.php @@ -9,12 +9,12 @@ namespace Magento\Bundle\Test\Constraint; use Magento\Catalog\Test\Constraint\AssertProductForm; /** - * Class AssertBundleProductForm + * Assert bundle product form. */ class AssertBundleProductForm extends AssertProductForm { /** - * Formatting options for array values + * Formatting options for array values. * * @var array */ @@ -28,7 +28,7 @@ class AssertBundleProductForm extends AssertProductForm ]; /** - * Prepares fixture data for comparison + * Prepares fixture data for comparison. * * @param array $data * @param array $sortFields [optional] @@ -44,7 +44,7 @@ class AssertBundleProductForm extends AssertProductForm } /** - * Prepare Bundle Options array from preset + * Prepare Bundle Options array from dataset. * * @param array $bundleSelections * @return array diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleProductPage.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleProductPage.php index e6d1d24ff1e6989b8d6f44c83752a176d0358ecf..1ccbfd702f4ebc2ccc73aee8abae7f308ebde322 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleProductPage.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleProductPage.php @@ -22,7 +22,7 @@ class AssertBundleProductPage extends AssertProductPage */ protected function verifyPrice() { - $priceData = $this->product->getDataFieldConfig('price')['source']->getPreset(); + $priceData = $this->product->getDataFieldConfig('price')['source']->getPriceData(); $priceView = $this->product->getPriceView(); $priceBlock = $this->productView->getPriceBlock(); diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertGroupedPriceOnBundleProductPage.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertGroupedPriceOnBundleProductPage.php index da18ba61b486e1c9bfa31c6a1ec2464747626e77..7d721ba3a304e8a1bf5b028c900a89988aa42fdf 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertGroupedPriceOnBundleProductPage.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertGroupedPriceOnBundleProductPage.php @@ -29,7 +29,7 @@ class AssertGroupedPriceOnBundleProductPage extends AssertProductGroupedPriceOnP 'price_regular_price' => $view->getPriceBlock()->getPrice(), 'price_from' => $view->getPriceBlock()->getPriceFrom(), ], - 'fixture' => $product->getDataFieldConfig('price')['source']->getPreset()['price_from'], + 'fixture' => $product->getDataFieldConfig('price')['source']->getPriceData()['price_from'], ]; $groupPrice['onPage'] = isset($groupPrice['onPage']['price_regular_price']) diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct.xml b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct.xml index b9f96e1cb55a7ff19150c846a5424c9b8a2c4414..2cff47a580a63e3107126b560fe79b173f630938 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct.xml +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct.xml @@ -6,204 +6,94 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="bundleProduct" module="Magento_Bundle" type="eav" entity_type="catalog_product" product_type="bundle" collection="Magento\Catalog\Model\Resource\Product\Collection" identifier="sku" repository_class="Magento\Bundle\Test\Repository\BundleProduct" handler_interface="Magento\Bundle\Test\Handler\BundleProduct\BundleProductInterface" class="Magento\Bundle\Test\Fixture\BundleProduct"> - <dataset name="default"> - <field name="name" xsi:type="string">BundleProduct %isolation%</field> - <field name="sku_type" xsi:type="string">Dynamic</field> - <field name="price_type" xsi:type="string">Dynamic</field> - <field name="weight_type" xsi:type="string">Dynamic</field> - </dataset> - <data_config> - <item name="type_id" xsi:type="string">bundle</item> - <item name="create_url_params" xsi:type="array"> - <item name="type" xsi:type="string">bundle</item> - <item name="set" xsi:type="string">4</item> - </item> - <item name="input_prefix" xsi:type="string">product</item> - </data_config> - <field name="category_ids" is_required="0" group="product-details" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\CategoryIds"> - <default_value xsi:type="null"/> - </field> - <field name="country_of_manufacture" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="created_at" is_required="1"> - <default_value xsi:type="null"/> - </field> - <field name="custom_design" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="custom_design_from" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="custom_design_to" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="custom_layout_update" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="description" is_required="0" group="product-details"> - <default_value xsi:type="null"/> - </field> - <field name="enable_googlecheckout" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="gallery" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="gift_message_available" is_required="0" group="autosettings"> - <default_value xsi:type="null"/> - </field> - <field name="use_config_gift_message_available" is_required="0" group="autosettings"> - <default_value xsi:type="null"/> - </field> - <field name="group_price" is_required="0" group="advanced-pricing" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\GroupPriceOptions"> - <default_value xsi:type="null"/> - </field> - <field name="has_options" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="image" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="image_label" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="media_gallery" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="meta_description" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="meta_keyword" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="meta_title" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="minimal_price" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="msrp" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="msrp_display_actual_price_type" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="name" is_required="1" group="product-details"> - <default_value xsi:type="string">BundleProduct %isolation%</default_value> - </field> - <field name="news_from_date" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="news_to_date" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="old_id" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="options_container" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="page_layout" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="price" is_required="1" source="Magento\Bundle\Test\Fixture\BundleProduct\Price" group="product-details"> - <default_value xsi:type="null"/> - </field> - <field name="price_from" is_required="1" group="product-details"> - <default_value xsi:type="null"/> - </field> - <field name="price_to" is_required="1" group="product-details"> - <default_value xsi:type="null"/> - </field> - <field name="price_type" is_required="1" group="product-details"> - <default_value xsi:type="string">Dynamic</default_value> - </field> - <field name="status" is_required="0" group="product-details"/> - <field name="price_view" is_required="1" group="advanced-pricing"> - <default_value xsi:type="null"/> - </field> - <field name="quantity_and_stock_status" is_required="0" group="product-details"/> - <field name="required_options" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="use_config_manage_stock" group="advanced-inventory"/> - <field name="manage_stock" group="advanced-inventory"/> - <field name="shipment_type" is_required="1" group="product-details"> - <default_value xsi:type="null"/> - </field> - <field name="short_description" is_required="0" group="autosettings"> - <default_value xsi:type="null"/> - </field> - <field name="sku" is_required="1" group="product-details"> - <default_value xsi:type="null"/> - </field> - <field name="sku_type" is_required="1" group="product-details"> - <default_value xsi:type="string">Dynamic</default_value> - </field> - <field name="weight_type" is_required="1" group="product-details"> - <default_value xsi:type="string">Dynamic</default_value> - </field> - <field name="weight" is_required="0" group="product-details"> - <default_value xsi:type="null"/> - </field> - <field name="small_image" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="small_image_label" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="special_price" is_required="0" group="advanced-pricing"> - <default_value xsi:type="null"/> - </field> - <field name="special_from_date" is_required="0" group="advanced-pricing" source="Magento\Backend\Test\Fixture\Source\Date"> - <default_value xsi:type="null"/> - </field> - <field name="special_to_date" is_required="0" group="advanced-pricing" source="Magento\Backend\Test\Fixture\Source\Date"> - <default_value xsi:type="null"/> - </field> - <field name="tax_class_id" is_required="0" group="product-details" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\TaxClass"/> - <field name="thumbnail" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="thumbnail_label" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="tier_price" is_required="0" group="advanced-pricing" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\TierPriceOptions"> - <default_value xsi:type="null"/> - </field> - <field name="updated_at" is_required="1"> - <default_value xsi:type="null"/> - </field> - <field name="url_key" is_required="0" group="search-engine-optimization"> - <default_value xsi:type="null"/> - </field> - <field name="url_path" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="visibility" is_required="0" group="autosettings"/> - <field name="id"/> - <field name="bundle_selections" is_required="1" group="bundle" source="Magento\Bundle\Test\Fixture\BundleProduct\BundleSelections"/> - <field name="checkout_data" is_required="1" group="null" source="Magento\Bundle\Test\Fixture\BundleProduct\CheckoutData"/> - <field name="custom_options" is_required="0" group="customer-options" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\CustomOptions"/> - <field name="type_id"/> - <field name="new_variations_attribute_set_id"/> - <field name="affect_bundle_product_selection"/> - <field name="stock_data" group="advanced-inventory"/> - <field name="category_id" group="product-details"/> - <field name="website_ids" group="websites"/> - <field name="cross_sell_products" - group="crosssells" - source="Magento\Catalog\Test\Fixture\CatalogProductSimple\UpSellProducts" - /> - <field name="up_sell_products" - group="upsells" - source="Magento\Catalog\Test\Fixture\CatalogProductSimple\CrossSellProducts" - /> - <field name="related_products" - group="related-products" - source="Magento\Catalog\Test\Fixture\CatalogProductSimple\RelatedProducts" - /> - </fixture> + <fixture name="bundleProduct" + module="Magento_Bundle" + type="eav" + entity_type="catalog_product" + product_type="bundle" + collection="Magento\Catalog\Model\Resource\Product\Collection" + identifier="sku" + repository_class="Magento\Bundle\Test\Repository\BundleProduct" + handler_interface="Magento\Bundle\Test\Handler\BundleProduct\BundleProductInterface" + class="Magento\Bundle\Test\Fixture\BundleProduct"> + <data_config> + <item name="type_id" xsi:type="string">bundle</item> + <item name="create_url_params" xsi:type="array"> + <item name="type" xsi:type="string">bundle</item> + <item name="set" xsi:type="string">4</item> + </item> + <item name="input_prefix" xsi:type="string">product</item> + </data_config> + <field name="category_ids" is_required="0" group="product-details" source="Magento\Catalog\Test\Fixture\Product\CategoryIds" /> + <field name="country_of_manufacture" is_required="0" /> + <field name="created_at" is_required="1" /> + <field name="custom_design" is_required="0" /> + <field name="custom_design_from" is_required="0" /> + <field name="custom_design_to" is_required="0" /> + <field name="custom_layout_update" is_required="0" /> + <field name="description" is_required="0" group="product-details" /> + <field name="enable_googlecheckout" is_required="0" /> + <field name="gallery" is_required="0" /> + <field name="gift_message_available" is_required="0" group="autosettings" /> + <field name="use_config_gift_message_available" is_required="0" group="autosettings" /> + <field name="group_price" is_required="0" group="advanced-pricing" repository="Magento\Catalog\Test\Repository\Product\GroupPriceOptions" /> + <field name="has_options" is_required="0" /> + <field name="image" is_required="0" /> + <field name="image_label" is_required="0" /> + <field name="media_gallery" is_required="0" /> + <field name="meta_description" is_required="0" /> + <field name="meta_keyword" is_required="0" /> + <field name="meta_title" is_required="0" /> + <field name="minimal_price" is_required="0" /> + <field name="msrp" is_required="0" /> + <field name="msrp_display_actual_price_type" is_required="0" /> + <field name="name" is_required="1" group="product-details" /> + <field name="news_from_date" is_required="0" /> + <field name="news_to_date" is_required="0" /> + <field name="old_id" is_required="0" /> + <field name="options_container" is_required="0" /> + <field name="page_layout" is_required="0" /> + <field name="price" is_required="1" source="Magento\Catalog\Test\Fixture\Product\Price" repository="Magento\Bundle\Test\Repository\BundleProduct\Price" group="product-details" /> + <field name="price_from" is_required="1" group="product-details" /> + <field name="price_to" is_required="1" group="product-details" /> + <field name="price_type" is_required="1" group="product-details" /> + <field name="status" is_required="0" group="product-details" /> + <field name="price_view" is_required="1" group="advanced-pricing" /> + <field name="quantity_and_stock_status" is_required="0" group="product-details" /> + <field name="required_options" is_required="0" /> + <field name="use_config_manage_stock" group="advanced-inventory" /> + <field name="manage_stock" group="advanced-inventory" /> + <field name="shipment_type" is_required="1" group="product-details" /> + <field name="short_description" is_required="0" group="autosettings" /> + <field name="sku" is_required="1" group="product-details" /> + <field name="sku_type" is_required="1" group="product-details" /> + <field name="weight_type" is_required="1" group="product-details" /> + <field name="weight" is_required="0" group="product-details" /> + <field name="small_image" is_required="0" /> + <field name="small_image_label" is_required="0" /> + <field name="special_price" is_required="0" group="advanced-pricing" /> + <field name="special_from_date" is_required="0" group="advanced-pricing" source="Magento\Backend\Test\Fixture\Source\Date" /> + <field name="special_to_date" is_required="0" group="advanced-pricing" source="Magento\Backend\Test\Fixture\Source\Date" /> + <field name="tax_class_id" is_required="0" group="product-details" source="Magento\Catalog\Test\Fixture\Product\TaxClass" /> + <field name="thumbnail" is_required="0" /> + <field name="thumbnail_label" is_required="0" /> + <field name="tier_price" is_required="0" group="advanced-pricing" repository="Magento\Catalog\Test\Repository\Product\TierPrice" /> + <field name="updated_at" is_required="1" /> + <field name="url_key" is_required="0" group="search-engine-optimization" /> + <field name="url_path" is_required="0" /> + <field name="visibility" is_required="0" group="autosettings" /> + <field name="id" /> + <field name="bundle_selections" is_required="1" group="bundle" source="Magento\Bundle\Test\Fixture\BundleProduct\BundleSelections" repository="Magento\Bundle\Test\Repository\BundleProduct\BundleSelection" /> + <field name="checkout_data" is_required="1" group="null" repository="Magento\Bundle\Test\Repository\BundleProduct\CheckoutData" /> + <field name="custom_options" is_required="0" group="customer-options" source="Magento\Catalog\Test\Fixture\Product\CustomOptions" repository="Magento\Catalog\Test\Repository\Product\CustomOptions" /> + <field name="type_id" /> + <field name="new_variations_attribute_set_id" /> + <field name="affect_bundle_product_selection" /> + <field name="stock_data" group="advanced-inventory" /> + <field name="category_id" group="product-details" /> + <field name="website_ids" group="websites" /> + <field name="cross_sell_products" group="crosssells" source="Magento\Catalog\Test\Fixture\Product\UpSellProducts" /> + <field name="up_sell_products" group="upsells" source="Magento\Catalog\Test\Fixture\Product\CrossSellProducts" /> + <field name="related_products" group="related-products" source="Magento\Catalog\Test\Fixture\Product\RelatedProducts" /> + </fixture> </config> diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/BundleSelections.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/BundleSelections.php index f0d58fec564c30e6ee50a070ef76a9f37f4f5edf..664f7537eecb782e03357bb70f8c0b6133501c0f 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/BundleSelections.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/BundleSelections.php @@ -6,44 +6,61 @@ namespace Magento\Bundle\Test\Fixture\BundleProduct; +use Magento\Mtf\Fixture\DataSource; use Magento\Mtf\Fixture\FixtureFactory; use Magento\Mtf\Fixture\FixtureInterface; +use Magento\Mtf\Repository\RepositoryFactory; /** - * Class BundleSelections - * Bundle selections preset + * Prepare bundle selection items. */ -class BundleSelections implements FixtureInterface +class BundleSelections extends DataSource { /** - * Prepared dataSet data + * Repository factory instance. * - * @var array + * @var RepositoryFactory */ - protected $data; + protected $repositoryFactory; /** - * Data set configuration settings + * Fixture factory instance. * - * @var array + * @var RepositoryFactory */ - protected $params; + protected $fixtureFactory; /** - * Constructor - * * @constructor + * @param RepositoryFactory $repositoryFactory * @param FixtureFactory $fixtureFactory * @param array $data * @param array $params [optional] */ - public function __construct(FixtureFactory $fixtureFactory, array $data, array $params = []) - { + public function __construct( + RepositoryFactory $repositoryFactory, + FixtureFactory $fixtureFactory, + array $data, + array $params = [] + ) { + $this->repositoryFactory = $repositoryFactory; + $this->fixtureFactory = $fixtureFactory; $this->params = $params; - $this->data = !isset($data['preset']) ? $data : []; + $this->data = !isset($data['dataset']) ? $data : []; + $this->getDataset($data); + $this->prepareProducts(); + } - if (isset($data['preset'])) { - $this->data = $this->getPreset($data['preset']); + /** + * Get dataset for a field. + * + * @param array $data + * @return void + */ + protected function getDataset(array $data) + { + if (isset($data['dataset']) && isset($this->params['repository'])) { + $this->data = $this->repositoryFactory->get($this->params['repository'])->get($data['dataset']); if (!empty($data['products'])) { $this->data['products'] = []; $this->data['products'] = explode('|', $data['products']); @@ -52,7 +69,15 @@ class BundleSelections implements FixtureInterface } } } + } + /** + * Prepare products for bundle items. + * + * @return void + */ + protected function prepareProducts() + { if (!empty($this->data['products'])) { $productsSelections = $this->data['products']; $this->data['products'] = []; @@ -63,8 +88,8 @@ class BundleSelections implements FixtureInterface $productSelection[$key] = $product; continue; } - list($fixture, $dataSet) = explode('::', $product); - $productSelection[$key] = $fixtureFactory->createByCode($fixture, ['dataSet' => $dataSet]); + list($fixture, $dataset) = explode('::', $product); + $productSelection[$key] = $this->fixtureFactory->createByCode($fixture, ['dataset' => $dataset]); $productSelection[$key]->persist(); $this->data['bundle_options'][$index]['assigned_products'][$key]['search_data']['name'] = $productSelection[$key]->getName(); @@ -73,655 +98,4 @@ class BundleSelections implements FixtureInterface } } } - - /** - * Persist bundle selections 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; - } - - /** - * Preset array - * - * @param string $name - * @return mixed - * @throws \InvalidArgumentException - * - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) - */ - protected function getPreset($name) - { - $presets = [ - 'default_dynamic' => [ - 'bundle_options' => [ - [ - 'title' => 'Drop-down Option', - 'type' => 'Drop-down', - 'required' => 'Yes', - 'assigned_products' => [ - [ - 'search_data' => [ - 'name' => '%product_name%', - ], - 'data' => [ - 'selection_qty' => 1, - ], - ], - [ - 'search_data' => [ - 'name' => '%product_name%', - ], - 'data' => [ - 'selection_qty' => 1, - ] - ], - ], - ], - ], - 'products' => [ - [ - 'catalogProductSimple::default', - 'catalogProductSimple::product_100_dollar', - ], - ], - ], - - 'default_fixed' => [ - 'bundle_options' => [ - [ - 'title' => 'Drop-down Option', - 'type' => 'Drop-down', - 'required' => 'Yes', - 'assigned_products' => [ - [ - 'search_data' => [ - 'name' => '%product_name%', - ], - 'data' => [ - 'selection_price_value' => 5.00, - 'selection_price_type' => 'Fixed', - 'selection_qty' => 1, - ], - ], - [ - 'search_data' => [ - 'name' => '%product_name%', - ], - 'data' => [ - 'selection_price_value' => 6.00, - 'selection_price_type' => 'Fixed', - 'selection_qty' => 1, - ] - ], - ], - ], - ], - 'products' => [ - [ - 'catalogProductSimple::default', - 'catalogProductSimple::product_100_dollar', - ], - ], - ], - - 'fixed_100_dollar' => [ - 'bundle_options' => [ - [ - 'title' => 'Drop-down Option', - 'type' => 'Drop-down', - 'required' => 'Yes', - 'assigned_products' => [ - [ - 'search_data' => [ - 'name' => '%product_name%', - ], - 'data' => [ - 'selection_price_value' => 10.00, - 'selection_price_type' => 'Fixed', - 'selection_qty' => 1, - ], - ], - [ - 'search_data' => [ - 'name' => '%product_name%', - ], - 'data' => [ - 'selection_price_value' => 560.00, - 'selection_price_type' => 'Fixed', - 'selection_qty' => 1, - ] - ], - ], - ], - ], - 'products' => [ - [ - 'catalogProductSimple::product_10_dollar', - 'catalogProductSimple::default', - ], - ], - ], - - 'second' => [ - 'bundle_options' => [ - [ - 'title' => 'Drop-down Option', - 'type' => 'Drop-down', - 'required' => 'Yes', - 'assigned_products' => [ - [ - 'search_data' => [ - 'name' => '%product_name%', - ], - 'data' => [ - 'selection_price_value' => 5.00, - 'selection_price_type' => 'Fixed', - 'selection_qty' => 1, - ], - ], - [ - 'search_data' => [ - 'name' => '%product_name%', - ], - 'data' => [ - 'selection_price_value' => 10.00, - 'selection_price_type' => 'Fixed', - 'selection_qty' => 1, - ] - ], - ], - ], - ], - 'products' => [ - [ - 'catalogProductSimple::default', - 'catalogProductSimple::product_100_dollar', - ], - ], - ], - - 'all_types_fixed' => [ - 'bundle_options' => [ - [ - 'title' => 'Drop-down Option', - 'type' => 'Drop-down', - 'required' => 'Yes', - 'assigned_products' => [ - [ - 'search_data' => [ - 'name' => '%product_name%', - ], - 'data' => [ - 'selection_price_value' => 5.00, - 'selection_price_type' => 'Fixed', - 'selection_qty' => 1, - ], - ], - [ - 'search_data' => [ - 'name' => '%product_name%', - ], - 'data' => [ - 'selection_price_value' => 6.00, - 'selection_price_type' => 'Fixed', - 'selection_qty' => 1, - ] - ], - ], - ], - [ - 'title' => 'Radio Button Option', - 'type' => 'Radio Buttons', - 'required' => 'Yes', - 'assigned_products' => [ - [ - 'search_data' => [ - 'name' => '%product_name%', - ], - 'data' => [ - 'selection_price_value' => 5.00, - 'selection_price_type' => 'Fixed', - 'selection_qty' => 1, - ], - ], - [ - 'search_data' => [ - 'name' => '%product_name%', - ], - 'data' => [ - 'selection_price_value' => 6.00, - 'selection_price_type' => 'Fixed', - 'selection_qty' => 1, - ] - ], - ] - ], - [ - 'title' => 'Checkbox Option', - 'type' => 'Checkbox', - 'required' => 'Yes', - 'assigned_products' => [ - [ - 'search_data' => [ - 'name' => '%product_name%', - ], - 'data' => [ - 'selection_price_value' => 5.00, - 'selection_price_type' => 'Fixed', - 'selection_qty' => 1, - ], - ], - [ - 'search_data' => [ - 'name' => '%product_name%', - ], - 'data' => [ - 'selection_price_value' => 6.00, - 'selection_price_type' => 'Fixed', - 'selection_qty' => 1, - ] - ], - ] - ], - [ - 'title' => 'Multiple Select Option', - 'type' => 'Multiple Select', - 'required' => 'Yes', - 'assigned_products' => [ - [ - 'search_data' => [ - 'name' => '%product_name%', - ], - 'data' => [ - 'selection_price_value' => 5.00, - 'selection_price_type' => 'Fixed', - 'selection_qty' => 1, - ], - ], - [ - 'search_data' => [ - 'name' => '%product_name%', - ], - 'data' => [ - 'selection_price_value' => 6.00, - 'selection_price_type' => 'Fixed', - 'selection_qty' => 1, - ] - ], - ] - ], - ], - 'products' => [ - [ - 'catalogProductSimple::default', - 'catalogProductSimple::product_100_dollar', - ], - [ - 'catalogProductSimple::default', - 'catalogProductSimple::product_100_dollar' - ], - [ - 'catalogProductSimple::default', - 'catalogProductSimple::product_100_dollar' - ], - [ - 'catalogProductSimple::default', - 'catalogProductSimple::product_100_dollar' - ], - ], - ], - - 'all_types_dynamic' => [ - 'bundle_options' => [ - [ - 'title' => 'Drop-down Option', - 'type' => 'Drop-down', - 'required' => 'Yes', - 'assigned_products' => [ - [ - 'search_data' => [ - 'name' => '%product_name%', - ], - 'data' => [ - 'selection_qty' => 1, - ], - ], - [ - 'search_data' => [ - 'name' => '%product_name%', - ], - 'data' => [ - 'selection_qty' => 1, - ] - ], - ], - ], - [ - 'title' => 'Radio Button Option', - 'type' => 'Radio Buttons', - 'required' => 'Yes', - 'assigned_products' => [ - [ - 'search_data' => [ - 'name' => '%product_name%', - ], - 'data' => [ - 'selection_qty' => 1, - ], - ], - [ - 'search_data' => [ - 'name' => '%product_name%', - ], - 'data' => [ - 'selection_qty' => 1, - ] - ], - ] - ], - [ - 'title' => 'Checkbox Option', - 'type' => 'Checkbox', - 'required' => 'Yes', - 'assigned_products' => [ - [ - 'search_data' => [ - 'name' => '%product_name%', - ], - 'data' => [ - 'selection_qty' => 1, - ], - ], - [ - 'search_data' => [ - 'name' => '%product_name%', - ], - 'data' => [ - 'selection_qty' => 1, - ] - ], - ] - ], - [ - 'title' => 'Multiple Select Option', - 'type' => 'Multiple Select', - 'required' => 'Yes', - 'assigned_products' => [ - [ - 'search_data' => [ - 'name' => '%product_name%', - ], - 'data' => [ - 'selection_qty' => 1, - ], - ], - [ - 'search_data' => [ - 'name' => '%product_name%', - ], - 'data' => [ - 'selection_qty' => 1, - ] - ], - ] - ], - ], - 'products' => [ - [ - 'catalogProductSimple::default', - 'catalogProductSimple::product_100_dollar', - ], - [ - 'catalogProductSimple::default', - 'catalogProductSimple::product_100_dollar' - ], - [ - 'catalogProductSimple::default', - 'catalogProductSimple::product_100_dollar' - ], - [ - 'catalogProductSimple::default', - 'catalogProductSimple::product_100_dollar' - ], - ], - ], - - 'with_not_required_options' => [ - 'bundle_options' => [ - [ - 'title' => 'Drop-down Option', - 'type' => 'Drop-down', - 'required' => 'No', - 'assigned_products' => [ - [ - 'search_data' => [ - 'name' => '%product_name%', - ], - 'data' => [ - 'selection_qty' => 1, - 'selection_price_value' => 45, - 'selection_price_type' => 'Fixed', - ], - ], - [ - 'search_data' => [ - 'name' => '%product_name%', - ], - 'data' => [ - 'selection_qty' => 1, - 'selection_price_value' => 43, - 'selection_price_type' => 'Fixed', - ] - ], - ], - ], - [ - 'title' => 'Radio Button Option', - 'type' => 'Radio Buttons', - 'required' => 'No', - 'assigned_products' => [ - [ - 'search_data' => [ - 'name' => '%product_name%', - ], - 'data' => [ - 'selection_qty' => 1, - 'selection_price_value' => 45, - 'selection_price_type' => 'Fixed', - ], - ], - [ - 'search_data' => [ - 'name' => '%product_name%', - ], - 'data' => [ - 'selection_qty' => 1, - 'selection_price_value' => 43, - 'selection_price_type' => 'Fixed', - ] - ], - ] - ], - ], - 'products' => [ - [ - 'catalogProductSimple::default', - 'catalogProductSimple::product_100_dollar', - ], - [ - 'catalogProductSimple::default', - 'catalogProductSimple::product_100_dollar' - ], - ], - ], - - 'two_options_with_fixed_and_percent_prices' => [ - 'bundle_options' => [ - [ - 'title' => 'BundleOption1', - 'type' => 'Drop-down', - 'required' => 'Yes', - 'assigned_products' => [ - [ - 'search_data' => [ - 'name' => '%product_name%', - ], - 'data' => [ - 'selection_price_value' => 10.00, - 'selection_price_type' => 'Fixed', - 'selection_qty' => 1, - ], - ], - [ - 'search_data' => [ - 'name' => '%product_name%', - ], - 'data' => [ - 'selection_price_value' => 20.00, - 'selection_price_type' => 'Percent', - 'selection_qty' => 1, - ] - ], - ], - ], - ], - 'products' => [ - [ - 'catalogProductSimple::product_without_category', - 'catalogProductSimple::product_without_category', - ], - ], - ], - - 'two_options_assigned_products_without_category' => [ - 'bundle_options' => [ - [ - 'title' => 'Drop-down Option', - 'type' => 'Drop-down', - 'required' => 'Yes', - 'assigned_products' => [ - [ - 'search_data' => [ - 'name' => '%product_name%', - ], - 'data' => [ - 'selection_qty' => 1, - ], - ], - [ - 'search_data' => [ - 'name' => '%product_name%', - ], - 'data' => [ - 'selection_qty' => 1, - ] - ], - ], - ], - ], - 'products' => [ - [ - 'catalogProductSimple::product_without_category', - 'catalogProductSimple::product_without_category', - ], - ], - ], - - 'one_options_assigned_simple_big_qty' => [ - 'bundle_options' => [ - [ - 'title' => 'Drop-down Option', - 'type' => 'Drop-down', - 'required' => 'Yes', - 'assigned_products' => [ - [ - 'search_data' => [ - 'name' => '%product_name%', - ], - 'data' => [ - 'selection_qty' => 1, - ], - ], - ], - ], - ], - 'products' => [ - [ - 'catalogProductSimple::simple_big_qty', - ], - ], - ], - - 'required_two_fixed_options' => [ - 'bundle_options' => [ - [ - 'title' => 'Drop-down Option', - 'type' => 'Drop-down', - 'required' => 'Yes', - 'assigned_products' => [ - [ - 'search_data' => [ - 'name' => '%product_name%', - ], - 'data' => [ - 'selection_price_value' => 10.00, - 'selection_price_type' => 'Fixed', - 'selection_qty' => 1, - ], - ], - [ - 'search_data' => [ - 'name' => '%product_name%', - ], - 'data' => [ - 'selection_price_value' => 20.00, - 'selection_price_type' => 'Fixed', - 'selection_qty' => 1, - ] - ], - ], - ], - ], - 'products' => [ - [ - 'catalogProductSimple::simple', - 'catalogProductVirtual::product_15_dollar', - ], - ], - ], - ]; - if (!isset($presets[$name])) { - throw new \InvalidArgumentException( - sprintf('Wrong Bundle Selections preset name: %s', $name) - ); - } - return $presets[$name]; - } } diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/CheckoutData.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/CheckoutData.php deleted file mode 100644 index bff410f211501458091c109e7a8df3cb4e830658..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/CheckoutData.php +++ /dev/null @@ -1,342 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Bundle\Test\Fixture\BundleProduct; - -/** - * Class CheckoutData - * Data for fill product form on frontend - * - * Data keys: - * - preset (Checkout data verification preset name) - * - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) - */ -class CheckoutData extends \Magento\Catalog\Test\Fixture\CatalogProductSimple\CheckoutData -{ - /** - * Get preset array - * - * @param string $name - * @return array|null - */ - protected function getPreset($name) - { - $presets = [ - 'default' => [ - 'options' => [ - 'bundle_options' => [ - [ - 'title' => 'Drop-down Option', - 'type' => 'Drop-down', - 'value' => [ - 'name' => 'product_100_dollar', - ], - ], - ], - ], - ], - 'default_dynamic' => [ - 'options' => [ - 'bundle_options' => [ - [ - 'title' => 'Drop-down Option', - 'type' => 'Drop-down', - 'value' => [ - 'name' => 'product_100_dollar', - ], - ], - ], - ], - 'qty' => 2, - 'cartItem' => [ - 'price' => 100, - 'qty' => 2, - 'subtotal' => 200, - ], - ], - 'default_fixed' => [ - 'options' => [ - 'bundle_options' => [ - [ - 'title' => 'Drop-down Option', - 'type' => 'Drop-down', - 'value' => [ - 'name' => 'product_100_dollar', - ], - ], - ], - ], - 'qty' => 1, - 'cartItem' => [ - 'price' => 756, - 'qty' => 1, - 'subtotal' => 756, - ], - ], - 'fixed_100_dollar' => [ - 'options' => [ - 'bundle_options' => [ - [ - 'title' => 'Drop-down Option', - 'type' => 'Drop-down', - 'value' => [ - 'name' => 'product_10_dollar', - ], - ], - ], - ], - 'qty' => 1, - 'cartItem' => [ - 'price' => 110, - 'qty' => 1, - 'subtotal' => 110, - ], - ], - 'forUpdateMiniShoppingCart' => [ - 'options' => [ - 'bundle_options' => [ - [ - 'title' => 'Drop-down Option', - 'type' => 'Drop-down', - 'value' => [ - 'name' => 'Simple Product', - ], - ], - ], - ], - 'qty' => 1, - 'cartItem' => [ - 'price' => 756, - 'qty' => 1, - 'subtotal' => 756, - ], - ], - 'with_not_required_options' => [ - 'options' => [ - 'bundle_options' => [ - [ - 'title' => 'Drop-down Option', - 'type' => 'Drop-down', - 'value' => [ - 'name' => 'product_100_dollar', - ], - ], - [ - 'title' => 'Radio Button Option', - 'type' => 'Radio Buttons', - 'value' => [ - 'name' => 'product_100_dollar', - ] - ], - ], - ], - ], - 'with_custom_options_1' => [ - 'options' => [ - 'bundle_options' => [ - [ - 'title' => 'Drop-down Option', - 'type' => 'Drop-down', - 'value' => [ - 'name' => 'product_100_dollar', - ], - ], - ], - 'custom_options' => [ - [ - 'title' => 'attribute_key_0', - 'value' => 'option_key_0', - ], - [ - 'title' => 'attribute_key_1', - 'value' => 'option_key_0', - ], - [ - 'title' => 'attribute_key_2', - 'value' => 'Field', - ], - [ - 'title' => 'attribute_key_3', - 'value' => 'Field', - ], - [ - 'title' => 'attribute_key_4', - 'value' => 'Area', - ], - [ - 'title' => 'attribute_key_6', - 'value' => 'option_key_0', - ], - [ - 'title' => 'attribute_key_7', - 'value' => 'option_key_0', - ], - [ - 'title' => 'attribute_key_8', - 'value' => 'option_key_0', - ], - [ - 'title' => 'attribute_key_9', - 'value' => 'option_key_0', - ], - [ - 'title' => 'attribute_key_10', - 'value' => '12/12/2015', - ], - [ - 'title' => 'attribute_key_11', - 'value' => '12/12/2015/12/30/AM', - ], - [ - 'title' => 'attribute_key_12', - 'value' => '12/12/AM', - ], - ], - ], - ], - 'with_custom_options_2' => [ - 'options' => [ - 'bundle_options' => [ - [ - 'title' => 'Drop-down Option', - 'type' => 'Drop-down', - 'value' => [ - 'name' => 'product_100_dollar', - ], - ], - ], - 'custom_options' => [ - [ - 'title' => 'attribute_key_0', - 'value' => 'option_key_0', - ], - ], - ], - ], - 'all_types_bundle_fixed_and_custom_options' => [ - 'options' => [ - 'bundle_options' => [ - [ - 'title' => 'Drop-down Option', - 'type' => 'Drop-down', - 'value' => [ - 'name' => 'product_100_dollar', - ], - ], - [ - 'title' => 'Radio Button Option', - 'type' => 'Radio Buttons', - 'value' => [ - 'name' => 'product_100_dollar', - ] - ], - [ - 'title' => 'Checkbox Option', - 'type' => 'Checkbox', - 'value' => [ - 'name' => 'product_100_dollar', - ] - ], - [ - 'title' => 'Multiple Select Option', - 'type' => 'Multiple', - 'value' => [ - 'name' => 'product_100_dollar', - ] - ], - ], - 'custom_options' => [ - [ - 'title' => 'attribute_key_0', - 'value' => 'Field', - ], - [ - 'title' => 'attribute_key_1', - 'value' => 'Area', - ], - [ - 'title' => 'attribute_key_3', - 'value' => 'option_key_0', - ], - [ - 'title' => 'attribute_key_4', - 'value' => 'option_key_0', - ], - [ - 'title' => 'attribute_key_5', - 'value' => 'option_key_0', - ], - [ - 'title' => 'attribute_key_6', - 'value' => 'option_key_0', - ], - [ - 'title' => 'attribute_key_7', - 'value' => '12/12/2015', - ], - [ - 'title' => 'attribute_key_8', - 'value' => '12/12/2015/12/30/AM', - ], - [ - 'title' => 'attribute_key_9', - 'value' => '12/12/AM', - ], - ], - ], - ], - 'all_types_bundle_options' => [ - 'options' => [ - 'bundle_options' => [ - [ - 'title' => 'Drop-down Option', - 'type' => 'Drop-down', - 'value' => [ - 'name' => 'product_100_dollar', - ], - ], - [ - 'title' => 'Radio Button Option', - 'type' => 'Radio Buttons', - 'value' => [ - 'name' => 'product_100_dollar', - ] - ], - [ - 'title' => 'Checkbox Option', - 'type' => 'Checkbox', - 'value' => [ - 'name' => 'product_100_dollar', - ] - ], - [ - 'title' => 'Multiple Select Option', - 'type' => 'Multiple', - 'value' => [ - 'name' => 'product_100_dollar', - ] - ], - ], - ], - ], - 'required_two_fixed_options' => [ - 'options' => [ - 'bundle_options' => [ - [ - 'title' => 'Drop-down Option', - 'type' => 'Drop-down', - 'value' => [ - 'name' => 'Test simple product', - ], - ], - ], - ], - ], - ]; - return isset($presets[$name]) ? $presets[$name] : null; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/Price.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/Price.php deleted file mode 100644 index c4f0aee1ebebec8092b22ef6e821825495669879..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/Price.php +++ /dev/null @@ -1,214 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Bundle\Test\Fixture\BundleProduct; - -use Magento\Mtf\Fixture\FixtureInterface; - -/** - * Class Price - * Data keys: - * - preset (Price verification preset name) - * - value (Price value) - */ -class Price implements FixtureInterface -{ - /** - * Prepared dataSet data - * - * @var array - */ - protected $data; - - /** - * Data set configuration settings - * - * @var array - */ - protected $params; - - /** - * Current preset - * - * @var string - */ - protected $currentPreset; - - /** - * Constructor - * - * @constructor - * @param array $params - * @param array $data [optional] - */ - public function __construct(array $params, $data = []) - { - $this->params = $params; - $this->data = (!isset($data['value']) && !isset($data['preset'])) ? $data : []; - - $this->data = (isset($data['value']) && $data['value'] != '-') ? $data['value'] : null; - if (isset($data['preset'])) { - $this->currentPreset = $data['preset']; - } - } - - /** - * 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() - { - return $this->params; - } - - /** - * Get preset array - * - * @return array|null - * - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) - */ - public function getPreset() - { - $presets = [ - 'drop_down_with_one_option_fixed_price' => [ - 'price_from' => '115.00', - 'price_to' => '120.00', - 'cart_price' => '145.00', - ], - 'drop_down_with_one_option_percent_price' => [ - 'price_from' => '115.00', - 'price_to' => '120.00', - 'cart_price' => '126.00', - ], - 'MAGETWO-23070' => [ - 'price_from' => '40.00', - 'price_to' => '100.00', - 'cart_price' => '100.00', - ], - 'MAGETWO-23061' => [ - 'price_from' => '32.00', - 'price_to' => '80.00', - 'cart_price' => '80.00', - ], - // Bundle fixed - 'fixed-10' => [ - 'price_from' => '10.00', - 'price_to' => '100.00', - 'cart_price' => '80.00', - ], - 'fixed-15' => [ - 'price_from' => '15.00', - 'price_to' => '16.00', - 'cart_price' => '80.00', - ], - 'fixed-24' => [ - 'price_from' => '96.00', - 'price_to' => '97.00', - 'cart_price' => '244.00', - ], - 'fixed-100' => [ - 'price_from' => '110.00', - 'price_to' => '120.00', - ], - 'fixed-115' => [ - 'price_from' => '317.00', - 'price_to' => '362.00', - 'cart_price' => '317.00', - ], - 'fixed-110' => [ - 'price_from' => '159.00', - 'price_to' => '164.00', - 'cart_price' => '159.00', - ], - 'fixed-756' => [ - 'price_from' => '755.00', - 'price_to' => '756.00', - 'cart_price' => '756.00', - ], - 'default_fixed' => [ - 'compare_price' => [ - 'price_from' => '755.00', - 'price_to' => '756.00', - ], - ], - 'bundle_fixed_with_category' => [ - 'price_from' => '130.00', - 'price_to' => '144.00', - ], - // Bundle dynamic - 'default_dynamic' => [ - 'compare_price' => [ - 'price_from' => '100.00', - 'price_to' => '560.00', - ], - ], - 'dynamic-8' => [ - 'price_from' => '8.00', - 'price_to' => '20.00', - 'cart_price' => '80.00', - ], - 'dynamic-32' => [ - 'price_from' => '32.00', - 'price_to' => '80.00', - 'cart_price' => '80.00', - ], - 'dynamic-40' => [ - 'price_from' => '40.00', - 'price_to' => '100.00', - 'cart_price' => '100.00', - ], - 'dynamic-50' => [ - 'price_from' => '50.00', - ], - 'dynamic-100' => [ - 'price_from' => '100.00', - 'price_to' => '560.00', - 'cart_price' => '100.00', - ], - 'dynamic-200' => [ - 'price_from' => '200.00', - 'price_to' => '500.00', - 'cart_price' => '400.00', - ], - 'dynamic-560' => [ - 'price_from' => '560.00', - ], - 'bundle_dynamic_with_category' => [ - 'price_from' => '100.00', - 'price_to' => '100.00', - ] - ]; - if (!isset($presets[$this->currentPreset])) { - return null; - } - return $presets[$this->currentPreset]; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/Cart/Item.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/Cart/Item.php index 89bab0c1b7e8a5e30e95020d9426b4bd116475db..32afeb9d6a42059668a8a8669b8c566d311c8508 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/Cart/Item.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/Cart/Item.php @@ -10,8 +10,7 @@ use Magento\Bundle\Test\Fixture\BundleProduct; use Magento\Mtf\Fixture\FixtureInterface; /** - * Class Item - * Data for verify cart item block on checkout page + * Data for verify cart item block on checkout page. * * Data keys: * - product (fixture data for verify) @@ -67,37 +66,4 @@ class Item extends \Magento\Catalog\Test\Fixture\Cart\Item $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/Magento/Bundle/Test/Repository/BundleProduct.xml b/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct.xml index 60e602800cc2446fed4d5de29c5d35ced8681cf5..2e920885fa4887a0d4133166a0dc5f7119cefae6 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct.xml +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct.xml @@ -17,7 +17,7 @@ <field name="short_description" xsi:type="string" /> <field name="description" xsi:type="string"/> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="sku_type" xsi:type="string">0</field> <field name="price_type" xsi:type="string">0</field> @@ -41,7 +41,7 @@ <field name="short_description" xsi:type="string" /> <field name="description" xsi:type="string" /> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="sku_type" xsi:type="string">0</field> <field name="weight_type" xsi:type="string">0</field> @@ -60,8 +60,7 @@ <field name="sku_type" xsi:type="string">Dynamic</field> <field name="price_type" xsi:type="string">Dynamic</field> <field name="price" xsi:type="array"> - <item name="value" xsi:type="string">-</item> - <item name="preset" xsi:type="string">default_dynamic</item> + <item name="dataset" xsi:type="string">default_dynamic</item> </field> <field name="quantity_and_stock_status" xsi:type="array"> <item name="qty" xsi:type="string">666</item> @@ -70,7 +69,7 @@ <field name="weight_type" xsi:type="string">Dynamic</field> <field name="shipment_type" xsi:type="string">Separately</field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="website_ids" xsi:type="array"> <item name="0" xsi:type="string">Main Website</item> @@ -84,11 +83,11 @@ <field name="url_key" xsi:type="string">bundle-dynamic-product-%isolation%</field> <field name="visibility" xsi:type="string">Catalog, Search</field> <field name="bundle_selections" xsi:type="array"> - <item name="preset" xsi:type="string">default_dynamic</item> + <item name="dataset" xsi:type="string">default_dynamic</item> </field> <field name="attribute_set_id" xsi:type="string">Default</field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">default_dynamic</item> + <item name="dataset" xsi:type="string">bundle_default_dynamic</item> </field> </dataset> @@ -99,10 +98,10 @@ <field name="price_type" xsi:type="string">Fixed</field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">750</item> - <item name="preset" xsi:type="string">default_fixed</item> + <item name="dataset" xsi:type="string">default_fixed</item> </field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="quantity_and_stock_status" xsi:type="array"> <item name="qty" xsi:type="string">666</item> @@ -124,11 +123,11 @@ <field name="url_key" xsi:type="string">bundle-fixed-product-%isolation%</field> <field name="visibility" xsi:type="string">Catalog, Search</field> <field name="bundle_selections" xsi:type="array"> - <item name="preset" xsi:type="string">default_fixed</item> + <item name="dataset" xsi:type="string">default_fixed</item> </field> <field name="attribute_set_id" xsi:type="string">Default</field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">default_fixed</item> + <item name="dataset" xsi:type="string">bundle_default_fixed</item> </field> </dataset> @@ -142,7 +141,7 @@ <item name="value" xsi:type="string">100</item> </field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="weight" xsi:type="string">1</field> <field name="weight_type" xsi:type="string">Fixed</field> @@ -150,10 +149,10 @@ <item name="0" xsi:type="string">Main Website</item> </field> <field name="category_ids" xsi:type="array"> - <item name="presets" xsi:type="string">default_subcategory</item> + <item name="dataset" xsi:type="string">default_subcategory</item> </field> <field name="bundle_selections" xsi:type="array"> - <item name="preset" xsi:type="string">two_options_with_fixed_and_percent_prices</item> + <item name="dataset" xsi:type="string">two_options_with_fixed_and_percent_prices</item> </field> </dataset> @@ -164,17 +163,16 @@ <field name="sku_type" xsi:type="string">Dynamic</field> <field name="price_type" xsi:type="string">Dynamic</field> <field name="price" xsi:type="array"> - <item name="value" xsi:type="string">-</item> - <item name="preset" xsi:type="string">bundle_dynamic_with_category</item> + <item name="dataset" xsi:type="string">bundle_dynamic_with_category</item> </field> <field name="website_ids" xsi:type="array"> <item name="0" xsi:type="string">Main Website</item> </field> <field name="category_ids" xsi:type="array"> - <item name="presets" xsi:type="string">default_subcategory</item> + <item name="dataset" xsi:type="string">default_subcategory</item> </field> <field name="bundle_selections" xsi:type="array"> - <item name="preset" xsi:type="string">two_options_assigned_products_without_category</item> + <item name="dataset" xsi:type="string">two_options_assigned_products_without_category</item> </field> </dataset> @@ -188,7 +186,7 @@ <item name="value" xsi:type="string">100</item> </field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="weight" xsi:type="string">1</field> <field name="weight_type" xsi:type="string">Fixed</field> @@ -197,10 +195,10 @@ </field> <field name="shipment_type" xsi:type="string">Separately</field> <field name="bundle_selections" xsi:type="array"> - <item name="preset" xsi:type="string">required_two_fixed_options</item> + <item name="dataset" xsi:type="string">required_two_fixed_options</item> </field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">required_two_fixed_options</item> + <item name="dataset" xsi:type="string">bundle_required_two_fixed_options</item> </field> </dataset> @@ -211,10 +209,10 @@ <field name="price_type" xsi:type="string">Fixed</field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">100</item> - <item name="preset" xsi:type="string">fixed_100_dollar</item> + <item name="dataset" xsi:type="string">fixed_100_dollar</item> </field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="quantity_and_stock_status" xsi:type="array"> <item name="qty" xsi:type="string">666</item> @@ -236,11 +234,11 @@ <field name="url_key" xsi:type="string">bundle-fixed-product-%isolation%</field> <field name="visibility" xsi:type="string">Catalog, Search</field> <field name="bundle_selections" xsi:type="array"> - <item name="preset" xsi:type="string">fixed_100_dollar</item> + <item name="dataset" xsi:type="string">fixed_100_dollar</item> </field> <field name="attribute_set_id" xsi:type="string">Default</field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">fixed_100_dollar</item> + <item name="dataset" xsi:type="string">bundle_fixed_100_dollar</item> </field> </dataset> </repository> diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct/BundleSelections.xml b/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct/BundleSelections.xml new file mode 100644 index 0000000000000000000000000000000000000000..5b636708193323c1e8942e7da774d6cfa341f12e --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct/BundleSelections.xml @@ -0,0 +1,608 @@ +<?xml version="1.0" ?> +<!-- +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> + <repository class="Magento\Bundle\Test\Repository\BundleProduct\BundleSelection"> + <dataset name="default_dynamic"> + <field name="bundle_options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">Drop-down Option</item> + <item name="type" xsi:type="string">Drop-down</item> + <item name="required" xsi:type="string">Yes</item> + <item name="assigned_products" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="search_data" xsi:type="array"> + <item name="name" xsi:type="string">%product_name%</item> + </item> + <item name="data" xsi:type="array"> + <item name="selection_qty" xsi:type="string">1</item> + </item> + </item> + <item name="1" xsi:type="array"> + <item name="search_data" xsi:type="array"> + <item name="name" xsi:type="string">%product_name%</item> + </item> + <item name="data" xsi:type="array"> + <item name="selection_qty" xsi:type="string">1</item> + </item> + </item> + </item> + </item> + </field> + <field name="products" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="0" xsi:type="string">catalogProductSimple::default</item> + <item name="1" xsi:type="string">catalogProductSimple::product_100_dollar</item> + </item> + </field> + </dataset> + + <dataset name="default_fixed"> + <field name="bundle_options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">Drop-down Option</item> + <item name="type" xsi:type="string">Drop-down</item> + <item name="required" xsi:type="string">Yes</item> + <item name="assigned_products" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="search_data" xsi:type="array"> + <item name="name" xsi:type="string">%product_name%</item> + </item> + <item name="data" xsi:type="array"> + <item name="selection_price_value" xsi:type="string">5.00</item> + <item name="selection_price_type" xsi:type="string">Fixed</item> + <item name="selection_qty" xsi:type="string">1</item> + </item> + </item> + <item name="1" xsi:type="array"> + <item name="search_data" xsi:type="array"> + <item name="name" xsi:type="string">%product_name%</item> + </item> + <item name="data" xsi:type="array"> + <item name="selection_price_value" xsi:type="string">6.00</item> + <item name="selection_price_type" xsi:type="string">Fixed</item> + <item name="selection_qty" xsi:type="string">1</item> + </item> + </item> + </item> + </item> + </field> + <field name="products" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="0" xsi:type="string">catalogProductSimple::default</item> + <item name="1" xsi:type="string">catalogProductSimple::product_100_dollar</item> + </item> + </field> + </dataset> + + <dataset name="fixed_100_dollar"> + <field name="bundle_options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">Drop-down Option</item> + <item name="type" xsi:type="string">Drop-down</item> + <item name="required" xsi:type="string">Yes</item> + <item name="assigned_products" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="search_data" xsi:type="array"> + <item name="name" xsi:type="string">%product_name%</item> + </item> + <item name="data" xsi:type="array"> + <item name="selection_price_value" xsi:type="string">10.00</item> + <item name="selection_price_type" xsi:type="string">Fixed</item> + <item name="selection_qty" xsi:type="string">1</item> + </item> + </item> + <item name="1" xsi:type="array"> + <item name="search_data" xsi:type="array"> + <item name="name" xsi:type="string">%product_name%</item> + </item> + <item name="data" xsi:type="array"> + <item name="selection_price_value" xsi:type="string">560.00</item> + <item name="selection_price_type" xsi:type="string">Fixed</item> + <item name="selection_qty" xsi:type="string">1</item> + </item> + </item> + </item> + </item> + </field> + <field name="products" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="0" xsi:type="string">catalogProductSimple::product_10_dollar</item> + <item name="1" xsi:type="string">catalogProductSimple::default</item> + </item> + </field> + </dataset> + + <dataset name="second"> + <field name="bundle_options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">Drop-down Option</item> + <item name="type" xsi:type="string">Drop-down</item> + <item name="required" xsi:type="string">Yes</item> + <item name="assigned_products" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="search_data" xsi:type="array"> + <item name="name" xsi:type="string">%product_name%</item> + </item> + <item name="data" xsi:type="array"> + <item name="selection_price_value" xsi:type="string">5.00</item> + <item name="selection_price_type" xsi:type="string">Fixed</item> + <item name="selection_qty" xsi:type="string">1</item> + </item> + </item> + <item name="1" xsi:type="array"> + <item name="search_data" xsi:type="array"> + <item name="name" xsi:type="string">%product_name%</item> + </item> + <item name="data" xsi:type="array"> + <item name="selection_price_value" xsi:type="string">10.00</item> + <item name="selection_price_type" xsi:type="string">Fixed</item> + <item name="selection_qty" xsi:type="string">1</item> + </item> + </item> + </item> + </item> + </field> + <field name="products" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="0" xsi:type="string">catalogProductSimple::default</item> + <item name="1" xsi:type="string">catalogProductSimple::product_100_dollar</item> + </item> + </field> + </dataset> + + <dataset name="all_types_fixed"> + <field name="bundle_options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">Drop-down Option</item> + <item name="type" xsi:type="string">Drop-down</item> + <item name="required" xsi:type="string">Yes</item> + <item name="assigned_products" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="search_data" xsi:type="array"> + <item name="name" xsi:type="string">%product_name%</item> + </item> + <item name="data" xsi:type="array"> + <item name="selection_price_value" xsi:type="string">5.00</item> + <item name="selection_price_type" xsi:type="string">Fixed</item> + <item name="selection_qty" xsi:type="string">1</item> + </item> + </item> + <item name="1" xsi:type="array"> + <item name="search_data" xsi:type="array"> + <item name="name" xsi:type="string">%product_name%</item> + </item> + <item name="data" xsi:type="array"> + <item name="selection_price_value" xsi:type="string">6.00</item> + <item name="selection_price_type" xsi:type="string">Fixed</item> + <item name="selection_qty" xsi:type="string">1</item> + </item> + </item> + </item> + </item> + <item name="1" xsi:type="array"> + <item name="title" xsi:type="string">Radio Button Option</item> + <item name="type" xsi:type="string">Radio Buttons</item> + <item name="required" xsi:type="string">Yes</item> + <item name="assigned_products" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="search_data" xsi:type="array"> + <item name="name" xsi:type="string">%product_name%</item> + </item> + <item name="data" xsi:type="array"> + <item name="selection_price_value" xsi:type="string">5.00</item> + <item name="selection_price_type" xsi:type="string">Fixed</item> + <item name="selection_qty" xsi:type="string">1</item> + </item> + </item> + <item name="1" xsi:type="array"> + <item name="search_data" xsi:type="array"> + <item name="name" xsi:type="string">%product_name%</item> + </item> + <item name="data" xsi:type="array"> + <item name="selection_price_value" xsi:type="string">6.00</item> + <item name="selection_price_type" xsi:type="string">Fixed</item> + <item name="selection_qty" xsi:type="string">1</item> + </item> + </item> + </item> + </item> + <item name="2" xsi:type="array"> + <item name="title" xsi:type="string">Checkbox Option</item> + <item name="type" xsi:type="string">Checkbox</item> + <item name="required" xsi:type="string">Yes</item> + <item name="assigned_products" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="search_data" xsi:type="array"> + <item name="name" xsi:type="string">%product_name%</item> + </item> + <item name="data" xsi:type="array"> + <item name="selection_price_value" xsi:type="string">5.00</item> + <item name="selection_price_type" xsi:type="string">Fixed</item> + <item name="selection_qty" xsi:type="string">1</item> + </item> + </item> + <item name="1" xsi:type="array"> + <item name="search_data" xsi:type="array"> + <item name="name" xsi:type="string">%product_name%</item> + </item> + <item name="data" xsi:type="array"> + <item name="selection_price_value" xsi:type="string">6.00</item> + <item name="selection_price_type" xsi:type="string">Fixed</item> + <item name="selection_qty" xsi:type="string">1</item> + </item> + </item> + </item> + </item> + <item name="3" xsi:type="array"> + <item name="title" xsi:type="string">Multiple Select Option</item> + <item name="type" xsi:type="string">Multiple Select</item> + <item name="required" xsi:type="string">Yes</item> + <item name="assigned_products" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="search_data" xsi:type="array"> + <item name="name" xsi:type="string">%product_name%</item> + </item> + <item name="data" xsi:type="array"> + <item name="selection_price_value" xsi:type="string">5.00</item> + <item name="selection_price_type" xsi:type="string">Fixed</item> + <item name="selection_qty" xsi:type="string">1</item> + </item> + </item> + <item name="1" xsi:type="array"> + <item name="search_data" xsi:type="array"> + <item name="name" xsi:type="string">%product_name%</item> + </item> + <item name="data" xsi:type="array"> + <item name="selection_price_value" xsi:type="string">6.00</item> + <item name="selection_price_type" xsi:type="string">Fixed</item> + <item name="selection_qty" xsi:type="string">1</item> + </item> + </item> + </item> + </item> + </field> + <field name="products" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="0" xsi:type="string">catalogProductSimple::default</item> + <item name="1" xsi:type="string">catalogProductSimple::product_100_dollar</item> + </item> + <item name="1" xsi:type="array"> + <item name="0" xsi:type="string">catalogProductSimple::default</item> + <item name="1" xsi:type="string">catalogProductSimple::product_100_dollar</item> + </item> + <item name="2" xsi:type="array"> + <item name="0" xsi:type="string">catalogProductSimple::default</item> + <item name="1" xsi:type="string">catalogProductSimple::product_100_dollar</item> + </item> + <item name="3" xsi:type="array"> + <item name="0" xsi:type="string">catalogProductSimple::default</item> + <item name="1" xsi:type="string">catalogProductSimple::product_100_dollar</item> + </item> + </field> + </dataset> + + <dataset name="all_types_dynamic"> + <field name="bundle_options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">Drop-down Option</item> + <item name="type" xsi:type="string">Drop-down</item> + <item name="required" xsi:type="string">Yes</item> + <item name="assigned_products" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="search_data" xsi:type="array"> + <item name="name" xsi:type="string">%product_name%</item> + </item> + <item name="data" xsi:type="array"> + <item name="selection_qty" xsi:type="string">1</item> + </item> + </item> + <item name="1" xsi:type="array"> + <item name="search_data" xsi:type="array"> + <item name="name" xsi:type="string">%product_name%</item> + </item> + <item name="data" xsi:type="array"> + <item name="selection_qty" xsi:type="string">1</item> + </item> + </item> + </item> + </item> + <item name="1" xsi:type="array"> + <item name="title" xsi:type="string">Radio Button Option</item> + <item name="type" xsi:type="string">Radio Buttons</item> + <item name="required" xsi:type="string">Yes</item> + <item name="assigned_products" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="search_data" xsi:type="array"> + <item name="name" xsi:type="string">%product_name%</item> + </item> + <item name="data" xsi:type="array"> + <item name="selection_qty" xsi:type="string">1</item> + </item> + </item> + <item name="1" xsi:type="array"> + <item name="search_data" xsi:type="array"> + <item name="name" xsi:type="string">%product_name%</item> + </item> + <item name="data" xsi:type="array"> + <item name="selection_qty" xsi:type="string">1</item> + </item> + </item> + </item> + </item> + <item name="2" xsi:type="array"> + <item name="title" xsi:type="string">Checkbox Option</item> + <item name="type" xsi:type="string">Checkbox</item> + <item name="required" xsi:type="string">Yes</item> + <item name="assigned_products" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="search_data" xsi:type="array"> + <item name="name" xsi:type="string">%product_name%</item> + </item> + <item name="data" xsi:type="array"> + <item name="selection_qty" xsi:type="string">1</item> + </item> + </item> + <item name="1" xsi:type="array"> + <item name="search_data" xsi:type="array"> + <item name="name" xsi:type="string">%product_name%</item> + </item> + <item name="data" xsi:type="array"> + <item name="selection_qty" xsi:type="string">1</item> + </item> + </item> + </item> + </item> + <item name="3" xsi:type="array"> + <item name="title" xsi:type="string">Multiple Select Option</item> + <item name="type" xsi:type="string">Multiple Select</item> + <item name="required" xsi:type="string">Yes</item> + <item name="assigned_products" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="search_data" xsi:type="array"> + <item name="name" xsi:type="string">%product_name%</item> + </item> + <item name="data" xsi:type="array"> + <item name="selection_qty" xsi:type="string">1</item> + </item> + </item> + <item name="1" xsi:type="array"> + <item name="search_data" xsi:type="array"> + <item name="name" xsi:type="string">%product_name%</item> + </item> + <item name="data" xsi:type="array"> + <item name="selection_qty" xsi:type="string">1</item> + </item> + </item> + </item> + </item> + </field> + <field name="products" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="0" xsi:type="string">catalogProductSimple::default</item> + <item name="1" xsi:type="string">catalogProductSimple::product_100_dollar</item> + </item> + <item name="1" xsi:type="array"> + <item name="0" xsi:type="string">catalogProductSimple::default</item> + <item name="1" xsi:type="string">catalogProductSimple::product_100_dollar</item> + </item> + <item name="2" xsi:type="array"> + <item name="0" xsi:type="string">catalogProductSimple::default</item> + <item name="1" xsi:type="string">catalogProductSimple::product_100_dollar</item> + </item> + <item name="3" xsi:type="array"> + <item name="0" xsi:type="string">catalogProductSimple::default</item> + <item name="1" xsi:type="string">catalogProductSimple::product_100_dollar</item> + </item> + </field> + </dataset> + + <dataset name="with_not_required_options"> + <field name="bundle_options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">Drop-down Option</item> + <item name="type" xsi:type="string">Drop-down</item> + <item name="required" xsi:type="string">No</item> + <item name="assigned_products" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="search_data" xsi:type="array"> + <item name="name" xsi:type="string">%product_name%</item> + </item> + <item name="data" xsi:type="array"> + <item name="selection_qty" xsi:type="string">1</item> + <item name="selection_price_value" xsi:type="string">45</item> + <item name="selection_price_type" xsi:type="string">Fixed</item> + </item> + </item> + <item name="1" xsi:type="array"> + <item name="search_data" xsi:type="array"> + <item name="name" xsi:type="string">%product_name%</item> + </item> + <item name="data" xsi:type="array"> + <item name="selection_qty" xsi:type="string">1</item> + <item name="selection_price_value" xsi:type="string">43</item> + <item name="selection_price_type" xsi:type="string">Fixed</item> + </item> + </item> + </item> + </item> + <item name="1" xsi:type="array"> + <item name="title" xsi:type="string">Radio Button Option</item> + <item name="type" xsi:type="string">Radio Buttons</item> + <item name="required" xsi:type="string">No</item> + <item name="assigned_products" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="search_data" xsi:type="array"> + <item name="name" xsi:type="string">%product_name%</item> + </item> + <item name="data" xsi:type="array"> + <item name="selection_qty" xsi:type="string">1</item> + <item name="selection_price_value" xsi:type="string">45</item> + <item name="selection_price_type" xsi:type="string">Fixed</item> + </item> + </item> + <item name="1" xsi:type="array"> + <item name="search_data" xsi:type="array"> + <item name="name" xsi:type="string">%product_name%</item> + </item> + <item name="data" xsi:type="array"> + <item name="selection_qty" xsi:type="string">1</item> + <item name="selection_price_value" xsi:type="string">43</item> + <item name="selection_price_type" xsi:type="string">Fixed</item> + </item> + </item> + </item> + </item> + </field> + <field name="products" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="0" xsi:type="string">catalogProductSimple::default</item> + <item name="1" xsi:type="string">catalogProductSimple::product_100_dollar</item> + </item> + <item name="1" xsi:type="array"> + <item name="0" xsi:type="string">catalogProductSimple::default</item> + <item name="1" xsi:type="string">catalogProductSimple::product_100_dollar</item> + </item> + </field> + </dataset> + + <dataset name="two_options_with_fixed_and_percent_prices"> + <field name="bundle_options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">Drop-down Option</item> + <item name="type" xsi:type="string">Drop-down</item> + <item name="required" xsi:type="string">Yes</item> + <item name="assigned_products" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="search_data" xsi:type="array"> + <item name="name" xsi:type="string">%product_name%</item> + </item> + <item name="data" xsi:type="array"> + <item name="selection_qty" xsi:type="string">1</item> + <item name="selection_price_value" xsi:type="string">10.00</item> + <item name="selection_price_type" xsi:type="string">Fixed</item> + </item> + </item> + <item name="1" xsi:type="array"> + <item name="search_data" xsi:type="array"> + <item name="name" xsi:type="string">%product_name%</item> + </item> + <item name="data" xsi:type="array"> + <item name="selection_qty" xsi:type="string">1</item> + <item name="selection_price_value" xsi:type="string">20.00</item> + <item name="selection_price_type" xsi:type="string">Percent</item> + </item> + </item> + </item> + </item> + </field> + <field name="products" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="0" xsi:type="string">catalogProductSimple::product_without_category</item> + <item name="1" xsi:type="string">catalogProductSimple::product_without_category</item> + </item> + </field> + </dataset> + + <dataset name="two_options_assigned_products_without_category"> + <field name="bundle_options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">Drop-down Option</item> + <item name="type" xsi:type="string">Drop-down</item> + <item name="required" xsi:type="string">Yes</item> + <item name="assigned_products" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="search_data" xsi:type="array"> + <item name="name" xsi:type="string">%product_name%</item> + </item> + <item name="data" xsi:type="array"> + <item name="selection_qty" xsi:type="string">1</item> + </item> + </item> + <item name="1" xsi:type="array"> + <item name="search_data" xsi:type="array"> + <item name="name" xsi:type="string">%product_name%</item> + </item> + <item name="data" xsi:type="array"> + <item name="selection_qty" xsi:type="string">1</item> + </item> + </item> + </item> + </item> + </field> + <field name="products" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="0" xsi:type="string">catalogProductSimple::product_without_category</item> + <item name="1" xsi:type="string">catalogProductSimple::product_without_category</item> + </item> + </field> + </dataset> + + <dataset name="one_options_assigned_simple_big_qty"> + <field name="bundle_options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">Drop-down Option</item> + <item name="type" xsi:type="string">Drop-down</item> + <item name="required" xsi:type="string">Yes</item> + <item name="assigned_products" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="search_data" xsi:type="array"> + <item name="name" xsi:type="string">%product_name%</item> + </item> + <item name="data" xsi:type="array"> + <item name="selection_qty" xsi:type="string">1</item> + </item> + </item> + </item> + </item> + </field> + <field name="products" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="0" xsi:type="string">catalogProductSimple::simple_big_qty</item> + </item> + </field> + </dataset> + + <dataset name="required_two_fixed_options"> + <field name="bundle_options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">Drop-down Option</item> + <item name="type" xsi:type="string">Drop-down</item> + <item name="required" xsi:type="string">Yes</item> + <item name="assigned_products" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="search_data" xsi:type="array"> + <item name="name" xsi:type="string">%product_name%</item> + </item> + <item name="data" xsi:type="array"> + <item name="selection_price_value" xsi:type="string">10.00</item> + <item name="selection_price_type" xsi:type="string">Fixed</item> + <item name="selection_qty" xsi:type="string">1</item> + </item> + </item> + <item name="1" xsi:type="array"> + <item name="search_data" xsi:type="array"> + <item name="name" xsi:type="string">%product_name%</item> + </item> + <item name="data" xsi:type="array"> + <item name="selection_price_value" xsi:type="string">20.00</item> + <item name="selection_price_type" xsi:type="string">Fixed</item> + <item name="selection_qty" xsi:type="string">1</item> + </item> + </item> + </item> + </item> + </field> + <field name="products" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="0" xsi:type="string">catalogProductSimple::simple</item> + <item name="1" xsi:type="string">catalogProductSimple::product_15_dollar</item> + </item> + </field> + </dataset> + </repository> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct/CheckoutData.xml b/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct/CheckoutData.xml new file mode 100644 index 0000000000000000000000000000000000000000..7b9551aeae7c06b05a2c79c3282d2986ae5fefb2 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct/CheckoutData.xml @@ -0,0 +1,331 @@ +<?xml version="1.0" ?> +<!-- +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> + <repository class="Magento\Bundle\Test\Repository\BundleProduct\CheckoutData"> + <dataset name="bundle_default"> + <field name="options" xsi:type="array"> + <item name="bundle_options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">Drop-down Option</item> + <item name="type" xsi:type="string">Drop-down</item> + <item name="value" xsi:type="array"> + <item name="name" xsi:type="string">product_100_dollar</item> + </item> + </item> + </item> + </field> + </dataset> + + <dataset name="bundle_default_dynamic"> + <field name="options" xsi:type="array"> + <item name="bundle_options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">Drop-down Option</item> + <item name="type" xsi:type="string">Drop-down</item> + <item name="value" xsi:type="array"> + <item name="name" xsi:type="string">product_100_dollar</item> + </item> + </item> + </item> + </field> + <field name="qty" xsi:type="string">2</field> + <field name="cartItem" xsi:type="array"> + <item name="price" xsi:type="string">100</item> + <item name="qty" xsi:type="string">2</item> + <item name="subtotal" xsi:type="string">200</item> + </field> + </dataset> + + <dataset name="bundle_default_fixed"> + <field name="options" xsi:type="array"> + <item name="bundle_options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">Drop-down Option</item> + <item name="type" xsi:type="string">Drop-down</item> + <item name="value" xsi:type="array"> + <item name="name" xsi:type="string">product_100_dollar</item> + </item> + </item> + </item> + </field> + <field name="qty" xsi:type="string">1</field> + <field name="cartItem" xsi:type="array"> + <item name="price" xsi:type="string">756</item> + <item name="qty" xsi:type="string">1</item> + <item name="subtotal" xsi:type="string">756</item> + </field> + </dataset> + + <dataset name="bundle_fixed_100_dollar"> + <field name="options" xsi:type="array"> + <item name="bundle_options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">Drop-down Option</item> + <item name="type" xsi:type="string">Drop-down</item> + <item name="value" xsi:type="array"> + <item name="name" xsi:type="string">product_10_dollar</item> + </item> + </item> + </item> + </field> + <field name="qty" xsi:type="string">1</field> + <field name="cartItem" xsi:type="array"> + <item name="price" xsi:type="string">110</item> + <item name="qty" xsi:type="string">1</item> + <item name="subtotal" xsi:type="string">110</item> + </field> + </dataset> + + <dataset name="bundle_update_mini_shopping_cart"> + <field name="options" xsi:type="array"> + <item name="bundle_options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">Drop-down Option</item> + <item name="type" xsi:type="string">Drop-down</item> + <item name="value" xsi:type="array"> + <item name="name" xsi:type="string">Simple Product</item> + </item> + </item> + </item> + </field> + <field name="qty" xsi:type="string">1</field> + <field name="cartItem" xsi:type="array"> + <item name="price" xsi:type="string">756</item> + <item name="qty" xsi:type="string">1</item> + <item name="subtotal" xsi:type="string">756</item> + </field> + </dataset> + + <dataset name="bundle_with_not_required_options"> + <field name="options" xsi:type="array"> + <item name="bundle_options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">Drop-down Option</item> + <item name="type" xsi:type="string">Drop-down</item> + <item name="value" xsi:type="array"> + <item name="name" xsi:type="string">product_100_dollar</item> + </item> + </item> + <item name="1" xsi:type="array"> + <item name="title" xsi:type="string">Radio Button Option</item> + <item name="type" xsi:type="string">Radio Buttons</item> + <item name="value" xsi:type="array"> + <item name="name" xsi:type="string">product_100_dollar</item> + </item> + </item> + </item> + </field> + </dataset> + + <dataset name="bundle_with_custom_options_1"> + <field name="options" xsi:type="array"> + <item name="bundle_options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">Drop-down Option</item> + <item name="type" xsi:type="string">Drop-down</item> + <item name="value" xsi:type="array"> + <item name="name" xsi:type="string">product_100_dollar</item> + </item> + </item> + </item> + <item name="custom_options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_0</item> + <item name="value" xsi:type="string">option_key_0</item> + </item> + <item name="1" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_1</item> + <item name="value" xsi:type="string">option_key_0</item> + </item> + <item name="2" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_2</item> + <item name="value" xsi:type="string">Field</item> + </item> + <item name="3" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_3</item> + <item name="value" xsi:type="string">Field</item> + </item> + <item name="4" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_4</item> + <item name="value" xsi:type="string">Area</item> + </item> + <item name="5" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_6</item> + <item name="value" xsi:type="string">option_key_0</item> + </item> + <item name="6" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_7</item> + <item name="value" xsi:type="string">option_key_0</item> + </item> + <item name="7" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_8</item> + <item name="value" xsi:type="string">option_key_0</item> + </item> + <item name="8" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_9</item> + <item name="value" xsi:type="string">option_key_0</item> + </item> + <item name="9" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_10</item> + <item name="value" xsi:type="string">12/12/2015</item> + </item> + <item name="10" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_11</item> + <item name="value" xsi:type="string">12/12/2015/12/30/AM</item> + </item> + <item name="11" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_12</item> + <item name="value" xsi:type="string">12/12/AM</item> + </item> + </item> + </field> + </dataset> + + <dataset name="bundle_with_custom_options_2"> + <field name="options" xsi:type="array"> + <item name="bundle_options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">Drop-down Option</item> + <item name="type" xsi:type="string">Drop-down</item> + <item name="value" xsi:type="array"> + <item name="name" xsi:type="string">product_100_dollar</item> + </item> + </item> + </item> + <item name="custom_options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_0</item> + <item name="value" xsi:type="string">option_key_0</item> + </item> + </item> + </field> + </dataset> + + <dataset name="bundle_all_types_bundle_fixed_and_custom_options"> + <field name="options" xsi:type="array"> + <item name="bundle_options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">Drop-down Option</item> + <item name="type" xsi:type="string">Drop-down</item> + <item name="value" xsi:type="array"> + <item name="name" xsi:type="string">product_100_dollar</item> + </item> + </item> + <item name="1" xsi:type="array"> + <item name="title" xsi:type="string">Radio Button Option</item> + <item name="type" xsi:type="string">Radio Buttons</item> + <item name="value" xsi:type="array"> + <item name="name" xsi:type="string">product_100_dollar</item> + </item> + </item> + <item name="2" xsi:type="array"> + <item name="title" xsi:type="string">Checkbox Option</item> + <item name="type" xsi:type="string">Checkbox</item> + <item name="value" xsi:type="array"> + <item name="name" xsi:type="string">product_100_dollar</item> + </item> + </item> + <item name="3" xsi:type="array"> + <item name="title" xsi:type="string">Multiple Select Option</item> + <item name="type" xsi:type="string">Multiple</item> + <item name="value" xsi:type="array"> + <item name="name" xsi:type="string">product_100_dollar</item> + </item> + </item> + </item> + <item name="custom_options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_0</item> + <item name="value" xsi:type="string">Field</item> + </item> + <item name="1" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_1</item> + <item name="value" xsi:type="string">Area</item> + </item> + <item name="3" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_3</item> + <item name="value" xsi:type="string">option_key_0</item> + </item> + <item name="4" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_4</item> + <item name="value" xsi:type="string">option_key_0</item> + </item> + <item name="5" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_5</item> + <item name="value" xsi:type="string">option_key_0</item> + </item> + <item name="6" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_6</item> + <item name="value" xsi:type="string">option_key_0</item> + </item> + <item name="7" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_7</item> + <item name="value" xsi:type="string">12/12/2015</item> + </item> + <item name="8" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_8</item> + <item name="value" xsi:type="string">12/12/2015/12/30/AM</item> + </item> + <item name="9" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_9</item> + <item name="value" xsi:type="string">12/12/AM</item> + </item> + </item> + </field> + </dataset> + + <dataset name="bundle_all_types_bundle_options"> + <field name="options" xsi:type="array"> + <item name="bundle_options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">Drop-down Option</item> + <item name="type" xsi:type="string">Drop-down</item> + <item name="value" xsi:type="array"> + <item name="name" xsi:type="string">product_100_dollar</item> + </item> + </item> + <item name="1" xsi:type="array"> + <item name="title" xsi:type="string">Radio Button Option</item> + <item name="type" xsi:type="string">Radio Buttons</item> + <item name="value" xsi:type="array"> + <item name="name" xsi:type="string">product_100_dollar</item> + </item> + </item> + <item name="2" xsi:type="array"> + <item name="title" xsi:type="string">Checkbox Option</item> + <item name="type" xsi:type="string">Checkbox</item> + <item name="value" xsi:type="array"> + <item name="name" xsi:type="string">product_100_dollar</item> + </item> + </item> + <item name="3" xsi:type="array"> + <item name="title" xsi:type="string">Multiple Select Option</item> + <item name="type" xsi:type="string">Multiple</item> + <item name="value" xsi:type="array"> + <item name="name" xsi:type="string">product_100_dollar</item> + </item> + </item> + </item> + </field> + </dataset> + + <dataset name="bundle_required_two_fixed_options"> + <field name="options" xsi:type="array"> + <item name="bundle_options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">Drop-down Option</item> + <item name="type" xsi:type="string">Drop-down</item> + <item name="value" xsi:type="array"> + <item name="name" xsi:type="string">Test simple product</item> + </item> + </item> + </item> + </field> + </dataset> + </repository> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct/Price.xml b/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct/Price.xml new file mode 100644 index 0000000000000000000000000000000000000000..99871d62cd2cb588bb8a05dab27949853e1e8c8d --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct/Price.xml @@ -0,0 +1,137 @@ +<?xml version="1.0" ?> +<!-- +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> + <repository class="Magento\Bundle\Test\Repository\BundleProduct\Price"> + <dataset name="default_fixed"> + <field name="compare_price" xsi:type="array"> + <item name="price_from" xsi:type="string">755.00</item> + <item name="price_to" xsi:type="string">756.00</item> + </field> + </dataset> + + <dataset name="drop_down_with_one_option_fixed_price-100"> + <field name="price_from" xsi:type="string">115.00</field> + <field name="price_to" xsi:type="string">120.00</field> + <field name="cart_price" xsi:type="string">145.00</field> + </dataset> + + <dataset name="drop_down_with_one_option_percent_price"> + <field name="price_from" xsi:type="string">115.00</field> + <field name="price_to" xsi:type="string">120.00</field> + <field name="cart_price" xsi:type="string">126.00</field> + </dataset> + + <dataset name="MAGETWO-23070"> + <field name="price_from" xsi:type="string">40.00</field> + <field name="price_to" xsi:type="string">100.00</field> + <field name="cart_price" xsi:type="string">100.00</field> + </dataset> + + <dataset name="MAGETWO-23061"> + <field name="price_from" xsi:type="string">32.00</field> + <field name="price_to" xsi:type="string">80.00</field> + <field name="cart_price" xsi:type="string">80.00</field> + </dataset> + + <dataset name="fixed-10"> + <field name="price_from" xsi:type="string">10.00</field> + <field name="price_to" xsi:type="string">100.00</field> + <field name="cart_price" xsi:type="string">80.00</field> + </dataset> + + <dataset name="fixed-15"> + <field name="price_from" xsi:type="string">15.00</field> + <field name="price_to" xsi:type="string">16.00</field> + <field name="cart_price" xsi:type="string">80.00</field> + </dataset> + + <dataset name="fixed-24"> + <field name="price_from" xsi:type="string">96.00</field> + <field name="price_to" xsi:type="string">97.00</field> + <field name="cart_price" xsi:type="string">244.00</field> + </dataset> + + <dataset name="fixed-100"> + <field name="price_from" xsi:type="string">110.00</field> + <field name="price_to" xsi:type="string">120.00</field> + </dataset> + + <dataset name="fixed-110"> + <field name="price_from" xsi:type="string">159.00</field> + <field name="price_to" xsi:type="string">164.00</field> + <field name="cart_price" xsi:type="string">159.00</field> + </dataset> + + <dataset name="fixed-115"> + <field name="price_from" xsi:type="string">317.00</field> + <field name="price_to" xsi:type="string">362.00</field> + <field name="cart_price" xsi:type="string">317.00</field> + </dataset> + + <dataset name="fixed-756"> + <field name="price_from" xsi:type="string">755.00</field> + <field name="price_to" xsi:type="string">756.00</field> + <field name="cart_price" xsi:type="string">756.00</field> + </dataset> + + <dataset name="bundle_fixed_with_category"> + <field name="price_from" xsi:type="string">130.00</field> + <field name="price_to" xsi:type="string">144.00</field> + </dataset> + + <dataset name="default_dynamic"> + <field name="compare_price" xsi:type="array"> + <item name="price_from" xsi:type="string">100.00</item> + <item name="price_to" xsi:type="string">560.00</item> + </field> + </dataset> + + <dataset name="dynamic-8"> + <field name="price_from" xsi:type="string">8.00</field> + <field name="price_to" xsi:type="string">20.00</field> + <field name="cart_price" xsi:type="string">80.00</field> + </dataset> + + <dataset name="dynamic-32"> + <field name="price_from" xsi:type="string">32.00</field> + <field name="price_to" xsi:type="string">80.00</field> + <field name="cart_price" xsi:type="string">80.00</field> + </dataset> + + <dataset name="dynamic-40"> + <field name="price_from" xsi:type="string">40.00</field> + <field name="price_to" xsi:type="string">100.00</field> + <field name="cart_price" xsi:type="string">100.00</field> + </dataset> + + <dataset name="dynamic-50"> + <field name="price_from" xsi:type="string">50.00</field> + </dataset> + + <dataset name="dynamic-100"> + <field name="price_from" xsi:type="string">100.00</field> + <field name="price_to" xsi:type="string">560.00</field> + <field name="cart_price" xsi:type="string">100.00</field> + </dataset> + + <dataset name="dynamic-200"> + <field name="price_from" xsi:type="string">200.00</field> + <field name="price_to" xsi:type="string">500.00</field> + <field name="cart_price" xsi:type="string">400.00</field> + </dataset> + + <dataset name="dynamic-560"> + <field name="price_from" xsi:type="string">560.00</field> + </dataset> + + <dataset name="bundle_dynamic_with_category"> + <field name="price_from" xsi:type="string">100.00</field> + <field name="price_to" xsi:type="string">100.00</field> + </dataset> + </repository> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest.xml index ad5b9bfa0c055caf84c363a3dcc9067689628cc6..40e5809b352555155d70c6747dfeec8b35b60b6a 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest.xml @@ -15,9 +15,9 @@ <data name="product/data/description" xsi:type="string">Bundle Product Dynamic Required</data> <data name="product/data/stock_data/use_config_manage_stock" xsi:type="string">No</data> <data name="product/data/stock_data/manage_stock" xsi:type="string">No</data> - <data name="product/data/bundle_selections/preset" xsi:type="string">default_dynamic</data> + <data name="product/data/bundle_selections/dataset" xsi:type="string">default_dynamic</data> <data name="product/data/bundle_selections/products" xsi:type="string">catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar</data> - <data name="product/data/checkout_data/preset" xsi:type="string">default</data> + <data name="product/data/checkout_data/dataset" xsi:type="string">bundle_default</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> <constraint name="Magento\Bundle\Test\Constraint\AssertBundleItemsOnProductPage" /> @@ -34,9 +34,9 @@ <data name="product/data/weight_type" xsi:type="string">Dynamic</data> <data name="product/data/category" xsi:type="string">category_%isolation%</data> <data name="product/data/shipment_type" xsi:type="string">Separately</data> - <data name="product/data/bundle_selections/preset" xsi:type="string">default_dynamic</data> + <data name="product/data/bundle_selections/dataset" xsi:type="string">default_dynamic</data> <data name="product/data/bundle_selections/products" xsi:type="string">catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar</data> - <data name="product/data/checkout_data/preset" xsi:type="string">default</data> + <data name="product/data/checkout_data/dataset" xsi:type="string">bundle_default</data> <data name="product/data/visibility" xsi:type="string">Catalog, Search</data> <data name="product/data/use_config_gift_message_available" xsi:type="string">No</data> <data name="product/data/gift_message_available" xsi:type="string">Yes</data> @@ -51,16 +51,16 @@ <data name="product/data/sku" xsi:type="string">bundle_sku_%isolation%</data> <data name="product/data/status" xsi:type="string">Product online</data> <data name="product/data/price_type" xsi:type="string">Dynamic</data> - <data name="product/data/price/preset" xsi:type="string">dynamic-200</data> + <data name="product/data/price/dataset" xsi:type="string">dynamic-200</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> <data name="product/data/weight_type" xsi:type="string">Dynamic</data> <data name="product/data/category" xsi:type="string">category_%isolation%</data> <data name="product/data/description" xsi:type="string">Bundle Product Dynamic</data> <data name="product/data/price_view" xsi:type="string">Price Range</data> <data name="product/data/shipment_type" xsi:type="string">Together</data> - <data name="product/data/bundle_selections/preset" xsi:type="string">all_types_dynamic</data> + <data name="product/data/bundle_selections/dataset" xsi:type="string">all_types_dynamic</data> <data name="product/data/bundle_selections/products" xsi:type="string">catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar|catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar|catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar|catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar</data> - <data name="product/data/checkout_data/preset" xsi:type="string">all_types_bundle_options</data> + <data name="product/data/checkout_data/dataset" xsi:type="string">bundle_all_types_bundle_options</data> <data name="product/data/visibility" xsi:type="string">Catalog, Search</data> <data name="product/data/use_config_gift_message_available" xsi:type="string">No</data> <data name="product/data/gift_message_available" xsi:type="string">Yes</data> @@ -83,14 +83,14 @@ <data name="product/data/sku" xsi:type="string">bundle_sku_%isolation%</data> <data name="product/data/price_type" xsi:type="string">Fixed</data> <data name="product/data/price/value" xsi:type="string">10</data> - <data name="product/data/price/preset" xsi:type="string">fixed-15</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">None</data> + <data name="product/data/price/dataset" xsi:type="string">fixed-15</data> + <data name="product/data/tax_class_id/dataset" xsi:type="string">None</data> <data name="product/data/weight_type" xsi:type="string">Fixed</data> <data name="product/data/weight" xsi:type="string">10</data> <data name="product/data/description" xsi:type="string">Bundle Product Fixed Required</data> - <data name="product/data/bundle_selections/preset" xsi:type="string">default_fixed</data> + <data name="product/data/bundle_selections/dataset" xsi:type="string">default_fixed</data> <data name="product/data/bundle_selections/products" xsi:type="string">catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar</data> - <data name="product/data/checkout_data/preset" xsi:type="string">default</data> + <data name="product/data/checkout_data/dataset" xsi:type="string">bundle_default</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> <constraint name="Magento\Bundle\Test\Constraint\AssertBundleProductForm" /> @@ -99,7 +99,6 @@ <constraint name="Magento\Bundle\Test\Constraint\AssertBundleItemsOnProductPage" /> </variation> <variation name="CreateBundleProductEntityTestVariation5"> - <data name="issue" xsi:type="string">Bug: MAGETWO-35342</data> <data name="description" xsi:type="string">Create fixed bundle with all types options</data> <data name="product/data/url_key" xsi:type="string">bundle-product-%isolation%</data> <data name="product/data/name" xsi:type="string">BundleProduct %isolation%</data> @@ -108,20 +107,20 @@ <data name="product/data/status" xsi:type="string">Product online</data> <data name="product/data/price_type" xsi:type="string">Fixed</data> <data name="product/data/price/value" xsi:type="string">100</data> - <data name="product/data/price/preset" xsi:type="string">fixed-24</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> + <data name="product/data/price/dataset" xsi:type="string">fixed-24</data> + <data name="product/data/tax_class_id/dataset" xsi:type="string">taxable_goods</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> <data name="product/data/weight_type" xsi:type="string">Fixed</data> <data name="product/data/weight" xsi:type="string">10</data> <data name="product/data/category" xsi:type="string">category_%isolation%</data> <data name="product/data/description" xsi:type="string">Bundle Product Fixed</data> - <data name="product/data/group_price/preset" xsi:type="string">default</data> + <data name="product/data/group_price/dataset" xsi:type="string">not_logged_in_20</data> <data name="product/data/price_view" xsi:type="string">As Low as</data> <data name="product/data/shipment_type" xsi:type="string">Separately</data> - <data name="product/data/bundle_selections/preset" xsi:type="string">all_types_fixed</data> + <data name="product/data/bundle_selections/dataset" xsi:type="string">all_types_fixed</data> <data name="product/data/bundle_selections/products" xsi:type="string">catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar|catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar|catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar|catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar</data> - <data name="product/data/checkout_data/preset" xsi:type="string">all_types_bundle_fixed_and_custom_options</data> - <data name="product/data/custom_options/preset" xsi:type="string">all_types</data> + <data name="product/data/checkout_data/dataset" xsi:type="string">bundle_all_types_bundle_fixed_and_custom_options</data> + <data name="product/data/custom_options/dataset" xsi:type="string">all_types</data> <data name="product/data/visibility" xsi:type="string">Catalog, Search</data> <data name="product/data/use_config_gift_message_available" xsi:type="string">No</data> <data name="product/data/gift_message_available" xsi:type="string">No</data> @@ -145,8 +144,8 @@ <data name="product/data/status" xsi:type="string">Product online</data> <data name="product/data/price_type" xsi:type="string">Fixed</data> <data name="product/data/price/value" xsi:type="string">10</data> - <data name="product/data/price/preset" xsi:type="string">fixed-10</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> + <data name="product/data/price/dataset" xsi:type="string">fixed-10</data> + <data name="product/data/tax_class_id/dataset" xsi:type="string">taxable_goods</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">Out of Stock</data> <data name="product/data/weight_type" xsi:type="string">Fixed</data> <data name="product/data/weight" xsi:type="string">10</data> @@ -155,9 +154,9 @@ <data name="product/data/stock_data/use_config_manage_stock" xsi:type="string">No</data> <data name="product/data/stock_data/manage_stock" xsi:type="string">Yes</data> <data name="product/data/shipment_type" xsi:type="string">Together</data> - <data name="product/data/bundle_selections/preset" xsi:type="string">with_not_required_options</data> + <data name="product/data/bundle_selections/dataset" xsi:type="string">with_not_required_options</data> <data name="product/data/bundle_selections/products" xsi:type="string">catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar|catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar</data> - <data name="product/data/checkout_data/preset" xsi:type="string">with_not_required_options</data> + <data name="product/data/checkout_data/dataset" xsi:type="string">bundle_with_not_required_options</data> <data name="product/data/visibility" xsi:type="string">Catalog</data> <data name="product/data/use_config_gift_message_available" xsi:type="string">No</data> <data name="product/data/gift_message_available" xsi:type="string">No</data> @@ -173,17 +172,17 @@ <data name="product/data/sku_type" xsi:type="string">Dynamic</data> <data name="product/data/sku" xsi:type="string">bundle_sku_%isolation%</data> <data name="product/data/price_type" xsi:type="string">Dynamic</data> - <data name="product/data/price/preset" xsi:type="string">dynamic-50</data> + <data name="product/data/price/dataset" xsi:type="string">dynamic-50</data> <data name="product/data/weight_type" xsi:type="string">Fixed</data> <data name="product/data/weight" xsi:type="string">10</data> - <data name="product/data/tier_price/preset" xsi:type="string">default</data> + <data name="product/data/tier_price/dataset" xsi:type="string">default</data> <data name="product/data/price_view" xsi:type="string">As Low as</data> <data name="product/data/stock_data/use_config_manage_stock" xsi:type="string">No</data> <data name="product/data/stock_data/manage_stock" xsi:type="string">No</data> <data name="product/data/shipment_type" xsi:type="string">Together</data> - <data name="product/data/bundle_selections/preset" xsi:type="string">default_dynamic</data> + <data name="product/data/bundle_selections/dataset" xsi:type="string">default_dynamic</data> <data name="product/data/bundle_selections/products" xsi:type="string">catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar</data> - <data name="product/data/checkout_data/preset" xsi:type="string">default</data> + <data name="product/data/checkout_data/dataset" xsi:type="string">bundle_default</data> <data name="product/data/visibility" xsi:type="string">Search</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> @@ -200,13 +199,13 @@ <data name="product/data/sku_type" xsi:type="string">Dynamic</data> <data name="product/data/sku" xsi:type="string">sku_bundle_dynamic_%isolation%</data> <data name="product/data/price_type" xsi:type="string">Dynamic</data> - <data name="product/data/price/preset" xsi:type="string">dynamic-8</data> + <data name="product/data/price/dataset" xsi:type="string">dynamic-8</data> <data name="product/data/special_price" xsi:type="string">20</data> <data name="product/data/special_from_date/pattern" xsi:type="string">m/d/Y</data> <data name="product/data/special_to_date/pattern" xsi:type="string">m/d/Y +3 days</data> - <data name="product/data/bundle_selections/preset" xsi:type="string">default_dynamic</data> + <data name="product/data/bundle_selections/dataset" xsi:type="string">default_dynamic</data> <data name="product/data/bundle_selections/products" xsi:type="string">catalogProductSimple::product_100_dollar,catalogProductSimple::product_40_dollar</data> - <data name="product/data/checkout_data/preset" xsi:type="string">default</data> + <data name="product/data/checkout_data/dataset" xsi:type="string">bundle_default</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Bundle\Test\Constraint\AssertBundleInCategory" /> </variation> @@ -217,11 +216,11 @@ <data name="product/data/sku_type" xsi:type="string">Dynamic</data> <data name="product/data/sku" xsi:type="string">sku_bundle_dynamic_%isolation%</data> <data name="product/data/price_type" xsi:type="string">Dynamic</data> - <data name="product/data/price/preset" xsi:type="string">dynamic-32</data> - <data name="product/data/group_price/preset" xsi:type="string">MAGETWO-23061</data> - <data name="product/data/bundle_selections/preset" xsi:type="string">default_dynamic</data> + <data name="product/data/price/dataset" xsi:type="string">dynamic-32</data> + <data name="product/data/group_price/dataset" xsi:type="string">not_logged_in_20</data> + <data name="product/data/bundle_selections/dataset" xsi:type="string">default_dynamic</data> <data name="product/data/bundle_selections/products" xsi:type="string">catalogProductSimple::product_100_dollar,catalogProductSimple::product_40_dollar</data> - <data name="product/data/checkout_data/preset" xsi:type="string">default</data> + <data name="product/data/checkout_data/dataset" xsi:type="string">bundle_default</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Bundle\Test\Constraint\AssertBundleInCategory" /> <constraint name="Magento\Bundle\Test\Constraint\AssertBundlePriceView" /> @@ -234,10 +233,10 @@ <data name="product/data/sku_type" xsi:type="string">Dynamic</data> <data name="product/data/sku" xsi:type="string">sku_bundle_dynamic_%isolation%</data> <data name="product/data/price_type" xsi:type="string">Dynamic</data> - <data name="product/data/price/preset" xsi:type="string">dynamic-40</data> - <data name="product/data/bundle_selections/preset" xsi:type="string">default_dynamic</data> + <data name="product/data/price/dataset" xsi:type="string">dynamic-40</data> + <data name="product/data/bundle_selections/dataset" xsi:type="string">default_dynamic</data> <data name="product/data/bundle_selections/products" xsi:type="string">catalogProductSimple::product_100_dollar,catalogProductSimple::product_40_dollar</data> - <data name="product/data/checkout_data/preset" xsi:type="string">default</data> + <data name="product/data/checkout_data/dataset" xsi:type="string">bundle_default</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Bundle\Test\Constraint\AssertBundleInCategory" /> <constraint name="Magento\Bundle\Test\Constraint\AssertBundlePriceView" /> @@ -251,11 +250,11 @@ <data name="product/data/sku" xsi:type="string">sku_bundle_fixed_%isolation%</data> <data name="product/data/price_type" xsi:type="string">Fixed</data> <data name="product/data/price/value" xsi:type="string">110</data> - <data name="product/data/price/preset" xsi:type="string">fixed-115</data> - <data name="product/data/bundle_selections/preset" xsi:type="string">second</data> + <data name="product/data/price/dataset" xsi:type="string">fixed-115</data> + <data name="product/data/bundle_selections/dataset" xsi:type="string">second</data> <data name="product/data/bundle_selections/products" xsi:type="string">catalogProductSimple::product_100_dollar,catalogProductSimple::product_40_dollar</data> - <data name="product/data/checkout_data/preset" xsi:type="string">with_custom_options_1</data> - <data name="product/data/custom_options/preset" xsi:type="string">drop_down_with_one_option_fixed_price</data> + <data name="product/data/checkout_data/dataset" xsi:type="string">bundle_with_custom_options_1</data> + <data name="product/data/custom_options/dataset" xsi:type="string">drop_down_with_one_option_fixed_price</data> <data name="product/data/custom_options/import_products" xsi:type="string">catalogProductSimple::with_two_custom_option,catalogProductSimple::with_all_custom_option</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Bundle\Test\Constraint\AssertBundleInCategory" /> @@ -271,11 +270,11 @@ <data name="product/data/sku" xsi:type="string">sku_bundle_fixed_%isolation%</data> <data name="product/data/price_type" xsi:type="string">Fixed</data> <data name="product/data/price/value" xsi:type="string">110</data> - <data name="product/data/price/preset" xsi:type="string">fixed-110</data> - <data name="product/data/bundle_selections/preset" xsi:type="string">second</data> + <data name="product/data/price/dataset" xsi:type="string">fixed-110</data> + <data name="product/data/bundle_selections/dataset" xsi:type="string">second</data> <data name="product/data/bundle_selections/products" xsi:type="string">catalogProductSimple::product_100_dollar,catalogProductSimple::product_40_dollar</data> - <data name="product/data/checkout_data/preset" xsi:type="string">with_custom_options_2</data> - <data name="product/data/custom_options/preset" xsi:type="string">drop_down_with_one_option_percent_price</data> + <data name="product/data/checkout_data/dataset" xsi:type="string">bundle_with_custom_options_2</data> + <data name="product/data/custom_options/dataset" xsi:type="string">drop_down_with_one_option_percent_price</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Bundle\Test\Constraint\AssertBundleInCategory" /> <constraint name="Magento\Bundle\Test\Constraint\AssertBundlePriceView" /> @@ -288,9 +287,9 @@ <data name="product/data/sku_type" xsi:type="string">Dynamic</data> <data name="product/data/sku" xsi:type="string">sku_bundle_dynamic_%isolation%</data> <data name="product/data/price_type" xsi:type="string">Dynamic</data> - <data name="product/data/bundle_selections/preset" xsi:type="string">default_dynamic</data> + <data name="product/data/bundle_selections/dataset" xsi:type="string">default_dynamic</data> <data name="product/data/bundle_selections/products" xsi:type="string">catalogProductSimple::product_100_dollar,catalogProductSimple::product_40_dollar</data> - <data name="product/data/checkout_data/preset" xsi:type="string">default</data> + <data name="product/data/checkout_data/dataset" xsi:type="string">bundle_default</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> </variation> <variation name="CreateBundleProductEntityTestVariation14"> @@ -301,9 +300,9 @@ <data name="product/data/sku" xsi:type="string">sku_bundle_fixed_%isolation%</data> <data name="product/data/price_type" xsi:type="string">Fixed</data> <data name="product/data/price/value" xsi:type="string">10</data> - <data name="product/data/bundle_selections/preset" xsi:type="string">second</data> + <data name="product/data/bundle_selections/dataset" xsi:type="string">second</data> <data name="product/data/bundle_selections/products" xsi:type="string">catalogProductSimple::product_100_dollar,catalogProductSimple::product_40_dollar</data> - <data name="product/data/checkout_data/preset" xsi:type="string">default</data> + <data name="product/data/checkout_data/dataset" xsi:type="string">bundle_default</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> </variation> <variation name="CreateBundleProductEntityTestVariation15"> @@ -314,13 +313,13 @@ <data name="product/data/sku" xsi:type="string">sku_bundle_fixed_%isolation%</data> <data name="product/data/price_type" xsi:type="string">Fixed</data> <data name="product/data/price/value" xsi:type="string">100</data> - <data name="product/data/price/preset" xsi:type="string">fixed-100</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> + <data name="product/data/price/dataset" xsi:type="string">fixed-100</data> + <data name="product/data/tax_class_id/dataset" xsi:type="string">taxable_goods</data> <data name="product/data/weight_type" xsi:type="string">Fixed</data> <data name="product/data/weight" xsi:type="string">1</data> <data name="product/data/category" xsi:type="string">category_%isolation%</data> <data name="product/data/shipment_type" xsi:type="string">Together</data> - <data name="product/data/bundle_selections/preset" xsi:type="string">two_options_with_fixed_and_percent_prices</data> + <data name="product/data/bundle_selections/dataset" xsi:type="string">two_options_with_fixed_and_percent_prices</data> <data name="tag" xsi:type="string">test_type:acceptance_test</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> @@ -333,10 +332,10 @@ <data name="product/data/name" xsi:type="string">Bundle Dynamic %isolation%</data> <data name="product/data/sku" xsi:type="string">sku_bundle_dynamic_%isolation%</data> <data name="product/data/price_type" xsi:type="string">Dynamic</data> - <data name="product/data/price/preset" xsi:type="string">dynamic-560</data> + <data name="product/data/price/dataset" xsi:type="string">dynamic-560</data> <data name="product/data/category" xsi:type="string">category_%isolation%</data> <data name="product/data/shipment_type" xsi:type="string">Together</data> - <data name="product/data/bundle_selections/preset" xsi:type="string">one_options_assigned_simple_big_qty</data> + <data name="product/data/bundle_selections/dataset" xsi:type="string">one_options_assigned_simple_big_qty</data> <data name="tag" xsi:type="string">test_type:acceptance_test</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/UpdateBundleProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/UpdateBundleProductEntityTest.xml index 89e9f03427db7da0934a86f374b5510825145310..bbe84c24f29ab19636ffd21d1b4802166f5d3a07 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/UpdateBundleProductEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/UpdateBundleProductEntityTest.xml @@ -6,99 +6,74 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\Bundle\Test\TestCase\UpdateBundleProductEntityTest"> - <variation name="UpdateBundleProductEntityTestVariation1" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <data name="description" xsi:type="string">Update dynamic bundle product</data> - <data name="originalProduct/dataSet" xsi:type="string">bundle_dynamic_product</data> - <data name="product/data/url_key" xsi:type="string">bundle-product-%isolation%</data> - <data name="product/data/name" xsi:type="string">bundle_dynamic_%isolation%</data> - <data name="product/data/sku_type" xsi:type="string">Fixed</data> - <data name="product/data/sku" xsi:type="string">bundle_dynamic_%isolation%</data> - <data name="product/data/price/value" xsi:type="string">-</data> - <data name="product/data/price/preset" xsi:type="string">dynamic-100</data> - <data name="product/data/weight_type" xsi:type="string">Fixed</data> - <data name="product/data/weight" xsi:type="string">1</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</data> - <data name="product/data/description" xsi:type="string">Bundle Product Fixed Required</data> - <data name="product/data/bundle_shipment_type" xsi:type="string">Together</data> - <data name="product/data/bundle_selections/preset" xsi:type="string">default_dynamic</data> - <data name="product/data/checkout_data/preset" xsi:type="string">default</data> - <data name="product/data/visibility" xsi:type="string">-</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - <constraint name="Magento\Bundle\Test\Constraint\AssertBundleItemsOnProductPage"/> - <constraint name="Magento\Bundle\Test\Constraint\AssertBundleProductForm"/> - <constraint name="Magento\Bundle\Test\Constraint\AssertBundleProductPage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInStock"/> - <constraint name="Magento\Bundle\Test\Constraint\AssertBundlePriceView"/> - <constraint name="Magento\Bundle\Test\Constraint\AssertBundlePriceType"/> - </variation> - <variation name="UpdateBundleProductEntityTestVariation2" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <data name="description" xsi:type="string">Update fixed bundle product</data> - <data name="originalProduct/dataSet" xsi:type="string">bundle_fixed_product</data> - <data name="product/data/url_key" xsi:type="string">bundle-product-%isolation%</data> - <data name="product/data/name" xsi:type="string">bundle_fixed_%isolation%</data> - <data name="product/data/sku_type" xsi:type="string">Dynamic</data> - <data name="product/data/sku" xsi:type="string">bundle_sku_%isolation%</data> - <data name="product/data/price/value" xsi:type="string">-</data> - <data name="product/data/price/preset" xsi:type="string">fixed-756</data> - <data name="product/data/weight_type" xsi:type="string">Dynamic</data> - <data name="product/data/weight" xsi:type="string">-</data> - <data name="product/data/category_ids/presets" xsi:type="string">default_subcategory</data> - <data name="product/data/description" xsi:type="string">-</data> - <data name="product/data/bundle_shipment_type" xsi:type="string">Separately</data> - <data name="product/data/bundle_selections/preset" xsi:type="string">default_fixed</data> - <data name="product/data/checkout_data/preset" xsi:type="string">default</data> - <data name="product/data/visibility" xsi:type="string">Catalog, Search</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid"/> - <constraint name="Magento\Bundle\Test\Constraint\AssertBundleItemsOnProductPage"/> - <constraint name="Magento\Bundle\Test\Constraint\AssertBundleProductForm"/> - <constraint name="Magento\Bundle\Test\Constraint\AssertBundleProductPage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInStock"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductVisibleInCategory"/> - <constraint name="Magento\Bundle\Test\Constraint\AssertBundlePriceView"/> - <constraint name="Magento\Bundle\Test\Constraint\AssertBundlePriceType"/> - </variation> - <variation name="UpdateBundleProductEntityTestVariation3" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <data name="description" xsi:type="string">MAGETWO-12841: Edit Bundle Product (Fixed Price)</data> - <data name="originalProduct/dataSet" xsi:type="string">bundle_fixed_with_category</data> - <data name="product/data/url_key" xsi:type="string">bundle-product-%isolation%</data> - <data name="product/data/name" xsi:type="string">bundle_fixed_%isolation%</data> - <data name="product/data/sku_type" xsi:type="string">-</data> - <data name="product/data/sku" xsi:type="string">bundle_sku_%isolation%</data> - <data name="product/data/price/value" xsi:type="string">120.00</data> - <data name="product/data/price/preset" xsi:type="string">bundle_fixed_with_category</data> - <data name="product/data/weight_type" xsi:type="string">-</data> - <data name="product/data/weight" xsi:type="string">-</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</data> - <data name="product/data/description" xsi:type="string">-</data> - <data name="product/data/bundle_shipment_type" xsi:type="string">-</data> - <data name="product/data/bundle_selections/preset" xsi:type="string">-</data> - <data name="product/data/checkout_data/preset" xsi:type="string">-</data> - <data name="product/data/visibility" xsi:type="string">-</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" next="Magento\Bundle\Test\Constraint\AssertBundleProductPage"/> - <constraint name="Magento\Bundle\Test\Constraint\AssertBundleProductPage" prev="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - </variation> - <variation name="UpdateBundleProductEntityTestVariation4" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <data name="description" xsi:type="string">MAGETWO-12842: Edit Bundle (dynamic) Product</data> - <data name="originalProduct/dataSet" xsi:type="string">bundle_dynamic_with_category</data> - <data name="product/data/url_key" xsi:type="string">bundle-product-%isolation%</data> - <data name="product/data/name" xsi:type="string">bundle_dynamic_%isolation%</data> - <data name="product/data/sku_type" xsi:type="string">-</data> - <data name="product/data/sku" xsi:type="string">bundle_sku_%isolation%</data> - <data name="product/data/price/value" xsi:type="string">-</data> - <data name="product/data/price/preset" xsi:type="string">bundle_dynamic_with_category</data> - <data name="product/data/weight_type" xsi:type="string">-</data> - <data name="product/data/weight" xsi:type="string">-</data> - <data name="product/data/category_ids/presets" xsi:type="string">-</data> - <data name="product/data/description" xsi:type="string">-</data> - <data name="product/data/bundle_shipment_type" xsi:type="string">-</data> - <data name="product/data/bundle_selections/preset" xsi:type="string">-</data> - <data name="product/data/checkout_data/preset" xsi:type="string">-</data> - <data name="product/data/visibility" xsi:type="string">-</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" next="Magento\Bundle\Test\Constraint\AssertBundleProductPage"/> - <constraint name="Magento\Bundle\Test\Constraint\AssertBundleProductPage" prev="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - </variation> - </testCase> + <testCase name="Magento\Bundle\Test\TestCase\UpdateBundleProductEntityTest"> + <variation name="UpdateBundleProductEntityTestVariation1"> + <data name="description" xsi:type="string">Update dynamic bundle product</data> + <data name="originalProduct/dataset" xsi:type="string">bundle_dynamic_product</data> + <data name="product/data/url_key" xsi:type="string">bundle-product-%isolation%</data> + <data name="product/data/name" xsi:type="string">bundle_dynamic_%isolation%</data> + <data name="product/data/sku_type" xsi:type="string">Fixed</data> + <data name="product/data/sku" xsi:type="string">bundle_dynamic_%isolation%</data> + <data name="product/data/price/dataset" xsi:type="string">dynamic-100</data> + <data name="product/data/weight_type" xsi:type="string">Fixed</data> + <data name="product/data/weight" xsi:type="string">1</data> + <data name="product/data/description" xsi:type="string">Bundle Product Fixed Required</data> + <data name="product/data/bundle_shipment_type" xsi:type="string">Together</data> + <data name="product/data/bundle_selections/dataset" xsi:type="string">default_dynamic</data> + <data name="product/data/checkout_data/dataset" xsi:type="string">bundle_default</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> + <constraint name="Magento\Bundle\Test\Constraint\AssertBundleItemsOnProductPage" /> + <constraint name="Magento\Bundle\Test\Constraint\AssertBundleProductForm" /> + <constraint name="Magento\Bundle\Test\Constraint\AssertBundleProductPage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInStock" /> + <constraint name="Magento\Bundle\Test\Constraint\AssertBundlePriceView" /> + <constraint name="Magento\Bundle\Test\Constraint\AssertBundlePriceType" /> + </variation> + <variation name="UpdateBundleProductEntityTestVariation2"> + <data name="description" xsi:type="string">Update fixed bundle product</data> + <data name="originalProduct/dataset" xsi:type="string">bundle_fixed_product</data> + <data name="product/data/url_key" xsi:type="string">bundle-product-%isolation%</data> + <data name="product/data/name" xsi:type="string">bundle_fixed_%isolation%</data> + <data name="product/data/sku_type" xsi:type="string">Dynamic</data> + <data name="product/data/sku" xsi:type="string">bundle_sku_%isolation%</data> + <data name="product/data/price/dataset" xsi:type="string">fixed-756</data> + <data name="product/data/weight_type" xsi:type="string">Dynamic</data> + <data name="product/data/category_ids/dataset" xsi:type="string">default_subcategory</data> + <data name="product/data/bundle_shipment_type" xsi:type="string">Separately</data> + <data name="product/data/bundle_selections/dataset" xsi:type="string">default_fixed</data> + <data name="product/data/checkout_data/dataset" xsi:type="string">bundle_default</data> + <data name="product/data/visibility" xsi:type="string">Catalog, Search</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> + <constraint name="Magento\Bundle\Test\Constraint\AssertBundleItemsOnProductPage" /> + <constraint name="Magento\Bundle\Test\Constraint\AssertBundleProductForm" /> + <constraint name="Magento\Bundle\Test\Constraint\AssertBundleProductPage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInStock" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductVisibleInCategory" /> + <constraint name="Magento\Bundle\Test\Constraint\AssertBundlePriceView" /> + <constraint name="Magento\Bundle\Test\Constraint\AssertBundlePriceType" /> + </variation> + <variation name="UpdateBundleProductEntityTestVariation3"> + <data name="description" xsi:type="string">MAGETWO-12841: Edit Bundle Product (Fixed Price)</data> + <data name="originalProduct/dataset" xsi:type="string">bundle_fixed_with_category</data> + <data name="product/data/url_key" xsi:type="string">bundle-product-%isolation%</data> + <data name="product/data/name" xsi:type="string">bundle_fixed_%isolation%</data> + <data name="product/data/sku" xsi:type="string">bundle_sku_%isolation%</data> + <data name="product/data/price/value" xsi:type="string">120.00</data> + <data name="product/data/price/dataset" xsi:type="string">bundle_fixed_with_category</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> + <constraint name="Magento\Bundle\Test\Constraint\AssertBundleProductPage" /> + </variation> + <variation name="UpdateBundleProductEntityTestVariation4"> + <data name="description" xsi:type="string">MAGETWO-12842: Edit Bundle (dynamic) Product</data> + <data name="originalProduct/dataset" xsi:type="string">bundle_dynamic_with_category</data> + <data name="product/data/url_key" xsi:type="string">bundle-product-%isolation%</data> + <data name="product/data/name" xsi:type="string">bundle_dynamic_%isolation%</data> + <data name="product/data/sku" xsi:type="string">bundle_sku_%isolation%</data> + <data name="product/data/price/dataset" xsi:type="string">bundle_dynamic_with_category</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> + <constraint name="Magento\Bundle\Test\Constraint\AssertBundleProductPage" /> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Edit/AttributeForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Edit/AttributeForm.php index 791edb5f5229677ce79b8350e335847162e9944b..9824582c0225ac675bfdd5d96e82dd468e23543b 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Edit/AttributeForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Edit/AttributeForm.php @@ -76,7 +76,28 @@ class AttributeForm extends FormTabs } } - return $data; + return $this->removeEmptyValues($data); + } + + /** + * Remove recursive all empty values in array. + * + * @param mixed $input + * @return mixed + */ + protected function removeEmptyValues($input) + { + if (!is_array($input)) { + return $input; + } + $filteredArray = []; + foreach ($input as $key => $value) { + if ($value) { + $filteredArray[$key] = $this->removeEmptyValues($value); + } + } + + return $filteredArray; } /** diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryPage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryPage.php index 08f536e9e41b81c5f9387ff129d59a533298b9e6..def6490e3bf2734e78252c8fffa7c51181114626 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryPage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryPage.php @@ -78,7 +78,7 @@ class AssertCategoryPage extends AbstractConstraint $product = $fixtureFactory->createByCode( 'catalogProductSimple', [ - 'dataSet' => 'default', + 'dataset' => 'default', 'data' => [ 'category_ids' => [ 'category' => $initialCategory, diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsFilterable.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsFilterable.php index 30224411bc7df526a1e01a3e5ec6f202e421710a..1f355049a172ea7b076feb749db30b33bb33fa64 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsFilterable.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsFilterable.php @@ -38,10 +38,10 @@ class AssertProductAttributeIsFilterable extends AbstractConstraint $fixtureFactory->createByCode( 'catalogProductSimple', [ - 'dataSet' => 'product_with_category_with_anchor', + 'dataset' => 'product_with_category_with_anchor', 'data' => [ 'category_ids' => [ - 'presets' => null, + 'dataset' => null, 'category' => $product->getDataFieldConfig('category_ids')['source']->getCategories()[0] ] ], diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsUnique.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsUnique.php index f812fcdcf2617a925569123cba71e145b0dd4646..4d29d2c4ccdf2c8a4b2c08cf62d64b431aa5f225 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsUnique.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsUnique.php @@ -95,7 +95,7 @@ class AssertProductAttributeIsUnique extends AbstractConstraint return $this->fixtureFactory->createByCode( 'catalogProductSimple', [ - 'dataSet' => 'product_with_category_with_anchor', + 'dataset' => 'product_with_category_with_anchor', 'data' => [ 'attribute_set_id' => [ 'attribute_set' => $product->getDataFieldConfig('attribute_set_id')['source']->getAttributeSet() diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareBlockOnCmsPage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareBlockOnCmsPage.php index c44e68eb547f3b27a56786b9c75f955ee8ff1b2e..4be5339886f262e942aad9e65aac7bb7753c954a 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareBlockOnCmsPage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareBlockOnCmsPage.php @@ -32,7 +32,7 @@ class AssertProductCompareBlockOnCmsPage extends AbstractConstraint FixtureFactory $fixtureFactory, BrowserInterface $browser ) { - $newCmsPage = $fixtureFactory->createByCode('cmsPage', ['dataSet' => '3_column_template']); + $newCmsPage = $fixtureFactory->createByCode('cmsPage', ['dataset' => '3_column_template']); $newCmsPage->persist(); $browser->open($_ENV['app_frontend_url'] . $newCmsPage->getIdentifier()); foreach ($products as &$product) { diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductComparePage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductComparePage.php index c3f069fa2ed055d01fec077464d69224dbd8c5b0..4c52c900a1e741624f5a81c70ccbf65521ee4a12 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductComparePage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductComparePage.php @@ -60,8 +60,8 @@ class AssertProductComparePage extends AbstractConstraint ? ($product->hasData($attribute) ? $product->getData($attribute) : 'N/A') - : ($product->getDataFieldConfig('price')['source']->getPreset() !== null - ? $product->getDataFieldConfig('price')['source']->getPreset()['compare_price'] + : ($product->getDataFieldConfig('price')['source']->getPriceData() !== null + ? $product->getDataFieldConfig('price')['source']->getPriceData()['compare_price'] : number_format($product->getPrice(), 2)); $attribute = is_numeric($attributeKey) ? 'info' : 'attribute'; diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateGroupOnProductForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateGroupOnProductForm.php index 165f69f007b7e6325fd6048ed5c3b3fe524e5e9b..2baac340525f3c1506afbb7cde40e0325dffe918 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateGroupOnProductForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateGroupOnProductForm.php @@ -52,7 +52,7 @@ class AssertProductTemplateGroupOnProductForm extends AbstractConstraint $productSimple = $fixtureFactory->createByCode( 'catalogProductSimple', [ - 'dataSet' => 'default', + 'dataset' => 'default', 'data' => [ 'attribute_set_id' => ['attribute_set' => $attributeSet], ], diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateOnProductForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateOnProductForm.php index 86ef5f1742097b12b5f19e29c41afedef30900ba..cf3e50c9f09009b498b96ad8bb74853d520f50ea 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateOnProductForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateOnProductForm.php @@ -52,7 +52,7 @@ class AssertProductTemplateOnProductForm extends AbstractConstraint $productSimple = $fixtureFactory->createByCode( 'catalogProductSimple', [ - 'dataSet' => 'default', + 'dataset' => 'default', 'data' => [ 'attribute_set_id' => ['attribute_set' => $attributeSet], ], diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Cart/Item.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Cart/Item.php index 9e8d1996b13a22dda3e97df67182435f16caaf66..c5b0a6ead567206c97a0147fab64357dbca8d527 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Cart/Item.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Cart/Item.php @@ -6,27 +6,20 @@ namespace Magento\Catalog\Test\Fixture\Cart; -use Magento\Catalog\Test\Fixture\CatalogProductSimple; +use Magento\Mtf\Fixture\DataSource; use Magento\Mtf\Fixture\FixtureInterface; +use Magento\Catalog\Test\Fixture\CatalogProductSimple; /** - * Class Item - * Data for verify cart item block on checkout page + * Data for verify cart item block on checkout page. * * Data keys: * - product (fixture data for verify) * * @SuppressWarnings(PHPMD.NPathComplexity) */ -class Item implements FixtureInterface +class Item extends DataSource { - /** - * Prepared dataSet data - * - * @var array - */ - protected $data = []; - /** * @constructor * @param FixtureInterface $product @@ -64,37 +57,4 @@ class Item implements FixtureInterface $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/Magento/Catalog/Test/Fixture/CatalogAttributeSet.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogAttributeSet.xml index 20c3c831f6e627016d8ff8f74fff0f8d26485017..8fad06be79f594e14f7a05d33b3d6c0ecc32a736 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogAttributeSet.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogAttributeSet.xml @@ -6,31 +6,20 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="catalogAttributeSet" module="Magento_Catalog" type="flat" entity_type="eav_attribute_set" collection="Magento\Catalog\Model\Resource\Product\Link\Product\Collection" repository_class="Magento\Catalog\Test\Repository\CatalogAttributeSet" handler_interface="Magento\Catalog\Test\Handler\CatalogAttributeSet\CatalogAttributeSetInterface" class="Magento\Catalog\Test\Fixture\CatalogAttributeSet"> - <dataset name="default"> - <field name="attribute_set_name" xsi:type="string">Default_attribute_set_%isolation%</field> - <field name="skeleton_set" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> - </field> - </dataset> - <field name="attribute_set_id" is_required="1"> - <default_value xsi:type="null"/> - </field> - <field name="entity_type_id" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="attribute_set_name" is_required=""> - <default_value xsi:type="string">Default_attribute_set_%isolation%</default_value> - </field> - <field name="sort_order" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="skeleton_set" is_required="" source="Magento\Catalog\Test\Fixture\CatalogAttributeSet\SkeletonSet"> - <default_value xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> - </default_value> - </field> - <field name="assigned_attributes" source="Magento\Catalog\Test\Fixture\CatalogAttributeSet\AssignedAttributes"/> - <field name="group"/> - </fixture> + <fixture name="catalogAttributeSet" + module="Magento_Catalog" + type="flat" + entity_type="eav_attribute_set" + collection="Magento\Catalog\Model\Resource\Product\Link\Product\Collection" + repository_class="Magento\Catalog\Test\Repository\CatalogAttributeSet" + handler_interface="Magento\Catalog\Test\Handler\CatalogAttributeSet\CatalogAttributeSetInterface" + class="Magento\Catalog\Test\Fixture\CatalogAttributeSet"> + <field name="attribute_set_id" is_required="1" /> + <field name="entity_type_id" is_required="" /> + <field name="attribute_set_name" is_required="" /> + <field name="sort_order" is_required="" /> + <field name="skeleton_set" is_required="" source="Magento\Catalog\Test\Fixture\CatalogAttributeSet\SkeletonSet" /> + <field name="assigned_attributes" source="Magento\Catalog\Test\Fixture\CatalogAttributeSet\AssignedAttributes" /> + <field name="group" /> + </fixture> </config> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogAttributeSet/AssignedAttributes.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogAttributeSet/AssignedAttributes.php index 3cab12364140258fe29475db5ca95c8c651c8109..ef7559333b1e5d80a480fe0ac7323d33f0d1daa3 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogAttributeSet/AssignedAttributes.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogAttributeSet/AssignedAttributes.php @@ -6,33 +6,19 @@ namespace Magento\Catalog\Test\Fixture\CatalogAttributeSet; -use Magento\Catalog\Test\Fixture\CatalogProductAttribute; +use Magento\Mtf\Fixture\DataSource; use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Mtf\Fixture\FixtureInterface; +use Magento\Catalog\Test\Fixture\CatalogProductAttribute; /** - * Class AssignedAttributes + * Assigned attributes sources. * * Data keys: - * - presets + * - dataset * - attributes */ -class AssignedAttributes implements FixtureInterface +class AssignedAttributes extends DataSource { - /** - * Data set configuration settings - * - * @var array - */ - protected $params = []; - - /** - * Names of assigned attributes - * - * @var array - */ - protected $data = []; - /** * Assigned attributes * @@ -49,11 +35,11 @@ class AssignedAttributes implements FixtureInterface public function __construct(FixtureFactory $fixtureFactory, array $params, array $data = []) { $this->params = $params; - if (isset($data['presets']) && is_string($data['presets'])) { - $presets = explode(',', $data['presets']); - foreach ($presets as $preset) { + if (isset($data['dataset']) && is_string($data['dataset'])) { + $datasets = explode(',', $data['dataset']); + foreach ($datasets as $dataset) { /** @var CatalogProductAttribute $attribute */ - $attribute = $fixtureFactory->createByCode('catalogProductAttribute', ['dataSet' => $preset]); + $attribute = $fixtureFactory->createByCode('catalogProductAttribute', ['dataset' => $dataset]); $attribute->persist(); $this->data[] = $attribute->getAttributeCode(); @@ -70,39 +56,6 @@ class AssignedAttributes implements FixtureInterface } } - /** - * Persist attribute - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return data set configuration settings - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Return prepared data set - * - * @param string|null $key - * @return array - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - /** * Get Attributes * diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogAttributeSet/SkeletonSet.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogAttributeSet/SkeletonSet.php index 27f86800767f536908ea62c0a07b6d158469d4ee..8367af66ae8485663ce2839876657c8cdc36b14e 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogAttributeSet/SkeletonSet.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogAttributeSet/SkeletonSet.php @@ -6,25 +6,18 @@ namespace Magento\Catalog\Test\Fixture\CatalogAttributeSet; -use Magento\Catalog\Test\Fixture\CatalogAttributeSet; +use Magento\Mtf\Fixture\DataSource; use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Mtf\Fixture\FixtureInterface; +use Magento\Catalog\Test\Fixture\CatalogAttributeSet; /** * Class SkeletonSet * * Data keys: - * - dataSet + * - dataset */ -class SkeletonSet implements FixtureInterface +class SkeletonSet extends DataSource { - /** - * Attribute Set name - * - * @var string - */ - protected $data; - /** * New Attribute Set * @@ -33,6 +26,7 @@ class SkeletonSet implements FixtureInterface protected $attributeSet; /** + * @constructor * @param FixtureFactory $fixtureFactory * @param array $params * @param array $data @@ -40,8 +34,8 @@ class SkeletonSet implements FixtureInterface public function __construct(FixtureFactory $fixtureFactory, array $params, array $data = []) { $this->params = $params; - if (isset($data['dataSet']) && $data['dataSet'] !== '-') { - $parentSet = $fixtureFactory->createByCode('catalogAttributeSet', ['dataSet' => $data['dataSet']]); + if (isset($data['dataset']) && $data['dataset'] !== '-') { + $parentSet = $fixtureFactory->createByCode('catalogAttributeSet', ['dataset' => $data['dataset']]); if (!$parentSet->hasData('attribute_set_id')) { $parentSet->persist(); } @@ -51,29 +45,6 @@ class SkeletonSet implements FixtureInterface } } - /** - * 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; - } - /** * Get Attribute Set * @@ -83,14 +54,4 @@ class SkeletonSet implements FixtureInterface { return $this->attributeSet; } - - /** - * Return data set configuration settings - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductAttribute.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductAttribute.xml index 1a38dd8158cd63cd9553ba8cde4daaa7e3c76eed..c2606db97bb6dbeb83d5c1f47d9b9f3d22ff48ad 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductAttribute.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductAttribute.xml @@ -6,123 +6,52 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="catalogProductAttribute" module="Magento_Catalog" type="composite" collection="Magento\Catalog\Model\Resource\Attribute" repository_class="Magento\Catalog\Test\Repository\CatalogProductAttribute" handler_interface="Magento\Catalog\Test\Handler\CatalogProductAttribute\CatalogProductAttributeInterface" class="Magento\Catalog\Test\Fixture\CatalogProductAttribute"> - <dataset name="default"> - <field name="frontend_label" xsi:type="string">attribute_label%isolation%</field> - <field name="frontend_input" xsi:type="string">Text Field</field> - <field name="is_required" xsi:type="string">No</field> - </dataset> - <field name="attribute_id" is_required="1"> - <default_value xsi:type="null"/> - </field> - <field name="entity_type_id" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="attribute_code" is_required="" group="advanced-properties"> - <default_value xsi:type="null"/> - </field> - <field name="attribute_model" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="backend_model" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="backend_type" is_required=""> - <default_value xsi:type="string">static</default_value> - </field> - <field name="backend_table" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="frontend_model" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="frontend_input" is_required="" group="properties"> - <default_value xsi:type="string">Text Field</default_value> - </field> - <field name="frontend_label" is_required="" group="properties"> - <default_value xsi:type="string">attribute_label%isolation%</default_value> - </field> - <field name="manage_frontend_label" is_required="" group="manage-labels"> - <default_value xsi:type="null"/> - </field> - <field name="frontend_class" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="source_model" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="is_required" is_required="" group="properties"> - <default_value xsi:type="string">No</default_value> - </field> - <field name="is_user_defined" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="is_unique" is_required="" group="advanced-properties"> - <default_value xsi:type="number">0</default_value> - </field> - <field name="note" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="frontend_input_renderer" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="is_global" is_required="" group="advanced-properties"> - <default_value xsi:type="string">1</default_value> - </field> - <field name="is_visible" is_required=""> - <default_value xsi:type="string">1</default_value> - </field> - <field name="is_searchable" is_required="" group="frontend-properties"> - <default_value xsi:type="number">0</default_value> - </field> - <field name="is_filterable" is_required="" group="frontend-properties"> - <default_value xsi:type="number">0</default_value> - </field> - <field name="is_comparable" is_required="" group="frontend-properties"> - <default_value xsi:type="number">0</default_value> - </field> - <field name="is_visible_on_front" is_required="" group="frontend-properties"> - <default_value xsi:type="number">0</default_value> - </field> - <field name="is_html_allowed_on_front" is_required="" group="frontend-properties"> - <default_value xsi:type="number">0</default_value> - </field> - <field name="is_used_for_price_rules" is_required="" group="frontend-properties"> - <default_value xsi:type="number">0</default_value> - </field> - <field name="is_filterable_in_search" is_required="" group="frontend-properties"> - <default_value xsi:type="number">0</default_value> - </field> - <field name="used_in_product_listing" is_required="" group="frontend-properties"> - <default_value xsi:type="number">0</default_value> - </field> - <field name="used_for_sort_by" is_required="" group="frontend-properties"> - <default_value xsi:type="number">0</default_value> - </field> - <field name="apply_to" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="is_visible_in_advanced_search" is_required="" group="frontend-properties"> - <default_value xsi:type="number">0</default_value> - </field> - <field name="position" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="is_wysiwyg_enabled" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="is_used_for_promo_rules" is_required="" group="frontend-properties"> - <default_value xsi:type="number">0</default_value> - </field> - <field name="search_weight" is_required=""> - <default_value xsi:type="string">1</default_value> - </field> - <field name="options" is_required="" group="properties" source="Magento\Catalog\Test\Fixture\CatalogProductAttribute\Options"> - <default_value xsi:type="null"/> - </field> - <field name="default_value_text" group="advanced-properties"/> - <field name="default_value_textarea" group="advanced-properties"/> - <field name="default_value_date" group="advanced-properties" source="Magento\Backend\Test\Fixture\Source\Date"/> - <field name="default_value_yesno" group="advanced-properties"/> - </fixture> + <fixture name="catalogProductAttribute" + module="Magento_Catalog" + type="composite" + collection="Magento\Catalog\Model\Resource\Attribute" + repository_class="Magento\Catalog\Test\Repository\CatalogProductAttribute" + handler_interface="Magento\Catalog\Test\Handler\CatalogProductAttribute\CatalogProductAttributeInterface" + class="Magento\Catalog\Test\Fixture\CatalogProductAttribute"> + <field name="attribute_id" is_required="1" /> + <field name="entity_type_id" is_required="" /> + <field name="attribute_code" is_required="" group="advanced-properties" /> + <field name="attribute_model" is_required="" /> + <field name="backend_model" is_required="" /> + <field name="backend_type" is_required="" /> + <field name="backend_table" is_required="" /> + <field name="frontend_model" is_required="" /> + <field name="frontend_input" is_required="" group="properties" /> + <field name="frontend_label" is_required="" group="properties" /> + <field name="manage_frontend_label" is_required="" group="manage-labels" /> + <field name="frontend_class" is_required="" /> + <field name="source_model" is_required="" /> + <field name="is_required" is_required="" group="properties" /> + <field name="is_user_defined" is_required="" /> + <field name="is_unique" is_required="" group="advanced-properties" /> + <field name="note" is_required="" /> + <field name="frontend_input_renderer" is_required="" /> + <field name="is_global" is_required="" group="advanced-properties" /> + <field name="is_visible" is_required="" /> + <field name="is_searchable" is_required="" group="frontend-properties" /> + <field name="is_filterable" is_required="" group="frontend-properties" /> + <field name="is_comparable" is_required="" group="frontend-properties" /> + <field name="is_visible_on_front" is_required="" group="frontend-properties" /> + <field name="is_html_allowed_on_front" is_required="" group="frontend-properties" /> + <field name="is_used_for_price_rules" is_required="" group="frontend-properties" /> + <field name="is_filterable_in_search" is_required="" group="frontend-properties" /> + <field name="used_in_product_listing" is_required="" group="frontend-properties" /> + <field name="used_for_sort_by" is_required="" group="frontend-properties" /> + <field name="apply_to" is_required="" /> + <field name="is_visible_in_advanced_search" is_required="" group="frontend-properties" /> + <field name="position" is_required="" /> + <field name="is_wysiwyg_enabled" is_required="" /> + <field name="is_used_for_promo_rules" is_required="" group="frontend-properties" /> + <field name="search_weight" is_required="" /> + <field name="options" is_required="" group="properties" repository="Magento\Catalog\Test\Repository\CatalogProductAttribute\Options" /> + <field name="default_value_text" group="advanced-properties" /> + <field name="default_value_textarea" group="advanced-properties" /> + <field name="default_value_date" group="advanced-properties" source="Magento\Backend\Test\Fixture\Source\Date" /> + <field name="default_value_yesno" group="advanced-properties" /> + </fixture> </config> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductAttribute/Options.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductAttribute/Options.php deleted file mode 100644 index e0a28bee41f494b87e9371838ff923dec620680f..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductAttribute/Options.php +++ /dev/null @@ -1,108 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Catalog\Test\Fixture\CatalogProductAttribute; - -use Magento\Mtf\Fixture\FixtureInterface; - -/** - * Class Options - * Prepare Manage Options for attribute - */ -class Options implements FixtureInterface -{ - /** - * Prepared dataSet data - * - * @var array - */ - protected $data; - - /** - * Data set configuration settings - * - * @var array - */ - protected $params; - - /** - * Constructor - * - * @param array $params [optional] - * @param array $data [optional] - */ - public function __construct(array $params, array $data = []) - { - $this->params = $params; - if (isset($data['preset'])) { - $this->data = $this->getPreset($data['preset']); - } else { - $this->data = $data; - } - } - - /** - * 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 = [ - 'default' => [ - [ - 'is_default' => 'Yes', - 'admin' => 'blue', - 'view' => '', - ], - ], - 'two_options' => [ - ['admin' => 'black'], - ['admin' => 'white'], - ], - ]; - - if (!isset($presets[$name])) { - return null; - } - - return $presets[$name]; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.xml index 59bc10f7eeecdc84fcec704f0166306b479f60f5..e295d379e33d2c977a9d2192ee40d4511694ce22 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.xml @@ -6,212 +6,87 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="catalogProductSimple" module="Magento_Catalog" type="eav" entity_type="catalog_product" product_type="simple" collection="Magento\Catalog\Model\Resource\Product\Collection" identifier="sku" repository_class="Magento\Catalog\Test\Repository\CatalogProductSimple" handler_interface="Magento\Catalog\Test\Handler\CatalogProductSimple\CatalogProductSimpleInterface" class="Magento\Catalog\Test\Fixture\CatalogProductSimple"> - <dataset name="default"> - <field name="name" xsi:type="string">Test simple product %isolation%</field> - <field name="sku" xsi:type="string">test_simple_sku_%isolation%</field> - <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> - </field> - <field name="price" xsi:type="array"> - <item name="value" xsi:type="string">100.00</item> - </field> - <field name="weight" xsi:type="string">12.00</field> - <field name="quantity_and_stock_status" xsi:type="array"> - <item name="qty" xsi:type="string">10.00</item> - <item name="is_in_stock" xsi:type="string">In Stock</item> - </field> - <field name="website_ids" xsi:type="array"> - <item name="0" xsi:type="string">Main Website</item> - </field> - <field name="url_key" xsi:type="string">simple-product-%isolation%</field> - </dataset> - <data_config> - <item name="type_id" xsi:type="string">simple</item> - <item name="create_url_params" xsi:type="array"> - <item name="type" xsi:type="string">simple</item> - <item name="set" xsi:type="string">4</item> - </item> - <item name="input_prefix" xsi:type="string">product</item> - </data_config> - <field name="category_ids" is_required="0" group="product-details" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\CategoryIds"> - <default_value xsi:type="null"/> - </field> - <field name="color" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="country_of_manufacture" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="created_at" is_required="1"> - <default_value xsi:type="null"/> - </field> - <field name="custom_design" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="custom_design_from" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="custom_design_to" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="custom_layout_update" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="description" is_required="0" group="product-details"> - <default_value xsi:type="null"/> - </field> - <field name="gallery" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="gift_message_available" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="group_price" is_required="0" group="advanced-pricing" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\GroupPriceOptions"> - <default_value xsi:type="null"/> - </field> - <field name="has_options" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="image" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="image_label" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="manufacturer" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="media_gallery" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="meta_description" is_required="0" group="search-engine-optimization"> - <default_value xsi:type="null"/> - </field> - <field name="meta_keyword" is_required="0" group="search-engine-optimization"> - <default_value xsi:type="null"/> - </field> - <field name="meta_title" is_required="0" group="search-engine-optimization"> - <default_value xsi:type="null"/> - </field> - <field name="minimal_price" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="msrp" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="msrp_display_actual_price_type" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="name" is_required="1" group="product-details"> - <default_value xsi:type="string">Test simple product %isolation%</default_value> - </field> - <field name="old_id" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="options_container" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="page_layout" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="price" is_required="1" group="product-details" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\Price"> - <default_value xsi:type="array"> - <item name="value" xsi:type="number">100</item> - </default_value> - </field> - <field name="quantity_and_stock_status" is_required="0" group="product-details"> - <default_value xsi:type="array"> - <item name="qty" xsi:type="number">10</item> - <item name="is_in_stock" xsi:type="string">In Stock</item> - </default_value> - </field> - <field name="required_options" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="sku" is_required="1" group="product-details"> - <default_value xsi:type="string">test_simple_sku_%isolation%</default_value> - </field> - <field name="small_image" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="small_image_label" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="special_from_date" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="short_description" is_required="0" group="autosettings"> - <default_value xsi:type="null"/> - </field> - <field name="special_price" is_required="0" group="advanced-pricing"> - <default_value xsi:type="null"/> - </field> - <field name="special_to_date" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="status" is_required="0" group="product-details"> - <default_value xsi:type="string">Product online</default_value> - </field> - <field name="tax_class_id" is_required="0" group="product-details" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\TaxClass"> - <default_value xsi:type="string">Taxable Goods</default_value> - </field> - <field name="thumbnail" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="thumbnail_label" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="tier_price" is_required="0" group="advanced-pricing" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\TierPriceOptions"> - <default_value xsi:type="null"/> - </field> - <field name="updated_at" is_required="1"> - <default_value xsi:type="null"/> - </field> - <field name="url_key" is_required="0" group="search-engine-optimization"> - <default_value xsi:type="null"/> - </field> - <field name="url_path" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="visibility" is_required="0" group="autosettings"> - <default_value xsi:type="string">Catalog, Search</default_value> - </field> - <field name="weight" is_required="0" group="product-details"> - <default_value xsi:type="number">12</default_value> - </field> - <field name="id" group="null"/> - <field name="type_id"/> - <field name="attribute_set_id" group="product-details" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\AttributeSetId"> - <default_value xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> - </default_value> - </field> - <field name="custom_attribute" group="product-details" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\CustomAttribute"/> - <field name="custom_options" is_required="0" group="customer-options" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\CustomOptions"/> - <field name="website_ids" group="websites"> - <default_value xsi:type="array"> - <item name="0" xsi:type="string">Main Website</item> - </default_value> - </field> - <field name="is_returnable" is_required="0" group="autosettings"> - <default_value xsi:type="null"/> - </field> - <field name="news_from_date" is_required="0" source="Magento\Backend\Test\Fixture\Source\Date"> - <default_value xsi:type="null"/> - </field> - <field name="news_to_date" is_required="0" source="Magento\Backend\Test\Fixture\Source\Date"> - <default_value xsi:type="null"/> - </field> - <field name="stock_data" group="advanced-inventory"/> - <field name="checkout_data" group="null" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\CheckoutData"/> - <field name="cross_sell_products" group="crosssells" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\CrossSellProducts"/> - <field name="up_sell_products" group="upsells" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\UpSellProducts"/> - <field name="related_products" group="related-products" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\RelatedProducts"/> - <field name="is_virtual" group="product-details"/> - <field name="attributes"/> - <field name="fpt" is_required="0" group="product-details" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\Fpt"> - <default_value xsi:type="null"/> - </field> - </fixture> + <fixture name="catalogProductSimple" + module="Magento_Catalog" + type="eav" + entity_type="catalog_product" + product_type="simple" + collection="Magento\Catalog\Model\Resource\Product\Collection" + identifier="sku" + repository_class="Magento\Catalog\Test\Repository\CatalogProductSimple" + handler_interface="Magento\Catalog\Test\Handler\CatalogProductSimple\CatalogProductSimpleInterface" + class="Magento\Catalog\Test\Fixture\CatalogProductSimple"> + <data_config> + <item name="type_id" xsi:type="string">simple</item> + <item name="create_url_params" xsi:type="array"> + <item name="type" xsi:type="string">simple</item> + <item name="set" xsi:type="string">4</item> + </item> + <item name="input_prefix" xsi:type="string">product</item> + </data_config> + <field name="category_ids" is_required="0" group="product-details" source="Magento\Catalog\Test\Fixture\Product\CategoryIds" /> + <field name="color" is_required="0" /> + <field name="country_of_manufacture" is_required="0" /> + <field name="created_at" is_required="1" /> + <field name="custom_design" is_required="0" /> + <field name="custom_design_from" is_required="0" /> + <field name="custom_design_to" is_required="0" /> + <field name="custom_layout_update" is_required="0" /> + <field name="description" is_required="0" group="product-details" /> + <field name="gallery" is_required="0" /> + <field name="gift_message_available" is_required="0" /> + <field name="group_price" is_required="0" group="advanced-pricing" repository="Magento\Catalog\Test\Repository\Product\GroupPriceOptions" /> + <field name="has_options" is_required="0" /> + <field name="image" is_required="0" /> + <field name="image_label" is_required="0" /> + <field name="manufacturer" is_required="0" /> + <field name="media_gallery" is_required="0" /> + <field name="meta_description" is_required="0" group="search-engine-optimization" /> + <field name="meta_keyword" is_required="0" group="search-engine-optimization" /> + <field name="meta_title" is_required="0" group="search-engine-optimization" /> + <field name="minimal_price" is_required="0" /> + <field name="msrp" is_required="0" /> + <field name="msrp_display_actual_price_type" is_required="0" /> + <field name="name" is_required="1" group="product-details" /> + <field name="old_id" is_required="0" /> + <field name="options_container" is_required="0" /> + <field name="page_layout" is_required="0" /> + <field name="price" is_required="1" group="product-details" source="Magento\Catalog\Test\Fixture\Product\Price" repository="Magento\Catalog\Test\Repository\CatalogProductSimple\Price" /> + <field name="quantity_and_stock_status" is_required="0" group="product-details" /> + <field name="required_options" is_required="0" /> + <field name="sku" is_required="1" group="product-details" /> + <field name="small_image" is_required="0" /> + <field name="small_image_label" is_required="0" /> + <field name="special_from_date" is_required="0" /> + <field name="short_description" is_required="0" group="autosettings" /> + <field name="special_price" is_required="0" group="advanced-pricing" /> + <field name="special_to_date" is_required="0" /> + <field name="status" is_required="0" group="product-details" /> + <field name="tax_class_id" is_required="0" group="product-details" source="Magento\Catalog\Test\Fixture\Product\TaxClass" /> + <field name="thumbnail" is_required="0" /> + <field name="thumbnail_label" is_required="0" /> + <field name="tier_price" is_required="0" group="advanced-pricing" repository="Magento\Catalog\Test\Repository\Product\TierPrice" /> + <field name="updated_at" is_required="1" /> + <field name="url_key" is_required="0" group="search-engine-optimization" /> + <field name="url_path" is_required="0" /> + <field name="visibility" is_required="0" group="autosettings" /> + <field name="weight" is_required="0" group="product-details" /> + <field name="id" group="null" /> + <field name="type_id" /> + <field name="attribute_set_id" group="product-details" source="Magento\Catalog\Test\Fixture\Product\AttributeSetId" /> + <field name="custom_attribute" group="product-details" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\CustomAttribute" /> + <field name="custom_options" is_required="0" group="customer-options" source="Magento\Catalog\Test\Fixture\Product\CustomOptions" repository="Magento\Catalog\Test\Repository\Product\CustomOptions" /> + <field name="website_ids" group="websites" /> + <field name="is_returnable" is_required="0" group="autosettings" /> + <field name="news_from_date" is_required="0" source="Magento\Backend\Test\Fixture\Source\Date" /> + <field name="news_to_date" is_required="0" source="Magento\Backend\Test\Fixture\Source\Date" /> + <field name="stock_data" group="advanced-inventory" /> + <field name="checkout_data" group="null" repository="Magento\Catalog\Test\Repository\CatalogProductSimple\CheckoutData" /> + <field name="cross_sell_products" group="crosssells" source="Magento\Catalog\Test\Fixture\Product\RelatedProducts" /> + <field name="up_sell_products" group="upsells" source="Magento\Catalog\Test\Fixture\Product\RelatedProducts" /> + <field name="related_products" group="related-products" source="Magento\Catalog\Test\Fixture\Product\RelatedProducts" /> + <field name="is_virtual" group="product-details" /> + <field name="attributes" /> + <field name="fpt" is_required="0" group="product-details" repository="Magento\Catalog\Test\Repository\Product\Fpt" /> + </fixture> </config> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CheckoutData.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CheckoutData.php deleted file mode 100644 index 238cfafd0832a956fa2b3991a8cf5b9f5f077b0c..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CheckoutData.php +++ /dev/null @@ -1,216 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Catalog\Test\Fixture\CatalogProductSimple; - -use Magento\Mtf\Fixture\FixtureInterface; - -/** - * Class CheckoutData - * Data for fill product form on frontend - * - * Data keys: - * - preset (Checkout data verification preset name) - */ -class CheckoutData implements FixtureInterface -{ - /** - * Data set configuration settings - * - * @var array - */ - protected $params; - - /** - * Prepared dataSet data - * - * @var array - */ - protected $data; - - /** - * @constructor - * @param array $params - * @param array $data - */ - public function __construct(array $params, array $data = []) - { - $this->params = $params; - $preset = []; - if (isset($data['preset'])) { - $preset = $this->getPreset($data['preset']); - unset($data['preset']); - } - $this->data = empty($preset) ? $data : array_replace_recursive($preset, $data); - } - - /** - * Persist custom selections 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; - } - - /** - * Return array preset - * - * @param string $name - * @return array|null - * - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) - */ - protected function getPreset($name) - { - $presets = [ - 'with_two_custom_option' => [ - 'options' => [ - 'custom_options' => [ - [ - 'title' => 'attribute_key_0', - 'value' => 'option_key_0', - ], - [ - 'title' => 'attribute_key_1', - 'value' => 'Content option %isolation%', - ], - ], - ], - 'qty' => 1, - 'cartItem' => [ - 'price' => 340, - 'subtotal' => 340, - ], - ], - 'forUpdateMiniShoppingCart' => [ - 'options' => [ - 'custom_options' => [ - [ - 'title' => 'attribute_key_0', - 'value' => 'option_key_1', - ], - [ - 'title' => 'attribute_key_1', - 'value' => 'Content option %isolation%', - ], - ], - ], - 'qty' => 2, - 'cartItem' => [ - 'price' => 370, - 'subtotal' => 740, - ], - ], - 'options-suite' => [ - 'options' => [ - 'custom_options' => [ - [ - 'title' => 'attribute_key_0', - 'value' => 'Field value 1 %isolation%', - ], - [ - 'title' => 'attribute_key_1', - 'value' => 'Field value 2 %isolation%' - ], - [ - 'title' => 'attribute_key_2', - 'value' => 'option_key_1' - ], - [ - 'title' => 'attribute_key_3', - 'value' => 'option_key_0' - ], - ], - ], - ], - 'drop_down_with_one_option_fixed_price' => [ - 'options' => [ - 'custom_options' => [ - [ - 'title' => 'attribute_key_0', - 'value' => 'option_key_0', - ], - ], - ], - ], - 'drop_down_with_one_option_percent_price' => [ - 'options' => [ - 'custom_options' => [ - [ - 'title' => 'attribute_key_0', - 'value' => 'option_key_0', - ], - ], - ], - ], - 'order_default' => [ - 'qty' => 1, - 'cartItem' => [ - 'price' => 560, - 'subtotal' => 560, - ], - ], - 'two_products' => [ - 'qty' => 2, - 'cartItem' => [ - 'price' => 100, - 'subtotal' => 200, - ], - ], - 'order_big_qty' => [ - 'qty' => 900, - ], - 'order_custom_price' => [ - 'qty' => 3, - 'checkout_data' => [ - 'use_custom_price' => "Yes", - 'custom_price' => 100, - ], - 'cartItem' => [], - ], - 'order_special_price' => [ - 'qty' => 1, - 'cartItem' => [ - 'price' => 9, - 'subtotal' => 9, - ], - ], - 'order_10_dollar_product' => [ - 'qty' => 1, - 'cartItem' => [ - 'price' => 10, - 'subtotal' => 10, - ], - ] - ]; - return isset($presets[$name]) ? $presets[$name] : []; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CrossSellProducts.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CrossSellProducts.php deleted file mode 100644 index 7c4a89ea39b40240a29baff34f85cc87a0cc0df8..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CrossSellProducts.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Catalog\Test\Fixture\CatalogProductSimple; - -/** - * Class CrossSellProducts - * Create cross sell products - */ -class CrossSellProducts extends AbstractRelatedProducts -{ - // -} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CustomAttribute.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CustomAttribute.php index 49fb328876a9cac473cb9e402bbffe57e6cedc4f..1e9a5690533baef1822206cfdfa4f2d57ce134a5 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CustomAttribute.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CustomAttribute.php @@ -6,22 +6,15 @@ namespace Magento\Catalog\Test\Fixture\CatalogProductSimple; -use Magento\Catalog\Test\Fixture\CatalogProductAttribute; +use Magento\Mtf\Fixture\DataSource; use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Mtf\Fixture\FixtureInterface; +use Magento\Catalog\Test\Fixture\CatalogProductAttribute; /** * Source for attribute field. */ -class CustomAttribute implements FixtureInterface +class CustomAttribute extends DataSource { - /** - * Attribute name. - * - * @var string - */ - protected $data; - /** * Attribute fixture. * @@ -29,13 +22,6 @@ class CustomAttribute implements FixtureInterface */ protected $attribute; - /** - * Data set configuration settings. - * - * @var array - */ - protected $params; - /** * @constructor * @param FixtureFactory $fixtureFactory @@ -45,9 +31,9 @@ class CustomAttribute implements FixtureInterface public function __construct(FixtureFactory $fixtureFactory, array $params, $data) { $this->params = $params; - if (is_array($data) && isset($data['dataSet'])) { + if (is_array($data) && isset($data['dataset'])) { /** @var CatalogProductAttribute $data */ - $data = $fixtureFactory->createByCode('catalogProductAttribute', ['dataSet' => $data['dataSet']]); + $data = $fixtureFactory->createByCode('catalogProductAttribute', ['dataset' => $data['dataset']]); } $this->data['value'] = $this->getDefaultAttributeValue($data); $this->data['code'] = $data->hasData('attribute_code') == false @@ -84,29 +70,6 @@ class CustomAttribute implements FixtureInterface return $value; } - /** - * 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 CatalogProductAttribute fixture. * @@ -117,16 +80,6 @@ class CustomAttribute implements FixtureInterface return $this->attribute; } - /** - * Return data set configuration settings. - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } - /** * Get default attribute code according to attribute label. * diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CustomOptions.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CustomOptions.php deleted file mode 100755 index c6fa45ab95730ed273a19679991cbb6f622288a3..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CustomOptions.php +++ /dev/null @@ -1,455 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Catalog\Test\Fixture\CatalogProductSimple; - -use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Mtf\Fixture\FixtureInterface; - -/** - * Custom options fixture - * - * Data keys: - * - preset (Custom options preset name) - * - import_products (comma separated data set name) - */ -class CustomOptions implements FixtureInterface -{ - /** - * Prepared dataSet data - * - * @var array - */ - protected $data; - - /** - * Custom options data - * - * @var array - */ - protected $customOptions; - - /** - * Data set configuration settings - * - * @var array - */ - protected $params; - - /** - * @constructor - * @param array $params - * @param array $data - * @param FixtureFactory|null $fixtureFactory - */ - public function __construct(array $params, array $data, FixtureFactory $fixtureFactory) - { - $this->params = $params; - $this->data = (!isset($data['preset']) && !isset($data['import_products'])) ? $data : []; - $this->customOptions = $this->data; - - if (isset($data['preset'])) { - $this->data = $this->replaceData($this->getPreset($data['preset']), mt_rand()); - $this->customOptions = $this->data; - } - if (isset($data['import_products'])) { - $importData = explode(',', $data['import_products']); - $importCustomOptions = []; - $importProducts = []; - foreach ($importData as $item) { - list($fixture, $dataSet) = explode('::', $item); - $product = $fixtureFactory->createByCode($fixture, ['dataSet' => $dataSet]); - if ($product->hasData('id') !== null) { - $product->persist(); - } - $importCustomOptions = array_merge($importCustomOptions, $product->getCustomOptions()); - $importProducts[] = $product->getSku(); - } - $this->customOptions = array_merge($this->data, $importCustomOptions); - $this->data['import'] = ['options' => $importCustomOptions, 'products' => $importProducts]; - } - } - - /** - * 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; - } - - /** - * Persist custom selections 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 all custom options - * - * @return array - */ - public function getCustomOptions() - { - return $this->customOptions; - } - - /** - * Return data set configuration settings - * - * @return string - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * @param string $name - * @return array|null - * - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) - */ - protected function getPreset($name) - { - $presets = [ - 'drop_down_with_one_option_fixed_price' => [ - [ - 'title' => 'custom option drop down %isolation%', - 'is_require' => 'Yes', - 'type' => 'Select/Drop-down', - 'options' => [ - [ - 'title' => '30 bucks', - 'price' => 30, - 'price_type' => 'Fixed', - 'sku' => 'sku_drop_down_row_1', - ], - ], - ], - ], - 'drop_down_with_one_option_percent_price' => [ - [ - 'title' => 'custom option drop down %isolation%', - 'is_require' => 'Yes', - 'type' => 'Select/Drop-down', - 'options' => [ - [ - 'title' => '40 bucks', - 'price' => 40, - 'price_type' => 'Percent', - 'sku' => 'sku_drop_down_row_1', - ], - ], - ], - ], - 'options-suite' => [ - [ - 'title' => 'Test1 option %isolation%', - 'is_require' => 'Yes', - 'type' => 'Text/Field', - 'options' => [ - [ - 'price' => 120.03, - 'price_type' => 'Fixed', - 'sku' => 'sku1_%isolation%', - 'max_characters' => 45, - ], - ], - ], - [ - 'title' => 'Test2 option %isolation%', - 'is_require' => 'Yes', - 'type' => 'Text/Field', - 'options' => [ - [ - 'price' => 120.03, - 'price_type' => 'Fixed', - 'sku' => 'sku1_%isolation%', - 'max_characters' => 45, - ], - ] - ], - [ - 'title' => 'Test3 option %isolation%', - 'is_require' => 'Yes', - 'type' => 'Select/Drop-down', - 'options' => [ - [ - 'title' => 'Test3-1 %isolation%', - 'price' => 110.01, - 'price_type' => 'Percent', - 'sku' => 'sku2_%isolation%', - ], - [ - 'title' => 'Test3-2 %isolation%', - 'price' => 210.02, - 'price_type' => 'Fixed', - 'sku' => 'sku3_%isolation%' - ], - ] - ], - [ - 'title' => 'Test4 option %isolation%', - 'is_require' => 'Yes', - 'type' => 'Select/Drop-down', - 'options' => [ - [ - 'title' => 'Test1 %isolation%', - 'price' => 10.01, - 'price_type' => 'Percent', - 'sku' => 'sku2_%isolation%', - ], - [ - 'title' => 'Test2 %isolation%', - 'price' => 20.02, - 'price_type' => 'Fixed', - 'sku' => 'sku3_%isolation%' - ], - ] - ], - ], - 'default' => [ - [ - 'title' => 'custom option drop down %isolation%', - 'is_require' => 'Yes', - 'type' => 'Select/Drop-down', - 'options' => [ - [ - 'title' => '10 percent', - 'price' => 10, - 'price_type' => 'Percent', - 'sku' => 'sku_drop_down_row_1', - ], - ], - ], - [ - 'title' => 'custom option drop down2 %isolation%', - 'is_require' => 'Yes', - 'type' => 'Select/Drop-down', - 'options' => [ - [ - 'title' => '20 percent', - 'price' => 20, - 'price_type' => 'Percent', - 'sku' => 'sku_drop_down_row_2', - ], - ] - ], - ], - 'two_options' => [ - [ - 'title' => 'custom option drop down %isolation%', - 'is_require' => 'Yes', - 'type' => 'Select/Drop-down', - 'options' => [ - [ - 'title' => '10 percent', - 'price' => 10, - 'price_type' => 'Percent', - 'sku' => 'sku_drop_down_row_1', - ], - [ - 'title' => '20 percent', - 'price' => 20, - 'price_type' => 'Percent', - 'sku' => 'sku_drop_down_row_2' - ], - ], - ], - [ - 'title' => 'custom option field %isolation%', - 'is_require' => 'Yes', - 'type' => 'Text/Field', - 'options' => [ - [ - 'price' => 10, - 'price_type' => 'Fixed', - 'sku' => 'sku_field_option_%isolation%', - 'max_characters' => 1024, - ], - ] - ], - ], - 'all_types' => [ - [ - 'title' => 'custom option field %isolation%', - 'type' => 'Text/Field', - 'is_require' => 'Yes', - 'options' => [ - [ - 'price' => 10, - 'price_type' => 'Fixed', - 'sku' => 'sku_field_option_%isolation%', - 'max_characters' => 1024, - ], - ], - ], - [ - 'title' => 'custom option Area %isolation%', - 'is_require' => 'Yes', - 'type' => 'Text/Area', - 'options' => [ - [ - 'price' => 10, - 'price_type' => 'Fixed', - 'sku' => 'sku_area_row_%isolation%', - 'max_characters' => '10', - ], - ] - ], - [ - 'title' => 'custom option File %isolation%', - 'is_require' => 'No', - 'type' => 'File/File', - 'options' => [ - [ - 'price' => 10, - 'price_type' => 'Fixed', - 'sku' => 'sku_file_row_%isolation%', - 'file_extension' => 'jpg', - 'image_size_x' => '100', - 'image_size_y' => '100', - ], - ] - ], - [ - 'title' => 'custom option drop down %isolation%', - 'is_require' => 'Yes', - 'type' => 'Select/Drop-down', - 'options' => [ - [ - 'title' => '10 percent', - 'price' => 10, - 'price_type' => 'Percent', - 'sku' => 'sku_drop_down_row_1_%isolation%', - ], - [ - 'title' => '20 percent', - 'price' => 20, - 'price_type' => 'Percent', - 'sku' => 'sku_drop_down_row_2_%isolation%' - ], - [ - 'title' => '30 fixed', - 'price' => 30, - 'price_type' => 'Fixed', - 'sku' => 'sku_drop_down_row_3_%isolation%' - ], - ] - ], - [ - 'title' => 'custom option Radio Buttons %isolation%', - 'is_require' => 'Yes', - 'type' => 'Select/Radio Buttons', - 'options' => [ - [ - 'title' => '20 fixed', - 'price' => 20, - 'price_type' => 'Fixed', - 'sku' => 'sku_radio_buttons_row%isolation%', - ], - ] - ], - [ - 'title' => 'custom option Checkbox %isolation%', - 'is_require' => 'Yes', - 'type' => 'Select/Checkbox', - 'options' => [ - [ - 'title' => '20 fixed', - 'price' => 20, - 'price_type' => 'Fixed', - 'sku' => 'sku_checkbox_row%isolation%', - ], - ] - ], - [ - 'title' => 'custom option Multiple Select %isolation%', - 'is_require' => 'Yes', - 'type' => 'Select/Multiple Select', - 'options' => [ - [ - 'title' => '20 fixed', - 'price' => 20, - 'price_type' => 'Fixed', - 'sku' => 'sku_multiple_select_row%isolation%', - ], - ] - ], - [ - 'title' => 'custom option Date %isolation%', - 'is_require' => 'Yes', - 'type' => 'Date/Date', - 'options' => [ - [ - 'price' => 20, - 'price_type' => 'Fixed', - 'sku' => 'sku_date_row%isolation%', - ], - ] - ], - [ - 'title' => 'custom option Date & Time %isolation%', - 'is_require' => 'Yes', - 'type' => 'Date/Date & Time', - 'options' => [ - [ - 'price' => 20, - 'price_type' => 'Fixed', - 'sku' => 'sku_date_and_time_row%isolation%', - ], - ] - ], - [ - 'title' => 'custom option Time %isolation%', - 'is_require' => 'Yes', - 'type' => 'Date/Time', - 'options' => [ - [ - 'price' => 20, - 'price_type' => 'Fixed', - 'sku' => 'sku_time_row%isolation%', - ], - ] - ], - ], - ]; - if (!isset($presets[$name])) { - return null; - } - return $presets[$name]; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/Fpt.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/Fpt.php deleted file mode 100644 index 8d29bd7bd8bf13d7e76cd74e233d633f356c74c9..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/Fpt.php +++ /dev/null @@ -1,87 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Catalog\Test\Fixture\CatalogProductSimple; - -use Magento\Mtf\Fixture\FixtureInterface; - -/** - * Class Fpt - * - * Data keys: - * - preset (Price options preset name) - */ -class Fpt implements FixtureInterface -{ - /** - * @param array $params - * @param array $data - */ - public function __construct(array $params, array $data = []) - { - $this->params = $params; - if (isset($data['preset'])) { - $this->data = $this->getPreset($data['preset']); - } - } - - /** - * Persist group price - * - * @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; - } - - /** - * Get fpt preset for product fixture - * - * @param string $name - * @return mixed|null - */ - protected function getPreset($name) - { - $presets = [ - 'one_fpt_for_all_states' => [ - [ - 'price' => 10, - 'website' => 'All Websites [USD]', - 'country_name' => 'United States', - 'state_name' => '*', - ], - ], - ]; - if (!isset($presets[$name])) { - return null; - } - return $presets[$name]; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/GroupPriceOptions.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/GroupPriceOptions.php deleted file mode 100644 index 2640e83ddd9bd77aa21414d02a759e3ac7538526..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/GroupPriceOptions.php +++ /dev/null @@ -1,113 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Catalog\Test\Fixture\CatalogProductSimple; - -use Magento\Mtf\Fixture\FixtureInterface; - -/** - * Class GroupPriceOptions - * - * Data keys: - * - preset (Price options preset name) - * - products (comma separated sku identifiers) - */ -class GroupPriceOptions implements FixtureInterface -{ - /** - * @var \Magento\Mtf\Fixture\FixtureFactory - */ - protected $fixtureFactory; - - /** - * @param array $params - * @param array $data - */ - public function __construct(array $params, array $data = []) - { - $this->params = $params; - if (isset($data['preset'])) { - $this->data = $this->getPreset($data['preset']); - } - } - - /** - * Persist group price - * - * @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 data set configuration settings - * - * @return string - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Get preset array - * - * @param string $name - * @return mixed|null - */ - protected function getPreset($name) - { - $presets = [ - 'MAGETWO-23055' => [ - [ - 'price' => 90, - 'website' => 'All Websites [USD]', - 'customer_group' => 'NOT LOGGED IN', - ], - ], - 'MAGETWO-23061' => [ - [ - 'price' => 20, - 'website' => 'All Websites [USD]', - 'customer_group' => 'NOT LOGGED IN', - ], - ], - 'default' => [ - [ - 'price' => 20, - 'website' => 'All Websites [USD]', - 'customer_group' => 'NOT LOGGED IN', - ], - ], - 'tax_calculation' => [ - [ - 'price' => 90.99, - 'website' => 'All Websites [USD]', - 'customer_group' => 'General', - ], - ], - ]; - if (!isset($presets[$name])) { - return null; - } - return $presets[$name]; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/Price.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/Price.php deleted file mode 100644 index 470558b5d4d0ba8c8f8e26f410b894fea1ed6696..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/Price.php +++ /dev/null @@ -1,146 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Catalog\Test\Fixture\CatalogProductSimple; - -use Magento\Mtf\Fixture\FixtureInterface; - -/** - * Class Price - * - * Data keys: - * - preset (Price verification preset name) - * - value (Price value) - * - */ -class Price implements FixtureInterface -{ - /** - * Prepared dataSet data - * - * @var array - */ - protected $data; - - /** - * Data set configuration settings - * - * @var array - */ - protected $params; - - /** - * @var \Magento\Mtf\Fixture\FixtureFactory - */ - protected $fixtureFactory; - - /** - * @var string - */ - protected $currentPreset; - - /** - * @param array $params - * @param array $data - */ - public function __construct(array $params, $data = []) - { - $this->params = $params; - $this->data = (!isset($data['preset']) && !isset($data['value'])) ? $data : []; - - if (isset($data['value'])) { - $this->data = $data['value']; - if (is_array($this->data)) { - $this->data = array_filter( - $this->data, - function ($value) { - return $value !== '-'; - } - ); - } - } - if (isset($data['preset'])) { - $this->currentPreset = $data['preset']; - } - } - - /** - * Persist custom selections products - * - * @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 data set configuration settings - * - * @return string - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * @return array|null - */ - public function getPreset() - { - $presets = [ - 'drop_down_with_one_option_fixed_price' => [ - 'category_price' => '100.00', - 'product_price' => '100.00', - 'cart_price' => '130.00', - ], - 'drop_down_with_one_option_percent_price' => [ - 'category_price' => '100.00', - 'product_price' => '100.00', - 'cart_price' => '140.00', - ], - 'MAGETWO-23029' => [ - 'category_price' => '100.00', - 'category_special_price' => '90.00', - 'product_price' => '100.00', - 'product_special_price' => '90.00', - 'cart_price' => '120.00', - ], - 'MAGETWO-23030' => [ - 'category_price' => '100.00', - 'category_special_price' => '90.00', - 'product_price' => '100.00', - 'product_special_price' => '90.00', - 'cart_price' => '126.00', - ], - 'MAGETWO-23036' => [ - 'category_price' => '100.00', - 'category_special_price' => '90.00', - 'product_price' => '100.00', - 'product_special_price' => '90.00', - 'cart_price' => '90.00', - ], - ]; - if (!isset($presets[$this->currentPreset])) { - return null; - } - return $presets[$this->currentPreset]; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/RelatedProducts.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/RelatedProducts.php deleted file mode 100644 index ccb66fbfb3359384dd6f11504349a6d3baf057c9..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/RelatedProducts.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Catalog\Test\Fixture\CatalogProductSimple; - -/** - * Class RelatedProducts - * Create related products - */ -class RelatedProducts extends AbstractRelatedProducts -{ - // -} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/TierPriceOptions.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/TierPriceOptions.php deleted file mode 100644 index 1d2c292ec6e6392fa304cf14697b10598df989a7..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/TierPriceOptions.php +++ /dev/null @@ -1,101 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Catalog\Test\Fixture\CatalogProductSimple; - -use Magento\Mtf\Fixture\FixtureInterface; - -/** - * Class TierPriceOptions - * - * Data keys: - * - preset (Price options preset name) - * - products (comma separated sku identifiers) - */ -class TierPriceOptions implements FixtureInterface -{ - /** - * @param array $params - * @param array $data - */ - public function __construct(array $params, array $data = []) - { - $this->params = $params; - if (isset($data['preset'])) { - $this->data = $this->getPreset($data['preset']); - } - } - - /** - * Persist group price - * - * @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 data set configuration settings - * - * @return string - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * @param string $name - * @return mixed|null - */ - protected function getPreset($name) - { - $presets = [ - 'default' => [ - [ - 'price' => 15, - 'website' => 'All Websites [USD]', - 'price_qty' => 3, - 'customer_group' => 'ALL GROUPS', - ], - [ - 'price' => 24, - 'website' => 'All Websites [USD]', - 'price_qty' => 15, - 'customer_group' => 'ALL GROUPS' - ], - ], - 'MAGETWO-23002' => [ - [ - 'price' => 90, - 'website' => 'All Websites [USD]', - 'price_qty' => 2, - 'customer_group' => 'ALL GROUPS', - ], - ], - ]; - - if (!isset($presets[$name])) { - return null; - } - return $presets[$name]; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/UpSellProducts.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/UpSellProducts.php deleted file mode 100644 index 887125967f75caccdd9caf42c8fe9e5dadba867f..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/UpSellProducts.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Catalog\Test\Fixture\CatalogProductSimple; - -/** - * Class UpSellProducts - * Create up sell products - */ -class UpSellProducts extends AbstractRelatedProducts -{ - // -} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductVirtual.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductVirtual.xml index 158e62ce41f722ec50d060011baf95da903f15f9..edcfc39f2c5b08532d89fbc84807b2a661fda497 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductVirtual.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductVirtual.xml @@ -6,203 +6,82 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="catalogProductVirtual" module="Magento_Catalog" type="eav" entity_type="catalog_product" product_type="virtual" collection="Magento\Catalog\Model\Resource\Product\Collection" identifier="sku" repository_class="Magento\Catalog\Test\Repository\CatalogProductVirtual" handler_interface="Magento\Catalog\Test\Handler\CatalogProductVirtual\CatalogProductVirtualInterface" class="Magento\Catalog\Test\Fixture\CatalogProductVirtual"> - <dataset name="default"> - <field name="name" xsi:type="string">Test virtual product %isolation%</field> - <field name="sku" xsi:type="string">test_virtual_sku_%isolation%</field> - <field name="price" xsi:type="array"> - <item name="value" xsi:type="string">100.00</item> - </field> - <field name="quantity_and_stock_status" xsi:type="array"> - <item name="qty" xsi:type="string">10.00</item> - <item name="is_in_stock" xsi:type="string">In Stock</item> - </field> - <field name="is_virtual" xsi:type="string">Yes</field> - </dataset> - <data_config> - <item name="type_id" xsi:type="string">virtual</item> - <item name="create_url_params" xsi:type="array"> - <item name="type" xsi:type="string">virtual</item> - <item name="set" xsi:type="string">4</item> - </item> - <item name="input_prefix" xsi:type="string">product</item> - </data_config> - <field name="is_virtual" group="product-details"> - <default_value xsi:type="string">Yes</default_value> - </field> - <field name="category_ids" is_required="0" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\CategoryIds" group="product-details"> - <default_value xsi:type="null"/> - </field> - <field name="color" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="country_of_manufacture" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="created_at" is_required="1"> - <default_value xsi:type="null"/> - </field> - <field name="custom_design" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="custom_design_from" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="custom_design_to" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="custom_layout_update" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="description" is_required="0" group="product-details"> - <default_value xsi:type="null"/> - </field> - <field name="gallery" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="gift_message_available" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="group_price" is_required="0" group="advanced-pricing" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\GroupPriceOptions"> - <default_value xsi:type="null"/> - </field> - <field name="has_options" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="image" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="image_label" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="manufacturer" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="media_gallery" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="meta_description" is_required="0" group="search-engine-optimization"> - <default_value xsi:type="null"/> - </field> - <field name="meta_keyword" is_required="0" group="search-engine-optimization"> - <default_value xsi:type="null"/> - </field> - <field name="meta_title" is_required="0" group="search-engine-optimization"> - <default_value xsi:type="null"/> - </field> - <field name="minimal_price" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="msrp" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="msrp_display_actual_price_type" is_required="0"> - <default_value xsi:type="string">Use config</default_value> - </field> - <field name="name" is_required="1" group="product-details"> - <default_value xsi:type="string">Test virtual product %isolation%</default_value> - </field> - <field name="news_from_date" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="news_to_date" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="old_id" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="options_container" is_required="0"> - <default_value xsi:type="string">Block after Info Column</default_value> - </field> - <field name="page_layout" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="price" is_required="1" group="product-details" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\Price"> - <default_value xsi:type="array"> - <item name="value" xsi:type="number">100</item> - </default_value> - </field> - <field name="quantity_and_stock_status" is_required="0" group="product-details"> - <default_value xsi:type="array"> - <item name="qty" xsi:type="number">10</item> - <item name="is_in_stock" xsi:type="string">In Stock</item> - </default_value> - </field> - <field name="required_options" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="sku" is_required="1" group="product-details"> - <default_value xsi:type="string">sku_test_virtual_product_%isolation%</default_value> - </field> - <field name="small_image" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="small_image_label" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="special_from_date" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="short_description" is_required="0" group="autosettings"> - <default_value xsi:type="null"/> - </field> - <field name="special_price" is_required="0" group="advanced-pricing"> - <default_value xsi:type="null"/> - </field> - <field name="special_to_date" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="status" is_required="0" group="product-details"> - <default_value xsi:type="string">Product online</default_value> - </field> - <field name="tax_class_id" is_required="0" group="product-details" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\TaxClass"> - <default_value xsi:type="string">Taxable Goods</default_value> - </field> - <field name="thumbnail" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="thumbnail_label" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="tier_price" is_required="0" group="advanced-pricing" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\TierPriceOptions"> - <default_value xsi:type="null"/> - </field> - <field name="updated_at" is_required="1"> - <default_value xsi:type="null"/> - </field> - <field name="url_key" is_required="0" group="search-engine-optimization"> - <default_value xsi:type="null"/> - </field> - <field name="url_path" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="visibility" is_required="0" group="autosettings"> - <default_value xsi:type="string">Catalog, Search</default_value> - </field> - <field name="weight" is_required="0" group="product-details"> - <default_value xsi:type="null"/> - </field> - <field name="id"/> - <field name="type_id"/> - <field name="attribute_set_id" group="product-details" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\AttributeSetId"/> - <field name="custom_options" is_required="0" group="customer-options" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\CustomOptions"/> - <field name="website_ids" group="websites"> - <default_value xsi:type="array"> - <item name="0" xsi:type="string">Main Website</item> - </default_value> - </field> - <field name="checkout_data" group="null" source="Magento\Catalog\Test\Fixture\CatalogProductVirtual\CheckoutData"/> - <field name="cross_sell_products" - group="crosssells" - source="Magento\Catalog\Test\Fixture\CatalogProductSimple\CrossSellProducts" - /> - <field name="up_sell_products" - group="upsells" - source="Magento\Catalog\Test\Fixture\CatalogProductSimple\UpSellProducts" - /> - <field name="related_products" - group="related-products" - source="Magento\Catalog\Test\Fixture\CatalogProductSimple\RelatedProducts" - /> - </fixture> + <fixture name="catalogProductVirtual" + module="Magento_Catalog" + type="eav" + entity_type="catalog_product" + product_type="virtual" + collection="Magento\Catalog\Model\Resource\Product\Collection" + identifier="sku" + repository_class="Magento\Catalog\Test\Repository\CatalogProductVirtual" + handler_interface="Magento\Catalog\Test\Handler\CatalogProductVirtual\CatalogProductVirtualInterface" + class="Magento\Catalog\Test\Fixture\CatalogProductVirtual"> + <data_config> + <item name="type_id" xsi:type="string">virtual</item> + <item name="create_url_params" xsi:type="array"> + <item name="type" xsi:type="string">virtual</item> + <item name="set" xsi:type="string">4</item> + </item> + <item name="input_prefix" xsi:type="string">product</item> + </data_config> + <field name="is_virtual" group="product-details" /> + <field name="category_ids" is_required="0" source="Magento\Catalog\Test\Fixture\Product\CategoryIds" group="product-details" /> + <field name="color" is_required="0" /> + <field name="country_of_manufacture" is_required="0" /> + <field name="created_at" is_required="1" /> + <field name="custom_design" is_required="0" /> + <field name="custom_design_from" is_required="0" /> + <field name="custom_design_to" is_required="0" /> + <field name="custom_layout_update" is_required="0" /> + <field name="description" is_required="0" group="product-details" /> + <field name="gallery" is_required="0" /> + <field name="gift_message_available" is_required="0" /> + <field name="group_price" is_required="0" group="advanced-pricing" repository="Magento\Catalog\Test\Repository\Product\GroupPriceOptions" /> + <field name="has_options" is_required="0" /> + <field name="image" is_required="0" /> + <field name="image_label" is_required="0" /> + <field name="manufacturer" is_required="0" /> + <field name="media_gallery" is_required="0" /> + <field name="meta_description" is_required="0" group="search-engine-optimization" /> + <field name="meta_keyword" is_required="0" group="search-engine-optimization" /> + <field name="meta_title" is_required="0" group="search-engine-optimization" /> + <field name="minimal_price" is_required="0" /> + <field name="msrp" is_required="0" /> + <field name="msrp_display_actual_price_type" is_required="0" /> + <field name="name" is_required="1" group="product-details" /> + <field name="news_from_date" is_required="0" /> + <field name="news_to_date" is_required="0" /> + <field name="old_id" is_required="0" /> + <field name="options_container" is_required="0" /> + <field name="page_layout" is_required="0" /> + <field name="price" is_required="1" group="product-details" source="Magento\Catalog\Test\Fixture\Product\Price" /> + <field name="quantity_and_stock_status" is_required="0" group="product-details" /> + <field name="required_options" is_required="0" /> + <field name="sku" is_required="1" group="product-details" /> + <field name="small_image" is_required="0" /> + <field name="small_image_label" is_required="0" /> + <field name="special_from_date" is_required="0" /> + <field name="short_description" is_required="0" group="autosettings" /> + <field name="special_price" is_required="0" group="advanced-pricing" /> + <field name="special_to_date" is_required="0" /> + <field name="status" is_required="0" group="product-details" /> + <field name="tax_class_id" is_required="0" group="product-details" source="Magento\Catalog\Test\Fixture\Product\TaxClass" /> + <field name="thumbnail" is_required="0" /> + <field name="thumbnail_label" is_required="0" /> + <field name="tier_price" is_required="0" group="advanced-pricing" repository="Magento\Catalog\Test\Repository\Product\TierPrice" /> + <field name="updated_at" is_required="1" /> + <field name="url_key" is_required="0" group="search-engine-optimization" /> + <field name="url_path" is_required="0" /> + <field name="visibility" is_required="0" group="autosettings" /> + <field name="weight" is_required="0" group="product-details" /> + <field name="id" /> + <field name="type_id" /> + <field name="attribute_set_id" group="product-details" source="Magento\Catalog\Test\Fixture\Product\AttributeSetId" /> + <field name="custom_options" is_required="0" group="customer-options" source="Magento\Catalog\Test\Fixture\Product\CustomOptions" repository="Magento\Catalog\Test\Repository\Product\CustomOptions" /> + <field name="website_ids" group="websites" /> + <field name="checkout_data" group="null" repository="Magento\Catalog\Test\Repository\CatalogProductVirtual\CheckoutData" /> + <field name="cross_sell_products" group="crosssells" source="Magento\Catalog\Test\Fixture\Product\RelatedProducts" /> + <field name="up_sell_products" group="upsells" source="Magento\Catalog\Test\Fixture\Product\RelatedProducts" /> + <field name="related_products" group="related-products" source="Magento\Catalog\Test\Fixture\Product\RelatedProducts" /> + </fixture> </config> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductVirtual/CheckoutData.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductVirtual/CheckoutData.php deleted file mode 100644 index bb1ba27ff3bcf8eae1a25b606d51d812591edea4..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductVirtual/CheckoutData.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Catalog\Test\Fixture\CatalogProductVirtual; - -/** - * Class CheckoutData - * Data for fill product form on frontend - * - * Data keys: - * - preset (Checkout data verification preset name) - */ -class CheckoutData extends \Magento\Catalog\Test\Fixture\CatalogProductSimple\CheckoutData -{ - /** - * Get preset array - * - * @param $name - * @return array|null - */ - protected function getPreset($name) - { - $presets = [ - 'order_default' => [ - 'qty' => 1, - ], - 'product_50_dollar' => [ - 'qty' => 1, - 'cartItem' => [ - 'price' => 50, - 'qty' => 1, - 'subtotal' => 50, - ], - ], - 'order_custom_price' => [ - 'qty' => 3, - 'checkout_data' => [ - 'use_custom_price' => "Yes", - 'custom_price' => 100, - ], - ], - 'order_big_qty' => [ - 'qty' => 900, - ], - ]; - return isset($presets[$name]) ? $presets[$name] : null; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Category.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Category.xml index 9ea63b5e3616f573ba5385f127969f81779f8210..2a973efeac3d27b96ac79f636800b6cc8aa4f521 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Category.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Category.xml @@ -6,80 +6,38 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="category" module="Magento_Catalog" type="eav" entity_type="catalog_category_entity" collection="Magento\Catalog\Model\Resource\Category\Collection" repository_class="Magento\Catalog\Test\Repository\Category" handler_interface="Magento\Catalog\Test\Handler\Category\CategoryInterface" class="Magento\Catalog\Test\Fixture\Category"> - <dataset name="default"> - <field name="name" xsi:type="string">Category%isolation%</field> - <field name="url_key" xsi:type="string">category%isolation%</field> - <field name="is_active" xsi:type="string">Yes</field> - <field name="include_in_menu" xsi:type="string">Yes</field> - <field name="parent_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default_category</item> - </field> - </dataset> - <field name="entity_id" is_required="1"> - <default_value xsi:type="null"/> - </field> - <field name="entity_type_id" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="attribute_set_id" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="description" is_required="0" group="general_information"> - <default_value xsi:type="null"/> - </field> - <field name="parent_id" is_required="" group="null" source="Magento\Catalog\Test\Fixture\Category\ParentId"> - <default_value xsi:type="number">2</default_value> - </field> - <field name="created_at" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="updated_at" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="path" is_required="" group="null"> - <default_value xsi:type="string">Default Category</default_value> - </field> - <field name="position" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="level" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="children_count" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="available_product_listing_config" is_required="" group="display_setting"> - <default_value xsi:type="null"/> - </field> - <field name="available_sort_by" is_required="0" group="display_setting"> - <default_value xsi:type="null"/> - </field> - <field name="default_product_listing_config" is_required="0" group="display_setting"> - <default_value xsi:type="null"/> - </field> - <field name="default_sort_by" is_required="0" group="display_setting"> - <default_value xsi:type="null"/> - </field> - <field name="meta_title" is_required="" group="general_information"> - <default_value xsi:type="null"/> - </field> - <field name="id" group="null"/> - <field name="name" group="general_information"> - <default_value xsi:type="string">Category%isolation%</default_value> - </field> - <field name="is_active" group="general_information"> - <default_value xsi:type="string">Yes</default_value> - </field> - <field name="is_anchor" group="display_setting"/> - <field name="url_key" group="general_information"> - <default_value xsi:type="string">category%isolation%</default_value> - </field> - <field name="include_in_menu" group="general_information"> - <default_value xsi:type="string">Yes</default_value> - </field> - <field name="landing_page" group="display_setting" source="Magento\Catalog\Test\Fixture\Category\LandingPage"/> - <field name="display_mode" group="display_setting"/> - <field name="category_products" group="category_products" source="Magento\Catalog\Test\Fixture\Category\CategoryProducts"/> - </fixture> + <fixture name="category" + module="Magento_Catalog" + type="eav" + entity_type="catalog_category_entity" + collection="Magento\Catalog\Model\Resource\Category\Collection" + repository_class="Magento\Catalog\Test\Repository\Category" + handler_interface="Magento\Catalog\Test\Handler\Category\CategoryInterface" + class="Magento\Catalog\Test\Fixture\Category"> + <field name="entity_id" is_required="1" /> + <field name="entity_type_id" is_required="" /> + <field name="attribute_set_id" is_required="" /> + <field name="description" is_required="0" group="general_information" /> + <field name="parent_id" is_required="" group="null" source="Magento\Catalog\Test\Fixture\Category\ParentId" /> + <field name="created_at" is_required="" /> + <field name="updated_at" is_required="" /> + <field name="path" is_required="" group="null" /> + <field name="position" is_required="" /> + <field name="level" is_required="" /> + <field name="children_count" is_required="" /> + <field name="available_product_listing_config" is_required="" group="display_setting" /> + <field name="available_sort_by" is_required="0" group="display_setting" /> + <field name="default_product_listing_config" is_required="0" group="display_setting" /> + <field name="default_sort_by" is_required="0" group="display_setting" /> + <field name="meta_title" is_required="" group="general_information" /> + <field name="id" group="null" /> + <field name="name" group="general_information" /> + <field name="is_active" group="general_information" /> + <field name="is_anchor" group="display_setting" /> + <field name="url_key" group="general_information" /> + <field name="include_in_menu" group="general_information" /> + <field name="landing_page" group="display_setting" source="Magento\Catalog\Test\Fixture\Category\LandingPage" /> + <field name="display_mode" group="display_setting" /> + <field name="category_products" group="category_products" source="Magento\Catalog\Test\Fixture\Category\CategoryProducts" /> + </fixture> </config> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Category/CategoryProducts.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Category/CategoryProducts.php index 1230c6c96549b1afe27bd09808dbed64eec56270..88ac5ece79d53f848562b5ddd0a1fb40d55771b5 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Category/CategoryProducts.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Category/CategoryProducts.php @@ -6,36 +6,21 @@ namespace Magento\Catalog\Test\Fixture\Category; +use Magento\Mtf\Fixture\DataSource; use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Mtf\Fixture\FixtureInterface; /** - * Class CategoryProducts - * Prepare products + * Prepare products. */ -class CategoryProducts implements FixtureInterface +class CategoryProducts extends DataSource { /** - * Prepared dataSet data - * - * @var array|null - */ - protected $data; - - /** - * Return products + * Return products. * * @var array */ protected $products = []; - /** - * Fixture params - * - * @var array - */ - protected $params; - /** * @constructor * @param FixtureFactory $fixtureFactory @@ -45,11 +30,11 @@ class CategoryProducts implements FixtureInterface public function __construct(FixtureFactory $fixtureFactory, array $params, $data = []) { $this->params = $params; - if (!empty($data['dataSet']) && $data['dataSet'] !== '-') { - $dataSet = array_map('trim', explode(',', $data['dataSet'])); - foreach ($dataSet as $value) { + if (!empty($data['dataset']) && $data['dataset'] !== '-') { + $dataset = array_map('trim', explode(',', $data['dataset'])); + foreach ($dataset as $value) { $explodeValue = explode('::', $value); - $product = $fixtureFactory->createByCode($explodeValue[0], ['dataSet' => $explodeValue[1]]); + $product = $fixtureFactory->createByCode($explodeValue[0], ['dataset' => $explodeValue[1]]); if (!$product->getId()) { $product->persist(); } @@ -60,40 +45,7 @@ class CategoryProducts implements FixtureInterface } /** - * Persist attribute options - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set - * - * @param string|null $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 products + * Return products. * * @return array */ diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Category/LandingPage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Category/LandingPage.php index 22ac44c8c5e55700a322e6a1359a6dc4dcb241b7..fcab7554227ca52d8572e639064955ed59b5f532 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Category/LandingPage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Category/LandingPage.php @@ -6,22 +6,15 @@ namespace Magento\Catalog\Test\Fixture\Category; +use Magento\Mtf\Fixture\DataSource; use Magento\Cms\Test\Fixture\CmsBlock; use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Mtf\Fixture\FixtureInterface; /** * Prepare landing page. */ -class LandingPage implements FixtureInterface +class LandingPage extends DataSource { - /** - * Prepared dataSet data. - * - * @var string - */ - protected $data; - /** * Source Cms Block. * @@ -29,13 +22,6 @@ class LandingPage implements FixtureInterface */ protected $cmsBlock = null; - /** - * Fixture params. - * - * @var array - */ - protected $params; - /** * @constructor * @param FixtureFactory $fixtureFactory @@ -47,9 +33,9 @@ class LandingPage implements FixtureInterface $this->params = $params; $this->data = $data; - if (isset($data['preset'])) { + if (isset($data['dataset'])) { /** @var CmsBlock $cmsBlock */ - $cmsBlock = $fixtureFactory->createByCode('cmsBlock', ['dataSet' => $data['preset']]); + $cmsBlock = $fixtureFactory->createByCode('cmsBlock', ['dataset' => $data['dataset']]); if (!$cmsBlock->getBlockId()) { $cmsBlock->persist(); } @@ -59,39 +45,6 @@ class LandingPage implements FixtureInterface } } - /** - * Persist source. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set. - * - * @param string|null $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 Cms Block. * diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Category/ParentId.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Category/ParentId.php index 7075706983b99a89b14a29a36617d980df17ec62..17a37eef163e480172dfc5e48beaaa974bd09acd 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Category/ParentId.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Category/ParentId.php @@ -6,30 +6,22 @@ namespace Magento\Catalog\Test\Fixture\Category; -use Magento\Catalog\Test\Fixture\Category; +use Magento\Mtf\Fixture\DataSource; use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Mtf\Fixture\FixtureInterface; +use Magento\Catalog\Test\Fixture\Category; /** - * Class ParentId - * Prepare parent category + * Prepare parent category. */ -class ParentId implements FixtureInterface +class ParentId extends DataSource { /** - * Return category + * Return category. * * @var Category */ protected $parentCategory = null; - /** - * Fixture params - * - * @var array - */ - protected $params; - /** * @constructor * @param FixtureFactory $fixtureFactory @@ -39,8 +31,8 @@ class ParentId implements FixtureInterface public function __construct(FixtureFactory $fixtureFactory, array $params, $data = []) { $this->params = $params; - if (isset($data['dataSet']) && $data['dataSet'] !== '-') { - $this->parentCategory = $fixtureFactory->createByCode('category', ['dataSet' => $data['dataSet']]); + if (isset($data['dataset']) && $data['dataset'] !== '-') { + $this->parentCategory = $fixtureFactory->createByCode('category', ['dataset' => $data['dataset']]); if (!$this->parentCategory->hasData('id')) { $this->parentCategory->persist(); } @@ -51,40 +43,7 @@ class ParentId implements FixtureInterface } /** - * 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 entity. * * @return Category */ diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/AttributeSetId.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Product/AttributeSetId.php similarity index 56% rename from dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/AttributeSetId.php rename to dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Product/AttributeSetId.php index 798cb76ead304d822876b6714776d1b2430ff9bb..9a314c06e7d285c25dad13cf614d6317987a1d60 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/AttributeSetId.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Product/AttributeSetId.php @@ -4,36 +4,30 @@ * See COPYING.txt for license details. */ -namespace Magento\Catalog\Test\Fixture\CatalogProductSimple; +namespace Magento\Catalog\Test\Fixture\Product; -use Magento\Catalog\Test\Fixture\CatalogAttributeSet; +use Magento\Mtf\Fixture\DataSource; use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Mtf\Fixture\FixtureInterface; +use Magento\Catalog\Test\Fixture\CatalogAttributeSet; /** - * Class AttributeSetId + * Product template entity data source. * * Data keys: - * - dataSet + * - dataset * - attribute_set */ -class AttributeSetId implements FixtureInterface +class AttributeSetId extends DataSource { /** - * Attribute Set name - * - * @var string - */ - protected $data; - - /** - * Attribute Set fixture + * Attribute Set fixture. * * @var CatalogAttributeSet */ protected $attributeSet; /** + * @constructor * @param FixtureFactory $fixtureFactory * @param array $params * @param array $data @@ -41,9 +35,9 @@ class AttributeSetId implements FixtureInterface public function __construct(FixtureFactory $fixtureFactory, array $params, $data = []) { $this->params = $params; - if (isset($data['dataSet']) && $data['dataSet'] !== '-') { + if (isset($data['dataset'])) { /** @var CatalogAttributeSet $attributeSet */ - $attributeSet = $fixtureFactory->createByCode('catalogAttributeSet', ['dataSet' => $data['dataSet']]); + $attributeSet = $fixtureFactory->createByCode('catalogAttributeSet', ['dataset' => $data['dataset']]); if (!$attributeSet->hasData('attribute_set_id')) { $attributeSet->persist(); } @@ -51,7 +45,7 @@ class AttributeSetId implements FixtureInterface if (isset($data['attribute_set']) && $data['attribute_set'] instanceof CatalogAttributeSet) { $attributeSet = $data['attribute_set']; } - if (!isset($data['dataSet']) && !isset($data['attribute_set'])) { + if (!isset($data['dataset']) && !isset($data['attribute_set'])) { $this->data = $data; } else { /** @var CatalogAttributeSet $attributeSet */ @@ -61,30 +55,7 @@ class AttributeSetId implements FixtureInterface } /** - * 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 Attribute Set fixture. * * @return CatalogAttributeSet */ @@ -92,14 +63,4 @@ class AttributeSetId implements FixtureInterface { return $this->attributeSet; } - - /** - * Return data set configuration settings - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CategoryIds.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Product/CategoryIds.php old mode 100755 new mode 100644 similarity index 63% rename from dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CategoryIds.php rename to dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Product/CategoryIds.php index 7742361674d6f636d9645c6acc33cce6feb9c52a..3eda80caa7c3ece39b1b7d019ec5e893516340f2 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CategoryIds.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Product/CategoryIds.php @@ -4,25 +4,17 @@ * See COPYING.txt for license details. */ -namespace Magento\Catalog\Test\Fixture\CatalogProductSimple; +namespace Magento\Catalog\Test\Fixture\Product; -use Magento\Catalog\Test\Fixture\Category; +use Magento\Mtf\Fixture\DataSource; use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Mtf\Fixture\FixtureInterface; +use Magento\Catalog\Test\Fixture\Category; /** - * Class CategoryIds - * Create and return Category + * Create and return Category. */ -class CategoryIds implements FixtureInterface +class CategoryIds extends DataSource { - /** - * Names and Ids of the created categories - * - * @var array - */ - protected $data; - /** * Fixtures of category * @@ -46,7 +38,7 @@ class CategoryIds implements FixtureInterface $this->params = $params; if (!empty($data['category']) - && empty($data['presets']) + && empty($data['dataset']) && $data['category'] instanceof Category ) { /** @var Category $category */ @@ -56,14 +48,14 @@ class CategoryIds implements FixtureInterface } $this->data[] = $category->getName(); $this->categories[] = $category; - } elseif (isset($data['presets'])) { - $presets = explode(',', $data['presets']); - foreach ($presets as $preset) { - if (trim($preset) == '-') { + } elseif (isset($data['dataset'])) { + $datasets = explode(',', $data['dataset']); + foreach ($datasets as $dataset) { + if (trim($dataset) == '-') { $this->data[] = ''; continue; } - $category = $fixtureFactory->createByCode('category', ['dataSet' => $preset]); + $category = $fixtureFactory->createByCode('category', ['dataset' => $dataset]); if (!isset($data['new_category']) || $data['new_category'] !== 'yes') { $category->persist(); } @@ -75,39 +67,6 @@ class CategoryIds implements FixtureInterface } } - /** - * Persist custom selections 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 category array * diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Product/CustomOptions.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Product/CustomOptions.php new file mode 100644 index 0000000000000000000000000000000000000000..4d677778a4b6055c9505ead381ff8b880734a618 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Product/CustomOptions.php @@ -0,0 +1,98 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Catalog\Test\Fixture\Product; + +use Magento\Mtf\Fixture\DataSource; +use Magento\Mtf\Fixture\FixtureFactory; +use Magento\Mtf\Repository\RepositoryFactory; + +/** + * Custom options fixture. + * + * Data keys: + * - dataset (Custom options dataset name) + * - import_products (comma separated data set name) + */ +class CustomOptions extends DataSource +{ + /** + * Custom options data. + * + * @var array + */ + protected $customOptions; + + /** + * @constructor + * @param RepositoryFactory $repositoryFactory + * @param FixtureFactory|null $fixtureFactory + * @param array $params + * @param array $data + */ + public function __construct( + RepositoryFactory $repositoryFactory, + FixtureFactory $fixtureFactory, + array $params, + array $data + ) { + $this->params = $params; + $this->data = (!isset($data['dataset']) && !isset($data['import_products'])) ? $data : []; + $this->customOptions = $this->data; + + if (isset($data['dataset']) && isset($this->params['repository'])) { + $this->data = $repositoryFactory->get($this->params['repository'])->get($data['dataset']); + $this->data = $this->replaceData($this->data, mt_rand()); + $this->customOptions = $this->data; + } + if (isset($data['import_products'])) { + $importData = explode(',', $data['import_products']); + $importCustomOptions = []; + $importProducts = []; + foreach ($importData as $item) { + list($fixture, $dataset) = explode('::', $item); + $product = $fixtureFactory->createByCode($fixture, ['dataset' => $dataset]); + if ($product->hasData('id') !== null) { + $product->persist(); + } + $importCustomOptions = array_merge($importCustomOptions, $product->getCustomOptions()); + $importProducts[] = $product->getSku(); + } + $this->customOptions = array_merge($this->data, $importCustomOptions); + $this->data['import'] = ['options' => $importCustomOptions, 'products' => $importProducts]; + } + } + + /** + * 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/Magento/Catalog/Test/Fixture/Product/Price.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Product/Price.php new file mode 100644 index 0000000000000000000000000000000000000000..293b0489f569eea08f9b366b6f807f6d6774cb48 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Product/Price.php @@ -0,0 +1,57 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Catalog\Test\Fixture\Product; + +use Magento\Mtf\Fixture\DataSource; +use Magento\Mtf\Repository\RepositoryFactory; + +/** + * Price data source. + * + * Data keys: + * - dataset (Price verification dataset name) + * - value (Price value) + */ +class Price extends DataSource +{ + /** + * Price view on different pages. + * + * @var string + */ + protected $priceData = null; + + /** + * @constructor + * @param RepositoryFactory $repositoryFactory + * @param array $params + * @param array $data + */ + public function __construct(RepositoryFactory $repositoryFactory, array $params, $data = []) + { + $this->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/Magento/Catalog/Test/Fixture/CatalogProductSimple/AbstractRelatedProducts.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Product/RelatedProducts.php similarity index 52% rename from dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/AbstractRelatedProducts.php rename to dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Product/RelatedProducts.php index fbe47d82bdf68ce9308e9891613360da1846b20f..3aada24483b409a75a4f0e1bc46e6d2015575310 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/AbstractRelatedProducts.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Product/RelatedProducts.php @@ -4,31 +4,18 @@ * See COPYING.txt for license details. */ -namespace Magento\Catalog\Test\Fixture\CatalogProductSimple; +namespace Magento\Catalog\Test\Fixture\Product; -use Magento\Catalog\Test\Fixture\CatalogProductSimple; +use Magento\Mtf\Fixture\DataSource; use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Mtf\Fixture\FixtureInterface; +use Magento\Mtf\Repository\RepositoryFactory; +use Magento\Catalog\Test\Fixture\CatalogProductSimple; /** * Base class for create related products. */ -class AbstractRelatedProducts implements FixtureInterface +class RelatedProducts extends DataSource { - /** - * Data set configuration settings. - * - * @var array - */ - protected $params; - - /** - * Data of the created products. - * - * @var array - */ - protected $data = []; - /** * Products fixture. * @@ -38,19 +25,24 @@ class AbstractRelatedProducts implements FixtureInterface /** * @constructor + * @param RepositoryFactory $repositoryFactory * @param FixtureFactory $fixtureFactory * @param array $params * @param array $data [optional] */ - public function __construct(FixtureFactory $fixtureFactory, array $params, array $data = []) - { + public function __construct( + RepositoryFactory $repositoryFactory, + FixtureFactory $fixtureFactory, + array $params, + array $data = [] + ) { $this->params = $params; - if (isset($data['presets'])) { - $presets = array_map('trim', explode(',', $data['presets'])); - foreach ($presets as $preset) { - list($fixtureCode, $dataSet) = explode('::', $preset); - $this->products[] = $fixtureFactory->createByCode($fixtureCode, ['dataSet' => $dataSet]); + if (isset($data['dataset']) && isset($this->params['repository'])) { + $datasets = $repositoryFactory->get($this->params['repository'])->get($data['dataset']); + foreach ($datasets as $dataset) { + list($fixtureCode, $dataset) = explode('::', $dataset); + $this->products[] = $fixtureFactory->createByCode($fixtureCode, ['dataset' => $dataset]); } } if (isset($data['products'])) { @@ -75,39 +67,6 @@ class AbstractRelatedProducts implements FixtureInterface } } - /** - * 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. * diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/TaxClass.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Product/TaxClass.php similarity index 72% rename from dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/TaxClass.php rename to dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Product/TaxClass.php index 7bc605d82acca354327d119a88a570982aec88a4..c471725a5f02cd9db2985a2fa97c22e3e7197302 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/TaxClass.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Product/TaxClass.php @@ -4,48 +4,47 @@ * See COPYING.txt for license details. */ -namespace Magento\Catalog\Test\Fixture\CatalogProductSimple; +namespace Magento\Catalog\Test\Fixture\Product; -use Magento\Tax\Test\Fixture\TaxClass as FixtureTaxClass; +use Magento\Mtf\Fixture\DataSource; use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Mtf\Fixture\FixtureInterface; use Magento\Mtf\Util\Protocol\CurlInterface; use Magento\Mtf\Util\Protocol\CurlTransport; +use Magento\Tax\Test\Fixture\TaxClass as FixtureTaxClass; use Magento\Mtf\Util\Protocol\CurlTransport\BackendDecorator; /** - * Class TaxClass + * Taz class data source. * * Data keys: - * - dataSet + * - dataset * - tax_product_class */ -class TaxClass implements FixtureInterface +class TaxClass extends DataSource { /** - * Tax class id + * Tax class id. * * @var int */ protected $taxClassId; /** - * Tax class name + * Tax class name. * * @var string */ protected $data = 'None'; /** - * Tax class fixture + * Tax class fixture. * * @var \Magento\Tax\Test\Fixture\TaxClass */ protected $taxClass; /** - * Constructor - * + * @constructor * @param FixtureFactory $fixtureFactory * @param array $params * @param array|string $data @@ -53,13 +52,13 @@ class TaxClass implements FixtureInterface public function __construct(FixtureFactory $fixtureFactory, array $params, $data = []) { $this->params = $params; - if ((!isset($data['dataSet']) && !isset($data['tax_product_class']))) { + 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']]); + 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(); @@ -79,7 +78,7 @@ class TaxClass implements FixtureInterface } /** - * Set tax class id + * Set tax class id. * * @param string $taxClassName * @return void @@ -104,40 +103,7 @@ class TaxClass implements FixtureInterface } /** - * 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 tax class fixture. * * @return FixtureTaxClass */ @@ -147,7 +113,7 @@ class TaxClass implements FixtureInterface } /** - * Return tax class id + * Return tax class id. * * @return int */ diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/ProductAttribute.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/ProductAttribute.php deleted file mode 100644 index a738e51b8874fabe151e8aebbd93a5af3f99e68a..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/ProductAttribute.php +++ /dev/null @@ -1,204 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Catalog\Test\Fixture; - -use Magento\Mtf\Client\Locator; -use Magento\Mtf\Factory\Factory; -use Magento\Mtf\Fixture\DataFixture; - -/** - * Class Attribute - */ -class ProductAttribute extends DataFixture -{ - /** - * Logical sets for mapping data into tabs - */ - const GROUP_PRODUCT_ATTRIBUTE_MAIN = 'product_attribute_tabs_main'; - const GROUP_PRODUCT_ATTRIBUTE_LABELS = 'product_attribute_tabs_labels'; - const GROUP_PRODUCT_ATTRIBUTE_FRONT = 'product_attribute_tabs_front'; - - /** - * Get attribute name - * - * @return string - */ - public function getFrontendLabel() - { - return $this->getData('fields/frontend_label/value'); - } - - /** - * Get attribute code - * - * @return string - */ - public function getAttributeCode() - { - return $this->getData('fields/attribute_code/value'); - } - - /** - * Get attribute option ids - * - * @return array - */ - public function getOptionIds() - { - return $this->getData('fields/option_ids'); - } - - /** - * Get attribute options labels - * - * @return array - */ - public function getOptionLabels() - { - $options = $this->getOptions(); - $optionsLabels = []; - foreach ($options as $option) { - $optionsLabels[] = $option['label']['value']; - } - return $optionsLabels; - } - - /** - * Get attribute options - * - * @return array - */ - public function getOptions() - { - $options = $this->getData('options/value'); - return is_array($options) ? $options : []; - } - - /** - * Get attribute id - * - * @return string - */ - public function getAttributeId() - { - return $this->getData('fields/attribute_id/value'); - } - - /** - * Save Attribute into Magento - */ - public function persist() - { - $attributeIds = Factory::getApp()->magentoCatalogCreateProductAttribute($this); - $this->_data['fields']['attribute_id']['value'] = $attributeIds['attributeId']; - $this->_data['fields']['option_ids'] = $attributeIds['optionIds']; - - return $this; - } - - /** - * {inheritdoc} - * - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) - */ - protected function _initData() - { - $this->_data = [ - 'fields' => [ - 'attribute_code' => [ - 'value' => 'attribute_code_%isolation%', - 'group' => self::GROUP_PRODUCT_ATTRIBUTE_MAIN, - ], - 'frontend_label' => [ - 'value' => 'Attribute %isolation%', - 'input_name' => 'frontend_label[0]', - 'group' => self::GROUP_PRODUCT_ATTRIBUTE_MAIN, - ], - 'frontend_input' => [ - 'value' => 'Dropdown', - 'input' => 'select', - 'input_value' => 'select', - 'group' => self::GROUP_PRODUCT_ATTRIBUTE_MAIN, - ], - 'is_searchable' => [ - 'value' => 'Yes', - 'input' => 'select', - 'input_value' => 1, - 'group' => self::GROUP_PRODUCT_ATTRIBUTE_FRONT, - ], - 'is_visible_in_advanced_search' => [ - 'value' => 'Yes', - 'input' => 'select', - 'input_value' => 1, - 'group' => self::GROUP_PRODUCT_ATTRIBUTE_FRONT, - ], - 'is_comparable' => [ - 'value' => 'Yes', - 'input' => 'select', - 'input_value' => 1, - 'group' => self::GROUP_PRODUCT_ATTRIBUTE_FRONT, - ], - 'is_filterable' => [ - 'value' => 'Filterable (with results)', - 'input' => 'select', - 'input_value' => 1, - 'group' => self::GROUP_PRODUCT_ATTRIBUTE_FRONT, - ], - 'is_visible_on_front' => [ - 'value' => 'Yes', - 'input' => 'select', - 'input_value' => 1, - 'group' => self::GROUP_PRODUCT_ATTRIBUTE_FRONT, - ], - 'is_filterable_in_search' => [ - 'value' => 'Yes', - 'input' => 'select', - 'input_value' => 1, - 'group' => self::GROUP_PRODUCT_ATTRIBUTE_FRONT, - ], - ], - 'options' => [ - 'value' => [ - 'option_1' => [ - 'label' => [ - 'value' => 'Option 1 %isolation%', - 'input_name' => 'option[value][option_0][0]', - 'selector' => '//*[@id="manage-options-panel"]/table/tbody/tr[1]/td[3]/input', - 'strategy' => Locator::SELECTOR_XPATH, - ], - 'default' => [ - 'value' => 'Yes', - 'input' => 'checkbox', - 'input_name' => 'default[0]', - 'input_value' => 'option_0', - 'selector' => '//*[@id="manage-options-panel"]/table/tbody/tr[1]/td[2]/input', - 'strategy' => Locator::SELECTOR_XPATH, - ], - ], - 'option_2' => [ - 'label' => [ - 'value' => 'Option 2 %isolation%', - 'input_name' => 'option[value][option_1][0]', - 'selector' => '//*[@id="manage-options-panel"]/table/tbody/tr[2]/td[3]/input', - 'strategy' => Locator::SELECTOR_XPATH, - ], - 'default' => [ - 'value' => 'No', - 'input' => 'checkbox', - 'input_name' => 'default[1]', - 'input_value' => 'option_1', - 'selector' => '//*[@id="manage-options-panel"]/table/tbody/tr[2]/td[2]/input', - 'strategy' => Locator::SELECTOR_XPATH, - ], - ], - ], - ], - ]; - $this->_repository = Factory::getRepositoryFactory() - ->getMagentoCatalogProductAttribute($this->_dataConfig, $this->_data); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/Curl/CreateProductAttribute.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/Curl/CreateProductAttribute.php deleted file mode 100644 index 632de082cfe61df3dcfddd9ccf1359a9d3581638..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/Curl/CreateProductAttribute.php +++ /dev/null @@ -1,121 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Catalog\Test\Handler\Curl; - -use Magento\Catalog\Test\Fixture\ProductAttribute; -use Magento\Mtf\Fixture\FixtureInterface; -use Magento\Mtf\Handler\Curl; -use Magento\Mtf\Util\Protocol\CurlInterface; -use Magento\Mtf\Util\Protocol\CurlTransport; -use Magento\Mtf\Util\Protocol\CurlTransport\BackendDecorator; - -/** - * Class CreateProductAttribute - */ -class CreateProductAttribute extends Curl -{ - /** - * Create attribute - * - * @param FixtureInterface|\Magento\Catalog\Test\Fixture\ProductAttribute $fixture [optional] - * @return mixed|string - */ - public function persist(FixtureInterface $fixture = null) - { - $url = $_ENV['app_backend_url'] . 'catalog/product_attribute/save/back/edit/active_tab/main'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->write(CurlInterface::POST, $url, '1.0', [], $this->getPostParams($fixture)); - $response = $curl->read(); - $curl->close(); - - $id = null; - if (preg_match('!catalog/product_attribute/save/attribute_id/(\d+)/active_tab/main/!', $response, $matches)) { - $id = $matches[1]; - } - - $optionIds = []; - if (preg_match_all( - '!attributeOption\.add\({"checked":"(.?)*","intype":"radio","id":"(\d+)"!', - $response, - $matches - )) { - $optionIds = $matches[2]; - } - - return ['attributeId' => $id, 'optionIds' => $optionIds]; - } - - /** - * Get data for curl POST params - * - * @param ProductAttribute $fixture - * @return array - */ - protected function getPostParams(ProductAttribute $fixture) - { - $data = $this->prepareParams($fixture->getData('fields')); - $options = $fixture->getOptions(); - foreach ($options as $option) { - $data = array_merge($data, $this->prepareParams($option)); - } - return $data; - } - - /** - * Prepare data for curl POST params - * - * @param array $fields - * @return array - */ - protected function prepareParams(array $fields) - { - $data = []; - foreach ($fields as $key => $field) { - $value = $this->getParamValue($field); - - if (null === $value) { - continue; - } - - $_key = $this->getFieldKey($field); - if (null === $_key) { - $_key = $key; - } - $data[$_key] = $value; - } - return $data; - } - - /** - * Return key for request - * - * @param array $data - * @return null|string - */ - protected function getFieldKey(array $data) - { - return isset($data['input_name']) ? $data['input_name'] : null; - } - - /** - * Return value for request - * - * @param array $data - * @return null|string - */ - protected function getParamValue(array $data) - { - if (array_key_exists('input_value', $data)) { - return $data['input_value']; - } - - if (array_key_exists('value', $data)) { - return $data['value']; - } - return null; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogAttributeSet.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogAttributeSet.xml index 2ae408622b1120f58e67143d65287445fc3ffd48..3d89c92046b048bb62f39a09f44ffeea350a9ffe 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogAttributeSet.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogAttributeSet.xml @@ -15,17 +15,17 @@ <dataset name="custom_attribute_set"> <field name="attribute_set_name" xsi:type="string">Custom_attribute_set%isolation%</field> <field name="skeleton_set" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> </dataset> <dataset name="custom_attribute_set_with_fpt"> <field name="attribute_set_name" xsi:type="string">Custom_attribute_set%isolation%</field> <field name="skeleton_set" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="assigned_attributes" xsi:type="array"> - <item name="presets" xsi:type="string">attribute_type_fpt</item> + <item name="dataset" xsi:type="string">attribute_type_fpt</item> </field> </dataset> </repository> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductAttribute.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductAttribute.xml index 0562055a8c5ad9f034875f10a1a3d94066879ddc..82f92677fd218755c054785d7bc40ccf9ed8eea0 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductAttribute.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductAttribute.xml @@ -7,6 +7,12 @@ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> <repository class="Magento\Catalog\Test\Repository\CatalogProductAttribute"> + <dataset name="default"> + <field name="frontend_label" xsi:type="string">attribute_label%isolation%</field> + <field name="frontend_input" xsi:type="string">Text Field</field> + <field name="is_required" xsi:type="string">No</field> + </dataset> + <dataset name="attribute_type_text_field"> <field name="frontend_label" xsi:type="string">attribute_text%isolation%</field> <field name="attribute_code" xsi:type="string">attribute_text%isolation%</field> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductAttribute/Options.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductAttribute/Options.xml new file mode 100644 index 0000000000000000000000000000000000000000..38ec9a7268549f44d6383d376a13e406bb7f4f8f --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductAttribute/Options.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" ?> +<!-- +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> + <repository class="Magento\Catalog\Test\Repository\CatalogProductAttribute\Options"> + <dataset name="default"> + <field name="0" xsi:type="array"> + <item name="is_default" xsi:type="string">Yes</item> + <item name="admin" xsi:type="string">blue</item> + </field> + </dataset> + + <dataset name="two_options"> + <field name="0" xsi:type="array"> + <item name="admin" xsi:type="string">black</item> + </field> + <field name="1" xsi:type="array"> + <item name="admin" xsi:type="string">white</item> + </field> + </dataset> + </repository> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml index c4ae2d72fde4dc62c6c352172b7510b3a237138e..328c932717e7369c0db6eab0328a12b70124a27d 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml @@ -9,7 +9,7 @@ <repository class="Magento\Catalog\Test\Repository\CatalogProductSimple"> <dataset name="default"> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="name" xsi:type="string">Simple Product %isolation%</field> <field name="sku" xsi:type="string">sku_simple_product_%isolation%</field> @@ -21,10 +21,9 @@ </field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">560</item> - <item name="preset" xsi:type="string">-</item> </field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="website_ids" xsi:type="array"> <item name="0" xsi:type="string">Main Website</item> @@ -32,13 +31,13 @@ <field name="visibility" xsi:type="string">Catalog, Search</field> <field name="url_key" xsi:type="string">simple-product-%isolation%</field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">order_default</item> + <item name="dataset" xsi:type="string">simple_order_default</item> </field> </dataset> <dataset name="product_10_dollar"> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="name" xsi:type="string">product_10_dollar %isolation%</field> <field name="sku" xsi:type="string">sku_product_10_dollar_%isolation%</field> @@ -50,10 +49,9 @@ </field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">10</item> - <item name="preset" xsi:type="string">-</item> </field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="website_ids" xsi:type="array"> <item name="0" xsi:type="string">Main Website</item> @@ -61,13 +59,13 @@ <field name="visibility" xsi:type="string">Catalog, Search</field> <field name="url_key" xsi:type="string">product-10-dollar-%isolation%</field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">order_10_dollar_product</item> + <item name="dataset" xsi:type="string">simple_order_10_dollar_product</item> </field> </dataset> <dataset name="product_20_dollar"> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="name" xsi:type="string">product_20_dollar %isolation%</field> <field name="sku" xsi:type="string">sku_product_20_dollar_%isolation%</field> @@ -81,7 +79,7 @@ <item name="value" xsi:type="string">20</item> </field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="website_ids" xsi:type="array"> <item name="0" xsi:type="string">Main Website</item> @@ -102,20 +100,19 @@ <field name="url_key" xsi:type="string">simple-product-%isolation%</field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">560</item> - <item name="preset" xsi:type="string">-</item> </field> <field name="website_ids" xsi:type="array"> <item name="key" xsi:type="string">Main Website</item> </field> <field name="visibility" xsi:type="string">Catalog, Search</field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">order_default</item> + <item name="dataset" xsi:type="string">simple_order_default</item> </field> </dataset> <dataset name="simple_big_qty"> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="name" xsi:type="string">Simple Product %isolation%</field> <field name="sku" xsi:type="string">sku_simple_product_%isolation%</field> @@ -126,10 +123,9 @@ </field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">560</item> - <item name="preset" xsi:type="string">-</item> </field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="website_ids" xsi:type="array"> <item name="0" xsi:type="string">Main Website</item> @@ -137,13 +133,13 @@ <field name="visibility" xsi:type="string">Catalog, Search</field> <field name="url_key" xsi:type="string">simple-product-%isolation%</field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">order_big_qty</item> + <item name="dataset" xsi:type="string">simple_order_big_qty</item> </field> </dataset> <dataset name="simple_for_sales"> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="name" xsi:type="string">Simple Product %isolation%</field> <field name="sku" xsi:type="string">sku_simple_product_%isolation%</field> @@ -154,10 +150,9 @@ </field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">560</item> - <item name="preset" xsi:type="string">-</item> </field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="website_ids" xsi:type="array"> <item name="0" xsi:type="string">Main Website</item> @@ -165,7 +160,7 @@ <field name="visibility" xsi:type="string">Catalog, Search</field> <field name="url_key" xsi:type="string">simple-product-%isolation%</field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">order_custom_price</item> + <item name="dataset" xsi:type="string">simple_order_custom_price</item> </field> </dataset> @@ -179,18 +174,17 @@ </field> <field name="weight" xsi:type="string">1</field> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">100</item> - <item name="preset" xsi:type="string">-</item> </field> <field name="website_ids" xsi:type="array"> <item name="0" xsi:type="string">Main Website</item> </field> <field name="url_key" xsi:type="string">simple-product-%isolation%</field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">two_products</item> + <item name="dataset" xsi:type="string">simple_two_products</item> </field> </dataset> @@ -204,11 +198,10 @@ </field> <field name="weight" xsi:type="string">1</field> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">40</item> - <item name="preset" xsi:type="string">-</item> </field> <field name="mtf_dataset_name" xsi:type="string">product_40_dollar</field> <field name="url_key" xsi:type="string">simple-product-%isolation%</field> @@ -221,7 +214,7 @@ <field name="sku" xsi:type="string">MAGETWO-23036_%isolation%</field> <field name="name" xsi:type="string">simple_with_category %isolation%</field> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="type_id" xsi:type="string">simple</field> <field name="quantity_and_stock_status" xsi:type="array"> @@ -231,10 +224,10 @@ <field name="weight" xsi:type="string">1</field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">100</item> - <item name="preset" xsi:type="string">MAGETWO-23036</item> + <item name="dataset" xsi:type="string">MAGETWO-23036</item> </field> <field name="category_ids" xsi:type="array"> - <item name="presets" xsi:type="string">default_subcategory</item> + <item name="dataset" xsi:type="string">default_subcategory</item> </field> <field name="mtf_dataset_name" xsi:type="string">simple_with_category</field> <field name="website_ids" xsi:type="array"> @@ -252,14 +245,14 @@ </field> <field name="weight" xsi:type="string">1</field> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">100</item> - <item name="preset" xsi:type="string" /> + <item name="dataset" xsi:type="string" /> </field> <field name="category_ids" xsi:type="array"> - <item name="presets" xsi:type="string">default_subcategory</item> + <item name="dataset" xsi:type="string">default_subcategory</item> </field> <field name="website_ids" xsi:type="array"> <item name="0" xsi:type="string">Main Website</item> @@ -274,11 +267,11 @@ <field name="sku" xsi:type="string">simple_product_without_category_%isolation%</field> <field name="weight" xsi:type="string">1</field> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">100</item> - <item name="preset" xsi:type="string" /> + <item name="dataset" xsi:type="string" /> </field> <field name="website_ids" xsi:type="array"> <item name="0" xsi:type="string">Main Website</item> @@ -287,7 +280,7 @@ <dataset name="simple_for_salesrule_1"> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="type_id" xsi:type="string">simple</field> <field name="quantity_and_stock_status" xsi:type="array"> @@ -298,7 +291,7 @@ <field name="sku" xsi:type="string">sku_simple_product_%isolation%</field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">100</item> - <item name="preset" xsi:type="string" /> + <item name="dataset" xsi:type="string" /> </field> <field name="weight" xsi:type="string">100</field> <field name="website_ids" xsi:type="array"> @@ -306,7 +299,7 @@ </field> <field name="url_key" xsi:type="string">simple-product-%isolation%</field> <field name="category_ids" xsi:type="array"> - <item name="presets" xsi:type="string">default_subcategory</item> + <item name="dataset" xsi:type="string">default_subcategory</item> </field> </dataset> @@ -315,13 +308,12 @@ <field name="sku" xsi:type="string">simple_for_composite_products%isolation%</field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">560</item> - <item name="preset" xsi:type="string">-</item> </field> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="quantity_and_stock_status" xsi:type="array"> <item name="qty" xsi:type="string">111</item> @@ -343,13 +335,13 @@ <dataset name="simple_for_salesrule_2"> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="name" xsi:type="string">Simple Product %isolation%</field> <field name="sku" xsi:type="string">sku_simple_product_%isolation%</field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">50</item> - <item name="preset" xsi:type="string" /> + <item name="dataset" xsi:type="string" /> </field> <field name="weight" xsi:type="string">50</field> <field name="website_ids" xsi:type="array"> @@ -357,7 +349,7 @@ </field> <field name="url_key" xsi:type="string">simple-product-%isolation%</field> <field name="category_ids" xsi:type="array"> - <item name="presets" xsi:type="string">default_subcategory</item> + <item name="dataset" xsi:type="string">default_subcategory</item> </field> </dataset> @@ -365,15 +357,15 @@ <field name="sku" xsi:type="string">simple_product_with_special_price_and_category%isolation%</field> <field name="name" xsi:type="string">Simple product with special price and category %isolation%</field> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">100</item> - <item name="preset" xsi:type="string" /> + <item name="dataset" xsi:type="string" /> </field> <field name="special_price" xsi:type="string">90</field> <field name="category_ids" xsi:type="array"> - <item name="presets" xsi:type="string">default_subcategory</item> + <item name="dataset" xsi:type="string">default_subcategory</item> </field> <field name="website_ids" xsi:type="array"> <item name="0" xsi:type="string">Main Website</item> @@ -385,11 +377,11 @@ <field name="sku" xsi:type="string">simple_product_with_special_price_and_category%isolation%</field> <field name="name" xsi:type="string">Simple with Special Price 1$ off %isolation%</field> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">10</item> - <item name="preset" xsi:type="string" /> + <item name="dataset" xsi:type="string" /> </field> <field name="special_price" xsi:type="string">9</field> <field name="website_ids" xsi:type="array"> @@ -397,7 +389,7 @@ </field> <field name="url_key" xsi:type="string">simple-product-%isolation%</field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">order_special_price</item> + <item name="dataset" xsi:type="string">simple_order_special_price</item> </field> </dataset> @@ -406,10 +398,9 @@ <field name="sku" xsi:type="string">adc_123</field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">100</item> - <item name="preset" xsi:type="string">-</item> </field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">None</item> + <item name="dataset" xsi:type="string">None</item> </field> <field name="quantity_and_stock_status" xsi:type="array"> <item name="qty" xsi:type="string">666</item> @@ -430,10 +421,9 @@ <field name="sku" xsi:type="string">adc_123</field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">100</item> - <item name="preset" xsi:type="string">-</item> </field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">None</item> + <item name="dataset" xsi:type="string">None</item> </field> <field name="quantity_and_stock_status" xsi:type="array"> <item name="qty" xsi:type="string">666</item> @@ -454,10 +444,9 @@ <field name="sku" xsi:type="string">adc_123</field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">100</item> - <item name="preset" xsi:type="string">-</item> </field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">None</item> + <item name="dataset" xsi:type="string">None</item> </field> <field name="quantity_and_stock_status" xsi:type="array"> <item name="qty" xsi:type="string">666</item> @@ -478,10 +467,9 @@ <field name="sku" xsi:type="string">abc_dfj</field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">50</item> - <item name="preset" xsi:type="string">-</item> </field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="quantity_and_stock_status" xsi:type="array"> <item name="qty" xsi:type="string">666</item> @@ -502,7 +490,7 @@ <field name="sku" xsi:type="string">product_100_dollar%isolation%</field> <field name="name" xsi:type="string">product_100_dollar%isolation%</field> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="type_id" xsi:type="string">simple</field> <field name="quantity_and_stock_status" xsi:type="array"> @@ -512,7 +500,6 @@ <field name="weight" xsi:type="string">1</field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">100</item> - <item name="preset" xsi:type="string">-</item> </field> <field name="website_ids" xsi:type="array"> <item name="0" xsi:type="string">Main Website</item> @@ -523,13 +510,12 @@ <dataset name="withSpecialPrice"> <field name="type_id" xsi:type="string">simple</field> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="name" xsi:type="string">Simple Product %isolation%</field> <field name="sku" xsi:type="string">sku_simple_product_%isolation%</field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">100</item> - <item name="preset" xsi:type="string">-</item> </field> <field name="weight" xsi:type="string">1</field> <field name="url_key" xsi:type="string">simple-product-%isolation%</field> @@ -539,17 +525,16 @@ <dataset name="simple_with_group_price"> <field name="type_id" xsi:type="string">simple</field> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="name" xsi:type="string">Simple Product %isolation%</field> <field name="sku" xsi:type="string">sku_simple_product_%isolation%</field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">100</item> - <item name="preset" xsi:type="string">-</item> </field> <field name="weight" xsi:type="string">1</field> <field name="group_price" xsi:type="array"> - <item name="preset" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">not_logged_in_20</item> </field> <field name="url_key" xsi:type="string">simple-product-%isolation%</field> </dataset> @@ -557,20 +542,19 @@ <dataset name="simple_with_group_price_and_category"> <field name="type_id" xsi:type="string">simple</field> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="name" xsi:type="string">Simple Product %isolation%</field> <field name="sku" xsi:type="string">sku_simple_product_%isolation%</field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">100</item> - <item name="preset" xsi:type="string">-</item> </field> <field name="weight" xsi:type="string">1</field> <field name="group_price" xsi:type="array"> - <item name="preset" xsi:type="string">tax_calculation</item> + <item name="dataset" xsi:type="string">general_90_99</item> </field> <field name="category_ids" xsi:type="array"> - <item name="presets" xsi:type="string">default_subcategory</item> + <item name="dataset" xsi:type="string">default_subcategory</item> </field> <field name="website_ids" xsi:type="array"> <item name="0" xsi:type="string">Main Website</item> @@ -581,17 +565,16 @@ <dataset name="simple_with_tier_price"> <field name="type_id" xsi:type="string">simple</field> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="name" xsi:type="string">Simple Product %isolation%</field> <field name="sku" xsi:type="string">sku_simple_product_%isolation%</field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">300</item> - <item name="preset" xsi:type="string">-</item> </field> <field name="weight" xsi:type="string">1</field> <field name="tier_price" xsi:type="array"> - <item name="preset" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="url_key" xsi:type="string">simple-product-%isolation%</field> </dataset> @@ -599,20 +582,19 @@ <dataset name="simple_with_tier_price_and_category"> <field name="type_id" xsi:type="string">simple</field> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="name" xsi:type="string">Simple Product %isolation%</field> <field name="sku" xsi:type="string">sku_simple_product_%isolation%</field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">300</item> - <item name="preset" xsi:type="string">-</item> </field> <field name="weight" xsi:type="string">1</field> <field name="tier_price" xsi:type="array"> - <item name="preset" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="category_ids" xsi:type="array"> - <item name="presets" xsi:type="string">default_subcategory</item> + <item name="dataset" xsi:type="string">default_subcategory</item> </field> <field name="website_ids" xsi:type="array"> <item name="0" xsi:type="string">Main Website</item> @@ -623,50 +605,48 @@ <dataset name="with_two_custom_option"> <field name="type_id" xsi:type="string">simple</field> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="name" xsi:type="string">Simple Product %isolation%</field> <field name="sku" xsi:type="string">sku_simple_product_%isolation%</field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">300</item> - <item name="preset" xsi:type="string">-</item> </field> <field name="weight" xsi:type="string">1</field> <field name="website_ids" xsi:type="array"> <item name="0" xsi:type="string">Main Website</item> </field> <field name="custom_options" xsi:type="array"> - <item name="preset" xsi:type="string">two_options</item> + <item name="dataset" xsi:type="string">two_options</item> </field> <field name="url_key" xsi:type="string">simple-product-%isolation%</field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">with_two_custom_option</item> + <item name="dataset" xsi:type="string">simple_with_two_custom_option</item> </field> </dataset> <dataset name="with_one_custom_option_and_category"> <field name="type_id" xsi:type="string">simple</field> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="name" xsi:type="string">Simple Product %isolation%</field> <field name="sku" xsi:type="string">sku_simple_product_%isolation%</field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">300</item> - <item name="preset" xsi:type="string">-</item> </field> <field name="weight" xsi:type="string">1</field> <field name="custom_options" xsi:type="array"> - <item name="preset" xsi:type="string">drop_down_with_one_option_percent_price</item> + <item name="dataset" xsi:type="string">drop_down_with_one_option_percent_price</item> </field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">drop_down_with_one_option_percent_price</item> + <item name="dataset" xsi:type="string">simple_drop_down_with_one_option_percent_price</item> </field> <field name="website_ids" xsi:type="array"> <item name="0" xsi:type="string">Main Website</item> </field> <field name="category_ids" xsi:type="array"> - <item name="presets" xsi:type="string">default_subcategory</item> + <item name="dataset" xsi:type="string">default_subcategory</item> </field> <field name="url_key" xsi:type="string">simple-product-%isolation%</field> </dataset> @@ -674,18 +654,17 @@ <dataset name="with_all_custom_option"> <field name="type_id" xsi:type="string">simple</field> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="name" xsi:type="string">Simple Product With Custom Option %isolation%</field> <field name="sku" xsi:type="string">sku_simple_product_%isolation%</field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">300</item> - <item name="preset" xsi:type="string">-</item> </field> <field name="weight" xsi:type="string">1</field> <field name="url_key" xsi:type="string">simple-product-%isolation%</field> <field name="custom_options" xsi:type="array"> - <item name="preset" xsi:type="string">all_types</item> + <item name="dataset" xsi:type="string">all_types</item> </field> </dataset> @@ -703,11 +682,10 @@ </field> <field name="weight" xsi:type="string">1</field> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">100</item> - <item name="preset" xsi:type="string">-</item> </field> <field name="website_ids" xsi:type="array"> <item name="0" xsi:type="string">Main Website</item> @@ -717,7 +695,7 @@ <dataset name="out_of_stock"> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="name" xsi:type="string">Simple Product out of stock %isolation%</field> <field name="sku" xsi:type="string">sku_simple_product_out_of_stock%isolation%</field> @@ -728,24 +706,23 @@ </field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">560</item> - <item name="preset" xsi:type="string">-</item> </field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="website_ids" xsi:type="array"> <item name="0" xsi:type="string">Main Website</item> </field> <field name="visibility" xsi:type="string">Catalog, Search</field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">order_default</item> + <item name="dataset" xsi:type="string">simple_order_default</item> </field> <field name="url_key" xsi:type="string">simple-product-%isolation%</field> </dataset> <dataset name="offline"> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="name" xsi:type="string">Simple Product offline %isolation%</field> <field name="sku" xsi:type="string">sku_simple_product_offline_%isolation%</field> @@ -756,17 +733,16 @@ </field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">560</item> - <item name="preset" xsi:type="string">-</item> </field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="website_ids" xsi:type="array"> <item name="0" xsi:type="string">Main Website</item> </field> <field name="visibility" xsi:type="string">Catalog, Search</field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">order_default</item> + <item name="dataset" xsi:type="string">simple_order_default</item> </field> <field name="status" xsi:type="string">Product offline</field> <field name="url_key" xsi:type="string">simple-product-%isolation%</field> @@ -774,7 +750,7 @@ <dataset name="not_visible_individually"> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="name" xsi:type="string">Simple Product not visible %isolation%</field> <field name="sku" xsi:type="string">sku_simple_product_not_visible_%isolation%</field> @@ -785,24 +761,23 @@ </field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">560</item> - <item name="preset" xsi:type="string">-</item> </field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="website_ids" xsi:type="array"> <item name="0" xsi:type="string">Main Website</item> </field> <field name="visibility" xsi:type="string">Not Visible Individually</field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">order_default</item> + <item name="dataset" xsi:type="string">simple_order_default</item> </field> <field name="url_key" xsi:type="string">simple-product-%isolation%</field> </dataset> <dataset name="simple_with_cart_limits"> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="name" xsi:type="string">Simple Product with cart limit %isolation%</field> <field name="sku" xsi:type="string">sku_simple_product_with_cart_limit_%isolation%</field> @@ -813,17 +788,16 @@ </field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">560</item> - <item name="preset" xsi:type="string">-</item> </field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="website_ids" xsi:type="array"> <item name="0" xsi:type="string">Main Website</item> </field> <field name="visibility" xsi:type="string">Catalog, Search</field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">order_default</item> + <item name="dataset" xsi:type="string">simple_order_default</item> </field> <field name="stock_data" xsi:type="array"> <item name="min_sale_qty" xsi:type="string">2</item> @@ -835,20 +809,19 @@ <dataset name="with_one_custom_option"> <field name="type_id" xsi:type="string">simple</field> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="name" xsi:type="string">Simple Product %isolation%</field> <field name="sku" xsi:type="string">sku_simple_product_%isolation%</field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">300</item> - <item name="preset" xsi:type="string">-</item> </field> <field name="weight" xsi:type="string">1</field> <field name="custom_options" xsi:type="array"> - <item name="preset" xsi:type="string">drop_down_with_one_option_percent_price</item> + <item name="dataset" xsi:type="string">drop_down_with_one_option_percent_price</item> </field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">drop_down_with_one_option_percent_price</item> + <item name="dataset" xsi:type="string">simple_drop_down_with_one_option_percent_price</item> </field> <field name="url_key" xsi:type="string">simple-product-%isolation%</field> <field name="website_ids" xsi:type="array"> @@ -858,7 +831,7 @@ <dataset name="simple_with_qty_increments"> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="name" xsi:type="string">Simple Product with qty increments %isolation%</field> <field name="sku" xsi:type="string">sku_simple_product_with_qty_increments_%isolation%</field> @@ -869,17 +842,16 @@ </field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">560</item> - <item name="preset" xsi:type="string">-</item> </field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="website_ids" xsi:type="array"> <item name="0" xsi:type="string">Main Website</item> </field> <field name="visibility" xsi:type="string">Catalog, Search</field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">order_default</item> + <item name="dataset" xsi:type="string">simple_order_default</item> </field> <field name="stock_data" xsi:type="array"> <item name="enable_qty_increments" xsi:type="string">Yes</item> @@ -891,13 +863,12 @@ <dataset name="simple_with_tier_price_and_qty"> <field name="type_id" xsi:type="string">simple</field> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="name" xsi:type="string">Simple Product %isolation%</field> <field name="sku" xsi:type="string">sku_simple_product_%isolation%</field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">300</item> - <item name="preset" xsi:type="string">-</item> </field> <field name="weight" xsi:type="string">1</field> <field name="quantity_and_stock_status" xsi:type="array"> @@ -906,7 +877,7 @@ </field> <field name="url_key" xsi:type="string">simple-product-%isolation%</field> <field name="tier_price" xsi:type="array"> - <item name="preset" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="website_ids" xsi:type="array"> <item name="0" xsi:type="string">Main Website</item> @@ -922,14 +893,14 @@ </field> <field name="weight" xsi:type="string">1</field> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">100</item> - <item name="preset" xsi:type="string" /> + <item name="dataset" xsi:type="string" /> </field> <field name="category_ids" xsi:type="array"> - <item name="presets" xsi:type="string">default_anchor_subcategory</item> + <item name="dataset" xsi:type="string">default_anchor_subcategory</item> </field> <field name="website_ids" xsi:type="array"> <item name="0" xsi:type="string">Main Website</item> @@ -941,10 +912,10 @@ <dataset name="with_custom_option_and_fpt"> <field name="type_id" xsi:type="string">simple</field> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="category_ids" xsi:type="array"> - <item name="presets" xsi:type="string">default_subcategory</item> + <item name="dataset" xsi:type="string">default_subcategory</item> </field> <field name="website_ids" xsi:type="array"> <item name="0" xsi:type="string">Main Website</item> @@ -953,28 +924,27 @@ <field name="sku" xsi:type="string">sku_simple_product_%isolation%</field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">70</item> - <item name="preset" xsi:type="string">-</item> </field> <field name="weight" xsi:type="string">1</field> <field name="custom_options" xsi:type="array"> - <item name="preset" xsi:type="string">drop_down_with_one_option_fixed_price</item> + <item name="dataset" xsi:type="string">drop_down_with_one_option_fixed_price</item> </field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">drop_down_with_one_option_fixed_price</item> + <item name="dataset" xsi:type="string">simple_drop_down_with_one_option_fixed_price</item> </field> <field name="url_key" xsi:type="string">simple-product-%isolation%</field> <field name="fpt" xsi:type="array"> - <item name="preset" xsi:type="string">one_fpt_for_all_states</item> + <item name="dataset" xsi:type="string">one_fpt_for_all_states</item> </field> </dataset> <dataset name="with_special_price_and_fpt"> <field name="type_id" xsi:type="string">simple</field> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="category_ids" xsi:type="array"> - <item name="presets" xsi:type="string">default_subcategory</item> + <item name="dataset" xsi:type="string">default_subcategory</item> </field> <field name="website_ids" xsi:type="array"> <item name="0" xsi:type="string">Main Website</item> @@ -983,19 +953,18 @@ <field name="sku" xsi:type="string">sku_simple_product_%isolation%</field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">110</item> - <item name="preset" xsi:type="string">-</item> </field> <field name="special_price" xsi:type="string">100</field> <field name="weight" xsi:type="string">1</field> <field name="url_key" xsi:type="string">simple-product-%isolation%</field> <field name="fpt" xsi:type="array"> - <item name="preset" xsi:type="string">one_fpt_for_all_states</item> + <item name="dataset" xsi:type="string">one_fpt_for_all_states</item> </field> </dataset> <dataset name="simple_10_dollar"> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="name" xsi:type="string">Simple Product %isolation%</field> <field name="sku" xsi:type="string">sku_simple_product_%isolation%</field> @@ -1007,23 +976,22 @@ </field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">10</item> - <item name="preset" xsi:type="string">-</item> </field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="website_ids" xsi:type="array"> <item name="0" xsi:type="string">Main Website</item> </field> <field name="visibility" xsi:type="string">Catalog, Search</field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">order_default</item> + <item name="dataset" xsi:type="string">simple_order_default</item> </field> <field name="stock_data" xsi:type="array"> <item name="manage_stock" xsi:type="string">No</item> </field> <field name="category_ids" xsi:type="array"> - <item name="presets" xsi:type="string">default_subcategory</item> + <item name="dataset" xsi:type="string">default_subcategory</item> </field> </dataset> </repository> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple/CheckoutData.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple/CheckoutData.xml new file mode 100644 index 0000000000000000000000000000000000000000..53227bff53859155d86fb64d4c396d4586a2b842 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple/CheckoutData.xml @@ -0,0 +1,140 @@ +<?xml version="1.0" ?> +<!-- +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> + <repository class="Magento\Catalog\Test\Repository\CatalogProductSimple\CheckoutData"> + <dataset name="simple_with_two_custom_option"> + <field name="options" xsi:type="array"> + <item name="custom_options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_0</item> + <item name="value" xsi:type="string">option_key_0</item> + </item> + <item name="1" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_1</item> + <item name="value" xsi:type="string">Content option %isolation%</item> + </item> + </item> + </field> + <field name="qty" xsi:type="string">1</field> + <field name="cartItem" xsi:type="array"> + <item name="price" xsi:type="string">340</item> + <item name="qty" xsi:type="string">1</item> + <item name="subtotal" xsi:type="string">340</item> + </field> + </dataset> + + <dataset name="simple_update_mini_shopping_cart"> + <field name="options" xsi:type="array"> + <item name="custom_options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_0</item> + <item name="value" xsi:type="string">option_key_1</item> + </item> + <item name="1" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_1</item> + <item name="value" xsi:type="string">Content option %isolation%</item> + </item> + </item> + </field> + <field name="qty" xsi:type="string">2</field> + <field name="cartItem" xsi:type="array"> + <item name="price" xsi:type="string">370</item> + <item name="subtotal" xsi:type="string">74</item> + </field> + </dataset> + + <dataset name="simple_options_suite"> + <field name="options" xsi:type="array"> + <item name="custom_options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_0</item> + <item name="value" xsi:type="string">Field value 1 %isolation%</item> + </item> + <item name="1" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_1</item> + <item name="value" xsi:type="string">Field value 2 %isolation%</item> + </item> + <item name="2" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_2</item> + <item name="value" xsi:type="string">option_key_1</item> + </item> + <item name="3" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_3</item> + <item name="value" xsi:type="string">option_key_0</item> + </item> + </item> + </field> + </dataset> + + <dataset name="simple_drop_down_with_one_option_fixed_price"> + <field name="options" xsi:type="array"> + <item name="custom_options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_0</item> + <item name="value" xsi:type="string">option_key_0</item> + </item> + </item> + </field> + </dataset> + + <dataset name="simple_drop_down_with_one_option_percent_price"> + <field name="options" xsi:type="array"> + <item name="custom_options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_0</item> + <item name="value" xsi:type="string">option_key_0</item> + </item> + </item> + </field> + </dataset> + + <dataset name="simple_order_default"> + <field name="qty" xsi:type="string">1</field> + <field name="cartItem" xsi:type="array"> + <item name="price" xsi:type="string">560</item> + <item name="subtotal" xsi:type="string">560</item> + </field> + </dataset> + + <dataset name="simple_two_products"> + <field name="qty" xsi:type="string">2</field> + <field name="cartItem" xsi:type="array"> + <item name="price" xsi:type="string">100</item> + <item name="subtotal" xsi:type="string">200</item> + </field> + </dataset> + + <dataset name="simple_order_big_qty"> + <field name="qty" xsi:type="string">900</field> + </dataset> + + <dataset name="simple_order_custom_price"> + <field name="qty" xsi:type="string">3</field> + <field name="checkout_data" xsi:type="array"> + <item name="use_custom_price" xsi:type="string">Yes</item> + <item name="custom_price" xsi:type="string">100</item> + </field> + </dataset> + + <dataset name="simple_order_special_price"> + <field name="qty" xsi:type="string">1</field> + <field name="cartItem" xsi:type="array"> + <item name="price" xsi:type="string">9</item> + <item name="subtotal" xsi:type="string">9</item> + </field> + </dataset> + + <dataset name="simple_order_10_dollar_product"> + <field name="qty" xsi:type="string">1</field> + <field name="cartItem" xsi:type="array"> + <item name="price" xsi:type="string">10</item> + <item name="subtotal" xsi:type="string">10</item> + </field> + </dataset> + </repository> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple/Price.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple/Price.xml new file mode 100644 index 0000000000000000000000000000000000000000..8b700e37456f31cb5317c98b7832f38677d4f029 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple/Price.xml @@ -0,0 +1,46 @@ +<?xml version="1.0" ?> +<!-- +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> + <repository class="Magento\Catalog\Test\Repository\CatalogProductSimple\Price"> + <dataset name="drop_down_with_one_option_fixed_price"> + <field name="category_price" xsi:type="string">100.00</field> + <field name="product_price" xsi:type="string">100.00</field> + <field name="cart_price" xsi:type="string">130.00</field> + </dataset> + + <dataset name="drop_down_with_one_option_percent_price"> + <field name="category_price" xsi:type="string">100.00</field> + <field name="product_price" xsi:type="string">100.00</field> + <field name="cart_price" xsi:type="string">140.00</field> + </dataset> + + <dataset name="MAGETWO-23029"> + <field name="category_price" xsi:type="string">100.00</field> + <field name="category_special_price" xsi:type="string">90.00</field> + <field name="product_price" xsi:type="string">100.00</field> + <field name="product_special_price" xsi:type="string">90.00</field> + <field name="cart_price" xsi:type="string">120.00</field> + </dataset> + + <dataset name="MAGETWO-23030"> + <field name="category_price" xsi:type="string">100.00</field> + <field name="category_special_price" xsi:type="string">90.00</field> + <field name="product_price" xsi:type="string">100.00</field> + <field name="product_special_price" xsi:type="string">90.00</field> + <field name="cart_price" xsi:type="string">126.00</field> + </dataset> + + <dataset name="MAGETWO-23036"> + <field name="category_price" xsi:type="string">100.00</field> + <field name="category_special_price" xsi:type="string">90.00</field> + <field name="product_price" xsi:type="string">100.00</field> + <field name="product_special_price" xsi:type="string">90.00</field> + <field name="cart_price" xsi:type="string">90.00</field> + </dataset> + </repository> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual.xml index 2e2903a0cf35267fb62eb27cec89bee8c831baef..818590b22319a1de8c03a62887e5b1e9ec8b3721 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual.xml @@ -9,7 +9,7 @@ <repository class="Magento\Catalog\Test\Repository\CatalogProductVirtual"> <dataset name="default"> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="status" xsi:type="string">Product online</field> <field name="website_ids" xsi:type="array"> @@ -19,7 +19,7 @@ <field name="url_key" xsi:type="string">virtual-product%isolation%</field> <field name="visibility" xsi:type="string">Catalog, Search</field> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="name" xsi:type="string">Virtual product %isolation%</field> <field name="sku" xsi:type="string">sku_virtual_product_%isolation%</field> @@ -29,10 +29,9 @@ </field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">10</item> - <item name="preset" xsi:type="string">-</item> </field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">order_default</item> + <item name="dataset" xsi:type="string">virtual_order_default</item> </field> </dataset> @@ -43,10 +42,9 @@ <field name="is_virtual" xsi:type="string">Yes</field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">10</item> - <item name="preset" xsi:type="string">-</item> </field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="website_ids" xsi:type="array"> <item name="0" xsi:type="string">Main Website</item> @@ -60,13 +58,12 @@ <field name="is_virtual" xsi:type="string">Yes</field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">10</item> - <item name="preset" xsi:type="string">-</item> </field> <field name="category_ids" xsi:type="array"> - <item name="presets" xsi:type="string">default_subcategory</item> + <item name="dataset" xsi:type="string">default_subcategory</item> </field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="website_ids" xsi:type="array"> <item name="0" xsi:type="string">Main Website</item> @@ -75,7 +72,7 @@ <dataset name="virtual_big_qty"> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="status" xsi:type="string">Product online</field> <field name="website_ids" xsi:type="array"> @@ -85,7 +82,7 @@ <field name="url_key" xsi:type="string">virtual-product%isolation%</field> <field name="visibility" xsi:type="string">Catalog, Search</field> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="name" xsi:type="string">Virtual product %isolation%</field> <field name="sku" xsi:type="string">sku_virtual_product_%isolation%</field> @@ -95,16 +92,15 @@ </field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">10</item> - <item name="preset" xsi:type="string">-</item> </field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">order_big_qty</item> + <item name="dataset" xsi:type="string">virtual_order_big_qty</item> </field> </dataset> <dataset name="virtual_for_sales"> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="status" xsi:type="string">Product online</field> <field name="website_ids" xsi:type="array"> @@ -114,7 +110,7 @@ <field name="url_key" xsi:type="string">virtual-product%isolation%</field> <field name="visibility" xsi:type="string">Catalog, Search</field> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="name" xsi:type="string">Virtual product %isolation%</field> <field name="sku" xsi:type="string">sku_virtual_product_%isolation%</field> @@ -124,10 +120,9 @@ </field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">10</item> - <item name="preset" xsi:type="string">-</item> </field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">order_custom_price</item> + <item name="dataset" xsi:type="string">virtual_order_custom_price</item> </field> </dataset> @@ -135,7 +130,7 @@ <field name="name" xsi:type="string">product_50_dollar %isolation%</field> <field name="sku" xsi:type="string">product_50_dollar_%isolation%</field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="status" xsi:type="string">Product online</field> <field name="website_ids" xsi:type="array"> @@ -145,7 +140,7 @@ <field name="url_key" xsi:type="string">virtual-product%isolation%</field> <field name="visibility" xsi:type="string">Catalog, Search</field> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="quantity_and_stock_status" xsi:type="array"> <item name="qty" xsi:type="string">111</item> @@ -153,16 +148,15 @@ </field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">50</item> - <item name="preset" xsi:type="string">-</item> </field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">product_50_dollar</item> + <item name="dataset" xsi:type="string">virtual_product_50_dollar</item> </field> </dataset> <dataset name="product_15_dollar"> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="website_ids" xsi:type="array"> <item name="0" xsi:type="string">Main Website</item> @@ -180,10 +174,9 @@ </field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">15</item> - <item name="preset" xsi:type="string">-</item> </field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">order_default</item> + <item name="dataset" xsi:type="string">virtual_order_default</item> </field> </dataset> </repository> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual/CheckoutData.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual/CheckoutData.xml new file mode 100644 index 0000000000000000000000000000000000000000..7a9a25ede99799eb8a9833ee558efb6b61142d0b --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual/CheckoutData.xml @@ -0,0 +1,35 @@ +<?xml version="1.0" ?> +<!-- +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> + <repository class="Magento\Catalog\Test\Repository\CatalogProductVirtual\CheckoutData"> + <dataset name="virtual_order_default"> + <field name="qty" xsi:type="string">1</field> + </dataset> + + <dataset name="virtual_order_big_qty"> + <field name="qty" xsi:type="string">900</field> + </dataset> + + <dataset name="virtual_product_50_dollar"> + <field name="qty" xsi:type="string">1</field> + <field name="cartItem" xsi:type="array"> + <item name="price" xsi:type="string">50</item> + <item name="qty" xsi:type="string">1</item> + <item name="subtotal" xsi:type="string">50</item> + </field> + </dataset> + + <dataset name="virtual_order_custom_price"> + <field name="qty" xsi:type="string">3</field> + <field name="checkout_data" xsi:type="array"> + <item name="use_custom_price" xsi:type="string">Yes</item> + <item name="custom_price" xsi:type="string">100</item> + </field> + </dataset> + </repository> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Category.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Category.xml index 6f12c7c4305770f8895c24830ddf538f57f7a567..e08fb4234aae848630002b3bffb66d6bb7b218d4 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Category.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Category.xml @@ -7,6 +7,16 @@ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> <repository class="Magento\Catalog\Test\Repository\Category"> + <dataset name="default"> + <field name="name" xsi:type="string">Category%isolation%</field> + <field name="url_key" xsi:type="string">category%isolation%</field> + <field name="is_active" xsi:type="string">Yes</field> + <field name="include_in_menu" xsi:type="string">Yes</field> + <field name="parent_id" xsi:type="array"> + <item name="dataset" xsi:type="string">default_category</item> + </field> + </dataset> + <dataset name="default_category"> <field name="name" xsi:type="string">Default Category</field> <field name="parent_id" xsi:type="string">1</field> @@ -18,7 +28,7 @@ <field name="name" xsi:type="string">DefaultSubcategory%isolation%</field> <field name="url_key" xsi:type="string">default-subcategory-%isolation%</field> <field name="parent_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default_category</item> + <item name="dataset" xsi:type="string">default_category</item> </field> <field name="is_active" xsi:type="string">Yes</field> <field name="include_in_menu" xsi:type="string">Yes</field> @@ -28,7 +38,7 @@ <field name="name" xsi:type="string">DefaultSubcategory%isolation%</field> <field name="url_key" xsi:type="string">default-subcategory-%isolation%</field> <field name="parent_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default_category</item> + <item name="dataset" xsi:type="string">default_category</item> </field> <field name="is_active" xsi:type="string">Yes</field> <field name="is_anchor" xsi:type="string">Yes</field> @@ -47,7 +57,7 @@ <field name="name" xsi:type="string">RootSubCategory%isolation%</field> <field name="url_key" xsi:type="string">root-sub-category-%isolation%</field> <field name="parent_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">root_category</item> + <item name="dataset" xsi:type="string">root_category</item> </field> <field name="is_active" xsi:type="string">Yes</field> <field name="include_in_menu" xsi:type="string">Yes</field> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Product/CustomOptions.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Product/CustomOptions.xml new file mode 100644 index 0000000000000000000000000000000000000000..a785e3bda5ed7a129c899439c6eea6f59a2864a9 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Product/CustomOptions.xml @@ -0,0 +1,317 @@ +<?xml version="1.0" ?> +<!-- +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> + <repository class="Magento\Catalog\Test\Repository\Product\CustomOptions"> + <dataset name="default"> + <field name="0" xsi:type="array"> + <item name="title" xsi:type="string">custom option drop down %isolation%</item> + <item name="is_require" xsi:type="string">Yes</item> + <item name="type" xsi:type="string">Select/Drop-down</item> + <item name="options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">10 percent</item> + <item name="price" xsi:type="string">10</item> + <item name="price_type" xsi:type="string">Percent</item> + <item name="sku" xsi:type="string">sku_drop_down_row_1</item> + </item> + </item> + </field> + <field name="1" xsi:type="array"> + <item name="title" xsi:type="string">custom option drop down2 %isolation%</item> + <item name="is_require" xsi:type="string">Yes</item> + <item name="type" xsi:type="string">Select/Drop-down</item> + <item name="options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">20 percent</item> + <item name="price" xsi:type="string">20</item> + <item name="price_type" xsi:type="string">Percent</item> + <item name="sku" xsi:type="string">sku_drop_down_row_2</item> + </item> + </item> + </field> + </dataset> + + <dataset name="two_options"> + <field name="0" xsi:type="array"> + <item name="title" xsi:type="string">custom option drop down %isolation%</item> + <item name="is_require" xsi:type="string">Yes</item> + <item name="type" xsi:type="string">Select/Drop-down</item> + <item name="options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">10 percent</item> + <item name="price" xsi:type="string">10</item> + <item name="price_type" xsi:type="string">Percent</item> + <item name="sku" xsi:type="string">sku_drop_down_row_1</item> + </item> + <item name="1" xsi:type="array"> + <item name="title" xsi:type="string">20 percent</item> + <item name="price" xsi:type="string">20</item> + <item name="price_type" xsi:type="string">Percent</item> + <item name="sku" xsi:type="string">sku_drop_down_row_2</item> + </item> + </item> + </field> + <field name="1" xsi:type="array"> + <item name="title" xsi:type="string">custom option field %isolation%</item> + <item name="is_require" xsi:type="string">Yes</item> + <item name="type" xsi:type="string">Text/Field</item> + <item name="options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="price" xsi:type="string">10</item> + <item name="price_type" xsi:type="string">Fixed</item> + <item name="sku" xsi:type="string">sku_field_option_%isolation%</item> + <item name="max_characters" xsi:type="string">1024</item> + </item> + </item> + </field> + </dataset> + + <dataset name="drop_down_with_one_option_fixed_price"> + <field name="0" xsi:type="array"> + <item name="title" xsi:type="string">custom option drop down %isolation%</item> + <item name="is_require" xsi:type="string">Yes</item> + <item name="type" xsi:type="string">Select/Drop-down</item> + <item name="options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">30 bucks</item> + <item name="price" xsi:type="string">30</item> + <item name="price_type" xsi:type="string">Fixed</item> + <item name="sku" xsi:type="string">sku_drop_down_row_1</item> + </item> + </item> + </field> + </dataset> + + <dataset name="drop_down_with_one_option_percent_price"> + <field name="0" xsi:type="array"> + <item name="title" xsi:type="string">custom option drop down %isolation%</item> + <item name="is_require" xsi:type="string">Yes</item> + <item name="type" xsi:type="string">Select/Drop-down</item> + <item name="options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">40 Percent</item> + <item name="price" xsi:type="string">40</item> + <item name="price_type" xsi:type="string">Percent</item> + <item name="sku" xsi:type="string">sku_drop_down_row_1</item> + </item> + </item> + </field> + </dataset> + + <dataset name="options_suite"> + <field name="0" xsi:type="array"> + <item name="title" xsi:type="string">Test1 option %isolation%</item> + <item name="is_require" xsi:type="string">Yes</item> + <item name="type" xsi:type="string">Text/Field</item> + <item name="options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="price" xsi:type="string">120.03</item> + <item name="price_type" xsi:type="string">Fixed</item> + <item name="sku" xsi:type="string">sku1_%isolation%</item> + <item name="max_characters" xsi:type="string">45</item> + </item> + </item> + </field> + <field name="1" xsi:type="array"> + <item name="title" xsi:type="string">Test2 option %isolation%</item> + <item name="is_require" xsi:type="string">Yes</item> + <item name="type" xsi:type="string">Text/Field</item> + <item name="options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="price" xsi:type="string">120.03</item> + <item name="price_type" xsi:type="string">Fixed</item> + <item name="sku" xsi:type="string">sku1_%isolation%</item> + <item name="max_characters" xsi:type="string">45</item> + </item> + </item> + </field> + <field name="2" xsi:type="array"> + <item name="title" xsi:type="string">Test3 option %isolation%</item> + <item name="is_require" xsi:type="string">Yes</item> + <item name="type" xsi:type="string">Select/Drop-down</item> + <item name="options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">Test3-1 %isolation%</item> + <item name="price" xsi:type="string">110.01</item> + <item name="price_type" xsi:type="string">Percent</item> + <item name="sku" xsi:type="string">Percent</item> + </item> + <item name="1" xsi:type="array"> + <item name="title" xsi:type="string">Test3-2 %isolation%</item> + <item name="price" xsi:type="string">210.02</item> + <item name="price_type" xsi:type="string">Fixed</item> + <item name="sku" xsi:type="string">sku3_%isolation%</item> + </item> + </item> + </field> + <field name="3" xsi:type="array"> + <item name="title" xsi:type="string">Test4 option %isolation%</item> + <item name="is_require" xsi:type="string">Yes</item> + <item name="type" xsi:type="string">Select/Drop-down</item> + <item name="options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">Test4-1 %isolation%</item> + <item name="price" xsi:type="string">10.01</item> + <item name="price_type" xsi:type="string">Percent</item> + <item name="sku" xsi:type="string">sku2_%isolation%</item> + </item> + <item name="1" xsi:type="array"> + <item name="title" xsi:type="string">Test4-2 %isolation%</item> + <item name="price" xsi:type="string">20.02</item> + <item name="price_type" xsi:type="string">Fixed</item> + <item name="sku" xsi:type="string">sku3_%isolation%</item> + </item> + </item> + </field> + </dataset> + + <dataset name="all_types"> + <field name="0" xsi:type="array"> + <item name="title" xsi:type="string">custom option field %isolation%</item> + <item name="is_require" xsi:type="string">Yes</item> + <item name="type" xsi:type="string">Text/Field</item> + <item name="options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="price" xsi:type="string">10</item> + <item name="price_type" xsi:type="string">Fixed</item> + <item name="sku" xsi:type="string">sku_field_option_%isolation%</item> + <item name="max_characters" xsi:type="string">1024</item> + </item> + </item> + </field> + <field name="1" xsi:type="array"> + <item name="title" xsi:type="string">custom option Area %isolation%</item> + <item name="is_require" xsi:type="string">Yes</item> + <item name="type" xsi:type="string">Text/Area</item> + <item name="options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="price" xsi:type="string">10</item> + <item name="price_type" xsi:type="string">Fixed</item> + <item name="sku" xsi:type="string">sku_area_row_%isolation%</item> + <item name="max_characters" xsi:type="string">100</item> + </item> + </item> + </field> + <field name="2" xsi:type="array"> + <item name="title" xsi:type="string">custom option File %isolation%</item> + <item name="is_require" xsi:type="string">No</item> + <item name="type" xsi:type="string">File/File</item> + <item name="options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="price" xsi:type="string">10</item> + <item name="price_type" xsi:type="string">Fixed</item> + <item name="sku" xsi:type="string">sku_file_row_%isolation%</item> + <item name="file_extension" xsi:type="string">jpg</item> + <item name="image_size_x" xsi:type="string">100</item> + <item name="image_size_y" xsi:type="string">100</item> + </item> + </item> + </field> + <field name="3" xsi:type="array"> + <item name="title" xsi:type="string">custom option drop down %isolation%</item> + <item name="is_require" xsi:type="string">Yes</item> + <item name="type" xsi:type="string">Select/Drop-down</item> + <item name="options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">10 percent</item> + <item name="price" xsi:type="string">10</item> + <item name="price_type" xsi:type="string">Percent</item> + <item name="sku" xsi:type="string">sku_drop_down_row_1_%isolation%</item> + </item> + <item name="1" xsi:type="array"> + <item name="title" xsi:type="string">20 percent</item> + <item name="price" xsi:type="string">20</item> + <item name="price_type" xsi:type="string">Percent</item> + <item name="sku" xsi:type="string">sku_drop_down_row_2_%isolation%</item> + </item> + <item name="2" xsi:type="array"> + <item name="title" xsi:type="string">30 fixed</item> + <item name="price" xsi:type="string">30</item> + <item name="price_type" xsi:type="string">Fixed</item> + <item name="sku" xsi:type="string">sku_drop_down_row_3_%isolation%</item> + </item> + </item> + </field> + <field name="4" xsi:type="array"> + <item name="title" xsi:type="string">custom option Radio Buttons %isolation%</item> + <item name="is_require" xsi:type="string">Yes</item> + <item name="type" xsi:type="string">Select/Radio Buttons</item> + <item name="options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">20 fixed</item> + <item name="price" xsi:type="string">20</item> + <item name="price_type" xsi:type="string">Fixed</item> + <item name="sku" xsi:type="string">sku_radio_buttons_row%isolation%</item> + </item> + </item> + </field> + <field name="5" xsi:type="array"> + <item name="title" xsi:type="string">custom option Checkbox %isolation%</item> + <item name="is_require" xsi:type="string">Yes</item> + <item name="type" xsi:type="string">Select/Checkbox</item> + <item name="options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">20 fixed</item> + <item name="price" xsi:type="string">20</item> + <item name="price_type" xsi:type="string">Fixed</item> + <item name="sku" xsi:type="string">sku_checkbox_row%isolation%</item> + </item> + </item> + </field> + <field name="6" xsi:type="array"> + <item name="title" xsi:type="string">custom option Multiple Select %isolation%</item> + <item name="is_require" xsi:type="string">Yes</item> + <item name="type" xsi:type="string">Select/Multiple Select</item> + <item name="options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">20 fixed</item> + <item name="price" xsi:type="string">20</item> + <item name="price_type" xsi:type="string">Fixed</item> + <item name="sku" xsi:type="string">sku_multiple_select_row%isolation%</item> + </item> + </item> + </field> + <field name="7" xsi:type="array"> + <item name="title" xsi:type="string">custom option Date %isolation%</item> + <item name="is_require" xsi:type="string">Yes</item> + <item name="type" xsi:type="string">Date/Date</item> + <item name="options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="price" xsi:type="string">20</item> + <item name="price_type" xsi:type="string">Fixed</item> + <item name="sku" xsi:type="string">sku_date_row%isolation%</item> + </item> + </item> + </field> + <field name="8" xsi:type="array"> + <item name="title" xsi:type="string">custom option Date & Time %isolation%</item> + <item name="is_require" xsi:type="string">Yes</item> + <item name="type" xsi:type="string">Date/Date & Time</item> + <item name="options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="price" xsi:type="string">20</item> + <item name="price_type" xsi:type="string">Fixed</item> + <item name="sku" xsi:type="string">sku_date_and_time_row%isolation%</item> + </item> + </item> + </field> + <field name="9" xsi:type="array"> + <item name="title" xsi:type="string">custom option Time %isolation%</item> + <item name="is_require" xsi:type="string">Yes</item> + <item name="type" xsi:type="string">Date/Time</item> + <item name="options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="price" xsi:type="string">20</item> + <item name="price_type" xsi:type="string">Fixed</item> + <item name="sku" xsi:type="string">sku_time_row%isolation%</item> + </item> + </item> + </field> + </dataset> + </repository> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Product/Fpt.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Product/Fpt.xml new file mode 100644 index 0000000000000000000000000000000000000000..c942bb1d6517bb09abaa435ed180f821d03f198a --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Product/Fpt.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" ?> +<!-- +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> + <repository class="Magento\Catalog\Test\Repository\Product\Fpt"> + <dataset name="one_fpt_for_all_states"> + <field name="0" xsi:type="array"> + <item name="price" xsi:type="string">10</item> + <item name="website" xsi:type="string">All Websites [USD]</item> + <item name="country_name" xsi:type="string">United States</item> + <item name="state_name" xsi:type="string">*</item> + </field> + </dataset> + </repository> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Product/GroupPriceOptions.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Product/GroupPriceOptions.xml new file mode 100644 index 0000000000000000000000000000000000000000..c55de6d823b8c81bf52abce6e3866445d2a999ba --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Product/GroupPriceOptions.xml @@ -0,0 +1,34 @@ +<?xml version="1.0" ?> +<!-- +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> + <repository class="Magento\Catalog\Test\Repository\Product\GroupPriceOptions"> + <dataset name="not_logged_in_20"> + <field name="0" xsi:type="array"> + <item name="price" xsi:type="string">20</item> + <item name="website" xsi:type="string">All Websites [USD]</item> + <item name="customer_group" xsi:type="string">NOT LOGGED IN</item> + </field> + </dataset> + + <dataset name="not_logged_in_90"> + <field name="0" xsi:type="array"> + <item name="price" xsi:type="string">90</item> + <item name="website" xsi:type="string">All Websites [USD]</item> + <item name="customer_group" xsi:type="string">NOT LOGGED IN</item> + </field> + </dataset> + + <dataset name="general_90_99"> + <field name="0" xsi:type="array"> + <item name="price" xsi:type="string">90.99</item> + <item name="website" xsi:type="string">All Websites [USD]</item> + <item name="customer_group" xsi:type="string">General</item> + </field> + </dataset> + </repository> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Product/TierPrice.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Product/TierPrice.xml new file mode 100644 index 0000000000000000000000000000000000000000..805c784847fede76be38cb664d180f3b07e04c06 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Product/TierPrice.xml @@ -0,0 +1,34 @@ +<?xml version="1.0" ?> +<!-- +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> + <repository class="Magento\Catalog\Test\Repository\Product\TierPrice"> + <dataset name="default"> + <field name="0" xsi:type="array"> + <item name="price" xsi:type="string">15</item> + <item name="website" xsi:type="string">All Websites [USD]</item> + <item name="price_qty" xsi:type="string">3</item> + <item name="customer_group" xsi:type="string">ALL GROUPS</item> + </field> + <field name="1" xsi:type="array"> + <item name="price" xsi:type="string">24</item> + <item name="website" xsi:type="string">All Websites [USD]</item> + <item name="price_qty" xsi:type="string">15</item> + <item name="customer_group" xsi:type="string">ALL GROUPS</item> + </field> + </dataset> + + <dataset name="MAGETWO-23002"> + <field name="0" xsi:type="array"> + <item name="price" xsi:type="string">90</item> + <item name="website" xsi:type="string">All Websites [USD]</item> + <item name="price_qty" xsi:type="string">2</item> + <item name="customer_group" xsi:type="string">ALL GROUPS</item> + </field> + </dataset> + </repository> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/ProductAttribute.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/ProductAttribute.php deleted file mode 100644 index 5834f1f1d2d9752a65b09d5fdc0f9a03a986451c..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/ProductAttribute.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Catalog\Test\Repository; - -use Magento\Mtf\Repository\AbstractRepository; - -/** - * Class Product Attribute Repository - * - */ -class ProductAttribute extends AbstractRepository -{ - /** - * Construct - * - * @param array $defaultConfig - * @param array $defaultData - */ - public function __construct(array $defaultConfig = [], array $defaultData = []) - { - $this->_data['default'] = [ - 'config' => $defaultConfig, - 'data' => $defaultData, - ]; - - $this->_data['configurable_attribute'] = $this->_data['default']; - - $this->_data['new_attribute'] = [ - 'config' => $defaultConfig, - 'data' => $this->buildNewAttributeData($defaultData), - ]; - } - - /** - * Build new attribute data set - * - * @param array $defaultData - * @return array - */ - protected function buildNewAttributeData(array $defaultData) - { - unset($defaultData['fields']['attribute_code']); - return $defaultData; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/CreateCategoryEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/CreateCategoryEntityTest.xml index 83d80113af0ae3d885bd6e2f706b904a39164dfd..88a87a7dd63b43dbac089279bf4a7419e65eab17 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/CreateCategoryEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/CreateCategoryEntityTest.xml @@ -46,7 +46,7 @@ <variation name="CreateCategoryEntityTestVariation3"> <data name="description" xsi:type="string">Create subcategory with required fields</data> <data name="addCategory" xsi:type="string">addSubcategory</data> - <data name="category/data/parent_id/dataSet" xsi:type="string">default_category</data> + <data name="category/data/parent_id/dataset" xsi:type="string">default_category</data> <data name="category/data/name" xsi:type="string">Subcategory%isolation%</data> <data name="category/data/url_key" xsi:type="string">Subcategory%isolation%</data> <data name="category/data/is_active" xsi:type="string">Yes</data> @@ -59,7 +59,7 @@ <variation name="CreateCategoryEntityTestVariation4"> <data name="description" xsi:type="string">Create not anchor subcategory with required fields</data> <data name="addCategory" xsi:type="string">addSubcategory</data> - <data name="category/data/parent_id/dataSet" xsi:type="string">default_category</data> + <data name="category/data/parent_id/dataset" xsi:type="string">default_category</data> <data name="category/data/name" xsi:type="string">Subcategory%isolation%</data> <data name="category/data/url_key" xsi:type="string">Subcategory%isolation%</data> <data name="category/data/is_active" xsi:type="string">Yes</data> @@ -69,7 +69,7 @@ <data name="category/data/available_product_listing_config" xsi:type="string">Yes</data> <data name="category/data/default_product_listing_config" xsi:type="string">Yes</data> <data name="category/data/use_config_price_range" xsi:type="string">Yes</data> - <data name="category/data/category_products/dataSet" xsi:type="string">catalogProductSimple::default,catalogProductSimple::default</data> + <data name="category/data/category_products/dataset" xsi:type="string">catalogProductSimple::default,catalogProductSimple::default</data> <constraint name="Magento\Catalog\Test\Constraint\AssertCategorySaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertCategoryForm" /> <constraint name="Magento\Catalog\Test\Constraint\AssertCategoryPage" /> @@ -78,7 +78,7 @@ <variation name="CreateCategoryEntityTestVariation5"> <data name="description" xsi:type="string">Create anchor subcategory with all fields</data> <data name="addCategory" xsi:type="string">addSubcategory</data> - <data name="category/data/parent_id/dataSet" xsi:type="string">default_category</data> + <data name="category/data/parent_id/dataset" xsi:type="string">default_category</data> <data name="category/data/name" xsi:type="string">Subcategory%isolation%</data> <data name="category/data/url_key" xsi:type="string">Subcategory%isolation%</data> <data name="category/data/is_active" xsi:type="string">Yes</data> @@ -86,7 +86,7 @@ <data name="category/data/meta_title" xsi:type="string">Subcategory Page Title</data> <data name="category/data/include_in_menu" xsi:type="string">Yes</data> <data name="category/data/display_mode" xsi:type="string">Static block and products</data> - <data name="category/data/landing_page/preset" xsi:type="string">default</data> + <data name="category/data/landing_page/dataset" xsi:type="string">default</data> <data name="category/data/is_anchor" xsi:type="string">Yes</data> <data name="category/data/available_product_listing_config" xsi:type="string">No</data> <data name="category/data/available_sort_by/sort_0" xsi:type="string">Position</data> @@ -96,7 +96,7 @@ <data name="category/data/default_sort_by" xsi:type="string">Price</data> <data name="category/data/use_config_price_range" xsi:type="string">No</data> <data name="category/data/layered_navigation_price_step" xsi:type="string">50</data> - <data name="category/data/category_products/dataSet" xsi:type="string">catalogProductSimple::default,catalogProductSimple::default</data> + <data name="category/data/category_products/dataset" xsi:type="string">catalogProductSimple::default,catalogProductSimple::default</data> <constraint name="Magento\Catalog\Test\Constraint\AssertCategorySaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertCategoryForm" /> <constraint name="Magento\Catalog\Test\Constraint\AssertCategoryPage" /> @@ -105,7 +105,7 @@ <variation name="CreateCategoryEntityTestVariation6"> <data name="description" xsi:type="string">Create not active subcategory</data> <data name="addCategory" xsi:type="string">addSubcategory</data> - <data name="category/data/parent_id/dataSet" xsi:type="string">default_category</data> + <data name="category/data/parent_id/dataset" xsi:type="string">default_category</data> <data name="category/data/name" xsi:type="string">Subcategory%isolation%</data> <data name="category/data/url_key" xsi:type="string">Subcategory%isolation%</data> <data name="category/data/is_active" xsi:type="string">Yes</data> @@ -120,7 +120,7 @@ <variation name="CreateCategoryEntityTestVariation7"> <data name="description" xsi:type="string">Create not included in menu subcategory</data> <data name="addCategory" xsi:type="string">addSubcategory</data> - <data name="category/data/parent_id/dataSet" xsi:type="string">default_category</data> + <data name="category/data/parent_id/dataset" xsi:type="string">default_category</data> <data name="category/data/name" xsi:type="string">Subcategory%isolation%</data> <data name="category/data/url_key" xsi:type="string">Subcategory%isolation%</data> <data name="category/data/is_active" xsi:type="string">Yes</data> @@ -132,7 +132,7 @@ <variation name="CreateCategoryEntityTestVariation8"> <data name="description" xsi:type="string">MAGETWO-12513: Create Category from Category page with Required Fields Only</data> <data name="addCategory" xsi:type="string">addSubcategory</data> - <data name="category/data/parent_id/dataSet" xsi:type="string">default_category</data> + <data name="category/data/parent_id/dataset" xsi:type="string">default_category</data> <data name="category/data/name" xsi:type="string">Subcategory%isolation%</data> <data name="category/data/is_active" xsi:type="string">Yes</data> <data name="category/data/include_in_menu" xsi:type="string">Yes</data> @@ -144,11 +144,11 @@ <variation name="CreateCategoryEntityTestVariation9"> <data name="description" xsi:type="string">MAGETWO-16351: Assign Products at the Category Level</data> <data name="addCategory" xsi:type="string">addSubcategory</data> - <data name="category/data/parent_id/dataSet" xsi:type="string">default_category</data> + <data name="category/data/parent_id/dataset" xsi:type="string">default_category</data> <data name="category/data/name" xsi:type="string">Subcategory%isolation%</data> <data name="category/data/is_active" xsi:type="string">Yes</data> <data name="category/data/include_in_menu" xsi:type="string">Yes</data> - <data name="category/data/category_products/dataSet" xsi:type="string">catalogProductSimple::default, configurableProduct::default, bundleProduct::bundle_fixed_product</data> + <data name="category/data/category_products/dataset" xsi:type="string">catalogProductSimple::default, configurableProduct::default, bundleProduct::bundle_fixed_product</data> <data name="tag" xsi:type="string">test_type:acceptance_test</data> <constraint name="Magento\Catalog\Test\Constraint\AssertCategorySaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertCategoryForAssignedProducts" /> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/DeleteCategoryEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/DeleteCategoryEntityTest.xml index 6e1a9b50d3b46e4140241fcfc9e4a4086f16c726..391a0df0752ace44e645bb475a4c4d94fe9b2ade 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/DeleteCategoryEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/DeleteCategoryEntityTest.xml @@ -8,12 +8,12 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Catalog\Test\TestCase\Category\DeleteCategoryEntityTest"> <variation name="DeleteCategoryEntityTestVariation1"> - <data name="category/dataSet" xsi:type="string">root_category</data> + <data name="category/dataset" xsi:type="string">root_category</data> <constraint name="Magento\Catalog\Test\Constraint\AssertCategorySuccessDeleteMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertCategoryAbsenceOnBackend" /> </variation> <variation name="DeleteCategoryEntityTestVariation2"> - <data name="category/dataSet" xsi:type="string">root_subcategory</data> + <data name="category/dataset" xsi:type="string">root_subcategory</data> <constraint name="Magento\Catalog\Test\Constraint\AssertCategorySuccessDeleteMessage" /> <constraint name="Magento\UrlRewrite\Test\Constraint\AssertUrlRewriteCategoryNotInGrid" /> <constraint name="Magento\Catalog\Test\Constraint\AssertCategoryAbsenceOnBackend" /> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/UpdateCategoryEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/UpdateCategoryEntityTest.xml index ed7e2cdbd4394824e95cbcb4328d220255f6f2d5..438c23775e13d43931603b970ed929c9d4560963 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/UpdateCategoryEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/UpdateCategoryEntityTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Catalog\Test\TestCase\Category\UpdateCategoryEntityTest"> <variation name="UpdateCategoryEntityTestVariation1"> - <data name="category/data/parent_id/dataSet" xsi:type="string">default_category</data> + <data name="category/data/parent_id/dataset" xsi:type="string">default_category</data> <data name="category/data/name" xsi:type="string">Name%isolation%</data> <data name="category/data/is_active" xsi:type="string">Yes</data> <data name="category/data/url_key" xsi:type="string">UrlKey%isolation%</data> @@ -23,7 +23,7 @@ <constraint name="Magento\Catalog\Test\Constraint\AssertCategoryPage" /> </variation> <variation name="UpdateCategoryEntityTestVariation2"> - <data name="category/data/parent_id/dataSet" xsi:type="string">default_category</data> + <data name="category/data/parent_id/dataset" xsi:type="string">default_category</data> <data name="category/data/name" xsi:type="string">Name%isolation%</data> <data name="category/data/is_active" xsi:type="string">Yes</data> <data name="category/data/url_key" xsi:type="string">UrlKey%isolation%</data> @@ -40,7 +40,7 @@ <constraint name="Magento\Catalog\Test\Constraint\AssertCategoryPage" /> </variation> <variation name="UpdateCategoryEntityTestVariation3"> - <data name="category/data/parent_id/dataSet" xsi:type="string">default_category</data> + <data name="category/data/parent_id/dataset" xsi:type="string">default_category</data> <data name="category/data/name" xsi:type="string">Name%isolation%</data> <data name="category/data/is_active" xsi:type="string">No</data> <constraint name="Magento\Catalog\Test\Constraint\AssertCategorySaveMessage" /> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AbstractCompareProductsTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AbstractCompareProductsTest.php index ed44c17d572bdd9db17cfa213bbd0b1916d2854c..6b6b889a1728184021ae063f7970cc272fe9acbc 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AbstractCompareProductsTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AbstractCompareProductsTest.php @@ -138,8 +138,8 @@ abstract class AbstractCompareProductsTest extends Injectable { $products = explode(',', $products); foreach ($products as $key => $product) { - list($fixture, $dataSet) = explode('::', $product); - $product = $this->fixtureFactory->createByCode($fixture, ['dataSet' => $dataSet]); + list($fixture, $dataset) = explode('::', $product); + $product = $this->fixtureFactory->createByCode($fixture, ['dataset' => $dataset]); $product->persist(); $products[$key] = $product; } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AbstractProductPromotedProductsTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AbstractProductPromotedProductsTest.php index a99ac0e95137636019e6f759dd403f5d5eb659d2..902e241e6e480fef05f851c4b3a6069841e4f086 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AbstractProductPromotedProductsTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AbstractProductPromotedProductsTest.php @@ -103,8 +103,8 @@ abstract class AbstractProductPromotedProductsTest extends Injectable $list = array_map('trim', explode(',', $products)); foreach ($list as $item) { - list($productName, $fixtureCode, $dataSet) = array_map('trim', explode('::', $item)); - $product = $this->fixtureFactory->createByCode($fixtureCode, ['dataSet' => $dataSet]); + list($productName, $fixtureCode, $dataset) = array_map('trim', explode('::', $item)); + $product = $this->fixtureFactory->createByCode($fixtureCode, ['dataset' => $dataset]); $product->persist(); $this->products[$productName] = $product; diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.xml index 364854e6870bbf6a8b9aa15989b7ccececcb7cbc..7983610bd33192616f70fe972c04902d392e2c09 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.xml @@ -17,9 +17,9 @@ <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> <data name="product/data/weight" xsi:type="string">50</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">657</data> - <data name="product/data/custom_options/preset" xsi:type="string">drop_down_with_one_option_fixed_price</data> - <data name="product/data/checkout_data/preset" xsi:type="string">drop_down_with_one_option_fixed_price</data> - <data name="product/data/price/preset" xsi:type="string">drop_down_with_one_option_fixed_price</data> + <data name="product/data/custom_options/dataset" xsi:type="string">drop_down_with_one_option_fixed_price</data> + <data name="product/data/checkout_data/dataset" xsi:type="string">simple_drop_down_with_one_option_fixed_price</data> + <data name="product/data/price/dataset" xsi:type="string">drop_down_with_one_option_fixed_price</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory" /> @@ -36,9 +36,9 @@ <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> <data name="product/data/weight" xsi:type="string">51</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">658</data> - <data name="product/data/custom_options/preset" xsi:type="string">drop_down_with_one_option_percent_price</data> - <data name="product/data/checkout_data/preset" xsi:type="string">drop_down_with_one_option_percent_price</data> - <data name="product/data/price/preset" xsi:type="string">drop_down_with_one_option_percent_price</data> + <data name="product/data/custom_options/dataset" xsi:type="string">drop_down_with_one_option_percent_price</data> + <data name="product/data/checkout_data/dataset" xsi:type="string">simple_drop_down_with_one_option_percent_price</data> + <data name="product/data/price/dataset" xsi:type="string">drop_down_with_one_option_percent_price</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory" /> @@ -56,9 +56,9 @@ <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> <data name="product/data/weight" xsi:type="string">52</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">659</data> - <data name="product/data/custom_options/preset" xsi:type="string">drop_down_with_one_option_fixed_price</data> - <data name="product/data/checkout_data/preset" xsi:type="string">drop_down_with_one_option_fixed_price</data> - <data name="product/data/price/preset" xsi:type="string">MAGETWO-23029</data> + <data name="product/data/custom_options/dataset" xsi:type="string">drop_down_with_one_option_fixed_price</data> + <data name="product/data/checkout_data/dataset" xsi:type="string">simple_drop_down_with_one_option_fixed_price</data> + <data name="product/data/price/dataset" xsi:type="string">MAGETWO-23029</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory" /> @@ -76,9 +76,9 @@ <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> <data name="product/data/weight" xsi:type="string">53</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">660</data> - <data name="product/data/custom_options/preset" xsi:type="string">drop_down_with_one_option_percent_price</data> - <data name="product/data/checkout_data/preset" xsi:type="string">drop_down_with_one_option_percent_price</data> - <data name="product/data/price/preset" xsi:type="string">MAGETWO-23030</data> + <data name="product/data/custom_options/dataset" xsi:type="string">drop_down_with_one_option_percent_price</data> + <data name="product/data/checkout_data/dataset" xsi:type="string">simple_drop_down_with_one_option_percent_price</data> + <data name="product/data/price/dataset" xsi:type="string">MAGETWO-23030</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory" /> @@ -95,10 +95,10 @@ <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> <data name="product/data/weight" xsi:type="string">54</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">661</data> - <data name="product/data/custom_options/preset" xsi:type="string">drop_down_with_one_option_percent_price</data> - <data name="product/data/checkout_data/preset" xsi:type="string">drop_down_with_one_option_percent_price</data> - <data name="product/data/price/preset" xsi:type="string">MAGETWO-23030</data> - <data name="product/data/group_price/preset" xsi:type="string">MAGETWO-23055</data> + <data name="product/data/custom_options/dataset" xsi:type="string">drop_down_with_one_option_percent_price</data> + <data name="product/data/checkout_data/dataset" xsi:type="string">simple_drop_down_with_one_option_percent_price</data> + <data name="product/data/price/dataset" xsi:type="string">MAGETWO-23030</data> + <data name="product/data/group_price/dataset" xsi:type="string">not_logged_in_90</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory" /> @@ -115,10 +115,10 @@ <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> <data name="product/data/weight" xsi:type="string">55</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">662</data> - <data name="product/data/custom_options/preset" xsi:type="string">drop_down_with_one_option_fixed_price</data> - <data name="product/data/checkout_data/preset" xsi:type="string">drop_down_with_one_option_fixed_price</data> - <data name="product/data/price/preset" xsi:type="string">MAGETWO-23029</data> - <data name="product/data/group_price/preset" xsi:type="string">MAGETWO-23055</data> + <data name="product/data/custom_options/dataset" xsi:type="string">drop_down_with_one_option_fixed_price</data> + <data name="product/data/checkout_data/dataset" xsi:type="string">simple_drop_down_with_one_option_fixed_price</data> + <data name="product/data/price/dataset" xsi:type="string">MAGETWO-23029</data> + <data name="product/data/group_price/dataset" xsi:type="string">not_logged_in_90</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory" /> @@ -135,10 +135,10 @@ <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> <data name="product/data/weight" xsi:type="string">56</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">663</data> - <data name="product/data/custom_options/preset" xsi:type="string">drop_down_with_one_option_percent_price</data> - <data name="product/data/checkout_data/preset" xsi:type="string">drop_down_with_one_option_percent_price</data> - <data name="product/data/price/preset" xsi:type="string">MAGETWO-23030</data> - <data name="product/data/tier_price/preset" xsi:type="string">MAGETWO-23002</data> + <data name="product/data/custom_options/dataset" xsi:type="string">drop_down_with_one_option_percent_price</data> + <data name="product/data/checkout_data/dataset" xsi:type="string">simple_drop_down_with_one_option_percent_price</data> + <data name="product/data/price/dataset" xsi:type="string">MAGETWO-23030</data> + <data name="product/data/tier_price/dataset" xsi:type="string">MAGETWO-23002</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory" /> @@ -155,10 +155,10 @@ <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> <data name="product/data/weight" xsi:type="string">57</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">664</data> - <data name="product/data/custom_options/preset" xsi:type="string">drop_down_with_one_option_fixed_price</data> - <data name="product/data/checkout_data/preset" xsi:type="string">drop_down_with_one_option_fixed_price</data> - <data name="product/data/price/preset" xsi:type="string">MAGETWO-23029</data> - <data name="product/data/tier_price/preset" xsi:type="string">MAGETWO-23002</data> + <data name="product/data/custom_options/dataset" xsi:type="string">drop_down_with_one_option_fixed_price</data> + <data name="product/data/checkout_data/dataset" xsi:type="string">simple_drop_down_with_one_option_fixed_price</data> + <data name="product/data/price/dataset" xsi:type="string">MAGETWO-23029</data> + <data name="product/data/tier_price/dataset" xsi:type="string">MAGETWO-23002</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory" /> @@ -261,13 +261,13 @@ <data name="product/data/url_key" xsi:type="string">simple-product-%isolation%</data> <data name="product/data/name" xsi:type="string">Simple Product %isolation%</data> <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> + <data name="product/data/tax_class_id/dataset" xsi:type="string">taxable_goods</data> <data name="product/data/price/value" xsi:type="string">10014</data> <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> <data name="product/data/weight" xsi:type="string">64</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">141</data> - <data name="product/data/group_price/preset" xsi:type="string">default</data> + <data name="product/data/group_price/dataset" xsi:type="string">not_logged_in_20</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductForm" /> @@ -281,7 +281,7 @@ <data name="product/data/url_key" xsi:type="string">simple-product-%isolation%</data> <data name="product/data/name" xsi:type="string">Simple Product %isolation%</data> <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> + <data name="product/data/tax_class_id/dataset" xsi:type="string">taxable_goods</data> <data name="product/data/price/value" xsi:type="string">10015</data> <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> @@ -300,13 +300,13 @@ <data name="product/data/url_key" xsi:type="string">simple-product-%isolation%</data> <data name="product/data/name" xsi:type="string">Simple Product %isolation%</data> <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">None</data> + <data name="product/data/tax_class_id/dataset" xsi:type="string">None</data> <data name="product/data/price/value" xsi:type="string">10016</data> <data name="product/data/short_description" xsi:type="string">Simple Product short_description %isolation%</data> <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> <data name="product/data/weight" xsi:type="string">66</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">143</data> - <data name="product/data/tier_price/preset" xsi:type="string">default</data> + <data name="product/data/tier_price/dataset" xsi:type="string">default</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductForm" /> @@ -325,8 +325,8 @@ <data name="product/data/description" xsi:type="string">Simple Product description %isolation%</data> <data name="product/data/weight" xsi:type="string">67</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">144</data> - <data name="product/data/custom_options/preset" xsi:type="string">options-suite</data> - <data name="product/data/checkout_data/preset" xsi:type="string">options-suite</data> + <data name="product/data/custom_options/dataset" xsi:type="string">options_suite</data> + <data name="product/data/checkout_data/dataset" xsi:type="string">simple_options_suite</data> <data name="product/data/custom_options/import_products" xsi:type="string">catalogProductSimple::with_two_custom_option,catalogProductSimple::with_all_custom_option</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> @@ -337,7 +337,7 @@ <constraint name="Magento\Catalog\Test\Constraint\AssertProductCustomOptionsOnProductPage" /> </variation> <variation name="CreateSimpleProductEntityTestVariation19"> - <data name="description" xsi:type="string">Create product with cross-sell products</data> + <data name="description" xsi:type="string">MAGETWO-29081: Create product with cross-sell products</data> <data name="product/data/url_key" xsi:type="string">simple-product-%isolation%</data> <data name="product/data/name" xsi:type="string">Simple Product %isolation%</data> <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> @@ -347,14 +347,14 @@ <data name="product/data/weight" xsi:type="string">59</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">75</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> - <data name="product/data/cross_sell_products/presets" xsi:type="string">catalogProductSimple::default, configurableProduct::default</data> + <data name="product/data/cross_sell_products/dataset" xsi:type="string">catalogProductSimple::default, configurableProduct::default</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductForm" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductCrossSells" /> </variation> <variation name="CreateSimpleProductEntityTestVariation20"> - <data name="description" xsi:type="string">Create product with up-sell products</data> + <data name="description" xsi:type="string">MAGETWO-29105: Create product with up-sell products</data> <data name="product/data/url_key" xsi:type="string">simple-product-%isolation%</data> <data name="product/data/name" xsi:type="string">Simple Product %isolation%</data> <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> @@ -364,14 +364,14 @@ <data name="product/data/weight" xsi:type="string">59</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">75</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> - <data name="product/data/up_sell_products/presets" xsi:type="string">catalogProductSimple::default, configurableProduct::default</data> + <data name="product/data/up_sell_products/dataset" xsi:type="string">catalogProductSimple::default, configurableProduct::default</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductForm" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductUpSells" /> </variation> <variation name="CreateSimpleProductEntityTestVariation21"> - <data name="description" xsi:type="string">Create product with related products</data> + <data name="description" xsi:type="string">MAGETWO-29352: Create product with related products</data> <data name="product/data/url_key" xsi:type="string">simple-product-%isolation%</data> <data name="product/data/name" xsi:type="string">Simple Product %isolation%</data> <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> @@ -381,7 +381,7 @@ <data name="product/data/weight" xsi:type="string">59</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">75</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> - <data name="product/data/related_products/presets" xsi:type="string">catalogProductSimple::default, configurableProduct::default</data> + <data name="product/data/related_products/dataset" xsi:type="string">catalogProductSimple::default, configurableProduct::default</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductForm" /> @@ -404,7 +404,7 @@ <variation name="CreateSimpleProductEntityTestVariation23"> <data name="description" xsi:type="string">MAGETWO-13345: Create Simple Product with Creating New Category (Required Fields Only)</data> <data name="product/data/category_ids/new_category" xsi:type="string">yes</data> - <data name="product/data/category_ids/presets" xsi:type="string">default_subcategory</data> + <data name="product/data/category_ids/dataset" xsi:type="string">default_subcategory</data> <data name="product/data/url_key" xsi:type="string">simple%isolation%</data> <data name="product/data/name" xsi:type="string">simple%isolation%</data> <data name="product/data/sku" xsi:type="string">simple%isolation%</data> @@ -418,7 +418,7 @@ <data name="product/data/url_key" xsi:type="string">simple-product-%isolation%</data> <data name="product/data/name" xsi:type="string">Simple Product %isolation%</data> <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> + <data name="product/data/tax_class_id/dataset" xsi:type="string">taxable_goods</data> <data name="product/data/price/value" xsi:type="string">10</data> <data name="product/data/weight" xsi:type="string">1</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">1000</data> @@ -433,12 +433,12 @@ <data name="product/data/url_key" xsi:type="string">simple-product-%isolation%</data> <data name="product/data/name" xsi:type="string">Simple Product %isolation%</data> <data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> + <data name="product/data/tax_class_id/dataset" xsi:type="string">taxable_goods</data> <data name="product/data/price/value" xsi:type="string">10</data> <data name="product/data/weight" xsi:type="string">1</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">1000</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> - <data name="product/data/custom_options/preset" xsi:type="string">drop_down_with_one_option_fixed_price</data> + <data name="product/data/custom_options/dataset" xsi:type="string">drop_down_with_one_option_fixed_price</data> <data name="tag" xsi:type="string">test_type:acceptance_test</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateVirtualProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateVirtualProductEntityTest.xml index 25aaa878701d8fac2096c44e351b65caee56d4da..f7123e36381259979655742a244afd3127f711bc 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateVirtualProductEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateVirtualProductEntityTest.xml @@ -13,18 +13,7 @@ <data name="product/data/name" xsi:type="string">VirtualProduct %isolation%</data> <data name="product/data/sku" xsi:type="string">virtual_sku_%isolation%</data> <data name="product/data/price/value" xsi:type="string">10</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">-</data> - <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">-</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> - <data name="product/data/category" xsi:type="string">-</data> - <data name="product/data/group_price/preset" xsi:type="string">-</data> - <data name="product/data/price/preset" xsi:type="string">-</data> - <data name="product/data/tier_price/preset" xsi:type="string">-</data> - <data name="product/data/inventory_manage_stock" xsi:type="string">-</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">-</data> - <data name="product/data/custom_options/preset" xsi:type="string">-</data> - <data name="product/data/custom_options/import_products" xsi:type="string">-</data> - <data name="product/data/visibility" xsi:type="string">-</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> </variation> @@ -34,17 +23,13 @@ <data name="product/data/name" xsi:type="string">VirtualProduct %isolation%</data> <data name="product/data/sku" xsi:type="string">virtual_sku_%isolation%</data> <data name="product/data/price/value" xsi:type="string">10</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">None</data> + <data name="product/data/tax_class_id/dataset" xsi:type="string">None</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">999</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> <data name="product/data/category" xsi:type="string">category_%isolation%</data> - <data name="product/data/group_price/preset" xsi:type="string">-</data> - <data name="product/data/price/preset" xsi:type="string">-</data> - <data name="product/data/tier_price/preset" xsi:type="string">MAGETWO-23002</data> + <data name="product/data/tier_price/dataset" xsi:type="string">MAGETWO-23002</data> <data name="product/data/inventory_manage_stock" xsi:type="string">Yes</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> - <data name="product/data/custom_options/preset" xsi:type="string">-</data> - <data name="product/data/custom_options/import_products" xsi:type="string">-</data> <data name="product/data/visibility" xsi:type="string">Catalog, Search</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductVisibleInCategory" /> @@ -55,19 +40,12 @@ <data name="description" xsi:type="string">Create product with out of stock</data> <data name="product/data/url_key" xsi:type="string">virtual-product-%isolation%</data> <data name="product/data/name" xsi:type="string">VirtualProduct %isolation%</data> - <data name="product/data/sku" xsi:type="string">-</data> <data name="product/data/price/value" xsi:type="string">10</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> + <data name="product/data/tax_class_id/dataset" xsi:type="string">taxable_goods</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">999</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> - <data name="product/data/category" xsi:type="string">-</data> - <data name="product/data/group_price/preset" xsi:type="string">-</data> - <data name="product/data/price/preset" xsi:type="string">MAGETWO-23030</data> - <data name="product/data/tier_price/preset" xsi:type="string">-</data> - <data name="product/data/inventory_manage_stock" xsi:type="string">-</data> + <data name="product/data/price/dataset" xsi:type="string">MAGETWO-23030</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">Out of Stock</data> - <data name="product/data/custom_options/preset" xsi:type="string">-</data> - <data name="product/data/custom_options/import_products" xsi:type="string">-</data> <data name="product/data/visibility" xsi:type="string">Search</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductForm" /> @@ -80,17 +58,9 @@ <data name="product/data/name" xsi:type="string">VirtualProduct %isolation%</data> <data name="product/data/sku" xsi:type="string">virtual_sku_%isolation%</data> <data name="product/data/price/value" xsi:type="string">10</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">-</data> - <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">-</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> <data name="product/data/category" xsi:type="string">category_%isolation%</data> - <data name="product/data/group_price/preset" xsi:type="string">MAGETWO-23055</data> - <data name="product/data/price/preset" xsi:type="string">-</data> - <data name="product/data/tier_price/preset" xsi:type="string">-</data> - <data name="product/data/inventory_manage_stock" xsi:type="string">-</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">-</data> - <data name="product/data/custom_options/preset" xsi:type="string">-</data> - <data name="product/data/custom_options/import_products" xsi:type="string">-</data> + <data name="product/data/group_price/dataset" xsi:type="string">not_logged_in_90</data> <data name="product/data/visibility" xsi:type="string">Catalog</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductForm" /> @@ -102,18 +72,10 @@ <data name="product/data/name" xsi:type="string">VirtualProduct %isolation%</data> <data name="product/data/sku" xsi:type="string">virtual_sku_%isolation%</data> <data name="product/data/price/value" xsi:type="string">9000</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">-</data> - <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">-</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> - <data name="product/data/category" xsi:type="string">-</data> - <data name="product/data/group_price/preset" xsi:type="string">MAGETWO-23055</data> - <data name="product/data/price/preset" xsi:type="string">-</data> - <data name="product/data/tier_price/preset" xsi:type="string">-</data> - <data name="product/data/inventory_manage_stock" xsi:type="string">-</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">-</data> - <data name="product/data/custom_options/preset" xsi:type="string">options-suite</data> + <data name="product/data/group_price/dataset" xsi:type="string">not_logged_in_90</data> + <data name="product/data/custom_options/dataset" xsi:type="string">options_suite</data> <data name="product/data/custom_options/import_products" xsi:type="string">catalogProductSimple::with_two_custom_option,catalogProductSimple::with_all_custom_option</data> - <data name="product/data/visibility" xsi:type="string">-</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSearchableBySku" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> @@ -126,18 +88,11 @@ <data name="product/data/name" xsi:type="string">VirtualProduct %isolation%</data> <data name="product/data/sku" xsi:type="string">virtual_sku_%isolation%</data> <data name="product/data/price/value" xsi:type="string">10</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">-</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">999</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> - <data name="product/data/category" xsi:type="string">-</data> - <data name="product/data/group_price/preset" xsi:type="string">-</data> - <data name="product/data/price/preset" xsi:type="string">MAGETWO-23030</data> - <data name="product/data/tier_price/preset" xsi:type="string">-</data> + <data name="product/data/price/dataset" xsi:type="string">MAGETWO-23030</data> <data name="product/data/inventory_manage_stock" xsi:type="string">No</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> - <data name="product/data/custom_options/preset" xsi:type="string">-</data> - <data name="product/data/custom_options/import_products" xsi:type="string">-</data> - <data name="product/data/visibility" xsi:type="string">-</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSpecialPriceOnProductPage" /> @@ -149,18 +104,10 @@ <data name="product/data/name" xsi:type="string">VirtualProduct %isolation%</data> <data name="product/data/sku" xsi:type="string">virtual_sku_%isolation%</data> <data name="product/data/price/value" xsi:type="string">9000</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">-</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">999</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> - <data name="product/data/category" xsi:type="string">-</data> - <data name="product/data/group_price/preset" xsi:type="string">-</data> - <data name="product/data/price/preset" xsi:type="string">-</data> - <data name="product/data/tier_price/preset" xsi:type="string">default</data> - <data name="product/data/inventory_manage_stock" xsi:type="string">-</data> + <data name="product/data/tier_price/dataset" xsi:type="string">default</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">Out of Stock</data> - <data name="product/data/custom_options/preset" xsi:type="string">-</data> - <data name="product/data/custom_options/import_products" xsi:type="string">-</data> - <data name="product/data/visibility" xsi:type="string">-</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductTierPriceOnProductPage" /> @@ -172,18 +119,8 @@ <data name="product/data/name" xsi:type="string">VirtualProduct %isolation%</data> <data name="product/data/sku" xsi:type="string">virtual_sku_%isolation%</data> <data name="product/data/price/value" xsi:type="string">10</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">-</data> - <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">-</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> <data name="product/data/category" xsi:type="string">category_%isolation%</data> - <data name="product/data/group_price/preset" xsi:type="string">-</data> - <data name="product/data/price/preset" xsi:type="string">-</data> - <data name="product/data/tier_price/preset" xsi:type="string">-</data> - <data name="product/data/inventory_manage_stock" xsi:type="string">-</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">-</data> - <data name="product/data/custom_options/preset" xsi:type="string">-</data> - <data name="product/data/custom_options/import_products" xsi:type="string">-</data> - <data name="product/data/visibility" xsi:type="string">-</data> <data name="tag" xsi:type="string">test_type:acceptance_test</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/DuplicateProductEntityTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/DuplicateProductEntityTest.php index d9e73e456e61868ca16699ab0d4f2d15de01c324..bfa4e2cc5e2ab1e5129222bbc395fa3a259c9757 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/DuplicateProductEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/DuplicateProductEntityTest.php @@ -111,11 +111,11 @@ class DuplicateProductEntityTest extends Injectable */ protected function createProduct($productType) { - list($fixture, $dataSet) = explode('::', $productType); + list($fixture, $dataset) = explode('::', $productType); $product = $this->fixtureFactory->createByCode( $fixture, [ - 'dataSet' => $dataSet, + 'dataset' => $dataset, 'data' => [ 'category_ids' => [ 'category' => $this->category, diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/MassProductUpdateTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/MassProductUpdateTest.xml index b00facf21e2b5f084b0be4c6e005d81820e7e26c..f51dde987341e9e25302383ccd826ba669b51070 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/MassProductUpdateTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/MassProductUpdateTest.xml @@ -9,7 +9,7 @@ <testCase name="Magento\Catalog\Test\TestCase\Product\MassProductUpdateTest"> <variation name="MassProductPriceUpdateTestVariation1"> <data name="configData" xsi:type="string">product_flat</data> - <data name="initialProduct/dataSet" xsi:type="string">simple_10_dollar</data> + <data name="initialProduct/dataset" xsi:type="string">simple_10_dollar</data> <data name="product/data/price/value" xsi:type="string">1.99</data> <constraint name="Magento\Catalog\Test\Constraint\AssertMassProductUpdateSuccessMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateUpSellProductsTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateUpSellProductsTest.php index 57d87b3147d82451f71b8324a310cae4db658327..c3ed264e72fc9645bc38e5d629606e1d41732c42 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateUpSellProductsTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateUpSellProductsTest.php @@ -9,8 +9,6 @@ namespace Magento\Catalog\Test\TestCase\Product; use Magento\Mtf\Fixture\InjectableFixture; /** - * Test Flow: - * * Preconditions: * 1. Create products. * 2. Assign promoted products. diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnCreationTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnCreationTest.php index 1cdff9dbf0ed156e55ea0d5bbc657f7628f7e02d..051bbfc08d499f0858ba21d0e465f0b19de1f060 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnCreationTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnCreationTest.php @@ -17,8 +17,8 @@ use Magento\Mtf\TestCase\Injectable; * Test Flow: * 1. Open backend * 2. Go to Products > Catalog - * 3. Start create product from preconditions (according dataSet) - * 4. Fill data from dataSet + * 3. Start create product from preconditions (according dataset) + * 4. Fill data from dataset * 5. Save * 6. Perform all assertions * @@ -83,8 +83,8 @@ class ProductTypeSwitchingOnCreationTest extends Injectable // Steps $this->catalogProductIndex->open(); $this->catalogProductIndex->getGridPageActionBlock()->addProduct($createProduct); - list($fixture, $dataSet) = explode('::', $product); - $product = $this->fixtureFactory->createByCode($fixture, ['dataSet' => $dataSet]); + list($fixture, $dataset) = explode('::', $product); + $product = $this->fixtureFactory->createByCode($fixture, ['dataset' => $dataset]); $this->catalogProductNew->getProductForm()->fill($product); $this->catalogProductNew->getFormPageActions()->save($product); diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnUpdateTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnUpdateTest.php index d856f2bdd684ae4ebebf4ca2f8ce592a27e80173..4904d72775c5c24024c6ee99d5b6d9064e57f019 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnUpdateTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnUpdateTest.php @@ -19,14 +19,14 @@ use Magento\Mtf\TestCase\Injectable; * Test Flow: * * Preconditions: - * 1. Create product according to dataSet + * 1. Create product according to dataset * * Steps: * 1. Open backend * 2. Go to Products > Catalog * 3. Open created product in preconditions - * 4. Perform Actions from dataSet - * 5. Fill data from dataSet + * 4. Perform Actions from dataset + * 5. Fill data from dataset * 6. Save * 7. Perform all assertions * @@ -90,11 +90,11 @@ class ProductTypeSwitchingOnUpdateTest extends Injectable public function test($productOrigin, $product, $actionName) { // Preconditions - list($fixtureClass, $dataSet) = explode('::', $productOrigin); - $productOrigin = $this->fixtureFactory->createByCode(trim($fixtureClass), ['dataSet' => trim($dataSet)]); + list($fixtureClass, $dataset) = explode('::', $productOrigin); + $productOrigin = $this->fixtureFactory->createByCode(trim($fixtureClass), ['dataset' => trim($dataset)]); $productOrigin->persist(); - list($fixtureClass, $dataSet) = explode('::', $product); - $product = $this->fixtureFactory->createByCode(trim($fixtureClass), ['dataSet' => trim($dataSet)]); + list($fixtureClass, $dataset) = explode('::', $product); + $product = $this->fixtureFactory->createByCode(trim($fixtureClass), ['dataset' => trim($dataset)]); // Steps $this->catalogProductIndex->open(); diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.xml index 4dde51eae09a370f540fa8e3b2e9970d40c19dc6..e9f21fa39a028a1a4cd7a67fa47b3f2aed9cd34b 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.xml @@ -9,7 +9,7 @@ <testCase name="Magento\Catalog\Test\TestCase\Product\UpdateSimpleProductEntityTest"> <variation name="UpdateSimpleProductEntityTestVariation1"> <data name="description" xsi:type="string">Update visibility to Catalog, Search</data> - <data name="initialProduct/dataSet" xsi:type="string">product_with_category</data> + <data name="initialProduct/dataset" xsi:type="string">product_with_category</data> <data name="product/data/name" xsi:type="string">Test simple product %isolation%</data> <data name="product/data/sku" xsi:type="string">test_simple_product_%isolation%</data> <data name="product/data/price/value" xsi:type="string">245.00</data> @@ -25,7 +25,7 @@ </variation> <variation name="UpdateSimpleProductEntityTestVariation2"> <data name="description" xsi:type="string">Update visibility to Not Visible Individually</data> - <data name="initialProduct/dataSet" xsi:type="string">product_with_category</data> + <data name="initialProduct/dataset" xsi:type="string">product_with_category</data> <data name="product/data/name" xsi:type="string">Test simple product %isolation%</data> <data name="product/data/sku" xsi:type="string">test_simple_product_%isolation%</data> <data name="product/data/price/value" xsi:type="string">325.00</data> @@ -39,7 +39,7 @@ </variation> <variation name="UpdateSimpleProductEntityTestVariation3"> <data name="description" xsi:type="string">Update visibility to Catalog</data> - <data name="initialProduct/dataSet" xsi:type="string">product_with_category</data> + <data name="initialProduct/dataset" xsi:type="string">product_with_category</data> <data name="product/data/name" xsi:type="string">Test simple product %isolation%</data> <data name="product/data/sku" xsi:type="string">test_simple_product_%isolation%</data> <data name="product/data/price/value" xsi:type="string">325.01</data> @@ -56,7 +56,7 @@ </variation> <variation name="UpdateSimpleProductEntityTestVariation4"> <data name="description" xsi:type="string">Update visibility to Search</data> - <data name="initialProduct/dataSet" xsi:type="string">product_with_category</data> + <data name="initialProduct/dataset" xsi:type="string">product_with_category</data> <data name="product/data/name" xsi:type="string">Test simple product %isolation%</data> <data name="product/data/sku" xsi:type="string">test_simple_product_%isolation%</data> <data name="product/data/price/value" xsi:type="string">325.02</data> @@ -73,7 +73,7 @@ </variation> <variation name="UpdateSimpleProductEntityTestVariation5"> <data name="description" xsi:type="string">Update stock to Out of Stock</data> - <data name="initialProduct/dataSet" xsi:type="string">product_with_category</data> + <data name="initialProduct/dataset" xsi:type="string">product_with_category</data> <data name="product/data/name" xsi:type="string">Test simple product %isolation%</data> <data name="product/data/sku" xsi:type="string">test_simple_product_%isolation%</data> <data name="product/data/price/value" xsi:type="string">325.03</data> @@ -90,7 +90,7 @@ </variation> <variation name="UpdateSimpleProductEntityTestVariation6"> <data name="description" xsi:type="string">Update product status to offline</data> - <data name="initialProduct/dataSet" xsi:type="string">product_with_category</data> + <data name="initialProduct/dataset" xsi:type="string">product_with_category</data> <data name="product/data/name" xsi:type="string">Test simple product %isolation%</data> <data name="product/data/sku" xsi:type="string">test_simple_product_%isolation%</data> <data name="product/data/price/value" xsi:type="string">74.00</data> @@ -104,8 +104,8 @@ </variation> <variation name="UpdateSimpleProductEntityTestVariation7"> <data name="description" xsi:type="string">Update category</data> - <data name="initialProduct/dataSet" xsi:type="string">product_with_category</data> - <data name="product/data/category_ids/presets" xsi:type="string">default</data> + <data name="initialProduct/dataset" xsi:type="string">product_with_category</data> + <data name="product/data/category_ids/dataset" xsi:type="string">default</data> <data name="product/data/name" xsi:type="string">Test simple product %isolation%</data> <data name="product/data/sku" xsi:type="string">test_simple_product_%isolation%</data> <data name="product/data/price/value" xsi:type="string">74.00</data> @@ -119,8 +119,8 @@ </variation> <variation name="UpdateSimpleProductEntityTestVariation8"> <data name="description" xsi:type="string">MAGETWO-12428: Edit Simple Product</data> - <data name="initialProduct/dataSet" xsi:type="string">product_with_category</data> - <data name="product/data/category_ids/presets" xsi:type="string">default</data> + <data name="initialProduct/dataset" xsi:type="string">product_with_category</data> + <data name="product/data/category_ids/dataset" xsi:type="string">default</data> <data name="product/data/name" xsi:type="string">Test simple product %isolation%</data> <data name="product/data/sku" xsi:type="string">test_simple_product_%isolation%</data> <data name="product/data/price/value" xsi:type="string">133.00</data> @@ -130,8 +130,8 @@ </variation> <variation name="UpdateSimpleProductEntityTestVariation9"> <data name="description" xsi:type="string">MAGETWO-12417: Unassign Products from the Category</data> - <data name="initialProduct/dataSet" xsi:type="string">product_with_category</data> - <data name="product/data/category_ids/presets" xsi:type="string"> -</data> + <data name="initialProduct/dataset" xsi:type="string">product_with_category</data> + <data name="product/data/category_ids/dataset" xsi:type="string"> -</data> <data name="tag" xsi:type="string">test_type:acceptance_test</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductNotVisibleInCategory" /> @@ -139,12 +139,11 @@ <variation name="EditSimpleProductTestVariation10"> <data name="description" xsi:type="string">Edit product with enabled flat</data> <data name="configData" xsi:type="string">product_flat</data> - <data name="initialProduct/dataSet" xsi:type="string">simple_10_dollar</data> + <data name="initialProduct/dataset" xsi:type="string">simple_10_dollar</data> <data name="product/data/name" xsi:type="string">Simple Product %isolation%</data> <data name="product/data/sku" xsi:type="string">sku_simple_product_%isolation%</data> <data name="product/data/price/value" xsi:type="string">1.99</data> - <data name="product/data/price/preset" xsi:type="string">-</data> - <data name="product/data/attribute_set_id/dataSet" xsi:type="string">default</data> + <data name="product/data/attribute_set_id/dataset" xsi:type="string">default</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory" /> </variation> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateVirtualProductEntityTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateVirtualProductEntityTest.php index 0868765d7b590ed722dcbf6cb943b594df8ce68a..e45992c85e609d4bc8884044c1e14c722574755a 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateVirtualProductEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateVirtualProductEntityTest.php @@ -93,7 +93,7 @@ class UpdateVirtualProductEntityTest extends Injectable $this->product = $fixtureFactory->createByCode( 'catalogProductVirtual', [ - 'dataSet' => 'default', + 'dataset' => 'default', 'data' => [ 'category_ids' => [ 'category' => $category, diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateVirtualProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateVirtualProductEntityTest.xml index d6607d67fd40b773f4af4c01f0f6dad154b31237..8ea588e36a329758056605096150586c42fa708d 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateVirtualProductEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateVirtualProductEntityTest.xml @@ -11,11 +11,11 @@ <data name="product/data/name" xsi:type="string">VirtualProduct %isolation%</data> <data name="product/data/sku" xsi:type="string">virtual_sku_%isolation%</data> <data name="product/data/price/value" xsi:type="string">99.99</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">None</data> + <data name="product/data/tax_class_id/dataset" xsi:type="string">None</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">999</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> - <data name="product/data/category_ids/presets" xsi:type="string">default_subcategory</data> - <data name="product/data/tier_price/preset" xsi:type="string">MAGETWO-23002</data> + <data name="product/data/category_ids/dataset" xsi:type="string">default_subcategory</data> + <data name="product/data/tier_price/dataset" xsi:type="string">MAGETWO-23002</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> <data name="product/data/visibility" xsi:type="string">Catalog</data> <data name="product/data/url_key" xsi:type="string">virtual-product-%isolation%</data> @@ -32,7 +32,7 @@ <data name="product/data/name" xsi:type="string">virtual_product_%isolation%</data> <data name="product/data/sku" xsi:type="string">virtual_sku_%isolation%</data> <data name="product/data/price/value" xsi:type="string">120.00</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> + <data name="product/data/tax_class_id/dataset" xsi:type="string">taxable_goods</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">999</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> <data name="product/data/special_price" xsi:type="string">45</data> @@ -52,11 +52,11 @@ <data name="product/data/name" xsi:type="string">VirtualProduct %isolation%</data> <data name="product/data/sku" xsi:type="string">virtual_sku_%isolation%</data> <data name="product/data/price/value" xsi:type="string">185.00</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">None</data> + <data name="product/data/tax_class_id/dataset" xsi:type="string">None</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">999</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> - <data name="product/data/category_ids/presets" xsi:type="string">default_subcategory</data> - <data name="product/data/tier_price/preset" xsi:type="string">MAGETWO-23002</data> + <data name="product/data/category_ids/dataset" xsi:type="string">default_subcategory</data> + <data name="product/data/tier_price/dataset" xsi:type="string">MAGETWO-23002</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">Out of Stock</data> <data name="product/data/visibility" xsi:type="string">Catalog, Search</data> <data name="product/data/url_key" xsi:type="string">virtual-product-%isolation%</data> @@ -73,7 +73,7 @@ <data name="product/data/name" xsi:type="string">virtual_product_%isolation%</data> <data name="product/data/sku" xsi:type="string">virtual_sku_%isolation%</data> <data name="product/data/price/value" xsi:type="string">99.99</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> + <data name="product/data/tax_class_id/dataset" xsi:type="string">taxable_goods</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">Out of Stock</data> <data name="product/data/visibility" xsi:type="string">Search</data> @@ -89,7 +89,7 @@ <data name="product/data/name" xsi:type="string">VirtualProduct %isolation%</data> <data name="product/data/sku" xsi:type="string">virtual_sku_%isolation%</data> <data name="product/data/price/value" xsi:type="string">5.00</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">None</data> + <data name="product/data/tax_class_id/dataset" xsi:type="string">None</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">Out of Stock</data> <data name="product/data/visibility" xsi:type="string">Catalog</data> @@ -105,12 +105,12 @@ <data name="product/data/name" xsi:type="string">virtual_product_%isolation%</data> <data name="product/data/sku" xsi:type="string">virtual_sku_%isolation%</data> <data name="product/data/price/value" xsi:type="string">145.00</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> + <data name="product/data/tax_class_id/dataset" xsi:type="string">taxable_goods</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">999</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> - <data name="product/data/category_ids/presets" xsi:type="string">default_subcategory</data> - <data name="product/data/group_price/preset" xsi:type="string">MAGETWO-23055</data> - <data name="product/data/tier_price/preset" xsi:type="string">MAGETWO-23002</data> + <data name="product/data/category_ids/dataset" xsi:type="string">default_subcategory</data> + <data name="product/data/group_price/dataset" xsi:type="string">not_logged_in_90</data> + <data name="product/data/tier_price/dataset" xsi:type="string">MAGETWO-23002</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> <data name="product/data/visibility" xsi:type="string">Catalog, Search</data> <data name="product/data/url_key" xsi:type="string">virtual-product-%isolation%</data> @@ -127,9 +127,9 @@ <data name="product/data/name" xsi:type="string">VirtualProduct %isolation%</data> <data name="product/data/sku" xsi:type="string">virtual_sku_%isolation%</data> <data name="product/data/price/value" xsi:type="string">99.99</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">None</data> + <data name="product/data/tax_class_id/dataset" xsi:type="string">None</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> - <data name="product/data/category_ids/presets" xsi:type="string">default_subcategory</data> + <data name="product/data/category_ids/dataset" xsi:type="string">default_subcategory</data> <data name="product/data/special_price" xsi:type="string">45</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">Out of Stock</data> <data name="product/data/visibility" xsi:type="string">Catalog, Search</data> @@ -145,9 +145,9 @@ <data name="product/data/name" xsi:type="string">virtual_product_%isolation%</data> <data name="product/data/sku" xsi:type="string">virtual_sku_%isolation%</data> <data name="product/data/price/value" xsi:type="string">5.00</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> + <data name="product/data/tax_class_id/dataset" xsi:type="string">taxable_goods</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> - <data name="product/data/group_price/preset" xsi:type="string">MAGETWO-23055</data> + <data name="product/data/group_price/dataset" xsi:type="string">not_logged_in_90</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">Out of Stock</data> <data name="product/data/visibility" xsi:type="string">Search</data> <data name="product/data/url_key" xsi:type="string">virtual-product-%isolation%</data> @@ -162,12 +162,12 @@ <data name="product/data/name" xsi:type="string">VirtualProduct %isolation%</data> <data name="product/data/sku" xsi:type="string">virtual_sku_%isolation%</data> <data name="product/data/price/value" xsi:type="string">120.00</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">None</data> + <data name="product/data/tax_class_id/dataset" xsi:type="string">None</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">999</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> - <data name="product/data/category_ids/presets" xsi:type="string">default_subcategory</data> + <data name="product/data/category_ids/dataset" xsi:type="string">default_subcategory</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> - <data name="product/data/custom_options/preset" xsi:type="string">options-suite</data> + <data name="product/data/custom_options/dataset" xsi:type="string">options_suite</data> <data name="product/data/visibility" xsi:type="string">Search</data> <data name="product/data/url_key" xsi:type="string">virtual-product-%isolation%</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> @@ -182,9 +182,9 @@ <data name="product/data/name" xsi:type="string">VirtualProduct %isolation%</data> <data name="product/data/sku" xsi:type="string">virtual_sku_%isolation%</data> <data name="product/data/price/value" xsi:type="string">99.99</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> + <data name="product/data/tax_class_id/dataset" xsi:type="string">taxable_goods</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> - <data name="product/data/group_price/preset" xsi:type="string">MAGETWO-23055</data> + <data name="product/data/group_price/dataset" xsi:type="string">not_logged_in_90</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">Out of Stock</data> <data name="product/data/visibility" xsi:type="string">Catalog, Search</data> <data name="product/data/url_key" xsi:type="string">virtual-product-%isolation%</data> @@ -199,12 +199,12 @@ <data name="product/data/name" xsi:type="string">VirtualProduct %isolation%</data> <data name="product/data/sku" xsi:type="string">virtual_sku_%isolation%</data> <data name="product/data/price/value" xsi:type="string">99.99</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">None</data> + <data name="product/data/tax_class_id/dataset" xsi:type="string">None</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">999</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> - <data name="product/data/category_ids/presets" xsi:type="string">default_subcategory</data> - <data name="product/data/group_price/preset" xsi:type="string">MAGETWO-23055</data> - <data name="product/data/tier_price/preset" xsi:type="string">MAGETWO-23002</data> + <data name="product/data/category_ids/dataset" xsi:type="string">default_subcategory</data> + <data name="product/data/group_price/dataset" xsi:type="string">not_logged_in_90</data> + <data name="product/data/tier_price/dataset" xsi:type="string">MAGETWO-23002</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> <data name="product/data/visibility" xsi:type="string">Catalog</data> <data name="product/data/url_key" xsi:type="string">virtual-product-%isolation%</data> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateAttributeSetEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateAttributeSetEntityTest.xml index 320e99b58a4df53b9a155bad31d53748404b84d5..9b091cb1c393db6fccd08889e7aeba8efb5c5ae1 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateAttributeSetEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateAttributeSetEntityTest.xml @@ -9,7 +9,7 @@ <testCase name="Magento\Catalog\Test\TestCase\ProductAttribute\CreateAttributeSetEntityTest"> <variation name="CreateAttributeSetEntityTestVariation1"> <data name="attributeSet/data/attribute_set_name" xsi:type="string">ProductTemplate%isolation%</data> - <data name="attributeSet/data/skeleton_set/dataSet" xsi:type="string">default</data> + <data name="attributeSet/data/skeleton_set/dataset" xsi:type="string">default</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateSuccessSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateForm" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateInGrid" /> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityFromProductPageTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityFromProductPageTest.php index 396d177f80c0fdec006ff9e52afe5dd3b57f3b8f..d52ffac221086437339441ff924d4fbf8a114999 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityFromProductPageTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityFromProductPageTest.php @@ -44,7 +44,7 @@ class CreateProductAttributeEntityFromProductPageTest extends Scenario { $product = $fixtureFactory->createByCode( 'catalogProductSimple', - ['dataSet' => 'product_with_category_with_anchor'] + ['dataset' => 'product_with_category_with_anchor'] ); $product->persist(); return ['product' => $product]; diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityFromProductPageTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityFromProductPageTest.xml index 0236f7716289ef6a0ca0ec1fec079770c68f1462..3f454e6d213b00d73c92779c4641cd76b622e5f4 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityFromProductPageTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityFromProductPageTest.xml @@ -35,7 +35,7 @@ <variation name="CreateProductAttributeEntityFromProductPageTestVariation2"> <data name="attribute/data/frontend_label" xsi:type="string">Dropdown_Admin_%isolation%</data> <data name="attribute/data/frontend_input" xsi:type="string">Dropdown</data> - <data name="attribute/data/options/preset" xsi:type="string">two_options</data> + <data name="attribute/data/options/dataset" xsi:type="string">two_options</data> <data name="attribute/data/is_required" xsi:type="string">No</data> <data name="attribute/data/attribute_code" xsi:type="string">attr_dropdown_%isolation%</data> <data name="attribute/data/is_global" xsi:type="string">Global</data> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest.xml index cd482fba45140d4a24631d09b5add85bf5144294..00014f1017d6914d528b658e11214ccbe3de3092 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Catalog\Test\TestCase\ProductAttribute\CreateProductAttributeEntityTest"> <variation name="CreateProductAttributeEntityTestVariation1"> - <data name="productTemplate/dataSet" xsi:type="string">custom_attribute_set</data> + <data name="productTemplate/dataset" xsi:type="string">custom_attribute_set</data> <data name="productAttribute/data/frontend_label" xsi:type="string">Text_Field_Admin_%isolation%</data> <data name="productAttribute/data/frontend_input" xsi:type="string">Text Field</data> <data name="productAttribute/data/is_required" xsi:type="string">No</data> @@ -19,7 +19,7 @@ <constraint name="Magento\Catalog\Test\Constraint\AssertAddedProductAttributeOnProductForm" /> </variation> <variation name="CreateProductAttributeEntityTestVariation2"> - <data name="productTemplate/dataSet" xsi:type="string">custom_attribute_set</data> + <data name="productTemplate/dataset" xsi:type="string">custom_attribute_set</data> <data name="productAttribute/data/frontend_label" xsi:type="string">Text_Field_Admin_%isolation%</data> <data name="productAttribute/data/frontend_input" xsi:type="string">Text Area</data> <data name="productAttribute/data/is_required" xsi:type="string">Yes</data> @@ -41,7 +41,7 @@ <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeIsComparable" /> </variation> <variation name="CreateProductAttributeEntityTestVariation3"> - <data name="productTemplate/dataSet" xsi:type="string">custom_attribute_set</data> + <data name="productTemplate/dataset" xsi:type="string">custom_attribute_set</data> <data name="productAttribute/data/frontend_label" xsi:type="string">Date_Admin_%isolation%</data> <data name="productAttribute/data/frontend_input" xsi:type="string">Date</data> <data name="productAttribute/data/is_required" xsi:type="string">No</data> @@ -62,7 +62,7 @@ <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeIsUsedPromoRules" /> </variation> <variation name="CreateProductAttributeEntityTestVariation4"> - <data name="productTemplate/dataSet" xsi:type="string">custom_attribute_set</data> + <data name="productTemplate/dataset" xsi:type="string">custom_attribute_set</data> <data name="productAttribute/data/frontend_label" xsi:type="string">Yes/No_Admin_%isolation%</data> <data name="productAttribute/data/frontend_input" xsi:type="string">Yes/No</data> <data name="productAttribute/data/is_required" xsi:type="string">Yes</data> @@ -75,10 +75,10 @@ <constraint name="Magento\Catalog\Test\Constraint\AssertAddedProductAttributeOnProductForm" /> </variation> <variation name="CreateProductAttributeEntityTestVariation5"> - <data name="productTemplate/dataSet" xsi:type="string">custom_attribute_set</data> + <data name="productTemplate/dataset" xsi:type="string">custom_attribute_set</data> <data name="productAttribute/data/frontend_label" xsi:type="string">Multiple_Select_Admin_%isolation%</data> <data name="productAttribute/data/frontend_input" xsi:type="string">Multiple Select</data> - <data name="productAttribute/data/options/preset" xsi:type="string">default</data> + <data name="productAttribute/data/options/dataset" xsi:type="string">default</data> <data name="productAttribute/data/is_required" xsi:type="string">No</data> <data name="productAttribute/data/attribute_code" xsi:type="string">attr_multiselect_%isolation%</data> <data name="productAttribute/data/is_global" xsi:type="string">Website</data> @@ -103,10 +103,10 @@ <constraint name="Magento\Catalog\Test\Constraint\AssertAttributeOptionsOnProductForm" /> </variation> <variation name="CreateProductAttributeEntityTestVariation6"> - <data name="productTemplate/dataSet" xsi:type="string">custom_attribute_set</data> + <data name="productTemplate/dataset" xsi:type="string">custom_attribute_set</data> <data name="productAttribute/data/frontend_label" xsi:type="string">Dropdown_Admin_%isolation%</data> <data name="productAttribute/data/frontend_input" xsi:type="string">Dropdown</data> - <data name="productAttribute/data/options/preset" xsi:type="string">default</data> + <data name="productAttribute/data/options/dataset" xsi:type="string">default</data> <data name="productAttribute/data/is_required" xsi:type="string">Yes</data> <data name="productAttribute/data/attribute_code" xsi:type="string">attr_dropdown_%isolation%</data> <data name="productAttribute/data/is_global" xsi:type="string">Global</data> @@ -136,7 +136,7 @@ <constraint name="Magento\Catalog\Test\Constraint\AssertAttributeOptionsOnProductForm" /> </variation> <variation name="CreateProductAttributeEntityTestVariation7"> - <data name="productTemplate/dataSet" xsi:type="string">custom_attribute_set</data> + <data name="productTemplate/dataset" xsi:type="string">custom_attribute_set</data> <data name="productAttribute/data/frontend_label" xsi:type="string">Price_Admin_%isolation%</data> <data name="productAttribute/data/frontend_input" xsi:type="string">Price</data> <data name="productAttribute/data/is_required" xsi:type="string">No</data> @@ -158,7 +158,7 @@ <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeIsFilterableInSearch" /> </variation> <variation name="CreateProductAttributeEntityTestVariation8"> - <data name="productTemplate/dataSet" xsi:type="string">custom_attribute_set</data> + <data name="productTemplate/dataset" xsi:type="string">custom_attribute_set</data> <data name="productAttribute/data/frontend_label" xsi:type="string">Fixed_Product_Tax_Admin_%isolation%</data> <data name="productAttribute/data/frontend_input" xsi:type="string">Fixed Product Tax</data> <data name="productAttribute/data/attribute_code" xsi:type="string">attr_fpt_code_%isolation%</data> @@ -168,7 +168,7 @@ <constraint name="Magento\Catalog\Test\Constraint\AssertAddedProductAttributeOnProductForm" /> </variation> <variation name="CreateProductAttributeEntityTestVariation9"> - <data name="productTemplate/dataSet" xsi:type="string">custom_attribute_set</data> + <data name="productTemplate/dataset" xsi:type="string">custom_attribute_set</data> <data name="productAttribute/data/frontend_label" xsi:type="string">Text_Field_Admin_%isolation%</data> <data name="productAttribute/data/frontend_input" xsi:type="string">Text Field</data> <data name="productAttribute/data/is_required" xsi:type="string">Yes</data> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteAssignedToTemplateProductAttributeTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteAssignedToTemplateProductAttributeTest.xml index 72778bf65334cdd41b1f1b78ee49c57bd520cf10..fefb8ecd118c149d518a477c16ad664ec796a2ff 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteAssignedToTemplateProductAttributeTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteAssignedToTemplateProductAttributeTest.xml @@ -8,16 +8,16 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Catalog\Test\TestCase\ProductAttribute\DeleteAssignedToTemplateProductAttributeTest"> <variation name="DeleteAssignedToTemplateProductAttributeTestVariation1"> - <data name="productTemplate/dataSet" xsi:type="string">custom_attribute_set</data> - <data name="productTemplate/data/assigned_attributes/presets" xsi:type="string">attribute_type_dropdown</data> + <data name="productTemplate/dataset" xsi:type="string">custom_attribute_set</data> + <data name="productTemplate/data/assigned_attributes/dataset" xsi:type="string">attribute_type_dropdown</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeSuccessDeleteMessage"/> <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeAbsenceInGrid"/> <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeAbsenceInTemplateGroups"/> <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeAbsenceInUnassignedAttributes"/> </variation> <variation name="DeleteAssignedToTemplateProductAttributeTestVariation2"> - <data name="productTemplate/dataSet" xsi:type="string">default</data> - <data name="productTemplate/data/assigned_attributes/presets" xsi:type="string">attribute_type_text_field</data> + <data name="productTemplate/dataset" xsi:type="string">default</data> + <data name="productTemplate/data/assigned_attributes/dataset" xsi:type="string">attribute_type_text_field</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeSuccessDeleteMessage"/> <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeAbsenceInGrid"/> <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertProductAttributeAbsenceInVariationsSearch"/> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteAttributeSetTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteAttributeSetTest.php index 0ecf8bb12952db8e64a09cabfb7d64761bc3f752..4eb5df71d91d4c48024acec44d3ff42623edb512 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteAttributeSetTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteAttributeSetTest.php @@ -80,7 +80,7 @@ class DeleteAttributeSetTest extends Injectable $product = $fixtureFactory->createByCode( 'catalogProductSimple', [ - 'dataSet' => 'default', + 'dataset' => 'default', 'data' => [ 'attribute_set_id' => ['attribute_set' => $productTemplate], ], diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteAttributeSetTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteAttributeSetTest.xml index 9d56a856c52f4dddd7e3773481862661c6558d66..ede699f625cb9638c4bc717ed17b2d5f087035ae 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteAttributeSetTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteAttributeSetTest.xml @@ -8,9 +8,9 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Catalog\Test\TestCase\ProductAttribute\DeleteAttributeSetTest"> <variation name="DeleteAttributeSetTestVariation1"> - <data name="productTemplate/dataSet" xsi:type="string">custom_attribute_set</data> - <data name="productTemplate/data/assigned_attributes/presets" xsi:type="string">default</data> - <data name="product/dataSet" xsi:type="string">default</data> + <data name="productTemplate/dataset" xsi:type="string">custom_attribute_set</data> + <data name="productTemplate/data/assigned_attributes/dataset" xsi:type="string">default</data> + <data name="product/dataset" xsi:type="string">default</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateSuccessDeleteMessage"/> <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateNotInGrid"/> <constraint name="Magento\Catalog\Test\Constraint\AssertProductNotInGrid"/> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteProductAttributeEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteProductAttributeEntityTest.xml index fcd45cbf6b0fa3248290f18f3e2fbe1e369c0427..a2fca7dd7787a3dfb2a1bffa6899b2233e28ca7c 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteProductAttributeEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteProductAttributeEntityTest.xml @@ -8,14 +8,14 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Catalog\Test\TestCase\ProductAttribute\DeleteProductAttributeEntityTest"> <variation name="DeleteProductAttributeEntityTestVariation1"> - <data name="attribute/dataSet" xsi:type="string">attribute_type_text_field</data> + <data name="attribute/dataset" xsi:type="string">attribute_type_text_field</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeSuccessDeleteMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeAbsenceInGrid" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeAbsenceInSearchOnProductForm" /> <constraint name="Magento\ImportExport\Test\Constraint\AssertProductAttributeAbsenceForExport" /> </variation> <variation name="DeleteProductAttributeEntityTestVariation2"> - <data name="attribute/dataSet" xsi:type="string">attribute_type_dropdown</data> + <data name="attribute/dataset" xsi:type="string">attribute_type_dropdown</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeSuccessDeleteMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeAbsenceInGrid" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeAbsenceInSearchOnProductForm" /> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteUsedInConfigurableProductAttributeTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteUsedInConfigurableProductAttributeTest.xml index 0c7d65d6cd0aae23fe6e275a07cee0a0692919a0..541aa9291334639a436f0e1fc4da221dab1fda4b 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteUsedInConfigurableProductAttributeTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteUsedInConfigurableProductAttributeTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Catalog\Test\TestCase\ProductAttribute\DeleteUsedInConfigurableProductAttributeTest"> <variation name="DeleteUsedInConfigurableProductAttributeTestVariation1"> - <data name="product/dataSet" xsi:type="string">one_variation</data> + <data name="product/dataset" xsi:type="string">one_variation</data> <constraint name="Magento\Catalog\Test\Constraint\AssertUsedSuperAttributeImpossibleDeleteMessages"/> <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeInGrid"/> <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductForm"/> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateAttributeSetTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateAttributeSetTest.xml index 7597b2416ba022c4ba0a68073835d2af87313ada..4264283d45b388d6e4ddff0143966124a2d2c816 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateAttributeSetTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateAttributeSetTest.xml @@ -10,8 +10,8 @@ <variation name="UpdateAttributeSetTestVariation1"> <data name="attributeSet/data/attribute_set_name" xsi:type="string">ProductTemplateEdit1%isolation%</data> <data name="attributeSet/data/group" xsi:type="string">Custom-group%isolation%</data> - <data name="attributeSetOriginal/dataSet" xsi:type="string">custom_attribute_set</data> - <data name="productAttributeOriginal/dataSet" xsi:type="string">attribute_type_text_field</data> + <data name="attributeSetOriginal/dataset" xsi:type="string">custom_attribute_set</data> + <data name="productAttributeOriginal/dataset" xsi:type="string">attribute_type_text_field</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateSuccessSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateForm" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateInGrid" /> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateProductAttributeEntityTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateProductAttributeEntityTest.php index b9e8ed962b3f0f1fd0e3e94ebe5d3b44d8f8726c..8429c349f0cfe3ad3ffd6e16d33ae27cb665fe05 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateProductAttributeEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateProductAttributeEntityTest.php @@ -13,10 +13,8 @@ use Magento\Catalog\Test\Page\Adminhtml\CatalogProductAttributeNew; use Magento\Mtf\TestCase\Injectable; /** - * Test Creation for UpdateProductAttributeEntity - * * Preconditions: - * Preset : AttributeOptions + * Dataset : AttributeOptions * 1. Attribute is created (Attribute) * 2. Attribute set is created (Product Template) * diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateProductAttributeEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateProductAttributeEntityTest.xml index 0e74dfb542a73f312a319c9aef11e02d330176da..c3bc9c6a2c27df2ae6a26f8b6b1ecb3cd29af40c 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateProductAttributeEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateProductAttributeEntityTest.xml @@ -8,8 +8,8 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Catalog\Test\TestCase\ProductAttribute\UpdateProductAttributeEntityTest"> <variation name="UpdateProductAttributeEntityTestVariation1"> - <data name="productTemplate/dataSet" xsi:type="string">custom_attribute_set</data> - <data name="productAttributeOriginal/dataSet" xsi:type="string">attribute_type_text_field</data> + <data name="productTemplate/dataset" xsi:type="string">custom_attribute_set</data> + <data name="productAttributeOriginal/dataset" xsi:type="string">attribute_type_text_field</data> <data name="attribute/data/frontend_label" xsi:type="string">Text_Field_%isolation%</data> <data name="attribute/data/is_required" xsi:type="string">Yes</data> <data name="attribute/data/is_global" xsi:type="string">Global</data> @@ -28,10 +28,10 @@ <constraint name="Magento\Catalog\Test\Constraint\AssertAddedProductAttributeOnProductForm" /> </variation> <variation name="UpdateProductAttributeEntityTestVariation2"> - <data name="productTemplate/dataSet" xsi:type="string">custom_attribute_set</data> - <data name="productAttributeOriginal/dataSet" xsi:type="string">attribute_type_dropdown</data> + <data name="productTemplate/dataset" xsi:type="string">custom_attribute_set</data> + <data name="productAttributeOriginal/dataset" xsi:type="string">attribute_type_dropdown</data> <data name="attribute/data/frontend_label" xsi:type="string">Dropdown_%isolation%</data> - <data name="attribute/data/options/preset" xsi:type="string">default</data> + <data name="attribute/data/options/dataset" xsi:type="string">default</data> <data name="attribute/data/is_required" xsi:type="string">Yes</data> <data name="attribute/data/is_global" xsi:type="string">Global</data> <data name="attribute/data/is_unique" xsi:type="string">Yes</data> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/AddAttributeToProductTemplateStep.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/AddAttributeToProductTemplateStep.php index e7b7313d2e5422ce4008237c245025d7fb01bac4..e022906b29b18a8f6bb1d651fa717fff2a88666a 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/AddAttributeToProductTemplateStep.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/AddAttributeToProductTemplateStep.php @@ -84,7 +84,7 @@ class AddAttributeToProductTemplateStep implements TestStepInterface $product = $this->fixtureFactory->createByCode( 'catalogProductSimple', [ - 'dataSet' => 'product_with_category_with_anchor', + 'dataset' => 'product_with_category_with_anchor', 'data' => [ 'attribute_set_id' => ['attribute_set' => $this->productTemplate], ], diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/CreateProductStep.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/CreateProductStep.php index 28bc0fc4eb20698a7b8f0a4f90209be03f9cea48..6b4fd6f1054bb352df43fafd3954cd576a873ea3 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/CreateProductStep.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/CreateProductStep.php @@ -16,7 +16,7 @@ use Magento\Mtf\TestStep\TestStepInterface; class CreateProductStep implements TestStepInterface { /** - * Product fixture from dataSet. + * Product fixture from dataset. * * @var string */ @@ -49,9 +49,9 @@ class CreateProductStep implements TestStepInterface */ public function run() { - list($fixtureClass, $dataSet) = explode('::', $this->product); + list($fixtureClass, $dataset) = explode('::', $this->product); /** @var FixtureInterface $product */ - $product = $this->fixtureFactory->createByCode(trim($fixtureClass), ['dataSet' => trim($dataSet)]); + $product = $this->fixtureFactory->createByCode(trim($fixtureClass), ['dataset' => trim($dataset)]); if ($product->hasData('id') === false) { $product->persist(); } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/CreateProductsStep.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/CreateProductsStep.php index 74adfb27e1075d828970ffbc81df67f9dffe087e..5141fe99e50806dedba7d8b16cb8105115b97940 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/CreateProductsStep.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/CreateProductsStep.php @@ -64,12 +64,12 @@ class CreateProductsStep implements TestStepInterface foreach ($productsDataSets as $key => $productDataSet) { $productDataSet = explode('::', $productDataSet); $fixtureClass = $productDataSet[0]; - $dataSet = isset($productDataSet[1]) ? $productDataSet[1] : ''; + $dataset = isset($productDataSet[1]) ? $productDataSet[1] : ''; $data = isset($this->data[$key]) ? $this->data[$key] : []; /** @var FixtureInterface[] $products */ $products[$key] = $this->fixtureFactory->createByCode( trim($fixtureClass), - ['dataSet' => trim($dataSet), 'data' => $data] + ['dataset' => trim($dataset), 'data' => $data] ); if ($products[$key]->hasData('id') === false) { $products[$key]->persist(); diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedCatalogPage.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedCatalogPage.php index 045029bca59a36e4f52a0d1f2523d43272397223..7e425f21585dc2f9474fd4593fe8d692093a9fd2 100755 --- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedCatalogPage.php +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedCatalogPage.php @@ -46,8 +46,8 @@ class AssertCatalogPriceRuleAppliedCatalogPage extends AbstractConstraint $categoryName = $product->getCategoryIds()[0]; $cmsIndexPage->getTopmenu()->selectCategoryByName($categoryName); $priceBlock = $catalogCategoryViewPage->getListProductBlock()->getProductItem($product)->getPriceBlock(); - $actualPrice['regular'] = $priceBlock->getOldPrice(); - $actualPrice['special'] = $priceBlock->getSpecialPrice(); + $actualPrice['regular'] = (float)$priceBlock->getOldPrice(); + $actualPrice['special'] = (float)$priceBlock->getSpecialPrice(); $actualPrice['discount_amount'] = $actualPrice['regular'] - $actualPrice['special']; $diff = $this->verifyData($actualPrice, $productPrice[$key]); \PHPUnit_Framework_Assert::assertTrue( diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Fixture/CatalogRule.xml b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Fixture/CatalogRule.xml index f76cebd5e059c921b0f734c37a913239f559fd32..1c025f00d6eb511b1ec2a85cbaabb7567ebaaec6 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Fixture/CatalogRule.xml +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Fixture/CatalogRule.xml @@ -6,61 +6,29 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="catalogRule" module="Magento_CatalogRule" type="eav" entity_type="catalog_rule" collection="Magento\CatalogRule\Model\Resource\Rule\Product\Price\Collection" repository_class="Magento\CatalogRule\Test\Repository\CatalogRule" handler_interface="Magento\CatalogRule\Test\Handler\CatalogRule\CatalogRuleInterface" class="Magento\CatalogRule\Test\Fixture\CatalogRule"> - <dataset name="default"> - <field name="name" xsi:type="string">CatalogPriceRule %isolation%</field> - <field name="description" xsi:type="string">Catalog Price Rule Description</field> - <field name="is_active" xsi:type="string">Active</field> - <field name="website_ids" xsi:type="array"> - <item name="0" xsi:type="string">Main Website</item> - </field> - <field name="customer_group_ids" xsi:type="array"> - <item name="0" xsi:type="string">NOT LOGGED IN</item> - </field> - <field name="simple_action" xsi:type="string">Apply as percentage of original</field> - <field name="discount_amount" xsi:type="string">50</field> - </dataset> - <field name="name" is_required="1" group="rule_information"> - <default_value xsi:type="string">CatalogPriceRule %isolation%</default_value> - </field> - <field name="description" group="rule_information"> - <default_value xsi:type="string">Catalog Price Rule Description</default_value> - </field> - <field name="is_active" is_required="1" group="rule_information"> - <default_value xsi:type="string">Active</default_value> - </field> - <field name="website_ids" is_required="1" group="rule_information"> - <default_value xsi:type="array"> - <item name="0" xsi:type="string">Main Website</item> - </default_value> - </field> - <field name="customer_group_ids" is_required="1" group="rule_information"> - <default_value xsi:type="array"> - <item name="0" xsi:type="string">NOT LOGGED IN</item> - </default_value> - </field> - <field name="from_date" is_required="0" group="rule_information"> - <default_value xsi:type="null"/> - </field> - <field name="to_date" is_required="0" group="rule_information"> - <default_value xsi:type="null"/> - </field> - <field name="simple_action" is_required="0" group="actions"> - <default_value xsi:type="string">Apply as percentage of original</default_value> - </field> - <field name="discount_amount" is_required="1" group="actions"> - <default_value xsi:type="number">50</default_value> - </field> - <field name="condition_type" is_required="0" group="conditions"/> - <field name="condition_value" is_required="0" group="conditions"/> - <field name="rule" is_required="0" group="conditions"/> - <field name="conditions" group="conditions"/> - <field name="id"/> - <field name="sort_order" group="rule_information"> - <default_value xsi:type="null"/> - </field> - <field name="stop_rules_processing" group="rule_information"> - <default_value xsi:type="null"/> - </field> - </fixture> + <fixture name="catalogRule" + module="Magento_CatalogRule" + type="eav" + entity_type="catalog_rule" + collection="Magento\CatalogRule\Model\Resource\Rule\Product\Price\Collection" + repository_class="Magento\CatalogRule\Test\Repository\CatalogRule" + handler_interface="Magento\CatalogRule\Test\Handler\CatalogRule\CatalogRuleInterface" + class="Magento\CatalogRule\Test\Fixture\CatalogRule"> + <field name="name" is_required="1" group="rule_information" /> + <field name="description" group="rule_information" /> + <field name="is_active" is_required="1" group="rule_information" /> + <field name="website_ids" is_required="1" group="rule_information" /> + <field name="customer_group_ids" is_required="1" group="rule_information" /> + <field name="from_date" is_required="0" group="rule_information" /> + <field name="to_date" is_required="0" group="rule_information" /> + <field name="simple_action" is_required="0" group="actions" /> + <field name="discount_amount" is_required="1" group="actions" /> + <field name="condition_type" is_required="0" group="conditions" /> + <field name="condition_value" is_required="0" group="conditions" /> + <field name="rule" is_required="0" group="conditions" /> + <field name="conditions" group="conditions" /> + <field name="id" /> + <field name="sort_order" group="rule_information" /> + <field name="stop_rules_processing" group="rule_information" /> + </fixture> </config> diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Repository/CatalogRule.xml b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Repository/CatalogRule.xml index 1991317d9d1aa12995023e96e0699c8cc1d1a662..ae748f108af441345fe6420cb68940e33583c40c 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Repository/CatalogRule.xml +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Repository/CatalogRule.xml @@ -7,6 +7,20 @@ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> <repository class="Magento\CatalogRule\Test\Repository\CatalogRule"> + <dataset name="default"> + <field name="name" xsi:type="string">CatalogPriceRule %isolation%</field> + <field name="description" xsi:type="string">Catalog Price Rule Description</field> + <field name="is_active" xsi:type="string">Active</field> + <field name="website_ids" xsi:type="array"> + <item name="0" xsi:type="string">Main Website</item> + </field> + <field name="customer_group_ids" xsi:type="array"> + <item name="0" xsi:type="string">NOT LOGGED IN</item> + </field> + <field name="simple_action" xsi:type="string">By Percentage of the Original Price</field> + <field name="discount_amount" xsi:type="string">50</field> + </dataset> + <dataset name="active_catalog_rule"> <field name="name" xsi:type="string">Active Catalog Rule</field> <field name="description" xsi:type="string">Rule Description</field> diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/ApplySeveralCatalogPriceRuleEntityTest.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/ApplySeveralCatalogPriceRuleEntityTest.php index 1ef4e30a3e542de934a5f0b55e214460b385c8a5..f58522829371e6dad6829d18fbbfd9b4abf454fe 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/ApplySeveralCatalogPriceRuleEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/ApplySeveralCatalogPriceRuleEntityTest.php @@ -12,7 +12,7 @@ use Magento\Catalog\Test\Fixture\CatalogProductSimple; * Preconditions: * 1. Execute before each variation: * - Delete all active catalog price rules - * - Create catalog price rule from dataSet using Curl + * - Create catalog price rule from dataset using Curl * * Steps: * 1. Apply all created rules. @@ -44,7 +44,7 @@ class ApplySeveralCatalogPriceRuleEntityTest extends AbstractCatalogRuleEntityTe } $catalogRules[$key] = $this->fixtureFactory->createByCode( 'catalogRule', - ['dataSet' => $catalogPriceRule] + ['dataset' => $catalogPriceRule] ); $catalogRules[$key]->persist(); diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/CreateCatalogRuleTest.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/CreateCatalogRuleTest.php index e09819c8e64a3b3c7bb80492d06814673d925e89..d9d68e5bc3cc052ac04c0a917ea3ff21eed720b3 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/CreateCatalogRuleTest.php +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/CreateCatalogRuleTest.php @@ -46,7 +46,7 @@ class CreateCatalogRuleTest extends AbstractCatalogRuleEntityTest $product, Customer $customer = null ) { - $productSimple = $this->fixtureFactory->createByCode('catalogProductSimple', ['dataSet' => $product]); + $productSimple = $this->fixtureFactory->createByCode('catalogProductSimple', ['dataset' => $product]); // Prepare data $catalogPriceRule = $this->applyCustomerGroup($catalogPriceRule, $customer); $replace = [ diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/CreateCatalogRuleTest.xml b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/CreateCatalogRuleTest.xml index a4124b74a02737ae4c9f4b368860e89ff68ea541..1938d790f9068761e4917670b9a7a3fae2e009c1 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/CreateCatalogRuleTest.xml +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/CreateCatalogRuleTest.xml @@ -29,7 +29,7 @@ </variation> <variation name="CreateCatalogRuleTestVariation2"> <data name="description" xsi:type="string">MAGETWO-12908: Apply Catalog Price Rules to Specific Customer Group.</data> - <data name="customer/dataSet" xsi:type="string">customer_with_new_customer_group</data> + <data name="customer/dataset" xsi:type="string">customer_with_new_customer_group</data> <data name="product" xsi:type="string">simple_10_dollar</data> <data name="catalogPriceRule/data/name" xsi:type="string">rule_name%isolation%</data> <data name="catalogPriceRule/data/is_active" xsi:type="string">Active</data> diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/DeleteCatalogPriceRuleEntityTest.xml b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/DeleteCatalogPriceRuleEntityTest.xml index f986ef83a139dabbf47b22b41075680000e25806..1567fcd1819a80a07bd608df81abb37cc93c9982 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/DeleteCatalogPriceRuleEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/DeleteCatalogPriceRuleEntityTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\CatalogRule\Test\TestCase\DeleteCatalogPriceRuleEntityTest"> <variation name="DeleteCatalogPriceRuleEntityTestVariation1"> - <data name="catalogPriceRule/dataSet" xsi:type="string">active_catalog_price_rule_with_conditions</data> + <data name="catalogPriceRule/dataset" xsi:type="string">active_catalog_price_rule_with_conditions</data> <constraint name="Magento\CatalogRule\Test\Constraint\AssertCatalogPriceRuleSuccessDeleteMessage"/> <constraint name="Magento\CatalogRule\Test\Constraint\AssertCatalogPriceRuleNotInGrid"/> </variation> diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/UpdateCatalogPriceRuleEntityTest.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/UpdateCatalogPriceRuleEntityTest.php index fd30614dd24abfbdd239882132548305f5199cd0..a7ee832dbdbd0e799d00b2619fbdbe5a095c8a99 100755 --- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/UpdateCatalogPriceRuleEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/UpdateCatalogPriceRuleEntityTest.php @@ -7,7 +7,7 @@ namespace Magento\CatalogRule\Test\TestCase; use Magento\Catalog\Test\Fixture\CatalogProductSimple; -use Magento\Catalog\Test\Fixture\CatalogProductSimple\CategoryIds; +use Magento\Catalog\Test\Fixture\Product\CategoryIds; use Magento\CatalogRule\Test\Fixture\CatalogRule; /** @@ -18,7 +18,7 @@ use Magento\CatalogRule\Test\Fixture\CatalogRule; * 1. Login to backend. * 2. Navigate to MARKETING > Catalog Price Rules. * 3. Click Catalog Price Rule from grid. - * 4. Edit test value(s) according to dataSet. + * 4. Edit test value(s) according to dataset. * 5. Click 'Save'/ 'Apply' button. * 6. Create simple product with category. * 7. Perform all asserts. @@ -53,7 +53,7 @@ class UpdateCatalogPriceRuleEntityTest extends AbstractCatalogRuleEntityTest //Prepare data $productSimple = $this->fixtureFactory->createByCode( 'catalogProductSimple', - ['dataSet' => 'product_with_category'] + ['dataset' => 'product_with_category'] ); if ($saveAction == 'saveAndApply') { /** @var CategoryIds $sourceCategories */ diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/UpdateCatalogPriceRuleEntityTest.xml b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/UpdateCatalogPriceRuleEntityTest.xml index 9f1e3a665ff224c329fc203ca9b01a24f9d0c91e..a89cc50030055de693bcba46bdbdff039e195cf0 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/UpdateCatalogPriceRuleEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/UpdateCatalogPriceRuleEntityTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\CatalogRule\Test\TestCase\UpdateCatalogPriceRuleEntityTest"> <variation name="UpdateCatalogPriceRuleEntityTestVariation1"> - <data name="catalogPriceRuleOriginal/dataSet" xsi:type="string">active_catalog_price_rule_with_conditions</data> + <data name="catalogPriceRuleOriginal/dataset" xsi:type="string">active_catalog_price_rule_with_conditions</data> <data name="catalogPriceRule/data/name" xsi:type="string">New Catalog Price Rule Name %isolation%</data> <data name="catalogPriceRule/data/is_active" xsi:type="string">Inactive</data> <data name="saveAction" xsi:type="string">save</data> @@ -19,7 +19,7 @@ <constraint name="Magento\CatalogRule\Test\Constraint\AssertCatalogPriceRuleNotAppliedProductPage" /> </variation> <variation name="UpdateCatalogPriceRuleEntityTestVariation2"> - <data name="catalogPriceRuleOriginal/dataSet" xsi:type="string">active_catalog_price_rule_with_conditions</data> + <data name="catalogPriceRuleOriginal/dataset" xsi:type="string">active_catalog_price_rule_with_conditions</data> <data name="catalogPriceRule/data/name" xsi:type="string">New Catalog Price Rule Name %isolation%</data> <data name="catalogPriceRule/data/description" xsi:type="string">New Catalog Price Rule Description %isolation%</data> <data name="catalogPriceRule/data/is_active" xsi:type="string">Active</data> diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestStep/CreateCatalogRuleStep.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestStep/CreateCatalogRuleStep.php index 82215f4f64f2445cadf5bcedddd973e38c14de99..12412122501f2b81d5105404a0425b707ad14997 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestStep/CreateCatalogRuleStep.php +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestStep/CreateCatalogRuleStep.php @@ -61,7 +61,7 @@ class CreateCatalogRuleStep implements TestStepInterface if ($this->catalogRule != '-') { $catalogRule = $this->fixtureFactory->createByCode( 'catalogRule', - ['dataSet' => $this->catalogRule] + ['dataset' => $this->catalogRule] ); $catalogRule->persist(); $result['catalogRule'] = $catalogRule; diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Fixture/CatalogSearchQuery.xml b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Fixture/CatalogSearchQuery.xml index 940729a21995ef1db6dd3a718c6c92293ddbe299..348fd35048e3a1331e1720b76edaac9117bf63af 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Fixture/CatalogSearchQuery.xml +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Fixture/CatalogSearchQuery.xml @@ -6,39 +6,24 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="catalogSearchQuery" module="Magento_CatalogSearch" type="flat" entity_type="search_query" collection="Magento\Search\Model\Resource\Query\Collection" repository_class="Magento\CatalogSearch\Test\Repository\CatalogSearchQuery" handler_interface="Magento\CatalogSearch\Test\Handler\CatalogSearchQuery\CatalogSearchQueryInterface" class="Magento\CatalogSearch\Test\Fixture\CatalogSearchQuery"> - <field name="query_id" is_required="1"> - <default_value xsi:type="null"/> - </field> - <field name="query_text" is_required="" source="Magento\CatalogSearch\Test\Fixture\CatalogSearchQuery\QueryText"> - <default_value xsi:type="null"/> - </field> - <field name="num_results" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="popularity" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="redirect" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="synonym_for" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="store_id" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="display_in_terms" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="is_active" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="is_processed" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="updated_at" is_required=""> - <default_value xsi:type="null"/> - </field> - </fixture> + <fixture name="catalogSearchQuery" + module="Magento_CatalogSearch" + type="flat" + entity_type="search_query" + collection="Magento\Search\Model\Resource\Query\Collection" + repository_class="Magento\CatalogSearch\Test\Repository\CatalogSearchQuery" + handler_interface="Magento\CatalogSearch\Test\Handler\CatalogSearchQuery\CatalogSearchQueryInterface" + class="Magento\CatalogSearch\Test\Fixture\CatalogSearchQuery"> + <field name="query_id" is_required="1" /> + <field name="query_text" is_required="" source="Magento\CatalogSearch\Test\Fixture\CatalogSearchQuery\QueryText" /> + <field name="num_results" is_required="" /> + <field name="popularity" is_required="" /> + <field name="redirect" is_required="" /> + <field name="synonym_for" is_required="" /> + <field name="store_id" is_required="" /> + <field name="display_in_terms" is_required="" /> + <field name="is_active" is_required="" /> + <field name="is_processed" is_required="" /> + <field name="updated_at" is_required="" /> + </fixture> </config> diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Fixture/CatalogSearchQuery/QueryText.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Fixture/CatalogSearchQuery/QueryText.php index b2bf945cc675cb44e701f778786c6743b1757306..17b03aa1501a1ab37fa5c67176ab2217aedea5b3 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Fixture/CatalogSearchQuery/QueryText.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Fixture/CatalogSearchQuery/QueryText.php @@ -6,8 +6,8 @@ namespace Magento\CatalogSearch\Test\Fixture\CatalogSearchQuery; +use Magento\Mtf\Fixture\DataSource; use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Mtf\Fixture\FixtureInterface; use Magento\Mtf\Fixture\InjectableFixture; /** @@ -15,9 +15,9 @@ use Magento\Mtf\Fixture\InjectableFixture; * Possible templates: * - {value} * - {product}::{product_property_to_search} - * - {product}::{product_dataSet}::{product_property_to_search} + * - {product}::{product_dataset}::{product_property_to_search} */ -class QueryText implements FixtureInterface +class QueryText extends DataSource { /** * Entity to search. @@ -26,13 +26,6 @@ class QueryText implements FixtureInterface */ protected $product; - /** - * Resource data. - * - * @var string - */ - protected $data; - /** * @constructor * @param FixtureFactory $fixtureFactory @@ -45,9 +38,9 @@ class QueryText implements FixtureInterface $explodeValue = explode('::', $data['value']); if (!empty($explodeValue) && count($explodeValue) > 1) { $fixtureCode = $explodeValue[0]; - $dataSet = isset($explodeValue[2]) ? $explodeValue[1] : ''; + $dataset = isset($explodeValue[2]) ? $explodeValue[1] : ''; $searchValue = isset($explodeValue[2]) ? $explodeValue[2] : $explodeValue[1]; - $this->product = $fixtureFactory->createByCode($fixtureCode, ['dataSet' => $dataSet]); + $this->product = $fixtureFactory->createByCode($fixtureCode, ['dataset' => $dataset]); if (!$this->product->hasData('id')) { $this->product->persist(); } @@ -62,39 +55,6 @@ class QueryText implements FixtureInterface } } - /** - * Persist custom selections products. - * - * @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; - } - /** * Get product fixture to search. * diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/AdvancedSearchEntityTest.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/AdvancedSearchEntityTest.php index 2bd73f161a8028441ef459a631e1bfa211d9df97..740497bffb148aea85ca2c32ffe264e9e33cc4e4 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/AdvancedSearchEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/AdvancedSearchEntityTest.php @@ -45,14 +45,14 @@ class AdvancedSearchEntityTest extends Injectable /** @var CatalogProductSimple $productSymbols */ $productSymbols = $fixtureFactory->createByCode( 'catalogProductSimple', - ['dataSet' => 'abc_dfj_simple_for_advancedsearch'] + ['dataset' => 'abc_dfj_simple_for_advancedsearch'] ); $productSymbols->persist(); /** @var CatalogProductSimple $productNumbers */ $productNumbers = $fixtureFactory->createByCode( 'catalogProductSimple', - ['dataSet' => 'adc_123_simple_for_advancedsearch'] + ['dataset' => 'adc_123_simple_for_advancedsearch'] ); $productNumbers->persist(); diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/AdvancedSearchEntityTest.xml b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/AdvancedSearchEntityTest.xml index d9306dd78afd0a6c85816d8f794b662f2adcd5f2..204b9a57eb15c2267963777b340a553203285f0f 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/AdvancedSearchEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/AdvancedSearchEntityTest.xml @@ -13,10 +13,6 @@ <data name="products/simple_2" xsi:type="string">-</data> <data name="productSearch/data/name" xsi:type="string">abc_dfj</data> <data name="productSearch/data/sku" xsi:type="string">abc_dfj</data> - <data name="productSearch/data/description" xsi:type="string">-</data> - <data name="productSearch/data/short_description" xsi:type="string">-</data> - <data name="productSearch/data/price/value/price_from" xsi:type="string">-</data> - <data name="productSearch/data/price/value/price_to" xsi:type="string">-</data> <data name="tag" xsi:type="string">test_type:acceptance_test</data> <constraint name="Magento\CatalogSearch\Test\Constraint\AssertAdvancedSearchProductsResult"/> </variation> @@ -25,11 +21,6 @@ <data name="products/simple_1" xsi:type="string">-</data> <data name="products/simple_2" xsi:type="string">Yes</data> <data name="productSearch/data/name" xsi:type="string">adc_123</data> - <data name="productSearch/data/sku" xsi:type="string">-</data> - <data name="productSearch/data/description" xsi:type="string">-</data> - <data name="productSearch/data/short_description" xsi:type="string">-</data> - <data name="productSearch/data/price/value/price_from" xsi:type="string">-</data> - <data name="productSearch/data/price/value/price_to" xsi:type="string">-</data> <constraint name="Magento\CatalogSearch\Test\Constraint\AssertAdvancedSearchProductsResult"/> </variation> <variation name="AdvancedSearchEntityTestVariation3"> @@ -37,94 +28,55 @@ <data name="products/simple_1" xsi:type="string">Yes</data> <data name="products/simple_2" xsi:type="string">-</data> <data name="productSearch/data/name" xsi:type="string">abc</data> - <data name="productSearch/data/sku" xsi:type="string">-</data> - <data name="productSearch/data/description" xsi:type="string">-</data> - <data name="productSearch/data/short_description" xsi:type="string">-</data> - <data name="productSearch/data/price/value/price_from" xsi:type="string">-</data> - <data name="productSearch/data/price/value/price_to" xsi:type="string">-</data> <constraint name="Magento\CatalogSearch\Test\Constraint\AssertAdvancedSearchProductsResult"/> </variation> <variation name="AdvancedSearchEntityTestVariation4"> <data name="description" xsi:type="string">Search product in advanced search by sku</data> <data name="products/simple_1" xsi:type="string">Yes</data> <data name="products/simple_2" xsi:type="string">-</data> - <data name="productSearch/data/name" xsi:type="string">-</data> <data name="productSearch/data/sku" xsi:type="string">abc_dfj</data> - <data name="productSearch/data/description" xsi:type="string">-</data> - <data name="productSearch/data/short_description" xsi:type="string">-</data> - <data name="productSearch/data/price/value/price_from" xsi:type="string">-</data> - <data name="productSearch/data/price/value/price_to" xsi:type="string">-</data> <constraint name="Magento\CatalogSearch\Test\Constraint\AssertAdvancedSearchProductsResult"/> </variation> <variation name="AdvancedSearchEntityTestVariation5"> <data name="description" xsi:type="string">Search product in advanced search by partial sku</data> <data name="products/simple_1" xsi:type="string">Yes</data> <data name="products/simple_2" xsi:type="string">-</data> - <data name="productSearch/data/name" xsi:type="string">-</data> <data name="productSearch/data/sku" xsi:type="string">abc</data> - <data name="productSearch/data/description" xsi:type="string">-</data> - <data name="productSearch/data/short_description" xsi:type="string">-</data> - <data name="productSearch/data/price/value/price_from" xsi:type="string">-</data> - <data name="productSearch/data/price/value/price_to" xsi:type="string">-</data> <constraint name="Magento\CatalogSearch\Test\Constraint\AssertAdvancedSearchProductsResult"/> </variation> <variation name="AdvancedSearchEntityTestVariation6"> <data name="description" xsi:type="string">Search product in advanced search by partial sku and description</data> <data name="products/simple_1" xsi:type="string">Yes</data> <data name="products/simple_2" xsi:type="string">-</data> - <data name="productSearch/data/name" xsi:type="string">-</data> <data name="productSearch/data/sku" xsi:type="string">abc</data> <data name="productSearch/data/description" xsi:type="string">adc_full</data> - <data name="productSearch/data/short_description" xsi:type="string">-</data> - <data name="productSearch/data/price/value/price_from" xsi:type="string">-</data> - <data name="productSearch/data/price/value/price_to" xsi:type="string">-</data> <constraint name="Magento\CatalogSearch\Test\Constraint\AssertAdvancedSearchProductsResult"/> </variation> <variation name="AdvancedSearchEntityTestVariation7"> <data name="description" xsi:type="string">Search product in advanced search by description</data> <data name="products/simple_1" xsi:type="string">-</data> <data name="products/simple_2" xsi:type="string">Yes</data> - <data name="productSearch/data/name" xsi:type="string">-</data> - <data name="productSearch/data/sku" xsi:type="string">-</data> <data name="productSearch/data/description" xsi:type="string">dfj_full</data> - <data name="productSearch/data/short_description" xsi:type="string">-</data> - <data name="productSearch/data/price/value/price_from" xsi:type="string">-</data> - <data name="productSearch/data/price/value/price_to" xsi:type="string">-</data> <constraint name="Magento\CatalogSearch\Test\Constraint\AssertAdvancedSearchProductsResult"/> </variation> <variation name="AdvancedSearchEntityTestVariation8"> <data name="description" xsi:type="string">Search product in advanced search by short description</data> <data name="products/simple_1" xsi:type="string">-</data> <data name="products/simple_2" xsi:type="string">-</data> - <data name="productSearch/data/name" xsi:type="string">-</data> - <data name="productSearch/data/sku" xsi:type="string">-</data> - <data name="productSearch/data/description" xsi:type="string">-</data> <data name="productSearch/data/short_description" xsi:type="string">dfj_short</data> - <data name="productSearch/data/price/value/price_from" xsi:type="string">-</data> - <data name="productSearch/data/price/value/price_to" xsi:type="string">-</data> <constraint name="Magento\CatalogSearch\Test\Constraint\AssertAdvancedSearchProductsResult"/> </variation> <variation name="AdvancedSearchEntityTestVariation9"> <data name="description" xsi:type="string">Search product in advanced search by partial short description</data> <data name="products/simple_1" xsi:type="string">Yes</data> <data name="products/simple_2" xsi:type="string">-</data> - <data name="productSearch/data/name" xsi:type="string">-</data> - <data name="productSearch/data/sku" xsi:type="string">-</data> - <data name="productSearch/data/description" xsi:type="string">-</data> <data name="productSearch/data/short_description" xsi:type="string">abc_short</data> - <data name="productSearch/data/price/value/price_from" xsi:type="string">-</data> - <data name="productSearch/data/price/value/price_to" xsi:type="string">-</data> <constraint name="Magento\CatalogSearch\Test\Constraint\AssertAdvancedSearchProductsResult"/> </variation> <variation name="AdvancedSearchEntityTestVariation10"> <data name="description" xsi:type="string">Search product in advanced search by price to</data> <data name="products/simple_1" xsi:type="string">Yes</data> <data name="products/simple_2" xsi:type="string">Yes</data> - <data name="productSearch/data/name" xsi:type="string">-</data> - <data name="productSearch/data/sku" xsi:type="string">-</data> - <data name="productSearch/data/description" xsi:type="string">-</data> - <data name="productSearch/data/short_description" xsi:type="string">-</data> - <data name="productSearch/data/price/value/price_from" xsi:type="string">-</data> <data name="productSearch/data/price/value/price_to" xsi:type="string">100</data> <constraint name="Magento\CatalogSearch\Test\Constraint\AssertAdvancedSearchProductsResult"/> </variation> @@ -132,10 +84,6 @@ <data name="description" xsi:type="string">Search product in advanced search by price from and price to</data> <data name="products/simple_1" xsi:type="string">Yes</data> <data name="products/simple_2" xsi:type="string">-</data> - <data name="productSearch/data/name" xsi:type="string">-</data> - <data name="productSearch/data/sku" xsi:type="string">-</data> - <data name="productSearch/data/description" xsi:type="string">-</data> - <data name="productSearch/data/short_description" xsi:type="string">-</data> <data name="productSearch/data/price/value/price_from" xsi:type="string">50</data> <data name="productSearch/data/price/value/price_to" xsi:type="string">50</data> <constraint name="Magento\CatalogSearch\Test\Constraint\AssertAdvancedSearchProductsResult"/> diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/DeleteSearchTermEntityTest.xml b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/DeleteSearchTermEntityTest.xml index bab6e86c1809bbf4dc898595fdac5f6388f800ac..fe84b326dd4ba8388af2a87cc453093161be3d5a 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/DeleteSearchTermEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/DeleteSearchTermEntityTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\CatalogSearch\Test\TestCase\DeleteSearchTermEntityTest"> <variation name="DeleteSearchTermEntityTestVariation1"> - <data name="searchTerm/dataSet" xsi:type="string">default</data> + <data name="searchTerm/dataset" xsi:type="string">default</data> <constraint name="Magento\CatalogSearch\Test\Constraint\AssertSearchTermSuccessDeleteMessage"/> <constraint name="Magento\CatalogSearch\Test\Constraint\AssertSearchTermNotInGrid"/> <constraint name="Magento\CatalogSearch\Test\Constraint\AssertSearchTermNotOnFrontend"/> diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/MassDeleteSearchTermEntityTest.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/MassDeleteSearchTermEntityTest.php index 4f35edd4150c5e5d8daa234e290eb5318465bf0d..393a9cdc0143c7e6324d6ff4daac6288eee90be4 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/MassDeleteSearchTermEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/MassDeleteSearchTermEntityTest.php @@ -69,8 +69,8 @@ class MassDeleteSearchTermEntityTest extends Injectable $deleteSearchTerms = []; $searchTerms = array_map('trim', explode(',', $searchTerms)); foreach ($searchTerms as $term) { - list($fixture, $dataSet) = explode('::', $term); - $term = $fixtureFactory->createByCode($fixture, ['dataSet' => $dataSet]); + list($fixture, $dataset) = explode('::', $term); + $term = $fixtureFactory->createByCode($fixture, ['dataset' => $dataset]); /** @var CatalogSearchQuery $term */ $term->persist(); $deleteSearchTerms[] = ['search_query' => $term->getQueryText()]; diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/AbstractCartItem.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/AbstractCartItem.php index 458c7c1e57982a60970abfed7fdb762a5dd50cee..9e5cd000b1aa48d1c594b43123e45c2d0a3960db 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/AbstractCartItem.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/AbstractCartItem.php @@ -9,64 +9,75 @@ namespace Magento\Checkout\Test\Block\Cart; use Magento\Mtf\Block\Block; /** - * Class AbstractCartItem - * Base product item block on checkout page + * Base product item block on checkout page. */ class AbstractCartItem extends Block { /** - * Selector for product name + * Selector for product name. * * @var string */ protected $productName = '.product-item-name > a'; /** - * Selector for unit price + * Selector for unit price. * * @var string */ protected $price = './/td[@class="col price"]//span[@class="price"]'; /** - * Selector for unit price including tax + * Selector for unit price including tax. * * @var string */ protected $priceInclTax = './/td[@class="col price"]/*[@class="price-including-tax"]/span'; /** - * Quantity input selector + * Selector for unit price excluding tax. + * + * @var string + */ + protected $priceExclTax = './/td[@class="col price"]/*[@class="price-excluding-tax"]/span'; + + /** + * Quantity input selector. * * @var string */ protected $qty = './/input[@data-role="cart-item-qty"]'; /** - * Cart item sub-total xpath selector + * Cart item sub-total xpath selector. + * + * @var string + */ + protected $subtotalPrice = '.col.subtotal .price'; + + /** + * Cart item sub-total excluding tax xpath selector. * * @var string */ - protected $subtotalPrice = './/td[@class="col subtotal"]//*[@class="price-excluding-tax"]//span[@class="price"]'; + protected $subTotalPriceExclTax = '.col.subtotal .price-excluding-tax .price'; - // @codingStandardsIgnoreStart /** - * Cart item sub-total including tax xpath selector + * Cart item sub-total including tax xpath selector. * * @var string */ - protected $subTotalPriceInclTax = '//td[@class="col subtotal"]//span[@class="price"]'; - // @codingStandardsIgnoreEnd + protected $subTotalPriceInclTax = '.col.subtotal .price-including-tax .price'; /** - * Selector for options block + * Selector for options block. * * @var string */ - protected $optionsBlock = './/dl[@class="item-options"]'; + protected $optionsBlock = './/dl[contains(@class, "item-options")]'; /** - * Escape currency in price + * Escape currency in price. * * @param string $price * @return string|null diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/CartItem.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/CartItem.php index fe9ac8f85cfa3071c0a3442fbe50c215b285acc8..0d6181f26ec844b3ba98291d51e188ee50db96a2 100755 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/CartItem.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/CartItem.php @@ -40,7 +40,7 @@ class CartItem extends AbstractCartItem * * @var string */ - protected $wishlistButton = '.towishlist'; + protected $wishlistButton = '.action-towishlist'; /** * Quantity input selector @@ -49,13 +49,6 @@ class CartItem extends AbstractCartItem */ protected $name = '.product-item-name a'; - /** - * Cart item sub-total xpath selector - * - * @var string - */ - protected $subtotalPrice = './/td[@class="col subtotal"]//*[@class="price-excluding-tax"]//span[@class="price"]'; - /** * Get product name * @@ -92,6 +85,19 @@ class CartItem extends AbstractCartItem : null; } + /** + * Get product price excluding tax + * + * @return string|null + */ + public function getPriceExclTax() + { + $cartProductPrice = $this->_rootElement->find($this->priceExclTax, Locator::SELECTOR_XPATH); + return $cartProductPrice->isVisible() + ? str_replace(',', '', $this->escapeCurrency($cartProductPrice->getText())) + : null; + } + /** * Set product quantity * @@ -120,7 +126,20 @@ class CartItem extends AbstractCartItem */ public function getSubtotalPrice() { - $cartProductPrice = $this->_rootElement->find($this->subtotalPrice, Locator::SELECTOR_XPATH); + $cartProductPrice = $this->_rootElement->find($this->subtotalPrice); + return $cartProductPrice->isVisible() + ? str_replace(',', '', $this->escapeCurrency($cartProductPrice->getText())) + : null; + } + + /** + * Get sub-total excluding tax for the specified item in the cart + * + * @return string|null + */ + public function getSubtotalPriceExclTax() + { + $cartProductPrice = $this->_rootElement->find($this->subTotalPriceExclTax); return $cartProductPrice->isVisible() ? str_replace(',', '', $this->escapeCurrency($cartProductPrice->getText())) : null; @@ -133,7 +152,7 @@ class CartItem extends AbstractCartItem */ public function getSubtotalPriceInclTax() { - $cartProductPrice = $this->_rootElement->find($this->subTotalPriceInclTax, Locator::SELECTOR_XPATH); + $cartProductPrice = $this->_rootElement->find($this->subTotalPriceInclTax); return $cartProductPrice->isVisible() ? str_replace(',', '', $this->escapeCurrency($cartProductPrice->getText())) : null; diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/AbstractReview.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/AbstractReview.php index edc468d49224be1d0489c767e841d4d2de34527a..e25da69fdefb62cf35a179b06432f237df7820f9 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/AbstractReview.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/AbstractReview.php @@ -19,6 +19,13 @@ use Magento\Mtf\Client\Element\SimpleElement; */ abstract class AbstractReview extends Block { + /** + * Product item block locator. + * + * @var string + */ + protected $productItemByName = './/li[contains(@class,"product-item") and contains(.,"%s")]'; + /** * Grand total search mask. * @@ -31,14 +38,14 @@ abstract class AbstractReview extends Block * * @var string */ - protected $grandTotalExclTax = '[class="grand totals excl"] td>strong'; + protected $grandTotalExclTax = '.grand.totals.excl .price'; /** * Grand total including tax search mask. * * @var string */ - protected $grandTotalInclTax = '[class="grand totals incl"] td>strong'; + protected $grandTotalInclTax = '.grand.totals.incl .price'; /** * Subtotal search mask. @@ -52,28 +59,28 @@ abstract class AbstractReview extends Block * * @var string */ - protected $subtotalExclTax = '[class="totals sub excl"] span'; + protected $subtotalExclTax = '.totals.sub.excl .price'; /** * Subtotal including tax search mask. * * @var string */ - protected $subtotalInclTax = '[class="totals sub incl"] span'; + protected $subtotalInclTax = '.totals.sub.incl .price'; /** * Tax search mask. * * @var string */ - protected $tax = '.totals-tax span'; + protected $tax = '.totals-tax .price'; /** * Discount search mask. * * @var string */ - protected $discount = '[class="totals"] .amount>span'; + protected $discount = '.totals.discount .price'; /** * Shipping excluding tax search mask. @@ -87,21 +94,21 @@ abstract class AbstractReview extends Block * * @var string */ - protected $shippingInclTax = '[class="totals shipping incl"] span'; + protected $shippingInclTax = '.totals.shipping.incl .price'; /** * Product price excluding tax search mask. * * @var string */ - protected $itemExclTax = '//tr[contains (.,"%s")]/td[@class="col price"]/span[@class="price-excluding-tax"]/span'; + protected $itemExclTax = '.price-excluding-tax .price'; /** * Product price including tax search mask. * * @var string */ - protected $itemInclTax = '//tr[contains (.,"%s")]/td[@class="col price"]/span[@class="price-including-tax"]/span'; + protected $itemInclTax = '.price-including-tax .price'; // @codingStandardsIgnoreStart /** @@ -109,14 +116,14 @@ abstract class AbstractReview extends Block * * @var string */ - protected $itemSubExclTax = '//tr[contains (.,"%s")]/td[@class="col subtotal"]/span[@class="price-excluding-tax"]/span'; + protected $itemSubExclTax = '.subtotal .price-excluding-tax .price'; /** * Product price subtotal including tax search mask. * * @var string */ - protected $itemSubInclTax = '//tr[contains (.,"%s")]/td[@class="col subtotal"]/span[@class="price-including-tax"]/span'; + protected $itemSubInclTax = '.subtotal .price-including-tax .price'; // @codingStandardsIgnoreEnd /** @@ -156,8 +163,11 @@ abstract class AbstractReview extends Block */ public function getItemPriceExclTax($productName) { - $locator = sprintf($this->itemExclTax, $productName); - $price = $this->_rootElement->find($locator, Locator::SELECTOR_XPATH); + $productItem = $this->_rootElement->find( + sprintf($this->productItemByName, $productName), + Locator::SELECTOR_XPATH + ); + $price = $productItem->find($this->itemExclTax); return $price->isVisible() ? $this->escapeCurrency($price->getText()) : null; } @@ -169,8 +179,11 @@ abstract class AbstractReview extends Block */ public function getItemPriceInclTax($productName) { - $locator = sprintf($this->itemInclTax, $productName); - $price = $this->_rootElement->find($locator, Locator::SELECTOR_XPATH); + $productItem = $this->_rootElement->find( + sprintf($this->productItemByName, $productName), + Locator::SELECTOR_XPATH + ); + $price = $productItem->find($this->itemInclTax); return $price->isVisible() ? $this->escapeCurrency($price->getText()) : null; } @@ -182,8 +195,11 @@ abstract class AbstractReview extends Block */ public function getItemSubExclTax($productName) { - $locator = sprintf($this->itemSubExclTax, $productName); - $price = $this->_rootElement->find($locator, Locator::SELECTOR_XPATH); + $productItem = $this->_rootElement->find( + sprintf($this->productItemByName, $productName), + Locator::SELECTOR_XPATH + ); + $price = $productItem->find($this->itemSubExclTax); return $price->isVisible() ? $this->escapeCurrency($price->getText()) : null; } @@ -195,8 +211,11 @@ abstract class AbstractReview extends Block */ public function getItemSubInclTax($productName) { - $locator = sprintf($this->itemSubInclTax, $productName); - $price = $this->_rootElement->find($locator, Locator::SELECTOR_XPATH); + $productItem = $this->_rootElement->find( + sprintf($this->productItemByName, $productName), + Locator::SELECTOR_XPATH + ); + $price = $productItem->find($this->itemSubInclTax); return $price->isVisible() ? $this->escapeCurrency($price->getText()) : null; } @@ -225,12 +244,12 @@ abstract class AbstractReview extends Block /** * Get Tax text from Order Totals. * - * @return array|string + * @return string|null */ public function getTax() { - $tax = $this->_rootElement->find($this->tax)->getText(); - return $this->escapeCurrency($tax); + $tax = $this->_rootElement->find($this->tax, Locator::SELECTOR_CSS); + return $tax->isVisible() ? $this->escapeCurrency($tax->getText()) : null; } /** @@ -295,7 +314,6 @@ abstract class AbstractReview extends Block */ public function getShippingExclTax() { - $this->waitForElementVisible($this->shippingExclTax); $subTotal = $this->_rootElement->find($this->shippingExclTax); return $subTotal->isVisible() ? $this->escapeCurrency($subTotal->getText()) : null; } diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Payment.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Payment.php index 1d21f0613d44aa0ccb26dfc2383660b78633846d..8ac7389621c01625b8af81ecc793e650b56335e8 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Payment.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Payment.php @@ -19,22 +19,36 @@ class Payment extends Block * * @var string */ - protected $paymentMethodInput = '#p_method_%s'; + protected $paymentMethodInput = '#%s'; /** * Labels for payment methods. * * @var string */ - protected $paymentMethodLabels = '[for^=p_method_]'; + protected $paymentMethodLabels = '.payment-method:not([style="display: none;"]) .payment-method-title label'; /** * Label for payment methods. * * @var string */ - protected $paymentMethodLabel = '[for=%s]'; + protected $paymentMethodLabel = '[for="%s"]'; + /** + * Continue checkout button. + * + * @var string + */ + protected $continue = '#payment-buttons-container button'; + + /** + * Place order button. + * + * @var string + */ + protected $placeOrder = '.action.primary.checkout'; + /** * Wait element. * @@ -56,6 +70,7 @@ class Payment extends Block */ protected $activePaymentMethodSelector = '.payment-method._active'; + /** * Select payment method. * @@ -70,8 +85,8 @@ class Payment extends Block if ($paymentSelector->isVisible()) { $paymentSelector->click(); } else { - $paymentSelector = $this->_rootElement->find(sprintf($this->paymentMethodLabel, $payment['method'])); - if (!$paymentSelector->isVisible()) { + $paymentLabel = $this->_rootElement->find(sprintf($this->paymentMethodLabel, $payment['method'])); + if (!$paymentLabel->isVisible()) { throw new \Exception('Such payment method is absent.'); } } @@ -102,4 +117,22 @@ class Payment extends Block ['element' => $element] ); } + + /* + * Press "Place Order" button. + * + * @return void + */ + public function placeOrder() + { + $this->_rootElement->find($this->placeOrder)->click(); + $browser = $this->browser; + $selector = $this->waitElement; + $browser->waitUntil( + function () use ($browser, $selector) { + $element = $browser->find($selector); + return $element->isVisible() == false ? true : null; + } + ); + } } diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertCartItemsOptions.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertCartItemsOptions.php index f4d12c6d12531d1bf931e95f035ae4d222d0a938..67f6ee002ec4b074d04ce039be1b8e7a876144a8 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertCartItemsOptions.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertCartItemsOptions.php @@ -30,7 +30,7 @@ class AssertCartItemsOptions extends AbstractAssertForm /** * Assert that cart item options for product(s) display with correct information block - * (custom options, variations, links, samples, bundle items etc) according to passed from dataSet. + * (custom options, variations, links, samples, bundle items etc) according to passed from dataset. * * @param CheckoutCart $checkoutCart * @param Cart $cart diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Fixture/Cart.xml b/dev/tests/functional/tests/app/Magento/Checkout/Test/Fixture/Cart.xml index e83f70cc78018e0f14cab10d2dda9996e148971e..f9cd65e0982724619fc42fb949f418701ef58d48 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Fixture/Cart.xml +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Fixture/Cart.xml @@ -5,165 +5,67 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="cart" module="Magento_Checkout" type="flat" entity_type="quote" repository_class="Magento\Checkout\Test\Repository\Cart" handler_interface="Magento\Checkout\Test\Handler\Cart\CartInterface" class="Magento\Checkout\Test\Fixture\Cart"> - <field name="entity_id" is_required="1"> - <default_value xsi:type="null"/> - </field> - <field name="store_id" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="created_at" is_required=""> - <default_value xsi:type="string">CURRENT_TIMESTAMP</default_value> - </field> - <field name="updated_at" is_required=""> - <default_value xsi:type="string">0000-00-00 00:00:00</default_value> - </field> - <field name="converted_at" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="is_active" is_required=""> - <default_value xsi:type="string">1</default_value> - </field> - <field name="is_virtual" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="is_multi_shipping" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="items" source="Magento\Checkout\Test\Fixture\Cart\Items"/> - <field name="items_count" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="items_qty" is_required=""> - <default_value xsi:type="string">0.0000</default_value> - </field> - <field name="orig_order_id" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="store_to_base_rate" is_required=""> - <default_value xsi:type="string">0.0000</default_value> - </field> - <field name="store_to_quote_rate" is_required=""> - <default_value xsi:type="string">0.0000</default_value> - </field> - <field name="base_currency_code" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="store_currency_code" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="quote_currency_code" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="grand_total" is_required=""> - <default_value xsi:type="string">0.0000</default_value> - </field> - <field name="base_grand_total" is_required=""> - <default_value xsi:type="string">0.0000</default_value> - </field> - <field name="checkout_method" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="customer_id" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="customer_tax_class_id" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="customer_group_id" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="customer_email" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="customer_prefix" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="customer_firstname" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="customer_middlename" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="customer_lastname" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="customer_suffix" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="customer_dob" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="customer_note" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="customer_note_notify" is_required=""> - <default_value xsi:type="string">1</default_value> - </field> - <field name="customer_is_guest" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="remote_ip" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="applied_rule_ids" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="reserved_order_id" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="password_hash" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="coupon_code" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="global_currency_code" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="base_to_global_rate" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="base_to_quote_rate" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="customer_taxvat" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="customer_gender" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="subtotal" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="base_subtotal" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="subtotal_with_discount" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="base_subtotal_with_discount" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="is_changed" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="trigger_recollec" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="ext_shipping_info" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="is_persistent" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="gift_message_id" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="shipping_method" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="checkout_data" group="" source="Magento\Checkout\Test\Fixture\Cart\CheckoutData"/> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> + <fixture name="cart" + module="Magento_Checkout" + type="flat" + entity_type="quote" + repository_class="Magento\Checkout\Test\Repository\Cart" + handler_interface="Magento\Checkout\Test\Handler\Cart\CartInterface" + class="Magento\Checkout\Test\Fixture\Cart"> + <field name="entity_id" is_required="1" /> + <field name="store_id" is_required="" /> + <field name="created_at" is_required="" /> + <field name="updated_at" is_required="" /> + <field name="converted_at" is_required="" /> + <field name="is_active" is_required="" /> + <field name="is_virtual" is_required="" /> + <field name="is_multi_shipping" is_required="" /> + <field name="items" source="Magento\Checkout\Test\Fixture\Cart\Items" /> + <field name="items_count" is_required="" /> + <field name="items_qty" is_required="" /> + <field name="orig_order_id" is_required="" /> + <field name="store_to_base_rate" is_required="" /> + <field name="store_to_quote_rate" is_required="" /> + <field name="base_currency_code" is_required="" /> + <field name="store_currency_code" is_required="" /> + <field name="quote_currency_code" is_required="" /> + <field name="grand_total" is_required="" /> + <field name="base_grand_total" is_required="" /> + <field name="checkout_method" is_required="" /> + <field name="customer_id" is_required="" /> + <field name="customer_tax_class_id" is_required="" /> + <field name="customer_group_id" is_required="" /> + <field name="customer_email" is_required="" /> + <field name="customer_prefix" is_required="" /> + <field name="customer_firstname" is_required="" /> + <field name="customer_middlename" is_required="" /> + <field name="customer_lastname" is_required="" /> + <field name="customer_suffix" is_required="" /> + <field name="customer_dob" is_required="" /> + <field name="customer_note" is_required="" /> + <field name="customer_note_notify" is_required="" /> + <field name="customer_is_guest" is_required="" /> + <field name="remote_ip" is_required="" /> + <field name="applied_rule_ids" is_required="" /> + <field name="reserved_order_id" is_required="" /> + <field name="password_hash" is_required="" /> + <field name="coupon_code" is_required="" /> + <field name="global_currency_code" is_required="" /> + <field name="base_to_global_rate" is_required="" /> + <field name="base_to_quote_rate" is_required="" /> + <field name="customer_taxvat" is_required="" /> + <field name="customer_gender" is_required="" /> + <field name="subtotal" is_required="" /> + <field name="base_subtotal" is_required="" /> + <field name="subtotal_with_discount" is_required="" /> + <field name="base_subtotal_with_discount" is_required="" /> + <field name="is_changed" is_required="" /> + <field name="trigger_recollec" is_required="" /> + <field name="ext_shipping_info" is_required="" /> + <field name="is_persistent" is_required="" /> + <field name="gift_message_id" is_required="" /> + <field name="shipping_method" is_required="" /> + <field name="checkout_data" group="" source="Magento\Checkout\Test\Fixture\Cart\CheckoutData" /> </fixture> </config> diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Fixture/Cart/Items.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Fixture/Cart/Items.php index 6ca6c12cc218cfbbb0d6a65ecef8e99c40b8dfd2..acca29590a3f26bb2d9879ab11e7dc3da27de489 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Fixture/Cart/Items.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Fixture/Cart/Items.php @@ -6,34 +6,20 @@ namespace Magento\Checkout\Test\Fixture\Cart; -use Magento\Mtf\Fixture\FixtureInterface; use Magento\Mtf\ObjectManager; +use Magento\Mtf\Fixture\DataSource; +use Magento\Mtf\Fixture\FixtureInterface; /** - * Class Item - * Data for verify cart item block on checkout page + * Data for verify cart item block on checkout page. * * Data keys: * - product (fixture data for verify) */ -class Items implements FixtureInterface +class Items extends DataSource { /** - * Data set configuration settings - * - * @var array - */ - protected $params; - - /** - * Prepared dataSet data - * - * @var array - */ - protected $data = []; - - /** - * List fixture products + * List fixture products. * * @var FixtureInterface[] */ @@ -58,7 +44,7 @@ class Items implements FixtureInterface } /** - * Get module name from fixture + * Get module name from fixture. * * @param FixtureInterface $product * @return string @@ -70,40 +56,7 @@ class Items implements FixtureInterface } /** - * 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() - { - return $this->params; - } - - /** - * Get source products + * Get source products. * * @return array */ diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest.php index 8bfa4789d0ef329d869850606da31d13e302bb09..cca404d1fa94fc87760a0876446c0f64334eb10b 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest.php @@ -14,10 +14,6 @@ use Magento\Mtf\ObjectManager; use Magento\Mtf\TestCase\Injectable; /** - * Test Creation for AddProductsToShoppingCartEntity - * - * Test Flow: - * * Preconditions: * 1. All type products is created * diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest.xml b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest.xml index a03da15b27b8200d6880c37f16305170489d6b16..839994f8a917e8209a3c34e71dc31c12a7eceb06 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest.xml @@ -54,8 +54,7 @@ </variation> <variation name="AddProductsToShoppingCartEntityTestVariation6"> <data name="productsData" xsi:type="string">downloadableProduct::with_two_separately_links</data> - <data name="cart/data/grand_total" xsi:type="string">46</data> - <data name="issue" xsi:type="string">Bug: MAGETWO-24195</data> + <data name="cart/data/grand_total" xsi:type="string">22.43</data> <constraint name="Magento\Checkout\Test\Constraint\AssertPriceInShoppingCart" /> <constraint name="Magento\Checkout\Test\Constraint\AssertProductQtyInShoppingCart" /> <constraint name="Magento\Checkout\Test\Constraint\AssertSubtotalInShoppingCart" /> @@ -73,8 +72,7 @@ </variation> <variation name="AddProductsToShoppingCartEntityTestVariation8"> <data name="productsData" xsi:type="string">catalogProductSimple::with_two_custom_option, catalogProductVirtual::product_50_dollar, downloadableProduct::with_two_separately_links, groupedProduct::three_simple_products, configurableProduct::default, bundleProduct::bundle_dynamic_product, bundleProduct::bundle_dynamic_product</data> - <data name="cart/data/grand_total" xsi:type="string">3249</data> - <data name="issue" xsi:type="string">Bug: MAGETWO-24195</data> + <data name="cart/data/grand_total" xsi:type="string">2510</data> <constraint name="Magento\Checkout\Test\Constraint\AssertPriceInShoppingCart" /> <constraint name="Magento\Checkout\Test\Constraint\AssertProductQtyInShoppingCart" /> <constraint name="Magento\Checkout\Test\Constraint\AssertSubtotalInShoppingCart" /> diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductFromMiniShoppingCartTest.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductFromMiniShoppingCartTest.php index b3ae8fdbd934efe933c2ad70b9c945d2da272c02..a586805619624a8c61be4f24866763f45501a6df 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductFromMiniShoppingCartTest.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductFromMiniShoppingCartTest.php @@ -14,11 +14,8 @@ use Magento\Mtf\ObjectManager; use Magento\Mtf\TestCase\Injectable; /** - * Class DeleteProductFromMiniShoppingCartTest - * Test delete products from shopping cart - * - * Preconditions - * 1. Create product according to dataSet + * Preconditions: + * 1. Create product according to dataset * 2. Add products to cart * * Steps: diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductFromMiniShoppingCartTest.xml b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductFromMiniShoppingCartTest.xml index 165315f753cb3809ccb097bb3dccbd8b69631312..d9e8f0c865b2a3072b8a4cf218965cef909a44b8 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductFromMiniShoppingCartTest.xml +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/DeleteProductFromMiniShoppingCartTest.xml @@ -6,19 +6,19 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\Checkout\Test\TestCase\DeleteProductFromMiniShoppingCartTest"> - <variation name="DeleteProductFromMiniShoppingCartTestVariation1"> - <data name="description" xsi:type="string">delete Simple</data> - <data name="products" xsi:type="string">catalogProductSimple::default, catalogProductVirtual::default</data> - <data name="deletedProductIndex" xsi:type="string">0</data> - <constraint name="Magento\Checkout\Test\Constraint\AssertProductAbsentInMiniShoppingCart"/> - <constraint name="Magento\Checkout\Test\Constraint\AssertProductPresentInMiniShoppingCart"/> - </variation> - <variation name="DeleteProductFromMiniShoppingCartTestVariation2"> - <data name="description" xsi:type="string">delete Simple</data> - <data name="products" xsi:type="string">catalogProductSimple::default</data> - <data name="deletedProductIndex" xsi:type="string">0</data> - <constraint name="Magento\Checkout\Test\Constraint\AssertCartIsEmpty"/> - </variation> - </testCase> + <testCase name="Magento\Checkout\Test\TestCase\DeleteProductFromMiniShoppingCartTest"> + <variation name="DeleteProductFromMiniShoppingCartTestVariation1"> + <data name="description" xsi:type="string">delete Simple</data> + <data name="products" xsi:type="string">catalogProductSimple::default, catalogProductVirtual::default</data> + <data name="deletedProductIndex" xsi:type="string">0</data> + <constraint name="Magento\Checkout\Test\Constraint\AssertProductAbsentInMiniShoppingCart" /> + <constraint name="Magento\Checkout\Test\Constraint\AssertProductPresentInMiniShoppingCart" /> + </variation> + <variation name="DeleteProductFromMiniShoppingCartTestVariation2"> + <data name="description" xsi:type="string">delete Simple</data> + <data name="products" xsi:type="string">catalogProductSimple::default</data> + <data name="deletedProductIndex" xsi:type="string">0</data> + <constraint name="Magento\Checkout\Test\Constraint\AssertCartIsEmpty" /> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateProductFromMiniShoppingCartEntityTest.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateProductFromMiniShoppingCartEntityTest.php index f5d30d2f9bdc2f376563ee8964537b6758553fb2..01385567492ce096d405591e187a8712860b5187 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateProductFromMiniShoppingCartEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateProductFromMiniShoppingCartEntityTest.php @@ -13,17 +13,15 @@ use Magento\Mtf\Fixture\FixtureInterface; use Magento\Mtf\TestCase\Injectable; /** - * Test Flow: - * * Preconditions: - * 1. Create product according to dataSet. + * 1. Create product according to dataset. * 2. Go to frontend. * 3. Add product to cart. * * Steps: * 1. Click on mini shopping cart icon. * 2. Click Edit. - * 3. Fill data from dataSet. + * 3. Fill data from dataset. * 4. Click Update. * 5. Perform all assertions. * diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateProductFromMiniShoppingCartEntityTest.xml b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateProductFromMiniShoppingCartEntityTest.xml index 20f26723f598da161f19c94f2e99cf9584713d9e..49792e12b0ee7cf5049fd46c9295a605448a16e5 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateProductFromMiniShoppingCartEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateProductFromMiniShoppingCartEntityTest.xml @@ -6,41 +6,40 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\Checkout\Test\TestCase\UpdateProductFromMiniShoppingCartEntityTest"> - <variation name="UpdateProductFromMiniShoppingCartEntityTestVariation1"> - <data name="description" xsi:type="string">Update Simple</data> - <data name="originalProduct" xsi:type="string">catalogProductSimple::with_two_custom_option</data> - <data name="checkoutData/preset" xsi:type="string">forUpdateMiniShoppingCart</data> - <constraint name="Magento\Checkout\Test\Constraint\AssertProductQtyInMiniShoppingCart"/> - <constraint name="Magento\Checkout\Test\Constraint\AssertProductQtyInShoppingCart"/> - </variation> - <variation name="UpdateProductFromMiniShoppingCartEntityTestVariation2"> - <data name="description" xsi:type="string">Update Configurable and verify previous product was updated to new one in shopping cart and mini shopping cart</data> - <data name="originalProduct" xsi:type="string">configurableProduct::default</data> - <data name="checkoutData/preset" xsi:type="string">forUpdateMiniShoppingCart</data> - <constraint name="Magento\Checkout\Test\Constraint\AssertCartItemsOptions"/> - <constraint name="Magento\Checkout\Test\Constraint\AssertProductQtyInMiniShoppingCart"/> - <constraint name="Magento\Checkout\Test\Constraint\AssertProductQtyInShoppingCart"/> - <constraint name="Magento\Checkout\Test\Constraint\AssertProductOptionsAbsentInShoppingCart"/> - </variation> - <variation name="UpdateProductFromMiniShoppingCartEntityTestVariation3"> - <data name="description" xsi:type="string">Update Bundle and verify previous product was updated to new one in shopping cart and mini shopping cart</data> - <data name="originalProduct" xsi:type="string">bundleProduct::bundle_fixed_product</data> - <data name="checkoutData/preset" xsi:type="string">forUpdateMiniShoppingCart</data> - <constraint name="Magento\Checkout\Test\Constraint\AssertCartItemsOptions"/> - <constraint name="Magento\Checkout\Test\Constraint\AssertProductQtyInMiniShoppingCart"/> - <constraint name="Magento\Checkout\Test\Constraint\AssertProductQtyInShoppingCart"/> - <constraint name="Magento\Checkout\Test\Constraint\AssertProductOptionsAbsentInShoppingCart"/> - </variation> - <variation name="UpdateProductFromMiniShoppingCartEntityTestVariation4"> - <data name="description" xsi:type="string">Update Downloadable and check previous link was updated to new one in shopping cart and mini shopping cart</data> - <data name="originalProduct" xsi:type="string">downloadableProduct::with_two_separately_links</data> - <data name="checkoutData/preset" xsi:type="string">forUpdateMiniShoppingCart</data> - <data name="issue" xsi:type="string">Bug: MAGETWO-24195</data> - <constraint name="Magento\Checkout\Test\Constraint\AssertCartItemsOptions"/> - <constraint name="Magento\Checkout\Test\Constraint\AssertProductQtyInMiniShoppingCart"/> - <constraint name="Magento\Checkout\Test\Constraint\AssertProductQtyInShoppingCart"/> - <constraint name="Magento\Checkout\Test\Constraint\AssertProductOptionsAbsentInShoppingCart"/> - </variation> - </testCase> + <testCase name="Magento\Checkout\Test\TestCase\UpdateProductFromMiniShoppingCartEntityTest"> + <variation name="UpdateProductFromMiniShoppingCartEntityTestVariation1"> + <data name="description" xsi:type="string">Update Simple</data> + <data name="originalProduct" xsi:type="string">catalogProductSimple::with_two_custom_option</data> + <data name="checkoutData/dataset" xsi:type="string">simple_update_mini_shopping_cart</data> + <constraint name="Magento\Checkout\Test\Constraint\AssertProductQtyInMiniShoppingCart" /> + <constraint name="Magento\Checkout\Test\Constraint\AssertProductQtyInShoppingCart" /> + </variation> + <variation name="UpdateProductFromMiniShoppingCartEntityTestVariation2"> + <data name="description" xsi:type="string">Update Configurable and verify previous product was updated to new one in shopping cart and mini shopping cart</data> + <data name="originalProduct" xsi:type="string">configurableProduct::default</data> + <data name="checkoutData/dataset" xsi:type="string">configurable_update_mini_shopping_cart</data> + <constraint name="Magento\Checkout\Test\Constraint\AssertCartItemsOptions" /> + <constraint name="Magento\Checkout\Test\Constraint\AssertProductQtyInMiniShoppingCart" /> + <constraint name="Magento\Checkout\Test\Constraint\AssertProductQtyInShoppingCart" /> + <constraint name="Magento\Checkout\Test\Constraint\AssertProductOptionsAbsentInShoppingCart" /> + </variation> + <variation name="UpdateProductFromMiniShoppingCartEntityTestVariation3"> + <data name="description" xsi:type="string">Update Bundle and verify previous product was updated to new one in shopping cart and mini shopping cart</data> + <data name="originalProduct" xsi:type="string">bundleProduct::bundle_fixed_product</data> + <data name="checkoutData/dataset" xsi:type="string">bundle_update_mini_shopping_cart</data> + <constraint name="Magento\Checkout\Test\Constraint\AssertCartItemsOptions" /> + <constraint name="Magento\Checkout\Test\Constraint\AssertProductQtyInMiniShoppingCart" /> + <constraint name="Magento\Checkout\Test\Constraint\AssertProductQtyInShoppingCart" /> + <constraint name="Magento\Checkout\Test\Constraint\AssertProductOptionsAbsentInShoppingCart" /> + </variation> + <variation name="UpdateProductFromMiniShoppingCartEntityTestVariation4"> + <data name="description" xsi:type="string">Update Downloadable and check previous link was updated to new one in shopping cart and mini shopping cart</data> + <data name="originalProduct" xsi:type="string">downloadableProduct::with_two_separately_links</data> + <data name="checkoutData/dataset" xsi:type="string">downloadable_update_mini_shopping_cart</data> + <constraint name="Magento\Checkout\Test\Constraint\AssertCartItemsOptions" /> + <constraint name="Magento\Checkout\Test\Constraint\AssertProductQtyInMiniShoppingCart" /> + <constraint name="Magento\Checkout\Test\Constraint\AssertProductQtyInShoppingCart" /> + <constraint name="Magento\Checkout\Test\Constraint\AssertProductOptionsAbsentInShoppingCart" /> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateShoppingCartTest.xml b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateShoppingCartTest.xml index 3796dbef8a5445d87303c188eb9c0147512edf69..71424d79dff0b1588a76d9e25ad7b94ec9fc6e1d 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateShoppingCartTest.xml +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateShoppingCartTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Checkout\Test\TestCase\UpdateShoppingCartTest"> <variation name="UpdateShoppingCartTestVariation1"> - <data name="product/dataSet" xsi:type="string">default</data> + <data name="product/dataset" xsi:type="string">default</data> <data name="product/data/price/value" xsi:type="string">100</data> <data name="product/data/checkout_data/qty" xsi:type="string">3</data> <data name="product/data/checkout_data/cartItem/price" xsi:type="string">100</data> @@ -19,7 +19,7 @@ <constraint name="Magento\Checkout\Test\Constraint\AssertSubtotalInShoppingCart" /> </variation> <variation name="UpdateShoppingCartTestVariation2"> - <data name="product/dataSet" xsi:type="string">with_two_custom_option</data> + <data name="product/dataset" xsi:type="string">with_two_custom_option</data> <data name="product/data/price/value" xsi:type="string">50</data> <data name="product/data/checkout_data/qty" xsi:type="string">11</data> <data name="product/data/checkout_data/cartItem/price" xsi:type="string">65</data> diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermAbsentOnCheckout.php b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermAbsentOnCheckout.php index c2f88960e6d746a02a2e2fc53cf7108b8ea02fff..74bc1bcb31d1f1be14e6ce1f50cd40c6a3792865 100644 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermAbsentOnCheckout.php +++ b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermAbsentOnCheckout.php @@ -55,7 +55,7 @@ class AssertTermAbsentOnCheckout extends AbstractConstraint ); $product = $createProductsStep->run(); - $billingAddress = $fixtureFactory->createByCode('address', ['dataSet' => 'default']); + $billingAddress = $fixtureFactory->createByCode('address', ['dataset' => 'default']); $browser->open($_ENV['app_frontend_url'] . $product['products'][0]->getUrlKey() . '.html'); $catalogProductView->getViewBlock()->clickAddToCartButton(); diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermOnCheckout.php b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermOnCheckout.php index 64c35824418c162a4e8ca802278cdc173f071227..da394ef9e49f721c8434d113fefe4b9eaff236b6 100644 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermOnCheckout.php +++ b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermOnCheckout.php @@ -67,7 +67,7 @@ class AssertTermOnCheckout extends AbstractConstraint ); $product = $createProductsStep->run(); - $billingAddress = $fixtureFactory->createByCode('address', ['dataSet' => 'default']); + $billingAddress = $fixtureFactory->createByCode('address', ['dataset' => 'default']); $browser->open($_ENV['app_frontend_url'] . $product['products'][0]->getUrlKey() . '.html'); $catalogProductView->getViewBlock()->clickAddToCartButton(); diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermRequireMessageOnMultishippingCheckout.php b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermRequireMessageOnMultishippingCheckout.php index 38be9a5f0cceb54b290fd0f4c6617eec7e952dac..c9cee02f75d3edc971773230ab6bf116f5865ff7 100644 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermRequireMessageOnMultishippingCheckout.php +++ b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermRequireMessageOnMultishippingCheckout.php @@ -42,7 +42,7 @@ class AssertTermRequireMessageOnMultishippingCheckout extends AbstractConstraint $payment, $shipping ) { - $customer = ['customer' => ['dataSet' => 'johndoe_with_multiple_addresses']]; + $customer = ['customer' => ['dataset' => 'johndoe_with_multiple_addresses']]; $customer = $stepFactory->create('\Magento\Customer\Test\TestStep\CreateCustomerStep', $customer)->run(); $product = $stepFactory->create('\Magento\Catalog\Test\TestStep\CreateProductsStep', ['products' => $product]) ->run(); diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Fixture/CheckoutAgreement.xml b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Fixture/CheckoutAgreement.xml index d1f5018824ca4b96d33cf487ce339c285c1022f5..d33227c98e18747dce9b7ed2080dba78f8108721 100644 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Fixture/CheckoutAgreement.xml +++ b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Fixture/CheckoutAgreement.xml @@ -11,43 +11,13 @@ repository_class="Magento\CheckoutAgreements\Test\Repository\CheckoutAgreement" handler_interface="Magento\CheckoutAgreements\Test\Handler\CheckoutAgreement\CheckoutAgreementInterface" class="Magento\CheckoutAgreements\Test\Fixture\CheckoutAgreement"> - <dataset name="default"> - <field name="name" xsi:type="string">DefaultName%isolation%</field> - <field name="is_active" xsi:type="string">Enabled</field> - <field name="is_html" xsi:type="string">Text</field> - <field name="stores" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> - </field> - <field name="checkbox_text" xsi:type="string">test_checkbox%isolation%</field> - <field name="content" xsi:type="string">TestMessage%isolation%</field> - </dataset> - <field name="agreement_id" is_required="1"> - <default_value xsi:type="null" /> - </field> - <field name="name" is_required=""> - <default_value xsi:type="string">DefaultName%isolation%</default_value> - </field> - <field name="content" is_required=""> - <default_value xsi:type="string">TestMessage%isolation%</default_value> - </field> - <field name="content_height" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="checkbox_text" is_required=""> - <default_value xsi:type="string">test_checkbox%isolation%</default_value> - </field> - <field name="is_active" is_required=""> - <default_value xsi:type="string">Enabled</default_value> - </field> - <field name="is_html" is_required=""> - <default_value xsi:type="string">Text</default_value> - </field> - <field name="stores" source="Magento\CheckoutAgreements\Test\Fixture\CheckoutAgreement\Stores"> - <default_value xsi:type="array"> - <item name="dataSet" xsi:type="array"> - <item name="0" xsi:type="string">default</item> - </item> - </default_value> - </field> + <field name="agreement_id" is_required="1" /> + <field name="name" is_required="" /> + <field name="content" is_required="" /> + <field name="content_height" is_required="" /> + <field name="checkbox_text" is_required="" /> + <field name="is_active" is_required="" /> + <field name="is_html" is_required="" /> + <field name="stores" source="Magento\CheckoutAgreements\Test\Fixture\CheckoutAgreement\Stores" /> </fixture> </config> diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Fixture/CheckoutAgreement/Stores.php b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Fixture/CheckoutAgreement/Stores.php index 38b0fb89d8ad46ce7c3eba0f80355cf8efa1dc6f..7a95323ef6e141eb983cfed3c199f806420d7953 100644 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Fixture/CheckoutAgreement/Stores.php +++ b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Fixture/CheckoutAgreement/Stores.php @@ -6,40 +6,24 @@ namespace Magento\CheckoutAgreements\Test\Fixture\CheckoutAgreement; +use Magento\Mtf\Fixture\DataSource; use Magento\Store\Test\Fixture\Store; use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Mtf\Fixture\FixtureInterface; /** - * Class Stores - * Prepare Stores + * Prepare Stores. */ -class Stores implements FixtureInterface +class Stores extends DataSource { /** - * Prepared dataSet data - * - * @var array - */ - protected $data; - - /** - * Data set configuration settings - * - * @var array - */ - protected $params; - - /** - * Store fixture + * Store fixture. * * @var Store[] */ public $stores; /** - * Constructor - * + * @constructor * @param FixtureFactory $fixtureFactory * @param array $data * @param array $params [optional] @@ -47,9 +31,9 @@ class Stores implements FixtureInterface public function __construct(FixtureFactory $fixtureFactory, array $data, array $params = []) { $this->params = $params; - if (isset($data['dataSet'])) { - foreach ($data['dataSet'] as $store) { - $store = $fixtureFactory->createByCode('store', ['dataSet' => $store]); + if (isset($data['dataset'])) { + foreach ($data['dataset'] as $store) { + $store = $fixtureFactory->createByCode('store', ['dataset' => $store]); /** @var Store $store */ if (!$store->getStoreId()) { $store->persist(); @@ -61,40 +45,7 @@ class Stores implements FixtureInterface } /** - * Persist stores - * - * @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 array + * Return array. * * @return Store[] */ diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Repository/CheckoutAgreement.xml b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Repository/CheckoutAgreement.xml index a320ff995cd67a4b116e0317a712cb55857f86e2..d709248ee26e1c02d094e7063d121bfd5512db09 100644 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Repository/CheckoutAgreement.xml +++ b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Repository/CheckoutAgreement.xml @@ -7,12 +7,23 @@ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> <repository class="Magento\CheckoutAgreements\Test\Repository\CheckoutAgreement"> + <dataset name="default"> + <field name="name" xsi:type="string">DefaultName%isolation%</field> + <field name="is_active" xsi:type="string">Enabled</field> + <field name="is_html" xsi:type="string">Text</field> + <field name="stores" xsi:type="array"> + <item name="dataset" xsi:type="string">default</item> + </field> + <field name="checkbox_text" xsi:type="string">test_checkbox%isolation%</field> + <field name="content" xsi:type="string">TestMessage%isolation%</field> + </dataset> + <dataset name="term_disabled_text"> <field name="name" xsi:type="string">TermDisabledTextName%isolation%</field> <field name="is_active" xsi:type="string">Disabled</field> <field name="is_html" xsi:type="string">Text</field> <field name="stores" xsi:type="array"> - <item name="dataSet" xsi:type="array"> + <item name="dataset" xsi:type="array"> <item name="0" xsi:type="string">default</item> </item> </field> @@ -26,7 +37,7 @@ <field name="is_active" xsi:type="string">Disabled</field> <field name="is_html" xsi:type="string">HTML</field> <field name="stores" xsi:type="array"> - <item name="dataSet" xsi:type="array"> + <item name="dataset" xsi:type="array"> <item name="0" xsi:type="string">default</item> </item> </field> @@ -40,7 +51,7 @@ <field name="is_active" xsi:type="string">Enabled</field> <field name="is_html" xsi:type="string">Text</field> <field name="stores" xsi:type="array"> - <item name="dataSet" xsi:type="array"> + <item name="dataset" xsi:type="array"> <item name="0" xsi:type="string">default</item> </item> </field> diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/CreateTermEntityTest.php b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/CreateTermEntityTest.php index c0abdce3aeda49deb6c11229e5876d49111e4532..7d699f287fdde73b3298b3d3295f41fc01b3ebb4 100644 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/CreateTermEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/CreateTermEntityTest.php @@ -19,7 +19,7 @@ use Magento\Mtf\TestCase\Injectable; * Steps: * 1. Open Backend Stores > Terms and Conditions * 2. Create new "Terms and Conditions" - * 3. Fill data from dataSet + * 3. Fill data from dataset * 4. Save * 5. Perform all assertions * diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/CreateTermEntityTest.xml b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/CreateTermEntityTest.xml index d82cb340f1cb26b50041ffeeee8f22cb7bb92dcb..4779c05af5cdedc0d77a88be8c5a0faba8d5f030 100644 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/CreateTermEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/CreateTermEntityTest.xml @@ -13,7 +13,7 @@ <data name="agreement/data/name" xsi:type="string">name%isolation%</data> <data name="agreement/data/is_active" xsi:type="string">Enabled</data> <data name="agreement/data/is_html" xsi:type="string">Text</data> - <data name="agreement/data/stores/dataSet/0" xsi:type="string">default</data> + <data name="agreement/data/stores/dataset/0" xsi:type="string">default</data> <data name="agreement/data/checkbox_text" xsi:type="string">test_checkbox%isolation%</data> <data name="agreement/data/content" xsi:type="string">TestMessage%isolation%</data> <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data> @@ -29,7 +29,7 @@ <data name="agreement/data/name" xsi:type="string">name%isolation%</data> <data name="agreement/data/is_active" xsi:type="string">Enabled</data> <data name="agreement/data/is_html" xsi:type="string">HTML</data> - <data name="agreement/data/stores/dataSet/0" xsi:type="string">default</data> + <data name="agreement/data/stores/dataset/0" xsi:type="string">default</data> <data name="agreement/data/checkbox_text" xsi:type="string">test_checkbox%isolation%</data> <data name="agreement/data/content" xsi:type="string"><html></data> <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data> @@ -45,7 +45,7 @@ <data name="agreement/data/name" xsi:type="string">name%isolation%</data> <data name="agreement/data/is_active" xsi:type="string">Enabled</data> <data name="agreement/data/is_html" xsi:type="string">Text</data> - <data name="agreement/data/stores/dataSet/0" xsi:type="string">default</data> + <data name="agreement/data/stores/dataset/0" xsi:type="string">default</data> <data name="agreement/data/checkbox_text" xsi:type="string">test_checkbox%isolation%</data> <data name="agreement/data/content" xsi:type="string">TestMessage%isolation%</data> <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data> @@ -61,7 +61,7 @@ <data name="agreement/data/name" xsi:type="string">name%isolation%</data> <data name="agreement/data/is_active" xsi:type="string">Disabled</data> <data name="agreement/data/is_html" xsi:type="string">Text</data> - <data name="agreement/data/stores/dataSet/0" xsi:type="string">default</data> + <data name="agreement/data/stores/dataset/0" xsi:type="string">default</data> <data name="agreement/data/checkbox_text" xsi:type="string">test_checkbox%isolation%</data> <data name="agreement/data/content" xsi:type="string">TestMessage%isolation%</data> <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data> @@ -77,7 +77,7 @@ <data name="agreement/data/name" xsi:type="string">name%isolation%</data> <data name="agreement/data/is_active" xsi:type="string">Enabled</data> <data name="agreement/data/is_html" xsi:type="string">Text</data> - <data name="agreement/data/stores/dataSet/0" xsi:type="string">default</data> + <data name="agreement/data/stores/dataset/0" xsi:type="string">default</data> <data name="agreement/data/checkbox_text" xsi:type="string">test_checkbox%isolation%</data> <data name="agreement/data/content" xsi:type="string">TestMessage%isolation%</data> <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data> diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/DeleteTermEntityTest.php b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/DeleteTermEntityTest.php index 3b20d91b19db8727f7afffd43b8e5e74366c122c..f866638018411e21e5911b1052f93e8eef82cb1c 100644 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/DeleteTermEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/DeleteTermEntityTest.php @@ -15,7 +15,7 @@ use Magento\Mtf\TestCase\Injectable; /** * Preconditions: * 1. Enable "Terms and Conditions": Stores > Configuration > Sales > Checkout > Checkout Options. - * 2. Create term according to dataSet. + * 2. Create term according to dataset. * * Steps: * 1. Open Backend Stores > Terms and Conditions. diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/DeleteTermEntityTest.xml b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/DeleteTermEntityTest.xml index 7fb6d83370663faf308357c2ae4822a7fcbfb6a7..e13ce03265cb5927df0268758b2a2112e1940d61 100644 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/DeleteTermEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/DeleteTermEntityTest.xml @@ -9,7 +9,7 @@ <testCase name="Magento\CheckoutAgreements\Test\TestCase\DeleteTermEntityTest"> <variation name="DeleteTermEntityTestVariation1"> <data name="product" xsi:type="string">catalogProductSimple::default</data> - <data name="agreement/dataSet" xsi:type="string">term_enabled_text</data> + <data name="agreement/dataset" xsi:type="string">term_enabled_text</data> <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data> <data name="shipping/shipping_method" xsi:type="string">Fixed</data> <data name="payment/method" xsi:type="string">checkmo</data> diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/UpdateTermEntityTest.php b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/UpdateTermEntityTest.php index 50ef121fc19371645900d4366c9895d299bf9b21..eba27746e7e3d529cd4ca40a1581635bb66abb8a 100644 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/UpdateTermEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/UpdateTermEntityTest.php @@ -15,12 +15,12 @@ use Magento\Mtf\TestCase\Injectable; /** * Preconditions: * 1. Enable "Terms and Conditions": Stores > Configuration > Sales > Checkout > Checkout Options - * 2. Create term according to dataSet + * 2. Create term according to dataset * * Steps: * 1. Open Backend Stores > Terms and Conditions * 2. Open created Term from preconditions - * 3. Fill data from dataSet + * 3. Fill data from dataset * 4. Save * 5. Perform all assertions * diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/UpdateTermEntityTest.xml b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/UpdateTermEntityTest.xml index c293d7996e2a35ae0f169376cd9f05a0090004cf..e1818c9838943da9ced9b13d00ce479ac2f8f309 100644 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/UpdateTermEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/UpdateTermEntityTest.xml @@ -9,11 +9,11 @@ <testCase name="Magento\CheckoutAgreements\Test\TestCase\UpdateTermEntityTest"> <variation name="UpdateTermEntityTestVariation1"> <data name="product" xsi:type="string">catalogProductSimple::default</data> - <data name="agreementOrigin/dataSet" xsi:type="string">term_disabled_text</data> + <data name="agreementOrigin/dataset" xsi:type="string">term_disabled_text</data> <data name="agreement/data/name" xsi:type="string">name%isolation%</data> <data name="agreement/data/is_active" xsi:type="string">Enabled</data> <data name="agreement/data/is_html" xsi:type="string">HTML</data> - <data name="agreement/data/stores/dataSet/0" xsi:type="string">default</data> + <data name="agreement/data/stores/dataset/0" xsi:type="string">default</data> <data name="agreement/data/checkbox_text" xsi:type="string">test_checkbox%isolation%</data> <data name="agreement/data/content" xsi:type="string">TestMessage%isolation%</data> <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data> @@ -25,11 +25,11 @@ </variation> <variation name="UpdateTermEntityTestVariation2"> <data name="product" xsi:type="string">catalogProductSimple::default</data> - <data name="agreementOrigin/dataSet" xsi:type="string">term_disabled_html</data> + <data name="agreementOrigin/dataset" xsi:type="string">term_disabled_html</data> <data name="agreement/data/name" xsi:type="string">name%isolation%</data> <data name="agreement/data/is_active" xsi:type="string">Enabled</data> <data name="agreement/data/is_html" xsi:type="string">Text</data> - <data name="agreement/data/stores/dataSet/0" xsi:type="string">default</data> + <data name="agreement/data/stores/dataset/0" xsi:type="string">default</data> <data name="agreement/data/checkbox_text" xsi:type="string">test_checkbox%isolation%</data> <data name="agreement/data/content" xsi:type="string"><html></data> <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data> @@ -41,11 +41,11 @@ </variation> <variation name="UpdateTermEntityTestVariation3"> <data name="product" xsi:type="string">catalogProductSimple::default</data> - <data name="agreementOrigin/dataSet" xsi:type="string">term_enabled_text</data> + <data name="agreementOrigin/dataset" xsi:type="string">term_enabled_text</data> <data name="agreement/data/name" xsi:type="string">name%isolation%</data> <data name="agreement/data/is_active" xsi:type="string">Disabled</data> <data name="agreement/data/is_html" xsi:type="string">HTML</data> - <data name="agreement/data/stores/dataSet/0" xsi:type="string">default</data> + <data name="agreement/data/stores/dataset/0" xsi:type="string">default</data> <data name="agreement/data/checkbox_text" xsi:type="string">test_checkbox%isolation%</data> <data name="agreement/data/content" xsi:type="string">TestMessage%isolation%</data> <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Page/Edit/Tab/Content.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Page/Edit/Tab/Content.php index fd83e30ebbeb7d5c55e917ad11675759209857f9..a10d58ffa2dfecea82389000f734e1913c5ae5f7 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Page/Edit/Tab/Content.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Page/Edit/Tab/Content.php @@ -124,8 +124,8 @@ class Content extends Tab if (isset($fields['content_heading']['value'])) { $element->find($this->contentHeading)->setValue($fields['content_heading']['value']); } - if (isset($fields['content']['value']['widget']['preset'])) { - foreach ($fields['content']['value']['widget']['preset'] as $widget) { + if (isset($fields['content']['value']['widget']['dataset'])) { + foreach ($fields['content']['value']['widget']['dataset'] as $widget) { $this->clickInsertWidget(); $this->getWidgetBlock()->addWidget($widget); } diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockNotOnCategoryPage.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockNotOnCategoryPage.php index 96eeb2aa0d04f542ba991d9161180911681b7cd6..81f15956479ed188db635ae9aaa36e2694b8fd6f 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockNotOnCategoryPage.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockNotOnCategoryPage.php @@ -36,7 +36,7 @@ class AssertCmsBlockNotOnCategoryPage extends AbstractConstraint $category = $fixtureFactory->createByCode( 'category', [ - 'dataSet' => 'default_subcategory', + 'dataset' => 'default_subcategory', 'data' => [ 'display_mode' => 'Static block and products', 'landing_page' => $cmsBlock->getTitle(), diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockOnCategoryPage.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockOnCategoryPage.php index 2cc8650a1f924523c0c5c22dd4966f2bad642ccc..4554fe161d4e92d83851825bc51e93b58bde3207 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockOnCategoryPage.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockOnCategoryPage.php @@ -36,7 +36,7 @@ class AssertCmsBlockOnCategoryPage extends AbstractConstraint $category = $fixtureFactory->createByCode( 'category', [ - 'dataSet' => 'default_subcategory', + 'dataset' => 'default_subcategory', 'data' => [ 'display_mode' => 'Static block and products', 'landing_page' => $cmsBlock->getTitle(), diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPagePreview.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPagePreview.php index 2f8203b640e6c883490f3391b79593e4d5dfcfe6..4f96145bc6a3413ab791789f29502729fafbd20a 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPagePreview.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPagePreview.php @@ -51,7 +51,7 @@ class AssertCmsPagePreview extends AbstractConstraint 'Wrong content is displayed.' ); if (isset($fixtureContent['widget'])) { - foreach ($fixtureContent['widget']['preset'] as $widget) { + foreach ($fixtureContent['widget']['dataset'] as $widget) { \PHPUnit_Framework_Assert::assertTrue( $frontCmsPage->getCmsPageBlock()->isWidgetVisible($widget['widget_type'], $widget['anchor_text']), 'Widget \'' . $widget['widget_type'] . '\' is not displayed.' diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Fixture/CmsBlock.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/Fixture/CmsBlock.xml index 746165d67c89a7210ccc56a3e065f581fff90a75..71e66d0998b0d6085bb5635aaaa14c0c9c5673cc 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/Fixture/CmsBlock.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Fixture/CmsBlock.xml @@ -6,44 +6,21 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="cmsBlock" module="Magento_Cms" type="flat" entity_type="cms_block" collection="Magento\Cms\Model\Resource\Block\Grid\Collection" identifier="identifier" - handler_interface="Magento\Cms\Test\Handler\CmsBlock\CmsBlockInterface" repository_class="Magento\Cms\Test\Repository\CmsBlock" class="Magento\Cms\Test\Fixture\CmsBlock"> - <dataset name="default"> - <field name="title" xsi:type="string">block_%isolation%</field> - <field name="identifier" xsi:type="string">identifier_%isolation%</field> - <field name="stores" xsi:type="array"> - <item name="dataSet" xsi:type="string">All Store Views</item> - </field> - <field name="is_active" xsi:type="string">Enabled</field> - <field name="content" xsi:type="string">description_%isolation%</field> - </dataset> - <field name="block_id" is_required="1"> - <default_value xsi:type="null" /> - </field> - <field name="title" is_required=""> - <default_value xsi:type="string">block_%isolation%</default_value> - </field> - <field name="identifier" is_required=""> - <default_value xsi:type="string">identifier_%isolation%</default_value> - </field> - <field name="content" is_required=""> - <default_value xsi:type="string">description_%isolation%</default_value> - </field> - <field name="creation_time" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="update_time" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="is_active" is_required=""> - <default_value xsi:type="string">Enabled</default_value> - </field> - <field name="stores" is_required="1" source="Magento\Cms\Test\Fixture\CmsBlock\Stores"> - <default_value xsi:type="array"> - <item name="dataSet" xsi:type="array"> - <item name="0" xsi:type="string">All Store Views</item> - </item> - </default_value> - </field> + <fixture name="cmsBlock" + module="Magento_Cms" + type="flat" + entity_type="cms_block" + collection="Magento\Cms\Model\Resource\Block\Grid\Collection" + identifier="identifier" + handler_interface="Magento\Cms\Test\Handler\CmsBlock\CmsBlockInterface" + repository_class="Magento\Cms\Test\Repository\CmsBlock" class="Magento\Cms\Test\Fixture\CmsBlock"> + <field name="block_id" is_required="1" /> + <field name="title" is_required="" /> + <field name="identifier" is_required="" /> + <field name="content" is_required="" /> + <field name="creation_time" is_required="" /> + <field name="update_time" is_required="" /> + <field name="is_active" is_required="" /> + <field name="stores" is_required="1" source="Magento\Cms\Test\Fixture\CmsBlock\Stores" /> </fixture> </config> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Fixture/CmsBlock/Stores.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Fixture/CmsBlock/Stores.php index 4622537127e7ff531f67dbe09b1a06a5f4a59669..2cd890cb5555504353dd8e633345f6492f95d8fe 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/Fixture/CmsBlock/Stores.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Fixture/CmsBlock/Stores.php @@ -6,24 +6,17 @@ namespace Magento\Cms\Test\Fixture\CmsBlock; +use Magento\Mtf\Fixture\DataSource; use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Mtf\Fixture\FixtureInterface; /** * Data source for 'stores' field. * * Data keys: - * - dataSet + * - dataset */ -class Stores implements FixtureInterface +class Stores extends DataSource { - /** - * Array with store names. - * - * @var array - */ - protected $data = []; - /** * Array with store fixtures. * @@ -31,13 +24,6 @@ class Stores implements FixtureInterface */ protected $stores; - /** - * Data set configuration settings. - * - * @var array - */ - protected $params; - /** * Create custom Store if we have block with custom store view. * @@ -49,11 +35,11 @@ class Stores implements FixtureInterface public function __construct(FixtureFactory $fixtureFactory, array $params, array $data = []) { $this->params = $params; - if (isset($data['dataSet'])) { - $dataSets = is_array($data['dataSet']) ? $data['dataSet'] : [$data['dataSet']]; - foreach ($dataSets as $dataSet) { + if (isset($data['dataset'])) { + $datasets = is_array($data['dataset']) ? $data['dataset'] : [$data['dataset']]; + foreach ($datasets as $dataset) { /** @var \Magento\Store\Test\Fixture\Store $store */ - $store = $fixtureFactory->createByCode('store', ['dataSet' => $dataSet]); + $store = $fixtureFactory->createByCode('store', ['dataset' => $dataset]); if (!$store->hasData('store_id')) { $store->persist(); } @@ -65,29 +51,6 @@ class Stores implements FixtureInterface } } - /** - * Persist custom selections store view. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set. - * - * @param string|null $key [optional] - * @return array - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - /** * Return stores. * @@ -97,14 +60,4 @@ class Stores implements FixtureInterface { return $this->stores; } - - /** - * Return data set configuration settings. - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } } diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Fixture/CmsPage.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/Fixture/CmsPage.xml index 071897f0c5b13b72147ac1b674931f71e784f333..7cf7c822cf2b97e2f2559fc06110b234707adea1 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/Fixture/CmsPage.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Fixture/CmsPage.xml @@ -6,74 +6,34 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="cmsPage" module="Magento_Cms" type="flat" entity_type="cms_page" collection="Magento\Cms\Model\Resource\Page\Grid\Collection" identifier="identifier" - repository_class="Magento\Cms\Test\Repository\CmsPage" handler_interface="Magento\Cms\Test\Handler\CmsPage\CmsPageInterface" class="Magento\Cms\Test\Fixture\CmsPage"> - <dataset name="default"> - <field name="title" xsi:type="string">CMS Page%isolation%</field> - <field name="identifier" xsi:type="string">identifier%isolation%</field> - <field name="store_id" xsi:type="string">All Store Views</field> - <field name="is_actice" xsi:type="string">Enabled</field> - <field name="content" xsi:type="array"> - <item name="content" xsi:type="string">description_%isolation%</item> - </field> - </dataset> - <field name="page_id" is_required="1"> - <default_value xsi:type="null" /> - </field> - <field name="title" is_required="" group="page_information"> - <default_value xsi:type="null" /> - </field> - <field name="is_active" is_required="" group="page_information"> - <default_value xsi:type="string">Enabled</default_value> - </field> - <field name="page_layout" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="meta_keywords" is_required="" group="meta_data"> - <default_value xsi:type="null" /> - </field> - <field name="meta_description" is_required="" group="meta_data"> - <default_value xsi:type="null" /> - </field> - <field name="identifier" group="page_information" is_required=""> - <default_value xsi:type="string">identifier%isolation%</default_value> - </field> - <field name="content_heading" is_required="" group="content"> - <default_value xsi:type="null" /> - </field> - <field name="content" is_required="" group="content" source="Magento\Cms\Test\Fixture\CmsPage\Content"> - <default_value xsi:type="array"> - <item name="content" xsi:type="string">Text %isolation%</item> - </default_value> - </field> - <field name="creation_time" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="update_time" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="sort_order" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="layout_update_xml" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="custom_theme" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="custom_page_layout" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="custom_layout_update_xml" is_required=""> - <default_value xsi:type="null" /> - </field> + <fixture name="cmsPage" + module="Magento_Cms" + type="flat" + entity_type="cms_page" + collection="Magento\Cms\Model\Resource\Page\Grid\Collection" + identifier="identifier" + repository_class="Magento\Cms\Test\Repository\CmsPage" + handler_interface="Magento\Cms\Test\Handler\CmsPage\CmsPageInterface" + class="Magento\Cms\Test\Fixture\CmsPage"> + <field name="page_id" is_required="1" /> + <field name="title" is_required="" group="page_information" /> + <field name="is_active" is_required="" group="page_information" /> + <field name="page_layout" is_required="" /> + <field name="meta_keywords" is_required="" group="meta_data" /> + <field name="meta_description" is_required="" group="meta_data" /> + <field name="identifier" group="page_information" is_required="" /> + <field name="content_heading" is_required="" group="content" /> + <field name="content" is_required="" group="content" source="Magento\Cms\Test\Fixture\CmsPage\Content" repository="Magento\Cms\Test\Repository\CmsPage\Content" /> + <field name="creation_time" is_required="" /> + <field name="update_time" is_required="" /> + <field name="sort_order" is_required="" /> + <field name="layout_update_xml" is_required="" /> + <field name="custom_theme" is_required="" /> + <field name="custom_page_layout" is_required="" /> + <field name="custom_layout_update_xml" is_required="" /> <field name="custom_theme_from" source="Magento\Backend\Test\Fixture\Source\Date" /> <field name="custom_theme_to" source="Magento\Backend\Test\Fixture\Source\Date" /> - <field name="website_root" is_required=""> - <default_value xsi:type="string">1</default_value> - </field> - <field name="store_id" is_required="1" group="page_information"> - <default_value xsi:type="string">All Store Views</default_value> - </field> + <field name="website_root" is_required="" /> + <field name="store_id" is_required="1" group="page_information" /> </fixture> </config> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Fixture/CmsPage/Content.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Fixture/CmsPage/Content.php index fc3d5f72bf9c2dfe34c7b78f9524223d8eb59698..0ce3f511d5732c8cae18a3f24fc59f156a751587 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/Fixture/CmsPage/Content.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Fixture/CmsPage/Content.php @@ -6,31 +6,18 @@ namespace Magento\Cms\Test\Fixture\CmsPage; -use Magento\Catalog\Test\Fixture\Category; -use Magento\Catalog\Test\Fixture\CatalogProductSimple; +use Magento\Mtf\Fixture\DataSource; use Magento\Cms\Test\Fixture\CmsBlock; use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Mtf\Fixture\FixtureInterface; +use Magento\Catalog\Test\Fixture\Category; +use Magento\Mtf\Repository\RepositoryFactory; +use Magento\Catalog\Test\Fixture\CatalogProductSimple; /** * Prepare content for cms page. */ -class Content implements FixtureInterface +class Content extends DataSource { - /** - * Content data. - * - * @var array - */ - protected $data = []; - - /** - * Fixture params. - * - * @var array - */ - protected $params; - /** * Fixture factory. * @@ -40,31 +27,40 @@ class Content implements FixtureInterface /** * @constructor + * @param RepositoryFactory $repositoryFactory + * @param FixtureFactory $fixtureFactory * @param array $params * @param array $data - * @param FixtureFactory $fixtureFactory + * + * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ - public function __construct(FixtureFactory $fixtureFactory, array $params, array $data = []) - { + public function __construct( + RepositoryFactory $repositoryFactory, + FixtureFactory $fixtureFactory, + array $params, + array $data = [] + ) { $this->fixtureFactory = $fixtureFactory; $this->params = $params; $this->data = $data; - if (isset($data['widget']['preset'])) { - $this->data['widget']['preset'] = $this->getPreset($data['widget']['preset']); - foreach ($this->data['widget']['preset'] as $key => $widget) { + if (isset($data['widget']['dataset']) && isset($this->params['repository'])) { + $this->data['widget']['dataset'] = $repositoryFactory->get($this->params['repository'])->get( + $data['widget']['dataset'] + ); + foreach ($this->data['widget']['dataset'] as $key => $widget) { if (isset($widget['chosen_option']['category_path']) && !isset($widget['chosen_option']['filter_sku']) ) { $category = $this->createCategory($widget); $categoryName = $category->getData('name'); - $this->data['widget']['preset'][$key]['chosen_option']['category_path'] = $categoryName; + $this->data['widget']['dataset'][$key]['chosen_option']['category_path'] = $categoryName; } if (isset($widget['chosen_option']['category_path']) && isset($widget['chosen_option']['filter_sku'])) { $product = $this->createProduct($widget); $categoryName = $product->getCategoryIds()[0]['name']; $productSku = $product->getData('sku'); - $this->data['widget']['preset'][$key]['chosen_option']['category_path'] = $categoryName; - $this->data['widget']['preset'][$key]['chosen_option']['filter_sku'] = $productSku; + $this->data['widget']['dataset'][$key]['chosen_option']['category_path'] = $categoryName; + $this->data['widget']['dataset'][$key]['chosen_option']['filter_sku'] = $productSku; } if ($widget['widget_type'] == 'Catalog New Products List') { $this->createProduct(); @@ -72,7 +68,7 @@ class Content implements FixtureInterface if ($widget['widget_type'] == 'CMS Static Block') { $block = $this->createBlock($widget); $blockIdentifier = $block->getIdentifier(); - $this->data['widget']['preset'][$key]['chosen_option']['filter_identifier'] = $blockIdentifier; + $this->data['widget']['dataset'][$key]['chosen_option']['filter_identifier'] = $blockIdentifier; } } } @@ -89,7 +85,7 @@ class Content implements FixtureInterface /** @var Category $category */ $category = $this->fixtureFactory->createByCode( 'category', - ['dataSet' => $widget['chosen_option']['category_path']] + ['dataset' => $widget['chosen_option']['category_path']] ); if (!$category->hasData('id')) { $category->persist(); @@ -106,9 +102,9 @@ class Content implements FixtureInterface */ protected function createProduct($widget = null) { - $dataSet = $widget === null ? 'default' : $widget['chosen_option']['category_path']; + $dataset = $widget === null ? 'default' : $widget['chosen_option']['category_path']; /** @var CatalogProductSimple $product */ - $product = $this->fixtureFactory->createByCode('catalogProductSimple', ['dataSet' => $dataSet]); + $product = $this->fixtureFactory->createByCode('catalogProductSimple', ['dataset' => $dataset]); if (!$product->hasData('id')) { $product->persist(); } @@ -132,119 +128,4 @@ class Content implements FixtureInterface return $block; } - - /** - * 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; - } - - /** - * 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', - ], - ], - ], - 'all_widgets' => [ - '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', - ], - ], - 'widget_2' => [ - 'widget_type' => 'CMS Static Block', - 'template' => 'CMS Static Block Default Template', - 'chosen_option' => [ - 'filter_identifier' => 'cmsBlock', - ], - ], - 'widget_3' => [ - 'widget_type' => 'Catalog Category Link', - 'anchor_text' => 'Catalog Category Link anchor_text_%isolation%', - 'title' => 'Catalog Category Link anchor_title_%isolation%', - 'template' => 'Category Link Block Template', - 'chosen_option' => [ - 'category_path' => 'default_subcategory', - ], - ], - 'widget_4' => [ - 'widget_type' => 'Catalog New Products List', - 'display_type' => 'All products', - 'show_pager' => 'Yes', - 'products_count' => 10, - 'template' => 'New Products Grid Template', - 'cache_lifetime' => 86400, - ], - 'widget_5' => [ - 'widget_type' => 'Catalog Product Link', - 'anchor_text' => 'Catalog Product Link anchor_text_%isolation%', - 'title' => 'Catalog Product Link anchor_title_%isolation%', - 'template' => 'Product Link Block Template', - 'chosen_option' => [ - 'category_path' => 'product_with_category', - 'filter_sku' => 'product_with_category', - ], - ], - 'widget_6' => [ - 'widget_type' => 'Recently Compared Products', - 'page_size' => 10, - 'template' => 'Compared Products Grid Template', - ], - 'widget_7' => [ - 'widget_type' => 'Recently Viewed Products', - 'page_size' => 10, - 'template' => 'Viewed Products Grid Template', - ], - ], - ]; - if (!isset($presets[$name])) { - return null; - } - return $presets[$name]; - } } diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Repository/CmsBlock.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/Repository/CmsBlock.xml index 81f9f676fe986eabfdcf044a7eabfe490f176142..3c025006873c931777a6883129379f2ca8ec21ac 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/Repository/CmsBlock.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Repository/CmsBlock.xml @@ -11,8 +11,8 @@ <field name="title" xsi:type="string">block_%isolation%</field> <field name="identifier" xsi:type="string">identifier_%isolation%</field> <field name="stores" xsi:type="array"> - <item name="dataSet" xsi:type="array"> - <item name="0" xsi:type="string">All Store Views</item> + <item name="dataset" xsi:type="array"> + <item name="0" xsi:type="string">all_store_views</item> </item> </field> <field name="is_active" xsi:type="string">Enabled</field> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Repository/CmsPage/Content.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/Repository/CmsPage/Content.xml new file mode 100644 index 0000000000000000000000000000000000000000..c0ba39affa9c1a943216487690178b9d4ca47128 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Repository/CmsPage/Content.xml @@ -0,0 +1,78 @@ +<?xml version="1.0" ?> +<!-- +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> + <repository class="Magento\Cms\Test\Repository\CmsPage\Content"> + <dataset name="default"> + <field name="widget_1" xsi:type="array"> + <item name="widget_type" xsi:type="string">CMS Page Link</item> + <item name="anchor_text" xsi:type="string">CMS Page Link anchor_text_%isolation%</item> + <item name="title" xsi:type="string">CMS Page Link anchor_title_%isolation%</item> + <item name="template" xsi:type="string">CMS Page Link Block Template</item> + <item name="chosen_option" xsi:type="array"> + <item name="filter_url_key" xsi:type="string">home</item> + </item> + </field> + </dataset> + + <dataset name="all_widgets"> + <field name="widget_1" xsi:type="array"> + <item name="widget_type" xsi:type="string">CMS Page Link</item> + <item name="anchor_text" xsi:type="string">CMS Page Link anchor_text_%isolation%</item> + <item name="title" xsi:type="string">CMS Page Link anchor_title_%isolation%</item> + <item name="template" xsi:type="string">CMS Page Link Block Template</item> + <item name="chosen_option" xsi:type="array"> + <item name="filter_url_key" xsi:type="string">home</item> + </item> + </field> + <field name="widget_2" xsi:type="array"> + <item name="widget_type" xsi:type="string">CMS Static Block</item> + <item name="template" xsi:type="string">CMS Static Block Default Template</item> + <item name="chosen_option" xsi:type="array"> + <item name="filter_url_key" xsi:type="string">cmsBlock</item> + </item> + </field> + <field name="widget_3" xsi:type="array"> + <item name="widget_type" xsi:type="string">Catalog Category Link</item> + <item name="anchor_text" xsi:type="string">Catalog Category Link anchor_text_%isolation%</item> + <item name="title" xsi:type="string">Catalog Category Link anchor_title_%isolation%</item> + <item name="template" xsi:type="string">Category Link Block Template</item> + <item name="chosen_option" xsi:type="array"> + <item name="filter_url_key" xsi:type="string">default_subcategory</item> + </item> + </field> + <field name="widget_4" xsi:type="array"> + <item name="widget_type" xsi:type="string">Catalog New Products List</item> + <item name="display_type" xsi:type="string">All products</item> + <item name="show_pager" xsi:type="string">Yes</item> + <item name="products_count" xsi:type="string">10</item> + <item name="template" xsi:type="string">New Products Grid Template</item> + <item name="cache_lifetime" xsi:type="string">86400</item> + </field> + <field name="widget_5" xsi:type="array"> + <item name="widget_type" xsi:type="string">Catalog Product Link</item> + <item name="anchor_text" xsi:type="string">Catalog Product Link anchor_text_%isolation%</item> + <item name="title" xsi:type="string">Catalog Product Link anchor_title_%isolation%</item> + <item name="template" xsi:type="string">Product Link Block Template</item> + <item name="chosen_option" xsi:type="array"> + <item name="category_path" xsi:type="string">product_with_category</item> + <item name="filter_sku" xsi:type="string">product_with_category</item> + </item> + </field> + <field name="widget_6" xsi:type="array"> + <item name="widget_type" xsi:type="string">Recently Compared Products</item> + <item name="page_size" xsi:type="string">10</item> + <item name="template" xsi:type="string">Compared Products Grid Template</item> + </field> + <field name="widget_7" xsi:type="array"> + <item name="widget_type" xsi:type="string">Recently Viewed Products</item> + <item name="page_size" xsi:type="string">10</item> + <item name="template" xsi:type="string">Viewed Products Grid Template</item> + </field> + </dataset> + </repository> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsBlockEntityTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsBlockEntityTest.xml index a6fb5bb04526031f8a9e828ea496e769bde0590b..3527279c5c98d8b0ba1a1edcbc30ee37976a8291 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsBlockEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsBlockEntityTest.xml @@ -10,7 +10,7 @@ <variation name="CreateCmsBlockEntityTestVariation1"> <data name="cmsBlock/data/title" xsi:type="string">block_%isolation%</data> <data name="cmsBlock/data/identifier" xsi:type="string">identifier_%isolation%</data> - <data name="cmsBlock/data/stores/dataSet/option_0" xsi:type="string">All Store Views</data> + <data name="cmsBlock/data/stores/dataset/option_0" xsi:type="string">All Store Views</data> <data name="cmsBlock/data/is_active" xsi:type="string">Enabled</data> <data name="cmsBlock/data/content" xsi:type="string">description_%isolation%</data> <constraint name="Magento\Cms\Test\Constraint\AssertCmsBlockSuccessSaveMessage" /> @@ -20,7 +20,7 @@ <variation name="CreateCmsBlockEntityTestVariation2"> <data name="cmsBlock/data/title" xsi:type="string">block_%isolation%</data> <data name="cmsBlock/data/identifier" xsi:type="string">identifier_%isolation%</data> - <data name="cmsBlock/data/stores/dataSet/option_0" xsi:type="string">default</data> + <data name="cmsBlock/data/stores/dataset/option_0" xsi:type="string">default</data> <data name="cmsBlock/data/is_active" xsi:type="string">Disabled</data> <data name="cmsBlock/data/content" xsi:type="string">description_%isolation%</data> <constraint name="Magento\Cms\Test\Constraint\AssertCmsBlockSuccessSaveMessage" /> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.xml index a549ca390d66817d3c7a2c64590aaa833bd1ed8a..fd63c140b0c9163db7f8b54cc6a866c5d4b89144 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.xml @@ -34,7 +34,7 @@ <data name="data/title" xsi:type="string">NewCmsPage%isolation%</data> <data name="data/store_id" xsi:type="string">Main Website/Main Website Store/Default Store View</data> <data name="data/content/content" xsi:type="string">cms_page_text_content%isolation%</data> - <data name="data/content/widget/preset" xsi:type="string">default</data> + <data name="data/content/widget/dataset" xsi:type="string">default</data> <data name="data/content/variable" xsi:type="string">General Contact Name</data> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageSuccessSaveMessage" /> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageForm" /> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageEntityTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageEntityTest.xml index 78dd465ad2b65d302b9e2f8d8786a7081b3dce64..b317224b3c164c1738e26bc5dda9ac2107b34d66 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageEntityTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Cms\Test\TestCase\DeleteCmsPageEntityTest"> <variation name="DeleteCmsPageEntityTestVariation1"> - <data name="cmsPage/dataSet" xsi:type="string">default</data> + <data name="cmsPage/dataset" xsi:type="string">default</data> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageDeleteMessage" /> <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageNotInGrid" /> </variation> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageUrlRewriteEntityTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageUrlRewriteEntityTest.xml index 86128fd3a6411d2f0a9564c4d084b984079d02a2..9ff1187200f24d525ced2dbd33b3462148a456bd 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageUrlRewriteEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageUrlRewriteEntityTest.xml @@ -8,19 +8,19 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Cms\Test\TestCase\DeleteCmsPageUrlRewriteEntityTest"> <variation name="DeleteCmsPageUrlRewriteEntityTestVariation1"> - <data name="urlRewrite/dataSet" xsi:type="string">cms_default_no_redirect</data> + <data name="urlRewrite/dataset" xsi:type="string">cms_default_no_redirect</data> <constraint name="Magento\UrlRewrite\Test\Constraint\AssertUrlRewriteDeletedMessage" /> <constraint name="Magento\UrlRewrite\Test\Constraint\AssertUrlRewriteNotInGrid" /> <constraint name="Magento\UrlRewrite\Test\Constraint\AssertPageByUrlRewriteIsNotFound" /> </variation> <variation name="DeleteCmsPageUrlRewriteEntityTestVariation2"> - <data name="urlRewrite/dataSet" xsi:type="string">cms_default_permanent_redirect</data> + <data name="urlRewrite/dataset" xsi:type="string">cms_default_permanent_redirect</data> <constraint name="Magento\UrlRewrite\Test\Constraint\AssertUrlRewriteDeletedMessage" /> <constraint name="Magento\UrlRewrite\Test\Constraint\AssertUrlRewriteNotInGrid" /> <constraint name="Magento\UrlRewrite\Test\Constraint\AssertPageByUrlRewriteIsNotFound" /> </variation> <variation name="DeleteCmsPageUrlRewriteEntityTestVariation3"> - <data name="urlRewrite/dataSet" xsi:type="string">cms_default_temporary_redirect</data> + <data name="urlRewrite/dataset" xsi:type="string">cms_default_temporary_redirect</data> <constraint name="Magento\UrlRewrite\Test\Constraint\AssertUrlRewriteDeletedMessage" /> <constraint name="Magento\UrlRewrite\Test\Constraint\AssertUrlRewriteNotInGrid" /> <constraint name="Magento\UrlRewrite\Test\Constraint\AssertPageByUrlRewriteIsNotFound" /> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsBlockEntityTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsBlockEntityTest.xml index 048ff19fc06e9c2126be6cf5113afdaaa5349c9a..1aa116123698a49fe298ec50c69eb9ef61a8cce7 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsBlockEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsBlockEntityTest.xml @@ -10,7 +10,7 @@ <variation name="UpdateCmsBlockEntityTestVariation1"> <data name="cmsBlock/data/title" xsi:type="string">block_updated_%isolation%</data> <data name="cmsBlock/data/identifier" xsi:type="string">identifier_updated_%isolation%</data> - <data name="cmsBlock/data/stores/dataSet/option_0" xsi:type="string">All Store Views</data> + <data name="cmsBlock/data/stores/dataset/option_0" xsi:type="string">all_store_views</data> <data name="cmsBlock/data/is_active" xsi:type="string">Enabled</data> <data name="cmsBlock/data/content" xsi:type="string">description_updated_%isolation%</data> <constraint name="Magento\Cms\Test\Constraint\AssertCmsBlockSuccessSaveMessage" /> @@ -20,7 +20,7 @@ <variation name="UpdateCmsBlockEntityTestVariation2"> <data name="cmsBlock/data/title" xsi:type="string">block_updated_%isolation%</data> <data name="cmsBlock/data/identifier" xsi:type="string">identifier_updated_%isolation%</data> - <data name="cmsBlock/data/stores/dataSet/option_0" xsi:type="string">default</data> + <data name="cmsBlock/data/stores/dataset/option_0" xsi:type="string">default</data> <data name="cmsBlock/data/is_active" xsi:type="string">Disabled</data> <data name="cmsBlock/data/content" xsi:type="string">description_updated_%isolation%</data> <constraint name="Magento\Cms\Test\Constraint\AssertCmsBlockSuccessSaveMessage" /> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageRewriteEntityTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageRewriteEntityTest.xml index ebf6cc9116491916eb95a74a55217360e6987cc9..f03d64ae76aebb60ceef267be53598e4b3159421 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageRewriteEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageRewriteEntityTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Cms\Test\TestCase\UpdateCmsPageRewriteEntityTest"> <variation name="UpdateCmsPageRewriteEntityTestVariation1"> - <data name="cmsPageRewrite/dataSet" xsi:type="string">cms_default_no_redirect</data> + <data name="cmsPageRewrite/dataset" xsi:type="string">cms_default_no_redirect</data> <data name="urlRewrite/data/store_id" xsi:type="string">Main Website/Main Website Store/%default%</data> <data name="urlRewrite/data/request_path" xsi:type="string">request_path%isolation%</data> <data name="urlRewrite/data/redirect_type" xsi:type="string">No</data> @@ -17,7 +17,7 @@ <constraint name="Magento\Cms\Test\Constraint\AssertUrlRewriteCmsPageRedirect" /> </variation> <variation name="UpdateCmsPageRewriteEntityTestVariation2"> - <data name="cmsPageRewrite/dataSet" xsi:type="string">cms_default_temporary_redirect</data> + <data name="cmsPageRewrite/dataset" xsi:type="string">cms_default_temporary_redirect</data> <data name="urlRewrite/data/store_id" xsi:type="string">Main Website/Main Website Store/Default Store View</data> <data name="urlRewrite/data/request_path" xsi:type="string">request_path%isolation%.html</data> <data name="urlRewrite/data/redirect_type" xsi:type="string">Temporary (302)</data> @@ -26,7 +26,7 @@ <constraint name="Magento\Cms\Test\Constraint\AssertUrlRewriteCmsPageRedirect" /> </variation> <variation name="UpdateCmsPageRewriteEntityTestVariation3"> - <data name="cmsPageRewrite/dataSet" xsi:type="string">cms_default_permanent_redirect</data> + <data name="cmsPageRewrite/dataset" xsi:type="string">cms_default_permanent_redirect</data> <data name="urlRewrite/data/store_id" xsi:type="string">Main Website/Main Website Store/Default Store View</data> <data name="urlRewrite/data/request_path" xsi:type="string">request_path%isolation%.htm</data> <data name="urlRewrite/data/redirect_type" xsi:type="string">Permanent (301)</data> diff --git a/dev/tests/functional/tests/app/Magento/Config/Test/Fixture/ConfigData.xml b/dev/tests/functional/tests/app/Magento/Config/Test/Fixture/ConfigData.xml index 564a0942002ee7f0c4b00132dbce97660ee494c2..d3f1fd8c407b01297bd7385273a0251475c08747 100644 --- a/dev/tests/functional/tests/app/Magento/Config/Test/Fixture/ConfigData.xml +++ b/dev/tests/functional/tests/app/Magento/Config/Test/Fixture/ConfigData.xml @@ -15,20 +15,10 @@ handler_interface="Magento\Config\Test\Handler\ConfigData\ConfigDataInterface" class="Magento\Config\Test\Fixture\ConfigData"> <field name="section" /> - <field name="config_id" is_required="1"> - <default_value xsi:type="null" /> - </field> - <field name="scope" is_required=""> - <default_value xsi:type="string">default</default_value> - </field> - <field name="scope_id" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="path" is_required=""> - <default_value xsi:type="string">general</default_value> - </field> - <field name="value" is_required=""> - <default_value xsi:type="null" /> - </field> + <field name="config_id" is_required="1" /> + <field name="scope" is_required="" /> + <field name="scope_id" is_required="" /> + <field name="path" is_required="" /> + <field name="value" is_required="" /> </fixture> </config> diff --git a/dev/tests/functional/tests/app/Magento/Config/Test/TestStep/SetupConfigurationStep.php b/dev/tests/functional/tests/app/Magento/Config/Test/TestStep/SetupConfigurationStep.php index 81cd63e33bc184c7e12356ba579fa6557a648f9a..4922dba6247dfea3f682536100ac4c81862c34f6 100644 --- a/dev/tests/functional/tests/app/Magento/Config/Test/TestStep/SetupConfigurationStep.php +++ b/dev/tests/functional/tests/app/Magento/Config/Test/TestStep/SetupConfigurationStep.php @@ -66,7 +66,7 @@ class SetupConfigurationStep implements TestStepInterface $result = []; foreach ($configData as $configDataSet) { - $config = $this->fixtureFactory->createByCode('configData', ['dataSet' => $configDataSet . $prefix]); + $config = $this->fixtureFactory->createByCode('configData', ['dataset' => $configDataSet . $prefix]); if ($config->hasData('section')) { $config->persist(); $result[] = $config; diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Matrix.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Matrix.php index 8ecdc5aa867ac14b09de37a8dfc480144d468b6f..49957a1509f639db4d62177dd93a28fa7c29bffc 100755 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Matrix.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Matrix.php @@ -117,6 +117,35 @@ class Matrix extends Form } } + /** + * Fill form data. + * + * @param array $fields + * @param SimpleElement|null $element + * @return void + * @throws \Exception + */ + protected function _fill(array $fields, SimpleElement $element = null) + { + $context = ($element === null) ? $this->_rootElement : $element; + foreach ($fields as $name => $field) { + if (!isset($field['value'])) { + $this->_fill($field, $context); + } else { + $element = $this->getElement($context, $field); + if (!$element->isVisible()) { + continue; + } + + if (!$element->isDisabled()) { + $element->setValue($field['value']); + } else { + throw new \Exception("Unable to set value to field '$name' as it's disabled."); + } + } + } + } + /** * Assign product to variation matrix * diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/Cart/Item.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/Cart/Item.php index 1e6169606f5e1ba058e5a6ec66143bdb075790c9..546fdedabdd48b9344691e9f004844e9c0c0f23d 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/Cart/Item.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/Cart/Item.php @@ -10,8 +10,7 @@ use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProduct; use Magento\Mtf\Fixture\FixtureInterface; /** - * Class Item - * Data for verify cart item block on checkout page + * Data for verify cart item block on checkout page. * * Data keys: * - product (fixture data for verify) @@ -42,11 +41,11 @@ class Item extends \Magento\Catalog\Test\Fixture\Cart\Item $checkoutConfigurableOptions[$key] = [ 'title' => isset($attributesData[$attribute]['label']) - ? $attributesData[$attribute]['label'] - : $attribute, + ? $attributesData[$attribute]['label'] + : $attribute, 'value' => isset($attributesData[$attribute]['options'][$option]['label']) - ? $attributesData[$attribute]['options'][$option]['label'] - : $option, + ? $attributesData[$attribute]['options'][$option]['label'] + : $option, ]; } @@ -55,37 +54,4 @@ class Item extends \Magento\Catalog\Test\Fixture\Cart\Item : $checkoutConfigurableOptions; $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/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProduct.xml b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProduct.xml index 6eb5ee6976ace67bf42136395b5894d354f7618c..64d4c230aaf72f698bb1f39872d74757f4c0f6dc 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProduct.xml +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProduct.xml @@ -6,226 +6,86 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="configurableProduct" - module="Magento_ConfigurableProduct" - type="eav" - entity_type="catalog_product" - product_type="configurable" - collection="Magento\Catalog\Model\Resource\Product\Collection" - identifier="sku" - repository_class="Magento\ConfigurableProduct\Test\Repository\ConfigurableProduct" - handler_interface="Magento\ConfigurableProduct\Test\Handler\ConfigurableProduct\ConfigurableProductInterface" - class="Magento\ConfigurableProduct\Test\Fixture\ConfigurableProduct"> - <dataset name="default"> - <field name="name" xsi:type="string">Configurable Product %isolation%</field> - <field name="sku" xsi:type="string">sku_configurable_product_%isolation%</field> - <field name="type_id" xsi:type="string">configurable</field> - <field name="url_key" xsi:type="string">configurable-product-%isolation%</field> - <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> - </field> - <field name="website_ids" xsi:type="array"> - <item name="0" xsi:type="string">Main Website</item> - </field> - <field name="price" xsi:type="array"> - <item name="value" xsi:type="string">100.00</item> - </field> - <field name="weight" xsi:type="string">1</field> - <field name="quantity_and_stock_status" xsi:type="array"> - <item name="is_in_stock" xsi:type="string">In Stock</item> - </field> - <field name="configurable_attributes_data" xsi:type="array"> - <item name="preset" xsi:type="string">default</item> - </field> - </dataset> - <data_config> - <item name="type_id" xsi:type="string">configurable</item> - <item name="create_url_params" xsi:type="array"> - <item name="type" xsi:type="string">configurable</item> - <item name="set" xsi:type="string">4</item> - </item> - <item name="input_prefix" xsi:type="string">product</item> - </data_config> - <field name="category_ids" is_required="0" group="product-details" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\CategoryIds"> - <default_value xsi:type="null"/> - </field> - <field name="color" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="country_of_manufacture" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="created_at" is_required="1"> - <default_value xsi:type="null"/> - </field> - <field name="custom_design" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="custom_design_from" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="custom_design_to" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="custom_layout_update" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="description" is_required="0" group="product-details"> - <default_value xsi:type="null"/> - </field> - <field name="enable_googlecheckout" is_required="0"> - <default_value xsi:type="string">No</default_value> - </field> - <field name="gallery" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="gift_message_available" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="group_price" is_required="0" group="advanced-pricing" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\GroupPriceOptions"> - <default_value xsi:type="null"/> - </field> - <field name="has_options" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="image" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="image_label" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="manufacturer" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="media_gallery" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="meta_description" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="meta_keyword" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="meta_title" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="minimal_price" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="msrp" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="msrp_display_actual_price_type" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="name" is_required="1" group="product-details"> - <default_value xsi:type="string">Configurable Product %isolation%</default_value> - </field> - <field name="news_from_date" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="news_to_date" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="old_id" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="options_container" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="page_layout" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="price" is_required="1" group="product-details" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\Price"> - <default_value xsi:type="array"> - <item name="value" xsi:type="number">100</item> - </default_value> - </field> - <field name="quantity_and_stock_status" is_required="0" group="product-details"> - <default_value xsi:type="array"> - <item name="is_in_stock" xsi:type="string">In Stock</item> - </default_value> - </field> - <field name="required_options" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="short_description" is_required="0" group="autosettings"> - <default_value xsi:type="null"/> - </field> - <field name="sku" is_required="1" group="product-details"> - <default_value xsi:type="string">sku_configurable_product_%isolation%</default_value> - </field> - <field name="small_image" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="small_image_label" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="special_from_date" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="special_price" is_required="0" group="advanced-pricing"> - <default_value xsi:type="null"/> - </field> - <field name="special_to_date" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="status" is_required="0" group="product-details"> - <default_value xsi:type="string">Product online</default_value> - </field> - <field name="tax_class_id" is_required="0" group="product-details" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\TaxClass"> - <default_value xsi:type="string">Taxable Goods</default_value> - </field> - <field name="thumbnail" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="thumbnail_label" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="tier_price" is_required="0" group="advanced-pricing" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\TierPriceOptions"> - <default_value xsi:type="null"/> - </field> - <field name="updated_at" is_required="1"> - <default_value xsi:type="null"/> - </field> - <field name="url_key" is_required="0" group="search-engine-optimization"> - <default_value xsi:type="string">configurable-product-%isolation%</default_value> - </field> - <field name="url_path" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="visibility" is_required="0" group="autosettings"> - <default_value xsi:type="string">Catalog, Search</default_value> - </field> - <field name="weight" is_required="0" group="product-details"> - <default_value xsi:type="string">1</default_value> - </field> - <field name="is_virtual" group="product-details"/> - <field name="id"/> - <field name="type_id" group="null"> - <default_value xsi:type="string">configurable</default_value> - </field> - <field name="attribute_set_id" group="product-details" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\AttributeSetId"> - <default_value xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> - </default_value> - </field> - <field name="attribute_set_name" group="variations"/> - <field name="affected_attribute_set" group="null"/> - <field name="custom_options" is_required="0" group="customer-options" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\CustomOptions"/> - <field name="configurable_attributes_data" is_required="0" group="variations" source="Magento\ConfigurableProduct\Test\Fixture\ConfigurableProduct\ConfigurableAttributesData"> - <default_value xsi:type="array"> - <item name="preset" xsi:type="string">default</item> - </default_value> - </field> - <field name="website_ids" group="websites"> - <default_value xsi:type="array"> - <item name="0" xsi:type="string">Main Website</item> - </default_value> - </field> - <field name="checkout_data" group="null" source="Magento\ConfigurableProduct\Test\Fixture\ConfigurableProduct\CheckoutData"/> - <field name="up_sell_products" group="upsells" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\UpSellProducts"/> - <field name="cross_sell_products" group="crosssells" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\CrossSellProducts"/> - <field name="related_products" group="related-products" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\RelatedProducts"/> - </fixture> + <fixture name="configurableProduct" + module="Magento_ConfigurableProduct" + type="eav" + entity_type="catalog_product" + product_type="configurable" + collection="Magento\Catalog\Model\Resource\Product\Collection" + identifier="sku" + repository_class="Magento\ConfigurableProduct\Test\Repository\ConfigurableProduct" + handler_interface="Magento\ConfigurableProduct\Test\Handler\ConfigurableProduct\ConfigurableProductInterface" + class="Magento\ConfigurableProduct\Test\Fixture\ConfigurableProduct"> + <data_config> + <item name="type_id" xsi:type="string">configurable</item> + <item name="create_url_params" xsi:type="array"> + <item name="type" xsi:type="string">configurable</item> + <item name="set" xsi:type="string">4</item> + </item> + <item name="input_prefix" xsi:type="string">product</item> + </data_config> + <field name="category_ids" is_required="0" group="product-details" source="Magento\Catalog\Test\Fixture\Product\CategoryIds" /> + <field name="color" is_required="0" /> + <field name="country_of_manufacture" is_required="0" /> + <field name="created_at" is_required="1" /> + <field name="custom_design" is_required="0" /> + <field name="custom_design_from" is_required="0" /> + <field name="custom_design_to" is_required="0" /> + <field name="custom_layout_update" is_required="0" /> + <field name="description" is_required="0" group="product-details" /> + <field name="enable_googlecheckout" is_required="0" /> + <field name="gallery" is_required="0" /> + <field name="gift_message_available" is_required="0" /> + <field name="group_price" is_required="0" group="advanced-pricing" repository="Magento\Catalog\Test\Repository\Product\GroupPriceOptions" /> + <field name="has_options" is_required="0" /> + <field name="image" is_required="0" /> + <field name="image_label" is_required="0" /> + <field name="manufacturer" is_required="0" /> + <field name="media_gallery" is_required="0" /> + <field name="meta_description" is_required="0" /> + <field name="meta_keyword" is_required="0" /> + <field name="meta_title" is_required="0" /> + <field name="minimal_price" is_required="0" /> + <field name="msrp" is_required="0" /> + <field name="msrp_display_actual_price_type" is_required="0" /> + <field name="name" is_required="1" group="product-details" /> + <field name="news_from_date" is_required="0" /> + <field name="news_to_date" is_required="0" /> + <field name="old_id" is_required="0" /> + <field name="options_container" is_required="0" /> + <field name="page_layout" is_required="0" /> + <field name="price" is_required="1" group="product-details" source="Magento\Catalog\Test\Fixture\Product\Price" /> + <field name="quantity_and_stock_status" is_required="0" group="product-details" /> + <field name="required_options" is_required="0" /> + <field name="short_description" is_required="0" group="autosettings" /> + <field name="sku" is_required="1" group="product-details" /> + <field name="small_image" is_required="0" /> + <field name="small_image_label" is_required="0" /> + <field name="special_from_date" is_required="0" /> + <field name="special_price" is_required="0" group="advanced-pricing" /> + <field name="special_to_date" is_required="0" /> + <field name="status" is_required="0" group="product-details" /> + <field name="tax_class_id" is_required="0" group="product-details" source="Magento\Catalog\Test\Fixture\Product\TaxClass" /> + <field name="thumbnail" is_required="0" /> + <field name="thumbnail_label" is_required="0" /> + <field name="tier_price" is_required="0" group="advanced-pricing" repository="Magento\Catalog\Test\Repository\Product\TierPrice" /> + <field name="updated_at" is_required="1" /> + <field name="url_key" is_required="0" group="search-engine-optimization" /> + <field name="url_path" is_required="0" /> + <field name="visibility" is_required="0" group="autosettings" /> + <field name="weight" is_required="0" group="product-details" /> + <field name="is_virtual" group="product-details" /> + <field name="id" /> + <field name="type_id" group="null" /> + <field name="attribute_set_id" group="product-details" source="Magento\Catalog\Test\Fixture\Product\AttributeSetId" /> + <field name="attribute_set_name" group="variations" /> + <field name="affected_attribute_set" group="null" /> + <field name="custom_options" is_required="0" group="customer-options" source="Magento\Catalog\Test\Fixture\Product\CustomOptions" repository="Magento\Catalog\Test\Repository\Product\CustomOptions" /> + <field name="configurable_attributes_data" is_required="0" group="variations" source="Magento\ConfigurableProduct\Test\Fixture\ConfigurableProduct\ConfigurableAttributesData" repository="Magento\ConfigurableProduct\Test\Repository\ConfigurableProduct\ConfigurableAttributesData" /> + <field name="website_ids" group="websites" /> + <field name="checkout_data" group="null" repository="Magento\ConfigurableProduct\Test\Repository\ConfigurableProduct\CheckoutData" /> + <field name="up_sell_products" group="upsells" source="Magento\Catalog\Test\Fixture\Product\RelatedProducts" /> + <field name="cross_sell_products" group="crosssells" source="Magento\Catalog\Test\Fixture\Product\RelatedProducts" /> + <field name="related_products" group="related-products" source="Magento\Catalog\Test\Fixture\Product\RelatedProducts" /> + </fixture> </config> diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProduct/CheckoutData.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProduct/CheckoutData.php deleted file mode 100644 index 74df30ef1f8aaa67c57f6aa7ef898a3e34d1017d..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProduct/CheckoutData.php +++ /dev/null @@ -1,219 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\ConfigurableProduct\Test\Fixture\ConfigurableProduct; - -/** - * Data for fill product form on frontend. - * - * Data keys: - * - preset (Checkout data verification preset name). - */ -class CheckoutData extends \Magento\Catalog\Test\Fixture\CatalogProductSimple\CheckoutData -{ - /** - * Get preset array. - * - * @param $name - * @return array|null - * - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) - */ - protected function getPreset($name) - { - $presets = [ - 'default' => [ - 'options' => [ - 'configurable_options' => [ - [ - 'title' => 'attribute_key_0', - 'value' => 'option_key_0', - ], - [ - 'title' => 'attribute_key_1', - 'value' => 'option_key_1', - ], - ], - ], - 'qty' => 3, - 'cartItem' => [ - 'price' => 172, - 'qty' => 3, - 'subtotal' => 516, - ], - ], - 'forUpdateMiniShoppingCart' => [ - 'options' => [ - 'configurable_options' => [ - [ - 'title' => 'attribute_key_0', - 'value' => 'option_key_1', - ], - [ - 'title' => 'attribute_key_1', - 'value' => 'option_key_0', - ], - ], - ], - 'qty' => 1, - 'cartItem' => [ - 'price' => 172, - 'qty' => 1, - 'subtotal' => 172, - ], - ], - 'two_options' => [ - 'options' => [ - 'configurable_options' => [ - [ - 'title' => 'attribute_key_0', - 'value' => 'option_key_0', - ], - ], - ], - 'cartItem' => [ - 'price' => 101, - ], - ], - 'two_new_options' => [ - 'options' => [ - 'configurable_options' => [ - [ - 'title' => 'attribute_key_0', - 'value' => 'option_key_1', - ], - ], - ], - 'cartItem' => [ - 'price' => 102, - ], - ], - 'two_attributes' => [ - 'options' => [ - 'configurable_options' => [ - [ - 'title' => 'attribute_key_0', - 'value' => 'option_key_0', - ], - [ - 'title' => 'attribute_key_1', - 'value' => 'option_key_0', - ], - ], - ], - 'cartItem' => [ - 'price' => 112, - ], - ], - 'three_attributes' => [ - 'options' => [ - 'configurable_options' => [ - [ - 'title' => 'attribute_key_0', - 'value' => 'option_key_0', - ], - [ - 'title' => 'attribute_key_1', - 'value' => 'option_key_0', - ], - [ - 'title' => 'attribute_key_2', - 'value' => 'option_key_0', - ], - ], - ], - 'cartItem' => [ - 'price' => 112, - ], - ], - 'two_new_options_with_special_price' => [ - 'options' => [ - 'configurable_options' => [ - [ - 'title' => 'attribute_key_0', - 'value' => 'option_key_1', - ], - ], - ], - 'cartItem' => [ - 'price' => 12, - ], - ], - 'two_options_with_assigned_product' => [ - 'options' => [ - 'configurable_options' => [ - [ - 'title' => 'attribute_key_0', - 'value' => 'option_key_0', - ], - ], - ], - 'cartItem' => [ - 'price' => 101, - ], - ], - 'with_one_option' => [ - 'options' => [ - 'configurable_options' => [ - [ - 'title' => 'attribute_key_0', - 'value' => 'option_key_0', - ], - ], - ], - 'qty' => 1, - //TODO: adopt fixture MAGETWO-40002 - 'cartItem' => [ - 'price' => 11, - 'qty' => 1, - 'subtotal' => 10, - ], - ], - 'with_special_price' => [ - 'options' => [ - 'configurable_options' => [ - [ - 'title' => 'attribute_key_0', - 'value' => 'option_key_0', - ], - ], - ], - 'qty' => 1, - 'cartItem' => [ - 'price' => 10, - 'qty' => 1, - 'subtotal' => 10, - ], - ], - 'two_options_with_fixed_price' => [ - 'options' => [ - 'configurable_options' => [ - [ - 'title' => 'attribute_key_0', - 'value' => 'option_key_1', - ], - ], - ], - 'qty' => 1, - ], - 'two_options_by_one_dollar' => [ - 'options' => [ - 'configurable_options' => [ - [ - 'title' => 'attribute_key_0', - 'value' => 'option_key_0', - ], - ], - ], - 'cartItem' => [ - 'price' => 11, - ], - 'qty' => 1, - ] - ]; - return isset($presets[$name]) ? $presets[$name] : null; - } -} diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProduct/ConfigurableAttributesData.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProduct/ConfigurableAttributesData.php index d8f80f360ac9a57e2943ac09dd7dfe7d8da71b72..79ed15ba3836a109458725bf54ce0257bf72fdc3 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProduct/ConfigurableAttributesData.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProduct/ConfigurableAttributesData.php @@ -6,805 +6,75 @@ namespace Magento\ConfigurableProduct\Test\Fixture\ConfigurableProduct; -use Magento\Catalog\Test\Fixture\CatalogProductAttribute; -use Magento\Catalog\Test\Fixture\CatalogProductSimple; +use Magento\Mtf\Fixture\DataSource; use Magento\Mtf\Fixture\FixtureFactory; use Magento\Mtf\Fixture\FixtureInterface; use Magento\Mtf\Fixture\InjectableFixture; +use Magento\Mtf\Repository\RepositoryFactory; +use Magento\Catalog\Test\Fixture\CatalogProductSimple; /** - * Class ConfigurableAttributesData - * Source configurable attributes data of the configurable products + * Source configurable attributes data of the configurable products. */ -class ConfigurableAttributesData implements FixtureInterface +class ConfigurableAttributesData extends DataSource { /** - * Fixture factory + * Fixture factory. * * @var FixtureFactory */ protected $fixtureFactory; /** - * Data set configuration settings - * - * @var array - */ - protected $params; - - /** - * Prepared dataSet data - * - * @var array - */ - protected $data = []; - - /** - * Prepared attributes data + * Prepared attributes data. * * @var array */ protected $attributesData = []; /** - * Prepared variation matrix + * Prepared variation matrix. * * @var array */ protected $variationsMatrix = []; /** - * Prepared attributes + * Prepared attributes. * * @var array */ protected $attributes = []; /** - * Prepared products + * Prepared products. * * @var array */ protected $products = []; - /** - * Presets data - * - * @var array - */ - protected $presets = [ - 'default' => [ - 'attributes_data' => [ - 'attribute_key_0' => [ - 'options' => [ - 'option_key_0' => [ - 'pricing_value' => 12.00, - 'include' => 'Yes', - 'is_percent' => 'No', - ], - 'option_key_1' => [ - 'pricing_value' => 20.00, - 'include' => 'Yes', - 'is_percent' => 'No', - ], - 'option_key_2' => [ - 'pricing_value' => 18.00, - 'include' => 'Yes', - 'is_percent' => 'No', - ], - ], - ], - 'attribute_key_1' => [ - 'options' => [ - 'option_key_0' => [ - 'pricing_value' => 42.00, - 'include' => 'Yes', - 'is_percent' => 'No', - ], - 'option_key_1' => [ - 'pricing_value' => 40.00, - 'include' => 'Yes', - 'is_percent' => 'No', - ], - 'option_key_2' => [ - 'pricing_value' => 48.00, - 'include' => 'Yes', - 'is_percent' => 'No', - ], - ], - ], - ], - 'products' => [], - 'attributes' => [ - 'attribute_key_0' => 'catalogProductAttribute::attribute_type_dropdown', - 'attribute_key_1' => 'catalogProductAttribute::attribute_type_dropdown', - ], - 'matrix' => [ - 'attribute_key_0:option_key_0 attribute_key_1:option_key_0' => [ - 'quantity_and_stock_status' => [ - 'qty' => 10, - ], - 'weight' => 1, - ], - 'attribute_key_0:option_key_0 attribute_key_1:option_key_1' => [ - 'quantity_and_stock_status' => [ - 'qty' => 10, - ], - 'weight' => 1, - ], - 'attribute_key_0:option_key_0 attribute_key_1:option_key_2' => [ - 'quantity_and_stock_status' => [ - 'qty' => 10, - ], - 'weight' => 1, - ], - 'attribute_key_0:option_key_1 attribute_key_1:option_key_0' => [ - 'quantity_and_stock_status' => [ - 'qty' => 10, - ], - 'weight' => 1, - ], - 'attribute_key_0:option_key_1 attribute_key_1:option_key_1' => [ - 'quantity_and_stock_status' => [ - 'qty' => 10, - ], - 'weight' => 1, - ], - 'attribute_key_0:option_key_1 attribute_key_1:option_key_2' => [ - 'quantity_and_stock_status' => [ - 'qty' => 10, - ], - 'weight' => 1, - ], - 'attribute_key_0:option_key_2 attribute_key_1:option_key_0' => [ - 'quantity_and_stock_status' => [ - 'qty' => 10, - ], - 'weight' => 1, - ], - 'attribute_key_0:option_key_2 attribute_key_1:option_key_1' => [ - 'quantity_and_stock_status' => [ - 'qty' => 10, - ], - 'weight' => 1, - ], - 'attribute_key_0:option_key_2 attribute_key_1:option_key_2' => [ - 'quantity_and_stock_status' => [ - 'qty' => 10, - ], - 'weight' => 1, - ], - ], - ], - - 'one_variation' => [ - 'attributes_data' => [ - 'attribute_key_0' => [ - 'options' => [ - 'option_key_0' => [ - 'pricing_value' => 12.00, - 'include' => 'Yes', - 'is_percent' => 'No', - ], - ], - ], - ], - 'products' => [], - 'attributes' => [ - 'attribute_key_0' => 'catalogProductAttribute::attribute_type_dropdown_one_option', - ], - 'matrix' => [ - 'attribute_key_0:option_key_0' => [ - 'display' => 'Yes', - 'quantity_and_stock_status' => [ - 'qty' => 10, - ], - 'weight' => 1, - ], - ], - ], - - 'one_variation_one_dollar' => [ - 'attributes_data' => [ - 'attribute_key_0' => [ - 'options' => [ - 'option_key_0' => [ - 'pricing_value' => 1.00, - 'include' => 'Yes', - 'is_percent' => 'No', - ], - ], - ], - ], - 'products' => [], - 'attributes' => [ - 'attribute_key_0' => 'catalogProductAttribute::attribute_type_dropdown_one_option', - ], - 'matrix' => [ - 'attribute_key_0:option_key_0' => [ - 'display' => 'Yes', - 'quantity_and_stock_status' => [ - 'qty' => 10, - ], - 'weight' => 1, - ], - ], - ], - - 'two_options' => [ - 'attributes_data' => [ - 'attribute_key_0' => [ - 'options' => [ - 'option_key_0' => [ - 'label' => 'option_key_1_%isolation%', - 'pricing_value' => 1, - 'is_percent' => 'Yes', - 'include' => 'Yes', - ], - 'option_key_1' => [ - 'label' => 'option_2_%isolation%', - 'pricing_value' => 2, - 'is_percent' => 'Yes', - 'include' => 'Yes', - ], - ], - ], - ], - 'attributes' => [ - 'attribute_key_0' => 'catalogProductAttribute::attribute_type_dropdown_two_options', - ], - 'products' => [], - 'matrix' => [ - 'attribute_key_0:option_key_0' => [ - 'display' => 'Yes', - 'quantity_and_stock_status' => [ - 'qty' => 10, - ], - 'weight' => 1, - ], - 'attribute_key_0:option_key_1' => [ - 'display' => 'Yes', - 'quantity_and_stock_status' => [ - 'qty' => 20, - ], - 'weight' => 2, - ], - ], - ], - - 'filterable_two_options_with_zero_price' => [ - 'attributes_data' => [ - 'attribute_key_0' => [ - 'options' => [ - 'option_key_0' => [ - 'label' => 'option_key_1_%isolation%', - 'pricing_value' => 0, - 'is_percent' => 'No', - 'include' => 'Yes', - ], - 'option_key_1' => [ - 'label' => 'option_2_%isolation%', - 'pricing_value' => 0, - 'is_percent' => 'No', - 'include' => 'Yes', - ], - ], - ], - ], - 'attributes' => [ - 'attribute_key_0' => 'catalogProductAttribute::filterable_dropdown_two_options', - ], - 'products' => [], - 'matrix' => [ - 'attribute_key_0:option_key_0' => [ - 'display' => 'Yes', - 'quantity_and_stock_status' => [ - 'qty' => 10, - ], - 'weight' => 1, - ], - 'attribute_key_0:option_key_1' => [ - 'display' => 'Yes', - 'quantity_and_stock_status' => [ - 'qty' => 20, - ], - 'weight' => 2, - ], - ], - ], - - 'two_new_options' => [ - 'attributes_data' => [ - 'attribute_key_0' => [ - 'frontend_label' => 'two_new_options_title_%isolation%', - 'frontend_input' => 'Dropdown', - 'label' => 'two_new_options_title_%isolation%', - 'is_required' => 'No', - 'options' => [ - 'option_key_0' => [ - 'label' => 'option_key_1_%isolation%', - 'pricing_value' => 1, - 'is_percent' => 'No', - 'include' => 'Yes', - ], - 'option_key_1' => [ - 'label' => 'option_key_2_%isolation%', - 'pricing_value' => 2, - 'is_percent' => 'No', - 'include' => 'Yes', - ], - ], - ], - ], - 'attributes' => [], - 'products' => [], - 'matrix' => [ - 'attribute_key_0:option_key_0' => [ - 'display' => 'Yes', - 'quantity_and_stock_status' => [ - 'qty' => 10, - ], - 'weight' => 1, - ], - 'attribute_key_0:option_key_1' => [ - 'display' => 'Yes', - 'quantity_and_stock_status' => [ - 'qty' => 20, - ], - 'weight' => 2, - ], - ], - ], - - 'two_searchable_options' => [ - 'attributes_data' => [ - 'attribute_key_0' => [ - 'frontend_label' => 'two_searchable_options_%isolation%', - 'frontend_input' => 'Dropdown', - 'label' => 'two_searchable_options_%isolation%', - 'is_required' => 'No', - 'is_searchable' => 'Yes', - 'is_visible_in_advanced_search' => 'Yes', - 'is_filterable' => 'Filterable (with results)', - 'is_filterable_in_search' => 'Yes', - 'options' => [ - 'option_key_0' => [ - 'label' => 'option_key_1_%isolation%', - 'pricing_value' => 1, - 'is_percent' => 'No', - 'include' => 'Yes', - ], - 'option_key_1' => [ - 'label' => 'option_key_2_%isolation%', - 'pricing_value' => 2, - 'is_percent' => 'No', - 'include' => 'Yes', - ], - ], - ], - ], - 'attributes' => [], - 'products' => [], - 'matrix' => [ - 'attribute_key_0:option_key_0' => [ - 'display' => 'Yes', - 'quantity_and_stock_status' => [ - 'qty' => 100, - ], - 'weight' => 1, - ], - 'attribute_key_0:option_key_1' => [ - 'display' => 'Yes', - 'quantity_and_stock_status' => [ - 'qty' => 100, - ], - 'weight' => 2, - ], - ], - ], - - 'one_new_options' => [ - 'attributes_data' => [ - 'attribute_key_0' => [ - 'options' => [ - 'option_key_0' => [ - 'label' => 'option_key_1_%isolation%', - 'pricing_value' => 1, - 'is_percent' => 'No', - 'include' => 'Yes', - ], - ], - ], - ], - 'attributes' => [], - 'products' => [], - 'matrix' => [], - ], - - 'two_new_options_with_zero_products' => [ - 'attributes_data' => [ - 'attribute_key_0' => [ - 'options' => [ - 'option_key_0' => [ - 'label' => 'option_key_1_%isolation%', - 'pricing_value' => 1, - 'is_percent' => 'No', - 'include' => 'Yes', - ], - ], - ], - ], - 'attributes' => [ - 'attribute_key_0' => 'catalogProductAttribute::attribute_type_dropdown_one_option', - ], - 'products' => [ - 'attribute_key_0:option_key_0' => 'catalogProductSimple::out_of_stock', - ], - 'matrix' => [], - ], - - 'two_options_with_assigned_product' => [ - 'attributes_data' => [ - 'attribute_key_0' => [ - 'options' => [ - 'option_key_0' => [ - 'label' => 'option_key_1_%isolation%', - 'pricing_value' => 1, - 'is_percent' => 'Yes', - 'include' => 'Yes', - ], - 'option_key_1' => [ - 'label' => 'option_key_2_%isolation%', - 'pricing_value' => 2, - 'is_percent' => 'Yes', - 'include' => 'Yes', - ], - ], - ], - ], - 'attributes' => [ - 'attribute_key_0' => 'catalogProductAttribute::attribute_type_dropdown_two_options', - ], - 'products' => [ - 'attribute_key_0:option_key_0' => 'catalogProductSimple::default', - 'attribute_key_0:option_key_1' => 'catalogProductSimple::default', - ], - 'matrix' => [ - 'attribute_key_0:option_key_0' => [ - 'display' => 'Yes', - 'quantity_and_stock_status' => [ - 'qty' => 10, - ], - 'weight' => 1, - ], - 'attribute_key_0:option_key_1' => [ - 'display' => 'Yes', - 'quantity_and_stock_status' => [ - 'qty' => 20, - ], - 'weight' => 2, - ], - ], - ], - - 'color_and_size' => [ - 'attributes_data' => [ - 'attribute_key_0' => [ - 'options' => [ - 'option_key_0' => [ - 'pricing_value' => 0.00, - 'include' => 'Yes', - 'is_percent' => 'No', - ], - 'option_key_1' => [ - 'pricing_value' => 0.00, - 'include' => 'Yes', - 'is_percent' => 'No', - ], - ], - ], - 'attribute_key_1' => [ - 'options' => [ - 'option_key_0' => [ - 'pricing_value' => 5.00, - 'include' => 'Yes', - 'is_percent' => 'No', - ], - 'option_key_1' => [ - 'pricing_value' => 10.00, - 'include' => 'Yes', - 'is_percent' => 'No', - ], - ], - ], - ], - 'products' => [ - - ], - 'attributes' => [ - 'attribute_key_0' => 'catalogProductAttribute::color', - 'attribute_key_1' => 'catalogProductAttribute::size', - ], - 'matrix' => [ - 'attribute_key_0:option_key_0 attribute_key_1:option_key_0' => [ - 'quantity_and_stock_status' => [ - 'qty' => 100, - ], - 'weight' => 1, - ], - 'attribute_key_0:option_key_0 attribute_key_1:option_key_1' => [ - 'quantity_and_stock_status' => [ - 'qty' => 100, - ], - 'weight' => 1, - ], - 'attribute_key_0:option_key_1 attribute_key_1:option_key_0' => [ - 'quantity_and_stock_status' => [ - 'qty' => 100, - ], - 'weight' => 1, - ], - 'attribute_key_0:option_key_1 attribute_key_1:option_key_1' => [ - 'quantity_and_stock_status' => [ - 'qty' => 100, - ], - 'weight' => 1, - ], - ], - ], - - 'size' => [ - 'attributes_data' => [ - 'attribute_key_0' => [ - 'options' => [ - 'option_key_0' => [ - 'pricing_value' => 0.00, - 'include' => 'Yes', - 'is_percent' => 'No', - ], - 'option_key_1' => [ - 'pricing_value' => 0.00, - 'include' => 'Yes', - 'is_percent' => 'No', - ], - ], - ], - ], - 'products' => [ - - ], - 'attributes' => [ - 'attribute_key_0' => 'catalogProductAttribute::size', - ], - 'matrix' => [ - 'attribute_key_0:option_key_0' => [ - 'quantity_and_stock_status' => [ - 'qty' => 10, - ], - 'weight' => 1, - ], - 'attribute_key_0:option_key_1' => [ - 'quantity_and_stock_status' => [ - 'qty' => 10, - ], - 'weight' => 1, - ], - ], - ], - - 'with_one_option' => [ - 'attributes_data' => [ - 'attribute_key_0' => [ - 'options' => [ - //TODO: adopt fixture MAGETWO-40002 - 'option_key_0' => [ - 'pricing_value' => 0, - 'include' => 'Yes', - 'is_percent' => 'No', - ], - 'option_key_1' => [ - 'pricing_value' => 0, - 'include' => 'Yes', - 'is_percent' => 'No', - ], - 'option_key_2' => [ - 'pricing_value' => 0, - 'include' => 'Yes', - 'is_percent' => 'No', - ], - ], - ], - ], - 'products' => [], - 'attributes' => [ - 'attribute_key_0' => 'catalogProductAttribute::attribute_type_dropdown', - ], - 'matrix' => [ - 'attribute_key_0:option_key_0' => [ - 'quantity_and_stock_status' => [ - 'qty' => 10, - ], - 'weight' => 1, - ], - 'attribute_key_0:option_key_1' => [ - 'quantity_and_stock_status' => [ - 'qty' => 10, - ], - 'weight' => 1, - ], - 'attribute_key_0:option_key_2' => [ - 'quantity_and_stock_status' => [ - 'qty' => 10, - ], - 'weight' => 1, - ], - ], - ], - - 'with_out_of_stock_item' => [ - 'attributes_data' => [ - 'attribute_key_0' => [ - 'options' => [ - 'option_key_0' => [ - 'pricing_value' => 12.00, - 'include' => 'Yes', - 'is_percent' => 'No', - ], - ], - ], - ], - 'products' => [ - 'attribute_key_0:option_key_0' => 'catalogProductSimple::out_of_stock', - ], - 'attributes' => [ - 'attribute_key_0' => 'catalogProductAttribute::attribute_type_dropdown_one_option', - ], - 'matrix' => [], - ], - - 'two_options_with_fixed_price' => [ - 'attributes_data' => [ - 'attribute_key_0' => [ - 'options' => [ - 'option_key_0' => [ - 'label' => 'option_key_1_%isolation%', - 'pricing_value' => 11, - 'is_percent' => 'No', - 'include' => 'Yes', - ], - 'option_key_1' => [ - 'label' => 'option_2_%isolation%', - 'pricing_value' => 12, - 'is_percent' => 'No', - 'include' => 'Yes', - ], - ], - ], - ], - 'attributes' => [ - 'attribute_key_0' => 'catalogProductAttribute::attribute_type_dropdown_two_options', - ], - 'products' => [], - 'matrix' => [ - 'attribute_key_0:option_key_0' => [ - 'display' => 'Yes', - 'quantity_and_stock_status' => [ - 'qty' => 100, - ], - 'weight' => 1, - ], - 'attribute_key_0:option_key_1' => [ - 'display' => 'Yes', - 'quantity_and_stock_status' => [ - 'qty' => 200, - ], - 'weight' => 1, - ], - ], - ], - - 'two_options_by_one_dollar' => [ - 'attributes_data' => [ - 'attribute_key_0' => [ - 'options' => [ - 'option_key_0' => [ - 'label' => 'option_key_1_%isolation%', - 'pricing_value' => 1, - 'is_percent' => 'No', - 'include' => 'Yes', - ], - 'option_key_1' => [ - 'label' => 'option_2_%isolation%', - 'pricing_value' => 1, - 'is_percent' => 'No', - 'include' => 'Yes', - ], - ], - ], - ], - 'attributes' => [ - 'attribute_key_0' => 'catalogProductAttribute::attribute_type_dropdown_two_options', - ], - 'products' => [], - 'matrix' => [ - 'attribute_key_0:option_key_0' => [ - 'display' => 'Yes', - 'quantity_and_stock_status' => [ - 'qty' => 100, - ], - 'weight' => 1, - ], - 'attribute_key_0:option_key_1' => [ - 'display' => 'Yes', - 'quantity_and_stock_status' => [ - 'qty' => 200, - ], - 'weight' => 1, - ], - ], - ], - - 'two_variations_with_fixed_price' => [ - 'attributes_data' => [ - 'attribute_key_0' => [ - 'options' => [ - 'option_key_0' => [ - 'label' => 'option_key_1_%isolation%', - 'pricing_value' => 1, - 'is_percent' => 'No', - 'include' => 'Yes', - ], - 'option_key_1' => [ - 'label' => 'option_2_%isolation%', - 'pricing_value' => 2, - 'is_percent' => 'No', - 'include' => 'Yes', - ], - ], - ], - ], - 'attributes' => [ - 'attribute_key_0' => 'catalogProductAttribute::attribute_type_dropdown_two_options', - ], - 'products' => [ - 'attribute_key_0:option_key_0' => 'catalogProductSimple::product_without_category', - 'attribute_key_0:option_key_1' => 'catalogProductSimple::product_without_category', - ], - 'matrix' => [ - 'attribute_key_0:option_key_0' => [ - 'display' => 'Yes', - 'quantity_and_stock_status' => [ - 'qty' => 100, - ], - 'weight' => 1, - ], - 'attribute_key_0:option_key_1' => [ - 'display' => 'Yes', - 'quantity_and_stock_status' => [ - 'qty' => 200, - ], - 'weight' => 1, - ], - ], - ], - ]; - /** * @constructor + * @param RepositoryFactory $repositoryFactory * @param FixtureFactory $fixtureFactory * @param array $data * @param array $params [optional] */ - public function __construct(FixtureFactory $fixtureFactory, array $data, array $params = []) - { + public function __construct( + RepositoryFactory $repositoryFactory, + FixtureFactory $fixtureFactory, + array $data, + array $params = [] + ) { $this->fixtureFactory = $fixtureFactory; $this->params = $params; - $preset = []; - if (isset($data['preset'])) { - $preset = $this->getPreset($data['preset']); - unset($data['preset']); + $dataset = []; + if (isset($data['dataset']) && isset($this->params['repository'])) { + $dataset = $repositoryFactory->get($this->params['repository'])->get($data['dataset']); + unset($data['dataset']); } - $data = array_replace_recursive($data, $preset); + + $data = array_replace_recursive($data, $dataset); if (!empty($data)) { $this->prepareAttributes($data); @@ -816,32 +86,22 @@ class ConfigurableAttributesData implements FixtureInterface } /** - * Persist configurable attribute data - * - * @return void - */ - public function persist() - { - // - } - - /** - * Prepare attributes + * Prepare attributes. * * @param array $data * @return void */ protected function prepareAttributes(array $data) { - if (empty($data['attributes'])) { + if (!isset($data['attributes'])) { return; } foreach ($data['attributes'] as $key => $attribute) { if (is_string($attribute)) { - list($fixture, $dataSet) = explode('::', $attribute); + list($fixture, $dataset) = explode('::', $attribute); /** @var InjectableFixture $attribute */ - $attribute = $this->fixtureFactory->createByCode($fixture, ['dataSet' => $dataSet]); + $attribute = $this->fixtureFactory->createByCode($fixture, ['dataset' => $dataset]); } if (!$attribute->hasData('attribute_id')) { $attribute->persist(); @@ -851,7 +111,7 @@ class ConfigurableAttributesData implements FixtureInterface } /** - * Prepare attributes data + * Prepare attributes data. * * @param array $data * @return void @@ -877,14 +137,14 @@ class ConfigurableAttributesData implements FixtureInterface } /** - * Prepare products + * Prepare products. * * @param array $data * @return void */ protected function prepareProducts(array $data) { - if (empty($data['products'])) { + if (!isset($data['products'])) { return; } @@ -895,7 +155,7 @@ class ConfigurableAttributesData implements FixtureInterface foreach ($data['products'] as $key => $product) { if (is_string($product)) { - list($fixture, $dataSet) = explode('::', $product); + list($fixture, $dataset) = explode('::', $product); $attributeData = ['attributes' => $this->getProductAttributeData($key)]; $stock = []; @@ -909,7 +169,7 @@ class ConfigurableAttributesData implements FixtureInterface $product = $this->fixtureFactory->createByCode( $fixture, [ - 'dataSet' => $dataSet, + 'dataset' => $dataset, 'data' => array_merge($attributeSetData, $attributeData, $stock) ] ); @@ -923,7 +183,7 @@ class ConfigurableAttributesData implements FixtureInterface } /** - * Create attribute set + * Create attribute set. * * @return FixtureInterface */ @@ -932,7 +192,7 @@ class ConfigurableAttributesData implements FixtureInterface $attributeSet = $this->fixtureFactory->createByCode( 'catalogAttributeSet', [ - 'dataSet' => 'custom_attribute_set', + 'dataset' => 'custom_attribute_set', 'data' => [ 'assigned_attributes' => [ 'attributes' => array_values($this->attributes), @@ -945,7 +205,7 @@ class ConfigurableAttributesData implements FixtureInterface } /** - * Get prepared attribute data for persist product + * Get prepared attribute data for persist product. * * @param string $key * @return array @@ -968,7 +228,7 @@ class ConfigurableAttributesData implements FixtureInterface } /** - * Get id of attribute option by composite key + * Get id of attribute option by composite key. * * @param string $compositeKey * @return int|null @@ -982,7 +242,7 @@ class ConfigurableAttributesData implements FixtureInterface } /** - * Prepare data for matrix + * Prepare data for matrix. * * @param array $data * @return void @@ -1037,7 +297,7 @@ class ConfigurableAttributesData implements FixtureInterface } /** - * Add matrix variation + * Add matrix variation. * * @param array $variationsMatrix * @param array $attribute @@ -1079,7 +339,7 @@ class ConfigurableAttributesData implements FixtureInterface } /** - * Prepare data from source + * Prepare data from source. * * @return void */ @@ -1134,28 +394,7 @@ class ConfigurableAttributesData implements FixtureInterface } /** - * Return data set configuration settings - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Return prepared data set - * - * @param string|null $key - * @return array - */ - public function getData($key = null) - { - return isset($this->data[$key]) ? $this->data[$key] : $this->data; - } - - /** - * Get prepared attributes data + * Get prepared attributes data. * * @return array */ @@ -1165,7 +404,7 @@ class ConfigurableAttributesData implements FixtureInterface } /** - * Get prepared variations matrix + * Get prepared variations matrix. * * @return array */ @@ -1175,7 +414,7 @@ class ConfigurableAttributesData implements FixtureInterface } /** - * Get prepared attributes + * Get prepared attributes. * * @return array */ @@ -1185,7 +424,7 @@ class ConfigurableAttributesData implements FixtureInterface } /** - * Get prepared products + * Get prepared products. * * @return array */ @@ -1193,15 +432,4 @@ class ConfigurableAttributesData implements FixtureInterface { return $this->products; } - - /** - * Preset array - * - * @param string $name - * @return mixed|null - */ - protected function getPreset($name) - { - return isset($this->presets[$name]) ? $this->presets[$name] : null; - } } diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProduct.xml b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProduct.xml index fa36f1aef661ab28d1eceace46b405d40e263af9..d2a23302b7cb1d450bab07d462d316d046b3a7d0 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProduct.xml +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProduct.xml @@ -17,11 +17,11 @@ <field name="status" xsi:type="string">Product online</field> <field name="visibility" xsi:type="string">Catalog, Search</field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="url_key" xsi:type="string">configurable-product-%isolation%</field> <field name="configurable_attributes_data" xsi:type="array"> - <item name="preset" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="quantity_and_stock_status" xsi:type="array"> <item name="is_in_stock" xsi:type="string">In Stock</item> @@ -30,10 +30,10 @@ <item name="0" xsi:type="string">Main Website</item> </field> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">configurable_default</item> </field> </dataset> @@ -48,11 +48,11 @@ <field name="status" xsi:type="string">Product online</field> <field name="visibility" xsi:type="string">Catalog, Search</field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="url_key" xsi:type="string">configurable-product-%isolation%</field> <field name="configurable_attributes_data" xsi:type="array"> - <item name="preset" xsi:type="string">with_one_option</item> + <item name="dataset" xsi:type="string">with_one_option</item> </field> <field name="quantity_and_stock_status" xsi:type="array"> <item name="is_in_stock" xsi:type="string">In Stock</item> @@ -61,10 +61,10 @@ <item name="0" xsi:type="string">Main Website</item> </field> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">with_special_price</item> + <item name="dataset" xsi:type="string">configurable_with_special_price</item> </field> </dataset> @@ -78,11 +78,11 @@ <field name="status" xsi:type="string">Product online</field> <field name="visibility" xsi:type="string">Catalog, Search</field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="url_key" xsi:type="string">configurable-product-%isolation%</field> <field name="configurable_attributes_data" xsi:type="array"> - <item name="preset" xsi:type="string">size</item> + <item name="dataset" xsi:type="string">size</item> </field> <field name="quantity_and_stock_status" xsi:type="array"> <item name="is_in_stock" xsi:type="string">In Stock</item> @@ -91,10 +91,10 @@ <item name="0" xsi:type="string">Main Website</item> </field> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">configurable_default</item> </field> </dataset> @@ -108,11 +108,11 @@ <field name="status" xsi:type="string">Product online</field> <field name="visibility" xsi:type="string">Catalog, Search</field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="url_key" xsi:type="string">configurable-product-%isolation%</field> <field name="configurable_attributes_data" xsi:type="array"> - <item name="preset" xsi:type="string">color_and_size</item> + <item name="dataset" xsi:type="string">color_and_size</item> </field> <field name="quantity_and_stock_status" xsi:type="array"> <item name="is_in_stock" xsi:type="string">In Stock</item> @@ -121,10 +121,10 @@ <item name="0" xsi:type="string">Main Website</item> </field> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">configurable_default</item> </field> </dataset> @@ -138,11 +138,11 @@ <field name="status" xsi:type="string">Product online</field> <field name="visibility" xsi:type="string">Catalog, Search</field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="url_key" xsi:type="string">test-configurable-product-%isolation%</field> <field name="configurable_attributes_data" xsi:type="array"> - <item name="preset" xsi:type="string">one_variation</item> + <item name="dataset" xsi:type="string">one_variation</item> </field> <field name="quantity_and_stock_status" xsi:type="array"> <item name="is_in_stock" xsi:type="string">In Stock</item> @@ -151,7 +151,7 @@ <item name="0" xsi:type="string">Main Website</item> </field> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> </dataset> @@ -166,11 +166,11 @@ <field name="status" xsi:type="string">Product online</field> <field name="visibility" xsi:type="string">Catalog, Search</field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="url_key" xsi:type="string">configurable-product-%isolation%</field> <field name="configurable_attributes_data" xsi:type="array"> - <item name="preset" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="quantity_and_stock_status" xsi:type="array"> <item name="is_in_stock" xsi:type="string">In Stock</item> @@ -179,10 +179,10 @@ <item name="0" xsi:type="string">Main Website</item> </field> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">configurable_default</item> </field> </dataset> @@ -196,11 +196,11 @@ <field name="status" xsi:type="string">Product online</field> <field name="visibility" xsi:type="string">Catalog, Search</field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="url_key" xsi:type="string">configurable-product-%isolation%</field> <field name="configurable_attributes_data" xsi:type="array"> - <item name="preset" xsi:type="string">with_one_option</item> + <item name="dataset" xsi:type="string">with_one_option</item> </field> <field name="quantity_and_stock_status" xsi:type="array"> <item name="is_in_stock" xsi:type="string">In Stock</item> @@ -209,10 +209,10 @@ <item name="0" xsi:type="string">Main Website</item> </field> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">with_one_option</item> + <item name="dataset" xsi:type="string">configurable_one_option</item> </field> </dataset> @@ -226,11 +226,11 @@ <field name="status" xsi:type="string">Product online</field> <field name="visibility" xsi:type="string">Catalog, Search</field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="url_key" xsi:type="string">test-configurable-product-%isolation%</field> <field name="configurable_attributes_data" xsi:type="array"> - <item name="preset" xsi:type="string">with_out_of_stock_item</item> + <item name="dataset" xsi:type="string">with_out_of_stock_item</item> </field> <field name="quantity_and_stock_status" xsi:type="array"> <item name="is_in_stock" xsi:type="string">In Stock</item> @@ -239,7 +239,7 @@ <item name="0" xsi:type="string">Main Website</item> </field> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> </dataset> @@ -251,7 +251,7 @@ <item name="value" xsi:type="string">10</item> </field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="weight" xsi:type="string">1</field> <field name="quantity_and_stock_status" xsi:type="array"> @@ -259,19 +259,19 @@ <item name="is_in_stock" xsi:type="string">In Stock</item> </field> <field name="category_ids" xsi:type="array"> - <item name="presets" xsi:type="string">default_subcategory</item> + <item name="dataset" xsi:type="string">default_subcategory</item> </field> <field name="website_ids" xsi:type="array"> <item name="0" xsi:type="string">Main Website</item> </field> <field name="configurable_attributes_data" xsi:type="array"> - <item name="preset" xsi:type="string">two_options_with_fixed_price</item> + <item name="dataset" xsi:type="string">two_options_with_fixed_price</item> </field> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">custom_attribute_set</item> + <item name="dataset" xsi:type="string">custom_attribute_set</item> </field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">two_options_with_fixed_price</item> + <item name="dataset" xsi:type="string">configurable_two_options_with_fixed_price</item> </field> </dataset> @@ -283,20 +283,20 @@ <item name="value" xsi:type="string">10</item> </field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="weight" xsi:type="string">1</field> <field name="website_ids" xsi:type="array"> <item name="0" xsi:type="string">Main Website</item> </field> <field name="configurable_attributes_data" xsi:type="array"> - <item name="preset" xsi:type="string">two_variations_with_fixed_price</item> + <item name="dataset" xsi:type="string">two_variations_with_fixed_price</item> </field> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">custom_attribute_set</item> + <item name="dataset" xsi:type="string">custom_attribute_set</item> </field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">two_options_by_one_dollar</item> + <item name="dataset" xsi:type="string">two_options_by_one_dollar</item> </field> </dataset> @@ -310,11 +310,11 @@ <field name="status" xsi:type="string">Product online</field> <field name="visibility" xsi:type="string">Catalog, Search</field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="url_key" xsi:type="string">configurable-product-%isolation%</field> <field name="configurable_attributes_data" xsi:type="array"> - <item name="preset" xsi:type="string">filterable_two_options_with_zero_price</item> + <item name="dataset" xsi:type="string">filterable_two_options_with_zero_price</item> </field> <field name="quantity_and_stock_status" xsi:type="array"> <item name="qty" xsi:type="string">1</item> @@ -324,7 +324,7 @@ <item name="0" xsi:type="string">Main Website</item> </field> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">custom_attribute_set</item> + <item name="dataset" xsi:type="string">custom_attribute_set</item> </field> </dataset> @@ -336,7 +336,7 @@ <item name="value" xsi:type="string">10</item> </field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="weight" xsi:type="string">1</field> <field name="quantity_and_stock_status" xsi:type="array"> @@ -344,19 +344,19 @@ <item name="is_in_stock" xsi:type="string">In Stock</item> </field> <field name="category_ids" xsi:type="array"> - <item name="presets" xsi:type="string">default_subcategory</item> + <item name="dataset" xsi:type="string">default_subcategory</item> </field> <field name="website_ids" xsi:type="array"> <item name="0" xsi:type="string">Main Website</item> </field> <field name="configurable_attributes_data" xsi:type="array"> - <item name="preset" xsi:type="string">two_options_by_one_dollar</item> + <item name="dataset" xsi:type="string">two_options_by_one_dollar</item> </field> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">custom_attribute_set</item> + <item name="dataset" xsi:type="string">custom_attribute_set</item> </field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">two_options_by_one_dollar</item> + <item name="dataset" xsi:type="string">two_options_by_one_dollar</item> </field> </dataset> </repository> diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProduct/CheckoutData.xml b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProduct/CheckoutData.xml new file mode 100644 index 0000000000000000000000000000000000000000..350ae10b384d1b9b8428ebb785e9592903866f60 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProduct/CheckoutData.xml @@ -0,0 +1,209 @@ +<?xml version="1.0" ?> +<!-- +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> + <repository class="Magento\ConfigurableProduct\Test\Repository\ConfigurableProduct\CheckoutData"> + <dataset name="configurable_default"> + <field name="options" xsi:type="array"> + <item name="configurable_options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_0</item> + <item name="value" xsi:type="string">option_key_0</item> + </item> + <item name="1" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_1</item> + <item name="value" xsi:type="string">option_key_1</item> + </item> + </item> + </field> + <field name="qty" xsi:type="string">3</field> + <field name="cartItem" xsi:type="array"> + <item name="price" xsi:type="string">172</item> + <item name="qty" xsi:type="string">3</item> + <item name="subtotal" xsi:type="string">516</item> + </field> + </dataset> + + <dataset name="configurable_update_mini_shopping_cart"> + <field name="options" xsi:type="array"> + <item name="configurable_options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_0</item> + <item name="value" xsi:type="string">option_key_1</item> + </item> + <item name="1" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_1</item> + <item name="value" xsi:type="string">option_key_0</item> + </item> + </item> + </field> + <field name="qty" xsi:type="string">1</field> + <field name="cartItem" xsi:type="array"> + <item name="price" xsi:type="string">172</item> + <item name="qty" xsi:type="string">1</item> + <item name="subtotal" xsi:type="string">172</item> + </field> + </dataset> + + <dataset name="configurable_two_options"> + <field name="options" xsi:type="array"> + <item name="configurable_options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_0</item> + <item name="value" xsi:type="string">option_key_0</item> + </item> + </item> + </field> + <field name="cartItem" xsi:type="array"> + <item name="price" xsi:type="string">101</item> + </field> + </dataset> + + <dataset name="configurable_two_new_options"> + <field name="options" xsi:type="array"> + <item name="configurable_options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_0</item> + <item name="value" xsi:type="string">option_key_1</item> + </item> + </item> + </field> + <field name="cartItem" xsi:type="array"> + <item name="price" xsi:type="string">102</item> + </field> + </dataset> + + <dataset name="configurable_two_attributes"> + <field name="options" xsi:type="array"> + <item name="configurable_options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_0</item> + <item name="value" xsi:type="string">option_key_0</item> + </item> + <item name="1" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_1</item> + <item name="value" xsi:type="string">option_key_0</item> + </item> + </item> + </field> + <field name="cartItem" xsi:type="array"> + <item name="price" xsi:type="string">112</item> + </field> + </dataset> + + <dataset name="configurable_three_attributes"> + <field name="options" xsi:type="array"> + <item name="configurable_options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_0</item> + <item name="value" xsi:type="string">option_key_0</item> + </item> + <item name="1" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_1</item> + <item name="value" xsi:type="string">option_key_0</item> + </item> + <item name="2" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_2</item> + <item name="value" xsi:type="string">option_key_0</item> + </item> + </item> + </field> + <field name="cartItem" xsi:type="array"> + <item name="price" xsi:type="string">112</item> + </field> + </dataset> + + <dataset name="configurable_two_new_options_with_special_price"> + <field name="options" xsi:type="array"> + <item name="configurable_options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_0</item> + <item name="value" xsi:type="string">option_key_1</item> + </item> + </item> + </field> + <field name="cartItem" xsi:type="array"> + <item name="price" xsi:type="string">12</item> + </field> + </dataset> + + <dataset name="configurable_with_special_price"> + <field name="options" xsi:type="array"> + <item name="configurable_options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_0</item> + <item name="value" xsi:type="string">option_key_0</item> + </item> + </item> + </field> + <field name="qty" xsi:type="string">1</field> + <field name="cartItem" xsi:type="array"> + <item name="price" xsi:type="string">10</item> + <item name="qty" xsi:type="string">1</item> + <item name="subtotal" xsi:type="string">10</item> + </field> + </dataset> + + <dataset name="configurable_two_options_with_assigned_product"> + <field name="options" xsi:type="array"> + <item name="configurable_options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_0</item> + <item name="value" xsi:type="string">option_key_0</item> + </item> + </item> + </field> + <field name="cartItem" xsi:type="array"> + <item name="price" xsi:type="string">101</item> + </field> + </dataset> + + <dataset name="configurable_one_option"> + <field name="options" xsi:type="array"> + <item name="configurable_options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_0</item> + <item name="value" xsi:type="string">option_key_0</item> + </item> + </item> + </field> + <field name="qty" xsi:type="string">1</field> + <field name="cartItem" xsi:type="array"> + <item name="price" xsi:type="string">11</item> + <item name="qty" xsi:type="string">1</item> + <item name="subtotal" xsi:type="string">11</item> + </field> + </dataset> + + <dataset name="configurable_two_options_with_fixed_price"> + <field name="options" xsi:type="array"> + <item name="configurable_options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_0</item> + <item name="value" xsi:type="string">option_key_1</item> + </item> + </item> + </field> + <field name="qty" xsi:type="string">1</field> + </dataset> + + <dataset name="configurable_two_options_by_one_dollar"> + <field name="options" xsi:type="array"> + <item name="configurable_options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_0</item> + <item name="value" xsi:type="string">option_key_0</item> + </item> + </item> + </field> + <field name="qty" xsi:type="string">1</field> + <field name="cartItem" xsi:type="array"> + <item name="price" xsi:type="string">11</item> + </field> + </dataset> + </repository> +</config> diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProduct/ConfigurableAttributesData.xml b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProduct/ConfigurableAttributesData.xml new file mode 100644 index 0000000000000000000000000000000000000000..6c84fb72b0149752967a51887f1afb019f6d4913 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProduct/ConfigurableAttributesData.xml @@ -0,0 +1,701 @@ +<?xml version="1.0" ?> +<!-- +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> + <repository class="Magento\ConfigurableProduct\Test\Repository\ConfigurableProduct\ConfigurableAttributesData"> + <dataset name="default"> + <field name="attributes_data" xsi:type="array"> + <item name="attribute_key_0" xsi:type="array"> + <item name="options" xsi:type="array"> + <item name="option_key_0" xsi:type="array"> + <item name="pricing_value" xsi:type="string">12.00</item> + <item name="include" xsi:type="string">Yes</item> + <item name="is_percent" xsi:type="string">No</item> + </item> + <item name="option_key_1" xsi:type="array"> + <item name="pricing_value" xsi:type="string">20.00</item> + <item name="include" xsi:type="string">Yes</item> + <item name="is_percent" xsi:type="string">No</item> + </item> + <item name="option_key_2" xsi:type="array"> + <item name="pricing_value" xsi:type="string">18.00</item> + <item name="include" xsi:type="string">Yes</item> + <item name="is_percent" xsi:type="string">No</item> + </item> + </item> + </item> + <item name="attribute_key_1" xsi:type="array"> + <item name="options" xsi:type="array"> + <item name="option_key_0" xsi:type="array"> + <item name="pricing_value" xsi:type="string">42.00</item> + <item name="include" xsi:type="string">Yes</item> + <item name="is_percent" xsi:type="string">No</item> + </item> + <item name="option_key_1" xsi:type="array"> + <item name="pricing_value" xsi:type="string">40.00</item> + <item name="include" xsi:type="string">Yes</item> + <item name="is_percent" xsi:type="string">No</item> + </item> + <item name="option_key_2" xsi:type="array"> + <item name="pricing_value" xsi:type="string">48.00</item> + <item name="include" xsi:type="string">Yes</item> + <item name="is_percent" xsi:type="string">No</item> + </item> + </item> + </item> + </field> + <field name="attributes" xsi:type="array"> + <item name="attribute_key_0" xsi:type="string">catalogProductAttribute::attribute_type_dropdown</item> + <item name="attribute_key_1" xsi:type="string">catalogProductAttribute::attribute_type_dropdown</item> + </field> + <field name="matrix" xsi:type="array"> + <item name="attribute_key_0:option_key_0 attribute_key_1:option_key_0" xsi:type="array"> + <item name="quantity_and_stock_status" xsi:type="array"> + <item name="qty" xsi:type="string">10</item> + </item> + <item name="weight" xsi:type="string">1</item> + </item> + <item name="attribute_key_0:option_key_0 attribute_key_1:option_key_1" xsi:type="array"> + <item name="quantity_and_stock_status" xsi:type="array"> + <item name="qty" xsi:type="string">10</item> + </item> + <item name="weight" xsi:type="string">1</item> + </item> + <item name="attribute_key_0:option_key_0 attribute_key_1:option_key_2" xsi:type="array"> + <item name="quantity_and_stock_status" xsi:type="array"> + <item name="qty" xsi:type="string">10</item> + </item> + <item name="weight" xsi:type="string">1</item> + </item> + <item name="attribute_key_0:option_key_1 attribute_key_1:option_key_0" xsi:type="array"> + <item name="quantity_and_stock_status" xsi:type="array"> + <item name="qty" xsi:type="string">10</item> + </item> + <item name="weight" xsi:type="string">1</item> + </item> + <item name="attribute_key_0:option_key_1 attribute_key_1:option_key_1" xsi:type="array"> + <item name="quantity_and_stock_status" xsi:type="array"> + <item name="qty" xsi:type="string">10</item> + </item> + <item name="weight" xsi:type="string">1</item> + </item> + <item name="attribute_key_0:option_key_1 attribute_key_1:option_key_2" xsi:type="array"> + <item name="quantity_and_stock_status" xsi:type="array"> + <item name="qty" xsi:type="string">10</item> + </item> + <item name="weight" xsi:type="string">1</item> + </item> + <item name="attribute_key_0:option_key_2 attribute_key_1:option_key_0" xsi:type="array"> + <item name="quantity_and_stock_status" xsi:type="array"> + <item name="qty" xsi:type="string">10</item> + </item> + <item name="weight" xsi:type="string">1</item> + </item> + <item name="attribute_key_0:option_key_2 attribute_key_1:option_key_1" xsi:type="array"> + <item name="quantity_and_stock_status" xsi:type="array"> + <item name="qty" xsi:type="string">10</item> + </item> + <item name="weight" xsi:type="string">1</item> + </item> + <item name="attribute_key_0:option_key_2 attribute_key_1:option_key_2" xsi:type="array"> + <item name="quantity_and_stock_status" xsi:type="array"> + <item name="qty" xsi:type="string">10</item> + </item> + <item name="weight" xsi:type="string">1</item> + </item> + </field> + </dataset> + + <dataset name="one_variation"> + <field name="attributes_data" xsi:type="array"> + <item name="attribute_key_0" xsi:type="array"> + <item name="options" xsi:type="array"> + <item name="option_key_0" xsi:type="array"> + <item name="pricing_value" xsi:type="string">12.00</item> + <item name="include" xsi:type="string">Yes</item> + <item name="is_percent" xsi:type="string">No</item> + </item> + </item> + </item> + </field> + <field name="attributes" xsi:type="array"> + <item name="attribute_key_0" xsi:type="string">catalogProductAttribute::attribute_type_dropdown_one_option</item> + </field> + <field name="matrix" xsi:type="array"> + <item name="attribute_key_0:option_key_0" xsi:type="array"> + <item name="display" xsi:type="string">Yes</item> + <item name="quantity_and_stock_status" xsi:type="array"> + <item name="qty" xsi:type="string">10</item> + </item> + <item name="weight" xsi:type="string">1</item> + </item> + </field> + </dataset> + + <dataset name="one_variation_one_dollar"> + <field name="attributes_data" xsi:type="array"> + <item name="attribute_key_0" xsi:type="array"> + <item name="options" xsi:type="array"> + <item name="option_key_0" xsi:type="array"> + <item name="pricing_value" xsi:type="string">1.00</item> + <item name="include" xsi:type="string">Yes</item> + <item name="is_percent" xsi:type="string">No</item> + </item> + </item> + </item> + </field> + <field name="attributes" xsi:type="array"> + <item name="attribute_key_0" xsi:type="string">catalogProductAttribute::attribute_type_dropdown_one_option</item> + </field> + <field name="matrix" xsi:type="array"> + <item name="attribute_key_0:option_key_0" xsi:type="array"> + <item name="display" xsi:type="string">Yes</item> + <item name="quantity_and_stock_status" xsi:type="array"> + <item name="qty" xsi:type="string">10</item> + </item> + <item name="weight" xsi:type="string">1</item> + </item> + </field> + </dataset> + + <dataset name="two_options"> + <field name="attributes_data" xsi:type="array"> + <item name="attribute_key_0" xsi:type="array"> + <item name="options" xsi:type="array"> + <item name="option_key_0" xsi:type="array"> + <item name="label" xsi:type="string">option_key_1_%isolation%</item> + <item name="pricing_value" xsi:type="string">1</item> + <item name="include" xsi:type="string">Yes</item> + <item name="is_percent" xsi:type="string">Yes</item> + </item> + <item name="option_key_1" xsi:type="array"> + <item name="label" xsi:type="string">option_key_2_%isolation%</item> + <item name="pricing_value" xsi:type="string">2</item> + <item name="include" xsi:type="string">Yes</item> + <item name="is_percent" xsi:type="string">Yes</item> + </item> + </item> + </item> + </field> + <field name="attributes" xsi:type="array"> + <item name="attribute_key_0" xsi:type="string">catalogProductAttribute::attribute_type_dropdown_two_options</item> + </field> + <field name="matrix" xsi:type="array"> + <item name="attribute_key_0:option_key_0" xsi:type="array"> + <item name="display" xsi:type="string">Yes</item> + <item name="quantity_and_stock_status" xsi:type="array"> + <item name="qty" xsi:type="string">10</item> + </item> + <item name="weight" xsi:type="string">1</item> + </item> + <item name="attribute_key_0:option_key_1" xsi:type="array"> + <item name="display" xsi:type="string">Yes</item> + <item name="quantity_and_stock_status" xsi:type="array"> + <item name="qty" xsi:type="string">20</item> + </item> + <item name="weight" xsi:type="string">2</item> + </item> + </field> + </dataset> + + <dataset name="filterable_two_options_with_zero_price"> + <field name="attributes_data" xsi:type="array"> + <item name="attribute_key_0" xsi:type="array"> + <item name="options" xsi:type="array"> + <item name="option_key_0" xsi:type="array"> + <item name="label" xsi:type="string">option_key_1_%isolation%</item> + <item name="pricing_value" xsi:type="string">0</item> + <item name="include" xsi:type="string">Yes</item> + <item name="is_percent" xsi:type="string">No</item> + </item> + <item name="option_key_1" xsi:type="array"> + <item name="label" xsi:type="string">option_key_2_%isolation%</item> + <item name="pricing_value" xsi:type="string">0</item> + <item name="include" xsi:type="string">Yes</item> + <item name="is_percent" xsi:type="string">No</item> + </item> + </item> + </item> + </field> + <field name="attributes" xsi:type="array"> + <item name="attribute_key_0" xsi:type="string">catalogProductAttribute::filterable_dropdown_two_options</item> + </field> + <field name="matrix" xsi:type="array"> + <item name="attribute_key_0:option_key_0" xsi:type="array"> + <item name="display" xsi:type="string">Yes</item> + <item name="quantity_and_stock_status" xsi:type="array"> + <item name="qty" xsi:type="string">10</item> + </item> + <item name="weight" xsi:type="string">1</item> + </item> + <item name="attribute_key_0:option_key_1" xsi:type="array"> + <item name="display" xsi:type="string">Yes</item> + <item name="quantity_and_stock_status" xsi:type="array"> + <item name="qty" xsi:type="string">20</item> + </item> + <item name="weight" xsi:type="string">2</item> + </item> + </field> + </dataset> + + <dataset name="two_new_options"> + <field name="attributes_data" xsi:type="array"> + <item name="attribute_key_0" xsi:type="array"> + <item name="frontend_label" xsi:type="string">two_new_options_title_%isolation%</item> + <item name="frontend_input" xsi:type="string">Dropdown</item> + <item name="label" xsi:type="string">two_new_options_title_%isolation%</item> + <item name="is_required" xsi:type="string">No</item> + <item name="options" xsi:type="array"> + <item name="option_key_0" xsi:type="array"> + <item name="label" xsi:type="string">option_key_1_%isolation%</item> + <item name="pricing_value" xsi:type="string">1</item> + <item name="include" xsi:type="string">Yes</item> + <item name="is_percent" xsi:type="string">No</item> + </item> + <item name="option_key_1" xsi:type="array"> + <item name="label" xsi:type="string">option_key_2_%isolation%</item> + <item name="pricing_value" xsi:type="string">2</item> + <item name="include" xsi:type="string">Yes</item> + <item name="is_percent" xsi:type="string">No</item> + </item> + </item> + </item> + </field> + <field name="matrix" xsi:type="array"> + <item name="attribute_key_0:option_key_0" xsi:type="array"> + <item name="display" xsi:type="string">Yes</item> + <item name="quantity_and_stock_status" xsi:type="array"> + <item name="qty" xsi:type="string">10</item> + </item> + <item name="weight" xsi:type="string">1</item> + </item> + <item name="attribute_key_0:option_key_1" xsi:type="array"> + <item name="display" xsi:type="string">Yes</item> + <item name="quantity_and_stock_status" xsi:type="array"> + <item name="qty" xsi:type="string">20</item> + </item> + <item name="weight" xsi:type="string">2</item> + </item> + </field> + </dataset> + + <dataset name="two_searchable_options"> + <field name="attributes_data" xsi:type="array"> + <item name="attribute_key_0" xsi:type="array"> + <item name="frontend_label" xsi:type="string">two_searchable_options_%isolation%</item> + <item name="frontend_input" xsi:type="string">Dropdown</item> + <item name="label" xsi:type="string">two_searchable_options_%isolation%</item> + <item name="is_required" xsi:type="string">No</item> + <item name="is_searchable" xsi:type="string">Yes</item> + <item name="is_visible_in_advanced_search" xsi:type="string">Yes</item> + <item name="is_filterable" xsi:type="string">Filterable (with results)</item> + <item name="is_filterable_in_search" xsi:type="string">Yes</item> + <item name="options" xsi:type="array"> + <item name="option_key_0" xsi:type="array"> + <item name="label" xsi:type="string">option_key_1_%isolation%</item> + <item name="pricing_value" xsi:type="string">1</item> + <item name="include" xsi:type="string">Yes</item> + <item name="is_percent" xsi:type="string">No</item> + </item> + <item name="option_key_1" xsi:type="array"> + <item name="label" xsi:type="string">option_key_2_%isolation%</item> + <item name="pricing_value" xsi:type="string">2</item> + <item name="include" xsi:type="string">Yes</item> + <item name="is_percent" xsi:type="string">No</item> + </item> + </item> + </item> + </field> + <field name="matrix" xsi:type="array"> + <item name="attribute_key_0:option_key_0" xsi:type="array"> + <item name="display" xsi:type="string">Yes</item> + <item name="quantity_and_stock_status" xsi:type="array"> + <item name="qty" xsi:type="string">100</item> + </item> + <item name="weight" xsi:type="string">1</item> + </item> + <item name="attribute_key_0:option_key_1" xsi:type="array"> + <item name="display" xsi:type="string">Yes</item> + <item name="quantity_and_stock_status" xsi:type="array"> + <item name="qty" xsi:type="string">100</item> + </item> + <item name="weight" xsi:type="string">2</item> + </item> + </field> + </dataset> + + <dataset name="one_new_options"> + <field name="attributes_data" xsi:type="array"> + <item name="attribute_key_0" xsi:type="array"> + <item name="options" xsi:type="array"> + <item name="option_key_0" xsi:type="array"> + <item name="label" xsi:type="string">option_key_1_%isolation%</item> + <item name="pricing_value" xsi:type="string">1</item> + <item name="include" xsi:type="string">Yes</item> + <item name="is_percent" xsi:type="string">No</item> + </item> + </item> + </item> + </field> + </dataset> + + <dataset name="two_new_options_with_zero_products"> + <field name="attributes_data" xsi:type="array"> + <item name="attribute_key_0" xsi:type="array"> + <item name="options" xsi:type="array"> + <item name="option_key_0" xsi:type="array"> + <item name="label" xsi:type="string">option_key_1_%isolation%</item> + <item name="pricing_value" xsi:type="string">1</item> + <item name="include" xsi:type="string">Yes</item> + <item name="is_percent" xsi:type="string">No</item> + </item> + </item> + </item> + </field> + <field name="attributes" xsi:type="array"> + <item name="attribute_key_0" xsi:type="string">catalogProductAttribute::attribute_type_dropdown_one_option</item> + </field> + <field name="products" xsi:type="array"> + <item name="attribute_key_0:option_key_0" xsi:type="string">catalogProductSimple::out_of_stock</item> + </field> + </dataset> + + <dataset name="two_options_with_assigned_product"> + <field name="attributes_data" xsi:type="array"> + <item name="attribute_key_0" xsi:type="array"> + <item name="options" xsi:type="array"> + <item name="option_key_0" xsi:type="array"> + <item name="label" xsi:type="string">option_key_1_%isolation%</item> + <item name="pricing_value" xsi:type="string">1</item> + <item name="is_percent" xsi:type="string">Yes</item> + <item name="include" xsi:type="string">Yes</item> + </item> + <item name="option_key_1" xsi:type="array"> + <item name="label" xsi:type="string">option_key_2_%isolation%</item> + <item name="pricing_value" xsi:type="string">2</item> + <item name="is_percent" xsi:type="string">Yes</item> + <item name="include" xsi:type="string">Yes</item> + </item> + </item> + </item> + </field> + <field name="attributes" xsi:type="array"> + <item name="attribute_key_0" xsi:type="string">catalogProductAttribute::attribute_type_dropdown_two_options</item> + </field> + <field name="products" xsi:type="array"> + <item name="attribute_key_0:option_key_0" xsi:type="string">catalogProductSimple::default</item> + <item name="attribute_key_0:option_key_1" xsi:type="string">catalogProductSimple::default</item> + </field> + <field name="matrix" xsi:type="array"> + <item name="attribute_key_0:option_key_0" xsi:type="array"> + <item name="display" xsi:type="string">Yes</item> + <item name="quantity_and_stock_status" xsi:type="array"> + <item name="qty" xsi:type="string">10</item> + </item> + <item name="weight" xsi:type="string">1</item> + </item> + <item name="attribute_key_0:option_key_1" xsi:type="array"> + <item name="display" xsi:type="string">Yes</item> + <item name="quantity_and_stock_status" xsi:type="array"> + <item name="qty" xsi:type="string">20</item> + </item> + <item name="weight" xsi:type="string">2</item> + </item> + </field> + </dataset> + + <dataset name="color_and_size"> + <field name="attributes_data" xsi:type="array"> + <item name="attribute_key_0" xsi:type="array"> + <item name="options" xsi:type="array"> + <item name="option_key_0" xsi:type="array"> + <item name="pricing_value" xsi:type="string">0.00</item> + <item name="is_percent" xsi:type="string">No</item> + <item name="include" xsi:type="string">Yes</item> + </item> + <item name="option_key_1" xsi:type="array"> + <item name="pricing_value" xsi:type="string">0.00</item> + <item name="is_percent" xsi:type="string">No</item> + <item name="include" xsi:type="string">Yes</item> + </item> + </item> + </item> + <item name="attribute_key_1" xsi:type="array"> + <item name="options" xsi:type="array"> + <item name="option_key_0" xsi:type="array"> + <item name="pricing_value" xsi:type="string">5.00</item> + <item name="is_percent" xsi:type="string">No</item> + <item name="include" xsi:type="string">Yes</item> + </item> + <item name="option_key_1" xsi:type="array"> + <item name="pricing_value" xsi:type="string">10.00</item> + <item name="is_percent" xsi:type="string">No</item> + <item name="include" xsi:type="string">Yes</item> + </item> + </item> + </item> + </field> + <field name="attributes" xsi:type="array"> + <item name="attribute_key_0" xsi:type="string">catalogProductAttribute::color</item> + <item name="attribute_key_1" xsi:type="string">catalogProductAttribute::size</item> + </field> + <field name="matrix" xsi:type="array"> + <item name="attribute_key_0:option_key_0 attribute_key_1:option_key_0" xsi:type="array"> + <item name="quantity_and_stock_status" xsi:type="array"> + <item name="qty" xsi:type="string">100</item> + </item> + <item name="weight" xsi:type="string">1</item> + </item> + <item name="attribute_key_0:option_key_0 attribute_key_1:option_key_1" xsi:type="array"> + <item name="quantity_and_stock_status" xsi:type="array"> + <item name="qty" xsi:type="string">100</item> + </item> + <item name="weight" xsi:type="string">1</item> + </item> + <item name="attribute_key_0:option_key_1 attribute_key_1:option_key_0" xsi:type="array"> + <item name="quantity_and_stock_status" xsi:type="array"> + <item name="qty" xsi:type="string">100</item> + </item> + <item name="weight" xsi:type="string">1</item> + </item> + <item name="attribute_key_0:option_key_1 attribute_key_1:option_key_1" xsi:type="array"> + <item name="quantity_and_stock_status" xsi:type="array"> + <item name="qty" xsi:type="string">100</item> + </item> + <item name="weight" xsi:type="string">1</item> + </item> + </field> + </dataset> + + <dataset name="size"> + <field name="attributes_data" xsi:type="array"> + <item name="attribute_key_0" xsi:type="array"> + <item name="options" xsi:type="array"> + <item name="option_key_0" xsi:type="array"> + <item name="pricing_value" xsi:type="string">0.00</item> + <item name="include" xsi:type="string">Yes</item> + <item name="is_percent" xsi:type="string">No</item> + </item> + <item name="option_key_1" xsi:type="array"> + <item name="pricing_value" xsi:type="string">0.00</item> + <item name="include" xsi:type="string">Yes</item> + <item name="is_percent" xsi:type="string">No</item> + </item> + </item> + </item> + </field> + <field name="attributes" xsi:type="array"> + <item name="attribute_key_0" xsi:type="string">catalogProductAttribute::size</item> + </field> + <field name="matrix" xsi:type="array"> + <item name="attribute_key_0:option_key_0" xsi:type="array"> + <item name="quantity_and_stock_status" xsi:type="array"> + <item name="qty" xsi:type="string">10</item> + </item> + <item name="weight" xsi:type="string">1</item> + </item> + <item name="attribute_key_0:option_key_1" xsi:type="array"> + <item name="quantity_and_stock_status" xsi:type="array"> + <item name="qty" xsi:type="string">10</item> + </item> + <item name="weight" xsi:type="string">1</item> + </item> + </field> + </dataset> + + <dataset name="with_one_option"> + <field name="attributes_data" xsi:type="array"> + <item name="attribute_key_0" xsi:type="array"> + <item name="options" xsi:type="array"> + <item name="option_key_0" xsi:type="array"> + <item name="pricing_value" xsi:type="string">1</item> + <item name="include" xsi:type="string">Yes</item> + <item name="is_percent" xsi:type="string">No</item> + </item> + <item name="option_key_1" xsi:type="array"> + <item name="pricing_value" xsi:type="string">2</item> + <item name="include" xsi:type="string">Yes</item> + <item name="is_percent" xsi:type="string">No</item> + </item> + <item name="option_key_2" xsi:type="array"> + <item name="pricing_value" xsi:type="string">3</item> + <item name="include" xsi:type="string">Yes</item> + <item name="is_percent" xsi:type="string">No</item> + </item> + </item> + </item> + </field> + <field name="attributes" xsi:type="array"> + <item name="attribute_key_0" xsi:type="string">catalogProductAttribute::attribute_type_dropdown</item> + </field> + <field name="matrix" xsi:type="array"> + <item name="attribute_key_0:option_key_0" xsi:type="array"> + <item name="quantity_and_stock_status" xsi:type="array"> + <item name="qty" xsi:type="string">10</item> + </item> + <item name="weight" xsi:type="string">1</item> + </item> + <item name="attribute_key_0:option_key_1" xsi:type="array"> + <item name="quantity_and_stock_status" xsi:type="array"> + <item name="qty" xsi:type="string">10</item> + </item> + <item name="weight" xsi:type="string">1</item> + </item> + <item name="attribute_key_0:option_key_2" xsi:type="array"> + <item name="quantity_and_stock_status" xsi:type="array"> + <item name="qty" xsi:type="string">10</item> + </item> + <item name="weight" xsi:type="string">1</item> + </item> + </field> + </dataset> + + <dataset name="with_out_of_stock_item"> + <field name="attributes_data" xsi:type="array"> + <item name="attribute_key_0" xsi:type="array"> + <item name="options" xsi:type="array"> + <item name="option_key_0" xsi:type="array"> + <item name="pricing_value" xsi:type="string">12.00</item> + <item name="include" xsi:type="string">Yes</item> + <item name="is_percent" xsi:type="string">No</item> + </item> + </item> + </item> + </field> + <field name="products" xsi:type="array"> + <item name="attribute_key_0:option_key_0" xsi:type="string">catalogProductSimple::out_of_stock</item> + </field> + <field name="attributes" xsi:type="array"> + <item name="attribute_key_0" xsi:type="string">catalogProductAttribute::attribute_type_dropdown_one_option</item> + </field> + </dataset> + + <dataset name="two_options_with_fixed_price"> + <field name="attributes_data" xsi:type="array"> + <item name="attribute_key_0" xsi:type="array"> + <item name="options" xsi:type="array"> + <item name="option_key_0" xsi:type="array"> + <item name="label" xsi:type="string">option_key_1_%isolation%</item> + <item name="pricing_value" xsi:type="string">11</item> + <item name="include" xsi:type="string">Yes</item> + <item name="is_percent" xsi:type="string">No</item> + </item> + <item name="option_key_1" xsi:type="array"> + <item name="label" xsi:type="string">option_2_%isolation%</item> + <item name="pricing_value" xsi:type="string">12</item> + <item name="include" xsi:type="string">Yes</item> + <item name="is_percent" xsi:type="string">No</item> + </item> + </item> + </item> + </field> + <field name="attributes" xsi:type="array"> + <item name="attribute_key_0" xsi:type="string">catalogProductAttribute::attribute_type_dropdown_two_options</item> + </field> + <field name="matrix" xsi:type="array"> + <item name="attribute_key_0:option_key_0" xsi:type="array"> + <item name="display" xsi:type="string">Yes</item> + <item name="quantity_and_stock_status" xsi:type="array"> + <item name="qty" xsi:type="string">100</item> + </item> + <item name="weight" xsi:type="string">1</item> + </item> + <item name="attribute_key_0:option_key_1" xsi:type="array"> + <item name="display" xsi:type="string">Yes</item> + <item name="quantity_and_stock_status" xsi:type="array"> + <item name="qty" xsi:type="string">200</item> + </item> + <item name="weight" xsi:type="string">1</item> + </item> + </field> + </dataset> + + <dataset name="two_options_by_one_dollar"> + <field name="attributes_data" xsi:type="array"> + <item name="attribute_key_0" xsi:type="array"> + <item name="options" xsi:type="array"> + <item name="option_key_0" xsi:type="array"> + <item name="label" xsi:type="string">option_key_1_%isolation%</item> + <item name="pricing_value" xsi:type="string">1</item> + <item name="include" xsi:type="string">Yes</item> + <item name="is_percent" xsi:type="string">No</item> + </item> + <item name="option_key_1" xsi:type="array"> + <item name="label" xsi:type="string">option_2_%isolation%</item> + <item name="pricing_value" xsi:type="string">1</item> + <item name="include" xsi:type="string">Yes</item> + <item name="is_percent" xsi:type="string">No</item> + </item> + </item> + </item> + </field> + <field name="attributes" xsi:type="array"> + <item name="attribute_key_0" xsi:type="string">catalogProductAttribute::attribute_type_dropdown_two_options</item> + </field> + <field name="matrix" xsi:type="array"> + <item name="attribute_key_0:option_key_0" xsi:type="array"> + <item name="display" xsi:type="string">Yes</item> + <item name="quantity_and_stock_status" xsi:type="array"> + <item name="qty" xsi:type="string">100</item> + </item> + <item name="weight" xsi:type="string">1</item> + </item> + <item name="attribute_key_0:option_key_1" xsi:type="array"> + <item name="display" xsi:type="string">Yes</item> + <item name="quantity_and_stock_status" xsi:type="array"> + <item name="qty" xsi:type="string">200</item> + </item> + <item name="weight" xsi:type="string">1</item> + </item> + </field> + </dataset> + + <dataset name="two_variations_with_fixed_price"> + <field name="attributes_data" xsi:type="array"> + <item name="attribute_key_0" xsi:type="array"> + <item name="options" xsi:type="array"> + <item name="option_key_0" xsi:type="array"> + <item name="label" xsi:type="string">option_key_1_%isolation%</item> + <item name="pricing_value" xsi:type="string">1</item> + <item name="include" xsi:type="string">Yes</item> + <item name="is_percent" xsi:type="string">No</item> + </item> + <item name="option_key_1" xsi:type="array"> + <item name="label" xsi:type="string">option_2_%isolation%</item> + <item name="pricing_value" xsi:type="string">2</item> + <item name="include" xsi:type="string">Yes</item> + <item name="is_percent" xsi:type="string">No</item> + </item> + </item> + </item> + </field> + <field name="attributes" xsi:type="array"> + <item name="attribute_key_0" xsi:type="string">catalogProductAttribute::attribute_type_dropdown_two_options</item> + </field> + <field name="products" xsi:type="array"> + <item name="attribute_key_0:option_key_0" xsi:type="string">catalogProductSimple::product_without_category</item> + <item name="attribute_key_0:option_key_1" xsi:type="string">catalogProductSimple::product_without_category</item> + </field> + <field name="matrix" xsi:type="array"> + <item name="attribute_key_0:option_key_0" xsi:type="array"> + <item name="display" xsi:type="string">Yes</item> + <item name="quantity_and_stock_status" xsi:type="array"> + <item name="qty" xsi:type="string">100</item> + </item> + <item name="weight" xsi:type="string">1</item> + </item> + <item name="attribute_key_0:option_key_1" xsi:type="array"> + <item name="display" xsi:type="string">Yes</item> + <item name="quantity_and_stock_status" xsi:type="array"> + <item name="qty" xsi:type="string">200</item> + </item> + <item name="weight" xsi:type="string">1</item> + </item> + </field> + </dataset> + </repository> +</config> diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest.php index 03a43acc66825efacc9e4a808d7d66623a2284e9..9aed12f1c9236b1cb9d303c2c14f94ad0bee2ba5 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest.php @@ -27,9 +27,9 @@ use Magento\Mtf\TestCase\Injectable; * 3. Click on narrow near "Add Product" button * 4. Select Configurable Product * 5. Fill in data according to data sets - * 5.1 If field "attributeNew/dataSet" is not empty - search created attribute by putting it's name + * 5.1 If field "attributeNew/dataset" is not empty - search created attribute by putting it's name * to variation Search field. - * 5.2 If "attribute/dataSet" is not empty- create new Variation Set + * 5.2 If "attribute/dataset" is not empty- create new Variation Set * 6. Save product * 7. Perform all assertions * diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest.xml index c90775e494c64bc193492d008cb88ea41e1caed1..224ebfc244f038d1f087f3030c6ddc08a67e72a2 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest.xml @@ -5,18 +5,17 @@ * See COPYING.txt for license details. */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\ConfigurableProduct\Test\TestCase\CreateConfigurableProductEntityTest"> <variation name="CreateConfigurableProductEntityTestVariation1"> <data name="description" xsi:type="string">Create product with category and two new options</data> <data name="product/data/url_key" xsi:type="string">configurable-product-%isolation%</data> - <data name="product/data/configurable_attributes_data/preset" xsi:type="string">two_new_options</data> - <data name="product/data/checkout_data/preset" xsi:type="string">two_new_options</data> + <data name="product/data/configurable_attributes_data/dataset" xsi:type="string">two_new_options</data> + <data name="product/data/checkout_data/dataset" xsi:type="string">configurable_two_options</data> <data name="product/data/name" xsi:type="string">Configurable Product %isolation%</data> <data name="product/data/sku" xsi:type="string">configurable_sku_%isolation%</data> <data name="product/data/price/value" xsi:type="string">100</data> - <data name="product/data/category_ids/presets" xsi:type="string">default_subcategory</data> + <data name="product/data/category_ids/dataset" xsi:type="string">default_subcategory</data> <data name="product/data/short_description" xsi:type="string">Configurable short description</data> <data name="product/data/description" xsi:type="string">Configurable Product description %isolation%</data> <data name="product/data/weight" xsi:type="string">2</data> @@ -35,8 +34,8 @@ <variation name="CreateConfigurableProductEntityTestVariation2"> <data name="description" xsi:type="string">Create product with two options</data> <data name="product/data/url_key" xsi:type="string">configurable-product-%isolation%</data> - <data name="product/data/configurable_attributes_data/preset" xsi:type="string">two_options</data> - <data name="product/data/checkout_data/preset" xsi:type="string">two_options</data> + <data name="product/data/configurable_attributes_data/dataset" xsi:type="string">two_options</data> + <data name="product/data/checkout_data/dataset" xsi:type="string">configurable_two_options</data> <data name="product/data/name" xsi:type="string">Configurable Product %isolation%</data> <data name="product/data/sku" xsi:type="string">configurable_sku_%isolation%</data> <data name="product/data/price/value" xsi:type="string">100</data> @@ -56,8 +55,8 @@ <variation name="CreateConfigurableProductEntityTestVariation3"> <data name="description" xsi:type="string">Create product with special price</data> <data name="product/data/url_key" xsi:type="string">configurable-product-%isolation%</data> - <data name="product/data/configurable_attributes_data/preset" xsi:type="string">two_new_options</data> - <data name="product/data/checkout_data/preset" xsi:type="string">two_new_options_with_special_price</data> + <data name="product/data/configurable_attributes_data/dataset" xsi:type="string">two_new_options</data> + <data name="product/data/checkout_data/dataset" xsi:type="string">configurable_two_new_options_with_special_price</data> <data name="product/data/name" xsi:type="string">Configurable Product %isolation%</data> <data name="product/data/sku" xsi:type="string">configurable_sku_%isolation%</data> <data name="product/data/price/value" xsi:type="string">100</data> @@ -80,8 +79,8 @@ <data name="issue" xsi:type="string">Bug: MAGETWO-34791</data> <data name="description" xsi:type="string">Create product with assigned products to options</data> <data name="product/data/url_key" xsi:type="string">configurable-product-%isolation%</data> - <data name="product/data/configurable_attributes_data/preset" xsi:type="string">two_options_with_assigned_product</data> - <data name="product/data/checkout_data/preset" xsi:type="string">two_options_with_assigned_product</data> + <data name="product/data/configurable_attributes_data/dataset" xsi:type="string">two_options_with_assigned_product</data> + <data name="product/data/checkout_data/dataset" xsi:type="string">configurable_two_options_with_assigned_product</data> <data name="product/data/name" xsi:type="string">Configurable Product %isolation%</data> <data name="product/data/sku" xsi:type="string">configurable_sku_%isolation%</data> <data name="product/data/price/value" xsi:type="string">100</data> @@ -100,12 +99,12 @@ <variation name="CreateConfigurableProductEntityTestVariation5"> <data name="description" xsi:type="string">MAGETWO-12620: Create Configurable Product and Assign it to Category</data> <data name="product/data/url_key" xsi:type="string">configurable-product-%isolation%</data> - <data name="product/data/configurable_attributes_data/preset" xsi:type="string">two_options_with_fixed_price</data> + <data name="product/data/configurable_attributes_data/dataset" xsi:type="string">two_options_with_fixed_price</data> <data name="product/data/name" xsi:type="string">Configurable Product %isolation%</data> <data name="product/data/sku" xsi:type="string">configurable_sku_%isolation%</data> <data name="product/data/tax_class_id" xsi:type="string">Taxable Goods</data> <data name="product/data/price/value" xsi:type="string">10</data> - <data name="product/data/category_ids/presets" xsi:type="string">default_subcategory</data> + <data name="product/data/category_ids/dataset" xsi:type="string">default_subcategory</data> <data name="product/data/weight" xsi:type="string">1</data> <data name="product/data/affected_attribute_set" xsi:type="string">custom_attribute_set_%isolation%</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> @@ -115,11 +114,11 @@ </variation> <variation name="CreateConfigurableProductEntityTestVariation6"> <data name="description" xsi:type="string">MAGETWO-13361: Create Configurable Product with Creating New Category and New Attribute (Required Fields Only)</data> - <data name="product/data/configurable_attributes_data/preset" xsi:type="string">two_searchable_options</data> + <data name="product/data/configurable_attributes_data/dataset" xsi:type="string">two_searchable_options</data> <data name="product/data/name" xsi:type="string">Configurable Product %isolation%</data> <data name="product/data/price/value" xsi:type="string">100</data> <data name="product/data/category_ids/new_category" xsi:type="string">no</data> - <data name="product/data/category_ids/presets" xsi:type="string">default_subcategory</data> + <data name="product/data/category_ids/dataset" xsi:type="string">default_subcategory</data> <data name="product/data/url_key" xsi:type="string">configurable-product-%isolation%</data> <data name="product/data/affected_attribute_set" xsi:type="string">custom_attribute_set_%isolation%</data> <data name="tag" xsi:type="string">test_type:acceptance_test</data> diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/UpdateConfigurableProductEntityTest.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/UpdateConfigurableProductEntityTest.php index 7aade5f419fff074751dd8aa90e310e080c00476..63c8de2d3e43eb692cfdee9c7d134e4267de6d90 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/UpdateConfigurableProductEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/UpdateConfigurableProductEntityTest.php @@ -21,7 +21,7 @@ use Magento\Mtf\TestCase\Scenario; * 1. Log in to backend. * 2. Open Products -> Catalog. * 3. Search and open configurable product from preconditions. - * 4. Fill in data according to dataSet. + * 4. Fill in data according to dataset. * 5. Save product. * 6. Perform all assertions. * diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/UpdateConfigurableProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/UpdateConfigurableProductEntityTest.xml index 02d24b92e564bffda20aee14adabdb195974b651..c093b465be30eb913094fa9d11de83255036e0c7 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/UpdateConfigurableProductEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/UpdateConfigurableProductEntityTest.xml @@ -12,13 +12,13 @@ <data name="attributeTypeAction" xsi:type="string">addOptions</data> <data name="product" xsi:type="string">configurableProduct::default</data> <data name="updatedProduct/data/url_key" xsi:type="string">configurable-product-%isolation%</data> - <data name="updatedProduct/data/configurable_attributes_data/preset" xsi:type="string">one_new_options</data> - <data name="updatedProduct/data/checkout_data/preset" xsi:type="string">two_attributes</data> + <data name="updatedProduct/data/configurable_attributes_data/dataset" xsi:type="string">one_new_options</data> + <data name="updatedProduct/data/checkout_data/dataset" xsi:type="string">configurable_two_attributes</data> <data name="updatedProduct/data/checkout_data/cartItem/price" xsi:type="string">153</data> <data name="updatedProduct/data/name" xsi:type="string">Configurable Product %isolation%</data> <data name="updatedProduct/data/sku" xsi:type="string">configurable_sku_%isolation%</data> <data name="updatedProduct/data/price/value" xsi:type="string">99</data> - <data name="updatedProduct/data/category_ids/presets" xsi:type="string">default_subcategory</data> + <data name="updatedProduct/data/category_ids/dataset" xsi:type="string">default_subcategory</data> <data name="updatedProduct/data/short_description" xsi:type="string">Configurable short description</data> <data name="updatedProduct/data/description" xsi:type="string">Configurable Product description %isolation%</data> <data name="updatedProduct/data/weight" xsi:type="string">3</data> @@ -37,8 +37,8 @@ <data name="description" xsi:type="string">Add new variations</data> <data name="product" xsi:type="string">configurableProduct::default</data> <data name="updatedProduct/data/url_key" xsi:type="string">configurable-product-%isolation%</data> - <data name="updatedProduct/data/configurable_attributes_data/preset" xsi:type="string">two_new_options</data> - <data name="updatedProduct/data/checkout_data/preset" xsi:type="string">three_attributes</data> + <data name="updatedProduct/data/configurable_attributes_data/dataset" xsi:type="string">two_new_options</data> + <data name="updatedProduct/data/checkout_data/dataset" xsi:type="string">configurable_three_attributes</data> <data name="updatedProduct/data/checkout_data/cartItem/price" xsi:type="string">154</data> <data name="updatedProduct/data/name" xsi:type="string">Configurable Product %isolation%</data> <data name="updatedProduct/data/sku" xsi:type="string">configurable_sku_%isolation%</data> @@ -60,13 +60,13 @@ <data name="attributeTypeAction" xsi:type="string">deleteLast</data> <data name="product" xsi:type="string">configurableProduct::default</data> <data name="updatedProduct/data/url_key" xsi:type="string">configurable-product-%isolation%</data> - <data name="updatedProduct/data/configurable_attributes_data/preset" xsi:type="string">two_new_options</data> - <data name="updatedProduct/data/checkout_data/preset" xsi:type="string">two_attributes</data> + <data name="updatedProduct/data/configurable_attributes_data/dataset" xsi:type="string">two_new_options</data> + <data name="updatedProduct/data/checkout_data/dataset" xsi:type="string">configurable_two_attributes</data> <data name="updatedProduct/data/checkout_data/cartItem/price" xsi:type="string">112</data> <data name="updatedProduct/data/name" xsi:type="string">Configurable Product %isolation%</data> <data name="updatedProduct/data/sku" xsi:type="string">configurable_sku_%isolation%</data> <data name="updatedProduct/data/price/value" xsi:type="string">99</data> - <data name="updatedProduct/data/category_ids/presets" xsi:type="string">default_subcategory</data> + <data name="updatedProduct/data/category_ids/dataset" xsi:type="string">default_subcategory</data> <data name="updatedProduct/data/short_description" xsi:type="string">Configurable short description</data> <data name="updatedProduct/data/description" xsi:type="string">Configurable Product description %isolation%</data> <data name="updatedProduct/data/weight" xsi:type="string">3</data> @@ -85,8 +85,8 @@ <data name="attributeTypeAction" xsi:type="string">deleteAll</data> <data name="product" xsi:type="string">configurableProduct::default</data> <data name="updatedProduct/data/url_key" xsi:type="string">configurable-product-%isolation%</data> - <data name="updatedProduct/data/configurable_attributes_data/preset" xsi:type="string">two_new_options_with_zero_products</data> - <data name="updatedProduct/data/checkout_data/preset" xsi:type="string">two_attributes</data> + <data name="updatedProduct/data/configurable_attributes_data/dataset" xsi:type="string">two_new_options_with_zero_products</data> + <data name="updatedProduct/data/checkout_data/dataset" xsi:type="string">configurable_two_attributes</data> <data name="updatedProduct/data/name" xsi:type="string">Configurable Product %isolation%</data> <data name="updatedProduct/data/sku" xsi:type="string">configurable_sku_%isolation%</data> <data name="updatedProduct/data/price/value" xsi:type="string">99</data> @@ -105,7 +105,7 @@ <data name="attributeTypeAction" xsi:type="string">addOptions</data> <data name="product" xsi:type="string">configurableProduct::two_options_with_fixed_price</data> <data name="updatedProduct/data/url_key" xsi:type="string">configurable-product-%isolation%</data> - <data name="updatedProduct/data/configurable_attributes_data/preset" xsi:type="string">one_new_options</data> + <data name="updatedProduct/data/configurable_attributes_data/dataset" xsi:type="string">one_new_options</data> <data name="updatedProduct/data/name" xsi:type="string">Configurable Product %isolation%</data> <data name="updatedProduct/data/sku" xsi:type="string">configurable_sku_%isolation%</data> <data name="updatedProduct/data/price/value" xsi:type="string">99</data> diff --git a/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/Fixture/CurrencySymbolEntity.xml b/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/Fixture/CurrencySymbolEntity.xml index 9b37f90342b5b9e52c0a7b3fa232d85409f6c41f..fd28c1bea9a9a50a37688ace0d0ae7a5500caad7 100644 --- a/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/Fixture/CurrencySymbolEntity.xml +++ b/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/Fixture/CurrencySymbolEntity.xml @@ -6,29 +6,20 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="currencySymbolEntity" module="Magento_CurrencySymbol" type="flat" entity_type="core_config_data" repository_class="Magento\CurrencySymbol\Test\Repository\CurrencySymbolEntity" handler_interface="Magento\CurrencySymbol\Test\Handler\CurrencySymbolEntity\CurrencySymbolEntityInterface" class="Magento\CurrencySymbol\Test\Fixture\CurrencySymbolEntity"> - <dataset name="default"> - <field name="inherit_custom_currency_symbol" xsi:type="string">Yes</field> - </dataset> - <field name="config_id" is_required="1"> - <default_value xsi:type="null"/> - </field> - <field name="scope" is_required=""> - <default_value xsi:type="string">default</default_value> - </field> - <field name="scope_id" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="path" is_required=""> - <default_value xsi:type="string">general</default_value> - </field> - <field name="value" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="inherit_custom_currency_symbol"> - <default_value xsi:type="string">Yes</default_value> - </field> - <field name="custom_currency_symbol"/> - <field name="code"/> - </fixture> + <fixture name="currencySymbolEntity" + module="Magento_CurrencySymbol" + type="flat" + entity_type="core_config_data" + repository_class="Magento\CurrencySymbol\Test\Repository\CurrencySymbolEntity" + handler_interface="Magento\CurrencySymbol\Test\Handler\CurrencySymbolEntity\CurrencySymbolEntityInterface" + class="Magento\CurrencySymbol\Test\Fixture\CurrencySymbolEntity"> + <field name="config_id" is_required="1" /> + <field name="scope" is_required="" /> + <field name="scope_id" is_required="" /> + <field name="path" is_required="" /> + <field name="value" is_required="" /> + <field name="inherit_custom_currency_symbol" /> + <field name="custom_currency_symbol" /> + <field name="code" /> + </fixture> </config> diff --git a/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/Repository/CurrencySymbolEntity.xml b/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/Repository/CurrencySymbolEntity.xml index 38a879960a771d8e8a1d8164810ee6463d47600d..36b144079a035234eee2307dc382f8b8112b7b7d 100644 --- a/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/Repository/CurrencySymbolEntity.xml +++ b/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/Repository/CurrencySymbolEntity.xml @@ -7,6 +7,10 @@ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> <repository class="Magento\CurrencySymbol\Test\Repository\CurrencySymbolEntity"> + <dataset name="default"> + <field name="inherit_custom_currency_symbol" xsi:type="string">Yes</field> + </dataset> + <dataset name="currency_symbols_uah"> <field name="custom_currency_symbol" xsi:type="array"> <item name="UAH" xsi:type="string">custom</item> diff --git a/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/TestCase/AbstractCurrencySymbolEntityTest.php b/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/TestCase/AbstractCurrencySymbolEntityTest.php index 5be6ff8e8e5da8d09fc80e6ca5252ca94700bbb0..acc4e79d62648c4cdfd33d5118ead60c04f83d61 100644 --- a/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/TestCase/AbstractCurrencySymbolEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/TestCase/AbstractCurrencySymbolEntityTest.php @@ -56,7 +56,7 @@ abstract class AbstractCurrencySymbolEntityTest extends Injectable $this->fixtureFactory = $fixtureFactory; $product = $this->fixtureFactory->createByCode( 'catalogProductSimple', - ['dataSet' => 'product_with_category'] + ['dataset' => 'product_with_category'] ); $product->persist(); diff --git a/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/TestCase/ResetCurrencySymbolEntityTest.xml b/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/TestCase/ResetCurrencySymbolEntityTest.xml index 4a68b882263ee5d79e382f900412f98f1d07d78d..f66c1df25289b3951d83f0d32216ab6c8f0de01e 100644 --- a/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/TestCase/ResetCurrencySymbolEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/TestCase/ResetCurrencySymbolEntityTest.xml @@ -9,7 +9,7 @@ <testCase name="Magento\CurrencySymbol\Test\TestCase\ResetCurrencySymbolEntityTest"> <variation name="ResetCurrencySymbolEntityTestVariation1" firstConstraint="Magento\CurrencySymbol\Test\Constraint\AssertCurrencySymbolSuccessSaveMessage" method="test"> <data name="configData" xsi:type="string">config_currency_symbols_usd_and_uah</data> - <data name="currencySymbolOriginal/dataSet" xsi:type="string">currency_symbols_uah</data> + <data name="currencySymbolOriginal/dataset" xsi:type="string">currency_symbols_uah</data> <data name="currencySymbol/data/code" xsi:type="string">UAH</data> <data name="currencySymbolDefault" xsi:type="string">₴</data> <data name="currencySymbol/data/inherit_custom_currency_symbol" xsi:type="string">Yes</data> diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnCustomerForm.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnCustomerForm.php index b06fc4feddb1fa5bbcac49d3e5d285d0be92fc7d..d0f38165dea70abbc733a66ba53d78a752e7e214 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnCustomerForm.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnCustomerForm.php @@ -37,7 +37,7 @@ class AssertCustomerGroupOnCustomerForm extends AbstractConstraint $customer = $fixtureFactory->createByCode( 'customer', [ - 'dataSet' => 'defaultBackend', + 'dataset' => 'defaultBackend', 'data' => ['group_id' => ['customerGroup' => $customerGroup]] ] ); diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerPasswordChanged.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerPasswordChanged.php index 690b437961fdda4ecfe5b72efab32493debfcb9f..059ca378bc37a9f7a0ed80e674b74ef9921f83fc 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerPasswordChanged.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerPasswordChanged.php @@ -38,7 +38,7 @@ class AssertCustomerPasswordChanged extends AbstractConstraint $customer = $fixtureFactory->createByCode( 'customer', [ - 'dataSet' => 'default', + 'dataset' => 'default', 'data' => [ 'email' => $initialCustomer->getEmail(), 'password' => $customer->getPassword(), diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Address.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Address.xml index 09e93bbf76968ec5a9dc5cdcaec363c71607cb39..2493ece8b746748f07b73567128c23b5c7dce1c5 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Address.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Address.xml @@ -6,84 +6,35 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="address" module="Magento_Customer" type="eav" entity_type="customer_address" collection="Magento\Customer\Model\Resource\Address\Collection" repository_class="Magento\Customer\Test\Repository\Address" handler_interface="Magento\Customer\Test\Handler\Address\AddressInterface" class="Magento\Customer\Test\Fixture\Address"> - <dataset name="default"> - <field name="firstname" xsi:type="string">John</field> - <field name="lastname" xsi:type="string">Doe</field> - <field name="email" xsi:type="string">John.Doe%isolation%@example.com</field> - <field name="company" xsi:type="string">Magento %isolation%</field> - <field name="street" xsi:type="string">6161 West Centinela Avenue</field> - <field name="city" xsi:type="string">Culver City</field> - <field name="region_id" xsi:type="string">California</field> - <field name="postcode" xsi:type="string">90230</field> - <field name="country_id" xsi:type="string">United States</field> - <field name="telephone" xsi:type="string">555-55-555-55</field> - </dataset> - <field name="city" is_required="1"> - <default_value xsi:type="string">Culver City</default_value> - </field> - <field name="default_billing" is_required="1"> - <default_value xsi:type="null"/> - </field> - <field name="default_shipping" is_required="1"> - <default_value xsi:type="null"/> - </field> - <field name="company" is_required="0"> - <default_value xsi:type="string">Magento %isolation%</default_value> - </field> - <field name="country_id" is_required="1"> - <default_value xsi:type="string">United States</default_value> - </field> - <field name="fax" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="firstname" is_required="1"> - <default_value xsi:type="string">John</default_value> - </field> - <field name="lastname" is_required="1"> - <default_value xsi:type="string">Doe</default_value> - </field> - <field name="email" is_required="1"> - <default_value xsi:type="string">John.Doe%isolation%@example.com</default_value> - </field> - <field name="middlename" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="postcode" is_required="0"> - <default_value xsi:type="string">90230</default_value> - </field> - <field name="prefix" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="region" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="region_id" is_required="0"> - <default_value xsi:type="string">California</default_value> - </field> - <field name="street" is_required="1"> - <default_value xsi:type="string">6161 West Centinela Avenue</default_value> - </field> - <field name="suffix" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="telephone" is_required="1"> - <default_value xsi:type="string">555-55-555-55</default_value> - </field> - <field name="vat_id" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="vat_is_valid" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="vat_request_date" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="vat_request_id" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="vat_request_success" is_required="0"> - <default_value xsi:type="null"/> - </field> - </fixture> + <fixture name="address" + module="Magento_Customer" + type="eav" + entity_type="customer_address" + collection="Magento\Customer\Model\Resource\Address\Collection" + repository_class="Magento\Customer\Test\Repository\Address" + handler_interface="Magento\Customer\Test\Handler\Address\AddressInterface" + class="Magento\Customer\Test\Fixture\Address"> + <field name="city" is_required="1" /> + <field name="default_billing" is_required="1" /> + <field name="default_shipping" is_required="1" /> + <field name="company" is_required="0" /> + <field name="country_id" is_required="1" /> + <field name="fax" is_required="0" /> + <field name="firstname" is_required="1" /> + <field name="lastname" is_required="1" /> + <field name="email" is_required="1" /> + <field name="middlename" is_required="0" /> + <field name="postcode" is_required="0" /> + <field name="prefix" is_required="0" /> + <field name="region" is_required="0" /> + <field name="region_id" is_required="0" /> + <field name="street" is_required="1" /> + <field name="suffix" is_required="0" /> + <field name="telephone" is_required="1" /> + <field name="vat_id" is_required="0" /> + <field name="vat_is_valid" is_required="0" /> + <field name="vat_request_date" is_required="0" /> + <field name="vat_request_id" is_required="0" /> + <field name="vat_request_success" is_required="0" /> + </fixture> </config> diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Customer.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Customer.xml index fe4bdb7814a700b02ed39663d62dc2b11379f814..143efd72a580f14ec2ddf86fdb6de2ee3cb185d9 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Customer.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Customer.xml @@ -6,92 +6,42 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="customer" module="Magento_Customer" type="eav" entity_type="customer" collection="Magento\Customer\Model\Resource\Customer\Collection" identifier="email" repository_class="Magento\Customer\Test\Repository\Customer" handler_interface="Magento\Customer\Test\Handler\Customer\CustomerInterface" class="Magento\Customer\Test\Fixture\Customer"> - <dataset name="default"> - <field name="firstname" xsi:type="string">John</field> - <field name="lastname" xsi:type="string">Doe</field> - <field name="group_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">General</item> - </field> - <field name="email" xsi:type="string">John.Doe%isolation%@example.com</field> - <field name="password" xsi:type="string">123123q</field> - <field name="password_confirmation" xsi:type="string">123123q</field> - </dataset> - <field name="address" source="Magento\Customer\Test\Fixture\Customer\Address" group="addresses"/> - <field name="confirmation" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="id" group="null"/> - <field name="created_at" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="created_in" is_required="0" group="account_information"> - <default_value xsi:type="null"/> - </field> - <field name="default_billing" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="default_shipping" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="disable_auto_group_change" is_required="0" group="account_information"> - <default_value xsi:type="null"/> - </field> - <field name="dob" is_required="0" group="account_information"> - <default_value xsi:type="null"/> - </field> - <field name="email" is_required="1" group="account_information"> - <default_value xsi:type="string">John.Doe%isolation%@example.com</default_value> - </field> - <field name="firstname" is_required="1" group="account_information"> - <default_value xsi:type="string">John</default_value> - </field> - <field name="gender" is_required="0" group="account_information"> - <default_value xsi:type="null"/> - </field> - <field name="group_id" is_required="1" group="account_information" source="Magento\Customer\Test\Fixture\Customer\GroupId"> - <default_value xsi:type="null"/> - </field> - <field name="lastname" is_required="1" group="account_information"> - <default_value xsi:type="string">Doe</default_value> - </field> - <field name="middlename" is_required="0" group="account_information"> - <default_value xsi:type="null"/> - </field> - <field name="password_hash" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="prefix" is_required="0" group="account_information"> - <default_value xsi:type="null"/> - </field> - <field name="rp_token" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="rp_token_created_at" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="store_id" is_required="1" group="account_information"> - <default_value xsi:type="null"/> - </field> - <field name="suffix" is_required="0" group="account_information"> - <default_value xsi:type="null"/> - </field> - <field name="taxvat" is_required="0" group="account_information"> - <default_value xsi:type="null"/> - </field> - <field name="website_id" is_required="1" group="account_information"> - <default_value xsi:type="null"/> - </field> - <field name="amount_delta" is_required="1" group="store_credit"> - <default_value xsi:type="null"/> - </field> - <field name="is_subscribed"/> - <field name="password" group="null"> - <default_value xsi:type="string">123123q</default_value> - </field> - <field name="password_confirmation" group="null"> - <default_value xsi:type="string">123123q</default_value> - </field> - <field name="current_password" group="null"/> - </fixture> + <fixture name="customer" + module="Magento_Customer" + type="eav" + entity_type="customer" + collection="Magento\Customer\Model\Resource\Customer\Collection" + identifier="email" + repository_class="Magento\Customer\Test\Repository\Customer" + handler_interface="Magento\Customer\Test\Handler\Customer\CustomerInterface" + class="Magento\Customer\Test\Fixture\Customer"> + <field name="address" source="Magento\Customer\Test\Fixture\Customer\Address" group="addresses" /> + <field name="confirmation" is_required="0" /> + <field name="id" group="null" /> + <field name="created_at" is_required="0" /> + <field name="created_in" is_required="0" group="account_information" /> + <field name="default_billing" is_required="0" /> + <field name="default_shipping" is_required="0" /> + <field name="disable_auto_group_change" is_required="0" group="account_information" /> + <field name="dob" is_required="0" group="account_information" /> + <field name="email" is_required="1" group="account_information" /> + <field name="firstname" is_required="1" group="account_information" /> + <field name="gender" is_required="0" group="account_information" /> + <field name="group_id" is_required="1" group="account_information" source="Magento\Customer\Test\Fixture\Customer\GroupId" /> + <field name="lastname" is_required="1" group="account_information" /> + <field name="middlename" is_required="0" group="account_information" /> + <field name="password_hash" is_required="0" /> + <field name="prefix" is_required="0" group="account_information" /> + <field name="rp_token" is_required="0" /> + <field name="rp_token_created_at" is_required="0" /> + <field name="store_id" is_required="1" group="account_information" /> + <field name="suffix" is_required="0" group="account_information" /> + <field name="taxvat" is_required="0" group="account_information" /> + <field name="website_id" is_required="1" group="account_information" /> + <field name="amount_delta" is_required="1" group="store_credit" /> + <field name="is_subscribed" /> + <field name="password" group="null" /> + <field name="password_confirmation" group="null" /> + <field name="current_password" group="null" /> + </fixture> </config> diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Customer/Address.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Customer/Address.php index b381e4d91081885562031cc26cdc469bde919c45..32ba4b160a5d6fcdfe5bcc6f02ca43f03f5e75bf 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Customer/Address.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Customer/Address.php @@ -6,30 +6,15 @@ namespace Magento\Customer\Test\Fixture\Customer; -use Magento\Customer\Test\Fixture\Address as AddressFixture; +use Magento\Mtf\Fixture\DataSource; use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Mtf\Fixture\FixtureInterface; +use Magento\Customer\Test\Fixture\Address as AddressFixture; /** - * Class Address - * Addresses source for customer fixture + * Addresses source for customer fixture. */ -class Address implements FixtureInterface +class Address extends DataSource { - /** - * Source data - * - * @var array - */ - protected $data = []; - - /** - * Source parameters - * - * @var array - */ - protected $params; - /** * Customer addresses fixture * @@ -38,8 +23,7 @@ class Address implements FixtureInterface protected $addressesFixture; /** - * Source constructor - * + * @constructor * @param FixtureFactory $fixtureFactory * @param array $params * @param array $data @@ -48,15 +32,15 @@ class Address implements FixtureInterface { $this->params = $params; - if (isset($data['presets'])) { - $data['presets'] = array_map('trim', explode(',', $data['presets'])); - foreach ($data['presets'] as $value) { + if (isset($data['dataset'])) { + $data['dataset'] = array_map('trim', explode(',', $data['dataset'])); + foreach ($data['dataset'] as $value) { /** @var AddressFixture $address*/ - $address = $fixtureFactory->createByCode('address', ['dataSet' => $value]); + $address = $fixtureFactory->createByCode('address', ['dataset' => $value]); $this->data[] = $address->getData(); $this->addressesFixture[] = $address; } - } elseif (empty($data['presets']) && !empty($data['addresses'])) { + } elseif (empty($data['dataset']) && !empty($data['addresses'])) { foreach ($data['addresses'] as $address) { /** @var AddressFixture $address */ $this->data[] = $address->getData(); @@ -66,38 +50,7 @@ class Address implements FixtureInterface } /** - * 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 + * Getting addresses fixture. * * @return array */ diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Customer/GroupId.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Customer/GroupId.php index 592fe020ec1327e3b04bf0ac7d9f9ebec58a726f..f7f0b896469901c228175d48b1ebc824d09e13d6 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Customer/GroupId.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Customer/GroupId.php @@ -6,40 +6,24 @@ namespace Magento\Customer\Test\Fixture\Customer; -use Magento\Customer\Test\Fixture\CustomerGroup; +use Magento\Mtf\Fixture\DataSource; use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Mtf\Fixture\FixtureInterface; +use Magento\Customer\Test\Fixture\CustomerGroup; /** - * Class GroupId - * Addresses source for customer fixture + * Addresses source for customer fixture. */ -class GroupId implements FixtureInterface +class GroupId extends DataSource { /** - * Source data - * - * @var array - */ - protected $data = []; - - /** - * Source parameters - * - * @var array - */ - protected $params; - - /** - * Customer Group fixture + * Customer Group fixture. * * @var array */ protected $customerGroupFixture; /** - * Source constructor - * + * @constructor * @param FixtureFactory $fixtureFactory * @param array $params * @param array $data @@ -47,9 +31,9 @@ class GroupId implements FixtureInterface public function __construct(FixtureFactory $fixtureFactory, array $params, array $data = []) { $this->params = $params; - if (isset($data['dataSet'])) { + if (isset($data['dataset'])) { /** @var CustomerGroup $customerGroup */ - $customerGroup = $fixtureFactory->createByCode('customerGroup', ['dataSet' => $data['dataSet']]); + $customerGroup = $fixtureFactory->createByCode('customerGroup', ['dataset' => $data['dataset']]); if (!$customerGroup->hasData('customer_group_id')) { $customerGroup->persist(); } @@ -66,39 +50,7 @@ class GroupId implements FixtureInterface } /** - * 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 + * Getting customer group fixture. * * @return array */ diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/CustomerGroup.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/CustomerGroup.xml index 46083535c8cde1eae96b9870c761a34689b1a33d..bd0e52cf844d8691b8a95c88a46fa6c15e985d3b 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/CustomerGroup.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/CustomerGroup.xml @@ -6,21 +6,16 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="customerGroup" module="Magento_Customer" type="flat" entity_type="customer_group" collection="Magento\Customer\Model\Resource\Group\Collection" repository_class="Magento\Customer\Test\Repository\CustomerGroup" handler_interface="Magento\Customer\Test\Handler\CustomerGroup\CustomerGroupInterface" class="Magento\Customer\Test\Fixture\CustomerGroup"> - <dataset name="default"> - <field name="customer_group_code" xsi:type="string">customer_code_%isolation%</field> - <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">customer_tax_class</item> - </field> - </dataset> - <field name="customer_group_code" is_required="1"> - <default_value xsi:type="string">customer_code_%isolation%</default_value> - </field> - <field name="tax_class_id" is_required="1" source="Magento\Customer\Test\Fixture\CustomerGroup\TaxClassIds"> - <default_value xsi:type="array"> - <item name="dataSet" xsi:type="string">customer_tax_class</item> - </default_value> - </field> + <fixture name="customerGroup" + module="Magento_Customer" + type="flat" + entity_type="customer_group" + collection="Magento\Customer\Model\Resource\Group\Collection" + repository_class="Magento\Customer\Test\Repository\CustomerGroup" + handler_interface="Magento\Customer\Test\Handler\CustomerGroup\CustomerGroupInterface" + class="Magento\Customer\Test\Fixture\CustomerGroup"> + <field name="customer_group_code" is_required="1" /> + <field name="tax_class_id" is_required="1" source="Magento\Customer\Test\Fixture\CustomerGroup\TaxClassIds" /> <field name="customer_group_id" /> </fixture> </config> diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/CustomerGroup/TaxClassIds.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/CustomerGroup/TaxClassIds.php index db297d43bb3bbe9165cacff046042e5ea5489fa7..347c238fc3726cd9070b392c3e74a4fdf4e4ae2b 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/CustomerGroup/TaxClassIds.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/CustomerGroup/TaxClassIds.php @@ -6,25 +6,18 @@ namespace Magento\Customer\Test\Fixture\CustomerGroup; +use Magento\Mtf\Fixture\DataSource; use Magento\Tax\Test\Fixture\TaxClass; use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Mtf\Fixture\FixtureInterface; /** * Class TaxClassIds * * Data keys: - * - dataSet + * - dataset */ -class TaxClassIds implements FixtureInterface +class TaxClassIds extends DataSource { - /** - * Tax class name - * - * @var string - */ - protected $data; - /** * TaxClass fixture * @@ -33,6 +26,7 @@ class TaxClassIds implements FixtureInterface protected $taxClass; /** + * @constructor * @param FixtureFactory $fixtureFactory * @param array $params * @param array $data @@ -43,10 +37,10 @@ class TaxClassIds implements FixtureInterface array $data ) { $this->params = $params; - if (isset($data['dataSet']) && $data['dataSet'] !== '-') { - $dataSet = $data['dataSet']; + if (isset($data['dataset'])) { + $dataset = $data['dataset']; /** @var \Magento\Tax\Test\Fixture\TaxClass $taxClass */ - $taxClass = $fixtureFactory->createByCode('taxClass', ['dataSet' => $dataSet]); + $taxClass = $fixtureFactory->createByCode('taxClass', ['dataset' => $dataset]); if (!$taxClass->hasData('id')) { $taxClass->persist(); } @@ -55,29 +49,6 @@ class TaxClassIds implements FixtureInterface } } - /** - * Persist custom selections products - * - * @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 * @@ -87,14 +58,4 @@ class TaxClassIds implements FixtureInterface { return $this->taxClass; } - - /** - * Return data set configuration settings - * - * @return string - */ - public function getDataConfig() - { - return $this->params; - } } diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Address.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Address.xml index f3b5f5764e27903e94d5dacbe807ddcdb7a5a071..bca31130341c1d56f8ea3d42274b079abc5c0cf0 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Address.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Address.xml @@ -7,6 +7,19 @@ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> <repository class="Magento\Customer\Test\Repository\Address"> + <dataset name="default"> + <field name="firstname" xsi:type="string">John</field> + <field name="lastname" xsi:type="string">Doe</field> + <field name="email" xsi:type="string">John.Doe%isolation%@example.com</field> + <field name="company" xsi:type="string">Magento %isolation%</field> + <field name="street" xsi:type="string">6161 West Centinela Avenue</field> + <field name="city" xsi:type="string">Culver City</field> + <field name="region_id" xsi:type="string">California</field> + <field name="postcode" xsi:type="string">90230</field> + <field name="country_id" xsi:type="string">United States</field> + <field name="telephone" xsi:type="string">555-55-555-55</field> + </dataset> + <dataset name="US_address"> <field name="firstname" xsi:type="string">John</field> <field name="lastname" xsi:type="string">Doe</field> @@ -186,7 +199,7 @@ <field name="street" xsi:type="string">172, Westminster Bridge Rd</field> <field name="postcode" xsi:type="string">SE1 7RW</field> <field name="country_id" xsi:type="string">United Kingdom</field> - <field name="region_id" xsi:type="string">London</field> + <field name="region" xsi:type="string">London</field> <field name="telephone" xsi:type="string">444-44-444-44</field> <field name="vat_id" xsi:type="string">584451913</field> <field name="default_billing" xsi:type="string">Yes</field> diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Customer.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Customer.xml index 2dc95ab415c6d8bebb759f0726e17366ed87a627..15df2b81f2518ed677cb21e5a3b9a3692808c093 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Customer.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Customer.xml @@ -11,7 +11,7 @@ <field name="firstname" xsi:type="string">John</field> <field name="lastname" xsi:type="string">Doe</field> <field name="group_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">General</item> + <item name="dataset" xsi:type="string">General</item> </field> <field name="email" xsi:type="string">JohnDoe_%isolation%@example.com</field> <field name="password" xsi:type="string">123123q</field> @@ -22,7 +22,7 @@ <field name="firstname" xsi:type="string">John</field> <field name="lastname" xsi:type="string">Doe</field> <field name="group_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">customer_group_retail_customer</item> + <item name="dataset" xsi:type="string">customer_group_retail_customer</item> </field> <field name="email" xsi:type="string">JohnDoe_%isolation%@example.com</field> <field name="password" xsi:type="string">123123q</field> @@ -38,7 +38,7 @@ <field name="dob" xsi:type="string">01/01/1990</field> <field name="gender" xsi:type="string">Male</field> <field name="group_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">General</item> + <item name="dataset" xsi:type="string">General</item> </field> </dataset> @@ -46,7 +46,7 @@ <field name="firstname" xsi:type="string">John</field> <field name="lastname" xsi:type="string">Doe</field> <field name="group_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">Retailer</item> + <item name="dataset" xsi:type="string">Retailer</item> </field> <field name="email" xsi:type="string">JohnDoe_%isolation%@example.com</field> <field name="password" xsi:type="string">123123q</field> @@ -66,13 +66,13 @@ <field name="firstname" xsi:type="string">John</field> <field name="lastname" xsi:type="string">Doe</field> <field name="group_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">General</item> + <item name="dataset" xsi:type="string">General</item> </field> <field name="email" xsi:type="string">JohnDoe_%isolation%@example.com</field> <field name="password" xsi:type="string">123123q</field> <field name="password_confirmation" xsi:type="string">123123q</field> <field name="address" xsi:type="array"> - <item name="presets" xsi:type="string">US_address</item> + <item name="dataset" xsi:type="string">US_address</item> </field> </dataset> @@ -80,13 +80,13 @@ <field name="firstname" xsi:type="string">John</field> <field name="lastname" xsi:type="string">Doe%isolation%</field> <field name="group_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">General</item> + <item name="dataset" xsi:type="string">General</item> </field> <field name="email" xsi:type="string">JohnDoe_%isolation%@example.com</field> <field name="password" xsi:type="string">123123q</field> <field name="password_confirmation" xsi:type="string">123123q</field> <field name="address" xsi:type="array"> - <item name="presets" xsi:type="string">US_address_NY</item> + <item name="dataset" xsi:type="string">US_address_NY</item> </field> </dataset> @@ -94,13 +94,13 @@ <field name="firstname" xsi:type="string">John</field> <field name="lastname" xsi:type="string">Doe%isolation%</field> <field name="group_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">General</item> + <item name="dataset" xsi:type="string">General</item> </field> <field name="email" xsi:type="string">JohnDoe_%isolation%@example.com</field> <field name="password" xsi:type="string">123123q</field> <field name="password_confirmation" xsi:type="string">123123q</field> <field name="address" xsi:type="array"> - <item name="presets" xsi:type="string">US_address_TX</item> + <item name="dataset" xsi:type="string">US_address_TX</item> </field> </dataset> @@ -108,13 +108,13 @@ <field name="firstname" xsi:type="string">John</field> <field name="lastname" xsi:type="string">Doe%isolation%</field> <field name="group_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">General</item> + <item name="dataset" xsi:type="string">General</item> </field> <field name="email" xsi:type="string">JohnDoe_%isolation%@example.com</field> <field name="password" xsi:type="string">123123q</field> <field name="password_confirmation" xsi:type="string">123123q</field> <field name="address" xsi:type="array"> - <item name="presets" xsi:type="string">US_address_NY, US_address</item> + <item name="dataset" xsi:type="string">US_address_NY, US_address</item> </field> </dataset> @@ -122,13 +122,13 @@ <field name="firstname" xsi:type="string">John</field> <field name="lastname" xsi:type="string">Doe%isolation%</field> <field name="group_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">General</item> + <item name="dataset" xsi:type="string">General</item> </field> <field name="email" xsi:type="string">John.Doe%isolation%@example.com</field> <field name="password" xsi:type="string">123123q</field> <field name="password_confirmation" xsi:type="string">123123q</field> <field name="address" xsi:type="array"> - <item name="presets" xsi:type="string">US_address_1</item> + <item name="dataset" xsi:type="string">US_address_1</item> </field> </dataset> @@ -136,13 +136,13 @@ <field name="firstname" xsi:type="string">John</field> <field name="lastname" xsi:type="string">Doe%isolation%</field> <field name="group_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">Retailer</item> + <item name="dataset" xsi:type="string">Retailer</item> </field> <field name="email" xsi:type="string">John.Doe%isolation%@example.com</field> <field name="password" xsi:type="string">123123q</field> <field name="password_confirmation" xsi:type="string">123123q</field> <field name="address" xsi:type="array"> - <item name="presets" xsi:type="string">US_address_1</item> + <item name="dataset" xsi:type="string">US_address_1</item> </field> </dataset> @@ -153,7 +153,7 @@ <field name="password" xsi:type="string">123123q</field> <field name="password_confirmation" xsi:type="string">123123q</field> <field name="address" xsi:type="array"> - <item name="presets" xsi:type="string">US_address_1</item> + <item name="dataset" xsi:type="string">US_address_1</item> </field> </dataset> @@ -164,7 +164,7 @@ <field name="password" xsi:type="string">123123q</field> <field name="password_confirmation" xsi:type="string">123123q</field> <field name="address" xsi:type="array"> - <item name="presets" xsi:type="string">UK_address_default_billing</item> + <item name="dataset" xsi:type="string">UK_address_default_billing</item> </field> </dataset> @@ -175,7 +175,7 @@ <field name="password" xsi:type="string">123123q</field> <field name="password_confirmation" xsi:type="string">123123q</field> <field name="address" xsi:type="array"> - <item name="presets" xsi:type="string">UK_address_with_VAT</item> + <item name="dataset" xsi:type="string">UK_address_with_VAT</item> </field> </dataset> </repository> diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/CustomerGroup.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/CustomerGroup.xml index 6f495c88b95e7bb1d8c91b4b936a1a768a3925b7..dd472330ed3f0d2bd41905bbce15a289ecaeccbe 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/CustomerGroup.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/CustomerGroup.xml @@ -7,11 +7,18 @@ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> <repository class="Magento\Customer\Test\Repository\CustomerGroup"> + <dataset name="default"> + <field name="customer_group_code" xsi:type="string">customer_code_%isolation%</field> + <field name="tax_class_id" xsi:type="array"> + <item name="dataset" xsi:type="string">customer_tax_class</item> + </field> + </dataset> + <dataset name="General"> <field name="customer_group_id" xsi:type="string">1</field> <field name="customer_group_code" xsi:type="string">General</field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">retail_customer</item> + <item name="dataset" xsi:type="string">retail_customer</item> </field> </dataset> @@ -19,7 +26,7 @@ <field name="customer_group_id" xsi:type="string">3</field> <field name="customer_group_code" xsi:type="string">Retailer</field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">retail_customer</item> + <item name="dataset" xsi:type="string">retail_customer</item> </field> </dataset> @@ -27,7 +34,7 @@ <field name="customer_group_id" xsi:type="string">2</field> <field name="customer_group_code" xsi:type="string">Wholesale</field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">retail_customer</item> + <item name="dataset" xsi:type="string">retail_customer</item> </field> </dataset> @@ -40,42 +47,42 @@ <field name="customer_group_id" xsi:type="string">0</field> <field name="customer_group_code" xsi:type="string">NOT LOGGED IN</field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">retail_customer</item> + <item name="dataset" xsi:type="string">retail_customer</item> </field> </dataset> <dataset name="customer_group_retail_customer"> <field name="customer_group_code" xsi:type="string">Customer_group_%isolation%</field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">retail_customer</item> + <item name="dataset" xsi:type="string">retail_customer</item> </field> </dataset> <dataset name="valid_vat_id_domestic"> <field name="customer_group_code" xsi:type="string">Valid VAT ID Domestic %isolation%</field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">retail_customer</item> + <item name="dataset" xsi:type="string">retail_customer</item> </field> </dataset> <dataset name="valid_vat_id_intra_union"> <field name="customer_group_code" xsi:type="string">Valid VAT ID Intra %isolation%</field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">retail_customer</item> + <item name="dataset" xsi:type="string">retail_customer</item> </field> </dataset> <dataset name="invalid_vat_id"> <field name="customer_group_code" xsi:type="string">Invalid VAT ID %isolation%</field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">retail_customer</item> + <item name="dataset" xsi:type="string">retail_customer</item> </field> </dataset> <dataset name="validation_error_vat_id"> <field name="customer_group_code" xsi:type="string">Error VAT ID %isolation%</field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">retail_customer</item> + <item name="dataset" xsi:type="string">retail_customer</item> </field> </dataset> </repository> diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/AbstractApplyVatIdTest.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/AbstractApplyVatIdTest.php index 4389e18c6164363fd3aeb6851c5d5f9f1bdfaa7e..23030f07c0819ce6cb49667c7f1082f21f21aee2 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/AbstractApplyVatIdTest.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/AbstractApplyVatIdTest.php @@ -67,9 +67,9 @@ abstract class AbstractApplyVatIdTest extends Injectable { $this->fixtureFactory = $fixtureFactory; - foreach ($this->vatGroupDataSets as $group => $dataSet) { + foreach ($this->vatGroupDataSets as $group => $dataset) { /** @var CustomerGroup $groupFixture */ - $groupFixture = $this->fixtureFactory->createByCode('customerGroup', ['dataSet' => $dataSet]); + $groupFixture = $this->fixtureFactory->createByCode('customerGroup', ['dataset' => $dataset]); $groupFixture->persist(); $this->vatGroups[$group] = $groupFixture; } diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ApplyVatIdTest.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ApplyVatIdTest.xml index e381864c2850e00139e306b693033ed0c3ada15d..255ac6f90738e2b5064acf46f7d3f72897c81f11 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ApplyVatIdTest.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ApplyVatIdTest.xml @@ -9,9 +9,9 @@ <testCase name="Magento\Customer\Test\TestCase\ApplyVatIdTest"> <variation name="ApplyVatIdTestVariation1"> <data name="description" xsi:type="string">MAGETWO-12447: Enable Automatic Assignment of Customers to Appropriate VAT Group (valid Intra-Union group).</data> - <data name="vatConfig/dataSet" xsi:type="string">enable_VAT_on_frontend</data> + <data name="vatConfig/dataset" xsi:type="string">enable_VAT_on_frontend</data> <data name="configData" xsi:type="string">store_information_DE_with_VAT, enable_VAT_on_frontend</data> - <data name="customer/dataSet" xsi:type="string">customer_UK_1_default_billing_address</data> + <data name="customer/dataset" xsi:type="string">customer_UK_1_default_billing_address</data> <data name="vatId/data/vat_id" xsi:type="string">584451913</data> <data name="customerGroup" xsi:type="string">valid_intra_union_group</data> <data name="tag" xsi:type="string">test_type:3rd_party_test</data> @@ -20,9 +20,9 @@ </variation> <variation name="ApplyVatIdTestVariation2"> <data name="description" xsi:type="string">MAGETWO-12447: Enable Automatic Assignment of Customers to Appropriate VAT Group (invalid VAT ID group).</data> - <data name="vatConfig/dataSet" xsi:type="string">enable_VAT_on_frontend</data> + <data name="vatConfig/dataset" xsi:type="string">enable_VAT_on_frontend</data> <data name="configData" xsi:type="string">store_information_DE_with_VAT, enable_VAT_on_frontend</data> - <data name="customer/dataSet" xsi:type="string">customer_UK_1_default_billing_address</data> + <data name="customer/dataset" xsi:type="string">customer_UK_1_default_billing_address</data> <data name="vatId/data/vat_id" xsi:type="string">123456789</data> <data name="customerGroup" xsi:type="string">invalid_group</data> <data name="tag" xsi:type="string">test_type:3rd_party_test</data> diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ChangeCustomerPasswordTest.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ChangeCustomerPasswordTest.xml index d60ae3776821335480626a24a409cd99c426af2f..2d3334dfd508a132f64401c4bc6bc3ae669c19bc 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ChangeCustomerPasswordTest.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ChangeCustomerPasswordTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Customer\Test\TestCase\ChangeCustomerPasswordTest"> <variation name="ChangeCustomerPasswordTestVariation1"> - <data name="initialCustomer/dataSet" xsi:type="string">default</data> + <data name="initialCustomer/dataset" xsi:type="string">default</data> <data name="customer/data/current_password" xsi:type="string">123123q</data> <data name="customer/data/password" xsi:type="string">123123a</data> <data name="customer/data/password_confirmation" xsi:type="string">123123a</data> @@ -16,14 +16,14 @@ <constraint name="Magento\Customer\Test\Constraint\AssertCustomerPasswordChanged" /> </variation> <variation name="ChangeCustomerPasswordTestVariation2"> - <data name="initialCustomer/dataSet" xsi:type="string">default</data> + <data name="initialCustomer/dataset" xsi:type="string">default</data> <data name="customer/data/current_password" xsi:type="string">123123</data> <data name="customer/data/password" xsi:type="string">123123a</data> <data name="customer/data/password_confirmation" xsi:type="string">123123a</data> <constraint name="Magento\Customer\Test\Constraint\AssertChangePasswordFailMessage" /> </variation> <variation name="ChangeCustomerPasswordTestVariation3"> - <data name="initialCustomer/dataSet" xsi:type="string">default</data> + <data name="initialCustomer/dataset" xsi:type="string">default</data> <data name="customer/data/current_password" xsi:type="string">123123q</data> <data name="customer/data/password" xsi:type="string">123123a</data> <data name="customer/data/password_confirmation" xsi:type="string">123123</data> diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest.xml index cce2180d084f38348efe6fa02f2dd36c681ff877..1b511d97d5c331bf1c4b57a131d1b73c04fce674 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest.xml @@ -11,7 +11,7 @@ <data name="description" xsi:type="string">General customer without address</data> <data name="customerAction" xsi:type="string">save</data> <data name="customer/data/website_id" xsi:type="string">Main Website</data> - <data name="customer/data/group_id/dataSet" xsi:type="string">General</data> + <data name="customer/data/group_id/dataset" xsi:type="string">General</data> <data name="customer/data/prefix" xsi:type="string">-</data> <data name="customer/data/firstname" xsi:type="string">John%isolation%</data> <data name="customer/data/middlename" xsi:type="string">-</data> @@ -37,7 +37,7 @@ <data name="description" xsi:type="string">Customer with prefix</data> <data name="customerAction" xsi:type="string">save</data> <data name="customer/data/website_id" xsi:type="string">Admin</data> - <data name="customer/data/group_id/dataSet" xsi:type="string">Wholesale</data> + <data name="customer/data/group_id/dataset" xsi:type="string">Wholesale</data> <data name="customer/data/prefix" xsi:type="string">M</data> <data name="customer/data/firstname" xsi:type="string">John%isolation%</data> <data name="customer/data/middlename" xsi:type="string">Jack</data> @@ -63,7 +63,7 @@ <data name="description" xsi:type="string">General customer from USA</data> <data name="customerAction" xsi:type="string">save</data> <data name="customer/data/website_id" xsi:type="string">Main Website</data> - <data name="customer/data/group_id/dataSet" xsi:type="string">General</data> + <data name="customer/data/group_id/dataset" xsi:type="string">General</data> <data name="customer/data/prefix" xsi:type="string">-</data> <data name="customer/data/firstname" xsi:type="string">John%isolation%</data> <data name="customer/data/middlename" xsi:type="string">-</data> @@ -89,7 +89,7 @@ <data name="description" xsi:type="string">Retailer customer without address</data> <data name="customerAction" xsi:type="string">save</data> <data name="customer/data/website_id" xsi:type="string">Main Website</data> - <data name="customer/data/group_id/dataSet" xsi:type="string">Retailer</data> + <data name="customer/data/group_id/dataset" xsi:type="string">Retailer</data> <data name="customer/data/prefix" xsi:type="string">-</data> <data name="customer/data/firstname" xsi:type="string">John%isolation%</data> <data name="customer/data/middlename" xsi:type="string">-</data> @@ -113,7 +113,7 @@ <data name="description" xsi:type="string">General customer from Poland</data> <data name="customerAction" xsi:type="string">save</data> <data name="customer/data/website_id" xsi:type="string">Main Website</data> - <data name="customer/data/group_id/dataSet" xsi:type="string">General</data> + <data name="customer/data/group_id/dataset" xsi:type="string">General</data> <data name="customer/data/prefix" xsi:type="string">-</data> <data name="customer/data/firstname" xsi:type="string">Thomas%isolation%</data> <data name="customer/data/middlename" xsi:type="string">-</data> @@ -139,7 +139,7 @@ <data name="description" xsi:type="string">MAGETWO-12516: Create New Customer on Backend</data> <data name="customerAction" xsi:type="string">saveAndContinue</data> <data name="customer/data/website_id" xsi:type="string">Main Website</data> - <data name="customer/data/group_id/dataSet" xsi:type="string">General</data> + <data name="customer/data/group_id/dataset" xsi:type="string">General</data> <data name="customer/data/prefix" xsi:type="string">-</data> <data name="customer/data/firstname" xsi:type="string">John%isolation%</data> <data name="customer/data/middlename" xsi:type="string">-</data> diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerGroupEntityTest.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerGroupEntityTest.xml index a939641976d0a71b01f4a743d0d57eb171c3316f..acb4844ba124c939b88f4ca936a8d61378aed53e 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerGroupEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerGroupEntityTest.xml @@ -8,19 +8,19 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Customer\Test\TestCase\CreateCustomerGroupEntityTest"> <variation name="CreateCustomerGroupEntityTestVariation1"> - <data name="customerGroup/data/tax_class_id/dataSet" xsi:type="string">retail_customer</data> + <data name="customerGroup/data/tax_class_id/dataset" xsi:type="string">retail_customer</data> <data name="customerGroup/data/customer_group_code" xsi:type="string">GroupName%isolation%</data> <constraint name="Magento\Customer\Test\Constraint\AssertCustomerGroupSuccessSaveMessage"/> <constraint name="Magento\Customer\Test\Constraint\AssertCustomerGroupInGrid"/> <constraint name="Magento\Customer\Test\Constraint\AssertCustomerGroupOnCustomerForm"/> </variation> <variation name="CreateCustomerGroupEntityTestVariation2"> - <data name="customerGroup/data/tax_class_id/dataSet" xsi:type="string">retail_customer</data> + <data name="customerGroup/data/tax_class_id/dataset" xsi:type="string">retail_customer</data> <data name="customerGroup/data/customer_group_code" xsi:type="string">General</data> <constraint name="Magento\Customer\Test\Constraint\AssertCustomerGroupAlreadyExists"/> </variation> <variation name="CreateCustomerGroupEntityTestVariation3"> - <data name="customerGroup/data/tax_class_id/dataSet" xsi:type="string">customer_tax_class</data> + <data name="customerGroup/data/tax_class_id/dataset" xsi:type="string">customer_tax_class</data> <data name="customerGroup/data/customer_group_code" xsi:type="string">GroupName%isolation%</data> <constraint name="Magento\Customer\Test\Constraint\AssertCustomerGroupSuccessSaveMessage"/> <constraint name="Magento\Customer\Test\Constraint\AssertCustomerGroupInGrid"/> diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/DeleteCustomerAddressTest.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/DeleteCustomerAddressTest.xml index d4c96eef41e1caf37de7b2357dbfba0dec7e7350..f71ac07a13422ba05de6961557c682111f018638 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/DeleteCustomerAddressTest.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/DeleteCustomerAddressTest.xml @@ -8,8 +8,8 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Customer\Test\TestCase\DeleteCustomerAddressTest"> <variation name="DeleteCustomerAddressTestVariation1"> - <data name="customer/dataSet" xsi:type="string">default</data> - <data name="customer/data/address/presets" xsi:type="string">US_address_default_billing,US_address_NY_default_no</data> + <data name="customer/dataset" xsi:type="string">default</data> + <data name="customer/data/address/dataset" xsi:type="string">US_address_default_billing,US_address_NY_default_no</data> <constraint name="Magento\Customer\Test\Constraint\AssertAddressDeletedFrontend"/> <constraint name="Magento\Customer\Test\Constraint\AssertAddressDeletedBackend"/> </variation> diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/DeleteCustomerBackendEntityTest.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/DeleteCustomerBackendEntityTest.xml index a3389e37677177489e80133273f51b9be1edc91d..efabd7c64bd78b87d0fb0339fa4433493bc950aa 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/DeleteCustomerBackendEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/DeleteCustomerBackendEntityTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Customer\Test\TestCase\DeleteCustomerBackendEntityTest"> <variation name="DeleteCustomerBackendEntityTestVariation1"> - <data name="customer/dataSet" xsi:type="string">default</data> + <data name="customer/dataset" xsi:type="string">default</data> <constraint name="Magento\Customer\Test\Constraint\AssertCustomerSuccessDeleteMessage"/> <constraint name="Magento\Customer\Test\Constraint\AssertCustomerNotInGrid"/> </variation> diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ForgotPasswordOnFrontendTest.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ForgotPasswordOnFrontendTest.xml index 42e10059a897b80bc35e7c0bccffb34f56469c75..32ef81cc1e2a84ffc4c26575c84f8d6b2a9f35a3 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ForgotPasswordOnFrontendTest.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ForgotPasswordOnFrontendTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Customer\Test\TestCase\ForgotPasswordOnFrontendTest"> <variation name="ForgotPasswordOnFrontendTestVariation1"> - <data name="customer/dataSet" xsi:type="string">customer_US</data> + <data name="customer/dataset" xsi:type="string">customer_US</data> <constraint name="Magento\Customer\Test\Constraint\AssertCustomerForgotPasswordSuccessMessage" /> </variation> </testCase> diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/MassAssignCustomerGroupTest.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/MassAssignCustomerGroupTest.xml index 336c0a5d7d0ece541a7708452f929f3aabaa549d..414eae3135f92a22ae8b43268851c32037937d6e 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/MassAssignCustomerGroupTest.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/MassAssignCustomerGroupTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Customer\Test\TestCase\MassAssignCustomerGroupTest"> <variation name="MassAssignCustomerGroupTestVariation1"> - <data name="customerGroup/dataSet" xsi:type="string">default</data> + <data name="customerGroup/dataset" xsi:type="string">default</data> <constraint name="Magento\Customer\Test\Constraint\AssertMassActionSuccessUpdateMessage"/> <constraint name="Magento\Customer\Test\Constraint\AssertCustomerGroupInGrid"/> </variation> diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/MassDeleteCustomerBackendEntityTest.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/MassDeleteCustomerBackendEntityTest.php index ef596fbdfa071f9775a9012f115c01386386ea19..b68c1850d0c5fb8d37d17456760d2d4707e79c5b 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/MassDeleteCustomerBackendEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/MassDeleteCustomerBackendEntityTest.php @@ -108,7 +108,7 @@ class MassDeleteCustomerBackendEntityTest extends Injectable { $customers = []; for ($i = 0; $i < $customersQty; $i++) { - $customer = $this->fixtureFactory->createByCode('customer', ['dataSet' => 'default']); + $customer = $this->fixtureFactory->createByCode('customer', ['dataset' => 'default']); $customer->persist(); $customers[] = $customer; } diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/MassDeleteCustomerBackendEntityTest.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/MassDeleteCustomerBackendEntityTest.xml index 8a97e9471b18e5f1860f087720b89319df698c02..a0de3c12b525f511543c421a39349f7f804002b6 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/MassDeleteCustomerBackendEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/MassDeleteCustomerBackendEntityTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Customer\Test\TestCase\MassDeleteCustomerBackendEntityTest"> <variation name="MassDeleteCustomerBackendEntityTestVariation1"> - <data name="customer/dataSet" xsi:type="string">default</data> + <data name="customer/dataset" xsi:type="string">default</data> <data name="customersQty" xsi:type="string">3</data> <data name="customersQtyToDelete" xsi:type="string">2</data> <constraint name="Magento\Customer\Test\Constraint\AssertCustomerMassDeleteSuccessMessage"/> diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerBackendEntityTest.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerBackendEntityTest.xml index 57257d4659d3d183ac762f91472080295de122a5..acff1c874d93c4f3ddac8688b3df8c3e78f66201 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerBackendEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerBackendEntityTest.xml @@ -8,8 +8,8 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Customer\Test\TestCase\UpdateCustomerBackendEntityTest"> <variation name="UpdateCustomerBackendEntityTestVariation1"> - <data name="initialCustomer/dataSet" xsi:type="string">default</data> - <data name="customer/data/group_id/dataSet" xsi:type="string">Wholesale</data> + <data name="initialCustomer/dataset" xsi:type="string">default</data> + <data name="customer/data/group_id/dataset" xsi:type="string">Wholesale</data> <data name="customer/data/prefix" xsi:type="string">%isolation%Prefix_</data> <data name="customer/data/firstname" xsi:type="string">John_%isolation%</data> <data name="customer/data/middlename" xsi:type="string">Middle Name %isolation%</data> @@ -39,8 +39,8 @@ <constraint name="Magento\Customer\Test\Constraint\AssertCustomerInGrid"/> </variation> <variation name="UpdateCustomerBackendEntityTestVariation2"> - <data name="initialCustomer/dataSet" xsi:type="string">default</data> - <data name="customer/data/group_id/dataSet" xsi:type="string">-</data> + <data name="initialCustomer/dataset" xsi:type="string">default</data> + <data name="customer/data/group_id/dataset" xsi:type="string">-</data> <data name="customer/data/prefix" xsi:type="string">-</data> <data name="customer/data/firstname" xsi:type="string">-</data> <data name="customer/data/middlename" xsi:type="string">-</data> @@ -70,8 +70,8 @@ <constraint name="Magento\Customer\Test\Constraint\AssertCustomerInGrid"/> </variation> <variation name="UpdateCustomerBackendEntityTestVariation3"> - <data name="initialCustomer/dataSet" xsi:type="string">default</data> - <data name="customer/data/group_id/dataSet" xsi:type="string">Retailer</data> + <data name="initialCustomer/dataset" xsi:type="string">default</data> + <data name="customer/data/group_id/dataset" xsi:type="string">Retailer</data> <data name="customer/data/prefix" xsi:type="string">%isolation%Prefix_</data> <data name="customer/data/firstname" xsi:type="string">Jane_%isolation%</data> <data name="customer/data/middlename" xsi:type="string">Jane Middle Name %isolation%</data> diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerGroupEntityTest.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerGroupEntityTest.xml index 84b8c3279a6c24eced069cf0dd761bde17cc8667..ca4632fbb4a23ea938c393717010ea437a6eb1dd 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerGroupEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerGroupEntityTest.xml @@ -9,7 +9,7 @@ <testCase name="Magento\Customer\Test\TestCase\UpdateCustomerGroupEntityTest"> <variation name="UpdateCustomerGroupEntityTestVariation1"> <data name="tag" xsi:type="string">stable:no</data> - <data name="customerGroup/data/tax_class_id/dataSet" xsi:type="string">retail_customer</data> + <data name="customerGroup/data/tax_class_id/dataset" xsi:type="string">retail_customer</data> <data name="customerGroup/data/customer_group_code" xsi:type="string">GroupName%isolation%</data> <constraint name="Magento\Customer\Test\Constraint\AssertCustomerGroupSuccessSaveMessage" /> <constraint name="Magento\Customer\Test\Constraint\AssertCustomerGroupInGrid" /> @@ -17,12 +17,12 @@ <constraint name="Magento\Customer\Test\Constraint\AssertCustomerGroupForm" /> </variation> <variation name="UpdateCustomerGroupEntityTestVariation2"> - <data name="customerGroup/data/tax_class_id/dataSet" xsi:type="string">-</data> + <data name="customerGroup/data/tax_class_id/dataset" xsi:type="string">-</data> <data name="customerGroup/data/customer_group_code" xsi:type="string">General</data> <constraint name="Magento\Customer\Test\Constraint\AssertCustomerGroupAlreadyExists" /> </variation> <variation name="UpdateCustomerGroupEntityTestVariation3"> - <data name="customerGroup/data/tax_class_id/dataSet" xsi:type="string">customer_tax_class</data> + <data name="customerGroup/data/tax_class_id/dataset" xsi:type="string">customer_tax_class</data> <data name="customerGroup/data/customer_group_code" xsi:type="string">Group Name %isolation%</data> <constraint name="Magento\Customer\Test\Constraint\AssertCustomerGroupSuccessSaveMessage" /> <constraint name="Magento\Customer\Test\Constraint\AssertCustomerGroupInGrid" /> @@ -30,7 +30,7 @@ <constraint name="Magento\Customer\Test\Constraint\AssertCustomerGroupForm" /> </variation> <variation name="UpdateCustomerGroupEntityTestVariation4"> - <data name="customerGroup/data/tax_class_id/dataSet" xsi:type="string">customer_tax_class</data> + <data name="customerGroup/data/tax_class_id/dataset" xsi:type="string">customer_tax_class</data> <data name="customerGroup/data/customer_group_code" xsi:type="string">Group#Name%isolation%</data> <constraint name="Magento\Customer\Test\Constraint\AssertCustomerGroupSuccessSaveMessage" /> <constraint name="Magento\Customer\Test\Constraint\AssertCustomerGroupInGrid" /> diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestStep/LogoutCustomerOnFrontendStep.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestStep/LogoutCustomerOnFrontendStep.php index df4f4ce87118ba8a339374b4feaef86b14546151..1ff30b1dcdf030fedef0e289d4b4d6c8076fc2f3 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestStep/LogoutCustomerOnFrontendStep.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestStep/LogoutCustomerOnFrontendStep.php @@ -7,8 +7,8 @@ namespace Magento\Customer\Test\TestStep; use Magento\Cms\Test\Page\CmsIndex; -use Magento\Customer\Test\Page\CustomerAccountLogout; use Magento\Mtf\TestStep\TestStepInterface; +use Magento\Customer\Test\Page\CustomerAccountIndex; /** * Logout customer on frontend. @@ -28,21 +28,21 @@ class LogoutCustomerOnFrontendStep implements TestStepInterface protected $cmsIndex; /** - * Customer logout page. + * Customer account page. * - * @var CustomerAccountLogout + * @var CustomerAccountIndex */ - protected $customerAccountLogout; + protected $customerAccount; /** * @constructor * @param CmsIndex $cmsIndex - * @param CustomerAccountLogout $customerAccountLogout + * @param CustomerAccountIndex $customerAccount */ - public function __construct(CmsIndex $cmsIndex, CustomerAccountLogout $customerAccountLogout) + public function __construct(CmsIndex $cmsIndex, CustomerAccountIndex $customerAccount) { $this->cmsIndex = $cmsIndex; - $this->customerAccountLogout = $customerAccountLogout; + $this->customerAccount = $customerAccount; } /** @@ -52,9 +52,8 @@ class LogoutCustomerOnFrontendStep implements TestStepInterface */ public function run() { - $this->cmsIndex->open(); + $this->customerAccount->open(); $this->cmsIndex->getCmsPageBlock()->waitPageInit(); - $this->cmsIndex->getCmsPageBlock()->waitUntilTextIsVisible('Home Page'); if ($this->cmsIndex->getLinksBlock()->isLinkVisible('Sign Out')) { $this->cmsIndex->getLinksBlock()->openLink('Sign Out'); $this->cmsIndex->getCmsPageBlock()->waitUntilTextIsVisible('Home Page'); diff --git a/dev/tests/functional/tests/app/Magento/Dhl/Test/TestCase/OnePageCheckoutTest.xml b/dev/tests/functional/tests/app/Magento/Dhl/Test/TestCase/OnePageCheckoutTest.xml index 6b6a97b9d49e62754c8340ec0d889e1ae13c77bd..fd74223e5fcee0c03bdf5ed0508fd6599be7804c 100644 --- a/dev/tests/functional/tests/app/Magento/Dhl/Test/TestCase/OnePageCheckoutTest.xml +++ b/dev/tests/functional/tests/app/Magento/Dhl/Test/TestCase/OnePageCheckoutTest.xml @@ -11,9 +11,9 @@ <data name="description" xsi:type="string">MAGETWO-12850 – Use DHL International (EU) Online Shipping Carrier on Checkout as a Registered Customer</data> <data name="products" xsi:type="string">catalogProductSimple::default, configurableProduct::default, bundleProduct::bundle_fixed_product</data> <data name="checkoutMethod" xsi:type="string">login</data> - <data name="customer/dataSet" xsi:type="string">customer_DE</data> - <data name="address/dataSet" xsi:type="string">customer_DE</data> - <data name="billingAddress/dataSet" xsi:type="string">customer_DE</data> + <data name="customer/dataset" xsi:type="string">customer_DE</data> + <data name="address/dataset" xsi:type="string">DE_address</data> + <data name="billingAddress/dataset" xsi:type="string">customer_DE</data> <data name="shipping/shipping_service" xsi:type="string">DHL</data> <data name="shipping/shipping_method" xsi:type="string">Express worldwide</data> <data name="cart/data/shipping_method" xsi:type="string">Express worldwide</data> diff --git a/dev/tests/functional/tests/app/Magento/Directory/Test/Fixture/CurrencyRate.xml b/dev/tests/functional/tests/app/Magento/Directory/Test/Fixture/CurrencyRate.xml index 70fcf15c962980ade05464ff3e6a8cebb9b66c85..8e9a51f944a7dab96f43db73dacf4163539c4f54 100644 --- a/dev/tests/functional/tests/app/Magento/Directory/Test/Fixture/CurrencyRate.xml +++ b/dev/tests/functional/tests/app/Magento/Directory/Test/Fixture/CurrencyRate.xml @@ -6,13 +6,15 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="currencyRate" module="Magento_Directory" type="flat" entity_type="directory_currency_rate" collection="Magento\Directory\Model\Resource\Currency" identifier="" repository_class="Magento\Directory\Test\Repository\CurrencyRate" handler_interface="Magento\Directory\Test\Handler\CurrencyRate\CurrencyRateInterface" class="Magento\Directory\Test\Fixture\CurrencyRate"> - <dataset name="default"> - <field name="currency_from" xsi:type="string">USD</field> - <field name="currency_to" xsi:type="string">EUR</field> - <field name="rate" xsi:type="number">0.8</field> - </dataset> - + <fixture name="currencyRate" + module="Magento_Directory" + type="flat" + entity_type="directory_currency_rate" + collection="Magento\Directory\Model\Resource\Currency" + identifier="" + repository_class="Magento\Directory\Test\Repository\CurrencyRate" + handler_interface="Magento\Directory\Test\Handler\CurrencyRate\CurrencyRateInterface" + class="Magento\Directory\Test\Fixture\CurrencyRate"> <field name="currency_from" is_required="1" /> <field name="currency_to" is_required="1" /> <field name="rate" is_required="1" /> diff --git a/dev/tests/functional/tests/app/Magento/Directory/Test/Repository/CurrencyRate.xml b/dev/tests/functional/tests/app/Magento/Directory/Test/Repository/CurrencyRate.xml index c1b6dc96e3cbb79862eb959f0325f551cb12acf2..b2cfab80394125989a7c900765f8851ed2de93a0 100644 --- a/dev/tests/functional/tests/app/Magento/Directory/Test/Repository/CurrencyRate.xml +++ b/dev/tests/functional/tests/app/Magento/Directory/Test/Repository/CurrencyRate.xml @@ -7,6 +7,12 @@ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> <repository class="Magento\Directory\Test\Repository\CurrencyRate"> + <dataset name="default"> + <field name="currency_from" xsi:type="string">USD</field> + <field name="currency_to" xsi:type="string">EUR</field> + <field name="rate" xsi:type="number">0.8</field> + </dataset> + <dataset name="usd_chf_rate_0_9"> <field name="currency_from" xsi:type="string">USD</field> <field name="currency_to" xsi:type="string">CHF</field> diff --git a/dev/tests/functional/tests/app/Magento/Directory/Test/TestCase/CreateCurrencyRateTest.php b/dev/tests/functional/tests/app/Magento/Directory/Test/TestCase/CreateCurrencyRateTest.php index 22b8d54518de92625349f1aa55fdf5cc7044695b..5ca238d28ba06eb534d3d7a6ede9fc71efc5870d 100644 --- a/dev/tests/functional/tests/app/Magento/Directory/Test/TestCase/CreateCurrencyRateTest.php +++ b/dev/tests/functional/tests/app/Magento/Directory/Test/TestCase/CreateCurrencyRateTest.php @@ -20,7 +20,7 @@ use Magento\CurrencySymbol\Test\Page\Adminhtml\SystemCurrencyIndex; * Steps: * 1. Login to backend. * 2. Go to Stores > Currency > Currency Rates. - * 3. Fill currency rate according to dataSet. + * 3. Fill currency rate according to dataset. * 4. Click on 'Save Currency Rates' button. * 5. Perform assertions. * diff --git a/dev/tests/functional/tests/app/Magento/Directory/Test/TestCase/CreateCurrencyRateTest.xml b/dev/tests/functional/tests/app/Magento/Directory/Test/TestCase/CreateCurrencyRateTest.xml index 561f9307ff07f058b79e7873e4e7ed15ceb67632..294132c493afe16792ccab9dc9586db863fa8eb3 100644 --- a/dev/tests/functional/tests/app/Magento/Directory/Test/TestCase/CreateCurrencyRateTest.xml +++ b/dev/tests/functional/tests/app/Magento/Directory/Test/TestCase/CreateCurrencyRateTest.xml @@ -11,9 +11,9 @@ <data name="currencyRate/data/currency_from" xsi:type="string">USD</data> <data name="currencyRate/data/currency_to" xsi:type="string">EUR</data> <data name="currencyRate/data/rate" xsi:type="number">0.8</data> - <data name="currencySymbol/dataSet" xsi:type="string">currency_symbols_eur</data> - <data name="product/dataSet" xsi:type="string">simple_10_dollar</data> - <data name="config/dataSet" xsi:type="string">config_currency_symbols_usd_and_eur</data> + <data name="currencySymbol/dataset" xsi:type="string">currency_symbols_eur</data> + <data name="product/dataset" xsi:type="string">simple_10_dollar</data> + <data name="config/dataset" xsi:type="string">config_currency_symbols_usd_and_eur</data> <data name="basePrice" xsi:type="string">$10.00</data> <data name="convertedPrice" xsi:type="string">€8.00</data> <data name="tag" xsi:type="string">test_type:acceptance_test</data> diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AbstractAssertTaxCalculationAfterCheckoutDownloadable.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AbstractAssertTaxCalculationAfterCheckoutDownloadable.php index 8d8542cb82c1b74d9b98a3ab62b49963d3e2331f..2621befd5c8d12a98ee8ce1ee60a03e557b9741f 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AbstractAssertTaxCalculationAfterCheckoutDownloadable.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AbstractAssertTaxCalculationAfterCheckoutDownloadable.php @@ -9,6 +9,7 @@ namespace Magento\Downloadable\Test\Constraint; use Magento\Checkout\Test\Page\CheckoutCart; use Magento\Checkout\Test\Page\CheckoutOnepage; use Magento\Checkout\Test\Page\CheckoutOnepageSuccess; +use Magento\Cms\Test\Page\CmsIndex; use Magento\Customer\Test\Fixture\Customer; use Magento\Sales\Test\Page\CustomerOrderView; use Magento\Mtf\Fixture\InjectableFixture; @@ -43,24 +44,24 @@ abstract class AbstractAssertTaxCalculationAfterCheckoutDownloadable extends Abs CheckoutCart $checkoutCart, CheckoutOnepage $checkoutOnepage, CheckoutOnepageSuccess $checkoutOnepageSuccess, - CustomerOrderView $customerOrderView + CustomerOrderView $customerOrderView, + CmsIndex $cmsIndex ) { $this->checkoutOnepage = $checkoutOnepage; $this->customerOrderView = $customerOrderView; $checkoutCart->getProceedToCheckoutBlock()->proceedToCheckout(); - $checkoutOnepage->getBillingBlock()->clickContinue(); - $checkoutOnepage->getPaymentMethodsBlock()->selectPaymentMethod(['method' => 'check_money_order']); - $checkoutOnepage->getPaymentMethodsBlock()->clickContinue(); + $cmsIndex->getCmsPageBlock()->waitPageInit(); + $checkoutOnepage->getPaymentBlock()->selectPaymentMethod(['method' => 'checkmo']); $actualPrices = []; $actualPrices = $this->getReviewPrices($actualPrices, $product); $actualPrices = $this->getReviewTotals($actualPrices); $prices = $this->preparePrices($prices); //Order review prices verification $message = 'Prices on order review should be equal to defined in dataset.'; - \PHPUnit_Framework_Assert::assertEquals($prices, $actualPrices, $message); + \PHPUnit_Framework_Assert::assertEquals($prices, array_filter($actualPrices), $message); - $checkoutOnepage->getReviewBlock()->placeOrder(); + $checkoutOnepage->getPaymentBlock()->placeOrder(); $checkoutOnepageSuccess->getSuccessBlock()->getGuestOrderId(); $checkoutOnepageSuccess->getSuccessBlock()->openOrder(); $actualPrices = []; @@ -69,6 +70,6 @@ abstract class AbstractAssertTaxCalculationAfterCheckoutDownloadable extends Abs //Frontend order prices verification $message = 'Prices on order view page should be equal to defined in dataset.'; - \PHPUnit_Framework_Assert::assertEquals($prices, $actualPrices, $message); + \PHPUnit_Framework_Assert::assertEquals($prices, array_filter($actualPrices), $message); } } diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AbstractAssertTaxRuleIsAppliedToAllPricesDownloadable.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AbstractAssertTaxRuleIsAppliedToAllPricesDownloadable.php index 95e825d05f18ff4aa470723fe1d687021108d3dc..20dd5579d0e28a11fb03d5f80fffd6a078c9e0d1 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AbstractAssertTaxRuleIsAppliedToAllPricesDownloadable.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AbstractAssertTaxRuleIsAppliedToAllPricesDownloadable.php @@ -55,8 +55,9 @@ abstract class AbstractAssertTaxRuleIsAppliedToAllPricesDownloadable extends Abs $this->catalogCategoryView = $catalogCategoryView; $this->catalogProductView = $catalogProductView; $this->checkoutCart = $checkoutCart; - $actualPrices = []; + //Assertion steps + $actualPrices = []; $productCategory = $product->getCategoryIds()[0]; $this->openCategory($productCategory); $actualPrices = $this->getCategoryPrices($product, $actualPrices); @@ -69,6 +70,6 @@ abstract class AbstractAssertTaxRuleIsAppliedToAllPricesDownloadable extends Abs $actualPrices = $this->getTotals($actualPrices); //Prices verification $message = 'Prices from dataset should be equal to prices on frontend'; - \PHPUnit_Framework_Assert::assertEquals($prices, $actualPrices, $message); + \PHPUnit_Framework_Assert::assertEquals($prices, array_filter($actualPrices), $message); } } diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertTaxRuleIsAppliedToAllPricesDownloadableExcludingTax.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertTaxRuleIsAppliedToAllPricesDownloadableExcludingTax.php index 4c1e9f6c06bded72c5c7f16057dadb1e7ba1291c..875b3532052596c4d0e085d1b7225b648f3813ac 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertTaxRuleIsAppliedToAllPricesDownloadableExcludingTax.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertTaxRuleIsAppliedToAllPricesDownloadableExcludingTax.php @@ -32,8 +32,9 @@ class AssertTaxRuleIsAppliedToAllPricesDownloadableExcludingTax extends public function getCategoryPrices(FixtureInterface $product, $actualPrices) { $priceBlock = $this->catalogCategoryView->getListProductBlock()->getProductItem($product)->getPriceBlock(); + $actualPrices['category_price'] = $priceBlock->getPrice(); $actualPrices['category_price_excl_tax'] = $priceBlock->getPriceExcludingTax(); - $actualPrices['category_price_incl_tax'] = null; + $actualPrices['category_price_incl_tax'] = $priceBlock->getPriceIncludingTax(); return $actualPrices; } @@ -46,9 +47,10 @@ class AssertTaxRuleIsAppliedToAllPricesDownloadableExcludingTax extends */ public function getProductPagePrices($actualPrices) { - $viewBlock = $this->catalogProductView->getViewBlock(); - $actualPrices['product_view_price_excl_tax'] = $viewBlock->getPriceBlock()->getPriceExcludingTax(); - $actualPrices['product_view_price_incl_tax'] = null; + $priceBlock = $this->catalogProductView->getViewBlock()->getPriceBlock(); + $actualPrices['product_view_price'] = $priceBlock->getPrice(); + $actualPrices['product_view_price_excl_tax'] = $priceBlock->getPriceExcludingTax(); + $actualPrices['product_view_price_incl_tax'] = $priceBlock->getPriceIncludingTax(); return $actualPrices; } diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertTaxRuleIsAppliedToAllPricesDownloadableIncludingTax.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertTaxRuleIsAppliedToAllPricesDownloadableIncludingTax.php index 5818f5fcab0addd5510a9875c00e95821c8f5a90..398fcd7c86bc2b53eba275d5f185ee50fbddaa5d 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertTaxRuleIsAppliedToAllPricesDownloadableIncludingTax.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertTaxRuleIsAppliedToAllPricesDownloadableIncludingTax.php @@ -31,7 +31,8 @@ class AssertTaxRuleIsAppliedToAllPricesDownloadableIncludingTax extends public function getCategoryPrices(FixtureInterface $product, $actualPrices) { $priceBlock = $this->catalogCategoryView->getListProductBlock()->getProductItem($product)->getPriceBlock(); - $actualPrices['category_price_excl_tax'] = null; + $actualPrices['category_special_price'] = $priceBlock->getSpecialPrice(); + $actualPrices['category_price_excl_tax'] = $priceBlock->getPriceExcludingTax(); $actualPrices['category_price_incl_tax'] = $priceBlock->getPriceIncludingTax(); return $actualPrices; @@ -45,9 +46,10 @@ class AssertTaxRuleIsAppliedToAllPricesDownloadableIncludingTax extends */ public function getProductPagePrices($actualPrices) { - $viewBlock = $this->catalogProductView->getViewBlock(); - $actualPrices['product_view_price_excl_tax'] = null; - $actualPrices['product_view_price_incl_tax'] = $viewBlock->getPriceBlock()->getPriceIncludingTax(); + $priceBlock = $this->catalogProductView->getViewBlock()->getPriceBlock(); + $actualPrices['product_view_special_price'] = $priceBlock->getSpecialPrice(); + $actualPrices['product_view_price_excl_tax'] = $priceBlock->getPriceExcludingTax(); + $actualPrices['product_view_price_incl_tax'] = $priceBlock->getPriceIncludingTax(); return $actualPrices; } diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/Cart/Item.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/Cart/Item.php index 76c76772f8f8b28490a839629679222e975107b7..14050dace32ec1535627b66668b4383131171202 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/Cart/Item.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/Cart/Item.php @@ -10,8 +10,7 @@ use Magento\Downloadable\Test\Fixture\DownloadableProduct; use Magento\Mtf\Fixture\FixtureInterface; /** - * Class Item - * Data for verify cart item block on checkout page + * Data for verify cart item block on checkout page. * * Data keys: * - product (fixture data for verify) @@ -33,7 +32,7 @@ class Item extends \Magento\Catalog\Test\Fixture\Cart\Item foreach ($checkoutData['options']['links'] as $link) { $keyLink = str_replace('link_', '', $link['label']); $checkoutDownloadableOptions[] = [ - 'title' => 'Links', + 'title' => $downloadableOptions['title'], 'value' => $downloadableOptions['downloadable']['link'][$keyLink]['title'], ]; } diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct.xml b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct.xml index 7c7caf2f5c2495c7e0fdf71340026c83ad3e7bb3..3d250fc3f2f46bf059b105c988536531a4a07afc 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct.xml +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct.xml @@ -6,236 +6,91 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="downloadableProduct" module="Magento_Downloadable" type="eav" entity_type="catalog_product" product_type="downloadable" collection="Magento\Catalog\Model\Resource\Product\Collection" identifier="sku" repository_class="Magento\Downloadable\Test\Repository\DownloadableProduct" handler_interface="Magento\Downloadable\Test\Handler\DownloadableProduct\DownloadableProductInterface" class="Magento\Downloadable\Test\Fixture\DownloadableProduct"> - <dataset name="default"> - <field name="name" xsi:type="string">DownloadableProduct_%isolation%</field> - <field name="sku" xsi:type="string">DownloadableProduct_%isolation%</field> - <field name="url_key" xsi:type="string">downloadableproduct_%isolation%</field> - <field name="price" xsi:type="array"> - <item name="value" xsi:type="string">100.00</item> - </field> - <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> - </field> - <field name="description" xsi:type="string">This is description for downloadable product</field> - <field name="short_description" xsi:type="string">This is short description for downloadable product</field> - <field name="quantity_and_stock_status" xsi:type="array"> - <item name="qty" xsi:type="string">1.000</item> - <item name="is_in_stock" xsi:type="string">In Stock</item> - </field> - <field name="is_virtual" xsi:type="string">Yes</field> - <field name="downloadable_links" xsi:type="array"> - <item name="preset" xsi:type="string">default</item> - </field> - </dataset> - <data_config> - <item name="type_id" xsi:type="string">downloadable</item> - <item name="create_url_params" xsi:type="array"> - <item name="type" xsi:type="string">downloadable</item> - <item name="set" xsi:type="string">4</item> - </item> - <item name="input_prefix" xsi:type="string">product</item> - </data_config> - <field name="category_ids" is_required="0" group="product-details" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\CategoryIds"> - <default_value xsi:type="null"/> - </field> - <field name="cost" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="created_at" is_required="1"> - <default_value xsi:type="null"/> - </field> - <field name="custom_design" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="custom_design_from" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="custom_design_to" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="custom_layout_update" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="description" is_required="0" group="product-details"> - <default_value xsi:type="string">This is description for downloadable product</default_value> - </field> - <field name="gallery" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="gift_message_available" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="group_price" is_required="0" group="advanced-pricing" source="Magento\Downloadable\Test\Fixture\DownloadableProduct\GroupPriceOptions"> - <default_value xsi:type="null"/> - </field> - <field name="has_options" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="image" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="image_label" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="is_returnable" is_required="0"> - <default_value xsi:type="number">2</default_value> - </field> - <field name="links_exist" is_required="0"> - <default_value xsi:type="number">0</default_value> - </field> - <field name="links_purchased_separately" is_required="1"> - <default_value xsi:type="null"/> - </field> - <field name="links_title" is_required="1"> - <default_value xsi:type="null"/> - </field> - <field name="media_gallery" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="meta_description" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="meta_keyword" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="meta_title" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="minimal_price" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="msrp" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="msrp_display_actual_price_type" is_required="0"> - <default_value xsi:type="number">4</default_value> - </field> - <field name="name" is_required="1" group="product-details"> - <default_value xsi:type="string">DownloadableProduct_%isolation%</default_value> - </field> - <field name="news_from_date" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="news_to_date" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="old_id" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="options_container" is_required="0"> - <default_value xsi:type="string">container2</default_value> - </field> - <field name="page_layout" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="price" is_required="1" group="product-details" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\Price"> - <default_value xsi:type="array"> - <item name="value" xsi:type="string">100</item> - </default_value> - </field> - <field name="stock_data" group="advanced-inventory"/> - <field name="quantity_and_stock_status" is_required="0" group="product-details"> - <default_value xsi:type="array"> - <item name="qty" xsi:type="number">1</item> - <item name="is_in_stock" xsi:type="string">In Stock</item> - </default_value> - </field> - <field name="related_tgtr_position_behavior" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="related_tgtr_position_limit" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="required_options" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="samples_title" is_required="1"> - <default_value xsi:type="null"/> - </field> - <field name="short_description" is_required="0" group="autosettings"> - <default_value xsi:type="string">This is short description for downloadable product</default_value> - </field> - <field name="downloadable" is_required="0" group="downloadable_information"/> - <field name="downloadable_links" is_required="0" group="downloadable_information" source="Magento\Downloadable\Test\Fixture\DownloadableProduct\Links"> - <default_value xsi:type="array"> - <item name="preset" xsi:type="string">default</item> - </default_value> - </field> - <field name="downloadable_sample" is_required="0" group="downloadable_information" source="Magento\Downloadable\Test\Fixture\DownloadableProduct\Samples"> - <default_value xsi:type="string">dafault</default_value> - </field> - <field name="sku" is_required="1" group="product-details"> - <default_value xsi:type="string">DownloadableProduct_%isolation%</default_value> - </field> - <field name="small_image" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="small_image_label" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="special_from_date" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="special_price" is_required="0" group="advanced-pricing"> - <default_value xsi:type="number">10</default_value> - </field> - <field name="special_to_date" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="status" is_required="0" group="product-details"> - <default_value xsi:type="string">1</default_value> - </field> - <field name="tax_class_id" is_required="0" group="product-details" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\TaxClass"> - <default_value xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> - </default_value> - </field> - <field name="thumbnail" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="thumbnail_label" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="tier_price" is_required="0" group="advanced-pricing" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\TierPriceOptions"> - <default_value xsi:type="string">default</default_value> - </field> - <field name="updated_at" is_required="1"> - <default_value xsi:type="null"/> - </field> - <field name="upsell_tgtr_position_behavior" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="upsell_tgtr_position_limit" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="url_key" is_required="0" group="search-engine-optimization"> - <default_value xsi:type="string">downloadableproduct_%isolation%</default_value> - </field> - <field name="url_path" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="visibility" is_required="0" group="autosettings"> - <default_value xsi:type="number">4</default_value> - </field> - <field name="weight" is_required="0" group="product-details"> - <default_value xsi:type="null"/> - </field> - <field name="custom_options" is_required="0" group="customer-options" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\CustomOptions"> - <default_value xsi:type="string">default</default_value> - </field> - <field name="id"/> - <field name="is_virtual" group="product-details"> - <default_value xsi:type="string">Yes</default_value> - </field> - <field name="website_ids" group="websites"> - <default_value xsi:type="array"> - <item name="0" xsi:type="string">Main Website</item> - </default_value> - </field> - <field name="checkout_data" group="null" source="Magento\Downloadable\Test\Fixture\DownloadableProduct\CheckoutData"/> - <field name="cross_sell_products" group="crosssells" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\CrossSellProducts"/> - <field name="up_sell_products" group="upsells" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\UpSellProducts"/> - <field name="related_products" group="related-products" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\RelatedProducts"/> - </fixture> + <fixture name="downloadableProduct" + module="Magento_Downloadable" + type="eav" + entity_type="catalog_product" + product_type="downloadable" + collection="Magento\Catalog\Model\Resource\Product\Collection" + identifier="sku" + repository_class="Magento\Downloadable\Test\Repository\DownloadableProduct" + handler_interface="Magento\Downloadable\Test\Handler\DownloadableProduct\DownloadableProductInterface" + class="Magento\Downloadable\Test\Fixture\DownloadableProduct"> + <data_config> + <item name="type_id" xsi:type="string">downloadable</item> + <item name="create_url_params" xsi:type="array"> + <item name="type" xsi:type="string">downloadable</item> + <item name="set" xsi:type="string">4</item> + </item> + <item name="input_prefix" xsi:type="string">product</item> + </data_config> + <field name="category_ids" is_required="0" group="product-details" source="Magento\Catalog\Test\Fixture\Product\CategoryIds" /> + <field name="cost" is_required="0" /> + <field name="created_at" is_required="1" /> + <field name="custom_design" is_required="0" /> + <field name="custom_design_from" is_required="0" /> + <field name="custom_design_to" is_required="0" /> + <field name="custom_layout_update" is_required="0" /> + <field name="description" is_required="0" group="product-details" /> + <field name="gallery" is_required="0" /> + <field name="gift_message_available" is_required="0" /> + <field name="group_price" is_required="0" group="advanced-pricing" repository="Magento\Catalog\Test\Repository\Product\GroupPriceOptions" /> + <field name="has_options" is_required="0" /> + <field name="image" is_required="0" /> + <field name="image_label" is_required="0" /> + <field name="is_returnable" is_required="0" /> + <field name="links_exist" is_required="0" /> + <field name="links_purchased_separately" is_required="1" /> + <field name="links_title" is_required="1" /> + <field name="media_gallery" is_required="0" /> + <field name="meta_description" is_required="0" /> + <field name="meta_keyword" is_required="0" /> + <field name="meta_title" is_required="0" /> + <field name="minimal_price" is_required="0" /> + <field name="msrp" is_required="0" /> + <field name="msrp_display_actual_price_type" is_required="0" /> + <field name="name" is_required="1" group="product-details" /> + <field name="news_from_date" is_required="0" /> + <field name="news_to_date" is_required="0" /> + <field name="old_id" is_required="0" /> + <field name="options_container" is_required="0" /> + <field name="page_layout" is_required="0" /> + <field name="price" is_required="1" group="product-details" source="Magento\Catalog\Test\Fixture\Product\Price" /> + <field name="stock_data" group="advanced-inventory" /> + <field name="quantity_and_stock_status" is_required="0" group="product-details" /> + <field name="related_tgtr_position_behavior" is_required="0" /> + <field name="related_tgtr_position_limit" is_required="0" /> + <field name="required_options" is_required="0" /> + <field name="samples_title" is_required="1" /> + <field name="short_description" is_required="0" group="autosettings" /> + <field name="downloadable" is_required="0" group="downloadable_information" /> + <field name="downloadable_links" is_required="0" group="downloadable_information" repository="Magento\Downloadable\Test\Repository\DownloadableProduct\Links" /> + <field name="downloadable_sample" is_required="0" group="downloadable_information" repository="Magento\Downloadable\Test\Repository\DownloadableProduct\Samples" /> + <field name="sku" is_required="1" group="product-details" /> + <field name="small_image" is_required="0" /> + <field name="small_image_label" is_required="0" /> + <field name="special_from_date" is_required="0" /> + <field name="special_price" is_required="0" group="advanced-pricing" /> + <field name="special_to_date" is_required="0" /> + <field name="status" is_required="0" group="product-details" /> + <field name="tax_class_id" is_required="0" group="product-details" source="Magento\Catalog\Test\Fixture\Product\TaxClass" /> + <field name="thumbnail" is_required="0" /> + <field name="thumbnail_label" is_required="0" /> + <field name="tier_price" is_required="0" group="advanced-pricing" repository="Magento\Catalog\Test\Repository\Product\TierPrice" /> + <field name="updated_at" is_required="1" /> + <field name="upsell_tgtr_position_behavior" is_required="0" /> + <field name="upsell_tgtr_position_limit" is_required="0" /> + <field name="url_key" is_required="0" group="search-engine-optimization" /> + <field name="url_path" is_required="0" /> + <field name="visibility" is_required="0" group="autosettings" /> + <field name="weight" is_required="0" group="product-details" /> + <field name="custom_options" is_required="0" group="customer-options" source="Magento\Catalog\Test\Fixture\Product\CustomOptions" repository="Magento\Catalog\Test\Repository\Product\CustomOptions" /> + <field name="id" /> + <field name="is_virtual" group="product-details" /> + <field name="website_ids" group="websites" /> + <field name="checkout_data" group="null" repository="Magento\Downloadable\Test\Repository\DownloadableProduct\CheckoutData" /> + <field name="cross_sell_products" group="crosssells" source="Magento\Catalog\Test\Fixture\Product\RelatedProducts" /> + <field name="up_sell_products" group="upsells" source="Magento\Catalog\Test\Fixture\Product\RelatedProducts" /> + <field name="related_products" group="related-products" source="Magento\Catalog\Test\Fixture\Product\RelatedProducts" /> + </fixture> </config> diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/CheckoutData.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/CheckoutData.php deleted file mode 100644 index 89c3a434fb5274fe67ecbdd5351fdf15bf041b4d..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/CheckoutData.php +++ /dev/null @@ -1,129 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Downloadable\Test\Fixture\DownloadableProduct; - -/** - * Data for fill product form on frontend - * - * Data keys: - * - preset (Checkout data verification preset name) - */ -class CheckoutData extends \Magento\Catalog\Test\Fixture\CatalogProductSimple\CheckoutData -{ - /** - * Get preset array - * - * @param $name - * @return array|null - * - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) - */ - protected function getPreset($name) - { - $presets = [ - 'with_two_separately_links' => [ - 'options' => [ - 'links' => [ - [ - 'label' => 'link_0', - 'value' => 'Yes', - ], - ], - ], - 'cartItem' => [ - 'price' => 23, - 'subtotal' => 23, - ], - ], - - 'with_two_bought_links' => [ - 'options' => [ - 'links' => [ - [ - 'label' => 'link_0', - 'value' => 'Yes', - ], - [ - 'label' => 'link_1', - 'value' => 'Yes' - ], - ], - 'cartItem' => [ - 'price' => 23, - 'subtotal' => 23, - ], - ], - ], - - 'forUpdateMiniShoppingCart' => [ - 'options' => [ - 'links' => [ - [ - 'label' => 'link_0', - 'value' => 'Yes', - ], - ], - ], - 'cartItem' => [ - 'price' => 23, - 'subtotal' => 22.43, - ], - ], - - 'default' => [ - 'options' => [ - 'links' => [ - [ - 'label' => 'link_0', - 'value' => 'Yes', - ], - ], - ], - ], - - 'one_custom_option_and_downloadable_link' => [ - 'options' => [ - 'custom_options' => [ - [ - 'title' => 'attribute_key_0', - 'value' => 'option_key_0' - ], - ], - 'links' => [ - [ - 'label' => 'link_0', - 'value' => 'Yes' - ] - ], - ] - ], - - 'one_dollar_product_with_separated_link' => [ - 'options' => [ - 'links' => [ - [ - 'label' => 'link_0', - 'value' => 'Yes' - ] - ], - ], - 'cartItem' => [ - 'price' => 3, - 'subtotal' => 3, - ], - ], - - 'one_dollar_product_with_no_separated_link' => [ - 'cartItem' => [ - 'price' => 1, - 'subtotal' => 1, - ], - ], - ]; - return isset($presets[$name]) ? $presets[$name] : []; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/GroupPriceOptions.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/GroupPriceOptions.php deleted file mode 100644 index 552f201300fe3538e7a430c2662b47c65f498b49..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/GroupPriceOptions.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Downloadable\Test\Fixture\DownloadableProduct; - -/** - * Group price options fixture for downloadable product - */ -class GroupPriceOptions extends \Magento\Catalog\Test\Fixture\CatalogProductSimple\GroupPriceOptions -{ - /** - * Get preset array - * - * @param string $name - * @return mixed|null - */ - protected function getPreset($name) - { - $presets = [ - 'default' => [ - [ - 'price' => 20, - 'website' => 'All Websites [USD]', - 'customer_group' => 'NOT LOGGED IN', - ], - ], - 'downloadable_with_tax' => [ - [ - 'price' => 20.00, - 'website' => 'All Websites [USD]', - 'customer_group' => 'General', - ], - ], - ]; - if (!isset($presets[$name])) { - return null; - } - return $presets[$name]; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/Links.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/Links.php deleted file mode 100644 index 3dd27e94ec34b17153f7fd5c5c48b11a87ccd9db..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/Links.php +++ /dev/null @@ -1,250 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Downloadable\Test\Fixture\DownloadableProduct; - -use Magento\Mtf\Fixture\FixtureInterface; - -/** - * Class Links - * - * Preset for link block - * - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) - */ -class Links implements FixtureInterface -{ - /** - * Prepared dataSet data - * - * @var array - */ - protected $data; - - /** - * Data set configuration settings - * - * @var array - */ - protected $params; - - /** - * @constructor - * @param array $params - * @param array $data - */ - public function __construct(array $params, array $data = []) - { - $this->params = $params; - $this->data = isset($data['preset']) ? $this->getPreset($data['preset']) : $data; - } - - /** - * Persist group price - * - * @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; - } - - /** - * Preset array for downloadable links - * - * @param string $name - * @return array|null - */ - protected function getPreset($name) - { - $presets = [ - 'default' => [ - 'title' => 'Links%isolation%', - 'links_purchased_separately' => 'Yes', - 'downloadable' => [ - 'link' => [ - [ - 'title' => 'link1%isolation%', - 'price' => 2.43, - 'number_of_downloads' => 2, - 'sample' => [ - 'sample_type_url' => 'Yes', - 'sample_url' => 'http://example.com', - ], - 'file_type_url' => 'Yes', - 'file_link_url' => 'http://example.com', - 'is_shareable' => 'No', - 'sort_order' => 1, - ], - [ - 'title' => 'link2%isolation%', - 'price' => 3, - 'number_of_downloads' => 3, - 'sample' => [ - 'sample_type_url' => 'Yes', - 'sample_url' => 'http://example.net', - ], - 'file_type_url' => 'Yes', - 'file_link_url' => 'http://example.net', - 'is_shareable' => 'Yes', - 'sort_order' => 0 - ], - ], - ], - ], - 'one_separately_link' => [ - 'title' => 'Links%isolation%', - 'links_purchased_separately' => 'Yes', - 'downloadable' => [ - 'link' => [ - [ - 'title' => 'link1%isolation%', - 'price' => 2, - 'number_of_downloads' => 2, - 'is_shareable' => 'Use config', - 'sort_order' => 1, - 'sample' => [ - 'sample_type_url' => 'Yes', - 'sample_url' => 'http://example.com', - ], - 'file_type_url' => 'Yes', - 'file_link_url' => 'http://example.com', - ], - ], - ], - ], - 'one_no_separately_link' => [ - 'title' => 'Links%isolation%', - 'links_purchased_separately' => 'No', - 'downloadable' => [ - 'link' => [ - [ - 'title' => 'link1%isolation%', - 'price' => 2, - 'number_of_downloads' => 2, - 'is_shareable' => 'Use config', - 'sort_order' => 1, - 'sample' => [ - 'sample_type_url' => 'Yes', - 'sample_url' => 'http://example.com', - ], - 'file_type_url' => 'Yes', - 'file_link_url' => 'http://example.com', - ], - ], - ], - ], - 'with_two_separately_links' => [ - 'title' => 'Links%isolation%', - 'links_purchased_separately' => 'Yes', - 'downloadable' => [ - 'link' => [ - [ - 'title' => 'link1%isolation%', - 'price' => 2.43, - 'number_of_downloads' => 2, - 'is_shareable' => 'No', - 'sample' => [ - 'sample_type_url' => 'Yes', - 'sample_url' => 'http://example.com/sample', - ], - 'file_type_url' => 'Yes', - 'file_link_url' => 'http://example.com', - 'sort_order' => 0, - ], - [ - 'title' => 'link2%isolation%', - 'price' => 3, - 'number_of_downloads' => 3, - 'is_shareable' => 'Yes', - 'sample' => [ - 'sample_type_url' => 'Yes', - 'sample_url' => 'http://example.net/sample2', - ], - 'file_type_url' => 'Yes', - 'file_link_url' => 'http://example.net/', - 'sort_order' => 1 - ], - ], - ], - ], - 'with_three_links' => [ - 'title' => 'Links%isolation%', - 'links_purchased_separately' => 'Yes', - 'downloadable' => [ - 'link' => [ - [ - 'title' => 'link1%isolation%', - 'price' => 2.43, - 'number_of_downloads' => 2, - 'sample' => [ - 'sample_type_url' => 'Yes', - 'sample_url' => 'http://example.com', - ], - 'file_type_url' => 'Yes', - 'file_link_url' => 'http://example.com', - 'is_shareable' => 'No', - 'sort_order' => 0, - ], - [ - 'title' => 'link2%isolation%', - 'price' => 3, - 'number_of_downloads' => 3, - 'sample' => [ - 'sample_type_url' => 'Yes', - 'sample_url' => 'http://example.net', - ], - 'file_type_url' => 'Yes', - 'file_link_url' => 'http://example.net', - 'is_shareable' => 'Yes', - 'sort_order' => 1 - ], - [ - 'title' => 'link3%isolation%', - 'price' => 5.43, - 'number_of_downloads' => 5, - 'sample' => [ - 'sample_type_url' => 'Yes', - 'sample_url' => 'http://example.net', - ], - 'file_type_url' => 'Yes', - 'file_link_url' => 'http://example.net', - 'is_shareable' => 'Yes', - 'sort_order' => 2 - ], - ], - ], - ], - ]; - if (!isset($presets[$name])) { - return null; - } - return $presets[$name]; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/Samples.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/Samples.php deleted file mode 100644 index 5399800e8a67cc26d4301ff558fcec20d9a6173a..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/Samples.php +++ /dev/null @@ -1,137 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Downloadable\Test\Fixture\DownloadableProduct; - -use Magento\Mtf\Fixture\FixtureInterface; - -/** - * Class Samples - * Preset for sample block - */ -class Samples implements FixtureInterface -{ - /** - * Prepared dataSet data - * - * @var array - */ - protected $data; - - /** - * Data set configuration settings - * - * @var array - */ - protected $params; - - /** - * Construct for class - * - * @param array $params - * @param array $data - */ - public function __construct(array $params, array $data = []) - { - $this->params = $params; - $this->data = isset($data['preset']) ? $this->getPreset($data['preset']) : $data; - } - - /** - * 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() - { - return $this->params; - } - - /** - * Preset array for downloadable samples - * - * @param string $name - * @return array|null - */ - protected function getPreset($name) - { - $presets = [ - 'default' => [ - 'title' => 'Samples%isolation%', - 'downloadable' => [ - 'sample' => [ - [ - 'title' => 'sample1%isolation%', - 'sample_type_url' => 'Yes', - 'sample_url' => 'http://example.com', - 'sort_order' => 0, - ], - [ - 'title' => 'sample2%isolation%', - 'sample_type_url' => 'Yes', - 'sample_url' => 'http://example2.com', - 'sort_order' => 1 - ], - ], - ], - ], - 'with_three_samples' => [ - 'title' => 'Samples%isolation%', - 'downloadable' => [ - 'sample' => [ - [ - 'title' => 'sample1%isolation%', - 'sample_type_url' => 'Yes', - 'sample_url' => 'http://example.com', - 'sort_order' => 0, - ], - [ - 'title' => 'sample2%isolation%', - 'sample_type_url' => 'Yes', - 'sample_url' => 'http://example2.com', - 'sort_order' => 1 - ], - [ - 'title' => 'sample3%isolation%', - 'sample_type_url' => 'Yes', - 'sample_url' => 'http://example3.com', - 'sort_order' => 2 - ], - ], - ], - ], - ]; - - if (!isset($presets[$name])) { - return null; - } - - return $presets[$name]; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Repository/DownloadableProduct.xml b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Repository/DownloadableProduct.xml index 13314c0ec5bd9ccca54db0319dcdd98e2ff0582d..8d84025eee8b4ca63eccf2f1d24b16ce654baa40 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Repository/DownloadableProduct.xml +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Repository/DownloadableProduct.xml @@ -12,11 +12,11 @@ <field name="sku" xsi:type="string">sku_test_downloadable_product_%isolation%</field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">280</item> - <item name="preset" xsi:type="string">-</item> + <item name="dataset" xsi:type="string">-</item> </field> <field name="type_id" xsi:type="string">downloadable</field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="quantity_and_stock_status" xsi:type="array"> <item name="qty" xsi:type="string">90</item> @@ -27,13 +27,13 @@ <field name="url_key" xsi:type="string">test-downloadable-product-%isolation%</field> <field name="is_virtual" xsi:type="string">Yes</field> <field name="downloadable_links" xsi:type="array"> - <item name="preset" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">with_two_separately_links</item> </field> <field name="website_ids" xsi:type="array"> <item name="0" xsi:type="string">Main Website</item> </field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">downloadable_default</item> </field> </dataset> @@ -45,7 +45,7 @@ <item name="value" xsi:type="string">20</item> </field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="quantity_and_stock_status" xsi:type="array"> <item name="qty" xsi:type="string">1111</item> @@ -58,10 +58,10 @@ <item name="0" xsi:type="string">Main Website</item> </field> <field name="downloadable_links" xsi:type="array"> - <item name="preset" xsi:type="string">with_two_separately_links</item> + <item name="dataset" xsi:type="string">with_two_separately_links</item> </field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">with_two_separately_links</item> + <item name="dataset" xsi:type="string">downloadable_with_two_separately_links</item> </field> </dataset> @@ -73,7 +73,7 @@ <item name="value" xsi:type="string">20</item> </field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="quantity_and_stock_status" xsi:type="array"> <item name="qty" xsi:type="string">1111</item> @@ -86,10 +86,10 @@ <item name="0" xsi:type="string">Main Website</item> </field> <field name="downloadable_links" xsi:type="array"> - <item name="preset" xsi:type="string">with_two_separately_links</item> + <item name="dataset" xsi:type="string">with_two_separately_links</item> </field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">with_two_bought_links</item> + <item name="dataset" xsi:type="string">downloadable_with_two_bought_links</item> </field> </dataset> @@ -102,7 +102,7 @@ </field> <field name="special_price" xsi:type="string">20</field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="quantity_and_stock_status" xsi:type="array"> <item name="qty" xsi:type="string">1111</item> @@ -110,7 +110,7 @@ </field> <field name="status" xsi:type="string">Product online</field> <field name="category_ids" xsi:type="array"> - <item name="presets" xsi:type="string">default_subcategory</item> + <item name="dataset" xsi:type="string">default_subcategory</item> </field> <field name="visibility" xsi:type="string">Catalog, Search</field> <field name="is_virtual" xsi:type="string">Yes</field> @@ -118,10 +118,10 @@ <item name="0" xsi:type="string">Main Website</item> </field> <field name="downloadable_links" xsi:type="array"> - <item name="preset" xsi:type="string">with_two_separately_links</item> + <item name="dataset" xsi:type="string">with_two_separately_links</item> </field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">with_two_bought_links</item> + <item name="dataset" xsi:type="string">downloadable_with_two_bought_links</item> </field> </dataset> @@ -133,10 +133,10 @@ <item name="value" xsi:type="string">30</item> </field> <field name="group_price" xsi:type="array"> - <item name="preset" xsi:type="string">downloadable_with_tax</item> + <item name="dataset" xsi:type="string">general_90_99</item> </field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="quantity_and_stock_status" xsi:type="array"> <item name="qty" xsi:type="string">1111</item> @@ -144,7 +144,7 @@ </field> <field name="status" xsi:type="string">Product online</field> <field name="category_ids" xsi:type="array"> - <item name="presets" xsi:type="string">default_subcategory</item> + <item name="dataset" xsi:type="string">default_subcategory</item> </field> <field name="visibility" xsi:type="string">Catalog, Search</field> <field name="is_virtual" xsi:type="string">Yes</field> @@ -152,10 +152,10 @@ <item name="0" xsi:type="string">Main Website</item> </field> <field name="downloadable_links" xsi:type="array"> - <item name="preset" xsi:type="string">with_two_separately_links</item> + <item name="dataset" xsi:type="string">with_two_separately_links</item> </field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">with_two_bought_links</item> + <item name="dataset" xsi:type="string">downloadable_with_two_bought_links</item> </field> </dataset> @@ -167,7 +167,7 @@ <item name="value" xsi:type="string">20</item> </field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="quantity_and_stock_status" xsi:type="array"> <item name="qty" xsi:type="string">1111</item> @@ -175,7 +175,7 @@ </field> <field name="status" xsi:type="string">Product online</field> <field name="category_ids" xsi:type="array"> - <item name="presets" xsi:type="string">default_subcategory</item> + <item name="dataset" xsi:type="string">default_subcategory</item> </field> <field name="visibility" xsi:type="string">Catalog, Search</field> <field name="is_virtual" xsi:type="string">Yes</field> @@ -183,13 +183,13 @@ <item name="0" xsi:type="string">Main Website</item> </field> <field name="downloadable_links" xsi:type="array"> - <item name="preset" xsi:type="string">with_two_separately_links</item> + <item name="dataset" xsi:type="string">with_two_separately_links</item> </field> <field name="custom_options" xsi:type="array"> - <item name="preset" xsi:type="string">drop_down_with_one_option_percent_price</item> + <item name="dataset" xsi:type="string">drop_down_with_one_option_percent_price</item> </field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">one_custom_option_and_downloadable_link</item> + <item name="dataset" xsi:type="string">downloadable_one_custom_option_and_downloadable_link</item> </field> </dataset> @@ -202,23 +202,23 @@ <item name="value" xsi:type="string">1</item> </field> <field name="category_ids" xsi:type="array"> - <item name="presets" xsi:type="string">default_subcategory</item> + <item name="dataset" xsi:type="string">default_subcategory</item> </field> <field name="downloadable_links" xsi:type="array"> - <item name="preset" xsi:type="string">one_no_separately_link</item> + <item name="dataset" xsi:type="string">one_no_separately_link</item> </field> <field name="quantity_and_stock_status" xsi:type="array"> <item name="qty" xsi:type="string">10</item> <item name="is_in_stock" xsi:type="string">In Stock</item> </field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="website_ids" xsi:type="array"> <item name="0" xsi:type="string">Main Website</item> </field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">one_dollar_product_with_no_separated_link</item> + <item name="dataset" xsi:type="string">downloadable_one_dollar_product_with_no_separated_link</item> </field> </dataset> </repository> diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Repository/DownloadableProduct/CheckoutData.xml b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Repository/DownloadableProduct/CheckoutData.xml new file mode 100644 index 0000000000000000000000000000000000000000..74b9db4043e56a880cd19e6396bc35c4f96330c3 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Repository/DownloadableProduct/CheckoutData.xml @@ -0,0 +1,109 @@ +<?xml version="1.0" ?> +<!-- +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> + <repository class="Magento\Downloadable\Test\Repository\DownloadableProduct\CheckoutData"> + <dataset name="downloadable_default"> + <field name="options" xsi:type="array"> + <item name="links" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="label" xsi:type="string">link_0</item> + <item name="value" xsi:type="string">Yes</item> + </item> + </item> + </field> + </dataset> + + <dataset name="downloadable_one_dollar_product_with_no_separated_link"> + <field name="cartItem" xsi:type="array"> + <item name="price" xsi:type="string">3</item> + <item name="subtotal" xsi:type="string">3</item> + </field> + </dataset> + + <dataset name="downloadable_with_two_separately_links"> + <field name="options" xsi:type="array"> + <item name="links" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="label" xsi:type="string">link_0</item> + <item name="value" xsi:type="string">Yes</item> + </item> + </item> + </field> + <field name="cartItem" xsi:type="array"> + <item name="price" xsi:type="string">22.43</item> + <item name="subtotal" xsi:type="string">22.43</item> + </field> + </dataset> + + <dataset name="downloadable_with_two_bought_links"> + <field name="options" xsi:type="array"> + <item name="links" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="label" xsi:type="string">link_0</item> + <item name="value" xsi:type="string">Yes</item> + </item> + <item name="1" xsi:type="array"> + <item name="label" xsi:type="string">link_1</item> + <item name="value" xsi:type="string">Yes</item> + </item> + </item> + </field> + <field name="cartItem" xsi:type="array"> + <item name="price" xsi:type="string">23</item> + <item name="subtotal" xsi:type="string">23</item> + </field> + </dataset> + + <dataset name="downloadable_update_mini_shopping_cart"> + <field name="options" xsi:type="array"> + <item name="links" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="label" xsi:type="string">link_1</item> + <item name="value" xsi:type="string">Yes</item> + </item> + </item> + </field> + <field name="cartItem" xsi:type="array"> + <item name="price" xsi:type="string">23</item> + <item name="subtotal" xsi:type="string">23</item> + </field> + </dataset> + + <dataset name="downloadable_one_custom_option_and_downloadable_link"> + <field name="options" xsi:type="array"> + <item name="custom_options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">attribute_key_0</item> + <item name="value" xsi:type="string">option_key_0</item> + </item> + </item> + <item name="links" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="label" xsi:type="string">link_0</item> + <item name="value" xsi:type="string">Yes</item> + </item> + </item> + </field> + </dataset> + + <dataset name="downloadable_one_dollar_product_with_separated_link"> + <field name="options" xsi:type="array"> + <item name="links" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="label" xsi:type="string">link_0</item> + <item name="value" xsi:type="string">Yes</item> + </item> + </item> + </field> + <field name="cartItem" xsi:type="array"> + <item name="price" xsi:type="string">3</item> + <item name="subtotal" xsi:type="string">3</item> + </field> + </dataset> + </repository> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Repository/DownloadableProduct/Links.xml b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Repository/DownloadableProduct/Links.xml new file mode 100644 index 0000000000000000000000000000000000000000..52291319fe9abe64a4dec81e8e44541c0bdd5dd9 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Repository/DownloadableProduct/Links.xml @@ -0,0 +1,137 @@ +<?xml version="1.0" ?> +<!-- +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> + <repository class="Magento\Downloadable\Test\Repository\DownloadableProduct\Links"> + <dataset name="one_separately_link"> + <field name="title" xsi:type="string">Links%isolation%</field> + <field name="links_purchased_separately" xsi:type="string">Yes</field> + <field name="downloadable" xsi:type="array"> + <item name="link" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">link1%isolation%</item> + <item name="price" xsi:type="string">2</item> + <item name="is_shareable" xsi:type="string">Use config</item> + <item name="number_of_downloads" xsi:type="string">2</item> + <item name="sort_order" xsi:type="string">1</item> + <item name="sample" xsi:type="array"> + <item name="sample_type_url" xsi:type="string">Yes</item> + <item name="sample_url" xsi:type="string">http://example.com</item> + </item> + <item name="file_type_url" xsi:type="string">Yes</item> + <item name="file_link_url" xsi:type="string">http://example.com</item> + </item> + </item> + </field> + </dataset> + + <dataset name="one_no_separately_link"> + <field name="title" xsi:type="string">Links%isolation%</field> + <field name="links_purchased_separately" xsi:type="string">No</field> + <field name="downloadable" xsi:type="array"> + <item name="link" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">link1%isolation%</item> + <item name="price" xsi:type="string">2</item> + <item name="is_shareable" xsi:type="string">Use config</item> + <item name="number_of_downloads" xsi:type="string">2</item> + <item name="sort_order" xsi:type="string">1</item> + <item name="sample" xsi:type="array"> + <item name="sample_type_url" xsi:type="string">Yes</item> + <item name="sample_url" xsi:type="string">http://example.com</item> + </item> + <item name="file_type_url" xsi:type="string">Yes</item> + <item name="file_link_url" xsi:type="string">http://example.com</item> + </item> + </item> + </field> + </dataset> + + <dataset name="with_two_separately_links"> + <field name="title" xsi:type="string">Links title %isolation%</field> + <field name="links_purchased_separately" xsi:type="string">Yes</field> + <field name="downloadable" xsi:type="array"> + <item name="link" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">link-1-%isolation%</item> + <item name="price" xsi:type="string">2.43</item> + <item name="number_of_downloads" xsi:type="string">2</item> + <item name="sample" xsi:type="array"> + <item name="sample_type_url" xsi:type="string">Yes</item> + <item name="sample_url" xsi:type="string">http://example.com</item> + </item> + <item name="file_type_url" xsi:type="string">Yes</item> + <item name="file_link_url" xsi:type="string">http://example.com</item> + <item name="is_shareable" xsi:type="string">No</item> + <item name="sort_order" xsi:type="string">1</item> + </item> + <item name="1" xsi:type="array"> + <item name="title" xsi:type="string">link-2-%isolation%</item> + <item name="price" xsi:type="string">3</item> + <item name="number_of_downloads" xsi:type="string">3</item> + <item name="sample" xsi:type="array"> + <item name="sample_type_url" xsi:type="string">Yes</item> + <item name="sample_url" xsi:type="string">http://example.com</item> + </item> + <item name="file_type_url" xsi:type="string">Yes</item> + <item name="file_link_url" xsi:type="string">http://example.com</item> + <item name="is_shareable" xsi:type="string">Yes</item> + <item name="sort_order" xsi:type="string">0</item> + </item> + </item> + </field> + </dataset> + + <dataset name="with_three_links"> + <field name="title" xsi:type="string">Links Title %isolation%</field> + <field name="links_purchased_separately" xsi:type="string">Yes</field> + <field name="downloadable" xsi:type="array"> + <item name="link" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">link-1-%isolation%</item> + <item name="price" xsi:type="string">2.43</item> + <item name="number_of_downloads" xsi:type="string">2</item> + <item name="sample" xsi:type="array"> + <item name="sample_type_url" xsi:type="string">Yes</item> + <item name="sample_url" xsi:type="string">http://example.com</item> + </item> + <item name="file_type_url" xsi:type="string">Yes</item> + <item name="file_link_url" xsi:type="string">http://example.com</item> + <item name="is_shareable" xsi:type="string">No</item> + <item name="sort_order" xsi:type="string">0</item> + </item> + <item name="1" xsi:type="array"> + <item name="title" xsi:type="string">link-2-%isolation%</item> + <item name="price" xsi:type="string">3</item> + <item name="number_of_downloads" xsi:type="string">3</item> + <item name="sample" xsi:type="array"> + <item name="sample_type_url" xsi:type="string">Yes</item> + <item name="sample_url" xsi:type="string">http://example.com</item> + </item> + <item name="file_type_url" xsi:type="string">Yes</item> + <item name="file_link_url" xsi:type="string">http://example.com</item> + <item name="is_shareable" xsi:type="string">Yes</item> + <item name="sort_order" xsi:type="string">1</item> + </item> + <item name="2" xsi:type="array"> + <item name="title" xsi:type="string">link-3-%isolation%</item> + <item name="price" xsi:type="string">5.43</item> + <item name="number_of_downloads" xsi:type="string">5</item> + <item name="sample" xsi:type="array"> + <item name="sample_type_url" xsi:type="string">Yes</item> + <item name="sample_url" xsi:type="string">http://example.com</item> + </item> + <item name="file_type_url" xsi:type="string">Yes</item> + <item name="file_link_url" xsi:type="string">http://example.com</item> + <item name="is_shareable" xsi:type="string">Yes</item> + <item name="sort_order" xsi:type="string">2</item> + </item> + </item> + </field> + </dataset> + </repository> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Repository/DownloadableProduct/Samples.xml b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Repository/DownloadableProduct/Samples.xml new file mode 100644 index 0000000000000000000000000000000000000000..65bf205651d1de2990be96e4edc795009b42c41c --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Repository/DownloadableProduct/Samples.xml @@ -0,0 +1,56 @@ +<?xml version="1.0" ?> +<!-- +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> + <repository class="Magento\Downloadable\Test\Repository\DownloadableProduct\Samples"> + <dataset name="with_two_samples"> + <field name="title" xsi:type="string">Samples%isolation%</field> + <field name="downloadable" xsi:type="array"> + <item name="sample" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">sample1%isolation%</item> + <item name="sample_type_url" xsi:type="string">Yes</item> + <item name="sample_url" xsi:type="string">http://example.com</item> + <item name="sort_order" xsi:type="string">0</item> + </item> + <item name="1" xsi:type="array"> + <item name="title" xsi:type="string">sample2%isolation%</item> + <item name="sample_type_url" xsi:type="string">Yes</item> + <item name="sample_url" xsi:type="string">http://example.com</item> + <item name="sort_order" xsi:type="string">1</item> + </item> + </item> + </field> + </dataset> + + <dataset name="with_three_samples"> + <field name="title" xsi:type="string">Samples%isolation%</field> + <field name="downloadable" xsi:type="array"> + <item name="sample" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="title" xsi:type="string">sample1%isolation%</item> + <item name="sample_type_url" xsi:type="string">Yes</item> + <item name="sample_url" xsi:type="string">http://example.com</item> + <item name="sort_order" xsi:type="string">0</item> + </item> + <item name="1" xsi:type="array"> + <item name="title" xsi:type="string">sample2%isolation%</item> + <item name="sample_type_url" xsi:type="string">Yes</item> + <item name="sample_url" xsi:type="string">http://example.com</item> + <item name="sort_order" xsi:type="string">1</item> + </item> + <item name="2" xsi:type="array"> + <item name="title" xsi:type="string">sample3%isolation%</item> + <item name="sample_type_url" xsi:type="string">Yes</item> + <item name="sample_url" xsi:type="string">http://example.com</item> + <item name="sort_order" xsi:type="string">2</item> + </item> + </item> + </field> + </dataset> + </repository> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest.xml index c54301de79898f7c51f2ec79b822bdf89e8e7c68..b02763d9f5fab9c6c395a0870f684b5acbb9b92f 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest.xml @@ -13,8 +13,8 @@ <data name="product/data/sku" xsi:type="string">DownloadableProduct_%isolation%</data> <data name="product/data/price/value" xsi:type="string">1</data> <data name="product/data/category" xsi:type="string">category %isolation%</data> - <data name="product/data/downloadable_links/preset" xsi:type="string">one_separately_link</data> - <data name="product/data/checkout_data/preset" xsi:type="string">one_dollar_product_with_separated_link</data> + <data name="product/data/downloadable_links/dataset" xsi:type="string">one_separately_link</data> + <data name="product/data/checkout_data/dataset" xsi:type="string">downloadable_one_dollar_product_with_separated_link</data> <data name="product/data/url_key" xsi:type="string">downloadableproduct-%isolation%</data> <data name="tag" xsi:type="string">test_type:acceptance_test</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> @@ -27,12 +27,12 @@ <data name="product/data/name" xsi:type="string">DownloadableProduct_%isolation%</data> <data name="product/data/sku" xsi:type="string">DownloadableProduct_%isolation%</data> <data name="product/data/price/value" xsi:type="string">100</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> + <data name="product/data/tax_class_id/dataset" xsi:type="string">taxable_goods</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">1</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> <data name="product/data/category" xsi:type="string">Default Category</data> - <data name="product/data/downloadable_links/preset" xsi:type="string">default</data> + <data name="product/data/downloadable_links/dataset" xsi:type="string">with_two_separately_links</data> <data name="product/data/url_key" xsi:type="string">downloadableproduct-%isolation%</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> @@ -46,13 +46,13 @@ <data name="product/data/name" xsi:type="string">DownloadableProduct_%isolation%</data> <data name="product/data/sku" xsi:type="string">DownloadableProduct_%isolation%</data> <data name="product/data/price/value" xsi:type="string">1</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> + <data name="product/data/tax_class_id/dataset" xsi:type="string">taxable_goods</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">10</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> <data name="product/data/category" xsi:type="string">category %isolation%</data> - <data name="product/data/downloadable_sample/preset" xsi:type="string">default</data> - <data name="product/data/downloadable_links/preset" xsi:type="string">default</data> + <data name="product/data/downloadable_sample/dataset" xsi:type="string">with_two_samples</data> + <data name="product/data/downloadable_links/dataset" xsi:type="string">with_two_separately_links</data> <data name="product/data/url_key" xsi:type="string">downloadableproduct-%isolation%</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> @@ -66,13 +66,13 @@ <data name="product/data/name" xsi:type="string">DownloadableProduct_%isolation%</data> <data name="product/data/sku" xsi:type="string">DownloadableProduct_%isolation%</data> <data name="product/data/price/value" xsi:type="string">33</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> + <data name="product/data/tax_class_id/dataset" xsi:type="string">taxable_goods</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">10</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> <data name="product/data/category" xsi:type="string">category %isolation%</data> - <data name="product/data/downloadable_links/preset" xsi:type="string">default</data> - <data name="product/data/custom_options/preset" xsi:type="string">default</data> + <data name="product/data/downloadable_links/dataset" xsi:type="string">with_two_separately_links</data> + <data name="product/data/custom_options/dataset" xsi:type="string">default</data> <data name="product/data/url_key" xsi:type="string">downloadableproduct-%isolation%</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Downloadable\Test\Constraint\AssertDownloadableProductForm" /> @@ -86,13 +86,13 @@ <data name="product/data/name" xsi:type="string">DownloadableProduct_%isolation%</data> <data name="product/data/sku" xsi:type="string">DownloadableProduct_%isolation%</data> <data name="product/data/price/value" xsi:type="string">55</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> + <data name="product/data/tax_class_id/dataset" xsi:type="string">taxable_goods</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">10</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> - <data name="product/data/downloadable_sample/preset" xsi:type="string">with_three_samples</data> - <data name="product/data/downloadable_links/preset" xsi:type="string">with_three_links</data> - <data name="product/data/custom_options/preset" xsi:type="string">two_options</data> + <data name="product/data/downloadable_sample/dataset" xsi:type="string">with_three_samples</data> + <data name="product/data/downloadable_links/dataset" xsi:type="string">with_three_links</data> + <data name="product/data/custom_options/dataset" xsi:type="string">two_options</data> <data name="product/data/url_key" xsi:type="string">downloadableproduct-%isolation%</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductCustomOptionsOnProductPage" /> @@ -109,12 +109,12 @@ <data name="product/data/name" xsi:type="string">DownloadableProduct_%isolation%</data> <data name="product/data/sku" xsi:type="string">DownloadableProduct_%isolation%</data> <data name="product/data/price/value" xsi:type="string">100</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> + <data name="product/data/tax_class_id/dataset" xsi:type="string">taxable_goods</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">50</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">Out of Stock</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> <data name="product/data/category" xsi:type="string">Default Category</data> - <data name="product/data/downloadable_links/preset" xsi:type="string">default</data> + <data name="product/data/downloadable_links/dataset" xsi:type="string">with_two_separately_links</data> <data name="product/data/url_key" xsi:type="string">downloadableproduct-%isolation%</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductOutOfStock" /> @@ -127,14 +127,14 @@ <data name="product/data/name" xsi:type="string">DownloadableProduct_%isolation%</data> <data name="product/data/sku" xsi:type="string">DownloadableProduct_%isolation%</data> <data name="product/data/price/value" xsi:type="string">9999</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> + <data name="product/data/tax_class_id/dataset" xsi:type="string">taxable_goods</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> <data name="product/data/category" xsi:type="string">Default Category</data> <data name="product/data/stock_data/manage_stock" xsi:type="string">Yes</data> <data name="product/data/stock_data/qty" xsi:type="string">123</data> <data name="product/data/stock_data/use_config_min_qty" xsi:type="string">No</data> <data name="product/data/stock_data/min_qty" xsi:type="string">123</data> - <data name="product/data/downloadable_links/preset" xsi:type="string">default</data> + <data name="product/data/downloadable_links/dataset" xsi:type="string">with_two_separately_links</data> <data name="product/data/url_key" xsi:type="string">downloadableproduct-%isolation%</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> @@ -146,13 +146,13 @@ <data name="product/data/name" xsi:type="string">DownloadableProduct_%isolation%</data> <data name="product/data/sku" xsi:type="string">DownloadableProduct_%isolation%</data> <data name="product/data/price/value" xsi:type="string">98</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">None</data> + <data name="product/data/tax_class_id/dataset" xsi:type="string">None</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">5</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> <data name="product/data/category" xsi:type="string">Default Category</data> <data name="product/data/description" xsi:type="string">This is description for downloadable product</data> - <data name="product/data/downloadable_links/preset" xsi:type="string">default</data> + <data name="product/data/downloadable_links/dataset" xsi:type="string">with_two_separately_links</data> <data name="product/data/url_key" xsi:type="string">downloadableproduct-%isolation%</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> @@ -165,15 +165,15 @@ <data name="product/data/name" xsi:type="string">DownloadableProduct_%isolation%</data> <data name="product/data/sku" xsi:type="string">DownloadableProduct_%isolation%</data> <data name="product/data/price/value" xsi:type="string">57</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> + <data name="product/data/tax_class_id/dataset" xsi:type="string">taxable_goods</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">10</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> <data name="product/data/category" xsi:type="string">category %isolation%</data> <data name="product/data/short_description" xsi:type="string">This is short description for downloadable product</data> - <data name="product/data/downloadable_sample/preset" xsi:type="string">default</data> - <data name="product/data/downloadable_links/preset" xsi:type="string">with_three_links</data> - <data name="product/data/custom_options/preset" xsi:type="string">default</data> + <data name="product/data/downloadable_sample/dataset" xsi:type="string">with_two_samples</data> + <data name="product/data/downloadable_links/dataset" xsi:type="string">with_three_links</data> + <data name="product/data/custom_options/dataset" xsi:type="string">default</data> <data name="product/data/custom_options/import_products" xsi:type="string">catalogProductSimple::with_two_custom_option,catalogProductSimple::with_all_custom_option</data> <data name="product/data/url_key" xsi:type="string">downloadableproduct-%isolation%</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> @@ -189,16 +189,16 @@ <data name="product/data/name" xsi:type="string">DownloadableProduct_%isolation%</data> <data name="product/data/sku" xsi:type="string">DownloadableProduct_%isolation%</data> <data name="product/data/price/value" xsi:type="string">65</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> + <data name="product/data/tax_class_id/dataset" xsi:type="string">taxable_goods</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">11</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> <data name="product/data/category" xsi:type="string">category %isolation%</data> <data name="product/data/description" xsi:type="string">This is description for downloadable product</data> <data name="product/data/short_description" xsi:type="string">This is short description for downloadable product</data> - <data name="product/data/downloadable_sample/preset" xsi:type="string">default</data> - <data name="product/data/downloadable_links/preset" xsi:type="string">with_three_links</data> - <data name="product/data/custom_options/preset" xsi:type="string">default</data> + <data name="product/data/downloadable_sample/dataset" xsi:type="string">with_two_samples</data> + <data name="product/data/downloadable_links/dataset" xsi:type="string">with_three_links</data> + <data name="product/data/custom_options/dataset" xsi:type="string">default</data> <data name="product/data/url_key" xsi:type="string">downloadableproduct-%isolation%</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> @@ -213,14 +213,14 @@ <data name="product/data/name" xsi:type="string">DownloadableProduct_%isolation%</data> <data name="product/data/sku" xsi:type="string">DownloadableProduct_%isolation%</data> <data name="product/data/price/value" xsi:type="string">65</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> + <data name="product/data/tax_class_id/dataset" xsi:type="string">taxable_goods</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">11</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> <data name="product/data/category" xsi:type="string">category %isolation%</data> - <data name="product/data/downloadable_sample/preset" xsi:type="string">default</data> - <data name="product/data/downloadable_links/preset" xsi:type="string">with_three_links</data> - <data name="product/data/custom_options/preset" xsi:type="string">default</data> + <data name="product/data/downloadable_sample/dataset" xsi:type="string">with_two_samples</data> + <data name="product/data/downloadable_links/dataset" xsi:type="string">with_three_links</data> + <data name="product/data/custom_options/dataset" xsi:type="string">default</data> <data name="product/data/url_key" xsi:type="string">downloadableproduct-%isolation%</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> @@ -234,10 +234,10 @@ <data name="product/data/name" xsi:type="string">DownloadableProduct_%isolation%</data> <data name="product/data/sku" xsi:type="string">DownloadableProduct_%isolation%</data> <data name="product/data/price/value" xsi:type="string">100</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> + <data name="product/data/tax_class_id/dataset" xsi:type="string">taxable_goods</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> <data name="product/data/category" xsi:type="string">Default Category</data> - <data name="product/data/downloadable_links/preset" xsi:type="string">default</data> + <data name="product/data/downloadable_links/dataset" xsi:type="string">with_two_separately_links</data> <data name="product/data/url_key" xsi:type="string">downloadableproduct-%isolation%</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Downloadable\Test\Constraint\AssertDownloadableProductForm" /> @@ -249,12 +249,12 @@ <data name="product/data/name" xsi:type="string">DownloadableProduct_%isolation%</data> <data name="product/data/sku" xsi:type="string">DownloadableProduct_%isolation%</data> <data name="product/data/price/value" xsi:type="string">10</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> + <data name="product/data/tax_class_id/dataset" xsi:type="string">taxable_goods</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">10</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> <data name="product/data/category" xsi:type="string">category %isolation%</data> - <data name="product/data/downloadable_links/preset" xsi:type="string">default</data> + <data name="product/data/downloadable_links/dataset" xsi:type="string">with_two_separately_links</data> <data name="product/data/special_price" xsi:type="string">5</data> <data name="product/data/url_key" xsi:type="string">downloadableproduct-%isolation%</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> @@ -268,13 +268,13 @@ <data name="product/data/name" xsi:type="string">DownloadableProduct_%isolation%</data> <data name="product/data/sku" xsi:type="string">DownloadableProduct_%isolation%</data> <data name="product/data/price/value" xsi:type="string">365</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> + <data name="product/data/tax_class_id/dataset" xsi:type="string">taxable_goods</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">23</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> <data name="product/data/category" xsi:type="string">category %isolation%</data> - <data name="product/data/downloadable_links/preset" xsi:type="string">default</data> - <data name="product/data/group_price/preset" xsi:type="string">default</data> + <data name="product/data/downloadable_links/dataset" xsi:type="string">with_two_separately_links</data> + <data name="product/data/group_price/dataset" xsi:type="string">not_logged_in_20</data> <data name="product/data/url_key" xsi:type="string">downloadableproduct-%isolation%</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> @@ -287,13 +287,13 @@ <data name="product/data/name" xsi:type="string">DownloadableProduct_%isolation%</data> <data name="product/data/sku" xsi:type="string">DownloadableProduct_%isolation%</data> <data name="product/data/price/value" xsi:type="string">250</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> + <data name="product/data/tax_class_id/dataset" xsi:type="string">taxable_goods</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">65</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> <data name="product/data/category" xsi:type="string">category %isolation%</data> - <data name="product/data/downloadable_links/preset" xsi:type="string">default</data> - <data name="product/data/tier_price/preset" xsi:type="string">default</data> + <data name="product/data/downloadable_links/dataset" xsi:type="string">with_two_separately_links</data> + <data name="product/data/tier_price/dataset" xsi:type="string">default</data> <data name="product/data/url_key" xsi:type="string">downloadableproduct-%isolation%</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/UpdateDownloadableProductEntityTest.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/UpdateDownloadableProductEntityTest.php index 7fd60c8a210852ee56aedebcde77ba69fc12476e..30bb9409bce622288045e9ff565cf7c51928c0c7 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/UpdateDownloadableProductEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/UpdateDownloadableProductEntityTest.php @@ -90,7 +90,7 @@ class UpdateDownloadableProductEntityTest extends Injectable ) { $this->product = $fixtureFactory->createByCode( 'downloadableProduct', - ['dataSet' => 'default'] + ['dataset' => 'default'] ); $this->product->persist(); $this->catalogProductIndex = $catalogProductIndexNewPage; diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/UpdateDownloadableProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/UpdateDownloadableProductEntityTest.xml index 10ba00e4d5db1f8c1791e7c96b82c0ddde64d343..e0de074a41c10a50d08b9a874fc99fc7c94016c8 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/UpdateDownloadableProductEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/UpdateDownloadableProductEntityTest.xml @@ -11,13 +11,13 @@ <data name="product/data/name" xsi:type="string">DownloadableProduct_%isolation%</data> <data name="product/data/sku" xsi:type="string">DownloadableProduct_%isolation%</data> <data name="product/data/price/value" xsi:type="string">55</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> + <data name="product/data/tax_class_id/dataset" xsi:type="string">taxable_goods</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">10</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> - <data name="product/data/downloadable_sample/preset" xsi:type="string">with_three_samples</data> - <data name="product/data/downloadable_links/preset" xsi:type="string">with_three_links</data> - <data name="product/data/custom_options/preset" xsi:type="string">two_options</data> + <data name="product/data/downloadable_sample/dataset" xsi:type="string">with_three_samples</data> + <data name="product/data/downloadable_links/dataset" xsi:type="string">with_three_links</data> + <data name="product/data/custom_options/dataset" xsi:type="string">two_options</data> <data name="isRequired" xsi:type="string">No</data> <data name="product/data/url_key" xsi:type="string">downloadableproduct-%isolation%</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> @@ -33,12 +33,12 @@ <data name="product/data/name" xsi:type="string">DownloadableProduct_%isolation%</data> <data name="product/data/sku" xsi:type="string">DownloadableProduct_%isolation%</data> <data name="product/data/price/value" xsi:type="string">100</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> + <data name="product/data/tax_class_id/dataset" xsi:type="string">taxable_goods</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">50</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">Out of Stock</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> <data name="product/data/category" xsi:type="string">Default Category</data> - <data name="product/data/downloadable_links/preset" xsi:type="string">default</data> + <data name="product/data/downloadable_links/dataset" xsi:type="string">with_two_separately_links</data> <data name="isRequired" xsi:type="string">No</data> <data name="product/data/url_key" xsi:type="string">downloadableproduct-%isolation%</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> @@ -50,7 +50,7 @@ <data name="product/data/name" xsi:type="string">DownloadableProduct_%isolation%</data> <data name="product/data/sku" xsi:type="string">DownloadableProduct_%isolation%</data> <data name="product/data/price/value" xsi:type="string">9999</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> + <data name="product/data/tax_class_id/dataset" xsi:type="string">taxable_goods</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">123</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> <data name="product/data/category" xsi:type="string">Default Category</data> @@ -68,13 +68,13 @@ <data name="product/data/name" xsi:type="string">DownloadableProduct_%isolation%</data> <data name="product/data/sku" xsi:type="string">DownloadableProduct_%isolation%</data> <data name="product/data/price/value" xsi:type="string">48</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">None</data> + <data name="product/data/tax_class_id/dataset" xsi:type="string">None</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">5</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> <data name="product/data/category" xsi:type="string">Default Category</data> <data name="product/data/description" xsi:type="string">This is description for downloadable product</data> - <data name="product/data/downloadable_links/preset" xsi:type="string">default</data> + <data name="product/data/downloadable_links/dataset" xsi:type="string">with_two_separately_links</data> <data name="isRequired" xsi:type="string">No</data> <data name="product/data/url_key" xsi:type="string">downloadableproduct-%isolation%</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> @@ -86,15 +86,15 @@ <data name="product/data/name" xsi:type="string">DownloadableProduct_%isolation%</data> <data name="product/data/sku" xsi:type="string">DownloadableProduct_%isolation%</data> <data name="product/data/price/value" xsi:type="string">54</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> + <data name="product/data/tax_class_id/dataset" xsi:type="string">taxable_goods</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">10</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> <data name="product/data/category" xsi:type="string">category %isolation%</data> <data name="product/data/short_description" xsi:type="string">This is short description for downloadable product</data> - <data name="product/data/downloadable_sample/preset" xsi:type="string">default</data> - <data name="product/data/downloadable_links/preset" xsi:type="string">with_three_links</data> - <data name="product/data/custom_options/preset" xsi:type="string">default</data> + <data name="product/data/downloadable_sample/dataset" xsi:type="string">with_two_samples</data> + <data name="product/data/downloadable_links/dataset" xsi:type="string">with_three_links</data> + <data name="product/data/custom_options/dataset" xsi:type="string">default</data> <data name="isRequired" xsi:type="string">Yes</data> <data name="product/data/url_key" xsi:type="string">downloadableproduct-%isolation%</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> @@ -110,7 +110,7 @@ <data name="product/data/name" xsi:type="string">DownloadableProduct_%isolation%</data> <data name="product/data/sku" xsi:type="string">DownloadableProduct_%isolation%</data> <data name="product/data/price/value" xsi:type="string">43</data> - <data name="product/data/tax_class_id/dataSet" xsi:type="string">taxable_goods</data> + <data name="product/data/tax_class_id/dataset" xsi:type="string">taxable_goods</data> <data name="product/data/quantity_and_stock_status/qty" xsi:type="string">10</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> <data name="product/data/is_virtual" xsi:type="string">Yes</data> diff --git a/dev/tests/functional/tests/app/Magento/Fedex/Test/TestCase/OnePageCheckoutTest.xml b/dev/tests/functional/tests/app/Magento/Fedex/Test/TestCase/OnePageCheckoutTest.xml index 846ea00925857a42c33c6fc80933cf69d7760a19..28075acb0a4cbfa5f2d21614d80c864df87f1edd 100644 --- a/dev/tests/functional/tests/app/Magento/Fedex/Test/TestCase/OnePageCheckoutTest.xml +++ b/dev/tests/functional/tests/app/Magento/Fedex/Test/TestCase/OnePageCheckoutTest.xml @@ -11,14 +11,14 @@ <data name="description" xsi:type="string">Check Out as Guest using FedEx with US shipping origin and UK customer</data> <data name="products" xsi:type="string">catalogProductSimple::default, configurableProduct::default, bundleProduct::bundle_fixed_product</data> <data name="checkoutMethod" xsi:type="string">guest</data> - <data name="customer/dataSet" xsi:type="string">default</data> - <data name="address/dataSet" xsi:type="string">UK_address</data> - <data name="billingAddress/dataSet" xsi:type="string">UK_address</data> + <data name="customer/dataset" xsi:type="string">default</data> + <data name="address/dataset" xsi:type="string">UK_address</data> + <data name="billingAddress/dataset" xsi:type="string">UK_address</data> <data name="shipping/shipping_service" xsi:type="string">Federal Express</data> <data name="shipping/shipping_method" xsi:type="string">International Economy</data> <data name="cart/data/shipping_method" xsi:type="string">International Economy</data> <data name="payment/method" xsi:type="string">checkmo</data> - <data name="configData" xsi:type="string">checkmo, fedex, shipping_origin_US_CA</data><!--<data name="issue" xsi:type="string">Rating is temporarily unavailable - Error in FEDEX</data>--> + <data name="configData" xsi:type="string">checkmo, fedex, shipping_origin_US_CA</data> <constraint name="Magento\Checkout\Test\Constraint\AssertOrderSuccessPlacedMessage"/> <constraint name="Magento\Sales\Test\Constraint\AssertOrderInOrdersGrid"/> <constraint name="Magento\Checkout\Test\Constraint\AssertCartIsEmpty"/> @@ -27,9 +27,9 @@ <data name="description" xsi:type="string">MAGETWO-12849 – Use FedEx Online Shipping Carrier on Checkout as a Registered Customer</data> <data name="products" xsi:type="string">catalogProductSimple::default, configurableProduct::default, bundleProduct::bundle_fixed_product</data> <data name="checkoutMethod" xsi:type="string">login</data> - <data name="customer/dataSet" xsi:type="string">customer_DE</data> - <data name="address/dataSet" xsi:type="string">customer_DE</data> - <data name="billingAddress/dataSet" xsi:type="string">customer_DE</data> + <data name="customer/dataset" xsi:type="string">customer_DE</data> + <data name="address/dataset" xsi:type="string">DE_address</data> + <data name="billingAddress/dataset" xsi:type="string">customer_DE</data> <data name="shipping/shipping_service" xsi:type="string">Federal Express</data> <data name="shipping/shipping_method" xsi:type="string">Ground</data> <data name="cart/data/shipping_method" xsi:type="string">Ground</data> diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Block/Adminhtml/Order/Create.php b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Block/Adminhtml/Order/Create.php index a30bc92f6f7a96e588b74502f52ab54ed6024b46..5cc2532f1c544217562e07cf9a16c863c04d4053 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Block/Adminhtml/Order/Create.php +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Block/Adminhtml/Order/Create.php @@ -36,8 +36,8 @@ class Create extends \Magento\Sales\Test\Block\Adminhtml\Order\Create 'Magento\GiftMessage\Test\Block\Adminhtml\Order\Create\Items', ['element' => $this->_rootElement->find($this->itemsBlock)] ); - foreach ($products as $key => $product) { - $giftMessageItem = $giftMessage->getItems()[$key]; + foreach ($giftMessage->getItems() as $key => $giftMessageItem) { + $product = $products[$key]; $items->getItemProduct($product)->fillGiftMessageForm($giftMessageItem); } } diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Block/Adminhtml/Order/Create/GiftOptions.php b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Block/Adminhtml/Order/Create/GiftOptions.php index dc4cd18309225b15af820330550275f99bd0efb3..dcf34e5af99ac86b215be87df5cd8b8c4e9c313c 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Block/Adminhtml/Order/Create/GiftOptions.php +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Block/Adminhtml/Order/Create/GiftOptions.php @@ -7,7 +7,6 @@ namespace Magento\GiftMessage\Test\Block\Adminhtml\Order\Create; /** - * Class GiftOptions * Backend GiftMessage for order form. */ class GiftOptions extends \Magento\Mtf\Block\Form diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Block/Adminhtml/Order/Create/GiftOptions.xml b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Block/Adminhtml/Order/Create/GiftOptions.xml index a55da0421665c7dbef5f59b08448b20d64583cb6..34ecc89c7da57db9b3fb2bcfb97af9bda0795ef8 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Block/Adminhtml/Order/Create/GiftOptions.xml +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Block/Adminhtml/Order/Create/GiftOptions.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> -<mapping strict="0"> +<mapping strict="1"> <fields> <sender> <selector>[name$="[sender]"]</selector> diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInBackendOrder.php b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInBackendOrder.php index 9d4546439a5f9e99eed56b299fd95b1878721f7a..7ebe75449ad209a1053add870d5ecbf0ea9bf839 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInBackendOrder.php +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInBackendOrder.php @@ -12,8 +12,7 @@ use Magento\Sales\Test\Page\Adminhtml\SalesOrderView; use Magento\Mtf\Constraint\AbstractAssertForm; /** - * Class AssertGiftMessageInBackendOrder - * Assert that message from dataSet is displayed on order(s) view page on backend. + * Assert that message from dataset is displayed on order(s) view page on backend. */ class AssertGiftMessageInBackendOrder extends AbstractAssertForm { @@ -30,7 +29,7 @@ class AssertGiftMessageInBackendOrder extends AbstractAssertForm ]; /** - * Assert that message from dataSet is displayed on order(s) view page on backend. + * Assert that message from dataset is displayed on order(s) view page on backend. * * @param GiftMessage $giftMessage * @param SalesOrderView $salesOrderView @@ -46,6 +45,8 @@ class AssertGiftMessageInBackendOrder extends AbstractAssertForm array $products, $orderId ) { + $expectedData = []; + $actualData = []; $orderIndex->open()->getSalesOrderGrid()->searchAndOpen(['id' => $orderId]); if ($giftMessage->getAllowGiftMessagesForOrder()) { @@ -54,8 +55,9 @@ class AssertGiftMessageInBackendOrder extends AbstractAssertForm } if ($giftMessage->getAllowGiftOptionsForItems()) { - foreach ($products as $key => $product) { - $expectedData[] = $giftMessage->getItems()[$key]->getData(); + foreach ($giftMessage->getItems() as $key => $giftMessageItem) { + $expectedData[] = $giftMessageItem->getData(); + $product = $products[$key]; $actualData[] = $salesOrderView->getGiftItemsBlock()->getItemProduct($product) ->getGiftMessageFormData($giftMessage); } @@ -72,6 +74,6 @@ class AssertGiftMessageInBackendOrder extends AbstractAssertForm */ public function toString() { - return 'Backend gift message form data is equal to data passed from dataSet.'; + return 'Backend gift message form data is equal to data passed from dataset.'; } } diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrder.php b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrder.php index 4fcfbc2afb80eea11d9563d03b702ef72bebb6f9..d7a16e4e7e2fb0465283b48c019bbd7d956a79bc 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrder.php +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrder.php @@ -14,12 +14,12 @@ use Magento\Sales\Test\Page\CustomerOrderView; use Magento\Mtf\Constraint\AbstractConstraint; /** - * Assert that message from dataSet is displayed on order(s) view page on frontend. + * Assert that message from dataset is displayed on order(s) view page on frontend. */ class AssertGiftMessageInFrontendOrder extends AbstractConstraint { /** - * Assert that message from dataSet is displayed on order(s) view page on frontend. + * Assert that message from dataset is displayed on order(s) view page on frontend. * * @param GiftMessage $giftMessage * @param Customer $customer diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrderItems.php b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrderItems.php index 932115cdf37abb0a769342973706c00a20f05734..bb193414ea93a70f62b7e64ce4281c4ba87dd0d9 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrderItems.php +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrderItems.php @@ -15,12 +15,12 @@ use Magento\Mtf\Constraint\AbstractConstraint; /** * Class AssertGiftMessageInFrontendOrderItems - * Assert that message from dataSet is displayed for each items on order(s) view page on frontend + * Assert that message from dataset is displayed for each items on order(s) view page on frontend */ class AssertGiftMessageInFrontendOrderItems extends AbstractConstraint { /** - * Assert that message from dataSet is displayed for each items on order(s) view page on frontend + * Assert that message from dataset is displayed for each items on order(s) view page on frontend * * @param GiftMessage $giftMessage * @param Customer $customer @@ -53,9 +53,9 @@ class AssertGiftMessageInFrontendOrderItems extends AbstractConstraint $orderHistory->open(); $orderHistory->getOrderHistoryBlock()->openOrderById($orderId); - foreach ($products as $key => $product) { + foreach ($giftMessage->getItems() as $key => $itemGiftMessage) { + $product = $products[$key]; if ($giftMessage->hasData('items')) { - $itemGiftMessage = $giftMessage->getItems()[$key]; $expectedData = [ 'sender' => $itemGiftMessage->getSender(), 'recipient' => $itemGiftMessage->getRecipient(), diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Fixture/GiftMessage.xml b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Fixture/GiftMessage.xml index d11995d1e7dc6baef8dc65be2371f688ec1c73dc..17844e49b69b1e0cb11f8cd53f52146d6eec725a 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Fixture/GiftMessage.xml +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Fixture/GiftMessage.xml @@ -6,36 +6,22 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="giftMessage" module="Magento_GiftMessage" type="flat" entity_type="gift_message" collection="Magento\GiftMessage\Model\Resource\Message\Collection" identifier="gift_message_id" repository_class="Magento\GiftMessage\Test\Repository\GiftMessage" class="Magento\GiftMessage\Test\Fixture\GiftMessage"> - <dataset name="default"> - <field name="allow_gift_options" xsi:type="string">Yes</field> - <field name="allow_gift_messages_for_order" xsi:type="string">Yes</field> - <field name="sender" xsi:type="string">John Doe</field> - <field name="recipient" xsi:type="string">Jane Doe</field> - <field name="message" xsi:type="string">text_%isolation%</field> - </dataset> - <field name="gift_message_id" is_required="1"> - <default_value xsi:type="null"/> - </field> - <field name="customer_id" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="sender" is_required=""> - <default_value xsi:type="string">John Doe</default_value> - </field> - <field name="recipient" is_required=""> - <default_value xsi:type="string">Jane Doe</default_value> - </field> - <field name="message" is_required=""> - <default_value xsi:type="string">text_%isolation%</default_value> - </field> - <field name="allow_gift_options"> - <default_value xsi:type="string">Yes</default_value> - </field> - <field name="allow_gift_messages_for_order"> - <default_value xsi:type="string">Yes</default_value> - </field> - <field name="allow_gift_options_for_items"/> - <field name="items" source="Magento\GiftMessage\Test\Fixture\GiftMessage\Items"/> - </fixture> + <fixture name="giftMessage" + module="Magento_GiftMessage" + type="flat" + entity_type="gift_message" + collection="Magento\GiftMessage\Model\Resource\Message\Collection" + identifier="gift_message_id" + repository_class="Magento\GiftMessage\Test\Repository\GiftMessage" + class="Magento\GiftMessage\Test\Fixture\GiftMessage"> + <field name="gift_message_id" is_required="1" /> + <field name="customer_id" is_required="" /> + <field name="sender" is_required="" /> + <field name="recipient" is_required="" /> + <field name="message" is_required="" /> + <field name="allow_gift_options" /> + <field name="allow_gift_messages_for_order" /> + <field name="allow_gift_options_for_items" /> + <field name="items" source="Magento\GiftMessage\Test\Fixture\GiftMessage\Items" /> + </fixture> </config> diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Fixture/GiftMessage/Items.php b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Fixture/GiftMessage/Items.php index d53cc71937440951f1334e325d5fb514b1c504ab..995f35bb57255562f74688e69be56bfbe70192d7 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Fixture/GiftMessage/Items.php +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Fixture/GiftMessage/Items.php @@ -6,32 +6,16 @@ namespace Magento\GiftMessage\Test\Fixture\GiftMessage; +use Magento\Mtf\Fixture\DataSource; use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Mtf\Fixture\FixtureInterface; /** - * Class Items - * Prepare Items for GiftMessage + * Prepare Items for GiftMessage. */ -class Items implements FixtureInterface +class Items extends DataSource { /** - * Prepared dataSet data - * - * @var array - */ - protected $data; - - /** - * Data set configuration settings - * - * @var array - */ - protected $params; - - /** - * Constructor - * + * @constructor * @param FixtureFactory $fixtureFactory * @param array $params * @param array $data [optional] @@ -39,46 +23,13 @@ class Items implements FixtureInterface public function __construct(FixtureFactory $fixtureFactory, array $params, array $data = []) { $this->params = $params; - if (isset($data['dataSets'])) { - $dataSets = explode(',', $data['dataSets']); - foreach ($dataSets as $dataSet) { - $this->data[] = $fixtureFactory->createByCode('giftMessage', ['dataSet' => trim($dataSet)]); + if (isset($data['datasets'])) { + $datasets = explode(',', $data['datasets']); + foreach ($datasets as $dataset) { + $this->data[] = $fixtureFactory->createByCode('giftMessage', ['dataset' => trim($dataset)]); } } else { $this->data = $data; } } - - /** - * 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; - } } diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Page/Adminhtml/OrderView.xml b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Page/Adminhtml/OrderView.xml index 4270f0d4106dc3c2abefa30a8474f88d67783f6b..6ea4afd10785d00f8633d021c94fb2b404763ca1 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Page/Adminhtml/OrderView.xml +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Page/Adminhtml/OrderView.xml @@ -8,6 +8,6 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd"> <page name="SalesOrderView" area="Adminhtml" mca="sales/order/view"> <block name="giftOptionsBlock" class="Magento\GiftMessage\Test\Block\Adminhtml\Order\View\GiftOptions" locator=".order-gift-options" strategy="css selector"/> - <block name="giftItemsBlock" class="Magento\GiftMessage\Test\Block\Adminhtml\Order\View\Items" locator="#sales_order_view_tabs_order_info_content .grid" strategy="css selector"/> + <block name="giftItemsBlock" class="Magento\GiftMessage\Test\Block\Adminhtml\Order\View\Items" locator="#sales_order_view_tabs_order_info_content .edit-order-table" strategy="css selector"/> </page> </config> diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.php b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.php index 18a366d47dfdad8c6a7da738c08b657e9aac8260..9a53ceb731423d050d562b72842d79e04bc1b254 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.php +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.php @@ -13,7 +13,7 @@ use Magento\Mtf\TestCase\Scenario; * * Preconditions: * 1. Enable Gift Messages (Order/Items level) - * 2. Create Product according dataSet + * 2. Create Product according dataset * * Steps: * 1. Login as registered customer diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.xml b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.xml index b6433e7ad8ed1e3a5d3715920b9e4f7cc85f4e47..bdc1fbbd1aee949eb1dc16b96dd67aea2b0b609a 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.xml +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.xml @@ -9,8 +9,8 @@ <testCase name="Magento\GiftMessage\Test\TestCase\CheckoutWithGiftMessagesTest"> <variation name="CheckoutWithGiftMessagesTestVariation1"> <data name="products" xsi:type="string">catalogProductSimple::default, catalogProductVirtual::default</data> - <data name="customer/dataSet" xsi:type="string">default</data> - <data name="billingAddress/dataSet" xsi:type="string">US_address_1</data> + <data name="customer/dataset" xsi:type="string">default</data> + <data name="billingAddress/dataset" xsi:type="string">US_address_1</data> <data name="checkoutMethod" xsi:type="string">login</data> <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data> <data name="shipping/shipping_method" xsi:type="string">Fixed</data> @@ -26,8 +26,8 @@ </variation> <variation name="CheckoutWithGiftMessagesTestVariation2"> <data name="products" xsi:type="string">catalogProductSimple::default, catalogProductVirtual::default</data> - <data name="customer/dataSet" xsi:type="string">default</data> - <data name="billingAddress/dataSet" xsi:type="string">US_address_1</data> + <data name="customer/dataset" xsi:type="string">default</data> + <data name="billingAddress/dataset" xsi:type="string">US_address_1</data> <data name="checkoutMethod" xsi:type="string">login</data> <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data> <data name="shipping/shipping_method" xsi:type="string">Fixed</data> diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Block/Adminhtml/Product/Grouped/AssociatedProducts.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Block/Adminhtml/Product/Grouped/AssociatedProducts.php index 618e06a6391659476bd7fcf648193767afae8302..0b6e622cf8d03bfabcc217caa3fdb29b9ba1f46d 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Block/Adminhtml/Product/Grouped/AssociatedProducts.php +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Block/Adminhtml/Product/Grouped/AssociatedProducts.php @@ -7,48 +7,56 @@ namespace Magento\GroupedProduct\Test\Block\Adminhtml\Product\Grouped; use Magento\Backend\Test\Block\Widget\Tab; +use Magento\GroupedProduct\Test\Block\Adminhtml\Product\Grouped\AssociatedProducts\ListAssociatedProducts; +use Magento\GroupedProduct\Test\Block\Adminhtml\Product\Grouped\AssociatedProducts\Search\Grid; use Magento\Mtf\Client\Element\SimpleElement; use Magento\Mtf\Client\Element; use Magento\Mtf\Client\Locator; /** - * Class AssociatedProducts - * Grouped products tab + * Grouped products tab. */ class AssociatedProducts extends Tab { /** - * 'Create New Option' button + * 'Create New Option' button. * * @var string */ protected $addNewOption = '#grouped-product-container>button'; /** - * Associated products grid locator + * Associated products grid locator. * * @var string */ protected $productSearchGrid = './/*[@data-role="modal"][.//*[@data-role="add-product-dialog"]]'; /** - * Associated products list block + * Associated products list block. * * @var string */ protected $associatedProductsBlock = '[data-role=grouped-product-grid]'; /** - * Selector for delete button + * Selector for delete button. * * @var string */ protected $deleteButton = '[data-role="delete"]'; /** - * Get search grid + * Selector for loading mask element. * - * @return AssociatedProducts\Search\Grid + * @var string + */ + protected $loadingMask = '.loading-mask'; + + /** + * Get search grid. + * + * @return Grid */ protected function getSearchGridBlock() { @@ -59,9 +67,9 @@ class AssociatedProducts extends Tab } /** - * Get associated products list block + * Get associated products list block. * - * @return AssociatedProducts\ListAssociatedProducts + * @return ListAssociatedProducts */ protected function getListAssociatedProductsBlock() { @@ -72,7 +80,7 @@ class AssociatedProducts extends Tab } /** - * Fill data to fields on tab + * Fill data to fields on tab. * * @param array $fields * @param SimpleElement|null $element @@ -90,6 +98,7 @@ class AssociatedProducts extends Tab foreach ($fields['associated']['value']['assigned_products'] as $key => $groupedProduct) { $element->find($this->addNewOption)->click(); $searchBlock = $this->getSearchGridBlock(); + $this->waitLoaderNotVisible(); $searchBlock->searchAndSelect(['name' => $groupedProduct['name']]); $searchBlock->addProducts(); $this->getListAssociatedProductsBlock()->fillProductOptions($groupedProduct, ($key + 1)); @@ -99,7 +108,7 @@ class AssociatedProducts extends Tab } /** - * Get data to fields on group tab + * Get data to fields on group tab. * * @param array|null $fields * @param SimpleElement|null $element @@ -118,4 +127,21 @@ class AssociatedProducts extends Tab } return $newFields; } + + /** + * Wait until loader is not visible. + * + * return void + */ + protected function waitLoaderNotVisible() + { + $browser = $this->browser; + $selector = $this->loadingMask; + $browser->waitUntil( + function () use ($browser, $selector) { + $element = $browser->find($selector); + return $element->isVisible() === false ? true : null; + } + ); + } } diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedProductForm.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedProductForm.php index fe78ef841ca38bac22f7c4897240da6b7b6a875a..dd4743f94361801334728e85f01b0c6439bf0509 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedProductForm.php +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedProductForm.php @@ -44,7 +44,7 @@ class AssertGroupedProductForm extends AssertProductForm } /** - * Prepare Grouped Options array from preset + * Prepare Grouped Options array from dataset * * @param array $fields * @return array diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/Cart/Item.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/Cart/Item.php index bd6f991bce9ee4093b26e9795ebb222f3acf2b17..c06591804d57c4f1df55f73a4108485720bd1555 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/Cart/Item.php +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/Cart/Item.php @@ -10,8 +10,7 @@ use Magento\GroupedProduct\Test\Fixture\GroupedProduct; use Magento\Mtf\Fixture\FixtureInterface; /** - * Class Item - * Data for verify cart item block on checkout page + * Data for verify cart item block on checkout page. * * Data keys: * - product (fixture data for verify) @@ -53,37 +52,4 @@ class Item extends \Magento\Catalog\Test\Fixture\Cart\Item $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/Magento/GroupedProduct/Test/Fixture/GroupedProduct.xml b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProduct.xml index 5fc47bd6a0c653287b86c7ccc4ecd29838839f8d..e1757e1adbcf006b9653385d22b80bb23be118cb 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProduct.xml +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProduct.xml @@ -6,166 +6,73 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="groupedProduct" module="Magento_GroupedProduct" type="eav" entity_type="catalog_product" product_type="grouped" collection="Magento\Catalog\Model\Resource\Product\Collection" identifier="sku" repository_class="Magento\GroupedProduct\Test\Repository\GroupedProduct" handler_interface="Magento\GroupedProduct\Test\Handler\GroupedProduct\GroupedProductInterface" class="Magento\GroupedProduct\Test\Fixture\GroupedProduct"> - <dataset name="default"> - <field name="name" xsi:type="string">GroupedProduct_%isolation%</field> - <field name="sku" xsi:type="string">GroupedProduct_%isolation%</field> - <field name="tax_class" xsi:type="string">Taxable Goods</field> - <field name="description" xsi:type="string">This is description for grouped product</field> - <field name="short_description" xsi:type="string">This is short description for grouped product</field> - <field name="quantity_and_stock_status" xsi:type="array"> - <item name="qty" xsi:type="string">1</item> - <item name="is_in_stock" xsi:type="string">In Stock</item> - </field> - </dataset> - <data_config> - <item name="type_id" xsi:type="string">grouped</item> - <item name="create_url_params" xsi:type="array"> - <item name="type" xsi:type="string">grouped</item> - <item name="set" xsi:type="string">4</item> - </item> - <item name="input_prefix" xsi:type="string">product</item> - </data_config> - <field name="category_ids" is_required="0" group="product-details" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\CategoryIds"> - <default_value xsi:type="null"/> - </field> - <field name="country_of_manufacture" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="created_at" is_required="1"> - <default_value xsi:type="null"/> - </field> - <field name="custom_design" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="associated" is_required="1" group="grouped" source="Magento\GroupedProduct\Test\Fixture\GroupedProduct\Associated"/> - <field name="custom_design_from" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="custom_design_to" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="custom_layout_update" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="description" is_required="0" group="product-details"> - <default_value xsi:type="string">This is description for grouped product</default_value> - </field> - <field name="gallery" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="gift_message_available" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="has_options" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="image" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="image_label" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="is_returnable" is_required="0"> - <default_value xsi:type="number">2</default_value> - </field> - <field name="media_gallery" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="meta_description" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="meta_keyword" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="meta_title" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="name" is_required="1" group="product-details"> - <default_value xsi:type="string">GroupedProduct_%isolation%</default_value> - </field> - <field name="news_from_date" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="news_to_date" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="old_id" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="options_container" is_required="0"> - <default_value xsi:type="string">container2</default_value> - </field> - <field name="page_layout" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="quantity_and_stock_status" is_required="0" group="product-details"> - <default_value xsi:type="array"> - <item name="qty" xsi:type="number">1</item> - <item name="is_in_stock" xsi:type="string">In Stock</item> - </default_value> - </field> - <field name="stock_data" group="advanced-inventory"/> - <field name="related_tgtr_position_behavior" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="related_tgtr_position_limit" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="required_options" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="short_description" is_required="0" group="autosettings"> - <default_value xsi:type="string">This is short description for grouped product</default_value> - </field> - <field name="sku" is_required="1" group="product-details"> - <default_value xsi:type="string">GroupedProduct_%isolation%</default_value> - </field> - <field name="small_image" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="small_image_label" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="status" is_required="0"> - <default_value xsi:type="string">1</default_value> - </field> - <field name="thumbnail" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="thumbnail_label" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="updated_at" is_required="1"> - <default_value xsi:type="null"/> - </field> - <field name="upsell_tgtr_position_behavior" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="upsell_tgtr_position_limit" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="url_key" is_required="0" group="search-engine-optimization"> - <default_value xsi:type="null"/> - </field> - <field name="url_path" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="visibility" is_required="0"> - <default_value xsi:type="number">4</default_value> - </field> - <field name="id"/> - <field name="type_id"/> - <field name="attribute_set_id" group="product-details" source="Magento\Catalog\Test\Fixture\CatalogProductSimple\AttributeSetId"/> - <field name="website_ids" group="websites"> - <default_value xsi:type="array"> - <item name="0" xsi:type="string">Main Website</item> - </default_value> - </field> - <field name="price" source="Magento\GroupedProduct\Test\Fixture\GroupedProduct\Price"/> - <field name="checkout_data" group="null" source="Magento\GroupedProduct\Test\Fixture\GroupedProduct\CheckoutData"/> - <field name="tax_class"> - <default_value xsi:type="string">taxable_goods</default_value> - </field> - </fixture> + <fixture name="groupedProduct" + module="Magento_GroupedProduct" + type="eav" + entity_type="catalog_product" + product_type="grouped" + collection="Magento\Catalog\Model\Resource\Product\Collection" + identifier="sku" + repository_class="Magento\GroupedProduct\Test\Repository\GroupedProduct" + handler_interface="Magento\GroupedProduct\Test\Handler\GroupedProduct\GroupedProductInterface" + class="Magento\GroupedProduct\Test\Fixture\GroupedProduct"> + <data_config> + <item name="type_id" xsi:type="string">grouped</item> + <item name="create_url_params" xsi:type="array"> + <item name="type" xsi:type="string">grouped</item> + <item name="set" xsi:type="string">4</item> + </item> + <item name="input_prefix" xsi:type="string">product</item> + </data_config> + <field name="category_ids" is_required="0" group="product-details" source="Magento\Catalog\Test\Fixture\Product\CategoryIds" /> + <field name="country_of_manufacture" is_required="0" /> + <field name="created_at" is_required="1" /> + <field name="custom_design" is_required="0" /> + <field name="associated" is_required="1" group="grouped" source="Magento\GroupedProduct\Test\Fixture\GroupedProduct\Associated" repository="Magento\GroupedProduct\Test\Repository\GroupedProduct\Associated" /> + <field name="custom_design_from" is_required="0" /> + <field name="custom_design_to" is_required="0" /> + <field name="custom_layout_update" is_required="0" /> + <field name="description" is_required="0" group="product-details" /> + <field name="gallery" is_required="0" /> + <field name="gift_message_available" is_required="0" /> + <field name="has_options" is_required="0" /> + <field name="image" is_required="0" /> + <field name="image_label" is_required="0" /> + <field name="is_returnable" is_required="0" /> + <field name="media_gallery" is_required="0" /> + <field name="meta_description" is_required="0" /> + <field name="meta_keyword" is_required="0" /> + <field name="meta_title" is_required="0" /> + <field name="name" is_required="1" group="product-details" /> + <field name="news_from_date" is_required="0" /> + <field name="news_to_date" is_required="0" /> + <field name="old_id" is_required="0" /> + <field name="options_container" is_required="0" /> + <field name="page_layout" is_required="0" /> + <field name="quantity_and_stock_status" is_required="0" group="product-details" /> + <field name="stock_data" group="advanced-inventory" /> + <field name="related_tgtr_position_behavior" is_required="0" /> + <field name="related_tgtr_position_limit" is_required="0" /> + <field name="required_options" is_required="0" /> + <field name="short_description" is_required="0" group="autosettings" /> + <field name="sku" is_required="1" group="product-details" /> + <field name="small_image" is_required="0" /> + <field name="small_image_label" is_required="0" /> + <field name="status" is_required="0" /> + <field name="thumbnail" is_required="0" /> + <field name="thumbnail_label" is_required="0" /> + <field name="updated_at" is_required="1" /> + <field name="upsell_tgtr_position_behavior" is_required="0" /> + <field name="upsell_tgtr_position_limit" is_required="0" /> + <field name="url_key" is_required="0" group="search-engine-optimization" /> + <field name="url_path" is_required="0" /> + <field name="visibility" is_required="0" /> + <field name="id" /> + <field name="type_id" /> + <field name="attribute_set_id" group="product-details" source="Magento\Catalog\Test\Fixture\Product\AttributeSetId" /> + <field name="website_ids" group="websites" /> + <field name="price" source="Magento\Catalog\Test\Fixture\Product\Price" repository="Magento\GroupedProduct\Test\Repository\GroupedProduct\Price" /> + <field name="checkout_data" group="null" repository="Magento\GroupedProduct\Test\Repository\GroupedProduct\CheckoutData" /> + <field name="tax_class" /> + </fixture> </config> diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProduct/Associated.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProduct/Associated.php index 427bc6c11cd4edfd7ed82f34ccafe2b6229d88e2..9bc1dc13d3ac5806531499a0b25794e264dbeb09 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProduct/Associated.php +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProduct/Associated.php @@ -6,45 +6,36 @@ namespace Magento\GroupedProduct\Test\Fixture\GroupedProduct; +use Magento\Mtf\Fixture\DataSource; use Magento\Mtf\Fixture\FixtureFactory; use Magento\Mtf\Fixture\FixtureInterface; use Magento\Mtf\Fixture\InjectableFixture; +use Magento\Mtf\Repository\RepositoryFactory; /** - * Class Associated - * Grouped selections preset - * - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + * Grouped selections sources. */ -class Associated implements FixtureInterface +class Associated extends DataSource { /** - * Prepared dataSet data - * - * @var array - */ - protected $data; - - /** - * Data set configuration settings - * - * @var array - */ - protected $params; - - /** - * Constructor - * + * @constructor + * @param RepositoryFactory $repositoryFactory * @param FixtureFactory $fixtureFactory * @param array $data * @param array $params [optional] * * @SuppressWarnings(PHPMD.NPathComplexity) */ - public function __construct(FixtureFactory $fixtureFactory, array $data, array $params = []) - { + public function __construct( + RepositoryFactory $repositoryFactory, + FixtureFactory $fixtureFactory, + array $data, + array $params = [] + ) { $this->params = $params; - $this->data = isset($data['preset']) ? $this->getPreset($data['preset']) : $data; + $this->data = isset($data['dataset']) + ? $repositoryFactory->get($this->params['repository'])->get($data['dataset']) + : $data; $this->data['products'] = (isset($data['products']) && !is_array($data['products'])) ? explode(',', $data['products']) @@ -52,9 +43,9 @@ class Associated implements FixtureInterface foreach ($this->data['products'] as $key => $product) { if (!($product instanceof FixtureInterface)) { - list($fixture, $dataSet) = explode('::', $product); + list($fixture, $dataset) = explode('::', $product); /** @var $productFixture InjectableFixture */ - $product = $fixtureFactory->createByCode($fixture, ['dataSet' => $dataSet]); + $product = $fixtureFactory->createByCode($fixture, ['dataset' => $dataset]); } if (!$product->hasData('id')) { $product->persist(); @@ -62,190 +53,11 @@ class Associated implements FixtureInterface $this->data['products'][$key] = $product; } - $assignedProducts = & $this->data['assigned_products']; + $assignedProducts = &$this->data['assigned_products']; foreach (array_keys($assignedProducts) as $key) { $assignedProducts[$key]['name'] = $this->data['products'][$key]->getName(); $assignedProducts[$key]['id'] = $this->data['products'][$key]->getId(); $assignedProducts[$key]['position'] = $key + 1; } } - - /** - * Persists prepared data into application - * - * @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 string - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Preset array - * - * @param string $name - * @return mixed|null - */ - protected function getPreset($name) - { - $presets = [ - 'defaultSimpleProduct' => [ - 'assigned_products' => [ - [ - 'id' => '%id%', - 'name' => '%item1_simple::getProductName%', - 'position' => '%position%', - 'qty' => 1, - ], - [ - 'id' => '%id%', - 'name' => '%item1_simple::getProductName%', - 'position' => '%position%', - 'qty' => 2, - ], - ], - 'products' => [ - 'catalogProductSimple::default', - 'catalogProductSimple::product_100_dollar', - ], - ], - 'defaultSimpleProduct_without_qty' => [ - 'assigned_products' => [ - [ - 'id' => '%id%', - 'name' => '%item1_simple::getProductName%', - 'position' => '%position%', - 'qty' => 0, - ], - [ - 'id' => '%id%', - 'name' => '%item1_simple::getProductName%', - 'position' => '%position%', - 'qty' => 0, - ], - ], - 'products' => [ - 'catalogProductSimple::default', - 'catalogProductSimple::product_100_dollar', - ], - ], - 'defaultSimpleProduct_with_specialPrice' => [ - 'assigned_products' => [ - [ - 'id' => '%id%', - 'name' => '%item1_simple::getProductName%', - 'position' => '%position%', - 'qty' => 1, - ], - [ - 'id' => '%id%', - 'name' => '%item1_simple::getProductName%', - 'position' => '%position%', - 'qty' => 2, - ], - ], - 'products' => [ - 'catalogProductSimple::withSpecialPrice', - 'catalogProductSimple::withSpecialPrice', - ], - ], - 'defaultVirtualProduct' => [ - 'assigned_products' => [ - [ - 'id' => '%id%', - 'name' => '%item1_virtual::getProductName%', - 'position' => '%position%', - 'qty' => 1, - ], - [ - 'id' => '%id%', - 'name' => '%item1_virtual::getProductName%', - 'position' => '%position%', - 'qty' => 2, - ], - ], - 'products' => [ - 'catalogProductVirtual::default', - 'catalogProductVirtual::product_50_dollar', - ], - ], - 'three_simple_products' => [ - 'assigned_products' => [ - [ - 'id' => '%id%', - 'name' => '%item1_simple::getProductName%', - 'position' => '%position%', - 'qty' => 3, - ], - [ - 'id' => '%id%', - 'name' => '%item1_simple::getProductName%', - 'position' => '%position%', - 'qty' => 1, - ], - [ - 'id' => '%id%', - 'name' => '%item1_simple::getProductName%', - 'position' => '%position%', - 'qty' => 2, - ], - ], - 'products' => [ - 'catalogProductSimple::default', - 'catalogProductSimple::product_40_dollar', - 'catalogProductSimple::product_100_dollar', - ], - ], - 'simple_downloadable_virtual' => [ - 'assigned_products' => [ - [ - 'id' => '%id%', - 'name' => '%item1_simple::getProductName%', - 'position' => '%position%', - 'qty' => 3, - ], - [ - 'id' => '%id%', - 'name' => '%item2_downloadable::getProductName%', - 'position' => '%position%', - 'qty' => 7, - ], - [ - 'id' => '%id%', - 'name' => '%item3_virtual::getProductName%', - 'position' => '%position%', - 'qty' => 11, - ], - ], - 'products' => [], - ], - ]; - if (!isset($presets[$name])) { - return null; - } - return $presets[$name]; - } } diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProduct/CheckoutData.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProduct/CheckoutData.php deleted file mode 100644 index 2871ec912db01ef8020b14699f62d95c6f7299ac..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProduct/CheckoutData.php +++ /dev/null @@ -1,63 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\GroupedProduct\Test\Fixture\GroupedProduct; - -/** - * Class CheckoutData - * Data for fill product form on frontend - * - * Data keys: - * - preset (Checkout data verification preset name) - */ -class CheckoutData extends \Magento\Catalog\Test\Fixture\CatalogProductSimple\CheckoutData -{ - /** - * Get preset array - * - * @param $name - * @return array|null - */ - protected function getPreset($name) - { - $presets = [ - 'three_simple_products' => [ - 'options' => [ - [ - 'name' => 'product_key_0', - 'qty' => 3, - ], - [ - 'name' => 'product_key_1', - 'qty' => 1 - ], - [ - 'name' => 'product_key_2', - 'qty' => 2 - ], - ], - 'cartItem' => [ - 'price' => [ - 'product_key_0' => 560, - 'product_key_1' => 40, - 'product_key_2' => 100, - ], - 'qty' => [ - 'product_key_0' => 3, - 'product_key_1' => 1, - 'product_key_2' => 2, - ], - 'subtotal' => [ - 'product_key_0' => 1680, - 'product_key_1' => 40, - 'product_key_2' => 200, - ], - ], - ], - ]; - return isset($presets[$name]) ? $presets[$name] : null; - } -} diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProduct/Price.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProduct/Price.php deleted file mode 100644 index 2204d6abae2e0ea8c5ebb32cfac2a168342f9fcb..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProduct/Price.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\GroupedProduct\Test\Fixture\GroupedProduct; - -use Magento\Catalog\Test\Fixture\CatalogProductSimple\Price as ParentPrice; -use Magento\Mtf\Fixture\FixtureInterface; - -/** - * Class Price - * - * Data keys: - * - preset (Price verification preset name) - * - value (Price value) - */ -class Price extends ParentPrice implements FixtureInterface -{ - /** - * Preset for price - * - * @return array|null - */ - public function getPreset() - { - $presets = [ - 'starting-100' => [ - 'compare_price' => [ - 'price_starting' => '100.00', - ], - ], - 'starting-560' => [ - 'compare_price' => [ - 'price_starting' => '560.00', - ], - ], - ]; - if (!isset($presets[$this->currentPreset])) { - return null; - } - return $presets[$this->currentPreset]; - } -} diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Repository/GroupedProduct.xml b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Repository/GroupedProduct.xml index cd0bc02b3df4ccab18c34b1876eef98e775af553..5a6c3730426641bbe7fcdb78270da19358f5f2cf 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Repository/GroupedProduct.xml +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Repository/GroupedProduct.xml @@ -11,15 +11,15 @@ <field name="name" xsi:type="string">Test grouped product %isolation%</field> <field name="sku" xsi:type="string">sku_test_grouped_product_%isolation%</field> <field name="category_ids" xsi:type="array"> - <item name="presets" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="associated" xsi:type="array"> - <item name="preset" xsi:type="string">defaultSimpleProduct</item> + <item name="dataset" xsi:type="string">defaultSimpleProduct</item> </field> <field name="status" xsi:type="string">Product online</field> <field name="visibility" xsi:type="string">Catalog, Search</field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="url_key" xsi:type="string">test-grouped-product-%isolation%</field> <field name="quantity_and_stock_status" xsi:type="array"> @@ -29,7 +29,7 @@ <item name="0" xsi:type="string">Main Website</item> </field> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> </dataset> @@ -37,15 +37,15 @@ <field name="name" xsi:type="string">Test grouped product %isolation%</field> <field name="sku" xsi:type="string">sku_test_grouped_product_%isolation%</field> <field name="category_ids" xsi:type="array"> - <item name="presets" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="associated" xsi:type="array"> - <item name="preset" xsi:type="string">defaultSimpleProduct</item> + <item name="dataset" xsi:type="string">defaultSimpleProduct</item> </field> <field name="status" xsi:type="string">Product online</field> <field name="visibility" xsi:type="string">Catalog, Search</field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="url_key" xsi:type="string">test-grouped-product-%isolation%</field> <field name="quantity_and_stock_status" xsi:type="array"> @@ -55,7 +55,7 @@ <item name="0" xsi:type="string">Main Website</item> </field> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> </dataset> @@ -64,18 +64,18 @@ <field name="sku" xsi:type="string">sku_test_grouped_product_%isolation%</field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">-</item> - <item name="preset" xsi:type="string">starting-100</item> + <item name="dataset" xsi:type="string">starting-100</item> </field> <field name="category_ids" xsi:type="array"> - <item name="presets" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="associated" xsi:type="array"> - <item name="preset" xsi:type="string">defaultSimpleProduct</item> + <item name="dataset" xsi:type="string">defaultSimpleProduct</item> </field> <field name="status" xsi:type="string">Product online</field> <field name="visibility" xsi:type="string">Catalog, Search</field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="url_key" xsi:type="string">test-grouped-product-%isolation%</field> <field name="quantity_and_stock_status" xsi:type="array"> @@ -85,7 +85,7 @@ <item name="0" xsi:type="string">Main Website</item> </field> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> </dataset> @@ -93,15 +93,15 @@ <field name="name" xsi:type="string">Grouped product %isolation%</field> <field name="sku" xsi:type="string">grouped_product_%isolation%</field> <field name="category_ids" xsi:type="array"> - <item name="presets" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="associated" xsi:type="array"> - <item name="preset" xsi:type="string">three_simple_products</item> + <item name="dataset" xsi:type="string">three_simple_products</item> </field> <field name="status" xsi:type="string">Product online</field> <field name="visibility" xsi:type="string">Catalog, Search</field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="url_key" xsi:type="string">test-grouped-product-%isolation%</field> <field name="quantity_and_stock_status" xsi:type="array"> @@ -111,10 +111,10 @@ <item name="0" xsi:type="string">Main Website</item> </field> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">three_simple_products</item> + <item name="dataset" xsi:type="string">grouped_three_simple_products</item> </field> </dataset> </repository> diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Repository/GroupedProduct/Associated.xml b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Repository/GroupedProduct/Associated.xml new file mode 100644 index 0000000000000000000000000000000000000000..8ada3e7a91dd0926c94038f7cd2afd4c43ba8a7d --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Repository/GroupedProduct/Associated.xml @@ -0,0 +1,150 @@ +<?xml version="1.0" ?> +<!-- +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> + <repository class="Magento\GroupedProduct\Test\Repository\GroupedProduct\Associated"> + <dataset name="defaultSimpleProduct"> + <field name="assigned_products" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="id" xsi:type="string">%id%</item> + <item name="name" xsi:type="string">%item1_simple::getProductName%</item> + <item name="position" xsi:type="string">%position%</item> + <item name="qty" xsi:type="string">1</item> + </item> + <item name="1" xsi:type="array"> + <item name="id" xsi:type="string">%id%</item> + <item name="name" xsi:type="string">%item1_simple::getProductName%</item> + <item name="position" xsi:type="string">%position%</item> + <item name="qty" xsi:type="string">2</item> + </item> + </field> + <field name="products" xsi:type="array"> + <item name="0" xsi:type="string">catalogProductSimple::default</item> + <item name="1" xsi:type="string">catalogProductSimple::product_100_dollar</item> + </field> + </dataset> + + <dataset name="defaultSimpleProduct_without_qty"> + <field name="assigned_products" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="id" xsi:type="string">%id%</item> + <item name="name" xsi:type="string">%item1_simple::getProductName%</item> + <item name="position" xsi:type="string">%position%</item> + <item name="qty" xsi:type="string">0</item> + </item> + <item name="1" xsi:type="array"> + <item name="id" xsi:type="string">%id%</item> + <item name="name" xsi:type="string">%item1_simple::getProductName%</item> + <item name="position" xsi:type="string">%position%</item> + <item name="qty" xsi:type="string">0</item> + </item> + </field> + <field name="products" xsi:type="array"> + <item name="0" xsi:type="string">catalogProductSimple::default</item> + <item name="1" xsi:type="string">catalogProductSimple::product_100_dollar</item> + </field> + </dataset> + + <dataset name="defaultSimpleProduct_with_specialPrice"> + <field name="assigned_products" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="id" xsi:type="string">%id%</item> + <item name="name" xsi:type="string">%item1_simple::getProductName%</item> + <item name="position" xsi:type="string">%position%</item> + <item name="qty" xsi:type="string">1</item> + </item> + <item name="1" xsi:type="array"> + <item name="id" xsi:type="string">%id%</item> + <item name="name" xsi:type="string">%item1_simple::getProductName%</item> + <item name="position" xsi:type="string">%position%</item> + <item name="qty" xsi:type="string">2</item> + </item> + </field> + <field name="products" xsi:type="array"> + <item name="0" xsi:type="string">catalogProductSimple::withSpecialPrice</item> + <item name="1" xsi:type="string">catalogProductSimple::withSpecialPrice</item> + </field> + </dataset> + + <dataset name="defaultVirtualProduct"> + <field name="assigned_products" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="id" xsi:type="string">%id%</item> + <item name="name" xsi:type="string">%item1_virtual::getProductName%</item> + <item name="position" xsi:type="string">%position%</item> + <item name="qty" xsi:type="string">1</item> + </item> + <item name="1" xsi:type="array"> + <item name="id" xsi:type="string">%id%</item> + <item name="name" xsi:type="string">%item1_virtual::getProductName%</item> + <item name="position" xsi:type="string">%position%</item> + <item name="qty" xsi:type="string">2</item> + </item> + </field> + <field name="products" xsi:type="array"> + <item name="0" xsi:type="string">catalogProductVirtual::default</item> + <item name="1" xsi:type="string">catalogProductVirtual::product_50_dollar</item> + </field> + </dataset> + + <dataset name="three_simple_products"> + <field name="assigned_products" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="id" xsi:type="string">%id%</item> + <item name="name" xsi:type="string">%item1_simple::getProductName%</item> + <item name="position" xsi:type="string">%position%</item> + <item name="qty" xsi:type="string">3</item> + </item> + <item name="1" xsi:type="array"> + <item name="id" xsi:type="string">%id%</item> + <item name="name" xsi:type="string">%item1_simple::getProductName%</item> + <item name="position" xsi:type="string">%position%</item> + <item name="qty" xsi:type="string">1</item> + </item> + <item name="2" xsi:type="array"> + <item name="id" xsi:type="string">%id%</item> + <item name="name" xsi:type="string">%item1_simple::getProductName%</item> + <item name="position" xsi:type="string">%position%</item> + <item name="qty" xsi:type="string">2</item> + </item> + </field> + <field name="products" xsi:type="array"> + <item name="0" xsi:type="string">catalogProductSimple::default</item> + <item name="1" xsi:type="string">catalogProductSimple::product_40_dollar</item> + <item name="2" xsi:type="string">catalogProductSimple::product_100_dollar</item> + </field> + </dataset> + + <dataset name="simple_downloadable_virtual"> + <field name="assigned_products" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="id" xsi:type="string">%id%</item> + <item name="name" xsi:type="string">%item1_simple::getProductName%</item> + <item name="position" xsi:type="string">%position%</item> + <item name="qty" xsi:type="string">3</item> + </item> + <item name="1" xsi:type="array"> + <item name="id" xsi:type="string">%id%</item> + <item name="name" xsi:type="string">%item2_downloadable::getProductName%</item> + <item name="position" xsi:type="string">%position%</item> + <item name="qty" xsi:type="string">7</item> + </item> + <item name="2" xsi:type="array"> + <item name="id" xsi:type="string">%id%</item> + <item name="name" xsi:type="string">%item3_virtual::getProductName%</item> + <item name="position" xsi:type="string">%position%</item> + <item name="qty" xsi:type="string">11</item> + </item> + </field> + <field name="products" xsi:type="array"> + <item name="0" xsi:type="string">catalogProductSimple::default</item> + <item name="1" xsi:type="string">catalogProductSimple::product_40_dollar</item> + <item name="2" xsi:type="string">catalogProductSimple::product_100_dollar</item> + </field> + </dataset> + </repository> +</config> diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Repository/GroupedProduct/CheckoutData.xml b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Repository/GroupedProduct/CheckoutData.xml new file mode 100644 index 0000000000000000000000000000000000000000..f7347bf02add102909579c23cfe6547bb6c26dc3 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Repository/GroupedProduct/CheckoutData.xml @@ -0,0 +1,44 @@ +<?xml version="1.0" ?> +<!-- +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> + <repository class="Magento\GroupedProduct\Test\Repository\GroupedProduct\CheckoutData"> + <dataset name="grouped_three_simple_products"> + <field name="options" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="name" xsi:type="string">product_key_0</item> + <item name="qty" xsi:type="string">3</item> + </item> + <item name="1" xsi:type="array"> + <item name="name" xsi:type="string">product_key_1</item> + <item name="qty" xsi:type="string">1</item> + </item> + <item name="2" xsi:type="array"> + <item name="name" xsi:type="string">product_key_2</item> + <item name="qty" xsi:type="string">2</item> + </item> + </field> + <field name="cartItem" xsi:type="array"> + <item name="price" xsi:type="array"> + <item name="product_key_0" xsi:type="string">560</item> + <item name="product_key_1" xsi:type="string">40</item> + <item name="product_key_2" xsi:type="string">100</item> + </item> + <item name="qty" xsi:type="array"> + <item name="product_key_0" xsi:type="string">3</item> + <item name="product_key_1" xsi:type="string">1</item> + <item name="product_key_2" xsi:type="string">2</item> + </item> + <item name="subtotal" xsi:type="array"> + <item name="product_key_0" xsi:type="string">1680</item> + <item name="product_key_1" xsi:type="string">40</item> + <item name="product_key_2" xsi:type="string">200</item> + </item> + </field> + </dataset> + </repository> +</config> diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Repository/GroupedProduct/Price.xml b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Repository/GroupedProduct/Price.xml new file mode 100644 index 0000000000000000000000000000000000000000..d08f7b4cd25c3ee559c54db2cf7fe24a7515356f --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Repository/GroupedProduct/Price.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" ?> +<!-- +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> + <repository class="Magento\GroupedProduct\Test\Repository\GroupedProduct\Price"> + <dataset name="starting-100"> + <field name="compare_price" xsi:type="array"> + <item name="price_starting" xsi:type="string">100.00</item> + </field> + </dataset> + + <dataset name="starting-560"> + <field name="compare_price" xsi:type="array"> + <item name="price_starting" xsi:type="string">560.00</item> + </field> + </dataset> + </repository> +</config> diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/CreateGroupedProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/CreateGroupedProductEntityTest.xml index 021db6ee77f166f4af9fdef8b13572f0c79c7c4a..e8c077133c5662d1163ade5776403600c58f943c 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/CreateGroupedProductEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/CreateGroupedProductEntityTest.xml @@ -6,147 +6,127 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\GroupedProduct\Test\TestCase\CreateGroupedProductEntityTest"> - <variation name="CreateGroupedProductEntityTestVariation1" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <data name="description" xsi:type="string">MAGETWO-13610: Create Grouped Product and Assign It to the Category</data> - <data name="product/data/url_key" xsi:type="string">test-grouped-product-%isolation%</data> - <data name="product/data/name" xsi:type="string">GroupedProduct %isolation%</data> - <data name="product/data/sku" xsi:type="string">GroupedProduct_sku%isolation%</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">-</data> - <data name="product/data/category" xsi:type="string">category_%isolation%</data> - <data name="product/data/description" xsi:type="string">-</data> - <data name="product/data/associated/products" xsi:type="string">catalogProductSimple::simple_big_qty,downloadableProduct::one_dollar_product_with_no_separated_link,catalogProductVirtual::required_fields_with_category</data> - <data name="product/data/associated/preset" xsi:type="string">simple_downloadable_virtual</data> - <data name="product/data/short_description" xsi:type="string">-</data> - <data name="isRequired" xsi:type="string">-</data> - <data name="tag" xsi:type="string">test_type:acceptance_test, stable:no</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" next="Magento\Catalog\Test\Constraint\AssertProductVisibleInCategory"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductVisibleInCategory" next="Magento\Catalog\Test\Constraint\AssertProductPage" prev="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" prev="Magento\Catalog\Test\Constraint\AssertProductVisibleInCategory"/> - </variation> - <variation name="CreateGroupedProductEntityTestVariation2" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <data name="description" xsi:type="string">Create with required products and description</data> - <data name="product/data/url_key" xsi:type="string">test-grouped-product-%isolation%</data> - <data name="product/data/name" xsi:type="string">GroupedProduct %isolation%</data> - <data name="product/data/sku" xsi:type="string">GroupedProduct_sku%isolation%</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> - <data name="product/data/category" xsi:type="string">category_%isolation%</data> - <data name="product/data/description" xsi:type="string">This is description for grouped product</data> - <data name="product/data/associated/products" xsi:type="string">catalogProductSimple::simple_for_composite_products,catalogProductSimple::simple_for_composite_products</data> - <data name="product/data/associated/preset" xsi:type="string">defaultSimpleProduct</data> - <data name="product/data/short_description" xsi:type="string">This is short description for grouped product</data> - <data name="isRequired" xsi:type="string">Yes</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\GroupedProduct\Test\Constraint\AssertGroupedProductsDefaultQty"/> - </variation> - <variation name="CreateGroupedProductEntityTestVariation3" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductInStock" method="test"> - <data name="description" xsi:type="string">Create product without category</data> - <data name="product/data/url_key" xsi:type="string">test-grouped-product-%isolation%</data> - <data name="product/data/name" xsi:type="string">GroupedProduct %isolation%</data> - <data name="product/data/sku" xsi:type="string">-</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> - <data name="product/data/category" xsi:type="string">-</data> - <data name="product/data/description" xsi:type="string">-</data> - <data name="product/data/associated/products" xsi:type="string">catalogProductSimple::simple_for_composite_products,catalogProductSimple::simple_for_composite_products</data> - <data name="product/data/associated/preset" xsi:type="string">defaultSimpleProduct</data> - <data name="product/data/short_description" xsi:type="string">-</data> - <data name="isRequired" xsi:type="string">No</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductInStock"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSkuAutoGenerated"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSearchableBySku"/> - </variation> - <variation name="CreateGroupedProductEntityTestVariation4" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductOutOfStock" method="test"> - <data name="description" xsi:type="string">Create product out of stock</data> - <data name="product/data/url_key" xsi:type="string">test-grouped-product-%isolation%</data> - <data name="product/data/name" xsi:type="string">GroupedProduct %isolation%</data> - <data name="product/data/sku" xsi:type="string">GroupedProduct_sku%isolation%</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">Out of Stock</data> - <data name="product/data/category" xsi:type="string">category_%isolation%</data> - <data name="product/data/description" xsi:type="string">-</data> - <data name="product/data/associated/products" xsi:type="string">catalogProductSimple::simple_for_composite_products,catalogProductSimple::simple_for_composite_products</data> - <data name="product/data/associated/preset" xsi:type="string">defaultSimpleProduct</data> - <data name="product/data/short_description" xsi:type="string">-</data> - <data name="isRequired" xsi:type="string">No</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductOutOfStock"/> - </variation> - <variation name="CreateGroupedProductEntityTestVariation5" firstConstraint="Magento\GroupedProduct\Test\Constraint\AssertGroupedProductsDefaultQty" method="test"> - <data name="description" xsi:type="string">Create with no required products</data> - <data name="product/data/url_key" xsi:type="string">test-grouped-product-%isolation%</data> - <data name="product/data/name" xsi:type="string">GroupedProduct %isolation%</data> - <data name="product/data/sku" xsi:type="string">GroupedProduct_sku%isolation%</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> - <data name="product/data/category" xsi:type="string">category_%isolation%</data> - <data name="product/data/description" xsi:type="string">-</data> - <data name="product/data/associated/products" xsi:type="string">catalogProductSimple::simple_for_composite_products,catalogProductSimple::simple_for_composite_products</data> - <data name="product/data/associated/preset" xsi:type="string">defaultSimpleProduct</data> - <data name="product/data/short_description" xsi:type="string">-</data> - <data name="isRequired" xsi:type="string">No</data> - <constraint name="Magento\GroupedProduct\Test\Constraint\AssertGroupedProductsDefaultQty"/> - <constraint name="Magento\GroupedProduct\Test\Constraint\AssertGroupedProductForm"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage"/> - </variation> - <variation name="CreateGroupedProductEntityTestVariation6" firstConstraint="Magento\GroupedProduct\Test\Constraint\AssertSpecialPriceOnGroupedProductPage" method="test"> - <data name="description" xsi:type="string">Create with special price products</data> - <data name="product/data/url_key" xsi:type="string">test-grouped-product-%isolation%</data> - <data name="product/data/name" xsi:type="string">GroupedProduct %isolation%</data> - <data name="product/data/sku" xsi:type="string">GroupedProduct_sku%isolation%</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> - <data name="product/data/category" xsi:type="string">category_%isolation%</data> - <data name="product/data/description" xsi:type="string">-</data> - <data name="product/data/associated/products" xsi:type="string">catalogProductSimple::withSpecialPrice,catalogProductSimple::withSpecialPrice</data> - <data name="product/data/associated/preset" xsi:type="string">defaultSimpleProduct</data> - <data name="product/data/short_description" xsi:type="string">-</data> - <data name="isRequired" xsi:type="string">No</data> - <constraint name="Magento\GroupedProduct\Test\Constraint\AssertSpecialPriceOnGroupedProductPage"/> - <constraint name="Magento\GroupedProduct\Test\Constraint\AssertGroupedProductForm"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage"/> - </variation> - <variation name="CreateGroupedProductEntityTestVariation7" firstConstraint="Magento\GroupedProduct\Test\Constraint\AssertGroupedPriceOnGroupedProductPage" method="test"> - <data name="description" xsi:type="string">Create with group price products</data> - <data name="product/data/url_key" xsi:type="string">test-grouped-product-%isolation%</data> - <data name="product/data/name" xsi:type="string">GroupedProduct %isolation%</data> - <data name="product/data/sku" xsi:type="string">GroupedProduct_sku%isolation%</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> - <data name="product/data/category" xsi:type="string">category_%isolation%</data> - <data name="product/data/description" xsi:type="string">-</data> - <data name="product/data/associated/products" xsi:type="string">catalogProductSimple::simple_with_group_price,catalogProductSimple::simple_with_group_price</data> - <data name="product/data/associated/preset" xsi:type="string">defaultSimpleProduct</data> - <data name="product/data/short_description" xsi:type="string">-</data> - <data name="isRequired" xsi:type="string">No</data> - <constraint name="Magento\GroupedProduct\Test\Constraint\AssertGroupedPriceOnGroupedProductPage"/> - <constraint name="Magento\GroupedProduct\Test\Constraint\AssertGroupedProductForm"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage"/> - </variation> - <variation name="CreateGroupedProductEntityTestVariation8" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> - <data name="description" xsi:type="string">Create with virtual products</data> - <data name="product/data/url_key" xsi:type="string">test-grouped-product-%isolation%</data> - <data name="product/data/name" xsi:type="string">GroupedProduct %isolation%</data> - <data name="product/data/sku" xsi:type="string">GroupedProduct_sku%isolation%</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> - <data name="product/data/category" xsi:type="string">category_%isolation%</data> - <data name="product/data/description" xsi:type="string">-</data> - <data name="product/data/associated/products" xsi:type="string">catalogProductVirtual::virtual_product,catalogProductVirtual::virtual_product</data> - <data name="product/data/associated/preset" xsi:type="string">defaultVirtualProduct</data> - <data name="product/data/short_description" xsi:type="string">-</data> - <data name="isRequired" xsi:type="string">Yes</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage"/> - <constraint name="Magento\GroupedProduct\Test\Constraint\AssertGroupedProductsDefaultQty"/> - </variation> - <variation name="CreateGroupedProductEntityTestVariation9" firstConstraint="Magento\GroupedProduct\Test\Constraint\AssertTierPriceOnGroupedProductPage" method="test"> - <data name="description" xsi:type="string">Create with tier price products</data> - <data name="product/data/url_key" xsi:type="string">test-grouped-product-%isolation%</data> - <data name="product/data/name" xsi:type="string">GroupedProduct %isolation%</data> - <data name="product/data/sku" xsi:type="string">GroupedProduct_sku%isolation%</data> - <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> - <data name="product/data/category" xsi:type="string">category_%isolation%</data> - <data name="product/data/description" xsi:type="string">-</data> - <data name="product/data/associated/products" xsi:type="string">catalogProductSimple::simple_with_tier_price,catalogProductSimple::simple_with_tier_price</data> - <data name="product/data/associated/preset" xsi:type="string">defaultSimpleProduct</data> - <data name="product/data/short_description" xsi:type="string">-</data> - <data name="isRequired" xsi:type="string">No</data> - <constraint name="Magento\GroupedProduct\Test\Constraint\AssertTierPriceOnGroupedProductPage"/> - <constraint name="Magento\GroupedProduct\Test\Constraint\AssertGroupedProductForm"/> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage"/> - </variation> - </testCase> + <testCase name="Magento\GroupedProduct\Test\TestCase\CreateGroupedProductEntityTest"> + <variation name="CreateGroupedProductEntityTestVariation1" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> + <data name="description" xsi:type="string">MAGETWO-13610: Create Grouped Product and Assign It to the Category</data> + <data name="product/data/url_key" xsi:type="string">test-grouped-product-%isolation%</data> + <data name="product/data/name" xsi:type="string">GroupedProduct %isolation%</data> + <data name="product/data/sku" xsi:type="string">GroupedProduct_sku%isolation%</data> + <data name="product/data/category" xsi:type="string">category_%isolation%</data> + <data name="product/data/associated/products" xsi:type="string">catalogProductSimple::simple_big_qty,downloadableProduct::one_dollar_product_with_no_separated_link,catalogProductVirtual::required_fields_with_category</data> + <data name="product/data/associated/dataset" xsi:type="string">simple_downloadable_virtual</data> + <data name="tag" xsi:type="string">test_type:acceptance_test, stable:no</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" next="Magento\Catalog\Test\Constraint\AssertProductVisibleInCategory" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductVisibleInCategory" next="Magento\Catalog\Test\Constraint\AssertProductPage" prev="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" prev="Magento\Catalog\Test\Constraint\AssertProductVisibleInCategory" /> + </variation> + <variation name="CreateGroupedProductEntityTestVariation2" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> + <data name="description" xsi:type="string">Create with required products and description</data> + <data name="product/data/url_key" xsi:type="string">test-grouped-product-%isolation%</data> + <data name="product/data/name" xsi:type="string">GroupedProduct %isolation%</data> + <data name="product/data/sku" xsi:type="string">GroupedProduct_sku%isolation%</data> + <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> + <data name="product/data/category" xsi:type="string">category_%isolation%</data> + <data name="product/data/description" xsi:type="string">This is description for grouped product</data> + <data name="product/data/associated/products" xsi:type="string">catalogProductSimple::simple_for_composite_products,catalogProductSimple::simple_for_composite_products</data> + <data name="product/data/associated/dataset" xsi:type="string">defaultSimpleProduct</data> + <data name="product/data/short_description" xsi:type="string">This is short description for grouped product</data> + <data name="isRequired" xsi:type="string">Yes</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> + <constraint name="Magento\GroupedProduct\Test\Constraint\AssertGroupedProductsDefaultQty" /> + </variation> + <variation name="CreateGroupedProductEntityTestVariation3" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductInStock" method="test"> + <data name="description" xsi:type="string">Create product without category</data> + <data name="product/data/url_key" xsi:type="string">test-grouped-product-%isolation%</data> + <data name="product/data/name" xsi:type="string">GroupedProduct %isolation%</data> + <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> + <data name="product/data/associated/products" xsi:type="string">catalogProductSimple::simple_for_composite_products,catalogProductSimple::simple_for_composite_products</data> + <data name="product/data/associated/dataset" xsi:type="string">defaultSimpleProduct</data> + <data name="isRequired" xsi:type="string">No</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductInStock" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSkuAutoGenerated" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSearchableBySku" /> + </variation> + <variation name="CreateGroupedProductEntityTestVariation4" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductOutOfStock" method="test"> + <data name="description" xsi:type="string">Create product out of stock</data> + <data name="product/data/url_key" xsi:type="string">test-grouped-product-%isolation%</data> + <data name="product/data/name" xsi:type="string">GroupedProduct %isolation%</data> + <data name="product/data/sku" xsi:type="string">GroupedProduct_sku%isolation%</data> + <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">Out of Stock</data> + <data name="product/data/category" xsi:type="string">category_%isolation%</data> + <data name="product/data/associated/products" xsi:type="string">catalogProductSimple::simple_for_composite_products,catalogProductSimple::simple_for_composite_products</data> + <data name="product/data/associated/dataset" xsi:type="string">defaultSimpleProduct</data> + <data name="isRequired" xsi:type="string">No</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductOutOfStock" /> + </variation> + <variation name="CreateGroupedProductEntityTestVariation5" firstConstraint="Magento\GroupedProduct\Test\Constraint\AssertGroupedProductsDefaultQty" method="test"> + <data name="description" xsi:type="string">Create with no required products</data> + <data name="product/data/url_key" xsi:type="string">test-grouped-product-%isolation%</data> + <data name="product/data/name" xsi:type="string">GroupedProduct %isolation%</data> + <data name="product/data/sku" xsi:type="string">GroupedProduct_sku%isolation%</data> + <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> + <data name="product/data/category" xsi:type="string">category_%isolation%</data> + <data name="product/data/associated/products" xsi:type="string">catalogProductSimple::simple_for_composite_products,catalogProductSimple::simple_for_composite_products</data> + <data name="product/data/associated/dataset" xsi:type="string">defaultSimpleProduct</data> + <data name="isRequired" xsi:type="string">No</data> + <constraint name="Magento\GroupedProduct\Test\Constraint\AssertGroupedProductsDefaultQty" /> + <constraint name="Magento\GroupedProduct\Test\Constraint\AssertGroupedProductForm" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> + </variation> + <variation name="CreateGroupedProductEntityTestVariation6" firstConstraint="Magento\GroupedProduct\Test\Constraint\AssertSpecialPriceOnGroupedProductPage" method="test"> + <data name="description" xsi:type="string">Create with special price products</data> + <data name="product/data/url_key" xsi:type="string">test-grouped-product-%isolation%</data> + <data name="product/data/name" xsi:type="string">GroupedProduct %isolation%</data> + <data name="product/data/sku" xsi:type="string">GroupedProduct_sku%isolation%</data> + <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> + <data name="product/data/category" xsi:type="string">category_%isolation%</data> + <data name="product/data/associated/products" xsi:type="string">catalogProductSimple::withSpecialPrice,catalogProductSimple::withSpecialPrice</data> + <data name="product/data/associated/dataset" xsi:type="string">defaultSimpleProduct</data> + <data name="isRequired" xsi:type="string">No</data> + <constraint name="Magento\GroupedProduct\Test\Constraint\AssertSpecialPriceOnGroupedProductPage" /> + <constraint name="Magento\GroupedProduct\Test\Constraint\AssertGroupedProductForm" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> + </variation> + <variation name="CreateGroupedProductEntityTestVariation7" firstConstraint="Magento\GroupedProduct\Test\Constraint\AssertGroupedPriceOnGroupedProductPage" method="test"> + <data name="description" xsi:type="string">Create with group price products</data> + <data name="product/data/url_key" xsi:type="string">test-grouped-product-%isolation%</data> + <data name="product/data/name" xsi:type="string">GroupedProduct %isolation%</data> + <data name="product/data/sku" xsi:type="string">GroupedProduct_sku%isolation%</data> + <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> + <data name="product/data/category" xsi:type="string">category_%isolation%</data> + <data name="product/data/associated/products" xsi:type="string">catalogProductSimple::simple_with_group_price,catalogProductSimple::simple_with_group_price</data> + <data name="product/data/associated/dataset" xsi:type="string">defaultSimpleProduct</data> + <data name="isRequired" xsi:type="string">No</data> + <constraint name="Magento\GroupedProduct\Test\Constraint\AssertGroupedPriceOnGroupedProductPage" /> + <constraint name="Magento\GroupedProduct\Test\Constraint\AssertGroupedProductForm" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> + </variation> + <variation name="CreateGroupedProductEntityTestVariation8" firstConstraint="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" method="test"> + <data name="description" xsi:type="string">Create with virtual products</data> + <data name="product/data/url_key" xsi:type="string">test-grouped-product-%isolation%</data> + <data name="product/data/name" xsi:type="string">GroupedProduct %isolation%</data> + <data name="product/data/sku" xsi:type="string">GroupedProduct_sku%isolation%</data> + <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> + <data name="product/data/category" xsi:type="string">category_%isolation%</data> + <data name="product/data/associated/products" xsi:type="string">catalogProductVirtual::virtual_product,catalogProductVirtual::virtual_product</data> + <data name="product/data/associated/dataset" xsi:type="string">defaultVirtualProduct</data> + <data name="isRequired" xsi:type="string">Yes</data> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> + <constraint name="Magento\GroupedProduct\Test\Constraint\AssertGroupedProductsDefaultQty" /> + </variation> + <variation name="CreateGroupedProductEntityTestVariation9" firstConstraint="Magento\GroupedProduct\Test\Constraint\AssertTierPriceOnGroupedProductPage" method="test"> + <data name="description" xsi:type="string">Create with tier price products</data> + <data name="product/data/url_key" xsi:type="string">test-grouped-product-%isolation%</data> + <data name="product/data/name" xsi:type="string">GroupedProduct %isolation%</data> + <data name="product/data/sku" xsi:type="string">GroupedProduct_sku%isolation%</data> + <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> + <data name="product/data/category" xsi:type="string">category_%isolation%</data> + <data name="product/data/associated/products" xsi:type="string">catalogProductSimple::simple_with_tier_price,catalogProductSimple::simple_with_tier_price</data> + <data name="product/data/associated/dataset" xsi:type="string">defaultSimpleProduct</data> + <data name="isRequired" xsi:type="string">No</data> + <constraint name="Magento\GroupedProduct\Test\Constraint\AssertTierPriceOnGroupedProductPage" /> + <constraint name="Magento\GroupedProduct\Test\Constraint\AssertGroupedProductForm" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/UpdateGroupedProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/UpdateGroupedProductEntityTest.xml index cc918d24c96e699998e7896553dc3d225ebe8250..207cb0711a8292b3a83b5129f4116d4ea724fb67 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/UpdateGroupedProductEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/UpdateGroupedProductEntityTest.xml @@ -8,11 +8,11 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\GroupedProduct\Test\TestCase\UpdateGroupedProductEntityTest"> <variation name="UpdateGroupedProductEntityTestVariation1"> - <data name="originalProduct/dataSet" xsi:type="string">grouped_product_out_of_stock</data> + <data name="originalProduct/dataset" xsi:type="string">grouped_product_out_of_stock</data> <data name="product/data/name" xsi:type="string">GroupedProduct_edited %isolation%</data> <data name="product/data/sku" xsi:type="string">GroupedProduct_sku_edited %isolation%</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">In Stock</data> - <data name="product/data/category_ids/presets" xsi:type="string">category_%isolation%</data> + <data name="product/data/category_ids/dataset" xsi:type="string">category_%isolation%</data> <data name="product/data/description" xsi:type="string">This is edited description for grouped product</data> <data name="product/data/short_description" xsi:type="string">This is edited short description for grouped product</data> <data name="product/data/url_key" xsi:type="string">updated-grouped-product-%isolation%</data> @@ -21,38 +21,38 @@ <constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" /> </variation> <variation name="UpdateGroupedProductEntityTestVariation2"> - <data name="originalProduct/dataSet" xsi:type="string">default</data> + <data name="originalProduct/dataset" xsi:type="string">default</data> <data name="product/data/name" xsi:type="string">GroupedProduct_edited %isolation%</data> <data name="product/data/sku" xsi:type="string">GroupedProduct_sku_edited %isolation%</data> <data name="product/data/associated/products" xsi:type="string">catalogProductVirtual::default,catalogProductVirtual::product_50_dollar</data> - <data name="product/data/associated/preset" xsi:type="string">defaultVirtualProduct</data> + <data name="product/data/associated/dataset" xsi:type="string">defaultVirtualProduct</data> <data name="product/data/url_key" xsi:type="string">updated-grouped-product-%isolation%</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\GroupedProduct\Test\Constraint\AssertGroupedProductForm" /> </variation> <variation name="UpdateGroupedProductEntityTestVariation3"> - <data name="originalProduct/dataSet" xsi:type="string">default</data> + <data name="originalProduct/dataset" xsi:type="string">default</data> <data name="product/data/name" xsi:type="string">GroupedProduct_edited %isolation%</data> <data name="product/data/sku" xsi:type="string">GroupedProduct_sku_edited %isolation%</data> <data name="product/data/associated/products" xsi:type="string">catalogProductSimple::simple_for_composite_products,catalogProductSimple::default</data> - <data name="product/data/associated/preset" xsi:type="string">defaultSimpleProduct_without_qty</data> + <data name="product/data/associated/dataset" xsi:type="string">defaultSimpleProduct_without_qty</data> <data name="product/data/url_key" xsi:type="string">updated-grouped-product-%isolation%</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\GroupedProduct\Test\Constraint\AssertGroupedProductsDefaultQty" /> <constraint name="Magento\GroupedProduct\Test\Constraint\AssertGroupedProductForm" /> </variation> <variation name="UpdateGroupedProductEntityTestVariation4"> - <data name="originalProduct/dataSet" xsi:type="string">default</data> + <data name="originalProduct/dataset" xsi:type="string">default</data> <data name="product/data/name" xsi:type="string">GroupedProduct_edited %isolation%</data> <data name="product/data/sku" xsi:type="string">GroupedProduct_sku_edited %isolation%</data> <data name="product/data/associated/products" xsi:type="string">catalogProductSimple::withSpecialPrice,catalogProductSimple::withSpecialPrice</data> - <data name="product/data/associated/preset" xsi:type="string">defaultSimpleProduct_with_specialPrice</data> + <data name="product/data/associated/dataset" xsi:type="string">defaultSimpleProduct_with_specialPrice</data> <data name="product/data/url_key" xsi:type="string">updated-grouped-product-%isolation%</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\GroupedProduct\Test\Constraint\AssertSpecialPriceOnGroupedProductPage" /> </variation> <variation name="UpdateGroupedProductEntityTestVariation5"> - <data name="originalProduct/dataSet" xsi:type="string">default</data> + <data name="originalProduct/dataset" xsi:type="string">default</data> <data name="product/data/name" xsi:type="string">GroupedProduct_edited %isolation%</data> <data name="product/data/sku" xsi:type="string">GroupedProduct_sku_edited %isolation%</data> <data name="product/data/quantity_and_stock_status/is_in_stock" xsi:type="string">Out of Stock</data> diff --git a/dev/tests/functional/tests/app/Magento/ImportExport/Test/Fixture/ImportExport.xml b/dev/tests/functional/tests/app/Magento/ImportExport/Test/Fixture/ImportExport.xml index ac1253f96a0c0d1486389a3bf354b1842e4df1ac..3386350d698c1c5bbd033e75f74ed125a49ba056 100644 --- a/dev/tests/functional/tests/app/Magento/ImportExport/Test/Fixture/ImportExport.xml +++ b/dev/tests/functional/tests/app/Magento/ImportExport/Test/Fixture/ImportExport.xml @@ -6,22 +6,15 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="importExport" module="Magento_ImportExport" type="flat" entity_type="importexport_importdata" class="Magento\ImportExport\Test\Fixture\ImportExport"> - <dataset name="default"> - <field name="entity" xsi:type="string">Products</field> - <field name="behavior" xsi:type="string">CSV</field> - </dataset> - <field name="id" is_required="1"> - <default_value xsi:type="null" /> - </field> - <field name="entity" is_required=""> - <default_value xsi:type="string">Products</default_value> - </field> - <field name="file_format" is_required=""> - <default_value xsi:type="string">CSV</default_value> - </field> - <field name="data_export" is_required=""> - <default_value xsi:type="null" /> - </field> + <fixture name="importExport" + module="Magento_ImportExport" + type="flat" + entity_type="importexport_importdata" + repository_class="Magento\ImportExport\Test\Repository\ImportExport" + class="Magento\ImportExport\Test\Fixture\ImportExport"> + <field name="id" is_required="1" /> + <field name="entity" is_required="" /> + <field name="file_format" is_required="" /> + <field name="data_export" is_required="" /> </fixture> </config> diff --git a/dev/tests/functional/tests/app/Magento/ImportExport/Test/Repository/ImportExport.xml b/dev/tests/functional/tests/app/Magento/ImportExport/Test/Repository/ImportExport.xml new file mode 100644 index 0000000000000000000000000000000000000000..483a9341489fee25671d0c1cfcd7a8eb49fda9a3 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/ImportExport/Test/Repository/ImportExport.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" ?> +<!-- +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> + <repository class="Magento\ImportExport\Test\Repository\ImportExport"> + <dataset name="default"> + <field name="entity" xsi:type="string">Products</field> + <field name="behavior" xsi:type="string">CSV</field> + </dataset> + </repository> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Fixture/Install.xml b/dev/tests/functional/tests/app/Magento/Install/Test/Fixture/Install.xml index 2d83153459204f88755791b178917c92d4c01c79..10a8fdae3d894447dcaac4c1fbea78e0b472d4bf 100644 --- a/dev/tests/functional/tests/app/Magento/Install/Test/Fixture/Install.xml +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Fixture/Install.xml @@ -6,7 +6,13 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="install" module="Magento_Install" type="virtual" entity_type="install" repository_class="Magento\Install\Test\Repository\Install" handler_interface="Magento\Install\Test\Handler\Install\InstallInterface" class="Magento\Install\Test\Fixture\Install"> + <fixture name="install" + module="Magento_Install" + type="virtual" + entity_type="install" + repository_class="Magento\Install\Test\Repository\Install" + handler_interface="Magento\Install\Test\Handler\Install\InstallInterface" + class="Magento\Install\Test\Fixture\Install"> <field name="dbHost" /> <field name="dbUser" /> <field name="dbPassword" /> diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/TestCase/InstallTest.xml b/dev/tests/functional/tests/app/Magento/Install/Test/TestCase/InstallTest.xml index ff6ba2d1f1d7c44aa00109c83150752118a34b5b..5eb2c388a74a04ba2c51a7a3df82bbcfe42ee5f7 100644 --- a/dev/tests/functional/tests/app/Magento/Install/Test/TestCase/InstallTest.xml +++ b/dev/tests/functional/tests/app/Magento/Install/Test/TestCase/InstallTest.xml @@ -9,20 +9,20 @@ <testCase name="Magento\Install\Test\TestCase\InstallTest"> <variation name="InstallTestVariation1"> <data name="description" xsi:type="string">Install with default values.</data> - <data name="user/dataSet" xsi:type="string">default</data> + <data name="user/dataset" xsi:type="string">default</data> <constraint name="Magento\Install\Test\Constraint\AssertSuccessInstall" /> <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin" /> </variation> <variation name="InstallTestVariation2"> <data name="description" xsi:type="string">Install with custom admin path.</data> - <data name="user/dataSet" xsi:type="string">default</data> + <data name="user/dataset" xsi:type="string">default</data> <data name="install/admin" xsi:type="string">custom</data> <constraint name="Magento\Install\Test\Constraint\AssertSuccessInstall" /> <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin" /> </variation> <variation name="InstallTestVariation3"> <data name="description" xsi:type="string">Install with custom encryption key and changed currency and locale.</data> - <data name="user/dataSet" xsi:type="string">default</data> + <data name="user/dataset" xsi:type="string">default</data> <data name="install/keyOwn" xsi:type="string">Yes</data> <data name="install/keyValue" xsi:type="string">123123qa</data> <data name="install/storeLanguage" xsi:type="string">German (Germany)</data> @@ -37,7 +37,7 @@ </variation> <variation name="InstallTestVariation4"> <data name="description" xsi:type="string">Install with table prefix.</data> - <data name="user/dataSet" xsi:type="string">default</data> + <data name="user/dataset" xsi:type="string">default</data> <data name="install/dbTablePrefix" xsi:type="string">prefix1_</data> <data name="install/storeLanguage" xsi:type="string">Chinese (China)</data> <constraint name="Magento\Install\Test\Constraint\AssertSuccessInstall" /> @@ -45,7 +45,7 @@ </variation> <variation name="InstallTestVariation5"> <data name="description" xsi:type="string">Install with enabled url rewrites.</data> - <data name="user/dataSet" xsi:type="string">default</data> + <data name="user/dataset" xsi:type="string">default</data> <data name="install/apacheRewrites" xsi:type="string">Yes</data> <constraint name="Magento\Install\Test\Constraint\AssertSuccessInstall" /> <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin" /> @@ -53,7 +53,7 @@ </variation> <variation name="InstallTestVariation6"> <data name="description" xsi:type="string">Install with enabled secure urls.</data> - <data name="user/dataSet" xsi:type="string">default</data> + <data name="user/dataset" xsi:type="string">default</data> <data name="install/httpsFront" xsi:type="string">Yes</data> <data name="install/httpsAdmin" xsi:type="string">Yes</data> <constraint name="Magento\Install\Test\Constraint\AssertSuccessInstall" /> diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/Fixture/Integration.xml b/dev/tests/functional/tests/app/Magento/Integration/Test/Fixture/Integration.xml index 30c8310ea5534bdabf634e3e4e005c1ac71a87ca..f2ed1bfc1e24d94ed32d612709b0a5bd21498d1a 100644 --- a/dev/tests/functional/tests/app/Magento/Integration/Test/Fixture/Integration.xml +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/Fixture/Integration.xml @@ -6,86 +6,40 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="integration" module="Magento_Integration" type="composite" entity_type="integration" collection="Magento\Integration\Model\Resource\Integration\Collection" repository_class="Magento\Integration\Test\Repository\Integration" handler_interface="Magento\Integration\Test\Handler\Integration\IntegrationInterface" class="Magento\Integration\Test\Fixture\Integration"> - <dataset name="default"> - <field name="name" xsi:type="string">default_integration_%isolation%</field> - <field name="email" xsi:type="string">test_%isolation%@example.com</field> - <field name="resource_access" xsi:type="string">All</field> - </dataset> - <field name="integration_id" is_required="1"> - <default_value xsi:type="null"/> - </field> - <field name="name" is_required="" group="integration_info"> - <default_value xsi:type="string">default_integration_%isolation%</default_value> - </field> - <field name="email" is_required="" group="integration_info"> - <default_value xsi:type="string">test_%isolation%@example.com</default_value> - </field> - <field name="endpoint" is_required="" group="integration_info"> - <default_value xsi:type="null"/> - </field> - <field name="status" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="consumer_id" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="created_at" is_required=""> - <default_value xsi:type="string">CURRENT_TIMESTAMP</default_value> - </field> - <field name="updated_at" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="setup_type" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="identity_link_url" is_required="" group="integration_info"> - <default_value xsi:type="null"/> - </field> - <field name="entity_id" is_required="1"> - <default_value xsi:type="null"/> - </field> - <field name="admin_id" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="customer_id" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="type" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="token" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="secret" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="verifier" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="callback_url" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="revoked" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="authorized" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="user_type" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="key" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="rejected_callback_url" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="resource_access" group="api"> - <default_value xsi:type="string">All</default_value> - </field> - <field name="resources" group="api"/> - <field name="token_secret" group="integration_info"/> - <field name="consumer_secret" group="integration_info"/> - </fixture> + <fixture name="integration" + module="Magento_Integration" + type="composite" + entity_type="integration" + collection="Magento\Integration\Model\Resource\Integration\Collection" + repository_class="Magento\Integration\Test\Repository\Integration" + handler_interface="Magento\Integration\Test\Handler\Integration\IntegrationInterface" + class="Magento\Integration\Test\Fixture\Integration"> + <field name="integration_id" is_required="1" /> + <field name="name" is_required="" group="integration_info" /> + <field name="email" is_required="" group="integration_info" /> + <field name="endpoint" is_required="" group="integration_info" /> + <field name="status" is_required="" /> + <field name="consumer_id" is_required="" /> + <field name="created_at" is_required="" /> + <field name="updated_at" is_required="" /> + <field name="setup_type" is_required="" /> + <field name="identity_link_url" is_required="" group="integration_info" /> + <field name="entity_id" is_required="1" /> + <field name="admin_id" is_required="" /> + <field name="customer_id" is_required="" /> + <field name="type" is_required="" /> + <field name="token" is_required="" /> + <field name="secret" is_required="" /> + <field name="verifier" is_required="" /> + <field name="callback_url" is_required="" /> + <field name="revoked" is_required="" /> + <field name="authorized" is_required="" /> + <field name="user_type" is_required="" /> + <field name="key" is_required="" /> + <field name="rejected_callback_url" is_required="" /> + <field name="resource_access" group="api" /> + <field name="resources" group="api" /> + <field name="token_secret" group="integration_info" /> + <field name="consumer_secret" group="integration_info" /> + </fixture> </config> diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/Repository/Integration.xml b/dev/tests/functional/tests/app/Magento/Integration/Test/Repository/Integration.xml index 4fe24f70c1da67b096c307341201eb494b0dfc79..c4a76d5b60ffd41a6782fa34757fbbb4d2e91869 100644 --- a/dev/tests/functional/tests/app/Magento/Integration/Test/Repository/Integration.xml +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/Repository/Integration.xml @@ -7,6 +7,12 @@ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> <repository class="Magento\Integration\Test\Repository\Integration"> + <dataset name="default"> + <field name="name" xsi:type="string">default_integration_%isolation%</field> + <field name="email" xsi:type="string">test_%isolation%@example.com</field> + <field name="resource_access" xsi:type="string">All</field> + </dataset> + <dataset name="default_with_all_resources"> <field name="name" xsi:type="string">default_integration_%isolation%</field> <field name="email" xsi:type="string">test_%isolation%@example.com</field> diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/ActivateIntegrationEntityTest.xml b/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/ActivateIntegrationEntityTest.xml index b77b66906a0c89cae9dd9e43e2e2c8ac94d626d8..b369ae1c3b3c2fa40eacf6918dcbb020a4164c50 100644 --- a/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/ActivateIntegrationEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/ActivateIntegrationEntityTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Integration\Test\TestCase\ActivateIntegrationEntityTest"> <variation name="ActivateIntegrationEntityTestVariation1"> - <data name="integration/dataSet" xsi:type="string">default_with_all_resources</data> + <data name="integration/dataset" xsi:type="string">default_with_all_resources</data> <data name="resourceDepth" xsi:type="number">1</data> <constraint name="Magento\Integration\Test\Constraint\AssertIntegrationResourcesPopup"/> <constraint name="Magento\Integration\Test\Constraint\AssertIntegrationTokensPopup"/> diff --git a/dev/tests/functional/tests/app/Magento/LayeredNavigation/Test/TestCase/FilterProductListTest.xml b/dev/tests/functional/tests/app/Magento/LayeredNavigation/Test/TestCase/FilterProductListTest.xml index 4cfbc8d6397ff7d52133d0a2c70d129c06825b01..8c65b126821d45a703a3de6b1cffab5cae034388 100644 --- a/dev/tests/functional/tests/app/Magento/LayeredNavigation/Test/TestCase/FilterProductListTest.xml +++ b/dev/tests/functional/tests/app/Magento/LayeredNavigation/Test/TestCase/FilterProductListTest.xml @@ -9,8 +9,8 @@ <testCase name="Magento\LayeredNavigation\Test\TestCase\FilterProductListTest"> <variation name="FilterProductListTestVariation1"> <data name="configData" xsi:type="string">layered_navigation_manual_range_10</data> - <data name="category/dataSet" xsi:type="string">default_anchor_subcategory</data> - <data name="category/data/category_products/dataSet" xsi:type="string">catalogProductSimple::product_20_dollar, configurableProduct::filterable_two_options_with_zero_price</data> + <data name="category/dataset" xsi:type="string">default_anchor_subcategory</data> + <data name="category/data/category_products/dataset" xsi:type="string">catalogProductSimple::product_20_dollar, configurableProduct::filterable_two_options_with_zero_price</data> <data name="layeredNavigation" xsi:type="array"> <item name="filters_0" xsi:type="array"> <item name="0" xsi:type="array"> diff --git a/dev/tests/functional/tests/app/Magento/Msrp/Test/Repository/CatalogProductSimple.xml b/dev/tests/functional/tests/app/Magento/Msrp/Test/Repository/CatalogProductSimple.xml index b0a4b9350abbdbfcc880ae3a520eabf21e68a7b3..4553883e0c2a7e43576530662313c408b242761b 100644 --- a/dev/tests/functional/tests/app/Magento/Msrp/Test/Repository/CatalogProductSimple.xml +++ b/dev/tests/functional/tests/app/Magento/Msrp/Test/Repository/CatalogProductSimple.xml @@ -9,7 +9,7 @@ <repository class="Magento\Catalog\Test\Repository\CatalogProductSimple"> <dataset name="msrp_before_order_confirmation"> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="name" xsi:type="string">Simple Product with msrp %isolation%</field> <field name="sku" xsi:type="string">sku_simple_product_with_msrp_%isolation%</field> @@ -20,17 +20,17 @@ </field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">560</item> - <item name="preset" xsi:type="string">-</item> + <item name="dataset" xsi:type="string">-</item> </field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="website_ids" xsi:type="array"> <item name="0" xsi:type="string">Main Website</item> </field> <field name="visibility" xsi:type="string">Catalog, Search</field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">order_default</item> + <item name="dataset" xsi:type="string">simple_order_default</item> </field> <field name="msrp" xsi:type="string">600</field> <field name="msrp_display_actual_price_type" xsi:type="string">Before Order Confirmation</field> @@ -47,13 +47,13 @@ </field> <field name="price" xsi:type="array"> <item name="value" xsi:type="string">10</item> - <item name="preset" xsi:type="string">-</item> + <item name="dataset" xsi:type="string">-</item> </field> <field name="category_ids" xsi:type="array"> - <item name="presets" xsi:type="string">default_subcategory</item> + <item name="dataset" xsi:type="string">default_subcategory</item> </field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="website_ids" xsi:type="array"> <item name="0" xsi:type="string">Main Website</item> diff --git a/dev/tests/functional/tests/app/Magento/Msrp/Test/Repository/ConfigurableProduct.xml b/dev/tests/functional/tests/app/Magento/Msrp/Test/Repository/ConfigurableProduct.xml index ba737437dc71b592c29726604e7b22b304b6df44..32e6d1cf28fce54af38f12c1052c822f1f3ff382 100644 --- a/dev/tests/functional/tests/app/Magento/Msrp/Test/Repository/ConfigurableProduct.xml +++ b/dev/tests/functional/tests/app/Magento/Msrp/Test/Repository/ConfigurableProduct.xml @@ -15,27 +15,27 @@ </field> <field name="weight" xsi:type="string">30</field> <field name="tax_class_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">taxable_goods</item> + <item name="dataset" xsi:type="string">taxable_goods</item> </field> <field name="url_key" xsi:type="string">test-configurable-product-%isolation%</field> <field name="category_ids" xsi:type="array"> - <item name="presets" xsi:type="string">default_subcategory</item> + <item name="dataset" xsi:type="string">default_subcategory</item> </field> <field name="quantity_and_stock_status" xsi:type="array"> <item name="qty" xsi:type="string">1</item> <item name="is_in_stock" xsi:type="string">In Stock</item> </field> <field name="configurable_attributes_data" xsi:type="array"> - <item name="preset" xsi:type="string">one_variation_one_dollar</item> + <item name="dataset" xsi:type="string">one_variation_one_dollar</item> </field> <field name="website_ids" xsi:type="array"> <item name="0" xsi:type="string">Main Website</item> </field> <field name="attribute_set_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">custom_attribute_set</item> + <item name="dataset" xsi:type="string">custom_attribute_set</item> </field> <field name="checkout_data" xsi:type="array"> - <item name="preset" xsi:type="string">with_one_option</item> + <item name="dataset" xsi:type="string">configurable_one_option</item> </field> <field name="msrp" xsi:type="string">15</field> <field name="msrp_display_actual_price_type" xsi:type="string">On Gesture</field> diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Fixture/Template.xml b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Fixture/Template.xml index 6311e64c6602a507e3da61125c06670429df3af5..38155dfa637f67fe7fc8262f1713b830236e67f1 100644 --- a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Fixture/Template.xml +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Fixture/Template.xml @@ -6,49 +6,26 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="template" module="Magento_Newsletter" type="flat" entity_type="newsletter_template" collection="Magento\Newsletter\Model\Resource\Template\Collection" identifier="template_id" repository_class="Magento\Newsletter\Test\Repository\Template" handler_interface="Magento\Newsletter\Test\Handler\Template\TemplateInterface" class="Magento\Newsletter\Test\Fixture\Template"> - <dataset name="default"> - <field name="code" xsi:type="string">TemplateName%isolation%</field> - <field name="subject" xsi:type="string">TemplateSubject%isolation%</field> - <field name="sender_name" xsi:type="string">SenderName%isolation%</field> - <field name="sender_email" xsi:type="string">SenderName%isolation%@example.com</field> - <field name="text" xsi:type="string">Some text %isolation%</field> - </dataset> - <field name="id" is_required="1"> - <default_value xsi:type="null"/> - </field> - <field name="code" is_required=""> - <default_value xsi:type="string">TemplateName%isolation%</default_value> - </field> - <field name="text" is_required=""> - <default_value xsi:type="string">Some text %isolation%</default_value> - </field> - <field name="text_preprocessed" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="styles" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="type" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="subject" is_required=""> - <default_value xsi:type="string">TemplateSubject%isolation%</default_value> - </field> - <field name="sender_name" is_required=""> - <default_value xsi:type="string">SenderName%isolation%</default_value> - </field> - <field name="sender_email" is_required=""> - <default_value xsi:type="string">SenderName%isolation%@example.com</default_value> - </field> - <field name="actual" is_required=""> - <default_value xsi:type="string">1</default_value> - </field> - <field name="added_at" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="modified_at" is_required=""> - <default_value xsi:type="null"/> - </field> - </fixture> + <fixture name="template" + module="Magento_Newsletter" + type="flat" + entity_type="newsletter_template" + collection="Magento\Newsletter\Model\Resource\Template\Collection" + identifier="template_id" + repository_class="Magento\Newsletter\Test\Repository\Template" + handler_interface="Magento\Newsletter\Test\Handler\Template\TemplateInterface" + class="Magento\Newsletter\Test\Fixture\Template"> + <field name="id" is_required="1" /> + <field name="code" is_required="" /> + <field name="text" is_required="" /> + <field name="text_preprocessed" is_required="" /> + <field name="styles" is_required="" /> + <field name="type" is_required="" /> + <field name="subject" is_required="" /> + <field name="sender_name" is_required="" /> + <field name="sender_email" is_required="" /> + <field name="actual" is_required="" /> + <field name="added_at" is_required="" /> + <field name="modified_at" is_required="" /> + </fixture> </config> diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/TestCase/ActionNewsletterTemplateEntityTest.php b/dev/tests/functional/tests/app/Magento/Newsletter/Test/TestCase/ActionNewsletterTemplateEntityTest.php index 1bffdfc6e1ae3211531fbedb405cb07e87ee9caf..ff1fec3232d34b0a354e8223b9c24cf4cd6b463b 100644 --- a/dev/tests/functional/tests/app/Magento/Newsletter/Test/TestCase/ActionNewsletterTemplateEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/TestCase/ActionNewsletterTemplateEntityTest.php @@ -21,7 +21,7 @@ use Magento\Mtf\TestCase\Injectable; * 1. Open Backend * 2. Go to Marketing > Newsletter Template * 3. Find created template in grid - * 4. Select action in action dropdown for created template according to dataSet + * 4. Select action in action dropdown for created template according to dataset * 5. Perform all assertions * * @group Newsletters_(MX) diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/TestCase/ActionNewsletterTemplateEntityTest.xml b/dev/tests/functional/tests/app/Magento/Newsletter/Test/TestCase/ActionNewsletterTemplateEntityTest.xml index f00372d3f756436678cf1215d79092828a3a11f9..53f8aa6c0869a565ca3582f795d6ba85d9a20f52 100644 --- a/dev/tests/functional/tests/app/Magento/Newsletter/Test/TestCase/ActionNewsletterTemplateEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/TestCase/ActionNewsletterTemplateEntityTest.xml @@ -8,12 +8,12 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Newsletter\Test\TestCase\ActionNewsletterTemplateEntityTest"> <variation name="ActionNewsletterTemplateEntityTestVariation1"> - <data name="newsletter/dataSet" xsi:type="string">default</data> + <data name="newsletter/dataset" xsi:type="string">default</data> <data name="action" xsi:type="string">Preview</data> <constraint name="Magento\Newsletter\Test\Constraint\AssertNewsletterPreview"/> </variation> <variation name="ActionNewsletterTemplateEntityTestVariation2"> - <data name="newsletter/dataSet" xsi:type="string">default</data> + <data name="newsletter/dataset" xsi:type="string">default</data> <data name="action" xsi:type="string">Queue Newsletter</data> <constraint name="Magento\Newsletter\Test\Constraint\AssertNewsletterQueue"/> </variation> diff --git a/dev/tests/functional/tests/app/Magento/Payment/Test/Fixture/CreditCard.xml b/dev/tests/functional/tests/app/Magento/Payment/Test/Fixture/CreditCard.xml index b77e94c4b0245d6ec0cf68f8d5d02c2d2e30b94e..cbc6eadb0c65f33bbd5a1a78f2438f0511cc398c 100644 --- a/dev/tests/functional/tests/app/Magento/Payment/Test/Fixture/CreditCard.xml +++ b/dev/tests/functional/tests/app/Magento/Payment/Test/Fixture/CreditCard.xml @@ -6,7 +6,12 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="credit_card" module="Magento_Payment" type="virtual" entity_type="credit_card" repository_class="Magento\Payment\Test\Repository\CreditCard" class="Magento\Payment\Test\Fixture\CreditCard"> + <fixture name="credit_card" + module="Magento_Payment" + type="virtual" + entity_type="credit_card" + repository_class="Magento\Payment\Test\Repository\CreditCard" + class="Magento\Payment\Test\Fixture\CreditCard"> <field name="cc_type" /> <field name="cc_number" /> <field name="cc_exp_month" /> diff --git a/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/ExpressCheckoutFromProductPageTest.xml b/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/ExpressCheckoutFromProductPageTest.xml index c72134191de2dd2b9176458114ae38177cfec54b..2d459bcd61e1b0bcdd213b80ad014256864b269f 100644 --- a/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/ExpressCheckoutFromProductPageTest.xml +++ b/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/ExpressCheckoutFromProductPageTest.xml @@ -11,7 +11,7 @@ <data name="description" xsi:type="string">MAGETWO-12415 - Check Out as a Guest using "Checkout with PayPal" button from Product Page and Free Shipping</data> <data name="product" xsi:type="string">catalogProductSimple::simple_10_dollar</data> <data name="taxRule" xsi:type="string">us_ca_ny_rule</data> - <data name="sandboxCustomer/dataSet" xsi:type="string">sandbox_us_default</data> + <data name="sandboxCustomer/dataset" xsi:type="string">sandbox_us_default</data> <data name="checkoutMethod" xsi:type="string">guest</data> <data name="shipping" xsi:type="array"> <item name="shipping_method" xsi:type="string">Free</item> diff --git a/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/ExpressCheckoutOnePageTest.xml b/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/ExpressCheckoutOnePageTest.xml index 277ad9f6bf4206aba4291767c8f8c7ea8f4896fe..e11142c9fc5201c34f24810ce83c6da9155e87ca 100644 --- a/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/ExpressCheckoutOnePageTest.xml +++ b/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/ExpressCheckoutOnePageTest.xml @@ -11,8 +11,8 @@ <data name="description" xsi:type="string">MAGETWO-12413 - Check Out as a Guest Using PayPal Express Checkout Method and Offline Shipping Method</data> <data name="products" xsi:type="string">catalogProductSimple::simple_10_dollar, configurableProduct::with_one_option, bundleProduct::fixed_100_dollar_with_required_options</data> <data name="taxRule" xsi:type="string">us_ca_ny_rule</data> - <data name="sandboxCustomer/dataSet" xsi:type="string">sandbox_us_default</data> - <data name="customer/dataSet" xsi:type="string">default</data> + <data name="sandboxCustomer/dataset" xsi:type="string">sandbox_us_default</data> + <data name="customer/dataset" xsi:type="string">default</data> <data name="checkoutMethod" xsi:type="string">guest</data> <data name="shipping" xsi:type="array"> <item name="shipping_method" xsi:type="string">Fixed</item> @@ -38,8 +38,8 @@ <data name="description" xsi:type="string">MAGETWO-14359 - Check Out as a Guest using Payflow Link - PayPal Express Checkout Payflow Edition and Offline Shipping</data> <data name="products" xsi:type="string">catalogProductSimple::simple_10_dollar, configurableProduct::with_one_option, bundleProduct::fixed_100_dollar_with_required_options</data> <data name="taxRule" xsi:type="string">us_ca_ny_rule</data> - <data name="sandboxCustomer/dataSet" xsi:type="string">sandbox_us_default</data> - <data name="customer/dataSet" xsi:type="string">default</data> + <data name="sandboxCustomer/dataset" xsi:type="string">sandbox_us_default</data> + <data name="customer/dataset" xsi:type="string">default</data> <data name="checkoutMethod" xsi:type="string">guest</data> <data name="shipping" xsi:type="array"> <item name="shipping_method" xsi:type="string">Fixed</item> @@ -66,8 +66,8 @@ <data name="description" xsi:type="string">MAGETWO-12996 - Check Out as Guest User using PayPal Express and Offline Shipping Method</data> <data name="products" xsi:type="string">catalogProductSimple::simple_10_dollar, configurableProduct::with_one_option, bundleProduct::fixed_100_dollar_with_required_options</data> <data name="taxRule" xsi:type="string">us_ca_ny_rule</data> - <data name="sandboxCustomer/dataSet" xsi:type="string">sandbox_us_default</data> - <data name="customer/dataSet" xsi:type="string">default</data> + <data name="sandboxCustomer/dataset" xsi:type="string">sandbox_us_default</data> + <data name="customer/dataset" xsi:type="string">default</data> <data name="checkoutMethod" xsi:type="string">guest</data> <data name="shipping" xsi:type="array"> <item name="shipping_method" xsi:type="string">Fixed</item> diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertBestsellerReportResult.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertBestsellerReportResult.php index 30e3f10dd62470902ad5977f2e3e03f0b8698e38..182b567985b6e2ad8bd1bf64c505939949d4b96b 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertBestsellerReportResult.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertBestsellerReportResult.php @@ -51,6 +51,6 @@ class AssertBestsellerReportResult extends AbstractConstraint */ public function toString() { - return 'Bestseller total result is equals to data from dataSet.'; + return 'Bestseller total result is equals to data from dataset.'; } } diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertNewAccountsReportTotalResult.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertNewAccountsReportTotalResult.php index b453dc730f2f453d10a07c4e1cfc149abdddf384..eada24c44870c904a83d8796822fcc9ee7499c8e 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertNewAccountsReportTotalResult.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertNewAccountsReportTotalResult.php @@ -11,12 +11,12 @@ use Magento\Mtf\Constraint\AbstractConstraint; /** * Class AssertNewAccountsReportTotalResult - * Assert that new account total result is equals to data from dataSet + * Assert that new account total result is equals to data from dataset */ class AssertNewAccountsReportTotalResult extends AbstractConstraint { /** - * Assert that new account total result is equals to data from dataSet + * Assert that new account total result is equals to data from dataset * * @param CustomerAccounts $customerAccounts * @param string $total @@ -35,6 +35,6 @@ class AssertNewAccountsReportTotalResult extends AbstractConstraint */ public function toString() { - return 'New account total result is equals to data from dataSet.'; + return 'New account total result is equals to data from dataset.'; } } diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductViewsReportTotalResult.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductViewsReportTotalResult.php index 7218c72efa61a3ffec15e23afa129d73897c2e98..bd9f6e9ddaefe358536290eccfbf65d6d9db6d8b 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductViewsReportTotalResult.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductViewsReportTotalResult.php @@ -37,6 +37,6 @@ class AssertProductViewsReportTotalResult extends AbstractConstraint */ public function toString() { - return 'Products view total result is equals to data from dataSet.'; + return 'Products view total result is equals to data from dataset.'; } } diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertSearchTermReportForm.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertSearchTermReportForm.php index d82d59837b6d0ccc149e05b52facf0d7153bd62c..d7956d8e692351b9e8913ebec13028b4f3f99ce2 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertSearchTermReportForm.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertSearchTermReportForm.php @@ -12,12 +12,12 @@ use Magento\Mtf\Constraint\AbstractAssertForm; /** * Class AssertSearchTermReportForm - * Assert that Search Term Report form data equals to passed from dataSet + * Assert that Search Term Report form data equals to passed from dataset */ class AssertSearchTermReportForm extends AbstractAssertForm { /** - * Assert that Search Term Report form data equals to passed from dataSet + * Assert that Search Term Report form data equals to passed from dataset * * @param CatalogSearchEdit $catalogSearchEdit * @param SearchIndex $searchIndex @@ -53,6 +53,6 @@ class AssertSearchTermReportForm extends AbstractAssertForm */ public function toString() { - return 'Search Term Report form data equals to passed from dataSet.'; + return 'Search Term Report form data equals to passed from dataset.'; } } diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/AbandonedCartsReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/AbandonedCartsReportEntityTest.php index a8d4364fdd3479052461a9d86f6411b4b0b6c71f..5aef01eea5226e872523df33eb1ea61266f124ba 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/AbandonedCartsReportEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/AbandonedCartsReportEntityTest.php @@ -13,7 +13,6 @@ use Magento\Customer\Test\Fixture\Customer; use Magento\Catalog\Test\Page\Product\CatalogProductView; /** - * Test Flow: * Preconditions: * 1. Create simple product. * 2. Create customer. diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/AbandonedCartsReportEntityTest.xml b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/AbandonedCartsReportEntityTest.xml index c035d7e9c326e1305a4a1905ab737f553b3af47e..95ce6b354b4bf38ccf98f52d7d63ad1ab9dddb82 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/AbandonedCartsReportEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/AbandonedCartsReportEntityTest.xml @@ -6,18 +6,18 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\Reports\Test\TestCase\AbandonedCartsReportEntityTest"> - <variation name="AbandonedCartsReportEntityTestVariation1"> - <data name="description" xsi:type="string">add product to cart as registered user and check product in Report</data> - <data name="customer/dataSet" xsi:type="string">default</data> - <data name="products" xsi:type="string">catalogProductSimple::product_100_dollar</data> - <constraint name="Magento\Reports\Test\Constraint\AssertAbandonedCartCustomerInfoResult"/> - </variation> - <variation name="AbandonedCartsReportEntityTestVariation2"> - <data name="description" xsi:type="string">add two products to cart as registered user and check product in Report</data> - <data name="customer/dataSet" xsi:type="string">default</data> - <data name="products" xsi:type="string">catalogProductSimple::product_100_dollar,catalogProductSimple::product_100_dollar</data> - <constraint name="Magento\Reports\Test\Constraint\AssertAbandonedCartCustomerInfoResult"/> - </variation> - </testCase> + <testCase name="Magento\Reports\Test\TestCase\AbandonedCartsReportEntityTest"> + <variation name="AbandonedCartsReportEntityTestVariation1"> + <data name="description" xsi:type="string">add product to cart as registered user and check product in Report</data> + <data name="customer/dataset" xsi:type="string">default</data> + <data name="products" xsi:type="string">catalogProductSimple::product_100_dollar</data> + <constraint name="Magento\Reports\Test\Constraint\AssertAbandonedCartCustomerInfoResult" /> + </variation> + <variation name="AbandonedCartsReportEntityTestVariation2"> + <data name="description" xsi:type="string">add two products to cart as registered user and check product in Report</data> + <data name="customer/dataset" xsi:type="string">default</data> + <data name="products" xsi:type="string">catalogProductSimple::product_100_dollar,catalogProductSimple::product_100_dollar</data> + <constraint name="Magento\Reports\Test\Constraint\AssertAbandonedCartCustomerInfoResult" /> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/BestsellerProductsReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/BestsellerProductsReportEntityTest.php index 7ea6eae0fc5f2a6deff50b2b31babae0f5fb7345..1ad8d1b3356f731e3c677d3bced986eabe846662 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/BestsellerProductsReportEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/BestsellerProductsReportEntityTest.php @@ -11,7 +11,6 @@ use Magento\Sales\Test\Fixture\OrderInjectable; use Magento\Mtf\TestCase\Injectable; /** - * Test Flow: * Preconditions: * 1. Create customer. * 2. Create product. diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/BestsellerProductsReportEntityTest.xml b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/BestsellerProductsReportEntityTest.xml index 7b5657f4032dc62a41c5b7304bb38ead44a02749..5b953c047969f8837116d297404ab569da5fc6f5 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/BestsellerProductsReportEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/BestsellerProductsReportEntityTest.xml @@ -6,33 +6,33 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\Reports\Test\TestCase\BestsellerProductsReportEntityTest"> - <variation name="BestsellerProductsReportEntityTestVariation1"> - <data name="order/dataSet" xsi:type="string">simple_big_qty</data> - <data name="bestsellerReport/period_type" xsi:type="string">Year</data> - <data name="bestsellerReport/from" xsi:type="string">m/d/Y -1 year</data> - <data name="bestsellerReport/to" xsi:type="string">m/d/Y</data> - <data name="bestsellerReport/show_empty_rows" xsi:type="string">No</data> - <data name="date" xsi:type="string">Y</data> - <constraint name="Magento\Reports\Test\Constraint\AssertBestsellerReportResult"/> - </variation> - <variation name="BestsellerProductsReportEntityTestVariation2"> - <data name="order/dataSet" xsi:type="string">virtual_big_qty</data> - <data name="bestsellerReport/period_type" xsi:type="string">Month</data> - <data name="bestsellerReport/from" xsi:type="string">m/d/Y -1 month</data> - <data name="bestsellerReport/to" xsi:type="string">m/d/Y</data> - <data name="bestsellerReport/show_empty_rows" xsi:type="string">Yes</data> - <data name="date" xsi:type="string">n/Y</data> - <constraint name="Magento\Reports\Test\Constraint\AssertBestsellerReportResult"/> - </variation> - <variation name="BestsellerProductsReportEntityTestVariation3"> - <data name="order/dataSet" xsi:type="string">simple_big_qty</data> - <data name="bestsellerReport/period_type" xsi:type="string">Day</data> - <data name="bestsellerReport/from" xsi:type="string">m/d/Y -1 day</data> - <data name="bestsellerReport/to" xsi:type="string">m/d/Y +1 day</data> - <data name="bestsellerReport/show_empty_rows" xsi:type="string">No</data> - <data name="date" xsi:type="string">M d, Y</data> - <constraint name="Magento\Reports\Test\Constraint\AssertBestsellerReportResult"/> - </variation> - </testCase> + <testCase name="Magento\Reports\Test\TestCase\BestsellerProductsReportEntityTest"> + <variation name="BestsellerProductsReportEntityTestVariation1"> + <data name="order/dataset" xsi:type="string">simple_big_qty</data> + <data name="bestsellerReport/period_type" xsi:type="string">Year</data> + <data name="bestsellerReport/from" xsi:type="string">m/d/Y -1 year</data> + <data name="bestsellerReport/to" xsi:type="string">m/d/Y</data> + <data name="bestsellerReport/show_empty_rows" xsi:type="string">No</data> + <data name="date" xsi:type="string">Y</data> + <constraint name="Magento\Reports\Test\Constraint\AssertBestsellerReportResult" /> + </variation> + <variation name="BestsellerProductsReportEntityTestVariation2"> + <data name="order/dataset" xsi:type="string">virtual_big_qty</data> + <data name="bestsellerReport/period_type" xsi:type="string">Month</data> + <data name="bestsellerReport/from" xsi:type="string">m/d/Y -1 month</data> + <data name="bestsellerReport/to" xsi:type="string">m/d/Y</data> + <data name="bestsellerReport/show_empty_rows" xsi:type="string">Yes</data> + <data name="date" xsi:type="string">n/Y</data> + <constraint name="Magento\Reports\Test\Constraint\AssertBestsellerReportResult" /> + </variation> + <variation name="BestsellerProductsReportEntityTestVariation3"> + <data name="order/dataset" xsi:type="string">simple_big_qty</data> + <data name="bestsellerReport/period_type" xsi:type="string">Day</data> + <data name="bestsellerReport/from" xsi:type="string">m/d/Y -1 day</data> + <data name="bestsellerReport/to" xsi:type="string">m/d/Y +1 day</data> + <data name="bestsellerReport/show_empty_rows" xsi:type="string">No</data> + <data name="date" xsi:type="string">M d, Y</data> + <constraint name="Magento\Reports\Test\Constraint\AssertBestsellerReportResult" /> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomerReviewReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomerReviewReportEntityTest.php index 37e7727e7299cce0c0c020723104d0f0aeff79ee..ad89adee0371b97c49956fb8068371b7c0364478 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomerReviewReportEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomerReviewReportEntityTest.php @@ -88,7 +88,7 @@ class CustomerReviewReportEntityTest extends Injectable */ public function __prepare(FixtureFactory $fixtureFactory) { - $customer = $fixtureFactory->createByCode('customer', ['dataSet' => 'johndoe_unique']); + $customer = $fixtureFactory->createByCode('customer', ['dataset' => 'johndoe_unique']); $customer->persist(); return ['customer' => $customer]; diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomerReviewReportEntityTest.xml b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomerReviewReportEntityTest.xml index 26430b8ea9c7233e8734019c057493a2435bbbf3..1ccaf332596e0a2c495c5a766d28c290b8d9b0ef 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomerReviewReportEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomerReviewReportEntityTest.xml @@ -9,7 +9,7 @@ <testCase name="Magento\Reports\Test\TestCase\CustomerReviewReportEntityTest"> <variation name="CustomerReviewReportEntityTestVariation1"> <data name="customerLogin" xsi:type="string">Yes</data> - <data name="product/dataSet" xsi:type="string">default</data> + <data name="product/dataset" xsi:type="string">default</data> <data name="review/data/type" xsi:type="string">Customer</data> <data name="review/data/nickname" xsi:type="string">name_upd_%isolation%</data> <data name="review/data/title" xsi:type="string">title_upd_%isolation%</data> @@ -20,7 +20,7 @@ </variation> <variation name="CustomerReviewReportEntityTestVariation2"> <data name="customerLogin" xsi:type="string">Yes</data> - <data name="product/dataSet" xsi:type="string">default</data> + <data name="product/dataset" xsi:type="string">default</data> <data name="review/data/type" xsi:type="string">Customer</data> <data name="review/data/nickname" xsi:type="string">name_upd_%isolation%</data> <data name="review/data/title" xsi:type="string">title_upd_%isolation%</data> @@ -31,7 +31,7 @@ </variation> <variation name="CustomerReviewReportEntityTestVariation3"> <data name="customerLogin" xsi:type="string">No</data> - <data name="product/dataSet" xsi:type="string">default</data> + <data name="product/dataset" xsi:type="string">default</data> <data name="review/data/nickname" xsi:type="string">name_upd_%isolation%</data> <data name="review/data/title" xsi:type="string">title_upd_%isolation%</data> <data name="review/data/detail" xsi:type="string">review_upd_%isolation%</data> diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomersOrderCountReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomersOrderCountReportEntityTest.php index 49add4e5308305f9b37877e5ea75d79247f65b46..ddd49e71ae3564f677bf366bdbebd7045e108529 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomersOrderCountReportEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomersOrderCountReportEntityTest.php @@ -13,10 +13,6 @@ use Magento\Mtf\Fixture\FixtureFactory; use Magento\Mtf\TestCase\Injectable; /** - * Test Creation for OrderCountReportEntity - * - * Test Flow: - * * Preconditions: * 1. Create customer * 2. Create orders for customer @@ -24,7 +20,7 @@ use Magento\Mtf\TestCase\Injectable; * Steps: * 1. Login to backend * 2. Open Reports > Customer > Order Count - * 3. Fill data from dataSet + * 3. Fill data from dataset * 4. Click button Refresh * 5. Perform all assertions * @@ -39,14 +35,14 @@ class CustomersOrderCountReportEntityTest extends Injectable /* end tags */ /** - * Order count report page + * Order count report page. * * @var CustomerOrdersReport */ protected $customerOrdersReport; /** - * Inject page + * Inject page. * * @param CustomerOrdersReport $customerOrdersReport * @return void @@ -57,7 +53,7 @@ class CustomersOrderCountReportEntityTest extends Injectable } /** - * Order count report view + * Order count report view. * * @param Customer $customer * @param string $orders @@ -73,7 +69,7 @@ class CustomersOrderCountReportEntityTest extends Injectable foreach ($orders as $order) { $order = $fixtureFactory->createByCode( 'orderInjectable', - ['dataSet' => $order, 'data' => ['customer_id' => ['customer' => $customer]]] + ['dataset' => $order, 'data' => ['customer_id' => ['customer' => $customer]]] ); $order->persist(); } diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomersOrderCountReportEntityTest.xml b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomersOrderCountReportEntityTest.xml index 738b46c38f0816037d37c8c2e7a3505447a0e7c5..44da2a6f78cedc4402d54484d62d35eceee72aaa 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomersOrderCountReportEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomersOrderCountReportEntityTest.xml @@ -6,36 +6,36 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\Reports\Test\TestCase\CustomersOrderCountReportEntityTest"> - <variation name="CustomersOrderCountReportEntityTestVariation1"> - <data name="orders" xsi:type="string">default,virtual_product</data> - <data name="report/report_from" xsi:type="string">m/d/Y</data> - <data name="report/report_to" xsi:type="string">m/d/Y</data> - <data name="report/report_period" xsi:type="string">Day</data> - <data name="columns/orders" xsi:type="string">2</data> - <data name="columns/average" xsi:type="string">285</data> - <data name="columns/total" xsi:type="string">570</data> - <constraint name="Magento\Reports\Test\Constraint\AssertCustomerOrderCountReportResult"/> - </variation> - <variation name="CustomersOrderCountReportEntityTestVariation2"> - <data name="orders" xsi:type="string">default,virtual_product</data> - <data name="report/report_from" xsi:type="string">m/d/Y</data> - <data name="report/report_to" xsi:type="string">m/d/Y</data> - <data name="report/report_period" xsi:type="string">Month</data> - <data name="columns/orders" xsi:type="string">2</data> - <data name="columns/average" xsi:type="string">285</data> - <data name="columns/total" xsi:type="string">570</data> - <constraint name="Magento\Reports\Test\Constraint\AssertCustomerOrderCountReportResult"/> - </variation> - <variation name="CustomersOrderCountReportEntityTestVariation3"> - <data name="orders" xsi:type="string">default</data> - <data name="report/report_from" xsi:type="string">m/d/Y</data> - <data name="report/report_to" xsi:type="string">m/d/Y</data> - <data name="report/report_period" xsi:type="string">Year</data> - <data name="columns/orders" xsi:type="string">1</data> - <data name="columns/average" xsi:type="string">560</data> - <data name="columns/total" xsi:type="string">560</data> - <constraint name="Magento\Reports\Test\Constraint\AssertCustomerOrderCountReportResult"/> - </variation> - </testCase> + <testCase name="Magento\Reports\Test\TestCase\CustomersOrderCountReportEntityTest"> + <variation name="CustomersOrderCountReportEntityTestVariation1"> + <data name="orders" xsi:type="string">default,virtual_product</data> + <data name="report/report_from" xsi:type="string">m/d/Y</data> + <data name="report/report_to" xsi:type="string">m/d/Y</data> + <data name="report/report_period" xsi:type="string">Day</data> + <data name="columns/orders" xsi:type="string">2</data> + <data name="columns/average" xsi:type="string">285</data> + <data name="columns/total" xsi:type="string">570</data> + <constraint name="Magento\Reports\Test\Constraint\AssertCustomerOrderCountReportResult" /> + </variation> + <variation name="CustomersOrderCountReportEntityTestVariation2"> + <data name="orders" xsi:type="string">default,virtual_product</data> + <data name="report/report_from" xsi:type="string">m/d/Y</data> + <data name="report/report_to" xsi:type="string">m/d/Y</data> + <data name="report/report_period" xsi:type="string">Month</data> + <data name="columns/orders" xsi:type="string">2</data> + <data name="columns/average" xsi:type="string">285</data> + <data name="columns/total" xsi:type="string">570</data> + <constraint name="Magento\Reports\Test\Constraint\AssertCustomerOrderCountReportResult" /> + </variation> + <variation name="CustomersOrderCountReportEntityTestVariation3"> + <data name="orders" xsi:type="string">default</data> + <data name="report/report_from" xsi:type="string">m/d/Y</data> + <data name="report/report_to" xsi:type="string">m/d/Y</data> + <data name="report/report_period" xsi:type="string">Year</data> + <data name="columns/orders" xsi:type="string">1</data> + <data name="columns/average" xsi:type="string">560</data> + <data name="columns/total" xsi:type="string">560</data> + <constraint name="Magento\Reports\Test\Constraint\AssertCustomerOrderCountReportResult" /> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomersOrderTotalReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomersOrderTotalReportEntityTest.php index 2ff69f34355837c70dd84d115cf9f77a5985a8a8..0cc474f4a5a2a38b8db74794178f80bdce8e5d1e 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomersOrderTotalReportEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/CustomersOrderTotalReportEntityTest.php @@ -20,7 +20,7 @@ use Magento\Mtf\TestCase\Injectable; * Steps: * 1. Login to backend * 2. Open Reports > Customer > Order Total - * 3. Fill data from dataSet + * 3. Fill data from dataset * 4. Click button Refresh * 5. Perform all assertions * @@ -69,7 +69,7 @@ class CustomersOrderTotalReportEntityTest extends Injectable foreach ($orders as $order) { $order = $fixtureFactory->createByCode( 'orderInjectable', - ['dataSet' => $order, 'data' => ['customer_id' => ['customer' => $customer]]] + ['dataset' => $order, 'data' => ['customer_id' => ['customer' => $customer]]] ); $order->persist(); } diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/DownloadProductsReportEntityTest.xml b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/DownloadProductsReportEntityTest.xml index b985df63c8c565de9009334fc556f63e79e7e34d..111490b3550c6a8da2c833bd73c7d58f025ab9ca 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/DownloadProductsReportEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/DownloadProductsReportEntityTest.xml @@ -6,21 +6,21 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\Reports\Test\TestCase\DownloadProductsReportEntityTest"> - <variation name="DownloadProductsReportEntityTestVariation1"> - <data name="order/dataSet" xsi:type="string">downloadable_product</data> - <data name="downloads" xsi:type="string">1</data> - <constraint name="Magento\Reports\Test\Constraint\AssertDownloadsReportResult"/> - </variation> - <variation name="DownloadProductsReportEntityTestVariation2"> - <data name="order/dataSet" xsi:type="string">two_downloadable_product</data> - <data name="downloads" xsi:type="string">2</data> - <constraint name="Magento\Reports\Test\Constraint\AssertDownloadsReportResult"/> - </variation> - <variation name="DownloadProductsReportEntityTestVariation3"> - <data name="order/dataSet" xsi:type="string">downloadable_product</data> - <data name="downloads" xsi:type="string">0</data> - <constraint name="Magento\Reports\Test\Constraint\AssertDownloadsReportResult"/> - </variation> - </testCase> + <testCase name="Magento\Reports\Test\TestCase\DownloadProductsReportEntityTest"> + <variation name="DownloadProductsReportEntityTestVariation1"> + <data name="order/dataset" xsi:type="string">downloadable_product</data> + <data name="downloads" xsi:type="string">1</data> + <constraint name="Magento\Reports\Test\Constraint\AssertDownloadsReportResult" /> + </variation> + <variation name="DownloadProductsReportEntityTestVariation2"> + <data name="order/dataset" xsi:type="string">two_downloadable_product</data> + <data name="downloads" xsi:type="string">2</data> + <constraint name="Magento\Reports\Test\Constraint\AssertDownloadsReportResult" /> + </variation> + <variation name="DownloadProductsReportEntityTestVariation3"> + <data name="order/dataset" xsi:type="string">downloadable_product</data> + <data name="downloads" xsi:type="string">0</data> + <constraint name="Magento\Reports\Test\Constraint\AssertDownloadsReportResult" /> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/LowStockProductsReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/LowStockProductsReportEntityTest.php index a81da13dd13add8b8e706c50379a0626e96e9183..0b35a36c6309628557fc0ae3a65d23ef1dd81120 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/LowStockProductsReportEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/LowStockProductsReportEntityTest.php @@ -10,9 +10,6 @@ use Magento\Catalog\Test\Fixture\CatalogProductSimple; use Magento\Mtf\TestCase\Injectable; /** - * Test Creation for LowStockProductsReportEntityTest - * - * Test Flow: * Preconditions: * 1. Product is created. * diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/LowStockProductsReportEntityTest.xml b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/LowStockProductsReportEntityTest.xml index 449a25fd9192d63993639f35c2c78e7a3bfe88b0..5bdfba60de783b2ff161566ccac6734592b70d15 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/LowStockProductsReportEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/LowStockProductsReportEntityTest.xml @@ -6,10 +6,10 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\Reports\Test\TestCase\LowStockProductsReportEntityTest"> - <variation name="LowStockProductsReportEntityTestVariation1"> - <data name="product/dataSet" xsi:type="string">low_stock_product</data> - <constraint name="Magento\Reports\Test\Constraint\AssertLowStockProductInGrid"/> - </variation> - </testCase> + <testCase name="Magento\Reports\Test\TestCase\LowStockProductsReportEntityTest"> + <variation name="LowStockProductsReportEntityTestVariation1"> + <data name="product/dataset" xsi:type="string">low_stock_product</data> + <constraint name="Magento\Reports\Test\Constraint\AssertLowStockProductInGrid" /> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/NavigateMenuTest.xml index 46bb69f248a90ac90a6f816564fc4e1504af4480..b56a9e9db9218176ba3cf2612aa976757f40fb8e 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/NavigateMenuTest.xml +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/NavigateMenuTest.xml @@ -10,77 +10,77 @@ <variation name="NavigateMenuTest55"> <data name="menuItem" xsi:type="string">Reports > Products in Cart</data> <data name="pageTitle" xsi:type="string">Products in Carts</data> - <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable" /> </variation> <variation name="NavigateMenuTest56"> <data name="menuItem" xsi:type="string">Reports > Abandoned Carts</data> <data name="pageTitle" xsi:type="string">Abandoned Carts</data> - <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable" /> </variation> <variation name="NavigateMenuTest57"> <data name="menuItem" xsi:type="string">Reports > Orders</data> <data name="pageTitle" xsi:type="string">Sales Report</data> - <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable" /> </variation> <variation name="NavigateMenuTest58"> <data name="menuItem" xsi:type="string">Reports > Tax</data> <data name="pageTitle" xsi:type="string">Tax Report</data> - <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable" /> </variation> <variation name="NavigateMenuTest59"> <data name="menuItem" xsi:type="string">Reports > Invoiced</data> <data name="pageTitle" xsi:type="string">Invoice Report</data> - <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable" /> </variation> <variation name="NavigateMenuTest60"> <data name="menuItem" xsi:type="string">Reports > Coupons</data> <data name="pageTitle" xsi:type="string">Coupons Report</data> - <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable" /> </variation> <variation name="NavigateMenuTest61"> <data name="menuItem" xsi:type="string">Reports > Order Total</data> <data name="pageTitle" xsi:type="string">Order Total Report</data> - <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable" /> </variation> <variation name="NavigateMenuTest62"> <data name="menuItem" xsi:type="string">Reports > Order Count</data> <data name="pageTitle" xsi:type="string">Order Count Report</data> - <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable" /> </variation> <variation name="NavigateMenuTest63"> <data name="menuItem" xsi:type="string">Reports > New</data> <data name="pageTitle" xsi:type="string">New Accounts Report</data> - <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable" /> </variation> <variation name="NavigateMenuTest64"> <data name="menuItem" xsi:type="string">Reports > Views</data> <data name="pageTitle" xsi:type="string">Product Views Report</data> - <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable" /> </variation> <variation name="NavigateMenuTest65"> <data name="menuItem" xsi:type="string">Reports > Bestsellers</data> <data name="pageTitle" xsi:type="string">Best Sellers Report</data> - <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable" /> </variation> <variation name="NavigateMenuTest66"> <data name="menuItem" xsi:type="string">Reports > Low Stock</data> <data name="pageTitle" xsi:type="string">Low Stock Report</data> - <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable" /> </variation> <variation name="NavigateMenuTest67"> <data name="menuItem" xsi:type="string">Reports > Ordered</data> <data name="pageTitle" xsi:type="string">Ordered Products Report</data> - <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable" /> </variation> <variation name="NavigateMenuTest68"> <data name="menuItem" xsi:type="string">Reports > Downloads</data> <data name="pageTitle" xsi:type="string">Downloads Report</data> - <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable" /> </variation> <variation name="NavigateMenuTest69"> <data name="menuItem" xsi:type="string">Reports > Refresh statistics</data> <data name="pageTitle" xsi:type="string">Refresh Statistics</data> - <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> + <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable" /> </variation> </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/NewAccountsReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/NewAccountsReportEntityTest.php index 15078aca2addf12684876d57fe9c2eda6eb2dec9..04aeb9aa17fa50abc93f7fc48c5ab9763446daed 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/NewAccountsReportEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/NewAccountsReportEntityTest.php @@ -12,7 +12,6 @@ use Magento\Reports\Test\Page\Adminhtml\CustomerAccounts; use Magento\Mtf\TestCase\Injectable; /** - * Test Flow: * Preconditions: * 1. Delete all existing customers. * 2. Create customer. diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/NewAccountsReportEntityTest.xml b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/NewAccountsReportEntityTest.xml index 9d23f499e401ef6c148365fb305be3c7885b9075..1a8903a9dba5c8968a69cd1aabe02e252eb7f1d1 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/NewAccountsReportEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/NewAccountsReportEntityTest.xml @@ -6,38 +6,38 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\Reports\Test\TestCase\NewAccountsReportEntityTest"> - <variation name="NewAccountsReportEntityTestVariation1"> - <data name="customer/dataSet" xsi:type="string">default</data> - <data name="total" xsi:type="string">1</data> - <data name="customersReport/report_from" xsi:type="string">m/d/Y</data> - <data name="customersReport/report_to" xsi:type="string">m/d/Y</data> - <data name="customersReport/report_period" xsi:type="string">Year</data> - <constraint name="Magento\Reports\Test\Constraint\AssertNewAccountsReportTotalResult"/> - </variation> - <variation name="NewAccountsReportEntityTestVariation2"> - <data name="customer/dataSet" xsi:type="string">default</data> - <data name="total" xsi:type="string">1</data> - <data name="customersReport/report_from" xsi:type="string">m/d/Y</data> - <data name="customersReport/report_to" xsi:type="string">m/d/Y</data> - <data name="customersReport/report_period" xsi:type="string">Month</data> - <constraint name="Magento\Reports\Test\Constraint\AssertNewAccountsReportTotalResult"/> - </variation> - <variation name="NewAccountsReportEntityTestVariation3"> - <data name="customer/dataSet" xsi:type="string">default</data> - <data name="total" xsi:type="string">1</data> - <data name="customersReport/report_from" xsi:type="string">m/d/Y</data> - <data name="customersReport/report_to" xsi:type="string">m/d/Y</data> - <data name="customersReport/report_period" xsi:type="string">Day</data> - <constraint name="Magento\Reports\Test\Constraint\AssertNewAccountsReportTotalResult"/> - </variation> - <variation name="NewAccountsReportEntityTestVariation4"> - <data name="customer/dataSet" xsi:type="string">default</data> - <data name="total" xsi:type="string">0</data> - <data name="customersReport/report_from" xsi:type="string">m/d/Y 12:00 a+1 day</data> - <data name="customersReport/report_to" xsi:type="string">m/d/Y 12:00 a+1 day</data> - <data name="customersReport/report_period" xsi:type="string">Day</data> - <constraint name="Magento\Reports\Test\Constraint\AssertNewAccountsReportTotalResult"/> - </variation> - </testCase> + <testCase name="Magento\Reports\Test\TestCase\NewAccountsReportEntityTest"> + <variation name="NewAccountsReportEntityTestVariation1"> + <data name="customer/dataset" xsi:type="string">default</data> + <data name="total" xsi:type="string">1</data> + <data name="customersReport/report_from" xsi:type="string">m/d/Y</data> + <data name="customersReport/report_to" xsi:type="string">m/d/Y</data> + <data name="customersReport/report_period" xsi:type="string">Year</data> + <constraint name="Magento\Reports\Test\Constraint\AssertNewAccountsReportTotalResult" /> + </variation> + <variation name="NewAccountsReportEntityTestVariation2"> + <data name="customer/dataset" xsi:type="string">default</data> + <data name="total" xsi:type="string">1</data> + <data name="customersReport/report_from" xsi:type="string">m/d/Y</data> + <data name="customersReport/report_to" xsi:type="string">m/d/Y</data> + <data name="customersReport/report_period" xsi:type="string">Month</data> + <constraint name="Magento\Reports\Test\Constraint\AssertNewAccountsReportTotalResult" /> + </variation> + <variation name="NewAccountsReportEntityTestVariation3"> + <data name="customer/dataset" xsi:type="string">default</data> + <data name="total" xsi:type="string">1</data> + <data name="customersReport/report_from" xsi:type="string">m/d/Y</data> + <data name="customersReport/report_to" xsi:type="string">m/d/Y</data> + <data name="customersReport/report_period" xsi:type="string">Day</data> + <constraint name="Magento\Reports\Test\Constraint\AssertNewAccountsReportTotalResult" /> + </variation> + <variation name="NewAccountsReportEntityTestVariation4"> + <data name="customer/dataset" xsi:type="string">default</data> + <data name="total" xsi:type="string">0</data> + <data name="customersReport/report_from" xsi:type="string">m/d/Y 12:00 a+1 day</data> + <data name="customersReport/report_to" xsi:type="string">m/d/Y 12:00 a+1 day</data> + <data name="customersReport/report_period" xsi:type="string">Day</data> + <constraint name="Magento\Reports\Test\Constraint\AssertNewAccountsReportTotalResult" /> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/OrderedProductsReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/OrderedProductsReportEntityTest.php index f62833e2ba4508c7843c9454144b676632256f42..0882f100bba3b6702f7b5a40ade5707e7d2469a1 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/OrderedProductsReportEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/OrderedProductsReportEntityTest.php @@ -11,9 +11,6 @@ use Magento\Sales\Test\Fixture\OrderInjectable; use Magento\Mtf\TestCase\Injectable; /** - * Test Creation for OrderedProductsReportEntity - * - * Test Flow: * Preconditions: * 1. Place order * @@ -35,14 +32,14 @@ class OrderedProductsReportEntityTest extends Injectable /* end tags */ /** - * Ordered Products Report + * Ordered Products Report. * * @var OrderedProductsReport */ protected $orderedProducts; /** - * Inject pages + * Inject pages. * * @param OrderedProductsReport $orderedProducts * @return void @@ -53,7 +50,7 @@ class OrderedProductsReportEntityTest extends Injectable } /** - * Search order products report + * Search order products report. * * @param OrderInjectable $order * @param array $customersReport diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/OrderedProductsReportEntityTest.xml b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/OrderedProductsReportEntityTest.xml index a05fb0fcc906dc8b28c68943e33b6c1c9cbd9d26..e3dd733ebf82ad3b7dc3e871bea464750895da5b 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/OrderedProductsReportEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/OrderedProductsReportEntityTest.xml @@ -6,27 +6,27 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\Reports\Test\TestCase\OrderedProductsReportEntityTest"> - <variation name="OrderedProductsReportEntityTestVariation1"> - <data name="order/dataSet" xsi:type="string">default</data> - <data name="customersReport/report_from" xsi:type="string">m/d/Y</data> - <data name="customersReport/report_to" xsi:type="string">m/d/Y</data> - <data name="customersReport/report_period" xsi:type="string">Year</data> - <constraint name="Magento\Reports\Test\Constraint\AssertOrderedProductResult"/> - </variation> - <variation name="OrderedProductsReportEntityTestVariation2"> - <data name="order/dataSet" xsi:type="string">default</data> - <data name="customersReport/report_from" xsi:type="string">m/d/Y</data> - <data name="customersReport/report_to" xsi:type="string">m/d/Y</data> - <data name="customersReport/report_period" xsi:type="string">Month</data> - <constraint name="Magento\Reports\Test\Constraint\AssertOrderedProductResult"/> - </variation> - <variation name="OrderedProductsReportEntityTestVariation3"> - <data name="order/dataSet" xsi:type="string">virtual_product</data> - <data name="customersReport/report_from" xsi:type="string">m/d/Y</data> - <data name="customersReport/report_to" xsi:type="string">m/d/Y</data> - <data name="customersReport/report_period" xsi:type="string">Day</data> - <constraint name="Magento\Reports\Test\Constraint\AssertOrderedProductResult"/> - </variation> - </testCase> + <testCase name="Magento\Reports\Test\TestCase\OrderedProductsReportEntityTest"> + <variation name="OrderedProductsReportEntityTestVariation1"> + <data name="order/dataset" xsi:type="string">default</data> + <data name="customersReport/report_from" xsi:type="string">m/d/Y</data> + <data name="customersReport/report_to" xsi:type="string">m/d/Y</data> + <data name="customersReport/report_period" xsi:type="string">Year</data> + <constraint name="Magento\Reports\Test\Constraint\AssertOrderedProductResult" /> + </variation> + <variation name="OrderedProductsReportEntityTestVariation2"> + <data name="order/dataset" xsi:type="string">default</data> + <data name="customersReport/report_from" xsi:type="string">m/d/Y</data> + <data name="customersReport/report_to" xsi:type="string">m/d/Y</data> + <data name="customersReport/report_period" xsi:type="string">Month</data> + <constraint name="Magento\Reports\Test\Constraint\AssertOrderedProductResult" /> + </variation> + <variation name="OrderedProductsReportEntityTestVariation3"> + <data name="order/dataset" xsi:type="string">virtual_product</data> + <data name="customersReport/report_from" xsi:type="string">m/d/Y</data> + <data name="customersReport/report_to" xsi:type="string">m/d/Y</data> + <data name="customersReport/report_period" xsi:type="string">Day</data> + <constraint name="Magento\Reports\Test\Constraint\AssertOrderedProductResult" /> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ProductReviewReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ProductReviewReportEntityTest.php index 92b8ee33316e41343bacb0287a85088b48312488..089b129af4e07f2580867da2ec8ff4d242400fab 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ProductReviewReportEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ProductReviewReportEntityTest.php @@ -10,8 +10,6 @@ use Magento\Review\Test\Fixture\Review; use Magento\Mtf\TestCase\Injectable; /** - * Test Creation for ProductReviewReportEntity - * * Preconditions: * 1. Create simple product * 2. Create review for this product diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ProductReviewReportEntityTest.xml b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ProductReviewReportEntityTest.xml index c9c25cc407a1c1fd9608db269ae50c8c2bbc2837..fef82ffa1f3a00072dbb373f4fe9a4e49df05eae 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ProductReviewReportEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ProductReviewReportEntityTest.xml @@ -6,11 +6,11 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\Reports\Test\TestCase\ProductReviewReportEntityTest"> - <variation name="ProductReviewReportEntityTestVariation1"> - <data name="review/dataSet" xsi:type="string">frontend_review</data> - <constraint name="Magento\Reports\Test\Constraint\AssertProductReviewReportIsVisibleInGrid"/> - <constraint name="Magento\Reports\Test\Constraint\AssertProductReviewIsAvailableForProduct"/> - </variation> - </testCase> + <testCase name="Magento\Reports\Test\TestCase\ProductReviewReportEntityTest"> + <variation name="ProductReviewReportEntityTestVariation1"> + <data name="review/dataset" xsi:type="string">frontend_review</data> + <constraint name="Magento\Reports\Test\Constraint\AssertProductReviewReportIsVisibleInGrid" /> + <constraint name="Magento\Reports\Test\Constraint\AssertProductReviewIsAvailableForProduct" /> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ProductsInCartReportEntityTest.xml b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ProductsInCartReportEntityTest.xml index c2b2cfec986dea022d2b9ca7fb106ce93879d783..4be8a7343647af5ac379a23ec4d2e800483caa7b 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ProductsInCartReportEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ProductsInCartReportEntityTest.xml @@ -8,13 +8,13 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Reports\Test\TestCase\ProductsInCartReportEntityTest"> <variation name="ProductsInCartReportEntityVariation1"> - <data name="product/dataSet" xsi:type="string">default</data> + <data name="product/dataset" xsi:type="string">default</data> <data name="carts" xsi:type="string">1</data> <data name="isGuest" xsi:type="string">0</data> <constraint name="Magento\Reports\Test\Constraint\AssertProductInCartResult" /> </variation> <variation name="ProductsInCartReportEntityVariation2"> - <data name="product/dataSet" xsi:type="string">default</data> + <data name="product/dataset" xsi:type="string">default</data> <data name="carts" xsi:type="string">2</data> <data name="isGuest" xsi:type="string">1</data> <constraint name="Magento\Reports\Test\Constraint\AssertProductInCartResult" /> diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesCouponReportEntityTest.xml b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesCouponReportEntityTest.xml index 78c05c8e7d0d81cc8c70f43a1d2ccf96676c729b..0be3acf4f5e0d785da4e559d93166763b2b9f4cd 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesCouponReportEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesCouponReportEntityTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Reports\Test\TestCase\SalesCouponReportEntityTest"> <variation name="SalesCouponReportEntityTestVariation1"> - <data name="order/dataSet" xsi:type="string">with_coupon</data> + <data name="order/dataset" xsi:type="string">with_coupon</data> <data name="viewsReport/report_type" xsi:type="string">Order Created</data> <data name="viewsReport/period_type" xsi:type="string">Year</data> <data name="viewsReport/from" xsi:type="string">m/d/Y</data> @@ -19,7 +19,7 @@ <constraint name="Magento\Reports\Test\Constraint\AssertCouponReportResult" /> </variation> <variation name="SalesCouponReportEntityTestVariation2"> - <data name="order/dataSet" xsi:type="string">with_coupon</data> + <data name="order/dataset" xsi:type="string">with_coupon</data> <data name="viewsReport/report_type" xsi:type="string">Order Created</data> <data name="viewsReport/period_type" xsi:type="string">Month</data> <data name="viewsReport/from" xsi:type="string">m/d/Y</data> @@ -31,7 +31,7 @@ <constraint name="Magento\Reports\Test\Constraint\AssertCouponReportResult" /> </variation> <variation name="SalesCouponReportEntityTestVariation3"> - <data name="order/dataSet" xsi:type="string">with_coupon</data> + <data name="order/dataset" xsi:type="string">with_coupon</data> <data name="viewsReport/report_type" xsi:type="string">Order Updated</data> <data name="viewsReport/period_type" xsi:type="string">Day</data> <data name="viewsReport/from" xsi:type="string">m/d/Y</data> @@ -43,7 +43,7 @@ <constraint name="Magento\Reports\Test\Constraint\AssertCouponReportResult" /> </variation> <variation name="SalesCouponReportEntityTestVariation4"> - <data name="order/dataSet" xsi:type="string">with_coupon</data> + <data name="order/dataset" xsi:type="string">with_coupon</data> <data name="viewsReport/report_type" xsi:type="string">Order Updated</data> <data name="viewsReport/period_type" xsi:type="string">Day</data> <data name="viewsReport/from" xsi:type="string">m/d/Y 12:00 a-1 day</data> diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesInvoiceReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesInvoiceReportEntityTest.php index a08d31c92527df9a414ad4e8285c9153cf2f3ceb..895f48a9ecac2c44f74b7f3171305e6f40cc327b 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesInvoiceReportEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesInvoiceReportEntityTest.php @@ -11,10 +11,6 @@ use Magento\Sales\Test\Fixture\OrderInjectable; use Magento\Mtf\TestCase\Injectable; /** - * Test Creation for SalesInvoiceReportEntity - * - * Test Flow: - * * Preconditions: * 1. Open Backend * 2. Go to Reports > Sales > Invoiced @@ -45,7 +41,7 @@ class SalesInvoiceReportEntityTest extends Injectable /* end tags */ /** - * Sales invoice report + * Sales invoice report. * * @param SalesInvoiceReport $salesInvoiceReport * @param OrderInjectable $order diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesInvoiceReportEntityTest.xml b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesInvoiceReportEntityTest.xml index 302c972e318331db3f49fe6eccbfee1fbbaf7042..66a1caf735b407989bd09228c88e7ebf166fc798 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesInvoiceReportEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesInvoiceReportEntityTest.xml @@ -8,8 +8,8 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Reports\Test\TestCase\SalesInvoiceReportEntityTest"> <variation name="SalesInvoiceReportEntityTestVariation1"> - <data name="order/dataSet" xsi:type="string">default</data> - <data name="order/data/price/preset" xsi:type="string">full_invoice</data> + <data name="order/dataset" xsi:type="string">default</data> + <data name="order/data/price/dataset" xsi:type="string">full_invoice</data> <data name="invoiceReport/report_type" xsi:type="string">Order Created</data> <data name="invoiceReport/period_type" xsi:type="string">Year</data> <data name="invoiceReport/from" xsi:type="string">m/d/Y 12:00 a-2 days</data> @@ -20,8 +20,8 @@ <constraint name="Magento\Reports\Test\Constraint\AssertInvoiceReportTotalResult" /> </variation> <variation name="SalesInvoiceReportEntityTestVariation2"> - <data name="order/dataSet" xsi:type="string">default</data> - <data name="order/data/price/preset" xsi:type="string">full_invoice</data> + <data name="order/dataset" xsi:type="string">default</data> + <data name="order/data/price/dataset" xsi:type="string">full_invoice</data> <data name="invoiceReport/report_type" xsi:type="string">Order Created</data> <data name="invoiceReport/period_type" xsi:type="string">Month</data> <data name="invoiceReport/from" xsi:type="string">m/d/Y</data> @@ -32,8 +32,8 @@ <constraint name="Magento\Reports\Test\Constraint\AssertInvoiceReportTotalResult" /> </variation> <variation name="SalesInvoiceReportEntityTestVariation3"> - <data name="order/dataSet" xsi:type="string">default</data> - <data name="order/data/price/preset" xsi:type="string">full_invoice</data> + <data name="order/dataset" xsi:type="string">default</data> + <data name="order/data/price/dataset" xsi:type="string">full_invoice</data> <data name="invoiceReport/report_type" xsi:type="string">Last Invoice Created Date</data> <data name="invoiceReport/period_type" xsi:type="string">Day</data> <data name="invoiceReport/from" xsi:type="string">m/d/Y</data> diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesOrderReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesOrderReportEntityTest.php index dc47c458487d41ed2e68e972cb8ef5dc76dd4ae9..ec395cc8e3fd6a3cb27e4188198d6482fc7de0ae 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesOrderReportEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesOrderReportEntityTest.php @@ -11,10 +11,6 @@ use Magento\Sales\Test\Fixture\OrderInjectable; use Magento\Mtf\TestCase\Injectable; /** - * Test Creation for SalesOrderReportEntity - * - * Test Flow: - * * Preconditions: * 1. Open Backend * 2. Go to Reports > Sales > Orders @@ -45,14 +41,14 @@ class SalesOrderReportEntityTest extends Injectable /* end tags */ /** - * Sales Report page + * Sales Report page. * * @var SalesReport */ protected $salesReport; /** - * Inject page + * Inject page. * * @param SalesReport $salesReport * @return void @@ -63,7 +59,7 @@ class SalesOrderReportEntityTest extends Injectable } /** - * Sales order report + * Sales order report. * * @param OrderInjectable $order * @param array $salesReport diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesOrderReportEntityTest.xml b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesOrderReportEntityTest.xml index 72c8854bdbb6994ff4334375bfaf17a913c67061..36c41bc4d4bdbcb0e3095b52eb4077bf659ce7c3 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesOrderReportEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesOrderReportEntityTest.xml @@ -8,8 +8,8 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Reports\Test\TestCase\SalesOrderReportEntityTest"> <variation name="SalesOrderReportEntityTestVariation1"> - <data name="order/dataSet" xsi:type="string">default</data> - <data name="order/data/price/preset" xsi:type="string">full_invoice</data> + <data name="order/dataset" xsi:type="string">default</data> + <data name="order/data/price/dataset" xsi:type="string">full_invoice</data> <data name="salesReport/report_type" xsi:type="string">Order Created</data> <data name="salesReport/period_type" xsi:type="string">Year</data> <data name="salesReport/from" xsi:type="string">m/d/Y 12:00 a-2 days</data> @@ -21,8 +21,8 @@ <constraint name="Magento\Reports\Test\Constraint\AssertSalesReportTotalResult" /> </variation> <variation name="SalesOrderReportEntityTestVariation2"> - <data name="order/dataSet" xsi:type="string">default</data> - <data name="order/data/price/preset" xsi:type="string">full_invoice</data> + <data name="order/dataset" xsi:type="string">default</data> + <data name="order/data/price/dataset" xsi:type="string">full_invoice</data> <data name="salesReport/report_type" xsi:type="string">Order Created</data> <data name="salesReport/period_type" xsi:type="string">Month</data> <data name="salesReport/from" xsi:type="string">m/d/Y</data> @@ -34,8 +34,8 @@ <constraint name="Magento\Reports\Test\Constraint\AssertSalesReportTotalResult" /> </variation> <variation name="SalesOrderReportEntityTestVariation3"> - <data name="order/dataSet" xsi:type="string">default</data> - <data name="order/data/price/preset" xsi:type="string">full_invoice</data> + <data name="order/dataset" xsi:type="string">default</data> + <data name="order/data/price/dataset" xsi:type="string">full_invoice</data> <data name="salesReport/report_type" xsi:type="string">Order Updated</data> <data name="salesReport/period_type" xsi:type="string">Day</data> <data name="salesReport/from" xsi:type="string">m/d/Y</data> diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesRefundsReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesRefundsReportEntityTest.php index 03e55d5e381935f9093dd59ba5c8a552e0fee53e..f174f4243cd5f2e978ebd2963725c5d9f565a380 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesRefundsReportEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesRefundsReportEntityTest.php @@ -11,10 +11,6 @@ use Magento\Sales\Test\Fixture\OrderInjectable; use Magento\Mtf\TestCase\Injectable; /** - * Test Creation for SalesRefundsReportEntity - * - * Test Flow: - * * Preconditions: * 1. Open Backend * 2. Go to Reports > Sales > Refunds @@ -29,7 +25,7 @@ use Magento\Mtf\TestCase\Injectable; * Steps: * 1. Go to backend * 2. Go to Reports > Sales > Refunds - * 3. Fill data from dataSet + * 3. Fill data from dataset * 4. Click button Show Report * 5. Perform Asserts * @@ -44,14 +40,14 @@ class SalesRefundsReportEntityTest extends Injectable /* end tags */ /** - * Refunds report page + * Refunds report page. * * @var RefundsReport */ protected $refundsReport; /** - * Inject pages + * Inject pages. * * @param RefundsReport $refundsReport * @return void @@ -62,7 +58,7 @@ class SalesRefundsReportEntityTest extends Injectable } /** - * Refunds report + * Refunds report. * * @param OrderInjectable $order * @param array $refundsReport diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesRefundsReportEntityTest.xml b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesRefundsReportEntityTest.xml index 682ab24c2ca14d088bb02459978a3802b2fec274..6940f00d89337bd5ed1502c76d22f20a32cd1356 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesRefundsReportEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesRefundsReportEntityTest.xml @@ -9,8 +9,8 @@ <testCase name="Magento\Reports\Test\TestCase\SalesRefundsReportEntityTest"> <variation name="SalesRefundsReportEntityTestVariation1"> <data name="description" xsi:type="string">assert refunds year report</data> - <data name="order/dataSet" xsi:type="string">default</data> - <data name="order/data/price/preset" xsi:type="string">full_invoice</data> + <data name="order/dataset" xsi:type="string">default</data> + <data name="order/data/price/dataset" xsi:type="string">full_invoice</data> <data name="refundsReport/report_type" xsi:type="string">Order Created</data> <data name="refundsReport/period_type" xsi:type="string">Year</data> <data name="refundsReport/from" xsi:type="string">m/d/Y 12:00 a-2 days</data> @@ -21,8 +21,8 @@ </variation> <variation name="SalesRefundsReportEntityTestVariation2"> <data name="description" xsi:type="string">assert refunds month report</data> - <data name="order/dataSet" xsi:type="string">default</data> - <data name="order/data/price/preset" xsi:type="string">full_invoice</data> + <data name="order/dataset" xsi:type="string">default</data> + <data name="order/data/price/dataset" xsi:type="string">full_invoice</data> <data name="refundsReport/report_type" xsi:type="string">Order Created</data> <data name="refundsReport/period_type" xsi:type="string">Month</data> <data name="refundsReport/from" xsi:type="string">m/d/Y</data> @@ -33,8 +33,8 @@ </variation> <variation name="SalesRefundsReportEntityTestVariation3"> <data name="description" xsi:type="string">assert refund Daily report</data> - <data name="order/dataSet" xsi:type="string">default</data> - <data name="order/data/price/preset" xsi:type="string">full_invoice</data> + <data name="order/dataset" xsi:type="string">default</data> + <data name="order/data/price/dataset" xsi:type="string">full_invoice</data> <data name="refundsReport/report_type" xsi:type="string">Last Credit Memo Created Date</data> <data name="refundsReport/period_type" xsi:type="string">Day</data> <data name="refundsReport/from" xsi:type="string">m/d/Y</data> diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesTaxReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesTaxReportEntityTest.php index d9b0e19e90043d87fb459c4111bbdf803ddebf80..84d96da76d4f5db7f6b9c287d76d9f7ce9cb9247 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesTaxReportEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesTaxReportEntityTest.php @@ -28,7 +28,7 @@ use Magento\Mtf\TestCase\Injectable; * Steps: * 1. Login to backend. * 2. Go to Reports > Sales > Tax. - * 3. Fill data from dataSet. + * 3. Fill data from dataset. * 4. Click "Show report". * 5. Perform all assertions. * diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesTaxReportEntityTest.xml b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesTaxReportEntityTest.xml index 6448cc2b7fcd36903e791fe5f96df2b518f7bc19..4010b2753be8fffb9f008260bcedfa82a8e8b9c0 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesTaxReportEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesTaxReportEntityTest.xml @@ -9,8 +9,8 @@ <testCase name="Magento\Reports\Test\TestCase\SalesTaxReportEntityTest"> <variation name="SalesTaxReportEntityTestVariation1"> <data name="orderSteps" xsi:type="string">-</data> - <data name="taxRule/dataSet" xsi:type="string">custom_rule</data> - <data name="order/dataSet" xsi:type="string">default</data> + <data name="taxRule/dataset" xsi:type="string">custom_rule</data> + <data name="order/dataset" xsi:type="string">default</data> <data name="orderStatus" xsi:type="string">Pending</data> <data name="report/report_type" xsi:type="string">Order Created</data> <data name="report/period_type" xsi:type="string">Day</data> @@ -23,8 +23,8 @@ </variation> <variation name="SalesTaxReportEntityTestVariation2"> <data name="orderSteps" xsi:type="string">invoice</data> - <data name="taxRule/dataSet" xsi:type="string">custom_rule</data> - <data name="order/dataSet" xsi:type="string">default</data> + <data name="taxRule/dataset" xsi:type="string">custom_rule</data> + <data name="order/dataset" xsi:type="string">default</data> <data name="orderStatus" xsi:type="string">Processing</data> <data name="report/report_type" xsi:type="string">Order Created</data> <data name="report/period_type" xsi:type="string">Month</data> @@ -38,8 +38,8 @@ </variation> <variation name="SalesTaxReportEntityTestVariation3"> <data name="orderSteps" xsi:type="string">invoice,shipment</data> - <data name="taxRule/dataSet" xsi:type="string">custom_rule</data> - <data name="order/dataSet" xsi:type="string">default</data> + <data name="taxRule/dataset" xsi:type="string">custom_rule</data> + <data name="order/dataset" xsi:type="string">default</data> <data name="orderStatus" xsi:type="string">Complete</data> <data name="report/report_type" xsi:type="string">Order Updated</data> <data name="report/period_type" xsi:type="string">Year</data> diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SearchTermsReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SearchTermsReportEntityTest.php index eba901312b7964fc68c1520c885529aee0c6297b..7321dcaf84aff3cfa8c4c7aa090dedb67f89f0eb 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SearchTermsReportEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SearchTermsReportEntityTest.php @@ -12,7 +12,6 @@ use Magento\Mtf\Fixture\FixtureFactory; use Magento\Mtf\TestCase\Injectable; /** - * Test Flow: * Preconditions: * 1. Products is created. * @@ -102,7 +101,7 @@ class SearchTermsReportEntityTest extends Injectable for ($i = 0; $i < $countProduct; $i++) { $productFixture = $this->fixtureFactory->createByCode( 'catalogProductSimple', - ['dataSet' => $product, 'data' => ['name' => $name]] + ['dataset' => $product, 'data' => ['name' => $name]] ); $productFixture->persist(); } diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SearchTermsReportEntityTest.xml b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SearchTermsReportEntityTest.xml index b3ffcb9746fa59f6ffc5affba0048d0f2a4d1894..6a4aef2eea91fa77af1e3b404660094b58316f48 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SearchTermsReportEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SearchTermsReportEntityTest.xml @@ -6,20 +6,20 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\Reports\Test\TestCase\SearchTermsReportEntityTest"> - <variation name="SearchTermsReportEntityTestVariation1"> - <data name="product" xsi:type="string">product_with_url_key</data> - <data name="countProducts" xsi:type="string">1</data> - <data name="countSearch" xsi:type="string">2</data> - <constraint name="Magento\Reports\Test\Constraint\AssertSearchTermsInGrid"/> - <constraint name="Magento\Reports\Test\Constraint\AssertSearchTermReportForm"/> - </variation> - <variation name="SearchTermsReportEntityTestVariation2"> - <data name="product" xsi:type="string">product_with_url_key</data> - <data name="countProducts" xsi:type="string">3</data> - <data name="countSearch" xsi:type="string">1</data> - <constraint name="Magento\Reports\Test\Constraint\AssertSearchTermsInGrid"/> - <constraint name="Magento\Reports\Test\Constraint\AssertSearchTermReportForm"/> - </variation> - </testCase> + <testCase name="Magento\Reports\Test\TestCase\SearchTermsReportEntityTest"> + <variation name="SearchTermsReportEntityTestVariation1"> + <data name="product" xsi:type="string">product_with_url_key</data> + <data name="countProducts" xsi:type="string">1</data> + <data name="countSearch" xsi:type="string">2</data> + <constraint name="Magento\Reports\Test\Constraint\AssertSearchTermsInGrid" /> + <constraint name="Magento\Reports\Test\Constraint\AssertSearchTermReportForm" /> + </variation> + <variation name="SearchTermsReportEntityTestVariation2"> + <data name="product" xsi:type="string">product_with_url_key</data> + <data name="countProducts" xsi:type="string">3</data> + <data name="countSearch" xsi:type="string">1</data> + <constraint name="Magento\Reports\Test\Constraint\AssertSearchTermsInGrid" /> + <constraint name="Magento\Reports\Test\Constraint\AssertSearchTermReportForm" /> + </variation> + </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest.php index af35c7178b0a0fb24b832e7a13d167a22fe5d9b9..6a75582c9a76c7990bab54c1634aa83037147419 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest.php @@ -13,7 +13,6 @@ use Magento\Reports\Test\Page\Adminhtml\ProductReportView; use Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex; /** - * Test Flow: * Preconditions: * 1. Create products * 2. Open product page on frontend @@ -121,7 +120,7 @@ class ViewedProductsReportEntityTest extends Injectable $products = []; foreach ($productsData as $productConfig) { $product = explode('::', $productConfig); - $productFixture = $this->fixtureFactory->createByCode($product[0], ['dataSet' => $product[1]]); + $productFixture = $this->fixtureFactory->createByCode($product[0], ['dataset' => $product[1]]); $productFixture->persist(); $products[] = $productFixture; } diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest.xml b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest.xml index b0d0b350efa711f84fc0addab09a1e5dc7b6f95f..849c0625dd6b23257fdaf28315107b968b3dcd79 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest.xml @@ -22,7 +22,7 @@ <data name="total" xsi:type="string">1, 1</data> <data name="products" xsi:type="string">downloadableProduct::default, bundleProduct::bundle_dynamic_product</data> <data name="viewsReport/period_type" xsi:type="string">Month</data> - <data name="viewsReport/from" xsi:type="string">m/d/Y - 1 month</data> + <data name="viewsReport/from" xsi:type="string">m/d/Y -1 month</data> <data name="viewsReport/to" xsi:type="string">m/d/Y</data> <data name="viewsReport/show_empty_rows" xsi:type="string">No</data> <constraint name="Magento\Reports\Test\Constraint\AssertProductViewsReportTotalResult" /> diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Fixture/Rating.xml b/dev/tests/functional/tests/app/Magento/Review/Test/Fixture/Rating.xml index d551947d8c420dd84ac3396c240ec9bf0d140a76..4eb0c4f5dd9b29fe1dac349b4c07db8ed0fd9a5a 100755 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Fixture/Rating.xml +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Fixture/Rating.xml @@ -6,30 +6,21 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="rating" module="Magento_Review" type="flat" entity_type="rating" collection="Magento\Review\Model\Resource\Rating\Collection" identifier="rating_code" repository_class="Magento\Review\Test\Repository\Rating" handler_interface="Magento\Review\Test\Handler\Rating\RatingInterface" class="Magento\Review\Test\Fixture\Rating"> - <dataset name="default"> - <field name="rating_code" xsi:type="string">Rating %isolation%</field> - <field name="stores" xsi:type="string">Main Website/Main Website Store/Default Store View</field> - <field name="is_active" xsi:type="string">Yes</field> - </dataset> - <field name="rating_id" is_required="1"> - <default_value xsi:type="null"/> - </field> - <field name="entity_id" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="rating_code" is_required="" group="rating_information"> - <default_value xsi:type="string">Rating %isolation%</default_value> - </field> - <field name="position" is_required="" group="rating_information"> - <default_value xsi:type="number">0</default_value> - </field> - <field name="is_active" is_required="" group="rating_information"> - <default_value xsi:type="string">Yes</default_value> - </field> - <field name="stores" group="rating_information"> - <default_value xsi:type="string">Main Website/Main Website Store/Default Store View</default_value> - </field> - <field name="options" group="rating_information"/> - </fixture> + <fixture name="rating" + module="Magento_Review" + type="flat" + entity_type="rating" + collection="Magento\Review\Model\Resource\Rating\Collection" + identifier="rating_code" + repository_class="Magento\Review\Test\Repository\Rating" + handler_interface="Magento\Review\Test\Handler\Rating\RatingInterface" + class="Magento\Review\Test\Fixture\Rating"> + <field name="rating_id" is_required="1" /> + <field name="entity_id" is_required="" /> + <field name="rating_code" is_required="" group="rating_information" /> + <field name="position" is_required="" group="rating_information" /> + <field name="is_active" is_required="" group="rating_information" /> + <field name="stores" group="rating_information" /> + <field name="options" group="rating_information" /> + </fixture> </config> diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Fixture/Review.xml b/dev/tests/functional/tests/app/Magento/Review/Test/Fixture/Review.xml index a118552b4f5c6c97ee8523795f77d6e8b4d79d5b..41d99fc38a70e1c4c4466803a60633fb0e522404 100755 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Fixture/Review.xml +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Fixture/Review.xml @@ -6,76 +6,26 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="review" module="Magento_Review" type="composite" collection="Magento\Review\Model\Resource\Review\Collection" repository_class="Magento\Review\Test\Repository\Review" handler_interface="Magento\Review\Test\Handler\Review\ReviewInterface" class="Magento\Review\Test\Fixture\Review"> - <dataset name="default"> - <field name="status_id" xsi:type="string">Approved</field> - <field name="select_stores" xsi:type="array"> - <item name="0" xsi:type="string">Main Website/Main Website Store/Default Store View</item> - </field> - <field name="nickname" xsi:type="string">Guest customer %isolation%</field> - <field name="title" xsi:type="string">Summary review %isolation%</field> - <field name="detail" xsi:type="string">Text review %isolation%</field> - <field name="ratings" xsi:type="array"> - <item name="0" xsi:type="array"> - <item name="dataSet" xsi:type="string">visibleOnDefaultWebsite</item> - <item name="rating" xsi:type="string">4</item> - </item> - </field> - <field name="entity_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">catalogProductSimple::default</item> - </field> - <field name="type" xsi:type="string">Administrator</field> - </dataset> - <field name="review_id" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="created_at" is_required=""> - <default_value xsi:type="string">CURRENT_TIMESTAMP</default_value> - </field> - <field name="entity_id" is_required="" source="Magento\Review\Test\Fixture\Review\EntityId"> - <default_value xsi:type="array"> - <item name="dataSet" xsi:type="string">catalogProductSimple::default</item> - </default_value> - </field> - <field name="entity_pk_value" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="status_id" is_required=""> - <default_value xsi:type="string">Approved</default_value> - </field> - <field name="detail_id" is_required="1"> - <default_value xsi:type="null"/> - </field> - <field name="store_id" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="title" is_required=""> - <default_value xsi:type="string">Summary review %isolation%</default_value> - </field> - <field name="detail" is_required=""> - <default_value xsi:type="string">Text review %isolation%</default_value> - </field> - <field name="nickname" is_required=""> - <default_value xsi:type="string">Guest customer %isolation%</default_value> - </field> - <field name="customer_id" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="select_stores" is_required="1"> - <default_value xsi:type="array"> - <item name="0" xsi:type="string">Main Website/Main Website Store/Default Store View</item> - </default_value> - </field> - <field name="ratings" source="Magento\Review\Test\Fixture\Review\Ratings"> - <default_value xsi:type="array"> - <item name="0" xsi:type="array"> - <item name="dataSet" xsi:type="string">visibleOnDefaultWebsite</item> - <item name="rating" xsi:type="number">4</item> - </item> - </default_value> - </field> - <field name="type" is_required=""> - <default_value xsi:type="string">Administrator</default_value> - </field> - </fixture> + <fixture name="review" + module="Magento_Review" + type="composite" + collection="Magento\Review\Model\Resource\Review\Collection" + repository_class="Magento\Review\Test\Repository\Review" + handler_interface="Magento\Review\Test\Handler\Review\ReviewInterface" + class="Magento\Review\Test\Fixture\Review"> + <field name="review_id" is_required="" /> + <field name="created_at" is_required="" /> + <field name="entity_id" is_required="" source="Magento\Review\Test\Fixture\Review\EntityId" /> + <field name="entity_pk_value" is_required="" /> + <field name="status_id" is_required="" /> + <field name="detail_id" is_required="1" /> + <field name="store_id" is_required="" /> + <field name="title" is_required="" /> + <field name="detail" is_required="" /> + <field name="nickname" is_required="" /> + <field name="customer_id" is_required="" /> + <field name="select_stores" is_required="1" /> + <field name="ratings" source="Magento\Review\Test\Fixture\Review\Ratings" /> + <field name="type" is_required="" /> + </fixture> </config> diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Fixture/Review/EntityId.php b/dev/tests/functional/tests/app/Magento/Review/Test/Fixture/Review/EntityId.php index 6dd94f98ea9058931abac6c1bf9168e3219a5dfb..9b1d81495afbd85a15ceb16379911e15a0f965cc 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Fixture/Review/EntityId.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Fixture/Review/EntityId.php @@ -6,32 +6,17 @@ namespace Magento\Review\Test\Fixture\Review; +use Magento\Mtf\Fixture\DataSource; use Magento\Mtf\Fixture\FixtureFactory; use Magento\Mtf\Fixture\FixtureInterface; -use Magento\Mtf\Fixture\InjectableFixture; /** - * Class EntityId - * Source for entity id fixture + * Source for entity id fixture. */ -class EntityId extends InjectableFixture +class EntityId extends DataSource { /** - * Configuration settings - * - * @var array - */ - protected $params; - - /** - * Id of the created entity - * - * @var int - */ - protected $data = null; - - /** - * The created entity + * The created entity. * * @var FixtureInterface */ @@ -47,9 +32,9 @@ class EntityId extends InjectableFixture { $this->params = $params; - if (isset($data['dataSet'])) { - list($typeFixture, $dataSet) = explode('::', $data['dataSet']); - $fixture = $fixtureFactory->createByCode($typeFixture, ['dataSet' => $dataSet]); + if (isset($data['dataset'])) { + list($typeFixture, $dataset) = explode('::', $data['dataset']); + $fixture = $fixtureFactory->createByCode($typeFixture, ['dataset' => $dataset]); if (!$fixture->hasData('id')) { $fixture->persist(); } @@ -60,40 +45,7 @@ class EntityId extends InjectableFixture } /** - * Persist data - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return id of the created entity - * - * @param string|null $key [optional] - * @return int - * - * @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 entity + * Get entity. * * @return FixtureInterface|null */ diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Fixture/Review/Ratings.php b/dev/tests/functional/tests/app/Magento/Review/Test/Fixture/Review/Ratings.php index c19487164c89538afe84d304cf024eada95ae6f4..122894c6c7fc49769efe100f8b650c821d8c4298 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Fixture/Review/Ratings.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Fixture/Review/Ratings.php @@ -6,32 +6,17 @@ namespace Magento\Review\Test\Fixture\Review; +use Magento\Mtf\Fixture\DataSource; use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Mtf\Fixture\FixtureInterface; use Magento\Review\Test\Fixture\Rating; /** - * Class Ratings - * Source for product ratings fixture + * Source for product ratings fixture. */ -class Ratings implements FixtureInterface +class Ratings extends DataSource { /** - * Configuration settings of fixture - * - * @var array - */ - protected $params; - - /** - * Data of the created ratings - * - * @var array - */ - protected $data = []; - - /** - * List of the created ratings + * List of the created ratings. * * @var array */ @@ -50,8 +35,8 @@ class Ratings implements FixtureInterface $fixtureRating = null; foreach ($data as $rating) { - if (isset($rating['dataSet'])) { - $fixtureRating = $fixtureFactory->createByCode('rating', ['dataSet' => $rating['dataSet']]); + if (isset($rating['dataset'])) { + $fixtureRating = $fixtureFactory->createByCode('rating', ['dataset' => $rating['dataset']]); if (!$fixtureRating->hasData('rating_id')) { $fixtureRating->persist(); } @@ -70,40 +55,7 @@ class Ratings implements FixtureInterface } /** - * Persist data - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set - * - * @param string|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; - } - - /** - * Get ratings + * Get ratings. * * @return array */ diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Repository/Review.php b/dev/tests/functional/tests/app/Magento/Review/Test/Repository/Review.php index 537245718b6494350a66442f09d19dd2fa8e8d61..5b3ae814f05f337c7dfe1f506b10f3a8697930b6 100755 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Repository/Review.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Repository/Review.php @@ -32,11 +32,11 @@ class Review extends AbstractRepository 'detail' => 'review_detail_%isolation%', 'ratings' => [ [ - 'dataSet' => 'visibleOnDefaultWebsite', + 'dataset' => 'visibleOnDefaultWebsite', 'rating' => mt_rand(1, 5) ] ], - 'entity_id' => ['dataSet' => 'catalogProductSimple::default'] + 'entity_id' => ['dataset' => 'catalogProductSimple::default'] ]; $this->_data['frontend_review'] = [ @@ -45,7 +45,7 @@ class Review extends AbstractRepository 'nickname' => 'nickname_%isolation%', 'title' => 'title_%isolation%', 'detail' => 'review_detail_%isolation%', - 'entity_id' => ['dataSet' => 'catalogProductSimple::default'] + 'entity_id' => ['dataset' => 'catalogProductSimple::default'] ]; } } diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Repository/Review.xml b/dev/tests/functional/tests/app/Magento/Review/Test/Repository/Review.xml index 3b9bf8f267818ef6d46eba1dde794be4f778bcfc..d4b841bdd2c217bc4f6f1f03eee6f24eb378480c 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Repository/Review.xml +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Repository/Review.xml @@ -7,6 +7,26 @@ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> <repository class="Magento\Review\Test\Repository\Review"> + <dataset name="default"> + <field name="status_id" xsi:type="string">Approved</field> + <field name="select_stores" xsi:type="array"> + <item name="0" xsi:type="string">Main Website/Main Website Store/Default Store View</item> + </field> + <field name="nickname" xsi:type="string">Guest customer %isolation%</field> + <field name="title" xsi:type="string">Summary review %isolation%</field> + <field name="detail" xsi:type="string">Text review %isolation%</field> + <field name="ratings" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="dataset" xsi:type="string">visibleOnDefaultWebsite</item> + <item name="rating" xsi:type="string">4</item> + </item> + </field> + <field name="entity_id" xsi:type="array"> + <item name="dataset" xsi:type="string">catalogProductSimple::default</item> + </field> + <field name="type" xsi:type="string">Administrator</field> + </dataset> + <dataset name="review_for_simple_product_with_rating"> <field name="status_id" xsi:type="string">Approved</field> <field name="select_stores" xsi:type="array"> @@ -17,12 +37,12 @@ <field name="detail" xsi:type="string">review_detail_%isolation%</field> <field name="ratings" xsi:type="array"> <item name="0" xsi:type="array"> - <item name="dataSet" xsi:type="string">visibleOnDefaultWebsite</item> + <item name="dataset" xsi:type="string">visibleOnDefaultWebsite</item> <item name="rating" xsi:type="string">5</item> </item> </field> <field name="entity_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">catalogProductSimple::default</item> + <item name="dataset" xsi:type="string">catalogProductSimple::default</item> </field> </dataset> @@ -35,7 +55,7 @@ <field name="title" xsi:type="string">title_%isolation%</field> <field name="detail" xsi:type="string">review_detail_%isolation%</field> <field name="entity_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">catalogProductSimple::default</item> + <item name="dataset" xsi:type="string">catalogProductSimple::default</item> </field> </dataset> </repository> diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductRatingEntityTest.php b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductRatingEntityTest.php index aff4c995ddb807f1fa395feb7ad0feea5c6ffe59..c1e5de868dfbd18beb1d674867e74476da7c79b1 100755 --- a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductRatingEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductRatingEntityTest.php @@ -67,7 +67,7 @@ class CreateProductRatingEntityTest extends Injectable */ public function __prepare(FixtureFactory $fixtureFactory) { - $product = $fixtureFactory->createByCode('catalogProductSimple', ['dataSet' => 'default']); + $product = $fixtureFactory->createByCode('catalogProductSimple', ['dataset' => 'default']); $product->persist(); return ['product' => $product]; diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewBackendEntityTest.xml b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewBackendEntityTest.xml index ee97d7bb2149563e0583afbb7328d09cf1189a3b..476353bb9203e9c91c63c8be24d3981bf717bc28 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewBackendEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewBackendEntityTest.xml @@ -8,10 +8,10 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Review\Test\TestCase\CreateProductReviewBackendEntityTest"> <variation name="CreateProductReviewBackendEntityTestVariation1"> - <data name="review/data/entity_id/dataSet" xsi:type="string">catalogProductSimple::default</data> + <data name="review/data/entity_id/dataset" xsi:type="string">catalogProductSimple::default</data> <data name="review/data/status_id" xsi:type="string">Approved</data> <data name="review/data/select_stores/0" xsi:type="string">Main Website/Main Website Store/Default Store View</data> - <data name="review/data/ratings/rating_0/dataSet" xsi:type="string">visibleOnDefaultWebsite</data> + <data name="review/data/ratings/rating_0/dataset" xsi:type="string">visibleOnDefaultWebsite</data> <data name="review/data/ratings/rating_0/rating" xsi:type="string">3</data> <data name="review/data/nickname" xsi:type="string">John</data> <data name="review/data/title" xsi:type="string">title %isolation%</data> @@ -21,10 +21,10 @@ <constraint name="Magento\Review\Test\Constraint\AssertProductRatingInProductPage" /> </variation> <variation name="CreateProductReviewBackendEntityTestVariation2"> - <data name="review/data/entity_id/dataSet" xsi:type="string">catalogProductSimple::default</data> + <data name="review/data/entity_id/dataset" xsi:type="string">catalogProductSimple::default</data> <data name="review/data/status_id" xsi:type="string">Pending</data> <data name="review/data/select_stores/0" xsi:type="string">Main Website/Main Website Store/Default Store View</data> - <data name="review/data/ratings/rating_0/dataSet" xsi:type="string">visibleOnDefaultWebsite</data> + <data name="review/data/ratings/rating_0/dataset" xsi:type="string">visibleOnDefaultWebsite</data> <data name="review/data/ratings/rating_0/rating" xsi:type="string">4</data> <data name="review/data/nickname" xsi:type="string">Britney</data> <data name="review/data/title" xsi:type="string">title %isolation%</data> @@ -34,10 +34,10 @@ <constraint name="Magento\Review\Test\Constraint\AssertProductRatingInProductPage" /> </variation> <variation name="CreateProductReviewBackendEntityTestVariation3"> - <data name="review/data/entity_id/dataSet" xsi:type="string">catalogProductSimple::default</data> + <data name="review/data/entity_id/dataset" xsi:type="string">catalogProductSimple::default</data> <data name="review/data/status_id" xsi:type="string">Not Approved</data> <data name="review/data/select_stores/0" xsi:type="string">Main Website/Main Website Store/Default Store View</data> - <data name="review/data/ratings/rating_0/dataSet" xsi:type="string">visibleOnDefaultWebsite</data> + <data name="review/data/ratings/rating_0/dataset" xsi:type="string">visibleOnDefaultWebsite</data> <data name="review/data/ratings/rating_0/rating" xsi:type="string">5</data> <data name="review/data/nickname" xsi:type="string">Michael</data> <data name="review/data/title" xsi:type="string">title %isolation%</data> diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewFrontendEntityTest.php b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewFrontendEntityTest.php index 4345551308dc988c5c2e5258fd701978707ec504..31963f958f15ea394dd5bc933534c76e189d7442 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewFrontendEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewFrontendEntityTest.php @@ -25,7 +25,7 @@ use Magento\Mtf\TestCase\Injectable; * 1. Open frontend. * 2. Go to product page. * 3. Click "Be the first to review this product". - * 4. Fill data according to dataSet. + * 4. Fill data according to dataset. * 5. click "Submit review". * 6. Perform all assertions. * diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewFrontendEntityTest.xml b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewFrontendEntityTest.xml index ee9096bce936c26452574d0d8362293f90933c68..04bbcfef97c57b50e556ac783c80e22345c9a174 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewFrontendEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewFrontendEntityTest.xml @@ -13,9 +13,9 @@ <data name="review/data/nickname" xsi:type="string">name_%isolation%</data> <data name="review/data/title" xsi:type="string">title_%isolation%</data> <data name="review/data/detail" xsi:type="string">review_%isolation%</data> - <data name="review/data/ratings/1/dataSet" xsi:type="string">visibleOnDefaultWebsite</data> + <data name="review/data/ratings/1/dataset" xsi:type="string">visibleOnDefaultWebsite</data> <data name="review/data/ratings/1/rating" xsi:type="string">4</data> - <data name="review/data/entity_id/dataSet" xsi:type="string">catalogProductSimple::default</data> + <data name="review/data/entity_id/dataset" xsi:type="string">catalogProductSimple::default</data> <constraint name="Magento\Review\Test\Constraint\AssertReviewCreationSuccessMessage" /> <constraint name="Magento\Review\Test\Constraint\AssertProductReviewInGrid" /> <constraint name="Magento\Review\Test\Constraint\AssertProductRatingOnReviewPage" /> @@ -27,7 +27,7 @@ <data name="review/data/nickname" xsi:type="string">name_%isolation%</data> <data name="review/data/title" xsi:type="string">title_%isolation%</data> <data name="review/data/detail" xsi:type="string">review_%isolation%</data> - <data name="review/data/entity_id/dataSet" xsi:type="string">catalogProductSimple::default</data> + <data name="review/data/entity_id/dataset" xsi:type="string">catalogProductSimple::default</data> <data name="tag" xsi:type="string">test_type:acceptance_test</data> <constraint name="Magento\Review\Test\Constraint\AssertReviewCreationSuccessMessage" /> <constraint name="Magento\Review\Test\Constraint\AssertProductReviewIsAbsentOnProductPage" /> diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/DeleteProductRatingEntityTest.php b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/DeleteProductRatingEntityTest.php index 129b383ffe285a0684b215c2718e5acb9ed73a73..0706a383cdf9fb3307f06437f9bc95cb9dbe3b0d 100755 --- a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/DeleteProductRatingEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/DeleteProductRatingEntityTest.php @@ -56,7 +56,7 @@ class DeleteProductRatingEntityTest extends Injectable */ public function __prepare(FixtureFactory $fixtureFactory) { - $product = $fixtureFactory->createByCode('catalogProductSimple', ['dataSet' => 'default']); + $product = $fixtureFactory->createByCode('catalogProductSimple', ['dataset' => 'default']); $product->persist(); return ['product' => $product]; diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/DeleteProductRatingEntityTest.xml b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/DeleteProductRatingEntityTest.xml index e9e63c56232ca7430b29ab8378cff1823e8beb5f..3c134bab6d15035e185b92bed17a3d8aadb15da0 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/DeleteProductRatingEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/DeleteProductRatingEntityTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Review\Test\TestCase\DeleteProductRatingEntityTest"> <variation name="DeleteProductRatingEntityTestVariation1"> - <data name="productRating/dataSet" xsi:type="string">default</data> + <data name="productRating/dataset" xsi:type="string">default</data> <constraint name="Magento\Review\Test\Constraint\AssertProductRatingSuccessDeleteMessage"/> <constraint name="Magento\Review\Test\Constraint\AssertProductRatingNotInGrid"/> <constraint name="Magento\Review\Test\Constraint\AssertProductRatingNotInProductPage"/> diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/ModerateProductReviewEntityTest.xml b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/ModerateProductReviewEntityTest.xml index 0efdc08ef19dcd2561797818487fe4767ba36326..309624db2a3b60deb92ceebc08900e78dc928528 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/ModerateProductReviewEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/ModerateProductReviewEntityTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Review\Test\TestCase\ModerateProductReviewEntityTest"> <variation name="ModerateProductReviewEntityTestVariation1"> - <data name="reviewInitial/dataSet" xsi:type="string">frontend_review</data> + <data name="reviewInitial/dataset" xsi:type="string">frontend_review</data> <data name="review/data/status_id" xsi:type="string">Approved</data> <data name="review/data/nickname" xsi:type="string">Nick%isolation%</data> <data name="review/data/title" xsi:type="string">Title %isolation%</data> @@ -18,7 +18,7 @@ <constraint name="Magento\Review\Test\Constraint\AssertProductReviewOnProductPage"/> </variation> <variation name="ModerateProductReviewEntityTestVariation2"> - <data name="reviewInitial/dataSet" xsi:type="string">frontend_review</data> + <data name="reviewInitial/dataset" xsi:type="string">frontend_review</data> <data name="review/data/status_id" xsi:type="string">Not Approved</data> <data name="review/data/nickname" xsi:type="string">Nick%isolation%</data> <data name="review/data/title" xsi:type="string">Title %isolation%</data> diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/UpdateProductReviewEntityOnProductPageTest.php b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/UpdateProductReviewEntityOnProductPageTest.php index 28dff5a865f3726dd66539c473101a8fd193f982..b5ff135352ebeb0a9cfaa776b7fec0feaebd924a 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/UpdateProductReviewEntityOnProductPageTest.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/UpdateProductReviewEntityOnProductPageTest.php @@ -28,7 +28,7 @@ use Magento\Mtf\TestCase\Injectable; * 2. Search and open product from preconditions * 3. Open Review tab * 4. Search and open review created in preconditions - * 5. Fill data according to dataSet + * 5. Fill data according to dataset * 6. Save changes * 7. Perform all assertions * @@ -95,7 +95,7 @@ class UpdateProductReviewEntityOnProductPageTest extends Injectable { $this->reviewInitial = $fixtureFactory->createByCode( 'review', - ['dataSet' => 'review_for_simple_product_with_rating'] + ['dataset' => 'review_for_simple_product_with_rating'] ); $this->reviewInitial->persist(); $this->fixtureFactory = $fixtureFactory; diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/UpdateProductReviewEntityTest.xml b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/UpdateProductReviewEntityTest.xml index 684b093219193d1af5ff97b2edcfc2a1f7e0e767..12a7623476b4fa3f402bcedb69b28cf54e7762d6 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/UpdateProductReviewEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/UpdateProductReviewEntityTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Review\Test\TestCase\UpdateProductReviewEntityTest"> <variation name="UpdateProductReviewEntityTestVariation1"> - <data name="reviewInitial/dataSet" xsi:type="string">review_for_simple_product_with_rating</data> + <data name="reviewInitial/dataset" xsi:type="string">review_for_simple_product_with_rating</data> <data name="review/data/nickname" xsi:type="string">name_upd_%isolation%</data> <data name="review/data/title" xsi:type="string">title_upd_%isolation%</data> <data name="review/data/detail" xsi:type="string">review_upd_%isolation%</data> diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create.php index ed403d78e22b909b309137d3cb95d9d5aa1b91df..6eb392b6d8ccf2f7580308e690e3c6a64a8afd5a 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create.php @@ -234,8 +234,7 @@ class Create extends Block ['element' => $this->_rootElement->find($this->itemsBlock)] ); foreach ($products as $product) { - $items->getItemProductByName($product->getName()) - ->fill($product->getDataFieldConfig('checkout_data')['source']); + $items->getItemProductByName($product->getName())->fillCheckoutData($product->getCheckoutData()); } $this->updateItems(); } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Items/ItemProduct.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Items/ItemProduct.php index 406aa612ce94d52922ed0123f9ef895386a7558a..9eed5cedd976840462ed00102d801608011c56d7 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Items/ItemProduct.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Items/ItemProduct.php @@ -8,7 +8,6 @@ namespace Magento\Sales\Test\Block\Adminhtml\Order\Create\Items; use Magento\Mtf\Block\Form; use Magento\Mtf\Client\Locator; -use Magento\Mtf\Fixture\FixtureInterface; use Magento\Mtf\Client\Element\SimpleElement; /** @@ -78,15 +77,14 @@ class ItemProduct extends Form } /** - * Fill the root form. + * Fill the root form with checkout data. * - * @param FixtureInterface $fixture + * @param array $data * @param SimpleElement|null $element * @return $this */ - public function fill(FixtureInterface $fixture, SimpleElement $element = null) + public function fillCheckoutData(array $data, SimpleElement $element = null) { - $data = $fixture->getData(); if (isset($data['cartItem'])) { unset($data['cartItem']); } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Grid.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Grid.php index ec2f37205a20d30340f86626c890b11b6b1bedde..8edbfb720f70923331a9af8cd1d2f6c0581e34d6 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Grid.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Grid.php @@ -81,10 +81,12 @@ class Grid extends DataGrid * * @var string */ - protected $firstRowSelector = '//tbody/tr[1]//a'; + protected $firstRowSelector = '//tbody/tr[1]/td[contains(@class,"data-grid-actions-cell")]/a'; /** * Start to create new order. + * + * @return void */ public function addNewOrder() { diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderButtonsUnavailable.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderButtonsUnavailable.php index 445ff602c8a826e41556535aeccf5da9743aee31..1c16624c4290e5aa4bd738be35a3bd89ffe31d3d 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderButtonsUnavailable.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderButtonsUnavailable.php @@ -12,12 +12,12 @@ use Magento\Sales\Test\Page\Adminhtml\SalesOrderView; use Magento\Mtf\Constraint\AbstractConstraint; /** - * Assert that buttons from dataSet are not present on page + * Assert that buttons from dataset are not present on page */ class AssertOrderButtonsUnavailable extends AbstractConstraint { /** - * Assert that buttons from dataSet are not present on page + * Assert that buttons from dataset are not present on page * * @param OrderIndex $orderIndex * @param SalesOrderView $salesOrderView @@ -54,6 +54,6 @@ class AssertOrderButtonsUnavailable extends AbstractConstraint */ public function toString() { - return 'Buttons from dataSet are not present on order page.'; + return 'Buttons from dataset are not present on order page.'; } } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Fixture/OrderInjectable.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Fixture/OrderInjectable.xml index e5e9d7d6f475e3953fa063dc2ef4d0bebcb0241e..d65cebe5a9456418ddd06cb45c6c2bb7d8f023e6 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Fixture/OrderInjectable.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Fixture/OrderInjectable.xml @@ -6,613 +6,205 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="orderInjectable" module="Magento_Sales" type="flat" entity_type="sales_order" collection="Magento\Sales\Model\Resource\Order\Collection" identifier="" repository_class="Magento\Sales\Test\Repository\OrderInjectable" handler_interface="Magento\Sales\Test\Handler\OrderInjectable\OrderInjectableInterface" class="Magento\Sales\Test\Fixture\OrderInjectable"> - <dataset name="default"> - <field name="customer_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> - </field> - <field name="base_currency_code" xsi:type="boolean">false</field> - <field name="order_currency_code" xsi:type="string">USD</field> - <field name="shipping_method" xsi:type="string">flatrate_flatrate</field> - <field name="payment_auth_expiration" xsi:type="array"> - <item name="method" xsi:type="string">checkmo</item> - </field> - <field name="payment_authorization_amount" xsi:type="array"> - <item name="method" xsi:type="string">free</item> - </field> - <field name="billing_address_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">US_address</item> - </field> - <field name="entity_id" xsi:type="array"> - <item name="products" xsi:type="string">catalogProductSimple::default</item> - </field> - <field name="store_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default_store_view</item> - </field> - </dataset> - <field name="entity_id" is_required="1" source="Magento\Sales\Test\Fixture\OrderInjectable\EntityId" group="null"> - <default_value xsi:type="array"> - <item name="products" xsi:type="string">catalogProductSimple::default</item> - </default_value> - </field> - <field name="state" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="status" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="coupon_code" is_required="" source="Magento\Sales\Test\Fixture\OrderInjectable\CouponCode" group="null"> - <default_value xsi:type="null" /> - </field> - <field name="protect_code" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="shipping_description" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="is_virtual" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="store_id" is_required="" source="Magento\Sales\Test\Fixture\OrderInjectable\StoreId" group="null"> - <default_value xsi:type="array"> - <item name="dataSet" xsi:type="string">default_store_view</item> - </default_value> - </field> - <field name="customer_id" is_required="" source="Magento\Sales\Test\Fixture\OrderInjectable\CustomerId" group="null"> - <default_value xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> - </default_value> - </field> - <field name="base_discount_amount" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_discount_canceled" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_discount_invoiced" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_discount_refunded" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_grand_total" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_shipping_amount" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_shipping_canceled" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_shipping_invoiced" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_shipping_refunded" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_shipping_tax_amount" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_shipping_tax_refunded" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_subtotal" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_subtotal_canceled" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_subtotal_invoiced" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_subtotal_refunded" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_tax_amount" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_tax_canceled" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_tax_invoiced" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_tax_refunded" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_to_global_rate" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_to_order_rate" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_total_canceled" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_total_invoiced" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_total_invoiced_cost" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_total_offline_refunded" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_total_online_refunded" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_total_paid" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_total_qty_ordered" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_total_refunded" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="discount_amount" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="discount_canceled" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="discount_invoiced" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="discount_refunded" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="grand_total" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="shipping_amount" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="shipping_canceled" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="shipping_invoiced" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="shipping_refunded" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="shipping_tax_amount" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="shipping_tax_refunded" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="store_to_base_rate" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="store_to_order_rate" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="subtotal" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="subtotal_canceled" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="subtotal_invoiced" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="subtotal_refunded" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="tax_amount" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="tax_canceled" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="tax_invoiced" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="tax_refunded" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="total_canceled" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="total_invoiced" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="total_offline_refunded" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="total_online_refunded" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="total_paid" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="total_qty_ordered" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="total_refunded" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="can_ship_partially" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="can_ship_partially_item" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="customer_is_guest" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="customer_note_notify" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="billing_address_id" is_required="" source="Magento\Sales\Test\Fixture\OrderInjectable\BillingAddressId"> - <default_value xsi:type="array"> - <item name="dataSet" xsi:type="string">US_address</item> - </default_value> - </field> - <field name="customer_group_id" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="edit_increment" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="email_sent" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="forced_shipment_with_invoice" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="payment_auth_expiration" is_required=""> - <default_value xsi:type="array"> - <item name="method" xsi:type="string">checkmo</item> - </default_value> - </field> - <field name="quote_address_id" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="quote_id" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="shipping_address_id" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="adjustment_negative" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="adjustment_positive" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_adjustment_negative" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_adjustment_positive" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_shipping_discount_amount" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_subtotal_incl_tax" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_total_due" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="payment_authorization_amount" is_required=""> - <default_value xsi:type="array"> - <item name="method" xsi:type="string">free</item> - </default_value> - </field> - <field name="shipping_discount_amount" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="subtotal_incl_tax" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="total_due" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="weight" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="customer_dob" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="increment_id" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="applied_rule_ids" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_currency_code" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="customer_email" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="customer_firstname" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="customer_lastname" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="customer_middlename" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="customer_prefix" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="customer_suffix" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="customer_taxvat" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="discount_description" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="ext_customer_id" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="ext_order_id" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="global_currency_code" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="hold_before_state" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="hold_before_status" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="order_currency_code" is_required=""> - <default_value xsi:type="string">USD</default_value> - </field> - <field name="original_increment_id" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="relation_child_id" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="relation_child_real_id" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="relation_parent_id" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="relation_parent_real_id" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="remote_ip" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="shipping_method" is_required=""> - <default_value xsi:type="string">flatrate_flatrate</default_value> - </field> - <field name="store_currency_code" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="store_name" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="x_forwarded_for" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="customer_note" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="created_at" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="updated_at" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="total_item_count" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="customer_gender" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="discount_tax_compensation_amount" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_discount_tax_compensation_amount" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="shipping_discount_tax_compensation_amount" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_shipping_discount_tax_compensation_amnt" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="discount_tax_compensation_invoiced" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_discount_tax_compensation_invoiced" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="discount_tax_compensation_refunded" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_discount_tax_compensation_refunded" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="shipping_incl_tax" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_shipping_incl_tax" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="coupon_rule_name" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_customer_balance_amount" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="customer_balance_amount" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_customer_balance_invoiced" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="customer_balance_invoiced" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_customer_balance_refunded" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="customer_balance_refunded" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="bs_customer_bal_total_refunded" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="customer_bal_total_refunded" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="gift_cards" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_gift_cards_amount" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="gift_cards_amount" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_gift_cards_invoiced" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="gift_cards_invoiced" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="base_gift_cards_refunded" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="gift_cards_refunded" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="gift_message_id" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="gw_id" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="gw_allow_gift_receipt" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="gw_add_card" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="gw_base_price" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="gw_price" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="gw_items_base_price" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="gw_items_price" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="gw_card_base_price" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="gw_card_price" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="gw_base_tax_amount" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="gw_tax_amount" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="gw_items_base_tax_amount" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="gw_items_tax_amount" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="gw_card_base_tax_amount" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="gw_card_tax_amount" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="gw_base_price_invoiced" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="gw_price_invoiced" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="gw_items_base_price_invoiced" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="gw_items_price_invoiced" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="gw_card_base_price_invoiced" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="gw_card_price_invoiced" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="gw_base_tax_amount_invoiced" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="gw_tax_amount_invoiced" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="gw_items_base_tax_invoiced" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="gw_items_tax_invoiced" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="gw_card_base_tax_invoiced" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="gw_card_tax_invoiced" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="gw_base_price_refunded" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="gw_price_refunded" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="gw_items_base_price_refunded" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="gw_items_price_refunded" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="gw_card_base_price_refunded" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="gw_card_price_refunded" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="gw_base_tax_amount_refunded" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="gw_tax_amount_refunded" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="gw_items_base_tax_refunded" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="gw_items_tax_refunded" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="gw_card_base_tax_refunded" is_required=""> - <default_value xsi:type="null" /> - </field> - <field name="gw_card_tax_refunded" is_required=""> - <default_value xsi:type="null" /> - </field> + <fixture name="orderInjectable" + module="Magento_Sales" + type="flat" + entity_type="sales_order" + collection="Magento\Sales\Model\Resource\Order\Collection" + repository_class="Magento\Sales\Test\Repository\OrderInjectable" + handler_interface="Magento\Sales\Test\Handler\OrderInjectable\OrderInjectableInterface" + class="Magento\Sales\Test\Fixture\OrderInjectable"> + <field name="entity_id" is_required="1" source="Magento\Sales\Test\Fixture\OrderInjectable\EntityId" group="null" /> + <field name="state" is_required="" /> + <field name="status" is_required="" /> + <field name="coupon_code" is_required="" source="Magento\Sales\Test\Fixture\OrderInjectable\CouponCode" group="null" /> + <field name="protect_code" is_required="" /> + <field name="shipping_description" is_required="" /> + <field name="is_virtual" is_required="" /> + <field name="store_id" is_required="" source="Magento\Sales\Test\Fixture\OrderInjectable\StoreId" group="null" /> + <field name="customer_id" is_required="" source="Magento\Sales\Test\Fixture\OrderInjectable\CustomerId" group="null" /> + <field name="base_discount_amount" is_required="" /> + <field name="base_discount_canceled" is_required="" /> + <field name="base_discount_invoiced" is_required="" /> + <field name="base_discount_refunded" is_required="" /> + <field name="base_grand_total" is_required="" /> + <field name="base_shipping_amount" is_required="" /> + <field name="base_shipping_canceled" is_required="" /> + <field name="base_shipping_invoiced" is_required="" /> + <field name="base_shipping_refunded" is_required="" /> + <field name="base_shipping_tax_amount" is_required="" /> + <field name="base_shipping_tax_refunded" is_required="" /> + <field name="base_subtotal" is_required="" /> + <field name="base_subtotal_canceled" is_required="" /> + <field name="base_subtotal_invoiced" is_required="" /> + <field name="base_subtotal_refunded" is_required="" /> + <field name="base_tax_amount" is_required="" /> + <field name="base_tax_canceled" is_required="" /> + <field name="base_tax_invoiced" is_required="" /> + <field name="base_tax_refunded" is_required="" /> + <field name="base_to_global_rate" is_required="" /> + <field name="base_to_order_rate" is_required="" /> + <field name="base_total_canceled" is_required="" /> + <field name="base_total_invoiced" is_required="" /> + <field name="base_total_invoiced_cost" is_required="" /> + <field name="base_total_offline_refunded" is_required="" /> + <field name="base_total_online_refunded" is_required="" /> + <field name="base_total_paid" is_required="" /> + <field name="base_total_qty_ordered" is_required="" /> + <field name="base_total_refunded" is_required="" /> + <field name="discount_amount" is_required="" /> + <field name="discount_canceled" is_required="" /> + <field name="discount_invoiced" is_required="" /> + <field name="discount_refunded" is_required="" /> + <field name="grand_total" is_required="" /> + <field name="shipping_amount" is_required="" /> + <field name="shipping_canceled" is_required="" /> + <field name="shipping_invoiced" is_required="" /> + <field name="shipping_refunded" is_required="" /> + <field name="shipping_tax_amount" is_required="" /> + <field name="shipping_tax_refunded" is_required="" /> + <field name="store_to_base_rate" is_required="" /> + <field name="store_to_order_rate" is_required="" /> + <field name="subtotal" is_required="" /> + <field name="subtotal_canceled" is_required="" /> + <field name="subtotal_invoiced" is_required="" /> + <field name="subtotal_refunded" is_required="" /> + <field name="tax_amount" is_required="" /> + <field name="tax_canceled" is_required="" /> + <field name="tax_invoiced" is_required="" /> + <field name="tax_refunded" is_required="" /> + <field name="total_canceled" is_required="" /> + <field name="total_invoiced" is_required="" /> + <field name="total_offline_refunded" is_required="" /> + <field name="total_online_refunded" is_required="" /> + <field name="total_paid" is_required="" /> + <field name="total_qty_ordered" is_required="" /> + <field name="total_refunded" is_required="" /> + <field name="can_ship_partially" is_required="" /> + <field name="can_ship_partially_item" is_required="" /> + <field name="customer_is_guest" is_required="" /> + <field name="customer_note_notify" is_required="" /> + <field name="billing_address_id" is_required="" source="Magento\Sales\Test\Fixture\OrderInjectable\BillingAddressId" /> + <field name="customer_group_id" is_required="" /> + <field name="edit_increment" is_required="" /> + <field name="email_sent" is_required="" /> + <field name="forced_shipment_with_invoice" is_required="" /> + <field name="payment_auth_expiration" is_required="" /> + <field name="quote_address_id" is_required="" /> + <field name="quote_id" is_required="" /> + <field name="shipping_address_id" is_required="" /> + <field name="adjustment_negative" is_required="" /> + <field name="adjustment_positive" is_required="" /> + <field name="base_adjustment_negative" is_required="" /> + <field name="base_adjustment_positive" is_required="" /> + <field name="base_shipping_discount_amount" is_required="" /> + <field name="base_subtotal_incl_tax" is_required="" /> + <field name="base_total_due" is_required="" /> + <field name="payment_authorization_amount" is_required="" /> + <field name="shipping_discount_amount" is_required="" /> + <field name="subtotal_incl_tax" is_required="" /> + <field name="total_due" is_required="" /> + <field name="weight" is_required="" /> + <field name="customer_dob" is_required="" /> + <field name="increment_id" is_required="" /> + <field name="applied_rule_ids" is_required="" /> + <field name="base_currency_code" is_required="" /> + <field name="customer_email" is_required="" /> + <field name="customer_firstname" is_required="" /> + <field name="customer_lastname" is_required="" /> + <field name="customer_middlename" is_required="" /> + <field name="customer_prefix" is_required="" /> + <field name="customer_suffix" is_required="" /> + <field name="customer_taxvat" is_required="" /> + <field name="discount_description" is_required="" /> + <field name="ext_customer_id" is_required="" /> + <field name="ext_order_id" is_required="" /> + <field name="global_currency_code" is_required="" /> + <field name="hold_before_state" is_required="" /> + <field name="hold_before_status" is_required="" /> + <field name="order_currency_code" is_required="" /> + <field name="original_increment_id" is_required="" /> + <field name="relation_child_id" is_required="" /> + <field name="relation_child_real_id" is_required="" /> + <field name="relation_parent_id" is_required="" /> + <field name="relation_parent_real_id" is_required="" /> + <field name="remote_ip" is_required="" /> + <field name="shipping_method" is_required="" /> + <field name="store_currency_code" is_required="" /> + <field name="store_name" is_required="" /> + <field name="x_forwarded_for" is_required="" /> + <field name="customer_note" is_required="" /> + <field name="created_at" is_required="" /> + <field name="updated_at" is_required="" /> + <field name="total_item_count" is_required="" /> + <field name="customer_gender" is_required="" /> + <field name="discount_tax_compensation_amount" is_required="" /> + <field name="base_discount_tax_compensation_amount" is_required="" /> + <field name="shipping_discount_tax_compensation_amount" is_required="" /> + <field name="base_shipping_discount_tax_compensation_amnt" is_required="" /> + <field name="discount_tax_compensation_invoiced" is_required="" /> + <field name="base_discount_tax_compensation_invoiced" is_required="" /> + <field name="discount_tax_compensation_refunded" is_required="" /> + <field name="base_discount_tax_compensation_refunded" is_required="" /> + <field name="shipping_incl_tax" is_required="" /> + <field name="base_shipping_incl_tax" is_required="" /> + <field name="coupon_rule_name" is_required="" /> + <field name="base_customer_balance_amount" is_required="" /> + <field name="customer_balance_amount" is_required="" /> + <field name="base_customer_balance_invoiced" is_required="" /> + <field name="customer_balance_invoiced" is_required="" /> + <field name="base_customer_balance_refunded" is_required="" /> + <field name="customer_balance_refunded" is_required="" /> + <field name="bs_customer_bal_total_refunded" is_required="" /> + <field name="customer_bal_total_refunded" is_required="" /> + <field name="gift_cards" is_required="" /> + <field name="base_gift_cards_amount" is_required="" /> + <field name="gift_cards_amount" is_required="" /> + <field name="base_gift_cards_invoiced" is_required="" /> + <field name="gift_cards_invoiced" is_required="" /> + <field name="base_gift_cards_refunded" is_required="" /> + <field name="gift_cards_refunded" is_required="" /> + <field name="gift_message_id" is_required="" /> + <field name="gw_id" is_required="" /> + <field name="gw_allow_gift_receipt" is_required="" /> + <field name="gw_add_card" is_required="" /> + <field name="gw_base_price" is_required="" /> + <field name="gw_price" is_required="" /> + <field name="gw_items_base_price" is_required="" /> + <field name="gw_items_price" is_required="" /> + <field name="gw_card_base_price" is_required="" /> + <field name="gw_card_price" is_required="" /> + <field name="gw_base_tax_amount" is_required="" /> + <field name="gw_tax_amount" is_required="" /> + <field name="gw_items_base_tax_amount" is_required="" /> + <field name="gw_items_tax_amount" is_required="" /> + <field name="gw_card_base_tax_amount" is_required="" /> + <field name="gw_card_tax_amount" is_required="" /> + <field name="gw_base_price_invoiced" is_required="" /> + <field name="gw_price_invoiced" is_required="" /> + <field name="gw_items_base_price_invoiced" is_required="" /> + <field name="gw_items_price_invoiced" is_required="" /> + <field name="gw_card_base_price_invoiced" is_required="" /> + <field name="gw_card_price_invoiced" is_required="" /> + <field name="gw_base_tax_amount_invoiced" is_required="" /> + <field name="gw_tax_amount_invoiced" is_required="" /> + <field name="gw_items_base_tax_invoiced" is_required="" /> + <field name="gw_items_tax_invoiced" is_required="" /> + <field name="gw_card_base_tax_invoiced" is_required="" /> + <field name="gw_card_tax_invoiced" is_required="" /> + <field name="gw_base_price_refunded" is_required="" /> + <field name="gw_price_refunded" is_required="" /> + <field name="gw_items_base_price_refunded" is_required="" /> + <field name="gw_items_price_refunded" is_required="" /> + <field name="gw_card_base_price_refunded" is_required="" /> + <field name="gw_card_price_refunded" is_required="" /> + <field name="gw_base_tax_amount_refunded" is_required="" /> + <field name="gw_tax_amount_refunded" is_required="" /> + <field name="gw_items_base_tax_refunded" is_required="" /> + <field name="gw_items_tax_refunded" is_required="" /> + <field name="gw_card_base_tax_refunded" is_required="" /> + <field name="gw_card_tax_refunded" is_required="" /> <field name="id" /> - <field name="price" is_required="1" group="null" source="Magento\Sales\Test\Fixture\OrderInjectable\Price" /> + <field name="price" is_required="1" group="null" repository="Magento\Sales\Test\Repository\OrderInjectable\Price" /> </fixture> </config> diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Fixture/OrderInjectable/BillingAddressId.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Fixture/OrderInjectable/BillingAddressId.php index 8aaa2b0cc381d1df3bdd37aa7e590a2f5d75e433..ec8e9857e5150170abf84ef864bb52cb0c1e8169 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Fixture/OrderInjectable/BillingAddressId.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Fixture/OrderInjectable/BillingAddressId.php @@ -15,13 +15,6 @@ use Magento\Mtf\Fixture\DataSource; */ class BillingAddressId extends DataSource { - /** - * Current preset. - * - * @var string - */ - protected $currentPreset; - /** * @constructor * @param FixtureFactory $fixtureFactory @@ -35,8 +28,8 @@ class BillingAddressId extends DataSource $this->data = $data['value']; return; } - if (isset($data['dataSet'])) { - $addresses = $fixtureFactory->createByCode('address', ['dataSet' => $data['dataSet']]); + if (isset($data['dataset'])) { + $addresses = $fixtureFactory->createByCode('address', ['dataset' => $data['dataset']]); $this->data = $addresses->getData(); $this->data['street'] = [$this->data['street']]; } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Fixture/OrderInjectable/CouponCode.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Fixture/OrderInjectable/CouponCode.php index 0a28aff4f63e99585c420f30ca03fcd9031e1a4e..25017987e5fc7119108f170953d722cf3b129505 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Fixture/OrderInjectable/CouponCode.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Fixture/OrderInjectable/CouponCode.php @@ -28,8 +28,8 @@ class CouponCode extends DataSource $this->data = $data['value']; return; } - if (isset($data['dataSet'])) { - $salesRule = $fixtureFactory->createByCode('salesRule', ['dataSet' => $data['dataSet']]); + if (isset($data['dataset'])) { + $salesRule = $fixtureFactory->createByCode('salesRule', ['dataset' => $data['dataset']]); $salesRule->persist(); $this->data = $salesRule; } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Fixture/OrderInjectable/CustomerId.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Fixture/OrderInjectable/CustomerId.php index b970afcd0d1ab5e7b87175dabe52324ba57d2d2f..30233046c6bf698ea6854d76f80405022eb06c69 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Fixture/OrderInjectable/CustomerId.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Fixture/OrderInjectable/CustomerId.php @@ -28,8 +28,8 @@ class CustomerId extends DataSource $this->data = $data['customer']; return; } - if (isset($data['dataSet'])) { - $customer = $fixtureFactory->createByCode('customer', ['dataSet' => $data['dataSet']]); + if (isset($data['dataset'])) { + $customer = $fixtureFactory->createByCode('customer', ['dataset' => $data['dataset']]); if ($customer->hasData('id') === false) { $customer->persist(); } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Fixture/OrderInjectable/EntityId.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Fixture/OrderInjectable/EntityId.php index 7b99bad4281b90281275c27b779155d1c97cd53f..cf25a0130f8866b80d08f3f6023ff2f05ff7b2c8 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Fixture/OrderInjectable/EntityId.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Fixture/OrderInjectable/EntityId.php @@ -14,13 +14,6 @@ use Magento\Mtf\Fixture\DataSource; */ class EntityId extends DataSource { - /** - * Current preset. - * - * @var string - */ - protected $currentPreset; - /** * @constructor * @param FixtureFactory $fixtureFactory @@ -42,8 +35,8 @@ class EntityId extends DataSource if (is_string($data['products'])) { $products = explode(',', $data['products']); foreach ($products as $product) { - list($fixture, $dataSet) = explode('::', trim($product)); - $product = $fixtureFactory->createByCode($fixture, ['dataSet' => $dataSet]); + list($fixture, $dataset) = explode('::', trim($product)); + $product = $fixtureFactory->createByCode($fixture, ['dataset' => $dataset]); $product->persist(); $this->data['products'][] = $product; } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Fixture/OrderInjectable/Price.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Fixture/OrderInjectable/Price.php deleted file mode 100644 index 0de14ee47f836ac21ef905568ff4d19fe4a8857c..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Fixture/OrderInjectable/Price.php +++ /dev/null @@ -1,74 +0,0 @@ -<?php -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Sales\Test\Fixture\OrderInjectable; - -/** - * Data keys: - * - preset (Price data verification preset name) - */ -class Price extends \Magento\Catalog\Test\Fixture\CatalogProductSimple\Price -{ - /** - * @constructor - * @param array $params - * @param array $data - */ - public function __construct(array $params, array $data = []) - { - $this->params = $params; - if (isset($data['preset'])) { - $this->currentPreset = $data['preset']; - $this->data = $this->getPreset(); - } - } - - /** - * Get preset array - * - * @return array|null - */ - public function getPreset() - { - $presets = [ - 'default_with_discount' => [ - 'subtotal' => 560, - 'discount' => 280, - ], - 'full_invoice' => [ - [ - 'grand_order_total' => 565, - 'grand_invoice_total' => 565, - ], - ], - 'partial_invoice' => [ - [ - 'grand_order_total' => 210, - 'grand_invoice_total' => 110, - ], - ], - 'full_refund' => [ - [ - 'grand_creditmemo_total' => 565, - ], - ], - 'full_refund_with_zero_shipping_refund' => [ - [ - 'grand_creditmemo_total' => 555, - ], - ], - 'partial_refund' => [ - [ - 'grand_creditmemo_total' => 110, - ], - ], - ]; - if (!isset($presets[$this->currentPreset])) { - return null; - } - return $presets[$this->currentPreset]; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Fixture/OrderInjectable/StoreId.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Fixture/OrderInjectable/StoreId.php index 11579ab84e9e8502d143e5c285f4774f271415c9..4f576f5d48b8d647a31f37b11808d9feb9b714bc 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Fixture/OrderInjectable/StoreId.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Fixture/OrderInjectable/StoreId.php @@ -32,7 +32,7 @@ class StoreId extends DataSource { $this->params = $params; - $storeData = isset($data['dataSet']) ? ['dataSet' => $data['dataSet']] : []; + $storeData = isset($data['dataset']) ? ['dataset' => $data['dataset']] : []; if (isset($data['data'])) { $storeData = array_replace_recursive($storeData, $data); } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Fixture/OrderStatus.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Fixture/OrderStatus.xml index b86502663dbd5b42802155a742536c492ab9d278..5cea54a5f707fb135a12a59300a163ad89d22cba 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Fixture/OrderStatus.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Fixture/OrderStatus.xml @@ -6,25 +6,17 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="orderStatus" module="Magento_Sales" type="composite" collection="Magento\Sales\Model\Resource\Order\Status\Collection" repository_class="Magento\Sales\Test\Repository\OrderStatus" handler_interface="Magento\Sales\Test\Handler\OrderStatus\OrderStatusInterface" class="Magento\Sales\Test\Fixture\OrderStatus"> - <dataset name="default"> - <field name="status" xsi:type="string">order_status%isolation%</field> - <field name="label" xsi:type="string">orderLabel%isolation%</field> - </dataset> - <field name="status" is_required="1"> - <default_value xsi:type="string">order_status%isolation%</default_value> - </field> - <field name="label" is_required=""> - <default_value xsi:type="string">orderLabel%isolation%</default_value> - </field> - <field name="state" is_required="1"> - <default_value xsi:type="null" /> - </field> - <field name="is_default" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="visible_on_front" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> + <fixture name="orderStatus" + module="Magento_Sales" + type="composite" + collection="Magento\Sales\Model\Resource\Order\Status\Collection" + repository_class="Magento\Sales\Test\Repository\OrderStatus" + handler_interface="Magento\Sales\Test\Handler\OrderStatus\OrderStatusInterface" + class="Magento\Sales\Test\Fixture\OrderStatus"> + <field name="status" is_required="1" /> + <field name="label" is_required="" /> + <field name="state" is_required="1" /> + <field name="is_default" is_required="" /> + <field name="visible_on_front" is_required="" /> </fixture> </config> diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderIndex.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderIndex.xml index ad56dea2c043b559305be1fb6290c259afac2c99..ca26062f43e664749f4568729d5f207d0e662a88 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderIndex.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/OrderIndex.xml @@ -6,9 +6,9 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd"> - <page name="OrderIndex" area="Adminhtml" mca="sales/order/index" module="Magento_Sales"> - <block name="gridPageActions" class="Magento\Backend\Test\Block\GridPageActions" locator=".page-main-actions" strategy="css selector"/> - <block name="salesOrderGrid" class="Magento\Sales\Test\Block\Adminhtml\Order\Grid" locator=".admin__data-grid-outer-wrap" strategy="css selector"/> - <block name="messagesBlock" class="Magento\Backend\Test\Block\Messages" locator="#messages" strategy="css selector"/> - </page> + <page name="OrderIndex" area="Adminhtml" mca="sales/order/index" module="Magento_Sales"> + <block name="gridPageActions" class="Magento\Backend\Test\Block\GridPageActions" locator=".page-main-actions" strategy="css selector"/> + <block name="salesOrderGrid" class="Magento\Sales\Test\Block\Adminhtml\Order\Grid" locator=".admin__data-grid-outer-wrap" strategy="css selector"/> + <block name="messagesBlock" class="Magento\Backend\Test\Block\Messages" locator="#messages" strategy="css selector"/> + </page> </config> diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/SalesOrderView.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/SalesOrderView.xml index bf4d778894b7baebd2c7260cf016a7c500d78ec4..f5259e343cebe135e9023e8d3709747af664c9ea 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/SalesOrderView.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/Adminhtml/SalesOrderView.xml @@ -11,7 +11,7 @@ <block name="messagesBlock" class="Magento\Backend\Test\Block\Messages" locator="#messages" strategy="css selector"/> <block name="orderForm" class="Magento\Sales\Test\Block\Adminhtml\Order\View\OrderForm" locator="[id='page:main-container']" strategy="css selector"/> <block name="titleBlock" class="Magento\Theme\Test\Block\Html\Title" locator=".page-title-wrapper" strategy="css selector"/> - <block name="itemsOrderedBlock" class="Magento\Sales\Test\Block\Adminhtml\Order\View\Items" locator="#sales_order_view_tabs_order_info_content .grid" strategy="css selector"/> + <block name="itemsOrderedBlock" class="Magento\Sales\Test\Block\Adminhtml\Order\View\Items" locator="#sales_order_view_tabs_order_info_content .edit-order-table" strategy="css selector"/> <block name="orderTotalsBlock" class="Magento\Sales\Test\Block\Adminhtml\Order\Totals" locator=".order-totals" strategy="css selector"/> <block name="orderHistoryBlock" class="Magento\Sales\Test\Block\Adminhtml\Order\History" locator=".order-comments-history" strategy="css selector"/> <block name="informationBlock" class="Magento\Sales\Test\Block\Adminhtml\Order\View\Info" locator=".order-account-information" strategy="css selector"/> diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Repository/OrderInjectable.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Repository/OrderInjectable.xml index e08828f7bff3bd1b96f52be17c1622a896cd61f1..1429cfef5546424faeae806818033ebb5e03172e 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Repository/OrderInjectable.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Repository/OrderInjectable.xml @@ -12,13 +12,13 @@ <item name="products" xsi:type="string">catalogProductSimple::default</item> </field> <field name="customer_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="billing_address_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">US_address</item> + <item name="dataset" xsi:type="string">US_address</item> </field> <field name="store_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default_store_view</item> + <item name="dataset" xsi:type="string">default_store_view</item> </field> <field name="shipping_method" xsi:type="string">flatrate_flatrate</field> <field name="payment_auth_expiration" xsi:type="array"> @@ -36,13 +36,13 @@ <item name="products" xsi:type="string">catalogProductSimple::default,catalogProductSimple::default</item> </field> <field name="customer_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="billing_address_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">US_address</item> + <item name="dataset" xsi:type="string">US_address</item> </field> <field name="store_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default_store_view</item> + <item name="dataset" xsi:type="string">default_store_view</item> </field> <field name="shipping_method" xsi:type="string">flatrate_flatrate</field> <field name="payment_auth_expiration" xsi:type="array"> @@ -60,13 +60,13 @@ <item name="products" xsi:type="string">catalogProductVirtual::default</item> </field> <field name="customer_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="billing_address_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">US_address</item> + <item name="dataset" xsi:type="string">US_address</item> </field> <field name="store_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default_store_view</item> + <item name="dataset" xsi:type="string">default_store_view</item> </field> <field name="payment_auth_expiration" xsi:type="array"> <item name="method" xsi:type="string">checkmo</item> @@ -83,13 +83,13 @@ <item name="products" xsi:type="string">downloadableProduct::with_two_bought_links</item> </field> <field name="customer_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="billing_address_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">US_address</item> + <item name="dataset" xsi:type="string">US_address</item> </field> <field name="store_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default_store_view</item> + <item name="dataset" xsi:type="string">default_store_view</item> </field> <field name="payment_auth_expiration" xsi:type="array"> <item name="method" xsi:type="string">checkmo</item> @@ -106,13 +106,13 @@ <item name="products" xsi:type="string">downloadableProduct::with_two_bought_links, downloadableProduct::with_two_bought_links</item> </field> <field name="customer_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="billing_address_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">US_address</item> + <item name="dataset" xsi:type="string">US_address</item> </field> <field name="store_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default_store_view</item> + <item name="dataset" xsi:type="string">default_store_view</item> </field> <field name="payment_auth_expiration" xsi:type="array"> <item name="method" xsi:type="string">checkmo</item> @@ -129,13 +129,13 @@ <item name="products" xsi:type="string">catalogProductSimple::default</item> </field> <field name="customer_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="billing_address_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">US_address</item> + <item name="dataset" xsi:type="string">US_address</item> </field> <field name="store_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default_store_view</item> + <item name="dataset" xsi:type="string">default_store_view</item> </field> <field name="shipping_method" xsi:type="string">flatrate_flatrate</field> <field name="payment_auth_expiration" xsi:type="array"> @@ -147,10 +147,10 @@ <field name="base_currency_code" xsi:type="string">0</field> <field name="order_currency_code" xsi:type="string">USD</field> <field name="coupon_code" xsi:type="array"> - <item name="dataSet" xsi:type="string">active_sales_rule_for_all_groups</item> + <item name="dataset" xsi:type="string">active_sales_rule_for_all_groups</item> </field> <field name="price" xsi:type="array"> - <item name="preset" xsi:type="string">default_with_discount</item> + <item name="dataset" xsi:type="string">default_with_discount</item> </field> </dataset> @@ -159,13 +159,13 @@ <item name="products" xsi:type="string">catalogProductSimple::default</item> </field> <field name="customer_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="billing_address_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">US_address</item> + <item name="dataset" xsi:type="string">US_address</item> </field> <field name="store_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default_store_view</item> + <item name="dataset" xsi:type="string">default_store_view</item> </field> <field name="shipping_method" xsi:type="string">flatrate_flatrate</field> <field name="payment_auth_expiration" xsi:type="array"> @@ -177,10 +177,10 @@ <field name="base_currency_code" xsi:type="string">0</field> <field name="order_currency_code" xsi:type="string">USD</field> <field name="coupon_code" xsi:type="array"> - <item name="dataSet" xsi:type="string">active_sales_rule_for_all_groups</item> + <item name="dataset" xsi:type="string">active_sales_rule_for_all_groups</item> </field> <field name="price" xsi:type="array"> - <item name="preset" xsi:type="string">default_with_discount</item> + <item name="dataset" xsi:type="string">default_with_discount</item> </field> </dataset> @@ -189,13 +189,13 @@ <item name="products" xsi:type="string">catalogProductSimple::simple_big_qty</item> </field> <field name="customer_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">johndoe_unique</item> + <item name="dataset" xsi:type="string">johndoe_unique</item> </field> <field name="billing_address_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">US_address</item> + <item name="dataset" xsi:type="string">US_address</item> </field> <field name="store_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default_store_view</item> + <item name="dataset" xsi:type="string">default_store_view</item> </field> <field name="shipping_method" xsi:type="string">flatrate_flatrate</field> <field name="payment_auth_expiration" xsi:type="array"> @@ -213,13 +213,13 @@ <item name="products" xsi:type="string">catalogProductVirtual::virtual_big_qty</item> </field> <field name="customer_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">johndoe_unique</item> + <item name="dataset" xsi:type="string">johndoe_unique</item> </field> <field name="billing_address_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">US_address</item> + <item name="dataset" xsi:type="string">US_address</item> </field> <field name="store_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default_store_view</item> + <item name="dataset" xsi:type="string">default_store_view</item> </field> <field name="shipping_method" xsi:type="string">flatrate_flatrate</field> <field name="payment_auth_expiration" xsi:type="array"> diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Repository/OrderInjectable/Price.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Repository/OrderInjectable/Price.xml new file mode 100644 index 0000000000000000000000000000000000000000..9f0c076288e87d39dcd3c67534c9a7917c167947 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Repository/OrderInjectable/Price.xml @@ -0,0 +1,47 @@ +<?xml version="1.0" ?> +<!-- +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> + <repository class="Magento\Sales\Test\Repository\OrderInjectable\Price"> + <dataset name="default_with_discount"> + <field name="subtotal" xsi:type="string">560</field> + <field name="discount" xsi:type="string">280</field> + </dataset> + + <dataset name="full_invoice"> + <field name="0" xsi:type="array"> + <item name="grand_order_total" xsi:type="string">565</item> + <item name="grand_invoice_total" xsi:type="string">565</item> + </field> + </dataset> + + <dataset name="partial_invoice"> + <field name="0" xsi:type="array"> + <item name="grand_order_total" xsi:type="string">210</item> + <item name="grand_invoice_total" xsi:type="string">110</item> + </field> + </dataset> + + <dataset name="full_refund"> + <field name="0" xsi:type="array"> + <item name="grand_creditmemo_total" xsi:type="string">565</item> + </field> + </dataset> + + <dataset name="full_refund_with_zero_shipping_refund"> + <field name="0" xsi:type="array"> + <item name="grand_creditmemo_total" xsi:type="string">555</item> + </field> + </dataset> + + <dataset name="partial_refund"> + <field name="0" xsi:type="array"> + <item name="grand_creditmemo_total" xsi:type="string">110</item> + </field> + </dataset> + </repository> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/AssignCustomOrderStatusTest.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/AssignCustomOrderStatusTest.php index f75105b14133251188ba8122d19f2a26a8e760bf..0ddc727fd502b498fd5d6fde89adc0c4e2b4f363 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/AssignCustomOrderStatusTest.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/AssignCustomOrderStatusTest.php @@ -27,7 +27,7 @@ use Magento\Mtf\TestCase\Injectable; * 5. Save Status Assignment. * 6. Call assert assertOrderStatusSuccessAssignMessage. * 7. Create Order. - * 8. Perform all assertions from dataSet. + * 8. Perform all assertions from dataset. * * @group Order_Management_(CS) * @ZephyrId MAGETWO-29382 diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CancelCreatedOrderTest.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CancelCreatedOrderTest.xml index 043c556bc3fc6e5bf3fb1f0c67d54c00201b2752..bf5098ff6b6b71c376f6fcb8f2a61cd83f9fd8eb 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CancelCreatedOrderTest.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CancelCreatedOrderTest.xml @@ -9,7 +9,7 @@ <testCase name="Magento\Sales\Test\TestCase\CancelCreatedOrderTest"> <variation name="CancelCreatedOrderTestVariation1"> <data name="description" xsi:type="string">cancel order and check status on storefront</data> - <data name="order/dataSet" xsi:type="string">default</data> + <data name="order/dataset" xsi:type="string">default</data> <data name="order/data/entity_id/products" xsi:type="string">catalogProductSimple::default,catalogProductSimple::default</data> <data name="status" xsi:type="string">Canceled</data> <constraint name="Magento\Sales\Test\Constraint\AssertOrderCancelSuccessMessage" /> diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateCreditMemoEntityTest.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateCreditMemoEntityTest.php index daf610dee8cd20d53b168c455d868410b90a3e91..2558af19e058d2a65617ff29c46bad1f40b54ba8 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateCreditMemoEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateCreditMemoEntityTest.php @@ -21,7 +21,7 @@ use Magento\Mtf\TestCase\Injectable; * Steps: * 1. Go to Sales > Orders > find out placed order and open. * 2. Click 'Credit Memo' button. - * 3. Fill data from dataSet. + * 3. Fill data from dataset. * 4. On order's page click 'Refund offline' button. * 5. Perform all assertions. * diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateCreditMemoEntityTest.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateCreditMemoEntityTest.xml index 1d730f56e5bbcc70863d71c20ca7f9ddc99b4d7c..bbdf7ba05ebd61bc16250ca31a6bfa1a9f10584e 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateCreditMemoEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateCreditMemoEntityTest.xml @@ -11,9 +11,9 @@ <data name="description" xsi:type="string">Assert items return to stock (partial refund)</data> <data name="data/items_data/0/back_to_stock" xsi:type="string">Yes</data> <data name="data/items_data/0/qty" xsi:type="string">1</data> - <data name="order/dataSet" xsi:type="string">default</data> + <data name="order/dataset" xsi:type="string">default</data> <data name="order/data/entity_id/products" xsi:type="string">catalogProductSimple::product_100_dollar</data> - <data name="order/data/price/preset" xsi:type="string">partial_refund</data> + <data name="order/data/price/dataset" xsi:type="string">partial_refund</data> <constraint name="Magento\Sales\Test\Constraint\AssertRefundSuccessCreateMessage" /> <constraint name="Magento\Sales\Test\Constraint\AssertCreditMemoButton" /> <constraint name="Magento\Sales\Test\Constraint\AssertRefundInCreditMemoTab" /> @@ -28,9 +28,9 @@ <data name="data/form_data/shipping_amount" xsi:type="string">0</data> <data name="data/form_data/adjustment_positive" xsi:type="string">5</data> <data name="data/form_data/adjustment_negative" xsi:type="string">10</data> - <data name="order/dataSet" xsi:type="string">default</data> + <data name="order/dataset" xsi:type="string">default</data> <data name="order/data/entity_id/products" xsi:type="string">catalogProductSimple::default</data> - <data name="order/data/price/preset" xsi:type="string">full_refund_with_zero_shipping_refund</data> + <data name="order/data/price/dataset" xsi:type="string">full_refund_with_zero_shipping_refund</data> <constraint name="Magento\Sales\Test\Constraint\AssertRefundSuccessCreateMessage" /> <constraint name="Magento\Sales\Test\Constraint\AssertCreditMemoButton" /> <constraint name="Magento\Sales\Test\Constraint\AssertRefundInCreditMemoTab" /> diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateInvoiceEntityTest.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateInvoiceEntityTest.php index 1c490060364c978df658f645025826b5f2335f0f..6fe0937884274185aa6102ea9a7f927c0e4ee73f 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateInvoiceEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateInvoiceEntityTest.php @@ -19,7 +19,7 @@ use Magento\Mtf\TestCase\Injectable; * 1. Go to Sales > Orders. * 2. Select created order in the grid and open it. * 3. Click 'Invoice' button. - * 4. Fill data according to dataSet. + * 4. Fill data according to dataset. * 5. Click 'Submit Invoice' button. * 6. Perform assertions. * diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateInvoiceEntityTest.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateInvoiceEntityTest.xml index 43b018bc8b8c2d6a7f689c61dd5e96aa9761aac1..a8aa9e15a666da30b86e7e190f8a8de61508355d 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateInvoiceEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateInvoiceEntityTest.xml @@ -8,8 +8,8 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Sales\Test\TestCase\CreateInvoiceEntityTest"> <variation name="CreateInvoiceEntityTestVariation1"> - <data name="order/dataSet" xsi:type="string">default</data> - <data name="order/data/price/preset" xsi:type="string">full_invoice</data> + <data name="order/dataset" xsi:type="string">default</data> + <data name="order/data/price/dataset" xsi:type="string">full_invoice</data> <data name="order/data/entity_id/products" xsi:type="string">catalogProductSimple::default</data> <data name="order/data/total_qty_ordered/0" xsi:type="string">1</data> <data name="data/items_data/0/qty" xsi:type="string">-</data> @@ -25,8 +25,8 @@ <constraint name="Magento\Sales\Test\Constraint\AssertInvoiceItems" /> </variation> <variation name="CreateInvoiceEntityTestVariation2"> - <data name="order/dataSet" xsi:type="string">default</data> - <data name="order/data/price/preset" xsi:type="string">partial_invoice</data> + <data name="order/dataset" xsi:type="string">default</data> + <data name="order/data/price/dataset" xsi:type="string">partial_invoice</data> <data name="order/data/entity_id/products" xsi:type="string">catalogProductSimple::product_100_dollar</data> <data name="order/data/total_qty_ordered/0" xsi:type="string">-</data> <data name="data/items_data/0/qty" xsi:type="string">1</data> diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateOrderBackendTest.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateOrderBackendTest.php index c95042db6b0a093314f689ba916dcac1292e98d9..b5329ca2860aca1303e254319fb746d470304a2a 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateOrderBackendTest.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateOrderBackendTest.php @@ -19,11 +19,11 @@ use Magento\Mtf\TestCase\Scenario; * 3. Click Create New Order. * 4. Select Customer created in preconditions. * 5. Add Product. - * 6. Fill data according dataSet. + * 6. Fill data according dataset. * 7. Click Update Product qty. - * 8. Fill data according dataSet. + * 8. Fill data according dataset. * 9. Click Get Shipping Method and rates. - * 10. Fill data according dataSet. + * 10. Fill data according dataset. * 11. Submit Order. * 12. Perform all assertions. * diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateOrderBackendTest.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateOrderBackendTest.xml index db4354d4bb58824980a6211c2951a3c5dd197578..5fd3348a6ff24347d06567f39caff18074b74e6f 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateOrderBackendTest.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateOrderBackendTest.xml @@ -10,8 +10,8 @@ <variation name="CreateOrderBackendTestVariation1"> <data name="description" xsi:type="string">Create order with simple product for registered US customer using Fixed shipping method and Cash on Delivery payment method</data> <data name="products" xsi:type="string">catalogProductSimple::default</data> - <data name="customer/dataSet" xsi:type="string">default</data> - <data name="billingAddress/dataSet" xsi:type="string">US_address_1_without_email</data> + <data name="customer/dataset" xsi:type="string">default</data> + <data name="billingAddress/dataset" xsi:type="string">US_address_1_without_email</data> <data name="saveAddress" xsi:type="string">No</data> <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data> <data name="shipping/shipping_method" xsi:type="string">Fixed</data> @@ -31,8 +31,8 @@ <variation name="CreateOrderBackendTestVariation2"> <data name="description" xsi:type="string">Create order with virtual product for registered UK customer using Check/Money Order payment method</data> <data name="products" xsi:type="string">catalogProductVirtual::default</data> - <data name="customer/dataSet" xsi:type="string">default</data> - <data name="billingAddress/dataSet" xsi:type="string">UK_address_without_email</data> + <data name="customer/dataset" xsi:type="string">default</data> + <data name="billingAddress/dataset" xsi:type="string">UK_address_without_email</data> <data name="setShippingAddress" xsi:type="boolean">false</data> <data name="prices" xsi:type="array"> <item name="grandTotal" xsi:type="string">10.00</item> @@ -50,8 +50,8 @@ <variation name="CreateOrderBackendTestVariation3"> <data name="description" xsi:type="string">Create order with simple product for registered US customer using Fixed shipping method and Bank Transfer payment method</data> <data name="products" xsi:type="string">catalogProductSimple::default</data> - <data name="customer/dataSet" xsi:type="string">default</data> - <data name="billingAddress/dataSet" xsi:type="string">US_address_1_without_email</data> + <data name="customer/dataset" xsi:type="string">default</data> + <data name="billingAddress/dataset" xsi:type="string">US_address_1_without_email</data> <data name="saveAddress" xsi:type="string">No</data> <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data> <data name="shipping/shipping_method" xsi:type="string">Fixed</data> @@ -71,8 +71,8 @@ <variation name="CreateOrderBackendTestVariation4"> <data name="description" xsi:type="string">Create order with virtual product for registered UK customer using Bank Transfer payment method</data> <data name="products" xsi:type="string">catalogProductVirtual::default</data> - <data name="customer/dataSet" xsi:type="string">default</data> - <data name="billingAddress/dataSet" xsi:type="string">UK_address_without_email</data> + <data name="customer/dataset" xsi:type="string">default</data> + <data name="billingAddress/dataset" xsi:type="string">UK_address_without_email</data> <data name="saveAddress" xsi:type="string">No</data> <data name="setShippingAddress" xsi:type="boolean">false</data> <data name="prices" xsi:type="array"> @@ -91,9 +91,9 @@ <variation name="CreateOrderBackendTestVariation5"> <data name="description" xsi:type="string">Create order with simple product for registered US customer using Fixed shipping method and Purchase Order payment method</data> <data name="products" xsi:type="string">catalogProductSimple::default</data> - <data name="customer/dataSet" xsi:type="string">default</data> + <data name="customer/dataset" xsi:type="string">default</data> <data name="saveAddress" xsi:type="string">No</data> - <data name="billingAddress/dataSet" xsi:type="string">US_address_1_without_email</data> + <data name="billingAddress/dataset" xsi:type="string">US_address_1_without_email</data> <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data> <data name="shipping/shipping_method" xsi:type="string">Fixed</data> <data name="prices" xsi:type="array"> @@ -114,10 +114,10 @@ <data name="description" xsi:type="string">MAGETWO-12395 - Create Offline Order for Registered Customer in Admin</data> <data name="products" xsi:type="string">catalogProductSimple::simple_10_dollar, configurableProduct::with_one_option</data> <data name="taxRule" xsi:type="string">us_ca_ny_rule</data> - <data name="customer/dataSet" xsi:type="string">default</data> + <data name="customer/dataset" xsi:type="string">default</data> <data name="saveAddress" xsi:type="string">No</data> <data name="checkoutMethod" xsi:type="string">login</data> - <data name="billingAddress/dataSet" xsi:type="string">US_address_1_without_email</data> + <data name="billingAddress/dataset" xsi:type="string">US_address_1_without_email</data> <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data> <data name="shipping/shipping_method" xsi:type="string">Fixed</data> <data name="prices" xsi:type="array"> @@ -133,10 +133,10 @@ <data name="description" xsi:type="string">MAGETWO-12520 - Create Order for New Customer in Admin with Offline Payment Method</data> <data name="products" xsi:type="string">catalogProductSimple::simple_10_dollar, configurableProduct::with_one_option</data> <data name="taxRule" xsi:type="string">us_ca_ny_rule</data> - <data name="customer/dataSet" xsi:type="string">default</data> + <data name="customer/dataset" xsi:type="string">default</data> <data name="saveAddress" xsi:type="string">Yes</data> <data name="checkoutMethod" xsi:type="string">register</data> - <data name="billingAddress/dataSet" xsi:type="string">US_address_1_without_email</data> + <data name="billingAddress/dataset" xsi:type="string">US_address_1_without_email</data> <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data> <data name="shipping/shipping_method" xsi:type="string">Fixed</data> <data name="prices" xsi:type="array"> diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/HoldCreatedOrderTest.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/HoldCreatedOrderTest.xml index b860583704c39bff1907b1227684516d15be04c1..63eb24aba368215b489d0fb734b92244d1155b03 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/HoldCreatedOrderTest.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/HoldCreatedOrderTest.xml @@ -9,7 +9,7 @@ <testCase name="Magento\Sales\Test\TestCase\HoldCreatedOrderTest"> <variation name="HoldCreatedOrderTestVariation1"> <data name="description" xsi:type="string">hold order and check status in my account on storefront</data> - <data name="order/dataSet" xsi:type="string">default</data> + <data name="order/dataset" xsi:type="string">default</data> <data name="order/data/entity_id/products" xsi:type="string">catalogProductSimple::default,catalogProductSimple::default</data> <data name="orderButtonsUnavailable" xsi:type="string">Invoice,Cancel,Reorder,Ship,Edit</data> <data name="status" xsi:type="string">On Hold</data> diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/MassOrdersUpdateTest.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/MassOrdersUpdateTest.php index 264f392cf0123e8e85c8579d9593506bab5bb04d..6457d6841a3b7012749da5b522f116a3401b6132 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/MassOrdersUpdateTest.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/MassOrdersUpdateTest.php @@ -18,7 +18,7 @@ use Magento\Mtf\TestCase\Injectable; * Steps: * 1. Navigate to backend. * 2. Go to Sales > Orders. - * 3. Select Mass Action according to dataSet. + * 3. Select Mass Action according to dataset. * 4. Submit. * 5. Perform Asserts. * @@ -94,7 +94,7 @@ class MassOrdersUpdateTest extends Injectable $steps = explode('|', $steps); for ($i = 0; $i < $count; $i++) { /** @var OrderInjectable $order */ - $order = $this->fixtureFactory->createByCode('orderInjectable', ['dataSet' => 'default']); + $order = $this->fixtureFactory->createByCode('orderInjectable', ['dataset' => 'default']); $order->persist(); $orders[$i] = $order; $this->processSteps($order, $steps[$i]); diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/MoveLastOrderedProductsOnOrderPageTest.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/MoveLastOrderedProductsOnOrderPageTest.xml index db32b31002732a1c3df2362d9af163e1c64e0321..9a78652cbb694a942b712491c8aaabf53360d067 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/MoveLastOrderedProductsOnOrderPageTest.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/MoveLastOrderedProductsOnOrderPageTest.xml @@ -8,12 +8,12 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Sales\Test\TestCase\MoveLastOrderedProductsOnOrderPageTest"> <variation name="MoveLastOrderedProductsOnOrderPageTestVariation1"> - <data name="order/dataSet" xsi:type="string">default</data> + <data name="order/dataset" xsi:type="string">default</data> <data name="order/data/entity_id/products" xsi:type="string">catalogProductSimple::default</data> <constraint name="Magento\Sales\Test\Constraint\AssertProductInItemsOrderedGrid" /> </variation> <variation name="MoveLastOrderedProductsOnOrderPageTestVariation2"> - <data name="order/dataSet" xsi:type="string">default</data> + <data name="order/dataset" xsi:type="string">default</data> <data name="order/data/entity_id/products" xsi:type="string">configurableProduct::default</data> <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductInItemsOrderedGrid" /> </variation> diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/MoveRecentlyViewedProductsOnOrderPageTest.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/MoveRecentlyViewedProductsOnOrderPageTest.php index 19e90720cd324342e8a787f23aba3ac3a6d61182..22539711206dc9084cac0631536beb665562e0f6 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/MoveRecentlyViewedProductsOnOrderPageTest.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/MoveRecentlyViewedProductsOnOrderPageTest.php @@ -23,7 +23,7 @@ use Magento\Customer\Test\Fixture\Customer; * 5. Check product in Recently Viewed Products section. * 6. Click Update Changes. * 7. Click Configure. - * 8. Fill data from dataSet. + * 8. Fill data from dataset. * 9. Click OK. * 10. Click Update Items and Qty's button. * 11. Perform all assertions. diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/PrintOrderFrontendGuestTest.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/PrintOrderFrontendGuestTest.php index 46f32296f578d1f38b728b19852355c90bcdd1ad..5bbdc4f923853925776a2db3fd46b0a8bf013c0e 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/PrintOrderFrontendGuestTest.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/PrintOrderFrontendGuestTest.php @@ -15,7 +15,7 @@ use Magento\Mtf\TestCase\Scenario; * 2. Enable all Gift Options. * 3. Create Gift Card Account with Balance = 1. * 4. Create Customer Account. - * 5. Place order with options according to dataSet. + * 5. Place order with options according to dataset. * * Steps: * 1. Find the Order on frontend. diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/PrintOrderFrontendGuestTest.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/PrintOrderFrontendGuestTest.xml index 2f203c368077e791bd2144102a318f5575b8ee10..d6d903187cf40d5bf56a9475ab98ae4b5ef6dd0d 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/PrintOrderFrontendGuestTest.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/PrintOrderFrontendGuestTest.xml @@ -9,10 +9,10 @@ <testCase name="Magento\Sales\Test\TestCase\PrintOrderFrontendGuestTest"> <variation name="PrintOrderFrontendGuestTestVariation1"> <data name="customer" xsi:type="array"> - <item name="dataSet" xsi:type="string">johndoe_with_addresses</item> + <item name="dataset" xsi:type="string">johndoe_with_addresses</item> </data> <data name="billingAddress" xsi:type="array"> - <item name="dataSet" xsi:type="string">US_address_1_without_email</item> + <item name="dataset" xsi:type="string">US_address_1_without_email</item> </data> <data name="payment" xsi:type="array"> <item name="method" xsi:type="string">checkmo</item> diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/ReorderOrderEntityTest.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/ReorderOrderEntityTest.xml index c46e4319f9b9ffe43b172a210a4bc410c2d8aaa6..f3efcdf27459b80f426b53125890ec6f244e5e00 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/ReorderOrderEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/ReorderOrderEntityTest.xml @@ -9,10 +9,10 @@ <testCase name="Magento\Sales\Test\TestCase\ReorderOrderEntityTest"> <variation name="ReorderOrderEntityTestVariation1"> <data name="description" xsi:type="string">Reorder placed order (update products, billing address).</data> - <data name="order/dataSet" xsi:type="string">two_simple_product</data> + <data name="order/dataset" xsi:type="string">two_simple_product</data> <data name="salesRule" xsi:type="string">active_sales_rule_with_fixed_price_discount_coupon</data> - <data name="customer/dataSet" xsi:type="string">default</data> - <data name="billingAddress/dataSet" xsi:type="string">US_address_1_without_email</data> + <data name="customer/dataset" xsi:type="string">default</data> + <data name="billingAddress/dataset" xsi:type="string">US_address_1_without_email</data> <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data> <data name="shipping/shipping_method" xsi:type="string">Fixed</data> <data name="prices" xsi:type="array"> diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/UnassignCustomOrderStatusTest.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/UnassignCustomOrderStatusTest.xml index c429fc46730d9b6983b05843d316b1f6a9586c1e..cecac4451c9410f7507976bd0e7745c4d93f77ec 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/UnassignCustomOrderStatusTest.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/UnassignCustomOrderStatusTest.xml @@ -9,7 +9,7 @@ <testCase name="Magento\Sales\Test\TestCase\UnassignCustomOrderStatusTest"> <variation name="UnassignCustomOrderStatusTestVariation1"> <data name="description" xsi:type="string">unassign order status</data> - <data name="orderStatus/dataSet" xsi:type="string">assign_to_pending</data> + <data name="orderStatus/dataset" xsi:type="string">assign_to_pending</data> <data name="defaultState" xsi:type="string">Pending</data> <constraint name="Magento\Sales\Test\Constraint\AssertOrderStatusSuccessUnassignMessage" /> <constraint name="Magento\Sales\Test\Constraint\AssertOrderStatusInGrid" /> diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/UpdateCustomOrderStatusTest.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/UpdateCustomOrderStatusTest.xml index ef538ec608e8bdd46a019a887013584b07984ee8..f342cb2b53bc8e299e823b190203b3a7ae6701d8 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/UpdateCustomOrderStatusTest.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/UpdateCustomOrderStatusTest.xml @@ -9,7 +9,7 @@ <testCase name="Magento\Sales\Test\TestCase\UpdateCustomOrderStatusTest"> <variation name="UpdateCustomOrderStatusTestVariation1"> <data name="description" xsi:type="string">change status label to existed</data> - <data name="orderStatusInitial/dataSet" xsi:type="string">default</data> + <data name="orderStatusInitial/dataset" xsi:type="string">default</data> <data name="orderExist" xsi:type="string">No</data> <data name="orderStatus/data/label" xsi:type="string">Suspected Fraud</data> <constraint name="Magento\Sales\Test\Constraint\AssertOrderStatusSuccessCreateMessage" /> @@ -17,7 +17,7 @@ </variation> <variation name="UpdateCustomOrderStatusTestVariation2"> <data name="description" xsi:type="string">change status label to new and check orderStatus for order with changed orderStatus</data> - <data name="orderStatusInitial/dataSet" xsi:type="string">assign_to_pending</data> + <data name="orderStatusInitial/dataset" xsi:type="string">assign_to_pending</data> <data name="orderExist" xsi:type="string">Yes</data> <data name="orderStatus/data/label" xsi:type="string">orderLabel%isolation%</data> <constraint name="Magento\Sales\Test\Constraint\AssertOrderStatusSuccessCreateMessage" /> diff --git a/dev/tests/functional/tests/app/Magento/SalesRule/Test/Fixture/SalesRule.xml b/dev/tests/functional/tests/app/Magento/SalesRule/Test/Fixture/SalesRule.xml index 9008a93b8a36b6f82c5115afc176f113495742bc..e02f275c2dfdd37e68790c5bb936cdf3704ce7d8 100644 --- a/dev/tests/functional/tests/app/Magento/SalesRule/Test/Fixture/SalesRule.xml +++ b/dev/tests/functional/tests/app/Magento/SalesRule/Test/Fixture/SalesRule.xml @@ -6,89 +6,41 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="salesRule" module="Magento_SalesRule" type="flat" entity_type="salesrule" collection="Magento\SalesRule\Model\Resource\Rule\Collection" repository_class="Magento\SalesRule\Test\Repository\SalesRule" handler_interface="Magento\SalesRule\Test\Handler\SalesRule\SalesRuleInterface" class="Magento\SalesRule\Test\Fixture\SalesRule"> - <dataset name="default"> - <field name="name" xsi:type="string">Default price rule %isolation%</field> - <field name="is_active" xsi:type="string">Active</field> - <field name="website_ids" xsi:type="array"> - <item name="0" xsi:type="string">Main Website</item> - </field> - <field name="customer_group_ids" xsi:type="array"> - <item name="0" xsi:type="string">NOT LOGGED IN</item> - <item name="1" xsi:type="string">General</item> - <item name="2" xsi:type="string">Wholesale</item> - <item name="3" xsi:type="string">Retailer</item> - </field> - <field name="coupon_type" xsi:type="string">No Coupon</field> - <field name="simple_action" xsi:type="string">Percent of product price discount</field> - <field name="discount_amount" xsi:type="string">50</field> - </dataset> + <fixture name="salesRule" + module="Magento_SalesRule" + type="flat" + entity_type="salesrule" + collection="Magento\SalesRule\Model\Resource\Rule\Collection" + repository_class="Magento\SalesRule\Test\Repository\SalesRule" + handler_interface="Magento\SalesRule\Test\Handler\SalesRule\SalesRuleInterface" + class="Magento\SalesRule\Test\Fixture\SalesRule"> <field name="rule_id" is_required="1" /> - <field name="name" group="rule_information"> - <default_value xsi:type="string">Default price rule %isolation%</default_value> - </field> + <field name="name" group="rule_information" /> <field name="description" group="rule_information" /> <field name="from_date" group="rule_information" source="Magento\Backend\Test\Fixture\Source\Date" /> <field name="to_date" group="rule_information" source="Magento\Backend\Test\Fixture\Source\Date" /> - <field name="uses_per_customer" group="rule_information"> - <default_value xsi:type="number">0</default_value> - </field> - <field name="is_active" group="rule_information"> - <default_value xsi:type="string">Active</default_value> - </field> + <field name="uses_per_customer" group="rule_information" /> + <field name="is_active" group="rule_information" /> <field name="conditions_serialized" group="conditions" source="Magento\SalesRule\Test\Fixture\SalesRule\ConditionsSerialized" /> <field name="actions_serialized" group="actions" /> - <field name="stop_rules_processing" group="actions"> - <default_value xsi:type="string">1</default_value> - </field> - <field name="is_advanced"> - <default_value xsi:type="string">1</default_value> - </field> + <field name="stop_rules_processing" group="actions" /> + <field name="is_advanced" /> <field name="product_ids" /> - <field name="sort_order" group="rule_information"> - <default_value xsi:type="number">0</default_value> - </field> - <field name="simple_action" group="actions"> - <default_value xsi:type="string">Percent of product price discount</default_value> - </field> - <field name="discount_amount" group="actions"> - <default_value xsi:type="number">50</default_value> - </field> + <field name="sort_order" group="rule_information" /> + <field name="simple_action" group="actions" /> + <field name="discount_amount" group="actions" /> <field name="discount_qty" group="actions" /> <field name="discount_step" group="actions" /> - <field name="apply_to_shipping" group="actions"> - <default_value xsi:type="number">0</default_value> - </field> - <field name="times_used"> - <default_value xsi:type="number">0</default_value> - </field> - <field name="is_rss" group="rule_information"> - <default_value xsi:type="number">0</default_value> - </field> - <field name="coupon_type" group="rule_information"> - <default_value xsi:type="string">No Coupon</default_value> - </field> - <field name="use_auto_generation" group="rule_information"> - <default_value xsi:type="number">0</default_value> - </field> - <field name="uses_per_coupon" group="rule_information"> - <default_value xsi:type="number">0</default_value> - </field> + <field name="apply_to_shipping" group="actions" /> + <field name="times_used" /> + <field name="is_rss" group="rule_information" /> + <field name="coupon_type" group="rule_information" /> + <field name="use_auto_generation" group="rule_information" /> + <field name="uses_per_coupon" group="rule_information" /> <field name="simple_free_shipping" group="actions" /> <field name="id" /> - <field name="website_ids" group="rule_information"> - <default_value xsi:type="array"> - <item name="0" xsi:type="string">Main Website</item> - </default_value> - </field> - <field name="customer_group_ids" group="rule_information"> - <default_value xsi:type="array"> - <item name="0" xsi:type="string">NOT LOGGED IN</item> - <item name="1" xsi:type="string">General</item> - <item name="2" xsi:type="string">Wholesale</item> - <item name="3" xsi:type="string">Retailer</item> - </default_value> - </field> + <field name="website_ids" group="rule_information" /> + <field name="customer_group_ids" group="rule_information" /> <field name="store_labels" group="labels" /> <field name="coupon_code" group="rule_information" /> <field name="rule" /> diff --git a/dev/tests/functional/tests/app/Magento/SalesRule/Test/Repository/SalesRule.xml b/dev/tests/functional/tests/app/Magento/SalesRule/Test/Repository/SalesRule.xml index 652a596b0f3af0ad422fc076c544b6f62bb43cba..5f0d0df94604fdc8a7604deea3e0d1a3c7d39568 100644 --- a/dev/tests/functional/tests/app/Magento/SalesRule/Test/Repository/SalesRule.xml +++ b/dev/tests/functional/tests/app/Magento/SalesRule/Test/Repository/SalesRule.xml @@ -7,6 +7,23 @@ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> <repository class="Magento\SalesRule\Test\Repository\SalesRule"> + <dataset name="default"> + <field name="name" xsi:type="string">Default price rule %isolation%</field> + <field name="is_active" xsi:type="string">Active</field> + <field name="website_ids" xsi:type="array"> + <item name="0" xsi:type="string">Main Website</item> + </field> + <field name="customer_group_ids" xsi:type="array"> + <item name="0" xsi:type="string">NOT LOGGED IN</item> + <item name="1" xsi:type="string">General</item> + <item name="2" xsi:type="string">Wholesale</item> + <item name="3" xsi:type="string">Retailer</item> + </field> + <field name="coupon_type" xsi:type="string">No Coupon</field> + <field name="simple_action" xsi:type="string">Percent of product price discount</field> + <field name="discount_amount" xsi:type="string">50</field> + </dataset> + <dataset name="active_sales_rule_with_percent_price_discount_coupon"> <field name="name" xsi:type="string">Cart Price Rule with Specific Coupon %isolation%</field> <field name="description" xsi:type="string">Description for Cart Price Rule</field> diff --git a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/CreateSalesRuleEntityTest.php b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/CreateSalesRuleEntityTest.php index 1a40513ce1e2bde70addfca84f6e7727dcf33bec..906a7b51a359b37337311d70edfde7d57a18c135 100644 --- a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/CreateSalesRuleEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/CreateSalesRuleEntityTest.php @@ -89,18 +89,18 @@ class CreateSalesRuleEntityTest extends Injectable */ public function __prepare(FixtureFactory $fixtureFactory) { - $customer = $fixtureFactory->createByCode('customer', ['dataSet' => 'default']); + $customer = $fixtureFactory->createByCode('customer', ['dataset' => 'default']); $customer->persist(); $productForSalesRule1 = $fixtureFactory->createByCode( 'catalogProductSimple', - ['dataSet' => 'simple_for_salesrule_1'] + ['dataset' => 'simple_for_salesrule_1'] ); $productForSalesRule1->persist(); $productForSalesRule2 = $fixtureFactory->createByCode( 'catalogProductSimple', - ['dataSet' => 'simple_for_salesrule_2'] + ['dataset' => 'simple_for_salesrule_2'] ); $productForSalesRule2->persist(); diff --git a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/CreateSalesRuleEntityTest.xml b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/CreateSalesRuleEntityTest.xml index 49441220295d989834db36a95c184c3788f103d7..11990ab3006daa7bf3861f6a8029bb0373168990 100644 --- a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/CreateSalesRuleEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/CreateSalesRuleEntityTest.xml @@ -249,7 +249,7 @@ <data name="salesRule/data/website_ids/website_0" xsi:type="string">Main Website</data> <data name="salesRule/data/customer_group_ids/group_0" xsi:type="string">NOT LOGGED IN</data> <data name="salesRule/data/coupon_type" xsi:type="string">No Coupon</data> - <data name="salesRule/data/conditions_serialized" xsi:type="string">{Product attribute combination:[Attribute Set|is|Default]}</data> + <data name="salesRule/data/conditions_serialized" xsi:type="string">{Product attribute combination:[Product Template|is|Default]}</data> <data name="salesRule/data/simple_action" xsi:type="string">Percent of product price discount</data> <data name="salesRule/data/discount_amount" xsi:type="string">50</data> <data name="salesRule/data/apply_to_shipping" xsi:type="string">No</data> diff --git a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/DeleteSalesRuleEntityTest.xml b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/DeleteSalesRuleEntityTest.xml index 2d76e09d87b8cdfb29e6b3b8b1ca4236a4a9a3dd..980ffa3d0ada6627b0a5149bfacdccbd35384c0c 100644 --- a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/DeleteSalesRuleEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/DeleteSalesRuleEntityTest.xml @@ -8,17 +8,17 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\SalesRule\Test\TestCase\DeleteSalesRuleEntityTest"> <variation name="DeleteSalesRuleEntityTestVariation1"> - <data name="salesRule/dataSet" xsi:type="string">active_sales_rule_with_percent_price_discount_coupon</data> + <data name="salesRule/dataset" xsi:type="string">active_sales_rule_with_percent_price_discount_coupon</data> <constraint name="Magento\SalesRule\Test\Constraint\AssertCartPriceRuleSuccessDeleteMessage" /> <constraint name="Magento\SalesRule\Test\Constraint\AssertCartPriceRuleIsNotPresentedInGrid" /> </variation> <variation name="DeleteSalesRuleEntityTestVariation2"> - <data name="salesRule/dataSet" xsi:type="string">active_sales_rule_with_complex_conditions</data> + <data name="salesRule/dataset" xsi:type="string">active_sales_rule_with_complex_conditions</data> <constraint name="Magento\SalesRule\Test\Constraint\AssertCartPriceRuleSuccessDeleteMessage" /> <constraint name="Magento\SalesRule\Test\Constraint\AssertCartPriceRuleIsNotPresentedInGrid" /> </variation> <variation name="DeleteSalesRuleEntityTestVariation3"> - <data name="salesRule/dataSet" xsi:type="string">inactive_sales_rule</data> + <data name="salesRule/dataset" xsi:type="string">inactive_sales_rule</data> <constraint name="Magento\SalesRule\Test\Constraint\AssertCartPriceRuleSuccessDeleteMessage" /> <constraint name="Magento\SalesRule\Test\Constraint\AssertCartPriceRuleIsNotPresentedInGrid" /> </variation> diff --git a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/UpdateSalesRuleEntityTest.php b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/UpdateSalesRuleEntityTest.php index 84c524d9cec06ab4163a7f1e37ca4ba14248b44d..a1ef4b347fef4ddf8cf43643b7ac9723e34191cb 100644 --- a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/UpdateSalesRuleEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/UpdateSalesRuleEntityTest.php @@ -65,7 +65,7 @@ class UpdateSalesRuleEntityTest extends Injectable { $productForSalesRule1 = $fixtureFactory->createByCode( 'catalogProductSimple', - ['dataSet' => 'simple_for_salesrule_1'] + ['dataset' => 'simple_for_salesrule_1'] ); $productForSalesRule1->persist(); return [ diff --git a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/UpdateSalesRuleEntityTest.xml b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/UpdateSalesRuleEntityTest.xml index f4f2c01eeccecd1c2ca4136cf63606d93f27d4ca..b46f67e76b3938d0406e733e9a8fb4728b954f5b 100644 --- a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/UpdateSalesRuleEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/UpdateSalesRuleEntityTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\SalesRule\Test\TestCase\UpdateSalesRuleEntityTest"> <variation name="UpdateSalesRuleEntityTestVariation1"> - <data name="salesRuleOrigin/dataSet" xsi:type="string">active_sales_rule_with_complex_conditions</data> + <data name="salesRuleOrigin/dataset" xsi:type="string">active_sales_rule_with_complex_conditions</data> <data name="salesRule/data/conditions_serialized" xsi:type="string">{Conditions combination:[[Shipping Method|is|\[flatrate\] Fixed][Shipping Postcode|is|95814][Shipping State/Province|is|California][Shipping Country|is|United States]]}</data> <data name="salesRule/data/simple_action" xsi:type="string">Buy X get Y free (discount amount is Y)</data> <data name="salesRule/data/discount_amount" xsi:type="string">1</data> diff --git a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestStep/CreateSalesRuleStep.php b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestStep/CreateSalesRuleStep.php index c9b0fc028347378c2a6f19048cbf3ae80905c898..56db436ccb68d969073310fe69e0278936c1ef75 100644 --- a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestStep/CreateSalesRuleStep.php +++ b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestStep/CreateSalesRuleStep.php @@ -61,7 +61,7 @@ class CreateSalesRuleStep implements TestStepInterface if ($this->salesRule !== null) { $salesRule = $this->fixtureFactory->createByCode( 'salesRule', - ['dataSet' => $this->salesRule] + ['dataset' => $this->salesRule] ); $salesRule->persist(); $result['salesRule'] = $salesRule; diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/TestCase/CreateShipmentEntityTest.php b/dev/tests/functional/tests/app/Magento/Shipping/Test/TestCase/CreateShipmentEntityTest.php index 4391265ca5bb52050392431e47f82ae69c2fbd1c..9402ee203c7ad8d68c83bc3b46997afdbe5790e2 100644 --- a/dev/tests/functional/tests/app/Magento/Shipping/Test/TestCase/CreateShipmentEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/TestCase/CreateShipmentEntityTest.php @@ -19,7 +19,7 @@ use Magento\Mtf\TestCase\Injectable; * 1. Go to Sales > Orders. * 2. Select created order in the grid and open it. * 3. Click 'Ship' button. - * 4. Fill data according to dataSet. + * 4. Fill data according to dataset. * 5. Click 'Submit Shipment' button. * 6. Perform all asserts. * diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/TestCase/CreateShipmentEntityTest.xml b/dev/tests/functional/tests/app/Magento/Shipping/Test/TestCase/CreateShipmentEntityTest.xml index aeb61fe1fc158c20a7d238ef8487dd56417c255d..ac41244817e64fce529f733db55a2cc3471e4cf5 100644 --- a/dev/tests/functional/tests/app/Magento/Shipping/Test/TestCase/CreateShipmentEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/TestCase/CreateShipmentEntityTest.xml @@ -9,7 +9,7 @@ <testCase name="Magento\Shipping\Test\TestCase\CreateShipmentEntityTest"> <variation name="CreateShipmentEntityTestVariation1"> <data name="description" xsi:type="string">shipment with tracking number</data> - <data name="order/dataSet" xsi:type="string">default</data> + <data name="order/dataset" xsi:type="string">default</data> <data name="order/data/entity_id/products" xsi:type="string">catalogProductSimple::default</data> <data name="order/data/total_qty_ordered/0" xsi:type="string">1</data> <data name="data/items_data/0/qty" xsi:type="string">-</data> @@ -26,7 +26,7 @@ </variation> <variation name="CreateShipmentEntityTestVariation2"> <data name="description" xsi:type="string">partial shipment</data> - <data name="order/dataSet" xsi:type="string">default</data> + <data name="order/dataset" xsi:type="string">default</data> <data name="order/data/entity_id/products" xsi:type="string">catalogProductSimple::product_100_dollar</data> <data name="order/data/total_qty_ordered/0" xsi:type="string">1</data> <data name="data/items_data/0/qty" xsi:type="string">1</data> diff --git a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Fixture/Sitemap.xml b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Fixture/Sitemap.xml index 6927691a7aa8e27bc0be0ff11dd70d694724a917..b225aa55e33a795662f055396f7dbaa6f89409dd 100644 --- a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Fixture/Sitemap.xml +++ b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Fixture/Sitemap.xml @@ -6,28 +6,19 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="sitemap" module="Magento_Sitemap" type="flat" entity_type="sitemap" collection="Magento\Sitemap\Model\Resource\Sitemap\Collection" repository_class="Magento\Sitemap\Test\Repository\Sitemap" handler_interface="Magento\Sitemap\Test\Handler\Sitemap\SitemapInterface" class="Magento\Sitemap\Test\Fixture\Sitemap"> - <dataset name="default"> - <field name="sitemap_filename" xsi:type="string">sitemap.xml</field> - <field name="sitemap_path" xsi:type="string">/</field> - </dataset> - <field name="sitemap_id" is_required="1"> - <default_value xsi:type="null"/> - </field> - <field name="sitemap_type" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="sitemap_filename" is_required=""> - <default_value xsi:type="string">sitemap.xml</default_value> - </field> - <field name="sitemap_path" is_required=""> - <default_value xsi:type="string">/</default_value> - </field> - <field name="sitemap_time" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="store_id" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - </fixture> + <fixture name="sitemap" + module="Magento_Sitemap" + type="flat" + entity_type="sitemap" + collection="Magento\Sitemap\Model\Resource\Sitemap\Collection" + repository_class="Magento\Sitemap\Test\Repository\Sitemap" + handler_interface="Magento\Sitemap\Test\Handler\Sitemap\SitemapInterface" + class="Magento\Sitemap\Test\Fixture\Sitemap"> + <field name="sitemap_id" is_required="1" /> + <field name="sitemap_type" is_required="" /> + <field name="sitemap_filename" is_required="" /> + <field name="sitemap_path" is_required="" /> + <field name="sitemap_time" is_required="" /> + <field name="store_id" is_required="" /> + </fixture> </config> diff --git a/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/DeleteSitemapEntityTest.xml b/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/DeleteSitemapEntityTest.xml index 5e7be0f681c8883a50f2925e33a5d3f846921227..e204dd90f9a2fb77320a1d7930239518511c1fb6 100644 --- a/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/DeleteSitemapEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/DeleteSitemapEntityTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Sitemap\Test\TestCase\DeleteSitemapEntityTest"> <variation name="DeleteSitemapEntityTestVariation1"> - <data name="sitemap/dataSet" xsi:type="string">default</data> + <data name="sitemap/dataset" xsi:type="string">default</data> <constraint name="Magento\Sitemap\Test\Constraint\AssertSitemapSuccessDeleteMessage"/> <constraint name="Magento\Sitemap\Test\Constraint\AssertSitemapNotInGrid"/> </variation> diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Fixture/Store.xml b/dev/tests/functional/tests/app/Magento/Store/Test/Fixture/Store.xml index 35dce3f104254db6dadc6df1f3c2a677b729ee84..51c3f79b2b90170bb3afc99d24f531802f94dcd3 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Fixture/Store.xml +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Fixture/Store.xml @@ -6,38 +6,20 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="store" module="Magento_Store" type="flat" entity_type="store" collection="Magento\Store\Model\Resource\Store\Collection" repository_class="Magento\Store\Test\Repository\Store" handler_interface="Magento\Store\Test\Handler\Store\StoreInterface" class="Magento\Store\Test\Fixture\Store"> - <dataset name="default"> - <field name="group_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> - </field> - <field name="name" xsi:type="string">Default Store View</field> - <field name="code" xsi:type="string">default</field> - <field name="is_active" xsi:type="string">Enabled</field> - <field name="store_id" xsi:type="string">1</field> - </dataset> - <field name="store_id" is_required="1"> - <default_value xsi:type="string">1</default_value> - </field> - <field name="code" is_required=""> - <default_value xsi:type="string">default</default_value> - </field> - <field name="website_id" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="group_id" is_required="" source="Magento\Store\Test\Fixture\Store\GroupId"> - <default_value xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> - </default_value> - </field> - <field name="name" is_required=""> - <default_value xsi:type="string">Default Store View</default_value> - </field> - <field name="sort_order" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="is_active" is_required=""> - <default_value xsi:type="string">Enabled</default_value> - </field> + <fixture name="store" + module="Magento_Store" + type="flat" + entity_type="store" + collection="Magento\Store\Model\Resource\Store\Collection" + repository_class="Magento\Store\Test\Repository\Store" + handler_interface="Magento\Store\Test\Handler\Store\StoreInterface" + class="Magento\Store\Test\Fixture\Store"> + <field name="store_id" is_required="1" /> + <field name="code" is_required="" /> + <field name="website_id" is_required="" /> + <field name="group_id" is_required="" source="Magento\Store\Test\Fixture\Store\GroupId" /> + <field name="name" is_required="" /> + <field name="sort_order" is_required="" /> + <field name="is_active" is_required="" /> </fixture> </config> diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Fixture/Store/GroupId.php b/dev/tests/functional/tests/app/Magento/Store/Test/Fixture/Store/GroupId.php index 9ec18c42b26f24c545930874d1c8bee6f100469c..ef38ef4250823ef010eef7e2586a9954b2f47074 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Fixture/Store/GroupId.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Fixture/Store/GroupId.php @@ -6,40 +6,24 @@ namespace Magento\Store\Test\Fixture\Store; -use Magento\Store\Test\Fixture\StoreGroup; +use Magento\Mtf\Fixture\DataSource; use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Mtf\Fixture\FixtureInterface; +use Magento\Store\Test\Fixture\StoreGroup; /** - * Class GroupId - * Prepare StoreGroup for Store + * Prepare StoreGroup for Store. */ -class GroupId implements FixtureInterface +class GroupId extends DataSource { /** - * Prepared dataSet data - * - * @var array - */ - protected $data; - - /** - * Data set configuration settings - * - * @var array - */ - protected $params; - - /** - * StoreGroup fixture + * StoreGroup fixture. * * @var StoreGroup */ protected $storeGroup; /** - * Constructor - * + * @constructor * @param FixtureFactory $fixtureFactory * @param array $params * @param array $data [optional] @@ -47,8 +31,8 @@ class GroupId implements FixtureInterface public function __construct(FixtureFactory $fixtureFactory, array $params, array $data = []) { $this->params = $params; - if (isset($data['dataSet'])) { - $storeGroup = $fixtureFactory->createByCode('storeGroup', ['dataSet' => $data['dataSet']]); + if (isset($data['dataset'])) { + $storeGroup = $fixtureFactory->createByCode('storeGroup', ['dataset' => $data['dataset']]); /** @var StoreGroup $storeGroup */ if (!$storeGroup->getGroupId()) { $storeGroup->persist(); @@ -58,39 +42,6 @@ class GroupId implements FixtureInterface } } - /** - * 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 * diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Fixture/StoreGroup.xml b/dev/tests/functional/tests/app/Magento/Store/Test/Fixture/StoreGroup.xml index c64a13ab523e9a397ead7206552d704e33ba31b7..c1fa4d6a8ac0fc0b67acae2f0013a9411b91b1d7 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Fixture/StoreGroup.xml +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Fixture/StoreGroup.xml @@ -6,34 +6,18 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="storeGroup" module="Magento_Store" type="flat" entity_type="store_group" collection="Magento\Store\Model\Resource\Group\Collection" identifier="" repository_class="Magento\Store\Test\Repository\StoreGroup" handler_interface="Magento\Store\Test\Handler\StoreGroup\StoreGroupInterface" class="Magento\Store\Test\Fixture\StoreGroup"> - <dataset name="default"> - <field name="website_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">main_website</item> - </field> - <field name="name" xsi:type="string">StoreGroup%isolation%</field> - <field name="root_category_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default_category</item> - </field> - </dataset> - <field name="group_id" is_required="1"> - <default_value xsi:type="null" /> - </field> - <field name="website_id" source="Magento\Store\Test\Fixture\StoreGroup\WebsiteId"> - <default_value xsi:type="array"> - <item name="dataSet" xsi:type="string">main_website</item> - </default_value> - </field> - <field name="name" is_required=""> - <default_value xsi:type="string">StoreGroup%isolation%</default_value> - </field> - <field name="root_category_id" source="Magento\Store\Test\Fixture\StoreGroup\CategoryId"> - <default_value xsi:type="array"> - <item name="dataSet" xsi:type="string">default_category</item> - </default_value> - </field> - <field name="default_store_id" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> + <fixture name="storeGroup" + module="Magento_Store" + type="flat" + entity_type="store_group" + collection="Magento\Store\Model\Resource\Group\Collection" + repository_class="Magento\Store\Test\Repository\StoreGroup" + handler_interface="Magento\Store\Test\Handler\StoreGroup\StoreGroupInterface" + class="Magento\Store\Test\Fixture\StoreGroup"> + <field name="group_id" is_required="1" /> + <field name="website_id" source="Magento\Store\Test\Fixture\StoreGroup\WebsiteId" /> + <field name="name" is_required="" /> + <field name="root_category_id" source="Magento\Store\Test\Fixture\StoreGroup\CategoryId" /> + <field name="default_store_id" is_required="" /> </fixture> </config> diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Fixture/StoreGroup/CategoryId.php b/dev/tests/functional/tests/app/Magento/Store/Test/Fixture/StoreGroup/CategoryId.php index ca4f11663f342c31e17e4a34188a980fd3c6cb59..23c3fa9a3850855f76cddf28e2afbb649ecd8746 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Fixture/StoreGroup/CategoryId.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Fixture/StoreGroup/CategoryId.php @@ -6,30 +6,15 @@ namespace Magento\Store\Test\Fixture\StoreGroup; -use Magento\Catalog\Test\Fixture\Category; +use Magento\Mtf\Fixture\DataSource; use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Mtf\Fixture\FixtureInterface; +use Magento\Catalog\Test\Fixture\Category; /** - * Class CategoryId - * Prepare CategoryId for Store Group + * Prepare CategoryId for Store Group. */ -class CategoryId implements FixtureInterface +class CategoryId extends DataSource { - /** - * Prepared dataSet data - * - * @var array - */ - protected $data; - - /** - * Data set configuration settings - * - * @var array - */ - protected $params; - /** * Category fixture * @@ -38,8 +23,7 @@ class CategoryId implements FixtureInterface protected $category; /** - * Constructor - * + * @constructor * @param FixtureFactory $fixtureFactory * @param array $params * @param array $data [optional] @@ -47,8 +31,8 @@ class CategoryId implements FixtureInterface public function __construct(FixtureFactory $fixtureFactory, array $params, array $data = []) { $this->params = $params; - if (isset($data['dataSet'])) { - $category = $fixtureFactory->createByCode('category', ['dataSet' => $data['dataSet']]); + if (isset($data['dataset'])) { + $category = $fixtureFactory->createByCode('category', ['dataset' => $data['dataset']]); /** @var Category $category */ if (!$category->getId()) { $category->persist(); @@ -58,39 +42,6 @@ class CategoryId implements FixtureInterface } } - /** - * 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 Category fixture * diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Fixture/StoreGroup/WebsiteId.php b/dev/tests/functional/tests/app/Magento/Store/Test/Fixture/StoreGroup/WebsiteId.php index 36e20106ce00ee2eec6ab81e5d5150a5df11d2ae..448a55ced512c4f679b1fb9185a97cbfd880a621 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Fixture/StoreGroup/WebsiteId.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Fixture/StoreGroup/WebsiteId.php @@ -6,40 +6,24 @@ namespace Magento\Store\Test\Fixture\StoreGroup; +use Magento\Mtf\Fixture\DataSource; use Magento\Store\Test\Fixture\Website; use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Mtf\Fixture\FixtureInterface; /** - * Class WebsiteId - * Prepare WebsiteId for Store Group + * Prepare WebsiteId for Store Group. */ -class WebsiteId implements FixtureInterface +class WebsiteId extends DataSource { /** - * Prepared dataSet data - * - * @var array - */ - protected $data; - - /** - * Data set configuration settings - * - * @var array - */ - protected $params; - - /** - * Website fixture + * Website fixture. * * @var Website */ protected $website; /** - * Constructor - * + * @constructor * @param FixtureFactory $fixtureFactory * @param array $params * @param array $data [optional] @@ -47,8 +31,8 @@ class WebsiteId implements FixtureInterface public function __construct(FixtureFactory $fixtureFactory, array $params, array $data = []) { $this->params = $params; - if (isset($data['dataSet'])) { - $website = $fixtureFactory->createByCode('website', ['dataSet' => $data['dataSet']]); + if (isset($data['dataset'])) { + $website = $fixtureFactory->createByCode('website', ['dataset' => $data['dataset']]); /** @var Website $website */ if (!$website->getWebsiteId()) { $website->persist(); @@ -58,39 +42,6 @@ class WebsiteId implements FixtureInterface } } - /** - * 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 * diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Fixture/Website.xml b/dev/tests/functional/tests/app/Magento/Store/Test/Fixture/Website.xml index 4614615109090b72d4e458a5162dd6b788fd0776..574f78cb6bc84bd254f17dbf3ad12f0fb3f4dc5d 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Fixture/Website.xml +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Fixture/Website.xml @@ -6,29 +6,20 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="website" module="Magento_Store" type="flat" entity_type="store_website" collection="Magento\Store\Model\Resource\Website\Collection" identifier="code" repository_class="Magento\Store\Test\Repository\Website" handler_interface="Magento\Store\Test\Handler\Website\WebsiteInterface" class="Magento\Store\Test\Fixture\Website"> - <dataset name="default"> - <field name="name" xsi:type="string">Main Website</field> - <field name="code" xsi:type="string">base</field> - <field name="website_id" xsi:type="string">1</field> - </dataset> - <field name="website_id" is_required="1"> - <default_value xsi:type="string">1</default_value> - </field> - <field name="code" is_required=""> - <default_value xsi:type="string">base</default_value> - </field> - <field name="name" is_required=""> - <default_value xsi:type="string">Main Website</default_value> - </field> - <field name="sort_order" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="default_group_id" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="is_default" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> + <fixture name="website" + module="Magento_Store" + type="flat" + entity_type="store_website" + collection="Magento\Store\Model\Resource\Website\Collection" + identifier="code" + repository_class="Magento\Store\Test\Repository\Website" + handler_interface="Magento\Store\Test\Handler\Website\WebsiteInterface" + class="Magento\Store\Test\Fixture\Website"> + <field name="website_id" is_required="1" /> + <field name="code" is_required="" /> + <field name="name" is_required="" /> + <field name="sort_order" is_required="" /> + <field name="default_group_id" is_required="" /> + <field name="is_default" is_required="" /> </fixture> </config> diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Repository/Store.xml b/dev/tests/functional/tests/app/Magento/Store/Test/Repository/Store.xml index a04123718ed74d688f24ad8b433811a628116b63..f14e959ce90cb0b427f74598ca9db7459259c828 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Repository/Store.xml +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Repository/Store.xml @@ -9,7 +9,7 @@ <repository class="Magento\Store\Test\Repository\Store"> <dataset name="default"> <field name="group_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="name" xsi:type="string">Default Store View</field> <field name="code" xsi:type="string">base</field> @@ -19,7 +19,7 @@ <dataset name="custom"> <field name="group_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="name" xsi:type="string">Custom_Store_%isolation%</field> <field name="code" xsi:type="string">code_%isolation%</field> @@ -31,14 +31,14 @@ <field name="store_id" xsi:type="string">1</field> </dataset> - <dataset name="All Store Views"> + <dataset name="all_store_views"> <field name="name" xsi:type="string">All Store Views</field> <field name="store_id" xsi:type="string">0</field> </dataset> <dataset name="german"> <field name="group_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default</item> + <item name="dataset" xsi:type="string">default</item> </field> <field name="name" xsi:type="string">DE%isolation%</field> <field name="code" xsi:type="string">de%isolation%</field> diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Repository/StoreGroup.xml b/dev/tests/functional/tests/app/Magento/Store/Test/Repository/StoreGroup.xml index 286213fdb3c2e4a1474b8f091de06e7a959d3f18..b04cb4b8af12cd7d61dcd23f704dde49b78037ed 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Repository/StoreGroup.xml +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Repository/StoreGroup.xml @@ -9,22 +9,22 @@ <repository class="Magento\Store\Test\Repository\StoreGroup"> <dataset name="default"> <field name="website_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">main_website</item> + <item name="dataset" xsi:type="string">main_website</item> </field> <field name="name" xsi:type="string">Main Website Store</field> <field name="group_id" xsi:type="string">1</field> <field name="root_category_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default_category</item> + <item name="dataset" xsi:type="string">default_category</item> </field> </dataset> <dataset name="custom"> <field name="website_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">main_website</item> + <item name="dataset" xsi:type="string">main_website</item> </field> <field name="name" xsi:type="string">store_name_%isolation%</field> <field name="root_category_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">default_category</item> + <item name="dataset" xsi:type="string">default_category</item> </field> </dataset> </repository> diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Repository/Website.xml b/dev/tests/functional/tests/app/Magento/Store/Test/Repository/Website.xml index 6c33406d71eb27d441965bbf7f93c2799e21ea38..15313c96f297b745ce30b1c3fcd153e3478de987 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Repository/Website.xml +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Repository/Website.xml @@ -7,6 +7,12 @@ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> <repository class="Magento\Store\Test\Repository\Website"> + <dataset name="default"> + <field name="name" xsi:type="string">Main Website</field> + <field name="code" xsi:type="string">base</field> + <field name="website_id" xsi:type="string">1</field> + </dataset> + <dataset name="all_websites"> <field name="name" xsi:type="string">All Websites</field> <field name="website_id" xsi:type="string">0</field> diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateStoreEntityTest.xml b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateStoreEntityTest.xml index 4ba86215b1c13a8851f4300298bd825521f0e341..a6bf8369d64d88f54213c82b592ab0a5db6aeff7 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateStoreEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateStoreEntityTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Store\Test\TestCase\CreateStoreEntityTest"> <variation name="CreateStoreEntityTestVariation1"> - <data name="store/data/group_id/dataSet" xsi:type="string">default</data> + <data name="store/data/group_id/dataset" xsi:type="string">default</data> <data name="store/data/name" xsi:type="string">store_name_%isolation%</data> <data name="store/data/code" xsi:type="string">storecode_%isolation%</data> <data name="store/data/is_active" xsi:type="string">Enabled</data> @@ -19,7 +19,7 @@ <constraint name="Magento\Store\Test\Constraint\AssertStoreFrontend" /> </variation> <variation name="CreateStoreEntityTestVariation2"> - <data name="store/data/group_id/dataSet" xsi:type="string">default</data> + <data name="store/data/group_id/dataset" xsi:type="string">default</data> <data name="store/data/name" xsi:type="string">store_name_%isolation%</data> <data name="store/data/code" xsi:type="string">storecode_%isolation%</data> <data name="store/data/is_active" xsi:type="string">Disabled</data> @@ -30,7 +30,7 @@ <constraint name="Magento\Store\Test\Constraint\AssertStoreNotOnFrontend" /> </variation> <variation name="CreateStoreEntityTestVariation3"> - <data name="store/data/group_id/dataSet" xsi:type="string">custom</data> + <data name="store/data/group_id/dataset" xsi:type="string">custom</data> <data name="store/data/name" xsi:type="string">store_name_%isolation%</data> <data name="store/data/code" xsi:type="string">storecode_%isolation%</data> <data name="store/data/is_active" xsi:type="string">Enabled</data> @@ -42,7 +42,7 @@ </variation> <variation name="CreateStoreEntityTestVariation4"> <data name="description" xsi:type="string">MAGETWO-12405: Create New Localized Store View</data> - <data name="store/data/group_id/dataSet" xsi:type="string">default</data> + <data name="store/data/group_id/dataset" xsi:type="string">default</data> <data name="store/data/name" xsi:type="string">DE_%isolation%</data> <data name="store/data/code" xsi:type="string">de_%isolation%</data> <data name="store/data/is_active" xsi:type="string">Enabled</data> diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateStoreGroupEntityTest.xml b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateStoreGroupEntityTest.xml index 9e96f8393d8da50be3c18f3147aa9b2af0bbba63..117b2010f23c79a5f50e25ca6bd3fcd610024d86 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateStoreGroupEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateStoreGroupEntityTest.xml @@ -8,18 +8,18 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Store\Test\TestCase\CreateStoreGroupEntityTest"> <variation name="CreateStoreGroupEntityTestVariation1"> - <data name="storeGroup/data/website_id/dataSet" xsi:type="string">main_website</data> + <data name="storeGroup/data/website_id/dataset" xsi:type="string">main_website</data> <data name="storeGroup/data/name" xsi:type="string">store_name_%isolation%</data> - <data name="storeGroup/data/root_category_id/dataSet" xsi:type="string">default_category</data> + <data name="storeGroup/data/root_category_id/dataset" xsi:type="string">default_category</data> <constraint name="Magento\Store\Test\Constraint\AssertStoreGroupSuccessSaveMessage"/> <constraint name="Magento\Store\Test\Constraint\AssertStoreGroupInGrid"/> <constraint name="Magento\Store\Test\Constraint\AssertStoreGroupForm"/> <constraint name="Magento\Store\Test\Constraint\AssertStoreGroupOnStoreViewForm"/> </variation> <variation name="CreateStoreGroupEntityTestVariation2"> - <data name="storeGroup/data/website_id/dataSet" xsi:type="string">custom_website</data> + <data name="storeGroup/data/website_id/dataset" xsi:type="string">custom_website</data> <data name="storeGroup/data/name" xsi:type="string">store_name_%isolation%</data> - <data name="storeGroup/data/root_category_id/dataSet" xsi:type="string">root_category</data> + <data name="storeGroup/data/root_category_id/dataset" xsi:type="string">root_category</data> <constraint name="Magento\Store\Test\Constraint\AssertStoreGroupSuccessSaveMessage"/> <constraint name="Magento\Store\Test\Constraint\AssertStoreGroupInGrid"/> <constraint name="Magento\Store\Test\Constraint\AssertStoreGroupForm"/> diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteStoreEntityTest.php b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteStoreEntityTest.php index debf3cb6b6ea0e48cfd7c35629d4daee1b899eec..e6a8f499b7a30e4f8784049b98ddf6c607af825f 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteStoreEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteStoreEntityTest.php @@ -25,7 +25,7 @@ use Magento\Mtf\TestCase\Injectable; * 2. Go to Stores -> All Stores * 3. Open created store view * 4. Click "Delete Store View" - * 5. Set "Create DB Backup" according to dataSet + * 5. Set "Create DB Backup" according to dataset * 6. Click "Delete Store View" * 7. Perform all assertions * diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteStoreEntityTest.xml b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteStoreEntityTest.xml index 8abbb20c16e260f3e282383587940bbca176f7b7..a81812963821bbdf448ea7a1eab8a2cf21a6dfe8 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteStoreEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteStoreEntityTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Store\Test\TestCase\DeleteStoreEntityTest"> <variation name="DeleteStoreEntityTestVariation1"> - <data name="store/dataSet" xsi:type="string">custom</data> + <data name="store/dataset" xsi:type="string">custom</data> <data name="createBackup" xsi:type="string">Yes</data> <constraint name="Magento\Store\Test\Constraint\AssertStoreSuccessDeleteAndBackupMessages"/> <constraint name="Magento\Store\Test\Constraint\AssertStoreNotInGrid"/> @@ -16,7 +16,7 @@ <constraint name="Magento\Store\Test\Constraint\AssertStoreNotOnFrontend"/> </variation> <variation name="DeleteStoreEntityTestVariation2"> - <data name="store/dataSet" xsi:type="string">custom</data> + <data name="store/dataset" xsi:type="string">custom</data> <data name="createBackup" xsi:type="string">No</data> <constraint name="Magento\Store\Test\Constraint\AssertStoreSuccessDeleteMessage"/> <constraint name="Magento\Store\Test\Constraint\AssertStoreNotInGrid"/> diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteStoreGroupEntityTest.xml b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteStoreGroupEntityTest.xml index 26afef08b4b80bce52d673d10e9e9054794de0a5..c7f54be88b9be172f9d664522f2019fcf9dcd0fe 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteStoreGroupEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteStoreGroupEntityTest.xml @@ -8,14 +8,14 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Store\Test\TestCase\DeleteStoreGroupEntityTest"> <variation name="DeleteStoreGroupEntityTestVariation1"> - <data name="storeGroup/dataSet" xsi:type="string">custom</data> + <data name="storeGroup/dataset" xsi:type="string">custom</data> <data name="createBackup" xsi:type="string">Yes</data> <constraint name="Magento\Store\Test\Constraint\AssertStoreGroupSuccessDeleteAndBackupMessages"/> <constraint name="Magento\Store\Test\Constraint\AssertStoreGroupNotInGrid"/> <constraint name="Magento\Backup\Test\Constraint\AssertBackupInGrid"/> </variation> <variation name="DeleteStoreGroupEntityTestVariation2"> - <data name="storeGroup/dataSet" xsi:type="string">custom</data> + <data name="storeGroup/dataset" xsi:type="string">custom</data> <data name="createBackup" xsi:type="string">No</data> <constraint name="Magento\Store\Test\Constraint\AssertStoreGroupSuccessDeleteMessage"/> <constraint name="Magento\Store\Test\Constraint\AssertStoreGroupNotInGrid"/> diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteWebsiteEntityTest.xml b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteWebsiteEntityTest.xml index ccccd1f1718947d2a45bb2702392d3a92cb9242f..e1e5a410e5e5ab2805cad9eefdb6ff5c5c2d20e6 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteWebsiteEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteWebsiteEntityTest.xml @@ -8,14 +8,14 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Store\Test\TestCase\DeleteWebsiteEntityTest"> <variation name="DeleteWebsiteEntityTestVariation1"> - <data name="website/dataSet" xsi:type="string">custom_website</data> + <data name="website/dataset" xsi:type="string">custom_website</data> <data name="createBackup" xsi:type="string">Yes</data> <constraint name="Magento\Store\Test\Constraint\AssertWebsiteSuccessDeleteAndBackupMessages"/> <constraint name="Magento\Store\Test\Constraint\AssertWebsiteNotInGrid"/> <constraint name="Magento\Backup\Test\Constraint\AssertBackupInGrid"/> </variation> <variation name="DeleteWebsiteEntityTestVariation2"> - <data name="website/dataSet" xsi:type="string">custom_website</data> + <data name="website/dataset" xsi:type="string">custom_website</data> <data name="createBackup" xsi:type="string">No</data> <constraint name="Magento\Store\Test\Constraint\AssertWebsiteSuccessDeleteMessage"/> <constraint name="Magento\Store\Test\Constraint\AssertWebsiteNotInGrid"/> diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateStoreEntityTest.xml b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateStoreEntityTest.xml index f6e5f58018e76bc67c321bbd71bec916dfade6bc..b3102104f5bb126a83fd0a486eb78fcc9b676ccb 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateStoreEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateStoreEntityTest.xml @@ -8,8 +8,8 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Store\Test\TestCase\UpdateStoreEntityTest"> <variation name="UpdateStoreEntityTestVariation1"> - <data name="storeInitial/dataSet" xsi:type="string">custom</data> - <data name="store/data/group_id/dataSet" xsi:type="string">default</data> + <data name="storeInitial/dataset" xsi:type="string">custom</data> + <data name="store/data/group_id/dataset" xsi:type="string">default</data> <data name="store/data/name" xsi:type="string">storename_updated%isolation%</data> <data name="store/data/code" xsi:type="string">storecode_updated%isolation%</data> <data name="store/data/is_active" xsi:type="string">Enabled</data> diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateStoreGroupEntityTest.xml b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateStoreGroupEntityTest.xml index 01bf7915792be4d2ef94985c4e5663236bd975c7..45aba74539d910bf799cca6e1c1fb10a308326b5 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateStoreGroupEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateStoreGroupEntityTest.xml @@ -8,20 +8,20 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Store\Test\TestCase\UpdateStoreGroupEntityTest"> <variation name="UpdateStoreGroupEntityTestVariation1"> - <data name="storeGroupOrigin/dataSet" xsi:type="string">custom</data> - <data name="storeGroup/data/website_id/dataSet" xsi:type="string">main_website</data> + <data name="storeGroupOrigin/dataset" xsi:type="string">custom</data> + <data name="storeGroup/data/website_id/dataset" xsi:type="string">main_website</data> <data name="storeGroup/data/name" xsi:type="string">store_name_updated_%isolation%</data> - <data name="storeGroup/data/root_category_id/dataSet" xsi:type="string">default_category</data> + <data name="storeGroup/data/root_category_id/dataset" xsi:type="string">default_category</data> <constraint name="Magento\Store\Test\Constraint\AssertStoreGroupSuccessSaveMessage"/> <constraint name="Magento\Store\Test\Constraint\AssertStoreGroupInGrid"/> <constraint name="Magento\Store\Test\Constraint\AssertStoreGroupForm"/> <constraint name="Magento\Store\Test\Constraint\AssertStoreGroupOnStoreViewForm"/> </variation> <variation name="UpdateStoreGroupEntityTestVariation2"> - <data name="storeGroupOrigin/dataSet" xsi:type="string">custom</data> - <data name="storeGroup/data/website_id/dataSet" xsi:type="string">custom_website</data> + <data name="storeGroupOrigin/dataset" xsi:type="string">custom</data> + <data name="storeGroup/data/website_id/dataset" xsi:type="string">custom_website</data> <data name="storeGroup/data/name" xsi:type="string">store_name_updated_%isolation%</data> - <data name="storeGroup/data/root_category_id/dataSet" xsi:type="string">root_category</data> + <data name="storeGroup/data/root_category_id/dataset" xsi:type="string">root_category</data> <constraint name="Magento\Store\Test\Constraint\AssertStoreGroupSuccessSaveMessage"/> <constraint name="Magento\Store\Test\Constraint\AssertStoreGroupInGrid"/> <constraint name="Magento\Store\Test\Constraint\AssertStoreGroupForm"/> diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateWebsiteEntityTest.xml b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateWebsiteEntityTest.xml index 4190be02bea35a4ccbd2271e5bf8919ef37a6a87..a0ed810288afe88d3c079dfa53f6293c9d9b16d9 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateWebsiteEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateWebsiteEntityTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Store\Test\TestCase\UpdateWebsiteEntityTest"> <variation name="UpdateWebsiteEntityTestVariation1"> - <data name="websiteOrigin/dataSet" xsi:type="string">custom_website</data> + <data name="websiteOrigin/dataset" xsi:type="string">custom_website</data> <data name="website/data/name" xsi:type="string">website_upd%isolation%</data> <data name="website/data/code" xsi:type="string">code_upd%isolation%</data> <constraint name="Magento\Store\Test\Constraint\AssertWebsiteSuccessSaveMessage"/> diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AbstractAssertOrderTaxOnBackend.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AbstractAssertOrderTaxOnBackend.php index f5d516b6f69577f9854dc805ab8d233ed857f4d5..1c93dc11aeee2217b014a1eec4e184d43b7d529f 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AbstractAssertOrderTaxOnBackend.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AbstractAssertOrderTaxOnBackend.php @@ -100,36 +100,35 @@ abstract class AbstractAssertOrderTaxOnBackend extends AbstractConstraint $actualPrices = $this->getOrderTotals($actualPrices); $prices = $this->preparePrices($prices); $message = 'Prices on order view page should be equal to defined in dataset.'; - \PHPUnit_Framework_Assert::assertEquals($prices, $actualPrices, $message); + \PHPUnit_Framework_Assert::assertEquals($prices, array_filter($actualPrices), $message); $salesOrderView->getPageActions()->invoice(); //Check prices on invoice creation page $actualPrices = []; $actualPrices = $this->getInvoiceNewPrices($actualPrices, $product); $actualPrices = $this->getInvoiceNewTotals($actualPrices); $message = 'Prices on invoice new page should be equal to defined in dataset.'; - \PHPUnit_Framework_Assert::assertEquals($prices, $actualPrices, $message); + \PHPUnit_Framework_Assert::assertEquals($prices, array_filter($actualPrices), $message); $orderInvoiceNew->getTotalsBlock()->submit(); //Check prices after invoice on order page $actualPrices = []; $actualPrices = $this->getOrderPrices($actualPrices, $product); $actualPrices = $this->getOrderTotals($actualPrices); $message = 'Prices on invoice page should be equal to defined in dataset.'; - \PHPUnit_Framework_Assert::assertEquals($prices, $actualPrices, $message); + \PHPUnit_Framework_Assert::assertEquals($prices, array_filter($actualPrices), $message); $salesOrderView->getPageActions()->orderCreditMemo(); //Check prices on credit memo creation page - $pricesCreditMemo = $this->preparePricesCreditMemo($prices); $actualPrices = []; $actualPrices = $this->getCreditMemoNewPrices($actualPrices, $product); $actualPrices = $this->getCreditMemoNewTotals($actualPrices); $message = 'Prices on credit memo new page should be equal to defined in dataset.'; - \PHPUnit_Framework_Assert::assertEquals($pricesCreditMemo, $actualPrices, $message); + \PHPUnit_Framework_Assert::assertEquals($prices, array_filter($actualPrices), $message); $orderCreditMemoNew->getFormBlock()->submit(); //Check prices after refund on order page $actualPrices = []; $actualPrices = $this->getOrderPrices($actualPrices, $product); $actualPrices = $this->getOrderTotals($actualPrices); $message = 'Prices on credit memo page should be equal to defined in dataset.'; - \PHPUnit_Framework_Assert::assertEquals($prices, $actualPrices, $message); + \PHPUnit_Framework_Assert::assertEquals($prices, array_filter($actualPrices), $message); } /** @@ -141,8 +140,10 @@ abstract class AbstractAssertOrderTaxOnBackend extends AbstractConstraint protected function preparePrices($prices) { $deletePrices = [ + 'category_special_price', 'category_price_excl_tax', 'category_price_incl_tax', + 'product_view_special_price', 'product_view_price_excl_tax', 'product_view_price_incl_tax' ]; @@ -155,19 +156,6 @@ abstract class AbstractAssertOrderTaxOnBackend extends AbstractConstraint return $prices; } - /** - * Unset category and product page expected prices. - * - * @param array $prices - * @return array - */ - protected function preparePricesCreditMemo($prices) - { - $prices['shipping_excl_tax'] = null; - $prices['shipping_incl_tax'] = null; - return $prices; - } - /** * Get order product prices. * diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AbstractAssertTaxCalculationAfterCheckout.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AbstractAssertTaxCalculationAfterCheckout.php index 4661c262f9cce06721c7518cb9da49f5b5aa06d1..3f3fe4e112b6b697a24d9be454a79330ada57671 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AbstractAssertTaxCalculationAfterCheckout.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AbstractAssertTaxCalculationAfterCheckout.php @@ -6,6 +6,7 @@ namespace Magento\Tax\Test\Constraint; +use Magento\Cms\Test\Page\CmsIndex; use Magento\Mtf\Constraint\AbstractConstraint; use Magento\Checkout\Test\Page\CheckoutCart; use Magento\Checkout\Test\Page\CheckoutOnepage; @@ -65,6 +66,7 @@ abstract class AbstractAssertTaxCalculationAfterCheckout extends AbstractConstra * @param CheckoutOnepage $checkoutOnepage * @param CheckoutOnepageSuccess $checkoutOnepageSuccess * @param CustomerOrderView $customerOrderView + * @param CmsIndex $cmsIndex * @return void */ public function processAssert( @@ -73,27 +75,32 @@ abstract class AbstractAssertTaxCalculationAfterCheckout extends AbstractConstra CheckoutCart $checkoutCart, CheckoutOnepage $checkoutOnepage, CheckoutOnepageSuccess $checkoutOnepageSuccess, - CustomerOrderView $customerOrderView + CustomerOrderView $customerOrderView, + CmsIndex $cmsIndex ) { $this->checkoutOnepage = $checkoutOnepage; $this->customerOrderView = $customerOrderView; $checkoutCart->getProceedToCheckoutBlock()->proceedToCheckout(); - $checkoutOnepage->getBillingBlock()->clickContinue(); + $cmsIndex->getCmsPageBlock()->waitPageInit(); + $shippingMethod = ['shipping_service' => 'Flat Rate', 'shipping_method' => 'Fixed']; $checkoutOnepage->getShippingMethodBlock()->selectShippingMethod($shippingMethod); $checkoutOnepage->getShippingMethodBlock()->clickContinue(); - $checkoutOnepage->getPaymentMethodsBlock()->selectPaymentMethod(['method' => 'check_money_order']); - $checkoutOnepage->getPaymentMethodsBlock()->clickContinue(); + $checkoutOnepage->getPaymentMethodsBlock()->selectPaymentMethod(['method' => 'checkmo']); $actualPrices = []; $actualPrices = $this->getReviewPrices($actualPrices, $product); $actualPrices = $this->getReviewTotals($actualPrices); $prices = $this->preparePrices($prices); //Order review prices verification $message = 'Prices on order review should be equal to defined in dataset.'; - \PHPUnit_Framework_Assert::assertEquals($prices, $actualPrices, $message); + \PHPUnit_Framework_Assert::assertEquals( + array_diff_key($prices, ['cart_item_price_excl_tax' => null, 'cart_item_price_incl_tax' => null]), + $actualPrices, + $message + ); - $checkoutOnepage->getReviewBlock()->placeOrder(); + $checkoutOnepage->getPaymentMethodsBlock()->placeOrder(); $checkoutOnepageSuccess->getSuccessBlock()->getGuestOrderId(); $checkoutOnepageSuccess->getSuccessBlock()->openOrder(); $actualPrices = []; @@ -109,23 +116,23 @@ abstract class AbstractAssertTaxCalculationAfterCheckout extends AbstractConstra * Prepare expected prices prices. * * @param array $prices - * @return array $prices + * @return array */ protected function preparePrices($prices) { - if (isset($prices['category_price_excl_tax'])) { - unset($prices['category_price_excl_tax']); - } - if (isset($prices['category_price_incl_tax'])) { - unset($prices['category_price_incl_tax']); - } - if (isset($prices['product_view_price_excl_tax'])) { - unset($prices['product_view_price_excl_tax']); - } - if (isset($prices['product_view_price_incl_tax'])) { - unset($prices['product_view_price_incl_tax']); - } - return $prices; + return array_diff_key( + $prices, + array_flip([ + 'category_price', + 'category_special_price', + 'category_price_excl_tax', + 'category_price_incl_tax', + 'product_view_price', + 'product_view_special_price', + 'product_view_price_excl_tax', + 'product_view_price_incl_tax' + ]) + ); } /** diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AbstractAssertTaxRuleIsAppliedToAllPrices.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AbstractAssertTaxRuleIsAppliedToAllPrices.php index 95ed90babd4f4d6a3177c53d2e607c3ec407b8ba..5620cefee21a44d70c27f0d1b8348d63abd1e42f 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AbstractAssertTaxRuleIsAppliedToAllPrices.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AbstractAssertTaxRuleIsAppliedToAllPrices.php @@ -109,7 +109,7 @@ abstract class AbstractAssertTaxRuleIsAppliedToAllPrices extends AbstractConstra $this->catalogProductView = $catalogProductView; $this->checkoutCart = $checkoutCart; //Preconditions - $address = $fixtureFactory->createByCode('address', ['dataSet' => 'US_address_NY']); + $address = $fixtureFactory->createByCode('address', ['dataset' => 'US_address_NY']); $shipping = ['shipping_service' => 'Flat Rate', 'shipping_method' => 'Fixed']; $actualPrices = []; //Assertion steps @@ -154,11 +154,11 @@ abstract class AbstractAssertTaxRuleIsAppliedToAllPrices extends AbstractConstra { $this->checkoutCart->open(); $actualPrices['cart_item_price_excl_tax'] = - $this->checkoutCart->getCartBlock()->getCartItem($product)->getPrice(); + $this->checkoutCart->getCartBlock()->getCartItem($product)->getPriceExclTax(); $actualPrices['cart_item_price_incl_tax'] = $this->checkoutCart->getCartBlock()->getCartItem($product)->getPriceInclTax(); $actualPrices['cart_item_subtotal_excl_tax'] = - $this->checkoutCart->getCartBlock()->getCartItem($product)->getSubtotalPrice(); + $this->checkoutCart->getCartBlock()->getCartItem($product)->getSubtotalPriceExclTax(); $actualPrices['cart_item_subtotal_incl_tax'] = $this->checkoutCart->getCartBlock()->getCartItem($product)->getSubtotalPriceInclTax(); diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxCalculationAfterCheckoutExcludingIncludingTax.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxCalculationAfterCheckoutExcludingIncludingTax.php index 57e9269dd9b79e95aae0572b97ce31d4dfefac14..b25d8698d16ee9fb56022ea737b90bb41f0dacc6 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxCalculationAfterCheckoutExcludingIncludingTax.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxCalculationAfterCheckoutExcludingIncludingTax.php @@ -48,7 +48,7 @@ class AssertTaxCalculationAfterCheckoutExcludingIncludingTax extends */ public function getOrderTotals($actualPrices) { - $viewBlock = $this->salesOrderView->getSalesOrderViewBlock(); + $viewBlock = $this->customerOrderView->getOrderViewBlock(); $actualPrices['subtotal_excl_tax'] = $viewBlock->getSubtotalExclTax(); $actualPrices['subtotal_incl_tax'] = $viewBlock->getSubtotalInclTax(); $actualPrices['discount'] = $viewBlock->getDiscount(); diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleApplying.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleApplying.php index 51476690a8897b2f9b745dc46fbab9c4a12a1955..51caa4822fa60fd38b18c1df6c132bfa8ec876e0 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleApplying.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleApplying.php @@ -117,7 +117,7 @@ abstract class AssertTaxRuleApplying extends AbstractConstraint $this->productSimple = $fixtureFactory->createByCode( 'catalogProductSimple', [ - 'dataSet' => 'product_100_dollar_for_tax_rule', + 'dataset' => 'product_100_dollar_for_tax_rule', 'data' => [ 'tax_class_id' => ['tax_product_class' => $taxProductClass], ] diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Fixture/TaxClass.xml b/dev/tests/functional/tests/app/Magento/Tax/Test/Fixture/TaxClass.xml index 30710bb5b2f81fc5e2f5f53025b9f6d5dc225476..7c33ce4479eb81b6e7c49a7fe8d4d648b088cade 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Fixture/TaxClass.xml +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Fixture/TaxClass.xml @@ -6,19 +6,17 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="taxClass" module="Magento_Tax" type="flat" entity_type="tax_class" collection="Magento\Tax\Model\Resource\TaxClass\Collection" identifier="" repository_class="Magento\Tax\Test\Repository\TaxClass" handler_interface="Magento\Tax\Test\Handler\TaxClass\TaxClassInterface" class="Magento\Tax\Test\Fixture\TaxClass"> - <dataset name="default"> - <field name="class_name" xsi:type="string">Tax Class %isolation%</field> - </dataset> - <field name="class_id" is_required="1"> - <default_value xsi:type="null"/> - </field> - <field name="class_name" is_required=""> - <default_value xsi:type="string">Tax Class %isolation%</default_value> - </field> - <field name="class_type" is_required=""> - <default_value xsi:type="string">CUSTOMER</default_value> - </field> - <field name="id"/> - </fixture> + <fixture name="taxClass" + module="Magento_Tax" + type="flat" + entity_type="tax_class" + collection="Magento\Tax\Model\Resource\TaxClass\Collection" + repository_class="Magento\Tax\Test\Repository\TaxClass" + handler_interface="Magento\Tax\Test\Handler\TaxClass\TaxClassInterface" + class="Magento\Tax\Test\Fixture\TaxClass"> + <field name="class_id" is_required="1" /> + <field name="class_name" is_required="" /> + <field name="class_type" is_required="" /> + <field name="id" /> + </fixture> </config> diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Fixture/TaxRate.xml b/dev/tests/functional/tests/app/Magento/Tax/Test/Fixture/TaxRate.xml index b9a4a30142690008bd8b142c8e8a74692b19307a..93925c39ddecd4a2749d9a74e8f72ea43f2926b2 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Fixture/TaxRate.xml +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Fixture/TaxRate.xml @@ -6,41 +6,24 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="taxRate" module="Magento_Tax" type="flat" entity_type="tax_calculation_rate" collection="Magento\Tax\Model\Resource\Calculation\Rate\Collection" identifier="code" repository_class="Magento\Tax\Test\Repository\TaxRate" handler_interface="Magento\Tax\Test\Handler\TaxRate\TaxRateInterface" class="Magento\Tax\Test\Fixture\TaxRate"> - <dataset name="default"> - <field name="code" xsi:type="string">Tax Rate %isolation%</field> - <field name="rate" xsi:type="string">10</field> - <field name="tax_country_id" xsi:type="string">United States</field> - <field name="tax_postcode" xsi:type="string">*</field> - <field name="tax_region_id" xsi:type="string">California</field> - </dataset> - <field name="tax_calculation_rate_id" is_required="1"> - <default_value xsi:type="null"/> - </field> - <field name="tax_country_id" is_required=""> - <default_value xsi:type="string">United States</default_value> - </field> - <field name="tax_region_id" is_required=""> - <default_value xsi:type="string">California</default_value> - </field> - <field name="tax_postcode" is_required=""> - <default_value xsi:type="string">*</default_value> - </field> - <field name="code" is_required=""> - <default_value xsi:type="string">Tax Rate %isolation%</default_value> - </field> - <field name="rate" is_required=""> - <default_value xsi:type="number">10</default_value> - </field> - <field name="zip_is_range" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="zip_from" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="zip_to" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="id"/> - </fixture> + <fixture name="taxRate" + module="Magento_Tax" + type="flat" + entity_type="tax_calculation_rate" + collection="Magento\Tax\Model\Resource\Calculation\Rate\Collection" + identifier="code" + repository_class="Magento\Tax\Test\Repository\TaxRate" + handler_interface="Magento\Tax\Test\Handler\TaxRate\TaxRateInterface" + class="Magento\Tax\Test\Fixture\TaxRate"> + <field name="tax_calculation_rate_id" is_required="1" /> + <field name="tax_country_id" is_required="" /> + <field name="tax_region_id" is_required="" /> + <field name="tax_postcode" is_required="" /> + <field name="code" is_required="" /> + <field name="rate" is_required="" /> + <field name="zip_is_range" is_required="" /> + <field name="zip_from" is_required="" /> + <field name="zip_to" is_required="" /> + <field name="id" /> + </fixture> </config> diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Fixture/TaxRule.xml b/dev/tests/functional/tests/app/Magento/Tax/Test/Fixture/TaxRule.xml index b53f3f1eba5d9b4c3f29653c282cf1b7af82820a..671a12d176951aabdd9ac591c8f464c768360fdb 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Fixture/TaxRule.xml +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Fixture/TaxRule.xml @@ -6,33 +6,21 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="taxRule" module="Magento_Tax" type="flat" entity_type="tax_calculation_rule" collection="Magento\Tax\Model\Resource\Calculation\Rule\Collection" identifier="code" repository_class="Magento\Tax\Test\Repository\TaxRule" handler_interface="Magento\Tax\Test\Handler\TaxRule\TaxRuleInterface" class="Magento\Tax\Test\Fixture\TaxRule"> - <dataset name="default"> - <field name="code" xsi:type="string">TaxIdentifier%isolation%</field> - <field name="tax_rate" xsi:type="array"> - <item name="dataSet" xsi:type="string">US-CA-Rate_1</item> - </field> - </dataset> - <field name="tax_calculation_rule_id" is_required="1"> - <default_value xsi:type="null"/> - </field> - <field name="code" is_required=""> - <default_value xsi:type="string">TaxIdentifier%isolation%</default_value> - </field> - <field name="priority" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="position" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="tax_rate" source="Magento\Tax\Test\Fixture\TaxRule\TaxRate"> - <default_value xsi:type="array"> - <item name="dataSet" xsi:type="array"> - <item name="0" xsi:type="string">US-CA-Rate_1</item> - </item> - </default_value> - </field> - <field name="tax_customer_class" source="Magento\Tax\Test\Fixture\TaxRule\TaxClass"/> - <field name="tax_product_class" source="Magento\Tax\Test\Fixture\TaxRule\TaxClass"/> - </fixture> + <fixture name="taxRule" + module="Magento_Tax" + type="flat" + entity_type="tax_calculation_rule" + collection="Magento\Tax\Model\Resource\Calculation\Rule\Collection" + identifier="code" + repository_class="Magento\Tax\Test\Repository\TaxRule" + handler_interface="Magento\Tax\Test\Handler\TaxRule\TaxRuleInterface" + class="Magento\Tax\Test\Fixture\TaxRule"> + <field name="tax_calculation_rule_id" is_required="1" /> + <field name="code" is_required="" /> + <field name="priority" is_required="" /> + <field name="position" is_required="" /> + <field name="tax_rate" source="Magento\Tax\Test\Fixture\TaxRule\TaxRate" /> + <field name="tax_customer_class" source="Magento\Tax\Test\Fixture\TaxRule\TaxClass" /> + <field name="tax_product_class" source="Magento\Tax\Test\Fixture\TaxRule\TaxClass" /> + </fixture> </config> diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Fixture/TaxRule/TaxClass.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Fixture/TaxRule/TaxClass.php index b40b943db578694f85058bb4c165c854101b2c00..2befe872139d2a4423d69cf7682edd219174f21b 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Fixture/TaxRule/TaxClass.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Fixture/TaxRule/TaxClass.php @@ -13,7 +13,7 @@ use Magento\Mtf\Fixture\FixtureFactory; * Class TaxClass * * Data keys: - * - dataSet + * - dataset */ class TaxClass extends DataSource { @@ -33,11 +33,11 @@ class TaxClass extends DataSource public function __construct(FixtureFactory $fixtureFactory, array $params, array $data = []) { $this->params = $params; - if (isset($data['dataSet'])) { - $dataSets = $data['dataSet']; - foreach ($dataSets as $dataSet) { + if (isset($data['dataset'])) { + $datasets = $data['dataset']; + foreach ($datasets as $dataset) { /** @var \Magento\Tax\Test\Fixture\TaxClass $taxClass */ - $taxClass = $fixtureFactory->createByCode('taxClass', ['dataSet' => $dataSet]); + $taxClass = $fixtureFactory->createByCode('taxClass', ['dataset' => $dataset]); $this->fixture[] = $taxClass; $this->data[] = $taxClass->getClassName(); } diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Fixture/TaxRule/TaxRate.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Fixture/TaxRule/TaxRate.php index 238a754ee60480e310045ce8b6fec70ae836a9da..3af39e10a3203543cbc6fe8eb3e13cb9644225ae 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Fixture/TaxRule/TaxRate.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Fixture/TaxRule/TaxRate.php @@ -13,7 +13,7 @@ use Magento\Mtf\Fixture\FixtureFactory; * Class TaxRate * * Data keys: - * - dataSet + * - dataset */ class TaxRate extends DataSource { @@ -33,11 +33,11 @@ class TaxRate extends DataSource public function __construct(FixtureFactory $fixtureFactory, array $params, array $data = []) { $this->params = $params; - if (isset($data['dataSet'])) { - $dataSets = $data['dataSet']; - foreach ($dataSets as $dataSet) { + if (isset($data['dataset'])) { + $datasets = $data['dataset']; + foreach ($datasets as $dataset) { /** @var \Magento\Tax\Test\Fixture\TaxRate $taxRate */ - $taxRate = $fixtureFactory->createByCode('taxRate', ['dataSet' => $dataSet]); + $taxRate = $fixtureFactory->createByCode('taxRate', ['dataset' => $dataset]); $this->fixture[] = $taxRate; $this->data[] = $taxRate->getCode(); } diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Repository/ConfigData.xml b/dev/tests/functional/tests/app/Magento/Tax/Test/Repository/ConfigData.xml index e8cd16287bce0286b32719788aff12048ca2262d..31757f3a6c34bf72fb7a6a57bc8c18c43b08d83c 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Repository/ConfigData.xml +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Repository/ConfigData.xml @@ -557,14 +557,14 @@ <field name="tax/calculation/shipping_includes_tax" xsi:type="array"> <item name="scope" xsi:type="string">tax</item> <item name="scope_id" xsi:type="number">1</item> - <item name="label" xsi:type="string">Excluding Tax</item> + <item name="label" xsi:type="string">Including Tax</item> <item name="value" xsi:type="number">0</item> </field> <field name="tax/calculation/apply_after_discount" xsi:type="array"> <item name="scope" xsi:type="string">tax</item> <item name="scope_id" xsi:type="number">1</item> - <item name="label" xsi:type="string">After Discount</item> - <item name="value" xsi:type="number">1</item> + <item name="label" xsi:type="string">Before Discount</item> + <item name="value" xsi:type="number">0</item> </field> <field name="tax/calculation/discount_tax" xsi:type="array"> <item name="scope" xsi:type="string">tax</item> diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Repository/TaxClass.xml b/dev/tests/functional/tests/app/Magento/Tax/Test/Repository/TaxClass.xml index 3e9c69f527b74497af80ee911b8f163835717214..c75bcdc7ba799f55f5d4ff86d57fdfb7be17984e 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Repository/TaxClass.xml +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Repository/TaxClass.xml @@ -7,6 +7,10 @@ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> <repository class="Magento\Tax\Test\Repository\TaxClass"> + <dataset name="default"> + <field name="class_name" xsi:type="string">Tax Class %isolation%</field> + </dataset> + <dataset name="taxable_goods"> <field name="class_id" xsi:type="string">2</field> <field name="class_name" xsi:type="string">Taxable Goods</field> diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Repository/TaxRate.xml b/dev/tests/functional/tests/app/Magento/Tax/Test/Repository/TaxRate.xml index c3e875e6e9482dc0c19be8412737465ebe870b8f..85abb1aa13287275ae6b077158b15cb9cd01454a 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Repository/TaxRate.xml +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Repository/TaxRate.xml @@ -7,6 +7,14 @@ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> <repository class="Magento\Tax\Test\Repository\TaxRate"> + <dataset name="default"> + <field name="code" xsi:type="string">Tax Rate %isolation%</field> + <field name="rate" xsi:type="string">10</field> + <field name="tax_country_id" xsi:type="string">United States</field> + <field name="tax_postcode" xsi:type="string">*</field> + <field name="tax_region_id" xsi:type="string">California</field> + </dataset> + <dataset name="US-CA-Rate_1"> <field name="tax_calculation_rate_id" xsi:type="string">1</field> <field name="tax_country_id" xsi:type="string">US</field> diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Repository/TaxRule.xml b/dev/tests/functional/tests/app/Magento/Tax/Test/Repository/TaxRule.xml index 801382ccf4b17cddfbbaa60d9499bd054d3a813b..42d64c06e719f5cabfd48de3c4e933215db500e6 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Repository/TaxRule.xml +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Repository/TaxRule.xml @@ -7,10 +7,17 @@ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> <repository class="Magento\Tax\Test\Repository\TaxRule"> + <dataset name="default"> + <field name="code" xsi:type="string">TaxIdentifier%isolation%</field> + <field name="tax_rate" xsi:type="array"> + <item name="dataset" xsi:type="string">US-CA-Rate_1</item> + </field> + </dataset> + <dataset name="custom_rule"> <field name="code" xsi:type="string">TaxIdentifier%isolation%</field> <field name="tax_rate" xsi:type="array"> - <item name="dataSet" xsi:type="array"> + <item name="dataset" xsi:type="array"> <item name="0" xsi:type="string">us_ca_rate_8_25</item> <item name="1" xsi:type="string">us_ny_rate_8_375</item> </item> @@ -22,19 +29,19 @@ <dataset name="us_ca_ny_rule"> <field name="code" xsi:type="string">Tax Rule %isolation%</field> <field name="tax_rate" xsi:type="array"> - <item name="dataSet" xsi:type="array"> + <item name="dataset" xsi:type="array"> <item name="0" xsi:type="string">US-CA-Rate_1</item> <item name="1" xsi:type="string">us_ny_rate_8_1</item> </item> </field> <field name="tax_customer_class" xsi:type="array"> - <item name="dataSet" xsi:type="array"> + <item name="dataset" xsi:type="array"> <item name="0" xsi:type="string">retail_customer</item> <item name="1" xsi:type="string">customer_tax_class</item> </item> </field> <field name="tax_product_class" xsi:type="array"> - <item name="dataSet" xsi:type="array"> + <item name="dataset" xsi:type="array"> <item name="0" xsi:type="string">taxable_goods</item> <item name="1" xsi:type="string">product_tax_class</item> </item> @@ -46,7 +53,7 @@ <dataset name="uk_full_tax_rule"> <field name="code" xsi:type="string">TaxIdentifier%isolation%</field> <field name="tax_rate" xsi:type="array"> - <item name="dataSet" xsi:type="array"> + <item name="dataset" xsi:type="array"> <item name="0" xsi:type="string">uk_full_tax_rate</item> </item> </field> @@ -57,17 +64,17 @@ <dataset name="tax_rule_default"> <field name="code" xsi:type="string">TaxIdentifier%isolation%</field> <field name="tax_rate" xsi:type="array"> - <item name="dataSet" xsi:type="array"> + <item name="dataset" xsi:type="array"> <item name="0" xsi:type="string">US-CA-Rate_1</item> </item> </field> <field name="tax_customer_class" xsi:type="array"> - <item name="dataSet" xsi:type="array"> + <item name="dataset" xsi:type="array"> <item name="0" xsi:type="string">retail_customer</item> </item> </field> <field name="tax_product_class" xsi:type="array"> - <item name="dataSet" xsi:type="array"> + <item name="dataset" xsi:type="array"> <item name="0" xsi:type="string">taxable_goods</item> </item> </field> @@ -78,19 +85,19 @@ <dataset name="tax_rule_with_custom_tax_classes"> <field name="code" xsi:type="string">TaxIdentifier%isolation%</field> <field name="tax_rate" xsi:type="array"> - <item name="dataSet" xsi:type="array"> + <item name="dataset" xsi:type="array"> <item name="0" xsi:type="string">US-CA-Rate_1</item> <item name="1" xsi:type="string">US-NY-Rate_1</item> </item> </field> <field name="tax_customer_class" xsi:type="array"> - <item name="dataSet" xsi:type="array"> + <item name="dataset" xsi:type="array"> <item name="0" xsi:type="string">retail_customer</item> <item name="1" xsi:type="string">customer_tax_class</item> </item> </field> <field name="tax_product_class" xsi:type="array"> - <item name="dataSet" xsi:type="array"> + <item name="dataset" xsi:type="array"> <item name="0" xsi:type="string">product_tax_class</item> <item name="1" xsi:type="string">taxable_goods</item> </item> @@ -102,7 +109,7 @@ <dataset name="customer_equals_store_rate"> <field name="code" xsi:type="string">TaxIdentifier%isolation%</field> <field name="tax_rate" xsi:type="array"> - <item name="dataSet" xsi:type="array"> + <item name="dataset" xsi:type="array"> <item name="0" xsi:type="string">us_ca_rate_8_25_no_zip</item> <item name="1" xsi:type="string">us_ny_rate_8_25</item> </item> @@ -114,7 +121,7 @@ <dataset name="customer_less_store_rate"> <field name="code" xsi:type="string">TaxIdentifier%isolation%</field> <field name="tax_rate" xsi:type="array"> - <item name="dataSet" xsi:type="array"> + <item name="dataset" xsi:type="array"> <item name="0" xsi:type="string">us_ca_rate_8_375</item> <item name="1" xsi:type="string">us_ny_rate_8_25</item> </item> @@ -126,7 +133,7 @@ <dataset name="customer_greater_store_rate"> <field name="code" xsi:type="string">TaxIdentifier%isolation%</field> <field name="tax_rate" xsi:type="array"> - <item name="dataSet" xsi:type="array"> + <item name="dataset" xsi:type="array"> <item name="0" xsi:type="string">us_ca_rate_8_25_no_zip</item> <item name="1" xsi:type="string">us_ny_rate_8_375</item> </item> @@ -138,7 +145,7 @@ <dataset name="cross_border_tax_rule"> <field name="code" xsi:type="string">TaxIdentifier%isolation%</field> <field name="tax_rate" xsi:type="array"> - <item name="dataSet" xsi:type="array"> + <item name="dataset" xsi:type="array"> <item name="0" xsi:type="string">tx_rate_10</item> <item name="1" xsi:type="string">ny_rate_20</item> <item name="2" xsi:type="string">ca_rate_30</item> @@ -151,17 +158,17 @@ <dataset name="retailer_uk_full_tax_rule"> <field name="code" xsi:type="string">Tax Rule %isolation%</field> <field name="tax_rate" xsi:type="array"> - <item name="dataSet" xsi:type="array"> + <item name="dataset" xsi:type="array"> <item name="0" xsi:type="string">uk_full_tax_rate</item> </item> </field> <field name="tax_customer_class" xsi:type="array"> - <item name="dataSet" xsi:type="array"> + <item name="dataset" xsi:type="array"> <item name="0" xsi:type="string">retail_customer</item> </item> </field> <field name="tax_product_class" xsi:type="array"> - <item name="dataSet" xsi:type="array"> + <item name="dataset" xsi:type="array"> <item name="0" xsi:type="string">taxable_goods</item> </item> </field> diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/ApplyTaxBasedOnVatIdTest.xml b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/ApplyTaxBasedOnVatIdTest.xml index d5407ecf878f38d62433a282d67c5b7e2f7f942a..dd6d2d00fc55c49b184e482a32e44d6dffcc34f3 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/ApplyTaxBasedOnVatIdTest.xml +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/ApplyTaxBasedOnVatIdTest.xml @@ -9,14 +9,14 @@ <testCase name="Magento\Tax\Test\TestCase\ApplyTaxBasedOnVatIdTest"> <variation name="ApplyTaxBasedOnVatIdTestVariation1"> <data name="description" xsi:type="string">MAGETWO-13436: Automatic Apply Tax Based on VAT ID.</data> - <data name="vatConfig/dataSet" xsi:type="string">enable_VAT_on_frontend</data> + <data name="vatConfig/dataset" xsi:type="string">enable_VAT_on_frontend</data> <data name="configData" xsi:type="string">default_tax_configuration, flatrate, checkmo, store_information_DE_with_VAT, enable_VAT_on_frontend</data> - <data name="customer/dataSet" xsi:type="string">customer_UK_address_with_VAT</data> - <data name="order/dataSet" xsi:type="string">default</data> + <data name="customer/dataset" xsi:type="string">customer_UK_address_with_VAT</data> + <data name="order/dataset" xsi:type="string">default</data> <data name="order/data/entity_id/products" xsi:type="string">catalogProductSimple::product_10_dollar</data> - <data name="order/data/customer_id/dataSet" xsi:type="string">customer_UK_address_with_VAT</data> - <data name="order/data/billing_address_id/dataSet" xsi:type="string">UK_address_with_VAT</data> - <data name="taxRule/dataSet" xsi:type="string">retailer_uk_full_tax_rule</data> + <data name="order/data/customer_id/dataset" xsi:type="string">customer_UK_address_with_VAT</data> + <data name="order/data/billing_address_id/dataset" xsi:type="string">UK_address_with_VAT</data> + <data name="taxRule/dataset" xsi:type="string">retailer_uk_full_tax_rule</data> <data name="customerGroup" xsi:type="string">valid_intra_union_group</data> <data name="cart/data/subtotal" xsi:type="string">10</data> <data name="cart/data/tax_amount" xsi:type="string">2</data> diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/CreateTaxRateEntityTest.php b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/CreateTaxRateEntityTest.php index ae00c783d685bb61330e4b1eba2708d3400627ff..c1fd40dbf47e48c580a6a7ef37cbcabcb05b7d50 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/CreateTaxRateEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/CreateTaxRateEntityTest.php @@ -17,7 +17,7 @@ use Magento\Mtf\TestCase\Injectable; * 1. Log in as default admin user. * 2. Go to Stores > Taxes > Tax Zones and Rates. * 3. Click 'Add New Tax Rate' button. - * 4. Fill in data according to dataSet + * 4. Fill in data according to dataset * 5. Save Tax Rate. * 6. Perform all assertions. * diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/CreateTaxRuleEntityTest.php b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/CreateTaxRuleEntityTest.php index 98d3605d2f2f29a8eafe0b35c0c541fe4e16a517..c3792a803da001bb2fda41dde79f3ce3537a476e 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/CreateTaxRuleEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/CreateTaxRuleEntityTest.php @@ -16,7 +16,7 @@ use Magento\Mtf\TestCase\Injectable; * 1. Log in as default admin user. * 2. Go to Stores > Tax Rules. * 3. Click 'Add New Tax Rule' button. - * 4. Fill in data according to dataSet + * 4. Fill in data according to dataset * 5. Save Tax Rule. * 6. Perform all assertions. * diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/CreateTaxRuleEntityTest.xml b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/CreateTaxRuleEntityTest.xml index b919c1584ec37e2ffeea7742fe526f59a76694ef..e3a83b20d90e61ad156547d0ee387a4cd046a1e5 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/CreateTaxRuleEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/CreateTaxRuleEntityTest.xml @@ -9,23 +9,23 @@ <testCase name="Magento\Tax\Test\TestCase\CreateTaxRuleEntityTest"> <variation name="CreateTaxRuleEntityTestVariation1"> <data name="taxRule/data/code" xsi:type="string">TaxIdentifier%isolation%</data> - <data name="taxRule/data/tax_rate/dataSet/rate_0" xsi:type="string">US-CA-Rate_1</data> - <data name="taxRule/data/tax_customer_class/dataSet/class_0" xsi:type="string">-</data> - <data name="taxRule/data/tax_customer_class/dataSet/class_1" xsi:type="string">-</data> - <data name="taxRule/data/tax_product_class/dataSet/class_0" xsi:type="string">-</data> - <data name="taxRule/data/tax_product_class/dataSet/class_1" xsi:type="string">-</data> + <data name="taxRule/data/tax_rate/dataset/rate_0" xsi:type="string">US-CA-Rate_1</data> + <data name="taxRule/data/tax_customer_class/dataset/class_0" xsi:type="string">-</data> + <data name="taxRule/data/tax_customer_class/dataset/class_1" xsi:type="string">-</data> + <data name="taxRule/data/tax_product_class/dataset/class_0" xsi:type="string">-</data> + <data name="taxRule/data/tax_product_class/dataset/class_1" xsi:type="string">-</data> <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleSuccessSaveMessage" /> <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleInGrid" /> <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleForm" /> </variation> <variation name="CreateTaxRuleEntityTestVariation2"> <data name="taxRule/data/code" xsi:type="string">TaxIdentifier%isolation%</data> - <data name="taxRule/data/tax_rate/dataSet/rate_0" xsi:type="string">US-CA-Rate_1</data> - <data name="taxRule/data/tax_rate/dataSet/rate_1" xsi:type="string">US-NY-Rate_1</data> - <data name="taxRule/data/tax_customer_class/dataSet/class_0" xsi:type="string">customer_tax_class</data> - <data name="taxRule/data/tax_customer_class/dataSet/class_1" xsi:type="string">-</data> - <data name="taxRule/data/tax_product_class/dataSet/class_0" xsi:type="string">product_tax_class</data> - <data name="taxRule/data/tax_product_class/dataSet/class_1" xsi:type="string">-</data> + <data name="taxRule/data/tax_rate/dataset/rate_0" xsi:type="string">US-CA-Rate_1</data> + <data name="taxRule/data/tax_rate/dataset/rate_1" xsi:type="string">US-NY-Rate_1</data> + <data name="taxRule/data/tax_customer_class/dataset/class_0" xsi:type="string">customer_tax_class</data> + <data name="taxRule/data/tax_customer_class/dataset/class_1" xsi:type="string">-</data> + <data name="taxRule/data/tax_product_class/dataset/class_0" xsi:type="string">product_tax_class</data> + <data name="taxRule/data/tax_product_class/dataset/class_1" xsi:type="string">-</data> <data name="taxRule/data/priority" xsi:type="string">1</data> <data name="taxRule/data/position" xsi:type="string">1</data> <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleSuccessSaveMessage" /> @@ -35,12 +35,12 @@ <variation name="CreateTaxRuleEntityTestVariation3"> <data name="description" xsi:type="string">Creating tax rule with new tax classes and tax rate</data> <data name="taxRule/data/code" xsi:type="string">TaxIdentifier%isolation%</data> - <data name="taxRule/data/tax_rate/dataSet/rate_0" xsi:type="string">default</data> - <data name="taxRule/data/tax_rate/dataSet/rate_1" xsi:type="string">US-NY-Rate_1</data> - <data name="taxRule/data/tax_rate/dataSet/rate_2" xsi:type="string">US-CA-Rate_1</data> - <data name="taxRule/data/tax_customer_class/dataSet/class_0" xsi:type="string">retail_customer</data> - <data name="taxRule/data/tax_customer_class/dataSet/class_1" xsi:type="string">customer_tax_class</data> - <data name="taxRule/data/tax_product_class/dataSet/class_0" xsi:type="string">taxable_goods</data> + <data name="taxRule/data/tax_rate/dataset/rate_0" xsi:type="string">default</data> + <data name="taxRule/data/tax_rate/dataset/rate_1" xsi:type="string">US-NY-Rate_1</data> + <data name="taxRule/data/tax_rate/dataset/rate_2" xsi:type="string">US-CA-Rate_1</data> + <data name="taxRule/data/tax_customer_class/dataset/class_0" xsi:type="string">retail_customer</data> + <data name="taxRule/data/tax_customer_class/dataset/class_1" xsi:type="string">customer_tax_class</data> + <data name="taxRule/data/tax_product_class/dataset/class_0" xsi:type="string">taxable_goods</data> <data name="taxRule/data/position" xsi:type="string">1</data> <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleSuccessSaveMessage" /> <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleInGrid" /> @@ -48,12 +48,12 @@ </variation> <variation name="CreateTaxRuleEntityTestVariation4"> <data name="taxRule/data/code" xsi:type="string">TaxIdentifier%isolation%</data> - <data name="taxRule/data/tax_rate/dataSet/rate_0" xsi:type="string">withZipRange</data> - <data name="taxRule/data/tax_rate/dataSet/rate_1" xsi:type="string">US-CA-Rate_1</data> - <data name="taxRule/data/tax_customer_class/dataSet/class_0" xsi:type="string">retail_customer</data> - <data name="taxRule/data/tax_customer_class/dataSet/class_1" xsi:type="string">customer_tax_class</data> - <data name="taxRule/data/tax_product_class/dataSet/class_0" xsi:type="string">taxable_goods</data> - <data name="taxRule/data/tax_product_class/dataSet/class_1" xsi:type="string">product_tax_class</data> + <data name="taxRule/data/tax_rate/dataset/rate_0" xsi:type="string">withZipRange</data> + <data name="taxRule/data/tax_rate/dataset/rate_1" xsi:type="string">US-CA-Rate_1</data> + <data name="taxRule/data/tax_customer_class/dataset/class_0" xsi:type="string">retail_customer</data> + <data name="taxRule/data/tax_customer_class/dataset/class_1" xsi:type="string">customer_tax_class</data> + <data name="taxRule/data/tax_product_class/dataset/class_0" xsi:type="string">taxable_goods</data> + <data name="taxRule/data/tax_product_class/dataset/class_1" xsi:type="string">product_tax_class</data> <data name="taxRule/data/priority" xsi:type="string">1</data> <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleSuccessSaveMessage" /> <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleInGrid" /> @@ -62,12 +62,12 @@ <variation name="CreateTaxRuleEntityTestVariation5"> <data name="description" xsi:type="string">MAGETWO-12438: Create Tax Rule with New and Existing Tax Rate, Customer Tax Class, Product Tax Class</data> <data name="taxRule/data/code" xsi:type="string">TaxIdentifier%isolation%</data> - <data name="taxRule/data/tax_rate/dataSet/rate_0" xsi:type="string">US-CA-*-Rate 1</data> - <data name="taxRule/data/tax_rate/dataSet/rate_1" xsi:type="string">us_ny_rate_8_1</data> - <data name="taxRule/data/tax_customer_class/dataSet/class_0" xsi:type="string">retail_customer</data> - <data name="taxRule/data/tax_customer_class/dataSet/class_1" xsi:type="string">customer_tax_class</data> - <data name="taxRule/data/tax_product_class/dataSet/class_0" xsi:type="string">taxable_goods</data> - <data name="taxRule/data/tax_product_class/dataSet/class_1" xsi:type="string">product_tax_class</data> + <data name="taxRule/data/tax_rate/dataset/rate_0" xsi:type="string">US-CA-*-Rate 1</data> + <data name="taxRule/data/tax_rate/dataset/rate_1" xsi:type="string">us_ny_rate_8_1</data> + <data name="taxRule/data/tax_customer_class/dataset/class_0" xsi:type="string">retail_customer</data> + <data name="taxRule/data/tax_customer_class/dataset/class_1" xsi:type="string">customer_tax_class</data> + <data name="taxRule/data/tax_product_class/dataset/class_0" xsi:type="string">taxable_goods</data> + <data name="taxRule/data/tax_product_class/dataset/class_1" xsi:type="string">product_tax_class</data> <data name="tag" xsi:type="string">bamboo_plan:end_to_end,test_type:acceptance_test, stable:no</data> <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleSuccessSaveMessage" /> <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleInGrid" /> diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/DeleteTaxRateEntityTest.xml b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/DeleteTaxRateEntityTest.xml index cc3ac1c0efb0b9706778c75c4b3aad5bf05f6845..3f5138c04257f6e24b02b83151d070a9592b29cf 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/DeleteTaxRateEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/DeleteTaxRateEntityTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Tax\Test\TestCase\DeleteTaxRateEntityTest"> <variation name="DeleteTaxRateEntityTestVariation1"> - <data name="taxRate/dataSet" xsi:type="string">default</data> + <data name="taxRate/dataset" xsi:type="string">default</data> <constraint name="Magento\Tax\Test\Constraint\AssertTaxRateSuccessDeleteMessage"/> <constraint name="Magento\Tax\Test\Constraint\AssertTaxRateNotInGrid"/> <constraint name="Magento\Tax\Test\Constraint\AssertTaxRateNotInTaxRule"/> diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/DeleteTaxRuleEntityTest.xml b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/DeleteTaxRuleEntityTest.xml index 8c8aa1e3888b449ecb35b4cd65f5df9ce68baa96..444a019050cbc8a517576f314b782399fbfb9349 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/DeleteTaxRuleEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/DeleteTaxRuleEntityTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Tax\Test\TestCase\DeleteTaxRuleEntityTest"> <variation name="DeleteTaxRuleEntityTestVariation1"> - <data name="taxRule/dataSet" xsi:type="string">tax_rule_with_custom_tax_classes</data> + <data name="taxRule/dataset" xsi:type="string">tax_rule_with_custom_tax_classes</data> <data name="address/data/country_id" xsi:type="string">United States</data> <data name="address/data/region_id" xsi:type="string">California</data> <data name="address/data/postcode" xsi:type="string">90001</data> diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/TaxCalculationTest.xml b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/TaxCalculationTest.xml index 50c3d439a11fb08fcf7fb25117c17fd6b08eeb8a..0e62906603bbc634dcfed507d21d1f86f498b44d 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/TaxCalculationTest.xml +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/TaxCalculationTest.xml @@ -14,7 +14,7 @@ <data name="salesRule" xsi:type="string">active_sales_rule_for_all_groups_no_coupon</data> <data name="catalogRule" xsi:type="string">-</data> <data name="taxRule" xsi:type="string">customer_equals_store_rate</data> - <data name="customer/dataSet" xsi:type="string">johndoe_unique</data> + <data name="customer/dataset" xsi:type="string">johndoe_unique</data> <data name="qty" xsi:type="string">3</data> <data name="prices/category_price_excl_tax" xsi:type="string">277.14</data> <data name="prices/category_price_incl_tax" xsi:type="string">300.00</data> @@ -43,7 +43,7 @@ <data name="salesRule" xsi:type="string">active_sales_rule_for_all_groups_no_coupon</data> <data name="catalogRule" xsi:type="string">-</data> <data name="taxRule" xsi:type="string">customer_greater_store_rate</data> - <data name="customer/dataSet" xsi:type="string">johndoe_unique</data> + <data name="customer/dataset" xsi:type="string">johndoe_unique</data> <data name="qty" xsi:type="string">3</data> <data name="prices/category_price_excl_tax" xsi:type="string">90.99</data> <data name="prices/category_price_incl_tax" xsi:type="string">98.61</data> @@ -72,7 +72,7 @@ <data name="salesRule" xsi:type="string">active_sales_rule_for_all_groups_no_coupon</data> <data name="catalogRule" xsi:type="string">-</data> <data name="taxRule" xsi:type="string">customer_less_store_rate</data> - <data name="customer/dataSet" xsi:type="string">johndoe_unique</data> + <data name="customer/dataset" xsi:type="string">johndoe_unique</data> <data name="qty" xsi:type="string">3</data> <data name="prices/category_price_excl_tax" xsi:type="string">90.99</data> <data name="prices/category_price_incl_tax" xsi:type="string">98.50</data> @@ -101,7 +101,7 @@ <data name="salesRule" xsi:type="string">active_sales_rule_for_all_groups_no_coupon</data> <data name="catalogRule" xsi:type="string">-</data> <data name="taxRule" xsi:type="string">customer_less_store_rate</data> - <data name="customer/dataSet" xsi:type="string">johndoe_unique</data> + <data name="customer/dataset" xsi:type="string">johndoe_unique</data> <data name="qty" xsi:type="string">3</data> <data name="prices/category_price_excl_tax" xsi:type="string">83.05</data> <data name="prices/category_price_incl_tax" xsi:type="string">89.90</data> @@ -130,7 +130,7 @@ <data name="salesRule" xsi:type="string">active_sales_rule_for_all_groups_no_coupon</data> <data name="catalogRule" xsi:type="string">-</data> <data name="taxRule" xsi:type="string">customer_less_store_rate</data> - <data name="customer/dataSet" xsi:type="string">johndoe_unique</data> + <data name="customer/dataset" xsi:type="string">johndoe_unique</data> <data name="qty" xsi:type="string">3</data> <data name="prices/category_price_excl_tax" xsi:type="string">276.81</data> <data name="prices/category_price_incl_tax" xsi:type="string">299.65</data> @@ -159,7 +159,7 @@ <data name="salesRule" xsi:type="string">active_sales_rule_for_all_groups_no_coupon</data> <data name="catalogRule" xsi:type="string">-</data> <data name="taxRule" xsi:type="string">customer_equals_store_rate</data> - <data name="customer/dataSet" xsi:type="string">johndoe_unique</data> + <data name="customer/dataset" xsi:type="string">johndoe_unique</data> <data name="qty" xsi:type="string">3</data> <data name="prices/category_price_excl_tax" xsi:type="string">90.00</data> <data name="prices/category_price_incl_tax" xsi:type="string">97.43</data> @@ -188,7 +188,7 @@ <data name="salesRule" xsi:type="string">active_sales_rule_for_all_groups_no_coupon</data> <data name="catalogRule" xsi:type="string">-</data> <data name="taxRule" xsi:type="string">customer_equals_store_rate</data> - <data name="customer/dataSet" xsi:type="string">johndoe_unique</data> + <data name="customer/dataset" xsi:type="string">johndoe_unique</data> <data name="qty" xsi:type="string">3</data> <data name="prices/category_price_excl_tax" xsi:type="string">90.99</data> <data name="prices/category_price_incl_tax" xsi:type="string">98.50</data> @@ -217,7 +217,7 @@ <data name="salesRule" xsi:type="string">active_sales_rule_for_all_groups_no_coupon</data> <data name="catalogRule" xsi:type="string">-</data> <data name="taxRule" xsi:type="string">customer_greater_store_rate</data> - <data name="customer/dataSet" xsi:type="string">johndoe_unique</data> + <data name="customer/dataset" xsi:type="string">johndoe_unique</data> <data name="qty" xsi:type="string">3</data> <data name="prices/category_price_excl_tax" xsi:type="string">84.06</data> <data name="prices/category_price_incl_tax" xsi:type="string">91.10</data> @@ -246,7 +246,7 @@ <data name="salesRule" xsi:type="string">active_sales_rule_for_all_groups_no_coupon</data> <data name="catalogRule" xsi:type="string">-</data> <data name="taxRule" xsi:type="string">customer_greater_store_rate</data> - <data name="customer/dataSet" xsi:type="string">johndoe_unique</data> + <data name="customer/dataset" xsi:type="string">johndoe_unique</data> <data name="qty" xsi:type="string">3</data> <data name="prices/category_price_excl_tax" xsi:type="string">300.00</data> <data name="prices/category_price_incl_tax" xsi:type="string">325.13</data> @@ -275,7 +275,7 @@ <data name="salesRule" xsi:type="string">active_sales_rule_for_all_groups_no_coupon</data> <data name="catalogRule" xsi:type="string">-</data> <data name="taxRule" xsi:type="string">customer_greater_store_rate</data> - <data name="customer/dataSet" xsi:type="string">johndoe_unique</data> + <data name="customer/dataset" xsi:type="string">johndoe_unique</data> <data name="qty" xsi:type="string">3</data> <data name="prices/category_price_excl_tax" xsi:type="string">90.00</data> <data name="prices/category_price_incl_tax" xsi:type="string">97.54</data> diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/TaxWithCrossBorderTest.php b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/TaxWithCrossBorderTest.php index b67edd7a4c1787025b0b0b45b126f3c3996427e4..b8b1f95c2b99818130b00e74a99e537b5a6bb6cb 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/TaxWithCrossBorderTest.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/TaxWithCrossBorderTest.php @@ -82,7 +82,7 @@ class TaxWithCrossBorderTest extends Injectable public function __inject() { // TODO: Move test set up to "__prepare" method after fix bug MAGETWO-29331 - $taxRule = $this->fixtureFactory->createByCode('taxRule', ['dataSet' => 'cross_border_tax_rule']); + $taxRule = $this->fixtureFactory->createByCode('taxRule', ['dataset' => 'cross_border_tax_rule']); $taxRule->persist(); } @@ -96,7 +96,7 @@ class TaxWithCrossBorderTest extends Injectable $customersData = ['johndoe_unique_TX', 'johndoe_unique']; $customers = []; foreach ($customersData as $customerData) { - $customer = $this->fixtureFactory->createByCode('customer', ['dataSet' => $customerData]); + $customer = $this->fixtureFactory->createByCode('customer', ['dataset' => $customerData]); $customer->persist(); $customers[] = $customer; } diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/TaxWithCrossBorderTest.xml b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/TaxWithCrossBorderTest.xml index 82218491cf409382415251e998b235429a4364c5..e01bee641331b2ada668efb40d3e587ec62736b3 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/TaxWithCrossBorderTest.xml +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/TaxWithCrossBorderTest.xml @@ -8,29 +8,29 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Tax\Test\TestCase\TaxWithCrossBorderTest"> <variation name="TaxWithCrossBorderTestVariation1"> - <data name="product/dataSet" xsi:type="string">with_one_custom_option_and_category</data> + <data name="product/dataset" xsi:type="string">with_one_custom_option_and_category</data> <data name="configData" xsi:type="string">cross_border_enabled_price_incl_tax, display_excluding_including_tax</data> <constraint name="Magento\Tax\Test\Constraint\AssertTaxWithCrossBorderApplied" /> </variation> <variation name="TaxWithCrossBorderTestVariation2"> - <data name="product/dataSet" xsi:type="string">product_with_category</data> - <data name="salesRule/dataSet" xsi:type="string">cart_rule</data> + <data name="product/dataset" xsi:type="string">product_with_category</data> + <data name="salesRule/dataset" xsi:type="string">cart_rule</data> <data name="configData" xsi:type="string">cross_border_enabled_price_incl_tax, display_excluding_including_tax</data> <constraint name="Magento\Tax\Test\Constraint\AssertTaxWithCrossBorderApplied" /> </variation> <variation name="TaxWithCrossBorderTestVariation3"> - <data name="product/dataSet" xsi:type="string">product_with_category</data> - <data name="catalogRule/dataSet" xsi:type="string">catalog_price_rule_priority_0</data> + <data name="product/dataset" xsi:type="string">product_with_category</data> + <data name="catalogRule/dataset" xsi:type="string">catalog_price_rule_priority_0</data> <data name="configData" xsi:type="string">cross_border_enabled_price_incl_tax, display_excluding_including_tax</data> <constraint name="Magento\Tax\Test\Constraint\AssertTaxWithCrossBorderApplied" /> </variation> <variation name="TaxWithCrossBorderTestVariation4"> - <data name="product/dataSet" xsi:type="string">product_with_special_price_and_category</data> + <data name="product/dataset" xsi:type="string">product_with_special_price_and_category</data> <data name="configData" xsi:type="string">cross_border_enabled_price_incl_tax, display_excluding_including_tax</data> <constraint name="Magento\Tax\Test\Constraint\AssertTaxWithCrossBorderApplied" /> </variation> <variation name="TaxWithCrossBorderTestVariation5"> - <data name="product/dataSet" xsi:type="string">product_with_category</data> + <data name="product/dataset" xsi:type="string">product_with_category</data> <data name="configData" xsi:type="string">cross_border_enabled_price_excl_tax, display_excluding_including_tax</data> <constraint name="Magento\Tax\Test\Constraint\AssertTaxWithCrossBorderNotApplied" /> </variation> diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRateEntityTest.xml b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRateEntityTest.xml index c8205ff306c4f0a543f0ab0cea2d619a6df8004a..23a2f6460cecc1a854f61ce4c44ac765a8e063a9 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRateEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRateEntityTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Tax\Test\TestCase\UpdateTaxRateEntityTest"> <variation name="UpdateTaxRateEntityTestVariation1"> - <data name="initialTaxRate/dataSet" xsi:type="string">default</data> + <data name="initialTaxRate/dataset" xsi:type="string">default</data> <data name="taxRate/data/code" xsi:type="string">TaxIdentifier%isolation%</data> <data name="taxRate/data/zip_is_range" xsi:type="string">No</data> <data name="taxRate/data/tax_postcode" xsi:type="string">90001</data> @@ -20,7 +20,7 @@ <constraint name="Magento\Tax\Test\Constraint\AssertTaxRateForm" /> </variation> <variation name="UpdateTaxRateEntityTestVariation2"> - <data name="initialTaxRate/dataSet" xsi:type="string">default</data> + <data name="initialTaxRate/dataset" xsi:type="string">default</data> <data name="taxRate/data/code" xsi:type="string">TaxIdentifier%isolation%</data> <data name="taxRate/data/zip_is_range" xsi:type="string">Yes</data> <data name="taxRate/data/zip_from" xsi:type="string">90001</data> @@ -33,7 +33,7 @@ <constraint name="Magento\Tax\Test\Constraint\AssertTaxRateForm" /> </variation> <variation name="UpdateTaxRateEntityTestVariation3"> - <data name="initialTaxRate/dataSet" xsi:type="string">default</data> + <data name="initialTaxRate/dataset" xsi:type="string">default</data> <data name="taxRate/data/code" xsi:type="string">TaxIdentifier%isolation%</data> <data name="taxRate/data/zip_is_range" xsi:type="string">No</data> <data name="taxRate/data/tax_postcode" xsi:type="string">*</data> @@ -44,7 +44,7 @@ <constraint name="Magento\Tax\Test\Constraint\AssertTaxRateForm" /> </variation> <variation name="UpdateTaxRateEntityTestVariation4"> - <data name="initialTaxRate/dataSet" xsi:type="string">withZipRange</data> + <data name="initialTaxRate/dataset" xsi:type="string">withZipRange</data> <data name="taxRate/data/code" xsi:type="string">TaxIdentifier%isolation%</data> <data name="taxRate/data/zip_is_range" xsi:type="string">No</data> <data name="taxRate/data/tax_postcode" xsi:type="string">180</data> @@ -56,7 +56,7 @@ <constraint name="Magento\Tax\Test\Constraint\AssertTaxRateForm" /> </variation> <variation name="UpdateTaxRateEntityTestVariation5"> - <data name="initialTaxRate/dataSet" xsi:type="string">withZipRange</data> + <data name="initialTaxRate/dataset" xsi:type="string">withZipRange</data> <data name="taxRate/data/code" xsi:type="string">TaxIdentifier%isolation%</data> <data name="taxRate/data/zip_is_range" xsi:type="string">Yes</data> <data name="taxRate/data/zip_from" xsi:type="string">1</data> @@ -67,7 +67,7 @@ <constraint name="Magento\Tax\Test\Constraint\AssertTaxRateForm" /> </variation> <variation name="UpdateTaxRateEntityTestVariation6"> - <data name="initialTaxRate/dataSet" xsi:type="string">withZipRange</data> + <data name="initialTaxRate/dataset" xsi:type="string">withZipRange</data> <data name="taxRate/data/code" xsi:type="string">TaxIdentifier%isolation%</data> <data name="taxRate/data/zip_is_range" xsi:type="string">No</data> <data name="taxRate/data/tax_postcode" xsi:type="string">*</data> diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRuleEntityTest.php b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRuleEntityTest.php index 49c320262784e4852b4f02906693951218e40e2f..07ed1106f3a7b4331270bc202cfe84e200211400 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRuleEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRuleEntityTest.php @@ -21,7 +21,7 @@ use Magento\Mtf\TestCase\Injectable; * 1. Login to backend * 2. Navigate to Stores > Tax Rules * 3. Click Tax Rule from grid - * 4. Edit test value(s) according to dataSet. + * 4. Edit test value(s) according to dataset. * 5. Click 'Save' button. * 6. Perform all asserts. * @@ -57,7 +57,7 @@ class UpdateTaxRuleEntityTest extends Injectable */ public function __prepare(FixtureFactory $fixtureFactory) { - $customer = $fixtureFactory->createByCode('customer', ['dataSet' => 'johndoe_retailer']); + $customer = $fixtureFactory->createByCode('customer', ['dataset' => 'johndoe_retailer']); $customer->persist(); return ['customer' => $customer]; diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRuleEntityTest.xml b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRuleEntityTest.xml index 1cc98aeb5bf1a0dfc16dc5dd1129a3d29461dd19..3941a395d7dcff1a42035a8d62ca7b5a0a4363d1 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRuleEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRuleEntityTest.xml @@ -8,12 +8,12 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Tax\Test\TestCase\UpdateTaxRuleEntityTest"> <variation name="UpdateTaxRuleEntityTestVariation1"> - <data name="initialTaxRule/dataSet" xsi:type="string">tax_rule_default</data> + <data name="initialTaxRule/dataset" xsi:type="string">tax_rule_default</data> <data name="taxRule/data/code" xsi:type="string">New Tax Rule name%isolation%</data> - <data name="taxRule/data/tax_rate/dataSet/rate_0" xsi:type="string">default</data> - <data name="taxRule/data/tax_customer_class/dataSet/class_0" xsi:type="string">customer_tax_class</data> - <data name="taxRule/data/tax_product_class/dataSet/class_0" xsi:type="string">product_tax_class</data> - <data name="taxRule/data/tax_product_class/dataSet/class_1" xsi:type="string">product_tax_class</data> + <data name="taxRule/data/tax_rate/dataset/rate_0" xsi:type="string">default</data> + <data name="taxRule/data/tax_customer_class/dataset/class_0" xsi:type="string">customer_tax_class</data> + <data name="taxRule/data/tax_product_class/dataset/class_0" xsi:type="string">product_tax_class</data> + <data name="taxRule/data/tax_product_class/dataset/class_1" xsi:type="string">product_tax_class</data> <data name="taxRule/data/priority" xsi:type="string">2</data> <data name="taxRule/data/position" xsi:type="string">2</data> <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleSuccessSaveMessage" /> @@ -21,44 +21,44 @@ <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleForm" /> </variation> <variation name="UpdateTaxRuleEntityTestVariation2"> - <data name="initialTaxRule/dataSet" xsi:type="string">tax_rule_with_custom_tax_classes</data> - <data name="taxRule/data/tax_rate/dataSet/rate_0" xsi:type="string">withZipRange</data> - <data name="taxRule/data/tax_customer_class/dataSet/class_0" xsi:type="string">retail_customer</data> - <data name="taxRule/data/tax_product_class/dataSet/class_0" xsi:type="string">product_tax_class</data> - <data name="taxRule/data/tax_product_class/dataSet/class_1" xsi:type="string">taxable_goods</data> + <data name="initialTaxRule/dataset" xsi:type="string">tax_rule_with_custom_tax_classes</data> + <data name="taxRule/data/tax_rate/dataset/rate_0" xsi:type="string">withZipRange</data> + <data name="taxRule/data/tax_customer_class/dataset/class_0" xsi:type="string">retail_customer</data> + <data name="taxRule/data/tax_product_class/dataset/class_0" xsi:type="string">product_tax_class</data> + <data name="taxRule/data/tax_product_class/dataset/class_1" xsi:type="string">taxable_goods</data> <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleSuccessSaveMessage" /> <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleInGrid" /> <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleForm" /> </variation> <variation name="UpdateTaxRuleEntityTestVariation3"> - <data name="initialTaxRule/dataSet" xsi:type="string">tax_rule_with_custom_tax_classes</data> + <data name="initialTaxRule/dataset" xsi:type="string">tax_rule_with_custom_tax_classes</data> <data name="address/data/country_id" xsi:type="string">United States</data> <data name="address/data/region_id" xsi:type="string">Utah</data> <data name="address/data/postcode" xsi:type="string">84001</data> <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data> <data name="shipping/shipping_method" xsi:type="string">Fixed</data> <data name="shipping/price" xsi:type="string">5</data> - <data name="taxRule/data/tax_rate/dataSet/rate_0" xsi:type="string">us_ut_fixed_zip_rate_20</data> - <data name="taxRule/data/tax_customer_class/dataSet/class_0" xsi:type="string">-</data> - <data name="taxRule/data/tax_product_class/dataSet/class_0" xsi:type="string">product_tax_class</data> - <data name="taxRule/data/tax_product_class/dataSet/class_1" xsi:type="string">-</data> + <data name="taxRule/data/tax_rate/dataset/rate_0" xsi:type="string">us_ut_fixed_zip_rate_20</data> + <data name="taxRule/data/tax_customer_class/dataset/class_0" xsi:type="string">-</data> + <data name="taxRule/data/tax_product_class/dataset/class_0" xsi:type="string">product_tax_class</data> + <data name="taxRule/data/tax_product_class/dataset/class_1" xsi:type="string">-</data> <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleSuccessSaveMessage" /> <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleInGrid" /> <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleForm" /> <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleIsApplied" /> </variation> <variation name="UpdateTaxRuleEntityTestVariation4"> - <data name="initialTaxRule/dataSet" xsi:type="string">tax_rule_with_custom_tax_classes</data> + <data name="initialTaxRule/dataset" xsi:type="string">tax_rule_with_custom_tax_classes</data> <data name="address/data/country_id" xsi:type="string">United States</data> <data name="address/data/region_id" xsi:type="string">Idaho</data> <data name="address/data/postcode" xsi:type="string">83201</data> <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data> <data name="shipping/shipping_method" xsi:type="string">Fixed</data> <data name="shipping/price" xsi:type="string">5</data> - <data name="taxRule/data/tax_rate/dataSet/rate_0" xsi:type="string">withFixedZip</data> - <data name="taxRule/data/tax_customer_class/dataSet/class_0" xsi:type="string">-</data> - <data name="taxRule/data/tax_product_class/dataSet/class_0" xsi:type="string">product_tax_class</data> - <data name="taxRule/data/tax_product_class/dataSet/class_1" xsi:type="string">-</data> + <data name="taxRule/data/tax_rate/dataset/rate_0" xsi:type="string">withFixedZip</data> + <data name="taxRule/data/tax_customer_class/dataset/class_0" xsi:type="string">-</data> + <data name="taxRule/data/tax_product_class/dataset/class_0" xsi:type="string">product_tax_class</data> + <data name="taxRule/data/tax_product_class/dataset/class_1" xsi:type="string">-</data> <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleSuccessSaveMessage" /> <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleInGrid" /> <constraint name="Magento\Tax\Test\Constraint\AssertTaxRuleForm" /> diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestStep/CreateTaxRuleStep.php b/dev/tests/functional/tests/app/Magento/Tax/Test/TestStep/CreateTaxRuleStep.php index a0f51838413330af5836f335faa6f58cc9c310df..a587216002ed8a933341ddf30fa10d8f24af1a1a 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestStep/CreateTaxRuleStep.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestStep/CreateTaxRuleStep.php @@ -63,7 +63,7 @@ class CreateTaxRuleStep implements TestStepInterface foreach ($taxRuleDataSets as $taxRuleDataSet) { $taxRule = $this->fixtureFactory->createByCode( 'taxRule', - ['dataSet' => $taxRuleDataSet] + ['dataset' => $taxRuleDataSet] ); $taxRule->persist(); $result['taxRule'] = $taxRule; diff --git a/dev/tests/functional/tests/app/Magento/Ups/Test/TestCase/OnePageCheckoutTest.xml b/dev/tests/functional/tests/app/Magento/Ups/Test/TestCase/OnePageCheckoutTest.xml index 6fc10ed38d6c56eaad94467b0d8a1a82b7f242cc..ac03a7e25283fc8e951d617d58ffc7594cfa491c 100644 --- a/dev/tests/functional/tests/app/Magento/Ups/Test/TestCase/OnePageCheckoutTest.xml +++ b/dev/tests/functional/tests/app/Magento/Ups/Test/TestCase/OnePageCheckoutTest.xml @@ -11,8 +11,8 @@ <data name="description" xsi:type="string">MAGETWO-12848 – Use UPS Online Shipping Carrier on Checkout as a Registered Customer</data> <data name="products" xsi:type="string">catalogProductSimple::default, configurableProduct::default, bundleProduct::bundle_fixed_product</data> <data name="checkoutMethod" xsi:type="string">login</data> - <data name="customer/dataSet" xsi:type="string">default</data> - <data name="billingAddress/dataSet" xsi:type="string">US_address_1</data> + <data name="customer/dataset" xsi:type="string">default</data> + <data name="billingAddress/dataset" xsi:type="string">US_address_1</data> <data name="shipping/shipping_service" xsi:type="string">United Parcel Service</data> <data name="shipping/shipping_method" xsi:type="string">UPS Ground</data> <data name="cart/data/shipping_method" xsi:type="string">UPS Ground</data> @@ -27,9 +27,9 @@ <data name="description" xsi:type="string">Check Out as Guest using UPS with US shipping origin and UK customer</data> <data name="products" xsi:type="string">catalogProductSimple::default, configurableProduct::default, bundleProduct::bundle_fixed_product</data> <data name="checkoutMethod" xsi:type="string">guest</data> - <data name="customer/dataSet" xsi:type="string">default</data> - <data name="address/dataSet" xsi:type="string">UK_address</data> - <data name="billingAddress/dataSet" xsi:type="string">UK_address</data> + <data name="customer/dataset" xsi:type="string">default</data> + <data name="address/dataset" xsi:type="string">UK_address</data> + <data name="billingAddress/dataset" xsi:type="string">UK_address</data> <data name="shipping/shipping_service" xsi:type="string">United Parcel Service</data> <data name="shipping/shipping_method" xsi:type="string">UPS Worldwide Expedited</data> <data name="cart/data/shipping_method" xsi:type="string">UPS Worldwide Expedited</data> diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Fixture/UrlRewrite.xml b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Fixture/UrlRewrite.xml index f0fda4e5442de3338d518ecad3cc758bfa82f5db..e2e122faa0a5e179ab42bf2a8d3563160fd16818 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Fixture/UrlRewrite.xml +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Fixture/UrlRewrite.xml @@ -6,25 +6,21 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="urlRewrite" module="Magento_UrlRewrite" type="virtual" entity_type="url_rewrite" collection="Magento\UrlRewrite\Model\Resource\UrlRewriteCollection" identifier="request_path" repository_class="Magento\UrlRewrite\Test\Repository\UrlRewrite" handler_interface="Magento\UrlRewrite\Test\Handler\UrlRewrite\UrlRewriteInterface" class="Magento\UrlRewrite\Test\Fixture\UrlRewrite"> - <dataset name="default"> - <field name="store_id" xsi:type="string">Main Website/Main Website Store/Default Store View</field> - <field name="request_path" xsi:type="string">test_request%isolation%</field> - </dataset> - <field name="id"/> - <field name="store_id" is_required="1" source="Magento\UrlRewrite\Test\Fixture\UrlRewrite\StoreId"> - <default_value xsi:type="string">Main Website/Main Website Store/Default Store View</default_value> - </field> - <field name="redirect_type" is_required="0"/> - <field name="request_path" is_required="1"> - <default_value xsi:type="string">test_request%isolation%</default_value> - </field> - <field name="entity_type" is_required="0"> - <default_value xsi:type="null"/> - </field> - <field name="target_path" is_required="1" source="Magento\UrlRewrite\Test\Fixture\UrlRewrite\TargetPath"> - <default_value xsi:type="string">target_path%isolation%</default_value> - </field> - <field name="description" is_required="0"/> - </fixture> + <fixture name="urlRewrite" + module="Magento_UrlRewrite" + type="virtual" + entity_type="url_rewrite" + collection="Magento\UrlRewrite\Model\Resource\UrlRewriteCollection" + identifier="request_path" + repository_class="Magento\UrlRewrite\Test\Repository\UrlRewrite" + handler_interface="Magento\UrlRewrite\Test\Handler\UrlRewrite\UrlRewriteInterface" + class="Magento\UrlRewrite\Test\Fixture\UrlRewrite"> + <field name="id" /> + <field name="store_id" is_required="1" source="Magento\UrlRewrite\Test\Fixture\UrlRewrite\StoreId" /> + <field name="redirect_type" is_required="0" /> + <field name="request_path" is_required="1" /> + <field name="entity_type" is_required="0" /> + <field name="target_path" is_required="1" source="Magento\UrlRewrite\Test\Fixture\UrlRewrite\TargetPath" /> + <field name="description" is_required="0" /> + </fixture> </config> diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Fixture/UrlRewrite/StoreId.php b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Fixture/UrlRewrite/StoreId.php index 5d234bfab7156b4bc26890eebd0f2c1202b75493..bd669eb51ab7a597d118dd35b24a352b86eeda10 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Fixture/UrlRewrite/StoreId.php +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Fixture/UrlRewrite/StoreId.php @@ -6,30 +6,15 @@ namespace Magento\UrlRewrite\Test\Fixture\UrlRewrite; +use Magento\Mtf\Fixture\DataSource; use Magento\Store\Test\Fixture\Store; use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Mtf\Fixture\FixtureInterface; /** - * Class StoreId - * Store id source + * Store id source. */ -class StoreId implements FixtureInterface +class StoreId extends DataSource { - /** - * Resource data - * - * @var string - */ - protected $data; - - /** - * Data set configuration settings - * - * @var array - */ - protected $params; - /** * @param FixtureFactory $fixtureFactory * @param array $params @@ -40,7 +25,7 @@ class StoreId implements FixtureInterface $this->params = $params; if (preg_match('`%(.*?)%`', $data, $store)) { /** @var Store $storeFixture */ - $storeFixture = $fixtureFactory->createByCode('store', ['dataSet' => $store[1]]); + $storeFixture = $fixtureFactory->createByCode('store', ['dataset' => $store[1]]); if (!$storeFixture->hasData('store_id')) { $storeFixture->persist(); } @@ -48,37 +33,4 @@ class StoreId implements FixtureInterface } $this->data = $data; } - - /** - * Persist custom selections products - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data - * - * @param string|null $key [optional] - * @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; - } } diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Fixture/UrlRewrite/TargetPath.php b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Fixture/UrlRewrite/TargetPath.php index 44614ad58326163a61320b149af2b5510566ad53..414760395e02d26c9567048bbaef713479102761 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Fixture/UrlRewrite/TargetPath.php +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Fixture/UrlRewrite/TargetPath.php @@ -6,37 +6,24 @@ namespace Magento\UrlRewrite\Test\Fixture\UrlRewrite; +use Magento\Mtf\Fixture\DataSource; use Magento\Mtf\Fixture\FixtureFactory; use Magento\Mtf\Fixture\FixtureInterface; /** - * Class TargetPath - * Prepare Target Path + * Prepare Target Path. */ -class TargetPath implements FixtureInterface +class TargetPath extends DataSource { /** - * Resource data - * - * @var string - */ - protected $data; - - /** - * Return entity + * Return entity. * * @var FixtureInterface */ protected $entity = null; /** - * Data set configuration settings - * - * @var array - */ - protected $params; - - /** + * @constructor * @param FixtureFactory $fixtureFactory * @param array $params * @param string $data [optional] @@ -48,11 +35,11 @@ class TargetPath implements FixtureInterface $this->data = $data; return; } - preg_match('`%(.*?)%`', $data['entity'], $dataSet); - $entityConfig = isset($dataSet[1]) ? explode('::', $dataSet[1]) : []; + preg_match('`%(.*?)%`', $data['entity'], $dataset); + $entityConfig = isset($dataset[1]) ? explode('::', $dataset[1]) : []; if (count($entityConfig) > 1) { /** @var FixtureInterface $fixture */ - $this->entity = $fixtureFactory->createByCode($entityConfig[0], ['dataSet' => $entityConfig[1]]); + $this->entity = $fixtureFactory->createByCode($entityConfig[0], ['dataset' => $entityConfig[1]]); $this->entity->persist(); $id = $this->entity->hasData('id') ? $this->entity->getId() : $this->entity->getPageId(); $this->data = preg_replace('`(%.*?%)`', $id, $data['entity']); @@ -62,40 +49,7 @@ class TargetPath implements FixtureInterface } /** - * Persist custom selections products - * - * @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 entity + * Return entity. * * @return FixtureInterface|null */ diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/CreateCategoryRewriteEntityTest.php b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/CreateCategoryRewriteEntityTest.php index 636a64f31e559b3586a72f06737c8a3e131cdd03..8039caec15da81ce8bed10d814202ecec7bea0c0 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/CreateCategoryRewriteEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/CreateCategoryRewriteEntityTest.php @@ -71,7 +71,7 @@ class CreateCategoryRewriteEntityTest extends Injectable $this->urlRewriteIndex = $urlRewriteIndex; $category = $fixtureFactory->createByCode( 'category', - ['dataSet' => 'default_subcategory'] + ['dataset' => 'default_subcategory'] ); $category->persist(); return ['category' => $category]; diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/CreateProductUrlRewriteEntityTest.php b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/CreateProductUrlRewriteEntityTest.php index 623d03d64103ad2928894121256198891cd2ac4d..c2bd659b50604ed00c99e4fabb40412475e9f665 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/CreateProductUrlRewriteEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/CreateProductUrlRewriteEntityTest.php @@ -26,7 +26,7 @@ use Magento\Mtf\TestCase\Injectable; * 4. Select "For Product" from "Create URL Rewrite:" dropdown * 5. Select created early product * 6. Click "Skip Category Selection" button - * 7. Fill data according to dataSet + * 7. Fill data according to dataset * 8. Perform all assertions * * @group URL_Rewrites_(PS) diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/CreateProductUrlRewriteEntityTest.xml b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/CreateProductUrlRewriteEntityTest.xml index 4413afea5711c09116ddad5faad24fe0ee4f5b26..8eb1de56fe44f9b3bf14fadb55adb8d3d900e785 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/CreateProductUrlRewriteEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/CreateProductUrlRewriteEntityTest.xml @@ -10,7 +10,7 @@ <variation name="CreateProductUrlRewriteEntityTestVariation1"> <data name="description" xsi:type="string">MAGETWO-12409: Add Temporary Redirect for Product</data> <data name="urlRewrite/data/entity_type" xsi:type="string">For product</data> - <data name="product/dataSet" xsi:type="string">product_with_category</data> + <data name="product/dataset" xsi:type="string">product_with_category</data> <data name="urlRewrite/data/store_id" xsi:type="string">Main Website/Main Website Store/Default Store View</data> <data name="urlRewrite/data/request_path" xsi:type="string">cat%isolation%/simp_redirect%isolation%.html</data> <data name="urlRewrite/data/redirect_type" xsi:type="string">Temporary (302)</data> @@ -22,7 +22,7 @@ <variation name="CreateProductUrlRewriteEntityTestVariation2"> <data name="description" xsi:type="string">Create Product URL Rewrites with no redirect</data> <data name="urlRewrite/data/entity_type" xsi:type="string">For product</data> - <data name="product/dataSet" xsi:type="string">default</data> + <data name="product/dataset" xsi:type="string">default</data> <data name="urlRewrite/data/store_id" xsi:type="string">Main Website/Main Website Store/Default Store View</data> <data name="urlRewrite/data/request_path" xsi:type="string">test_%isolation%.html</data> <data name="urlRewrite/data/redirect_type" xsi:type="string">No</data> @@ -32,7 +32,7 @@ <variation name="CreateProductUrlRewriteEntityTestVariation3"> <data name="description" xsi:type="string">Create Product URL Rewrites with Temporary redirect</data> <data name="urlRewrite/data/entity_type" xsi:type="string">For product</data> - <data name="product/dataSet" xsi:type="string">default</data> + <data name="product/dataset" xsi:type="string">default</data> <data name="urlRewrite/data/store_id" xsi:type="string">Main Website/Main Website Store/Default Store View</data> <data name="urlRewrite/data/request_path" xsi:type="string">test_%isolation%.html</data> <data name="urlRewrite/data/redirect_type" xsi:type="string">Temporary (302)</data> @@ -43,7 +43,7 @@ <variation name="CreateProductUrlRewriteEntityTestVariation4"> <data name="description" xsi:type="string">Create Product URL Rewrites with Permanent redirect</data> <data name="urlRewrite/data/entity_type" xsi:type="string">For product</data> - <data name="product/dataSet" xsi:type="string">default</data> + <data name="product/dataset" xsi:type="string">default</data> <data name="urlRewrite/data/store_id" xsi:type="string">Main Website/Main Website Store/Default Store View</data> <data name="urlRewrite/data/request_path" xsi:type="string">test_%isolation%.html</data> <data name="urlRewrite/data/redirect_type" xsi:type="string">Permanent (301)</data> diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/DeleteCustomUrlRewriteEntityTest.xml b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/DeleteCustomUrlRewriteEntityTest.xml index e3a67cc49fbed791e81a0c2d9ff5cf46a5f86bb8..1e855d511f0f2814d53597f67873422e3ef6b78e 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/DeleteCustomUrlRewriteEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/DeleteCustomUrlRewriteEntityTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\UrlRewrite\Test\TestCase\DeleteCustomUrlRewriteEntityTest"> <variation name="DeleteCustomUrlRewriteEntityTestVariation1"> - <data name="urlRewrite/dataSet" xsi:type="string">default</data> + <data name="urlRewrite/dataset" xsi:type="string">default</data> <constraint name="Magento\UrlRewrite\Test\Constraint\AssertUrlRewriteDeletedMessage"/> <constraint name="Magento\UrlRewrite\Test\Constraint\AssertUrlRewriteNotInGrid"/> <constraint name="Magento\UrlRewrite\Test\Constraint\AssertPageByUrlRewriteIsNotFound"/> diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/DeleteProductUrlRewriteEntityTest.xml b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/DeleteProductUrlRewriteEntityTest.xml index 8b9bf1859b06a755496151d2c53f61e2a0c3d796..f682028be63b84b63874799522ccb314d77f623f 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/DeleteProductUrlRewriteEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/DeleteProductUrlRewriteEntityTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\UrlRewrite\Test\TestCase\DeleteProductUrlRewriteEntityTest"> <variation name="DeleteProductUrlRewriteEntityTestVariation1"> - <data name="productRedirect/dataSet" xsi:type="string">default_without_target</data> + <data name="productRedirect/dataset" xsi:type="string">default_without_target</data> <data name="productRedirect/data/target_path/entity" xsi:type="string">product/%catalogProductSimple::product_100_dollar%</data> <constraint name="Magento\UrlRewrite\Test\Constraint\AssertUrlRewriteDeletedMessage"/> <constraint name="Magento\UrlRewrite\Test\Constraint\AssertUrlRewriteNotInGrid"/> diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/UpdateCategoryUrlRewriteEntityTest.php b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/UpdateCategoryUrlRewriteEntityTest.php index 25a5f58638c939f967563deab905f2777bf5c47b..a794d6a8b18fbca02ac237098b17885681786d9b 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/UpdateCategoryUrlRewriteEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/UpdateCategoryUrlRewriteEntityTest.php @@ -26,7 +26,7 @@ use Magento\Mtf\TestCase\Injectable; * 1. Log in to backend as Admin. * 2. Go to the Marketing-> SEO & Search->URL Rewrites. * 3. Click Category URL Rewrite from grid. - * 4. Edit test value(s) according to dataSet. + * 4. Edit test value(s) according to dataset. * 5. Click 'Save' button. * 6. Perform all asserts. * @@ -55,7 +55,7 @@ class UpdateCategoryUrlRewriteEntityTest extends Injectable protected $urlRewriteEdit; /** - * Prepare dataSets and pages + * Prepare datasets and pages * * @param UrlRewriteIndex $urlRewriteIndex * @param UrlRewriteEdit $urlRewriteEdit @@ -75,7 +75,7 @@ class UpdateCategoryUrlRewriteEntityTest extends Injectable $categoryRedirect = $fixtureFactory->createByCode( 'urlRewrite', [ - 'dataSet' => 'default', + 'dataset' => 'default', 'data' => ['target_path' => $category->getUrlKey() . '.html'] ] ); diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/UpdateCategoryUrlRewriteEntityTest.xml b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/UpdateCategoryUrlRewriteEntityTest.xml index 76f9b2e73f7d431658d934ff8b4820f317d2d259..5e20d3ac2af75dc82f59f378dc6fe182a6d6f9d9 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/UpdateCategoryUrlRewriteEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/UpdateCategoryUrlRewriteEntityTest.xml @@ -9,8 +9,8 @@ <testCase name="Magento\UrlRewrite\Test\TestCase\UpdateCategoryUrlRewriteEntityTest"> <variation name="UpdateCategoryUrlRewriteEntityTestVariation1"> <data name="urlRewrite/data/store_id" xsi:type="string">Main Website/Main Website Store/Default Store View</data> - <data name="category/dataSet" xsi:type="string">default_subcategory</data> - <data name="categoryRewrite/dataSet" xsi:type="string">default</data> + <data name="category/dataset" xsi:type="string">default_subcategory</data> + <data name="categoryRewrite/dataset" xsi:type="string">default</data> <data name="urlRewrite/data/store_id" xsi:type="string">-</data> <data name="urlRewrite/data/request_path" xsi:type="string">test_request%isolation%</data> <data name="urlRewrite/data/redirect_type" xsi:type="string">No</data> @@ -21,8 +21,8 @@ </variation> <variation name="UpdateCategoryUrlRewriteEntityTestVariation2"> <data name="urlRewrite/data/store_id" xsi:type="string">Main Website/Main Website Store/Default Store View</data> - <data name="category/dataSet" xsi:type="string">default_subcategory</data> - <data name="categoryRewrite/dataSet" xsi:type="string">default</data> + <data name="category/dataset" xsi:type="string">default_subcategory</data> + <data name="categoryRewrite/dataset" xsi:type="string">default</data> <data name="urlRewrite/data/store_id" xsi:type="string">-</data> <data name="urlRewrite/data/request_path" xsi:type="string">request_path%isolation%.html</data> <data name="urlRewrite/data/redirect_type" xsi:type="string">Temporary (302)</data> @@ -33,8 +33,8 @@ </variation> <variation name="UpdateCategoryUrlRewriteEntityTestVariation3"> <data name="urlRewrite/data/store_id" xsi:type="string">Main Website/Main Website Store/Default Store View</data> - <data name="category/dataSet" xsi:type="string">default_subcategory</data> - <data name="categoryRewrite/dataSet" xsi:type="string">default</data> + <data name="category/dataset" xsi:type="string">default_subcategory</data> + <data name="categoryRewrite/dataset" xsi:type="string">default</data> <data name="urlRewrite/data/store_id" xsi:type="string">-</data> <data name="urlRewrite/data/request_path" xsi:type="string">request_path%isolation%.htm</data> <data name="urlRewrite/data/redirect_type" xsi:type="string">Permanent (301)</data> @@ -45,8 +45,8 @@ </variation> <variation name="UpdateCategoryUrlRewriteEntityTestVariation4"> <data name="urlRewrite/data/store_id" xsi:type="string">Main Website/Main Website Store/Default Store View</data> - <data name="category/dataSet" xsi:type="string">default_subcategory</data> - <data name="categoryRewrite/dataSet" xsi:type="string">default</data> + <data name="category/dataset" xsi:type="string">default_subcategory</data> + <data name="categoryRewrite/dataset" xsi:type="string">default</data> <data name="urlRewrite/data/store_id" xsi:type="string">-</data> <data name="urlRewrite/data/request_path" xsi:type="string">request_path%isolation%.aspx</data> <data name="urlRewrite/data/redirect_type" xsi:type="string">Temporary (302)</data> diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/UpdateCustomUrlRewriteEntityTest.xml b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/UpdateCustomUrlRewriteEntityTest.xml index 989f7cab4a6847b080a9d7875747d92119817c3f..bb0fa6ed624a9a8a3c06069a4cbc3170f26743b6 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/UpdateCustomUrlRewriteEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/UpdateCustomUrlRewriteEntityTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\UrlRewrite\Test\TestCase\UpdateCustomUrlRewriteEntityTest"> <variation name="UpdateCustomUrlRewriteEntityTestVariation1"> - <data name="initialRewrite/dataSet" xsi:type="string">default</data> + <data name="initialRewrite/dataset" xsi:type="string">default</data> <data name="urlRewrite/data/store_id" xsi:type="string">Main Website/Main Website Store/Default Store View</data> <data name="urlRewrite/data/request_path" xsi:type="string">wishlist/%isolation%</data> <data name="urlRewrite/data/target_path/entity" xsi:type="string">http://www.magentocommerce.com/magento-connect/</data> @@ -19,7 +19,7 @@ <constraint name="Magento\UrlRewrite\Test\Constraint\AssertUrlRewriteSuccessOutsideRedirect"/> </variation> <variation name="UpdateCustomUrlRewriteEntityTestVariation2"> - <data name="initialRewrite/dataSet" xsi:type="string">custom_rewrite_wishlist</data> + <data name="initialRewrite/dataset" xsi:type="string">custom_rewrite_wishlist</data> <data name="urlRewrite/data/store_id" xsi:type="string">Main Website/Main Website Store/Default Store View</data> <data name="urlRewrite/data/request_path" xsi:type="string">wishlist/%isolation%</data> <data name="urlRewrite/data/target_path/entity" xsi:type="string">catalogsearch/result/?q=$%catalogProductSimple::defaul%sku$</data> diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/UpdateProductUrlRewriteEntityTest.php b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/UpdateProductUrlRewriteEntityTest.php index 3b7562540e692afc45f9053932eae6730d0aa8f8..dd3f4d91257ffa7e34f94f4eda03f50127fbd58e 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/UpdateProductUrlRewriteEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/UpdateProductUrlRewriteEntityTest.php @@ -54,7 +54,7 @@ class UpdateProductUrlRewriteEntityTest extends Injectable protected $urlRewriteEdit; /** - * Prepare dataSets and pages + * Prepare datasets and pages * * @param UrlRewriteIndex $urlRewriteIndex * @param UrlRewriteEdit $urlRewriteEdit @@ -81,7 +81,7 @@ class UpdateProductUrlRewriteEntityTest extends Injectable $productRedirect = $fixtureFactory->createByCode( 'urlRewrite', [ - 'dataSet' => 'default', + 'dataset' => 'default', 'data' => ['target_path' => $urlRewrite->getTargetPath()] ] ); diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserFailedLoginByPermissionMessage.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserFailedLoginByPermissionMessage.php new file mode 100644 index 0000000000000000000000000000000000000000..db943e911a3d0c3c695cecd9e7372f4e86ebf869 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserFailedLoginByPermissionMessage.php @@ -0,0 +1,49 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\User\Test\Constraint; + +use Magento\Backend\Test\Page\AdminAuthLogin; +use Magento\User\Test\Fixture\User; +use Magento\Mtf\Constraint\AbstractConstraint; + +/** + * Verify incorrect credentials message while login to admin. + */ +class AssertUserFailedLoginByPermissionMessage extends AbstractConstraint +{ + const FAILED_LOGIN_MESSAGE = 'You need more permissions to access this.'; + + /** + * Verify incorrect credentials message while login to admin. + * + * @param AdminAuthLogin $adminAuth + * @param User $customAdmin + * @return void + */ + public function processAssert(AdminAuthLogin $adminAuth, User $customAdmin) + { + $adminAuth->open(); + $adminAuth->getLoginBlock()->fill($customAdmin); + $adminAuth->getLoginBlock()->submit(); + + \PHPUnit_Framework_Assert::assertEquals( + self::FAILED_LOGIN_MESSAGE, + $adminAuth->getMessagesBlock()->getErrorMessages(), + 'Message "' . self::FAILED_LOGIN_MESSAGE . '" is not visible.' + ); + } + + /** + * Returns error message equals expected message. + * + * @return string + */ + public function toString() + { + return 'Invalid credentials message was displayed.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserFailedLoginMessage.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserFailedLoginMessage.php index e01aa9a9cd0cdfe0af16c3c74c6f32cfdbe8f669..1f55c18690f7469f2bf45f3226c5393ad5ae9e33 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserFailedLoginMessage.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserFailedLoginMessage.php @@ -15,7 +15,7 @@ use Magento\Mtf\Constraint\AbstractConstraint; */ class AssertUserFailedLoginMessage extends AbstractConstraint { - const FAILED_LOGIN_MESSAGE = 'You did not sign in correctly or your account is temporarily disabled.'; + const FAILED_LOGIN_MESSAGE = 'This account is inactive.'; /** * Verify incorrect credentials message while login to admin diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Fixture/Role.xml b/dev/tests/functional/tests/app/Magento/User/Test/Fixture/Role.xml index 39ac5778e0cc30e30d6d8edeca2824949954327d..a013071cb9c756a33e7557ca5e4d1db50ceb115e 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Fixture/Role.xml +++ b/dev/tests/functional/tests/app/Magento/User/Test/Fixture/Role.xml @@ -6,39 +6,24 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="role" module="Magento_User" type="flat" entity_type="authorization_role" collection="Magento\User\Model\Resource\Role\User\Collection" repository_class="Magento\User\Test\Repository\Role" handler_interface="Magento\User\Test\Handler\Role\RoleInterface" class="Magento\User\Test\Fixture\Role"> - <dataset name="default"> - <field name="rolename" xsi:type="string">AdminRole%isolation%</field> - <field name="resource_access" xsi:type="string">All</field> - </dataset> - <field name="role_id" is_required="1"> - <default_value xsi:type="null"/> - </field> - <field name="parent_id" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="tree_level" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="sort_order" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="role_type" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="user_id" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="rolename" is_required="" group="role-info"> - <default_value xsi:type="string">AdminRole%isolation%</default_value> - </field> - <field name="user_type" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="resource_access" group="role-resources"> - <default_value xsi:type="string">All</default_value> - </field> - <field name="roles_resources" group="role-resources"/> - <field name="in_role_users" group="in_role_users" source="Magento\User\Test\Fixture\Role\InRoleUsers"/> + <fixture name="role" + module="Magento_User" + type="flat" + entity_type="authorization_role" + collection="Magento\User\Model\Resource\Role\User\Collection" + repository_class="Magento\User\Test\Repository\Role" + handler_interface="Magento\User\Test\Handler\Role\RoleInterface" + class="Magento\User\Test\Fixture\Role"> + <field name="role_id" is_required="1" /> + <field name="parent_id" is_required="" /> + <field name="tree_level" is_required="" /> + <field name="sort_order" is_required="" /> + <field name="role_type" is_required="" /> + <field name="user_id" is_required="" /> + <field name="rolename" is_required="" group="role-info" /> + <field name="user_type" is_required="" /> + <field name="resource_access" group="role-resources" /> + <field name="roles_resources" group="role-resources" /> + <field name="in_role_users" group="in_role_users" source="Magento\User\Test\Fixture\Role\InRoleUsers" /> </fixture> </config> diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Fixture/Role/InRoleUsers.php b/dev/tests/functional/tests/app/Magento/User/Test/Fixture/Role/InRoleUsers.php index bd716bbeabb47af94db3a766d59fa37cc14559d5..6ec27d7a9941b7575827c609d68709ff8a337f6b 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Fixture/Role/InRoleUsers.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Fixture/Role/InRoleUsers.php @@ -7,24 +7,17 @@ namespace Magento\User\Test\Fixture\Role; use Magento\User\Test\Fixture\User; +use Magento\Mtf\Fixture\DataSource; use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Mtf\Fixture\FixtureInterface; /** * Class InRoleUsers * * Data keys: - * - dataSet + * - dataset */ -class InRoleUsers implements FixtureInterface +class InRoleUsers extends DataSource { - /** - * Array with data set configuration settings - * - * @var array - */ - protected $params; - /** * Array with Admin Users * @@ -32,13 +25,6 @@ class InRoleUsers implements FixtureInterface */ protected $adminUsers; - /** - * Array with usernames - * - * @var array - */ - protected $data; - /** * @construct * @param FixtureFactory $fixtureFactory @@ -48,10 +34,10 @@ class InRoleUsers implements FixtureInterface public function __construct(FixtureFactory $fixtureFactory, array $params, array $data = []) { $this->params = $params; - if (isset($data['dataSet']) && $data['dataSet'] !== '-') { - $dataSets = explode(',', $data['dataSet']); - foreach ($dataSets as $dataSet) { - $adminUser = $fixtureFactory->createByCode('user', ['dataSet' => trim($dataSet)]); + 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(); } @@ -61,39 +47,6 @@ class InRoleUsers implements FixtureInterface } } - /** - * Persist user role - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return array with usernames - * - * @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 * diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Fixture/User.xml b/dev/tests/functional/tests/app/Magento/User/Test/Fixture/User.xml index 80c969cf4bbfe3c393e25e8abae8066e552ec028..a6a92e41d6446f218e7aeca63bdf251fcbdae3c1 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Fixture/User.xml +++ b/dev/tests/functional/tests/app/Magento/User/Test/Fixture/User.xml @@ -6,69 +6,32 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="user" module="Magento_User" type="flat" entity_type="admin_user" collection="Magento\User\Model\Resource\User\Collection" repository_class="Magento\User\Test\Repository\User" handler_interface="Magento\User\Test\Handler\User\UserInterface" class="Magento\User\Test\Fixture\User"> - <dataset name="default"> - <field name="username" xsi:type="string">AdminUser%isolation%</field> - <field name="firstname" xsi:type="string">FirstName%isolation%</field> - <field name="lastname" xsi:type="string">LastName%isolation%</field> - <field name="email" xsi:type="string">email%isolation%@example.com</field> - <field name="password" xsi:type="string">123123q</field> - <field name="password_confirmation" xsi:type="string">123123q</field> - <field name="is_active" xsi:type="string">Active</field> - <field name="current_password" xsi:type="string">%current_password%</field> - </dataset> - <field name="user_id" is_required="1"> - <default_value xsi:type="null"/> - </field> - <field name="firstname" is_required="" group="user-info"> - <default_value xsi:type="string">FirstName%isolation%</default_value> - </field> - <field name="lastname" is_required="" group="user-info"> - <default_value xsi:type="string">LastName%isolation%</default_value> - </field> - <field name="email" is_required="" group="user-info"> - <default_value xsi:type="string">email%isolation%@example.com</default_value> - </field> - <field name="username" is_required="" group="user-info"> - <default_value xsi:type="string">AdminUser%isolation%</default_value> - </field> - <field name="password" is_required="" group="user-info"> - <default_value xsi:type="string">123123q</default_value> - </field> - <field name="created" is_required=""> - <default_value xsi:type="string">CURRENT_TIMESTAMP</default_value> - </field> - <field name="modified" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="logdate" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="lognum" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="reload_acl_flag" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="is_active" is_required=""> - <default_value xsi:type="string">Active</default_value> - </field> - <field name="extra" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="rp_token" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="rp_token_created_at" is_required=""> - <default_value xsi:type="null"/> - </field> - <field name="interface_locale" is_required=""> - <default_value xsi:type="string">en_US</default_value> - </field> - <field name="role_id" group="user-role" source="Magento\User\Test\Fixture\User\RoleId"/> - <field name="password_confirmation" group="user-info"> - <default_value xsi:type="string">123123q</default_value> - </field> - <field name="current_password" group="user-info" source="Magento\User\Test\Fixture\User\CurrentPassword"/> - </fixture> + <fixture name="user" + module="Magento_User" + type="flat" + entity_type="admin_user" + collection="Magento\User\Model\Resource\User\Collection" + repository_class="Magento\User\Test\Repository\User" + handler_interface="Magento\User\Test\Handler\User\UserInterface" + class="Magento\User\Test\Fixture\User"> + <field name="user_id" is_required="1" /> + <field name="firstname" is_required="" group="user-info" /> + <field name="lastname" is_required="" group="user-info" /> + <field name="email" is_required="" group="user-info" /> + <field name="username" is_required="" group="user-info" /> + <field name="password" is_required="" group="user-info" /> + <field name="created" is_required="" /> + <field name="modified" is_required="" /> + <field name="logdate" is_required="" /> + <field name="lognum" is_required="" /> + <field name="reload_acl_flag" is_required="" /> + <field name="is_active" is_required="" /> + <field name="extra" is_required="" /> + <field name="rp_token" is_required="" /> + <field name="rp_token_created_at" is_required="" /> + <field name="interface_locale" is_required="" /> + <field name="role_id" group="user-role" source="Magento\User\Test\Fixture\User\RoleId" /> + <field name="password_confirmation" group="user-info" /> + <field name="current_password" group="user-info" source="Magento\User\Test\Fixture\User\CurrentPassword" /> + </fixture> </config> diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Fixture/User/RoleId.php b/dev/tests/functional/tests/app/Magento/User/Test/Fixture/User/RoleId.php index 93e9e336080fe47fbad5c152dfa9347458029076..7b0a52176e9a9373861a537e7affa95d4fbc66fc 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Fixture/User/RoleId.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Fixture/User/RoleId.php @@ -6,18 +6,18 @@ namespace Magento\User\Test\Fixture\User; +use Magento\Mtf\Fixture\DataSource; use Magento\User\Test\Fixture\Role; use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Mtf\Fixture\FixtureInterface; /** * Source for Role of User. * * Data keys: - * - dataSet + * - dataset * - role */ -class RoleId implements FixtureInterface +class RoleId extends DataSource { /** * Admin User Role. @@ -26,13 +26,6 @@ class RoleId implements FixtureInterface */ protected $role; - /** - * User role name. - * - * @var string - */ - protected $data; - /** * @construct * @param FixtureFactory $fixtureFactory @@ -42,9 +35,9 @@ class RoleId implements FixtureInterface public function __construct(FixtureFactory $fixtureFactory, array $params, array $data = []) { $this->params = $params; - if (isset($data['dataSet']) && $data['dataSet'] !== '-') { - list($fixtureCode, $dataSet) = explode('::', $data['dataSet']); - $this->role = $fixtureFactory->createByCode($fixtureCode, ['dataSet' => $dataSet]); + if (isset($data['dataset']) && $data['dataset'] !== '-') { + list($fixtureCode, $dataset) = explode('::', $data['dataset']); + $this->role = $fixtureFactory->createByCode($fixtureCode, ['dataset' => $dataset]); if (!$this->role->hasData('role_id')) { $this->role->persist(); } @@ -58,39 +51,6 @@ class RoleId implements FixtureInterface } } - /** - * 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. * diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Repository/User.xml b/dev/tests/functional/tests/app/Magento/User/Test/Repository/User.xml index ab4fdba7cb44fb5833a6e2f994f3c2693d217e07..9360d3bedf2767be24171b68b097d8bced598e8f 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Repository/User.xml +++ b/dev/tests/functional/tests/app/Magento/User/Test/Repository/User.xml @@ -36,7 +36,7 @@ <field name="password" xsi:type="string">123123q</field> <field name="password_confirmation" xsi:type="string">123123q</field> <field name="role_id" xsi:type="array"> - <item name="dataSet" xsi:type="string">role::default</item> + <item name="dataset" xsi:type="string">role::default</item> </field> <field name="current_password" xsi:type="string">%current_password%</field> <field name="is_active" xsi:type="string">Active</field> diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserEntityTest.php b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserEntityTest.php index c77bc0c762a3da7f394ff6d16abdb468114350d5..487ff415aab3f80769b7efa1040665c8e834de87 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserEntityTest.php @@ -63,7 +63,7 @@ class CreateAdminUserEntityTest extends Injectable public function __prepare(FixtureFactory $fixtureFactory) { $this->fixtureFactory = $fixtureFactory; - $adminUser = $fixtureFactory->createByCode('user'); + $adminUser = $fixtureFactory->createByCode('user', ['dataset' => 'custom_admin']); $adminUser->persist(); return ['adminUser' => $adminUser]; @@ -88,13 +88,10 @@ class CreateAdminUserEntityTest extends Injectable * @param User $user * @param User $adminUser * @param string $isDuplicated - * @return void + * @return array */ - public function test( - User $user, - User $adminUser, - $isDuplicated - ) { + public function test(User $user, User $adminUser, $isDuplicated) + { // Prepare data if ($isDuplicated != '-') { $data = $user->getData(); @@ -108,5 +105,7 @@ class CreateAdminUserEntityTest extends Injectable $this->userIndexPage->getPageActions()->addNew(); $this->userEditPage->getUserForm()->fill($user); $this->userEditPage->getPageActions()->save(); + + return ['customAdmin' => $user]; } } diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserEntityTest.xml b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserEntityTest.xml index cac4f73a49c5f3ef40d607580ae439c728ed6ce2..127e2d122a32b6ad5aa9f89089b01d8b148279fb 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserEntityTest.xml @@ -15,7 +15,7 @@ <data name="user/data/password" xsi:type="string">123123q</data> <data name="user/data/password_confirmation" xsi:type="string">123123q</data> <data name="user/data/is_active" xsi:type="string">Active</data> - <data name="user/data/role_id/dataSet" xsi:type="string">role::Administrators</data> + <data name="user/data/role_id/dataset" xsi:type="string">role::Administrators</data> <data name="isDuplicated" xsi:type="string">-</data> <data name="user/data/current_password" xsi:type="string">%current_password%</data> <constraint name="Magento\User\Test\Constraint\AssertUserSuccessSaveMessage"/> @@ -31,7 +31,7 @@ <data name="user/data/password" xsi:type="string">123123q</data> <data name="user/data/password_confirmation" xsi:type="string">123123q</data> <data name="user/data/is_active" xsi:type="string">Inactive</data> - <data name="user/data/role_id/dataSet" xsi:type="string">role::Administrators</data> + <data name="user/data/role_id/dataset" xsi:type="string">role::Administrators</data> <data name="isDuplicated" xsi:type="string">-</data> <data name="user/data/current_password" xsi:type="string">%current_password%</data> <constraint name="Magento\User\Test\Constraint\AssertUserSuccessSaveMessage"/> @@ -46,7 +46,7 @@ <data name="user/data/password" xsi:type="string">123123q</data> <data name="user/data/password_confirmation" xsi:type="string">123123q</data> <data name="user/data/is_active" xsi:type="string">Active</data> - <data name="user/data/role_id/dataSet" xsi:type="string">role::Administrators</data> + <data name="user/data/role_id/dataset" xsi:type="string">role::Administrators</data> <data name="isDuplicated" xsi:type="string">username</data> <data name="user/data/current_password" xsi:type="string">%current_password%</data> <constraint name="Magento\User\Test\Constraint\AssertUserDuplicateMessage"/> @@ -58,7 +58,7 @@ <data name="user/data/password" xsi:type="string">123123q</data> <data name="user/data/password_confirmation" xsi:type="string">123123q</data> <data name="user/data/is_active" xsi:type="string">Active</data> - <data name="user/data/role_id/dataSet" xsi:type="string">role::Administrators</data> + <data name="user/data/role_id/dataset" xsi:type="string">role::Administrators</data> <data name="isDuplicated" xsi:type="string">email</data> <data name="user/data/current_password" xsi:type="string">%current_password%</data> <constraint name="Magento\User\Test\Constraint\AssertUserDuplicateMessage"/> @@ -76,7 +76,7 @@ <constraint name="Magento\User\Test\Constraint\AssertUserSuccessSaveMessage"/> <constraint name="Magento\User\Test\Constraint\AssertUserInGrid"/> <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogOut"/> - <constraint name="Magento\User\Test\Constraint\AssertUserFailedLoginMessage"/> + <constraint name="Magento\User\Test\Constraint\AssertUserFailedLoginByPermissionMessage"/> </variation> <variation name="CreateAdminUserEntityTestVariation6"> <data name="user/data/username" xsi:type="string">AdminUser%isolation%</data> diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/DeleteAdminUserEntityTest.php b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/DeleteAdminUserEntityTest.php index d6d4c9f9debbcf682bb730836658839d0126416f..662992062276a834232c280958d232c8bfc983fc 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/DeleteAdminUserEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/DeleteAdminUserEntityTest.php @@ -67,7 +67,7 @@ class DeleteAdminUserEntityTest extends Injectable { $user = $fixtureFactory->createByCode( 'user', - ['dataSet' => 'custom_admin_with_default_role'] + ['dataset' => 'custom_admin_with_default_role'] ); $user->persist(); diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/DeleteUserRoleEntityTest.php b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/DeleteUserRoleEntityTest.php index b4cf004d50b0139d06c4aba565a19b351d3512bd..22421a9557c82e3a7feb4f745ec5c92da61d59ee 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/DeleteUserRoleEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/DeleteUserRoleEntityTest.php @@ -68,7 +68,7 @@ class DeleteUserRoleEntityTest extends Injectable { $adminUser = $fixtureFactory->createByCode( 'user', - ['dataSet' => 'custom_admin_with_default_role'] + ['dataset' => 'custom_admin_with_default_role'] ); $adminUser->persist(); diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/RevokeAllAccessTokensForAdminWithoutTokensTest.xml b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/RevokeAllAccessTokensForAdminWithoutTokensTest.xml index 1ab6385dacf9b39cafffc28959ad1205bf9209c3..2603f1744ddf7b8ee3e83dc69fa0481c4f4fec90 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/RevokeAllAccessTokensForAdminWithoutTokensTest.xml +++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/RevokeAllAccessTokensForAdminWithoutTokensTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\User\Test\TestCase\RevokeAllAccessTokensForAdminWithoutTokensTest"> <variation name="RevokeAllAccessTokensForAdminWithoutTokensTestVariation1"> - <data name="user/dataSet" xsi:type="string">custom_admin</data> + <data name="user/dataset" xsi:type="string">custom_admin</data> <constraint name="Magento\User\Test\Constraint\AssertAccessTokensErrorRevokeMessage"/> </variation> </testCase> diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserEntityTest.xml b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserEntityTest.xml index 04daaffc3298480c1e3778a3d6ef7534ab0f4bb5..47c30567f65302c56c33817e5615e5ab3639e40d 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserEntityTest.xml @@ -8,8 +8,8 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\User\Test\TestCase\UpdateAdminUserEntityTest"> <variation name="UpdateAdminUserEntityTestVariation2"> - <data name="initialUser/dataSet" xsi:type="string">custom_admin_with_default_role</data> - <data name="user/data/role_id/dataSet" xsi:type="string">role::role_sales</data> + <data name="initialUser/dataset" xsi:type="string">custom_admin_with_default_role</data> + <data name="user/data/role_id/dataset" xsi:type="string">role::role_sales</data> <data name="user/data/current_password" xsi:type="string">123123q</data> <data name="loginAsDefaultAdmin" xsi:type="string">0</data> <data name="restrictedAccess" xsi:type="array"> diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserRoleEntityTest.xml b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserRoleEntityTest.xml index a96e809038e1bfad5fee61066835313c576af266..d4d4cf7a2b5f2ba0c85814219c8f9532d90d8fb0 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserRoleEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserRoleEntityTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\User\Test\TestCase\UpdateAdminUserRoleEntityTest"> <variation name="UpdateAdminUserRoleEntityTestVariation1"> - <data name="user/dataSet" xsi:type="string">custom_admin_with_default_role</data> + <data name="user/dataset" xsi:type="string">custom_admin_with_default_role</data> <data name="role/data/rolename" xsi:type="string">NewAdminRole%isolation%</data> <constraint name="Magento\User\Test\Constraint\AssertRoleSuccessSaveMessage"/> <constraint name="Magento\User\Test\Constraint\AssertRoleInGrid"/> @@ -16,10 +16,10 @@ <constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin"/> </variation> <variation name="UpdateAdminUserRoleEntityTestVariation2"> - <data name="user/dataSet" xsi:type="string">default</data> + <data name="user/dataset" xsi:type="string">default</data> <data name="role/data/resource_access" xsi:type="string">Custom</data> <data name="role/data/roles_resources" xsi:type="string">Sales</data> - <data name="role/data/in_role_users/dataSet" xsi:type="string">custom_admin</data> + <data name="role/data/in_role_users/dataset" xsi:type="string">custom_admin</data> <data name="restrictedAccess" xsi:type="array"> <item name="0" xsi:type="string">sales</item> </data> diff --git a/dev/tests/functional/tests/app/Magento/Usps/Test/TestCase/OnePageCheckoutTest.xml b/dev/tests/functional/tests/app/Magento/Usps/Test/TestCase/OnePageCheckoutTest.xml index b930b0fb8abc7e9d60dbde9e80605ae26a629f1a..87c86e00b7317ca7067a78b32b1594f5e4677510 100644 --- a/dev/tests/functional/tests/app/Magento/Usps/Test/TestCase/OnePageCheckoutTest.xml +++ b/dev/tests/functional/tests/app/Magento/Usps/Test/TestCase/OnePageCheckoutTest.xml @@ -11,8 +11,8 @@ <data name="description" xsi:type="string">MAGETWO-12444 – Use USPS Online Shipping Carrier on Checkout as a Registered Customer</data> <data name="products" xsi:type="string">catalogProductSimple::default, configurableProduct::default, bundleProduct::bundle_fixed_product</data> <data name="checkoutMethod" xsi:type="string">login</data> - <data name="customer/dataSet" xsi:type="string">default</data> - <data name="billingAddress/dataSet" xsi:type="string">US_address_1</data> + <data name="customer/dataset" xsi:type="string">default</data> + <data name="billingAddress/dataset" xsi:type="string">US_address_1</data> <data name="shipping/shipping_service" xsi:type="string">United States Postal Service</data> <data name="shipping/shipping_method" xsi:type="string">Priority Mail 1-Day</data> <data name="cart/data/shipping_method" xsi:type="string">Priority Mail 1-Day</data> @@ -27,9 +27,9 @@ <data name="description" xsi:type="string">Check Out as Guest using USPS with US shipping origin and UK customer</data> <data name="products" xsi:type="string">catalogProductSimple::default, configurableProduct::default, bundleProduct::bundle_fixed_product</data> <data name="checkoutMethod" xsi:type="string">guest</data> - <data name="customer/dataSet" xsi:type="string">default</data> - <data name="address/dataSet" xsi:type="string">UK_address</data> - <data name="billingAddress/dataSet" xsi:type="string">UK_address</data> + <data name="customer/dataset" xsi:type="string">default</data> + <data name="address/dataset" xsi:type="string">UK_address</data> + <data name="billingAddress/dataset" xsi:type="string">UK_address</data> <data name="shipping/shipping_service" xsi:type="string">United States Postal Service</data> <data name="shipping/shipping_method" xsi:type="string">Priority Mail International</data> <data name="cart/data/shipping_method" xsi:type="string">Priority Mail International</data> diff --git a/dev/tests/functional/tests/app/Magento/Variable/Test/Constraint/AssertCustomVariableInPage.php b/dev/tests/functional/tests/app/Magento/Variable/Test/Constraint/AssertCustomVariableInPage.php index 31ae1eafecdbc18dc64002d69b4b8fd94c0c4ef1..18bc8800223b46f3f0ef793d1f621d9b6cfec09c 100644 --- a/dev/tests/functional/tests/app/Magento/Variable/Test/Constraint/AssertCustomVariableInPage.php +++ b/dev/tests/functional/tests/app/Magento/Variable/Test/Constraint/AssertCustomVariableInPage.php @@ -43,7 +43,7 @@ class AssertCustomVariableInPage extends AbstractConstraint $cmsPage = $fixtureFactory->createByCode( 'cmsPage', [ - 'dataSet' => 'default', + 'dataset' => 'default', 'data' => [ 'content' => [ 'content' => '{{customVar code=' . $customVariable->getCode() . '}}', diff --git a/dev/tests/functional/tests/app/Magento/Variable/Test/Fixture/SystemVariable.xml b/dev/tests/functional/tests/app/Magento/Variable/Test/Fixture/SystemVariable.xml index c288a4ac3a0e8659efcf0775f1c121d0d4acc1a8..5ea25949b0f4bb2af1e0ea3dcbbfadb15a5c7f45 100644 --- a/dev/tests/functional/tests/app/Magento/Variable/Test/Fixture/SystemVariable.xml +++ b/dev/tests/functional/tests/app/Magento/Variable/Test/Fixture/SystemVariable.xml @@ -6,39 +6,19 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="systemVariable" - module="Magento_Variable" - type="composite" - collection="Magento\Variable\Model\Resource\Variable\Collection" - handler_interface="Magento\Variable\Test\Handler\SystemVariable\SystemVariableInterface" - class="Magento\Variable\Test\Fixture\SystemVariable"> - <dataset name="default"> - <field name="code" xsi:type="string">variableCode%isolation%</field> - <field name="name" xsi:type="string">variableName%isolation%</field> - <field name="html_value" xsi:type="string"><p>html_value</p></field> - <field name="plain_value" xsi:type="string">plain_value</field> - </dataset> - <field name="variable_id" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="code" is_required=""> - <default_value xsi:type="string">variableCode%isolation%</default_value> - </field> - <field name="name" is_required=""> - <default_value xsi:type="string">variableName%isolation%</default_value> - </field> - <field name="value_id" is_required="1"> - <default_value xsi:type="null"/> - </field> - <field name="store_id" is_required=""> - <default_value xsi:type="number">0</default_value> - </field> - <field name="plain_value" is_required=""> - <default_value xsi:type="string">plain_value</default_value> - </field> - <field name="html_value" is_required=""> - <default_value xsi:type="string"><p>html_value</p></default_value> - </field> - <field name="use_default_value"/> - </fixture> + <fixture name="systemVariable" + module="Magento_Variable" + type="composite" + collection="Magento\Variable\Model\Resource\Variable\Collection" + handler_interface="Magento\Variable\Test\Handler\SystemVariable\SystemVariableInterface" + class="Magento\Variable\Test\Fixture\SystemVariable"> + <field name="variable_id" is_required="" /> + <field name="code" is_required="" /> + <field name="name" is_required="" /> + <field name="value_id" is_required="1" /> + <field name="store_id" is_required="" /> + <field name="plain_value" is_required="" /> + <field name="html_value" is_required="" /> + <field name="use_default_value" /> + </fixture> </config> diff --git a/dev/tests/functional/tests/app/Magento/Variable/Test/Repository/SystemVariable.xml b/dev/tests/functional/tests/app/Magento/Variable/Test/Repository/SystemVariable.xml index 827a0fea14fdf3a62b7bb693fcb689cdeeb10c95..c4ac4c1aafba37cd92899b2cee06cace948a0918 100644 --- a/dev/tests/functional/tests/app/Magento/Variable/Test/Repository/SystemVariable.xml +++ b/dev/tests/functional/tests/app/Magento/Variable/Test/Repository/SystemVariable.xml @@ -7,6 +7,13 @@ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> <repository class="Magento\Variable\Test\Repository\SystemVariable"> + <dataset name="default"> + <field name="code" xsi:type="string">variableCode%isolation%</field> + <field name="name" xsi:type="string">variableName%isolation%</field> + <field name="html_value" xsi:type="string"><p>html_value</p></field> + <field name="plain_value" xsi:type="string">plain_value</field> + </dataset> + <dataset name="custom_variable"> <field name="variable" xsi:type="array"> <item name="code" xsi:type="string">variableCode%isolation%</item> diff --git a/dev/tests/functional/tests/app/Magento/Variable/Test/TestCase/UpdateCustomVariableEntityTest.php b/dev/tests/functional/tests/app/Magento/Variable/Test/TestCase/UpdateCustomVariableEntityTest.php index c3dc3c5c3a7acebfc487997f634329605bcaf2ce..0db8eee47b8428111e310802231eeed9b644fc0d 100644 --- a/dev/tests/functional/tests/app/Magento/Variable/Test/TestCase/UpdateCustomVariableEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Variable/Test/TestCase/UpdateCustomVariableEntityTest.php @@ -81,7 +81,7 @@ class UpdateCustomVariableEntityTest extends Injectable $customVariableOrigin->persist(); // TODO: Move store creation to "__prepare" method after fix bug MAGETWO-29331 - $storeOrigin = $factory->createByCode('store', ['dataSet' => 'custom']); + $storeOrigin = $factory->createByCode('store', ['dataset' => 'custom']); $storeOrigin->persist(); $this->store = $storeOrigin; diff --git a/dev/tests/functional/tests/app/Magento/Weee/Test/Block/Product/Price.php b/dev/tests/functional/tests/app/Magento/Weee/Test/Block/Product/Price.php index 0551b792554d41884a14d41903ecfd449c5b8d74..2bfd68bcdd2e9fc13c263aa52f1908566187487d 100644 --- a/dev/tests/functional/tests/app/Magento/Weee/Test/Block/Product/Price.php +++ b/dev/tests/functional/tests/app/Magento/Weee/Test/Block/Product/Price.php @@ -18,7 +18,7 @@ class Price extends \Magento\Catalog\Test\Block\AbstractPriceBlock */ protected $mapTypePrices = [ 'regular_price' => [ - 'selector' => '[data-price-type="finalPrice"] .price' + 'selector' => '.price-final_price .price' ], 'fpt_price' => [ 'selector' => '[data-price-type="weee"] .price', diff --git a/dev/tests/functional/tests/app/Magento/Weee/Test/TestCase/CreateTaxWithFptTest.php b/dev/tests/functional/tests/app/Magento/Weee/Test/TestCase/CreateTaxWithFptTest.php index 8da91bdf5ddcdd4d98ea1c73fec73077c8773e98..1bdedf647cb0b99bd7ccfff33cd1ed1782eec882 100644 --- a/dev/tests/functional/tests/app/Magento/Weee/Test/TestCase/CreateTaxWithFptTest.php +++ b/dev/tests/functional/tests/app/Magento/Weee/Test/TestCase/CreateTaxWithFptTest.php @@ -64,17 +64,13 @@ class CreateTaxWithFptTest extends Injectable * @param FixtureFactory $fixtureFactory * @return array */ - public function __prepare( - FixtureFactory $fixtureFactory - ) { - $this->markTestIncomplete("Epic: MAGETWO-30073. FPC issue."); + public function __prepare(FixtureFactory $fixtureFactory) + { $this->fixtureFactory = $fixtureFactory; - $customer = $fixtureFactory->createByCode('customer', ['dataSet' => 'johndoe_with_addresses']); + $customer = $fixtureFactory->createByCode('customer', ['dataset' => 'johndoe_with_addresses']); $customer->persist(); - $taxRule = $fixtureFactory->createByCode('taxRule', ['dataSet' => 'tax_rule_default']); - $taxRule->persist(); $productTemplate = $this->fixtureFactory - ->createByCode('catalogAttributeSet', ['dataSet' => 'custom_attribute_set_with_fpt']); + ->createByCode('catalogAttributeSet', ['dataset' => 'custom_attribute_set_with_fpt']); $productTemplate->persist(); return [ 'customer' => $customer, @@ -111,9 +107,10 @@ class CreateTaxWithFptTest extends Injectable Customer $customer, CatalogAttributeSet $productTemplate ) { + $this->fixtureFactory->createByCode('taxRule', ['dataset' => 'tax_rule_default'])->persist(); $product = $this->fixtureFactory->createByCode( 'catalogProductSimple', - ['dataSet' => $productData, 'data' => ['attribute_set_id' => ['attribute_set' => $productTemplate]]] + ['dataset' => $productData, 'data' => ['attribute_set_id' => ['attribute_set' => $productTemplate]]] ); $product->persist(); $this->objectManager->create( @@ -121,6 +118,7 @@ class CreateTaxWithFptTest extends Injectable ['configData' => $configData] )->run(); $this->loginCustomer($customer); + return ['product' => $product]; } diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductToWishlistEntityTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductToWishlistEntityTest.php index f64c8da3fa6d472013efd3c52dbc5cfc92edcd02..33bac1101c12f4c2301a922edcd3572dbf91c881 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductToWishlistEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductToWishlistEntityTest.php @@ -18,7 +18,7 @@ use Magento\Customer\Test\Fixture\Customer; * Steps: * 1. Login as a customer * 2. Navigate to catalog page - * 3. Add created product to Wishlist according to dataSet + * 3. Add created product to Wishlist according to dataset * 4. Perform all assertions * * @group Wishlist_(CS) diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ViewProductInCustomerWishlistOnBackendTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ViewProductInCustomerWishlistOnBackendTest.php index 0c2913116d0e28b0488f56f3d20f113e4ec6308f..3598c87f0c5d3269e4798365c78770d1ba236948 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ViewProductInCustomerWishlistOnBackendTest.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ViewProductInCustomerWishlistOnBackendTest.php @@ -15,7 +15,7 @@ use Magento\Customer\Test\Page\Adminhtml\CustomerIndexEdit; * * Preconditions: * 1. Create customer. - * 2. Create products from dataSet. + * 2. Create products from dataset. * 3. Add products to the customer's wish list (composite products should be configured). * * Steps: diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Helper/Product/CompositeTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Helper/Product/CompositeTest.php index 08e5449de44207303947327c92847017fbdfe86b..7ea04ced579fa693cec12145e72ee21de8683474 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Helper/Product/CompositeTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Helper/Product/CompositeTest.php @@ -35,7 +35,6 @@ class CompositeTest extends \PHPUnit_Framework_TestCase { $this->registry->unregister('composite_configure_result_error_message'); $this->registry->unregister(RegistryConstants::CURRENT_CUSTOMER_ID); - $this->registry->unregister(RegistryConstants::CURRENT_CUSTOMER); $this->registry->unregister('current_product'); $this->registry->unregister('product'); } diff --git a/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/View/CartTest.php b/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/View/CartTest.php index da93f3cdd96addf86282dc583908a7e86b20815e..f1cba5eb23c0944b1e33df783d77a93f30ffab06 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/View/CartTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/View/CartTest.php @@ -75,17 +75,6 @@ class CartTest extends \PHPUnit_Framework_TestCase $this->assertTrue($this->block->getHeadersVisibility()); } - /** - * Verify that the customer has a single item in his cart. - * - * @magentoDataFixture Magento/Customer/_files/customer.php - * @magentoDataFixture Magento/Customer/_files/quote.php - */ - public function testGetCollection() - { - $this->assertEquals(1, $this->block->getCollection()->getSize()); - } - /** * Verify the basic content of an empty cart. * @@ -111,4 +100,15 @@ class CartTest extends \PHPUnit_Framework_TestCase $this->assertContains('$10.00', $html); $this->assertContains('catalog/product/edit/id/1', $html); } + + /** + * Verify that the customer has a single item in his cart. + * + * @magentoDataFixture Magento/Customer/_files/customer.php + * @magentoDataFixture Magento/Customer/_files/quote.php + */ + public function testGetCollection() + { + $this->assertEquals(1, $this->block->getCollection()->getSize()); + } } diff --git a/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/IndexTest.php b/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/IndexTest.php index 9126bb17030bb111e807a8170e6eaabca8c3b2be..67f69454879eaa8076c22b18db505d99181bc411 100755 --- a/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/IndexTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/IndexTest.php @@ -330,6 +330,7 @@ class IndexTest extends \Magento\TestFramework\TestCase\AbstractBackendControlle $post = [ 'customer' => ['entity_id' => $customerId], + 'subscription' => 'false' ]; $this->getRequest()->setPostValue($post); $this->getRequest()->setParam('id', 1); diff --git a/dev/tests/integration/testsuite/Magento/Customer/_files/customer_from_repository.php b/dev/tests/integration/testsuite/Magento/Customer/_files/customer_from_repository.php new file mode 100644 index 0000000000000000000000000000000000000000..e7ecb6664159016cabe3dc6bb362b23ad8a53af0 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Customer/_files/customer_from_repository.php @@ -0,0 +1,26 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); +/** @var $repository \Magento\Customer\Api\CustomerRepositoryInterface */ +$repository = $objectManager->create('Magento\Customer\Api\CustomerRepositoryInterface'); +$customer = $objectManager->create('Magento\Customer\Api\Data\CustomerInterface'); + +/** @var Magento\Customer\Api\Data\CustomerInterface $customer */ +$customer->setWebsiteId(1) + ->setEmail('customer@example.com') + ->setGroupId(1) + ->setStoreId(1) + ->setPrefix('Mr.') + ->setFirstname('John') + ->setMiddlename('A') + ->setLastname('Smith') + ->setSuffix('Esq.') + ->setDefaultBilling(1) + ->setDefaultShipping(1) + ->setTaxvat('12') + ->setGender(0); +$repository->save($customer, 'password'); diff --git a/dev/tests/integration/testsuite/Magento/Sales/Model/Observer/Backend/CustomerQuoteTest.php b/dev/tests/integration/testsuite/Magento/Sales/Model/Observer/Backend/CustomerQuoteTest.php index cca4391f2940dfa92d49828b4ab82c7312d176d1..a0ea4bf40f7d17fe77f8c1f500f297a0f678c383 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Model/Observer/Backend/CustomerQuoteTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Model/Observer/Backend/CustomerQuoteTest.php @@ -16,18 +16,23 @@ class CustomerQuoteTest extends \PHPUnit_Framework_TestCase * Ensure that customer group is updated in customer quote, when it is changed for the customer. * * @magentoDataFixture Magento/Sales/_files/quote.php - * @magentoDataFixture Magento/Customer/_files/customer.php + * @magentoDataFixture Magento/Customer/_files/customer_from_repository.php */ public function testCustomerSaveQuoteObserver() { - /** @var \Magento\Customer\Model\Customer $customer */ - $customer = Bootstrap::getObjectManager()->create('Magento\Customer\Model\Customer'); - $customer->load(1); + /** @var \Magento\Customer\Api\Data\CustomerInterface $customer */ + /** @var \Magento\Customer\Api\CustomerRepositoryInterface $repository */ + $repository = Bootstrap::getObjectManager()->create('Magento\Customer\Api\CustomerRepositoryInterface'); + /** @var \Magento\Customer\Model\CustomerRegistry $registry */ + $registry = Bootstrap::getObjectManager()->create('Magento\Customer\Model\CustomerRegistry'); + $customer = $repository->getById($registry->retrieveByEmail('customer@example.com')->getId()); /** @var \Magento\Quote\Model\Quote $quote */ $quote = Bootstrap::getObjectManager()->create('Magento\Quote\Model\Quote'); $quote->load('test01', 'reserved_order_id'); - $quote->setCustomerIsGuest(false)->setCustomerId(1)->setCustomerGroupId($customer->getGroupId())->save(); + $quote->setCustomerIsGuest(false)->setCustomerId($customer->getId()) + ->setCustomerGroupId($customer->getGroupId()) + ->save(); $this->assertNotNull($customer->getGroupId(), "Precondition failed: Customer group is not set."); $this->assertEquals( @@ -41,7 +46,8 @@ class CustomerQuoteTest extends \PHPUnit_Framework_TestCase * \Magento\Sales\Model\Observer\Backend\CustomerQuote::dispatch() is an observer of this event. */ $newCustomerGroupId = 2; - $customer->setGroupId($newCustomerGroupId)->save(); + $customer->setGroupId($newCustomerGroupId); + $repository->save($customer); $quote->load('test01', 'reserved_order_id'); $this->assertEquals( diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_constants.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_constants.php index b949c13bad0e3ff183d2ace62a2ff239111ee871..94bbad3aa4775e041dccd1be16af20baa4db272c 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_constants.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_constants.php @@ -729,6 +729,7 @@ return [ 'Magento\Framework\App\ScopeInterface', 'Magento\Framework\App\Config\ScopeConfigInterface::SCOPE_TYPE_DEFAULT', ], + ['CURRENT_CUSTOMER', 'Magento\Customer\Controller\RegistryConstants'], ['METHOD_WPS', 'Magento\Paypal\Model\Config'], ['ERROR_INVALID_PRICE_CORRECTION', 'Magento\ConfigurableImportExport\Model\Import\Product\Type\Configurable'], ['EXCEPTION_CODE_NOT_SALABLE', 'Magento\Wishlist\Model\Item'], diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php index ef478b16d8e82e4f999a5be69878f2b18f81cb29..452cf6ab1c532ce79988c6752afee8cad3367230 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php @@ -2301,6 +2301,16 @@ return [ 'Magento\Authorizenet\Model\Directpost', 'Magento\Authorizenet\Model\Directpost::setDataHelper()' ], + [ + '_initCustomer', + 'Magento\Paypal\Controller\Adminhtml\Billing\Agreement\CustomerGrid', + 'Magento\Paypal\Controller\Adminhtml\Billing\Agreement\CustomerGrid::initCurrentCustomer' + ], + [ + '_initCustomer', + 'Magento\Customer\Controller\Adminhtml\Index', + 'Magento\Customer\Controller\Adminhtml\Index::initCurrentCustomer', + ], ['prepareIndexdata', 'Magento\Search\Helper\Data'], ['getPriceValues', 'Magento\ConfigurableProduct\Model\Resource\Product\Type\Configurable\Attribute\Collection'], ['getPricingValue', 'Magento\ConfigurableProduct\Model\Product\Type\Configurable\OptionValue'], diff --git a/lib/internal/Magento/Framework/Api/Search/SearchCriteria.php b/lib/internal/Magento/Framework/Api/Search/SearchCriteria.php index 626e830864d9f4e6296f567f96a648e509f4d8b2..dece9d9876bade3198f2915607385994f21b552d 100644 --- a/lib/internal/Magento/Framework/Api/Search/SearchCriteria.php +++ b/lib/internal/Magento/Framework/Api/Search/SearchCriteria.php @@ -10,25 +10,8 @@ use Magento\Framework\Api\Search\SearchCriteriaInterface; class SearchCriteria extends BaseSearchCriteria implements SearchCriteriaInterface { - const SEARCH_TERM = 'search_term'; const REQUEST_NAME = 'request_name'; - /** - * {@inheritdoc} - */ - public function getSearchTerm() - { - return $this->_get(self::SEARCH_TERM); - } - - /** - * {@inheritdoc} - */ - public function setSearchTerm($searchTerm) - { - return $this->setData(self::SEARCH_TERM, $searchTerm); - } - /** * {@inheritdoc} */ diff --git a/lib/internal/Magento/Framework/Api/Search/SearchCriteriaInterface.php b/lib/internal/Magento/Framework/Api/Search/SearchCriteriaInterface.php index e952763d3fd93ca208a02325ac106ebbce01277c..1c8fe9772fb403957a06945e7e72938b300e9ef3 100644 --- a/lib/internal/Magento/Framework/Api/Search/SearchCriteriaInterface.php +++ b/lib/internal/Magento/Framework/Api/Search/SearchCriteriaInterface.php @@ -9,17 +9,6 @@ use Magento\Framework\Api\SearchCriteriaInterface as BaseSearchCriteriaInterface interface SearchCriteriaInterface extends BaseSearchCriteriaInterface { - /** - * @return string - */ - public function getSearchTerm(); - - /** - * @param string $searchTerm - * @return $this - */ - public function setSearchTerm($searchTerm); - /** * @return string */