drupalCreateNode() creates by default nodes owned by the user running the tests (uid = 1). This is confusing for the test writer and has lead to three bad consequences:

  1. The Path test case created its own version (PathTestCase::createNode),
  2. Several tests add an ugly ('uid' => $user->uid) to the drupalCreateNode() call,
  3. Several tests assigned their test users more rights that strictly necessary (edit all page content instead of edit own page content).
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Damien Tournoud’s picture

Status: Active » Needs review
FileSize
10.83 KB

And the patch.

boombatower’s picture

Anonymous’s picture

Status: Needs review » Needs work

The last submitted patch failed testing.

Dave Reid’s picture

Status: Needs work » Needs review
FileSize
10.36 KB

Re-rollin

Status: Needs review » Needs work

The last submitted patch failed testing.

Dave Reid’s picture

Status: Needs work » Needs review
FileSize
11.08 KB

Ok this one *should* pass all the tests now. I got too lazy to not run some local tests first and just relied on the testing bot. *slaps hand* Bad Dave...

Status: Needs review » Needs work

The last submitted patch failed testing.

Dave Reid’s picture

Status: Needs work » Needs review
FileSize
11.3 KB

Frak...that wasn't the latest version.

Dries’s picture

Status: Needs review » Fixed

Looks like a nice little clean-up. Committed to CVS HEAD. Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.