forked from magento/magento2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request magento#1014 from magento-goinc/MAGETWO-31792
MVT auto merge.
- Loading branch information
Showing
34 changed files
with
803 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
app/code/Magento/Catalog/Plugin/Model/Indexer/Category/Product/Execute.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
/** | ||
* @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) | ||
*/ | ||
|
||
namespace Magento\Catalog\Plugin\Model\Indexer\Category\Product; | ||
|
||
use Magento\Catalog\Model\Indexer\Category\Product\AbstractAction; | ||
|
||
class Execute | ||
{ | ||
/** | ||
* @var \Magento\PageCache\Model\Config | ||
*/ | ||
protected $config; | ||
|
||
/** | ||
* @var \Magento\Framework\App\Cache\TypeListInterface | ||
*/ | ||
protected $typeList; | ||
|
||
/** | ||
* @param \Magento\PageCache\Model\Config $config | ||
* @param \Magento\Framework\App\Cache\TypeListInterface $typeList | ||
*/ | ||
public function __construct( | ||
\Magento\PageCache\Model\Config $config, | ||
\Magento\Framework\App\Cache\TypeListInterface $typeList | ||
) { | ||
$this->config = $config; | ||
$this->typeList = $typeList; | ||
} | ||
|
||
/** | ||
* @param AbstractAction $subject | ||
* @param AbstractAction $result | ||
* @return AbstractAction | ||
* | ||
* @SuppressWarnings(PHPMD.UnusedFormalParameter) | ||
*/ | ||
public function afterExecute(AbstractAction $subject, AbstractAction $result) | ||
{ | ||
if ($this->config->isEnabled()) { | ||
$this->typeList->invalidate('full_page'); | ||
} | ||
return $result; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
app/code/Magento/LayeredNavigation/Model/Aggregation/Status.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
/** | ||
* | ||
* @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) | ||
*/ | ||
namespace Magento\LayeredNavigation\Model\Aggregation; | ||
|
||
use Magento\Framework\Search\Request\Aggregation\StatusInterface; | ||
|
||
class Status implements StatusInterface | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function isEnabled() | ||
{ | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0"?> | ||
<!-- | ||
/** | ||
* @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) | ||
*/ | ||
--> | ||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> | ||
<preference for="Magento\Framework\Search\Request\Aggregation\StatusInterface" type="Magento\LayeredNavigation\Model\Aggregation\Status" /> | ||
</config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
dev/tests/integration/testsuite/Magento/Sales/Model/Order/InvoiceTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
/** | ||
* @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) | ||
*/ | ||
namespace Magento\Sales\Model\Order; | ||
|
||
class InvoiceTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* @var \Magento\Sales\Model\Resource\Order\Collection | ||
*/ | ||
private $_collection; | ||
|
||
protected function setUp() | ||
{ | ||
$this->_collection = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( | ||
'Magento\Sales\Model\Resource\Order\Collection' | ||
); | ||
} | ||
|
||
/** | ||
* @magentoDataFixture Magento/Sales/_files/invoice.php | ||
*/ | ||
public function testOrderTotalItemCount() | ||
{ | ||
$expectedResult = [['total_item_count' => 1]]; | ||
$actualResult = []; | ||
/** @var \Magento\Sales\Model\Order $order */ | ||
foreach ($this->_collection->getItems() as $order) { | ||
$actualResult[] = ['total_item_count' => $order->getData('total_item_count')]; | ||
} | ||
$this->assertEquals($expectedResult, $actualResult); | ||
} | ||
} |
Oops, something went wrong.