You are here

public function RouteTest::testScheme 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::testScheme()

File

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

Class

RouteTest

Namespace

Symfony\Component\Routing\Tests

Code

public function testScheme() {
  $route = new Route('/');
  $this
    ->assertEquals(array(), $route
    ->getSchemes(), 'schemes is initialized with array()');
  $this
    ->assertFalse($route
    ->hasScheme('http'));
  $route
    ->setSchemes('hTTp');
  $this
    ->assertEquals(array(
    'http',
  ), $route
    ->getSchemes(), '->setSchemes() accepts a single scheme string and lowercases it');
  $this
    ->assertTrue($route
    ->hasScheme('htTp'));
  $this
    ->assertFalse($route
    ->hasScheme('httpS'));
  $route
    ->setSchemes(array(
    'HttpS',
    'hTTp',
  ));
  $this
    ->assertEquals(array(
    'https',
    'http',
  ), $route
    ->getSchemes(), '->setSchemes() accepts an array of schemes and lowercases them');
  $this
    ->assertTrue($route
    ->hasScheme('htTp'));
  $this
    ->assertTrue($route
    ->hasScheme('httpS'));
}