Skip to content

Commit 7e2a9e9

Browse files
committed
Use ::class keyword when possible
1 parent a497e36 commit 7e2a9e9

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Tests/GenericEventTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function testGetArgument()
8080

8181
public function testGetArgException()
8282
{
83-
$this->expectException('\InvalidArgumentException');
83+
$this->expectException(\InvalidArgumentException::class);
8484
$this->event->getArgument('nameNotExist');
8585
}
8686

@@ -90,7 +90,7 @@ public function testOffsetGet()
9090
$this->assertEquals('Event', $this->event['name']);
9191

9292
// test getting invalid arg
93-
$this->expectException('InvalidArgumentException');
93+
$this->expectException(\InvalidArgumentException::class);
9494
$this->assertFalse($this->event['nameNotExist']);
9595
}
9696

Tests/ImmutableEventDispatcherTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,27 +72,27 @@ public function testHasListenersDelegates()
7272

7373
public function testAddListenerDisallowed()
7474
{
75-
$this->expectException('\BadMethodCallException');
75+
$this->expectException(\BadMethodCallException::class);
7676
$this->dispatcher->addListener('event', function () { return 'foo'; });
7777
}
7878

7979
public function testAddSubscriberDisallowed()
8080
{
81-
$this->expectException('\BadMethodCallException');
81+
$this->expectException(\BadMethodCallException::class);
8282
$subscriber = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventSubscriberInterface')->getMock();
8383

8484
$this->dispatcher->addSubscriber($subscriber);
8585
}
8686

8787
public function testRemoveListenerDisallowed()
8888
{
89-
$this->expectException('\BadMethodCallException');
89+
$this->expectException(\BadMethodCallException::class);
9090
$this->dispatcher->removeListener('event', function () { return 'foo'; });
9191
}
9292

9393
public function testRemoveSubscriberDisallowed()
9494
{
95-
$this->expectException('\BadMethodCallException');
95+
$this->expectException(\BadMethodCallException::class);
9696
$subscriber = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventSubscriberInterface')->getMock();
9797

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

0 commit comments

Comments
 (0)