77
88class ContentRouterTest extends CmfUnitTestCase
99{
10-
1110 public function setUp ()
1211 {
1312 $ this ->node = $ this ->buildMock ('Navigation ' , array ('getReference ' ));
1413 $ this ->document = $ this ->buildMock ('Document ' );
1514 $ this ->loader_interface = $ this ->buildMock ("\Symfony\Component\Config\Loader\LoaderInterface " );
16- $ this ->document_manager = $ this ->buildMock ("\Doctrine\ODM\PHPCR\DocumentManager " , array ('find ' ));
17- $ this ->controller_resolver = $ this ->buildMock ('\Symfony\Cmf\Bundle\ChainRoutingBundle\Controller\DocumentControllerResolver ' , array ('getController ' ));
15+ $ this ->object_manager = $ this ->buildMock ("\Doctrine\Common\Persistence\ObjectManager " , array ('find ' ));
16+ $ this ->controller_resolver = $ this ->buildMock ('\Symfony\Cmf\Bundle\ChainRoutingBundle\Controller\ControllerResolver ' , array ('getController ' ));
1817
1918 $ this ->router = new ContentRouter ($ this ->loader_interface , array ());
20- $ this ->router ->setDocumentManager ($ this ->document_manager );
19+ $ this ->router ->setObjectManager ($ this ->object_manager );
2120 $ this ->router ->setControllerResolver ($ this ->controller_resolver );
2221 }
2322
@@ -29,7 +28,7 @@ public function testMatch()
2928 ->method ('getReference ' )
3029 ->will ($ this ->returnValue ($ this ->document ));
3130
32- $ this ->document_manager ->expects ($ this ->once ())
31+ $ this ->object_manager ->expects ($ this ->once ())
3332 ->method ('find ' )
3433 ->with (null , $ url_alias )
3534 ->will ($ this ->returnValue ($ this ->node ));
@@ -49,7 +48,7 @@ public function testNoReferenceMatch()
4948 ->method ('getReference ' )
5049 ->will ($ this ->returnValue (null ));
5150
52- $ this ->document_manager ->expects ($ this ->once ())
51+ $ this ->object_manager ->expects ($ this ->once ())
5352 ->method ('find ' )
5453 ->with (null , $ url_alias )
5554 ->will ($ this ->returnValue ($ this ->node ));
@@ -61,12 +60,11 @@ public function testNoNodeMatch()
6160 {
6261 $ url_alias = "/company/more_no_match " ;
6362
64- $ this ->document_manager ->expects ($ this ->once ())
63+ $ this ->object_manager ->expects ($ this ->once ())
6564 ->method ('find ' )
6665 ->with (null , $ url_alias )
6766 ->will ($ this ->returnValue (null ));
6867
6968 $ this ->assertFalse ($ this ->router ->match ($ url_alias ));
7069 }
71-
7270}
0 commit comments