-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Michael Dyrynda <[email protected]>
- Loading branch information
1 parent
044ea53
commit adcc756
Showing
5 changed files
with
87 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,54 @@ | ||
{ | ||
"name": "dyrynda/laravel-make-user", | ||
"description": "An Artisan console command to create users in your Laravel application.", | ||
"license": "MIT", | ||
"keywords": [ | ||
"laravel", | ||
"artisan", | ||
"console" | ||
], | ||
"authors": [ | ||
{ | ||
"name": "Michael Dyrynda", | ||
"email": "[email protected]", | ||
"homepage": "https://dyrynda.com.au" | ||
} | ||
], | ||
"require": { | ||
"php": "^8.1", | ||
"illuminate/support": "^10.0", | ||
"illuminate/console": "^10.0", | ||
"illuminate/database": "^10.0", | ||
"illuminate/auth": "^10.0", | ||
"illuminate/notifications": "^10.0" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Dyrynda\\Artisan\\": "src/" | ||
} | ||
}, | ||
"require-dev": { | ||
"mockery/mockery": "^1.4.4", | ||
"phpunit/phpunit": "^9.6.0 || ^10.0.7", | ||
"orchestra/testbench": "^8.0" | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"Tests\\": "tests/" | ||
} | ||
}, | ||
"minimum-stability": "dev", | ||
"extra": { | ||
"laravel": { | ||
"providers": [ | ||
"Dyrynda\\Artisan\\MakeUserServiceProvider" | ||
] | ||
} | ||
"name": "dyrynda/laravel-make-user", | ||
"description": "An Artisan console command to create users in your Laravel application.", | ||
"license": "MIT", | ||
"keywords": [ | ||
"laravel", | ||
"artisan", | ||
"console" | ||
], | ||
"authors": [ | ||
{ | ||
"name": "Michael Dyrynda", | ||
"email": "[email protected]", | ||
"homepage": "https://dyrynda.com.au" | ||
} | ||
], | ||
"require": { | ||
"php": "^8.1", | ||
"illuminate/support": "^10.0 || ^11.0", | ||
"illuminate/console": "^10.0 || ^11.0", | ||
"illuminate/database": "^10.0 || ^11.0", | ||
"illuminate/auth": "^10.0 || ^11.0", | ||
"illuminate/notifications": "^10.0 || ^11.0" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Dyrynda\\Artisan\\": "src/" | ||
} | ||
}, | ||
"require-dev": { | ||
"mockery/mockery": "^1.4.4", | ||
"orchestra/testbench": "^8.0 || ^9.0", | ||
"pestphp/pest": "^3.0" | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"Tests\\": "tests/" | ||
} | ||
}, | ||
"minimum-stability": "dev", | ||
"prefer-stable": true, | ||
"extra": { | ||
"laravel": { | ||
"providers": [ | ||
"Dyrynda\\Artisan\\MakeUserServiceProvider" | ||
] | ||
} | ||
}, | ||
"config": { | ||
"allow-plugins": { | ||
"pestphp/pest-plugin": true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,22 @@ | ||
<?php | ||
|
||
namespace Tests; | ||
it('creates a new user', function () { | ||
$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('Should the password be encrypted?', 'yes') | ||
->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)', ''); | ||
}); | ||
|
||
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('Should the password be encrypted?', 'yes') | ||
->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('Should the password be encrypted?', 'yes') | ||
->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)', ''); | ||
} | ||
} | ||
it('creates a new user with additional fields', function () { | ||
$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('Should the password be encrypted?', 'yes') | ||
->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)', ''); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php | ||
|
||
uses(Tests\TestCase::class)->in(__DIR__); |