Problem/Motivation
Drupal\system\Tests\Menu\AssertBreadcrumbTrait is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0.
Proposed resolution
Instead, use \Drupal\Tests\system\Functional\Menu\AssertBreadcrumbTrait.
Remaining tasks
User interface changes
API changes
Data model changes
Original report by [username]
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | 2970017_11.patch | 1.04 KB | mile23 |
| #7 | 2970017-7.patch | 2.77 KB | martin107 |
Comments
Comment #2
szloredan commentedComment #4
quietone commentedThis isn't in the migration system. Moving to system.module based on #2887099: Menu: convert system functional tests to PHPUnit
Comment #5
martin107 commentedLooking at this I think the errors may have been fixed as core commits have advanced
The error have in common MenuTestBase ... I am triggering another testbot run
Comment #6
martin107 commentedComment #7
martin107 commentedreroll.
Comment #9
mile23The fails in #7 occur because simpletest performs discovery during these tests. It reflects on the trait files to discover whether they're tests or not, and in the process triggers the deprecation error. #2949363: Impossible to make trigger_error in some files without test fails
So the deprecation error is unrelated to the tests, other than the fact that
TestDiscoveryalways triggers them.We have some options for how to solve this:
1) Don't
@trigger_error()for deprecated traits.2) Have
TestDiscoveryonly scan files ending in*Test.php: #2296635: Evaluate performance impact of limiting test discovery to *Test.php filename suffixComment #11
mile23We now have #2949363: Impossible to make trigger_error in some files without test fails so this may pass.
NodeTypeTestwas deemed 'out of scope' in #2870453: Convert web tests to browser tests for node module because it used this trait. So it's an orphan and and the BTB conversion is out of scope here. Adding needs followup tag.TermTranslationTestgets the full BTB conversion treatment in #2887134: Convert web tests to browser tests for taxonomy module Part -2The error message has already been removed from
DeprecationListenerTraitbecause of the false-positives we're fixing here.Comment #13
mile23OK, the real problem here is that this trait is used by simpletest tests and has been moved to the PHPUnit namespaces. PHPUnit namespaces are (rightly) not autoloaded during simpletest execution.
We *could* make a layer which supports loading PHPUnit traits in simpletest tests.
Or, we could close/postpone this issue because #2887134: Convert web tests to browser tests for taxonomy module Part -2 and #2996030: Convert web tests to browser tests for node module - round 2 will fix the problem anyway.
I vote for the latter.
Postponing here rather than closing because the conversions might work out differently that we think.
Comment #14
mile23#2887134: Convert web tests to browser tests for taxonomy module Part -2 and #2996030: Convert web tests to browser tests for node module - round 2 fixed our usages of the deprecated trait.
Also verifying that
Drupal\Tests\Listeners\DeprecationListenerTrait::getSkippedDeprecations()does not skip the deprecation error message: https://cgit.drupalcode.org/drupal/tree/core/tests/Drupal/Tests/Listener...