You are here

function DatabaseAlterTestCase::testSimpleAlter in Drupal 7

Test that we can do basic alters.

File

modules/simpletest/tests/database_test.test, line 2765

Class

DatabaseAlterTestCase
Select alter tests.

Code

function testSimpleAlter() {
  $query = db_select('test');
  $query
    ->addField('test', 'name');
  $query
    ->addField('test', 'age', 'age');
  $query
    ->addTag('database_test_alter_add_range');
  $result = $query
    ->execute();
  $num_records = 0;
  foreach ($result as $record) {
    $num_records++;
  }
  $this
    ->assertEqual($num_records, 2, 'Returned the correct number of rows.');
}