Added more tests to route repository test

This commit is contained in:
Marcin Kurczewski 2014-11-21 10:30:29 +01:00
parent a3b02adb7f
commit a11436aa8c

View file

@ -14,6 +14,27 @@ final class RouteRepositoryTest extends AbstractDatabaseTestCase
$this->assertNotEmpty($routeRepository->getRoutes());
}
public function testRouteMethods()
{
$routeRepository = Injector::get(RouteRepository::class);
foreach ($routeRepository->getRoutes() as $route)
{
foreach ($route->getMethods() as $method)
{
$this->assertContains($method, ['GET', 'POST', 'PUT', 'DELETE']);
}
}
}
public function testRouteUrls()
{
$routeRepository = Injector::get(RouteRepository::class);
foreach ($routeRepository->getRoutes() as $route)
{
$this->assertEquals(0, strpos($route->getUrl(), '/api/'));
}
}
public function testRouteInjection()
{
$routerMock = $this->mock(Router::class);