Completed
Push — develop ( 7623eb...611a18 )
by Tom
03:37
created

CheckTablesCommandTest::getCommand()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 8
rs 9.4285
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
3
namespace N98\Magento\Command\Database\Maintain;
4
5
use N98\Magento\Command\TestCase;
6
7
/**
8
 * @see \N98\Magento\Command\Database\Maintain\CheckTablesCommand
9
 */
10
class CheckTablesCommandTest extends TestCase
11
{
12
    public function testExecuteMyIsam()
13
    {
14
        $this->markTestSkipped('Currently we have no myisam tables in a magento2 installation');
15
16
        $this->assertDisplayContains(
17
            array(
18
                'command'  => 'db:maintain:check-tables',
19
                '--format' => 'csv',
20
                '--type'   => 'quick',
21
                '--table'  => 'oauth_nonce',
22
            ),
23
            'oauth_nonce,check,quick,OK'
24
        );
25
    }
26
27
    public function testExecuteInnoDb()
28
    {
29
        $input = array(
30
            'command'  => 'db:maintain:check-tables',
31
            '--format' => 'csv',
32
            '--type'   => 'quick',
33
            '--table'  => 'catalog_product_entity_media_gallery*',
34
        );
35
        $timeRegex = '"\s+[0-9]+\srows","[0-9\.]+\ssecs"';
36
37
        $this->assertDisplayRegExp(
38
            $input,
39
            '~catalog_product_entity_media_gallery,"ENGINE InnoDB",' . $timeRegex . '~'
40
        );
41
        $this->assertDisplayRegExp(
42
            $input,
43
            '~catalog_product_entity_media_gallery_value,"ENGINE InnoDB",' . $timeRegex . '~'
44
        );
45
    }
46
}
47