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 ()
@@ -114,7 +117,7 @@ public function testMethodIsIgnoredIfNoMethodGiven()
114
117
$ collection = new RouteCollection ();
115
118
$ collection ->add ('foo ' , new Route ('/foo ' , [], [], [], '' , [], ['get ' , 'head ' ]));
116
119
$ matcher = $ this ->getUrlMatcher ($ collection );
117
- $ this ->assertInternalType ( ' array ' , $ matcher ->match ('/foo ' ));
120
+ $ this ->assertIsArray ( $ matcher ->match ('/foo ' ));
118
121
119
122
// route does not match with POST method context
120
123
$ matcher = $ this ->getUrlMatcher ($ collection , new RequestContext ('' , 'post ' ));
@@ -126,9 +129,9 @@ public function testMethodIsIgnoredIfNoMethodGiven()
126
129
127
130
// route does match with GET or HEAD method context
128
131
$ matcher = $ this ->getUrlMatcher ($ collection );
129
- $ this ->assertInternalType ( ' array ' , $ matcher ->match ('/foo ' ));
132
+ $ this ->assertIsArray ( $ matcher ->match ('/foo ' ));
130
133
$ matcher = $ this ->getUrlMatcher ($ collection , new RequestContext ('' , 'head ' ));
131
- $ this ->assertInternalType ( ' array ' , $ matcher ->match ('/foo ' ));
134
+ $ this ->assertIsArray ( $ matcher ->match ('/foo ' ));
132
135
}
133
136
134
137
public function testRouteWithOptionalVariableAsFirstSegment ()
0 commit comments