Problem

#2418119: REST user updates bypass tightened user account change validation accidentally introduced a dependency on the php intl extension by using the class AbstractConstraintValidatorTest provided by the validator as base class. The causing test is ProtectedUserFieldConstraintValidatorTest.

Proposed resolution

Change the test to use another base class.

Remaining tasks

User interface changes

API changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fago’s picture

Version: 8.1.x-dev » 8.0.x-dev
klausi’s picture

Priority: Critical » Major

no data loss, security, unusable system and the testbot does not fail on this, so not critical.

fago’s picture

Status: Active » Needs review
FileSize
2.37 KB

I'd say it's critical if d8 does not work with the documented system requirements, but whatever priority - this should fix it.

klausi’s picture

Status: Needs review » Needs work

It only affects the documented system requirements for running phpunit tests, which is unfortunate but not a stop gap.

+++ b/core/modules/user/tests/src/Unit/Plugin/Validation/Constraint/ProtectedUserFieldConstraintValidatorTest.php
@@ -7,22 +7,21 @@
-  protected function getApiVersion() {
-    return Validation::API_VERSION_2_4;
+  protected function setUp() {
+    parent::setUp();
   }

empty setUp() method that just calls the parent and can be removed?

fago’s picture

Status: Needs work » Needs review
FileSize
7.56 KB
881 bytes

Right, that became unneeded.

It only affects the documented system requirements for running phpunit tests, which is unfortunate but not a stop gap.

ok with me.

fago’s picture

FileSize
2.34 KB

Correcting patch file, interdiff was correct.

neclimdul’s picture

Status: Needs review » Reviewed & tested by the community

I don't see a problem with this.

YesCT’s picture

In head when I run all the phpunit tests, I get

Fatal error: Class 'Locale' not found in /Users/ctheys/foo/drupal/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/AbstractConstraintValidatorTest.php on line 85

with the patch I get

There was 1 error:

1) Drupal\Tests\Core\Image\ImageTest::testRotate
imagecolorallocatealpha() expects parameter 1 to be resource, null given

/Users/ctheys/foo/drupal/core/modules/system/src/Plugin/ImageToolkit/Operation/gd/Rotate.php:60
/Users/ctheys/foo/drupal/core/lib/Drupal/Core/ImageToolkit/ImageToolkitOperationBase.php:177
/Users/ctheys/foo/drupal/core/lib/Drupal/Core/ImageToolkit/ImageToolkitBase.php:127
/Users/ctheys/foo/drupal/core/lib/Drupal/Core/Image/Image.php:148
/Users/ctheys/foo/drupal/core/lib/Drupal/Core/Image/Image.php:190
/Users/ctheys/foo/drupal/core/tests/Drupal/Tests/Core/Image/ImageTest.php:455

FAILURES!
Tests: 7631, Assertions: 40525, Errors: 1, Incomplete: 2.

Maybe that is just my local though?

webchick’s picture

Status: Reviewed & tested by the community » Needs review
Issue tags: +Needs manual testing

Can anyone confirm/deny #8?

YesCT’s picture

I changed my php version from PHP 5.5.14 to PHP 5.6.2
and then it ran fine.
Tests: 7631, Assertions: 40527, Incomplete: 2.

neclimdul’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs manual testing

I can't reproduce this. On IRC YesCT mentioned doing a composer up so its possible she had some other code changes? At the very least the code in her failure is not related to this fix so i think its safe to handle separately if it is in fact reproducible.

Berdir’s picture

Can't reproduce that fail, the patch fixes the Locale fatal error for me and everything else passes. @YesCT, can you open a new issue for that and report your exact PHP version and also the version of your gd extension?

$ php -i | grep "GD Version"
GD Version => 2.1.1-dev

YesCT’s picture

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Great, let's get this one out of the way.

Committed and pushed to 8.0.x. Thanks!

  • webchick committed a833be4 on 8.0.x
    Issue #2463879 by fago: PHP unit tests fail if intl extension is missing
    

Status: Fixed » Closed (fixed)

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