File tree Expand file tree Collapse file tree 5 files changed +16
-28
lines changed
Expand file tree Collapse file tree 5 files changed +16
-28
lines changed Original file line number Diff line number Diff line change 1111class 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}
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments