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 +9
-8
lines changed
Tests/AutoRoute/RouteMaker Expand file tree Collapse file tree 2 files changed +9
-8
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 Doctrine \ODM \PHPCR \DocumentManager ;
6
6
use Symfony \Cmf \Bundle \RoutingAutoBundle \AutoRoute \RouteMakerInterface ;
7
7
use Symfony \Cmf \Bundle \RoutingAutoBundle \Document \AutoRoute ;
8
+ use Symfony \Cmf \Bundle \RoutingAutoBundle \AutoRoute \RouteStack ;
8
9
9
10
/**
10
11
* This class is responsible for creating and updating the actual
@@ -23,7 +24,7 @@ public function __construct(DocumentManager $dm)
23
24
24
25
public function make (RouteStack $ routeStack )
25
26
{
26
- $ context = $ autoRouteStack ->getContext ();
27
+ $ context = $ routeStack ->getContext ();
27
28
$ content = $ context ->getContent ();
28
29
29
30
$ autoRoute = $ this ->getAutoRouteForDocument ($ content );
@@ -34,9 +35,9 @@ public function make(RouteStack $routeStack)
34
35
$ autoRoute ->setRouteContent ($ content );
35
36
}
36
37
37
- $ autoRoute ->setName ($ autoRouteStack ->getPath ());
38
+ $ autoRoute ->setName ($ routeStack ->getPath ());
38
39
39
- $ autoRouteStack ->addRoute ($ autoRoute );
40
+ $ routeStack ->addRoute ($ autoRoute );
40
41
}
41
42
42
43
protected function getAutoRouteForDocument ($ document )
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
- namespace Symfony \Cmf \Bundle \RoutingAutoBundle \Tests \AutoRoute ;
3
+ namespace Symfony \Cmf \Bundle \RoutingAutoBundle \Tests \AutoRoute \ RouteMaker ;
4
4
5
- use Symfony \Cmf \Bundle \RoutingAutoBundle \AutoRoute \AutoRouteMaker ;
5
+ use Symfony \Cmf \Bundle \RoutingAutoBundle \AutoRoute \RouteMaker \ AutoRouteMaker ;
6
6
use Doctrine \Common \Collections \ArrayCollection ;
7
7
8
8
class AutoRouteMakerTest extends \PHPUnit_Framework_TestCase
@@ -85,7 +85,7 @@ public function testCreateOrUpdateAutoRouteForExisting()
85
85
->method ('addRoute ' )
86
86
->with ($ this ->autoRoute1 );
87
87
88
- $ this ->arm ->createOrUpdateAutoRoute ($ this ->autoRouteStack );
88
+ $ this ->arm ->make ($ this ->autoRouteStack );
89
89
}
90
90
91
91
public function testCreateOrUpdateAutoRouteForNew ()
@@ -108,6 +108,6 @@ public function testCreateOrUpdateAutoRouteForNew()
108
108
$ testCase ->assertInstanceOf ('Symfony\Cmf\Bundle\RoutingAutoBundle\Document\AutoRoute ' , $ route );
109
109
}));
110
110
111
- $ this ->arm ->createOrUpdateAutoRoute ($ this ->autoRouteStack );
111
+ $ this ->arm ->make ($ this ->autoRouteStack );
112
112
}
113
113
}
You can’t perform that action at this time.
0 commit comments