Closed (fixed)
Project:
Drupal core
Version:
9.1.x-dev
Component:
phpunit
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
23 May 2020 at 12:58 UTC
Updated:
24 Aug 2020 at 10:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
jungleAdding the "Deprecated assertions" tag to add this into the kanban board https://contribkanban.com/board/Deprecatedassertions
Comment #3
mondrakeSome of the current calls to assert(No)Escaped in functional tests still have a message passed in, even if AssertLegacyTrait::assert(No)Escaped() do not take that in. We need to remove the messages from the calls and inline them as comments where appropriate before doing the conversion.
Comment #4
mondrake#3142752: AssertLegacyTrait::assert(No)Escaped() in functional tests still have a message passed in got committed, unpostponing.
Comment #5
mondrakeOn this.
Comment #6
mondrakeRemoved usages, removed depraction silencers, added a deprecation test.
Comment #8
mondrakeOn it
Comment #9
mondrakeComment #10
hardik_patel_12 commentedPatch failed to apply , kindly review a new patch.
Comment #11
jungleThanks @Hardik_Patel_12!
It‘s worthy to do micro-optimizations for changes which similar to the above. See the code blew from
\Drupal\FunctionalTests\AssertLegacyTrait::assertSession().we should avoid calling $this->assertSession() multiple times in a test. Each call returns a new instance, it's not good. Instead, saving it as a local variable, for example,
$assert_session = $this->assertSession();and using$assert_sessionfor next one(s).Comment #12
nitesh624Comment #13
jungleSetting back to NR, it's not worthy to do such micro-optimizations or undecided. See discussions in the parent issue for more.
Comment #14
mohrerao commentedRerolled as patch failed to apply
Comment #15
nitesh624Unassigning as I see others progressing on this.
Comment #16
mondrakeRerolled, no more calls present in test code
Comment #17
dwwAs with #3139408-14: Replace usages of AssertLegacyTrait::assert(No)Field, that is deprecated, what's up with:
core/tests/Drupal/KernelTests/AssertContentTrait.php defining non-deprecated versions of
assert(No)?Escaped()?That seems highly problematic. Not sure where that's being addressed, but I don't think this is RTBC without reckoning with that.
Sorry,
-Derek
Comment #18
mondrake#17 see #3027952-50: [Plan] Remove the usage of deprecated methods in tests.
Comment #19
dwwThanks for clarifying! +1 to RTBC then. I read through the patch and it's just the fix to remove the deprecation from the skip list, the new @legacy deprecation test, and the results of a script. ;)
Thanks,
-Derek
Comment #20
catchCommitted 7628e38 and pushed to 9.1.x. Thanks!