Skip to content

Commit 9798cdd

Browse files
committed
Fix deprecated annotations
Ref: #261 Signed-off-by: William Desportes <williamdes@wdes.fr>
1 parent c9406f4 commit 9798cdd

File tree

5 files changed

+16
-28
lines changed

5 files changed

+16
-28
lines changed

tests/Components/ComponentTest.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,20 @@
1111
class ComponentTest extends TestCase
1212
{
1313
/**
14-
* @expectedException \Exception
15-
* @expectedExceptionMessage Not implemented yet.
1614
* @runInSeparateProcess
1715
* @preserveGlobalState disabled
1816
*/
1917
public function testParse()
2018
{
19+
$this->expectExceptionMessage('Not implemented yet.');
20+
$this->expectException(\Exception::class);
2121
Component::parse(new Parser(), new TokensList());
2222
}
2323

24-
/**
25-
* @expectedException \Exception
26-
* @expectedExceptionMessage Not implemented yet.
27-
*/
2824
public function testBuild()
2925
{
26+
$this->expectExceptionMessage('Not implemented yet.');
27+
$this->expectException(\Exception::class);
3028
Component::build(null);
3129
}
3230
}

tests/Lexer/ContextTest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,10 @@ public function contextNames()
103103
];
104104
}
105105

106-
/**
107-
* @expectedException \Exception
108-
* @expectedExceptionMessage Specified context ("\PhpMyAdmin\SqlParser\Contexts\ContextFoo") does not exist.
109-
*/
110106
public function testLoadError()
111107
{
108+
$this->expectExceptionMessage('Specified context ("\PhpMyAdmin\SqlParser\Contexts\ContextFoo") does not exist.');
109+
$this->expectException(\Exception::class);
112110
Context::load('Foo');
113111
}
114112

tests/Lexer/LexerTest.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,11 @@ public function testError()
3434
);
3535
}
3636

37-
/**
38-
* @expectedException \PhpMyAdmin\SqlParser\Exceptions\LexerException
39-
* @expectedExceptionMessage strict error
40-
* @expectedExceptionCode 4
41-
*/
4237
public function testErrorStrict()
4338
{
39+
$this->expectExceptionCode(4);
40+
$this->expectExceptionMessage('strict error');
41+
$this->expectException(LexerException::class);
4442
$lexer = new Lexer('');
4543
$lexer->strict = true;
4644

tests/Misc/UtfStringTest.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,18 @@ public function testArrayAccess()
3737
$this->assertNull($str[static::TEST_PHRASE_LEN]);
3838
}
3939

40-
/**
41-
* @expectedException \Exception
42-
* @expectedExceptionMessage Not implemented.
43-
*/
4440
public function testSet()
4541
{
42+
$this->expectExceptionMessage('Not implemented.');
43+
$this->expectException(\Exception::class);
4644
$str = new UtfString('');
4745
$str[0] = 'a';
4846
}
4947

50-
/**
51-
* @expectedException \Exception
52-
* @expectedExceptionMessage Not implemented.
53-
*/
5448
public function testUnset()
5549
{
50+
$this->expectExceptionMessage('Not implemented.');
51+
$this->expectException(\Exception::class);
5652
$str = new UtfString('');
5753
unset($str[0]);
5854
}

tests/Parser/ParserTest.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,11 @@ public function testError()
6868
);
6969
}
7070

71-
/**
72-
* @expectedException \PhpMyAdmin\SqlParser\Exceptions\ParserException
73-
* @expectedExceptionMessage strict error
74-
* @expectedExceptionCode 3
75-
*/
7671
public function testErrorStrict()
7772
{
73+
$this->expectExceptionCode(3);
74+
$this->expectExceptionMessage('strict error');
75+
$this->expectException(ParserException::class);
7876
$parser = new Parser(new TokensList());
7977
$parser->strict = true;
8078

0 commit comments

Comments
 (0)