Skip to content

Commit 5de00ac

Browse files
committed
Merge branch '5.1' into 5.2
* 5.1: Use ::class keyword when possible
2 parents d36c3c2 + fddf623 commit 5de00ac

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

Tests/DefinitionTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function testSetInitialPlaces()
3636

3737
public function testSetInitialPlaceAndPlaceIsNotDefined()
3838
{
39-
$this->expectException('Symfony\Component\Workflow\Exception\LogicException');
39+
$this->expectException(\Symfony\Component\Workflow\Exception\LogicException::class);
4040
$this->expectExceptionMessage('Place "d" cannot be the initial place as it does not exist.');
4141
new Definition([], [], 'd');
4242
}
@@ -54,7 +54,7 @@ public function testAddTransition()
5454

5555
public function testAddTransitionAndFromPlaceIsNotDefined()
5656
{
57-
$this->expectException('Symfony\Component\Workflow\Exception\LogicException');
57+
$this->expectException(\Symfony\Component\Workflow\Exception\LogicException::class);
5858
$this->expectExceptionMessage('Place "c" referenced in transition "name" does not exist.');
5959
$places = range('a', 'b');
6060

@@ -63,7 +63,7 @@ public function testAddTransitionAndFromPlaceIsNotDefined()
6363

6464
public function testAddTransitionAndToPlaceIsNotDefined()
6565
{
66-
$this->expectException('Symfony\Component\Workflow\Exception\LogicException');
66+
$this->expectException(\Symfony\Component\Workflow\Exception\LogicException::class);
6767
$this->expectExceptionMessage('Place "c" referenced in transition "name" does not exist.');
6868
$places = range('a', 'b');
6969

Tests/RegistryTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function testGetWithSuccess()
5555

5656
public function testGetWithMultipleMatch()
5757
{
58-
$this->expectException('Symfony\Component\Workflow\Exception\InvalidArgumentException');
58+
$this->expectException(\Symfony\Component\Workflow\Exception\InvalidArgumentException::class);
5959
$this->expectExceptionMessage('Too many workflows (workflow2, workflow3) match this subject (Symfony\Component\Workflow\Tests\Subject2); set a different name on each and use the second (name) argument of this method.');
6060
$w1 = $this->registry->get(new Subject2());
6161
$this->assertInstanceOf(Workflow::class, $w1);
@@ -64,7 +64,7 @@ public function testGetWithMultipleMatch()
6464

6565
public function testGetWithNoMatch()
6666
{
67-
$this->expectException('Symfony\Component\Workflow\Exception\InvalidArgumentException');
67+
$this->expectException(\Symfony\Component\Workflow\Exception\InvalidArgumentException::class);
6868
$this->expectExceptionMessage('Unable to find a workflow for class "stdClass".');
6969
$w1 = $this->registry->get(new \stdClass());
7070
$this->assertInstanceOf(Workflow::class, $w1);

Tests/Validator/StateMachineValidatorTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class StateMachineValidatorTest extends TestCase
1111
{
1212
public function testWithMultipleTransitionWithSameNameShareInput()
1313
{
14-
$this->expectException('Symfony\Component\Workflow\Exception\InvalidDefinitionException');
14+
$this->expectException(\Symfony\Component\Workflow\Exception\InvalidDefinitionException::class);
1515
$this->expectExceptionMessage('A transition from a place/state must have an unique name.');
1616
$places = ['a', 'b', 'c'];
1717
$transitions[] = new Transition('t1', 'a', 'b');
@@ -35,7 +35,7 @@ public function testWithMultipleTransitionWithSameNameShareInput()
3535

3636
public function testWithMultipleTos()
3737
{
38-
$this->expectException('Symfony\Component\Workflow\Exception\InvalidDefinitionException');
38+
$this->expectException(\Symfony\Component\Workflow\Exception\InvalidDefinitionException::class);
3939
$this->expectExceptionMessage('A transition in StateMachine can only have one output.');
4040
$places = ['a', 'b', 'c'];
4141
$transitions[] = new Transition('t1', 'a', ['b', 'c']);
@@ -58,7 +58,7 @@ public function testWithMultipleTos()
5858

5959
public function testWithMultipleFroms()
6060
{
61-
$this->expectException('Symfony\Component\Workflow\Exception\InvalidDefinitionException');
61+
$this->expectException(\Symfony\Component\Workflow\Exception\InvalidDefinitionException::class);
6262
$this->expectExceptionMessage('A transition in StateMachine can only have one input.');
6363
$places = ['a', 'b', 'c'];
6464
$transitions[] = new Transition('t1', ['a', 'b'], 'c');
@@ -106,7 +106,7 @@ public function testValid()
106106

107107
public function testWithTooManyInitialPlaces()
108108
{
109-
$this->expectException('Symfony\Component\Workflow\Exception\InvalidDefinitionException');
109+
$this->expectException(\Symfony\Component\Workflow\Exception\InvalidDefinitionException::class);
110110
$this->expectExceptionMessage('The state machine "foo" can not store many places. But the definition has 2 initial places. Only one is supported.');
111111
$places = range('a', 'c');
112112
$transitions = [];

0 commit comments

Comments
 (0)