summaryrefslogtreecommitdiff
path: root/modules/simpletest/tests/common.test
diff options
context:
space:
mode:
Diffstat (limited to 'modules/simpletest/tests/common.test')
-rw-r--r--modules/simpletest/tests/common.test23
1 files changed, 23 insertions, 0 deletions
diff --git a/modules/simpletest/tests/common.test b/modules/simpletest/tests/common.test
index f1bd54ac1..e74b053d1 100644
--- a/modules/simpletest/tests/common.test
+++ b/modules/simpletest/tests/common.test
@@ -1576,6 +1576,29 @@ class DrupalErrorCollectionUnitTest extends DrupalWebTestCase {
}
/**
+ * Test the drupal_parse_info_file() API function.
+ */
+class ParseInfoFilesTestCase extends DrupalWebTestCase {
+ public static function getInfo() {
+ return array(
+ 'name' => 'Parsing .info files',
+ 'description' => 'Tests parsing .info files.',
+ 'group' => 'System',
+ );
+ }
+
+ /**
+ * Parse an example .info file an verify the results.
+ */
+ function testParseInfoFile() {
+ $info_values = drupal_parse_info_file(drupal_get_path('module', 'simpletest') . '/tests/common_test_info.txt');
+ $this->assertEqual($info_values['simple_string'], 'A simple string', t('Simple string value was parsed correctly.'), t('System'));
+ $this->assertEqual($info_values['simple_constant'], WATCHDOG_INFO, t('Constant value was parsed correctly.'), t('System'));
+ $this->assertEqual($info_values['double_colon'], 'dummyClassName::', t('Value containing double-colon was parsed correctly.'), t('System'));
+ }
+}
+
+/**
* Tests for the format_date() function.
*/
class FormatDateUnitTest extends DrupalWebTestCase {