src/DrupalExtension/Context/ContentContext.php
protected function getContentEditLink($link, $title) {
    $node = $this->getCore()->loadNodeByName($title);

    /** @var \Behat\Mink\Element\DocumentElement $element */
    $element = $this->getSession()->getPage();

    $locator = ($link ? array('link', sprintf("'%s'", $link)) : array('link', "."));

    /** @var \Behat\Mink\Element\NodeElement[] $links */
    $links = $element->findAll('named', $locator);

    // Loop over all the links on the page and check for the node edit path.
    foreach ($links as $result) {
      $target = $result->getAttribute('href');
      if (strpos($target, 'node/' . $this->getCore()->getNodeId($node) . '/edit') !== FALSE) {
        return $result;
      }
    }
    return NULL;
  }
protected function getContentEditLink($link, $title) {
    $node = $this->getCore()->loadNodeByName($title);

    /** @var \Behat\Mink\Element\DocumentElement $element */
    $element = $this->getSession()->getPage();

    $locator = ($link ? array('link', sprintf("'%s'", $link)) : array('link', "."));

    /** @var \Behat\Mink\Element\NodeElement[] $links */
    $links = $element->findAll('named', $locator);

    // Loop over all the links on the page and check for the node edit path.
    foreach ($links as $result) {
      $target = $result->getAttribute('href');
      if (strpos($target, 'node/' . $this->getCore()->getNodeId($node) . '/edit') !== FALSE) {
        return $result;
      }
    }
    return NULL;
  }
protected function getContentEditLink ( $ link , $ title ) { $ node = $ this -> getCore ( ) -> loadNodeByName ( $ title ) ; /** @var \Behat\Mink\Element\DocumentElement $element */ $ element = $ this -> getSession ( ) -> getPage ( ) ; $ locator = ( $ link ? array ( 'link' , sprintf ( "'%s'" , $ link ) ) : array ( 'link' , "." ) ) ; /** @var \Behat\Mink\Element\NodeElement[] $links */ $ links = $ element -> findAll ( 'named' , $ locator ) ; // Loop over all the links on the page and check for the node edit path. foreach ( $ links as $ result ) { $ target = $ result -> getAttribute ( 'href' ) ; if ( strpos ( $ target , 'node/' . $ this -> getCore ( ) -> getNodeId ( $ node ) . '/edit' ) !== FALSE ) { return $ result ; } } return NULL ; }
Get the edit link for a node.

@param string $link
The link name.
@param string $title
The node title.

@return \Behat\Mink\Element\NodeElement|null
The link if found.

@throws \Exception
Get the edit link for a node .