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]

CommentFileSizeAuthor
#11 2970017_11.patch1.04 KBmile23
#7 2970017-7.patch2.77 KBmartin107
#2 2970017.patch2.71 KBszloredan

Comments

szloredan created an issue. See original summary.

szloredan’s picture

Assigned: szloredan » Unassigned
Status: Active » Needs review
StatusFileSize
new2.71 KB

Status: Needs review » Needs work

The last submitted patch, 2: 2970017.patch, failed testing. View results

quietone’s picture

Component: migration system » system.module

This isn't in the migration system. Moving to system.module based on #2887099: Menu: convert system functional tests to PHPUnit

martin107’s picture

Looking 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

martin107’s picture

Status: Needs work » Needs review
martin107’s picture

StatusFileSize
new2.77 KB

reroll.

Status: Needs review » Needs work

The last submitted patch, 7: 2970017-7.patch, failed testing. View results

mile23’s picture

The 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 TestDiscovery always triggers them.

We have some options for how to solve this:

1) Don't @trigger_error() for deprecated traits.

2) Have TestDiscovery only scan files ending in *Test.php: #2296635: Evaluate performance impact of limiting test discovery to *Test.php filename suffix

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

mile23’s picture

Status: Needs work » Needs review
Issue tags: +Needs followup
StatusFileSize
new1.04 KB

We now have #2949363: Impossible to make trigger_error in some files without test fails so this may pass.

NodeTypeTest was 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.

TermTranslationTest gets the full BTB conversion treatment in #2887134: Convert web tests to browser tests for taxonomy module Part -2

The error message has already been removed from DeprecationListenerTrait because of the false-positives we're fixing here.

Status: Needs review » Needs work

The last submitted patch, 11: 2970017_11.patch, failed testing. View results

mile23’s picture

Status: Needs work » Postponed
Issue tags: -Needs followup

OK, 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.

mile23’s picture

Status: Postponed » Closed (outdated)

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