Skip to content

Commit 424d4fe

Browse files
committed
Fix | Change structure
1 parent c94fcd5 commit 424d4fe

File tree

10 files changed

+73
-37
lines changed

10 files changed

+73
-37
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ Installation
2323
Install this command as a global composer package
2424

2525
```bash
26-
$ composer global require Diskominfotik-Banda-Aceh/pest-scaffold-cli
26+
$ composer global require diskominfotik-banda-aceh/pest-scaffold-cli
27+
```
28+
Copy this provider to the `config/app.php`
29+
```bash
30+
DiskominfotikBandaAceh\PestScaffoldCli\Providers\PestTestProvider::class,
2731
```
2832

2933
Usage

composer.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
{
22
"name": "diskominfotik-banda-aceh/pest-scaffold-cli",
33
"description": "Console commands to generate a directory structure for scaffold pest PHP testing files",
4-
"type": "library",
54
"autoload": {
65
"psr-4": {
76
"DiskominfotikBandaAceh\\PestScaffoldCli\\": "src/"
87
}
98
},
10-
"license": "MIT",
119
"authors": [
1210
{
1311
"name": "Diskominfotik Banda Aceh",
1412
"email": "[email protected]"
1513
}
1614
],
17-
"minimum-stability": "stable",
1815
"require": {
19-
"php": "^7.0",
20-
"symfony/console": "^4.0"
16+
17+
},
18+
"require-dev": {
19+
"pestphp/pest": "^v1.21.3"
2120
}
2221
}

composer.lock

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/PestCreateTest.php renamed to src/Commands/PestCreateTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<?php
22

3-
namespace DiskominfotikBandaAceh\PestScaffoldCli;
3+
namespace DiskominfotikBandaAceh\PestScaffoldCli\Commands;
44

55
use Illuminate\Console\GeneratorCommand;
66
use Illuminate\Support\Str;
77
use Symfony\Component\Console\Input\InputArgument;
8+
use function base_path;
89

910
class PestCreateTest extends GeneratorCommand
1011
{
@@ -84,7 +85,7 @@ protected function getArguments()
8485
}
8586

8687
protected function getStub(){
87-
return $this->resolveStubPath('/stubs/controller-create-test.stub');
88+
return $this->resolveStubPath('/../../templates/controller-create-test.stub');
8889
}
8990

9091
/**

src/PestDeleteTest.php renamed to src/Commands/PestDeleteTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<?php
22

3-
namespace DiskominfotikBandaAceh\PestScaffoldCli;
3+
namespace DiskominfotikBandaAceh\PestScaffoldCli\Commands;
44

55
use Illuminate\Console\GeneratorCommand;
66
use Illuminate\Support\Str;
77
use Symfony\Component\Console\Input\InputArgument;
8+
use function base_path;
89

910
class PestDeleteTest extends GeneratorCommand
1011
{
@@ -84,7 +85,7 @@ protected function getArguments()
8485
}
8586

8687
protected function getStub(){
87-
return $this->resolveStubPath('/stubs/controller-delete-test.stub');
88+
return $this->resolveStubPath('/../../templates/controller-delete-test.stub');
8889
}
8990

9091
/**

src/PestReadTest.php renamed to src/Commands/PestReadTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<?php
22

3-
namespace DiskominfotikBandaAceh\PestScaffoldCli;
3+
namespace DiskominfotikBandaAceh\PestScaffoldCli\Commands;
44

55
use Illuminate\Console\GeneratorCommand;
66
use Illuminate\Support\Str;
77
use Symfony\Component\Console\Input\InputArgument;
8+
use function base_path;
89

910
class PestReadTest extends GeneratorCommand
1011
{
@@ -84,7 +85,7 @@ protected function getArguments()
8485
}
8586

8687
protected function getStub(){
87-
return $this->resolveStubPath('/stubs/controller-read-test.stub');
88+
return $this->resolveStubPath('/../../templates/controller-read-test.stub');
8889
}
8990

9091
/**

src/PestTest.php renamed to src/Commands/PestTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<?php
22

3-
namespace DiskominfotikBandaAceh\PestScaffoldCli;
3+
namespace DiskominfotikBandaAceh\PestScaffoldCli\Commands;
44

55
use Illuminate\Console\GeneratorCommand;
66
use Illuminate\Support\Str;
77
use Symfony\Component\Console\Input\InputArgument;
8+
use function base_path;
89

910
class PestTest extends GeneratorCommand
1011
{
@@ -129,7 +130,7 @@ protected function getArguments()
129130
}
130131

131132
protected function getStub(){
132-
return $this->resolveStubPath('/stubs/controller-index-test.stub');
133+
return $this->resolveStubPath('/../../templates/controller-index-test.stub');
133134
}
134135

135136
/**

src/PestUpdateTest.php renamed to src/Commands/PestUpdateTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<?php
22

3-
namespace DiskominfotikBandaAceh\PestScaffoldCli;
3+
namespace DiskominfotikBandaAceh\PestScaffoldCli\Commands;
44

55
use Illuminate\Console\GeneratorCommand;
66
use Illuminate\Support\Str;
77
use Symfony\Component\Console\Input\InputArgument;
8+
use function base_path;
89

910
class PestUpdateTest extends GeneratorCommand
1011
{
@@ -84,7 +85,7 @@ protected function getArguments()
8485
}
8586

8687
protected function getStub(){
87-
return $this->resolveStubPath('/stubs/controller-update-test.stub');
88+
return $this->resolveStubPath('/../../templates/controller-update-test.stub');
8889
}
8990

9091
/**

src/PestTestProvider.php

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/Providers/PestTestProvider.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
namespace DiskominfotikBandaAceh\PestScaffoldCli\Providers;
3+
4+
use Illuminate\Support\ServiceProvider;
5+
6+
class PestTestProvider extends ServiceProvider {
7+
8+
protected $commands = [
9+
'DiskominfotikBandaAceh\PestScaffoldCli\Commands\PestTest',
10+
'DiskominfotikBandaAceh\PestScaffoldCli\Commands\PestCreateTest',
11+
'DiskominfotikBandaAceh\PestScaffoldCli\Commands\PestReadTest',
12+
'DiskominfotikBandaAceh\PestScaffoldCli\Commands\PestUpdateTest',
13+
'DiskominfotikBandaAceh\PestScaffoldCli\Commands\PestDeleteTest',
14+
];
15+
16+
public function register(){
17+
$this->commands($this->commands);
18+
}
19+
20+
/**
21+
* Bootstrap services.
22+
*
23+
* @return void
24+
*/
25+
public function boot()
26+
{
27+
28+
}
29+
}
30+
31+
?>

0 commit comments

Comments
 (0)