Skip to content

Commit b65e0bb

Browse files
committed
Merge branch '4.4' into 5.1
* 4.4: Use ::class keyword when possible
2 parents d0adf78 + 8076be7 commit b65e0bb

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

Tests/PropertyAccessorArrayAccessTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function testGetValue($collection, $path, $value)
4747

4848
public function testGetValueFailsIfNoSuchIndex()
4949
{
50-
$this->expectException('Symfony\Component\PropertyAccess\Exception\NoSuchIndexException');
50+
$this->expectException(\Symfony\Component\PropertyAccess\Exception\NoSuchIndexException::class);
5151
$this->propertyAccessor = PropertyAccess::createPropertyAccessorBuilder()
5252
->enableExceptionOnInvalidIndex()
5353
->getPropertyAccessor();

Tests/PropertyPathBuilderTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,13 @@ public function testReplaceByIndexWithoutName()
118118

119119
public function testReplaceByIndexDoesNotAllowInvalidOffsets()
120120
{
121-
$this->expectException('OutOfBoundsException');
121+
$this->expectException(\OutOfBoundsException::class);
122122
$this->builder->replaceByIndex(6, 'new1');
123123
}
124124

125125
public function testReplaceByIndexDoesNotAllowNegativeOffsets()
126126
{
127-
$this->expectException('OutOfBoundsException');
127+
$this->expectException(\OutOfBoundsException::class);
128128
$this->builder->replaceByIndex(-1, 'new1');
129129
}
130130

@@ -148,13 +148,13 @@ public function testReplaceByPropertyWithoutName()
148148

149149
public function testReplaceByPropertyDoesNotAllowInvalidOffsets()
150150
{
151-
$this->expectException('OutOfBoundsException');
151+
$this->expectException(\OutOfBoundsException::class);
152152
$this->builder->replaceByProperty(6, 'new1');
153153
}
154154

155155
public function testReplaceByPropertyDoesNotAllowNegativeOffsets()
156156
{
157-
$this->expectException('OutOfBoundsException');
157+
$this->expectException(\OutOfBoundsException::class);
158158
$this->builder->replaceByProperty(-1, 'new1');
159159
}
160160

@@ -190,7 +190,7 @@ public function testReplaceNegative()
190190
*/
191191
public function testReplaceDoesNotAllowInvalidOffsets($offset)
192192
{
193-
$this->expectException('OutOfBoundsException');
193+
$this->expectException(\OutOfBoundsException::class);
194194
$this->builder->replace($offset, 1, new PropertyPath('new1[new2].new3'));
195195
}
196196

@@ -264,13 +264,13 @@ public function testRemove()
264264

265265
public function testRemoveDoesNotAllowInvalidOffsets()
266266
{
267-
$this->expectException('OutOfBoundsException');
267+
$this->expectException(\OutOfBoundsException::class);
268268
$this->builder->remove(6);
269269
}
270270

271271
public function testRemoveDoesNotAllowNegativeOffsets()
272272
{
273-
$this->expectException('OutOfBoundsException');
273+
$this->expectException(\OutOfBoundsException::class);
274274
$this->builder->remove(-1);
275275
}
276276

Tests/PropertyPathTest.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ public function testToString()
2525

2626
public function testDotIsRequiredBeforeProperty()
2727
{
28-
$this->expectException('Symfony\Component\PropertyAccess\Exception\InvalidPropertyPathException');
28+
$this->expectException(\Symfony\Component\PropertyAccess\Exception\InvalidPropertyPathException::class);
2929
new PropertyPath('[index]property');
3030
}
3131

3232
public function testDotCannotBePresentAtTheBeginning()
3333
{
34-
$this->expectException('Symfony\Component\PropertyAccess\Exception\InvalidPropertyPathException');
34+
$this->expectException(\Symfony\Component\PropertyAccess\Exception\InvalidPropertyPathException::class);
3535
new PropertyPath('.property');
3636
}
3737

@@ -53,25 +53,25 @@ public function providePathsContainingUnexpectedCharacters()
5353
*/
5454
public function testUnexpectedCharacters($path)
5555
{
56-
$this->expectException('Symfony\Component\PropertyAccess\Exception\InvalidPropertyPathException');
56+
$this->expectException(\Symfony\Component\PropertyAccess\Exception\InvalidPropertyPathException::class);
5757
new PropertyPath($path);
5858
}
5959

6060
public function testPathCannotBeEmpty()
6161
{
62-
$this->expectException('Symfony\Component\PropertyAccess\Exception\InvalidPropertyPathException');
62+
$this->expectException(\Symfony\Component\PropertyAccess\Exception\InvalidPropertyPathException::class);
6363
new PropertyPath('');
6464
}
6565

6666
public function testPathCannotBeNull()
6767
{
68-
$this->expectException('Symfony\Component\PropertyAccess\Exception\InvalidArgumentException');
68+
$this->expectException(\Symfony\Component\PropertyAccess\Exception\InvalidArgumentException::class);
6969
new PropertyPath(null);
7070
}
7171

7272
public function testPathCannotBeFalse()
7373
{
74-
$this->expectException('Symfony\Component\PropertyAccess\Exception\InvalidArgumentException');
74+
$this->expectException(\Symfony\Component\PropertyAccess\Exception\InvalidArgumentException::class);
7575
new PropertyPath(false);
7676
}
7777

@@ -120,15 +120,15 @@ public function testGetElement()
120120

121121
public function testGetElementDoesNotAcceptInvalidIndices()
122122
{
123-
$this->expectException('OutOfBoundsException');
123+
$this->expectException(\OutOfBoundsException::class);
124124
$propertyPath = new PropertyPath('grandpa.parent[child]');
125125

126126
$propertyPath->getElement(3);
127127
}
128128

129129
public function testGetElementDoesNotAcceptNegativeIndices()
130130
{
131-
$this->expectException('OutOfBoundsException');
131+
$this->expectException(\OutOfBoundsException::class);
132132
$propertyPath = new PropertyPath('grandpa.parent[child]');
133133

134134
$propertyPath->getElement(-1);
@@ -144,15 +144,15 @@ public function testIsProperty()
144144

145145
public function testIsPropertyDoesNotAcceptInvalidIndices()
146146
{
147-
$this->expectException('OutOfBoundsException');
147+
$this->expectException(\OutOfBoundsException::class);
148148
$propertyPath = new PropertyPath('grandpa.parent[child]');
149149

150150
$propertyPath->isProperty(3);
151151
}
152152

153153
public function testIsPropertyDoesNotAcceptNegativeIndices()
154154
{
155-
$this->expectException('OutOfBoundsException');
155+
$this->expectException(\OutOfBoundsException::class);
156156
$propertyPath = new PropertyPath('grandpa.parent[child]');
157157

158158
$propertyPath->isProperty(-1);
@@ -168,15 +168,15 @@ public function testIsIndex()
168168

169169
public function testIsIndexDoesNotAcceptInvalidIndices()
170170
{
171-
$this->expectException('OutOfBoundsException');
171+
$this->expectException(\OutOfBoundsException::class);
172172
$propertyPath = new PropertyPath('grandpa.parent[child]');
173173

174174
$propertyPath->isIndex(3);
175175
}
176176

177177
public function testIsIndexDoesNotAcceptNegativeIndices()
178178
{
179-
$this->expectException('OutOfBoundsException');
179+
$this->expectException(\OutOfBoundsException::class);
180180
$propertyPath = new PropertyPath('grandpa.parent[child]');
181181

182182
$propertyPath->isIndex(-1);

0 commit comments

Comments
 (0)