Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 294883

Replace the database query with an entity query in UserInstallTest

$
0
0

Problem/Motivation

The test class in core\modules\user\tests\src\Kernel\UserInstallTest.php uses a regular database query instead of using an entity query.

Proposed resolution

Replace the regular database query with an entity query and then use user storage to load the user entities. Use the loaded user entities in the assertions.

Info for novices:
The entity query for loading the user ids: $user_ids = \Drupal::entityQuery('user')->sort('uid')->execute();
The user entities are loaded with: $users = \Drupal::entityTypeManager()->getStorage('user')->loadMultiple($user_ids);

Remaining tasks

TBD

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

TBD


Viewing all articles
Browse latest Browse all 294883

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>