|
| 1 | +<?php |
| 2 | + |
| 3 | +/* |
| 4 | + * This file is part of the Symfony package. |
| 5 | + * |
| 6 | + * (c) Fabien Potencier <fabien@symfony.com> |
| 7 | + * |
| 8 | + * For the full copyright and license information, please view the LICENSE |
| 9 | + * file that was distributed with this source code. |
| 10 | + */ |
| 11 | + |
| 12 | +namespace Symfony\Bundle\FrameworkBundle\Tests\Functional; |
| 13 | + |
| 14 | +class AnnotatedControllerTest extends WebTestCase |
| 15 | +{ |
| 16 | + /** |
| 17 | + * @dataProvider getRoutes |
| 18 | + */ |
| 19 | + public function testAnnotatedController($path, $expectedValue) |
| 20 | + { |
| 21 | + $client = $this->createClient(array('test_case' => 'AnnotatedController', 'root_config' => 'config.yml')); |
| 22 | + $client->request('GET', '/annotated'.$path); |
| 23 | + |
| 24 | + $this->assertSame(200, $client->getResponse()->getStatusCode()); |
| 25 | + $this->assertSame($expectedValue, $client->getResponse()->getContent()); |
| 26 | + } |
| 27 | + |
| 28 | + public function getRoutes() |
| 29 | + { |
| 30 | + return array( |
| 31 | + array('/null_request', 'Symfony\Component\HttpFoundation\Request'), |
| 32 | + array('/null_argument', ''), |
| 33 | + array('/null_argument_with_route_param', ''), |
| 34 | + array('/null_argument_with_route_param/value', 'value'), |
| 35 | + array('/argument_with_route_param_and_default', 'value'), |
| 36 | + array('/argument_with_route_param_and_default/custom', 'custom'), |
| 37 | + ); |
| 38 | + } |
| 39 | +} |
0 commit comments