Skip to content

Commit d71090d

Browse files
authored
Merge pull request #1041 from datamweb/improve-test-time
test: improve tests execution time
2 parents 3fa4ec3 + 0633ec5 commit d71090d

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

docs/references/testing.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,16 @@ class ActionsTest extends TestCase
3333
}
3434
}
3535
```
36+
37+
## Improving the Speed of Running Tests
38+
39+
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.
40+
41+
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:
42+
43+
```
44+
<php>
45+
<!-- Set hashCost for improving the speed of running tests -->
46+
<env name="auth.hashCost" value="4"/>
47+
</php>
48+
```

phpunit.xml.dist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@
7979

8080
<php>
8181
<env name="XDEBUG_MODE" value="coverage"/>
82+
<!-- Set hashCost for improving the speed of running tests -->
83+
<env name="auth.hashCost" value="4"/>
8284
<server name="app.baseURL" value="https://example.com/"/>
8385

8486
<!-- Directory containing phpunit.xml -->

0 commit comments

Comments
 (0)