function ParseInfoFileUnitTest::testParseInfoFile

Parses an example .info file and verifies the results.

File

drupal/core/modules/system/lib/Drupal/system/Tests/Common/ParseInfoFileUnitTest.php, line 27
Definition of Drupal\system\Tests\Common\ParseInfoFileUnitTest.

Class

ParseInfoFileUnitTest
Tests the drupal_parse_info_file() API function.

Namespace

Drupal\system\Tests\Common

Code

function testParseInfoFile() {
  $info_values = drupal_parse_info_file(drupal_get_path('module', 'system') . '/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');
}