Skip to content

Commit

Permalink
Fix | Change structure
Browse files Browse the repository at this point in the history
  • Loading branch information
RayhanYulanda committed Aug 3, 2022
1 parent c94fcd5 commit 424d4fe
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 37 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ Installation
Install this command as a global composer package

```bash
$ composer global require Diskominfotik-Banda-Aceh/pest-scaffold-cli
$ composer global require diskominfotik-banda-aceh/pest-scaffold-cli
```
Copy this provider to the `config/app.php`
```bash
DiskominfotikBandaAceh\PestScaffoldCli\Providers\PestTestProvider::class,
```

Usage
Expand Down
9 changes: 4 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
{
"name": "diskominfotik-banda-aceh/pest-scaffold-cli",
"description": "Console commands to generate a directory structure for scaffold pest PHP testing files",
"type": "library",
"autoload": {
"psr-4": {
"DiskominfotikBandaAceh\\PestScaffoldCli\\": "src/"
}
},
"license": "MIT",
"authors": [
{
"name": "Diskominfotik Banda Aceh",
"email": "[email protected]"
}
],
"minimum-stability": "stable",
"require": {
"php": "^7.0",
"symfony/console": "^4.0"

},
"require-dev": {
"pestphp/pest": "^v1.21.3"
}
}
18 changes: 18 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions src/PestCreateTest.php → src/Commands/PestCreateTest.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php

namespace DiskominfotikBandaAceh\PestScaffoldCli;
namespace DiskominfotikBandaAceh\PestScaffoldCli\Commands;

use Illuminate\Console\GeneratorCommand;
use Illuminate\Support\Str;
use Symfony\Component\Console\Input\InputArgument;
use function base_path;

class PestCreateTest extends GeneratorCommand
{
Expand Down Expand Up @@ -84,7 +85,7 @@ protected function getArguments()
}

protected function getStub(){
return $this->resolveStubPath('/stubs/controller-create-test.stub');
return $this->resolveStubPath('/../../templates/controller-create-test.stub');
}

/**
Expand Down
5 changes: 3 additions & 2 deletions src/PestDeleteTest.php → src/Commands/PestDeleteTest.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php

namespace DiskominfotikBandaAceh\PestScaffoldCli;
namespace DiskominfotikBandaAceh\PestScaffoldCli\Commands;

use Illuminate\Console\GeneratorCommand;
use Illuminate\Support\Str;
use Symfony\Component\Console\Input\InputArgument;
use function base_path;

class PestDeleteTest extends GeneratorCommand
{
Expand Down Expand Up @@ -84,7 +85,7 @@ protected function getArguments()
}

protected function getStub(){
return $this->resolveStubPath('/stubs/controller-delete-test.stub');
return $this->resolveStubPath('/../../templates/controller-delete-test.stub');
}

/**
Expand Down
5 changes: 3 additions & 2 deletions src/PestReadTest.php → src/Commands/PestReadTest.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php

namespace DiskominfotikBandaAceh\PestScaffoldCli;
namespace DiskominfotikBandaAceh\PestScaffoldCli\Commands;

use Illuminate\Console\GeneratorCommand;
use Illuminate\Support\Str;
use Symfony\Component\Console\Input\InputArgument;
use function base_path;

class PestReadTest extends GeneratorCommand
{
Expand Down Expand Up @@ -84,7 +85,7 @@ protected function getArguments()
}

protected function getStub(){
return $this->resolveStubPath('/stubs/controller-read-test.stub');
return $this->resolveStubPath('/../../templates/controller-read-test.stub');
}

/**
Expand Down
5 changes: 3 additions & 2 deletions src/PestTest.php → src/Commands/PestTest.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php

namespace DiskominfotikBandaAceh\PestScaffoldCli;
namespace DiskominfotikBandaAceh\PestScaffoldCli\Commands;

use Illuminate\Console\GeneratorCommand;
use Illuminate\Support\Str;
use Symfony\Component\Console\Input\InputArgument;
use function base_path;

class PestTest extends GeneratorCommand
{
Expand Down Expand Up @@ -129,7 +130,7 @@ protected function getArguments()
}

protected function getStub(){
return $this->resolveStubPath('/stubs/controller-index-test.stub');
return $this->resolveStubPath('/../../templates/controller-index-test.stub');
}

/**
Expand Down
5 changes: 3 additions & 2 deletions src/PestUpdateTest.php → src/Commands/PestUpdateTest.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php

namespace DiskominfotikBandaAceh\PestScaffoldCli;
namespace DiskominfotikBandaAceh\PestScaffoldCli\Commands;

use Illuminate\Console\GeneratorCommand;
use Illuminate\Support\Str;
use Symfony\Component\Console\Input\InputArgument;
use function base_path;

class PestUpdateTest extends GeneratorCommand
{
Expand Down Expand Up @@ -84,7 +85,7 @@ protected function getArguments()
}

protected function getStub(){
return $this->resolveStubPath('/stubs/controller-update-test.stub');
return $this->resolveStubPath('/../../templates/controller-update-test.stub');
}

/**
Expand Down
21 changes: 0 additions & 21 deletions src/PestTestProvider.php

This file was deleted.

31 changes: 31 additions & 0 deletions src/Providers/PestTestProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php
namespace DiskominfotikBandaAceh\PestScaffoldCli\Providers;

use Illuminate\Support\ServiceProvider;

class PestTestProvider extends ServiceProvider {

protected $commands = [
'DiskominfotikBandaAceh\PestScaffoldCli\Commands\PestTest',
'DiskominfotikBandaAceh\PestScaffoldCli\Commands\PestCreateTest',
'DiskominfotikBandaAceh\PestScaffoldCli\Commands\PestReadTest',
'DiskominfotikBandaAceh\PestScaffoldCli\Commands\PestUpdateTest',
'DiskominfotikBandaAceh\PestScaffoldCli\Commands\PestDeleteTest',
];

public function register(){
$this->commands($this->commands);
}

/**
* Bootstrap services.
*
* @return void
*/
public function boot()
{

}
}

?>

0 comments on commit 424d4fe

Please sign in to comment.