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.
Problem/Motivation
When the Flag tests are run from the CLI, the following errors occur before tests are run:
Fatal error: Call to a member function id() on null in /var/www/modules/flag/src/Tests/FlagTestBase.php on line 206
FATAL Drupal\flag\Tests\AdminUITest: test runner returned a non-zero error code (255).
Drupal\flag\Tests\AdminUITest 0 passes 1 fails
- Found database prefix 'simpletest950557' for test ID 1.
[05-Dec-2015 04:06:34 UTC] PHP Fatal error: Call to a member function id() on null in /var/www/modules/flag/src/Tests/FlagTestBase.php on line 206
Proposed resolution
Track down where the null entry is being passed to FlagTestBase::grantFlagPermissions() and correct it.
Remaining tasks
Create patch.
User interface changes
None.
API changes
None.
Data model changes
None.
Comments
Comment #2
joachim CreditAttribution: joachim commentedVery odd! The test-runner on d.org surely uses the CLI, just to make things even more mysterious...
Comment #3
socketwench CreditAttribution: socketwench as a volunteer commentedIt could just be something with my Dropwhale project. I might not have the PHP CLI configured correctly, and I can't use the same PHP instance without --x-networking Docker. The tests are also failing on the CLI for mysterious reasons.
Comment #4
BerdirMy guess is that your --url argument was incorrect or for some reason didn't work. If it would have failed to create the flag in the UI then I'd expect that error. I'm using the CLI all the time and it works fine.
If you still see this, use --browser and --verbose to get the results with verbose output, then you might be able to see the fault requests that happen before.