Repeatable
Always
Steps to repeat
1. clone git@git.drupal.org:project/drupal.git
2. checkout branch 9.0.x
3. run unit test: cd core && ../vendor\bin\phpunit
Expected Results
Tests run as usual
Actual Results
Warning: include(): Failed opening '{path}\core\tests\Drupal\TestTools\PhpUnitCompatibility\PhpUnit8/../../../../../../sites/simpletest/TestCase.php' for inclusion (include_path='{path}\vendor/pear/archive_tar;{path}\vendor/pear/console_getopt;{path}\vendor/pear/pear-core-minimal/src') in {path}\core\tests\Drupal\TestTools\PhpUnitCompatibility\PhpUnit8\ClassWriter.php on line 51
PHP Fatal error: Declaration of Drupal\Tests\UnitTestCase::setUp() must be compatible with PHPUnit\Framework\TestCase::setUp(): void in C:\Projects\_poc\_drupal\core\tests\Drupal\Tests\UnitTestCase.php on line 19
Cause
The "simpletest" folder does not exist under the sites/ directory
Patch from user mondrake https://www.drupal.org/project/drupal/issues/3063887#comment-13465642 which first creates the folder if it does not exist seems to solve the issue.
Comment | File | Size | Author |
---|---|---|---|
#17 | core-phpunit-test-declaration-compatibility-3114041-17.patch | 2.31 KB | gigimaor |
#16 | core-phpunit-test-declaration-compatibility-3114041-16.patch | 2.05 KB | gigimaor |
#15 | drupal-3114640-8.patch | 1.22 KB | SerShevchyk |
#10 | interdiff_8-10.txt | 905 bytes | swatichouhan012 |
#10 | 3114041-10.patch | 1.32 KB | swatichouhan012 |
Comments
Comment #2
longwaveComment #3
andypostComment #4
chr.fritschThis looks good to me.
We have this error also in our travis tests, see https://travis-ci.org/BurdaMagazinOrg/module-length-indicator/jobs/65793...
After applying this patch, our tests are working, see https://travis-ci.org/BurdaMagazinOrg/module-length-indicator/jobs/65812...
Comment #5
alexpottMy one concern with this is race conditions and multiple file_exists checks. We can do a bit better here.
So once the file exists - we will only do one file_exists() check.
Comment #7
alexpottCrediting @mondrake because they supplied the original patch in a different issue.
Comment #8
swatichouhan012 CreditAttribution: swatichouhan012 at Valuebound for Valuebound commentedupdated patch wrt comment #5, kindly review new patch.
Comment #9
longwaveThis comment now appears twice.
Comment #10
swatichouhan012 CreditAttribution: swatichouhan012 at Valuebound for Valuebound commentedRemoved unwanted comment, kindly review new patch.
Comment #11
chr.fritschI applied the latest patch to our testing and it still looks good: https://travis-ci.org/github/BurdaMagazinOrg/module-length-indicator/job...
All concerns are fixed, so re-rtbc
Comment #12
alexpottCommitted 449b333 and pushed to 9.0.x. Thanks!
Comment #15
SerShevchykComment #16
gigimaorHi
I still have compatibility issues with Test Kernel on Drupal v9.5.7 and PHPUnit v9.6.6.
Suggesting this patch
Comment #17
gigimaorComment #18
emb03 CreditAttribution: emb03 commentedHaving this issue on drupal 10.x patch is not applying.