Checks that current url matches route

``` php
<?php
$I->seeCurrentRouteIs('posts.index');
?>
```
@param $routeName
979977
public function seeCurrentRouteIs($routeName)
    {
        $this->getRouteByName($routeName); // Fails if route does not exists

        $currentRoute = $this->app->request->route();
        $currentRouteName = $currentRoute ? $currentRoute->getName() : '';

        if ($currentRouteName != $routeName) {
            $message = empty($currentRouteName)
                ? "Current route has no name"
                : "Current route is \"$currentRouteName\"";
            $this->fail($message);
        }
    }
614454
public function redirectToRoute($routeName, array $parameters = [])
    {
        $url = $this->router->getRouteUrlByName($routeName, $parameters);
        if (!$url) {
            throw new \Parable\Framework\Exception("Can't redirect to route, '{$routeName}' does not exist.");
        }
        $this->response->redirect($this->url->getUrl($url));
    }
1137371
public function seeCurrentRouteIs($routeName, array $params = [])
    {
        $router = $this->client->grabServiceFromContainer('router');
        $url = $router->assemble($params, ['name' => $routeName]);
        $this->seeCurrentUrlEquals($url);
    }
64920
private function checkMethod() {
        if (strpos(self::$currentRoute['method'], '|') !== false) {
            if (!in_array($_SERVER['REQUEST_METHOD'], explode('|', self::$currentRoute['method']))) {
                throw new RouteException(_message(ExceptionMessages::INCORRECT_METHOD, $_SERVER['REQUEST_METHOD']));
            }
        } else if ($_SERVER['REQUEST_METHOD'] != self::$currentRoute['method']) {
            throw new RouteException(_message(ExceptionMessages::INCORRECT_METHOD, $_SERVER['REQUEST_METHOD']));
        }
    }
1352965
public function is_current_url( $url )
	{
		$current_url = $this->getSession()->getCurrentUrl();

		if ( $url === substr( $current_url, 0 - strlen( $url ) ) ) {
			return true;
		} else {
			return false;
		}
	}
1336278
private function matchesRequest($route)
    {
        $requestURL = $this->requestURL;
        if (isset($route['fullDomainMatch']) && $route['fullDomainMatch'] == true) {
            $requestURL = $this->fullRequestURL;
        }
        if (isset($route['method']) && $route['method'] != $this->requestMethod) {
            return false;
        }
        return preg_match($route['match'], $requestURL, $this->matches);
    }
1211155
protected function isRouteNameExists($name)
    {
        $existingRoutes = Route::getRoutes();

        foreach ($existingRoutes as $existingRoute) {
            if ($existingRoute->getName() == $name) {
                return true;
            }
        }

        return false;
    }
171208
protected function doRouteMatching($url)
    {
        $matches = array();
        foreach ($this->route_definitions as $name => $route) {
            if (preg_match($route['regex'], $url, $matches)) {
                $matches[0] = $name;
                return $matches;
            }
        }
        return false;
    }
513162
public function url($name, $params = array()) {
		if (!isset($this->namedRoutes[$name])) {
			throw new RouterException("No route matches this name : $name");
		}

		return $this->namedRoutes[$name]->getUrl($params);
	}
729144
public function findChildByRouteName($routeName)
    {
        if ($this->hasChildren()) {
            if (array_key_exists($routeName, $this->children)) {
                return $this->children[$routeName];
            }
            /** @var RouteDefinition $definition */
            foreach ($this->children as $definition) {
                if (null !== $child = $definition->findChildByRouteName($routeName)) {
                    return $child;
                }
            }
        }
        return null;
    }
1023258
protected function isValidRoute()
    {
        try {

            $current = Route::current();
            if (!$current) {
                return false;
            }
            $action = $current->action;
            $as     = array_get($action, 'as');
            return str_contains($as, 'show') or str_contains($as, 'dashboard');
        } catch (Exception $ex) {
            return false;
        }
    }
31385
private function isPrefixedRoute($route, $routePrefix)
    {
        $regexp = '~^'. preg_quote($routePrefix) .'~';
        
        return preg_match($regexp, $this->getRouteParam($route, 'uri'));
    }
1201606
public function check($url)
    {
        try {
            $request = new ServerRequest(['url' => $url]);
            $route = Router::parseRequest($request);
            $name = null;
            foreach (Router::routes() as $r) {
                if ($r->match($route)) {
                    $name = isset($r->options['_name']) ? $r->options['_name'] : $r->getName();
                    break;
                }
            }

            unset($route['_matchedRoute']);
            ksort($route);

            $output = [
                ['Route name', 'URI template', 'Defaults'],
                [$name, $url, json_encode($route)]
            ];
            $this->helper('table')->output($output);
            $this->out();
        } catch (MissingRouteException $e) {
            $this->warn("'$url' did not match any routes.");
            $this->out();

            return false;
        }

        return true;
    }
1108988
public function checkRoute($routeNames)
    {
        if (!$this->route) {
            return false;
        }

        $routeName = $this->route->getName();

        if (in_array($routeName, (array)$routeNames)) {
            return true;
        }

        return false;
    }
1131085
protected function currentAction()
    {
        $action = substr($action = Route::currentRouteAction(), strpos($action, '@') + 1);

        if (!method_exists($this, $action)) {
            $action = 'index';
        }

        return $action;
    }
981880
public function match($path, RouteRequest $request = null)
    {
        $requestMethod = null;

        if ($request) {

            $requestMethod = self::convertRequestMethodConstant($request->getRequestMethod());

        } else if (isset($_SERVER['REQUEST_METHOD'])) {

            $requestMethod = self::convertRequestMethodConstant($_SERVER['REQUEST_METHOD']);

        }

        foreach ($this->routes as $route) {
            // If the route is using pcre pattern marching...
            if ($route[0]) {
                if (!preg_match($route[1], $path, $matches)) {
                    continue;
                }
                $route[3]['vars'] = $matches;

                // validate request method
                if (isset($route[3]['method']) && $route[3]['method'] != $requestMethod) {
                    continue;
                }
                if (isset($route[3]['domain']) && $route[3]['domain'] != $_SERVER['HTTP_HOST']) {
                    continue;
                }
                if (isset($route[3]['secure']) && $route[3]['secure'] && $_SERVER['HTTPS']) {
                    continue;
                }

                return $route;
            } else {
                // prefix match is used when expanding is not enabled.
                if ((
                        (is_int($route[2]) || $route[2] instanceof self || $route[2] instanceof \PHPSGI\App)
                        && strncmp($route[1], $path, strlen($route[1])) === 0
                    ) || $route[1] == $path) {
                    // validate request method
                    if (isset($route[3]['method']) && $route[3]['method'] != $requestMethod) {
                        continue;
                    }
                    if (isset($route[3]['domain']) && $route[3]['domain'] != $_SERVER['HTTP_HOST']) {
                        continue;
                    }
                    if (isset($route[3]['secure']) && $route[3]['secure'] && $_SERVER['HTTPS']) {
                        continue;
                    }

                    return $route;
                }
                continue;
            }
        }
    }
600124
private function findRouteDefinitionByRouteName($routeName)
    {
        if ($routeName === $this->homeRouteName) {
            return $this->homeDefinition;
        }

        return $this->homeDefinition->findChildByRouteName($routeName);
    }