You are here

function ParseInfoFilesTestCase::testParseInfoFile in Drupal 7

Parse an example .info file an verify the results.

File

modules/simpletest/tests/common.test, line 2707
Tests for common.inc functionality.

Class

ParseInfoFilesTestCase
Test the drupal_parse_info_file() API function.

Code

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', 'Simple string value was parsed correctly.', 'System');
  $this
    ->assertEqual($info_values['simple_constant'], WATCHDOG_INFO, 'Constant value was parsed correctly.', 'System');
  $this
    ->assertEqual($info_values['double_colon'], 'dummyClassName::', 'Value containing double-colon was parsed correctly.', 'System');
}