Issue #3151520 by adityasingh, pavnish, daffie, alexpott: Replace the database query with an entity query in UserInstallTest (cherry picked from commit 5ded5317)