Problem/Motivation
#2921860: \Drupal\simpletest\NodeCreationTrait @deprecated references new class in the incorrect namespace fixes an erroneous deprecation message introduced in #2803621: Break BrowserTestBase & children dependency on Simpletest, deprecate stub BC traits
Unfortunately other similar errors remain.
Many of those traits' deprecation messages are incorrect: http://cgit.drupalcode.org/drupal/commit/?h=8.4.x&id=71e5829354208d40c08...
UserCreationTrait, NodeCreationTrait, ContentTypeCreationTrait, BlockCreationTrait are all wrong, in 8.4.x and the unfixed ones in 8.5.x.
Proposed resolution
The traits' deprecation messages should all refer to the traits in their use block, instead of non-existent ones.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 2922371_3_85x.patch | 581 bytes | mile23 |
| #3 | 2922371_3_84x.patch | 2.27 KB | mile23 |
Comments
Comment #2
mile23Comment #3
mile23For 8.5.x, we have #2921860: \Drupal\simpletest\NodeCreationTrait @deprecated references new class in the incorrect namespace and #2921931: \Drupal\simpletest\UserCreationTrait @deprecated references new class in the incorrect namespace and #2921942: \Drupal\simpletest\ContentTypeCreationTrait @deprecated references new class in the incorrect namespace which leaves us with
BlockCreationTraitincorrectly deprecated.For 8.4.x, those issues weren't backported, so we have them fixed here.
Comment #4
dawehner@Mile23 Do you think its worth fixing this in 8.4.x?
Comment #5
mile23Yes: #2924387: NodeCreationTrait and UserCreationTrait are deprecated as of 8.4
Note yak shaving. :-)
Comment #6
dawehnerWorks for me
Comment #7
xjmError, circular dependency:
But:
Now both files are referring to themselves?
Comment #8
dawehnerI'm a bit confused, doesn't
\Drupal\simpletest\BlockCreationTraitrefers to\Drupal\Tests\block\Traits\BlockCreationTraitand
\Drupal\simpletest\AssertHelperTraitto\Drupal\Tests\AssertHelperTrait?Comment #9
dawehnerComment #10
mile23All of these traits in the
simpletest\namespace are deprecated.They either deprecate to traits that are in the
Tests\namespace, or in the module that is responsible for their behavior, such asnodeforContentTypeCreationTrait.Each deprecated trait
uses the non-deprecated one, and the trait suggestion in the deprecation message should match the one beingused.That one was just a victim of copypasta... It was not only the wrong namespace but the wrong trait name.
Comment #11
dawehnerI think this is RTBC again.
Comment #13
xjmOkay, I see what happened now; thanks for explaining.
Adding credit for @caseylau who worked on #2922104: core/modules/simpletest/src/BlockCreationTrait.php has wrong comment "Drupal\Tests\AssertHelperTrait instead", which was a duplicate of the 8.5.x scope.
Comment #16
xjmCommitted the 8.5.x version to 8.5.x and the 8.4.x version to 8.4.x (not sure why such simple documentation fixes were not backported, but it's resolved now at least). Thanks!