@@ -757,92 +757,73 @@ public function getTestsForOctalNumbers()
757
757
}
758
758
759
759
/**
760
- * @group legacy
761
760
* @dataProvider getTestsForOctalNumbersYaml11Notation
762
761
*/
763
- public function testParseOctalNumbersYaml11Notation (int $ expected , string $ yaml )
762
+ public function testParseOctalNumbersYaml11Notation (string $ expected , string $ yaml )
764
763
{
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
-
767
764
self ::assertSame ($ expected , Inline::parse ($ yaml ));
768
765
}
769
766
770
767
public function getTestsForOctalNumbersYaml11Notation ()
771
768
{
772
769
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 ' ],
776
775
];
777
776
}
778
777
779
778
/**
780
779
* @dataProvider phpObjectTagWithEmptyValueProvider
781
- *
782
- * @group legacy
783
780
*/
784
- public function testPhpObjectWithEmptyValue ($ expected , $ value )
781
+ public function testPhpObjectWithEmptyValue (string $ value )
785
782
{
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"). ' );
787
785
788
- $ this -> assertSame ( $ expected , Inline::parse ($ value , Yaml::PARSE_OBJECT ) );
786
+ Inline::parse ($ value , Yaml::PARSE_OBJECT );
789
787
}
790
788
791
789
public function phpObjectTagWithEmptyValueProvider ()
792
790
{
793
791
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] ' ],
800
798
];
801
799
}
802
800
803
801
/**
804
802
* @dataProvider phpConstTagWithEmptyValueProvider
805
- *
806
- * @group legacy
807
803
*/
808
- public function testPhpConstTagWithEmptyValue ($ expected , $ value )
804
+ public function testPhpConstTagWithEmptyValue (string $ value )
809
805
{
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"). ' );
811
808
812
- $ this -> assertSame ( $ expected , Inline::parse ($ value , Yaml::PARSE_CONSTANT ) );
809
+ Inline::parse ($ value , Yaml::PARSE_CONSTANT );
813
810
}
814
811
815
812
public function phpConstTagWithEmptyValueProvider ()
816
813
{
817
814
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} ' ],
827
824
];
828
825
}
829
826
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
-
846
827
public function testParseCommentNotPrefixedBySpaces ()
847
828
{
848
829
self ::assertSame ('foo ' , Inline::parse ('"foo"#comment ' ));
0 commit comments