You are here

public function RouteTest::testLegacySchemeRequirement in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/routing/Tests/RouteTest.php \Symfony\Component\Routing\Tests\RouteTest::testLegacySchemeRequirement()

@group legacy

File

vendor/symfony/routing/Tests/RouteTest.php, line 170

Class

RouteTest

Namespace

Symfony\Component\Routing\Tests

Code

public function testLegacySchemeRequirement() {
  $route = new Route('/');
  $route
    ->setRequirement('_scheme', 'http|https');
  $this
    ->assertEquals('http|https', $route
    ->getRequirement('_scheme'));
  $this
    ->assertEquals(array(
    'http',
    'https',
  ), $route
    ->getSchemes());
  $this
    ->assertTrue($route
    ->hasScheme('https'));
  $this
    ->assertTrue($route
    ->hasScheme('http'));
  $this
    ->assertFalse($route
    ->hasScheme('ftp'));
  $route
    ->setSchemes(array(
    'hTTp',
  ));
  $this
    ->assertEquals('http', $route
    ->getRequirement('_scheme'));
  $route
    ->setSchemes(array());
  $this
    ->assertNull($route
    ->getRequirement('_scheme'));
}