1313
1414use FOS \JsRoutingBundle \Extractor \ExposedRoutesExtractor ;
1515use FOS \JsRoutingBundle \Extractor \ExtractedRoute ;
16+ use PHPUnit \Framework \TestCase ;
1617use Symfony \Component \Routing \RequestContext ;
1718use Symfony \Component \Routing \Route ;
1819use Symfony \Component \HttpKernel \Kernel ;
2223 *
2324 * @author William DURAND <[email protected] > 2425 */
25- class ExposedRoutesExtractorTest extends \PHPUnit_Framework_TestCase
26+ class ExposedRoutesExtractorTest extends TestCase
2627{
2728 private $ cacheDir ;
2829
@@ -100,7 +101,9 @@ public function testGetRoutesWithPatterns()
100101
101102 public function testGetCachePath ()
102103 {
103- $ router = $ this ->getMock ('Symfony \\Component \\Routing \\Router ' , array (), array (), '' , false );
104+ $ router = $ this ->getMockBuilder ('Symfony \\Component \\Routing \\Router ' )
105+ ->disableOriginalConstructor ()
106+ ->getMock ();
104107
105108 $ extractor = new ExposedRoutesExtractor ($ router , array (), $ this ->cacheDir , array ());
106109 $ this ->assertEquals ($ this ->cacheDir . DIRECTORY_SEPARATOR . 'fosJsRouting ' . DIRECTORY_SEPARATOR . 'data.json ' , $ extractor ->getCachePath ('' ));
@@ -113,7 +116,9 @@ public function testGetHostOverHttp($host, $httpPort, $expected)
113116 {
114117 $ requestContext = new RequestContext ('/app_dev.php ' , 'GET ' , $ host , 'http ' , $ httpPort );
115118
116- $ router = $ this ->getMock ('Symfony \\Component \\Routing \\Router ' , array (), array (), '' , false );
119+ $ router = $ this ->getMockBuilder ('Symfony \\Component \\Routing \\Router ' )
120+ ->disableOriginalConstructor ()
121+ ->getMock ();
117122 $ router ->expects ($ this ->atLeastOnce ())
118123 ->method ('getContext ' )
119124 ->will ($ this ->returnValue ($ requestContext ));
@@ -137,7 +142,9 @@ public function testGetHostOverHttps($host, $httpsPort, $expected)
137142 {
138143 $ requestContext = new RequestContext ('/app_dev.php ' , 'GET ' , $ host , 'https ' , 80 , $ httpsPort );
139144
140- $ router = $ this ->getMock ('Symfony \\Component \\Routing \\Router ' , array (), array (), '' , false );
145+ $ router = $ this ->getMockBuilder ('Symfony \\Component \\Routing \\Router ' )
146+ ->disableOriginalConstructor ()
147+ ->getMock ();
141148 $ router ->expects ($ this ->atLeastOnce ())
142149 ->method ('getContext ' )
143150 ->will ($ this ->returnValue ($ requestContext ));
@@ -160,13 +167,17 @@ public function provideTestGetHostOverHttps()
160167 */
161168 private function getRouter (array $ routes )
162169 {
163- $ routeCollection = $ this ->getMock ('Symfony \\Component \\Routing \\RouteCollection ' , array (), array (), '' , false );
170+ $ routeCollection = $ this ->getMockBuilder ('Symfony \\Component \\Routing \\RouteCollection ' )
171+ ->disableOriginalConstructor ()
172+ ->getMock ();
164173 $ routeCollection
165174 ->expects ($ this ->atLeastOnce ())
166175 ->method ('all ' )
167176 ->will ($ this ->returnValue ($ routes ));
168177
169- $ router = $ this ->getMock ('Symfony \\Component \\Routing \\Router ' , array (), array (), '' , false );
178+ $ router = $ this ->getMockBuilder ('Symfony \\Component \\Routing \\Router ' )
179+ ->disableOriginalConstructor ()
180+ ->getMock ();
170181 $ router
171182 ->expects ($ this ->atLeastOnce ())
172183 ->method ('getRouteCollection ' )
0 commit comments