Skip to content

Commit

Permalink
Generator work for resource type is close
Browse files Browse the repository at this point in the history
  • Loading branch information
alnutile committed May 15, 2023
1 parent 34e5a29 commit e65ec78
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/ResponseType/ResponseTypeEnum.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

enum ResponseTypeEnum: string
{
//case TemplateType = 'template_type'
//case TemplateType = 'template_type'/
case EmbedQuestion = 'embed_question';
case VectorSearch = 'vector_search';
case CombineContent = 'combine_content';
Expand Down
1 change: 1 addition & 0 deletions tests/Feature/ControllerTransformerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class ControllerTransformerTest extends TestCase
{
public function test_copies_to_folders()
{
File::shouldReceive('makeDirectory')->andReturnTrue();
File::shouldReceive('exists')->andReturnTrue();
File::shouldReceive('allFiles')->andReturn(
[
Expand Down
5 changes: 4 additions & 1 deletion tests/Feature/GeneratorRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use App\Generators\ResponseType\GeneratorRepository;
use Facades\App\Generators\ResponseType\ControllerTransformer;
use Facades\App\Generators\ResponseType\EnumTransformer;
use Facades\App\Generators\ResponseType\RoutesTransformer;
use Facades\App\Generators\ResponseType\VueTransformer;
use Tests\TestCase;
Expand All @@ -15,6 +16,7 @@ public function test_keys()
ControllerTransformer::shouldReceive('handle')->once();
VueTransformer::shouldReceive('handle')->once();
RoutesTransformer::shouldReceive('handle')->once();
EnumTransformer::shouldReceive('handle')->once();
$generator = new GeneratorRepository();

$generator->setup('Foo Bar', 'Some Response Type', 'Some Description', false)->run();
Expand All @@ -27,10 +29,11 @@ public function test_path()
ControllerTransformer::shouldReceive('handle')->once();
VueTransformer::shouldReceive('handle')->once();
RoutesTransformer::shouldReceive('handle')->once();
EnumTransformer::shouldReceive('handle')->once();
$generator = new GeneratorRepository();

$generator->setup('Foo Bar', 'Some Response Type', 'Some Description', false)->run();

$this->assertStringContainsString('../STUBS/', $generator->getRootPathOrStubs());
$this->assertStringContainsString('STUBS/', $generator->getRootPathOrStubs());
}
}

0 comments on commit e65ec78

Please sign in to comment.