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

WebTestBase::$root_user does not have a uid

$
0
0

Problem

  • WebTestBase::setUp() installs Drupal through the interactive installer, and creates a fake user object for uid 1 and makes that available as $this->root_user, but the object does not contain a uid.
  • The lack of a uid breaks WebTestBase::drupalCreateNode(), which tries to use the uid of the currently logged in user (which may be $this->root_user).

Proposed solution

  1. Just add a ::$uid property with value 1 there.
  2. No need to (re)load the entire entity of uid 1 (performance). It's OK if $this->root_user is a mock stdClass object.
  3. No need for adding tests for this.
AttachmentSizeStatusTest resultOperations
drupal8.test-root-user-uid.0.patch617 bytesIdlePASSED: [[SimpleTest]]: [MySQL] 49,315 pass(es).View details | Re-test

Viewing all articles
Browse latest Browse all 293174

Trending Articles



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