X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Fdrupalmoduleupgrader%2Ftests%2Fsrc%2FUnit%2FPlugin%2FDMU%2FAnalyzer%2FAnalyzerTestBase.php;fp=web%2Fmodules%2Fcontrib%2Fdrupalmoduleupgrader%2Ftests%2Fsrc%2FUnit%2FPlugin%2FDMU%2FAnalyzer%2FAnalyzerTestBase.php;h=b855360a7ace1739ef84f533500311522008f903;hp=0000000000000000000000000000000000000000;hb=8acec36f19c470dfcda1ae2336826a782f41874c;hpb=e0411c4e83ba0d079034db83c3f7f55be24a0e35 diff --git a/web/modules/contrib/drupalmoduleupgrader/tests/src/Unit/Plugin/DMU/Analyzer/AnalyzerTestBase.php b/web/modules/contrib/drupalmoduleupgrader/tests/src/Unit/Plugin/DMU/Analyzer/AnalyzerTestBase.php new file mode 100644 index 000000000..b855360a7 --- /dev/null +++ b/web/modules/contrib/drupalmoduleupgrader/tests/src/Unit/Plugin/DMU/Analyzer/AnalyzerTestBase.php @@ -0,0 +1,43 @@ + $this->getRandomGenerator()->sentences(4), + 'summary' => NULL, + 'documentation' => [], + 'tags' => [], + ]; + return parent::getPlugin($configuration, $plugin_definition); + } + + /** + * Tests an issue generated by an analyzer to ensure that it has all the + * default values pulled from the plugin definition. + * + * @param $issue + * The issue to test. Will be checked for IssueInterface conformance. + */ + protected function assertIssueDefaults($issue) { + $this->assertInstanceOf('\Drupal\drupalmoduleupgrader\IssueInterface', $issue); + + $plugin_definition = $this->analyzer->getPluginDefinition(); + $this->assertEquals($plugin_definition['message'], $issue->getTitle()); + $this->assertEquals($plugin_definition['summary'], $issue->getSummary()); + $this->assertSame($issue->getDocumentation(), $plugin_definition['documentation']); + } + +}