@@ -9,30 +9,29 @@ This could become an issue especially when the tests reproduce the same steps
99that users follow to authenticate, such as submitting a login form or using
1010OAuth authentication services.
1111
12- This article explains the two most popular techniques to avoid these issues and
13- create fast tests when using authentication.
12+ This article explains some of the most popular techniques to avoid these issues
13+ and create fast tests when using authentication.
1414
15- Improving Password Encoder Speed in Tests
16- -----------------------------------------
15+ Hashing Passwords Faster Only for Tests
16+ ---------------------------------------
1717
18- By default, password encoders are resource intensive and take time. This is
19- important to generate secure password hashes. In tests however, secure hashes
20- are not important, waste resources and increase test times. You can reduce
21- the *work factor * for your encoders by adding the following *only in your test
22- environment *:
18+ By default, :ref: `password encoders <security-encoding-user-password >` are
19+ resource intensive and take time. This is important to generate secure password
20+ hashes. In tests however, secure hashes are not important, so you can change the
21+ encoders configuration to generate password hashes as fast as possible:
2322
2423.. configuration-block ::
2524
2625 .. code-block :: yaml
2726
2827 # config/packages/test/security.yaml
2928 encoders :
30- # Use your user class name here
31- App\Entity\User :
32- algorithm : auto # This should be the same value as in config/packages/security.yaml
33- cost : 4 # Lowest possible value for bcrypt
34- time_cost : 3 # Lowest possible value for argon
35- memory_cost : 10 # Lowest possible value for argon
29+ # Use your user class name here
30+ App\Entity\User :
31+ algorithm : auto # This should be the same value as in config/packages/security.yaml
32+ cost : 4 # Lowest possible value for bcrypt
33+ time_cost : 3 # Lowest possible value for argon
34+ memory_cost : 10 # Lowest possible value for argon
3635
3736 .. code-block :: xml
3837
0 commit comments