Skip to content

Commit 6e274d2

Browse files
committed
Do not use deprecated annotations
1 parent 6b5a2be commit 6e274d2

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

tests/lib/FieldListTest.php

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,9 @@
1111
class FieldListTest extends TestCase
1212
{
1313

14-
/**
15-
* @expectedException InvalidArgumentException
16-
*/
1714
public function testGetException()
1815
{
16+
$this->expectException(InvalidArgumentException::class);
1917
$field = new FieldList();
2018
$field->get('sdfkjskljdf');
2119
}
@@ -27,32 +25,26 @@ public function testGet()
2725
$this->assertEquals(null, $field->get(1), 'Null returned for the empty index.');
2826
}
2927

30-
/**
31-
* @expectedException InvalidArgumentException
32-
* @expectedExceptionMessage Unable to set a value with a non-numeric delta in a list.
33-
*/
3428
public function testSetIndexException()
3529
{
30+
$this->expectException(InvalidArgumentException::class);
31+
$this->expectExceptionMessage('Unable to set a value with a non-numeric delta in a list.');
3632
$field = new FieldList();
3733
$field->set('bad_index', 'something');
3834
}
3935

40-
/**
41-
* @expectedException InvalidArgumentException
42-
* @expectedExceptionMessage Properties must be an array.
43-
*/
4436
public function testSetBadPropertiesException()
4537
{
38+
$this->expectException(InvalidArgumentException::class);
39+
$this->expectExceptionMessage('Properties must be an array.');
4640
$field = new FieldList();
4741
$field->set(0, 'something');
4842
}
4943

50-
/**
51-
* @expectedException InvalidArgumentException
52-
* @expectedExceptionMessage Unable to set a value of a property with a non string name.
53-
*/
54-
public function testSetBadPropertyNmaeException()
44+
public function testSetBadPropertyNameException()
5545
{
46+
$this->expectException(InvalidArgumentException::class);
47+
$this->expectExceptionMessage('Unable to set a value of a property with a non string name.');
5648
$field = new FieldList();
5749
$field->set(0, ['value']);
5850
}

0 commit comments

Comments
 (0)