diff --git a/app/code/Magento/Authorizenet/Controller/Directpost/Payment/Place.php b/app/code/Magento/Authorizenet/Controller/Directpost/Payment/Place.php index fa5c22731a7a0..64c63ca4a1126 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 @@ eventManager = $context->getEventManager(); $this->cartManagement = $cartManagement; + $this->onepageCheckout = $onepageCheckout; + $this->jsonHelper = $jsonHelper; parent::__construct($context, $coreRegistry, $dataFactory); } @@ -59,20 +75,23 @@ public function execute() { $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 @@ public function execute() ); } 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 @@ protected function getCheckoutMethod() 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 @@ protected function placeCheckoutOrder() $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 9e2bb3ef195eb..8a337c4929167 100644 --- a/app/code/Magento/Authorizenet/Helper/DataFactory.php +++ b/app/code/Magento/Authorizenet/Helper/DataFactory.php @@ -13,6 +13,8 @@ */ 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 d9f6f6f85576f..e4f2af809aab5 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 @@ public function isCheckoutOrderIncrementIdExist($orderIncrementId) } 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 43a6b6bfd9eba..af25f301b3134 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 @@ 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 @@ */ 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 @@ public function setUp() ->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 @@ public function setUp() ->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 @@ public function setUp() * @param $paymentMethod * @param $controller * @param $quoteId - * @param $isLoggedIn * @param $orderId * @param $result * @dataProvider textExecuteDataProvider @@ -212,7 +180,6 @@ public function testExecute( $paymentMethod, $controller, $quoteId, - $isLoggedIn, $orderId, $result ) { @@ -230,14 +197,6 @@ public function testExecute( ->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 @@ public function testExecute( * @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 @@ public function testExecuteFailePlaceOrder( ->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 @@ public function textExecuteDataProvider() ['method' => null], IframeConfigProvider::CHECKOUT_IDENTIFIER, 1, - true, 1, ['error_messages' => __('Please choose a payment method.'), 'goto_section' => 'payment'] ], @@ -318,7 +266,6 @@ public function textExecuteDataProvider() ['method' => 'authorizenet_directpost'], IframeConfigProvider::CHECKOUT_IDENTIFIER, 1, - true, 1, $objectSuccess ], @@ -339,7 +286,6 @@ public function textExecuteFailedPlaceOrderDataProvider() ['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 0000000000000..f77de6a5ccb8b --- /dev/null +++ b/app/code/Magento/Authorizenet/Test/Unit/Model/Directpost/SessionTest.php @@ -0,0 +1,58 @@ +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 91d3eee738c3f..a2d0faca404af 100644 --- a/app/code/Magento/Backend/etc/module.xml +++ b/app/code/Magento/Backend/etc/module.xml @@ -6,7 +6,7 @@ */ --> - + diff --git a/app/code/Magento/Backup/etc/module.xml b/app/code/Magento/Backup/etc/module.xml index f43decfdbd42c..80d19293753e8 100644 --- a/app/code/Magento/Backup/etc/module.xml +++ b/app/code/Magento/Backup/etc/module.xml @@ -6,7 +6,7 @@ */ --> - + diff --git a/app/code/Magento/Catalog/Api/ProductRepositoryInterface.php b/app/code/Magento/Catalog/Api/ProductRepositoryInterface.php index 18cf0bdec693c..6fddee979e07f 100644 --- a/app/code/Magento/Catalog/Api/ProductRepositoryInterface.php +++ b/app/code/Magento/Catalog/Api/ProductRepositoryInterface.php @@ -72,10 +72,4 @@ public function deleteById($sku); * @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 971d6c6b10de0..7655807bcc7a7 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\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 @@ public function __construct( 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 @@ public function renderConfigureResult(\Magento\Framework\Object $configureResult // 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 4ff34b4581460..56631b4a8faf6 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 @@ public function getAffectedFields($object) 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 07096562de955..1cc9d446e5428 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 @@ public function __construct( \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 @@ public function __construct( $this->eavConfig = $eavConfig; $this->inputtypeValidatorFactory = $validatorFactory; $this->searchCriteriaBuilder = $searchCriteriaBuilder; - $this->filterBuilder = $filterBuilder; } /** @@ -209,19 +200,7 @@ public function deleteById($attributeCode) */ 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 6b71af37b08a5..28e8e25dfaa6b 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 @@ public function __construct( 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 @@ public function __construct( $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 @@ public function getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCr /** @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 @@ public function getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCr 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 @@ protected function addFilterGroupToCollection( $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 3f18ed575e087..e77013106a237 100644 --- a/app/code/Magento/Catalog/Setup/InstallData.php +++ b/app/code/Magento/Catalog/Setup/InstallData.php @@ -301,5 +301,17 @@ public function install(ModuleDataSetupInterface $setup, ModuleContextInterface '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 833ea7cf4dbbd..adc00706d7079 100644 --- a/app/code/Magento/Catalog/Setup/InstallSchema.php +++ b/app/code/Magento/Catalog/Setup/InstallSchema.php @@ -37,13 +37,6 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con ['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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con [], '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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con '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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con ['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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con ['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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con ['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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con ['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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con ['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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con ['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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con ->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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con ['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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con ['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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con ->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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con ['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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con ->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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con ['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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con ->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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con ['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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con ->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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con ['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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con ->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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con ); $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 1459f4a31d681..0000000000000 --- a/app/code/Magento/Catalog/Setup/UpgradeData.php +++ /dev/null @@ -1,56 +0,0 @@ -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 2f37f84191ac2..0000000000000 --- a/app/code/Magento/Catalog/Setup/UpgradeSchema.php +++ /dev/null @@ -1,105 +0,0 @@ -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 ae38586c74cef..533a4196a7499 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 @@ protected function setUp() 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 @@ protected function setUp() $this->eavAttributeRepositoryMock, $this->eavConfigMock, $this->validatorFactoryMock, - $this->searchCriteriaBuilderMock, - $this->filterBuilderMock + $this->searchCriteriaBuilderMock ); } @@ -169,20 +161,6 @@ public function testDeleteById() 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 030c464a62228..ad8341e86cfdd 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 @@ protected function setUp() 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 @@ protected function setUp() ->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 @@ protected function setUp() ['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 @@ protected function setUp() '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 @@ public function testGetList() $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 @@ public function testGetList() $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 @@ public function testSaveExistingWithMediaGalleryEntries() $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 93ec513556e08..ed2f204b24e5c 100644 --- a/app/code/Magento/Catalog/etc/module.xml +++ b/app/code/Magento/Catalog/etc/module.xml @@ -6,7 +6,7 @@ */ --> - + diff --git a/app/code/Magento/Catalog/etc/webapi.xml b/app/code/Magento/Catalog/etc/webapi.xml index 8ba7b4635b30a..ec8458cd8c9a7 100644 --- a/app/code/Magento/Catalog/etc/webapi.xml +++ b/app/code/Magento/Catalog/etc/webapi.xml @@ -39,12 +39,6 @@ - - - - - - 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 02898a8e87fff..b774dd8090d14 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 cef79f4f73706..ef70bb6fc518f 100755 --- a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php +++ b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php @@ -612,6 +612,17 @@ protected function getRuleProductsStmt($websiteId, $productId = null) $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 @@ protected function getRuleProductsStmt($websiteId, $productId = null) [] ); $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 8c41a3c24276d..3687d55d4710f 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 @@ protected function setUp() $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 @@ protected function setUp() $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 @@ protected function setUp() */ 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 2f3320648ad62..4c0166ea9c0fb 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\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 47d49900ef231..cbaeb578ac122 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\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 0000000000000..03f0fb14eadce --- /dev/null +++ b/app/code/Magento/CatalogSearch/Model/Indexer/Mview/Action.php @@ -0,0 +1,42 @@ +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 74c767a5ab994..a3c39528a1d0f 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 4e6648b6f5c08..6ae4e1ba0cf88 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\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 b9e718318b7ef..e5e2bf8f91ca5 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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con '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 bd950bd1f8266..0000000000000 --- a/app/code/Magento/CatalogSearch/Setup/UpgradeSchema.php +++ /dev/null @@ -1,74 +0,0 @@ -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 33ca04f2b95d2..5e93d20132e38 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 @@ protected function setUp() $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 a589de77d66c6..1acbcbc51d1e9 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 @@ 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 @@ protected function setUp() ->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 64e6b45ef808e..269b6462350b0 100644 --- a/app/code/Magento/CatalogSearch/etc/module.xml +++ b/app/code/Magento/CatalogSearch/etc/module.xml @@ -6,7 +6,7 @@ */ --> - + diff --git a/app/code/Magento/CatalogSearch/etc/mview.xml b/app/code/Magento/CatalogSearch/etc/mview.xml index dac32882981e5..8e9fb605186dd 100644 --- a/app/code/Magento/CatalogSearch/etc/mview.xml +++ b/app/code/Magento/CatalogSearch/etc/mview.xml @@ -6,7 +6,7 @@ */ --> - +
diff --git a/app/code/Magento/Checkout/Block/Registration.php b/app/code/Magento/Checkout/Block/Registration.php index 9ba1c23b9f918..a54c576873982 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 @@ public function __construct( \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 @@ public function getCreateAccountUrl() */ 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 05bafe1daa1ae..97c2a346efc98 100644 --- a/app/code/Magento/Checkout/Controller/Cart/Add.php +++ b/app/code/Magento/Checkout/Controller/Cart/Add.php @@ -169,7 +169,7 @@ protected function goBack($backUrl = null, $product = null) $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 22817f7d61970..30546be368a76 100644 --- a/app/code/Magento/Checkout/etc/frontend/sections.xml +++ b/app/code/Magento/Checkout/etc/frontend/sections.xml @@ -40,10 +40,10 @@
- +
- +
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 a2ba6ecb34cd0..f7e3c7468ea19 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 00c2eba7289fe..de6853122eba7 100644 --- a/app/code/Magento/Cms/Setup/InstallSchema.php +++ b/app/code/Magento/Cms/Setup/InstallSchema.php @@ -9,6 +9,7 @@ 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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con ); $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 a4811055a0796..0000000000000 --- a/app/code/Magento/Cms/Setup/UpgradeSchema.php +++ /dev/null @@ -1,52 +0,0 @@ -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 4303db7c6ae4c..9103575c3a6b1 100644 --- a/app/code/Magento/Cms/etc/module.xml +++ b/app/code/Magento/Cms/etc/module.xml @@ -6,7 +6,7 @@ */ --> - + 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 06396855cc8ea..c6e57282e4739 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 @@ + + + + custom_theme_from + Custom design from + + cms_page_listing.cms_page_listing.listing_top.listing_filters + + + + + + + from + from + From + MM/dd/YYYY + + + + + + + to + to + To + MM/dd/YYYY + + + + + + + + custom_theme_to + Custom design to + + cms_page_listing.cms_page_listing.listing_top.listing_filters + + + + + + + from + from + From + MM/dd/YYYY + + + + + + + to + to + To + MM/dd/YYYY + + + + + + + Magento\Cms\Model\Page\Source\Theme + + + + custom_theme + Select... + Custom Theme + + + + + + Magento\Cms\Model\Page\Source\PageLayout + + + + custom_root_template + Select... + Custom Layout + + + + + + + meta_keywords + Meta Keywords + + + + + + + meta_description + Meta Description + + + diff --git a/app/code/Magento/ConfigurableProduct/etc/module.xml b/app/code/Magento/ConfigurableProduct/etc/module.xml index 22393b16759b2..193c0adb48ca3 100644 --- a/app/code/Magento/ConfigurableProduct/etc/module.xml +++ b/app/code/Magento/ConfigurableProduct/etc/module.xml @@ -6,7 +6,7 @@ */ --> - + diff --git a/app/code/Magento/CurrencySymbol/etc/module.xml b/app/code/Magento/CurrencySymbol/etc/module.xml index 30fab952ed73f..97cf5f60eefb3 100644 --- a/app/code/Magento/CurrencySymbol/etc/module.xml +++ b/app/code/Magento/CurrencySymbol/etc/module.xml @@ -6,7 +6,7 @@ */ --> - + diff --git a/app/code/Magento/Customer/Api/Data/CustomerInterface.php b/app/code/Magento/Customer/Api/Data/CustomerInterface.php index fa6cc7fb97a82..3a125e7231a6a 100644 --- a/app/code/Magento/Customer/Api/Data/CustomerInterface.php +++ b/app/code/Magento/Customer/Api/Data/CustomerInterface.php @@ -218,7 +218,7 @@ public function getLastname(); * * @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 7e84b670e96cc..88c547452536a 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 @@ public function initForm() [ '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 @@ public function initForm() '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 2d84f59c80f84..ef5976c4f4bcb 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index.php @@ -229,20 +229,16 @@ public function __construct( /** * 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 3050408cda037..e1c4dd68c9cde 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 @@ public function execute() $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 37cb09d45a64a..4c4cb77fa3bd5 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 03fdd7af98f90..51afccd016346 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 7a0fa4df782dc..64af44a9bb84e 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 eb9e594860d22..fa0dcca712a90 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 cd0db70daa4b2..6c27c0a46bd8f 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 649c0c649ec8a..c825e5c24a85b 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 b6a2e0072a064..effaa2618f25a 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 7e5dfa9464523..ca03623385b96 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 @@ protected function _extractData( \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 @@ public function execute() $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 9dc52176624af..ee95065596c0a 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 b4ba61be29f66..34fa6b66a1187 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 ee767b848796a..6f7e0e3bfbd81 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 809bfe539c734..53d3a4454f16f 100644 --- a/app/code/Magento/Customer/Controller/RegistryConstants.php +++ b/app/code/Magento/Customer/Controller/RegistryConstants.php @@ -11,12 +11,6 @@ */ 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 6cc9db5d12676..9d5282327fd17 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\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 @@ public function loadByEmail($customerEmail) 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 d45f79f9a6625..2b1adcc1259f5 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 @@ public function __construct( \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 @@ protected function _validate($address) } } - /** - * @return \Magento\Customer\Model\Customer - */ - protected function _createCustomer() - { - return $this->_customerFactory->create(); - } - /** * {@inheritdoc} */ @@ -126,14 +116,14 @@ public function delete($object) 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 16666b61689da..7a793a489aca8 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 @@ public function __construct( \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 @@ protected function _getDefaultAttributes() * @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 fc3458c5fdc5d..a96527bb98073 100644 --- a/app/code/Magento/Customer/Setup/InstallSchema.php +++ b/app/code/Magento/Customer/Setup/InstallSchema.php @@ -35,18 +35,6 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con )->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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con ), ['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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con $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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con ), ['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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con $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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con ), ['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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con $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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con ), ['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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con $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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con ), ['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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con $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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con ), ['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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con $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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con ), ['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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con $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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con ), ['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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con $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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con ), ['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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con $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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con ), ['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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con $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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 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 1094a6d1d3d4e..0000000000000 --- a/app/code/Magento/Customer/Setup/UpgradeSchema.php +++ /dev/null @@ -1,156 +0,0 @@ -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 0000000000000..ea31301b7a7e2 --- /dev/null +++ b/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Edit/Tab/NewsletterTest.php @@ -0,0 +1,111 @@ +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 71925c695d16e..97599618c34b0 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 @@ public function testNewsletterAction() $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 0000000000000..a8fe33e93c985 --- /dev/null +++ b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/SaveTest.php @@ -0,0 +1,993 @@ +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 cc98e7676b3fa..bf8b44c4f76b6 100644 --- a/app/code/Magento/Customer/etc/di.xml +++ b/app/code/Magento/Customer/etc/di.xml @@ -70,6 +70,13 @@ + + + Magento\Customer\Api\CustomerRepositoryInterface\Proxy + EavVersionControlSnapshot + CustomerAddressRelationsComposite + + Magento\Customer\Model\Address\Config\Reader\Proxy @@ -156,12 +163,6 @@ EavVersionControlSnapshot - - - EavVersionControlSnapshot - CustomerAddressRelationsComposite - - EavVersionControlSnapshot diff --git a/app/code/Magento/Customer/etc/module.xml b/app/code/Magento/Customer/etc/module.xml index 973c14db73d61..3b30bbb644142 100644 --- a/app/code/Magento/Customer/etc/module.xml +++ b/app/code/Magento/Customer/etc/module.xml @@ -6,7 +6,7 @@ */ --> - + 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 45a742005048f..3fc839a52be45 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 c4969c8a280d0..cad13566790df 100755 --- a/app/code/Magento/Eav/Model/Entity/AbstractEntity.php +++ b/app/code/Magento/Eav/Model/Entity/AbstractEntity.php @@ -1413,7 +1413,7 @@ protected function _prepareStaticValue($key, $value) */ 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 beb4abc065cc1..3e85a986899c9 100644 --- a/app/code/Magento/ImportExport/Setup/InstallSchema.php +++ b/app/code/Magento/ImportExport/Setup/InstallSchema.php @@ -59,6 +59,56 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con ->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 900c2ed39be6b..0000000000000 --- a/app/code/Magento/ImportExport/Setup/UpgradeSchema.php +++ /dev/null @@ -1,85 +0,0 @@ -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 e072148a1dd4b..4dad36db35038 100644 --- a/app/code/Magento/ImportExport/etc/module.xml +++ b/app/code/Magento/ImportExport/etc/module.xml @@ -6,6 +6,6 @@ */ --> - + diff --git a/app/code/Magento/Indexer/Model/IndexStructure.php b/app/code/Magento/Indexer/Model/IndexStructure.php index d7c673cf50465..0443b6deecd77 100644 --- a/app/code/Magento/Indexer/Model/IndexStructure.php +++ b/app/code/Magento/Indexer/Model/IndexStructure.php @@ -11,8 +11,8 @@ 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 9059a96aadf56..37257f1f56071 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\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 98241dae0b2e6..8e415be17131e 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 381f20c79ed97..696d6af0041b2 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 880e8c26413a7..c2fbcace85baa 100644 --- a/app/code/Magento/Indexer/Setup/UpgradeData.php +++ b/app/code/Magento/Indexer/Setup/InstallData.php @@ -9,19 +9,19 @@ 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 @@ public function __construct( * @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 a3cc46c6e022a..44fbe6f37fe80 100644 --- a/app/code/Magento/Indexer/Setup/InstallSchema.php +++ b/app/code/Magento/Indexer/Setup/InstallSchema.php @@ -58,6 +58,13 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con [], '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 da4e6f2932df0..e453e18bc7d9f 100644 --- a/app/code/Magento/Indexer/Setup/Recurring.php +++ b/app/code/Magento/Indexer/Setup/Recurring.php @@ -78,35 +78,33 @@ public function __construct( */ 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 2288e2963d3df..0000000000000 --- a/app/code/Magento/Indexer/Setup/UpgradeSchema.php +++ /dev/null @@ -1,46 +0,0 @@ -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 a6884d22d03bf..aa002ea18a56c 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 @@ 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 @@ protected function setUp() ->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 9c3dc151b9998..a64005d658eba 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 @@ protected function setUp() $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 b3d895056ef1c..b7f27e0e6bf74 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 2edd82416ca5f..f03aca19f0cc4 100644 --- a/app/code/Magento/Indexer/etc/module.xml +++ b/app/code/Magento/Indexer/etc/module.xml @@ -6,10 +6,9 @@ */ --> - + - diff --git a/app/code/Magento/Multishipping/etc/module.xml b/app/code/Magento/Multishipping/etc/module.xml index b6ea0b6ce80ca..1e60e1c6f7c73 100644 --- a/app/code/Magento/Multishipping/etc/module.xml +++ b/app/code/Magento/Multishipping/etc/module.xml @@ -6,7 +6,7 @@ */ --> - + 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 66cf873c311eb..fd14f3799a7e8 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 @@ -

+

@@ -42,4 +42,3 @@
- \ 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 10287d8090d41..524d7b769b416 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 @@ -

+

@@ -43,4 +43,3 @@
- \ 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 e368daf233a14..d4513d05cccf7 100644 --- a/app/code/Magento/PageCache/etc/events.xml +++ b/app/code/Magento/PageCache/etc/events.xml @@ -21,9 +21,6 @@ - - - diff --git a/app/code/Magento/PageCache/etc/module.xml b/app/code/Magento/PageCache/etc/module.xml index bd152d0a9e584..8a461081663b3 100644 --- a/app/code/Magento/PageCache/etc/module.xml +++ b/app/code/Magento/PageCache/etc/module.xml @@ -6,7 +6,7 @@ */ --> - + 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 a038948331ab1..2952167ac681f 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 @@ public function getAfter() */ 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 5029599750e5b..0c157101b7065 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 @@ protected function _initCustomer() */ 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 f760294d0ca6c..44cd56531af46 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 @@ public function execute() $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 ffae21860511e..b7118b886ea76 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 d13040292a458..0292ef42cfd55 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 @@
-
diff --git a/app/code/Magento/Quote/Model/Observer/Backend/CustomerQuote.php b/app/code/Magento/Quote/Model/Observer/Backend/CustomerQuote.php index f5221834db63d..168f5dc060a6b 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 @@ public function dispatch(Observer $observer) { /** @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 7528b77939040..c32b3c533209f 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 @@ protected function setUp() ->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 @@ public function testDispatchNoCustomerGroupChange() $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 @@ public function testDispatchNoCustomerGroupChange() /** * @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 @@ public function testDispatch($isWebsiteScope, $websites, $quoteId) ->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 @@ public function testDispatch($isWebsiteScope, $websites, $quoteId) [ '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 05927da66756a..e9545774fa3ab 100644 --- a/app/code/Magento/RequireJs/etc/module.xml +++ b/app/code/Magento/RequireJs/etc/module.xml @@ -6,5 +6,5 @@ */ --> - + 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 05b96498e8cac..e07c8d24c23d9 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 @@ protected function _prepareLayout() '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 @@ protected function _prepareLayout() '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 9521dfa777017..2fd0890b7fd15 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 @@ public function __construct( \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 @@ public function __construct( $this->orderRepository = $orderRepository; $this->customerFactory = $customerFactory; $this->addressFactory = $addressFactory; + $this->regionFactory = $regionFactory; } /** @@ -78,7 +86,17 @@ public function create($orderId) $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 afa4460d56fa6..8e44a50adf155 100644 --- a/app/code/Magento/Sales/Setup/InstallSchema.php +++ b/app/code/Magento/Sales/Setup/InstallSchema.php @@ -473,6 +473,12 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con '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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con )->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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con )->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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con )->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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con '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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con '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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con '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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con )->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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con )->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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con )->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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con '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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con '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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con '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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con )->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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con )->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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con '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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con '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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con )->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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con )->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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con )->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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con '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 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con '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 58d07c9d1bba2..0000000000000 --- a/app/code/Magento/Sales/Setup/UpgradeSchema.php +++ /dev/null @@ -1,229 +0,0 @@ -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 07ce63f99c675..a837fd66e86b9 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 @@ protected function setUp() '', 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 @@ protected function setUp() $this->accountManagement, $this->customerFactory, $this->addressFactory, + $this->regionFactory, $this->orderRepository ); } @@ -85,14 +98,15 @@ public function testCreateCreatesCustomerBasedonGuestOrder() $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 fa8011a7bb564..2e245ab41cb9b 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 @@ public function prepareDataSource(array & $dataSource) { 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 931f2ab5884d8..294eb87cb2548 100644 --- a/app/code/Magento/Sales/etc/module.xml +++ b/app/code/Magento/Sales/etc/module.xml @@ -6,7 +6,7 @@ */ --> - + 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 cad2d7505b8e5..da40824257590 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 c948c4a55aadc..77c87265e8f42 100644 --- a/app/code/Magento/SalesSequence/etc/module.xml +++ b/app/code/Magento/SalesSequence/etc/module.xml @@ -6,6 +6,6 @@ */ --> - + diff --git a/app/code/Magento/Search/Api/SearchInterface.php b/app/code/Magento/Search/Api/SearchInterface.php new file mode 100644 index 0000000000000..4e53ba17fde12 --- /dev/null +++ b/app/code/Magento/Search/Api/SearchInterface.php @@ -0,0 +1,20 @@ +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 36e552b32409e..bf827763ebb69 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 d58c0da9a8946..34dd3d93895f9 100644 --- a/app/code/Magento/Search/Setup/InstallSchema.php +++ b/app/code/Magento/Search/Setup/InstallSchema.php @@ -115,6 +115,10 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con $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 461c7fd3d3d23..0000000000000 --- a/app/code/Magento/Search/Setup/UpgradeSchema.php +++ /dev/null @@ -1,49 +0,0 @@ -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 72021021884e6..d0e3b7f183d0c 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 @@ class SearchResponseBuilderTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Catalog\Model\SearchResponseBuilder + * @var \Magento\Search\Model\SearchResponseBuilder */ private $model; @@ -36,7 +36,7 @@ protected function setUp() ->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 0000000000000..02af8490fcc95 --- /dev/null +++ b/app/code/Magento/Search/Test/Unit/Model/SearchTest.php @@ -0,0 +1,150 @@ +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 a8b7dfd5bc687..26f8d94c1a502 100644 --- a/app/code/Magento/Search/etc/di.xml +++ b/app/code/Magento/Search/etc/di.xml @@ -7,6 +7,7 @@ --> + diff --git a/app/code/Magento/Search/etc/module.xml b/app/code/Magento/Search/etc/module.xml index 2648b158b5042..8719bbd18c2cf 100644 --- a/app/code/Magento/Search/etc/module.xml +++ b/app/code/Magento/Search/etc/module.xml @@ -7,7 +7,7 @@ --> - + diff --git a/app/code/Magento/Search/etc/webapi.xml b/app/code/Magento/Search/etc/webapi.xml new file mode 100644 index 0000000000000..d06beccfa8d80 --- /dev/null +++ b/app/code/Magento/Search/etc/webapi.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + diff --git a/app/code/Magento/TaxImportExport/etc/module.xml b/app/code/Magento/TaxImportExport/etc/module.xml index 64d6d6544460d..3fc38c0ae9612 100644 --- a/app/code/Magento/TaxImportExport/etc/module.xml +++ b/app/code/Magento/TaxImportExport/etc/module.xml @@ -6,7 +6,7 @@ */ --> - + diff --git a/app/code/Magento/Theme/Setup/InstallSchema.php b/app/code/Magento/Theme/Setup/InstallSchema.php index b7f6d0edb3775..c1ed22a79523f 100644 --- a/app/code/Magento/Theme/Setup/InstallSchema.php +++ b/app/code/Magento/Theme/Setup/InstallSchema.php @@ -51,12 +51,6 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 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 3df76719134e7..0000000000000 --- a/app/code/Magento/Theme/Setup/UpgradeSchema.php +++ /dev/null @@ -1,40 +0,0 @@ -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 0000000000000..2a69f64be343e --- /dev/null +++ b/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Wysiwyg/Files/DeleteFilesTest.php @@ -0,0 +1,104 @@ +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 0000000000000..9bd042cfe2e58 --- /dev/null +++ b/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Wysiwyg/Files/DeleteFolderTest.php @@ -0,0 +1,71 @@ +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 0000000000000..63884649f39f4 --- /dev/null +++ b/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Wysiwyg/Files/IndexTest.php @@ -0,0 +1,39 @@ +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 0000000000000..0061013ed728c --- /dev/null +++ b/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Wysiwyg/Files/OnInsertTest.php @@ -0,0 +1,59 @@ +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 e6744b59cb8c2..742926c80c224 100644 --- a/app/code/Magento/Theme/etc/module.xml +++ b/app/code/Magento/Theme/etc/module.xml @@ -6,7 +6,7 @@ */ --> - + diff --git a/app/code/Magento/User/Setup/InstallSchema.php b/app/code/Magento/User/Setup/InstallSchema.php index abda317b7bc8a..3527f70c4198b 100644 --- a/app/code/Magento/User/Setup/InstallSchema.php +++ b/app/code/Magento/User/Setup/InstallSchema.php @@ -124,7 +124,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con )->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 bab95673a66a0..0000000000000 --- a/app/code/Magento/User/Setup/UpgradeSchema.php +++ /dev/null @@ -1,47 +0,0 @@ -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 8bb2b470ccf55..d0467cb70e860 100644 --- a/app/code/Magento/User/etc/module.xml +++ b/app/code/Magento/User/etc/module.xml @@ -6,7 +6,7 @@ */ --> - + diff --git a/app/code/Magento/Weee/etc/module.xml b/app/code/Magento/Weee/etc/module.xml index 19658377fc4a7..48f7754d1356e 100644 --- a/app/code/Magento/Weee/etc/module.xml +++ b/app/code/Magento/Weee/etc/module.xml @@ -6,7 +6,7 @@ */ --> - + diff --git a/app/code/Magento/Wishlist/Test/Unit/Model/ItemTest.php b/app/code/Magento/Wishlist/Test/Unit/Model/ItemTest.php index 76b46f13538da..f31a0ced59d61 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 @@ public function testRemoveOptionByCode($code, $option) $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 @@ public function getOptionsDataProvider() ->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 @@ public function testCompareOptionsNegativeOptionsTwoHaveNotOption() $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 9503592265553..6d022d065ab11 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 2515bec96dcc9..793cf5b4d2f58 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 7009f22f35d2a..20c0ccb23a45a 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 ce48ebcb01e4d..5d29639a89d28 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,#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 2d63705c1a135..093ff416e14d2 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 8adda8f9d9b73..d33e1456bc363 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 0000000000000..ae6fd1cfc39eb --- /dev/null +++ b/dev/tests/api-functional/testsuite/Magento/Search/Api/SearchTest.php @@ -0,0 +1,70 @@ + [ + '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 ca4b3bc7f79e4..73c97a8815878 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 abd0c0b1627fc..0000000000000 --- a/dev/tests/functional/lib/Magento/Mtf/Fixture/DataSource.php +++ /dev/null @@ -1,62 +0,0 @@ -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 a88d4b922b643..ec1748e20b135 100755 --- a/dev/tests/functional/phpunit.xml.dist +++ b/dev/tests/functional/phpunit.xml.dist @@ -29,8 +29,8 @@ - - + + 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 7adf887baa967..03cebd5af2798 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 @@ MAGETWO-12832 - Check Out as a Guest with Authorize.Net and Offline Shipping method catalogProductSimple::product_10_dollar, configurableProduct::with_one_option, bundleProduct::bundle_fixed_100_dollar_product us_ca_ny_rule - default - US_address_1 + default + US_address_1 guest Flat Rate Fixed @@ -20,7 +20,7 @@ 156.81 authorizenet - visa_default + visa_default authorizenet test_type:3rd_party_test 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 6e6d66e7b0ee0..76509dfa40663 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 7b1c3f2aeac1d..f5831a6ba958a 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 @@ */ --> - - - catalogProductSimple::default::name - - - + + + 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 3f14768fb4511..3a4fd33ceba98 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 @@ public function __construct(FixtureFactory $fixtureFactory, $data, array $params $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 @@ public function __construct(FixtureFactory $fixtureFactory, $data, array $params $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 @@ public function __construct(FixtureFactory $fixtureFactory, $data, array $params } /** - * 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 @@ public function getEntity() { 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 2b5d6e994d403..5a9141b524060 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 @@ public function __construct(array $params, array $data = []) $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 9624a9398b6ac..836103161525e 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 @@ * 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 @@ public function __inject(Dashboard $dashboard) */ 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 30a4b7747c40e..a70183ca9d5dd 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 143320dbbba2d..d0e6e7a7f2f69 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\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 @@ public function processAssert( } /** - * Prepare bundle options + * Prepare bundle options. * * @param BundleProduct $product * @return array @@ -89,12 +88,12 @@ protected function prepareBundleOptions(BundleProduct $product) } /** - * 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 77c2e21ce5831..a4346357991c5 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 @@ protected function assertPrice( '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 e5323013d26b5..3a714a0115e86 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 @@ public function processAssert( */ 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 38ab1c7f295ba..a1f9b3e23a4f0 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 @@ 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 @@ protected function prepareFixtureData(array $data, array $sortFields = []) } /** - * 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 e6d1d24ff1e69..1ccbfd702f4eb 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 da18ba61b486e..7d721ba3a304e 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 @@ protected function getGroupedPrice(View $view, FixtureInterface $product) '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 b9f96e1cb55a7..2cff47a580a63 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 @@ */ --> - - - BundleProduct %isolation% - Dynamic - Dynamic - Dynamic - - - bundle - - bundle - 4 - - product - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - BundleProduct %isolation% - - - - - - - - - - - - - - - - - - - - - - - - - - - Dynamic - - - - - - - - - - - - - - - - - - - - - - Dynamic - - - Dynamic - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + bundle + + bundle + 4 + + product + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 f0d58fec564c3..664f7537eecb7 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 @@ public function __construct(FixtureFactory $fixtureFactory, array $data, array $ } } } + } + /** + * 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 @@ public function __construct(FixtureFactory $fixtureFactory, array $data, array $ $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 @@ public function __construct(FixtureFactory $fixtureFactory, array $data, array $ } } } - - /** - * 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 bff410f211501..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/CheckoutData.php +++ /dev/null @@ -1,342 +0,0 @@ - [ - '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 c4f0aee1ebebe..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/Price.php +++ /dev/null @@ -1,214 +0,0 @@ -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 89bab0c1b7e8a..32afeb9d6a420 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\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 @@ public function __construct(FixtureInterface $product) $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 60e602800cc24..2e920885fa488 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 @@ - taxable_goods + taxable_goods 0 0 @@ -41,7 +41,7 @@ - taxable_goods + taxable_goods 0 0 @@ -60,8 +60,7 @@ Dynamic Dynamic - - - default_dynamic + default_dynamic 666 @@ -70,7 +69,7 @@ Dynamic Separately - taxable_goods + taxable_goods Main Website @@ -84,11 +83,11 @@ bundle-dynamic-product-%isolation% Catalog, Search - default_dynamic + default_dynamic Default - default_dynamic + bundle_default_dynamic @@ -99,10 +98,10 @@ Fixed 750 - default_fixed + default_fixed - taxable_goods + taxable_goods 666 @@ -124,11 +123,11 @@ bundle-fixed-product-%isolation% Catalog, Search - default_fixed + default_fixed Default - default_fixed + bundle_default_fixed @@ -142,7 +141,7 @@ 100 - taxable_goods + taxable_goods 1 Fixed @@ -150,10 +149,10 @@ Main Website - default_subcategory + default_subcategory - two_options_with_fixed_and_percent_prices + two_options_with_fixed_and_percent_prices @@ -164,17 +163,16 @@ Dynamic Dynamic - - - bundle_dynamic_with_category + bundle_dynamic_with_category Main Website - default_subcategory + default_subcategory - two_options_assigned_products_without_category + two_options_assigned_products_without_category @@ -188,7 +186,7 @@ 100 - taxable_goods + taxable_goods 1 Fixed @@ -197,10 +195,10 @@ Separately - required_two_fixed_options + required_two_fixed_options - required_two_fixed_options + bundle_required_two_fixed_options @@ -211,10 +209,10 @@ Fixed 100 - fixed_100_dollar + fixed_100_dollar - taxable_goods + taxable_goods 666 @@ -236,11 +234,11 @@ bundle-fixed-product-%isolation% Catalog, Search - fixed_100_dollar + fixed_100_dollar Default - fixed_100_dollar + bundle_fixed_100_dollar 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 0000000000000..5b63670819332 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct/BundleSelections.xml @@ -0,0 +1,608 @@ + + + + + + + + Drop-down Option + Drop-down + Yes + + + + %product_name% + + + 1 + + + + + %product_name% + + + 1 + + + + + + + + catalogProductSimple::default + catalogProductSimple::product_100_dollar + + + + + + + + Drop-down Option + Drop-down + Yes + + + + %product_name% + + + 5.00 + Fixed + 1 + + + + + %product_name% + + + 6.00 + Fixed + 1 + + + + + + + + catalogProductSimple::default + catalogProductSimple::product_100_dollar + + + + + + + + Drop-down Option + Drop-down + Yes + + + + %product_name% + + + 10.00 + Fixed + 1 + + + + + %product_name% + + + 560.00 + Fixed + 1 + + + + + + + + catalogProductSimple::product_10_dollar + catalogProductSimple::default + + + + + + + + Drop-down Option + Drop-down + Yes + + + + %product_name% + + + 5.00 + Fixed + 1 + + + + + %product_name% + + + 10.00 + Fixed + 1 + + + + + + + + catalogProductSimple::default + catalogProductSimple::product_100_dollar + + + + + + + + Drop-down Option + Drop-down + Yes + + + + %product_name% + + + 5.00 + Fixed + 1 + + + + + %product_name% + + + 6.00 + Fixed + 1 + + + + + + Radio Button Option + Radio Buttons + Yes + + + + %product_name% + + + 5.00 + Fixed + 1 + + + + + %product_name% + + + 6.00 + Fixed + 1 + + + + + + Checkbox Option + Checkbox + Yes + + + + %product_name% + + + 5.00 + Fixed + 1 + + + + + %product_name% + + + 6.00 + Fixed + 1 + + + + + + Multiple Select Option + Multiple Select + Yes + + + + %product_name% + + + 5.00 + Fixed + 1 + + + + + %product_name% + + + 6.00 + Fixed + 1 + + + + + + + + catalogProductSimple::default + catalogProductSimple::product_100_dollar + + + catalogProductSimple::default + catalogProductSimple::product_100_dollar + + + catalogProductSimple::default + catalogProductSimple::product_100_dollar + + + catalogProductSimple::default + catalogProductSimple::product_100_dollar + + + + + + + + Drop-down Option + Drop-down + Yes + + + + %product_name% + + + 1 + + + + + %product_name% + + + 1 + + + + + + Radio Button Option + Radio Buttons + Yes + + + + %product_name% + + + 1 + + + + + %product_name% + + + 1 + + + + + + Checkbox Option + Checkbox + Yes + + + + %product_name% + + + 1 + + + + + %product_name% + + + 1 + + + + + + Multiple Select Option + Multiple Select + Yes + + + + %product_name% + + + 1 + + + + + %product_name% + + + 1 + + + + + + + + catalogProductSimple::default + catalogProductSimple::product_100_dollar + + + catalogProductSimple::default + catalogProductSimple::product_100_dollar + + + catalogProductSimple::default + catalogProductSimple::product_100_dollar + + + catalogProductSimple::default + catalogProductSimple::product_100_dollar + + + + + + + + Drop-down Option + Drop-down + No + + + + %product_name% + + + 1 + 45 + Fixed + + + + + %product_name% + + + 1 + 43 + Fixed + + + + + + Radio Button Option + Radio Buttons + No + + + + %product_name% + + + 1 + 45 + Fixed + + + + + %product_name% + + + 1 + 43 + Fixed + + + + + + + + catalogProductSimple::default + catalogProductSimple::product_100_dollar + + + catalogProductSimple::default + catalogProductSimple::product_100_dollar + + + + + + + + Drop-down Option + Drop-down + Yes + + + + %product_name% + + + 1 + 10.00 + Fixed + + + + + %product_name% + + + 1 + 20.00 + Percent + + + + + + + + catalogProductSimple::product_without_category + catalogProductSimple::product_without_category + + + + + + + + Drop-down Option + Drop-down + Yes + + + + %product_name% + + + 1 + + + + + %product_name% + + + 1 + + + + + + + + catalogProductSimple::product_without_category + catalogProductSimple::product_without_category + + + + + + + + Drop-down Option + Drop-down + Yes + + + + %product_name% + + + 1 + + + + + + + + catalogProductSimple::simple_big_qty + + + + + + + + Drop-down Option + Drop-down + Yes + + + + %product_name% + + + 10.00 + Fixed + 1 + + + + + %product_name% + + + 20.00 + Fixed + 1 + + + + + + + + catalogProductSimple::simple + catalogProductSimple::product_15_dollar + + + + + 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 0000000000000..7b9551aeae7c0 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct/CheckoutData.xml @@ -0,0 +1,331 @@ + + + + + + + + + Drop-down Option + Drop-down + + product_100_dollar + + + + + + + + + + + Drop-down Option + Drop-down + + product_100_dollar + + + + + 2 + + 100 + 2 + 200 + + + + + + + + Drop-down Option + Drop-down + + product_100_dollar + + + + + 1 + + 756 + 1 + 756 + + + + + + + + Drop-down Option + Drop-down + + product_10_dollar + + + + + 1 + + 110 + 1 + 110 + + + + + + + + Drop-down Option + Drop-down + + Simple Product + + + + + 1 + + 756 + 1 + 756 + + + + + + + + Drop-down Option + Drop-down + + product_100_dollar + + + + Radio Button Option + Radio Buttons + + product_100_dollar + + + + + + + + + + + Drop-down Option + Drop-down + + product_100_dollar + + + + + + attribute_key_0 + option_key_0 + + + attribute_key_1 + option_key_0 + + + attribute_key_2 + Field + + + attribute_key_3 + Field + + + attribute_key_4 + Area + + + attribute_key_6 + option_key_0 + + + attribute_key_7 + option_key_0 + + + attribute_key_8 + option_key_0 + + + attribute_key_9 + option_key_0 + + + attribute_key_10 + 12/12/2015 + + + attribute_key_11 + 12/12/2015/12/30/AM + + + attribute_key_12 + 12/12/AM + + + + + + + + + + Drop-down Option + Drop-down + + product_100_dollar + + + + + + attribute_key_0 + option_key_0 + + + + + + + + + + Drop-down Option + Drop-down + + product_100_dollar + + + + Radio Button Option + Radio Buttons + + product_100_dollar + + + + Checkbox Option + Checkbox + + product_100_dollar + + + + Multiple Select Option + Multiple + + product_100_dollar + + + + + + attribute_key_0 + Field + + + attribute_key_1 + Area + + + attribute_key_3 + option_key_0 + + + attribute_key_4 + option_key_0 + + + attribute_key_5 + option_key_0 + + + attribute_key_6 + option_key_0 + + + attribute_key_7 + 12/12/2015 + + + attribute_key_8 + 12/12/2015/12/30/AM + + + attribute_key_9 + 12/12/AM + + + + + + + + + + Drop-down Option + Drop-down + + product_100_dollar + + + + Radio Button Option + Radio Buttons + + product_100_dollar + + + + Checkbox Option + Checkbox + + product_100_dollar + + + + Multiple Select Option + Multiple + + product_100_dollar + + + + + + + + + + + Drop-down Option + Drop-down + + Test simple product + + + + + + + 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 0000000000000..99871d62cd2cb --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct/Price.xml @@ -0,0 +1,137 @@ + + + + + + + 755.00 + 756.00 + + + + + 115.00 + 120.00 + 145.00 + + + + 115.00 + 120.00 + 126.00 + + + + 40.00 + 100.00 + 100.00 + + + + 32.00 + 80.00 + 80.00 + + + + 10.00 + 100.00 + 80.00 + + + + 15.00 + 16.00 + 80.00 + + + + 96.00 + 97.00 + 244.00 + + + + 110.00 + 120.00 + + + + 159.00 + 164.00 + 159.00 + + + + 317.00 + 362.00 + 317.00 + + + + 755.00 + 756.00 + 756.00 + + + + 130.00 + 144.00 + + + + + 100.00 + 560.00 + + + + + 8.00 + 20.00 + 80.00 + + + + 32.00 + 80.00 + 80.00 + + + + 40.00 + 100.00 + 100.00 + + + + 50.00 + + + + 100.00 + 560.00 + 100.00 + + + + 200.00 + 500.00 + 400.00 + + + + 560.00 + + + + 100.00 + 100.00 + + + 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 ad5b9bfa0c055..40e5809b35255 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 @@ Bundle Product Dynamic Required No No - default_dynamic + default_dynamic catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar - default + bundle_default @@ -34,9 +34,9 @@ Dynamic category_%isolation% Separately - default_dynamic + default_dynamic catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar - default + bundle_default Catalog, Search No Yes @@ -51,16 +51,16 @@ bundle_sku_%isolation% Product online Dynamic - dynamic-200 + dynamic-200 In Stock Dynamic category_%isolation% Bundle Product Dynamic Price Range Together - all_types_dynamic + all_types_dynamic 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 - all_types_bundle_options + bundle_all_types_bundle_options Catalog, Search No Yes @@ -83,14 +83,14 @@ bundle_sku_%isolation% Fixed 10 - fixed-15 - None + fixed-15 + None Fixed 10 Bundle Product Fixed Required - default_fixed + default_fixed catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar - default + bundle_default @@ -99,7 +99,6 @@ - Bug: MAGETWO-35342 Create fixed bundle with all types options bundle-product-%isolation% BundleProduct %isolation% @@ -108,20 +107,20 @@ Product online Fixed 100 - fixed-24 - taxable_goods + fixed-24 + taxable_goods In Stock Fixed 10 category_%isolation% Bundle Product Fixed - default + not_logged_in_20 As Low as Separately - all_types_fixed + all_types_fixed 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 - all_types_bundle_fixed_and_custom_options - all_types + bundle_all_types_bundle_fixed_and_custom_options + all_types Catalog, Search No No @@ -145,8 +144,8 @@ Product online Fixed 10 - fixed-10 - taxable_goods + fixed-10 + taxable_goods Out of Stock Fixed 10 @@ -155,9 +154,9 @@ No Yes Together - with_not_required_options + with_not_required_options catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar|catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar - with_not_required_options + bundle_with_not_required_options Catalog No No @@ -173,17 +172,17 @@ Dynamic bundle_sku_%isolation% Dynamic - dynamic-50 + dynamic-50 Fixed 10 - default + default As Low as No No Together - default_dynamic + default_dynamic catalogProductSimple::product_100_dollar,catalogProductVirtual::product_50_dollar - default + bundle_default Search @@ -200,13 +199,13 @@ Dynamic sku_bundle_dynamic_%isolation% Dynamic - dynamic-8 + dynamic-8 20 m/d/Y m/d/Y +3 days - default_dynamic + default_dynamic catalogProductSimple::product_100_dollar,catalogProductSimple::product_40_dollar - default + bundle_default @@ -217,11 +216,11 @@ Dynamic sku_bundle_dynamic_%isolation% Dynamic - dynamic-32 - MAGETWO-23061 - default_dynamic + dynamic-32 + not_logged_in_20 + default_dynamic catalogProductSimple::product_100_dollar,catalogProductSimple::product_40_dollar - default + bundle_default @@ -234,10 +233,10 @@ Dynamic sku_bundle_dynamic_%isolation% Dynamic - dynamic-40 - default_dynamic + dynamic-40 + default_dynamic catalogProductSimple::product_100_dollar,catalogProductSimple::product_40_dollar - default + bundle_default @@ -251,11 +250,11 @@ sku_bundle_fixed_%isolation% Fixed 110 - fixed-115 - second + fixed-115 + second catalogProductSimple::product_100_dollar,catalogProductSimple::product_40_dollar - with_custom_options_1 - drop_down_with_one_option_fixed_price + bundle_with_custom_options_1 + drop_down_with_one_option_fixed_price catalogProductSimple::with_two_custom_option,catalogProductSimple::with_all_custom_option @@ -271,11 +270,11 @@ sku_bundle_fixed_%isolation% Fixed 110 - fixed-110 - second + fixed-110 + second catalogProductSimple::product_100_dollar,catalogProductSimple::product_40_dollar - with_custom_options_2 - drop_down_with_one_option_percent_price + bundle_with_custom_options_2 + drop_down_with_one_option_percent_price @@ -288,9 +287,9 @@ Dynamic sku_bundle_dynamic_%isolation% Dynamic - default_dynamic + default_dynamic catalogProductSimple::product_100_dollar,catalogProductSimple::product_40_dollar - default + bundle_default @@ -301,9 +300,9 @@ sku_bundle_fixed_%isolation% Fixed 10 - second + second catalogProductSimple::product_100_dollar,catalogProductSimple::product_40_dollar - default + bundle_default @@ -314,13 +313,13 @@ sku_bundle_fixed_%isolation% Fixed 100 - fixed-100 - taxable_goods + fixed-100 + taxable_goods Fixed 1 category_%isolation% Together - two_options_with_fixed_and_percent_prices + two_options_with_fixed_and_percent_prices test_type:acceptance_test @@ -333,10 +332,10 @@ Bundle Dynamic %isolation% sku_bundle_dynamic_%isolation% Dynamic - dynamic-560 + dynamic-560 category_%isolation% Together - one_options_assigned_simple_big_qty + one_options_assigned_simple_big_qty test_type:acceptance_test 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 89e9f03427db7..bbe84c24f29ab 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 @@ */ --> - - - Update dynamic bundle product - bundle_dynamic_product - bundle-product-%isolation% - bundle_dynamic_%isolation% - Fixed - bundle_dynamic_%isolation% - - - dynamic-100 - Fixed - 1 - - - Bundle Product Fixed Required - Together - default_dynamic - default - - - - - - - - - - - - - Update fixed bundle product - bundle_fixed_product - bundle-product-%isolation% - bundle_fixed_%isolation% - Dynamic - bundle_sku_%isolation% - - - fixed-756 - Dynamic - - - default_subcategory - - - Separately - default_fixed - default - Catalog, Search - - - - - - - - - - - - MAGETWO-12841: Edit Bundle Product (Fixed Price) - bundle_fixed_with_category - bundle-product-%isolation% - bundle_fixed_%isolation% - - - bundle_sku_%isolation% - 120.00 - bundle_fixed_with_category - - - - - - - - - - - - - - - - - - - - - MAGETWO-12842: Edit Bundle (dynamic) Product - bundle_dynamic_with_category - bundle-product-%isolation% - bundle_dynamic_%isolation% - - - bundle_sku_%isolation% - - - bundle_dynamic_with_category - - - - - - - - - - - - - - - - - - - - + + + Update dynamic bundle product + bundle_dynamic_product + bundle-product-%isolation% + bundle_dynamic_%isolation% + Fixed + bundle_dynamic_%isolation% + dynamic-100 + Fixed + 1 + Bundle Product Fixed Required + Together + default_dynamic + bundle_default + + + + + + + + + + + Update fixed bundle product + bundle_fixed_product + bundle-product-%isolation% + bundle_fixed_%isolation% + Dynamic + bundle_sku_%isolation% + fixed-756 + Dynamic + default_subcategory + Separately + default_fixed + bundle_default + Catalog, Search + + + + + + + + + + + + MAGETWO-12841: Edit Bundle Product (Fixed Price) + bundle_fixed_with_category + bundle-product-%isolation% + bundle_fixed_%isolation% + bundle_sku_%isolation% + 120.00 + bundle_fixed_with_category + + + + + MAGETWO-12842: Edit Bundle (dynamic) Product + bundle_dynamic_with_category + bundle-product-%isolation% + bundle_dynamic_%isolation% + bundle_sku_%isolation% + bundle_dynamic_with_category + + + + 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 791edb5f52296..9824582c0225a 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 @@ public function getData(FixtureInterface $fixture = null, SimpleElement $element } } - 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 08f536e9e41b8..def6490e3bf27 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 @@ protected function prepareData(FixtureFactory $fixtureFactory, Category $categor $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 30224411bc7df..1f355049a172e 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 @@ public function processAssert( $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 f812fcdcf2617..4d29d2c4ccdf2 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 @@ protected function createSimpleProductFixture(CatalogProductSimple $product, Cat 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 c44e68eb547f3..4be5339886f26 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 @@ public function processAssert( 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 c3f069fa2ed05..4c52c900a1e74 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 @@ public function processAssert( ? ($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 165f69f007b7e..2baac340525f3 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 @@ public function processAssert( $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 86ef5f1742097..cf3e50c9f0900 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 @@ public function processAssert( $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 9e8d1996b13a2..c5b0a6ead5672 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 @@ public function __construct(FixtureInterface $product) $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 20c3c831f6e62..8fad06be79f59 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 @@ */ --> - - - Default_attribute_set_%isolation% - - default - - - - - - - 0 - - - Default_attribute_set_%isolation% - - - 0 - - - - default - - - - - + + + + + + + + + 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 3cab123641402..ef7559333b1e5 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 @@ public function __construct(FixtureFactory $fixtureFactory, array $params, array } } - /** - * 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 27f86800767f5..8367af66ae848 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 @@ public function __construct(FixtureFactory $fixtureFactory, array $params, array } } - /** - * 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 @@ public function getAttributeSet() { return $this->attributeSet; } - - /** - * Return data set configuration settings - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductAttribute.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductAttribute.xml index 1a38dd8158cd6..c2606db97bb6d 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 @@ */ --> - - - attribute_label%isolation% - Text Field - No - - - - - - 0 - - - - - - - - - - - - static - - - - - - - - - Text Field - - - attribute_label%isolation% - - - - - - - - - - - - No - - - 0 - - - 0 - - - - - - - - - 1 - - - 1 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 1 - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 e0a28bee41f49..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductAttribute/Options.php +++ /dev/null @@ -1,108 +0,0 @@ -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 59bc10f7eeecd..e295d379e33d2 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 @@ */ --> - - - Test simple product %isolation% - test_simple_sku_%isolation% - - default - - - 100.00 - - 12.00 - - 10.00 - In Stock - - - Main Website - - simple-product-%isolation% - - - simple - - simple - 4 - - product - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Test simple product %isolation% - - - - - - - - - - - - - 100 - - - - - 10 - In Stock - - - - - - - test_simple_sku_%isolation% - - - - - - - - - - - - - - - - - - - - - Product online - - - Taxable Goods - - - - - - - - - - - - - - - - - - - - - Catalog, Search - - - 12 - - - - - - default - - - - - - - Main Website - - - - - - - - - - - - - - - - - - - - - - + + + simple + + simple + 4 + + product + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 238cfafd0832a..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CheckoutData.php +++ /dev/null @@ -1,216 +0,0 @@ -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 7c4a89ea39b40..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CrossSellProducts.php +++ /dev/null @@ -1,16 +0,0 @@ -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 @@ protected function getDefaultAttributeValue(CatalogProductAttribute $attribute) 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 @@ public function getAttribute() 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 c6fa45ab95730..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CustomOptions.php +++ /dev/null @@ -1,455 +0,0 @@ -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 8d29bd7bd8bf1..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/Fpt.php +++ /dev/null @@ -1,87 +0,0 @@ -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 2640e83ddd9bd..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/GroupPriceOptions.php +++ /dev/null @@ -1,113 +0,0 @@ -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 470558b5d4d0b..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/Price.php +++ /dev/null @@ -1,146 +0,0 @@ -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 ccb66fbfb3359..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/RelatedProducts.php +++ /dev/null @@ -1,16 +0,0 @@ -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 887125967f75c..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/UpSellProducts.php +++ /dev/null @@ -1,16 +0,0 @@ - - - - Test virtual product %isolation% - test_virtual_sku_%isolation% - - 100.00 - - - 10.00 - In Stock - - Yes - - - virtual - - virtual - 4 - - product - - - Yes - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Use config - - - Test virtual product %isolation% - - - - - - - - - - - - Block after Info Column - - - - - - - 100 - - - - - 10 - In Stock - - - - - - - sku_test_virtual_product_%isolation% - - - - - - - - - - - - - - - - - - - - - Product online - - - Taxable Goods - - - - - - - - - - - - - - - - - - - - - Catalog, Search - - - - - - - - - - - Main Website - - - - - - - + + + virtual + + virtual + 4 + + product + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 bb1ba27ff3bcf..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductVirtual/CheckoutData.php +++ /dev/null @@ -1,51 +0,0 @@ - [ - '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 9ea63b5e3616f..2a973efeac3d2 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 @@ */ --> - - - Category%isolation% - category%isolation% - Yes - Yes - - default_category - - - - - - - 0 - - - 0 - - - - - - 2 - - - - - - - - - Default Category - - - - - - 0 - - - - - - - - - - - - - - - - - - - - - - Category%isolation% - - - Yes - - - - category%isolation% - - - Yes - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 1230c6c96549b..88ac5ece79d53 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 @@ public function __construct(FixtureFactory $fixtureFactory, array $params, $data } /** - * 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 22ac44c8c5e55..fcab7554227ca 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 @@ public function __construct(FixtureFactory $fixtureFactory, array $params, $data $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 @@ public function __construct(FixtureFactory $fixtureFactory, array $params, $data } } - /** - * 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 7075706983b99..17a37eef163e4 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 @@ public function __construct(FixtureFactory $fixtureFactory, array $params, $data } /** - * Persist attribute options - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set - * - * @param string|null $key - * @return mixed - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Return entity + * Return 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 798cb76ead304..9a314c06e7d28 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 @@ public function __construct(FixtureFactory $fixtureFactory, array $params, $data 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 @@ public function __construct(FixtureFactory $fixtureFactory, array $params, $data } /** - * Persist attribute options - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set - * - * @param string|null $key - * @return mixed - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return Attribute Set fixture + * Return Attribute Set fixture. * * @return CatalogAttributeSet */ @@ -92,14 +63,4 @@ public function getAttributeSet() { return $this->attributeSet; } - - /** - * Return data set configuration settings - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } } diff --git a/dev/tests/functional/tests/app/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 7742361674d6f..3eda80caa7c3e --- 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 @@ public function __construct( $this->params = $params; if (!empty($data['category']) - && empty($data['presets']) + && empty($data['dataset']) && $data['category'] instanceof Category ) { /** @var Category $category */ @@ -56,14 +48,14 @@ public function __construct( } $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 @@ public function __construct( } } - /** - * 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 0000000000000..4d677778a4b60 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Product/CustomOptions.php @@ -0,0 +1,98 @@ +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 0000000000000..293b0489f569e --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Product/Price.php @@ -0,0 +1,57 @@ +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 fbe47d82bdf68..3aada24483b40 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 @@ public function __construct(FixtureFactory $fixtureFactory, array $params, array } } - /** - * 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 7bc605d82acca..c471725a5f02c 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 @@ public function __construct(FixtureFactory $fixtureFactory, array $params, $data } /** - * Set tax class id + * Set tax class id. * * @param string $taxClassName * @return void @@ -104,40 +103,7 @@ protected function setTaxClassId($taxClassName) } /** - * 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 @@ public function getTaxClass() } /** - * 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 a738e51b8874f..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/ProductAttribute.php +++ /dev/null @@ -1,204 +0,0 @@ -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 632de082cfe61..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/Curl/CreateProductAttribute.php +++ /dev/null @@ -1,121 +0,0 @@ -_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 2ae408622b112..3d89c92046b04 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 @@ Custom_attribute_set%isolation% - default + default Custom_attribute_set%isolation% - default + default - attribute_type_fpt + attribute_type_fpt 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 0562055a8c5ad..82f92677fd218 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 @@ --> + + attribute_label%isolation% + Text Field + No + + attribute_text%isolation% attribute_text%isolation% 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 0000000000000..38ec9a7268549 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductAttribute/Options.xml @@ -0,0 +1,26 @@ + + + + + + + Yes + blue + + + + + + black + + + white + + + + 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 c4ae2d72fde4d..328c932717e73 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 @@ - default + default Simple Product %isolation% sku_simple_product_%isolation% @@ -21,10 +21,9 @@ 560 - - - taxable_goods + taxable_goods Main Website @@ -32,13 +31,13 @@ Catalog, Search simple-product-%isolation% - order_default + simple_order_default - default + default product_10_dollar %isolation% sku_product_10_dollar_%isolation% @@ -50,10 +49,9 @@ 10 - - - taxable_goods + taxable_goods Main Website @@ -61,13 +59,13 @@ Catalog, Search product-10-dollar-%isolation% - order_10_dollar_product + simple_order_10_dollar_product - default + default product_20_dollar %isolation% sku_product_20_dollar_%isolation% @@ -81,7 +79,7 @@ 20 - taxable_goods + taxable_goods Main Website @@ -102,20 +100,19 @@ simple-product-%isolation% 560 - - Main Website Catalog, Search - order_default + simple_order_default - default + default Simple Product %isolation% sku_simple_product_%isolation% @@ -126,10 +123,9 @@ 560 - - - taxable_goods + taxable_goods Main Website @@ -137,13 +133,13 @@ Catalog, Search simple-product-%isolation% - order_big_qty + simple_order_big_qty - default + default Simple Product %isolation% sku_simple_product_%isolation% @@ -154,10 +150,9 @@ 560 - - - taxable_goods + taxable_goods Main Website @@ -165,7 +160,7 @@ Catalog, Search simple-product-%isolation% - order_custom_price + simple_order_custom_price @@ -179,18 +174,17 @@ 1 - default + default 100 - - Main Website simple-product-%isolation% - two_products + simple_two_products @@ -204,11 +198,10 @@ 1 - default + default 40 - - product_40_dollar simple-product-%isolation% @@ -221,7 +214,7 @@ MAGETWO-23036_%isolation% simple_with_category %isolation% - default + default simple @@ -231,10 +224,10 @@ 1 100 - MAGETWO-23036 + MAGETWO-23036 - default_subcategory + default_subcategory simple_with_category @@ -252,14 +245,14 @@ 1 - default + default 100 - + - default_subcategory + default_subcategory Main Website @@ -274,11 +267,11 @@ simple_product_without_category_%isolation% 1 - default + default 100 - + Main Website @@ -287,7 +280,7 @@ - default + default simple @@ -298,7 +291,7 @@ sku_simple_product_%isolation% 100 - + 100 @@ -306,7 +299,7 @@ simple-product-%isolation% - default_subcategory + default_subcategory @@ -315,13 +308,12 @@ simple_for_composite_products%isolation% 560 - - - default + default - taxable_goods + taxable_goods 111 @@ -343,13 +335,13 @@ - default + default Simple Product %isolation% sku_simple_product_%isolation% 50 - + 50 @@ -357,7 +349,7 @@ simple-product-%isolation% - default_subcategory + default_subcategory @@ -365,15 +357,15 @@ simple_product_with_special_price_and_category%isolation% Simple product with special price and category %isolation% - default + default 100 - + 90 - default_subcategory + default_subcategory Main Website @@ -385,11 +377,11 @@ simple_product_with_special_price_and_category%isolation% Simple with Special Price 1$ off %isolation% - default + default 10 - + 9 @@ -397,7 +389,7 @@ simple-product-%isolation% - order_special_price + simple_order_special_price @@ -406,10 +398,9 @@ adc_123 100 - - - None + None 666 @@ -430,10 +421,9 @@ adc_123 100 - - - None + None 666 @@ -454,10 +444,9 @@ adc_123 100 - - - None + None 666 @@ -478,10 +467,9 @@ abc_dfj 50 - - - taxable_goods + taxable_goods 666 @@ -502,7 +490,7 @@ product_100_dollar%isolation% product_100_dollar%isolation% - default + default simple @@ -512,7 +500,6 @@ 1 100 - - Main Website @@ -523,13 +510,12 @@ simple - default + default Simple Product %isolation% sku_simple_product_%isolation% 100 - - 1 simple-product-%isolation% @@ -539,17 +525,16 @@ simple - default + default Simple Product %isolation% sku_simple_product_%isolation% 100 - - 1 - default + not_logged_in_20 simple-product-%isolation% @@ -557,20 +542,19 @@ simple - default + default Simple Product %isolation% sku_simple_product_%isolation% 100 - - 1 - tax_calculation + general_90_99 - default_subcategory + default_subcategory Main Website @@ -581,17 +565,16 @@ simple - default + default Simple Product %isolation% sku_simple_product_%isolation% 300 - - 1 - default + default simple-product-%isolation% @@ -599,20 +582,19 @@ simple - default + default Simple Product %isolation% sku_simple_product_%isolation% 300 - - 1 - default + default - default_subcategory + default_subcategory Main Website @@ -623,50 +605,48 @@ simple - default + default Simple Product %isolation% sku_simple_product_%isolation% 300 - - 1 Main Website - two_options + two_options simple-product-%isolation% - with_two_custom_option + simple_with_two_custom_option simple - default + default Simple Product %isolation% sku_simple_product_%isolation% 300 - - 1 - drop_down_with_one_option_percent_price + drop_down_with_one_option_percent_price - drop_down_with_one_option_percent_price + simple_drop_down_with_one_option_percent_price Main Website - default_subcategory + default_subcategory simple-product-%isolation% @@ -674,18 +654,17 @@ simple - default + default Simple Product With Custom Option %isolation% sku_simple_product_%isolation% 300 - - 1 simple-product-%isolation% - all_types + all_types @@ -703,11 +682,10 @@ 1 - default + default 100 - - Main Website @@ -717,7 +695,7 @@ - default + default Simple Product out of stock %isolation% sku_simple_product_out_of_stock%isolation% @@ -728,24 +706,23 @@ 560 - - - taxable_goods + taxable_goods Main Website Catalog, Search - order_default + simple_order_default simple-product-%isolation% - default + default Simple Product offline %isolation% sku_simple_product_offline_%isolation% @@ -756,17 +733,16 @@ 560 - - - taxable_goods + taxable_goods Main Website Catalog, Search - order_default + simple_order_default Product offline simple-product-%isolation% @@ -774,7 +750,7 @@ - default + default Simple Product not visible %isolation% sku_simple_product_not_visible_%isolation% @@ -785,24 +761,23 @@ 560 - - - taxable_goods + taxable_goods Main Website Not Visible Individually - order_default + simple_order_default simple-product-%isolation% - default + default Simple Product with cart limit %isolation% sku_simple_product_with_cart_limit_%isolation% @@ -813,17 +788,16 @@ 560 - - - taxable_goods + taxable_goods Main Website Catalog, Search - order_default + simple_order_default 2 @@ -835,20 +809,19 @@ simple - default + default Simple Product %isolation% sku_simple_product_%isolation% 300 - - 1 - drop_down_with_one_option_percent_price + drop_down_with_one_option_percent_price - drop_down_with_one_option_percent_price + simple_drop_down_with_one_option_percent_price simple-product-%isolation% @@ -858,7 +831,7 @@ - default + default Simple Product with qty increments %isolation% sku_simple_product_with_qty_increments_%isolation% @@ -869,17 +842,16 @@ 560 - - - taxable_goods + taxable_goods Main Website Catalog, Search - order_default + simple_order_default Yes @@ -891,13 +863,12 @@ simple - default + default Simple Product %isolation% sku_simple_product_%isolation% 300 - - 1 @@ -906,7 +877,7 @@ simple-product-%isolation% - default + default Main Website @@ -922,14 +893,14 @@ 1 - default + default 100 - + - default_anchor_subcategory + default_anchor_subcategory Main Website @@ -941,10 +912,10 @@ simple - default + default - default_subcategory + default_subcategory Main Website @@ -953,28 +924,27 @@ sku_simple_product_%isolation% 70 - - 1 - drop_down_with_one_option_fixed_price + drop_down_with_one_option_fixed_price - drop_down_with_one_option_fixed_price + simple_drop_down_with_one_option_fixed_price simple-product-%isolation% - one_fpt_for_all_states + one_fpt_for_all_states simple - default + default - default_subcategory + default_subcategory Main Website @@ -983,19 +953,18 @@ sku_simple_product_%isolation% 110 - - 100 1 simple-product-%isolation% - one_fpt_for_all_states + one_fpt_for_all_states - default + default Simple Product %isolation% sku_simple_product_%isolation% @@ -1007,23 +976,22 @@ 10 - - - taxable_goods + taxable_goods Main Website Catalog, Search - order_default + simple_order_default No - default_subcategory + default_subcategory 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 0000000000000..53227bff53859 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple/CheckoutData.xml @@ -0,0 +1,140 @@ + + + + + + + + + attribute_key_0 + option_key_0 + + + attribute_key_1 + Content option %isolation% + + + + 1 + + 340 + 1 + 340 + + + + + + + + attribute_key_0 + option_key_1 + + + attribute_key_1 + Content option %isolation% + + + + 2 + + 370 + 74 + + + + + + + + attribute_key_0 + Field value 1 %isolation% + + + attribute_key_1 + Field value 2 %isolation% + + + attribute_key_2 + option_key_1 + + + attribute_key_3 + option_key_0 + + + + + + + + + + attribute_key_0 + option_key_0 + + + + + + + + + + attribute_key_0 + option_key_0 + + + + + + + 1 + + 560 + 560 + + + + + 2 + + 100 + 200 + + + + + 900 + + + + 3 + + Yes + 100 + + + + + 1 + + 9 + 9 + + + + + 1 + + 10 + 10 + + + + 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 0000000000000..8b700e37456f3 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple/Price.xml @@ -0,0 +1,46 @@ + + + + + + 100.00 + 100.00 + 130.00 + + + + 100.00 + 100.00 + 140.00 + + + + 100.00 + 90.00 + 100.00 + 90.00 + 120.00 + + + + 100.00 + 90.00 + 100.00 + 90.00 + 126.00 + + + + 100.00 + 90.00 + 100.00 + 90.00 + 90.00 + + + 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 2e2903a0cf352..818590b22319a 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 @@ - taxable_goods + taxable_goods Product online @@ -19,7 +19,7 @@ virtual-product%isolation% Catalog, Search - default + default Virtual product %isolation% sku_virtual_product_%isolation% @@ -29,10 +29,9 @@ 10 - - - order_default + virtual_order_default @@ -43,10 +42,9 @@ Yes 10 - - - taxable_goods + taxable_goods Main Website @@ -60,13 +58,12 @@ Yes 10 - - - default_subcategory + default_subcategory - taxable_goods + taxable_goods Main Website @@ -75,7 +72,7 @@ - taxable_goods + taxable_goods Product online @@ -85,7 +82,7 @@ virtual-product%isolation% Catalog, Search - default + default Virtual product %isolation% sku_virtual_product_%isolation% @@ -95,16 +92,15 @@ 10 - - - order_big_qty + virtual_order_big_qty - taxable_goods + taxable_goods Product online @@ -114,7 +110,7 @@ virtual-product%isolation% Catalog, Search - default + default Virtual product %isolation% sku_virtual_product_%isolation% @@ -124,10 +120,9 @@ 10 - - - order_custom_price + virtual_order_custom_price @@ -135,7 +130,7 @@ product_50_dollar %isolation% product_50_dollar_%isolation% - taxable_goods + taxable_goods Product online @@ -145,7 +140,7 @@ virtual-product%isolation% Catalog, Search - default + default 111 @@ -153,16 +148,15 @@ 50 - - - product_50_dollar + virtual_product_50_dollar - taxable_goods + taxable_goods Main Website @@ -180,10 +174,9 @@ 15 - - - order_default + virtual_order_default 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 0000000000000..7a9a25ede9979 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual/CheckoutData.xml @@ -0,0 +1,35 @@ + + + + + + 1 + + + + 900 + + + + 1 + + 50 + 1 + 50 + + + + + 3 + + Yes + 100 + + + + 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 6f12c7c430577..e08fb4234aae8 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 @@ --> + + Category%isolation% + category%isolation% + Yes + Yes + + default_category + + + Default Category 1 @@ -18,7 +28,7 @@ DefaultSubcategory%isolation% default-subcategory-%isolation% - default_category + default_category Yes Yes @@ -28,7 +38,7 @@ DefaultSubcategory%isolation% default-subcategory-%isolation% - default_category + default_category Yes Yes @@ -47,7 +57,7 @@ RootSubCategory%isolation% root-sub-category-%isolation% - root_category + root_category Yes Yes 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 0000000000000..a785e3bda5ed7 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Product/CustomOptions.xml @@ -0,0 +1,317 @@ + + + + + + + custom option drop down %isolation% + Yes + Select/Drop-down + + + 10 percent + 10 + Percent + sku_drop_down_row_1 + + + + + custom option drop down2 %isolation% + Yes + Select/Drop-down + + + 20 percent + 20 + Percent + sku_drop_down_row_2 + + + + + + + + custom option drop down %isolation% + Yes + Select/Drop-down + + + 10 percent + 10 + Percent + sku_drop_down_row_1 + + + 20 percent + 20 + Percent + sku_drop_down_row_2 + + + + + custom option field %isolation% + Yes + Text/Field + + + 10 + Fixed + sku_field_option_%isolation% + 1024 + + + + + + + + custom option drop down %isolation% + Yes + Select/Drop-down + + + 30 bucks + 30 + Fixed + sku_drop_down_row_1 + + + + + + + + custom option drop down %isolation% + Yes + Select/Drop-down + + + 40 Percent + 40 + Percent + sku_drop_down_row_1 + + + + + + + + Test1 option %isolation% + Yes + Text/Field + + + 120.03 + Fixed + sku1_%isolation% + 45 + + + + + Test2 option %isolation% + Yes + Text/Field + + + 120.03 + Fixed + sku1_%isolation% + 45 + + + + + Test3 option %isolation% + Yes + Select/Drop-down + + + Test3-1 %isolation% + 110.01 + Percent + Percent + + + Test3-2 %isolation% + 210.02 + Fixed + sku3_%isolation% + + + + + Test4 option %isolation% + Yes + Select/Drop-down + + + Test4-1 %isolation% + 10.01 + Percent + sku2_%isolation% + + + Test4-2 %isolation% + 20.02 + Fixed + sku3_%isolation% + + + + + + + + custom option field %isolation% + Yes + Text/Field + + + 10 + Fixed + sku_field_option_%isolation% + 1024 + + + + + custom option Area %isolation% + Yes + Text/Area + + + 10 + Fixed + sku_area_row_%isolation% + 100 + + + + + custom option File %isolation% + No + File/File + + + 10 + Fixed + sku_file_row_%isolation% + jpg + 100 + 100 + + + + + custom option drop down %isolation% + Yes + Select/Drop-down + + + 10 percent + 10 + Percent + sku_drop_down_row_1_%isolation% + + + 20 percent + 20 + Percent + sku_drop_down_row_2_%isolation% + + + 30 fixed + 30 + Fixed + sku_drop_down_row_3_%isolation% + + + + + custom option Radio Buttons %isolation% + Yes + Select/Radio Buttons + + + 20 fixed + 20 + Fixed + sku_radio_buttons_row%isolation% + + + + + custom option Checkbox %isolation% + Yes + Select/Checkbox + + + 20 fixed + 20 + Fixed + sku_checkbox_row%isolation% + + + + + custom option Multiple Select %isolation% + Yes + Select/Multiple Select + + + 20 fixed + 20 + Fixed + sku_multiple_select_row%isolation% + + + + + custom option Date %isolation% + Yes + Date/Date + + + 20 + Fixed + sku_date_row%isolation% + + + + + custom option Date & Time %isolation% + Yes + Date/Date & Time + + + 20 + Fixed + sku_date_and_time_row%isolation% + + + + + custom option Time %isolation% + Yes + Date/Time + + + 20 + Fixed + sku_time_row%isolation% + + + + + + 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 0000000000000..c942bb1d6517b --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Product/Fpt.xml @@ -0,0 +1,19 @@ + + + + + + + 10 + All Websites [USD] + United States + * + + + + 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 0000000000000..c55de6d823b8c --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Product/GroupPriceOptions.xml @@ -0,0 +1,34 @@ + + + + + + + 20 + All Websites [USD] + NOT LOGGED IN + + + + + + 90 + All Websites [USD] + NOT LOGGED IN + + + + + + 90.99 + All Websites [USD] + General + + + + 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 0000000000000..805c784847fed --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Product/TierPrice.xml @@ -0,0 +1,34 @@ + + + + + + + 15 + All Websites [USD] + 3 + ALL GROUPS + + + 24 + All Websites [USD] + 15 + ALL GROUPS + + + + + + 90 + All Websites [USD] + 2 + ALL GROUPS + + + + 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 5834f1f1d2d97..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/ProductAttribute.php +++ /dev/null @@ -1,49 +0,0 @@ -_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 83d80113af0ae..88a87a7dd63b4 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 @@ Create subcategory with required fields addSubcategory - default_category + default_category Subcategory%isolation% Subcategory%isolation% Yes @@ -59,7 +59,7 @@ Create not anchor subcategory with required fields addSubcategory - default_category + default_category Subcategory%isolation% Subcategory%isolation% Yes @@ -69,7 +69,7 @@ Yes Yes Yes - catalogProductSimple::default,catalogProductSimple::default + catalogProductSimple::default,catalogProductSimple::default @@ -78,7 +78,7 @@ Create anchor subcategory with all fields addSubcategory - default_category + default_category Subcategory%isolation% Subcategory%isolation% Yes @@ -86,7 +86,7 @@ Subcategory Page Title Yes Static block and products - default + default Yes No Position @@ -96,7 +96,7 @@ Price No 50 - catalogProductSimple::default,catalogProductSimple::default + catalogProductSimple::default,catalogProductSimple::default @@ -105,7 +105,7 @@ Create not active subcategory addSubcategory - default_category + default_category Subcategory%isolation% Subcategory%isolation% Yes @@ -120,7 +120,7 @@ Create not included in menu subcategory addSubcategory - default_category + default_category Subcategory%isolation% Subcategory%isolation% Yes @@ -132,7 +132,7 @@ MAGETWO-12513: Create Category from Category page with Required Fields Only addSubcategory - default_category + default_category Subcategory%isolation% Yes Yes @@ -144,11 +144,11 @@ MAGETWO-16351: Assign Products at the Category Level addSubcategory - default_category + default_category Subcategory%isolation% Yes Yes - catalogProductSimple::default, configurableProduct::default, bundleProduct::bundle_fixed_product + catalogProductSimple::default, configurableProduct::default, bundleProduct::bundle_fixed_product test_type:acceptance_test 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 6e1a9b50d3b46..391a0df0752ac 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 @@ - root_category + root_category - root_subcategory + root_subcategory 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 ed7e2cdbd4394..438c23775e13d 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 @@ - default_category + default_category Name%isolation% Yes UrlKey%isolation% @@ -23,7 +23,7 @@ - default_category + default_category Name%isolation% Yes UrlKey%isolation% @@ -40,7 +40,7 @@ - default_category + default_category Name%isolation% No 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 ed44c17d572bd..6b6b889a17281 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 @@ protected function createProducts($products) { $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 a99ac0e951376..902e241e6e480 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 @@ protected function createProducts($products) $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 364854e6870bb..7983610bd3319 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 @@ Simple Product description %isolation% 50 657 - drop_down_with_one_option_fixed_price - drop_down_with_one_option_fixed_price - drop_down_with_one_option_fixed_price + drop_down_with_one_option_fixed_price + simple_drop_down_with_one_option_fixed_price + drop_down_with_one_option_fixed_price @@ -36,9 +36,9 @@ Simple Product description %isolation% 51 658 - drop_down_with_one_option_percent_price - drop_down_with_one_option_percent_price - drop_down_with_one_option_percent_price + drop_down_with_one_option_percent_price + simple_drop_down_with_one_option_percent_price + drop_down_with_one_option_percent_price @@ -56,9 +56,9 @@ Simple Product description %isolation% 52 659 - drop_down_with_one_option_fixed_price - drop_down_with_one_option_fixed_price - MAGETWO-23029 + drop_down_with_one_option_fixed_price + simple_drop_down_with_one_option_fixed_price + MAGETWO-23029 @@ -76,9 +76,9 @@ Simple Product description %isolation% 53 660 - drop_down_with_one_option_percent_price - drop_down_with_one_option_percent_price - MAGETWO-23030 + drop_down_with_one_option_percent_price + simple_drop_down_with_one_option_percent_price + MAGETWO-23030 @@ -95,10 +95,10 @@ Simple Product description %isolation% 54 661 - drop_down_with_one_option_percent_price - drop_down_with_one_option_percent_price - MAGETWO-23030 - MAGETWO-23055 + drop_down_with_one_option_percent_price + simple_drop_down_with_one_option_percent_price + MAGETWO-23030 + not_logged_in_90 @@ -115,10 +115,10 @@ Simple Product description %isolation% 55 662 - drop_down_with_one_option_fixed_price - drop_down_with_one_option_fixed_price - MAGETWO-23029 - MAGETWO-23055 + drop_down_with_one_option_fixed_price + simple_drop_down_with_one_option_fixed_price + MAGETWO-23029 + not_logged_in_90 @@ -135,10 +135,10 @@ Simple Product description %isolation% 56 663 - drop_down_with_one_option_percent_price - drop_down_with_one_option_percent_price - MAGETWO-23030 - MAGETWO-23002 + drop_down_with_one_option_percent_price + simple_drop_down_with_one_option_percent_price + MAGETWO-23030 + MAGETWO-23002 @@ -155,10 +155,10 @@ Simple Product description %isolation% 57 664 - drop_down_with_one_option_fixed_price - drop_down_with_one_option_fixed_price - MAGETWO-23029 - MAGETWO-23002 + drop_down_with_one_option_fixed_price + simple_drop_down_with_one_option_fixed_price + MAGETWO-23029 + MAGETWO-23002 @@ -261,13 +261,13 @@ simple-product-%isolation% Simple Product %isolation% simple_sku_%isolation% - taxable_goods + taxable_goods 10014 Simple Product short_description %isolation% Simple Product description %isolation% 64 141 - default + not_logged_in_20 @@ -281,7 +281,7 @@ simple-product-%isolation% Simple Product %isolation% simple_sku_%isolation% - taxable_goods + taxable_goods 10015 Simple Product short_description %isolation% Simple Product description %isolation% @@ -300,13 +300,13 @@ simple-product-%isolation% Simple Product %isolation% simple_sku_%isolation% - None + None 10016 Simple Product short_description %isolation% Simple Product description %isolation% 66 143 - default + default @@ -325,8 +325,8 @@ Simple Product description %isolation% 67 144 - options-suite - options-suite + options_suite + simple_options_suite catalogProductSimple::with_two_custom_option,catalogProductSimple::with_all_custom_option @@ -337,7 +337,7 @@ - Create product with cross-sell products + MAGETWO-29081: Create product with cross-sell products simple-product-%isolation% Simple Product %isolation% simple_sku_%isolation% @@ -347,14 +347,14 @@ 59 75 In Stock - catalogProductSimple::default, configurableProduct::default + catalogProductSimple::default, configurableProduct::default - Create product with up-sell products + MAGETWO-29105: Create product with up-sell products simple-product-%isolation% Simple Product %isolation% simple_sku_%isolation% @@ -364,14 +364,14 @@ 59 75 In Stock - catalogProductSimple::default, configurableProduct::default + catalogProductSimple::default, configurableProduct::default - Create product with related products + MAGETWO-29352: Create product with related products simple-product-%isolation% Simple Product %isolation% simple_sku_%isolation% @@ -381,7 +381,7 @@ 59 75 In Stock - catalogProductSimple::default, configurableProduct::default + catalogProductSimple::default, configurableProduct::default @@ -404,7 +404,7 @@ MAGETWO-13345: Create Simple Product with Creating New Category (Required Fields Only) yes - default_subcategory + default_subcategory simple%isolation% simple%isolation% simple%isolation% @@ -418,7 +418,7 @@ simple-product-%isolation% Simple Product %isolation% simple_sku_%isolation% - taxable_goods + taxable_goods 10 1 1000 @@ -433,12 +433,12 @@ simple-product-%isolation% Simple Product %isolation% simple_sku_%isolation% - taxable_goods + taxable_goods 10 1 1000 In Stock - drop_down_with_one_option_fixed_price + drop_down_with_one_option_fixed_price test_type:acceptance_test 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 25aaa878701d8..f7123e3638125 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 @@ VirtualProduct %isolation% virtual_sku_%isolation% 10 - - - - Yes - - - - - - - - - - - - - - - - - - @@ -34,17 +23,13 @@ VirtualProduct %isolation% virtual_sku_%isolation% 10 - None + None 999 Yes category_%isolation% - - - - - MAGETWO-23002 + MAGETWO-23002 Yes In Stock - - - - Catalog, Search @@ -55,19 +40,12 @@ Create product with out of stock virtual-product-%isolation% VirtualProduct %isolation% - - 10 - taxable_goods + taxable_goods 999 Yes - - - - - MAGETWO-23030 - - - - + MAGETWO-23030 Out of Stock - - - - Search @@ -80,17 +58,9 @@ VirtualProduct %isolation% virtual_sku_%isolation% 10 - - - - Yes category_%isolation% - MAGETWO-23055 - - - - - - - - - - - - + not_logged_in_90 Catalog @@ -102,18 +72,10 @@ VirtualProduct %isolation% virtual_sku_%isolation% 9000 - - - - Yes - - - MAGETWO-23055 - - - - - - - - - options-suite + not_logged_in_90 + options_suite catalogProductSimple::with_two_custom_option,catalogProductSimple::with_all_custom_option - - @@ -126,18 +88,11 @@ VirtualProduct %isolation% virtual_sku_%isolation% 10 - - 999 Yes - - - - - MAGETWO-23030 - - + MAGETWO-23030 No In Stock - - - - - - @@ -149,18 +104,10 @@ VirtualProduct %isolation% virtual_sku_%isolation% 9000 - - 999 Yes - - - - - - - default - - + default Out of Stock - - - - - - @@ -172,18 +119,8 @@ VirtualProduct %isolation% virtual_sku_%isolation% 10 - - - - Yes category_%isolation% - - - - - - - - - - - - - - - - test_type:acceptance_test 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 d9e73e456e618..bfa4e2cc5e2ab 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 @@ public function test($productType) */ 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 b00facf21e2b5..f51dde987341e 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 @@ product_flat - simple_10_dollar + simple_10_dollar 1.99 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 57d87b3147d82..c3ed264e72fc9 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 @@ 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 1cdff9dbf0ed1..051bbfc08d499 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 @@ * 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 @@ public function test($createProduct, $product) // 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 d856f2bdd684a..4904d72775c5c 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 @@ * 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 @@ public function __inject( 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 4dde51eae09a3..e9f21fa39a028 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 @@ Update visibility to Catalog, Search - product_with_category + product_with_category Test simple product %isolation% test_simple_product_%isolation% 245.00 @@ -25,7 +25,7 @@ Update visibility to Not Visible Individually - product_with_category + product_with_category Test simple product %isolation% test_simple_product_%isolation% 325.00 @@ -39,7 +39,7 @@ Update visibility to Catalog - product_with_category + product_with_category Test simple product %isolation% test_simple_product_%isolation% 325.01 @@ -56,7 +56,7 @@ Update visibility to Search - product_with_category + product_with_category Test simple product %isolation% test_simple_product_%isolation% 325.02 @@ -73,7 +73,7 @@ Update stock to Out of Stock - product_with_category + product_with_category Test simple product %isolation% test_simple_product_%isolation% 325.03 @@ -90,7 +90,7 @@ Update product status to offline - product_with_category + product_with_category Test simple product %isolation% test_simple_product_%isolation% 74.00 @@ -104,8 +104,8 @@ Update category - product_with_category - default + product_with_category + default Test simple product %isolation% test_simple_product_%isolation% 74.00 @@ -119,8 +119,8 @@ MAGETWO-12428: Edit Simple Product - product_with_category - default + product_with_category + default Test simple product %isolation% test_simple_product_%isolation% 133.00 @@ -130,8 +130,8 @@ MAGETWO-12417: Unassign Products from the Category - product_with_category - - + product_with_category + - test_type:acceptance_test @@ -139,12 +139,11 @@ Edit product with enabled flat product_flat - simple_10_dollar + simple_10_dollar Simple Product %isolation% sku_simple_product_%isolation% 1.99 - - - default + default 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 0868765d7b590..e45992c85e609 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 @@ public function __inject( $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 d6607d67fd40b..8ea588e36a329 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 @@ VirtualProduct %isolation% virtual_sku_%isolation% 99.99 - None + None 999 Yes - default_subcategory - MAGETWO-23002 + default_subcategory + MAGETWO-23002 In Stock Catalog virtual-product-%isolation% @@ -32,7 +32,7 @@ virtual_product_%isolation% virtual_sku_%isolation% 120.00 - taxable_goods + taxable_goods 999 Yes 45 @@ -52,11 +52,11 @@ VirtualProduct %isolation% virtual_sku_%isolation% 185.00 - None + None 999 Yes - default_subcategory - MAGETWO-23002 + default_subcategory + MAGETWO-23002 Out of Stock Catalog, Search virtual-product-%isolation% @@ -73,7 +73,7 @@ virtual_product_%isolation% virtual_sku_%isolation% 99.99 - taxable_goods + taxable_goods Yes Out of Stock Search @@ -89,7 +89,7 @@ VirtualProduct %isolation% virtual_sku_%isolation% 5.00 - None + None Yes Out of Stock Catalog @@ -105,12 +105,12 @@ virtual_product_%isolation% virtual_sku_%isolation% 145.00 - taxable_goods + taxable_goods 999 Yes - default_subcategory - MAGETWO-23055 - MAGETWO-23002 + default_subcategory + not_logged_in_90 + MAGETWO-23002 In Stock Catalog, Search virtual-product-%isolation% @@ -127,9 +127,9 @@ VirtualProduct %isolation% virtual_sku_%isolation% 99.99 - None + None Yes - default_subcategory + default_subcategory 45 Out of Stock Catalog, Search @@ -145,9 +145,9 @@ virtual_product_%isolation% virtual_sku_%isolation% 5.00 - taxable_goods + taxable_goods Yes - MAGETWO-23055 + not_logged_in_90 Out of Stock Search virtual-product-%isolation% @@ -162,12 +162,12 @@ VirtualProduct %isolation% virtual_sku_%isolation% 120.00 - None + None 999 Yes - default_subcategory + default_subcategory In Stock - options-suite + options_suite Search virtual-product-%isolation% @@ -182,9 +182,9 @@ VirtualProduct %isolation% virtual_sku_%isolation% 99.99 - taxable_goods + taxable_goods Yes - MAGETWO-23055 + not_logged_in_90 Out of Stock Catalog, Search virtual-product-%isolation% @@ -199,12 +199,12 @@ VirtualProduct %isolation% virtual_sku_%isolation% 99.99 - None + None 999 Yes - default_subcategory - MAGETWO-23055 - MAGETWO-23002 + default_subcategory + not_logged_in_90 + MAGETWO-23002 In Stock Catalog virtual-product-%isolation% 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 320e99b58a4df..9b091cb1c393d 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 @@ ProductTemplate%isolation% - default + default 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 396d177f80c0f..d52ffac221086 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 @@ public function __prepare(FixtureFactory $fixtureFactory) { $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 0236f7716289e..3f454e6d213b0 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 @@ Dropdown_Admin_%isolation% Dropdown - two_options + two_options No attr_dropdown_%isolation% Global 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 cd482fba45140..00014f1017d69 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 @@ - custom_attribute_set + custom_attribute_set Text_Field_Admin_%isolation% Text Field No @@ -19,7 +19,7 @@ - custom_attribute_set + custom_attribute_set Text_Field_Admin_%isolation% Text Area Yes @@ -41,7 +41,7 @@ - custom_attribute_set + custom_attribute_set Date_Admin_%isolation% Date No @@ -62,7 +62,7 @@ - custom_attribute_set + custom_attribute_set Yes/No_Admin_%isolation% Yes/No Yes @@ -75,10 +75,10 @@ - custom_attribute_set + custom_attribute_set Multiple_Select_Admin_%isolation% Multiple Select - default + default No attr_multiselect_%isolation% Website @@ -103,10 +103,10 @@ - custom_attribute_set + custom_attribute_set Dropdown_Admin_%isolation% Dropdown - default + default Yes attr_dropdown_%isolation% Global @@ -136,7 +136,7 @@ - custom_attribute_set + custom_attribute_set Price_Admin_%isolation% Price No @@ -158,7 +158,7 @@ - custom_attribute_set + custom_attribute_set Fixed_Product_Tax_Admin_%isolation% Fixed Product Tax attr_fpt_code_%isolation% @@ -168,7 +168,7 @@ - custom_attribute_set + custom_attribute_set Text_Field_Admin_%isolation% Text Field Yes 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 72778bf65334c..fefb8ecd118c1 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 @@ - custom_attribute_set - attribute_type_dropdown + custom_attribute_set + attribute_type_dropdown - default - attribute_type_text_field + default + attribute_type_text_field 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 0ecf8bb12952d..4eb5df71d91d4 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 @@ public function test(FixtureFactory $fixtureFactory, CatalogAttributeSet $produc $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 9d56a856c52f4..ede699f625cb9 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 @@ - custom_attribute_set - default - default + custom_attribute_set + default + default 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 fcd45cbf6b0fa..a2fca7dd7787a 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 @@ - attribute_type_text_field + attribute_type_text_field - attribute_type_dropdown + attribute_type_dropdown 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 0c7d65d6cd0aa..541aa92913346 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 @@ - one_variation + one_variation 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 7597b2416ba02..4264283d45b38 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 @@ ProductTemplateEdit1%isolation% Custom-group%isolation% - custom_attribute_set - attribute_type_text_field + custom_attribute_set + attribute_type_text_field 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 b9e8ed962b3f0..8429c349f0cfe 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\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 0e74dfb542a73..c3bc9c6a2c27d 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 @@ - custom_attribute_set - attribute_type_text_field + custom_attribute_set + attribute_type_text_field Text_Field_%isolation% Yes Global @@ -28,10 +28,10 @@ - custom_attribute_set - attribute_type_dropdown + custom_attribute_set + attribute_type_dropdown Dropdown_%isolation% - default + default Yes Global Yes 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 e7b7313d2e542..e022906b29b18 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 @@ public function run() $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 28bc0fc4eb206..6b4fd6f1054bb 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 @@ class CreateProductStep implements TestStepInterface { /** - * Product fixture from dataSet. + * Product fixture from dataset. * * @var string */ @@ -49,9 +49,9 @@ public function __construct(FixtureFactory $fixtureFactory, $product) */ 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 74adfb27e1075..5141fe99e5080 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 @@ public function run() 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 045029bca59a3..7e425f21585dc 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 @@ public function processAssert( $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 f76cebd5e059c..1c025f00d6eb5 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 @@ */ --> - - - CatalogPriceRule %isolation% - Catalog Price Rule Description - Active - - Main Website - - - NOT LOGGED IN - - Apply as percentage of original - 50 - - - CatalogPriceRule %isolation% - - - Catalog Price Rule Description - - - Active - - - - Main Website - - - - - NOT LOGGED IN - - - - - - - - - - Apply as percentage of original - - - 50 - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + 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 1991317d9d1aa..ae748f108af44 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 @@ --> + + CatalogPriceRule %isolation% + Catalog Price Rule Description + Active + + Main Website + + + NOT LOGGED IN + + By Percentage of the Original Price + 50 + + Active Catalog Rule Rule Description 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 1ef4e30a3e542..f58522829371e 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 @@ * 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 @@ public function testApplySeveralCatalogPriceRules(array $catalogRulesOriginal) } $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 e09819c8e64a3..d9d68e5bc3cc0 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 @@ public function testCreate( $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 a4124b74a0273..1938d790f9068 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 @@ MAGETWO-12908: Apply Catalog Price Rules to Specific Customer Group. - customer_with_new_customer_group + customer_with_new_customer_group simple_10_dollar rule_name%isolation% Active 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 f986ef83a139d..1567fcd1819a8 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 @@ - active_catalog_price_rule_with_conditions + active_catalog_price_rule_with_conditions 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 fd30614dd24ab..a7ee832dbdbd0 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 @@ * 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 @@ public function testUpdateCatalogPriceRule( //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 9f1e3a665ff22..a89cc50030055 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 @@ - active_catalog_price_rule_with_conditions + active_catalog_price_rule_with_conditions New Catalog Price Rule Name %isolation% Inactive save @@ -19,7 +19,7 @@ - active_catalog_price_rule_with_conditions + active_catalog_price_rule_with_conditions New Catalog Price Rule Name %isolation% New Catalog Price Rule Description %isolation% Active 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 82215f4f64f24..12412122501f2 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 @@ public function run() 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 940729a21995e..348fd35048e3a 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 @@ */ --> - - - - - - - - - 0 - - - 0 - - - - - - - - - 0 - - - - - - - - - 0 - - - - - + + + + + + + + + + + + + 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 b2bf945cc675c..17b03aa1501a1 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 @@ * 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 @@ public function __construct(FixtureFactory $fixtureFactory, array $params, array $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 @@ public function __construct(FixtureFactory $fixtureFactory, array $params, array } } - /** - * 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 2bd73f161a802..740497bffb148 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 @@ public function __prepare(FixtureFactory $fixtureFactory) /** @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 d9306dd78afd0..204b9a57eb15c 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 @@ - abc_dfj abc_dfj - - - - - - - - test_type:acceptance_test @@ -25,11 +21,6 @@ - Yes adc_123 - - - - - - - - - - @@ -37,94 +28,55 @@ Yes - abc - - - - - - - - - - Search product in advanced search by sku Yes - - - abc_dfj - - - - - - - - Search product in advanced search by partial sku Yes - - - abc - - - - - - - - Search product in advanced search by partial sku and description Yes - - - abc adc_full - - - - - - Search product in advanced search by description - Yes - - - - dfj_full - - - - - - Search product in advanced search by short description - - - - - - - - dfj_short - - - - Search product in advanced search by partial short description Yes - - - - - - - abc_short - - - - Search product in advanced search by price to Yes Yes - - - - - - - - - - 100 @@ -132,10 +84,6 @@ Search product in advanced search by price from and price to Yes - - - - - - - - - 50 50 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 bab6e86c1809b..fe84b326dd4ba 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 @@ - default + default 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 4f35edd4150c5..393a9cdc0143c 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 @@ public function test($searchTerms, FixtureFactory $fixtureFactory) $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 458c7c1e57982..9e5cd000b1aa4 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 @@ 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 fe9ac8f85cfa3..0d6181f26ec84 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 @@ public function getPriceInclTax() : 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 @@ public function getQty() */ 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 @@ public function getSubtotalPrice() */ 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 edc468d49224b..e25da69fdefb6 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 @@ */ 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 @@ public function getGrandTotal() */ 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 @@ public function getItemPriceExclTax($productName) */ 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 @@ public function getItemPriceInclTax($productName) */ 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 @@ public function getItemSubExclTax($productName) */ 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 @@ public function getGrandTotalInclTax() /** * 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 @@ public function getShippingInclTax() */ 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 1d21f0613d44a..8ac7389621c01 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 @@ public function selectPaymentMethod(array $payment, CreditCard $creditCard = nul 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 @@ public function getSelectedPaymentMethodBlock() ['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 f4d12c6d12531..67f6ee002ec4b 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 e83f70cc78018..f9cd65e098272 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. */ --> - - - - - - - 0 - - - CURRENT_TIMESTAMP - - - 0000-00-00 00:00:00 - - - - - - 1 - - - 0 - - - 0 - - - - 0 - - - 0.0000 - - - 0 - - - 0.0000 - - - 0.0000 - - - - - - - - - - - - 0.0000 - - - 0.0000 - - - - - - 0 - - - 0 - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - - - - - - 0 - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 6ca6c12cc218c..acca29590a3f2 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 @@ public function __construct(array $params, array $data = []) } /** - * Get module name from fixture + * Get module name from fixture. * * @param FixtureInterface $product * @return string @@ -70,40 +56,7 @@ protected function getModuleName(FixtureInterface $product) } /** - * 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 8bfa4789d0ef3..cca404d1fa94f 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\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 a03da15b27b82..839994f8a917e 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 @@ downloadableProduct::with_two_separately_links - 46 - Bug: MAGETWO-24195 + 22.43 @@ -73,8 +72,7 @@ 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 - 3249 - Bug: MAGETWO-24195 + 2510 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 b3ae8fdbd934e..a586805619624 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\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 165315f753cb3..d9e8f0c865b2a 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 @@ */ --> - - - delete Simple - catalogProductSimple::default, catalogProductVirtual::default - 0 - - - - - delete Simple - catalogProductSimple::default - 0 - - - + + + delete Simple + catalogProductSimple::default, catalogProductVirtual::default + 0 + + + + + delete Simple + catalogProductSimple::default + 0 + + + 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 f5d30d2f9bdc2..01385567492ce 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\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 20f26723f598d..49792e12b0ee7 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 @@ */ --> - - - Update Simple - catalogProductSimple::with_two_custom_option - forUpdateMiniShoppingCart - - - - - Update Configurable and verify previous product was updated to new one in shopping cart and mini shopping cart - configurableProduct::default - forUpdateMiniShoppingCart - - - - - - - Update Bundle and verify previous product was updated to new one in shopping cart and mini shopping cart - bundleProduct::bundle_fixed_product - forUpdateMiniShoppingCart - - - - - - - Update Downloadable and check previous link was updated to new one in shopping cart and mini shopping cart - downloadableProduct::with_two_separately_links - forUpdateMiniShoppingCart - Bug: MAGETWO-24195 - - - - - - + + + Update Simple + catalogProductSimple::with_two_custom_option + simple_update_mini_shopping_cart + + + + + Update Configurable and verify previous product was updated to new one in shopping cart and mini shopping cart + configurableProduct::default + configurable_update_mini_shopping_cart + + + + + + + Update Bundle and verify previous product was updated to new one in shopping cart and mini shopping cart + bundleProduct::bundle_fixed_product + bundle_update_mini_shopping_cart + + + + + + + Update Downloadable and check previous link was updated to new one in shopping cart and mini shopping cart + downloadableProduct::with_two_separately_links + downloadable_update_mini_shopping_cart + + + + + + 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 3796dbef8a544..71424d79dff0b 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 @@ - default + default 100 3 100 @@ -19,7 +19,7 @@ - with_two_custom_option + with_two_custom_option 50 11 65 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 c2f88960e6d74..74bc1bcb31d1f 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 @@ public function processAssert( ); $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 64c35824418c1..da394ef9e49f7 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 @@ public function processAssert( ); $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 38be9a5f0cceb..c9cee02f75d3e 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 @@ public function processAssert( $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 d1f5018824ca4..d33227c98e187 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"> - - DefaultName%isolation% - Enabled - Text - - default - - test_checkbox%isolation% - TestMessage%isolation% - - - - - - DefaultName%isolation% - - - TestMessage%isolation% - - - - - - test_checkbox%isolation% - - - Enabled - - - Text - - - - - default - - - + + + + + + + + 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 38b0fb89d8ad4..7a95323ef6e14 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 @@ public function __construct(FixtureFactory $fixtureFactory, array $data, array $ } /** - * 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 a320ff995cd67..d709248ee26e1 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 @@ --> + + DefaultName%isolation% + Enabled + Text + + default + + test_checkbox%isolation% + TestMessage%isolation% + + TermDisabledTextName%isolation% Disabled Text - + default @@ -26,7 +37,7 @@ Disabled HTML - + default @@ -40,7 +51,7 @@ Enabled Text - + default 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 c0abdce3aeda4..7d699f287fdde 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 @@ * 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 d82cb340f1cb2..4779c05af5cde 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 @@ name%isolation% Enabled Text - default + default test_checkbox%isolation% TestMessage%isolation% Flat Rate @@ -29,7 +29,7 @@ name%isolation% Enabled HTML - default + default test_checkbox%isolation% <html> Flat Rate @@ -45,7 +45,7 @@ name%isolation% Enabled Text - default + default test_checkbox%isolation% TestMessage%isolation% Flat Rate @@ -61,7 +61,7 @@ name%isolation% Disabled Text - default + default test_checkbox%isolation% TestMessage%isolation% Flat Rate @@ -77,7 +77,7 @@ name%isolation% Enabled Text - default + default test_checkbox%isolation% TestMessage%isolation% Flat Rate 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 3b20d91b19db8..f866638018411 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 @@ /** * 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 7fb6d83370663..e13ce03265cb5 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 @@ catalogProductSimple::default - term_enabled_text + term_enabled_text Flat Rate Fixed checkmo 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 50ef121fc1937..eba27746e7e3d 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 @@ /** * 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 c293d7996e2a3..e1818c9838943 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 @@ catalogProductSimple::default - term_disabled_text + term_disabled_text name%isolation% Enabled HTML - default + default test_checkbox%isolation% TestMessage%isolation% Flat Rate @@ -25,11 +25,11 @@ catalogProductSimple::default - term_disabled_html + term_disabled_html name%isolation% Enabled Text - default + default test_checkbox%isolation% <html> Flat Rate @@ -41,11 +41,11 @@ catalogProductSimple::default - term_enabled_text + term_enabled_text name%isolation% Disabled HTML - default + default test_checkbox%isolation% TestMessage%isolation% Flat Rate 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 fd83e30ebbeb7..a10d58ffa2dfe 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 @@ public function fillFormTab(array $fields, SimpleElement $element = null) 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 96eeb2aa0d04f..81f15956479ed 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 @@ public function processAssert( $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 2cc8650a1f924..4554fe161d4e9 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 @@ public function processAssert( $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 2f8203b640e6c..4f96145bc6a34 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 @@ public function processAssert( '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 746165d67c89a..71e66d0998b0d 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 @@ */ --> - - - block_%isolation% - identifier_%isolation% - - All Store Views - - Enabled - description_%isolation% - - - - - - block_%isolation% - - - identifier_%isolation% - - - description_%isolation% - - - - - - - - - Enabled - - - - - All Store Views - - - + + + + + + + + + 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 4622537127e7f..2cd890cb55555 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 @@ public function __construct(FixtureFactory $fixtureFactory, array $params, array } } - /** - * 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 @@ public function getStores() { 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 071897f0c5b13..7cf7c822cf2b9 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 @@ */ --> - - - CMS Page%isolation% - identifier%isolation% - All Store Views - Enabled - - description_%isolation% - - - - - - - - - - Enabled - - - - - - - - - - - - identifier%isolation% - - - - - - - Text %isolation% - - - - - - - - - - 0 - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - 1 - - - All Store Views - + + 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 fc3d5f72bf9c2..0ce3f511d5732 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 @@ public function __construct(FixtureFactory $fixtureFactory, array $params, array 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 @@ protected function createCategory($widget) /** @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 @@ protected function createCategory($widget) */ 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 @@ protected function createBlock($widget) 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 81f9f676fe986..3c025006873c9 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 @@ block_%isolation% identifier_%isolation% - - All Store Views + + all_store_views Enabled 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 0000000000000..c0ba39affa9c1 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Repository/CmsPage/Content.xml @@ -0,0 +1,78 @@ + + + + + + + CMS Page Link + CMS Page Link anchor_text_%isolation% + CMS Page Link anchor_title_%isolation% + CMS Page Link Block Template + + home + + + + + + + CMS Page Link + CMS Page Link anchor_text_%isolation% + CMS Page Link anchor_title_%isolation% + CMS Page Link Block Template + + home + + + + CMS Static Block + CMS Static Block Default Template + + cmsBlock + + + + Catalog Category Link + Catalog Category Link anchor_text_%isolation% + Catalog Category Link anchor_title_%isolation% + Category Link Block Template + + default_subcategory + + + + Catalog New Products List + All products + Yes + 10 + New Products Grid Template + 86400 + + + Catalog Product Link + Catalog Product Link anchor_text_%isolation% + Catalog Product Link anchor_title_%isolation% + Product Link Block Template + + product_with_category + product_with_category + + + + Recently Compared Products + 10 + Compared Products Grid Template + + + Recently Viewed Products + 10 + Viewed Products Grid Template + + + + 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 a6fb5bb045260..3527279c5c98d 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 @@ block_%isolation% identifier_%isolation% - All Store Views + All Store Views Enabled description_%isolation% @@ -20,7 +20,7 @@ block_%isolation% identifier_%isolation% - default + default Disabled description_%isolation% 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 a549ca390d668..fd63c140b0c91 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 @@ NewCmsPage%isolation% Main Website/Main Website Store/Default Store View cms_page_text_content%isolation% - default + default General Contact Name 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 78dd465ad2b65..b317224b3c164 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 @@ - default + default 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 86128fd3a6411..9ff1187200f24 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 @@ - cms_default_no_redirect + cms_default_no_redirect - cms_default_permanent_redirect + cms_default_permanent_redirect - cms_default_temporary_redirect + cms_default_temporary_redirect 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 048ff19fc06e9..1aa116123698a 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 @@ block_updated_%isolation% identifier_updated_%isolation% - All Store Views + all_store_views Enabled description_updated_%isolation% @@ -20,7 +20,7 @@ block_updated_%isolation% identifier_updated_%isolation% - default + default Disabled description_updated_%isolation% 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 ebf6cc9116491..f03d64ae76aeb 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 @@ - cms_default_no_redirect + cms_default_no_redirect Main Website/Main Website Store/%default% request_path%isolation% No @@ -17,7 +17,7 @@ - cms_default_temporary_redirect + cms_default_temporary_redirect Main Website/Main Website Store/Default Store View request_path%isolation%.html Temporary (302) @@ -26,7 +26,7 @@ - cms_default_permanent_redirect + cms_default_permanent_redirect Main Website/Main Website Store/Default Store View request_path%isolation%.htm Permanent (301) 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 564a0942002ee..d3f1fd8c407b0 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"> - - - - - default - - - 0 - - - general - - - - + + + + + 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 81cd63e33bc18..4922dba6247df 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 @@ public function run() $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 8ecdc5aa867ac..49957a1509f63 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 @@ public function fillVariations(array $matrix) } } + /** + * 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 1e6169606f5e1..546fdedabdd48 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\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 @@ public function __construct(FixtureInterface $product) $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 @@ public function __construct(FixtureInterface $product) : $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 6eb5ee6976ace..64d4c230aaf72 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 @@ */ --> - - - Configurable Product %isolation% - sku_configurable_product_%isolation% - configurable - configurable-product-%isolation% - - default - - - Main Website - - - 100.00 - - 1 - - In Stock - - - default - - - - configurable - - configurable - 4 - - product - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - No - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Configurable Product %isolation% - - - - - - - - - - - - - - - - - - - 100 - - - - - In Stock - - - - - - - - - - sku_configurable_product_%isolation% - - - - - - - - - - - - - - - - - - Product online - - - Taxable Goods - - - - - - - - - - - - - - - configurable-product-%isolation% - - - - - - Catalog, Search - - - 1 - - - - - configurable - - - - default - - - - - - - - default - - - - - Main Website - - - - - - - + + + configurable + + configurable + 4 + + product + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 74df30ef1f8aa..0000000000000 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProduct/CheckoutData.php +++ /dev/null @@ -1,219 +0,0 @@ - [ - '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 d8f80f360ac9a..79ed15ba3836a 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 @@ public function __construct(FixtureFactory $fixtureFactory, array $data, array $ } /** - * 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 @@ protected function prepareAttributes(array $data) } /** - * Prepare attributes data + * Prepare attributes data. * * @param array $data * @return void @@ -877,14 +137,14 @@ protected function prepareAttributesData(array $data) } /** - * 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 @@ protected function prepareProducts(array $data) 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 @@ protected function prepareProducts(array $data) $product = $this->fixtureFactory->createByCode( $fixture, [ - 'dataSet' => $dataSet, + 'dataset' => $dataset, 'data' => array_merge($attributeSetData, $attributeData, $stock) ] ); @@ -923,7 +183,7 @@ protected function prepareProducts(array $data) } /** - * Create attribute set + * Create attribute set. * * @return FixtureInterface */ @@ -932,7 +192,7 @@ protected function createAttributeSet() $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 @@ protected function createAttributeSet() } /** - * Get prepared attribute data for persist product + * Get prepared attribute data for persist product. * * @param string $key * @return array @@ -968,7 +228,7 @@ protected function getProductAttributeData($key) } /** - * 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 @@ protected function getAttributeOptionId($compositeKey) } /** - * Prepare data for matrix + * Prepare data for matrix. * * @param array $data * @return void @@ -1037,7 +297,7 @@ protected function prepareVariationsMatrix(array $data) } /** - * Add matrix variation + * Add matrix variation. * * @param array $variationsMatrix * @param array $attribute @@ -1079,7 +339,7 @@ protected function addVariationMatrix(array $variationsMatrix, array $attribute, } /** - * Prepare data from source + * Prepare data from source. * * @return void */ @@ -1134,28 +394,7 @@ protected function prepareData() } /** - * 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 @@ public function getAttributesData() } /** - * Get prepared variations matrix + * Get prepared variations matrix. * * @return array */ @@ -1175,7 +414,7 @@ public function getVariationsMatrix() } /** - * Get prepared attributes + * Get prepared attributes. * * @return array */ @@ -1185,7 +424,7 @@ public function getAttributes() } /** - * Get prepared products + * Get prepared products. * * @return array */ @@ -1193,15 +432,4 @@ public function getProducts() { 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 fa36f1aef661a..d2a23302b7cb1 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 @@ Product online Catalog, Search - taxable_goods + taxable_goods configurable-product-%isolation% - default + default In Stock @@ -30,10 +30,10 @@ Main Website - default + default - default + configurable_default @@ -48,11 +48,11 @@ Product online Catalog, Search - taxable_goods + taxable_goods configurable-product-%isolation% - with_one_option + with_one_option In Stock @@ -61,10 +61,10 @@ Main Website - default + default - with_special_price + configurable_with_special_price @@ -78,11 +78,11 @@ Product online Catalog, Search - taxable_goods + taxable_goods configurable-product-%isolation% - size + size In Stock @@ -91,10 +91,10 @@ Main Website - default + default - default + configurable_default @@ -108,11 +108,11 @@ Product online Catalog, Search - taxable_goods + taxable_goods configurable-product-%isolation% - color_and_size + color_and_size In Stock @@ -121,10 +121,10 @@ Main Website - default + default - default + configurable_default @@ -138,11 +138,11 @@ Product online Catalog, Search - taxable_goods + taxable_goods test-configurable-product-%isolation% - one_variation + one_variation In Stock @@ -151,7 +151,7 @@ Main Website - default + default @@ -166,11 +166,11 @@ Product online Catalog, Search - taxable_goods + taxable_goods configurable-product-%isolation% - default + default In Stock @@ -179,10 +179,10 @@ Main Website - default + default - default + configurable_default @@ -196,11 +196,11 @@ Product online Catalog, Search - taxable_goods + taxable_goods configurable-product-%isolation% - with_one_option + with_one_option In Stock @@ -209,10 +209,10 @@ Main Website - default + default - with_one_option + configurable_one_option @@ -226,11 +226,11 @@ Product online Catalog, Search - taxable_goods + taxable_goods test-configurable-product-%isolation% - with_out_of_stock_item + with_out_of_stock_item In Stock @@ -239,7 +239,7 @@ Main Website - default + default @@ -251,7 +251,7 @@ 10 - taxable_goods + taxable_goods 1 @@ -259,19 +259,19 @@ In Stock - default_subcategory + default_subcategory Main Website - two_options_with_fixed_price + two_options_with_fixed_price - custom_attribute_set + custom_attribute_set - two_options_with_fixed_price + configurable_two_options_with_fixed_price @@ -283,20 +283,20 @@ 10 - taxable_goods + taxable_goods 1 Main Website - two_variations_with_fixed_price + two_variations_with_fixed_price - custom_attribute_set + custom_attribute_set - two_options_by_one_dollar + two_options_by_one_dollar @@ -310,11 +310,11 @@ Product online Catalog, Search - taxable_goods + taxable_goods configurable-product-%isolation% - filterable_two_options_with_zero_price + filterable_two_options_with_zero_price 1 @@ -324,7 +324,7 @@ Main Website - custom_attribute_set + custom_attribute_set @@ -336,7 +336,7 @@ 10 - taxable_goods + taxable_goods 1 @@ -344,19 +344,19 @@ In Stock - default_subcategory + default_subcategory Main Website - two_options_by_one_dollar + two_options_by_one_dollar - custom_attribute_set + custom_attribute_set - two_options_by_one_dollar + two_options_by_one_dollar 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 0000000000000..350ae10b384d1 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProduct/CheckoutData.xml @@ -0,0 +1,209 @@ + + + + + + + + + attribute_key_0 + option_key_0 + + + attribute_key_1 + option_key_1 + + + + 3 + + 172 + 3 + 516 + + + + + + + + attribute_key_0 + option_key_1 + + + attribute_key_1 + option_key_0 + + + + 1 + + 172 + 1 + 172 + + + + + + + + attribute_key_0 + option_key_0 + + + + + 101 + + + + + + + + attribute_key_0 + option_key_1 + + + + + 102 + + + + + + + + attribute_key_0 + option_key_0 + + + attribute_key_1 + option_key_0 + + + + + 112 + + + + + + + + attribute_key_0 + option_key_0 + + + attribute_key_1 + option_key_0 + + + attribute_key_2 + option_key_0 + + + + + 112 + + + + + + + + attribute_key_0 + option_key_1 + + + + + 12 + + + + + + + + attribute_key_0 + option_key_0 + + + + 1 + + 10 + 1 + 10 + + + + + + + + attribute_key_0 + option_key_0 + + + + + 101 + + + + + + + + attribute_key_0 + option_key_0 + + + + 1 + + 11 + 1 + 11 + + + + + + + + attribute_key_0 + option_key_1 + + + + 1 + + + + + + + attribute_key_0 + option_key_0 + + + + 1 + + 11 + + + + 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 0000000000000..6c84fb72b0149 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProduct/ConfigurableAttributesData.xml @@ -0,0 +1,701 @@ + + + + + + + + + + 12.00 + Yes + No + + + 20.00 + Yes + No + + + 18.00 + Yes + No + + + + + + + 42.00 + Yes + No + + + 40.00 + Yes + No + + + 48.00 + Yes + No + + + + + + catalogProductAttribute::attribute_type_dropdown + catalogProductAttribute::attribute_type_dropdown + + + + + 10 + + 1 + + + + 10 + + 1 + + + + 10 + + 1 + + + + 10 + + 1 + + + + 10 + + 1 + + + + 10 + + 1 + + + + 10 + + 1 + + + + 10 + + 1 + + + + 10 + + 1 + + + + + + + + + + 12.00 + Yes + No + + + + + + catalogProductAttribute::attribute_type_dropdown_one_option + + + + Yes + + 10 + + 1 + + + + + + + + + + 1.00 + Yes + No + + + + + + catalogProductAttribute::attribute_type_dropdown_one_option + + + + Yes + + 10 + + 1 + + + + + + + + + + option_key_1_%isolation% + 1 + Yes + Yes + + + option_key_2_%isolation% + 2 + Yes + Yes + + + + + + catalogProductAttribute::attribute_type_dropdown_two_options + + + + Yes + + 10 + + 1 + + + Yes + + 20 + + 2 + + + + + + + + + + option_key_1_%isolation% + 0 + Yes + No + + + option_key_2_%isolation% + 0 + Yes + No + + + + + + catalogProductAttribute::filterable_dropdown_two_options + + + + Yes + + 10 + + 1 + + + Yes + + 20 + + 2 + + + + + + + + two_new_options_title_%isolation% + Dropdown + two_new_options_title_%isolation% + No + + + option_key_1_%isolation% + 1 + Yes + No + + + option_key_2_%isolation% + 2 + Yes + No + + + + + + + Yes + + 10 + + 1 + + + Yes + + 20 + + 2 + + + + + + + + two_searchable_options_%isolation% + Dropdown + two_searchable_options_%isolation% + No + Yes + Yes + Filterable (with results) + Yes + + + option_key_1_%isolation% + 1 + Yes + No + + + option_key_2_%isolation% + 2 + Yes + No + + + + + + + Yes + + 100 + + 1 + + + Yes + + 100 + + 2 + + + + + + + + + + option_key_1_%isolation% + 1 + Yes + No + + + + + + + + + + + + option_key_1_%isolation% + 1 + Yes + No + + + + + + catalogProductAttribute::attribute_type_dropdown_one_option + + + catalogProductSimple::out_of_stock + + + + + + + + + option_key_1_%isolation% + 1 + Yes + Yes + + + option_key_2_%isolation% + 2 + Yes + Yes + + + + + + catalogProductAttribute::attribute_type_dropdown_two_options + + + catalogProductSimple::default + catalogProductSimple::default + + + + Yes + + 10 + + 1 + + + Yes + + 20 + + 2 + + + + + + + + + + 0.00 + No + Yes + + + 0.00 + No + Yes + + + + + + + 5.00 + No + Yes + + + 10.00 + No + Yes + + + + + + catalogProductAttribute::color + catalogProductAttribute::size + + + + + 100 + + 1 + + + + 100 + + 1 + + + + 100 + + 1 + + + + 100 + + 1 + + + + + + + + + + 0.00 + Yes + No + + + 0.00 + Yes + No + + + + + + catalogProductAttribute::size + + + + + 10 + + 1 + + + + 10 + + 1 + + + + + + + + + + 1 + Yes + No + + + 2 + Yes + No + + + 3 + Yes + No + + + + + + catalogProductAttribute::attribute_type_dropdown + + + + + 10 + + 1 + + + + 10 + + 1 + + + + 10 + + 1 + + + + + + + + + + 12.00 + Yes + No + + + + + + catalogProductSimple::out_of_stock + + + catalogProductAttribute::attribute_type_dropdown_one_option + + + + + + + + + option_key_1_%isolation% + 11 + Yes + No + + + option_2_%isolation% + 12 + Yes + No + + + + + + catalogProductAttribute::attribute_type_dropdown_two_options + + + + Yes + + 100 + + 1 + + + Yes + + 200 + + 1 + + + + + + + + + + option_key_1_%isolation% + 1 + Yes + No + + + option_2_%isolation% + 1 + Yes + No + + + + + + catalogProductAttribute::attribute_type_dropdown_two_options + + + + Yes + + 100 + + 1 + + + Yes + + 200 + + 1 + + + + + + + + + + option_key_1_%isolation% + 1 + Yes + No + + + option_2_%isolation% + 2 + Yes + No + + + + + + catalogProductAttribute::attribute_type_dropdown_two_options + + + catalogProductSimple::product_without_category + catalogProductSimple::product_without_category + + + + Yes + + 100 + + 1 + + + Yes + + 200 + + 1 + + + + + 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 03a43acc66825..9aed12f1c9236 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 @@ * 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 c90775e494c64..224ebfc244f03 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. */ --> - + Create product with category and two new options configurable-product-%isolation% - two_new_options - two_new_options + two_new_options + configurable_two_options Configurable Product %isolation% configurable_sku_%isolation% 100 - default_subcategory + default_subcategory Configurable short description Configurable Product description %isolation% 2 @@ -35,8 +34,8 @@ Create product with two options configurable-product-%isolation% - two_options - two_options + two_options + configurable_two_options Configurable Product %isolation% configurable_sku_%isolation% 100 @@ -56,8 +55,8 @@ Create product with special price configurable-product-%isolation% - two_new_options - two_new_options_with_special_price + two_new_options + configurable_two_new_options_with_special_price Configurable Product %isolation% configurable_sku_%isolation% 100 @@ -80,8 +79,8 @@ Bug: MAGETWO-34791 Create product with assigned products to options configurable-product-%isolation% - two_options_with_assigned_product - two_options_with_assigned_product + two_options_with_assigned_product + configurable_two_options_with_assigned_product Configurable Product %isolation% configurable_sku_%isolation% 100 @@ -100,12 +99,12 @@ MAGETWO-12620: Create Configurable Product and Assign it to Category configurable-product-%isolation% - two_options_with_fixed_price + two_options_with_fixed_price Configurable Product %isolation% configurable_sku_%isolation% Taxable Goods 10 - default_subcategory + default_subcategory 1 custom_attribute_set_%isolation% @@ -115,11 +114,11 @@ MAGETWO-13361: Create Configurable Product with Creating New Category and New Attribute (Required Fields Only) - two_searchable_options + two_searchable_options Configurable Product %isolation% 100 no - default_subcategory + default_subcategory configurable-product-%isolation% custom_attribute_set_%isolation% test_type:acceptance_test 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 7aade5f419fff..63c8de2d3e43e 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 @@ * 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 02d24b92e564b..c093b465be30e 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 @@ addOptions configurableProduct::default configurable-product-%isolation% - one_new_options - two_attributes + one_new_options + configurable_two_attributes 153 Configurable Product %isolation% configurable_sku_%isolation% 99 - default_subcategory + default_subcategory Configurable short description Configurable Product description %isolation% 3 @@ -37,8 +37,8 @@ Add new variations configurableProduct::default configurable-product-%isolation% - two_new_options - three_attributes + two_new_options + configurable_three_attributes 154 Configurable Product %isolation% configurable_sku_%isolation% @@ -60,13 +60,13 @@ deleteLast configurableProduct::default configurable-product-%isolation% - two_new_options - two_attributes + two_new_options + configurable_two_attributes 112 Configurable Product %isolation% configurable_sku_%isolation% 99 - default_subcategory + default_subcategory Configurable short description Configurable Product description %isolation% 3 @@ -85,8 +85,8 @@ deleteAll configurableProduct::default configurable-product-%isolation% - two_new_options_with_zero_products - two_attributes + two_new_options_with_zero_products + configurable_two_attributes Configurable Product %isolation% configurable_sku_%isolation% 99 @@ -105,7 +105,7 @@ addOptions configurableProduct::two_options_with_fixed_price configurable-product-%isolation% - one_new_options + one_new_options Configurable Product %isolation% configurable_sku_%isolation% 99 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 9b37f90342b5b..fd28c1bea9a9a 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 @@ */ --> - - - Yes - - - - - - default - - - 0 - - - general - - - - - - Yes - - - - + + + + + + + + + + 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 38a879960a771..36b144079a035 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 @@ --> + + Yes + + custom 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 5be6ff8e8e5da..acc4e79d62648 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 @@ public function __inject( $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 4a68b882263ee..f66c1df25289b 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 @@ config_currency_symbols_usd_and_uah - currency_symbols_uah + currency_symbols_uah UAH Yes 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 b06fc4feddb1f..d0f38165dea70 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 @@ public function processAssert( $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 690b437961fdd..059ca378bc37a 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 @@ public function processAssert( $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 09e93bbf76968..2493ece8b7467 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 @@ */ --> - - - John - Doe - John.Doe%isolation%@example.com - Magento %isolation% - 6161 West Centinela Avenue - Culver City - California - 90230 - United States - 555-55-555-55 - - - Culver City - - - - - - - - - Magento %isolation% - - - United States - - - - - - John - - - Doe - - - John.Doe%isolation%@example.com - - - - - - 90230 - - - - - - - - - California - - - 6161 West Centinela Avenue - - - - - - 555-55-555-55 - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + 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 fe4bdb7814a70..143efd72a580f 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 @@ */ --> - - - John - Doe - - General - - John.Doe%isolation%@example.com - 123123q - 123123q - - - - - - - - - - - - - - - - - - - - - - - - - - John.Doe%isolation%@example.com - - - John - - - - - - - - - Doe - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 123123q - - - 123123q - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 b381e4d910818..32ba4b160a5d6 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 @@ public function __construct(FixtureFactory $fixtureFactory, array $params, array { $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 @@ public function __construct(FixtureFactory $fixtureFactory, array $params, array } /** - * 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 592fe020ec132..f7f0b89646990 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 @@ public function __construct(FixtureFactory $fixtureFactory, array $params, array } /** - * 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 46083535c8cde..bd0e52cf844d8 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 @@ */ --> - - - customer_code_%isolation% - - customer_tax_class - - - - customer_code_%isolation% - - - - customer_tax_class - - + + + 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 db297d43bb3bb..347c238fc3726 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 @@ public function __construct( 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 @@ public function __construct( } } - /** - * 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 @@ public function getTaxClass() { return $this->taxClass; } - - /** - * Return data set configuration settings - * - * @return string - */ - public function getDataConfig() - { - return $this->params; - } } diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Address.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Address.xml index f3b5f5764e279..bca31130341c1 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 @@ --> + + John + Doe + John.Doe%isolation%@example.com + Magento %isolation% + 6161 West Centinela Avenue + Culver City + California + 90230 + United States + 555-55-555-55 + + John Doe @@ -186,7 +199,7 @@ 172, Westminster Bridge Rd SE1 7RW United Kingdom - London + London 444-44-444-44 584451913 Yes 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 2dc95ab415c6d..15df2b81f2518 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 @@ John Doe - General + General JohnDoe_%isolation%@example.com 123123q @@ -22,7 +22,7 @@ John Doe - customer_group_retail_customer + customer_group_retail_customer JohnDoe_%isolation%@example.com 123123q @@ -38,7 +38,7 @@ 01/01/1990 Male - General + General @@ -46,7 +46,7 @@ John Doe - Retailer + Retailer JohnDoe_%isolation%@example.com 123123q @@ -66,13 +66,13 @@ John Doe - General + General JohnDoe_%isolation%@example.com 123123q 123123q - US_address + US_address @@ -80,13 +80,13 @@ John Doe%isolation% - General + General JohnDoe_%isolation%@example.com 123123q 123123q - US_address_NY + US_address_NY @@ -94,13 +94,13 @@ John Doe%isolation% - General + General JohnDoe_%isolation%@example.com 123123q 123123q - US_address_TX + US_address_TX @@ -108,13 +108,13 @@ John Doe%isolation% - General + General JohnDoe_%isolation%@example.com 123123q 123123q - US_address_NY, US_address + US_address_NY, US_address @@ -122,13 +122,13 @@ John Doe%isolation% - General + General John.Doe%isolation%@example.com 123123q 123123q - US_address_1 + US_address_1 @@ -136,13 +136,13 @@ John Doe%isolation% - Retailer + Retailer John.Doe%isolation%@example.com 123123q 123123q - US_address_1 + US_address_1 @@ -153,7 +153,7 @@ 123123q 123123q - US_address_1 + US_address_1 @@ -164,7 +164,7 @@ 123123q 123123q - UK_address_default_billing + UK_address_default_billing @@ -175,7 +175,7 @@ 123123q 123123q - UK_address_with_VAT + UK_address_with_VAT 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 6f495c88b95e7..dd472330ed3f0 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 @@ --> + + customer_code_%isolation% + + customer_tax_class + + + 1 General - retail_customer + retail_customer @@ -19,7 +26,7 @@ 3 Retailer - retail_customer + retail_customer @@ -27,7 +34,7 @@ 2 Wholesale - retail_customer + retail_customer @@ -40,42 +47,42 @@ 0 NOT LOGGED IN - retail_customer + retail_customer Customer_group_%isolation% - retail_customer + retail_customer Valid VAT ID Domestic %isolation% - retail_customer + retail_customer Valid VAT ID Intra %isolation% - retail_customer + retail_customer Invalid VAT ID %isolation% - retail_customer + retail_customer Error VAT ID %isolation% - retail_customer + retail_customer 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 4389e18c61643..23030f07c0819 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 @@ public function __prepare(FixtureFactory $fixtureFactory) { $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 e381864c2850e..255ac6f90738e 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 @@ MAGETWO-12447: Enable Automatic Assignment of Customers to Appropriate VAT Group (valid Intra-Union group). - enable_VAT_on_frontend + enable_VAT_on_frontend store_information_DE_with_VAT, enable_VAT_on_frontend - customer_UK_1_default_billing_address + customer_UK_1_default_billing_address 584451913 valid_intra_union_group test_type:3rd_party_test @@ -20,9 +20,9 @@ MAGETWO-12447: Enable Automatic Assignment of Customers to Appropriate VAT Group (invalid VAT ID group). - enable_VAT_on_frontend + enable_VAT_on_frontend store_information_DE_with_VAT, enable_VAT_on_frontend - customer_UK_1_default_billing_address + customer_UK_1_default_billing_address 123456789 invalid_group test_type:3rd_party_test 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 d60ae37768213..2d3334dfd508a 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 @@ - default + default 123123q 123123a 123123a @@ -16,14 +16,14 @@ - default + default 123123 123123a 123123a - default + default 123123q 123123a 123123 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 cce2180d084f3..1b511d97d5c33 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 @@ General customer without address save Main Website - General + General - John%isolation% - @@ -37,7 +37,7 @@ Customer with prefix save Admin - Wholesale + Wholesale M John%isolation% Jack @@ -63,7 +63,7 @@ General customer from USA save Main Website - General + General - John%isolation% - @@ -89,7 +89,7 @@ Retailer customer without address save Main Website - Retailer + Retailer - John%isolation% - @@ -113,7 +113,7 @@ General customer from Poland save Main Website - General + General - Thomas%isolation% - @@ -139,7 +139,7 @@ MAGETWO-12516: Create New Customer on Backend saveAndContinue Main Website - General + General - John%isolation% - 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 a939641976d0a..acb4844ba124c 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 @@ - retail_customer + retail_customer GroupName%isolation% - retail_customer + retail_customer General - customer_tax_class + customer_tax_class GroupName%isolation% 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 d4c96eef41e1c..f71ac07a13422 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 @@ - default - US_address_default_billing,US_address_NY_default_no + default + US_address_default_billing,US_address_NY_default_no 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 a3389e3767717..efabd7c64bd78 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 @@ - default + default 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 42e10059a897b..32ef81cc1e2a8 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 @@ - customer_US + customer_US 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 336c0a5d7d0ec..414eae3135f92 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 @@ - default + default 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 ef596fbdfa071..b68c1850d0c5f 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 @@ protected function createCustomers($customersQty) { $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 8a97e9471b18e..a0de3c12b525f 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 @@ - default + default 3 2 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 57257d4659d3d..acff1c874d93c 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 @@ - default - Wholesale + default + Wholesale %isolation%Prefix_ John_%isolation% Middle Name %isolation% @@ -39,8 +39,8 @@ - default - - + default + - - - - @@ -70,8 +70,8 @@ - default - Retailer + default + Retailer %isolation%Prefix_ Jane_%isolation% Jane Middle Name %isolation% 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 84b8c3279a6c2..ca4632fbb4a23 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 @@ stable:no - retail_customer + retail_customer GroupName%isolation% @@ -17,12 +17,12 @@ - - + - General - customer_tax_class + customer_tax_class Group Name %isolation% @@ -30,7 +30,7 @@ - customer_tax_class + customer_tax_class Group#Name%isolation% 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 df4f4ce87118b..1ff30b1dcdf03 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 @@ public function __construct(CmsIndex $cmsIndex, CustomerAccountLogout $customerA */ 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 6b6a97b9d49e6..fd74223e5fcee 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 @@ MAGETWO-12850 – Use DHL International (EU) Online Shipping Carrier on Checkout as a Registered Customer catalogProductSimple::default, configurableProduct::default, bundleProduct::bundle_fixed_product login - customer_DE - customer_DE - customer_DE + customer_DE + DE_address + customer_DE DHL Express worldwide Express worldwide 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 70fcf15c96298..8e9a51f944a7d 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 @@ */ --> - - - USD - EUR - 0.8 - - + 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 c1b6dc96e3cbb..b2cfab8039412 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 @@ --> + + USD + EUR + 0.8 + + USD CHF 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 22b8d54518de9..5ca238d28ba06 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 @@ * 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 561f9307ff07f..294132c493afe 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 @@ USD EUR 0.8 - currency_symbols_eur - simple_10_dollar - config_currency_symbols_usd_and_eur + currency_symbols_eur + simple_10_dollar + config_currency_symbols_usd_and_eur $10.00 €8.00 test_type:acceptance_test 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 8d8542cb82c1b..2621befd5c8d1 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 @@ 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 @@ public function processAssert( 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 @@ public function processAssert( //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 95e825d05f18f..20dd5579d0e28 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 @@ public function processAssert( $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 @@ public function processAssert( $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 4c1e9f6c06bde..875b353205259 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 @@ public function getCategoryPrices(FixtureInterface $product, $actualPrices) */ 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 5818f5fcab0ad..398fcd7c86bc2 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 @@ public function getCategoryPrices(FixtureInterface $product, $actualPrices) */ 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 76c76772f8f8b..14050dace32ec 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\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 @@ public function __construct(FixtureInterface $product) 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 7c7caf2f5c249..3d250fc3f2f46 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 @@ */ --> - - - DownloadableProduct_%isolation% - DownloadableProduct_%isolation% - downloadableproduct_%isolation% - - 100.00 - - - taxable_goods - - This is description for downloadable product - This is short description for downloadable product - - 1.000 - In Stock - - Yes - - default - - - - downloadable - - downloadable - 4 - - product - - - - - - - - - - - - - - - - - - - - - - - - This is description for downloadable product - - - - - - - - - - - - - - - - - - - - - 2 - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - 4 - - - DownloadableProduct_%isolation% - - - - - - - - - - - - container2 - - - - - - - 100 - - - - - - 1 - In Stock - - - - - - - - - - - - - - - - This is short description for downloadable product - - - - - default - - - - dafault - - - DownloadableProduct_%isolation% - - - - - - - - - - - - 10 - - - - - - 1 - - - - taxable_goods - - - - - - - - - - default - - - - - - - - - - - - downloadableproduct_%isolation% - - - - - - 4 - - - - - - default - - - - Yes - - - - Main Website - - - - - - - + + + downloadable + + downloadable + 4 + + product + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 89c3a434fb527..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/CheckoutData.php +++ /dev/null @@ -1,129 +0,0 @@ - [ - '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 552f201300fe3..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/GroupPriceOptions.php +++ /dev/null @@ -1,43 +0,0 @@ - [ - [ - '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 3dd27e94ec34b..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/Links.php +++ /dev/null @@ -1,250 +0,0 @@ -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 5399800e8a67c..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/Samples.php +++ /dev/null @@ -1,137 +0,0 @@ -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 13314c0ec5bd9..8d84025eee8b4 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 @@ sku_test_downloadable_product_%isolation% 280 - - + - downloadable - taxable_goods + taxable_goods 90 @@ -27,13 +27,13 @@ test-downloadable-product-%isolation% Yes - default + with_two_separately_links Main Website - default + downloadable_default @@ -45,7 +45,7 @@ 20 - taxable_goods + taxable_goods 1111 @@ -58,10 +58,10 @@ Main Website - with_two_separately_links + with_two_separately_links - with_two_separately_links + downloadable_with_two_separately_links @@ -73,7 +73,7 @@ 20 - taxable_goods + taxable_goods 1111 @@ -86,10 +86,10 @@ Main Website - with_two_separately_links + with_two_separately_links - with_two_bought_links + downloadable_with_two_bought_links @@ -102,7 +102,7 @@ 20 - taxable_goods + taxable_goods 1111 @@ -110,7 +110,7 @@ Product online - default_subcategory + default_subcategory Catalog, Search Yes @@ -118,10 +118,10 @@ Main Website - with_two_separately_links + with_two_separately_links - with_two_bought_links + downloadable_with_two_bought_links @@ -133,10 +133,10 @@ 30 - downloadable_with_tax + general_90_99 - taxable_goods + taxable_goods 1111 @@ -144,7 +144,7 @@ Product online - default_subcategory + default_subcategory Catalog, Search Yes @@ -152,10 +152,10 @@ Main Website - with_two_separately_links + with_two_separately_links - with_two_bought_links + downloadable_with_two_bought_links @@ -167,7 +167,7 @@ 20 - taxable_goods + taxable_goods 1111 @@ -175,7 +175,7 @@ Product online - default_subcategory + default_subcategory Catalog, Search Yes @@ -183,13 +183,13 @@ Main Website - with_two_separately_links + with_two_separately_links - drop_down_with_one_option_percent_price + drop_down_with_one_option_percent_price - one_custom_option_and_downloadable_link + downloadable_one_custom_option_and_downloadable_link @@ -202,23 +202,23 @@ 1 - default_subcategory + default_subcategory - one_no_separately_link + one_no_separately_link 10 In Stock - taxable_goods + taxable_goods Main Website - one_dollar_product_with_no_separated_link + downloadable_one_dollar_product_with_no_separated_link 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 0000000000000..74b9db4043e56 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Repository/DownloadableProduct/CheckoutData.xml @@ -0,0 +1,109 @@ + + + + + + + + + link_0 + Yes + + + + + + + + 3 + 3 + + + + + + + + link_0 + Yes + + + + + 22.43 + 22.43 + + + + + + + + link_0 + Yes + + + link_1 + Yes + + + + + 23 + 23 + + + + + + + + link_1 + Yes + + + + + 23 + 23 + + + + + + + + attribute_key_0 + option_key_0 + + + + + link_0 + Yes + + + + + + + + + + link_0 + Yes + + + + + 3 + 3 + + + + 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 0000000000000..52291319fe9ab --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Repository/DownloadableProduct/Links.xml @@ -0,0 +1,137 @@ + + + + + + Links%isolation% + Yes + + + + link1%isolation% + 2 + Use config + 2 + 1 + + Yes + http://example.com + + Yes + http://example.com + + + + + + + Links%isolation% + No + + + + link1%isolation% + 2 + Use config + 2 + 1 + + Yes + http://example.com + + Yes + http://example.com + + + + + + + Links title %isolation% + Yes + + + + link-1-%isolation% + 2.43 + 2 + + Yes + http://example.com + + Yes + http://example.com + No + 1 + + + link-2-%isolation% + 3 + 3 + + Yes + http://example.com + + Yes + http://example.com + Yes + 0 + + + + + + + Links Title %isolation% + Yes + + + + link-1-%isolation% + 2.43 + 2 + + Yes + http://example.com + + Yes + http://example.com + No + 0 + + + link-2-%isolation% + 3 + 3 + + Yes + http://example.com + + Yes + http://example.com + Yes + 1 + + + link-3-%isolation% + 5.43 + 5 + + Yes + http://example.com + + Yes + http://example.com + Yes + 2 + + + + + + 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 0000000000000..65bf205651d1d --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Repository/DownloadableProduct/Samples.xml @@ -0,0 +1,56 @@ + + + + + + Samples%isolation% + + + + sample1%isolation% + Yes + http://example.com + 0 + + + sample2%isolation% + Yes + http://example.com + 1 + + + + + + + Samples%isolation% + + + + sample1%isolation% + Yes + http://example.com + 0 + + + sample2%isolation% + Yes + http://example.com + 1 + + + sample3%isolation% + Yes + http://example.com + 2 + + + + + + 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 c54301de79898..b02763d9f5fab 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 @@ DownloadableProduct_%isolation% 1 category %isolation% - one_separately_link - one_dollar_product_with_separated_link + one_separately_link + downloadable_one_dollar_product_with_separated_link downloadableproduct-%isolation% test_type:acceptance_test @@ -27,12 +27,12 @@ DownloadableProduct_%isolation% DownloadableProduct_%isolation% 100 - taxable_goods + taxable_goods 1 In Stock Yes Default Category - default + with_two_separately_links downloadableproduct-%isolation% @@ -46,13 +46,13 @@ DownloadableProduct_%isolation% DownloadableProduct_%isolation% 1 - taxable_goods + taxable_goods 10 In Stock Yes category %isolation% - default - default + with_two_samples + with_two_separately_links downloadableproduct-%isolation% @@ -66,13 +66,13 @@ DownloadableProduct_%isolation% DownloadableProduct_%isolation% 33 - taxable_goods + taxable_goods 10 In Stock Yes category %isolation% - default - default + with_two_separately_links + default downloadableproduct-%isolation% @@ -86,13 +86,13 @@ DownloadableProduct_%isolation% DownloadableProduct_%isolation% 55 - taxable_goods + taxable_goods 10 In Stock Yes - with_three_samples - with_three_links - two_options + with_three_samples + with_three_links + two_options downloadableproduct-%isolation% @@ -109,12 +109,12 @@ DownloadableProduct_%isolation% DownloadableProduct_%isolation% 100 - taxable_goods + taxable_goods 50 Out of Stock Yes Default Category - default + with_two_separately_links downloadableproduct-%isolation% @@ -127,14 +127,14 @@ DownloadableProduct_%isolation% DownloadableProduct_%isolation% 9999 - taxable_goods + taxable_goods Yes Default Category Yes 123 No 123 - default + with_two_separately_links downloadableproduct-%isolation% @@ -146,13 +146,13 @@ DownloadableProduct_%isolation% DownloadableProduct_%isolation% 98 - None + None 5 In Stock Yes Default Category This is description for downloadable product - default + with_two_separately_links downloadableproduct-%isolation% @@ -165,15 +165,15 @@ DownloadableProduct_%isolation% DownloadableProduct_%isolation% 57 - taxable_goods + taxable_goods 10 In Stock Yes category %isolation% This is short description for downloadable product - default - with_three_links - default + with_two_samples + with_three_links + default catalogProductSimple::with_two_custom_option,catalogProductSimple::with_all_custom_option downloadableproduct-%isolation% @@ -189,16 +189,16 @@ DownloadableProduct_%isolation% DownloadableProduct_%isolation% 65 - taxable_goods + taxable_goods 11 In Stock Yes category %isolation% This is description for downloadable product This is short description for downloadable product - default - with_three_links - default + with_two_samples + with_three_links + default downloadableproduct-%isolation% @@ -213,14 +213,14 @@ DownloadableProduct_%isolation% DownloadableProduct_%isolation% 65 - taxable_goods + taxable_goods 11 In Stock Yes category %isolation% - default - with_three_links - default + with_two_samples + with_three_links + default downloadableproduct-%isolation% @@ -234,10 +234,10 @@ DownloadableProduct_%isolation% DownloadableProduct_%isolation% 100 - taxable_goods + taxable_goods Yes Default Category - default + with_two_separately_links downloadableproduct-%isolation% @@ -249,12 +249,12 @@ DownloadableProduct_%isolation% DownloadableProduct_%isolation% 10 - taxable_goods + taxable_goods 10 In Stock Yes category %isolation% - default + with_two_separately_links 5 downloadableproduct-%isolation% @@ -268,13 +268,13 @@ DownloadableProduct_%isolation% DownloadableProduct_%isolation% 365 - taxable_goods + taxable_goods 23 In Stock Yes category %isolation% - default - default + with_two_separately_links + not_logged_in_20 downloadableproduct-%isolation% @@ -287,13 +287,13 @@ DownloadableProduct_%isolation% DownloadableProduct_%isolation% 250 - taxable_goods + taxable_goods 65 In Stock Yes category %isolation% - default - default + with_two_separately_links + default downloadableproduct-%isolation% 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 7fd60c8a21085..30bb9409bce62 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 @@ public function __inject( ) { $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 10ba00e4d5db1..e0de074a41c10 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 @@ DownloadableProduct_%isolation% DownloadableProduct_%isolation% 55 - taxable_goods + taxable_goods 10 In Stock Yes - with_three_samples - with_three_links - two_options + with_three_samples + with_three_links + two_options No downloadableproduct-%isolation% @@ -33,12 +33,12 @@ DownloadableProduct_%isolation% DownloadableProduct_%isolation% 100 - taxable_goods + taxable_goods 50 Out of Stock Yes Default Category - default + with_two_separately_links No downloadableproduct-%isolation% @@ -50,7 +50,7 @@ DownloadableProduct_%isolation% DownloadableProduct_%isolation% 9999 - taxable_goods + taxable_goods 123 Yes Default Category @@ -68,13 +68,13 @@ DownloadableProduct_%isolation% DownloadableProduct_%isolation% 48 - None + None 5 In Stock Yes Default Category This is description for downloadable product - default + with_two_separately_links No downloadableproduct-%isolation% @@ -86,15 +86,15 @@ DownloadableProduct_%isolation% DownloadableProduct_%isolation% 54 - taxable_goods + taxable_goods 10 In Stock Yes category %isolation% This is short description for downloadable product - default - with_three_links - default + with_two_samples + with_three_links + default Yes downloadableproduct-%isolation% @@ -110,7 +110,7 @@ DownloadableProduct_%isolation% DownloadableProduct_%isolation% 43 - taxable_goods + taxable_goods 10 In Stock Yes 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 846ea00925857..28075acb0a4cb 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 @@ Check Out as Guest using FedEx with US shipping origin and UK customer catalogProductSimple::default, configurableProduct::default, bundleProduct::bundle_fixed_product guest - default - UK_address - UK_address + default + UK_address + UK_address Federal Express International Economy International Economy checkmo - checkmo, fedex, shipping_origin_US_CA + checkmo, fedex, shipping_origin_US_CA @@ -27,9 +27,9 @@ MAGETWO-12849 – Use FedEx Online Shipping Carrier on Checkout as a Registered Customer catalogProductSimple::default, configurableProduct::default, bundleProduct::bundle_fixed_product login - customer_DE - customer_DE - customer_DE + customer_DE + DE_address + customer_DE Federal Express Ground Ground 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 a30bc92f6f7a9..5cc2532f1c544 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 @@ public function fillGiftMessageForItems(array $products, GiftMessage $giftMessag '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 dc4cd18309225..dcf34e5af99ac 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 a55da0421665c..34ecc89c7da57 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. */ --> - + [name$="[sender]"] 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 9d4546439a5f9..7ebe75449ad20 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\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 @@ public function processAssert( array $products, $orderId ) { + $expectedData = []; + $actualData = []; $orderIndex->open()->getSalesOrderGrid()->searchAndOpen(['id' => $orderId]); if ($giftMessage->getAllowGiftMessagesForOrder()) { @@ -54,8 +55,9 @@ public function processAssert( } 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 @@ public function processAssert( */ 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 4fcfbc2afb80e..d7a16e4e7e2fb 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\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 932115cdf37ab..bb193414ea93a 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 @@ /** * 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 @@ public function processAssert( $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 d11995d1e7dc6..17844e49b69b1 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 @@ */ --> - - - Yes - Yes - John Doe - Jane Doe - text_%isolation% - - - - - - 0 - - - John Doe - - - Jane Doe - - - text_%isolation% - - - Yes - - - Yes - - - - + + + + + + + + + + + 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 d53cc71937440..995f35bb57255 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 4270f0d4106dc..6ea4afd10785d 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 @@ - + 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 18a366d47dfda..9a53ceb731423 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 @@ * * 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 b6433e7ad8ed1..bdc1fbbd1aee9 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 @@ catalogProductSimple::default, catalogProductVirtual::default - default - US_address_1 + default + US_address_1 login Flat Rate Fixed @@ -26,8 +26,8 @@ catalogProductSimple::default, catalogProductVirtual::default - default - US_address_1 + default + US_address_1 login Flat Rate Fixed 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 618e06a639165..0b6e622cf8d03 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 @@ protected function getSearchGridBlock() } /** - * Get associated products list block + * Get associated products list block. * - * @return AssociatedProducts\ListAssociatedProducts + * @return ListAssociatedProducts */ protected function getListAssociatedProductsBlock() { @@ -72,7 +80,7 @@ protected function getListAssociatedProductsBlock() } /** - * Fill data to fields on tab + * Fill data to fields on tab. * * @param array $fields * @param SimpleElement|null $element @@ -90,6 +98,7 @@ public function fillFormTab(array $fields, SimpleElement $element = null) 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 @@ public function fillFormTab(array $fields, SimpleElement $element = null) } /** - * 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 @@ public function getDataFormTab($fields = null, SimpleElement $element = null) } 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 fe78ef841ca38..dd4743f943618 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 @@ public function processAssert( } /** - * 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 bd6f991bce9ee..c06591804d57c 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\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 @@ public function __construct(FixtureInterface $product) $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 5fc47bd6a0c65..e1757e1adbcf0 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 @@ */ --> - - - GroupedProduct_%isolation% - GroupedProduct_%isolation% - Taxable Goods - This is description for grouped product - This is short description for grouped product - - 1 - In Stock - - - - grouped - - grouped - 4 - - product - - - - - - - - - - - - - - - - - - - - - - - - - This is description for grouped product - - - - - - - - - - - - - - - - - - 2 - - - - - - - - - - - - - - - GroupedProduct_%isolation% - - - - - - - - - - - - container2 - - - - - - - 1 - In Stock - - - - - - - - - - - - - - This is short description for grouped product - - - GroupedProduct_%isolation% - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - - - - - - 4 - - - - - - - Main Website - - - - - - taxable_goods - - + + + grouped + + grouped + 4 + + product + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 427bc6c11cd4e..9bc1dc13d3ac5 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 @@ public function __construct(FixtureFactory $fixtureFactory, array $data, array $ 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 @@ public function __construct(FixtureFactory $fixtureFactory, array $data, array $ $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 2871ec912db01..0000000000000 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProduct/CheckoutData.php +++ /dev/null @@ -1,63 +0,0 @@ - [ - '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 2204d6abae2e0..0000000000000 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProduct/Price.php +++ /dev/null @@ -1,45 +0,0 @@ - [ - '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 cd0bc02b3df4c..5a6c373042664 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 @@ Test grouped product %isolation% sku_test_grouped_product_%isolation% - default + default - defaultSimpleProduct + defaultSimpleProduct Product online Catalog, Search - taxable_goods + taxable_goods test-grouped-product-%isolation% @@ -29,7 +29,7 @@ Main Website - default + default @@ -37,15 +37,15 @@ Test grouped product %isolation% sku_test_grouped_product_%isolation% - default + default - defaultSimpleProduct + defaultSimpleProduct Product online Catalog, Search - taxable_goods + taxable_goods test-grouped-product-%isolation% @@ -55,7 +55,7 @@ Main Website - default + default @@ -64,18 +64,18 @@ sku_test_grouped_product_%isolation% - - starting-100 + starting-100 - default + default - defaultSimpleProduct + defaultSimpleProduct Product online Catalog, Search - taxable_goods + taxable_goods test-grouped-product-%isolation% @@ -85,7 +85,7 @@ Main Website - default + default @@ -93,15 +93,15 @@ Grouped product %isolation% grouped_product_%isolation% - default + default - three_simple_products + three_simple_products Product online Catalog, Search - taxable_goods + taxable_goods test-grouped-product-%isolation% @@ -111,10 +111,10 @@ Main Website - default + default - three_simple_products + grouped_three_simple_products 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 0000000000000..8ada3e7a91dd0 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Repository/GroupedProduct/Associated.xml @@ -0,0 +1,150 @@ + + + + + + + + %id% + %item1_simple::getProductName% + %position% + 1 + + + %id% + %item1_simple::getProductName% + %position% + 2 + + + + catalogProductSimple::default + catalogProductSimple::product_100_dollar + + + + + + + %id% + %item1_simple::getProductName% + %position% + 0 + + + %id% + %item1_simple::getProductName% + %position% + 0 + + + + catalogProductSimple::default + catalogProductSimple::product_100_dollar + + + + + + + %id% + %item1_simple::getProductName% + %position% + 1 + + + %id% + %item1_simple::getProductName% + %position% + 2 + + + + catalogProductSimple::withSpecialPrice + catalogProductSimple::withSpecialPrice + + + + + + + %id% + %item1_virtual::getProductName% + %position% + 1 + + + %id% + %item1_virtual::getProductName% + %position% + 2 + + + + catalogProductVirtual::default + catalogProductVirtual::product_50_dollar + + + + + + + %id% + %item1_simple::getProductName% + %position% + 3 + + + %id% + %item1_simple::getProductName% + %position% + 1 + + + %id% + %item1_simple::getProductName% + %position% + 2 + + + + catalogProductSimple::default + catalogProductSimple::product_40_dollar + catalogProductSimple::product_100_dollar + + + + + + + %id% + %item1_simple::getProductName% + %position% + 3 + + + %id% + %item2_downloadable::getProductName% + %position% + 7 + + + %id% + %item3_virtual::getProductName% + %position% + 11 + + + + catalogProductSimple::default + catalogProductSimple::product_40_dollar + catalogProductSimple::product_100_dollar + + + + 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 0000000000000..f7347bf02add1 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Repository/GroupedProduct/CheckoutData.xml @@ -0,0 +1,44 @@ + + + + + + + + product_key_0 + 3 + + + product_key_1 + 1 + + + product_key_2 + 2 + + + + + 560 + 40 + 100 + + + 3 + 1 + 2 + + + 1680 + 40 + 200 + + + + + diff --git a/dev/tests/functional/tests/app/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 0000000000000..d08f7b4cd25c3 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Repository/GroupedProduct/Price.xml @@ -0,0 +1,22 @@ + + + + + + + 100.00 + + + + + + 560.00 + + + + 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 021db6ee77f16..e8c077133c566 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 @@ */ --> - - - MAGETWO-13610: Create Grouped Product and Assign It to the Category - test-grouped-product-%isolation% - GroupedProduct %isolation% - GroupedProduct_sku%isolation% - - - category_%isolation% - - - catalogProductSimple::simple_big_qty,downloadableProduct::one_dollar_product_with_no_separated_link,catalogProductVirtual::required_fields_with_category - simple_downloadable_virtual - - - - - test_type:acceptance_test, stable:no - - - - - - Create with required products and description - test-grouped-product-%isolation% - GroupedProduct %isolation% - GroupedProduct_sku%isolation% - In Stock - category_%isolation% - This is description for grouped product - catalogProductSimple::simple_for_composite_products,catalogProductSimple::simple_for_composite_products - defaultSimpleProduct - This is short description for grouped product - Yes - - - - - Create product without category - test-grouped-product-%isolation% - GroupedProduct %isolation% - - - In Stock - - - - - catalogProductSimple::simple_for_composite_products,catalogProductSimple::simple_for_composite_products - defaultSimpleProduct - - - No - - - - - - Create product out of stock - test-grouped-product-%isolation% - GroupedProduct %isolation% - GroupedProduct_sku%isolation% - Out of Stock - category_%isolation% - - - catalogProductSimple::simple_for_composite_products,catalogProductSimple::simple_for_composite_products - defaultSimpleProduct - - - No - - - - Create with no required products - test-grouped-product-%isolation% - GroupedProduct %isolation% - GroupedProduct_sku%isolation% - In Stock - category_%isolation% - - - catalogProductSimple::simple_for_composite_products,catalogProductSimple::simple_for_composite_products - defaultSimpleProduct - - - No - - - - - - Create with special price products - test-grouped-product-%isolation% - GroupedProduct %isolation% - GroupedProduct_sku%isolation% - In Stock - category_%isolation% - - - catalogProductSimple::withSpecialPrice,catalogProductSimple::withSpecialPrice - defaultSimpleProduct - - - No - - - - - - Create with group price products - test-grouped-product-%isolation% - GroupedProduct %isolation% - GroupedProduct_sku%isolation% - In Stock - category_%isolation% - - - catalogProductSimple::simple_with_group_price,catalogProductSimple::simple_with_group_price - defaultSimpleProduct - - - No - - - - - - Create with virtual products - test-grouped-product-%isolation% - GroupedProduct %isolation% - GroupedProduct_sku%isolation% - In Stock - category_%isolation% - - - catalogProductVirtual::virtual_product,catalogProductVirtual::virtual_product - defaultVirtualProduct - - - Yes - - - - - Create with tier price products - test-grouped-product-%isolation% - GroupedProduct %isolation% - GroupedProduct_sku%isolation% - In Stock - category_%isolation% - - - catalogProductSimple::simple_with_tier_price,catalogProductSimple::simple_with_tier_price - defaultSimpleProduct - - - No - - - - - + + + MAGETWO-13610: Create Grouped Product and Assign It to the Category + test-grouped-product-%isolation% + GroupedProduct %isolation% + GroupedProduct_sku%isolation% + category_%isolation% + catalogProductSimple::simple_big_qty,downloadableProduct::one_dollar_product_with_no_separated_link,catalogProductVirtual::required_fields_with_category + simple_downloadable_virtual + test_type:acceptance_test, stable:no + + + + + + Create with required products and description + test-grouped-product-%isolation% + GroupedProduct %isolation% + GroupedProduct_sku%isolation% + In Stock + category_%isolation% + This is description for grouped product + catalogProductSimple::simple_for_composite_products,catalogProductSimple::simple_for_composite_products + defaultSimpleProduct + This is short description for grouped product + Yes + + + + + Create product without category + test-grouped-product-%isolation% + GroupedProduct %isolation% + In Stock + catalogProductSimple::simple_for_composite_products,catalogProductSimple::simple_for_composite_products + defaultSimpleProduct + No + + + + + + Create product out of stock + test-grouped-product-%isolation% + GroupedProduct %isolation% + GroupedProduct_sku%isolation% + Out of Stock + category_%isolation% + catalogProductSimple::simple_for_composite_products,catalogProductSimple::simple_for_composite_products + defaultSimpleProduct + No + + + + Create with no required products + test-grouped-product-%isolation% + GroupedProduct %isolation% + GroupedProduct_sku%isolation% + In Stock + category_%isolation% + catalogProductSimple::simple_for_composite_products,catalogProductSimple::simple_for_composite_products + defaultSimpleProduct + No + + + + + + Create with special price products + test-grouped-product-%isolation% + GroupedProduct %isolation% + GroupedProduct_sku%isolation% + In Stock + category_%isolation% + catalogProductSimple::withSpecialPrice,catalogProductSimple::withSpecialPrice + defaultSimpleProduct + No + + + + + + Create with group price products + test-grouped-product-%isolation% + GroupedProduct %isolation% + GroupedProduct_sku%isolation% + In Stock + category_%isolation% + catalogProductSimple::simple_with_group_price,catalogProductSimple::simple_with_group_price + defaultSimpleProduct + No + + + + + + Create with virtual products + test-grouped-product-%isolation% + GroupedProduct %isolation% + GroupedProduct_sku%isolation% + In Stock + category_%isolation% + catalogProductVirtual::virtual_product,catalogProductVirtual::virtual_product + defaultVirtualProduct + Yes + + + + + Create with tier price products + test-grouped-product-%isolation% + GroupedProduct %isolation% + GroupedProduct_sku%isolation% + In Stock + category_%isolation% + catalogProductSimple::simple_with_tier_price,catalogProductSimple::simple_with_tier_price + defaultSimpleProduct + No + + + + + 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 cc918d24c96e6..207cb0711a829 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 @@ - grouped_product_out_of_stock + grouped_product_out_of_stock GroupedProduct_edited %isolation% GroupedProduct_sku_edited %isolation% In Stock - category_%isolation% + category_%isolation% This is edited description for grouped product This is edited short description for grouped product updated-grouped-product-%isolation% @@ -21,38 +21,38 @@ - default + default GroupedProduct_edited %isolation% GroupedProduct_sku_edited %isolation% catalogProductVirtual::default,catalogProductVirtual::product_50_dollar - defaultVirtualProduct + defaultVirtualProduct updated-grouped-product-%isolation% - default + default GroupedProduct_edited %isolation% GroupedProduct_sku_edited %isolation% catalogProductSimple::simple_for_composite_products,catalogProductSimple::default - defaultSimpleProduct_without_qty + defaultSimpleProduct_without_qty updated-grouped-product-%isolation% - default + default GroupedProduct_edited %isolation% GroupedProduct_sku_edited %isolation% catalogProductSimple::withSpecialPrice,catalogProductSimple::withSpecialPrice - defaultSimpleProduct_with_specialPrice + defaultSimpleProduct_with_specialPrice updated-grouped-product-%isolation% - default + default GroupedProduct_edited %isolation% GroupedProduct_sku_edited %isolation% Out of Stock 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 ac1253f96a0c0..3386350d698c1 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 @@ */ --> - - - Products - CSV - - - - - - Products - - - CSV - - - - + + + + + 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 0000000000000..483a9341489fe --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/ImportExport/Test/Repository/ImportExport.xml @@ -0,0 +1,15 @@ + + + + + + Products + CSV + + + 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 2d83153459204..10a8fdae3d894 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 @@ */ --> - + 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 ff6ba2d1f1d7c..5eb2c388a74a0 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 @@ Install with default values. - default + default Install with custom admin path. - default + default custom Install with custom encryption key and changed currency and locale. - default + default Yes 123123qa German (Germany) @@ -37,7 +37,7 @@ Install with table prefix. - default + default prefix1_ Chinese (China) @@ -45,7 +45,7 @@ Install with enabled url rewrites. - default + default Yes @@ -53,7 +53,7 @@ Install with enabled secure urls. - default + default Yes Yes 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 30c8310ea5534..f2ed1bfc1e24d 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 @@ */ --> - - - default_integration_%isolation% - test_%isolation%@example.com - All - - - - - - default_integration_%isolation% - - - test_%isolation%@example.com - - - - - - - - - - - - CURRENT_TIMESTAMP - - - - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - - - 0 - - - - - - - - - - - - All - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 4fe24f70c1da6..c4a76d5b60ffd 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 @@ --> + + default_integration_%isolation% + test_%isolation%@example.com + All + + default_integration_%isolation% test_%isolation%@example.com 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 b77b66906a0c8..b369ae1c3b3c2 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 @@ - default_with_all_resources + default_with_all_resources 1 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 4cfbc8d6397ff..8c65b126821d4 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 @@ layered_navigation_manual_range_10 - default_anchor_subcategory - catalogProductSimple::product_20_dollar, configurableProduct::filterable_two_options_with_zero_price + default_anchor_subcategory + catalogProductSimple::product_20_dollar, configurableProduct::filterable_two_options_with_zero_price 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 b0a4b9350abbd..4553883e0c2a7 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 @@ - default + default Simple Product with msrp %isolation% sku_simple_product_with_msrp_%isolation% @@ -20,17 +20,17 @@ 560 - - + - - taxable_goods + taxable_goods Main Website Catalog, Search - order_default + simple_order_default 600 Before Order Confirmation @@ -47,13 +47,13 @@ 10 - - + - - default_subcategory + default_subcategory - taxable_goods + taxable_goods Main Website 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 ba737437dc71b..32e6d1cf28fce 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 @@ 30 - taxable_goods + taxable_goods test-configurable-product-%isolation% - default_subcategory + default_subcategory 1 In Stock - one_variation_one_dollar + one_variation_one_dollar Main Website - custom_attribute_set + custom_attribute_set - with_one_option + configurable_one_option 15 On Gesture 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 6311e64c6602a..38155dfa637f6 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 @@ */ --> - - - TemplateName%isolation% - TemplateSubject%isolation% - SenderName%isolation% - SenderName%isolation%@example.com - Some text %isolation% - - - - - - TemplateName%isolation% - - - Some text %isolation% - - - - - - - - - - - - TemplateSubject%isolation% - - - SenderName%isolation% - - - SenderName%isolation%@example.com - - - 1 - - - - - - - - + + + + + + + + + + + + + + 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 1bffdfc6e1ae3..ff1fec3232d34 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 @@ * 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 f00372d3f7564..53f8aa6c0869a 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 @@ - default + default Preview - default + default Queue Newsletter 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 b77e94c4b0245..cbc6eadb0c65f 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 @@ */ --> - + 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 c72134191de2d..2d459bcd61e1b 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 @@ MAGETWO-12415 - Check Out as a Guest using "Checkout with PayPal" button from Product Page and Free Shipping catalogProductSimple::simple_10_dollar us_ca_ny_rule - sandbox_us_default + sandbox_us_default guest Free 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 277ad9f6bf420..e11142c9fc520 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 @@ MAGETWO-12413 - Check Out as a Guest Using PayPal Express Checkout Method and Offline Shipping Method catalogProductSimple::simple_10_dollar, configurableProduct::with_one_option, bundleProduct::fixed_100_dollar_with_required_options us_ca_ny_rule - sandbox_us_default - default + sandbox_us_default + default guest Fixed @@ -38,8 +38,8 @@ MAGETWO-14359 - Check Out as a Guest using Payflow Link - PayPal Express Checkout Payflow Edition and Offline Shipping catalogProductSimple::simple_10_dollar, configurableProduct::with_one_option, bundleProduct::fixed_100_dollar_with_required_options us_ca_ny_rule - sandbox_us_default - default + sandbox_us_default + default guest Fixed @@ -66,8 +66,8 @@ MAGETWO-12996 - Check Out as Guest User using PayPal Express and Offline Shipping Method catalogProductSimple::simple_10_dollar, configurableProduct::with_one_option, bundleProduct::fixed_100_dollar_with_required_options us_ca_ny_rule - sandbox_us_default - default + sandbox_us_default + default guest Fixed 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 30e3f10dd6247..182b567985b6e 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 @@ public function processAssert(Bestsellers $bestsellers, OrderInjectable $order, */ 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 b453dc730f2f4..eada24c44870c 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 @@ /** * 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 @@ public function processAssert(CustomerAccounts $customerAccounts, $total) */ 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 7218c72efa61a..bd9f6e9ddaefe 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 @@ public function processAssert(ProductReportView $productReportView, $total, arra */ 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 d82d59837b6d0..d7956d8e69235 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 @@ /** * 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 @@ public function processAssert( */ 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 a8d4364fdd347..5aef01eea5226 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\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 c035d7e9c326e..95ce6b354b4bf 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 @@ */ --> - - - add product to cart as registered user and check product in Report - default - catalogProductSimple::product_100_dollar - - - - add two products to cart as registered user and check product in Report - default - catalogProductSimple::product_100_dollar,catalogProductSimple::product_100_dollar - - - + + + add product to cart as registered user and check product in Report + default + catalogProductSimple::product_100_dollar + + + + add two products to cart as registered user and check product in Report + default + catalogProductSimple::product_100_dollar,catalogProductSimple::product_100_dollar + + + 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 7ea6eae0fc5f2..1ad8d1b3356f7 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\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 7b5657f4032dc..5b953c047969f 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 @@ */ --> - - - simple_big_qty - Year - m/d/Y -1 year - m/d/Y - No - Y - - - - virtual_big_qty - Month - m/d/Y -1 month - m/d/Y - Yes - n/Y - - - - simple_big_qty - Day - m/d/Y -1 day - m/d/Y +1 day - No - M d, Y - - - + + + simple_big_qty + Year + m/d/Y -1 year + m/d/Y + No + Y + + + + virtual_big_qty + Month + m/d/Y -1 month + m/d/Y + Yes + n/Y + + + + simple_big_qty + Day + m/d/Y -1 day + m/d/Y +1 day + No + M d, Y + + + 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 37e7727e7299c..ad89adee0371b 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 26430b8ea9c72..1ccaf332596e0 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 @@ Yes - default + default Customer name_upd_%isolation% title_upd_%isolation% @@ -20,7 +20,7 @@ Yes - default + default Customer name_upd_%isolation% title_upd_%isolation% @@ -31,7 +31,7 @@ No - default + default name_upd_%isolation% title_upd_%isolation% review_upd_%isolation% 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 49add4e530830..ddd49e71ae356 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\TestCase\Injectable; /** - * Test Creation for OrderCountReportEntity - * - * Test Flow: - * * Preconditions: * 1. Create customer * 2. Create orders for customer @@ -24,7 +20,7 @@ * 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 @@ public function __inject(CustomerOrdersReport $customerOrdersReport) } /** - * Order count report view + * Order count report view. * * @param Customer $customer * @param string $orders @@ -73,7 +69,7 @@ public function test(Customer $customer, $orders, array $report, FixtureFactory 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 738b46c38f081..44da2a6f78ced 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 @@ */ --> - - - default,virtual_product - m/d/Y - m/d/Y - Day - 2 - 285 - 570 - - - - default,virtual_product - m/d/Y - m/d/Y - Month - 2 - 285 - 570 - - - - default - m/d/Y - m/d/Y - Year - 1 - 560 - 560 - - - + + + default,virtual_product + m/d/Y + m/d/Y + Day + 2 + 285 + 570 + + + + default,virtual_product + m/d/Y + m/d/Y + Month + 2 + 285 + 570 + + + + default + m/d/Y + m/d/Y + Year + 1 + 560 + 560 + + + 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 2ff69f3435583..0cc474f4a5a2a 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 @@ * 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 @@ public function test(Customer $customer, $orders, array $report, FixtureFactory 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 b985df63c8c56..111490b3550c6 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 @@ */ --> - - - downloadable_product - 1 - - - - two_downloadable_product - 2 - - - - downloadable_product - 0 - - - + + + downloadable_product + 1 + + + + two_downloadable_product + 2 + + + + downloadable_product + 0 + + + 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 a81da13dd13ad..0b35a36c63096 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\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 449a25fd9192d..5bdfba60de783 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 @@ */ --> - - - low_stock_product - - - + + + low_stock_product + + + 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 46bb69f248a90..b56a9e9db9218 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 @@ Reports > Products in Cart Products in Carts - + Reports > Abandoned Carts Abandoned Carts - + Reports > Orders Sales Report - + Reports > Tax Tax Report - + Reports > Invoiced Invoice Report - + Reports > Coupons Coupons Report - + Reports > Order Total Order Total Report - + Reports > Order Count Order Count Report - + Reports > New New Accounts Report - + Reports > Views Product Views Report - + Reports > Bestsellers Best Sellers Report - + Reports > Low Stock Low Stock Report - + Reports > Ordered Ordered Products Report - + Reports > Downloads Downloads Report - + Reports > Refresh statistics Refresh Statistics - + 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 15078aca2addf..04aeb9aa17fa5 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\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 9d23f499e401e..1a8903a9dba5c 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 @@ */ --> - - - default - 1 - m/d/Y - m/d/Y - Year - - - - default - 1 - m/d/Y - m/d/Y - Month - - - - default - 1 - m/d/Y - m/d/Y - Day - - - - default - 0 - m/d/Y 12:00 a+1 day - m/d/Y 12:00 a+1 day - Day - - - + + + default + 1 + m/d/Y + m/d/Y + Year + + + + default + 1 + m/d/Y + m/d/Y + Month + + + + default + 1 + m/d/Y + m/d/Y + Day + + + + default + 0 + m/d/Y 12:00 a+1 day + m/d/Y 12:00 a+1 day + Day + + + 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 f62833e2ba450..0882f100bba3b 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\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 @@ public function __inject(OrderedProductsReport $orderedProducts) } /** - * 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 a05fb0fcc906d..e3dd733ebf82a 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 @@ */ --> - - - default - m/d/Y - m/d/Y - Year - - - - default - m/d/Y - m/d/Y - Month - - - - virtual_product - m/d/Y - m/d/Y - Day - - - + + + default + m/d/Y + m/d/Y + Year + + + + default + m/d/Y + m/d/Y + Month + + + + virtual_product + m/d/Y + m/d/Y + Day + + + 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 92b8ee33316e4..089b129af4e07 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\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 c9c25cc407a1c..fef82ffa1f3a0 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 @@ */ --> - - - frontend_review - - - - + + + frontend_review + + + + 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 c2b2cfec986de..4be8a7343647a 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 @@ - default + default 1 0 - default + default 2 1 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 78c05c8e7d0d8..0be3acf4f5e0d 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 @@ - with_coupon + with_coupon Order Created Year m/d/Y @@ -19,7 +19,7 @@ - with_coupon + with_coupon Order Created Month m/d/Y @@ -31,7 +31,7 @@ - with_coupon + with_coupon Order Updated Day m/d/Y @@ -43,7 +43,7 @@ - with_coupon + with_coupon Order Updated Day m/d/Y 12:00 a-1 day 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 a08d31c92527d..895f48a9ecac2 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\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 302c972e31833..66a1caf735b40 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 @@ - default - full_invoice + default + full_invoice Order Created Year m/d/Y 12:00 a-2 days @@ -20,8 +20,8 @@ - default - full_invoice + default + full_invoice Order Created Month m/d/Y @@ -32,8 +32,8 @@ - default - full_invoice + default + full_invoice Last Invoice Created Date Day m/d/Y 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 dc47c458487d4..ec395cc8e3fd6 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\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 @@ public function __inject(SalesReport $salesReport) } /** - * 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 72c8854bdbb69..36c41bc4d4bdb 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 @@ - default - full_invoice + default + full_invoice Order Created Year m/d/Y 12:00 a-2 days @@ -21,8 +21,8 @@ - default - full_invoice + default + full_invoice Order Created Month m/d/Y @@ -34,8 +34,8 @@ - default - full_invoice + default + full_invoice Order Updated Day m/d/Y 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 03e55d5e38193..f174f4243cd5f 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\Mtf\TestCase\Injectable; /** - * Test Creation for SalesRefundsReportEntity - * - * Test Flow: - * * Preconditions: * 1. Open Backend * 2. Go to Reports > Sales > Refunds @@ -29,7 +25,7 @@ * 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 @@ public function __inject(RefundsReport $refundsReport) } /** - * 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 682ab24c2ca14..6940f00d89337 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 @@ assert refunds year report - default - full_invoice + default + full_invoice Order Created Year m/d/Y 12:00 a-2 days @@ -21,8 +21,8 @@ assert refunds month report - default - full_invoice + default + full_invoice Order Created Month m/d/Y @@ -33,8 +33,8 @@ assert refund Daily report - default - full_invoice + default + full_invoice Last Credit Memo Created Date Day m/d/Y 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 d9b0e19e90043..84d96da76d4f5 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 @@ * 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 6448cc2b7fcd3..4010b2753be8f 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 @@ - - custom_rule - default + custom_rule + default Pending Order Created Day @@ -23,8 +23,8 @@ invoice - custom_rule - default + custom_rule + default Processing Order Created Month @@ -38,8 +38,8 @@ invoice,shipment - custom_rule - default + custom_rule + default Complete Order Updated Year 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 eba901312b796..7321dcaf84aff 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\TestCase\Injectable; /** - * Test Flow: * Preconditions: * 1. Products is created. * @@ -102,7 +101,7 @@ protected function createProducts($product, $countProduct) 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 b3ffcb9746fa5..6a4aef2eea91f 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 @@ */ --> - - - product_with_url_key - 1 - 2 - - - - - product_with_url_key - 3 - 1 - - - - + + + product_with_url_key + 1 + 2 + + + + + product_with_url_key + 3 + 1 + + + + 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 af35c7178b0a0..6a75582c9a76c 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\Catalog\Test\Page\Adminhtml\CatalogProductIndex; /** - * Test Flow: * Preconditions: * 1. Create products * 2. Open product page on frontend @@ -121,7 +120,7 @@ protected function prepareProducts($productList) $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 b0d0b350efa71..849c0625dd6b2 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 @@ 1, 1 downloadableProduct::default, bundleProduct::bundle_dynamic_product Month - m/d/Y - 1 month + m/d/Y -1 month m/d/Y No 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 d551947d8c420..4eb0c4f5dd9b2 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 @@ */ --> - - - Rating %isolation% - Main Website/Main Website Store/Default Store View - Yes - - - - - - 0 - - - Rating %isolation% - - - 0 - - - Yes - - - Main Website/Main Website Store/Default Store View - - - + + + + + + + + + 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 a118552b4f5c6..41d99fc38a70e 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 @@ */ --> - - - Approved - - Main Website/Main Website Store/Default Store View - - Guest customer %isolation% - Summary review %isolation% - Text review %isolation% - - - visibleOnDefaultWebsite - 4 - - - - catalogProductSimple::default - - Administrator - - - 0 - - - CURRENT_TIMESTAMP - - - - catalogProductSimple::default - - - - 0 - - - Approved - - - - - - 0 - - - Summary review %isolation% - - - Text review %isolation% - - - Guest customer %isolation% - - - - - - - Main Website/Main Website Store/Default Store View - - - - - - visibleOnDefaultWebsite - 4 - - - - - Administrator - - + + + + + + + + + + + + + + + + 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 6dd94f98ea905..9b1d81495afbd 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 @@ public function __construct(FixtureFactory $fixtureFactory, array $params, array { $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 @@ public function __construct(FixtureFactory $fixtureFactory, array $params, array } /** - * 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 c19487164c895..122894c6c7fc4 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 @@ public function __construct(FixtureFactory $fixtureFactory, array $params, array $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 @@ public function __construct(FixtureFactory $fixtureFactory, array $params, array } /** - * 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 537245718b649..5b3ae814f05f3 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 @@ public function __construct(array $defaultConfig = [], array $defaultData = []) '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 @@ public function __construct(array $defaultConfig = [], array $defaultData = []) '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 3b9bf8f267818..d4b841bdd2c21 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 @@ --> + + Approved + + Main Website/Main Website Store/Default Store View + + Guest customer %isolation% + Summary review %isolation% + Text review %isolation% + + + visibleOnDefaultWebsite + 4 + + + + catalogProductSimple::default + + Administrator + + Approved @@ -17,12 +37,12 @@ review_detail_%isolation% - visibleOnDefaultWebsite + visibleOnDefaultWebsite 5 - catalogProductSimple::default + catalogProductSimple::default @@ -35,7 +55,7 @@ title_%isolation% review_detail_%isolation% - catalogProductSimple::default + catalogProductSimple::default 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 aff4c995ddb80..c1e5de868dfbd 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 ee97d7bb21495..476353bb9203e 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 @@ - catalogProductSimple::default + catalogProductSimple::default Approved Main Website/Main Website Store/Default Store View - visibleOnDefaultWebsite + visibleOnDefaultWebsite 3 John title %isolation% @@ -21,10 +21,10 @@ - catalogProductSimple::default + catalogProductSimple::default Pending Main Website/Main Website Store/Default Store View - visibleOnDefaultWebsite + visibleOnDefaultWebsite 4 Britney title %isolation% @@ -34,10 +34,10 @@ - catalogProductSimple::default + catalogProductSimple::default Not Approved Main Website/Main Website Store/Default Store View - visibleOnDefaultWebsite + visibleOnDefaultWebsite 5 Michael title %isolation% 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 4345551308dc9..31963f958f15e 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 @@ * 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 ee9096bce936c..04bbcfef97c57 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 @@ name_%isolation% title_%isolation% review_%isolation% - visibleOnDefaultWebsite + visibleOnDefaultWebsite 4 - catalogProductSimple::default + catalogProductSimple::default @@ -27,7 +27,7 @@ name_%isolation% title_%isolation% review_%isolation% - catalogProductSimple::default + catalogProductSimple::default test_type:acceptance_test 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 129b383ffe285..0706a383cdf9f 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 e9e63c56232ca..3c134bab6d150 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 @@ - default + default 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 0efdc08ef19dc..309624db2a3b6 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 @@ - frontend_review + frontend_review Approved Nick%isolation% Title %isolation% @@ -18,7 +18,7 @@ - frontend_review + frontend_review Not Approved Nick%isolation% Title %isolation% 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 28dff5a865f37..b5ff135352ebe 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 @@ * 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 @@ public function __prepare(FixtureFactory $fixtureFactory) { $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 684b093219193..12a7623476b4f 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 @@ - review_for_simple_product_with_rating + review_for_simple_product_with_rating name_upd_%isolation% title_upd_%isolation% review_upd_%isolation% 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 ed403d78e22b9..6eb392b6d8ccf 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 @@ public function updateProductsData(array $products) ['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 406aa612ce94d..9eed5cedd9768 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 @@ 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 @@ public function getCheckoutData(array $fields, $currency = '$') } /** - * 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 ec2f37205a20d..8edbfb720f709 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 445ff602c8a82..1c16624c4290e 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\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 @@ public function processAssert( */ 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 e5e9d7d6f475e..d65cebe5a9456 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 @@ */ --> - - - - default - - false - USD - flatrate_flatrate - - checkmo - - - free - - - US_address - - - catalogProductSimple::default - - - default_store_view - - - - - catalogProductSimple::default - - - - - - - - - - - - - - - - - - - - - - - default_store_view - - - - - default - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - US_address - - - - - - - - - - - - - - - - - checkmo - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - free - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - USD - - - - - - - - - - - - - - - - - - - - - flatrate_flatrate - - - - - - - - - - - - - - - - - - - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + 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 8aaa2b0cc381d..ec8e9857e5150 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 @@ */ class BillingAddressId extends DataSource { - /** - * Current preset. - * - * @var string - */ - protected $currentPreset; - /** * @constructor * @param FixtureFactory $fixtureFactory @@ -35,8 +28,8 @@ public function __construct(FixtureFactory $fixtureFactory, array $data, array $ $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 0a28aff4f63e9..25017987e5fc7 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 @@ public function __construct(FixtureFactory $fixtureFactory, array $data, array $ $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 b970afcd0d1ab..30233046c6bf6 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 @@ public function __construct(FixtureFactory $fixtureFactory, array $params, array $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 7b99bad4281b9..cf25a0130f886 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 @@ */ class EntityId extends DataSource { - /** - * Current preset. - * - * @var string - */ - protected $currentPreset; - /** * @constructor * @param FixtureFactory $fixtureFactory @@ -42,8 +35,8 @@ public function __construct(FixtureFactory $fixtureFactory, array $data, array $ 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 0de14ee47f836..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Fixture/OrderInjectable/Price.php +++ /dev/null @@ -1,74 +0,0 @@ -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 11579ab84e9e8..4f576f5d48b8d 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 @@ public function __construct(FixtureFactory $fixtureFactory, array $data, array $ { $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 b86502663dbd5..5cea54a5f707f 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 @@ */ --> - - - order_status%isolation% - orderLabel%isolation% - - - order_status%isolation% - - - orderLabel%isolation% - - - - - - 0 - - - 0 - + + + + + + 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 ad56dea2c043b..ca26062f43e66 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 @@ */ --> - - - - - + + + + + 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 bf4d778894b7b..f5259e343cebe 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 @@ - + 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 e08828f7bff3b..1429cfef55464 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 @@ catalogProductSimple::default - default + default - US_address + US_address - default_store_view + default_store_view flatrate_flatrate @@ -36,13 +36,13 @@ catalogProductSimple::default,catalogProductSimple::default - default + default - US_address + US_address - default_store_view + default_store_view flatrate_flatrate @@ -60,13 +60,13 @@ catalogProductVirtual::default - default + default - US_address + US_address - default_store_view + default_store_view checkmo @@ -83,13 +83,13 @@ downloadableProduct::with_two_bought_links - default + default - US_address + US_address - default_store_view + default_store_view checkmo @@ -106,13 +106,13 @@ downloadableProduct::with_two_bought_links, downloadableProduct::with_two_bought_links - default + default - US_address + US_address - default_store_view + default_store_view checkmo @@ -129,13 +129,13 @@ catalogProductSimple::default - default + default - US_address + US_address - default_store_view + default_store_view flatrate_flatrate @@ -147,10 +147,10 @@ 0 USD - active_sales_rule_for_all_groups + active_sales_rule_for_all_groups - default_with_discount + default_with_discount @@ -159,13 +159,13 @@ catalogProductSimple::default - default + default - US_address + US_address - default_store_view + default_store_view flatrate_flatrate @@ -177,10 +177,10 @@ 0 USD - active_sales_rule_for_all_groups + active_sales_rule_for_all_groups - default_with_discount + default_with_discount @@ -189,13 +189,13 @@ catalogProductSimple::simple_big_qty - johndoe_unique + johndoe_unique - US_address + US_address - default_store_view + default_store_view flatrate_flatrate @@ -213,13 +213,13 @@ catalogProductVirtual::virtual_big_qty - johndoe_unique + johndoe_unique - US_address + US_address - default_store_view + default_store_view flatrate_flatrate 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 0000000000000..9f0c076288e87 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Repository/OrderInjectable/Price.xml @@ -0,0 +1,47 @@ + + + + + + 560 + 280 + + + + + 565 + 565 + + + + + + 210 + 110 + + + + + + 565 + + + + + + 555 + + + + + + 110 + + + + 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 f75105b141332..0ddc727fd502b 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 @@ * 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 043c556bc3fc6..bf5098ff6b6b7 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 @@ cancel order and check status on storefront - default + default catalogProductSimple::default,catalogProductSimple::default Canceled 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 daf610dee8cd2..2558af19e058d 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 @@ * 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 1d730f56e5bbc..bbdf7ba05ebd6 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 @@ Assert items return to stock (partial refund) Yes 1 - default + default catalogProductSimple::product_100_dollar - partial_refund + partial_refund @@ -28,9 +28,9 @@ 0 5 10 - default + default catalogProductSimple::default - full_refund_with_zero_shipping_refund + full_refund_with_zero_shipping_refund 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 1c490060364c9..6fe0937884274 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 @@ * 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 43b018bc8b8c2..a8aa9e15a666d 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 @@ - default - full_invoice + default + full_invoice catalogProductSimple::default 1 - @@ -25,8 +25,8 @@ - default - partial_invoice + default + partial_invoice catalogProductSimple::product_100_dollar - 1 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 c95042db6b0a0..b5329ca2860ac 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 @@ * 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 db4354d4bb588..5fd3348a6ff24 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 @@ Create order with simple product for registered US customer using Fixed shipping method and Cash on Delivery payment method catalogProductSimple::default - default - US_address_1_without_email + default + US_address_1_without_email No Flat Rate Fixed @@ -31,8 +31,8 @@ Create order with virtual product for registered UK customer using Check/Money Order payment method catalogProductVirtual::default - default - UK_address_without_email + default + UK_address_without_email false 10.00 @@ -50,8 +50,8 @@ Create order with simple product for registered US customer using Fixed shipping method and Bank Transfer payment method catalogProductSimple::default - default - US_address_1_without_email + default + US_address_1_without_email No Flat Rate Fixed @@ -71,8 +71,8 @@ Create order with virtual product for registered UK customer using Bank Transfer payment method catalogProductVirtual::default - default - UK_address_without_email + default + UK_address_without_email No false @@ -91,9 +91,9 @@ Create order with simple product for registered US customer using Fixed shipping method and Purchase Order payment method catalogProductSimple::default - default + default No - US_address_1_without_email + US_address_1_without_email Flat Rate Fixed @@ -114,10 +114,10 @@ MAGETWO-12395 - Create Offline Order for Registered Customer in Admin catalogProductSimple::simple_10_dollar, configurableProduct::with_one_option us_ca_ny_rule - default + default No login - US_address_1_without_email + US_address_1_without_email Flat Rate Fixed @@ -133,10 +133,10 @@ MAGETWO-12520 - Create Order for New Customer in Admin with Offline Payment Method catalogProductSimple::simple_10_dollar, configurableProduct::with_one_option us_ca_ny_rule - default + default Yes register - US_address_1_without_email + US_address_1_without_email Flat Rate Fixed 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 b860583704c39..63eb24aba3682 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 @@ hold order and check status in my account on storefront - default + default catalogProductSimple::default,catalogProductSimple::default Invoice,Cancel,Reorder,Ship,Edit On Hold 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 264f392cf0123..6457d6841a3b7 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 @@ * 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 @@ protected function createOrders($count, $steps) $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 db32b31002732..9a78652cbb694 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 @@ - default + default catalogProductSimple::default - default + default configurableProduct::default 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 19e90720cd324..22539711206dc 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 @@ * 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 46f32296f578d..5bbdc4f923853 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 @@ * 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 2f203c368077e..d6d903187cf40 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 @@ - johndoe_with_addresses + johndoe_with_addresses - US_address_1_without_email + US_address_1_without_email checkmo 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 c46e4319f9b9f..f3efcdf27459b 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 @@ Reorder placed order (update products, billing address). - two_simple_product + two_simple_product active_sales_rule_with_fixed_price_discount_coupon - default - US_address_1_without_email + default + US_address_1_without_email Flat Rate Fixed 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 c429fc46730d9..cecac4451c941 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 @@ unassign order status - assign_to_pending + assign_to_pending Pending 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 ef538ec608e8b..f342cb2b53bc8 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 @@ change status label to existed - default + default No Suspected Fraud @@ -17,7 +17,7 @@ change status label to new and check orderStatus for order with changed orderStatus - assign_to_pending + assign_to_pending Yes orderLabel%isolation% 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 9008a93b8a36b..e02f275c2dfdd 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 @@ */ --> - - - Default price rule %isolation% - Active - - Main Website - - - NOT LOGGED IN - General - Wholesale - Retailer - - No Coupon - Percent of product price discount - 50 - + - - Default price rule %isolation% - + - - 0 - - - Active - + + - - 1 - - - 1 - + + - - 0 - - - Percent of product price discount - - - 50 - + + + - - 0 - - - 0 - - - 0 - - - No Coupon - - - 0 - - - 0 - + + + + + + - - - Main Website - - - - - NOT LOGGED IN - General - Wholesale - Retailer - - + + 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 652a596b0f3af..5f0d0df94604f 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 @@ --> + + Default price rule %isolation% + Active + + Main Website + + + NOT LOGGED IN + General + Wholesale + Retailer + + No Coupon + Percent of product price discount + 50 + + Cart Price Rule with Specific Coupon %isolation% Description for Cart Price Rule 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 1a40513ce1e2b..906a7b51a359b 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 @@ public function __inject( */ 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 49441220295d9..11990ab3006da 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 @@ Main Website NOT LOGGED IN No Coupon - {Product attribute combination:[Attribute Set|is|Default]} + {Product attribute combination:[Product Template|is|Default]} Percent of product price discount 50 No 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 2d76e09d87b8c..980ffa3d0ada6 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 @@ - active_sales_rule_with_percent_price_discount_coupon + active_sales_rule_with_percent_price_discount_coupon - active_sales_rule_with_complex_conditions + active_sales_rule_with_complex_conditions - inactive_sales_rule + inactive_sales_rule 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 84c524d9cec06..a1ef4b347fef4 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 @@ public function __prepare(FixtureFactory $fixtureFactory) { $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 f4f2c01eeccec..b46f67e76b393 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 @@ - active_sales_rule_with_complex_conditions + active_sales_rule_with_complex_conditions {Conditions combination:[[Shipping Method|is|\[flatrate\] Fixed][Shipping Postcode|is|95814][Shipping State/Province|is|California][Shipping Country|is|United States]]} Buy X get Y free (discount amount is Y) 1 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 c9b0fc0283473..56db436ccb68d 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 @@ public function run() 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 4391265ca5bb5..9402ee203c7ad 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 @@ * 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 aeb61fe1fc158..ac41244817e64 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 @@ shipment with tracking number - default + default catalogProductSimple::default 1 - @@ -26,7 +26,7 @@ partial shipment - default + default catalogProductSimple::product_100_dollar 1 1 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 6927691a7aa8e..b225aa55e33a7 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 @@ */ --> - - - sitemap.xml - / - - - - - - - - - sitemap.xml - - - / - - - - - - 0 - - + + + + + + + + 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 5e7be0f681c88..e204dd90f9a2f 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 @@ - default + default 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 35dce3f104254..51c3f79b2b901 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 @@ */ --> - - - - default - - Default Store View - default - Enabled - 1 - - - 1 - - - default - - - 0 - - - - default - - - - Default Store View - - - 0 - - - Enabled - + + + + + + + + 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 9ec18c42b26f2..ef38ef4250823 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 @@ public function __construct(FixtureFactory $fixtureFactory, array $params, array } } - /** - * 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 c64a13ab523e9..c1fa4d6a8ac0f 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 @@ */ --> - - - - main_website - - StoreGroup%isolation% - - default_category - - - - - - - - main_website - - - - StoreGroup%isolation% - - - - default_category - - - - 0 - + + + + + + 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 ca4f11663f342..23c3fa9a38508 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 @@ public function __construct(FixtureFactory $fixtureFactory, array $params, array } } - /** - * 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 36e20106ce00e..448a55ced512c 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 @@ public function __construct(FixtureFactory $fixtureFactory, array $params, array } } - /** - * 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 4614615109090..574f78cb6bc84 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 @@ */ --> - - - Main Website - base - 1 - - - 1 - - - base - - - Main Website - - - 0 - - - 0 - - - 0 - + + + + + + + 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 a04123718ed74..f14e959ce90cb 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 @@ - default + default Default Store View base @@ -19,7 +19,7 @@ - default + default Custom_Store_%isolation% code_%isolation% @@ -31,14 +31,14 @@ 1 - + All Store Views 0 - default + default DE%isolation% de%isolation% 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 286213fdb3c2e..b04cb4b8af12c 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 @@ - main_website + main_website Main Website Store 1 - default_category + default_category - main_website + main_website store_name_%isolation% - default_category + default_category 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 6c33406d71eb2..15313c96f297b 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 @@ --> + + Main Website + base + 1 + + All Websites 0 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 4ba86215b1c13..a6bf8369d64d8 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 @@ - default + default store_name_%isolation% storecode_%isolation% Enabled @@ -19,7 +19,7 @@ - default + default store_name_%isolation% storecode_%isolation% Disabled @@ -30,7 +30,7 @@ - custom + custom store_name_%isolation% storecode_%isolation% Enabled @@ -42,7 +42,7 @@ MAGETWO-12405: Create New Localized Store View - default + default DE_%isolation% de_%isolation% Enabled 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 9e96f8393d8da..117b2010f23c7 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 @@ - main_website + main_website store_name_%isolation% - default_category + default_category - custom_website + custom_website store_name_%isolation% - root_category + root_category 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 debf3cb6b6ea0..e6a8f499b7a30 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 @@ * 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 8abbb20c16e26..a81812963821b 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 @@ - custom + custom Yes @@ -16,7 +16,7 @@ - custom + custom No 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 26afef08b4b80..c7f54be88b9be 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 @@ - custom + custom Yes - custom + custom No 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 ccccd1f171894..e1e5a410e5e5a 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 @@ - custom_website + custom_website Yes - custom_website + custom_website No 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 f6e5f58018e76..b3102104f5bb1 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 @@ - custom - default + custom + default storename_updated%isolation% storecode_updated%isolation% Enabled 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 01bf7915792be..45aba74539d91 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 @@ - custom - main_website + custom + main_website store_name_updated_%isolation% - default_category + default_category - custom - custom_website + custom + custom_website store_name_updated_%isolation% - root_category + root_category 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 4190be02bea35..a0ed810288afe 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 @@ - custom_website + custom_website website_upd%isolation% code_upd%isolation% 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 f5d516b6f6957..1c93dc11aeee2 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 @@ public function processAssert( $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 @@ public function processAssert( 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 @@ protected function preparePrices($prices) 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 4661c262f9cce..3f3fe4e112b6b 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 protected function getOrderTotals($actualPrices); * @param CheckoutOnepage $checkoutOnepage * @param CheckoutOnepageSuccess $checkoutOnepageSuccess * @param CustomerOrderView $customerOrderView + * @param CmsIndex $cmsIndex * @return void */ public function processAssert( @@ -73,27 +75,32 @@ public function processAssert( 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 @@ public function processAssert( * 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 95ed90babd4f4..5620cefee21a4 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 @@ public function processAssert( $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 @@ public function getCartPrices(InjectableFixture $product, $actualPrices) { $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 57e9269dd9b79..b25d8698d16ee 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 @@ public function getReviewTotals($actualPrices) */ 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 51476690a8897..51caa4822fa60 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 @@ public function processAssert( $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 30710bb5b2f81..7c33ce4479eb8 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 @@ */ --> - - - Tax Class %isolation% - - - - - - Tax Class %isolation% - - - CUSTOMER - - - + + + + + + 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 b9a4a30142690..93925c39ddecd 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 @@ */ --> - - - Tax Rate %isolation% - 10 - United States - * - California - - - - - - United States - - - California - - - * - - - Tax Rate %isolation% - - - 10 - - - - - - - - - - - - + + + + + + + + + + + + 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 b53f3f1eba5d9..671a12d176951 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 @@ */ --> - - - TaxIdentifier%isolation% - - US-CA-Rate_1 - - - - - - - TaxIdentifier%isolation% - - - - - - - - - - - US-CA-Rate_1 - - - - - - + + + + + + + + + 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 b40b943db5786..2befe872139d2 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 @@ * 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 238a754ee6048..3af39e10a3203 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 @@ * 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 e8cd16287bce0..31757f3a6c34b 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 @@ tax 1 - Excluding Tax + Including Tax 0 tax 1 - After Discount - 1 + Before Discount + 0 tax 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 3e9c69f527b74..c75bcdc7ba799 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 @@ --> + + Tax Class %isolation% + + 2 Taxable Goods 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 c3e875e6e9482..85abb1aa13287 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 @@ --> + + Tax Rate %isolation% + 10 + United States + * + California + + 1 US 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 801382ccf4b17..42d64c06e719f 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 @@ --> + + TaxIdentifier%isolation% + + US-CA-Rate_1 + + + TaxIdentifier%isolation% - + us_ca_rate_8_25 us_ny_rate_8_375 @@ -22,19 +29,19 @@ Tax Rule %isolation% - + US-CA-Rate_1 us_ny_rate_8_1 - + retail_customer customer_tax_class - + taxable_goods product_tax_class @@ -46,7 +53,7 @@ TaxIdentifier%isolation% - + uk_full_tax_rate @@ -57,17 +64,17 @@ TaxIdentifier%isolation% - + US-CA-Rate_1 - + retail_customer - + taxable_goods @@ -78,19 +85,19 @@ TaxIdentifier%isolation% - + US-CA-Rate_1 US-NY-Rate_1 - + retail_customer customer_tax_class - + product_tax_class taxable_goods @@ -102,7 +109,7 @@ TaxIdentifier%isolation% - + us_ca_rate_8_25_no_zip us_ny_rate_8_25 @@ -114,7 +121,7 @@ TaxIdentifier%isolation% - + us_ca_rate_8_375 us_ny_rate_8_25 @@ -126,7 +133,7 @@ TaxIdentifier%isolation% - + us_ca_rate_8_25_no_zip us_ny_rate_8_375 @@ -138,7 +145,7 @@ TaxIdentifier%isolation% - + tx_rate_10 ny_rate_20 ca_rate_30 @@ -151,17 +158,17 @@ Tax Rule %isolation% - + uk_full_tax_rate - + retail_customer - + taxable_goods 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 d5407ecf878f3..dd6d2d00fc55c 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 @@ MAGETWO-13436: Automatic Apply Tax Based on VAT ID. - enable_VAT_on_frontend + enable_VAT_on_frontend default_tax_configuration, flatrate, checkmo, store_information_DE_with_VAT, enable_VAT_on_frontend - customer_UK_address_with_VAT - default + customer_UK_address_with_VAT + default catalogProductSimple::product_10_dollar - customer_UK_address_with_VAT - UK_address_with_VAT - retailer_uk_full_tax_rule + customer_UK_address_with_VAT + UK_address_with_VAT + retailer_uk_full_tax_rule valid_intra_union_group 10 2 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 ae00c783d685b..c1fd40dbf47e4 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 @@ * 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 98d3605d2f2f2..c3792a803da00 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 @@ * 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 b919c1584ec37..e3a83b20d90e6 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 @@ TaxIdentifier%isolation% - US-CA-Rate_1 - - - - - - - - + US-CA-Rate_1 + - + - + - + - TaxIdentifier%isolation% - US-CA-Rate_1 - US-NY-Rate_1 - customer_tax_class - - - product_tax_class - - + US-CA-Rate_1 + US-NY-Rate_1 + customer_tax_class + - + product_tax_class + - 1 1 @@ -35,12 +35,12 @@ Creating tax rule with new tax classes and tax rate TaxIdentifier%isolation% - default - US-NY-Rate_1 - US-CA-Rate_1 - retail_customer - customer_tax_class - taxable_goods + default + US-NY-Rate_1 + US-CA-Rate_1 + retail_customer + customer_tax_class + taxable_goods 1 @@ -48,12 +48,12 @@ TaxIdentifier%isolation% - withZipRange - US-CA-Rate_1 - retail_customer - customer_tax_class - taxable_goods - product_tax_class + withZipRange + US-CA-Rate_1 + retail_customer + customer_tax_class + taxable_goods + product_tax_class 1 @@ -62,12 +62,12 @@ MAGETWO-12438: Create Tax Rule with New and Existing Tax Rate, Customer Tax Class, Product Tax Class TaxIdentifier%isolation% - US-CA-*-Rate 1 - us_ny_rate_8_1 - retail_customer - customer_tax_class - taxable_goods - product_tax_class + US-CA-*-Rate 1 + us_ny_rate_8_1 + retail_customer + customer_tax_class + taxable_goods + product_tax_class bamboo_plan:end_to_end,test_type:acceptance_test, stable:no 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 cc3ac1c0efb0b..3f5138c04257f 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 @@ - default + default 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 8c8aa1e3888b4..444a019050cbc 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 @@ - tax_rule_with_custom_tax_classes + tax_rule_with_custom_tax_classes United States California 90001 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 50c3d439a11fb..0e62906603bbc 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 @@ active_sales_rule_for_all_groups_no_coupon - customer_equals_store_rate - johndoe_unique + johndoe_unique 3 277.14 300.00 @@ -43,7 +43,7 @@ active_sales_rule_for_all_groups_no_coupon - customer_greater_store_rate - johndoe_unique + johndoe_unique 3 90.99 98.61 @@ -72,7 +72,7 @@ active_sales_rule_for_all_groups_no_coupon - customer_less_store_rate - johndoe_unique + johndoe_unique 3 90.99 98.50 @@ -101,7 +101,7 @@ active_sales_rule_for_all_groups_no_coupon - customer_less_store_rate - johndoe_unique + johndoe_unique 3 83.05 89.90 @@ -130,7 +130,7 @@ active_sales_rule_for_all_groups_no_coupon - customer_less_store_rate - johndoe_unique + johndoe_unique 3 276.81 299.65 @@ -159,7 +159,7 @@ active_sales_rule_for_all_groups_no_coupon - customer_equals_store_rate - johndoe_unique + johndoe_unique 3 90.00 97.43 @@ -188,7 +188,7 @@ active_sales_rule_for_all_groups_no_coupon - customer_equals_store_rate - johndoe_unique + johndoe_unique 3 90.99 98.50 @@ -217,7 +217,7 @@ active_sales_rule_for_all_groups_no_coupon - customer_greater_store_rate - johndoe_unique + johndoe_unique 3 84.06 91.10 @@ -246,7 +246,7 @@ active_sales_rule_for_all_groups_no_coupon - customer_greater_store_rate - johndoe_unique + johndoe_unique 3 300.00 325.13 @@ -275,7 +275,7 @@ active_sales_rule_for_all_groups_no_coupon - customer_greater_store_rate - johndoe_unique + johndoe_unique 3 90.00 97.54 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 b67edd7a4c178..b8b1f95c2b998 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 @@ public function __prepare(FixtureFactory $fixtureFactory) 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 @@ protected function createCustomers() $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 82218491cf409..e01bee641331b 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 @@ - with_one_custom_option_and_category + with_one_custom_option_and_category cross_border_enabled_price_incl_tax, display_excluding_including_tax - product_with_category - cart_rule + product_with_category + cart_rule cross_border_enabled_price_incl_tax, display_excluding_including_tax - product_with_category - catalog_price_rule_priority_0 + product_with_category + catalog_price_rule_priority_0 cross_border_enabled_price_incl_tax, display_excluding_including_tax - product_with_special_price_and_category + product_with_special_price_and_category cross_border_enabled_price_incl_tax, display_excluding_including_tax - product_with_category + product_with_category cross_border_enabled_price_excl_tax, display_excluding_including_tax 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 c8205ff306c4f..23a2f6460cecc 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 @@ - default + default TaxIdentifier%isolation% No 90001 @@ -20,7 +20,7 @@ - default + default TaxIdentifier%isolation% Yes 90001 @@ -33,7 +33,7 @@ - default + default TaxIdentifier%isolation% No * @@ -44,7 +44,7 @@ - withZipRange + withZipRange TaxIdentifier%isolation% No 180 @@ -56,7 +56,7 @@ - withZipRange + withZipRange TaxIdentifier%isolation% Yes 1 @@ -67,7 +67,7 @@ - withZipRange + withZipRange TaxIdentifier%isolation% No * 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 49c320262784e..07ed1106f3a7b 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 @@ * 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 1cc98aeb5bf1a..3941a395d7dcf 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 @@ - tax_rule_default + tax_rule_default New Tax Rule name%isolation% - default - customer_tax_class - product_tax_class - product_tax_class + default + customer_tax_class + product_tax_class + product_tax_class 2 2 @@ -21,44 +21,44 @@ - tax_rule_with_custom_tax_classes - withZipRange - retail_customer - product_tax_class - taxable_goods + tax_rule_with_custom_tax_classes + withZipRange + retail_customer + product_tax_class + taxable_goods - tax_rule_with_custom_tax_classes + tax_rule_with_custom_tax_classes United States Utah 84001 Flat Rate Fixed 5 - us_ut_fixed_zip_rate_20 - - - product_tax_class - - + us_ut_fixed_zip_rate_20 + - + product_tax_class + - - tax_rule_with_custom_tax_classes + tax_rule_with_custom_tax_classes United States Idaho 83201 Flat Rate Fixed 5 - withFixedZip - - - product_tax_class - - + withFixedZip + - + product_tax_class + - 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 a0f5183841333..a587216002ed8 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 @@ public function run() 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 6fc10ed38d6c5..ac03a7e25283f 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 @@ MAGETWO-12848 – Use UPS Online Shipping Carrier on Checkout as a Registered Customer catalogProductSimple::default, configurableProduct::default, bundleProduct::bundle_fixed_product login - default - US_address_1 + default + US_address_1 United Parcel Service UPS Ground UPS Ground @@ -27,9 +27,9 @@ Check Out as Guest using UPS with US shipping origin and UK customer catalogProductSimple::default, configurableProduct::default, bundleProduct::bundle_fixed_product guest - default - UK_address - UK_address + default + UK_address + UK_address United Parcel Service UPS Worldwide Expedited UPS Worldwide Expedited 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 f0fda4e5442de..e2e122faa0a5e 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 @@ */ --> - - - Main Website/Main Website Store/Default Store View - test_request%isolation% - - - - Main Website/Main Website Store/Default Store View - - - - test_request%isolation% - - - - - - target_path%isolation% - - - + + + + + + + + + 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 5d234bfab7156..bd669eb51ab7a 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 @@ public function __construct(FixtureFactory $fixtureFactory, array $params, $data $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 @@ public function __construct(FixtureFactory $fixtureFactory, array $params, $data } $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 44614ad583261..414760395e02d 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 @@ public function __construct(FixtureFactory $fixtureFactory, array $params, $data $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 @@ public function __construct(FixtureFactory $fixtureFactory, array $params, $data } /** - * 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 636a64f31e559..8039caec15da8 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 @@ public function __inject( $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 623d03d64103a..c2bd659b50604 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 @@ * 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 4413afea5711c..8eb1de56fe44f 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 @@ MAGETWO-12409: Add Temporary Redirect for Product For product - product_with_category + product_with_category Main Website/Main Website Store/Default Store View cat%isolation%/simp_redirect%isolation%.html Temporary (302) @@ -22,7 +22,7 @@ Create Product URL Rewrites with no redirect For product - default + default Main Website/Main Website Store/Default Store View test_%isolation%.html No @@ -32,7 +32,7 @@ Create Product URL Rewrites with Temporary redirect For product - default + default Main Website/Main Website Store/Default Store View test_%isolation%.html Temporary (302) @@ -43,7 +43,7 @@ Create Product URL Rewrites with Permanent redirect For product - default + default Main Website/Main Website Store/Default Store View test_%isolation%.html Permanent (301) 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 e3a67cc49fbed..1e855d511f0f2 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 @@ - default + default 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 8b9bf1859b06a..f682028be63b8 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 @@ - default_without_target + default_without_target product/%catalogProductSimple::product_100_dollar% 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 25a5f58638c93..a794d6a8b18fb 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 @@ * 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 @@ public function __inject( $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 76f9b2e73f7d4..5e20d3ac2af75 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 @@ Main Website/Main Website Store/Default Store View - default_subcategory - default + default_subcategory + default - test_request%isolation% No @@ -21,8 +21,8 @@ Main Website/Main Website Store/Default Store View - default_subcategory - default + default_subcategory + default - request_path%isolation%.html Temporary (302) @@ -33,8 +33,8 @@ Main Website/Main Website Store/Default Store View - default_subcategory - default + default_subcategory + default - request_path%isolation%.htm Permanent (301) @@ -45,8 +45,8 @@ Main Website/Main Website Store/Default Store View - default_subcategory - default + default_subcategory + default - request_path%isolation%.aspx Temporary (302) 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 989f7cab4a684..bb0fa6ed624a9 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 @@ - default + default Main Website/Main Website Store/Default Store View wishlist/%isolation% http://www.magentocommerce.com/magento-connect/ @@ -19,7 +19,7 @@ - custom_rewrite_wishlist + custom_rewrite_wishlist Main Website/Main Website Store/Default Store View wishlist/%isolation% catalogsearch/result/?q=$%catalogProductSimple::defaul%sku$ 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 3b7562540e692..dd3f4d91257ff 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 @@ public function test(UrlRewrite $urlRewrite, FixtureFactory $fixtureFactory) $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 0000000000000..db943e911a3d0 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserFailedLoginByPermissionMessage.php @@ -0,0 +1,49 @@ +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 e01aa9a9cd0cd..1f55c18690f74 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 @@ */ 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 39ac5778e0cc3..a013071cb9c75 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 @@ */ --> - - - AdminRole%isolation% - All - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - AdminRole%isolation% - - - - - - All - - - + + + + + + + + + + + + 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 bd716bbeabb47..6ec27d7a9941b 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 @@ public function __construct(FixtureFactory $fixtureFactory, array $params, array } } - /** - * 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 80c969cf4bbfe..a6a92e41d6446 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 @@ */ --> - - - AdminUser%isolation% - FirstName%isolation% - LastName%isolation% - email%isolation%@example.com - 123123q - 123123q - Active - %current_password% - - - - - - FirstName%isolation% - - - LastName%isolation% - - - email%isolation%@example.com - - - AdminUser%isolation% - - - 123123q - - - CURRENT_TIMESTAMP - - - - - - - - - 0 - - - 0 - - - Active - - - - - - - - - - - - en_US - - - - 123123q - - - + + + + + + + + + + + + + + + + + + + + + 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 93e9e336080fe..7b0a52176e9a9 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 @@ public function __construct(FixtureFactory $fixtureFactory, array $params, array } } - /** - * 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 ab4fdba7cb44f..9360d3bedf276 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 @@ 123123q 123123q - role::default + role::default %current_password% Active 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 c77bc0c762a3d..487ff415aab3f 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 @@ public function __inject( * @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 @@ public function test( $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 cac4f73a49c5f..127e2d122a32b 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 @@ 123123q 123123q Active - role::Administrators + role::Administrators - %current_password% @@ -31,7 +31,7 @@ 123123q 123123q Inactive - role::Administrators + role::Administrators - %current_password% @@ -46,7 +46,7 @@ 123123q 123123q Active - role::Administrators + role::Administrators username %current_password% @@ -58,7 +58,7 @@ 123123q 123123q Active - role::Administrators + role::Administrators email %current_password% @@ -76,7 +76,7 @@ - + AdminUser%isolation% 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 d6d4c9f9debbc..662992062276a 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 @@ public function __prepare(FixtureFactory $fixtureFactory) { $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 b4cf004d50b01..22421a9557c82 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 @@ public function __prepare(FixtureFactory $fixtureFactory) { $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 1ab6385dacf9b..2603f1744ddf7 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 @@ - custom_admin + custom_admin 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 04daaffc32984..47c30567f6530 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 @@ - custom_admin_with_default_role - role::role_sales + custom_admin_with_default_role + role::role_sales 123123q 0 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 a96e809038e1b..d4d4cf7a2b5f2 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 @@ - custom_admin_with_default_role + custom_admin_with_default_role NewAdminRole%isolation% @@ -16,10 +16,10 @@ - default + default Custom Sales - custom_admin + custom_admin sales 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 b930b0fb8abc7..87c86e00b7317 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 @@ MAGETWO-12444 – Use USPS Online Shipping Carrier on Checkout as a Registered Customer catalogProductSimple::default, configurableProduct::default, bundleProduct::bundle_fixed_product login - default - US_address_1 + default + US_address_1 United States Postal Service Priority Mail 1-Day Priority Mail 1-Day @@ -27,9 +27,9 @@ Check Out as Guest using USPS with US shipping origin and UK customer catalogProductSimple::default, configurableProduct::default, bundleProduct::bundle_fixed_product guest - default - UK_address - UK_address + default + UK_address + UK_address United States Postal Service Priority Mail International Priority Mail International 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 31ae1eafecdbc..18bc8800223b4 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 @@ public function processAssert( $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 c288a4ac3a0e8..5ea25949b0f4b 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 @@ */ --> - - - variableCode%isolation% - variableName%isolation% - <p>html_value</p> - plain_value - - - 0 - - - variableCode%isolation% - - - variableName%isolation% - - - - - - 0 - - - plain_value - - - <p>html_value</p> - - - + + + + + + + + + + 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 827a0fea14fdf..c4ac4c1aafba3 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 @@ --> + + variableCode%isolation% + variableName%isolation% + <p>html_value</p> + plain_value + + variableCode%isolation% 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 c3dc3c5c3a7ac..0db8eee47b842 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 @@ public function __inject( $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 0551b792554d4..2bfd68bcdd2e9 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 8da91bdf5ddcd..1bdedf647cb0b 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 @@ public function test( 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 @@ public function test( ['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 f64c8da3fa6d4..33bac1101c12f 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 @@ * 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 0c2913116d0e2..3598c87f0c5d3 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 @@ * * 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 08e5449de4420..7ea04ced579fa 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 @@ protected function tearDown() { $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 da93f3cdd96ad..f1cba5eb23c09 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 @@ public function testGetHeadersVisibility() $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 @@ public function testToHtmlCartItem() $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 9126bb17030bb..67f69454879ea 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 @@ public function testSaveActionExistingCustomerUnsubscribeNewsletter() $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 0000000000000..e7ecb66641590 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Customer/_files/customer_from_repository.php @@ -0,0 +1,26 @@ +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 cca4391f2940d..a0ea4bf40f7d1 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 @@ public function testCustomerSaveQuoteObserver() * \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 b949c13bad0e3..94bbad3aa4775 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 @@ '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 ef478b16d8e82..452cf6ab1c532 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 @@ '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 626e830864d9f..dece9d9876bad 100644 --- a/lib/internal/Magento/Framework/Api/Search/SearchCriteria.php +++ b/lib/internal/Magento/Framework/Api/Search/SearchCriteria.php @@ -10,25 +10,8 @@ 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 e952763d3fd93..1c8fe9772fb40 100644 --- a/lib/internal/Magento/Framework/Api/Search/SearchCriteriaInterface.php +++ b/lib/internal/Magento/Framework/Api/Search/SearchCriteriaInterface.php @@ -9,17 +9,6 @@ interface SearchCriteriaInterface extends BaseSearchCriteriaInterface { - /** - * @return string - */ - public function getSearchTerm(); - - /** - * @param string $searchTerm - * @return $this - */ - public function setSearchTerm($searchTerm); - /** * @return string */