Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. BrowserKitDriver.php

function BrowserKitDriver::getCurrentUrl

Overrides CoreDriver::getCurrentUrl

3 calls to BrowserKitDriver::getCurrentUrl()
BrowserKitDriver::getCookie in vendor/behat/mink-browserkit-driver/src/BrowserKitDriver.php
Returns cookie by name.
BrowserKitDriver::getCookiePath in vendor/behat/mink-browserkit-driver/src/BrowserKitDriver.php
Returns current cookie path.
BrowserKitDriver::getFormField in vendor/behat/mink-browserkit-driver/src/BrowserKitDriver.php
Returns form field from XPath query.

File

vendor/behat/mink-browserkit-driver/src/BrowserKitDriver.php, line 129

Class

BrowserKitDriver
Symfony BrowserKit driver.

Namespace

Behat\Mink\Driver

Code

public function getCurrentUrl() {
    // This should be encapsulated in `getRequest` method if any other method needs the request
    try {
        $request = $this->client
            ->getInternalRequest();
    } catch (BadMethodCallException $e) {
        // Handling Symfony 5+ behaviour
        $request = null;
    }
    if ($request === null) {
        throw new DriverException('Unable to access the request before visiting a page');
    }
    return $request->getUri();
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal