summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Desportes <williamdes@wdes.fr>2019-09-25 00:24:32 +0200
committerWilliam Desportes <williamdes@wdes.fr>2019-09-25 00:24:53 +0200
commit9798cdd11ce18522a8272c260888f03bba581721 (patch)
tree8c51bf7cebb6a95b07d8d6009d291e9e41456e0a
parentc9406f4a0ed1220056748d4924a46e367b7f2db1 (diff)
downloadsql-parser-9798cdd11ce18522a8272c260888f03bba581721.zip
sql-parser-9798cdd11ce18522a8272c260888f03bba581721.tar.gz
sql-parser-9798cdd11ce18522a8272c260888f03bba581721.tar.bz2
Fix deprecated annotations
Ref: #261 Signed-off-by: William Desportes <williamdes@wdes.fr>
-rw-r--r--tests/Components/ComponentTest.php10
-rw-r--r--tests/Lexer/ContextTest.php6
-rw-r--r--tests/Lexer/LexerTest.php8
-rw-r--r--tests/Misc/UtfStringTest.php12
-rw-r--r--tests/Parser/ParserTest.php8
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;