Dusk: improve speed and safety (#13370)

* Dusk: improve speed
Instead of refreshing the database between tests, just cleanup all side effects.
Update UserFactory to upstream so hash never has to be generated for default

* Actually, migrate, but not fresh
This commit is contained in:
Tony Murray
2021-10-18 03:01:07 -05:00
committed by GitHub
parent 4685ea13cc
commit 66d0a34f40
2 changed files with 10 additions and 9 deletions

View File

@@ -22,14 +22,12 @@ class UserFactory extends Factory
*/
public function definition()
{
static $password;
return [
'auth_type' => 'mysql',
'username' => $this->faker->unique()->userName,
'realname' => $this->faker->name,
'email' => $this->faker->safeEmail,
'password' => $password ?: $password = bcrypt('secret'),
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
'level' => 1,
];
}