Closed (fixed)
Project:
CAPTCHA
Version:
8.x-1.x-dev
Component:
Tests
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Apr 2021 at 16:58 UTC
Updated:
17 Jun 2022 at 16:19 UTC
Jump to comment: Most recent
Attempting to run PHPUnit on a module that depends on CAPTCHA v1.2.0. generates an access level error for the $modules property on a number of testing classes:
PHP Fatal error: Access level to Drupal\Tests\captcha\Kernel\Migrate\d7\MigrateCaptchaPointsTest::$modules must be public (as in class Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase) in modules/contrib/captcha/tests/src/Kernel/Migrate/d7/MigrateCaptchaPointsTest.php on line 94
Change property access level from protected to public.
| Comment | File | Size | Author |
|---|---|---|---|
| captcha-module-property-access-level.patch | 2.96 KB | collinhaines |
Comments
Comment #2
johne commentedI can confirm this patch fixes the issue.
Comment #3
davidwhthomas commentedThanks, also confirming the patch fixed the issue.
Comment #5
japerryComment #6
collinhaines commentedI believe this is no longer a relevant issue.
Starting in Drupal 9, the
$modulesproperty in tests should beprotectedas per the change record. I was running into this issue on a Drupal 8 site at the time of creating this issue, not knowing that Drupal 9 was enforcing the protected access level.Comment #7
japerryCorrect, I'll get this reverted and up the requirement to 9.2 instead with D10 readiness.