From f93b475febbce6351cd633442e16350ed1c3dd98 Mon Sep 17 00:00:00 2001
From: Bohdan Korablov <bkorablov@magento.com>
Date: Thu, 10 Nov 2016 12:06:29 +0200
Subject: [PATCH] MAGETWO-56787: [GITHUB][PR] Added call to action to compile
 command error #4134

---
 .../Console/Command/UpgradeCommandTest.php    | 28 +++++++++++++++++--
 1 file changed, 26 insertions(+), 2 deletions(-)

diff --git a/setup/src/Magento/Setup/Test/Unit/Console/Command/UpgradeCommandTest.php b/setup/src/Magento/Setup/Test/Unit/Console/Command/UpgradeCommandTest.php
index 6209df88bd5..89ea8199d62 100644
--- a/setup/src/Magento/Setup/Test/Unit/Console/Command/UpgradeCommandTest.php
+++ b/setup/src/Magento/Setup/Test/Unit/Console/Command/UpgradeCommandTest.php
@@ -11,7 +11,12 @@ use Magento\Framework\Console\Cli;
 
 class UpgradeCommandTest extends \PHPUnit_Framework_TestCase
 {
-    public function testExecute()
+    /**
+     * @param array $options
+     * @param string $expectedString
+     * @dataProvider executeDataProvider
+     */
+    public function testExecute($options = [], $expectedString ='')
     {
         $installerFactory = $this->getMock(\Magento\Setup\Model\InstallerFactory::class, [], [], '', false);
         $installer = $this->getMock(\Magento\Setup\Model\Installer::class, [], [], '', false);
@@ -20,6 +25,25 @@ class UpgradeCommandTest extends \PHPUnit_Framework_TestCase
         $installer->expects($this->at(2))->method('installDataFixtures');
         $installerFactory->expects($this->once())->method('create')->willReturn($installer);
         $commandTester = new CommandTester(new UpgradeCommand($installerFactory));
-        $this->assertSame(Cli::RETURN_SUCCESS, $commandTester->execute([]));
+        $this->assertSame(Cli::RETURN_SUCCESS, $commandTester->execute($options));
+        $this->assertEquals($expectedString, $commandTester->getDisplay());
+    }
+
+    /**
+     * @return array
+     */
+    public function executeDataProvider()
+    {
+        return [
+            [
+                'options' => [],
+                'expectedString' => 'Please re-run Magento compile command. Use the command "setup:di:compile"'
+                    . PHP_EOL
+            ],
+            [
+                'options' => ['--keep-generated' => true],
+                'expectedString' => ''
+            ],
+        ];
     }
 }
-- 
GitLab