class YamlRouteDiscoveryTest
Same name and namespace in other branches
- 11.x core/tests/Drupal/KernelTests/Core/Routing/YamlRouteDiscoveryTest.php \Drupal\KernelTests\Core\Routing\YamlRouteDiscoveryTest
Tests \Drupal\Core\Routing\YamlRouteDiscovery.
Attributes
#[CoversClass(YamlRouteDiscovery::class)]
#[Group('Routing')]
#[RunTestsInSeparateProcesses]
Hierarchy
- class \Drupal\KernelTests\KernelTestBase implements \Drupal\Core\DependencyInjection\ServiceProviderInterface uses \Drupal\Tests\DrupalTestCaseTrait, \Drupal\KernelTests\AssertContentTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\ExtensionListTestTrait, \Prophecy\PhpUnit\ProphecyTrait, \Drupal\Tests\BrowserHtmlDebugTrait, \Drupal\Tests\HttpKernelUiHelperTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\KernelTests\Core\Routing\YamlRouteDiscoveryTest extends \Drupal\KernelTests\KernelTestBase
Expanded class hierarchy of YamlRouteDiscoveryTest
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Routing/ YamlRouteDiscoveryTest.php, line 16
Namespace
Drupal\KernelTests\Core\RoutingView source
class YamlRouteDiscoveryTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'router_test',
'system',
];
/**
* Tests that string values for methods and schemes are supported.
*
* Symfony's route constructor accepts a single method or scheme as a
* string, so routing.yml files may use strings as well as arrays.
*
* @see https://www.drupal.org/node/3608776
*/
public function testStringMethodsAndSchemes() : void {
$route = $this->container
->get('router.route_provider')
->getRouteByName('router_test.string_method_scheme');
$this->assertSame([
'GET',
], $route->getMethods());
$this->assertSame([
'https',
], $route->getSchemes());
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.