$this->
assertFalse($route->
hasScheme('httpS'
));
$route->
setSchemes(['HttpS', 'hTTp'
]);
$this->
assertEquals(['https', 'http'
],
$route->
getSchemes(), '->setSchemes() accepts an array of schemes and lowercases them'
);
$this->
assertTrue($route->
hasScheme('htTp'
));
$this->
assertTrue($route->
hasScheme('httpS'
));
} public function testMethod() { $route =
new Route('/'
);
$this->
assertEquals([],
$route->
getMethods(), 'methods is initialized with []'
);
$route->
setMethods('gEt'
);
$this->
assertEquals(['GET'
],
$route->
getMethods(), '->setMethods() accepts a single method string and uppercases it'
);
$route->
setMethods(['gEt', 'PosT'
]);
$this->
assertEquals(['GET', 'POST'
],
$route->
getMethods(), '->setMethods() accepts an array of methods and uppercases them'
);
} public function testCondition() { $route =
new Route('/'
);
$this->
assertSame('',
$route->
getCondition());
$route->
setCondition('context.getMethod() == "GET"'
);
$this->
assertSame('context.getMethod() == "GET"',
$route->
getCondition());
}