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') {
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

juampynr’s picture

Status: Active » Needs review
FileSize
715 bytes

Here 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.

dawehner’s picture

Component: simpletest.module » documentation
Status: Needs review » Reviewed & tested by the community
Issue tags: +Quick fix

Good catch.

jhodgdon’s picture

Not 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.

xjm’s picture

alexpott’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
643 bytes

The 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.

alexpott’s picture

Hmmm.... actually the patch in #4 was correct but because assertLink and assertNoLink have 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.

Status: Needs review » Needs work

The last submitted patch, 5: 2267159.5.patch, failed testing.

alexpott’s picture

Status: Needs work » Needs review

5: 2267159.5.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, 5: 2267159.5.patch, failed testing.

juampynr’s picture

Status: Needs work » Needs review

5: 2267159.5.patch queued for re-testing.

juampynr’s picture

Re-testing again. Patch at #5 applies cleanly.

  • Commit f27f0ab on 8.x by jhodgdon:
    Issue #2267159 by juampy, xjm, alexpott: Remove nonexistent parameter...

  • Commit 40ddf51 on 7.x by jhodgdon:
    Issue #2267159 by juampy, xjm, alexpott: Remove nonexistent parameter...
jhodgdon’s picture

Status: Needs review » Fixed

The 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).

juampynr’s picture

Looks Great. Thanks @jhodgdon!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.