task: #3605477 Better tests performance by avoiding data providers

Closes #3605477

What this MR does

Removes PHPUnit data providers from the kernel tests, as suggested in the issue. Data providers are convenient for unit tests, but from kernel tests upward they force a full Drupal setup for every single data set, which is slow.

Each affected test method now iterates over its (kept) provider array internally, so Drupal is set up once per method instead of once per data set. The provider methods are preserved as plain static methods (still named data sets), and each assertion now carries the data-set name as its failure message, so debuggability is unchanged.

Changes

  • PropTypeNormalizationTestBase::runRenderPropTest() is made loop-safe: the expected exception is now caught explicitly (try/catch on the exception_class data) instead of expectException(), which would otherwise abort the remaining data sets in a method. An optional $message argument was added to surface the failing data set.
  • 13 PropTypeNormalization tests + SchemaManagerTest + SourcePluginManagerTest converted from @dataProvider to internal foreach loops.

Results (converted files only)

  • Before: 194 tests in ~96 s
  • After: 43 tests in ~22 s — roughly 4.5× faster (194 → 43 Drupal setups)
  • Full kernel suite: 77 tests / 3758 assertions — green. phpcs and phpstan clean.

Merge request reports

Loading