Nettoyer les notices PHPUnit createMock sans expects()#358
Merged
Conversation
Closes #272 190 → 25 notices PHPUnit ("Consider refactoring your test code to use a test stub instead") dans tests/Unit/{Entity,EventListener,Security,Service}. Les mocks qui ne posent jamais d'expects() (usage en pur stub via method()->willReturn()) basculent en createStub(). Les mocks partagés via setUp() avec au moins un expects() réel restent createMock (DefaultFolderServiceTest, FolderServiceTest, FolderMoverTest, SharedResourceCleanerTest non touchés).
Bascule authResolver/sharedResourceCleaner en createStub dans FolderServiceTest (aucun expects() posé dessus). Met à jour .github/avancement.md avec le résultat final : 190 → 22 notices sur le périmètre du ticket, 190 → 106 sur la suite complète.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Résumé
Closes #272
createMock()utilisé sansexpects()réel dans le test courant ("Consider refactoring your test code to use a test stub instead").createMock()parcreateStub()danstests/Unit/{Entity,EventListener,Security,Service}là où aucune expectation n'est réellement vérifiée.TailwindBuildTest, préexistant et hors périmètre).setUp()(DefaultFolderServiceTest,FolderServiceTest,FolderMoverTest,SharedResourceCleanerTest) dont au moins un test pose unexpects()réel — PHPUnit compte la notice par (test, mock), même si le mock n'est pas utilisé dans ce test précis. Les éliminer demanderait d'abandonner lesetUp()partagé au profit d'une instanciation par test ; jugé disproportionné pour ce ticket.Plan de test
./vendor/bin/phpunit --colors=always— 924 tests, 1 échec préexistant hors périmètre (TailwindBuildTest), 190 → 106 noticesexpects()) sont basculés