You are here

public function OptimizedbListTablesOperationExecuteTestCase::testListTablesOperationExecute in OptimizeDB 7

Performing operations on tables.

File

./optimizedb.test, line 294
Tests for optimizedb.module.

Class

OptimizedbListTablesOperationExecuteTestCase
Testing the performance of operations on tables.

Code

public function testListTablesOperationExecute() {
  $this
    ->drupalPost('admin/config/development/optimizedb/list_tables', array(), t('Check tables'));
  $this
    ->assertText(t('To execute, you must select at least one table from the list.'));

  // Output all database tables.
  $tables = _optimizedb_tables_list();
  $table_name = key($tables);
  $edit = array();

  // Selected first table in list.
  $edit['tables[' . $table_name . ']'] = $table_name;
  $this
    ->drupalPost('admin/config/development/optimizedb/list_tables', $edit, t('Check tables'));
  $this
    ->assertText(t('The operation completed successfully.'));
}