Skip to content
Snippets Groups Projects
Commit a8bcb8aa authored by Safwan Khan's avatar Safwan Khan
Browse files

MAGETWO-36068: Move dev/shell/log.php

- Fixed unit test.
parent 7bbaf631
No related merge requests found
......@@ -18,11 +18,19 @@ class LogStatusCommandTest extends \PHPUnit_Framework_TestCase
$objectManager->expects($this->once())->method('create')->willReturn($resourceFactory);
$resource = $this->getMock('Magento\Log\Model\Resource\Shell', [], [], '', false);
$resourceFactory->expects($this->once())->method('create')->willReturn($resource);
$resource->expects($this->once())->method('getTablesInfo')->willReturn([]);
$resource->expects($this->once())->method('getTablesInfo')->willReturn(
[['name' => 'log_customer', 'rows' => '0', 'data_length' => '16.00Kb', 'index_length' => '16.00Kb']]
);
$objectManagerFactory->expects($this->once())->method('create')->willReturn($objectManager);
$commandTester = new CommandTester(new LogStatusCommand($objectManagerFactory));
$commandTester->execute([]);
$this->assertStringStartsWith('-----------------------------------+------------+------------+------------+'
. PHP_EOL, $commandTester->getDisplay());
$expectedMsg = '-----------------------------------+------------+------------+------------+' . PHP_EOL
. 'Table Name | Rows | Data Size | Index Size |' . PHP_EOL
. '-----------------------------------+------------+------------+------------+' . PHP_EOL
. 'log_customer | 0 | 16 b | 16 b |' . PHP_EOL
. '-----------------------------------+------------+------------+------------+' . PHP_EOL
. 'Total | 0 | 16 b | 16 b |' . PHP_EOL
. '-----------------------------------+------------+------------+------------+';
$this->assertEquals($expectedMsg . PHP_EOL, $commandTester->getDisplay());
}
}
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