You are here

public function FeaturesEnableTestCase::testFeaturesGetComponents in Features 7.2

Same name and namespace in other branches
  1. 7 tests/features.test \FeaturesEnableTestCase::testFeaturesGetComponents()

Run test for features_get_components on enable.

File

tests/features.test, line 314
Contains test classes for features module.

Class

FeaturesEnableTestCase
Tests enabling of feature modules.

Code

public function testFeaturesGetComponents() {

  // Testing that features_get_components returns correct after enable.
  $modules = array(
    'features',
    'taxonomy',
    'features_test',
  );

  // Make sure features_get_components is cached if features already enabled.
  if (!module_exists('features')) {
    drupal_load('module', 'features');
  }
  features_get_components();
  module_enable($modules);

  // Make sure correct information for enabled modules is now cached.
  $components = features_get_components();
  $taxonomy_component_info = taxonomy_features_api();
  $this
    ->assertTrue(!empty($components['taxonomy']) && $components['taxonomy'] == $taxonomy_component_info['taxonomy'], 'features_get_components returns correct taxonomy information on enable');
  features_rebuild();
  $this
    ->assertNotNull(taxonomy_vocabulary_machine_name_load('taxonomy_features_test'), 'Taxonomy vocabulary correctly enabled on enable.');
}