Skip to content

Commit 49903e0

Browse files
committed
Changes for new hashing to keep tests speedy
1 parent 7e2e5fd commit 49903e0

File tree

5 files changed

+52
-19
lines changed

5 files changed

+52
-19
lines changed

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ APP_TIMEZONE=America/New_York
66
APP_CLEAR_TASKLOG=720
77
APP_DELETE_MINUTES=10
88
APP_ENVIRONMENT_ONLY=true
9+
LOG_CHANNEL=daily
910

1011
DB_HOST=127.0.0.1
1112
DB_PORT=3306

config/app.php

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -116,23 +116,6 @@
116116

117117
'cipher' => 'AES-256-CBC',
118118

119-
/*
120-
|--------------------------------------------------------------------------
121-
| Logging Configuration
122-
|--------------------------------------------------------------------------
123-
|
124-
| Here you may configure the log settings for your application. Out of
125-
| the box, Laravel uses the Monolog PHP logging library. This gives
126-
| you a variety of powerful log handlers / formatters to utilize.
127-
|
128-
| Available Settings: "single", "daily", "syslog", "errorlog"
129-
|
130-
*/
131-
132-
'log' => env('APP_LOG', 'daily'),
133-
134-
'log_level' => env('APP_LOG_LEVEL', 'info'),
135-
136119
/*
137120
|--------------------------------------------------------------------------
138121
| Exception Reporter Configuration

config/hashing.php

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?php
2+
3+
return [
4+
/*
5+
|--------------------------------------------------------------------------
6+
| Default Hash Driver
7+
|--------------------------------------------------------------------------
8+
|
9+
| This option controls the default hash driver that will be used to hash
10+
| passwords for your application. By default, the bcrypt algorithm is
11+
| used; however, you remain free to modify this option if you wish.
12+
|
13+
| Supported: "bcrypt", "argon"
14+
|
15+
*/
16+
17+
'driver' => 'bcrypt',
18+
19+
/*
20+
|--------------------------------------------------------------------------
21+
| Bcrypt Options
22+
|--------------------------------------------------------------------------
23+
|
24+
| Here you may specify the configuration options that should be used when
25+
| passwords are hashed using the Bcrypt algorithm. This will allow you
26+
| to control the amount of time it takes to hash the given password.
27+
|
28+
*/
29+
30+
'bcrypt' => [
31+
'rounds' => env('BCRYPT_ROUNDS', 10),
32+
],
33+
34+
/*
35+
|--------------------------------------------------------------------------
36+
| Argon Options
37+
|--------------------------------------------------------------------------
38+
|
39+
| Here you may specify the configuration options that should be used when
40+
| passwords are hashed using the Argon algorithm. These will allow you
41+
| to control the amount of time it takes to hash the given password.
42+
|
43+
*/
44+
45+
'argon' => [
46+
'memory' => 1024,
47+
'threads' => 2,
48+
'time' => 2,
49+
],
50+
];

phpunit.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
</filter>
2525
<php>
2626
<env name="APP_ENV" value="testing"/>
27+
<env name="BCRYPT_ROUNDS" value="4"/>
2728
<env name="DB_CONNECTION" value="testing"/>
2829
<env name="CACHE_DRIVER" value="array"/>
2930
<env name="SESSION_DRIVER" value="array"/>

tests/TestCase.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Tests;
44

55
use Cake\Chronos\Chronos;
6-
use Illuminate\Support\Facades\Hash;
76
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
87

98
abstract class TestCase extends BaseTestCase
@@ -17,7 +16,6 @@ public function setUp()
1716
{
1817
parent::setUp();
1918

20-
Hash::setRounds(4);
2119
$this->setKnownUuidFactory();
2220
}
2321

0 commit comments

Comments
 (0)