12
12
13
13
namespace Symfony \Cmf \Bundle \RoutingBundle \Tests \Functional \Routing ;
14
14
15
+ use PHPCR \Util \NodeHelper ;
16
+ use PHPCR \Util \PathHelper ;
15
17
use Symfony \Component \HttpFoundation \Request ;
16
18
17
19
use Symfony \Cmf \Bundle \RoutingBundle \Doctrine \Phpcr \Route ;
@@ -303,12 +305,13 @@ public function testEnhanceControllerByClass()
303
305
304
306
public function testEnhanceTemplateByClass ()
305
307
{
306
- if ($ content = $ this ->getDm ()->find (null , '/templatebyclass ' )) {
308
+ if ($ content = $ this ->getDm ()->find (null , '/test/content/ templatebyclass ' )) {
307
309
$ this ->getDm ()->remove ($ content );
308
310
$ this ->getDm ()->flush ();
309
311
}
312
+ NodeHelper::createPath ($ this ->getDm ()->getPhpcrSession (), '/test/content ' );
310
313
$ document = new Content ();
311
- $ document ->setId ('/test/templatebyclass ' );
314
+ $ document ->setId ('/test/content/ templatebyclass ' );
312
315
$ document ->setTitle ('the title ' );
313
316
$ this ->getDm ()->persist ($ document );
314
317
@@ -322,7 +325,7 @@ public function testEnhanceTemplateByClass()
322
325
323
326
$ expected = array (
324
327
'_controller ' => 'cmf_content.controller:indexAction ' ,
325
- RouteObjectInterface::ROUTE_NAME => ' /test/routing /templatebyclass ' ,
328
+ RouteObjectInterface::ROUTE_NAME => self :: ROUTE_ROOT . ' /templatebyclass ' ,
326
329
);
327
330
$ request = Request::create ('/templatebyclass ' );
328
331
$ matches = $ this ->router ->matchRequest ($ request );
0 commit comments