Yaffs site version 1.1
[yaffs-website] / vendor / symfony / http-kernel / Tests / TestHttpKernel.php
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\Component\HttpKernel\Tests;
13
14 use Symfony\Component\HttpKernel\HttpKernel;
15 use Symfony\Component\HttpFoundation\Request;
16 use Symfony\Component\HttpFoundation\Response;
17 use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface;
18 use Symfony\Component\EventDispatcher\EventDispatcher;
19
20 class TestHttpKernel extends HttpKernel implements ControllerResolverInterface
21 {
22     public function __construct()
23     {
24         parent::__construct(new EventDispatcher(), $this);
25     }
26
27     public function getController(Request $request)
28     {
29         return array($this, 'callController');
30     }
31
32     public function getArguments(Request $request, $controller)
33     {
34         return array($request);
35     }
36
37     public function callController(Request $request)
38     {
39         return new Response('Request: '.$request->getRequestUri());
40     }
41 }