Similar to #2531258: Improve \Drupal\Tests\user\Unit\PermissionHandlerTest::testBuildPermissionsSortPerModule the BlockRepositoryTest relies on sort behavior that can differ in php engines.
http://3v4l.org/e6noO A little more complicated though because it actually does this though a bug. This never mocks the label method so when the sort calls it it always gets NULL defining a specific order. We actually then assert that order. Because earlier versions of PHP swap those values and HHVM and PHP7 don't this causes failures.

This slightly expands the tests with better coverage and ensures that we test the label method's usage in the sort.

Lazy beta evaluation: Tests and PHP7 major so ok.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Berdir’s picture

Status: Needs review » Reviewed & tested by the community

Looks good, manually confirmed that this fixes the current test fail with PHP 7.

xjm’s picture

Status: Reviewed & tested by the community » Fixed

Lazy beta evaluation: Tests and PHP7 major so ok.

Haha, +1.

This issue addresses a major bug and only changes test code, so per https://www.drupal.org/core/beta-changes, this can be completed any time during the Drupal 8 beta phase. Committed and pushed to 8.0.x. Thanks @neclimdul and @Berdir!

  • xjm committed e473fe0 on 8.0.x
    Issue #2533168 by neclimdul, Berdir: Fix BlockRepositoryTest
    

Status: Fixed » Closed (fixed)

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