src/Concerns/MakesUrlAssertions.php
public function assertUrlIs($url)
    {
        $pattern = str_replace('\*', '.*', preg_quote($url, '/'));

        $segments = parse_url($this->driver->getCurrentURL());

        $currentUrl = sprintf(
            '%s://%s%s%s',
            $segments['scheme'],
            $segments['host'],
            Arr::get($segments, 'port', '') ? ':'.$segments['port'] : '',
            Arr::get($segments, 'path', '')
        );

        PHPUnit::assertRegExp(
            '/^'.$pattern.'$/u', $currentUrl,
            "Actual URL [{$this->driver->getCurrentURL()}] does not equal expected URL [{$url}]."
        );

        return $this;
    }
public function assertUrlIs($url)
    {
        $pattern = str_replace('\*', '.*', preg_quote($url, '/'));

        $segments = parse_url($this->driver->getCurrentURL());

        $currentUrl = sprintf(
            '%s://%s%s%s',
            $segments['scheme'],
            $segments['host'],
            Arr::get($segments, 'port', '') ? ':'.$segments['port'] : '',
            Arr::get($segments, 'path', '')
        );

        PHPUnit::assertRegExp(
            '/^'.$pattern.'$/u', $currentUrl,
            "Actual URL [{$this->driver->getCurrentURL()}] does not equal expected URL [{$url}]."
        );

        return $this;
    }
public function assertUrlIs ( $ url ) { $ pattern = str_replace ( '\*' , '.*' , preg_quote ( $ url , '/' ) ) ; $ segments = parse_url ( $ this -> driver -> getCurrentURL ( ) ) ; $ currentUrl = sprintf ( '%s://%s%s%s' , $ segments [ 'scheme' ] , $ segments [ 'host' ] , Arr :: get ( $ segments , 'port' , '' ) ? ':' . $ segments [ 'port' ] : '' , Arr :: get ( $ segments , 'path' , '' ) ) ; PHPUnit :: assertRegExp ( '/^' . $ pattern . '$/u' , $ currentUrl , "Actual URL [{$this->driver->getCurrentURL()}] does not equal expected URL [{$url}]." ) ; return $ this ; }
Assert that the current URL matches the given URL.

@param  string  $url
@return $this
Assert that the current URL matches the given URL .