Closed (fixed)
Project:
Drupal core
Version:
8.4.x-dev
Component:
phpunit
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
3 Mar 2017 at 20:07 UTC
Updated:
2 Apr 2017 at 06:56 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
jofitzSet the default value of the optional parameter
$valueto be''(rather thanNULL) as it was on WebTestBase.While investigating this issue I also found that most of the documentation for
assertNoFieldByName()is incorrect - it appears to have been copied fromassertFieldByName()and not completely updated - should this also be addressed in this issue or shall I create a separate issue?Comment #3
klausiLet's also make the docs for assertNoFieldByName() accurate in this issue.
shouldn't you also change the if() condition to check for the new default value?
Can you expand the test in BrowserTestBaseTest::testLegacyXPathAsserts() to cover this?
Comment #4
boaloysius commentedUpdate
NULLinside the if condition and modified the documentation.Comment #5
boaloysius commentedComment #6
klausishould be "doesn't"
Should be "(optional) Value of the field, to assert that the field's value on the page does not match it."
from the original method in Simpletest.
And we still need to expand the test cases as I said above.
Comment #7
jofitzassertNoFieldByName().assertNoFieldByName()(copied from simpletest AsserContentTrait version).assertNoFieldByName().I suspect there are also flaws in
assertNoFieldById()- should that be covered within this ticket too?Comment #10
klausiVery good, just a tiny thing:
ah, sorry, this test method is about legacy xpath asserts ...
We can just rename the test method to testLegacyFieldAsserts() since all methods tested have "field" in their name :)
I think we can cover flaws in assertNoFieldById() in another issue.
Comment #11
jofitzRenamed the method (and tweaked the documentation).
Now to remember what those flaws I was talking about are...
Comment #12
jofitzAdd another assertion failure test and a couple of comments.
Comment #13
klausiLooks good, thanks!
Comment #14
alexpottNeeds a reroll.
Comment #15
jofitzRe-rolled.
Comment #16
goz commentedLooks good
Comment #17
alexpottCommitted and pushed 4b8275d to 8.4.x and c91342a to 8.3.x. Thanks!
This brings us back into line with \Drupal\simpletest\AssertContentTrait::assertNoFieldByName() which is great for conversions.
Comment #21
boaloysius commented