Skip to content

Commit fff789d

Browse files
committed
Merge branch '4.4' into 5.1
* 4.4: Use ::class keyword when possible
2 parents 3567c90 + e190184 commit fff789d

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Tests/DependencyInjection/RegisterListenersPassTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class RegisterListenersPassTest extends TestCase
2828
*/
2929
public function testEventSubscriberWithoutInterface()
3030
{
31-
$this->expectException('InvalidArgumentException');
31+
$this->expectException(\InvalidArgumentException::class);
3232
$builder = new ContainerBuilder();
3333
$builder->register('event_dispatcher');
3434
$builder->register('my_event_subscriber', 'stdClass')
@@ -98,7 +98,7 @@ public function testAliasedEventSubscriber()
9898

9999
public function testAbstractEventListener()
100100
{
101-
$this->expectException('InvalidArgumentException');
101+
$this->expectException(\InvalidArgumentException::class);
102102
$this->expectExceptionMessage('The service "foo" tagged "kernel.event_listener" must not be abstract.');
103103
$container = new ContainerBuilder();
104104
$container->register('foo', 'stdClass')->setAbstract(true)->addTag('kernel.event_listener', []);
@@ -110,7 +110,7 @@ public function testAbstractEventListener()
110110

111111
public function testAbstractEventSubscriber()
112112
{
113-
$this->expectException('InvalidArgumentException');
113+
$this->expectException(\InvalidArgumentException::class);
114114
$this->expectExceptionMessage('The service "foo" tagged "kernel.event_subscriber" must not be abstract.');
115115
$container = new ContainerBuilder();
116116
$container->register('foo', 'stdClass')->setAbstract(true)->addTag('kernel.event_subscriber', []);
@@ -180,7 +180,7 @@ public function testNoPreloadEvents()
180180

181181
public function testEventSubscriberUnresolvableClassName()
182182
{
183-
$this->expectException('InvalidArgumentException');
183+
$this->expectException(\InvalidArgumentException::class);
184184
$this->expectExceptionMessage('You have requested a non-existent parameter "subscriber.class"');
185185
$container = new ContainerBuilder();
186186
$container->register('foo', '%subscriber.class%')->addTag('kernel.event_subscriber', []);

Tests/ImmutableEventDispatcherTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class ImmutableEventDispatcherTest extends TestCase
3333

3434
protected function setUp(): void
3535
{
36-
$this->innerDispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcherInterface')->getMock();
36+
$this->innerDispatcher = $this->getMockBuilder(\Symfony\Component\EventDispatcher\EventDispatcherInterface::class)->getMock();
3737
$this->dispatcher = new ImmutableEventDispatcher($this->innerDispatcher);
3838
}
3939

@@ -79,7 +79,7 @@ public function testAddListenerDisallowed()
7979
public function testAddSubscriberDisallowed()
8080
{
8181
$this->expectException(\BadMethodCallException::class);
82-
$subscriber = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventSubscriberInterface')->getMock();
82+
$subscriber = $this->getMockBuilder(\Symfony\Component\EventDispatcher\EventSubscriberInterface::class)->getMock();
8383

8484
$this->dispatcher->addSubscriber($subscriber);
8585
}
@@ -93,7 +93,7 @@ public function testRemoveListenerDisallowed()
9393
public function testRemoveSubscriberDisallowed()
9494
{
9595
$this->expectException(\BadMethodCallException::class);
96-
$subscriber = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventSubscriberInterface')->getMock();
96+
$subscriber = $this->getMockBuilder(\Symfony\Component\EventDispatcher\EventSubscriberInterface::class)->getMock();
9797

9898
$this->dispatcher->removeSubscriber($subscriber);
9999
}

0 commit comments

Comments
 (0)