3 * Tests for PMA_StorageEngine_innodb
5 * @package PhpMyAdmin-test
12 require_once 'libraries/StorageEngine.class.php';
13 require_once 'libraries/engines/innodb.lib.php';
14 require_once 'libraries/php-gettext/gettext.inc';
15 require_once 'libraries/Util.class.php';
16 require_once 'libraries/database_interface.inc.php';
17 require_once 'libraries/Tracker.class.php';
19 class PMA_StorageEngine_innodb_Test
extends PHPUnit_Framework_TestCase
27 * Sets up the fixture, for example, opens a network connection.
28 * This method is called before a test is executed.
33 protected function setUp()
35 $this->object = new PMA_StorageEngine_innodb('innodb');
39 * Tears down the fixture, for example, closes a network connection.
40 * This method is called after a test is executed.
45 protected function tearDown()
51 * Test for getVariables
53 public function testGetVariables()
57 'innodb_data_home_dir' => array(
58 'title' => __('Data home directory'),
59 'desc' => __('The common part of the directory path for all InnoDB data files.'),
61 'innodb_data_file_path' => array(
62 'title' => __('Data files'),
64 'innodb_autoextend_increment' => array(
65 'title' => __('Autoextend increment'),
66 'desc' => __('The increment size for extending the size of an autoextending tablespace when it becomes full.'),
69 'innodb_buffer_pool_size' => array(
70 'title' => __('Buffer pool size'),
71 'desc' => __('The size of the memory buffer InnoDB uses to cache data and indexes of its tables.'),
74 'innodb_additional_mem_pool_size' => array(
75 'title' => 'innodb_additional_mem_pool_size',
78 'innodb_buffer_pool_awe_mem_mb' => array(
81 'innodb_checksums' => array(
83 'innodb_commit_concurrency' => array(
85 'innodb_concurrency_tickets' => array(
88 'innodb_doublewrite' => array(
90 'innodb_fast_shutdown' => array(
92 'innodb_file_io_threads' => array(
95 'innodb_file_per_table' => array(
97 'innodb_flush_log_at_trx_commit' => array(
99 'innodb_flush_method' => array(
101 'innodb_force_recovery' => array(
103 'innodb_lock_wait_timeout' => array(
106 'innodb_locks_unsafe_for_binlog' => array(
108 'innodb_log_arch_dir' => array(
110 'innodb_log_archive' => array(
112 'innodb_log_buffer_size' => array(
115 'innodb_log_file_size' => array(
118 'innodb_log_files_in_group' => array(
121 'innodb_log_group_home_dir' => array(
123 'innodb_max_dirty_pages_pct' => array(
126 'innodb_max_purge_lag' => array(
128 'innodb_mirrored_log_groups' => array(
131 'innodb_open_files' => array(
134 'innodb_support_xa' => array(
136 'innodb_sync_spin_loops' => array(
139 'innodb_table_locks' => array(
142 'innodb_thread_concurrency' => array(
145 'innodb_thread_sleep_delay' => array(
149 $this->object->getVariables()
154 * Test for getVariablesLikePattern
156 public function testGetVariablesLikePattern()
160 $this->object->getVariablesLikePattern()
165 * Test for getInfoPages
167 public function testGetInfoPages()
171 $this->object->getInfoPages()
173 $this->object->support
= 2;
176 'Bufferpool' => 'Buffer Pool',
177 'Status' => 'InnoDB Status'
179 $this->object->getInfoPages()
184 * Test for getPageBufferpool
186 public function testGetPageBufferpool()
189 '<table class="data" id="table_innodb_bufferpool_usage">
190 <caption class="tblHeaders">
197 : 4,096 pages / 65,536 KiB
204 <td class="value">0</td>
208 <td class="value">0</td>
211 <th>Pages containing data</th>
216 <th>Pages to be flushed</th>
227 <table class="data" id="table_innodb_bufferpool_activity">
228 <caption class="tblHeaders">
233 <th>Read requests</th>
238 <th>Write requests</th>
253 <th>Read misses in %</th>
254 <td class="value">50 %
258 <th>Write waits in %</th>
259 <td class="value">0 %
265 $this->object->getPageBufferpool()
270 * Test for getPageStatus
272 public function testGetPageStatus()
275 '<pre id="pre_innodb_status">' . "\n" . "\n" . '</pre>' . "\n",
276 $this->object->getPageStatus()
284 public function testGetPage()
287 $this->object->getPage('Status')
289 $this->object->support
= 2;
291 '<pre id="pre_innodb_status">' . "\n" . "\n" . '</pre>' . "\n",
292 $this->object->getPage('Status')
297 * Test for getMysqlHelpPage
299 public function testGetMysqlHelpPage()
302 'innodb-storage-engine',
303 $this->object->getMysqlHelpPage()
309 * Test for getInnodbPluginVersion
311 public function testGetInnodbPluginVersion()
315 $this->object->getInnodbPluginVersion()
321 * Test for supportsFilePerTable
323 public function testSupportsFilePerTable()
326 $this->object->supportsFilePerTable()
332 * Test for getInnodbFileFormat
334 public function testGetInnodbFileFormat()
338 $this->object->getInnodbFileFormat()