Added more tests to route repository test
This commit is contained in:
parent
a3b02adb7f
commit
a11436aa8c
1 changed files with 21 additions and 0 deletions
|
@ -14,6 +14,27 @@ final class RouteRepositoryTest extends AbstractDatabaseTestCase
|
||||||
$this->assertNotEmpty($routeRepository->getRoutes());
|
$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()
|
public function testRouteInjection()
|
||||||
{
|
{
|
||||||
$routerMock = $this->mock(Router::class);
|
$routerMock = $this->mock(Router::class);
|
||||||
|
|
Loading…
Reference in a new issue