<?php

use Enlighten\Http\Request;
use Enlighten\Routing\Route;
use Enlighten\Routing\Router;

class RouterTest extends PHPUnit_Framework_TestCase
{
    public function testBlankRouter()
    {
        $request = new Request();
        $request->setRequestUri('/');

        $router = new Router();
        $this->assertNull($router->route($request));
    }

    public function testSimpleRouteMatch()
    {
        $route = new Route('/', function () {
            // ...
        });

        $request = new Request();
        $request->setRequestUri('/');

        $router = new Router();
        $router->register($route);

        $this->assertEquals($route, $router->route($request));
    }

    public function testRouterClear()
    {
        $route = new Route('/', function () {
            // ...
        });

        $request = new Request();
        $request->setRequestUri('/');

        $router = new Router();
        $router->register($route);
        $router->clear();

        $this->assertNull($router->route($request));
    }
}
Add unit test for Router
Routing: Add unit test for Router
