Must have been a copy & paste issue. The parameter $index at assertNoLink() is not part of the method's signature:
/**
* Passes if a link with the specified label is not found.
*
* @param $label
* Text between the anchor tags.
* @param $index
* Link position counting from zero.
* @param $message
* (optional) A message to display with the assertion. Do not translate
* messages: use format_string() to embed variables in the message text, not
* t(). If left blank, a default message will be displayed.
* @param $group
* (optional) The group this message is in, which is displayed in a column
* in test output. Use 'Debug' to indicate this is debugging output. Do not
* translate this string. Defaults to 'Other'; most tests do not override
* this default.
*
* @return
* TRUE if the assertion succeeded, FALSE otherwise.
*/
protected function assertNoLink($label, $message = '', $group = 'Other') {
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 2267159.5.patch | 643 bytes | alexpott |
| #4 | 2267159-psr4-reroll.patch | 643 bytes | xjm |
| #1 | drupal-fix-docblock-assert-no-link-2267159-1.patch | 715 bytes | juampynr |
Comments
Comment #1
juampynr commentedHere is the patch. I stumbled upon this because I actually tried to use this argument in order to test that a link with the given index did not exist.
Comment #2
dawehnerGood catch.
Comment #3
jhodgdonNot exactly a conflict... but a "no commit conflicts" issue #2016629: Refactor bootstrap to better utilize the kernel touches this same file, so I'm going to wait on committing this.
Comment #4
xjmReroll for #2247991: [May 27] Move all module code from …/lib/Drupal/… to …/src/… for PSR-4.
Comment #5
alexpottThe rerolled patch in #4 changed the doc block for
assertLink($label, $index = 0, $message = '', $group = 'Other')which has the $index param.The wrong doc block is for
assertNoLink- patch attached.Comment #6
alexpottHmmm.... actually the patch in #4 was correct but because
assertLinkandassertNoLinkhave exactly the same docblocks and there had been changes to WebTestBase in the interim git applies the patch to the wrong piece of code. Interesting.Comment #8
alexpott5: 2267159.5.patch queued for re-testing.
Comment #10
juampynr commented5: 2267159.5.patch queued for re-testing.
Comment #11
juampynr commentedRe-testing again. Patch at #5 applies cleanly.
Comment #14
jhodgdonThe patch was once again problematic (removing the parameter in the wrong documentation header).
So I decided this was easier and less error prone to do manually. I just edited the file, took out the two lines in the correct docs (for assertNoLink), and committed it. Hope that's OK.
I also "ported" this "patch" to 7.x (did the same manual fix there).
Comment #15
juampynr commentedLooks Great. Thanks @jhodgdon!