Loading core/modules/migrate/tests/src/Kernel/MigrateSourceTestBase.php +3 −8 Original line number Diff line number Diff line Loading @@ -6,7 +6,6 @@ use Drupal\migrate\Plugin\MigrateIdMapInterface; use Drupal\migrate\Plugin\MigrationInterface; use Drupal\migrate\Row; use PHPUnit\Util\Test; /** * Base class for tests of Migrate source plugins. Loading Loading @@ -78,13 +77,9 @@ protected function setUp(): void { * @return string */ protected function getPluginClass() { $annotations = Test::parseTestMethodAnnotations( static::class, $this->name() ); if (isset($annotations['class']['covers'])) { return $annotations['class']['covers'][0]; $covers = $this->getTestClassCovers(); if (!empty($covers)) { return $covers[0]; } else { $this->fail('No plugin class was specified'); Loading core/tests/Drupal/TestTools/PhpUnitCompatibility/PhpUnit9/TestCompatibilityTrait.php +13 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,8 @@ namespace Drupal\TestTools\PhpUnitCompatibility\PhpUnit9; use PHPUnit\Util\Test; /** * Drupal's forward compatibility layer with multiple versions of PHPUnit. */ Loading @@ -16,4 +18,15 @@ public function name(): string { return $this->getName(); } /** * Gets @covers defined on the test class. * * @return string[] * An array of classes listed with the @covers annotation. */ public function getTestClassCovers(): array { $annotations = Test::parseTestMethodAnnotations(static::class, $this->name()); return $annotations['class']['covers'] ?? []; } } Loading
core/modules/migrate/tests/src/Kernel/MigrateSourceTestBase.php +3 −8 Original line number Diff line number Diff line Loading @@ -6,7 +6,6 @@ use Drupal\migrate\Plugin\MigrateIdMapInterface; use Drupal\migrate\Plugin\MigrationInterface; use Drupal\migrate\Row; use PHPUnit\Util\Test; /** * Base class for tests of Migrate source plugins. Loading Loading @@ -78,13 +77,9 @@ protected function setUp(): void { * @return string */ protected function getPluginClass() { $annotations = Test::parseTestMethodAnnotations( static::class, $this->name() ); if (isset($annotations['class']['covers'])) { return $annotations['class']['covers'][0]; $covers = $this->getTestClassCovers(); if (!empty($covers)) { return $covers[0]; } else { $this->fail('No plugin class was specified'); Loading
core/tests/Drupal/TestTools/PhpUnitCompatibility/PhpUnit9/TestCompatibilityTrait.php +13 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,8 @@ namespace Drupal\TestTools\PhpUnitCompatibility\PhpUnit9; use PHPUnit\Util\Test; /** * Drupal's forward compatibility layer with multiple versions of PHPUnit. */ Loading @@ -16,4 +18,15 @@ public function name(): string { return $this->getName(); } /** * Gets @covers defined on the test class. * * @return string[] * An array of classes listed with the @covers annotation. */ public function getTestClassCovers(): array { $annotations = Test::parseTestMethodAnnotations(static::class, $this->name()); return $annotations['class']['covers'] ?? []; } }