77use Sabberworm \CSS \CSSList \KeyFrame ;
88use Sabberworm \CSS \OutputFormat ;
99use Sabberworm \CSS \Parser ;
10+ use Sabberworm \CSS \Parsing \OutputException ;
11+ use Sabberworm \CSS \Parsing \SourceException ;
1012use Sabberworm \CSS \Parsing \UnexpectedTokenException ;
1113use Sabberworm \CSS \Property \AtRule ;
1214use Sabberworm \CSS \Property \Charset ;
@@ -601,12 +603,12 @@ public function listValueRemoval()
601603 }
602604
603605 /**
604- * @expectedException \Sabberworm\CSS\Parsing\OutputException
605- *
606606 * @test
607607 */
608608 public function selectorRemoval ()
609609 {
610+ $ this ->expectException (OutputException::class);
611+
610612 $ oDoc = self ::parsedStructureForFile ('1readme ' );
611613 $ aBlocks = $ oDoc ->getAllDeclarationBlocks ();
612614 $ oBlock1 = $ aBlocks [0 ];
@@ -805,22 +807,22 @@ public function keyframeSelectors()
805807 }
806808
807809 /**
808- * @expectedException \Sabberworm\CSS\Parsing\UnexpectedTokenException
809- *
810810 * @test
811811 */
812812 public function lineNameFailure ()
813813 {
814+ $ this ->expectException (UnexpectedTokenException::class);
815+
814816 self ::parsedStructureForFile ('-empty-grid-linename ' , Settings::create ()->withLenientParsing (false ));
815817 }
816818
817819 /**
818- * @expectedException \Sabberworm\CSS\Parsing\UnexpectedTokenException
819- *
820820 * @test
821821 */
822822 public function calcFailure ()
823823 {
824+ $ this ->expectException (UnexpectedTokenException::class);
825+
824826 self ::parsedStructureForFile ('-calc-no-space-around-minus ' , Settings::create ()->withLenientParsing (false ));
825827 }
826828
@@ -887,45 +889,46 @@ public function trailingWhitespace()
887889 }
888890
889891 /**
890- * @expectedException \Sabberworm\CSS\Parsing\UnexpectedTokenException
891- *
892892 * @test
893893 */
894894 public function charsetFailure1 ()
895895 {
896+ $ this ->expectException (UnexpectedTokenException::class);
897+
896898 self ::parsedStructureForFile ('-charset-after-rule ' , Settings::create ()->withLenientParsing (false ));
897899 }
898900
899901 /**
900- * @expectedException \Sabberworm\CSS\Parsing\UnexpectedTokenException
901- *
902902 * @test
903903 */
904904 public function charsetFailure2 ()
905905 {
906+ $ this ->expectException (UnexpectedTokenException::class);
907+
906908 self ::parsedStructureForFile ('-charset-in-block ' , Settings::create ()->withLenientParsing (false ));
907909 }
908910
909911 /**
910- * @expectedException \Sabberworm\CSS\Parsing\SourceException
911- *
912912 * @test
913913 */
914914 public function unopenedClosingBracketFailure ()
915915 {
916+ $ this ->expectException (SourceException::class);
917+
916918 self ::parsedStructureForFile ('-unopened-close-brackets ' , Settings::create ()->withLenientParsing (false ));
917919 }
918920
919921 /**
920922 * Ensure that a missing property value raises an exception.
921923 *
922- * @expectedException \Sabberworm\CSS\Parsing\UnexpectedTokenException
923924 * @covers \Sabberworm\CSS\Value\Value::parseValue()
924925 *
925926 * @test
926927 */
927928 public function missingPropertyValueStrict ()
928929 {
930+ $ this ->expectException (UnexpectedTokenException::class);
931+
929932 self ::parsedStructureForFile ('missing-property-value ' , Settings::create ()->withLenientParsing (false ));
930933 }
931934
@@ -1025,12 +1028,12 @@ public function lineNumbersParsing()
10251028 }
10261029
10271030 /**
1028- * @expectedException \Sabberworm\CSS\Parsing\UnexpectedTokenException
1029- *
10301031 * @test
10311032 */
10321033 public function unexpectedTokenExceptionLineNo ()
10331034 {
1035+ $ this ->expectException (UnexpectedTokenException::class);
1036+
10341037 $ oParser = new Parser ("\ntest: 1; " , Settings::create ()->beStrict ());
10351038 try {
10361039 $ oParser ->parse ();
@@ -1041,12 +1044,12 @@ public function unexpectedTokenExceptionLineNo()
10411044 }
10421045
10431046 /**
1044- * @expectedException \Sabberworm\CSS\Parsing\UnexpectedTokenException
1045- *
10461047 * @test
10471048 */
10481049 public function ieHacksStrictParsing ()
10491050 {
1051+ $ this ->expectException (UnexpectedTokenException::class);
1052+
10501053 // We can't strictly parse IE hacks.
10511054 self ::parsedStructureForFile ('ie-hacks ' , Settings::create ()->beStrict ());
10521055 }
@@ -1138,12 +1141,12 @@ public function topLevelCommentExtracting()
11381141 }
11391142
11401143 /**
1141- * @expectedException \Sabberworm\CSS\Parsing\UnexpectedTokenException
1142- *
11431144 * @test
11441145 */
11451146 public function microsoftFilterStrictParsing ()
11461147 {
1148+ $ this ->expectException (UnexpectedTokenException::class);
1149+
11471150 $ oDoc = self ::parsedStructureForFile ('ms-filter ' , Settings::create ()->beStrict ());
11481151 }
11491152
0 commit comments