Skip to content

Laravel 5.7 support #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Sep 6, 2018
Prev Previous commit
Next Next commit
Apply fixes from StyleCI
  • Loading branch information
michaeldyrynda authored and StyleCIBot committed Sep 6, 2018
commit d3b564279fff0a2e3fd2bbc9736f5535b4d034a7
2 changes: 1 addition & 1 deletion src/Console/Commands/MakeUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function handle()
$email = $this->ask("What is the new user's email address?");
$name = $this->ask("What is the new user's name?") ?: '';
$password = bcrypt($this->secret("What is the new user's password? (blank generates a random one)", str_random(32)));
$sendReset = $this->confirm("Do you want to send a password reset email?");
$sendReset = $this->confirm('Do you want to send a password reset email?');

while ($custom = $this->ask('Do you have any custom user fields to add? Field=Value (blank continues)', false)) {
list($key, $value) = explode('=', $custom);
Expand Down
27 changes: 11 additions & 16 deletions tests/MakeUserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,28 @@

namespace Tests;

use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Notification;
use Illuminate\Auth\Notifications\ResetPassword;

class MakeUserTest extends TestCase
{
/** @test */
public function it_creates_a_new_user()
{
$this->artisan('make:user')
->expectsQuestion("What is the new user's email address?", "[email protected]")
->expectsQuestion("What is the new user's name?", "Test User")
->expectsQuestion("What is the new user's password? (blank generates a random one)", "")
->expectsQuestion("Do you want to send a password reset email?", "no")
->expectsQuestion("Do you have any custom user fields to add? Field=Value (blank continues)", "");
->expectsQuestion("What is the new user's email address?", '[email protected]')
->expectsQuestion("What is the new user's name?", 'Test User')
->expectsQuestion("What is the new user's password? (blank generates a random one)", '')
->expectsQuestion('Do you want to send a password reset email?', 'no')
->expectsQuestion('Do you have any custom user fields to add? Field=Value (blank continues)', '');
}

/** @test */
public function it_creates_a_new_user_with_additional_fields()
{
$this->artisan('make:user')
->expectsQuestion("What is the new user's email address?", "[email protected]")
->expectsQuestion("What is the new user's name?", "Test User")
->expectsQuestion("What is the new user's password? (blank generates a random one)", "")
->expectsQuestion("Do you want to send a password reset email?", "no")
->expectsQuestion("Do you have any custom user fields to add? Field=Value (blank continues)", "field=value")
->expectsQuestion("Do you have any custom user fields to add? Field=Value (blank continues)", "");
->expectsQuestion("What is the new user's email address?", '[email protected]')
->expectsQuestion("What is the new user's name?", 'Test User')
->expectsQuestion("What is the new user's password? (blank generates a random one)", '')
->expectsQuestion('Do you want to send a password reset email?', 'no')
->expectsQuestion('Do you have any custom user fields to add? Field=Value (blank continues)', 'field=value')
->expectsQuestion('Do you have any custom user fields to add? Field=Value (blank continues)', '');
}
}