Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
2239f3d
[backport] Category collection now use getStoreId and not directly th…
alepane21 Feb 20, 2018
6f556ff
fix to wrong php unit class name
alepane21 Feb 20, 2018
915be6e
fix test to comply with older versions of phpunit
alepane21 Feb 26, 2018
3d05e6b
Don't recalculate tax for every price on category page
May 8, 2018
07b708f
ENGCOM-1685: [backport 2.1] Category\Collection::joinUrlRewrite shoul…
magento-engcom-team May 25, 2018
e021b39
ENGCOM-1685: [backport 2.1] Category\Collection::joinUrlRewrite shoul…
May 25, 2018
bddb976
Add resetting of triggerRecollection flag
rogyar May 25, 2018
485fd48
Fix typos in Multishipping and User module
VitaliyBoyko May 27, 2018
c4e24d9
ENGCOM-1693: [Backport] Fix unnecessary recalculation of product list…
magento-engcom-team May 28, 2018
1ec4713
ENGCOM-1696: [Backport 2.1]Fix typos in Multishipping and User module…
magento-engcom-team May 29, 2018
7c65f0a
Correct function return statement
rogyar May 29, 2018
8e74137
ENGCOM-1699: [Backlog] Add resetting of triggerRecollection flag #15522
magento-engcom-team May 29, 2018
954a1f7
ENGCOM-1708: [Backport] Correct functions return statement #15563
magento-engcom-team May 29, 2018
dbcf578
ENGCOM-1696: [Backport 2.1]Fix typos in Multishipping and User module…
May 30, 2018
de752ac
ENGCOM-1685: [backport 2.1] Category\Collection::joinUrlRewrite shoul…
May 30, 2018
77aee0e
[backport 2.1] Category\Collection::joinUrlRewrite should use the sto…
VladimirZaets May 30, 2018
1a099cb
Merge pull request #2616 from magento-engcom/2.1-develop-prs
VladimirZaets May 30, 2018
ab64a2c
Fix incorrect type hinting in PHPDocs
dmytro-ch May 31, 2018
09c3119
ENGCOM-1727: Fix incorrect type hinting in PHPDocs #15619
magento-engcom-team May 31, 2018
bf2e745
ENGCOM-1727: Fix incorrect type hinting in PHPDocs #15619
May 31, 2018
4c59e94
ENGCOM-1708: [Backport] Correct functions return statement #15563
May 31, 2018
1e35076
ENGCOM-1699: [Backlog] Add resetting of triggerRecollection flag #15522
May 31, 2018
d871eb8
ENGCOM-1693: [Backport] Fix unnecessary recalculation of product list…
May 31, 2018
6103b6b
:arrows_clockwise: [EngCom] Public Pull Requests - 2.1-develop
ishakhsuvarov May 31, 2018
f98290d
Fixed typo error
gelanivishal May 28, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ public function joinUrlRewrite()
['request_path'],
sprintf(
'{{table}}.is_autogenerated = 1 AND {{table}}.store_id = %d AND {{table}}.entity_type = \'%s\'',
$this->_storeManager->getStore()->getId(),
$this->getStoreId(),
CategoryUrlRewriteGenerator::ENTITY_TYPE
),
'left'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

namespace Magento\Catalog\Test\Unit\Model\ResourceModel\Category\Collection;

class UrlRewriteTest extends \PHPUnit_Framework_TestCase
{
/**
* @var \PHPUnit_Framework_MockObject_MockObject
*/
protected $_model;

protected function setUp()
{
$this->_model = $this->getMockBuilder(\Magento\Catalog\Model\ResourceModel\Category\Collection::class)
->disableOriginalConstructor()
->setMethods(['joinTable'])
->getMock();
}

public function testStoreIdUsedByUrlRewrite()
{
$cond = '{{table}}.is_autogenerated = 1 AND {{table}}.store_id = 100 AND {{table}}.entity_type = \'category\'';
$this->_model->expects($this->once())
->method('joinTable')
->with(
$this->anything(),
$this->anything(),
$this->anything(),
$this->equalTo($cond),
$this->anything()
);
$this->_model->setStoreId(100);
$this->_model->joinUrlRewrite();
}
}
2 changes: 1 addition & 1 deletion app/code/Magento/Config/Block/System/Config/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ protected function _getAdditionalElementTypes()
}

/**
* Temporary moved those $this->getRequest()->getParam('blabla') from the code accross this block
* Temporary moved those $this->getRequest()->getParam('blabla') from the code across this block
* to getBlala() methods to be later set from controller with setters
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ protected function _insertData()
}

/**
* Get new supper attribute id.
* Get new super attribute id.
*
* @return int
*/
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Customer/Model/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ public function setAfterAuthUrl($url)
}

/**
* Reset core session hosts after reseting session ID
* Reset core session hosts after resetting session ID
*
* @return $this
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

/**
* Mustishipping checkout base abstract block
* Multishipping checkout base abstract block
*
* @author Magento Core Team <core@magentocommerce.com>
*/
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Multishipping/Block/Checkout/Shipping.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Magento\Quote\Model\Quote\Address;

/**
* Mustishipping checkout shipping
* Multishipping checkout shipping
*
* @author Magento Core Team <core@magentocommerce.com>
*/
Expand Down
6 changes: 5 additions & 1 deletion app/code/Magento/Quote/Model/Quote.php
Original file line number Diff line number Diff line change
Expand Up @@ -2363,13 +2363,17 @@ public function merge(Quote $quote)
* Trigger collect totals after loading, if required
*
* @return $this
* @throws \Exception
*/
protected function _afterLoad()
{
// collect totals and save me, if required
if (1 == $this->getData('trigger_recollect')) {
$this->collectTotals()->save();
$this->collectTotals()
->setTriggerRecollect(0)
->save();
}

return parent::_afterLoad();
}

Expand Down
4 changes: 1 addition & 3 deletions app/code/Magento/Sales/Model/Order/Shipment/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,7 @@ public function getOrderItem()
* Declare qty
*
* @param float $qty
* @return \Magento\Sales\Model\Order\Invoice\Item
* @throws \Magento\Framework\Exception\LocalizedException
* @return $this
*/
public function setQty($qty)
{
Expand All @@ -159,7 +158,6 @@ public function setQty($qty)
* Applying qty to order item
*
* @return $this
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function register()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ protected function _initRule()
/**
* Initiate action
*
* @return this
* @return $this
*/
protected function _initAction()
{
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Security/Model/AdminSessionInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public function isOtherSessionsTerminated()
* Setter for isOtherSessionsTerminated
*
* @param bool $isOtherSessionsTerminated
* @return this
* @return $this
*/
public function setIsOtherSessionsTerminated($isOtherSessionsTerminated)
{
Expand Down
6 changes: 3 additions & 3 deletions app/code/Magento/Tax/Model/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -831,20 +831,20 @@ public function getInfoUrl($store = null)
* If it necessary will be returned conversion type (minus or plus)
*
* @param null|int|string|Store $store
* @return bool
* @return bool|int
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
public function needPriceConversion($store = null)
{
$res = false;
$res = 0;
$priceIncludesTax = $this->priceIncludesTax($store) || $this->getNeedUseShippingExcludeTax();
if ($priceIncludesTax) {
switch ($this->getPriceDisplayType($store)) {
case self::DISPLAY_TYPE_EXCLUDING_TAX:
case self::DISPLAY_TYPE_BOTH:
return self::PRICE_CONVERSION_MINUS;
case self::DISPLAY_TYPE_INCLUDING_TAX:
$res = true;
$res = false;
break;
default:
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function getAdminPasswordLifetime()
}

/**
* Get admin maxiumum security failures from config
* Get admin maximum security failures from config
*
* @return int
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

namespace Magento\Catalog\Model\ResourceModel\Category;

class CollectionTest extends \PHPUnit_Framework_TestCase
{
/**
* @var \Magento\Catalog\Model\ResourceModel\Category\Collection
*/
private $collection;

/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
protected function setUp()
{
$this->collection = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
\Magento\Catalog\Model\ResourceModel\Category\Collection::class
);
}

protected function setDown()
{
/* Refresh stores memory cache after store deletion */
\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
\Magento\Store\Model\StoreManagerInterface::class
)->reinitStores();
}

/**
* @magentoAppIsolation enabled
* @magentoDbIsolation enabled
* @magentoDataFixture Magento/Catalog/Model/ResourceModel/_files/category_multiple_stores.php
*/
public function testJoinUrlRewriteOnDefault()
{
$categories = $this->collection->joinUrlRewrite()->addPathFilter('1/2/3');
$this->assertCount(1, $categories);
/** @var $category \Magento\Catalog\Model\Category */
$category = $categories->getFirstItem();
$this->assertStringEndsWith('category.html', $category->getUrl());
}

/**
* @magentoAppIsolation enabled
* @magentoDbIsolation enabled
* @magentoDataFixture Magento/Catalog/Model/ResourceModel/_files/category_multiple_stores.php
*/
public function testJoinUrlRewriteNotOnDefaultStore()
{
$store = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
->create(\Magento\Store\Model\Store::class);
$storeId = $store->load('second_category_store', 'code')->getId();
$categories = $this->collection->setStoreId($storeId)->joinUrlRewrite()->addPathFilter('1/2/3');
$this->assertCount(1, $categories);
/** @var $category \Magento\Catalog\Model\Category */
$category = $categories->getFirstItem();
$this->assertContains('category-3-on-2', $category->getUrl());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

/** @var \Magento\Catalog\Model\CategoryFactory $factory */
$factory = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
\Magento\Catalog\Model\CategoryFactory::class
);
/** @var \Magento\Catalog\Model\CategoryRepository $repository */
$repository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
\Magento\Catalog\Model\CategoryRepository::class
);
/** @var \Magento\Store\Model\StoreManagerInterface $storeManager */
$storeManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
\Magento\Store\Model\StoreManagerInterface::class
);
/** @var \Magento\Store\Model\Store $store */
$store = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(\Magento\Store\Model\Store::class);
if (!$store->load('second_category_store', 'code')->getId()) {
$websiteId = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
\Magento\Store\Model\StoreManagerInterface::class
)->getWebsite()->getId();
$groupId = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
\Magento\Store\Model\StoreManagerInterface::class
)->getWebsite()->getDefaultGroupId();

$store->setCode(
'second_category_store'
)->setWebsiteId(
$websiteId
)->setGroupId(
$groupId
)->setName(
'Fixture Store'
)->setSortOrder(
10
)->setIsActive(
1
);
$store->save();
}

/* Refresh stores memory cache */
\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
\Magento\Store\Model\StoreManagerInterface::class
)->reinitStores();

/** @var \Magento\Catalog\Model\Category $newCategory */
$newCategory = $factory->create();
$newCategory
->setName('Category')
->setParentId(2)
->setLevel(2)
->setPath('1/2/3')
->setAvailableSortBy('name')
->setDefaultSortBy('name')
->setIsActive(true)
->setPosition(1);
$repository->save($newCategory);
$currentStoreId = $storeManager->getStore()->getId();
$storeManager->setCurrentStore($storeManager->getStore($store->getId()));
$newCategory->setUrlKey('category-3-on-2');
$repository->save($newCategory);
$storeManager->setCurrentStore($storeManager->getStore($currentStoreId));