Skip to content

Commit 77c6e17

Browse files
committed
Use ::class keyword when possible
1 parent b2c5e25 commit 77c6e17

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Tests/Fragment/FragmentHandlerTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class FragmentHandlerTest extends TestCase
2626

2727
protected function setUp(): void
2828
{
29-
$this->requestStack = $this->getMockBuilder('Symfony\\Component\\HttpFoundation\\RequestStack')
29+
$this->requestStack = $this->getMockBuilder(\Symfony\Component\HttpFoundation\RequestStack::class)
3030
->disableOriginalConstructor()
3131
->getMock()
3232
;
@@ -39,14 +39,14 @@ protected function setUp(): void
3939

4040
public function testRenderWhenRendererDoesNotExist()
4141
{
42-
$this->expectException('InvalidArgumentException');
42+
$this->expectException(\InvalidArgumentException::class);
4343
$handler = new FragmentHandler($this->requestStack);
4444
$handler->render('/', 'foo');
4545
}
4646

4747
public function testRenderWithUnknownRenderer()
4848
{
49-
$this->expectException('InvalidArgumentException');
49+
$this->expectException(\InvalidArgumentException::class);
5050
$handler = $this->getHandler($this->returnValue(new Response('foo')));
5151

5252
$handler->render('/', 'bar');
@@ -59,7 +59,7 @@ public function testDeliverWithUnsuccessfulResponse()
5959
$handler->render('/', 'foo');
6060
$this->fail('->render() throws a \RuntimeException exception if response is not successful');
6161
} catch (\Exception $e) {
62-
$this->assertInstanceOf('\RuntimeException', $e);
62+
$this->assertInstanceOf(\RuntimeException::class, $e);
6363
$this->assertEquals(0, $e->getCode());
6464
$this->assertEquals('Error when rendering "http://localhost/" (Status code is 404).', $e->getMessage());
6565

@@ -79,7 +79,7 @@ public function testRender()
7979

8080
protected function getHandler($returnValue, $arguments = [])
8181
{
82-
$renderer = $this->getMockBuilder('Symfony\Component\HttpKernel\Fragment\FragmentRendererInterface')->getMock();
82+
$renderer = $this->getMockBuilder(\Symfony\Component\HttpKernel\Fragment\FragmentRendererInterface::class)->getMock();
8383
$renderer
8484
->expects($this->any())
8585
->method('getName')

0 commit comments

Comments
 (0)