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

socketwench created an issue. See original summary.

joachim’s picture

Very odd! The test-runner on d.org surely uses the CLI, just to make things even more mysterious...

socketwench’s picture

Very odd! The test-runner on d.org surely uses the CLI, just to make things even more mysterious...

It 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.

Berdir’s picture

Status: Active » Closed (cannot reproduce)

My 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.