Yaffs site version 1.1
[yaffs-website] / vendor / symfony-cmf / routing / Tests / Routing / RouteMock.php
1 <?php
2
3 /*
4  * This file is part of the Symfony CMF package.
5  *
6  * (c) 2011-2015 Symfony CMF
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\Cmf\Component\Routing\Tests\Routing;
13
14 use Symfony\Component\Routing\Route as SymfonyRoute;
15 use Symfony\Cmf\Component\Routing\RouteObjectInterface;
16
17 class RouteMock extends SymfonyRoute implements RouteObjectInterface
18 {
19     private $locale;
20
21     public function setLocale($locale)
22     {
23         $this->locale = $locale;
24     }
25
26     public function getContent()
27     {
28         return;
29     }
30
31     public function getDefaults()
32     {
33         $defaults = array();
34         if (!is_null($this->locale)) {
35             $defaults['_locale'] = $this->locale;
36         }
37
38         return $defaults;
39     }
40
41     public function getRequirement($key)
42     {
43         if (!$key == '_locale') {
44             throw new \Exception();
45         }
46
47         return $this->locale;
48     }
49
50     public function getRouteKey()
51     {
52         return;
53     }
54 }