You are here

public function ConfigurationHandlerVariableTestCase::testImportToActiveStore in Configuration Management 7.2

File

tests/handlers/vocabularies.test, line 45
Tests for Configuration Management: Vocabularies.

Class

ConfigurationHandlerVariableTestCase
Base class for functional tests for configuration management.

Code

public function testImportToActiveStore() {

  // Change the path from where the configurations are loaded.
  $source = drupal_get_path('module', 'configuration') . '/tests/test_configs/';
  $config = 'vocabulary.tags';
  $results = ConfigurationManagement::importToActiveStore(array(
    $config,
  ), FALSE, FALSE, FALSE, $source);
  $imported = $results
    ->getInfo('imported');
  $this
    ->assertTrue(in_array($config, $imported), "Configuration for {$config} was imported.");
  $vocabulary_exists = db_query('SELECT 1 FROM {taxonomy_vocabulary} WHERE machine_name = :machine_name', array(
    ':machine_name' => 'tags',
  ))
    ->fetchField();
  $this
    ->assertTrue($vocabulary_exists, "The vocabulary was saved in the ActiveStore.");
}