Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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:
- The Path test case created its own version (
PathTestCase::createNode
), - Several tests add an ugly
('uid' => $user->uid)
to thedrupalCreateNode()
call, - Several tests assigned their test users more rights that strictly necessary (
edit all page content
instead ofedit own page content
).
Comment | File | Size | Author |
---|---|---|---|
#8 | 308296-drupalcreatenode-love-D7.patch | 11.3 KB | Dave Reid |
#6 | 308296-drupalcreatenode-love-D7.patch | 11.08 KB | Dave Reid |
#4 | 308296-drupalcreatenode-love.patch | 10.36 KB | Dave Reid |
#1 | 308296-drupalcreatenode-love.patch | 10.83 KB | Damien Tournoud |
Comments
Comment #1
Damien Tournoud CreditAttribution: Damien Tournoud commentedAnd the patch.
Comment #2
boombatower CreditAttribution: boombatower commentedWhat about #212304: drupalCreateNode does not use the internal browser?
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedThe last submitted patch failed testing.
Comment #4
Dave ReidRe-rollin
Comment #6
Dave ReidOk 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...
Comment #8
Dave ReidFrak...that wasn't the latest version.
Comment #9
Dries CreditAttribution: Dries commentedLooks like a nice little clean-up. Committed to CVS HEAD. Thanks.