From 9b505867f73aee8f72c92f96ff20eed0a69c720f Mon Sep 17 00:00:00 2001 From: Pooya Parsa Dadashi Date: Fri, 23 Feb 2024 20:08:49 +0330 Subject: [PATCH 1/3] tests: set `$hashCost = 4` for improve tests running time --- phpunit.xml.dist | 2 ++ 1 file changed, 2 insertions(+) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index af444e0a1..b25b4ca2a 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -79,6 +79,8 @@ + + From c6cf073f157fa1e9499c357641f01e9edc6bf90a Mon Sep 17 00:00:00 2001 From: Pooya Parsa Dadashi Date: Fri, 23 Feb 2024 20:10:35 +0330 Subject: [PATCH 2/3] docs: add explanation about improving tests speed for users projects --- docs/references/testing.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/references/testing.md b/docs/references/testing.md index 30766858a..400d4f928 100644 --- a/docs/references/testing.md +++ b/docs/references/testing.md @@ -33,3 +33,16 @@ class ActionsTest extends TestCase } } ``` + +## Improving the Speed of Running Tests + +By default, the Shield has set the `Config\Auth::$hashCost = 12` due to the greater security of passwords. However, to increase the test execution time, we have set the `$hashCost = 4` for the test environment. + +If you use Shield in your project and your tests execution time is high, just set the `$hashCost = 4` in file **phpunit.xml.dist** of your project as follows: + +``` + + + + +``` \ No newline at end of file From 0633ec52f4d26f7e335849d8020e41645f0176e9 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Fri, 23 Feb 2024 20:38:34 +0330 Subject: [PATCH 3/3] docs: improved description Co-authored-by: Lonnie Ezell --- docs/references/testing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/references/testing.md b/docs/references/testing.md index 400d4f928..67a993c41 100644 --- a/docs/references/testing.md +++ b/docs/references/testing.md @@ -36,7 +36,7 @@ class ActionsTest extends TestCase ## Improving the Speed of Running Tests -By default, the Shield has set the `Config\Auth::$hashCost = 12` due to the greater security of passwords. However, to increase the test execution time, we have set the `$hashCost = 4` for the test environment. +By default, Shield has set the `Config\Auth::$hashCost = 12` due to the greater security of passwords. However, to increase the test execution time, we have set the `$hashCost = 4` for the test environment. If you use Shield in your project and your tests execution time is high, just set the `$hashCost = 4` in file **phpunit.xml.dist** of your project as follows: