Follow-up to #2917584-49: Some tests only go green because they happen to run as UID1 β
UserViewsFieldAccessTest
extends FieldFieldAccessTestBase
, where we have $userWithAccess
instance with unexpected user/1 mode.
As a result, the UserViewsFieldAccessTest::testUserFields()
checks access for user with full access, which is obviously not the goal of this test.
However, it would be good to keep assertions for user with 'administer users' permission too.
If we move this assertions to separate test, than another fun challenge arises. What to do with a commented code?
// $this->assertFieldAccess('user', 'mail', 'druplicon@drop.org');
// $this->assertFieldAccess('user', 'created', \Drupal::service('date.formatter')->format(123456));
// $this->assertFieldAccess('user', 'changed', \Drupal::service('date.formatter')->format(REQUEST_TIME));
'view test entity field', 'access content'
permissions'administer users'
permission$userWithAccess
in FieldFieldAccessTestBase
, to prevent similar defects in the future.To choose the most suitable solution:
Needs work
10.1 β¨
Last updated
Used to track the progress of issues reviewed by the Drupal Needs Review Queue Initiative.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
No activities found.