-
Notifications
You must be signed in to change notification settings - Fork 0
[55] fix admin name question option #75
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
base: main
Are you sure you want to change the base?
Changes from 9 commits
793d3ed
d958860
cc56666
02d8964
c7014a4
e2ab430
6c7eb99
6986207
7bd4375
6b31184
5d72f2f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -428,22 +428,26 @@ protected function runMigrations(): void | |||||
|
|
||||||
| protected function createAdminUser(string $kebabName, string $serviceKey = '', string $serviceName = ''): array | ||||||
| { | ||||||
| $adminEmail = when(empty($serviceKey), "admin@{$kebabName}.com", "admin.{$serviceKey}@{$kebabName}.com"); | ||||||
| $isServiceAdmin = (!empty($serviceKey) && !empty($serviceName)); | ||||||
|
|
||||||
| $adminEmail = when($isServiceAdmin, "admin.{$serviceKey}@{$kebabName}.com", "admin@{$kebabName}.com"); | ||||||
| $defaultPassword = substr(md5(uniqid()), 0, 8); | ||||||
|
|
||||||
| $serviceLabel = when(!empty($serviceName), " for {$serviceName}"); | ||||||
| $serviceLabel = when($isServiceAdmin, " for {$serviceName}"); | ||||||
|
||||||
| $serviceLabel = when($isServiceAdmin, " for {$serviceName}"); | |
| $serviceLabel = when($isServiceAdmin, " for {$serviceName}", ''); |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -2,7 +2,10 @@ | |||||
|
|
||||||
| namespace RonasIT\ProjectInitializator\Tests; | ||||||
|
|
||||||
| use RonasIT\ProjectInitializator\Commands\InitCommand; | ||||||
| use RonasIT\ProjectInitializator\Tests\Support\Traits\InitCommandMockTrait; | ||||||
| use Symfony\Component\Console\Application; | ||||||
| use Symfony\Component\Console\Tester\CommandTester; | ||||||
|
|
||||||
| class InitCommandTest extends TestCase | ||||||
| { | ||||||
|
|
@@ -926,4 +929,142 @@ public function testRunWithClerkAdditionalAdminsWithoutDefaultAdmin(): void | |||||
| ->expectsConfirmation('Do you want to uninstall project-initializator package?') | ||||||
| ->assertExitCode(0); | ||||||
| } | ||||||
|
|
||||||
| public function testDefaultAdminsCredentialsNoneAuth() | ||||||
|
||||||
| public function testDefaultAdminsCredentialsNoneAuth() | |
| public function testDefaultAdminsCredentialsNoneAuth(): void |
Outdated
Copilot
AI
Nov 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test method is missing the : void return type declaration. For consistency with other recently added test methods in this file (like testRunWithClerkMobileAppWithPintInstalled and testRunWithClerkAdditionalAdminsWithoutDefaultAdmin), this method should include the return type.
Add : void after the method signature:
public function testDefaultAdminsCredentialsClerkAuth(): void| public function testDefaultAdminsCredentialsClerkAuth() | |
| public function testDefaultAdminsCredentialsClerkAuth(): void |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| <?php | ||
|
|
||
| use Illuminate\Database\Migrations\Migration; | ||
| use Illuminate\Support\Facades\App; | ||
| use Illuminate\Support\Facades\DB; | ||
| use Illuminate\Support\Facades\Hash; | ||
|
|
||
| return new class extends Migration | ||
| { | ||
| public function up(): void | ||
| { | ||
| if (!App::environment('testing')) { | ||
| DB::table('admins')->insert([ | ||
| 'email' => 'admin@my-app.com', | ||
| 'password' => Hash::make('123456'), | ||
| ]); | ||
| } | ||
| } | ||
|
|
||
| public function down(): void | ||
| { | ||
| if (!App::environment('testing')) { | ||
| DB::table('admins') | ||
| ->where('email', 'admin@my-app.com') | ||
| ->delete(); | ||
| } | ||
| } | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| <?php | ||
|
|
||
| use Illuminate\Database\Migrations\Migration; | ||
| use Illuminate\Support\Facades\App; | ||
| use Illuminate\Support\Facades\DB; | ||
| use Illuminate\Support\Facades\Hash; | ||
|
|
||
| return new class extends Migration | ||
| { | ||
| public function up(): void | ||
| { | ||
| if (!App::environment('testing')) { | ||
| DB::table('admins')->insert([ | ||
| 'email' => 'admin.nova@my-app.com', | ||
| 'password' => Hash::make('123456'), | ||
| ]); | ||
| } | ||
| } | ||
|
|
||
| public function down(): void | ||
| { | ||
| if (!App::environment('testing')) { | ||
| DB::table('admins') | ||
| ->where('email', 'admin.nova@my-app.com') | ||
| ->delete(); | ||
| } | ||
| } | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| <?php | ||
|
|
||
| use Illuminate\Database\Migrations\Migration; | ||
| use Illuminate\Support\Facades\App; | ||
| use Illuminate\Support\Facades\DB; | ||
| use Illuminate\Support\Facades\Hash; | ||
|
|
||
| return new class extends Migration | ||
| { | ||
| public function up(): void | ||
| { | ||
| if (!App::environment('testing')) { | ||
| DB::table('admins')->insert([ | ||
| 'email' => 'admin.telescope@my-app.com', | ||
| 'password' => Hash::make('654321'), | ||
| ]); | ||
| } | ||
| } | ||
|
|
||
| public function down(): void | ||
| { | ||
| if (!App::environment('testing')) { | ||
| DB::table('admins') | ||
| ->where('email', 'admin.telescope@my-app.com') | ||
| ->delete(); | ||
| } | ||
| } | ||
| }; |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,40 @@ | ||||||
| # My App | ||||||
|
|
||||||
| This project implements an API for the My App Web app. | ||||||
|
|
||||||
| ## Project Resources & Contacts | ||||||
|
|
||||||
| This section provides quick links to various resources and contacts associated | ||||||
| with this project. It's here to streamline your navigation and communication | ||||||
| process, so you can efficiently find what you need or reach out to who you need. | ||||||
|
|
||||||
| ### Resources | ||||||
|
|
||||||
| Below are links to tools and services used in this project: | ||||||
| - [Laravel Telescope](): This is debug assistant for the Laravel framework. (will be added later) | ||||||
|
||||||
| - [Laravel Telescope](): This is debug assistant for the Laravel framework. (will be added later) | |
| - [Laravel Telescope](): This is a debug assistant for the Laravel framework. (will be added later) |
Outdated
Copilot
AI
Nov 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing article 'an' before 'admin panel'. Should be "This is an admin panel for the Laravel framework."
| - [Laravel Nova](): This is admin panel for the Laravel framework. (will be added later) | |
| - [Laravel Nova](): This is an admin panel for the Laravel framework. (will be added later) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| [ | ||
| "no", | ||
| "test@example.com", | ||
| "https://mysite.com", | ||
| "Web", | ||
| "clerk", | ||
| "yes", | ||
| null, | ||
| "123456", | ||
| "yes", | ||
| "yes", | ||
| "no", | ||
| "no", | ||
| "no", | ||
| "no", | ||
| "no", | ||
| "later", | ||
| "later", | ||
| "manager@mail.com", | ||
| "no", | ||
| "no", | ||
| "no", | ||
| "yes", | ||
| "no", | ||
| null, | ||
| "654321", | ||
| "no", | ||
| null, | ||
| "123456", | ||
| "no", | ||
| "no", | ||
| "no" | ||
| ] |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,38 @@ | ||||||
| # My App | ||||||
|
|
||||||
| This project implements an API for the My App Web app. | ||||||
|
|
||||||
| ## Project Resources & Contacts | ||||||
|
|
||||||
| This section provides quick links to various resources and contacts associated | ||||||
| with this project. It's here to streamline your navigation and communication | ||||||
| process, so you can efficiently find what you need or reach out to who you need. | ||||||
|
|
||||||
| ### Resources | ||||||
|
|
||||||
| Below are links to tools and services used in this project: | ||||||
| - [Laravel Telescope](): This is debug assistant for the Laravel framework. (will be added later) | ||||||
|
||||||
| - [Laravel Telescope](): This is debug assistant for the Laravel framework. (will be added later) | |
| - [Laravel Telescope](): This is a debug assistant for the Laravel framework. (will be added later) |
Outdated
Copilot
AI
Nov 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing article 'an' before 'admin panel'. Should be "This is an admin panel for the Laravel framework."
| - [Laravel Nova](): This is admin panel for the Laravel framework. (will be added later) | |
| - [Laravel Nova](): This is an admin panel for the Laravel framework. (will be added later) |
Uh oh!
There was an error while loading. Please reload this page.