@@ -141,10 +141,22 @@ public function testPassesExtensionIsNotExcutable()
141
141
142
142
$ this ->expectNotToPerformAssertions ();
143
143
144
- $ validator ->extensionIsNotExcutable (['php ' , 'html ' ]);
144
+ $ validator ->extensionIsNotExcutable ();
145
+ }
146
+
147
+ public function testFailsExtensionIsNotExcutableWithPhp ()
148
+ {
149
+ $ uploaded_file = m::mock (UploadedFile::class);
150
+ $ uploaded_file ->shouldReceive ('getClientOriginalExtension ' )->andReturn ('php ' );
151
+
152
+ $ validator = new LfmUploadValidator ($ uploaded_file );
153
+
154
+ $ this ->expectException (ExcutableFileException::class);
155
+
156
+ $ validator ->extensionIsNotExcutable ();
145
157
}
146
158
147
- public function testFailsExtensionIsNotExcutable ()
159
+ public function testFailsExtensionIsNotExcutableWithHtml ()
148
160
{
149
161
$ uploaded_file = m::mock (UploadedFile::class);
150
162
$ uploaded_file ->shouldReceive ('getClientOriginalExtension ' )->andReturn ('html ' );
@@ -153,7 +165,7 @@ public function testFailsExtensionIsNotExcutable()
153
165
154
166
$ this ->expectException (ExcutableFileException::class);
155
167
156
- $ validator ->extensionIsNotExcutable ([ ' php ' , ' html ' ] );
168
+ $ validator ->extensionIsNotExcutable ();
157
169
}
158
170
159
171
public function testFailsExtensionIsNotExcutableWithExtensionNotLowerCase ()
@@ -165,7 +177,7 @@ public function testFailsExtensionIsNotExcutableWithExtensionNotLowerCase()
165
177
166
178
$ this ->expectException (ExcutableFileException::class);
167
179
168
- $ validator ->extensionIsNotExcutable ([ ' php ' , ' html ' ] );
180
+ $ validator ->extensionIsNotExcutable ();
169
181
}
170
182
171
183
public function testFailsExtensionIsNotExcutableWithExtensionsStartsWithPhp ()
@@ -177,7 +189,7 @@ public function testFailsExtensionIsNotExcutableWithExtensionsStartsWithPhp()
177
189
178
190
$ this ->expectException (ExcutableFileException::class);
179
191
180
- $ validator ->extensionIsNotExcutable ([ ' php ' , ' html ' ] );
192
+ $ validator ->extensionIsNotExcutable ();
181
193
}
182
194
183
195
public function testFailsExtensionIsNotExcutableWithExtensionsEndsWithHtml ()
@@ -201,7 +213,7 @@ public function testFailsExtensionIsValidWithSpecialCharacters()
201
213
202
214
$ this ->expectException (InvalidExtensionException::class);
203
215
204
- $ validator ->extensionIsValid ();
216
+ $ validator ->extensionIsValid ([] );
205
217
}
206
218
207
219
public function testPassesSizeIsLowerThanConfiguredMaximum ()
0 commit comments