Skip to content

Commit c574e2f

Browse files
author
Dale Sikkema
committed
MAGETWO-43787: cache:clean command doesn't clear Varnish cache
- style test fixes
1 parent af4f1fa commit c574e2f

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,13 @@ public function setUp()
2626
*/
2727
public function testExecute($param, $enable, $result, $output)
2828
{
29-
$this->cacheManagerMock->expects($this->once())->method('getAvailableTypes')->willReturn(['A', 'B', 'C']);
30-
$this->cacheManagerMock->expects($this->once())->method('setEnabled')->with($enable, false)->willReturn($result);
29+
$this->cacheManagerMock->expects($this->once())
30+
->method('getAvailableTypes')
31+
->willReturn(['A', 'B', 'C']);
32+
$this->cacheManagerMock->expects($this->once())
33+
->method('setEnabled')
34+
->with($enable, false)
35+
->willReturn($result);
3136

3237
$commandTester = new CommandTester($this->command);
3338
$commandTester->execute($param);

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,14 @@ public function setUp()
2727
public function testExecute($param, $enable, $result, $output)
2828
{
2929
$this->cacheManagerMock->expects($this->once())->method('getAvailableTypes')->willReturn(['A', 'B', 'C']);
30-
$this->cacheManagerMock->expects($this->once())->method('setEnabled')->with($enable, true)->willReturn($result);
31-
$this->cacheManagerMock->expects($result === [] ? $this->never() : $this->once())->method('clean')->with($enable);
30+
$this->cacheManagerMock->expects($this->once())
31+
->method('setEnabled')
32+
->with($enable, true)
33+
->willReturn($result);
34+
$cleanInvocationCount = $result === [] ? 0 : 1;
35+
$this->cacheManagerMock->expects($this->exactly($cleanInvocationCount))
36+
->method('clean')
37+
->with($enable);
3238

3339
$commandTester = new CommandTester($this->command);
3440
$commandTester->execute($param);

0 commit comments

Comments
 (0)