12
12
namespace Symfony \Component \Routing \Tests \Matcher ;
13
13
14
14
use PHPUnit \Framework \TestCase ;
15
+ use Symfony \Bridge \PhpUnit \ForwardCompatTestTrait ;
15
16
use Symfony \Component \Routing \Exception \MethodNotAllowedException ;
16
17
use Symfony \Component \Routing \Exception \ResourceNotFoundException ;
17
18
use Symfony \Component \Routing \Matcher \UrlMatcher ;
21
22
22
23
class UrlMatcherTest extends TestCase
23
24
{
25
+ use ForwardCompatTestTrait;
26
+
24
27
public function testNoMethodSoAllowed ()
25
28
{
26
29
$ coll = new RouteCollection ();
27
30
$ coll ->add ('foo ' , new Route ('/foo ' ));
28
31
29
32
$ matcher = $ this ->getUrlMatcher ($ coll );
30
- $ this ->assertInternalType ( ' array ' , $ matcher ->match ('/foo ' ));
33
+ $ this ->assertIsArray ( $ matcher ->match ('/foo ' ));
31
34
}
32
35
33
36
public function testMethodNotAllowed ()
@@ -66,7 +69,7 @@ public function testHeadAllowedWhenRequirementContainsGet()
66
69
$ coll ->add ('foo ' , new Route ('/foo ' , [], [], [], '' , [], ['get ' ]));
67
70
68
71
$ matcher = $ this ->getUrlMatcher ($ coll , new RequestContext ('' , 'head ' ));
69
- $ this ->assertInternalType ( ' array ' , $ matcher ->match ('/foo ' ));
72
+ $ this ->assertIsArray ( $ matcher ->match ('/foo ' ));
70
73
}
71
74
72
75
public function testMethodNotAllowedAggregatesAllowedMethods ()
@@ -108,7 +111,7 @@ public function testMatch()
108
111
$ collection = new RouteCollection ();
109
112
$ collection ->add ('foo ' , new Route ('/foo ' , [], [], [], '' , [], ['get ' , 'head ' ]));
110
113
$ matcher = $ this ->getUrlMatcher ($ collection );
111
- $ this ->assertInternalType ( ' array ' , $ matcher ->match ('/foo ' ));
114
+ $ this ->assertIsArray ( $ matcher ->match ('/foo ' ));
112
115
113
116
// route does not match with POST method context
114
117
$ matcher = $ this ->getUrlMatcher ($ collection , new RequestContext ('' , 'post ' ));
@@ -120,9 +123,9 @@ public function testMatch()
120
123
121
124
// route does match with GET or HEAD method context
122
125
$ matcher = $ this ->getUrlMatcher ($ collection );
123
- $ this ->assertInternalType ( ' array ' , $ matcher ->match ('/foo ' ));
126
+ $ this ->assertIsArray ( $ matcher ->match ('/foo ' ));
124
127
$ matcher = $ this ->getUrlMatcher ($ collection , new RequestContext ('' , 'head ' ));
125
- $ this ->assertInternalType ( ' array ' , $ matcher ->match ('/foo ' ));
128
+ $ this ->assertIsArray ( $ matcher ->match ('/foo ' ));
126
129
127
130
// route with an optional variable as the first segment
128
131
$ collection = new RouteCollection ();
0 commit comments