From 5864407e617e5a5b9f2df50cda84c4bddc7211af Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 4 Nov 2019 18:38:28 +1100 Subject: [PATCH] Remove admin password, also make the credentials array a bit clearer --- database/seeds/UserStorySeeder.php | 6 ++++-- tests/ApiTestCase.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/database/seeds/UserStorySeeder.php b/database/seeds/UserStorySeeder.php index 39ff97f..ab0d030 100644 --- a/database/seeds/UserStorySeeder.php +++ b/database/seeds/UserStorySeeder.php @@ -8,7 +8,9 @@ class UserStorySeeder extends BaseSeeder /** * Credentials */ - const ADMIN_CREDENTIALS = ['admin@admin.com', 'secret']; + const ADMIN_CREDENTIALS = [ + 'email' => 'admin@admin.com', + ]; public function runFake() { @@ -18,7 +20,7 @@ public function runFake() // Create an admin user factory(App\Models\User::class)->create([ 'name' => 'Admin', - 'email' => static::ADMIN_CREDENTIALS[0], + 'email' => static::ADMIN_CREDENTIALS['email'], 'primary_role' => $roles->where('name', 'admin')->first()->role_id, ]); diff --git a/tests/ApiTestCase.php b/tests/ApiTestCase.php index 5d213c4..5d13cba 100644 --- a/tests/ApiTestCase.php +++ b/tests/ApiTestCase.php @@ -50,7 +50,7 @@ public function actingAsUser($credentials) */ public function actingAsAdmin() { - $user = User::where('email', UserStorySeeder::ADMIN_CREDENTIALS[0])->firstOrFail(); + $user = User::where('email', UserStorySeeder::ADMIN_CREDENTIALS['email'])->firstOrFail(); return $this->actingAs($user); }