Skip to content
Snippets Groups Projects
Commit f93b475f authored by Bohdan Korablov's avatar Bohdan Korablov
Browse files

MAGETWO-56787: [GITHUB][PR] Added call to action to compile command error #4134

parent c77d9d92
Branches
No related merge requests found
......@@ -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' => ''
],
];
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment