diff --git a/src/Symfony/Component/BrowserKit/Client.php b/src/Symfony/Component/BrowserKit/Client.php index 08324eecb3..e1630a332d 100644 --- a/src/Symfony/Component/BrowserKit/Client.php +++ b/src/Symfony/Component/BrowserKit/Client.php @@ -291,17 +291,13 @@ abstract class Client } /** - * Finds link by given text and then clicks on it. + * Clicks the first link (or clickable image) that contains the given text. * - * @param string $value The link text - * - * @return Crawler + * @param string $linkText The text of the link or the alt attribute of the clickable image */ - public function clickLink($value) + public function clickLink(string $linkText): Crawler { - $link = $this->getCrawler()->selectLink($value)->link(); - - return $this->click($link); + return $this->click($this->getCrawler()->selectLink($linkText)->link()); } /** @@ -322,20 +318,20 @@ abstract class Client } /** - * Finds a form by submit button text and then submits it. + * Finds the first form that contains a button with the given content and + * uses it to submit the given form field values. * - * @param string $button The button text - * @param array $values An array of form field values - * @param string $method The method for the form - * - * @return Crawler + * @param string $button The text content, id, value or name of the form