Problem/Motivation
Branch tests for 3.1.x-dev are broken at HEAD:
$ ../vendor/phpunit/phpunit/phpunit -c core/ modules/contrib/permissions_by_term/ --verbose
PHPUnit 8.5.15 by Sebastian Bergmann and contributors.
Runtime: PHP 7.3.25-1+0~20201130.73+debian10~1.gbp042074
Configuration: /var/www/html/web/core/phpunit.xml.dist
Testing modules/contrib/permissions_by_term/
......................F...... 29 / 29 (100%)
Time: 4.06 minutes, Memory: 6.00 MB
There was 1 failure:
1) Drupal\Tests\permissions_by_term\Kernel\NodeEntityBundleInfoTest::testGetPermissionsByTids
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
Array (
'roleLabels' => Array (
1 => Array (
- 0 => 'First Role'
+ 0 => 'administrator'
+ 1 => 'First Role'
+ 2 => 'Second Role'
+ 3 => 'Third Role'
+ )
+ 2 => Array (
+ 0 => 'administrator'
1 => 'Second Role'
2 => 'Third Role'
- 3 => 'administrator'
- )
- 2 => Array (
- 0 => 'Second Role'
- 1 => 'Third Role'
- 2 => 'administrator'
)
)
'userDisplayNames' => Array (...)
)
/var/www/html/vendor/phpunit/phpunit/src/Framework/Constraint/IsEqual.php:100
/var/www/html/vendor/phpunit/phpunit/src/Framework/Assert.php:2924
/var/www/html/vendor/phpunit/phpunit/src/Framework/Assert.php:629
/var/www/html/web/modules/contrib/permissions_by_term/tests/src/Kernel/NodeEntityBundleInfoTest.php:102
/var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:703
FAILURES!
Tests: 29, Assertions: 404, Failures: 1.
Remaining self deprecation notices (72)
29x: Installing the tables key_value and key_value_expire with the method KernelTestBase::installSchema() is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. The tables are now lazy loaded and therefore will be installed automatically when used. See https://www.drupal.org/node/3143286
1x in EntityAccessCheckTest::testBaseAccessControl from Drupal\Tests\permissions_by_entity\Kernel
1x in AccessStorageTest::testSaveMultipleLanguageCodes from Drupal\Tests\permissions_by_term\Kernel
1x in PermissionModeTest::testNodeAccessRecordCreation from Drupal\Tests\permissions_by_term\Kernel
1x in PermissionModeTest::testHandleNodeAsAdmin from Drupal\Tests\permissions_by_term\Kernel
1x in PermissionModeTest::testHandleNode from Drupal\Tests\permissions_by_term\Kernel
1x in PermissionModeTest::testCanAdminUserAccessByNodeId from Drupal\Tests\permissions_by_term\Kernel
1x in PermissionModeTest::testCanUserAccessByNodeId from Drupal\Tests\permissions_by_term\Kernel
1x in NodeEntityBundleInfoTest::testGetPermissionsByTids from Drupal\Tests\permissions_by_term\Kernel
1x in NodeAccessRecordsTest::testCreateIfTermHasNoPermissionButPermissionModeIsOn from Drupal\Tests\permissions_by_term\Kernel
1x in NodeAccessRecordsTest::testCreateIfTermHasPermission from Drupal\Tests\permissions_by_term\Kernel
1x in NodeAccessRecordsTest::testCreateNone from Drupal\Tests\permissions_by_term\Kernel
1x in MultilingualTest::testCanNotAccess from Drupal\Tests\permissions_by_term\Kernel
1x in MultilingualTest::testCanAccess from Drupal\Tests\permissions_by_term\Kernel
1x in AccessStorageTest::testTidsByNidRetrieval from Drupal\Tests\permissions_by_term\Kernel
1x in AccessCheckTest::testIsAnyTaxonomyTermFieldDefinedInNodeType from Drupal\Tests\permissions_by_term\Kernel
1x in EntityAccessCheckTest::testAnonymousAccessDeniedUsingKernel from Drupal\Tests\permissions_by_entity\Kernel
1x in AccessCheckTest::testBypassNodeAccess from Drupal\Tests\permissions_by_term\Kernel
1x in AccessCheckTest::testCheckAccessAsGuestWithTermRestriction from Drupal\Tests\permissions_by_term\Kernel
1x in AccessCheckTest::testCheckAccessAsGuestWithNoTermRestriction from Drupal\Tests\permissions_by_term\Kernel
1x in AccessCheckTest::testRequireAllTermsGrantedWithNoRestrictedTerms from Drupal\Tests\permissions_by_term\Kernel
1x in AccessCheckTest::testRequireAllTermsGrantedWithRestrictedTerms from Drupal\Tests\permissions_by_term\Kernel
1x in AccessCheckTest::testNoTermRestriction from Drupal\Tests\permissions_by_term\Kernel
1x in AccessCheckTest::testNoGrantedTermRestriction from Drupal\Tests\permissions_by_term\Kernel
1x in AccessCheckTest::testDisabledRequireAllTermsGranted from Drupal\Tests\permissions_by_term\Kernel
1x in EntityPublicationTest::testAnonymousCannotViewUnpublishedNodesWithoutTermPermissions from Drupal\Tests\permissions_by_entity\Kernel
1x in EntityPublicationTest::testAnonymousCanViewPublishedNodesWithoutTermPermissions from Drupal\Tests\permissions_by_entity\Kernel
1x in EntityAccessCheckTest::testAuthenticatedDeniedOnCachedAccessUsingKernel from Drupal\Tests\permissions_by_entity\Kernel
1x in EntityAccessCheckTest::testAuthenticatedAccessUsingKernel from Drupal\Tests\permissions_by_entity\Kernel
1x in TermHandlerTest::testGetTidsBoundForAllNids from Drupal\Tests\permissions_by_term\Kernel
9x: The Drupal\Tests\permissions_by_term\Kernel\AccessCheckTest::$modules property must be declared protected. See https://www.drupal.org/node/2909426
9x in DrupalListener::startTest from Drupal\Tests\Listeners
5x: The Drupal\Tests\permissions_by_term\Kernel\PermissionModeTest::$modules property must be declared protected. See https://www.drupal.org/node/2909426
5x in DrupalListener::startTest from Drupal\Tests\Listeners
4x: Declaring ::setUp without a void return typehint in Drupal\Tests\permissions_by_entity\Kernel\EntityAccessCheckTest is deprecated in drupal:9.0.0. Typehinting will be required before drupal:10.0.0. See https://www.drupal.org/node/3114724
4x in DrupalListener::startTest from Drupal\Tests\Listeners
4x: The Drupal\Tests\permissions_by_entity\Kernel\EntityAccessCheckTest::$modules property must be declared protected. See https://www.drupal.org/node/2909426
4x in DrupalListener::startTest from Drupal\Tests\Listeners
3x: The Drupal\Tests\permissions_by_term\Kernel\NodeAccessRecordsTest::$modules property must be declared protected. See https://www.drupal.org/node/2909426
3x in DrupalListener::startTest from Drupal\Tests\Listeners
2x: The Drupal\Tests\permissions_by_term\Kernel\MultilingualTest::$modules property must be declared protected. See https://www.drupal.org/node/2909426
2x in DrupalListener::startTest from Drupal\Tests\Listeners
2x: Declaring ::setUp without a void return typehint in Drupal\Tests\permissions_by_term\Kernel\MultilingualTest is deprecated in drupal:9.0.0. Typehinting will be required before drupal:10.0.0. See https://www.drupal.org/node/3114724
2x in DrupalListener::startTest from Drupal\Tests\Listeners
2x: The Drupal\Tests\permissions_by_term\Kernel\AccessStorageTest::$modules property must be declared protected. See https://www.drupal.org/node/2909426
2x in DrupalListener::startTest from Drupal\Tests\Listeners
2x: Declaring ::setUp without a void return typehint in Drupal\Tests\permissions_by_term\Kernel\AccessStorageTest is deprecated in drupal:9.0.0. Typehinting will be required before drupal:10.0.0. See https://www.drupal.org/node/3114724
2x in DrupalListener::startTest from Drupal\Tests\Listeners
2x: The Drupal\Tests\permissions_by_entity\Kernel\EntityPublicationTest::$modules property must be declared protected. See https://www.drupal.org/node/2909426
2x in DrupalListener::startTest from Drupal\Tests\Listeners
2x: Declaring ::setUp without a void return typehint in Drupal\Tests\permissions_by_entity\Kernel\EntityPublicationTest is deprecated in drupal:9.0.0. Typehinting will be required before drupal:10.0.0. See https://www.drupal.org/node/3114724
2x in DrupalListener::startTest from Drupal\Tests\Listeners
1x: AssertLegacyTrait::assertNotEqual() is deprecated in drupal:8.0.0 and is removed from drupal:10.0.0. Use $this->assertNotEquals() instead. See https://www.drupal.org/node/3129738
1x in EntityPublicationTest::testAnonymousCanViewPublishedNodesWithoutTermPermissions from Drupal\Tests\permissions_by_entity\Kernel
1x: Declaring ::setUp without a void return typehint in Drupal\Tests\permissions_by_term\Kernel\NodeEntityBundleInfoTest is deprecated in drupal:9.0.0. Typehinting will be required before drupal:10.0.0. See https://www.drupal.org/node/3114724
1x in DrupalListener::startTest from Drupal\Tests\Listeners
1x: The Drupal\Tests\permissions_by_term\Kernel\NodeEntityBundleInfoTest::$modules property must be declared protected. See https://www.drupal.org/node/2909426
1x in DrupalListener::startTest from Drupal\Tests\Listeners
1x: Calling the Symfony\Component\EventDispatcher\EventDispatcherInterface::dispatch() method with a string event name as the first argument is deprecated in drupal:9.1.0, an Event object will be required instead in drupal:10.0.0. See https://www.drupal.org/node/3154407
1x in PermissionModeTest::testHandleNode from Drupal\Tests\permissions_by_term\Kernel
1x: Declaring ::setUp without a void return typehint in Drupal\Tests\permissions_by_term\Kernel\TermHandlerTest is deprecated in drupal:9.0.0. Typehinting will be required before drupal:10.0.0. See https://www.drupal.org/node/3114724
1x in DrupalListener::startTest from Drupal\Tests\Listeners
1x: The Drupal\Tests\permissions_by_term\Kernel\TermHandlerTest::$modules property must be declared protected. See https://www.drupal.org/node/2909426
1x in DrupalListener::startTest from Drupal\Tests\Listeners
Remaining direct deprecation notices (5)
5x: Calling the "Symfony\Component\EventDispatcher\EventDispatcherInterface::dispatch()" method with the event name as the first argument is deprecated since Symfony 4.3, pass it as the second argument and provide the event object as the first argument instead.
3x in EntityAccessCheckTest::testAuthenticatedDeniedOnCachedAccessUsingKernel from Drupal\Tests\permissions_by_entity\Kernel
1x in EntityAccessCheckTest::testAnonymousAccessDeniedUsingKernel from Drupal\Tests\permissions_by_entity\Kernel
1x in EntityAccessCheckTest::testAuthenticatedAccessUsingKernel from Drupal\Tests\permissions_by_entity\Kernel
Setting to urgent per Issue Priority field
Cause tests to fail in HEAD on the automated testing platform for any supported environment (including random failures), since this blocks all other work.
There are also 70+ deprecation notices, but those can be handled in a follow-up issue once this development blocker has been removed.
Steps to reproduce
Run tests locally
Proposed resolution
Fix failing test
Remaining tasks
Debug and submit patch
User interface changes
None.
API changes
None.
Data model changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | Screenshot from 2021-06-04 15-06-45.png | 10.03 KB | paulocs |
| #3 | permissions_by_term-broken_branch_tests-3217414-3.patch | 793 bytes | chris burge |
Issue fork permissions_by_term-3217414
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
chris burge commentedThis bug also exists in 8.x-2.x. The fix should be backported.
Comment #3
chris burge commentedPatch attached. Test results below:
Comment #4
paulocsPatch fixes error in test.
I will trigger the tests and add screenshot after I ran tests locally.
Thanks Chris
Comment #5
jepster_This issue is tied to PHPUnit 8.x. In PHPUnit 7.5.20 the tests do pass: https://bitbucket.org/publicplan/permissions_by_term/addon/pipelines/hom...
Comment #6
jepster_Thanks for the patch. Could you try to create a merge request via GitLab, please?
Comment #8
paulocsLink with the MR: https://git.drupalcode.org/project/permissions_by_term/-/merge_requests/5
Comment #10
marcoliverI've updated the issue fork against the current dev state and fixed some more broken tests for phpunit 8 and 9.
Comment #12
marcoliverFixed in 3.1.24, thanks everyone!