Closed (fixed)
Project:
Drupal core
Version:
8.4.x-dev
Component:
phpunit
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
7 Aug 2017 at 06:23 UTC
Updated:
12 Sep 2023 at 09:12 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
manuel garcia commentedSo... something like this?
Comment #3
lendude@Manuel Garcia yeah that looks good, one nit:
'The HTML of the rendered page.' needs to be on the next line.
Comment #4
meenakshig commented@Lendude this patch contains 'The HTML of the rendered page.' on the next line . is it correct ?
Comment #5
meenakshig commentedComment #6
Anonymous (not verified) commented#5: Almost, but seems, that #3 should be interpreted literally. Few examples from other places:
It may also be useful to formally fix this change via test.
Comment #7
lendude#6++
Yes, added test coverage is great.
Comment #8
Anonymous (not verified) commented@Lendude, thank you!
We can also slightly improve the test, if check which line is returned.
Now we need to unite #2, #3 and current test (if @Lendude agrees that this variant is preferable).
@Meenakshi Gupta, do you still have the desire to help?
Comment #10
lendude@vaplas Yeah #8 looks good as a test, it's what we expect right? Not just any string but that specific string.
Comment #11
Anonymous (not verified) commentedYes. You read my mind like an open book.
Comment #12
shashikant_chauhan commentedCombined patch from #2, #3, #8.
Comment #13
shashikant_chauhan commentedupdating status.
Comment #14
dawehnerShould we document here that the recommended way is to use $this->getSession()->getPage()->getContent() or actually the assertions we provide via the
webAssert?Comment #15
Anonymous (not verified) commented#12: thank you, @shashikant_chauhan! All novice tasks are addressed, so remove the Novice tag.
#14: if I correctly understood the question, then the main reason is not in the recommendation to use the return value, but only in compatibility (especially for outside test, because to change the core tests - not a big deel). I tried to add a comment about it.
Also I adjusted the description a little, so that there would be no association with the html-format of the pages + tests:
Comment #16
dawehnerWhat do you think about moving the hint to webAssert into the function documentation itself? This would help a bit in terms of discovery, as people will most likely read the function documentation instead of the actual code of the function.
This
@seefeels a little bit weird ... I would have probably skipped that :)Comment #17
Anonymous (not verified) commented#16 I thought about this while I waited for the review. And I am absolutely glad about these proposals!
Comment #18
dawehnerThank you!
Comment #19
catchAre we going to want to deprecate the return for 9.0.x or just leave it like this?
Comment #20
Anonymous (not verified) commentedThe
'(deprecated)'mark definitely should help the wavering user, and will allow to eliminate the confusing variety in the future.Comment #21
lendudeHmm interesting deprecation case. Hadn't seen the return type deprecation before.
Per deprecation policy for this, we need a CR and a link to that CR for this.
Comment #22
manuel garcia commentedThanks all for the work on this!
I've added a draft CR, please review =) https://www.drupal.org/node/2907815
Comment #23
dawehnerThank you @Manuel Garcia to create the change record. I fixed a tiny bit of it, but it looks good for me.
Comment #26
catchYes return deprecation is hard.
Committed/pushed to 8.5.x and cherry-picked to 8.4.x. Thanks!
Comment #28
Anonymous (not verified) commentedShouldn't t('Submit') replaced with $this->t('Submit'); ??
Comment #29
lendude@JohnOku that's not needed inside a test.
Comment #30
quietone commentedpublish the change record