4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Routing\Tests\Annotation
;
14 use Symfony\Component\Routing\Annotation\Route
;
16 class RouteTest
extends \PHPUnit_Framework_TestCase
19 * @expectedException \BadMethodCallException
21 public function testInvalidRouteParameter()
23 $route = new Route(array('foo' => 'bar'));
27 * @dataProvider getValidParameters
29 public function testRouteParameters($parameter, $value, $getter)
31 $route = new Route(array($parameter => $value));
32 $this->assertEquals($route->$getter(), $value);
35 public function getValidParameters()
38 array('value', '/Blog', 'getPattern'),
39 array('value', '/Blog', 'getPath'),
40 array('requirements', array('_method' => 'GET'), 'getRequirements'),
41 array('options', array('compiler_class' => 'RouteCompiler'), 'getOptions'),
42 array('name', 'blog_index', 'getName'),
43 array('defaults', array('_controller' => 'MyBlogBundle:Blog:index'), 'getDefaults'),
44 array('schemes', array('https'), 'getSchemes'),
45 array('methods', array('GET', 'POST'), 'getMethods'),
46 array('host', array('{locale}.example.com'), 'getHost')