govCMS / scaffold

6 stars 17 forks source link

Update phpunit support #63

Open larowlan opened 1 year ago

larowlan commented 1 year ago

Problem statement

The codebase has code that references phpunit 4 and 6 :scream: It should be using PHPUnit 9 as a minimum, the current bootstrap code doesn't work with Drupal 9 This leads me to believe no-one is writing PHPUnit tests, or if they are, they're not contributing back their fixes to bootstrap.php/phpunit.xml

PHP Fatal error:  During class fetch: Uncaught Error: Class "Drupal\TestTools\PhpUnitCompatibility\RunnerVersion" not found in /app/web/core/tests/Drupal/Tests/PhpUnitCompatibilityTrait.php:10
PHP Warning:  Class "\PHPUnit\Framework\MockObject\Matcher\InvokedRecorder" not found in /app/tests/phpunit/bootstrap.php on line 198

Proposed resolution

Bring the phpunit support up to something that works with Drupal and uses a supported version of PHPUnit

stooit commented 1 year ago

Thanks @larowlan -- yeah, the require-dev repo is stale. 😔

Will make sure it's given a fresh lick of paint as a part of the D10 compatibility efforts, and ensure it gets added to the maintenance schedule. Slipped off the radar somewhat since nobody is writing PHPUnit tests as you correctly assumed.

acbramley commented 6 days ago

Seems like this still isn't on the radar at all...

Even with up to date libraries, the PaaS docker-compose setup seemingly makes it impossible to run phpunit tests anywhere. The networking setup means from the host machine you can't talk to the database, and from the test container you can't talk to the website.