Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions docs/references/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,16 @@ class ActionsTest extends TestCase
}
}
```

## Improving the Speed of Running Tests

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:

```
<php>
<!-- Set hashCost for improving the speed of running tests -->
<env name="auth.hashCost" value="4"/>
</php>
```
2 changes: 2 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@

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

<!-- Directory containing phpunit.xml -->
Expand Down