Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace Symfony\Component\Routing\Tests\Fixtures\AttributeFixtures;

use Symfony\Component\Routing\Annotation\Route;

#[Route(path: ['nl' => '/nl'])]
class LocalizedPrefixMissingLocaleActionController
{
#[Route(path: ['nl' => '/actie', 'en' => '/action'], name: 'action')]
public function action()
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace Symfony\Component\Routing\Tests\Fixtures\AttributeFixtures;

use Symfony\Component\Routing\Annotation\Route;

#[Route(path: ['nl' => '/nl', 'en' => '/en'])]
class LocalizedPrefixMissingRouteLocaleActionController
{
#[Route(path: ['nl' => '/actie'], name: 'action')]
public function action()
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,14 @@ public function testInvokableClassMultipleRouteLoad()
public function testMissingPrefixLocale()
{
$this->expectException(\LogicException::class);
$this->expectExceptionMessage(sprintf('Route to "action" with locale "en" is missing a corresponding prefix in class "%s\LocalizedPrefixMissingLocaleActionController".', $this->getNamespace()));
$this->loader->load($this->getNamespace().'\LocalizedPrefixMissingLocaleActionController');
}

public function testMissingRouteLocale()
{
$this->expectException(\LogicException::class);
$this->expectExceptionMessage(sprintf('Route to "%s\LocalizedPrefixMissingRouteLocaleActionController::action" is missing paths for locale(s) "en".', $this->getNamespace()));
$this->loader->load($this->getNamespace().'\LocalizedPrefixMissingRouteLocaleActionController');
}

Expand Down