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

Breadcrumb

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

function WebAssert::cleanUrl

Trims scriptname from the URL.

Parameters

string $url:

Return value

string

3 calls to WebAssert::cleanUrl()
WebAssert::addressEquals in vendor/behat/mink/src/WebAssert.php
Checks that current session address is equals to provided one.
WebAssert::addressNotEquals in vendor/behat/mink/src/WebAssert.php
Checks that current session address is not equals to provided one.
WebAssert::getCurrentUrlPath in vendor/behat/mink/src/WebAssert.php
Gets current url of the page.

File

vendor/behat/mink/src/WebAssert.php, line 863

Class

WebAssert
Mink web assertions tool.

Namespace

Behat\Mink

Code

protected function cleanUrl(string $url) {
    $parts = parse_url($url);
    $fragment = empty($parts['fragment']) ? '' : '#' . $parts['fragment'];
    $path = empty($parts['path']) ? '/' : $parts['path'];
    return preg_replace('/^\\/[^\\.\\/]+\\.php\\//', '/', $path) . $fragment;
}

API Navigation

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