3 namespace Drupal\drupalmoduleupgrader\Plugin\DMU\Analyzer;
5 use Drupal\drupalmoduleupgrader\AnalyzerBase;
6 use Drupal\drupalmoduleupgrader\TargetInterface;
11 * description = @Translation("Checks for test classes that need to be rejiggered for Drupal 8."),
14 * "url" = "https://www.drupal.org/node/1543796",
15 * "title" = @Translation("Namespacing of automated tests has changed")
18 * "url" = "https://www.drupal.org/node/2301125",
19 * "title" = @Translation("<code>getInfo()</code> in test classes replaced by doc comments")
22 * "url" = "https://www.drupal.org/node/1710766",
23 * "title" = @Translation("Test classes should define a <code>$modules</code> property declaring dependencies")
26 * "url" = "https://www.drupal.org/node/1911318",
27 * "title" = @Translation("SimpleTest tests now use empty "testing" profile by default")
30 * "url" = "https://www.drupal.org/node/1829160",
31 * "title" = @Translation("New <code>KernelTestBase</code> class for API-level integration tests")
34 * "url" = "https://www.drupal.org/node/2012184",
35 * "title" = @Translation("PHPUnit added to Drupal core")
39 * "category" = { "misc", "system" }
41 * message = @Translation("Automated web tests must be in a PSR-4 namespace, and unit tests must be converted to PHPUnit.")
44 class Tests extends AnalyzerBase {
49 public function analyze(TargetInterface $target) {
52 $total += $target->getIndexer('class')->getQuery()->condition('parent', 'DrupalWebTestCase')->countQuery()->execute();
53 $total += $target->getIndexer('class')->getQuery()->condition('parent', 'DrupalUnitTestCase')->countQuery()->execute();
54 $total += $target->getIndexer('class')->getQuery()->condition('parent', 'DrupalTestBase')->countQuery()->execute();
57 $issues[] = $this->buildIssue($target);