diff options
-rw-r--r-- | tests/Components/ComponentTest.php | 10 | ||||
-rw-r--r-- | tests/Lexer/ContextTest.php | 6 | ||||
-rw-r--r-- | tests/Lexer/LexerTest.php | 8 | ||||
-rw-r--r-- | tests/Misc/UtfStringTest.php | 12 | ||||
-rw-r--r-- | tests/Parser/ParserTest.php | 8 |
5 files changed, 16 insertions, 28 deletions
diff --git a/tests/Components/ComponentTest.php b/tests/Components/ComponentTest.php index 2595202..ce7c68f 100644 --- a/tests/Components/ComponentTest.php +++ b/tests/Components/ComponentTest.php @@ -11,22 +11,20 @@ use PhpMyAdmin\SqlParser\TokensList; class ComponentTest extends TestCase { /** - * @expectedException \Exception - * @expectedExceptionMessage Not implemented yet. * @runInSeparateProcess * @preserveGlobalState disabled */ public function testParse() { + $this->expectExceptionMessage('Not implemented yet.'); + $this->expectException(\Exception::class); Component::parse(new Parser(), new TokensList()); } - /** - * @expectedException \Exception - * @expectedExceptionMessage Not implemented yet. - */ public function testBuild() { + $this->expectExceptionMessage('Not implemented yet.'); + $this->expectException(\Exception::class); Component::build(null); } } diff --git a/tests/Lexer/ContextTest.php b/tests/Lexer/ContextTest.php index 47bd10a..83207c3 100644 --- a/tests/Lexer/ContextTest.php +++ b/tests/Lexer/ContextTest.php @@ -103,12 +103,10 @@ class ContextTest extends TestCase ]; } - /** - * @expectedException \Exception - * @expectedExceptionMessage Specified context ("\PhpMyAdmin\SqlParser\Contexts\ContextFoo") does not exist. - */ public function testLoadError() { + $this->expectExceptionMessage('Specified context ("\PhpMyAdmin\SqlParser\Contexts\ContextFoo") does not exist.'); + $this->expectException(\Exception::class); Context::load('Foo'); } diff --git a/tests/Lexer/LexerTest.php b/tests/Lexer/LexerTest.php index aff2bc8..fb7a219 100644 --- a/tests/Lexer/LexerTest.php +++ b/tests/Lexer/LexerTest.php @@ -34,13 +34,11 @@ class LexerTest extends TestCase ); } - /** - * @expectedException \PhpMyAdmin\SqlParser\Exceptions\LexerException - * @expectedExceptionMessage strict error - * @expectedExceptionCode 4 - */ public function testErrorStrict() { + $this->expectExceptionCode(4); + $this->expectExceptionMessage('strict error'); + $this->expectException(LexerException::class); $lexer = new Lexer(''); $lexer->strict = true; diff --git a/tests/Misc/UtfStringTest.php b/tests/Misc/UtfStringTest.php index d2c4dbf..c83339a 100644 --- a/tests/Misc/UtfStringTest.php +++ b/tests/Misc/UtfStringTest.php @@ -37,22 +37,18 @@ class UtfStringTest extends TestCase $this->assertNull($str[static::TEST_PHRASE_LEN]); } - /** - * @expectedException \Exception - * @expectedExceptionMessage Not implemented. - */ public function testSet() { + $this->expectExceptionMessage('Not implemented.'); + $this->expectException(\Exception::class); $str = new UtfString(''); $str[0] = 'a'; } - /** - * @expectedException \Exception - * @expectedExceptionMessage Not implemented. - */ public function testUnset() { + $this->expectExceptionMessage('Not implemented.'); + $this->expectException(\Exception::class); $str = new UtfString(''); unset($str[0]); } diff --git a/tests/Parser/ParserTest.php b/tests/Parser/ParserTest.php index 82afc18..d88c861 100644 --- a/tests/Parser/ParserTest.php +++ b/tests/Parser/ParserTest.php @@ -68,13 +68,11 @@ class ParserTest extends TestCase ); } - /** - * @expectedException \PhpMyAdmin\SqlParser\Exceptions\ParserException - * @expectedExceptionMessage strict error - * @expectedExceptionCode 3 - */ public function testErrorStrict() { + $this->expectExceptionCode(3); + $this->expectExceptionMessage('strict error'); + $this->expectException(ParserException::class); $parser = new Parser(new TokensList()); $parser->strict = true; |