Issue #3119761: Replace multiple test methods in InfoParserUnitTest with 1 testInfoException and a dataprovider
6 open threads
Merge request reports
Activity
added 11 commits
-
299a0d97...15ac0b4e - 9 commits from branch
project:11.x
- 38e14bb2 - Rerolled agaist 11.x
- a425f05f - [#3119761]: Remove stray '+' signs in test yml that broke tests
-
299a0d97...15ac0b4e - 9 commits from branch
- Resolved by Dave Long
74 68 vfsStream::create([ 75 69 'fixtures' => [ 76 'broken.info.txt' => $broken_info, 70 "broken.info.txt" => $yaml, 71 "broken-duplicate.info.txt" => $yaml, 77 72 ], 78 73 ]); 79 $filename = vfsStream::url('modules/fixtures/broken.info.txt'); 80 $this->expectException('\Drupal\Core\Extension\InfoParserException'); 81 $this->expectExceptionMessage('broken.info.txt'); 82 $this->infoParser->parse($filename); 74 75 $exception_message = "$expected_exception_message vfs://modules/fixtures/broken"; 76 // Set the expected exception for the second call to parse(). 77 $this->expectException(InfoParserException::class); 78 $this->expectExceptionMessage($exception_message . '-duplicate.info.txt'); changed this line in version 4 of the diff
65 public function testInfoException($yaml, $expected_exception_message): void { 72 66 73 67 vfsStream::setup('modules'); 74 68 vfsStream::create([ 75 69 'fixtures' => [ 76 'broken.info.txt' => $broken_info, 70 "broken.info.txt" => $yaml, 71 "broken-duplicate.info.txt" => $yaml, 77 72 ], 78 73 ]); 79 $filename = vfsStream::url('modules/fixtures/broken.info.txt'); 80 $this->expectException('\Drupal\Core\Extension\InfoParserException'); 81 $this->expectExceptionMessage('broken.info.txt'); 82 $this->infoParser->parse($filename); 74 75 $exception_message = "$expected_exception_message vfs://modules/fixtures/broken"; changed this line in version 4 of the diff
137 package: Core 138 version: VERSION 139 core_version_requirement: '*' 140 dependencies::;; 141 - field 142 BROKEN_INFO; 125 143 126 144 vfsStream::setup('modules'); 127 145 vfsStream::create([ 128 146 'fixtures' => [ 129 'missing_core_version_requirement.info.txt' => $missing_core_version_requirement, 130 'missing_core_version_requirement-duplicate.info.txt' => $missing_core_version_requirement, 147 'broken.info.txt' => $broken_info, 131 148 ], 132 149 ]); 133 150 $exception_message = "The 'core_version_requirement' key must be present in vfs://modules/fixtures/missing_core_version_requirement"; changed this line in version 3 of the diff
78 73 ]); 79 $filename = vfsStream::url('modules/fixtures/broken.info.txt'); 80 $this->expectException('\Drupal\Core\Extension\InfoParserException'); 81 $this->expectExceptionMessage('broken.info.txt'); 82 $this->infoParser->parse($filename); 74 75 $exception_message = "$expected_exception_message vfs://modules/fixtures/broken"; 76 // Set the expected exception for the second call to parse(). 77 $this->expectException(InfoParserException::class); 78 $this->expectExceptionMessage($exception_message . '-duplicate.info.txt'); 79 try { 80 $this->infoParser->parse(vfsStream::url("modules/fixtures/broken.info.txt")); 81 } 82 catch (InfoParserException $exception) { 83 $this->assertSame($exception_message . '.info.txt', $exception->getMessage()); 84 $this->infoParser->parse(vfsStream::url("modules/fixtures/broken-duplicate.info.txt")); changed this line in version 4 of the diff
138 version: VERSION 139 core_version_requirement: '*' 140 dependencies::;; 141 - field 142 BROKEN_INFO; 125 143 126 144 vfsStream::setup('modules'); 127 145 vfsStream::create([ 128 146 'fixtures' => [ 129 'missing_core_version_requirement.info.txt' => $missing_core_version_requirement, 130 'missing_core_version_requirement-duplicate.info.txt' => $missing_core_version_requirement, 147 'broken.info.txt' => $broken_info, 131 148 ], 132 149 ]); 133 150 $exception_message = "The 'core_version_requirement' key must be present in vfs://modules/fixtures/missing_core_version_requirement"; 134 151 // Set the expected exception for the 2nd call to parse(). changed this line in version 3 of the diff
82 catch (InfoParserException $exception) { 83 $this->assertSame($exception_message . '.info.txt', $exception->getMessage()); 84 $this->infoParser->parse(vfsStream::url("modules/fixtures/broken-duplicate.info.txt")); 85 } 83 86 } 84 87 85 88 /** 86 * Tests that missing required keys are detected. 87 * 88 * @covers ::parse 89 * Data provider for testInfoException(). 89 90 */ 90 public function testInfoParserMissingKeys() { 91 $missing_keys = <<<MISSING_KEYS 92 # info.yml for testing missing name, description, and type keys. 91 public function providerInfoException(): array { changed this line in version 4 of the diff
Please register or sign in to reply