From c574e2fad0edeffb5fb3ce291fccc88e075af13e Mon Sep 17 00:00:00 2001
From: Dale Sikkema <dsikkema@ebay.com>
Date: Mon, 19 Oct 2015 17:03:53 -0500
Subject: [PATCH] MAGETWO-43787: cache:clean command doesn't clear Varnish
 cache  - style test fixes

---
 .../Unit/Console/Command/CacheDisableCommandTest.php   |  9 +++++++--
 .../Unit/Console/Command/CacheEnableCommandTest.php    | 10 ++++++++--
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/app/code/Magento/Backend/Test/Unit/Console/Command/CacheDisableCommandTest.php b/app/code/Magento/Backend/Test/Unit/Console/Command/CacheDisableCommandTest.php
index f3e3311d4b8..4446b1b992e 100644
--- a/app/code/Magento/Backend/Test/Unit/Console/Command/CacheDisableCommandTest.php
+++ b/app/code/Magento/Backend/Test/Unit/Console/Command/CacheDisableCommandTest.php
@@ -26,8 +26,13 @@ class CacheDisableCommandTest extends AbstractCacheSetCommandTest
      */
     public function testExecute($param, $enable, $result, $output)
     {
-        $this->cacheManagerMock->expects($this->once())->method('getAvailableTypes')->willReturn(['A', 'B', 'C']);
-        $this->cacheManagerMock->expects($this->once())->method('setEnabled')->with($enable, false)->willReturn($result);
+        $this->cacheManagerMock->expects($this->once())
+            ->method('getAvailableTypes')
+            ->willReturn(['A', 'B', 'C']);
+        $this->cacheManagerMock->expects($this->once())
+            ->method('setEnabled')
+            ->with($enable, false)
+            ->willReturn($result);
 
         $commandTester = new CommandTester($this->command);
         $commandTester->execute($param);
diff --git a/app/code/Magento/Backend/Test/Unit/Console/Command/CacheEnableCommandTest.php b/app/code/Magento/Backend/Test/Unit/Console/Command/CacheEnableCommandTest.php
index 8690d4295ec..e44b71d06f9 100644
--- a/app/code/Magento/Backend/Test/Unit/Console/Command/CacheEnableCommandTest.php
+++ b/app/code/Magento/Backend/Test/Unit/Console/Command/CacheEnableCommandTest.php
@@ -27,8 +27,14 @@ class CacheEnableCommandTest extends AbstractCacheSetCommandTest
     public function testExecute($param, $enable, $result, $output)
     {
         $this->cacheManagerMock->expects($this->once())->method('getAvailableTypes')->willReturn(['A', 'B', 'C']);
-        $this->cacheManagerMock->expects($this->once())->method('setEnabled')->with($enable, true)->willReturn($result);
-        $this->cacheManagerMock->expects($result === [] ? $this->never() : $this->once())->method('clean')->with($enable);
+        $this->cacheManagerMock->expects($this->once())
+            ->method('setEnabled')
+            ->with($enable, true)
+            ->willReturn($result);
+        $cleanInvocationCount = $result === [] ? 0 : 1;
+        $this->cacheManagerMock->expects($this->exactly($cleanInvocationCount))
+            ->method('clean')
+            ->with($enable);
 
         $commandTester = new CommandTester($this->command);
         $commandTester->execute($param);
-- 
GitLab