summaryrefslogtreecommitdiff
path: root/modules/system/system.test
diff options
context:
space:
mode:
Diffstat (limited to 'modules/system/system.test')
-rw-r--r--modules/system/system.test26
1 files changed, 23 insertions, 3 deletions
diff --git a/modules/system/system.test b/modules/system/system.test
index ccb237d74..f40bd686a 100644
--- a/modules/system/system.test
+++ b/modules/system/system.test
@@ -272,12 +272,32 @@ class EnableDisableTestCase extends ModuleTestCase {
}
/**
- * Tests entity cache after enabling a module with a dependency on an enitity
- * providing module.
+ * Ensures entity info cache is updated after changes.
+ */
+ function testEntityInfoChanges() {
+ module_enable(array('entity_cache_test'));
+ $entity_info = entity_get_info();
+ $this->assertTrue(isset($entity_info['entity_cache_test']), 'Test entity type found.');
+
+ // Change the label of the test entity type and make sure changes appear
+ // after flushing caches.
+ variable_set('entity_cache_test_label', 'New label.');
+ drupal_flush_all_caches();
+ $info = entity_get_info('entity_cache_test');
+ $this->assertEqual($info['label'], 'New label.', 'New label appears in entity info.');
+
+ // Disable the providing module and make sure the entity type is gone.
+ module_disable(array('entity_cache_test', 'entity_cache_test_dependency'));
+ $entity_info = entity_get_info();
+ $this->assertFalse(isset($entity_info['entity_cache_test']), 'Entity type of the providing module is gone.');
+ }
+
+ /**
+ * Tests entity info cache after enabling a module with a dependency on an entity providing module.
*
* @see entity_cache_test_watchdog()
*/
- function testEntityCache() {
+ function testEntityInfoCacheWatchdog() {
module_enable(array('entity_cache_test'));
$info = variable_get('entity_cache_test');
$this->assertEqual($info['label'], 'Entity Cache Test', 'Entity info label is correct.');