Checks that current url matches route.

``` php
<?php
$I->seeCurrentRouteIs('posts.index');
$I->seeCurrentRouteIs('posts.show', array('id' => 8));
?>
```

@param $routeName
@param array $params
545481
public function seeCurrentRouteIs($routeName, array $params = [])
    {
        $router = $this->grabService('router');
        if (!$router->getRouteCollection()->get($routeName)) {
            $this->fail(sprintf('Route with name "%s" does not exists.', $routeName));
        }

        $uri = explode('?', $this->grabFromCurrentUrl())[0];
        try {
            $match = $router->match($uri);
        } catch (\Symfony\Component\Routing\Exception\ResourceNotFoundException $e) {
            $this->fail(sprintf('The "%s" url does not match with any route', $uri));
        }
        $expected = array_merge(['_route' => $routeName], $params);
        $intersection = array_intersect_assoc($expected, $match);

        $this->assertEquals($expected, $intersection);
    }
723174
public function execute(array $params = [])
    {
        $context = \Context::getInstance();
        $excludedRoutes = $this->getExcludedRoutes();
        $currentRoute = [
            'extension' => $context->getExtensionName(),
            'module' => $context->getModuleName(),
            'action' => $context->getActionName(),
        ];

        if (!in_array($currentRoute, $excludedRoutes)) {
            $currentUrl = \common_http_Request::currentRequest()->getUrl();
            $url = $this->url . (parse_url($this->url, PHP_URL_QUERY) ? '&' : '?') . 'return_url=' . urlencode($currentUrl);

            $flowController = new FlowController();
            $flowController->redirect($url);
        }
    }
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);
        }
    }
415727
private function getRouteParam($route, $param)
    {
        $route = (array) $route;
        $prefix = chr(0).'*'.chr(0);
        
        return $this->arrayGet(
            $route, 
            $prefix.$param, 
            $this->arrayGet($route, $param)
        );
    }
281070
public function match()
    {
        $params = [];

        $requestUrl = $this->requestUrl();

        foreach ($this->routes as $handler) {
            list ($_route, $controller, $action, $name) = $handler;

            if (false !== strpos($_route, '[:locale]')) {
                $_route = str_replace('[:locale]', '[' . implode('|', Config::get('locale', 'available')) . ':locale]',
                    $_route);
            }

            if ($_route === '*') {
                $match = true;
            } elseif (isset($_route[0]) && $_route[0] === '@') {
                $match = preg_match('`' . substr($_route, 1) . '`u', $requestUrl, $params);
            } else {
                $route = null;
                $regex = false;
                $j = 0;
                $n = isset($_route[0]) ? $_route[0] : null;
                $i = 0;

                // Find the longest non-regex substring and match it against the URI
                while (true) {
                    if (!isset($_route[$i])) {
                        break;
                    } elseif (false === $regex) {
                        $c = $n;
                        $regex = $c === '[' || $c === '(' || $c === '.';
                        if (false === $regex && false !== isset($_route[$i + 1])) {
                            $n = $_route[$i + 1];
                            $regex = $n === '?' || $n === '+' || $n === '*' || $n === '{';
                        }
                        if (false === $regex && $c !== '/' && (!isset($requestUrl[$j]) || $c !== $requestUrl[$j])) {
                            continue 2;
                        }
                        $j++;
                    }
                    $route .= $_route[$i++];
                }
                $regex = $this->compileRoute($route);
                $match = preg_match($regex, $requestUrl, $params);
            }

            if (($match == true || $match > 0)) {
                if ($params) {
                    foreach ($params as $key => $value) {
                        if (is_numeric($key)) {
                            unset($params[$key]);
                        }
                        if ($key === 'locale') {
                            foreach ($this->namedRoutes as $nameId => $namedRoute) {
                                $this->namedRoutes[$nameId] = str_replace('[:locale]', $value, $namedRoute);
                            }
                        }
                    }
                }

                return [
                    'controller' => $controller,
                    'action' => $action,
                    'params' => $params,
                    'name' => $name
                ];
            }
        }
        return [];
    }
1051576
public function getRoute(string $routeKey, array $params = []): string
    {
        $this->checkRouteIsDefined($routeKey);

        return route(
            $this->getAttribute('routes')[$routeKey]['alias'],
            array_merge($this->getAttribute('routes')[$routeKey]['parameters'], $params)
        );
    }
429596
protected function checkParams(RouteMatch $match, $routeConfig)
    {
        if (!isset($routeConfig['params'])) {
            return true;
        }

        $params = (array) $routeConfig['params'];
        foreach ($params as $name => $value) {

            $param = $match->getParam($name, null);
            if (null === $param) {
                continue;
            }

            if (!$this->checkParam($param, $value)) {
                return false;
            }
        }

        return true;
    }
758928
public function amOnRoute($routeName, $params = [])
    {
        $route = $this->getRouteByName($routeName);

        $absolute = !is_null($route->domain());
        $url = $this->app['url']->route($routeName, $params, $absolute);
        $this->amOnPage($url);
    }
488041
public function computePath($params) {
    $route = $this->getPath();

    if (!preg_match_all(
      '~' . self::VARIABLE_REGEX . '~x', $route, $matches,
      PREG_OFFSET_CAPTURE | PREG_SET_ORDER
    )) {
      return $route;
    }

    $offset = 0;
    $url = '';

    /** @var string[] $matches */
    foreach ($matches as $set) {
      if ($set[0][1] > $offset) {
        $url .= substr($route, $offset, $set[0][1] - $offset);
      }
      if(isset($params[$set[1][0]])) {
        $url .= $params[$set[1][0]];
      } else {
        throw new \InvalidArgumentException(sprintf('No value supplied for "%s"', $set[1][0]));
      }
      $offset = $set[0][1] + strlen($set[0][0]);
    }
    if ($offset !== strlen($route)) {
      $url .= substr($route, $offset);
    }

    return $url;
  }
1135668
public static function createSuccess(
        string $routeName,
        array $routeParams = [],
        array $routeAllowedMethods = [],
        array $routeMiddlewares = [],
        array $routeHandler = []
    ):self {
        $result                         = new self();
        $result->routeName              = $routeName;
        $result->routeParams            = $routeParams;
        $result->routeAllowedMethods    = $routeAllowedMethods;
        $result->routeMiddlewares       = $routeMiddlewares;
        $result->routeHandler           = $routeHandler;
        $result->status                 = $result::ROUTE_FOUND;
        return $result;
    }
1168524
public function toRoute($name, array $params = [])
    {
        $url = $this->getUrl()->fromRoute($name, $params);

        return $this->toUrl($url);
    }
243219
public function amOnRoute($routeName, array $params = [])
    {
        $router = $this->client->grabServiceFromContainer('router');
        $url = $router->assemble($params, ['name' => $routeName]);
        $this->amOnPage($url);
    }
760974
private function _hasParams($route, $params, $constraints)
    {
        foreach ($params as $key => $value)
        {
            if ( strpos(preg_replace('/\s+/', '', $route), '{' . $key . '}') === false ||
                (array_key_exists($key, $constraints) &&
                    preg_match('!' . preg_replace('/\s+/', '', $constraints[$key]) . '!', $value) == 0)
            )
                return false;
        }

        return true;
    }
155551
private static function prepare(Route $route, $params)
    {
        static::$current = $route;

        if ($route->getMethod() == 'resource') {
            if ($route->getTarget()['method'] == 'update') {
                $id = $params[0];
                $params[0] = new Request();
                $params[] = $id;
            } elseif ($route->getTarget()['method'] == 'insert') {
                $params[] = new Request();
            }
            self::treatment(call_user_func_array($route->getClosure(), $params));
        } elseif ($route->getMethod() == 'call') {
            $target = $route->getResource()[$route->name]->getTarget();

            self::treatment(call_user_func_array([$target['controller'], $target['method']], $params));
        } else {
            self::treatment(call_user_func_array($route->getClosure(), $params));
        }
    }
304671
public function route($route, $param = null)
	{
		if($route == '/')
		{
    	return route('wardrobe.index');
		}
		else
		{
			return \URL::route('wardrobe.'.$route, $param);
		}
	}
533307
public function seeCurrentRouteIs($routeName)
    {
        if (!$this->di->has('url')) {
            $this->fail('Unable to resolve "url" service.');
        }

        /** @var Url $url */
        $url = $this->di->getShared('url');
        $this->seeCurrentUrlEquals($url->get(['for' => $routeName], null, true));
    }
149817
public function matchParam($paramName)
    {
        return (0 == strcasecmp($this->name, $paramName))
                || (0 == strcasecmp($this->shortName, $paramName));
    }