This repository was archived by the owner on Sep 16, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +51
-2
lines changed
Tests/AutoRoute/RouteMaker Expand file tree Collapse file tree 2 files changed +51
-2
lines changed Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
- namespace Symfony \Cmf \Bundle \RoutingAutoBundle \AutoRoute ;
3
+ namespace Symfony \Cmf \Bundle \RoutingAutoBundle \AutoRoute \ RouteMaker ;
4
4
5
5
use Symfony \Cmf \Bundle \RoutingAutoBundle \AutoRoute \RouteMakerInterface ;
6
+ use Symfony \Cmf \Bundle \RoutingAutoBundle \AutoRoute \RouteStack ;
7
+ use Symfony \Cmf \Bundle \RoutingAutoBundle \AutoRoute \AutoRouteStack ;
6
8
7
9
/**
8
10
* Default route maker class - automatically delegates to an
9
11
* appropriate maker depending on the context.
10
12
*
11
13
* @author Daniel Leech <[email protected] >
12
14
*/
13
- class RouteMaker implements RouteMakerInterface
15
+ class DefaultMaker implements RouteMakerInterface
14
16
{
15
17
protected $ autoRouteMaker ;
16
18
protected $ patcher ;
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Symfony \Cmf \Bundle \RoutingAutoBundle \Tests \AutoRoute \DefaultMaker ;
4
+
5
+ use Symfony \Cmf \Bundle \RoutingAutoBundle \AutoRoute \RouteMaker \DefaultMaker ;
6
+
7
+ class DefaultMakerTest extends \PHPUnit_Framework_TestCase
8
+ {
9
+ public function setUp ()
10
+ {
11
+ $ this ->autoRouteMaker = $ this ->getMock (
12
+ 'Symfony\Cmf\Bundle\RoutingAutoBundle\AutoRoute\RouteMakerInterface '
13
+ );
14
+
15
+ $ this ->routeMaker = $ this ->getMock (
16
+ 'Symfony\Cmf\Bundle\RoutingAutoBundle\AutoRoute\RouteMakerInterface '
17
+ );
18
+
19
+ $ this ->routeStack = $ this ->getMockBuilder (
20
+ 'Symfony\Cmf\Bundle\RoutingAutoBundle\AutoRoute\RouteStack '
21
+ )->disableOriginalConstructor ()->getMock ();
22
+ $ this ->autoRouteStack = $ this ->getMockBuilder (
23
+ 'Symfony\Cmf\Bundle\RoutingAutoBundle\AutoRoute\AutoRouteStack '
24
+ )->disableOriginalConstructor ()->getMock ();
25
+
26
+ $ this ->defaultMaker = new DefaultMaker (
27
+ $ this ->autoRouteMaker ,
28
+ $ this ->routeMaker
29
+ );
30
+ }
31
+
32
+ public function testMakeWithAutoRouteStack ()
33
+ {
34
+ $ this ->autoRouteMaker ->expects ($ this ->once ())
35
+ ->method ('make ' )
36
+ ->with ($ this ->autoRouteStack );
37
+ $ this ->defaultMaker ->make ($ this ->autoRouteStack );
38
+ }
39
+
40
+ public function testMakeWithNormalRouteStack ()
41
+ {
42
+ $ this ->routeMaker ->expects ($ this ->once ())
43
+ ->method ('make ' )
44
+ ->with ($ this ->routeStack );
45
+ $ this ->defaultMaker ->make ($ this ->routeStack );
46
+ }
47
+ }
You can’t perform that action at this time.
0 commit comments