Skip to content

Commit

Permalink
minor #737 Reduce the BCrypt cost in tests to run them much faster (j…
Browse files Browse the repository at this point in the history
…aviereguiluz)

This PR was merged into the master branch.

Discussion
----------

Reduce the BCrypt cost in tests to run them much faster

I learned this cool trick from this @taylorotwell tweet: https://twitter.com/taylorotwell/status/943135617466105856

In my local machine, tests went from 15 to 10 seconds!

Commits
-------

54c2ebe Reduce the BCrypt cost in tests to run them much faster
  • Loading branch information
javiereguiluz committed Dec 27, 2017
2 parents 0d3e586 + 54c2ebe commit f4a7ac8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions config/packages/test/security.yaml
@@ -1,6 +1,11 @@
# this configuration simplifies testing URLs protected by the security mechanism
# See https://symfony.com/doc/current/cookbook/testing/http_authentication.html
security:
encoders:
# to make tests much faster, BCrypt cost is changed to its minimum allowed value (4)
# See https://symfony.com/doc/current/reference/configuration/security.html#using-the-bcrypt-password-encoder
App\Entity\User: { algorithm: bcrypt, cost: 4 }

firewalls:
main:
http_basic: ~

0 comments on commit f4a7ac8

Please sign in to comment.