From d596bcefa5c25d2831bae2ced75b16e4300b4552 Mon Sep 17 00:00:00 2001 From: RT Filefabrik Date: Mon, 19 Aug 2024 15:43:51 +0200 Subject: [PATCH 01/13] codeclimate v1.0.7 --- .codeclimate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.codeclimate.yml b/.codeclimate.yml index bc3b7b1..32e85f7 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -1,7 +1,7 @@ exclude_patterns: - ".github/" - ".idea/" - - "stubs/**" + - "stubs/" - "tests/" - "**/vendor/" - "**/node_modules/" From 304c9897c1ef56be85d9af1b792f94a8cfc89e6b Mon Sep 17 00:00:00 2001 From: RT Filefabrik Date: Tue, 20 Aug 2024 08:00:57 +0200 Subject: [PATCH 02/13] exclude codeclimate pattern v1.0.7 --- .codeclimate.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.codeclimate.yml b/.codeclimate.yml index 32e85f7..b656050 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -2,6 +2,7 @@ exclude_patterns: - ".github/" - ".idea/" - "stubs/" + - "*.stub" - "tests/" - "**/vendor/" - "**/node_modules/" From 7efd3e0703cb7c2eea65810ef6902047e8aa0247 Mon Sep 17 00:00:00 2001 From: RT Filefabrik Date: Tue, 20 Aug 2024 08:01:18 +0200 Subject: [PATCH 03/13] version bump v1.0.7 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 60df987..d536491 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "filefabrik/paxsy", "description": "Software-Packaging your Laravel apps from https://paxsy.filefabrik.com", - "version": "v1.0.6", + "version": "v1.0.7", "keywords": [ "laravel", "laravel 11", From 8dee6a7fab6d05b1c991ebdaf40ad2a295f2773e Mon Sep 17 00:00:00 2001 From: RT Filefabrik Date: Tue, 20 Aug 2024 08:10:51 +0200 Subject: [PATCH 04/13] msg sprintf v1.0.7 --- src/Console/Commands/Make/MakePackage.php | 41 +++++++++-------- .../Commands/Make/MakePackageStack.php | 45 ++++++++++--------- 2 files changed, 48 insertions(+), 38 deletions(-) diff --git a/src/Console/Commands/Make/MakePackage.php b/src/Console/Commands/Make/MakePackage.php index 6f195d8..d2c9fc4 100644 --- a/src/Console/Commands/Make/MakePackage.php +++ b/src/Console/Commands/Make/MakePackage.php @@ -42,12 +42,13 @@ class MakePackage extends Command */ public function handle(): int { - foreach (['stageArguments', - 'stageVendorPackage', - 'stageStubsConfig', - 'stageStubs', - 'stageStubsDirectory', - 'stageReplaceableVars'] as $method) { + /** @var callable $method */ + foreach (['stageArguments', + 'stageVendorPackage', + 'stageStubsConfig', + 'stageStubs', + 'stageStubsDirectory', + 'stageReplaceableVars'] as $method) { if (! $this->{$method}()) { return self::FAILURE; } @@ -74,8 +75,8 @@ public function handle(): int return self::SUCCESS; } - protected function stageArguments() - { + protected function stageArguments(): ?true + { [$vendor, $package, $selectedStubsSet] = $this->inputArguments(); if (! $vendor || ! $package || ! $selectedStubsSet) { $this->error(sprintf( @@ -95,8 +96,12 @@ protected function stageArguments() return true; } - protected function stageVendorPackage() - { + /** + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface + */ + protected function stageVendorPackage(): bool + { // todo must have the Package context, which has the Package Stack $newPackage = new VendorPackageNames( vendor : $this->stageVars['vendor'], @@ -125,16 +130,16 @@ protected function stageVendorPackage() return true; } - protected function stageStubsConfig() - { + protected function stageStubsConfig(): FromConfig + { /** * Semi-Validation */ return $this->stageVars['stubsConfig'] = new FromConfig($this->stageVars['selectedStubsSet']); } - protected function stageStubs() - { + protected function stageStubs(): ?true + { $stubs = $this->stageVars['stubsConfig']->stubs(); if (! $stubs) { @@ -154,8 +159,8 @@ protected function stageStubs() return true; } - protected function stageStubsDirectory() - { + protected function stageStubsDirectory(): ?true + { $stubsDirectory = $this->stageVars['stubsConfig']->directory(); if (! $stubsDirectory) { @@ -174,8 +179,8 @@ protected function stageStubsDirectory() return true; } - protected function stageReplaceableVars() - { + protected function stageReplaceableVars(): array + { return $this->stageVars['replaceableVars'] = Facade::variables( vendorPackageNames: $this->stageVars['newPackage'], config : $this->stageVars['stubsConfig'], diff --git a/src/Console/Commands/Make/MakePackageStack.php b/src/Console/Commands/Make/MakePackageStack.php index 40aa229..e1fb7d4 100644 --- a/src/Console/Commands/Make/MakePackageStack.php +++ b/src/Console/Commands/Make/MakePackageStack.php @@ -14,32 +14,37 @@ */ class MakePackageStack extends Command { - protected $signature = 'paxsy:package-create'; + protected $signature = 'paxsy:package-create'; - protected $description = 'Initial a create directory where packages will be organized into'; + protected $description = 'Initial a create directory where packages will be organized into'; - public function handle(): int - { - $packageStack = StackApp::get(); + public function handle(): int + { + $packageStack = StackApp::get(); - if (! $packageStack->exists()) { - $packageStack->ensureStackDirectoryExists(); + $stackName = $packageStack->getStackName(); + $stackBasePath = $packageStack->getStackBasePath(); - // todo would you like to publish configs before. so you can customize some stuff if need - $this->line('php artisan vendor:publish --tag=paxsy-config'); + if (!$packageStack->exists()) { + $packageStack->ensureStackDirectoryExists(); - $successfully = 'Package Stack "'.$packageStack->getStackName().'" created successfully in your laravel: "'.$packageStack->getStackBasePath().'"!'; + // todo would you like to publish configs before. so you can customize some stuff if need + $this->line('php artisan vendor:publish --tag=paxsy-config'); - $this->getOutput() - ->title($successfully) - ; + $successfully = + sprintf('Package Stack "%s" created successfully in your laravel: "%s"!', $stackName, $stackBasePath); - return self::SUCCESS; - } - $this->getOutput() - ->title('Package Stack "'.$packageStack->getStackName().'" already exists in your laravel: "'.$packageStack->getStackBasePath().'"!') - ; + $this->getOutput() + ->title($successfully) + ; - return self::SUCCESS; - } + return self::SUCCESS; + } + $msg = sprintf('Package Stack "%s" already exists in your laravel: "%s"!', $stackName, $stackBasePath); + $this->getOutput() + ->title($msg) + ; + + return self::SUCCESS; + } } From b7a010559226ff6853d8933e616228b7dbb74828 Mon Sep 17 00:00:00 2001 From: RT Filefabrik Date: Tue, 20 Aug 2024 08:13:51 +0200 Subject: [PATCH 05/13] namings v1.0.7 --- src/Support/VendorPackageNames.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Support/VendorPackageNames.php b/src/Support/VendorPackageNames.php index abb6e22..3d532fe 100644 --- a/src/Support/VendorPackageNames.php +++ b/src/Support/VendorPackageNames.php @@ -22,7 +22,7 @@ class VendorPackageNames { /** - * From config('stack_name') /app-modules/ + * From config('stack_name') /app-paxsy/ * * @var string|null */ From 270c648a4de1212bf66909facf392306f97c30aa Mon Sep 17 00:00:00 2001 From: RT Filefabrik Date: Tue, 20 Aug 2024 08:26:07 +0200 Subject: [PATCH 06/13] kosmetik v1.0.7 --- src/Support/Stubs/StubsWriter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Support/Stubs/StubsWriter.php b/src/Support/Stubs/StubsWriter.php index c7b07be..85689f5 100644 --- a/src/Support/Stubs/StubsWriter.php +++ b/src/Support/Stubs/StubsWriter.php @@ -87,7 +87,7 @@ public function writeFile(string $destinationPath, $stubPath): bool // todo perhaps flag force or re-create all files if ($this->filesystem->exists($filename)) { - $this->line(" - Skipping {$destinationPath} (already exists)"); + $this->line(sprintf(' - Skipping %s (already exists)',$destinationPath)); return false; } @@ -97,7 +97,7 @@ public function writeFile(string $destinationPath, $stubPath): bool $this->filesystem->ensureDirectoryExists($out); $this->filesystem->put($filename, $output); - $this->line(" — Wrote to {$destinationPath}"); + $this->line(sprintf(' — Wrote file %s into %s',$destinationPath,$out)); return true; } From 1982183bfe76340fc102c59c9f811e172a4247f3 Mon Sep 17 00:00:00 2001 From: Filefabrik Date: Tue, 20 Aug 2024 06:28:34 +0000 Subject: [PATCH 07/13] Fix styling changes --- src/Console/Commands/Make/MakePackage.php | 36 +++++++------- .../Commands/Make/MakePackageStack.php | 47 +++++++++---------- src/Support/Stubs/StubsWriter.php | 4 +- 3 files changed, 43 insertions(+), 44 deletions(-) diff --git a/src/Console/Commands/Make/MakePackage.php b/src/Console/Commands/Make/MakePackage.php index d2c9fc4..d3f2e36 100644 --- a/src/Console/Commands/Make/MakePackage.php +++ b/src/Console/Commands/Make/MakePackage.php @@ -42,13 +42,13 @@ class MakePackage extends Command */ public function handle(): int { - /** @var callable $method */ - foreach (['stageArguments', - 'stageVendorPackage', - 'stageStubsConfig', - 'stageStubs', - 'stageStubsDirectory', - 'stageReplaceableVars'] as $method) { + /** @var callable $method */ + foreach (['stageArguments', + 'stageVendorPackage', + 'stageStubsConfig', + 'stageStubs', + 'stageStubsDirectory', + 'stageReplaceableVars'] as $method) { if (! $this->{$method}()) { return self::FAILURE; } @@ -76,7 +76,7 @@ public function handle(): int } protected function stageArguments(): ?true - { + { [$vendor, $package, $selectedStubsSet] = $this->inputArguments(); if (! $vendor || ! $package || ! $selectedStubsSet) { $this->error(sprintf( @@ -96,12 +96,12 @@ protected function stageArguments(): ?true return true; } - /** - * @throws ContainerExceptionInterface - * @throws NotFoundExceptionInterface - */ - protected function stageVendorPackage(): bool - { + /** + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface + */ + protected function stageVendorPackage(): bool + { // todo must have the Package context, which has the Package Stack $newPackage = new VendorPackageNames( vendor : $this->stageVars['vendor'], @@ -131,7 +131,7 @@ protected function stageVendorPackage(): bool } protected function stageStubsConfig(): FromConfig - { + { /** * Semi-Validation */ @@ -139,7 +139,7 @@ protected function stageStubsConfig(): FromConfig } protected function stageStubs(): ?true - { + { $stubs = $this->stageVars['stubsConfig']->stubs(); if (! $stubs) { @@ -160,7 +160,7 @@ protected function stageStubs(): ?true } protected function stageStubsDirectory(): ?true - { + { $stubsDirectory = $this->stageVars['stubsConfig']->directory(); if (! $stubsDirectory) { @@ -180,7 +180,7 @@ protected function stageStubsDirectory(): ?true } protected function stageReplaceableVars(): array - { + { return $this->stageVars['replaceableVars'] = Facade::variables( vendorPackageNames: $this->stageVars['newPackage'], config : $this->stageVars['stubsConfig'], diff --git a/src/Console/Commands/Make/MakePackageStack.php b/src/Console/Commands/Make/MakePackageStack.php index e1fb7d4..94d3aff 100644 --- a/src/Console/Commands/Make/MakePackageStack.php +++ b/src/Console/Commands/Make/MakePackageStack.php @@ -14,37 +14,36 @@ */ class MakePackageStack extends Command { - protected $signature = 'paxsy:package-create'; + protected $signature = 'paxsy:package-create'; - protected $description = 'Initial a create directory where packages will be organized into'; + protected $description = 'Initial a create directory where packages will be organized into'; - public function handle(): int - { - $packageStack = StackApp::get(); + public function handle(): int + { + $packageStack = StackApp::get(); - $stackName = $packageStack->getStackName(); - $stackBasePath = $packageStack->getStackBasePath(); + $stackName = $packageStack->getStackName(); + $stackBasePath = $packageStack->getStackBasePath(); - if (!$packageStack->exists()) { - $packageStack->ensureStackDirectoryExists(); + if (! $packageStack->exists()) { + $packageStack->ensureStackDirectoryExists(); - // todo would you like to publish configs before. so you can customize some stuff if need - $this->line('php artisan vendor:publish --tag=paxsy-config'); + // todo would you like to publish configs before. so you can customize some stuff if need + $this->line('php artisan vendor:publish --tag=paxsy-config'); - $successfully = - sprintf('Package Stack "%s" created successfully in your laravel: "%s"!', $stackName, $stackBasePath); + $successfully = sprintf('Package Stack "%s" created successfully in your laravel: "%s"!', $stackName, $stackBasePath); - $this->getOutput() - ->title($successfully) - ; + $this->getOutput() + ->title($successfully) + ; - return self::SUCCESS; - } - $msg = sprintf('Package Stack "%s" already exists in your laravel: "%s"!', $stackName, $stackBasePath); - $this->getOutput() - ->title($msg) - ; + return self::SUCCESS; + } + $msg = sprintf('Package Stack "%s" already exists in your laravel: "%s"!', $stackName, $stackBasePath); + $this->getOutput() + ->title($msg) + ; - return self::SUCCESS; - } + return self::SUCCESS; + } } diff --git a/src/Support/Stubs/StubsWriter.php b/src/Support/Stubs/StubsWriter.php index 85689f5..c0b6a00 100644 --- a/src/Support/Stubs/StubsWriter.php +++ b/src/Support/Stubs/StubsWriter.php @@ -87,7 +87,7 @@ public function writeFile(string $destinationPath, $stubPath): bool // todo perhaps flag force or re-create all files if ($this->filesystem->exists($filename)) { - $this->line(sprintf(' - Skipping %s (already exists)',$destinationPath)); + $this->line(sprintf(' - Skipping %s (already exists)', $destinationPath)); return false; } @@ -97,7 +97,7 @@ public function writeFile(string $destinationPath, $stubPath): bool $this->filesystem->ensureDirectoryExists($out); $this->filesystem->put($filename, $output); - $this->line(sprintf(' — Wrote file %s into %s',$destinationPath,$out)); + $this->line(sprintf(' — Wrote file %s into %s', $destinationPath, $out)); return true; } From fcd8cd96da915b68bf32e695d6c280c87be7844e Mon Sep 17 00:00:00 2001 From: RT Filefabrik Date: Tue, 20 Aug 2024 09:24:53 +0200 Subject: [PATCH 08/13] kosmetik v1.0.7 --- src/Console/Commands/Admin/Menus.php | 6 +++--- tests/Datasets/MainMenu.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Console/Commands/Admin/Menus.php b/src/Console/Commands/Admin/Menus.php index d274895..90dcd15 100644 --- a/src/Console/Commands/Admin/Menus.php +++ b/src/Console/Commands/Admin/Menus.php @@ -17,9 +17,9 @@ class Menus * @var array[] */ public static array $mainMenu = [ - ['label' => 'Package components', 'method' => 'handle_package'], - ['label' => 'create Package', 'method' => 'create_package'], - ['label' => 'list Packages', 'method' => 'list_packages'], + ['label' => 'add components', 'method' => 'handle_package'], + ['label' => 'new laravel composer package', 'method' => 'create_package'], + ['label' => 'list packages', 'method' => 'list_packages'], // Handle composer Package into the Laravel-Host ['label' => 'add VendorPackage with there Repository (Laravel Host Composer )', 'method' => 'composer_add_repository_vendor_package'], ['label' => 'remove VendorPackage with there Repository (Laravel Host Composer)', 'method' => 'composer_remove_repository_vendor_package'], diff --git a/tests/Datasets/MainMenu.php b/tests/Datasets/MainMenu.php index c0b9682..09449ad 100644 --- a/tests/Datasets/MainMenu.php +++ b/tests/Datasets/MainMenu.php @@ -6,8 +6,8 @@ dataset( 'main menu', [ - ['label' => 'Package components', 'method' => 'handle_package'], - ['label' => 'create Package', 'method' => 'create_package'], + ['label' => 'add components', 'method' => 'handle_package'], + ['label' => 'new laravel composer package', 'method' => 'create_package'], ['label' => 'list Packages', 'method' => 'list_packages'], // Handle composer Package into the Laravel-Host ['label' => 'add VendorPackage with there Repository (Laravel Host Composer )', 'method' => 'composer_add_repository_vendor_package'], From 40c85eacc3ac2aea2618355d5d74e73435f08515 Mon Sep 17 00:00:00 2001 From: RT Filefabrik Date: Tue, 20 Aug 2024 18:58:18 +0200 Subject: [PATCH 09/13] kosmetik v1.0.7 --- tests/Datasets/MainMenu.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Datasets/MainMenu.php b/tests/Datasets/MainMenu.php index 09449ad..733f374 100644 --- a/tests/Datasets/MainMenu.php +++ b/tests/Datasets/MainMenu.php @@ -8,7 +8,7 @@ [ ['label' => 'add components', 'method' => 'handle_package'], ['label' => 'new laravel composer package', 'method' => 'create_package'], - ['label' => 'list Packages', 'method' => 'list_packages'], + ['label' => 'list packages', 'method' => 'list_packages'], // Handle composer Package into the Laravel-Host ['label' => 'add VendorPackage with there Repository (Laravel Host Composer )', 'method' => 'composer_add_repository_vendor_package'], ['label' => 'remove VendorPackage with there Repository (Laravel Host Composer)', 'method' => 'composer_remove_repository_vendor_package'], From 6c5e902095705fb178b50dc5b809c8c7ddeb89f5 Mon Sep 17 00:00:00 2001 From: RT Filefabrik Date: Tue, 20 Aug 2024 19:02:26 +0200 Subject: [PATCH 10/13] fixing renames v1.0.7 --- src/Console/Commands/Admin/Inputs.php | 2 +- tests/Unit/Console/Commands/PaxsyCommandTest.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Console/Commands/Admin/Inputs.php b/src/Console/Commands/Admin/Inputs.php index fb553b9..2dab410 100644 --- a/src/Console/Commands/Admin/Inputs.php +++ b/src/Console/Commands/Admin/Inputs.php @@ -55,7 +55,7 @@ public static function suggestComposerVendors(...$params): int|string } return suggest( - label : '"your-vendor-name" of the Package', + label : '"your-vendor-name" of the package', options: fn($value) => (new Collection($opts)) ->filter(fn($title) => str_contains(Str::lower($title), Str::lower($value))) ->all(), diff --git a/tests/Unit/Console/Commands/PaxsyCommandTest.php b/tests/Unit/Console/Commands/PaxsyCommandTest.php index 5297447..ec23572 100644 --- a/tests/Unit/Console/Commands/PaxsyCommandTest.php +++ b/tests/Unit/Console/Commands/PaxsyCommandTest.php @@ -11,7 +11,7 @@ /** @copyright-header * */ beforeEach(function() { // todo all reset for make:package into function ... - + currentStackName(); removePackageStack(); rerouteStubsDirectory(); @@ -83,8 +83,8 @@ function() { useShellDisabled(); $this->artisan('paxsy') - ->expectsQuestion('Paxsy Menu', 'create Package') - ->expectsQuestion('"your-vendor-name" of the Package', 'PaxsyVendorName') + ->expectsQuestion('Paxsy Menu', 'new laravel composer package') + ->expectsQuestion('"your-vendor-name" of the package', 'PaxsyVendorName') ->expectsQuestion('Name of your package?', 'PackEdgeName') ->expectsQuestion( 'Choose the "make" command for your "paxsy-vendor-name/pack-edge-name" Package?', From ebc54aa6d254a4821e34bda6148f106cf06c7f35 Mon Sep 17 00:00:00 2001 From: RT Filefabrik Date: Tue, 20 Aug 2024 19:08:43 +0200 Subject: [PATCH 11/13] fixing renames v1.0.7 --- tests/Unit/Console/Commands/PaxsyCommandTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/Unit/Console/Commands/PaxsyCommandTest.php b/tests/Unit/Console/Commands/PaxsyCommandTest.php index ec23572..93c2169 100644 --- a/tests/Unit/Console/Commands/PaxsyCommandTest.php +++ b/tests/Unit/Console/Commands/PaxsyCommandTest.php @@ -43,7 +43,7 @@ function() { $this->artisan('paxsy') ->expectsQuestion('Paxsy Menu', 'create_package') - ->expectsQuestion('"your-vendor-name" of the Package', '') + ->expectsQuestion('"your-vendor-name" of the package', '') ->assertExitCode(1) ; }, @@ -56,7 +56,7 @@ function() { $this->artisan('paxsy') ->expectsQuestion('Paxsy Menu', 'create_package') - ->expectsQuestion('"your-vendor-name" of the Package', 'testVendor') + ->expectsQuestion('"your-vendor-name" of the package', 'testVendor') ->expectsQuestion('Name of your package?', '') ->assertExitCode(1) ; @@ -211,7 +211,7 @@ function() { config()->set('paxsy.ui_default_vendor'); $this->artisan('paxsy') ->expectsQuestion('Paxsy Menu', 'create_package') - ->expectsQuestion('"your-vendor-name" of the Package', 't') + ->expectsQuestion('"your-vendor-name" of the package', 't') ->expectsQuestion('Name of your package?', 't') ->expectsQuestion('Choose the "make" command for your "t/t" Package?', PaxsyCommand::QUIT) ->expectsQuestion('Paxsy Menu', PaxsyCommand::QUIT) @@ -233,7 +233,7 @@ function() { $this->artisan('paxsy') ->expectsQuestion('Paxsy Menu', 'create Package') - ->expectsQuestion('"your-vendor-name" of the Package', 'PaxsyVendorName') + ->expectsQuestion('"your-vendor-name" of the package', 'PaxsyVendorName') ->expectsQuestion('Name of your package?', 'PackEdgeName') ->expectsQuestion('Which preconfigured Stub-Set?', 'set2') ->expectsQuestion( From 77bba4ba1cfcdd68a0451c0d649760d02191ad12 Mon Sep 17 00:00:00 2001 From: RT Filefabrik Date: Tue, 20 Aug 2024 19:15:25 +0200 Subject: [PATCH 12/13] fixing renames v1.0.7 --- src/Console/Commands/PaxsyCommand.php | 2 +- .../Console/Commands/PaxsyCommandTest.php | 398 +++++++++--------- 2 files changed, 199 insertions(+), 201 deletions(-) diff --git a/src/Console/Commands/PaxsyCommand.php b/src/Console/Commands/PaxsyCommand.php index 9875616..aa87aa8 100644 --- a/src/Console/Commands/PaxsyCommand.php +++ b/src/Console/Commands/PaxsyCommand.php @@ -280,7 +280,7 @@ protected function nest_in_package(string $vendor_package_name): int|string ->getPackage() ->toName() ; - $label = 'Choose the "make" command for your "'.$vendor_package_name.'" Package?'; + $label = sprintf( 'Choose the "make" command for your "%s" package?',$vendor_package_name); $command = Inputs::suggestMakeCommands($label); diff --git a/tests/Unit/Console/Commands/PaxsyCommandTest.php b/tests/Unit/Console/Commands/PaxsyCommandTest.php index 93c2169..1585ec2 100644 --- a/tests/Unit/Console/Commands/PaxsyCommandTest.php +++ b/tests/Unit/Console/Commands/PaxsyCommandTest.php @@ -6,242 +6,240 @@ /** @copyright-header * */ use Filefabrik\Paxsy\Console\Commands\PaxsyCommand; -use Filefabrik\Paxsy\Paxsy; /** @copyright-header * */ beforeEach(function() { - // todo all reset for make:package into function ... + // todo all reset for make:package into function ... - currentStackName(); - removePackageStack(); - rerouteStubsDirectory(); + currentStackName(); + removePackageStack(); + rerouteStubsDirectory(); }); it( - 'Paxsy command', - function() { - expect(class_exists(PaxsyCommand::class))->toBeTrue('Paxsy Admin Command exists'); - }, + 'Paxsy command', + function() { + expect(class_exists(PaxsyCommand::class))->toBeTrue('Paxsy Admin Command exists'); + }, ); it( - 'handle package with no packages', - function() { - // prevent from composer update - useShellDisabled(); - - $this->artisan('paxsy') - ->expectsQuestion('Paxsy Menu', 'handle_package') - ->assertExitCode(1) - ; - }, + 'handle package with no packages', + function() { + // prevent from composer update + useShellDisabled(); + + $this->artisan('paxsy') + ->expectsQuestion('Paxsy Menu', 'handle_package') + ->assertExitCode(1) + ; + }, ); it( - 'task create package missing vendor', - function() { - // prevent from composer update - useShellDisabled(); - - $this->artisan('paxsy') - ->expectsQuestion('Paxsy Menu', 'create_package') - ->expectsQuestion('"your-vendor-name" of the package', '') - ->assertExitCode(1) - ; - }, + 'task create package missing vendor', + function() { + // prevent from composer update + useShellDisabled(); + + $this->artisan('paxsy') + ->expectsQuestion('Paxsy Menu', 'create_package') + ->expectsQuestion('"your-vendor-name" of the package', '') + ->assertExitCode(1) + ; + }, ); it( - 'task create package missing package', - function() { - // prevent from composer update - useShellDisabled(); - - $this->artisan('paxsy') - ->expectsQuestion('Paxsy Menu', 'create_package') - ->expectsQuestion('"your-vendor-name" of the package', 'testVendor') - ->expectsQuestion('Name of your package?', '') - ->assertExitCode(1) - ; - }, + 'task create package missing package', + function() { + // prevent from composer update + useShellDisabled(); + + $this->artisan('paxsy') + ->expectsQuestion('Paxsy Menu', 'create_package') + ->expectsQuestion('"your-vendor-name" of the package', 'testVendor') + ->expectsQuestion('Name of your package?', '') + ->assertExitCode(1) + ; + }, ); it( - 'list vendor package', - function() { - // prevent from composer update - useShellDisabled(); - - $this->artisan('paxsy') - ->expectsQuestion('Paxsy Menu', 'list_packages') - ->expectsQuestion('Paxsy Menu', PaxsyCommand::QUIT) - ->assertExitCode(0) - ; - }, + 'list vendor package', + function() { + // prevent from composer update + useShellDisabled(); + + $this->artisan('paxsy') + ->expectsQuestion('Paxsy Menu', 'list_packages') + ->expectsQuestion('Paxsy Menu', PaxsyCommand::QUIT) + ->assertExitCode(0) + ; + }, ); it( - 'create Vendor Package', - function() { - // prevent from composer update - useShellDisabled(); - - $this->artisan('paxsy') - ->expectsQuestion('Paxsy Menu', 'new laravel composer package') - ->expectsQuestion('"your-vendor-name" of the package', 'PaxsyVendorName') - ->expectsQuestion('Name of your package?', 'PackEdgeName') - ->expectsQuestion( - 'Choose the "make" command for your "paxsy-vendor-name/pack-edge-name" Package?', - 'make:model', - ) - ->expectsQuestion('What should the model be named?', 'EdgyMododoodel') - ->expectsQuestion( - 'Choose the "make" command for your "paxsy-vendor-name/pack-edge-name" Package?', - PaxsyCommand::QUIT, - ) - ->expectsQuestion('Paxsy Menu', PaxsyCommand::QUIT) - ; - }, + 'create Vendor Package', + function() { + // prevent from composer update + useShellDisabled(); + + $this->artisan('paxsy') + ->expectsQuestion('Paxsy Menu', 'new laravel composer package') + ->expectsQuestion('"your-vendor-name" of the package', 'PaxsyVendorName') + ->expectsQuestion('Name of your package?', 'PackEdgeName') + ->expectsQuestion( + 'Choose the "make" command for your "paxsy-vendor-name/pack-edge-name" package?', + 'make:model', + ) + ->expectsQuestion('What should the model be named?', 'EdgyMododoodel') + ->expectsQuestion( + 'Choose the "make" command for your "paxsy-vendor-name/pack-edge-name" package?', + PaxsyCommand::QUIT, + ) + ->expectsQuestion('Paxsy Menu', PaxsyCommand::QUIT) + ; + }, ); it( - 'enable package', - function() { - // prevent from composer update - useShellDisabled(); - makePackageByArtisanCommand($this); - $this->artisan('paxsy') - ->expectsQuestion('Paxsy Menu', 'composer_add_repository_vendor_package') - ->expectsQuestion('package to call a make: command', 'paxsy-vendor-name/pack-edge-name') - ; - }, + 'enable package', + function() { + // prevent from composer update + useShellDisabled(); + makePackageByArtisanCommand($this); + $this->artisan('paxsy') + ->expectsQuestion('Paxsy Menu', 'composer_add_repository_vendor_package') + ->expectsQuestion('package to call a make: command', 'paxsy-vendor-name/pack-edge-name') + ; + }, ); it( - 'jump into but quit', - function() { - // prevent from composer update - useShellDisabled(); - makePackageByArtisanCommand($this); - - $this->artisan('paxsy') - ->expectsQuestion('Paxsy Menu', 'handle_package') - ->expectsQuestion('package to call a make: command', PaxsyCommand::QUIT) - - //->expectsQuestion('Paxsy Menu', PaxsyCommand::QUIT) - ->assertExitCode(0) - ; - }, + 'jump into but quit', + function() { + // prevent from composer update + useShellDisabled(); + makePackageByArtisanCommand($this); + + $this->artisan('paxsy') + ->expectsQuestion('Paxsy Menu', 'handle_package') + ->expectsQuestion('package to call a make: command', PaxsyCommand::QUIT) + + //->expectsQuestion('Paxsy Menu', PaxsyCommand::QUIT) + ->assertExitCode(0) + ; + }, ); it( - 'handle selected task and quit', - function() { - // prevent from composer update - useShellDisabled(); - makePackageByArtisanCommand($this); - $defaultPackage = defaultTestPackage(); - $this->artisan('paxsy') - ->expectsQuestion('Paxsy Menu', 'handle_package') - ->expectsQuestion('package to call a make: command', $defaultPackage->vendorPackageName()) - ->expectsQuestion( - 'Choose the "make" command for your "'.$defaultPackage->vendorPackageName().'" Package?', - PaxsyCommand::QUIT, - ) - ->expectsQuestion('Paxsy Menu', PaxsyCommand::QUIT) - ->assertExitCode(0) - ; - }, + 'handle selected task and quit', + function() { + // prevent from composer update + useShellDisabled(); + makePackageByArtisanCommand($this); + $defaultPackage = defaultTestPackage(); + $this->artisan('paxsy') + ->expectsQuestion('Paxsy Menu', 'handle_package') + ->expectsQuestion('package to call a make: command', $defaultPackage->vendorPackageName()) + ->expectsQuestion( + 'Choose the "make" command for your "' . $defaultPackage->vendorPackageName() . '" package?', + PaxsyCommand::QUIT, + ) + ->expectsQuestion('Paxsy Menu', PaxsyCommand::QUIT) + ->assertExitCode(0) + ; + }, ); it( - 'simply composer update', - function() { - // prevent from composer update - useShellDisabled(); - makePackageByArtisanCommand($this); - $this->artisan('paxsy') - ->expectsQuestion('Paxsy Menu', 'composer_update') - ->expectsQuestion('Paxsy Menu', PaxsyCommand::QUIT) - ->assertExitCode(0) - ; - }, + 'simply composer update', + function() { + // prevent from composer update + useShellDisabled(); + makePackageByArtisanCommand($this); + $this->artisan('paxsy') + ->expectsQuestion('Paxsy Menu', 'composer_update') + ->expectsQuestion('Paxsy Menu', PaxsyCommand::QUIT) + ->assertExitCode(0) + ; + }, ); it( - 'composer remove repository vendor package', - function() { - // prevent from composer update - useShellDisabled(); - makePackageByArtisanCommand($this); - $defaultPackage = defaultTestPackage(); - $this->artisan('paxsy') - ->expectsQuestion('Paxsy Menu', 'composer_remove_repository_vendor_package') - ->expectsQuestion('package to call a make: command', $defaultPackage->vendorPackageName()) - ->expectsQuestion('Paxsy Menu', PaxsyCommand::QUIT) - ->assertExitCode(0) - ; - }, + 'composer remove repository vendor package', + function() { + // prevent from composer update + useShellDisabled(); + makePackageByArtisanCommand($this); + $defaultPackage = defaultTestPackage(); + $this->artisan('paxsy') + ->expectsQuestion('Paxsy Menu', 'composer_remove_repository_vendor_package') + ->expectsQuestion('package to call a make: command', $defaultPackage->vendorPackageName()) + ->expectsQuestion('Paxsy Menu', PaxsyCommand::QUIT) + ->assertExitCode(0) + ; + }, ); it( - 'handle selected task with quit', - function() { - useShellDisabled(); - makePackageByArtisanCommand($this); - // $defaultPackage = defaultTestPackage(); - $this->artisan('paxsy') - ->expectsQuestion('Paxsy Menu', 'handle_package') - ->expectsQuestion('package to call a make: command', PaxsyCommand::QUIT) - ; - }, + 'handle selected task with quit', + function() { + useShellDisabled(); + makePackageByArtisanCommand($this); + // $defaultPackage = defaultTestPackage(); + $this->artisan('paxsy') + ->expectsQuestion('Paxsy Menu', 'handle_package') + ->expectsQuestion('package to call a make: command', PaxsyCommand::QUIT) + ; + }, ); it( - 'input vendor without ui', - function() { - useShellDisabled(); - - config()->set('paxsy.ui_vendor_select', ''); - config()->set('paxsy.ui_default_vendor', 'playvendor'); - $this->artisan('paxsy') - ->expectsQuestion('Paxsy Menu', 'create_package') - ->expectsQuestion('Name of your package?', '') - ->assertExitCode(1) - ; - }, + 'input vendor without ui', + function() { + useShellDisabled(); + + config()->set('paxsy.ui_vendor_select', ''); + config()->set('paxsy.ui_default_vendor', 'playvendor'); + $this->artisan('paxsy') + ->expectsQuestion('Paxsy Menu', 'create_package') + ->expectsQuestion('Name of your package?', '') + ->assertExitCode(1) + ; + }, ); it( - 'input vendor without ui and vendor not set', - function() { - useShellDisabled(); - - config()->set('paxsy.ui_vendor_select'); - config()->set('paxsy.ui_default_vendor'); - $this->artisan('paxsy') - ->expectsQuestion('Paxsy Menu', 'create_package') - ->expectsQuestion('"your-vendor-name" of the package', 't') - ->expectsQuestion('Name of your package?', 't') - ->expectsQuestion('Choose the "make" command for your "t/t" Package?', PaxsyCommand::QUIT) - ->expectsQuestion('Paxsy Menu', PaxsyCommand::QUIT) - ->assertExitCode(0) - ; - }, + 'input vendor without ui and vendor not set', + function() { + useShellDisabled(); + + config()->set('paxsy.ui_vendor_select'); + config()->set('paxsy.ui_default_vendor'); + $this->artisan('paxsy') + ->expectsQuestion('Paxsy Menu', 'create_package') + ->expectsQuestion('"your-vendor-name" of the package', 't') + ->expectsQuestion('Name of your package?', 't') + ->expectsQuestion('Choose the "make" command for your "t/t" package?', PaxsyCommand::QUIT) + ->expectsQuestion('Paxsy Menu', PaxsyCommand::QUIT) + ->assertExitCode(0) + ; + }, ); it( - 'multiple stubs sets', - function() { - $defStubsSet = config('paxsy.stub_sets.default'); - - config()->set( - 'paxsy.stub_sets', - ['set1' => $defStubsSet, 'set2' => $defStubsSet, 'set3' => $defStubsSet] - ); - // prevent from composer update - useShellDisabled(); - - $this->artisan('paxsy') - ->expectsQuestion('Paxsy Menu', 'create Package') - ->expectsQuestion('"your-vendor-name" of the package', 'PaxsyVendorName') - ->expectsQuestion('Name of your package?', 'PackEdgeName') - ->expectsQuestion('Which preconfigured Stub-Set?', 'set2') - ->expectsQuestion( - 'Choose the "make" command for your "paxsy-vendor-name/pack-edge-name" Package?', - PaxsyCommand::QUIT, - ) - - ->expectsQuestion('Paxsy Menu', PaxsyCommand::QUIT) - ; - }, + 'multiple stubs sets', + function() { + $defStubsSet = config('paxsy.stub_sets.default'); + + config()->set( + 'paxsy.stub_sets', + ['set1' => $defStubsSet, 'set2' => $defStubsSet, 'set3' => $defStubsSet], + ); + // prevent from composer update + useShellDisabled(); + + $this->artisan('paxsy') + ->expectsQuestion('Paxsy Menu', 'new laravel composer package') + ->expectsQuestion('"your-vendor-name" of the package', 'PaxsyVendorName') + ->expectsQuestion('Name of your package?', 'PackEdgeName') + ->expectsQuestion('Which preconfigured Stub-Set?', 'set2') + ->expectsQuestion( + 'Choose the "make" command for your "paxsy-vendor-name/pack-edge-name" package?', + PaxsyCommand::QUIT, + ) + ->expectsQuestion('Paxsy Menu', PaxsyCommand::QUIT) + ; + }, ); From 08134ad44a1e33df3139025e794667394f585be3 Mon Sep 17 00:00:00 2001 From: Filefabrik Date: Tue, 20 Aug 2024 17:15:56 +0000 Subject: [PATCH 13/13] Fix styling changes --- src/Console/Commands/PaxsyCommand.php | 2 +- .../Console/Commands/PaxsyCommandTest.php | 396 +++++++++--------- 2 files changed, 199 insertions(+), 199 deletions(-) diff --git a/src/Console/Commands/PaxsyCommand.php b/src/Console/Commands/PaxsyCommand.php index aa87aa8..b02639e 100644 --- a/src/Console/Commands/PaxsyCommand.php +++ b/src/Console/Commands/PaxsyCommand.php @@ -280,7 +280,7 @@ protected function nest_in_package(string $vendor_package_name): int|string ->getPackage() ->toName() ; - $label = sprintf( 'Choose the "make" command for your "%s" package?',$vendor_package_name); + $label = sprintf('Choose the "make" command for your "%s" package?', $vendor_package_name); $command = Inputs::suggestMakeCommands($label); diff --git a/tests/Unit/Console/Commands/PaxsyCommandTest.php b/tests/Unit/Console/Commands/PaxsyCommandTest.php index 1585ec2..34563fe 100644 --- a/tests/Unit/Console/Commands/PaxsyCommandTest.php +++ b/tests/Unit/Console/Commands/PaxsyCommandTest.php @@ -9,237 +9,237 @@ /** @copyright-header * */ beforeEach(function() { - // todo all reset for make:package into function ... + // todo all reset for make:package into function ... - currentStackName(); - removePackageStack(); - rerouteStubsDirectory(); + currentStackName(); + removePackageStack(); + rerouteStubsDirectory(); }); it( - 'Paxsy command', - function() { - expect(class_exists(PaxsyCommand::class))->toBeTrue('Paxsy Admin Command exists'); - }, + 'Paxsy command', + function() { + expect(class_exists(PaxsyCommand::class))->toBeTrue('Paxsy Admin Command exists'); + }, ); it( - 'handle package with no packages', - function() { - // prevent from composer update - useShellDisabled(); - - $this->artisan('paxsy') - ->expectsQuestion('Paxsy Menu', 'handle_package') - ->assertExitCode(1) - ; - }, + 'handle package with no packages', + function() { + // prevent from composer update + useShellDisabled(); + + $this->artisan('paxsy') + ->expectsQuestion('Paxsy Menu', 'handle_package') + ->assertExitCode(1) + ; + }, ); it( - 'task create package missing vendor', - function() { - // prevent from composer update - useShellDisabled(); - - $this->artisan('paxsy') - ->expectsQuestion('Paxsy Menu', 'create_package') - ->expectsQuestion('"your-vendor-name" of the package', '') - ->assertExitCode(1) - ; - }, + 'task create package missing vendor', + function() { + // prevent from composer update + useShellDisabled(); + + $this->artisan('paxsy') + ->expectsQuestion('Paxsy Menu', 'create_package') + ->expectsQuestion('"your-vendor-name" of the package', '') + ->assertExitCode(1) + ; + }, ); it( - 'task create package missing package', - function() { - // prevent from composer update - useShellDisabled(); - - $this->artisan('paxsy') - ->expectsQuestion('Paxsy Menu', 'create_package') - ->expectsQuestion('"your-vendor-name" of the package', 'testVendor') - ->expectsQuestion('Name of your package?', '') - ->assertExitCode(1) - ; - }, + 'task create package missing package', + function() { + // prevent from composer update + useShellDisabled(); + + $this->artisan('paxsy') + ->expectsQuestion('Paxsy Menu', 'create_package') + ->expectsQuestion('"your-vendor-name" of the package', 'testVendor') + ->expectsQuestion('Name of your package?', '') + ->assertExitCode(1) + ; + }, ); it( - 'list vendor package', - function() { - // prevent from composer update - useShellDisabled(); - - $this->artisan('paxsy') - ->expectsQuestion('Paxsy Menu', 'list_packages') - ->expectsQuestion('Paxsy Menu', PaxsyCommand::QUIT) - ->assertExitCode(0) - ; - }, + 'list vendor package', + function() { + // prevent from composer update + useShellDisabled(); + + $this->artisan('paxsy') + ->expectsQuestion('Paxsy Menu', 'list_packages') + ->expectsQuestion('Paxsy Menu', PaxsyCommand::QUIT) + ->assertExitCode(0) + ; + }, ); it( - 'create Vendor Package', - function() { - // prevent from composer update - useShellDisabled(); - - $this->artisan('paxsy') - ->expectsQuestion('Paxsy Menu', 'new laravel composer package') - ->expectsQuestion('"your-vendor-name" of the package', 'PaxsyVendorName') - ->expectsQuestion('Name of your package?', 'PackEdgeName') - ->expectsQuestion( - 'Choose the "make" command for your "paxsy-vendor-name/pack-edge-name" package?', - 'make:model', - ) - ->expectsQuestion('What should the model be named?', 'EdgyMododoodel') - ->expectsQuestion( - 'Choose the "make" command for your "paxsy-vendor-name/pack-edge-name" package?', - PaxsyCommand::QUIT, - ) - ->expectsQuestion('Paxsy Menu', PaxsyCommand::QUIT) - ; - }, + 'create Vendor Package', + function() { + // prevent from composer update + useShellDisabled(); + + $this->artisan('paxsy') + ->expectsQuestion('Paxsy Menu', 'new laravel composer package') + ->expectsQuestion('"your-vendor-name" of the package', 'PaxsyVendorName') + ->expectsQuestion('Name of your package?', 'PackEdgeName') + ->expectsQuestion( + 'Choose the "make" command for your "paxsy-vendor-name/pack-edge-name" package?', + 'make:model', + ) + ->expectsQuestion('What should the model be named?', 'EdgyMododoodel') + ->expectsQuestion( + 'Choose the "make" command for your "paxsy-vendor-name/pack-edge-name" package?', + PaxsyCommand::QUIT, + ) + ->expectsQuestion('Paxsy Menu', PaxsyCommand::QUIT) + ; + }, ); it( - 'enable package', - function() { - // prevent from composer update - useShellDisabled(); - makePackageByArtisanCommand($this); - $this->artisan('paxsy') - ->expectsQuestion('Paxsy Menu', 'composer_add_repository_vendor_package') - ->expectsQuestion('package to call a make: command', 'paxsy-vendor-name/pack-edge-name') - ; - }, + 'enable package', + function() { + // prevent from composer update + useShellDisabled(); + makePackageByArtisanCommand($this); + $this->artisan('paxsy') + ->expectsQuestion('Paxsy Menu', 'composer_add_repository_vendor_package') + ->expectsQuestion('package to call a make: command', 'paxsy-vendor-name/pack-edge-name') + ; + }, ); it( - 'jump into but quit', - function() { - // prevent from composer update - useShellDisabled(); - makePackageByArtisanCommand($this); - - $this->artisan('paxsy') - ->expectsQuestion('Paxsy Menu', 'handle_package') - ->expectsQuestion('package to call a make: command', PaxsyCommand::QUIT) - - //->expectsQuestion('Paxsy Menu', PaxsyCommand::QUIT) - ->assertExitCode(0) - ; - }, + 'jump into but quit', + function() { + // prevent from composer update + useShellDisabled(); + makePackageByArtisanCommand($this); + + $this->artisan('paxsy') + ->expectsQuestion('Paxsy Menu', 'handle_package') + ->expectsQuestion('package to call a make: command', PaxsyCommand::QUIT) + + //->expectsQuestion('Paxsy Menu', PaxsyCommand::QUIT) + ->assertExitCode(0) + ; + }, ); it( - 'handle selected task and quit', - function() { - // prevent from composer update - useShellDisabled(); - makePackageByArtisanCommand($this); - $defaultPackage = defaultTestPackage(); - $this->artisan('paxsy') - ->expectsQuestion('Paxsy Menu', 'handle_package') - ->expectsQuestion('package to call a make: command', $defaultPackage->vendorPackageName()) - ->expectsQuestion( - 'Choose the "make" command for your "' . $defaultPackage->vendorPackageName() . '" package?', - PaxsyCommand::QUIT, - ) - ->expectsQuestion('Paxsy Menu', PaxsyCommand::QUIT) - ->assertExitCode(0) - ; - }, + 'handle selected task and quit', + function() { + // prevent from composer update + useShellDisabled(); + makePackageByArtisanCommand($this); + $defaultPackage = defaultTestPackage(); + $this->artisan('paxsy') + ->expectsQuestion('Paxsy Menu', 'handle_package') + ->expectsQuestion('package to call a make: command', $defaultPackage->vendorPackageName()) + ->expectsQuestion( + 'Choose the "make" command for your "'.$defaultPackage->vendorPackageName().'" package?', + PaxsyCommand::QUIT, + ) + ->expectsQuestion('Paxsy Menu', PaxsyCommand::QUIT) + ->assertExitCode(0) + ; + }, ); it( - 'simply composer update', - function() { - // prevent from composer update - useShellDisabled(); - makePackageByArtisanCommand($this); - $this->artisan('paxsy') - ->expectsQuestion('Paxsy Menu', 'composer_update') - ->expectsQuestion('Paxsy Menu', PaxsyCommand::QUIT) - ->assertExitCode(0) - ; - }, + 'simply composer update', + function() { + // prevent from composer update + useShellDisabled(); + makePackageByArtisanCommand($this); + $this->artisan('paxsy') + ->expectsQuestion('Paxsy Menu', 'composer_update') + ->expectsQuestion('Paxsy Menu', PaxsyCommand::QUIT) + ->assertExitCode(0) + ; + }, ); it( - 'composer remove repository vendor package', - function() { - // prevent from composer update - useShellDisabled(); - makePackageByArtisanCommand($this); - $defaultPackage = defaultTestPackage(); - $this->artisan('paxsy') - ->expectsQuestion('Paxsy Menu', 'composer_remove_repository_vendor_package') - ->expectsQuestion('package to call a make: command', $defaultPackage->vendorPackageName()) - ->expectsQuestion('Paxsy Menu', PaxsyCommand::QUIT) - ->assertExitCode(0) - ; - }, + 'composer remove repository vendor package', + function() { + // prevent from composer update + useShellDisabled(); + makePackageByArtisanCommand($this); + $defaultPackage = defaultTestPackage(); + $this->artisan('paxsy') + ->expectsQuestion('Paxsy Menu', 'composer_remove_repository_vendor_package') + ->expectsQuestion('package to call a make: command', $defaultPackage->vendorPackageName()) + ->expectsQuestion('Paxsy Menu', PaxsyCommand::QUIT) + ->assertExitCode(0) + ; + }, ); it( - 'handle selected task with quit', - function() { - useShellDisabled(); - makePackageByArtisanCommand($this); - // $defaultPackage = defaultTestPackage(); - $this->artisan('paxsy') - ->expectsQuestion('Paxsy Menu', 'handle_package') - ->expectsQuestion('package to call a make: command', PaxsyCommand::QUIT) - ; - }, + 'handle selected task with quit', + function() { + useShellDisabled(); + makePackageByArtisanCommand($this); + // $defaultPackage = defaultTestPackage(); + $this->artisan('paxsy') + ->expectsQuestion('Paxsy Menu', 'handle_package') + ->expectsQuestion('package to call a make: command', PaxsyCommand::QUIT) + ; + }, ); it( - 'input vendor without ui', - function() { - useShellDisabled(); - - config()->set('paxsy.ui_vendor_select', ''); - config()->set('paxsy.ui_default_vendor', 'playvendor'); - $this->artisan('paxsy') - ->expectsQuestion('Paxsy Menu', 'create_package') - ->expectsQuestion('Name of your package?', '') - ->assertExitCode(1) - ; - }, + 'input vendor without ui', + function() { + useShellDisabled(); + + config()->set('paxsy.ui_vendor_select', ''); + config()->set('paxsy.ui_default_vendor', 'playvendor'); + $this->artisan('paxsy') + ->expectsQuestion('Paxsy Menu', 'create_package') + ->expectsQuestion('Name of your package?', '') + ->assertExitCode(1) + ; + }, ); it( - 'input vendor without ui and vendor not set', - function() { - useShellDisabled(); - - config()->set('paxsy.ui_vendor_select'); - config()->set('paxsy.ui_default_vendor'); - $this->artisan('paxsy') - ->expectsQuestion('Paxsy Menu', 'create_package') - ->expectsQuestion('"your-vendor-name" of the package', 't') - ->expectsQuestion('Name of your package?', 't') - ->expectsQuestion('Choose the "make" command for your "t/t" package?', PaxsyCommand::QUIT) - ->expectsQuestion('Paxsy Menu', PaxsyCommand::QUIT) - ->assertExitCode(0) - ; - }, + 'input vendor without ui and vendor not set', + function() { + useShellDisabled(); + + config()->set('paxsy.ui_vendor_select'); + config()->set('paxsy.ui_default_vendor'); + $this->artisan('paxsy') + ->expectsQuestion('Paxsy Menu', 'create_package') + ->expectsQuestion('"your-vendor-name" of the package', 't') + ->expectsQuestion('Name of your package?', 't') + ->expectsQuestion('Choose the "make" command for your "t/t" package?', PaxsyCommand::QUIT) + ->expectsQuestion('Paxsy Menu', PaxsyCommand::QUIT) + ->assertExitCode(0) + ; + }, ); it( - 'multiple stubs sets', - function() { - $defStubsSet = config('paxsy.stub_sets.default'); - - config()->set( - 'paxsy.stub_sets', - ['set1' => $defStubsSet, 'set2' => $defStubsSet, 'set3' => $defStubsSet], - ); - // prevent from composer update - useShellDisabled(); - - $this->artisan('paxsy') - ->expectsQuestion('Paxsy Menu', 'new laravel composer package') - ->expectsQuestion('"your-vendor-name" of the package', 'PaxsyVendorName') - ->expectsQuestion('Name of your package?', 'PackEdgeName') - ->expectsQuestion('Which preconfigured Stub-Set?', 'set2') - ->expectsQuestion( - 'Choose the "make" command for your "paxsy-vendor-name/pack-edge-name" package?', - PaxsyCommand::QUIT, - ) - ->expectsQuestion('Paxsy Menu', PaxsyCommand::QUIT) - ; - }, + 'multiple stubs sets', + function() { + $defStubsSet = config('paxsy.stub_sets.default'); + + config()->set( + 'paxsy.stub_sets', + ['set1' => $defStubsSet, 'set2' => $defStubsSet, 'set3' => $defStubsSet], + ); + // prevent from composer update + useShellDisabled(); + + $this->artisan('paxsy') + ->expectsQuestion('Paxsy Menu', 'new laravel composer package') + ->expectsQuestion('"your-vendor-name" of the package', 'PaxsyVendorName') + ->expectsQuestion('Name of your package?', 'PackEdgeName') + ->expectsQuestion('Which preconfigured Stub-Set?', 'set2') + ->expectsQuestion( + 'Choose the "make" command for your "paxsy-vendor-name/pack-edge-name" package?', + PaxsyCommand::QUIT, + ) + ->expectsQuestion('Paxsy Menu', PaxsyCommand::QUIT) + ; + }, );