diff --git a/core/.phpstan-baseline.php b/core/.phpstan-baseline.php index 789b1e63b598f731f3e8f64f965858785e6d10e1..e6850a6c6656ded14faccef52f9932a3085aa319 100644 --- a/core/.phpstan-baseline.php +++ b/core/.phpstan-baseline.php @@ -1131,6 +1131,16 @@ 'count' => 1, 'path' => __DIR__ . '/modules/migrate/src/Plugin/migrate/destination/NullDestination.php', ]; +$ignoreErrors[] = [ + 'message' => '#^@dataProvider providerSource related method not found\\.$#', + 'count' => 1, + 'path' => __DIR__ . '/modules/migrate/tests/src/Kernel/MigrateSourceTestBase.php', +]; +$ignoreErrors[] = [ + 'message' => '#^@dataProvider providerSource related method not found\\.$#', + 'count' => 1, + 'path' => __DIR__ . '/modules/migrate/tests/src/Kernel/MigrateSqlSourceTestBase.php', +]; $ignoreErrors[] = [ 'message' => '#^Call to an undefined static method Drupal\\\\Tests\\\\migrate\\\\Kernel\\\\MigrateTestBase\\:\\:migrateDumpAlter\\(\\)\\.$#', 'count' => 1, diff --git a/core/modules/migrate/tests/src/Kernel/MigrateSourceTestBase.php b/core/modules/migrate/tests/src/Kernel/MigrateSourceTestBase.php index f102b4b411266564e2939d424c08a728ce51f7bb..ba3317ba2aaa1c5284a72f1901da71ca9b60c292 100644 --- a/core/modules/migrate/tests/src/Kernel/MigrateSourceTestBase.php +++ b/core/modules/migrate/tests/src/Kernel/MigrateSourceTestBase.php @@ -9,6 +9,29 @@ /** * Base class for tests of Migrate source plugins. + * + * Implementing classes must declare a providerSource() method for this class + * to work, defined as follows: + * + * @code + * abstract public static function providerSource(): array; + * @endcode + * + * The returned array should be as follows: + * + * @code + * Array of data sets to test, each of which is a numerically indexed array + * with the following elements: + * - An array of source data, which can be optionally processed and set up + * by subclasses. + * - An array of expected result rows. + * - (optional) The number of result rows the plugin under test is expected + * to return. If this is not a numeric value, the plugin will not be + * counted. + * - (optional) Array of configuration options for the plugin under test. + * @endcode + * + * @see \Drupal\Tests\migrate\Kernel\MigrateSourceTestBase::testSource */ abstract class MigrateSourceTestBase extends KernelTestBase { @@ -31,24 +54,6 @@ abstract class MigrateSourceTestBase extends KernelTestBase { */ protected $plugin; - /** - * The data provider. - * - * @see \Drupal\Tests\migrate\Kernel\MigrateSourceTestBase::testSource - * - * @return array - * Array of data sets to test, each of which is a numerically indexed array - * with the following elements: - * - An array of source data, which can be optionally processed and set up - * by subclasses. - * - An array of expected result rows. - * - (optional) The number of result rows the plugin under test is expected - * to return. If this is not a numeric value, the plugin will not be - * counted. - * - (optional) Array of configuration options for the plugin under test. - */ - abstract public static function providerSource(); - /** * {@inheritdoc} */