Skip to content

Commit c204535

Browse files
committed
Fix assertInternalType deprecation in phpunit 9
1 parent e67beb1 commit c204535

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Tests/Matcher/UrlMatcherTest.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\Routing\Tests\Matcher;
1313

1414
use PHPUnit\Framework\TestCase;
15+
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
1516
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
1617
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
1718
use Symfony\Component\Routing\Matcher\UrlMatcher;
@@ -21,13 +22,15 @@
2122

2223
class UrlMatcherTest extends TestCase
2324
{
25+
use ForwardCompatTestTrait;
26+
2427
public function testNoMethodSoAllowed()
2528
{
2629
$coll = new RouteCollection();
2730
$coll->add('foo', new Route('/foo'));
2831

2932
$matcher = $this->getUrlMatcher($coll);
30-
$this->assertInternalType('array', $matcher->match('/foo'));
33+
$this->assertIsArray($matcher->match('/foo'));
3134
}
3235

3336
public function testMethodNotAllowed()
@@ -66,7 +69,7 @@ public function testHeadAllowedWhenRequirementContainsGet()
6669
$coll->add('foo', new Route('/foo', [], [], [], '', [], ['get']));
6770

6871
$matcher = $this->getUrlMatcher($coll, new RequestContext('', 'head'));
69-
$this->assertInternalType('array', $matcher->match('/foo'));
72+
$this->assertIsArray($matcher->match('/foo'));
7073
}
7174

7275
public function testMethodNotAllowedAggregatesAllowedMethods()
@@ -108,7 +111,7 @@ public function testMatch()
108111
$collection = new RouteCollection();
109112
$collection->add('foo', new Route('/foo', [], [], [], '', [], ['get', 'head']));
110113
$matcher = $this->getUrlMatcher($collection);
111-
$this->assertInternalType('array', $matcher->match('/foo'));
114+
$this->assertIsArray($matcher->match('/foo'));
112115

113116
// route does not match with POST method context
114117
$matcher = $this->getUrlMatcher($collection, new RequestContext('', 'post'));
@@ -120,9 +123,9 @@ public function testMatch()
120123

121124
// route does match with GET or HEAD method context
122125
$matcher = $this->getUrlMatcher($collection);
123-
$this->assertInternalType('array', $matcher->match('/foo'));
126+
$this->assertIsArray($matcher->match('/foo'));
124127
$matcher = $this->getUrlMatcher($collection, new RequestContext('', 'head'));
125-
$this->assertInternalType('array', $matcher->match('/foo'));
128+
$this->assertIsArray($matcher->match('/foo'));
126129

127130
// route with an optional variable as the first segment
128131
$collection = new RouteCollection();

0 commit comments

Comments
 (0)