@@ -757,92 +757,73 @@ public function getTestsForOctalNumbers()
757757 }
758758
759759 /**
760- * @group legacy
761760 * @dataProvider getTestsForOctalNumbersYaml11Notation
762761 */
763- public function testParseOctalNumbersYaml11Notation (int $ expected , string $ yaml )
762+ public function testParseOctalNumbersYaml11Notation (string $ expected , string $ yaml )
764763 {
765- $ this ->expectDeprecation ('Since symfony/yaml 5.1: Support for parsing numbers prefixed with 0 as octal numbers. They will be parsed as strings as of 6.0. ' );
766-
767764 self ::assertSame ($ expected , Inline::parse ($ yaml ));
768765 }
769766
770767 public function getTestsForOctalNumbersYaml11Notation ()
771768 {
772769 return [
773- 'positive octal number ' => [28 , '034 ' ],
774- 'positive octal number with separator ' => [1243 , '0_2_3_3_3 ' ],
775- 'negative octal number ' => [-28 , '-034 ' ],
770+ 'positive octal number ' => ['034 ' , '034 ' ],
771+ 'positive octal number with separator ' => ['02333 ' , '0_2_3_3_3 ' ],
772+ 'negative octal number ' => ['-034 ' , '-034 ' ],
773+ 'invalid positive octal number ' => ['0123456789 ' , '0123456789 ' ],
774+ 'invalid negative octal number ' => ['-0123456789 ' , '-0123456789 ' ],
776775 ];
777776 }
778777
779778 /**
780779 * @dataProvider phpObjectTagWithEmptyValueProvider
781- *
782- * @group legacy
783780 */
784- public function testPhpObjectWithEmptyValue ($ expected , $ value )
781+ public function testPhpObjectWithEmptyValue (string $ value )
785782 {
786- $ this ->expectDeprecation ('Since symfony/yaml 5.1: Using the !php/object tag without a value is deprecated. ' );
783+ $ this ->expectException (ParseException::class);
784+ $ this ->expectExceptionMessage ('Missing value for tag "!php/object" at line 1 (near "!php/object"). ' );
787785
788- $ this -> assertSame ( $ expected , Inline::parse ($ value , Yaml::PARSE_OBJECT ) );
786+ Inline::parse ($ value , Yaml::PARSE_OBJECT );
789787 }
790788
791789 public function phpObjectTagWithEmptyValueProvider ()
792790 {
793791 return [
794- [false , '!php/object ' ],
795- [false , '!php/object ' ],
796- [false , '!php/object ' ],
797- [[ false ], '[!php/object] ' ],
798- [[ false ], '[!php/object ] ' ],
799- [[ false , ' foo ' ], '[!php/object , foo] ' ],
792+ ['!php/object ' ],
793+ ['!php/object ' ],
794+ ['!php/object ' ],
795+ ['[!php/object] ' ],
796+ ['[!php/object ] ' ],
797+ ['[!php/object , foo] ' ],
800798 ];
801799 }
802800
803801 /**
804802 * @dataProvider phpConstTagWithEmptyValueProvider
805- *
806- * @group legacy
807803 */
808- public function testPhpConstTagWithEmptyValue ($ expected , $ value )
804+ public function testPhpConstTagWithEmptyValue (string $ value )
809805 {
810- $ this ->expectDeprecation ('Since symfony/yaml 5.1: Using the !php/const tag without a value is deprecated. ' );
806+ $ this ->expectException (ParseException::class);
807+ $ this ->expectExceptionMessage ('Missing value for tag "!php/const" at line 1 (near "!php/const"). ' );
811808
812- $ this -> assertSame ( $ expected , Inline::parse ($ value , Yaml::PARSE_CONSTANT ) );
809+ Inline::parse ($ value , Yaml::PARSE_CONSTANT );
813810 }
814811
815812 public function phpConstTagWithEmptyValueProvider ()
816813 {
817814 return [
818- ['' , ' !php/const ' ],
819- ['' , ' !php/const ' ],
820- ['' , ' !php/const ' ],
821- [[ '' ], '[!php/const] ' ],
822- [[ '' ], '[!php/const ] ' ],
823- [[ '' , ' foo ' ], '[!php/const , foo] ' ],
824- [[ '' => ' foo ' ], '{!php/const: foo} ' ],
825- [[ '' => ' foo ' ], '{!php/const : foo} ' ],
826- [[ '' => ' foo ' , ' bar ' => ' ccc ' ], '{!php/const : foo, bar: ccc} ' ],
815+ ['!php/const ' ],
816+ ['!php/const ' ],
817+ ['!php/const ' ],
818+ ['[!php/const] ' ],
819+ ['[!php/const ] ' ],
820+ ['[!php/const , foo] ' ],
821+ ['{!php/const: foo} ' ],
822+ ['{!php/const : foo} ' ],
823+ ['{!php/const : foo, bar: ccc} ' ],
827824 ];
828825 }
829826
830- /**
831- * @group legacy
832- */
833- public function testParsePositiveOctalNumberContainingInvalidDigits ()
834- {
835- self ::assertSame ('0123456789 ' , Inline::parse ('0123456789 ' ));
836- }
837-
838- /**
839- * @group legacy
840- */
841- public function testParseNegativeOctalNumberContainingInvalidDigits ()
842- {
843- self ::assertSame ('-0123456789 ' , Inline::parse ('-0123456789 ' ));
844- }
845-
846827 public function testParseCommentNotPrefixedBySpaces ()
847828 {
848829 self ::assertSame ('foo ' , Inline::parse ('"foo"#comment ' ));
0 commit comments