Problem/Motivation

Follow up to #3252257: Remove PHPUnit 8 support. The compatibility writer was moved but the code wasn't adjusted to take into account the new code location.

This leads to errors like this:

Warning: mkdir(): Permission denied in /app/core/tests/Drupal/TestTools/PhpUnitCompatibility/ClassWriter.php on line 108
PHP Warning:  file_put_contents(/app/core/tests/Drupal/TestTools/PhpUnitCompatibility/../../../../../../sites/simpletest/Assert.php): Failed to open stream: No such file or directory in /app/core/tests/Drupal/TestTools/PhpUnitCompatibility/ClassWriter.php on line 110
...

Steps to reproduce

1. clone drupal
2. composer install
3. ./vendor/bin/phpunit -c core core/modules/system/tests/src/Functional/Common/RenderWebTest.php

Proposed resolution

Fix the code.

CommentFileSizeAuthor
#2 3259158-2.patch787 bytesneclimdul

Comments

neclimdul created an issue. See original summary.

neclimdul’s picture

Category: Task » Bug report
Status: Active » Needs review
StatusFileSize
new787 bytes

This is the root of the problem from the related issue's patch.

rename from core/tests/Drupal/TestTools/PhpUnitCompatibility/PhpUnit8/ClassWriter.php
rename to core/tests/Drupal/TestTools/PhpUnitCompatibility/ClassWriter.php

You can see why the move was a problem in the patch.

Not sure why this hasn't shown up in the last month other then maybe not many people aren't doing things in d10 or are used to running the upgrade scripts to avoid the rewrite or maybe just users generally have write access to the parent directory? Either way, simple fix.

longwave’s picture

Status: Needs review » Reviewed & tested by the community

Yup, make sense to me. Locally I have a sites/simpletest directory in the wrong location because of this.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Nice find @neclimdul

Committed 45d838f and pushed to 10.0.x. Thanks!

  • alexpott committed 45d838f on 10.0.x
    Issue #3259158 by neclimdul: PhpUnit compatibility broken
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.