-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
with some tests on crud and migration error fixed
- Loading branch information
1 parent
9833033
commit 99e4f22
Showing
6 changed files
with
64 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ | |
.editorconfig | ||
.DS_Store | ||
/package | ||
composer.lock | ||
composer.lock | ||
.phpunit.result.cache |
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
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
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,45 @@ | ||
<?php | ||
|
||
namespace Tests\Feature; | ||
|
||
use Tests\TestCase; | ||
use Illuminate\Support\Facades\Artisan; | ||
|
||
class CrudMakeTest extends TestCase | ||
{ | ||
public function setUp():void | ||
{ | ||
parent::setUp(); | ||
Artisan::call('new TestApp Bitfumes Sarthaks sarthak@bitfumes.com laravel,test'); | ||
chdir(base_path()); | ||
} | ||
|
||
public function tearDown():void | ||
{ | ||
parent::tearDown(); | ||
$path = base_path() . '/package'; | ||
// echo shell_exec("rm -r $path"); | ||
} | ||
|
||
public function test_it_can_create_a_json_file_to_write_crud_structure() | ||
{ | ||
Artisan::call('crud:json Test'); | ||
$this->isFileExists('crud/Test.json'); | ||
} | ||
|
||
public function test_it_can_create_a_crud_for_a_json_file() | ||
{ | ||
Artisan::call('crud:json Test'); | ||
Artisan::call('crud:make crud/Test.json'); | ||
$this->isFileExists('src/Test.php'); | ||
$this->isFileExists('src/database/factories/TestFactory.php'); | ||
$this->isFileExists('src/Http/controllers/TestController.php'); | ||
$this->isFileExists('tests/Feature/TestTest.php'); | ||
$this->isFileExists('tests/Unit/TestTest.php'); | ||
} | ||
|
||
public function isFileExists($filename) | ||
{ | ||
return $this->assertFileExists(base_path() . '/package/TestApp/' . $filename); | ||
} | ||
} |