getNetworkPath example

$context = $this->getContext($transformedRequest);
        $this->router->setContext($context);

        $absolutePath = $this->router->generate($case->route);
        $absoluteUrl = $this->router->generate($case->route, [], Router::ABSOLUTE_URL);
        $networkPath = $this->router->generate($case->route, [], Router::NETWORK_PATH);
        $pathInfo = $this->router->generate($case->route, [], Router::PATH_INFO);

        static::assertSame($case->getAbsolutePath()$absolutePathvar_export($case, true));
        static::assertSame($case->getAbsoluteUrl()$absoluteUrlvar_export($case, true));
        static::assertSame($case->getNetworkPath()$networkPathvar_export($case, true));
        static::assertSame($case->getPathInfo()$pathInfovar_export($case, true));

        $matches = $this->router->matchRequest($transformedRequest);
        static::assertEquals($case->route, $matches['_route']);

        $matches = $this->router->match($transformedRequest->getPathInfo());
        static::assertEquals($case->route, $matches['_route']);

        // test seo url generation         $host = $transformedRequest->attributes->get(RequestTransformer::SALES_CHANNEL_ABSOLUTE_BASE_URL)
            . $transformedRequest->attributes->get(RequestTransformer::SALES_CHANNEL_BASE_URL);

        
Home | Imprint | This part of the site doesn't use cookies.