lithium\tests\cases\net\http\RouteTest::testSimpleRouteMatching PHP Метод

testSimpleRouteMatching() публичный Метод

Tests that simple routes with only a {:controller} parameter are properly matched, and anything including extra parameters or an action other than the default action are ignored.
    public function testSimpleRouteMatching()
    {
        $route = new Route(array('template' => '/{:controller}'));
        $result = $route->match(array('controller' => 'posts', 'action' => 'index'));
        $this->assertEqual('/posts', $result);
        $result = $route->match(array('controller' => 'users'));
        $this->assertEqual('/users', $result);
        $this->assertFalse($route->match(array('controller' => 'posts', 'action' => 'view')));
        $this->assertFalse($route->match(array('controller' => 'posts', 'id' => 5)));
        $this->assertFalse($route->match(array('action' => 'index')));
    }