Skip to content

Commit 3fdeae3

Browse files
committed
minor #39775 [WIP] Use ::class keyword when possible (fabpot)
This PR was merged into the 4.4 branch. Discussion ---------- [WIP] Use ::class keyword when possible | Q | A | ------------- | --- | Branch? | 4.4 <!-- see below --> | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | n/a <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT | Doc PR | n/a Commits ------- 036a36cb14 Use ::class keyword when possible
2 parents ac6b405 + 7e2a9e9 commit 3fdeae3

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)