SymfonyCasts / reset-password-bundle

Need a killer reset password feature for your Symfony? Us too!
https://symfonycasts.com
MIT License
468 stars 65 forks source link

Get not hashed token for functional testing #267

Closed SiestaCat closed 4 months ago

SiestaCat commented 1 year ago

Hello

Is posible to retreive the not hashed token for functional testings?

regards

jrushlow commented 5 months ago

Howdy @SiestaCat - sorry for the slow reply. The best way to get the token is from the email itself.. I'm working on a PR in maker bundle to generate a functional test for reset-password. In the meantime, checkout a quick and dirty solution https://gist.github.com/jrushlow/193798c452a6e135c883273277e05621

jrushlow commented 4 months ago

This has feature has been added in MakerBundle - https://github.com/symfony/maker-bundle/releases/tag/v1.59.0 PR https://github.com/symfony/maker-bundle/pull/1497

To generate a fully functional test - make:reset-password --with-tests. This will complain if you already have a say, ResetPasswordController::class. Checkout https://github.com/symfony/maker-bundle/blob/main/src/Resources/skeleton/resetPassword/Test.ResetPasswordController.tpl.php to see the actual test that MakerBundle generates...

Let us know if you run into any problems. Thanks!