Fix merge conflicts from 4.7.9 release
[phpmyadmin.git] / test / classes / Engines / InnodbTest.php
bloba14d7b139149a4703c3d3868ba3f0890699f8f46
1 <?php
2 /**
3 * Tests for PMA_StorageEngine_innodb
5 * @package PhpMyAdmin-test
6 */
7 namespace PhpMyAdmin\Tests\Engines;
9 use PhpMyAdmin\Engines\Innodb;
10 use PhpMyAdmin\Tests\PmaTestCase;
12 /**
13 * Tests for PhpMyAdmin\Engines\Innodb
15 * @package PhpMyAdmin-test
17 class InnodbTest extends PmaTestCase
19 /**
20 * @access protected
22 protected $object;
24 /**
25 * Sets up the fixture, for example, opens a network connection.
26 * This method is called before a test is executed.
28 * @access protected
29 * @return void
31 protected function setUp()
33 $GLOBALS['server'] = 0;
34 $this->object = new Innodb('innodb');
37 /**
38 * Tears down the fixture, for example, closes a network connection.
39 * This method is called after a test is executed.
41 * @access protected
42 * @return void
44 protected function tearDown()
46 unset($this->object);
49 /**
50 * Test for getVariables
52 * @return void
54 public function testGetVariables()
56 $this->assertEquals(
57 array(
58 'innodb_data_home_dir' => array(
59 'title' => __('Data home directory'),
60 'desc' => __('The common part of the directory path for all InnoDB data files.'),
62 'innodb_data_file_path' => array(
63 'title' => __('Data files'),
65 'innodb_autoextend_increment' => array(
66 'title' => __('Autoextend increment'),
67 'desc' => __('The increment size for extending the size of an autoextending tablespace when it becomes full.'),
68 'type' => 2,
70 'innodb_buffer_pool_size' => array(
71 'title' => __('Buffer pool size'),
72 'desc' => __('The size of the memory buffer InnoDB uses to cache data and indexes of its tables.'),
73 'type' => 1,
75 'innodb_additional_mem_pool_size' => array(
76 'title' => 'innodb_additional_mem_pool_size',
77 'type' => 1,
79 'innodb_buffer_pool_awe_mem_mb' => array(
80 'type' => 1,
82 'innodb_checksums' => array(
84 'innodb_commit_concurrency' => array(
86 'innodb_concurrency_tickets' => array(
87 'type' => 2,
89 'innodb_doublewrite' => array(
91 'innodb_fast_shutdown' => array(
93 'innodb_file_io_threads' => array(
94 'type' => 2,
96 'innodb_file_per_table' => array(
98 'innodb_flush_log_at_trx_commit' => array(
100 'innodb_flush_method' => array(
102 'innodb_force_recovery' => array(
104 'innodb_lock_wait_timeout' => array(
105 'type' => 2,
107 'innodb_locks_unsafe_for_binlog' => array(
109 'innodb_log_arch_dir' => array(
111 'innodb_log_archive' => array(
113 'innodb_log_buffer_size' => array(
114 'type' => 1,
116 'innodb_log_file_size' => array(
117 'type' => 1,
119 'innodb_log_files_in_group' => array(
120 'type' => 2,
122 'innodb_log_group_home_dir' => array(
124 'innodb_max_dirty_pages_pct' => array(
125 'type' => 2,
127 'innodb_max_purge_lag' => array(
129 'innodb_mirrored_log_groups' => array(
130 'type' => 2,
132 'innodb_open_files' => array(
133 'type' => 2,
135 'innodb_support_xa' => array(
137 'innodb_sync_spin_loops' => array(
138 'type' => 2,
140 'innodb_table_locks' => array(
141 'type' => 3,
143 'innodb_thread_concurrency' => array(
144 'type' => 2,
146 'innodb_thread_sleep_delay' => array(
147 'type' => 2,
150 $this->object->getVariables()
155 * Test for getVariablesLikePattern
157 * @return void
159 public function testGetVariablesLikePattern()
161 $this->assertEquals(
162 'innodb\\_%',
163 $this->object->getVariablesLikePattern()
168 * Test for getInfoPages
170 * @return void
172 public function testGetInfoPages()
174 $this->assertEquals(
175 array(),
176 $this->object->getInfoPages()
178 $this->object->support = 2;
179 $this->assertEquals(
180 array (
181 'Bufferpool' => 'Buffer Pool',
182 'Status' => 'InnoDB Status'
184 $this->object->getInfoPages()
189 * Test for getPageBufferpool
191 * @return void
193 public function testGetPageBufferpool()
195 $this->assertEquals(
196 '<table class="data" id="table_innodb_bufferpool_usage">
197 <caption class="tblHeaders">
198 Buffer Pool Usage
199 </caption>
200 <tfoot>
201 <tr>
202 <th colspan="2">
203 Total
204 : 4,096&nbsp;pages / 65,536&nbsp;KiB
205 </th>
206 </tr>
207 </tfoot>
208 <tbody>
209 <tr>
210 <th>Free pages</th>
211 <td class="value">0</td>
212 </tr>
213 <tr>
214 <th>Dirty pages</th>
215 <td class="value">0</td>
216 </tr>
217 <tr>
218 <th>Pages containing data</th>
219 <td class="value">0
220 </td>
221 </tr>
222 <tr>
223 <th>Pages to be flushed</th>
224 <td class="value">0
225 </td>
226 </tr>
227 <tr>
228 <th>Busy pages</th>
229 <td class="value">0
230 </td>
231 </tr> </tbody>
232 </table>
234 <table class="data" id="table_innodb_bufferpool_activity">
235 <caption class="tblHeaders">
236 Buffer Pool Activity
237 </caption>
238 <tbody>
239 <tr>
240 <th>Read requests</th>
241 <td class="value">64
242 </td>
243 </tr>
244 <tr>
245 <th>Write requests</th>
246 <td class="value">64
247 </td>
248 </tr>
249 <tr>
250 <th>Read misses</th>
251 <td class="value">32
252 </td>
253 </tr>
254 <tr>
255 <th>Write waits</th>
256 <td class="value">0
257 </td>
258 </tr>
259 <tr>
260 <th>Read misses in %</th>
261 <td class="value">50 %
262 </td>
263 </tr>
264 <tr>
265 <th>Write waits in %</th>
266 <td class="value">0 %
267 </td>
268 </tr>
269 </tbody>
270 </table>
272 $this->object->getPageBufferpool()
277 * Test for getPageStatus
279 * @return void
281 public function testGetPageStatus()
283 $this->assertEquals(
284 '<pre id="pre_innodb_status">' . "\n" . "\n" . '</pre>' . "\n",
285 $this->object->getPageStatus()
291 * Test for getPage
293 * @return void
295 public function testGetPage()
297 $this->assertEquals(
299 $this->object->getPage('Status')
301 $this->object->support = 2;
302 $this->assertEquals(
303 '<pre id="pre_innodb_status">' . "\n" . "\n" . '</pre>' . "\n",
304 $this->object->getPage('Status')
309 * Test for getMysqlHelpPage
311 * @return void
313 public function testGetMysqlHelpPage()
315 $this->assertEquals(
316 'innodb-storage-engine',
317 $this->object->getMysqlHelpPage()
323 * Test for getInnodbPluginVersion
325 * @return void
327 public function testGetInnodbPluginVersion()
329 $this->assertEquals(
330 '1.1.8',
331 $this->object->getInnodbPluginVersion()
337 * Test for supportsFilePerTable
339 * @return void
341 public function testSupportsFilePerTable()
343 $this->assertFalse(
344 $this->object->supportsFilePerTable()
350 * Test for getInnodbFileFormat
352 * @return void
354 public function testGetInnodbFileFormat()
356 $this->assertEquals(
357 'Antelope',
358 $this->object->getInnodbFileFormat()