Skip to content

Commit

Permalink
Merge pull request #84 from RonasIT/fix-template-for-generarte-nova-t…
Browse files Browse the repository at this point in the history
…ests

Fix template for generarte nova tests
  • Loading branch information
DenTray committed May 16, 2024
2 parents 5e1b91a + 1fedc1d commit 822e512
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions stubs/nova_test.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function setUp(): void
{
parent::setUp();

self::$user = User::find(1);
self::$user ??= User::find(1);
self::${{$lower_entity}}State ??= new ModelTestState({{$entity}}::class);

$this->skipDocumentationCollecting();
Expand Down Expand Up @@ -53,7 +53,7 @@ public function testCreateNoAuth(): void
@endif

self::${{$lower_entity}}State->assertNotChanged();
}
}

public function testCreateValidationError(): void
{
Expand Down Expand Up @@ -318,7 +318,7 @@ public function get{{$entity}}FiltersData(): array
@foreach($filters as $filter)
[
'filters' => [
'{{$filter['name']}}' => 'search term',
'{{$filter['name']}}' => ['search term'],
],
'response_fixture' => 'filter_{{$lower_entity}}_by_{{$filter['fixture_name']}}.json',
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function setUp(): void
{
parent::setUp();

self::$user = User::find(1);
self::$user ??= User::find(1);
self::$postState ??= new ModelTestState(Post::class);

$this->skipDocumentationCollecting();
Expand Down Expand Up @@ -43,7 +43,7 @@ public function testCreateNoAuth(): void
$response->assertUnauthorized();

self::$postState->assertNotChanged();
}
}

public function testCreateValidationError(): void
{
Expand Down Expand Up @@ -252,13 +252,13 @@ public function getPostFiltersData(): array
return [
[
'filters' => [
'TextField:description_field' => 'search term',
'TextField:description_field' => ['search term'],
],
'response_fixture' => 'filter_post_by_text_field.json',
],
[
'filters' => [
'RonasIT\Support\Tests\Support\CreatedAtFilter' => 'search term',
'RonasIT\Support\Tests\Support\CreatedAtFilter' => ['search term'],
],
'response_fixture' => 'filter_post_by_created_at_filter.json',
],
Expand Down

0 comments on commit 822e512

Please sign in to comment.