|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace N98\Magento\Command\Database; |
|
4
|
|
|
|
|
5
|
|
|
use N98\Magento\Command\TestCase; |
|
6
|
|
|
|
|
7
|
|
|
class VariablesCommandTest extends TestCase |
|
8
|
|
|
{ |
|
9
|
|
|
public function testExecute() |
|
10
|
|
|
{ |
|
11
|
|
|
$input = array( |
|
12
|
|
|
'command' => 'db:variables', |
|
13
|
|
|
'--format' => 'csv', |
|
14
|
|
|
); |
|
15
|
|
|
|
|
16
|
|
|
$this->assertDisplayContains($input, 'have_query_cache'); |
|
17
|
|
|
$this->assertDisplayContains($input, 'innodb_log_buffer_size'); |
|
18
|
|
|
$this->assertDisplayContains($input, 'max_connections'); |
|
19
|
|
|
$this->assertDisplayContains($input, 'thread_cache_size'); |
|
20
|
|
|
} |
|
21
|
|
|
|
|
22
|
|
|
public function testSearch() |
|
23
|
|
|
{ |
|
24
|
|
|
$input = array( |
|
25
|
|
|
'command' => 'db:variables', |
|
26
|
|
|
'--format' => 'csv', |
|
27
|
|
|
'search' => 'Innodb%', |
|
28
|
|
|
); |
|
29
|
|
|
|
|
30
|
|
|
$this->assertDisplayContains($input, 'innodb_concurrency_tickets'); |
|
31
|
|
|
$this->assertDisplayContains($input, 'innodb_file_format_check'); |
|
32
|
|
|
$this->assertDisplayContains($input, 'innodb_force_load_corrupted'); |
|
33
|
|
|
$this->assertDisplayContains($input, 'innodb_log_file_size'); |
|
34
|
|
|
$this->assertDisplayContains($input, 'innodb_read_io_threads'); |
|
35
|
|
|
} |
|
36
|
|
|
|
|
37
|
|
|
public function testRounding() |
|
38
|
|
|
{ |
|
39
|
|
|
$input = array( |
|
40
|
|
|
'command' => 'db:variables', |
|
41
|
|
|
'--format' => 'csv', |
|
42
|
|
|
'--rounding' => '2', |
|
43
|
|
|
'search' => '%size%', |
|
44
|
|
|
); |
|
45
|
|
|
|
|
46
|
|
|
$this->assertDisplayRegExp($input, '~max_binlog_stmt_cache_size," [0-9\.]+[A-Z]"~'); |
|
47
|
|
|
$this->assertDisplayRegExp($input, '~myisam_max_sort_file_size," +[0-9\.]+[A-Z]"~'); |
|
48
|
|
|
} |
|
49
|
|
|
} |
|
50
|
|
|
|