Skip to content

Commit 1bcd5b4

Browse files
committed
Merge branch '5.1' into 5.2
* 5.1: Use ::class keyword when possible
2 parents bb3205d + ed2b759 commit 1bcd5b4

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Tests/RouteCollectionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function testIterator()
6666
$collection->addCollection($collection1);
6767
$collection->add('last', $last = new Route('/last'));
6868

69-
$this->assertInstanceOf('\ArrayIterator', $collection->getIterator());
69+
$this->assertInstanceOf(\ArrayIterator::class, $collection->getIterator());
7070
$this->assertSame(['bar' => $bar, 'foo' => $foo, 'last' => $last], $collection->getIterator()->getArrayCopy());
7171
}
7272

Tests/RouteTest.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
use PHPUnit\Framework\TestCase;
1515
use Symfony\Component\Routing\Route;
16+
use Symfony\Component\Routing\Tests\Fixtures\CustomCompiledRoute;
17+
use Symfony\Component\Routing\Tests\Fixtures\CustomRouteCompiler;
1618

1719
class RouteTest extends TestCase
1820
{
@@ -266,13 +268,13 @@ public function testSerializeWhenCompiled()
266268
*/
267269
public function testSerializeWhenCompiledWithClass()
268270
{
269-
$route = new Route('/', [], [], ['compiler_class' => '\Symfony\Component\Routing\Tests\Fixtures\CustomRouteCompiler']);
270-
$this->assertInstanceOf('\Symfony\Component\Routing\Tests\Fixtures\CustomCompiledRoute', $route->compile(), '->compile() returned a proper route');
271+
$route = new Route('/', [], [], ['compiler_class' => CustomRouteCompiler::class]);
272+
$this->assertInstanceOf(CustomCompiledRoute::class, $route->compile(), '->compile() returned a proper route');
271273

272274
$serialized = serialize($route);
273275
try {
274276
$unserialized = unserialize($serialized);
275-
$this->assertInstanceOf('\Symfony\Component\Routing\Tests\Fixtures\CustomCompiledRoute', $unserialized->compile(), 'the unserialized route compiled successfully');
277+
$this->assertInstanceOf(CustomCompiledRoute::class, $unserialized->compile(), 'the unserialized route compiled successfully');
276278
} catch (\Exception $e) {
277279
$this->fail('unserializing a route which uses a custom compiled route class');
278280
}

0 commit comments

Comments
 (0)