-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[QA - Sentry] setKey on Array / TypeError #2218
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lecture et Test OK
Tester que l'upload d'image ne provoque pas l'erreur "setKey" aprés avoir ajouté throw new FileException('DEBUG'); sous la ligne 59 de src/Service/UploadHandlerService.php
Du coup, est ce que tu peux écrire un test qui simule l'exception FileException lors de l'upload et de vérifier que c'est bien un tableau ?
Tu peux copier ce test UploadHandlerServiceTest::testTemporaryFileUploaded()
et ajouter que writeStream lancera une exception
$this->filesystemOperator
->expects($this->once())
->method('writeStream')
->willThrowException(new FileException());
ça permettra de vérifier qu'on a bien un tableau avec une clé error
$uploadHandler = $uploadHandlerService->toTempFolder($uploadFile);
$this->assertIsArray($uploadHandler);
$this->assertArrayHasKey('error', $uploadHandler);
|
C'est fait, merci pour l'aide |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code + Test OK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK relecture et test !
Ticket
#2211 #2212
Description
Tests
Je n'ai pas su reproduire les erreurs via une utilisation normale, voici comment on peux tester :
throw new FileException('DEBUG');
sous la ligne 59 desrc/Service/UploadHandlerService.php
signalement[files][photos][OIG3.jpg]
=>signalement[files][photos][OIG3.jpg][]