tests/Routing/RouteTest.php
/**
     * Tests that routes correctly match to a corresponding request.
     */
Tests that routes correctly match to a corresponding request.
Tests that routes correctly match to a corresponding request .
public function testMatching()
    {
        $validRequest = new Request(array(), array(), array(), array(), array(), array(
            'REQUEST_METHOD' => 'GET',
            'REQUEST_URI' => '/test'
        ));
        $invalidRequest = new Request(array(), array(), array(), array(), array(), array(
            'REQUEST_METHOD' => 'GET',
            'REQUEST_URI' => '/test123'
        ));
        $this->assertTrue($this->route->matches($validRequest));
        $this->assertFalse($this->route->matches($invalidRequest));
    }
public function testMatching ( ) { $ validRequest = new Request ( array ( ) , array ( ) , array ( ) , array ( ) , array ( ) , array ( 'REQUEST_METHOD' => 'GET' , 'REQUEST_URI' => '/test' ) ) ; $ invalidRequest = new Request ( array ( ) , array ( ) , array ( ) , array ( ) , array ( ) , array ( 'REQUEST_METHOD' => 'GET' , 'REQUEST_URI' => '/test123' ) ) ; $ this -> assertTrue ( $ this -> route -> matches ( $ validRequest ) ) ; $ this -> assertFalse ( $ this -> route -> matches ( $ invalidRequest ) ) ; }
Tests that routes correctly match to a corresponding request.
Tests that routes correctly match to a corresponding request .
// Variable {var} should work for [a-zA-Z] // Variable {var} should fail for [^a-zA-Z]