Skip to content

Commit 8028968

Browse files
committed
feat: add export mode
refs: #97
1 parent cdd96f8 commit 8028968

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/Generators/AbstractTestsGenerator.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ abstract class AbstractTestsGenerator extends EntityGenerator
1717
protected bool $withAuth = false;
1818

1919
const array FIXTURE_TYPES = [
20-
'create' => ['request', 'response', 'state'],
21-
'update' => ['request', 'state'],
22-
'delete' => ['state'],
20+
'create' => ['request', 'response'],
21+
'update' => ['request'],
2322
];
2423

2524
const string EMPTY_GUARDED_FIELD = '*';

stubs/test.blade.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ public function testCreate()
4949

5050
$this->assertEqualsFixture('create_{{\Illuminate\Support\Str::snake($entity)}}_response.json', $response->json());
5151

52-
self::${{\Illuminate\Support\Str::camel($entity)}}State->assertChangesEqualsFixture('create_{{\Illuminate\Support\Str::snake($entity)}}_state.json');
52+
// TODO: Need to remove last argument after first successful start
53+
self::${{\Illuminate\Support\Str::camel($entity)}}State->assertChangesEqualsFixture('create_{{\Illuminate\Support\Str::snake($entity)}}_state.json', true);
5354
}
5455

5556
@if ($withAuth)
@@ -77,7 +78,8 @@ public function testUpdate()
7778

7879
$response->assertNoContent();
7980

80-
self::${{\Illuminate\Support\Str::camel($entity)}}State->assertChangesEqualsFixture('update_{{\Illuminate\Support\Str::snake($entity)}}_state.json');
81+
// TODO: Need to remove last argument after first successful start
82+
self::${{\Illuminate\Support\Str::camel($entity)}}State->assertChangesEqualsFixture('update_{{\Illuminate\Support\Str::snake($entity)}}_state.json', true);
8183
}
8284

8385
public function testUpdateNotExists()
@@ -116,7 +118,8 @@ public function testDelete()
116118

117119
$response->assertNoContent();
118120

119-
self::${{\Illuminate\Support\Str::camel($entity)}}State->assertChangesEqualsFixture('delete_{{\Illuminate\Support\Str::snake($entity)}}_state.json');
121+
// TODO: Need to remove last argument after first successful start
122+
self::${{\Illuminate\Support\Str::camel($entity)}}State->assertChangesEqualsFixture('delete_{{\Illuminate\Support\Str::snake($entity)}}_state.json', true);
120123
}
121124

122125
public function testDeleteNotExists()

0 commit comments

Comments
 (0)