Running PHPunit tests on Travis at PHP7.3 at core 8.8 and 8.9 now produce:

PHPUnit\Framework\Exception: Fatal error: Class Drupal\user\Entity\User contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Drupal\Core\Session\AccountInterface::getUsername) in vendor/drupal/core/modules/user/src/Entity/User.php on line 67

The tests were running OK daily at the commit on 29 January, and they started failing when I pushed the the latest four commits (22 February 5:10 - 6:20 GMT) to my github repo for Travis build testing.

The tests run OK on drupal.org at PHP7.3 so there must be something else different which is causing this. The test runs OK at PHP5.6, 7.0, 7.1 and 7.2 they only start failing at 7.3.

Comments

jonathan1055 created an issue. See original summary.

jonathan1055’s picture

@TR I am not expecting you to look into this much, right now. Just reporting it here as a problem that has appeared. I may try to eliminate each of the four recent commits in turn and try to isolate what has caused it. Or of course it could be coincidence, and some other dependency has also been changed between yesterday and today.

Forgot to say in the issue summary, that every single test fails with this same error.

tr’s picture

That doesn't really sound like anything that could be caused by this module ...

jonathan1055’s picture

Well, yes I thought that at first. However, I have just created a new test branch checked out from the commit before the new four (i.e 29 January) and it runs OK at PHP7.3 for core 8.8 and 8.9, all tests pass.

So something in those four commits has caused a problem.

tr’s picture

The only thing that touches the User object in this module is BrowserTestBase::createUser(), which is used in the TypedDataFormWidgets tests. But it was also used before the $defaultTheme patch went in ... Perhaps try the drupalCreateUser() alias of that function.

But really, if EVERY test fails (unit and functional?), that seems to be a problem with the testing environment. Likewise, the "contains 1 abstract method" error for the core User entity is not something that should differ between PHP versions - that's a pretty fundamental error, and I don't see how we could even intentionally cause it.

tr’s picture

Status: Active » Postponed (maintainer needs more info)

Are you still having this problem?

jonathan1055’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)

Just checked and the problem has gone. There was one more failure the next day, then it was green. There have been individual days when the tests fail, the last was 11th April but they've been running green continuously since then.

Sorry for not noticing and closing this myself.

jonathan1055’s picture

Title: Fatal error: Class Drupal\user\Entity\User contains 1 abstract ... » Fatal error: Class Drupal\user\Entity\User contains 1 abstract method ...
Issue summary: View changes
Status: Closed (outdated) » Active

Sorry for re-opening this, but I wanted to correct my statement in #7. The problem did not go away at all. I only added PHP7.3 on a test branch, which failed, but when I re-checked after your prompting in #6 and I said the problem had gone away I was looking at the main 8.x-1.x branch which does not use PHP7.3 yet.

I have re-tested at PHP7.3 and it fails consistently at core 8.8 and 8.9 with 61 errors of the type as initially reported. I may investigate, or I may just drop the PHP7.3 runs for 8.8 and 8.9.

PHP7.3 with Core 9.0 does not have this problem and the tests run OK.

tr’s picture

Status: Active » Postponed (maintainer needs more info)

Well as I said, I really don't think this has anything to do with the Typed Data module. I can't reproduce this, and it works on DrupalCI with PHP 7.3 in both 8.8 and 8.9.

jonathan1055’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new1.8 KB

Yes it is odd. I am going to investigate, but that can be done in my own time to satisfy my curiosity. The best solution here, to get this working on Travis and not have every job fail (which could mask a potential other fault that I'd not be alerted to) is simply not run Core 8.9 at PHP7.3, only 7.1. So here's a patch to .travis.yml which simplifies the job matrix. I have also dropped testing at core 8.7

jonathan1055’s picture

Status: Needs review » Reviewed & tested by the community

This is only a change to .travis.yml and will not affect testing on drupal.org. Setting to RTBC

  • TR committed c42ffb7 on 8.x-1.x authored by jonathan1055
    Issue #3115309 by jonathan1055: Fatal error: Class Drupal\user\Entity\...
tr’s picture

Status: Reviewed & tested by the community » Fixed

Committed.

jonathan1055’s picture

Just pushed this to my GitHub/Travis and the builds pass, all green. Thanks.
We still have

# Allow this many deprecation warnings.
- SYMFONY_DEPRECATIONS_HELPER=1

due to #3161000: Deprecated Symfony constraint 'min' option and when that is committed it will be zero again.

Status: Fixed » Closed (fixed)

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