Skip to content

Commit 3c0a6ea

Browse files
committed
[Tests] Move expectException closer to the place of the expectation to avoid false positives
1 parent a04a950 commit 3c0a6ea

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Tests/Factory/HttpFoundationFactoryTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -185,14 +185,14 @@ public function testCreateUploadedFile()
185185

186186
public function testCreateUploadedFileWithError()
187187
{
188-
$this->expectException(FileException::class);
189-
$this->expectExceptionMessage('The file "e" could not be written on disk.');
190-
191188
$uploadedFile = $this->createUploadedFile('Error.', \UPLOAD_ERR_CANT_WRITE, 'e', 'text/plain');
192189
$symfonyUploadedFile = $this->callCreateUploadedFile($uploadedFile);
193190

194191
$this->assertEquals(\UPLOAD_ERR_CANT_WRITE, $symfonyUploadedFile->getError());
195192

193+
$this->expectException(FileException::class);
194+
$this->expectExceptionMessage('The file "e" could not be written on disk.');
195+
196196
$symfonyUploadedFile->move($this->tmpDir, 'shouldFail.txt');
197197
}
198198

0 commit comments

Comments
 (0)