diff --git a/tests/handlers/content_types.test b/tests/handlers/content_types.test index 0b21036..07e5228 100644 --- a/tests/handlers/content_types.test +++ b/tests/handlers/content_types.test @@ -52,9 +52,6 @@ class ConfigurationHandlerContentTypeTestCase extends ConfigurationWebTestCase { $imported = $results->getInfo('imported'); $this->assertTrue(in_array($config, $imported), "Configuration for $config was imported."); - $configuration = ConfigurationManagement::createConfigurationInstance($config); - $this->assertTrue($configuration->loadFromActiveStore()->getStatus() == t('In Sync'), 'The configuration is In Sync'); - $article = node_type_load('article'); $type_exists = db_query('SELECT 1 FROM {node_type} WHERE type = :type', array(':type' => 'article'))->fetchField(); @@ -114,6 +111,9 @@ class ConfigurationHandlerContentTypeTestCase extends ConfigurationWebTestCase { $original_description = $non_modified_article->description; $this->assertTrue(!empty($non_modified_article), 'The content type was suscessfully loaded from the ActiveStore.'); + $configuration = ConfigurationManagement::createConfigurationInstance($config); + $this->assertTrue($configuration->loadFromActiveStore()->getStatus() == t('In Sync'), 'The configuration is In Sync'); + $object = db_select('configuration_staging', 'cs') ->fields('cs') ->condition('component', 'content_type') diff --git a/tests/handlers/image_styles.test b/tests/handlers/image_styles.test index d137517..8a3beb1 100644 --- a/tests/handlers/image_styles.test +++ b/tests/handlers/image_styles.test @@ -52,9 +52,6 @@ class ConfigurationHandlerImageStyleTestCase extends ConfigurationWebTestCase { $imported = $results->getInfo('imported'); $this->assertTrue(in_array($config, $imported), "Configuration for $config was imported."); - $configuration = ConfigurationManagement::createConfigurationInstance($config); - $this->assertTrue($configuration->loadFromActiveStore()->getStatus() == t('In Sync'), 'The configuration is In Sync'); - $format_exists = image_style_load('custom'); $this->assertTrue($format_exists, "The image style was saved in the ActiveStore."); $this->assertTrue(!empty($format_exists['effects']), "The image style saved in the ActiveStore contains effects."); @@ -107,6 +104,9 @@ class ConfigurationHandlerImageStyleTestCase extends ConfigurationWebTestCase { $config = 'image_style.custom'; $results = ConfigurationManagement::importToActiveStore(array($config), FALSE, FALSE, TRUE); + $configuration = ConfigurationManagement::createConfigurationInstance($config); + $this->assertTrue($configuration->loadFromActiveStore()->getStatus() == t('In Sync'), 'The configuration is In Sync'); + $object = db_select('configuration_staging', 'cs') ->fields('cs') ->condition('component', 'image_style') diff --git a/tests/handlers/permissions.test b/tests/handlers/permissions.test index c3680c2..dd5d8dc 100644 --- a/tests/handlers/permissions.test +++ b/tests/handlers/permissions.test @@ -53,9 +53,6 @@ class ConfigurationHandlerPermissionTestCase extends ConfigurationWebTestCase { $imported = $results->getInfo('imported'); $this->assertTrue(in_array($config, $imported), "Configuration for $config was imported."); - $configuration = ConfigurationManagement::createConfigurationInstance($config); - $this->assertTrue($configuration->loadFromActiveStore()->getStatus() == t('In Sync'), 'The configuration is In Sync'); - // After import the permission, the developer role should have permissions // to administer content types. $permission_exist = $this->canDevelopersAdministerContentTypes($developer_rid); @@ -88,6 +85,9 @@ class ConfigurationHandlerPermissionTestCase extends ConfigurationWebTestCase { ConfigurationManagement::setStream(drupal_get_path('module', 'configuration') . '/tests/test_configs/'); $results = ConfigurationManagement::importToActiveStore(array('permission.administer_content_types'), FALSE, FALSE, TRUE); + $configuration = ConfigurationManagement::createConfigurationInstance($config); + $this->assertTrue($configuration->loadFromActiveStore()->getStatus() == t('In Sync'), 'The configuration is In Sync'); + $object = db_select('configuration_staging', 'cs') ->fields('cs') ->condition('component', 'permission') diff --git a/tests/handlers/variables.test b/tests/handlers/variables.test index ca6a80a..1d5e6cd 100644 --- a/tests/handlers/variables.test +++ b/tests/handlers/variables.test @@ -50,9 +50,6 @@ class ConfigurationHandlerVariableTestCase extends ConfigurationWebTestCase { $imported = $results->getInfo('imported'); $this->assertTrue(in_array($config, $imported), "Configuration for $config was imported."); - $configuration = ConfigurationManagement::createConfigurationInstance($config); - $this->assertTrue($configuration->loadFromActiveStore()->getStatus() == t('In Sync'), 'The configuration is In Sync'); - $variable_exists = db_query('SELECT 1 FROM {variable} WHERE name = :name', array(':name' => 'site_name'))->fetchField(); $this->assertTrue($variable_exists, "The variable was saved in the ActiveStore."); } @@ -85,6 +82,9 @@ class ConfigurationHandlerVariableTestCase extends ConfigurationWebTestCase { ConfigurationManagement::setStream(drupal_get_path('module', 'configuration') . '/tests/test_configs/'); $results = ConfigurationManagement::importToActiveStore(array('variable.site_name'), FALSE, FALSE, TRUE); + $configuration = ConfigurationManagement::createConfigurationInstance($config); + $this->assertTrue($configuration->loadFromActiveStore()->getStatus() == t('In Sync'), 'The configuration is In Sync'); + $object = db_select('configuration_staging', 'cs') ->fields('cs') ->condition('component', 'variable') diff --git a/tests/handlers/views.test b/tests/handlers/views.test index c4e604b..408c0d2 100644 --- a/tests/handlers/views.test +++ b/tests/handlers/views.test @@ -53,9 +53,6 @@ class ConfigurationHandlerViewTestCase extends ConfigurationWebTestCase { $imported = $results->getInfo('imported'); $this->assertTrue(in_array($config, $imported), "Configuration for $config was imported."); - $configuration = ConfigurationManagement::createConfigurationInstance($config); - $this->assertTrue($configuration->loadFromActiveStore()->getStatus() == t('In Sync'), 'The configuration is In Sync'); - $view_exists = views_get_view('test'); $this->assertTrue(!empty($view_exists->name), "The view was saved in the ActiveStore."); } @@ -101,6 +98,9 @@ class ConfigurationHandlerViewTestCase extends ConfigurationWebTestCase { $results = ConfigurationManagement::importToActiveStore(array($config), FALSE, FALSE, TRUE); $view = views_get_view('test', TRUE); + $configuration = ConfigurationManagement::createConfigurationInstance($config); + $this->assertTrue($configuration->loadFromActiveStore()->getStatus() == t('In Sync'), 'The configuration is In Sync'); + $object = db_select('configuration_staging', 'cs') ->fields('cs') ->condition('component', 'views_view') diff --git a/tests/handlers/vocabularies.test b/tests/handlers/vocabularies.test index f59d0c7..b8ca59d 100644 --- a/tests/handlers/vocabularies.test +++ b/tests/handlers/vocabularies.test @@ -51,9 +51,6 @@ class ConfigurationHandlerVariableTestCase extends ConfigurationWebTestCase { $imported = $results->getInfo('imported'); $this->assertTrue(in_array($config, $imported), "Configuration for $config was imported."); - $configuration = ConfigurationManagement::createConfigurationInstance($config); - $this->assertTrue($configuration->loadFromActiveStore()->getStatus() == t('In Sync'), 'The configuration is In Sync'); - $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."); } @@ -65,7 +62,6 @@ class ConfigurationHandlerVariableTestCase extends ConfigurationWebTestCase { ConfigurationManagement::setStream($config_path); - $vocabulary = new stdClass(); $vocabulary->name = $this->randomName(); $vocabulary->description = $this->randomName(); @@ -93,6 +89,9 @@ class ConfigurationHandlerVariableTestCase extends ConfigurationWebTestCase { ConfigurationManagement::setStream(drupal_get_path('module', 'configuration') . '/tests/test_configs/'); $results = ConfigurationManagement::importToActiveStore(array('vocabulary.tags'), FALSE, FALSE, TRUE); + $configuration = ConfigurationManagement::createConfigurationInstance($config); + $this->assertTrue($configuration->loadFromActiveStore()->getStatus() == t('In Sync'), 'The configuration is In Sync'); + $object = db_select('configuration_staging', 'cs') ->fields('cs') ->condition('component', 'vocabulary')