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.
Comment | File | Size | Author |
---|---|---|---|
BlockRepositoryTest-sort-bug.patch | 1.89 KB | neclimdul | |
Comments
Comment #1
BerdirLooks good, manually confirmed that this fixes the current test fail with PHP 7.
Comment #2
xjmHaha, +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!