methods that are imported from traits as aliases can't be searched for

Created on 9 September 2019, almost 6 years ago
Updated 4 June 2025, 28 days ago

I was searching on api.d.org for 'drupalCreateUser', which I can see used in lots of functional tests.

All I could find was BrowserTestBase::drupalCreateUser() in 8.0, but nothing in recent branches.

It turns out it's this:

abstract class BrowserTestBase extends TestCase {

SNIP

  use UserCreationTrait {
    createRole as drupalCreateRole;
    createUser as drupalCreateUser;
  }

So there is no method drupalCreateUser() defined anywhere in Drupal code, but lots of code calls this because a trait import aliases it.

It there anything that can be done to allow this to be searched for, or linked to?

(Sorry, I keep filing issues here that are really awkward cases!)

Feature request
Status

Active

Version

2.0

Component

Parser

Created by

🇬🇧United Kingdom joachim

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024