You are here

public function PlugBasicTest::testModuleNamespaces in Plug 7

Checks the Module::getNamespaces() method.

File

lib/Drupal/plug/Tests/PlugBasicTest.php, line 57
Basic tests cases for plug module.

Class

PlugBasicTest

Namespace

Drupal\plug\Tests

Code

public function testModuleNamespaces() {
  $expected_values = array(
    'Drupal\\plug' => drupal_get_path('module', 'plug') . '/src',
    'Drupal\\field' => 'modules/field/src',
    'Drupal\\field_sql_storage' => 'modules/field/modules/field_sql_storage/src',
    'Drupal\\filter' => 'modules/filter/src',
    'Drupal\\node' => 'modules/node/src',
    'Drupal\\user' => 'modules/user/src',
    'Drupal\\standard' => 'profiles/standard/src',
    'Drupal\\system' => 'modules/system/src',
  );
  $namespaces = Module::getNamespaces();
  $this
    ->assertEqual($expected_values, array_intersect_assoc($namespaces
    ->getArrayCopy(), $expected_values));
  $cached_data = cache_get('module_namespaces');
  $this
    ->assertEqual($expected_values, array_intersect_assoc($cached_data->data, $expected_values));
}