File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 192192 // Create a fresh .env
193193 file_put_contents ($ envPath , "APP_NAME=Laravel \nBASIC_AUTH_PASSWORD=test " );
194194
195- $ password = 'newpassword123 ' ;
195+ $ password = 'password ' . uniqid () ;
196196
197197 // Simulate user input for the console command
198198 $ this ->artisan ('very-basic-auth:password-generate ' )
199199 ->expectsQuestion ('Please enter a password for the very basic auth ' , $ password )
200200 ->expectsQuestion ('Please confirm your password ' , $ password )
201201 ->assertExitCode (0 );
202202
203- // Load and parse the .env file to get the new hash via Laravels env helper
204- $ hashedPassword = env ('BASIC_AUTH_PASSWORD ' );
203+ // Reload env-variables to make sure the newest value is available
204+ $ this ->artisan ('config:cache ' );
205+ $ hashedPassword = config ('very_basic_auth.password ' );
205206
206207 expect ($ hashedPassword )->not ->toBeNull ();
207208 expect (app ()->make ('hash ' )->check ($ password , $ hashedPassword ))->toBeTrue ();
You can’t perform that action at this time.
0 commit comments