diff --git a/core/modules/locale/src/Tests/LocaleStaticTest.php b/core/modules/locale/src/Tests/LocaleStaticTest.php new file mode 100644 index 0000000..916057e --- /dev/null +++ b/core/modules/locale/src/Tests/LocaleStaticTest.php @@ -0,0 +1,55 @@ + 'Locale static cache clearing Tests', + 'description' => 'Tests that the checks if static cache is being cleared whenever rebuild js or not.', + 'group' => 'Locale', + ); + } + + /** + * Tests that static cache for language list gets cleared. + */ + public function testLocaleStatic() { + // Initialized an empty language object. + $test_language = array(); + // Test data. + drupal_static('language_list', array('test_static' => $test_language)); + _locale_rebuild_js(); + $lang_list = language_list(); + // Expecting lang_list to have test index still in there if the static + // cache was not reset. + if (array_key_exists('test', $lang_list)) + $this->assertFalse('The language cache was not cleared.'); + else + $this->assertTrue('The language cache was cleared successfully.'); + } +} +