Skip to content

Commit

Permalink
Merge pull request #1041 from datamweb/improve-test-time
Browse files Browse the repository at this point in the history
test: improve tests execution time
  • Loading branch information
datamweb authored Feb 24, 2024
2 parents 3fa4ec3 + 0633ec5 commit d71090d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
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

0 comments on commit d71090d

Please sign in to comment.