public function click($name)
    {
        $page = $this->currentPage();

        try {
            $link = $this->findByBody($name)->click();
        } catch (InvalidArgumentException $e) {
            $link = $this->findByNameOrId($name)->click();
        }

        $this->updateCurrentUrl();

        $this->assertPageLoaded(
            $page,
            "Successfully clicked on a link with a body, name, or class of '{$name}', " .
            "but its destination, {$page}, did not produce a 200 status code."
        );

        return $this;
    }
public function click($name)
    {
        $page = $this->currentPage();

        try {
            $link = $this->findByBody($name)->click();
        } catch (InvalidArgumentException $e) {
            $link = $this->findByNameOrId($name)->click();
        }

        $this->updateCurrentUrl();

        $this->assertPageLoaded(
            $page,
            "Successfully clicked on a link with a body, name, or class of '{$name}', " .
            "but its destination, {$page}, did not produce a 200 status code."
        );

        return $this;
    }
public function click ( $ name ) { $ page = $ this -> currentPage ( ) ; try { $ link = $ this -> findByBody ( $ name ) -> click ( ) ; } catch ( InvalidArgumentException $ e ) { $ link = $ this -> findByNameOrId ( $ name ) -> click ( ) ; } $ this -> updateCurrentUrl ( ) ; $ this -> assertPageLoaded ( $ page , "Successfully clicked on a link with a body, name, or class of '{$name}', " . "but its destination, {$page}, did not produce a 200 status code." ) ; return $ this ; }
Click a link with the given body.

@param  string $name
@return static
Click a link with the given body .