Skip to content

Commit b2ced3a

Browse files
Merge branch 'chore/laravel-5.7-support' of github.com:michaeldyrynda/laravel-make-user into chore/laravel-5.7-support
2 parents e10b364 + d3b5642 commit b2ced3a

File tree

2 files changed

+12
-17
lines changed

2 files changed

+12
-17
lines changed

src/Console/Commands/MakeUser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function handle()
4242
$email = $this->ask("What is the new user's email address?");
4343
$name = $this->ask("What is the new user's name?") ?: '';
4444
$password = bcrypt($this->secret("What is the new user's password? (blank generates a random one)", str_random(32)));
45-
$sendReset = $this->confirm("Do you want to send a password reset email?");
45+
$sendReset = $this->confirm('Do you want to send a password reset email?');
4646

4747
while ($custom = $this->ask('Do you have any custom user fields to add? Field=Value (blank continues)', false)) {
4848
list($key, $value) = explode('=', $custom);

tests/MakeUserTest.php

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,28 @@
22

33
namespace Tests;
44

5-
use Illuminate\Support\Facades\Hash;
6-
use Illuminate\Support\Facades\Artisan;
7-
use Illuminate\Support\Facades\Notification;
8-
use Illuminate\Auth\Notifications\ResetPassword;
9-
105
class MakeUserTest extends TestCase
116
{
127
/** @test */
138
public function it_creates_a_new_user()
149
{
1510
$this->artisan('make:user')
16-
->expectsQuestion("What is the new user's email address?", "[email protected]")
17-
->expectsQuestion("What is the new user's name?", "Test User")
18-
->expectsQuestion("What is the new user's password? (blank generates a random one)", "")
19-
->expectsQuestion("Do you want to send a password reset email?", "no")
20-
->expectsQuestion("Do you have any custom user fields to add? Field=Value (blank continues)", "");
11+
->expectsQuestion("What is the new user's email address?", '[email protected]')
12+
->expectsQuestion("What is the new user's name?", 'Test User')
13+
->expectsQuestion("What is the new user's password? (blank generates a random one)", '')
14+
->expectsQuestion('Do you want to send a password reset email?', 'no')
15+
->expectsQuestion('Do you have any custom user fields to add? Field=Value (blank continues)', '');
2116
}
2217

2318
/** @test */
2419
public function it_creates_a_new_user_with_additional_fields()
2520
{
2621
$this->artisan('make:user')
27-
->expectsQuestion("What is the new user's email address?", "[email protected]")
28-
->expectsQuestion("What is the new user's name?", "Test User")
29-
->expectsQuestion("What is the new user's password? (blank generates a random one)", "")
30-
->expectsQuestion("Do you want to send a password reset email?", "no")
31-
->expectsQuestion("Do you have any custom user fields to add? Field=Value (blank continues)", "field=value")
32-
->expectsQuestion("Do you have any custom user fields to add? Field=Value (blank continues)", "");
22+
->expectsQuestion("What is the new user's email address?", '[email protected]')
23+
->expectsQuestion("What is the new user's name?", 'Test User')
24+
->expectsQuestion("What is the new user's password? (blank generates a random one)", '')
25+
->expectsQuestion('Do you want to send a password reset email?', 'no')
26+
->expectsQuestion('Do you have any custom user fields to add? Field=Value (blank continues)', 'field=value')
27+
->expectsQuestion('Do you have any custom user fields to add? Field=Value (blank continues)', '');
3328
}
3429
}

0 commit comments

Comments
 (0)