diff --git a/core/modules/system/src/Tests/Extension/InfoParserUnitTest.php b/core/modules/system/src/Tests/Extension/InfoParserUnitTest.php deleted file mode 100644 index 4c30c71..0000000 --- a/core/modules/system/src/Tests/Extension/InfoParserUnitTest.php +++ /dev/null @@ -1,87 +0,0 @@ -infoParser = new InfoParser(); - } - - /** - * Tests the functionality of the infoParser object. - */ - public function testInfoParser() { - $info = $this->infoParser->parse('core/modules/system/tests/fixtures/does_not_exist.info.txt'); - $this->assertTrue(empty($info), 'Non existing info.yml returns empty array.'); - - // Test that invalid YAML throws an exception and that message contains the - // filename that caused it. - $filename = 'core/modules/system/tests/fixtures/broken.info.txt'; - try { - $this->infoParser->parse($filename); - $this->fail('Expected InfoParserException not thrown when reading broken.info.txt'); - } - catch (InfoParserException $e) { - $this->assertTrue(strpos($e->getMessage(), $filename) !== FALSE, 'Exception message contains info.yml filename.'); - } - - // Tests that missing required keys are detected. - $filename = 'core/modules/system/tests/fixtures/missing_keys.info.txt'; - try { - $this->infoParser->parse($filename); - $this->fail('Expected InfoParserException not thrown when reading missing_keys.info.txt'); - } - catch (InfoParserException $e) { - $expected_message = "Missing required keys (type, core, name) in $filename."; - $this->assertEqual($e->getMessage(), $expected_message); - } - - // Tests that a single missing required key is detected. - $filename = 'core/modules/system/tests/fixtures/missing_key.info.txt'; - try { - $this->infoParser->parse($filename); - $this->fail('Expected InfoParserException not thrown when reading missing_key.info.txt'); - } - catch (InfoParserException $e) { - $expected_message = "Missing required keys (type) in $filename."; - $this->assertEqual($e->getMessage(), $expected_message); - } - - $info_values = $this->infoParser->parse('core/modules/system/tests/fixtures/common_test.info.txt'); - $this->assertEqual($info_values['simple_string'], 'A simple string', 'Simple string value was parsed correctly.', 'System'); - $this->assertEqual($info_values['version'], \Drupal::VERSION, 'Constant value was parsed correctly.', 'System'); - $this->assertEqual($info_values['double_colon'], 'dummyClassName::foo', 'Value containing double-colon was parsed correctly.', 'System'); - } - -} diff --git a/core/modules/system/tests/fixtures/common_test.info.txt b/core/modules/system/tests/fixtures/common_test.info.txt deleted file mode 100644 index ff535b1..0000000 --- a/core/modules/system/tests/fixtures/common_test.info.txt +++ /dev/null @@ -1,7 +0,0 @@ -core: 8.x -name: common_test -type: module -description: 'testing info file parsing' -simple_string: 'A simple string' -version: "VERSION" -double_colon: dummyClassName::foo