Verified Commit fb02153b authored by Andrei Mateescu's avatar Andrei Mateescu
Browse files

task: #3584406 Refactor core/tests code via Rector

By: mondrake
parent b32c2605
Loading
Loading
Loading
Loading
Loading
+0 −18
Original line number Diff line number Diff line
@@ -38705,30 +38705,12 @@
	'count' => 1,
	'path' => __DIR__ . '/tests/Drupal/Tests/Core/Plugin/Discovery/TestContainerDerivativeDiscovery.php',
];
$ignoreErrors[] = [
	'message' => '#^Method Drupal\\\\Tests\\\\Core\\\\Plugin\\\\TestFilteredPluginManager\\:\\:contextHandler\\(\\) has no return type specified\\.$#',
	'identifier' => 'missingType.return',
	'count' => 1,
	'path' => __DIR__ . '/tests/Drupal/Tests/Core/Plugin/FilteredPluginManagerTraitTest.php',
];
$ignoreErrors[] = [
	'message' => '#^Method Drupal\\\\Tests\\\\Core\\\\Plugin\\\\TestFilteredPluginManager\\:\\:getDefinitionsForContexts\\(\\) has no return type specified\\.$#',
	'identifier' => 'missingType.return',
	'count' => 1,
	'path' => __DIR__ . '/tests/Drupal/Tests/Core/Plugin/FilteredPluginManagerTraitTest.php',
];
$ignoreErrors[] = [
	'message' => '#^Method Drupal\\\\Tests\\\\Core\\\\Plugin\\\\TestFilteredPluginManager\\:\\:moduleHandler\\(\\) has no return type specified\\.$#',
	'identifier' => 'missingType.return',
	'count' => 1,
	'path' => __DIR__ . '/tests/Drupal/Tests/Core/Plugin/FilteredPluginManagerTraitTest.php',
];
$ignoreErrors[] = [
	'message' => '#^Method Drupal\\\\Tests\\\\Core\\\\Plugin\\\\TestFilteredPluginManager\\:\\:themeManager\\(\\) has no return type specified\\.$#',
	'identifier' => 'missingType.return',
	'count' => 1,
	'path' => __DIR__ . '/tests/Drupal/Tests/Core/Plugin/FilteredPluginManagerTraitTest.php',
];
$ignoreErrors[] = [
	'message' => '#^Missing cache backend declaration for performance\\.$#',
	'identifier' => 'pluginManagerSetsCacheBackend.missingCacheBackend',
+1 −3
Original line number Diff line number Diff line
@@ -76,12 +76,10 @@ abstract class BuildTestBase extends TestCase {
  /**
   * The process that's running the HTTP server.
   *
   * @var \Symfony\Component\Process\Process
   *
   * @see self::standUpServer()
   * @see self::stopServer()
   */
  private $serverProcess = NULL;
  private ?Process $serverProcess = NULL;

  /**
   * Default to destroying build artifacts after a test finishes.
+2 −2
Original line number Diff line number Diff line
@@ -277,8 +277,8 @@ public function testCoreAutowiring(): void {
   * @return string[]
   *   An array of filenames.
   */
  private function getCoreServiceFiles() {
    $filenames = array_map(fn($module) => "core/modules/{$module[0]}/{$module[0]}.services.yml", $this->coreModuleListDataProvider());
  private function getCoreServiceFiles(): array {
    $filenames = array_map(fn(array $module): string => "core/modules/{$module[0]}/{$module[0]}.services.yml", $this->coreModuleListDataProvider());
    $filenames[] = 'core/core.services.yml';
    return array_filter($filenames, 'file_exists');
  }
+1 −1
Original line number Diff line number Diff line
@@ -177,7 +177,7 @@ public function testBuildParametersRemoved(): void {

    $build_only = array_filter(
      array_keys($container->getParameterBag()->all()),
      fn(string $name) => str_starts_with($name, '.'),
      fn(string $name): bool => str_starts_with($name, '.'),
    );
    $this->assertEmpty($build_only, sprintf(
      'Dot-prefixed build parameters should not be in the compiled container, but found: %s',
+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ class LinkGenerationTest extends KernelTestBase {
   * @see ::testHookLinkAlter()
   */
  #[Hook('link_alter')]
  public function linkAlter(&$variables): void {
  public function linkAlter(array &$variables): void {
    if (\Drupal::state()->get('link_generation_test_link_alter', FALSE)) {
      // Add text to the end of links.
      if (\Drupal::state()->get('link_generation_test_link_alter_safe', FALSE)) {
Loading