Skip to content

Commit af4f1fa

Browse files
author
Dale Sikkema
committed
MAGETWO-43787: cache:clean command doesn't clear Varnish cache
- fix unit tests
1 parent 8ed94a8 commit af4f1fa

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

app/code/Magento/Backend/Test/Unit/Console/Command/AbstractCacheManageCommandTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,14 @@ abstract class AbstractCacheManageCommandTest extends AbstractCacheCommandTest
1313
/** @var string */
1414
protected $cacheEventName;
1515

16-
/** @var \Magento\Framework\Event\ManagerInterface */
16+
/** @var \Magento\Framework\Event\ManagerInterface | \PHPUnit_Framework_MockObject_MockObject */
1717
protected $eventManagerMock;
1818

1919
public function setUp()
2020
{
2121
$this->eventManagerMock = $this->getMockBuilder('\Magento\Framework\Event\ManagerInterface')
2222
->disableOriginalConstructor()
2323
->getMock();
24-
$this->eventManagerMock->expects($this->any())->method('dispatch')->with($this->cacheEventName);
2524
parent::setUp();
2625
}
2726

app/code/Magento/Backend/Test/Unit/Console/Command/CacheCleanCommandTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public function testExecute($param, $types, $output)
2828
{
2929
$this->cacheManagerMock->expects($this->once())->method('getAvailableTypes')->willReturn(['A', 'B', 'C']);
3030
$this->cacheManagerMock->expects($this->once())->method('clean')->with($types);
31+
$this->eventManagerMock->expects($this->once())->method('dispatch')->with($this->cacheEventName);
3132

3233
$commandTester = new CommandTester($this->command);
3334
$commandTester->execute($param);

app/code/Magento/Backend/Test/Unit/Console/Command/CacheFlushCommandTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public function testExecute($param, $types, $output)
2828
{
2929
$this->cacheManagerMock->expects($this->once())->method('getAvailableTypes')->willReturn(['A', 'B', 'C']);
3030
$this->cacheManagerMock->expects($this->once())->method('flush')->with($types);
31+
$this->eventManagerMock->expects($this->once())->method('dispatch')->with($this->cacheEventName);
3132

3233
$commandTester = new CommandTester($this->command);
3334
$commandTester->execute($param);

0 commit comments

Comments
 (0)