From e7a90e5e8c8e71e475f9da4dc4d400a1a5dd47d0 Mon Sep 17 00:00:00 2001 From: Oleksandr Ivashchenko Date: Thu, 18 Dec 2014 12:51:36 +0200 Subject: [PATCH 1/8] MAGETWO-17177: mass price update doesn't affect discount price - Created plugin instead of old indexer functionality --- .../Plugin/Model/Product/Action.php | 42 ++++++++++ .../Magento/CatalogRule/etc/adminhtml/di.xml | 3 + .../Plugin/Model/Product/ActionTest.php | 79 +++++++++++++++++++ 3 files changed, 124 insertions(+) create mode 100644 app/code/Magento/CatalogRule/Plugin/Model/Product/Action.php create mode 100644 dev/tests/unit/testsuite/Magento/CatalogRule/Plugin/Model/Product/ActionTest.php diff --git a/app/code/Magento/CatalogRule/Plugin/Model/Product/Action.php b/app/code/Magento/CatalogRule/Plugin/Model/Product/Action.php new file mode 100644 index 0000000000000..c9dbc6742abff --- /dev/null +++ b/app/code/Magento/CatalogRule/Plugin/Model/Product/Action.php @@ -0,0 +1,42 @@ +productRuleProcessor = $productRuleProcessor; + } + + /** + * @param ProductAction $object + * @param ProductAction $result + * @return ProductAction + * + * @SuppressWarnings(PHPMD.UnusedFormatParameter) + */ + public function afterUpdateAttributes(ProductAction $object, ProductAction $result) + { + $data = $result->getAttributesData(); + if (!empty($data['price'])) { + $this->productRuleProcessor->reindexList($result->getProductIds()); + } + + return $result; + } +} diff --git a/app/code/Magento/CatalogRule/etc/adminhtml/di.xml b/app/code/Magento/CatalogRule/etc/adminhtml/di.xml index 55eca2f1b83ae..7268cb0de6eda 100644 --- a/app/code/Magento/CatalogRule/etc/adminhtml/di.xml +++ b/app/code/Magento/CatalogRule/etc/adminhtml/di.xml @@ -31,4 +31,7 @@ + + + diff --git a/dev/tests/unit/testsuite/Magento/CatalogRule/Plugin/Model/Product/ActionTest.php b/dev/tests/unit/testsuite/Magento/CatalogRule/Plugin/Model/Product/ActionTest.php new file mode 100644 index 0000000000000..189e4b63018d7 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/CatalogRule/Plugin/Model/Product/ActionTest.php @@ -0,0 +1,79 @@ +productRuleProcessor = $this->getMockBuilder( + 'Magento\CatalogRule\Model\Indexer\Product\ProductRuleProcessor' + )->disableOriginalConstructor() + ->setMethods(['reindexList']) + ->getMock(); + + $this->action = new Action($this->productRuleProcessor); + } + + public function testAfterUpdateAttributes() + { + $subject = $this->getMockBuilder('Magento\Catalog\Model\Product\Action') + ->disableOriginalConstructor() + ->setMethods([]) + ->getMock(); + + $result = $this->getMockBuilder('Magento\Catalog\Model\Product\Action') + ->disableOriginalConstructor() + ->setMethods(['getAttributesData', 'getProductIds']) + ->getMock(); + + $result->expects($this->once()) + ->method('getAttributesData') + ->willReturn([]); + + $result->expects($this->never()) + ->method('getProductIds'); + + $this->productRuleProcessor->expects($this->never()) + ->method('reindexList'); + + $this->action->afterUpdateAttributes($subject, $result); + } + + public function testAfterUpdateAttributesWithPrice() + { + $productIds = [1, 2, 3]; + $subject = $this->getMockBuilder('Magento\Catalog\Model\Product\Action') + ->disableOriginalConstructor() + ->setMethods([]) + ->getMock(); + + $result = $this->getMockBuilder('Magento\Catalog\Model\Product\Action') + ->disableOriginalConstructor() + ->setMethods(['getAttributesData', 'getProductIds']) + ->getMock(); + + $result->expects($this->once()) + ->method('getAttributesData') + ->willReturn(['price' => 100]); + + $result->expects($this->once()) + ->method('getProductIds') + ->willReturn($productIds); + + $this->productRuleProcessor->expects($this->once()) + ->method('reindexList') + ->with($productIds); + + $this->action->afterUpdateAttributes($subject, $result); + } +} From 8f6bb1840adde88c5cfc095d5c5af3a5788a4289 Mon Sep 17 00:00:00 2001 From: Michail Slabko Date: Mon, 22 Dec 2014 15:04:08 +0200 Subject: [PATCH 2/8] MAGETWO-31647: 'You saved the category' message is present on new subcategory page - MAGETWO-31723: Delete category message is absent after category has been deleted and a page has been loaded --- .../Block/Adminhtml/Category/Edit/Form.php | 2 +- .../Controller/Adminhtml/Category/Delete.php | 6 +-- .../Controller/Adminhtml/Category/Edit.php | 1 + .../templates/catalog/category/edit.phtml | 30 +++++-------- .../Adminhtml/Category/DeleteTest.php | 43 +++++++++++++++++++ 5 files changed, 58 insertions(+), 24 deletions(-) create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Category/DeleteTest.php diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Category/Edit/Form.php b/app/code/Magento/Catalog/Block/Adminhtml/Category/Edit/Form.php index 9cd66815ecf3e..6ff14589e82eb 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Category/Edit/Form.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Category/Edit/Form.php @@ -93,7 +93,7 @@ protected function _prepareLayout() 'onclick' => "categoryDelete('" . $this->getUrl( 'catalog/*/delete', ['_current' => true] - ) . "', true, {$categoryId})", + ) . "')", 'class' => 'delete' ] ); diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Category/Delete.php b/app/code/Magento/Catalog/Controller/Adminhtml/Category/Delete.php index f5b053679733a..e50c9d38b9c07 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Category/Delete.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Category/Delete.php @@ -18,13 +18,13 @@ public function execute() $resultRedirect = $this->resultRedirectFactory->create(); $categoryId = (int)$this->getRequest()->getParam('id'); + $parentId = null; if ($categoryId) { try { $category = $this->_objectManager->create('Magento\Catalog\Model\Category')->load($categoryId); + $parentId = $category->getParentId(); $this->_eventManager->dispatch('catalog_controller_category_delete', ['category' => $category]); - $this->_objectManager->get('Magento\Backend\Model\Auth\Session')->setDeletedPath($category->getPath()); - $category->delete(); $this->messageManager->addSuccess(__('You deleted the category.')); } catch (\Magento\Framework\Model\Exception $e) { @@ -35,6 +35,6 @@ public function execute() return $resultRedirect->setPath('catalog/*/edit', ['_current' => true]); } } - return $resultRedirect->setPath('catalog/*/', ['_current' => true, 'id' => null]); + return $resultRedirect->setPath('catalog/*/', ['_current' => true, 'id' => $parentId]); } } diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Category/Edit.php b/app/code/Magento/Catalog/Controller/Adminhtml/Category/Edit.php index f17bfc3abd5c1..7f6dde5cb3ee1 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Category/Edit.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Category/Edit.php @@ -97,6 +97,7 @@ public function execute() . $resultPage->getLayout()->getBlock('category.tree') ->getBreadcrumbsJavascript($breadcrumbsPath, 'editingCategoryBreadcrumbs'), 'messages' => $resultPage->getLayout()->getMessagesBlock()->getGroupedHtml(), + 'toolbar' => $resultPage->getLayout()->getBlock('page.actions.toolbar')->toHtml() ]); $this->_eventManager->dispatch( 'category_prepare_ajax_response', diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/category/edit.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/category/edit.phtml index 75b59da8d09aa..d1d3ec2b11497 100644 --- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/category/edit.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/category/edit.phtml @@ -34,21 +34,16 @@ require([ * This routine get categoryId explicitly, so even if currently selected tree node is out of sync * with this form, we surely delete same category in the tree and at backend */ - function categoryDelete(url, useAjax, categoryId) { + function categoryDelete(url) { if (confirm('')){ - if (useAjax){ - tree.nodeForDelete = categoryId; - updateContent(url, {}, true, true); - } else { - location.href = url; - } + location.href = url; } } /** * Update category content area */ - function updateContent(url, params, refreshTree, deleteAction) { + function updateContent(url, params, refreshTree) { var node = tree.getNodeById(tree.currentNodeId), parentNode = node && node.parentNode, parentId, @@ -64,23 +59,15 @@ require([ } (function($){ - var $categoryContainer = $('#category-edit-container'); + var $categoryContainer = $('#category-edit-container'), + messagesContainer = $('.messages'); + messagesContainer.html(''); $.ajax({ url: url + (url.match(new RegExp('\\?')) ? '&isAjax=true' : '?isAjax=true' ), data: params, context: $('body'), showLoader: true }).done(function(data){ - if (deleteAction && parentNode) { - parentId = parentNode.id; - - redirectUrl = !parentNode.isRoot ? - tree.buildUrl(parentId) : - tree.getBaseUrl(); - - location.href = redirectUrl; - } - if (data.content) { $('.page-actions').floatingHeader('destroy'); try { @@ -111,7 +98,10 @@ require([ } if (data.messages && data.messages.length > 0) { - $('.messages').html(data.messages); + messagesContainer.html(data.messages); + } + if (data.toolbar) { + $('[data-ui-id="page-actions-toolbar-content-header"]').replaceWith(data.toolbar) } }); })(jQuery); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Category/DeleteTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Category/DeleteTest.php new file mode 100644 index 0000000000000..34b69eeaddef3 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Category/DeleteTest.php @@ -0,0 +1,43 @@ +getRequest()->setParam('id', $categoryId); + + $this->dispatch('backend/catalog/category/delete/'); + + $this->assertNull($this->getCategoryById($categoryId)); + $this->assertSessionMessages( + $this->equalTo(['You deleted the category.']), + MessageInterface::TYPE_SUCCESS + ); + $this->assertRedirect($this->stringContains('catalog/category/index/id/' . $parentId)); + } + + /** + * Retrieve attribute set based on given name. + * + * @param int $categoryId + * @return \Magento\Catalog\Model\Category|null + */ + protected function getCategoryById($categoryId) + { + $category = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + 'Magento\Catalog\Model\Category' + )->load($categoryId); + return $category->getId() === null ? null : $category; + } +} From f826a379dd91dba7831aadbacfea1d5bf4462fc5 Mon Sep 17 00:00:00 2001 From: Michail Slabko Date: Tue, 23 Dec 2014 14:37:27 +0200 Subject: [PATCH 3/8] MAGETWO-31723: Delete category message is absent after category has been deleted and a page has been loaded --- .../Controller/Adminhtml/Category/Delete.php | 23 ++- .../Adminhtml/Category/DeleteTest.php | 43 ------ .../Adminhtml/Category/DeleteTest.php | 143 ++++++++++++++++++ 3 files changed, 163 insertions(+), 46 deletions(-) delete mode 100644 dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Category/DeleteTest.php create mode 100644 dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/Category/DeleteTest.php diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Category/Delete.php b/app/code/Magento/Catalog/Controller/Adminhtml/Category/Delete.php index e50c9d38b9c07..3c4eded51ce97 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Category/Delete.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Category/Delete.php @@ -7,6 +7,23 @@ class Delete extends \Magento\Catalog\Controller\Adminhtml\Category { + /** @var \Magento\Catalog\Api\CategoryRepositoryInterface */ + protected $categoryRepository; + + /** + * @param \Magento\Backend\App\Action\Context $context + * @param \Magento\Backend\Model\View\Result\RedirectFactory $resultRedirectFactory + * @param \Magento\Catalog\Api\CategoryRepositoryInterface $categoryRepository + */ + public function __construct( + \Magento\Backend\App\Action\Context $context, + \Magento\Backend\Model\View\Result\RedirectFactory $resultRedirectFactory, + \Magento\Catalog\Api\CategoryRepositoryInterface $categoryRepository + ) { + parent::__construct($context, $resultRedirectFactory); + $this->categoryRepository = $categoryRepository; + } + /** * Delete category action * @@ -21,11 +38,11 @@ public function execute() $parentId = null; if ($categoryId) { try { - $category = $this->_objectManager->create('Magento\Catalog\Model\Category')->load($categoryId); + $category = $this->categoryRepository->get($categoryId); $parentId = $category->getParentId(); $this->_eventManager->dispatch('catalog_controller_category_delete', ['category' => $category]); - $this->_objectManager->get('Magento\Backend\Model\Auth\Session')->setDeletedPath($category->getPath()); - $category->delete(); + $this->_auth->getAuthStorage()->setDeletedPath($category->getPath()); + $this->categoryRepository->delete($category); $this->messageManager->addSuccess(__('You deleted the category.')); } catch (\Magento\Framework\Model\Exception $e) { $this->messageManager->addError($e->getMessage()); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Category/DeleteTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Category/DeleteTest.php deleted file mode 100644 index 34b69eeaddef3..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Category/DeleteTest.php +++ /dev/null @@ -1,43 +0,0 @@ -getRequest()->setParam('id', $categoryId); - - $this->dispatch('backend/catalog/category/delete/'); - - $this->assertNull($this->getCategoryById($categoryId)); - $this->assertSessionMessages( - $this->equalTo(['You deleted the category.']), - MessageInterface::TYPE_SUCCESS - ); - $this->assertRedirect($this->stringContains('catalog/category/index/id/' . $parentId)); - } - - /** - * Retrieve attribute set based on given name. - * - * @param int $categoryId - * @return \Magento\Catalog\Model\Category|null - */ - protected function getCategoryById($categoryId) - { - $category = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Catalog\Model\Category' - )->load($categoryId); - return $category->getId() === null ? null : $category; - } -} diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/Category/DeleteTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/Category/DeleteTest.php new file mode 100644 index 0000000000000..0a1ec1af089b9 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/Category/DeleteTest.php @@ -0,0 +1,143 @@ +getMock('Magento\Backend\App\Action\Context', [], [], '', false); + $resultRedirectFactory = $this->getMock( + 'Magento\Backend\Model\View\Result\RedirectFactory', + ['create'], + [], + '', + false + ); + $this->request = $this->getMockForAbstractClass( + 'Magento\Framework\App\RequestInterface', + [], + '', + false, + true, + true, + ['getParam', 'getPost'] + ); + $auth = $this->getMock( + 'Magento\Backend\Model\Auth', + ['getAuthStorage'], + [], + '', + false + ); + $this->authStorage = $this->getMock( + 'Magento\Backend\Model\Auth\StorageInterface' + , + ['processLogin', 'processLogout', 'isLoggedIn', 'prolong', 'setDeletedPath'], + [], + '', + false + ); + $eventManager = $this->getMockForAbstractClass( + 'Magento\Framework\Event\ManagerInterface', + [], + '', + false, + true, + true, + ['dispatch'] + ); + $response = $this->getMockForAbstractClass( + 'Magento\Framework\App\ResponseInterface', + [], + '', + false + ); + $messageManager = $this->getMockForAbstractClass( + 'Magento\Framework\Message\ManagerInterface', + [], + '', + false, + true, + true, + ['addSuccess'] + ); + $this->categoryRepository = $this->getMock('Magento\Catalog\Api\CategoryRepositoryInterface'); + $context->expects($this->any()) + ->method('getRequest') + ->will($this->returnValue($this->request)); + $context->expects($this->any()) + ->method('getResponse') + ->will($this->returnValue($response)); + $context->expects($this->any()) + ->method('getMessageManager') + ->will($this->returnValue($messageManager)); + $context->expects($this->any()) + ->method('getEventManager') + ->will($this->returnValue($eventManager)); + $context->expects($this->any()) + ->method('getAuth') + ->will($this->returnValue($auth)); + $auth->expects($this->any()) + ->method('getAuthStorage') + ->will($this->returnValue($this->authStorage)); + + $this->resultRedirect = $this->getMock('Magento\Backend\Model\View\Result\Redirect', [], [], '', false); + $resultRedirectFactory->expects($this->any())->method('create')->willReturn($this->resultRedirect); + + $this->unit = (new ObjectManagerHelper($this))->getObject( + 'Magento\Catalog\Controller\Adminhtml\Category\Delete', + [ + 'context' => $context, + 'resultRedirectFactory' => $resultRedirectFactory, + 'categoryRepository' => $this->categoryRepository + ] + ); + } + + public function testDeleteWithoutCategoryId() + { + $this->request->expects($this->any())->method('getParam')->with('id')->willReturn(null); + $this->resultRedirect->expects($this->once())->method('setPath') + ->with('catalog/*/', ['_current' => true, 'id' => null]); + $this->categoryRepository->expects($this->never())->method('get'); + + $this->unit->execute(); + } + + public function testDelete() + { + $categoryId = 5; + $parentId = 7; + $this->request->expects($this->any())->method('getParam')->with('id')->willReturn($categoryId); + $category = $this->getMock('Magento\Catalog\Model\Category', ['getParentId', 'getPath'], [], '', false); + $category->expects($this->once())->method('getParentId')->willReturn($parentId); + $category->expects($this->once())->method('getPath')->willReturn('category-path'); + $this->categoryRepository->expects($this->once())->method('get')->with($categoryId)->willReturn($category); + $this->authStorage->expects($this->once())->method('setDeletedPath')->with('category-path'); + $this->resultRedirect->expects($this->once())->method('setPath') + ->with('catalog/*/', ['_current' => true, 'id' => $parentId]); + + $this->unit->execute(); + } +} From 741fc359027953b7e7e373c2ee54a8aae6db0f51 Mon Sep 17 00:00:00 2001 From: Vlad Veselov Date: Wed, 24 Dec 2014 06:13:34 -0500 Subject: [PATCH 4/8] MAGETWO-31001: [GoInc] Improve Change Risk Analysis and Predictions Metric - MAGETWO-32043: Magento\Catalog\Model\Resource\Helper::compareIndexColumnProperties --- .../Magento/Catalog/Model/Resource/Helper.php | 61 ---------- .../Resource/Product/Indexer/Eav/Source.php | 5 +- .../Magento/Catalog/Model/Resource/Setup.php | 49 +------- .../Test/Legacy/_files/obsolete_methods.php | 7 +- .../Catalog/Model/Resource/SetupTest.php | 107 ++++++++++++++++++ 5 files changed, 117 insertions(+), 112 deletions(-) create mode 100644 dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/SetupTest.php diff --git a/app/code/Magento/Catalog/Model/Resource/Helper.php b/app/code/Magento/Catalog/Model/Resource/Helper.php index ef2f15133bd8e..fcd489d68642d 100644 --- a/app/code/Magento/Catalog/Model/Resource/Helper.php +++ b/app/code/Magento/Catalog/Model/Resource/Helper.php @@ -6,14 +6,10 @@ /** * Eav Mysql resource helper model - * - * @author Magento Core Team */ class Helper extends \Magento\Eav\Model\Resource\Helper { /** - * Construct - * * @param \Magento\Framework\App\Resource $resource * @param string $modulePrefix */ @@ -21,61 +17,4 @@ public function __construct(\Magento\Framework\App\Resource $resource, $modulePr { parent::__construct($resource, $modulePrefix); } - - /** - * Compare Flat style with Describe style columns - * If column a different - return false - * - * @param array $column - * @param array $describe - * @return bool - */ - public function compareIndexColumnProperties($column, $describe) - { - $type = $column['type']; - if (isset($column['length'])) { - $type = sprintf('%s(%s)', $type[0], $column['length']); - } else { - $type = $type[0]; - } - $length = null; - $precision = null; - $scale = null; - - $matches = []; - if (preg_match('/^((?:var)?char)\((\d+)\)/', $type, $matches)) { - $type = $matches[1]; - $length = $matches[2]; - } elseif (preg_match('/^decimal\((\d+),(\d+)\)/', $type, $matches)) { - $type = 'decimal'; - $precision = $matches[1]; - $scale = $matches[2]; - } elseif (preg_match('/^float\((\d+),(\d+)\)/', $type, $matches)) { - $type = 'float'; - $precision = $matches[1]; - $scale = $matches[2]; - } elseif (preg_match('/^((?:big|medium|small|tiny)?int)\((\d+)\)?/', $type, $matches)) { - $type = $matches[1]; - } - - return $describe['DATA_TYPE'] == $type && - $describe['DEFAULT'] == $column['default'] && - (bool)$describe['NULLABLE'] == (bool)$column['nullable'] && - (bool)$describe['UNSIGNED'] == (bool)$column['unsigned'] && - $describe['LENGTH'] == $length && - $describe['SCALE'] == $scale && - $describe['PRECISION'] == $precision; - } - - /** - * Getting condition isNull(f1,f2) IS NOT Null - * - * @param string $firstField - * @param string $secondField - * @return string - */ - public function getIsNullNotNullCondition($firstField, $secondField) - { - return sprintf('%s IS NOT NULL', $this->_getReadAdapter()->getIfNullSql($firstField, $secondField)); - } } diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/Source.php b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/Source.php index f88c278afe41d..8c8f8d5ed1302 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/Source.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/Source.php @@ -143,6 +143,7 @@ protected function _prepareSelectIndex($entityIds = null, $attributeId = null) $subSelect->where('d.entity_id IN(?)', $entityIds); } + $ifNullSql = $adapter->getIfNullSql('pis.value', 'pid.value'); /**@var $select \Magento\Framework\DB\Select*/ $select = $adapter->select()->distinct(true)->from( ['pid' => new \Zend_Db_Expr(sprintf('(%s)', $subSelect->assemble()))], @@ -156,14 +157,14 @@ protected function _prepareSelectIndex($entityIds = null, $attributeId = null) 'pid.entity_id', 'pid.attribute_id', 'pid.store_id', - 'value' => $adapter->getIfNullSql('pis.value', 'pid.value'), + 'value' => $ifNullSql, ] )->where( 'pid.attribute_id IN(?)', $attrIds ); - $select->where($this->_resourceHelper->getIsNullNotNullCondition('pis.value', 'pid.value')); + $select->where($ifNullSql . ' IS NOT NULL'); /** * Exclude attribute values that contains NULL diff --git a/app/code/Magento/Catalog/Model/Resource/Setup.php b/app/code/Magento/Catalog/Model/Resource/Setup.php index bb2713d989c66..8fa1f596b380f 100644 --- a/app/code/Magento/Catalog/Model/Resource/Setup.php +++ b/app/code/Magento/Catalog/Model/Resource/Setup.php @@ -59,23 +59,13 @@ public function __construct( * * @param array $data * @return \Magento\Catalog\Model\Category + * @codeCoverageIgnore */ public function createCategory($data = []) { return $this->_categoryFactory->create($data); } - /** - * Creates eav attribute resource model - * - * @param array $data - * @return \Magento\Catalog\Model\Resource\Eav\Attribute - */ - public function createEavAttributeResource($data = []) - { - return $this->_eavAttributeResourceFactory->create($data); - } - /** * Default entites and attributes * @@ -828,41 +818,4 @@ public function getDefaultEntities() ] ]; } - - /** - * Returns category entity row by category id - * - * @param int $entityId - * @return array - */ - protected function _getCategoryEntityRow($entityId) - { - $select = $this->getConnection()->select(); - - $select->from($this->getTable('catalog_category_entity')); - $select->where('entity_id = :entity_id'); - - return $this->getConnection()->fetchRow($select, ['entity_id' => $entityId]); - } - - /** - * Returns category path as array - * - * @param array $category - * @param array $path - * @return string - */ - protected function _getCategoryPath($category, $path = []) - { - $path[] = $category['entity_id']; - - if ($category['parent_id'] != 0) { - $parentCategory = $this->_getCategoryEntityRow($category['parent_id']); - if ($parentCategory) { - $path = $this->_getCategoryPath($parentCategory, $path); - } - } - - return $path; - } } 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 5b3c80f4e523a..a2129ff07f879 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 @@ -2003,5 +2003,10 @@ ['getTerritoryTranslation', 'Magento\Framework\LocaleInterface'], ['getLinksConfig', 'Magento\Downloadable\Block\Catalog\Product\Links'], ['getAuthorizationAmounts', 'Magento\Paypal\Model\Config'], - ['cleanTransactions', 'Magento\Paypal\Model\Observer'] + ['cleanTransactions', 'Magento\Paypal\Model\Observer'], + ['compareIndexColumnProperties', 'Magento\Catalog\Model\Resource\Helper'], + ['getIsNullNotNullCondition', 'Magento\Catalog\Model\Resource\Helper'], + ['_getCategoryPath', 'Magento\Catalog\Model\Resource\Setup'], + ['_getCategoryEntityRow', 'Magento\Catalog\Model\Resource\Setup'], + ['createEavAttributeResource', 'Magento\Catalog\Model\Resource\Setup'], ]; diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/SetupTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/SetupTest.php new file mode 100644 index 0000000000000..557582b27a503 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/SetupTest.php @@ -0,0 +1,107 @@ +unit = (new \Magento\TestFramework\Helper\ObjectManager($this))->getObject( + 'Magento\Catalog\Model\Resource\Setup' + ); + } + + public function testGetDefaultEntitiesContainAllAttributes() + { + $defaultEntities = $this->unit->getDefaultEntities(); + + $this->assertEquals( + [ + 'name', + 'is_active', + 'description', + 'image', + 'meta_title', + 'meta_keywords', + 'meta_description', + 'display_mode', + 'landing_page', + 'is_anchor', + 'path', + 'position', + 'all_children', + 'path_in_store', + 'children', + 'custom_design', + 'custom_design_from', + 'custom_design_to', + 'page_layout', + 'custom_layout_update', + 'level', + 'children_count', + 'available_sort_by', + 'default_sort_by', + 'include_in_menu', + 'custom_use_parent_settings', + 'custom_apply_to_products', + 'filter_price_range', + ], + array_keys($defaultEntities['catalog_category']['attributes']) + ); + + $this->assertEquals( + [ + 'name', + 'sku', + 'description', + 'short_description', + 'price', + 'special_price', + 'special_from_date', + 'special_to_date', + 'cost', + 'weight', + 'manufacturer', + 'meta_title', + 'meta_keyword', + 'meta_description', + 'image', + 'small_image', + 'thumbnail', + 'media_gallery', + 'old_id', + 'group_price', + 'tier_price', + 'color', + 'news_from_date', + 'news_to_date', + 'gallery', + 'status', + 'minimal_price', + 'visibility', + 'custom_design', + 'custom_design_from', + 'custom_design_to', + 'custom_layout_update', + 'page_layout', + 'category_ids', + 'options_container', + 'required_options', + 'has_options', + 'image_label', + 'small_image_label', + 'thumbnail_label', + 'created_at', + 'updated_at', + 'country_of_manufacture', + 'quantity_and_stock_status', + ], + array_keys($defaultEntities['catalog_product']['attributes']) + ); + } +} From 047968613cfe04aedf11b01bea6b5127d8242159 Mon Sep 17 00:00:00 2001 From: Vlad Veselov Date: Mon, 5 Jan 2015 11:37:14 -0500 Subject: [PATCH 5/8] MAGETWO-32346: [GITHUB] Replace Symfony2/Yaml in composer #871 - update composer.lock with "composer update symfony/yaml" --- composer.json | 1 - composer.lock | 49 ++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index b30cc8775b2c0..027f9ba73d516 100644 --- a/composer.json +++ b/composer.json @@ -143,7 +143,6 @@ "magento/framework": "self.version", "magento/project-setup": "0.1.0", "oyejorge/less.php": "1.7.0", - "symfony/yaml": "2.3.x-dev", "trentrichardson/jquery-timepicker-addon": "1.4.3", "components/handlebars.js": "1.3.0", "colinmollenhour/cache-backend-redis": "dev-master#193d377b7fb2e88595578b282fa01a62d1185abc", diff --git a/composer.lock b/composer.lock index d2fc6da7fe7b8..2c0bffca2825e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "d3a510fb8a6b17c084148509d02478d4", + "hash": "09c73c1f1d5d4b40621ae2be993e8ad7", "packages": [ { "name": "composer/composer", @@ -3025,6 +3025,53 @@ "description": "Symfony Stopwatch Component", "homepage": "http://symfony.com", "time": "2014-12-02 20:19:20" + }, + { + "name": "symfony/yaml", + "version": "v2.6.1", + "target-dir": "Symfony/Component/Yaml", + "source": { + "type": "git", + "url": "https://github.com/symfony/Yaml.git", + "reference": "3346fc090a3eb6b53d408db2903b241af51dcb20" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/3346fc090a3eb6b53d408db2903b241af51dcb20", + "reference": "3346fc090a3eb6b53d408db2903b241af51dcb20", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Yaml\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony Yaml Component", + "homepage": "http://symfony.com", + "time": "2014-12-02 20:19:20" } ], "aliases": [], From 1270d77425325e4df5d8f8ccfe74cffdf3c1cf26 Mon Sep 17 00:00:00 2001 From: Michail Slabko Date: Fri, 19 Dec 2014 15:34:11 +0200 Subject: [PATCH 6/8] MAGETWO-31001: [GoInc] Improve Change Risk Analysis and Predictions Metric - MAGETWO-31970: Magento\Catalog\Block\Navigation::_renderCategoryMenuItemHtml --- app/code/Magento/Catalog/Block/Navigation.php | 266 ------------------ .../frontend/templates/navigation/top.phtml | 28 -- .../Test/Legacy/_files/obsolete_methods.php | 6 + .../Magento/Catalog/Block/NavigationTest.php | 9 +- 4 files changed, 7 insertions(+), 302 deletions(-) delete mode 100644 app/code/Magento/Catalog/view/frontend/templates/navigation/top.phtml diff --git a/app/code/Magento/Catalog/Block/Navigation.php b/app/code/Magento/Catalog/Block/Navigation.php index ed8f5d99d5700..77c1905eed71b 100644 --- a/app/code/Magento/Catalog/Block/Navigation.php +++ b/app/code/Magento/Catalog/Block/Navigation.php @@ -173,16 +173,6 @@ public function getCurrenCategoryKey() return $this->_currentCategoryKey; } - /** - * Get catagories of current store - * - * @return \Magento\Framework\Data\Tree\Node\Collection - */ - public function getStoreCategories() - { - return $this->_catalogCategory->getStoreCategories(); - } - /** * Retrieve child categories of current category * @@ -229,161 +219,6 @@ public function getCategoryUrl($category) return $url; } - /** - * Return item position representation in menu tree - * - * @param int $level - * @return string - */ - protected function _getItemPosition($level) - { - if ($level == 0) { - $zeroLevelPosition = isset( - $this->_itemLevelPositions[$level] - ) ? $this->_itemLevelPositions[$level] + 1 : 1; - $this->_itemLevelPositions = []; - $this->_itemLevelPositions[$level] = $zeroLevelPosition; - } elseif (isset($this->_itemLevelPositions[$level])) { - $this->_itemLevelPositions[$level]++; - } else { - $this->_itemLevelPositions[$level] = 1; - } - - $position = []; - for ($i = 0; $i <= $level; $i++) { - if (isset($this->_itemLevelPositions[$i])) { - $position[] = $this->_itemLevelPositions[$i]; - } - } - return implode('-', $position); - } - - /** - * Render category to html - * - * @param Category $category - * @param int $level Nesting level number - * @param boolean $isLast Whether ot not this item is last, affects list item class - * @param boolean $isFirst Whether ot not this item is first, affects list item class - * @param boolean $isOutermost Whether ot not this item is outermost, affects list item class - * @param string $outermostItemClass Extra class of outermost list items - * @param string $childrenWrapClass If specified wraps children list in div with this class - * @param boolean $noEventAttributes Whether ot not to add on* attributes to list item - * @return string - */ - protected function _renderCategoryMenuItemHtml( - $category, - $level = 0, - $isLast = false, - $isFirst = false, - $isOutermost = false, - $outermostItemClass = '', - $childrenWrapClass = '', - $noEventAttributes = false - ) { - if (!$category->getIsActive()) { - return ''; - } - - // get all children - if ($this->flatState->isAvailable()) { - $children = (array)$category->getChildrenNodes(); - } else { - $children = $category->getChildren(); - } - - // select active children - $activeChildren = []; - foreach ($children as $child) { - if ($child->getIsActive()) { - $activeChildren[] = $child; - } - } - - $activeChildrenCount = count($activeChildren); - $hasActiveChildren = $activeChildrenCount > 0; - - // prepare list item html classes - $classes = []; - $classes[] = 'level' . $level; - $classes[] = 'nav-' . $this->_getItemPosition($level); - if ($this->isCategoryActive($category)) { - $classes[] = 'active'; - } - - $linkClass = ''; - if ($isOutermost && $outermostItemClass) { - $classes[] = $outermostItemClass; - $linkClass = ' class="' . $outermostItemClass . '"'; - } - if ($isFirst) { - $classes[] = 'first'; - } - if ($isLast) { - $classes[] = 'last'; - } - if ($hasActiveChildren) { - $classes[] = 'parent'; - } - - // prepare list item attributes - $attributes = []; - if (count($classes) > 0) { - $attributes['class'] = implode(' ', $classes); - } - if ($hasActiveChildren && !$noEventAttributes) { - $attributes['onmouseover'] = 'toggleMenu(this,1)'; - $attributes['onmouseout'] = 'toggleMenu(this,0)'; - } - - // assemble list item with attributes - $htmlLi = ' $attrValue) { - $htmlLi .= ' ' . $attrName . '="' . str_replace('"', '\"', $attrValue) . '"'; - } - $htmlLi .= '>'; - - $html = []; - $html[] = $htmlLi; - - $html[] = ''; - $html[] = '' . $this->escapeHtml($category->getName()) . ''; - $html[] = ''; - - // render children - $htmlChildren = ''; - $j = 0; - foreach ($activeChildren as $child) { - $htmlChildren .= $this->_renderCategoryMenuItemHtml( - $child, - $level + 1, - $j == $activeChildrenCount - 1, - $j == 0, - false, - $outermostItemClass, - $childrenWrapClass, - $noEventAttributes - ); - $j++; - } - if (!empty($htmlChildren)) { - if ($childrenWrapClass) { - $html[] = '
'; - } - $html[] = '
    '; - $html[] = $htmlChildren; - $html[] = '
'; - if ($childrenWrapClass) { - $html[] = '
'; - } - } - - $html[] = ''; - - $html = implode("\n", $html); - return $html; - } - /** * Enter description here... * @@ -394,107 +229,6 @@ public function getCurrentCategory() return $this->_catalogLayer->getCurrentCategory(); } - /** - * Enter description here... - * - * @return string - */ - public function getCurrentCategoryPath() - { - if ($this->getCurrentCategory()) { - return explode(',', $this->getCurrentCategory()->getPathInStore()); - } - return []; - } - - /** - * Enter description here... - * - * @param Category $category - * @return string - */ - public function drawOpenCategoryItem($category) - { - $html = ''; - if (!$category->getIsActive()) { - return $html; - } - - $html .= 'isCategoryActive($category)) { - $html .= ' class="active"'; - } - - $html .= '>' . "\n"; - $html .= '' . '' . $this->escapeHtml( - $category->getName() - ) . '' . "\n"; - - if (in_array($category->getId(), $this->getCurrentCategoryPath())) { - $children = $category->getChildren(); - $hasChildren = $children && $children->count(); - - if ($hasChildren) { - $htmlChildren = ''; - foreach ($children as $child) { - $htmlChildren .= $this->drawOpenCategoryItem($child); - } - - if (!empty($htmlChildren)) { - $html .= '
    ' . "\n" . $htmlChildren . '
'; - } - } - } - $html .= '' . "\n"; - - return $html; - } - - /** - * Render categories menu in HTML - * - * @param int $level Level number for list item class to start from - * @param string $outermostItemClass Extra class of outermost list items - * @param string $childrenWrapClass If specified wraps children list in div with this class - * @return string - */ - public function renderCategoriesMenuHtml($level = 0, $outermostItemClass = '', $childrenWrapClass = '') - { - $activeCategories = []; - foreach ($this->getStoreCategories() as $child) { - if ($child->getIsActive()) { - $activeCategories[] = $child; - } - } - $activeCategoriesCount = count($activeCategories); - $hasActiveCategoriesCount = $activeCategoriesCount > 0; - - if (!$hasActiveCategoriesCount) { - return ''; - } - - $html = ''; - $j = 0; - foreach ($activeCategories as $category) { - $html .= $this->_renderCategoryMenuItemHtml( - $category, - $level, - $j == $activeCategoriesCount - 1, - $j == 0, - true, - $outermostItemClass, - $childrenWrapClass, - true - ); - $j++; - } - - return $html; - } - /** * Return identifiers for produced content * diff --git a/app/code/Magento/Catalog/view/frontend/templates/navigation/top.phtml b/app/code/Magento/Catalog/view/frontend/templates/navigation/top.phtml deleted file mode 100644 index 5eed153ff318d..0000000000000 --- a/app/code/Magento/Catalog/view/frontend/templates/navigation/top.phtml +++ /dev/null @@ -1,28 +0,0 @@ - - -renderCategoriesMenuHtml() supports optional arguments: - * int Level number for list item class to start from - * string Extra class of outermost list items - * string If specified wraps children list in div with this class - */ -?> -renderCategoriesMenuHtml(0, 'level-top') ?> - - - 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 485b7fd592683..fa7d5001d2087 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 @@ -328,6 +328,12 @@ ['displayFullSummary', 'Magento\Tax\Model\Config'], ['displayZeroTax', 'Magento\Tax\Model\Config'], ['drawItem', 'Magento\Catalog\Block\Navigation'], + ['getStoreCategories', 'Magento\Catalog\Block\Navigation'], + ['_getItemPosition', 'Magento\Catalog\Block\Navigation'], + ['_renderCategoryMenuItemHtml', 'Magento\Catalog\Block\Navigation'], + ['getCurrentCategoryPath', 'Magento\Catalog\Block\Navigation'], + ['drawOpenCategoryItem', 'Magento\Catalog\Block\Navigation'], + ['renderCategoriesMenuHtml', 'Magento\Catalog\Block\Navigation'], ['dropKey', 'Magento\Framework\DB\Adapter\Pdo\Mysql'], ['escapeJs', 'Magento\Backend\Block\Catalog\Product\Edit\Tab\Super\Config'], ['eventClean', 'Magento\Reports\Model\Event\Observer'], diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Block/NavigationTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Block/NavigationTest.php index 5cd76891eab23..c65f75ec78c3b 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Block/NavigationTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Block/NavigationTest.php @@ -14,16 +14,9 @@ class NavigationTest extends \PHPUnit_Framework_TestCase protected function setUp() { $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); - $categoryFactory = $this->getMock( - 'Magento\Catalog\Model\CategoryFactory', - ['create'], - [], - '', - false - ); $this->block = $objectManager->getObject( 'Magento\Catalog\Block\Navigation', - ['categoryFactory' => $categoryFactory] + [] ); } From a4384360dbc0532ded44883d7e76ae7e8d14944a Mon Sep 17 00:00:00 2001 From: Michail Slabko Date: Fri, 19 Dec 2014 15:34:11 +0200 Subject: [PATCH 7/8] MAGETWO-31001: [GoInc] Improve Change Risk Analysis and Predictions Metric - MAGETWO-31970: Magento\Catalog\Block\Navigation::_renderCategoryMenuItemHtml - revert invalid change in unit test --- .../testsuite/Magento/Catalog/Block/NavigationTest.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Block/NavigationTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Block/NavigationTest.php index c65f75ec78c3b..5cd76891eab23 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Block/NavigationTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Block/NavigationTest.php @@ -14,9 +14,16 @@ class NavigationTest extends \PHPUnit_Framework_TestCase protected function setUp() { $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + $categoryFactory = $this->getMock( + 'Magento\Catalog\Model\CategoryFactory', + ['create'], + [], + '', + false + ); $this->block = $objectManager->getObject( 'Magento\Catalog\Block\Navigation', - [] + ['categoryFactory' => $categoryFactory] ); } From a55bb3eda39c2226ee2f89916676100c9064c54c Mon Sep 17 00:00:00 2001 From: Vlad Veselov Date: Thu, 8 Jan 2015 08:46:15 -0500 Subject: [PATCH 8/8] MAGETWO-31723: Delete category message is absent after category has been deleted and a page has been loaded - fix coding style violation - update composer.lock --- composer.lock | 110 +++++++++--------- .../Adminhtml/Category/DeleteTest.php | 3 +- 2 files changed, 56 insertions(+), 57 deletions(-) diff --git a/composer.lock b/composer.lock index 81e82c63a548e..805bbf13580a0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "09c73c1f1d5d4b40621ae2be993e8ad7", + "hash": "27bff88b2a866343d0e0bc06fc52080f", "packages": [ { "name": "composer/composer", @@ -336,17 +336,17 @@ }, { "name": "symfony/console", - "version": "v2.6.1", + "version": "v2.6.3", "target-dir": "Symfony/Component/Console", "source": { "type": "git", "url": "https://github.com/symfony/Console.git", - "reference": "ef825fd9f809d275926547c9e57cbf14968793e8" + "reference": "6ac6491ff60c0e5a941db3ccdc75a07adbb61476" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Console/zipball/ef825fd9f809d275926547c9e57cbf14968793e8", - "reference": "ef825fd9f809d275926547c9e57cbf14968793e8", + "url": "https://api.github.com/repos/symfony/Console/zipball/6ac6491ff60c0e5a941db3ccdc75a07adbb61476", + "reference": "6ac6491ff60c0e5a941db3ccdc75a07adbb61476", "shasum": "" }, "require": { @@ -389,21 +389,21 @@ ], "description": "Symfony Console Component", "homepage": "http://symfony.com", - "time": "2014-12-02 20:19:20" + "time": "2015-01-06 17:50:02" }, { "name": "symfony/finder", - "version": "v2.6.1", + "version": "v2.6.3", "target-dir": "Symfony/Component/Finder", "source": { "type": "git", "url": "https://github.com/symfony/Finder.git", - "reference": "0d3ef7f6ec55a7af5eca7914eaa0dacc04ccc721" + "reference": "16513333bca64186c01609961a2bb1b95b5e1355" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Finder/zipball/0d3ef7f6ec55a7af5eca7914eaa0dacc04ccc721", - "reference": "0d3ef7f6ec55a7af5eca7914eaa0dacc04ccc721", + "url": "https://api.github.com/repos/symfony/Finder/zipball/16513333bca64186c01609961a2bb1b95b5e1355", + "reference": "16513333bca64186c01609961a2bb1b95b5e1355", "shasum": "" }, "require": { @@ -436,21 +436,21 @@ ], "description": "Symfony Finder Component", "homepage": "http://symfony.com", - "time": "2014-12-02 20:19:20" + "time": "2015-01-03 08:01:59" }, { "name": "symfony/process", - "version": "v2.6.1", + "version": "v2.6.3", "target-dir": "Symfony/Component/Process", "source": { "type": "git", "url": "https://github.com/symfony/Process.git", - "reference": "bf0c9bd625f13b0b0bbe39919225cf145dfb935a" + "reference": "319794f611bd8bdefbac72beb3f05e847f8ebc92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Process/zipball/bf0c9bd625f13b0b0bbe39919225cf145dfb935a", - "reference": "bf0c9bd625f13b0b0bbe39919225cf145dfb935a", + "url": "https://api.github.com/repos/symfony/Process/zipball/319794f611bd8bdefbac72beb3f05e847f8ebc92", + "reference": "319794f611bd8bdefbac72beb3f05e847f8ebc92", "shasum": "" }, "require": { @@ -483,7 +483,7 @@ ], "description": "Symfony Process Component", "homepage": "http://symfony.com", - "time": "2014-12-02 20:19:20" + "time": "2015-01-06 22:47:52" }, { "name": "zendframework/zend-code", @@ -1876,16 +1876,16 @@ }, { "name": "league/climate", - "version": "2.5.0", + "version": "2.6.0", "source": { "type": "git", "url": "https://github.com/thephpleague/climate.git", - "reference": "8687265629baaedd0fadc75350950ffc5ea53ae6" + "reference": "776b6c3b32837832a9f6d94f134b55cb7910ece6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/climate/zipball/8687265629baaedd0fadc75350950ffc5ea53ae6", - "reference": "8687265629baaedd0fadc75350950ffc5ea53ae6", + "url": "https://api.github.com/repos/thephpleague/climate/zipball/776b6c3b32837832a9f6d94f134b55cb7910ece6", + "reference": "776b6c3b32837832a9f6d94f134b55cb7910ece6", "shasum": "" }, "require": { @@ -1921,7 +1921,7 @@ "php", "terminal" ], - "time": "2014-11-08 02:33:31" + "time": "2015-01-08 02:28:23" }, { "name": "lusitanian/oauth", @@ -2833,17 +2833,17 @@ }, { "name": "symfony/config", - "version": "v2.5.8", + "version": "v2.5.9", "target-dir": "Symfony/Component/Config", "source": { "type": "git", "url": "https://github.com/symfony/Config.git", - "reference": "92f0b4c625b8c42d394b53f879d2795d84bb8c4f" + "reference": "c7309e33b719433d5cf3845d0b5b9608609d8c8e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Config/zipball/92f0b4c625b8c42d394b53f879d2795d84bb8c4f", - "reference": "92f0b4c625b8c42d394b53f879d2795d84bb8c4f", + "url": "https://api.github.com/repos/symfony/Config/zipball/c7309e33b719433d5cf3845d0b5b9608609d8c8e", + "reference": "c7309e33b719433d5cf3845d0b5b9608609d8c8e", "shasum": "" }, "require": { @@ -2877,21 +2877,21 @@ ], "description": "Symfony Config Component", "homepage": "http://symfony.com", - "time": "2014-12-02 20:15:53" + "time": "2015-01-03 08:01:13" }, { "name": "symfony/dependency-injection", - "version": "v2.5.8", + "version": "v2.5.9", "target-dir": "Symfony/Component/DependencyInjection", "source": { "type": "git", "url": "https://github.com/symfony/DependencyInjection.git", - "reference": "b4afda3c24867a17f93237ac1fcce917cc9d7695" + "reference": "b04e6782962f8e3312274fd16fb6b37a8210a1c3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/b4afda3c24867a17f93237ac1fcce917cc9d7695", - "reference": "b4afda3c24867a17f93237ac1fcce917cc9d7695", + "url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/b04e6782962f8e3312274fd16fb6b37a8210a1c3", + "reference": "b04e6782962f8e3312274fd16fb6b37a8210a1c3", "shasum": "" }, "require": { @@ -2899,8 +2899,8 @@ }, "require-dev": { "symfony/config": "~2.2", - "symfony/expression-language": "~2.4", - "symfony/yaml": "~2.0" + "symfony/expression-language": "~2.4,>=2.4.10", + "symfony/yaml": "~2.1" }, "suggest": { "symfony/config": "", @@ -2934,21 +2934,21 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "http://symfony.com", - "time": "2014-12-02 21:48:32" + "time": "2015-01-05 08:51:41" }, { "name": "symfony/event-dispatcher", - "version": "v2.6.1", + "version": "v2.6.3", "target-dir": "Symfony/Component/EventDispatcher", "source": { "type": "git", "url": "https://github.com/symfony/EventDispatcher.git", - "reference": "720fe9bca893df7ad1b4546649473b5afddf0216" + "reference": "40ff70cadea3785d83cac1c8309514b36113064e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/720fe9bca893df7ad1b4546649473b5afddf0216", - "reference": "720fe9bca893df7ad1b4546649473b5afddf0216", + "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/40ff70cadea3785d83cac1c8309514b36113064e", + "reference": "40ff70cadea3785d83cac1c8309514b36113064e", "shasum": "" }, "require": { @@ -2956,10 +2956,10 @@ }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~2.0", + "symfony/config": "~2.0,>=2.0.5", "symfony/dependency-injection": "~2.6", "symfony/expression-language": "~2.6", - "symfony/stopwatch": "~2.2" + "symfony/stopwatch": "~2.3" }, "suggest": { "symfony/dependency-injection": "", @@ -2992,21 +2992,21 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "http://symfony.com", - "time": "2014-12-02 20:19:20" + "time": "2015-01-05 14:28:40" }, { "name": "symfony/filesystem", - "version": "v2.5.8", + "version": "v2.5.9", "target-dir": "Symfony/Component/Filesystem", "source": { "type": "git", "url": "https://github.com/symfony/Filesystem.git", - "reference": "e5fc05a3a1dbb4ea0bed80fe7bd21ba3cab88c42" + "reference": "d3c24d7d6e9c342008d8421b2fade460311647ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Filesystem/zipball/e5fc05a3a1dbb4ea0bed80fe7bd21ba3cab88c42", - "reference": "e5fc05a3a1dbb4ea0bed80fe7bd21ba3cab88c42", + "url": "https://api.github.com/repos/symfony/Filesystem/zipball/d3c24d7d6e9c342008d8421b2fade460311647ea", + "reference": "d3c24d7d6e9c342008d8421b2fade460311647ea", "shasum": "" }, "require": { @@ -3039,21 +3039,21 @@ ], "description": "Symfony Filesystem Component", "homepage": "http://symfony.com", - "time": "2014-12-02 20:15:53" + "time": "2015-01-03 21:04:44" }, { "name": "symfony/stopwatch", - "version": "v2.6.1", + "version": "v2.6.3", "target-dir": "Symfony/Component/Stopwatch", "source": { "type": "git", "url": "https://github.com/symfony/Stopwatch.git", - "reference": "261abd360cfb6ac65ea93ffd82073e2011d034fc" + "reference": "e8da5286132ba75ce4b4275fbf0f4cd369bfd71c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Stopwatch/zipball/261abd360cfb6ac65ea93ffd82073e2011d034fc", - "reference": "261abd360cfb6ac65ea93ffd82073e2011d034fc", + "url": "https://api.github.com/repos/symfony/Stopwatch/zipball/e8da5286132ba75ce4b4275fbf0f4cd369bfd71c", + "reference": "e8da5286132ba75ce4b4275fbf0f4cd369bfd71c", "shasum": "" }, "require": { @@ -3086,21 +3086,21 @@ ], "description": "Symfony Stopwatch Component", "homepage": "http://symfony.com", - "time": "2014-12-02 20:19:20" + "time": "2015-01-03 08:01:59" }, { "name": "symfony/yaml", - "version": "v2.6.1", + "version": "v2.6.3", "target-dir": "Symfony/Component/Yaml", "source": { "type": "git", "url": "https://github.com/symfony/Yaml.git", - "reference": "3346fc090a3eb6b53d408db2903b241af51dcb20" + "reference": "82462a90848a52c2533aa6b598b107d68076b018" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/3346fc090a3eb6b53d408db2903b241af51dcb20", - "reference": "3346fc090a3eb6b53d408db2903b241af51dcb20", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/82462a90848a52c2533aa6b598b107d68076b018", + "reference": "82462a90848a52c2533aa6b598b107d68076b018", "shasum": "" }, "require": { @@ -3133,7 +3133,7 @@ ], "description": "Symfony Yaml Component", "homepage": "http://symfony.com", - "time": "2014-12-02 20:19:20" + "time": "2015-01-03 15:33:07" } ], "aliases": [], diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/Category/DeleteTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/Category/DeleteTest.php index 0a1ec1af089b9..09221eff20db8 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/Category/DeleteTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/Category/DeleteTest.php @@ -51,8 +51,7 @@ protected function setUp() false ); $this->authStorage = $this->getMock( - 'Magento\Backend\Model\Auth\StorageInterface' - , + 'Magento\Backend\Model\Auth\StorageInterface', ['processLogin', 'processLogout', 'isLoggedIn', 'prolong', 'setDeletedPath'], [], '',