Skip to content

Commit d34a471

Browse files
author
Eric Bohanon
committed
MAGETWO-70346: Configurable product shows on frontend after deleting child
1 parent 9245b7b commit d34a471

File tree

2 files changed

+0
-76
lines changed

2 files changed

+0
-76
lines changed

app/code/Magento/Catalog/Model/Indexer/Product/Full.php

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88

99
use Magento\Framework\Indexer\ActionInterface;
1010
use Magento\Framework\Indexer\IndexerRegistry;
11-
use Magento\PageCache\Model\Config;
12-
use Magento\Framework\App\Cache\TypeListInterface;
1311

1412
/**
1513
* Reindex all relevant product indexers
@@ -21,16 +19,6 @@ class Full implements ActionInterface
2119
*/
2220
private $indexerRegistry;
2321

24-
/**
25-
* @var Config
26-
*/
27-
private $pageCacheConfig;
28-
29-
/**
30-
* @var TypeListInterface
31-
*/
32-
private $cacheTypeList;
33-
3422
/**
3523
* @var string[]
3624
*/
@@ -40,19 +28,13 @@ class Full implements ActionInterface
4028
* Initialize dependencies
4129
*
4230
* @param IndexerRegistry $indexerRegistry
43-
* @param Config $pageCacheConfig
44-
* @param TypeListInterface $cacheTypeList
4531
* @param string[] $indexerList
4632
*/
4733
public function __construct(
4834
IndexerRegistry $indexerRegistry,
49-
Config $pageCacheConfig,
50-
TypeListInterface $cacheTypeList,
5135
array $indexerList
5236
) {
5337
$this->indexerRegistry = $indexerRegistry;
54-
$this->pageCacheConfig = $pageCacheConfig;
55-
$this->cacheTypeList = $cacheTypeList;
5638
$this->indexerList = $indexerList;
5739
}
5840

app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/FullTest.php

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
use Magento\Framework\Indexer\IndexerInterface;
1111
use PHPUnit\Framework\TestCase;
1212
use Magento\Framework\Indexer\IndexerRegistry;
13-
use Magento\PageCache\Model\Config;
14-
use Magento\Framework\App\Cache\TypeListInterface;
1513

1614
class FullTest extends TestCase
1715
{
@@ -25,16 +23,6 @@ class FullTest extends TestCase
2523
*/
2624
private $indexerRegistryMock;
2725

28-
/**
29-
* @var Config|\PHPUnit_Framework_MockObject_MockObject
30-
*/
31-
private $configMock;
32-
33-
/**
34-
* @var TypeListInterface|\PHPUnit_Framework_MockObject_MockObject
35-
*/
36-
private $typeListMock;
37-
3826
/**
3927
* @var Full
4028
*/
@@ -44,15 +32,11 @@ public function setUp()
4432
{
4533
$this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
4634
$this->indexerRegistryMock = $this->createMock(IndexerRegistry::class);
47-
$this->configMock = $this->createMock(Config::class);
48-
$this->typeListMock = $this->getMockForAbstractClass(TypeListInterface::class, [], "", false);
4935

5036
$this->full = $this->objectManager->getObject(
5137
Full::class,
5238
[
5339
'indexerRegistry' => $this->indexerRegistryMock,
54-
'pageCacheConfig' => $this->configMock,
55-
'cacheTypeList' => $this->typeListMock,
5640
'indexerList' => ['catalog_indexer', 'product_indexer', 'stock_indexer', 'search_indexer']
5741
]
5842
);
@@ -64,20 +48,6 @@ public function testExecuteFull()
6448
$indexerMock->expects($this->exactly(4))->method('isScheduled')->willReturn(false);
6549
$indexerMock->expects($this->exactly(4))->method('reindexAll');
6650
$this->indexerRegistryMock->expects($this->exactly(4))->method('get')->willReturn($indexerMock);
67-
$this->configMock->expects($this->once())->method('isEnabled')->willReturn(true);
68-
$this->typeListMock->expects($this->once())->method('invalidate')->with('full_page');
69-
70-
$this->full->executeFull();
71-
}
72-
73-
public function testExecuteFullPageCacheDisabled()
74-
{
75-
$indexerMock = $this->getMockForAbstractClass(IndexerInterface::class, [], "", false);
76-
$indexerMock->expects($this->exactly(4))->method('isScheduled')->willReturn(false);
77-
$indexerMock->expects($this->exactly(4))->method('reindexAll');
78-
$this->indexerRegistryMock->expects($this->exactly(4))->method('get')->willReturn($indexerMock);
79-
$this->configMock->expects($this->once())->method('isEnabled')->willReturn(false);
80-
$this->typeListMock->expects($this->never())->method('invalidate');
8151

8252
$this->full->executeFull();
8353
}
@@ -88,20 +58,6 @@ public function testExecuteList()
8858
$indexerMock->expects($this->exactly(4))->method('isScheduled')->willReturn(false);
8959
$indexerMock->expects($this->exactly(4))->method('reindexList')->with([1, 2]);
9060
$this->indexerRegistryMock->expects($this->exactly(4))->method('get')->willReturn($indexerMock);
91-
$this->configMock->expects($this->once())->method('isEnabled')->willReturn(true);
92-
$this->typeListMock->expects($this->once())->method('invalidate')->with('full_page');
93-
94-
$this->full->executeList([1, 2]);
95-
}
96-
97-
public function testExecuteListPageCacheDisabled()
98-
{
99-
$indexerMock = $this->getMockForAbstractClass(IndexerInterface::class, [], "", false);
100-
$indexerMock->expects($this->exactly(4))->method('isScheduled')->willReturn(false);
101-
$indexerMock->expects($this->exactly(4))->method('reindexList')->with([1, 2]);
102-
$this->indexerRegistryMock->expects($this->exactly(4))->method('get')->willReturn($indexerMock);
103-
$this->configMock->expects($this->once())->method('isEnabled')->willReturn(false);
104-
$this->typeListMock->expects($this->never())->method('invalidate');
10561

10662
$this->full->executeList([1, 2]);
10763
}
@@ -112,20 +68,6 @@ public function testExecuteRow()
11268
$indexerMock->expects($this->exactly(4))->method('isScheduled')->willReturn(false);
11369
$indexerMock->expects($this->exactly(4))->method('reindexRow')->with(1);
11470
$this->indexerRegistryMock->expects($this->exactly(4))->method('get')->willReturn($indexerMock);
115-
$this->configMock->expects($this->once())->method('isEnabled')->willReturn(true);
116-
$this->typeListMock->expects($this->once())->method('invalidate')->with('full_page');
117-
118-
$this->full->executeRow(1);
119-
}
120-
121-
public function testExecuteRowPageCacheDisabled()
122-
{
123-
$indexerMock = $this->getMockForAbstractClass(IndexerInterface::class, [], "", false);
124-
$indexerMock->expects($this->exactly(4))->method('isScheduled')->willReturn(false);
125-
$indexerMock->expects($this->exactly(4))->method('reindexRow')->with(1);
126-
$this->indexerRegistryMock->expects($this->exactly(4))->method('get')->willReturn($indexerMock);
127-
$this->configMock->expects($this->once())->method('isEnabled')->willReturn(false);
128-
$this->typeListMock->expects($this->never())->method('invalidate');
12971

13072
$this->full->executeRow(1);
13173
}

0 commit comments

Comments
 (0)