Unverified Commit 754b8ffa authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3186443 by tuutti, marcelovani: PHPUnit 9.5 Call to undefined method ::getAnnotations()

parent 86de015d
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@
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.
@@ -77,7 +78,10 @@ protected function setUp() {
   * @return string
   */
  protected function getPluginClass() {
    $annotations = $this->getAnnotations();
    $annotations = Test::parseTestMethodAnnotations(
      static::class,
      $this->getName()
    );

    if (isset($annotations['class']['covers'])) {
      return $annotations['class']['covers'][0];
+5 −1
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@
use PHPUnit\Framework\TestCase;
use PHPUnit\Framework\TestSuite;
use PHPUnit\Util\ErrorHandler;
use PHPUnit\Util\Test;

/**
 * Listens for PHPUnit tests and fails those with invalid coverage annotations.
@@ -60,7 +61,10 @@ private function checkValidCoversForTest(TestCase $test) {
      return;
    }
    // Gather our annotations.
    $annotations = $test->getAnnotations();
    $annotations = Test::parseTestMethodAnnotations(
      static::class,
      $test->getName()
    );
    // Glean the @coversDefaultClass annotation.
    $default_class = '';
    $valid_default_class = FALSE;
+4 −1
Original line number Diff line number Diff line
@@ -51,7 +51,10 @@ protected function checkRequirements() {
    $root = static::getDrupalRoot();

    // Check if required dependencies exist.
    $annotations = $this->getAnnotations();
    $annotations = Test::parseTestMethodAnnotations(
      static::class,
      $this->getName()
    );
    if (!empty($annotations['class']['requires'])) {
      $this->checkModuleRequirements($root, $annotations['class']['requires']);
    }