@@ -1950,39 +1950,39 @@ public function testValidateImage()
19501950 $ trans = $ this ->getIlluminateArrayTranslator ();
19511951 $ uploadedFile = [__FILE__ , '' , null , null , null , true ];
19521952
1953- $ file = $ this ->getMockBuilder ('Symfony\Component\HttpFoundation\File\UploadedFile ' )->setMethods (['guessExtension ' , 'getExtension ' ])->setConstructorArgs ($ uploadedFile )->getMock ();
1953+ $ file = $ this ->getMockBuilder ('Symfony\Component\HttpFoundation\File\UploadedFile ' )->setMethods (['guessExtension ' , 'getClientOriginalExtension ' ])->setConstructorArgs ($ uploadedFile )->getMock ();
19541954 $ file ->expects ($ this ->any ())->method ('guessExtension ' )->will ($ this ->returnValue ('php ' ));
1955- $ file ->expects ($ this ->any ())->method ('getExtension ' )->will ($ this ->returnValue ('php ' ));
1955+ $ file ->expects ($ this ->any ())->method ('getClientOriginalExtension ' )->will ($ this ->returnValue ('php ' ));
19561956 $ v = new Validator ($ trans , ['x ' => $ file ], ['x ' => 'Image ' ]);
19571957 $ this ->assertFalse ($ v ->passes ());
19581958
1959- $ file2 = $ this ->getMockBuilder ('Symfony\Component\HttpFoundation\File\UploadedFile ' )->setMethods (['guessExtension ' , 'getExtension ' ])->setConstructorArgs ($ uploadedFile )->getMock ();
1959+ $ file2 = $ this ->getMockBuilder ('Symfony\Component\HttpFoundation\File\UploadedFile ' )->setMethods (['guessExtension ' , 'getClientOriginalExtension ' ])->setConstructorArgs ($ uploadedFile )->getMock ();
19601960 $ file2 ->expects ($ this ->any ())->method ('guessExtension ' )->will ($ this ->returnValue ('jpeg ' ));
1961- $ file2 ->expects ($ this ->any ())->method ('getExtension ' )->will ($ this ->returnValue ('jpeg ' ));
1961+ $ file2 ->expects ($ this ->any ())->method ('getClientOriginalExtension ' )->will ($ this ->returnValue ('jpeg ' ));
19621962 $ v = new Validator ($ trans , ['x ' => $ file2 ], ['x ' => 'Image ' ]);
19631963 $ this ->assertTrue ($ v ->passes ());
19641964
1965- $ file3 = $ this ->getMockBuilder ('Symfony\Component\HttpFoundation\File\UploadedFile ' )->setMethods (['guessExtension ' , 'getExtension ' ])->setConstructorArgs ($ uploadedFile )->getMock ();
1965+ $ file3 = $ this ->getMockBuilder ('Symfony\Component\HttpFoundation\File\UploadedFile ' )->setMethods (['guessExtension ' , 'getClientOriginalExtension ' ])->setConstructorArgs ($ uploadedFile )->getMock ();
19661966 $ file3 ->expects ($ this ->any ())->method ('guessExtension ' )->will ($ this ->returnValue ('gif ' ));
1967- $ file3 ->expects ($ this ->any ())->method ('getExtension ' )->will ($ this ->returnValue ('gif ' ));
1967+ $ file3 ->expects ($ this ->any ())->method ('getClientOriginalExtension ' )->will ($ this ->returnValue ('gif ' ));
19681968 $ v = new Validator ($ trans , ['x ' => $ file3 ], ['x ' => 'Image ' ]);
19691969 $ this ->assertTrue ($ v ->passes ());
19701970
1971- $ file4 = $ this ->getMockBuilder ('Symfony\Component\HttpFoundation\File\UploadedFile ' )->setMethods (['guessExtension ' , 'getExtension ' ])->setConstructorArgs ($ uploadedFile )->getMock ();
1971+ $ file4 = $ this ->getMockBuilder ('Symfony\Component\HttpFoundation\File\UploadedFile ' )->setMethods (['guessExtension ' , 'getClientOriginalExtension ' ])->setConstructorArgs ($ uploadedFile )->getMock ();
19721972 $ file4 ->expects ($ this ->any ())->method ('guessExtension ' )->will ($ this ->returnValue ('bmp ' ));
1973- $ file4 ->expects ($ this ->any ())->method ('getExtension ' )->will ($ this ->returnValue ('bmp ' ));
1973+ $ file4 ->expects ($ this ->any ())->method ('getClientOriginalExtension ' )->will ($ this ->returnValue ('bmp ' ));
19741974 $ v = new Validator ($ trans , ['x ' => $ file4 ], ['x ' => 'Image ' ]);
19751975 $ this ->assertTrue ($ v ->passes ());
19761976
1977- $ file5 = $ this ->getMockBuilder ('Symfony\Component\HttpFoundation\File\UploadedFile ' )->setMethods (['guessExtension ' , 'getExtension ' ])->setConstructorArgs ($ uploadedFile )->getMock ();
1977+ $ file5 = $ this ->getMockBuilder ('Symfony\Component\HttpFoundation\File\UploadedFile ' )->setMethods (['guessExtension ' , 'getClientOriginalExtension ' ])->setConstructorArgs ($ uploadedFile )->getMock ();
19781978 $ file5 ->expects ($ this ->any ())->method ('guessExtension ' )->will ($ this ->returnValue ('png ' ));
1979- $ file5 ->expects ($ this ->any ())->method ('getExtension ' )->will ($ this ->returnValue ('png ' ));
1979+ $ file5 ->expects ($ this ->any ())->method ('getClientOriginalExtension ' )->will ($ this ->returnValue ('png ' ));
19801980 $ v = new Validator ($ trans , ['x ' => $ file5 ], ['x ' => 'Image ' ]);
19811981 $ this ->assertTrue ($ v ->passes ());
19821982
1983- $ file6 = $ this ->getMockBuilder ('Symfony\Component\HttpFoundation\File\UploadedFile ' )->setMethods (['guessExtension ' , 'getExtension ' ])->setConstructorArgs ($ uploadedFile )->getMock ();
1983+ $ file6 = $ this ->getMockBuilder ('Symfony\Component\HttpFoundation\File\UploadedFile ' )->setMethods (['guessExtension ' , 'getClientOriginalExtension ' ])->setConstructorArgs ($ uploadedFile )->getMock ();
19841984 $ file6 ->expects ($ this ->any ())->method ('guessExtension ' )->will ($ this ->returnValue ('svg ' ));
1985- $ file6 ->expects ($ this ->any ())->method ('getExtension ' )->will ($ this ->returnValue ('svg ' ));
1985+ $ file6 ->expects ($ this ->any ())->method ('getClientOriginalExtension ' )->will ($ this ->returnValue ('svg ' ));
19861986 $ v = new Validator ($ trans , ['x ' => $ file6 ], ['x ' => 'Image ' ]);
19871987 $ this ->assertTrue ($ v ->passes ());
19881988 }
@@ -1992,9 +1992,9 @@ public function testValidateImageDoesNotAllowPhpExtensionsOnImageMime()
19921992 $ trans = $ this ->getIlluminateArrayTranslator ();
19931993 $ uploadedFile = [__FILE__ , '' , null , null , null , true ];
19941994
1995- $ file = $ this ->getMockBuilder ('Symfony\Component\HttpFoundation\File\UploadedFile ' )->setMethods (['guessExtension ' , 'getExtension ' ])->setConstructorArgs ($ uploadedFile )->getMock ();
1995+ $ file = $ this ->getMockBuilder ('Symfony\Component\HttpFoundation\File\UploadedFile ' )->setMethods (['guessExtension ' , 'getClientOriginalExtension ' ])->setConstructorArgs ($ uploadedFile )->getMock ();
19961996 $ file ->expects ($ this ->any ())->method ('guessExtension ' )->will ($ this ->returnValue ('jpeg ' ));
1997- $ file ->expects ($ this ->any ())->method ('getExtension ' )->will ($ this ->returnValue ('php ' ));
1997+ $ file ->expects ($ this ->any ())->method ('getClientOriginalExtension ' )->will ($ this ->returnValue ('php ' ));
19981998 $ v = new Validator ($ trans , ['x ' => $ file ], ['x ' => 'Image ' ]);
19991999 $ this ->assertFalse ($ v ->passes ());
20002000 }
@@ -2085,9 +2085,9 @@ public function testValidatePhpMimetypes()
20852085 $ trans = $ this ->getIlluminateArrayTranslator ();
20862086 $ uploadedFile = [__FILE__ , '' , null , null , null , true ];
20872087
2088- $ file = $ this ->getMockBuilder ('Symfony\Component\HttpFoundation\File\UploadedFile ' )->setMethods (['guessExtension ' , 'getExtension ' ])->setConstructorArgs ($ uploadedFile )->getMock ();
2088+ $ file = $ this ->getMockBuilder ('Symfony\Component\HttpFoundation\File\UploadedFile ' )->setMethods (['guessExtension ' , 'getClientOriginalExtension ' ])->setConstructorArgs ($ uploadedFile )->getMock ();
20892089 $ file ->expects ($ this ->any ())->method ('guessExtension ' )->will ($ this ->returnValue ('rtf ' ));
2090- $ file ->expects ($ this ->any ())->method ('getExtension ' )->will ($ this ->returnValue ('rtf ' ));
2090+ $ file ->expects ($ this ->any ())->method ('getClientOriginalExtension ' )->will ($ this ->returnValue ('rtf ' ));
20912091
20922092 $ v = new Validator ($ trans , ['x ' => $ file ], ['x ' => 'mimetypes:text/* ' ]);
20932093 $ this ->assertTrue ($ v ->passes ());
@@ -2098,9 +2098,9 @@ public function testValidateMime()
20982098 $ trans = $ this ->getIlluminateArrayTranslator ();
20992099 $ uploadedFile = [__FILE__ , '' , null , null , null , true ];
21002100
2101- $ file = $ this ->getMockBuilder ('Symfony\Component\HttpFoundation\File\UploadedFile ' )->setMethods (['guessExtension ' , 'getExtension ' ])->setConstructorArgs ($ uploadedFile )->getMock ();
2101+ $ file = $ this ->getMockBuilder ('Symfony\Component\HttpFoundation\File\UploadedFile ' )->setMethods (['guessExtension ' , 'getClientOriginalExtension ' ])->setConstructorArgs ($ uploadedFile )->getMock ();
21022102 $ file ->expects ($ this ->any ())->method ('guessExtension ' )->will ($ this ->returnValue ('pdf ' ));
2103- $ file ->expects ($ this ->any ())->method ('getExtension ' )->will ($ this ->returnValue ('pdf ' ));
2103+ $ file ->expects ($ this ->any ())->method ('getClientOriginalExtension ' )->will ($ this ->returnValue ('pdf ' ));
21042104 $ v = new Validator ($ trans , ['x ' => $ file ], ['x ' => 'mimes:pdf ' ]);
21052105 $ this ->assertTrue ($ v ->passes ());
21062106
@@ -2116,15 +2116,15 @@ public function testValidateMimeEnforcesPhpCheck()
21162116 $ trans = $ this ->getIlluminateArrayTranslator ();
21172117 $ uploadedFile = [__FILE__ , '' , null , null , null , true ];
21182118
2119- $ file = $ this ->getMockBuilder ('Symfony\Component\HttpFoundation\File\UploadedFile ' )->setMethods (['guessExtension ' , 'getExtension ' ])->setConstructorArgs ($ uploadedFile )->getMock ();
2119+ $ file = $ this ->getMockBuilder ('Symfony\Component\HttpFoundation\File\UploadedFile ' )->setMethods (['guessExtension ' , 'getClientOriginalExtension ' ])->setConstructorArgs ($ uploadedFile )->getMock ();
21202120 $ file ->expects ($ this ->any ())->method ('guessExtension ' )->will ($ this ->returnValue ('pdf ' ));
2121- $ file ->expects ($ this ->any ())->method ('getExtension ' )->will ($ this ->returnValue ('php ' ));
2121+ $ file ->expects ($ this ->any ())->method ('getClientOriginalExtension ' )->will ($ this ->returnValue ('php ' ));
21222122 $ v = new Validator ($ trans , ['x ' => $ file ], ['x ' => 'mimes:pdf ' ]);
21232123 $ this ->assertFalse ($ v ->passes ());
21242124
2125- $ file2 = $ this ->getMockBuilder ('Symfony\Component\HttpFoundation\File\UploadedFile ' )->setMethods (['guessExtension ' , 'getExtension ' ])->setConstructorArgs ($ uploadedFile )->getMock ();
2125+ $ file2 = $ this ->getMockBuilder ('Symfony\Component\HttpFoundation\File\UploadedFile ' )->setMethods (['guessExtension ' , 'getClientOriginalExtension ' ])->setConstructorArgs ($ uploadedFile )->getMock ();
21262126 $ file2 ->expects ($ this ->any ())->method ('guessExtension ' )->will ($ this ->returnValue ('php ' ));
2127- $ file2 ->expects ($ this ->any ())->method ('getExtension ' )->will ($ this ->returnValue ('php ' ));
2127+ $ file2 ->expects ($ this ->any ())->method ('getClientOriginalExtension ' )->will ($ this ->returnValue ('php ' ));
21282128 $ v = new Validator ($ trans , ['x ' => $ file2 ], ['x ' => 'mimes:pdf,php ' ]);
21292129 $ this ->assertTrue ($ v ->passes ());
21302130 }
0 commit comments