Add tests app/router for new methods.

This commit is contained in:
Alexander Demidov
2012-05-25 16:31:08 +04:00
parent 1cf82d7442
commit c7815a2112
2 changed files with 94 additions and 0 deletions

View File

@ -77,4 +77,17 @@ class RouteTest extends PHPUnit_Framework_TestCase
$this->setExpectedException('PHPUnit_Framework_Error');
$route->match('');
}
public function testGetUri()
{
$route = 'myroute';
$route_mock = $this->getMockBuilder('Route')
->disableOriginalConstructor()
->setMethods(array('__construct'))
->getMock();
$reflection = new ReflectionProperty('Route', 'route');
$reflection->setAccessible(true);
$reflection->setValue($route_mock, $route);
$this->assertEquals('/' . $route, $route_mock->getUri());
}
}