You are here

private function PatternsSystemTestCase::assertModule in Patterns 7

Same name and namespace in other branches
  1. 7.2 tests/system/system.test \PatternsSystemTestCase::assertModule()

Check the database if a module is enabled/disabled. @name Module name @enabled TRUE iff the module should be enabled.

1 call to PatternsSystemTestCase::assertModule()
PatternsSystemTestCase::testModules in tests/system/system.test

File

tests/system/system.test, line 36
SimpleTests for the System component of Patterns.

Class

PatternsSystemTestCase
@file SimpleTests for the System component of Patterns.

Code

private function assertModule($name, $enabled = TRUE) {
  $module = db_select('system', 's')
    ->fields('s', array(
    'name',
  ))
    ->condition('name', $name)
    ->condition('type', 'module')
    ->condition('status', $enabled ? '1' : '0')
    ->countQuery()
    ->execute()
    ->fetchField();
  $this
    ->assertEqual($module, 1, $message = 'The ' . $name . ' module should ' . ($enabled ? '' : 'not ') . 'be enabled.');
}