Commit fbeaa7ee authored by alexpott's avatar alexpott

Issue #2500031 by cilefen: Killing the entire Testing list page if any test...

Issue #2500031 by cilefen: Killing the entire Testing list page if any test anywhere is missing a summary is not nice; add robustness
parent 4a4ee058
<?php
/**
* @file
* Contains \Drupal\simpletest\Exception\MissingSummaryLineException.
*/
namespace Drupal\simpletest\Exception;
/**
* Exception thrown when a simpletest class is missing a summary line.
*/
class MissingSummaryLineException extends \LogicException {
}
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
use Drupal\Core\Cache\CacheBackendInterface; use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Extension\ExtensionDiscovery; use Drupal\Core\Extension\ExtensionDiscovery;
use Drupal\simpletest\Exception\MissingGroupException; use Drupal\simpletest\Exception\MissingGroupException;
use Drupal\simpletest\Exception\MissingSummaryLineException;
use PHPUnit_Util_Test; use PHPUnit_Util_Test;
/** /**
...@@ -297,9 +296,6 @@ public static function scanDirectory($namespace_prefix, $path) { ...@@ -297,9 +296,6 @@ public static function scanDirectory($namespace_prefix, $path) {
* PHPDoc annotations: * PHPDoc annotations:
* - module: List of Drupal module extension names the test depends on. * - module: List of Drupal module extension names the test depends on.
* *
* @throws \Drupal\simpletest\Exception\MissingSummaryLineException
* If the class does not have a PHPDoc summary line or @coversDefaultClass
* annotation.
* @throws \Drupal\simpletest\Exception\MissingGroupException * @throws \Drupal\simpletest\Exception\MissingGroupException
* If the class does not have a @group annotation. * If the class does not have a @group annotation.
*/ */
...@@ -343,9 +339,6 @@ public static function getTestInfo($classname, $doc_comment = NULL) { ...@@ -343,9 +339,6 @@ public static function getTestInfo($classname, $doc_comment = NULL) {
} }
else { else {
$info['description'] = static::parseTestClassSummary($doc_comment); $info['description'] = static::parseTestClassSummary($doc_comment);
if (empty($info['description'])) {
throw new MissingSummaryLineException(sprintf('Missing PHPDoc summary line in %s', $classname));
}
} }
if (isset($annotations['dependencies'])) { if (isset($annotations['dependencies'])) {
$info['requires']['module'] = array_map('trim', explode(',', $annotations['dependencies'])); $info['requires']['module'] = array_map('trim', explode(',', $annotations['dependencies']));
......
...@@ -215,8 +215,6 @@ public function testTestInfoParserMissingGroup() { ...@@ -215,8 +215,6 @@ public function testTestInfoParserMissingGroup() {
/** /**
* @covers ::getTestInfo * @covers ::getTestInfo
* @expectedException \Drupal\simpletest\Exception\MissingSummaryLineException
* @expectedExceptionMessage Missing PHPDoc summary line in Drupal\field\Tests\BulkDeleteTest
*/ */
public function testTestInfoParserMissingSummary() { public function testTestInfoParserMissingSummary() {
$classname = 'Drupal\field\Tests\BulkDeleteTest'; $classname = 'Drupal\field\Tests\BulkDeleteTest';
...@@ -225,7 +223,8 @@ public function testTestInfoParserMissingSummary() { ...@@ -225,7 +223,8 @@ public function testTestInfoParserMissingSummary() {
* @group field * @group field
*/ */
EOT; EOT;
\Drupal\simpletest\TestDiscovery::getTestInfo($classname, $doc_comment); $info = \Drupal\simpletest\TestDiscovery::getTestInfo($classname, $doc_comment);
$this->assertEmpty($info['description']);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment