diff --git a/src/UrlGenerator.php b/src/UrlGenerator.php index bb3a8aa..cbe9b7c 100644 --- a/src/UrlGenerator.php +++ b/src/UrlGenerator.php @@ -210,21 +210,11 @@ private function isRelative(string $url): bool return strncmp($url, '//', 2) && !str_contains($url, '://'); } - public function getUriPrefix(): string - { - return $this->uriPrefix; - } - public function setEncodeRaw(bool $encodeRaw): void { $this->encodeRaw = $encodeRaw; } - public function setUriPrefix(string $name): void - { - $this->uriPrefix = $name; - } - /** * Checks for any missing route parameters. * @@ -265,7 +255,7 @@ private function missingArguments(array $parts, array $substitutions): array private function generatePath(array $arguments, array $queryParameters, array $parts): string { $notSubstitutedArguments = $arguments; - $path = $this->getUriPrefix(); + $path = ''; foreach ($parts as $part) { if (is_string($part)) { diff --git a/tests/UrlGeneratorTest.php b/tests/UrlGeneratorTest.php index 4c31566..d603f14 100644 --- a/tests/UrlGeneratorTest.php +++ b/tests/UrlGeneratorTest.php @@ -32,28 +32,6 @@ public function testSimpleRouteGenerated(): void $this->assertEquals('/home/index', $url); } - public function dataGenerateWithUriPrefix(): array - { - return [ - ['/home/index', ''], - ['/test/home/index', '/test'], - ]; - } - - /** - * @dataProvider dataGenerateWithUriPrefix - */ - public function testGenerateWithUriPrefix(string $expected, string $prefix): void - { - $generator = $this->createUrlGenerator([ - Route::get('/home/index')->name('index'), - ]); - - $generator->setUriPrefix($prefix); - - $this->assertSame($expected, $generator->generate('index')); - } - public function testRouteWithoutNameNotFound(): void { $routes = [ @@ -830,16 +808,6 @@ public function testGenerateFromCurrentWithoutFallbackRouteWithoutCurrentRoute() $this->assertEquals('/ru/home/index', $url); } - public function testGetUriPrefix(): void - { - $prefix = '/test'; - - $urlGenerator = $this->createUrlGenerator([]); - $urlGenerator->setUriPrefix($prefix); - - $this->assertSame($prefix, $urlGenerator->getUriPrefix()); - } - public function testNotFoundRoutes(): void { $routes = [