@@ -2798,7 +2798,7 @@ public function testValidateImageDimensions()
2798
2798
$ v = new Validator ($ trans , ['x ' => $ svgXmlUploadedFile ], ['x ' => 'dimensions:max_width=1,max_height=1 ' ]);
2799
2799
$ this ->assertTrue ($ v ->passes ());
2800
2800
2801
- $ svgXmlFile = new File (__DIR__ .'/fixtures/image.svg ' , '' , 'image/svg+xml ' , null , null , true );
2801
+ $ svgXmlFile = new UploadedFile (__DIR__ .'/fixtures/image.svg ' , '' , 'image/svg+xml ' , null , null , true );
2802
2802
$ trans = $ this ->getIlluminateArrayTranslator ();
2803
2803
2804
2804
$ v = new Validator ($ trans , ['x ' => $ svgXmlFile ], ['x ' => 'dimensions:max_width=1,max_height=1 ' ]);
@@ -2811,11 +2811,19 @@ public function testValidateImageDimensions()
2811
2811
$ v = new Validator ($ trans , ['x ' => $ svgUploadedFile ], ['x ' => 'dimensions:max_width=1,max_height=1 ' ]);
2812
2812
$ this ->assertTrue ($ v ->passes ());
2813
2813
2814
- $ svgFile = new File (__DIR__ .'/fixtures/image2.svg ' , '' , 'image/svg ' , null , null , true );
2814
+ $ svgFile = new UploadedFile (__DIR__ .'/fixtures/image2.svg ' , '' , 'image/svg ' , null , null , true );
2815
2815
$ trans = $ this ->getIlluminateArrayTranslator ();
2816
2816
2817
2817
$ v = new Validator ($ trans , ['x ' => $ svgFile ], ['x ' => 'dimensions:max_width=1,max_height=1 ' ]);
2818
2818
$ this ->assertTrue ($ v ->passes ());
2819
+
2820
+ // Knowing that demo image4.png has width = 64 and height = 65
2821
+ $ uploadedFile = new UploadedFile (__DIR__ .'/fixtures/image4.png ' , '' , null , null , true );
2822
+ $ trans = $ this ->getIlluminateArrayTranslator ();
2823
+
2824
+ // Ensure validation doesn't erroneously fail when ratio doesn't matches
2825
+ $ v = new Validator ($ trans , ['x ' => $ uploadedFile ], ['x ' => 'dimensions:ratio=1 ' ]);
2826
+ $ this ->assertFalse ($ v ->passes ());
2819
2827
}
2820
2828
2821
2829
/**
0 commit comments