Fix PHPStan L1 errors "Missing call to parent::setUp()/tearDown() method."

Created on 30 March 2023, over 1 year ago
Updated 1 May 2023, over 1 year ago

Problem/Motivation

Amongst the current suppressions found in the PHPStan level 1 baseline, introduce by the adding of phpstan/phpstan-phpunit, is: Missing call to parent::setUp() method..

This issue exists to fix almost all of those.

There are a few that can't be fixed (easily) and will remain in the baseline.
Those exceptions are listed here:

- modules/config/tests/src/Functional/ConfigInstallProfileUnmetDependenciesTest.php
Already has a parent::setUp() method, but in a try-catch.

Ad mentioned by @mondrake in #3 📌 Fix PHPStan L1 errors "Missing call to parent::setUp()/tearDown() method." Fixed :

I added to baseline a few missing calls to parent::setUp() in base test classes, since their setUp() methods are making unconventional things.

i.e. they would need IMHO a much deeper discussion if we want to clean them up

- tests/Drupal/FunctionalTests/Installer/InstallerTestBase.php
- tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php
- tests/Drupal/KernelTests/Core/DrupalKernel/DrupalKernelTest.php

Steps to reproduce

- Run PHPStan on level 1 and see the above issue amongst all others.

Proposed resolution

- Solve all of the reported issues for the above mentioned.
- Run PHPStan on level 1 and don't see the above issue any more, except for the one mentioned above.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

📌 Task
Status

Fixed

Version

10.1

Component
Base 

Last updated about 3 hours ago

Created by

🇳🇱Netherlands spokje

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024