diff --git a/tests/features.test b/tests/features.test index 9c65aae..82153ef 100644 --- a/tests/features.test +++ b/tests/features.test @@ -261,11 +261,17 @@ class FeaturesCtoolsIntegrationTest extends DrupalWebTestCase { 'features_export_render', 'features_revert', ); + foreach ($try as $module) { $function = $module . '_features_api'; $this->assertFalse(function_exists($function), 'Chaos tools functions for ' . $module . ' do not exist while it is disabled.'); - // Module enable will trigger declaring the new functions. - module_enable(array($module)); + } + + module_enable($try); + // ctools hooks only created when there is actual feature exportable enabled + module_enable(array('features_test')); + + foreach ($try as $module) { if (module_exists($module)) { $function_exists = function_exists($function); if ($function_exists) { @@ -280,53 +286,3 @@ class FeaturesCtoolsIntegrationTest extends DrupalWebTestCase { } } } - -/** - * Tests Features' Drush integration. - */ -class FeaturesDrushExportTest extends DrupalWebTestCase { - protected $profile = 'testing'; - - /** - * Test info. - */ - public static function getInfo() { - return array( - 'name' => t('Drush integration'), - 'description' => t('Run tests on Features\' `drush` commands.'), - 'group' => t('Features'), - ); - } - - /** - * Set up test. - */ - public function setUp() { - parent::setUp(array('features')); - } - - /** - * Test features-export command when module is not present. - */ - public function testModuleExportNew() { - $module = $this->randomName(); - - $stream_wrapper = file_stream_wrapper_get_instance_by_uri("public://$module"); - $destination = $stream_wrapper->getDirectoryPath(); - $directory = "$destination/$module"; - - // Verify the module files are not present. - $module_file_exists = is_dir($directory); - $this->assertFalse($module_file_exists, 'The test module files are not present.'); - - // Run drush command then check that the module was created. - exec("drush fe $module node:page -y --destination=\"$destination\""); - $module_file_exists = is_dir($directory); - $this->assertTrue($module_file_exists, 'The test module has been created'); - - // Verify the component was exported. - $component_exported = is_file("$directory/$module.features.field.inc"); - $this->assertTrue($component_exported, 'The component was exported succesfully.'); - } - -} diff --git a/tests/features_test.features.user_permission.inc b/tests/features_test.features.user_permission.inc index e957190..30b192f 100644 --- a/tests/features_test.features.user_permission.inc +++ b/tests/features_test.features.user_permission.inc @@ -14,8 +14,8 @@ function features_test_user_default_permissions() { $permissions['create features_test content'] = array( 'name' => 'create features_test content', 'roles' => array( - 0 => 'anonymous user', - 1 => 'authenticated user', + 'anonymous user' => 'anonymous user', + 'authenticated user' => 'authenticated user', ), 'module' => 'node', );