Closed (fixed)
Project:
Drupal core
Version:
8.4.x-dev
Component:
filter.module
Priority:
Normal
Category:
Task
Assigned:
Issue tags:
Reporter:
Created:
23 Mar 2017 at 16:57 UTC
Updated:
18 Aug 2017 at 11:25 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
jofitzSorry @nlisgo, I only just noticed you had assigned this to yourself after doing the work.
Comment #4
nlisgo commented@jo-fitzgerald Happy to step away from this and move on to a different module.
Comment #5
zviryatko commentedAbout changes in
core/modules/filter/tests/src/Functional/FilterAdminTest.phpassertFieldByName()now deprecated and was changed, so third paramater was removed, also test assert was changed because we need to check that checkboxes, which was checked on add filter form, is checked on filter edit form.Also
$this->xpath()now returnNodeElement[]array, instead of\SimpleXMLElement[]|bool, so all function call also changed.Comment #6
zviryatko commentedComment #7
dawehnerHi @zviryatko, thank you for your contribution!
First tip: Try to use the following git configuration:
[diff]
renames = copies
This detects renames, see https://www.drupal.org/documentation/git/configure for more details. This will make the patch size significantly smaller.
Comment #8
zviryatko commentedSorry, forgot about this ((
Comment #9
zviryatko commentedComment #10
michielnugter commented@zviryatko Thanks for the patch! Great to see this moving forward!
Some review comments:
You can use assertNotEmpty here.
You can use assertEmpty() here.
(string) cast is not required anymore
(string) cast is not required anymore
Comment #11
michielnugter commentedComment #12
zviryatko commentedComment #13
zviryatko commentedComment #14
dawehnerI really like these changes.
+1 also for this change. IMHO we don't loose any level of test coverage here.
Comment #15
alexpottCommitted and pushed 26ad8f8 to 8.4.x and 589eede to 8.3.x. Thanks!
Committed to 8.3.x since this is tests only.
Comment #20
alexpottThis clashed with #2868019: AssertLegacyTrait field assertions not compatible with Simpletest assertions and resulted in HEAD fails.
Comment #21
michielnugter commentedSorry about that @alexpott, didn't catch that one at review.
Updated the patch to conform to the new AssertLegacyTrait, this should pass.
Comment #22
andypostLet's get it in
Comment #24
alexpottCommitted and pushed facaf22 to 8.4.x and d002aa9 to 8.3.x. Thanks!
Comment #27
alexpottI'm really sorry - additional problems with #2868019: AssertLegacyTrait field assertions not compatible with Simpletest assertions came to light so we had to revert it - which means we have to revert this too.
Re-uploading #12 as that worked before and will commit if it is green.
Comment #28
alexpottComment #29
michielnugter commentedDiscussed with @alexpott on IRC. We'll have to fix the checkbox assertion that currently is failing to a correct test using the non-deprecated methods of Mink.
This assertion is incorrect because it checks if the value is equal to a role ID. Reading the test what was attempted to assert was if the checkbox was checked or not, this assertion does not test this at all. At most it tests if the checkbox is rendered properly with a value matching the name.
Without using the deprecated methods you could assert the state of a checkbox like this:
or
Comment #30
naveenvalechaAs we have checkbox names available. So we could use
$this->assertSession()->checkboxChecked//Naveen
Comment #31
michielnugter commented@naveenvalecha thanks for the patch!
Looks good, setting to RTBC.
Comment #33
mile23Maybe related: #2363815: FilterHtmlImageSecureTest fails on MAMP, not on testbot.
Comment #34
naveenvalechaback to RTBC per #31
Comment #37
catchCommitted/pushed to 8.5.x and cherry-picked to 8.4.x. Thanks!
Comment #39
catch