Skip to content

Commit 85aef68

Browse files
Update snapshot tests
1 parent c770e5d commit 85aef68

File tree

36 files changed

+132
-198
lines changed

36 files changed

+132
-198
lines changed

tests/Commands/Make/__snapshots__/ControllerMakeCommandTest__test_it_appends_controller_to_class_name_if_not_present__1.txt

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@ class MyController extends Controller
1818
/**
1919
* Show the form for creating a new resource.
2020
*/
21-
public function create()
22-
{
23-
return view('blog::create');
24-
}
21+
public function create() {}
2522

2623
/**
2724
* Store a newly created resource in storage.
@@ -31,18 +28,12 @@ class MyController extends Controller
3128
/**
3229
* Show the specified resource.
3330
*/
34-
public function show($id)
35-
{
36-
return view('blog::show');
37-
}
31+
public function show($id) {}
3832

3933
/**
4034
* Show the form for editing the specified resource.
4135
*/
42-
public function edit($id)
43-
{
44-
return view('blog::edit');
45-
}
36+
public function edit($id) {}
4637

4738
/**
4839
* Update the specified resource in storage.

tests/Commands/Make/__snapshots__/ControllerMakeCommandTest__test_it_can_change_the_default_namespace__1.txt

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@ class MyController extends Controller
1818
/**
1919
* Show the form for creating a new resource.
2020
*/
21-
public function create()
22-
{
23-
return view('blog::create');
24-
}
21+
public function create() {}
2522

2623
/**
2724
* Store a newly created resource in storage.
@@ -31,18 +28,12 @@ class MyController extends Controller
3128
/**
3229
* Show the specified resource.
3330
*/
34-
public function show($id)
35-
{
36-
return view('blog::show');
37-
}
31+
public function show($id) {}
3832

3933
/**
4034
* Show the form for editing the specified resource.
4135
*/
42-
public function edit($id)
43-
{
44-
return view('blog::edit');
45-
}
36+
public function edit($id) {}
4637

4738
/**
4839
* Update the specified resource in storage.

tests/Commands/Make/__snapshots__/ControllerMakeCommandTest__test_it_can_change_the_default_path__1.txt

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@ class MyController extends Controller
1818
/**
1919
* Show the form for creating a new resource.
2020
*/
21-
public function create()
22-
{
23-
return view('blog::create');
24-
}
21+
public function create() {}
2522

2623
/**
2724
* Store a newly created resource in storage.
@@ -31,18 +28,12 @@ class MyController extends Controller
3128
/**
3229
* Show the specified resource.
3330
*/
34-
public function show($id)
35-
{
36-
return view('blog::show');
37-
}
31+
public function show($id) {}
3832

3933
/**
4034
* Show the form for editing the specified resource.
4135
*/
42-
public function edit($id)
43-
{
44-
return view('blog::edit');
45-
}
36+
public function edit($id) {}
4637

4738
/**
4839
* Update the specified resource in storage.

tests/Commands/Make/__snapshots__/ControllerMakeCommandTest__test_it_can_generate_a_controller_in_sub_namespace_with_correct_generated_file__1.txt

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@ class MyController extends Controller
1818
/**
1919
* Show the form for creating a new resource.
2020
*/
21-
public function create()
22-
{
23-
return view('blog::create');
24-
}
21+
public function create() {}
2522

2623
/**
2724
* Store a newly created resource in storage.
@@ -31,18 +28,12 @@ class MyController extends Controller
3128
/**
3229
* Show the specified resource.
3330
*/
34-
public function show($id)
35-
{
36-
return view('blog::show');
37-
}
31+
public function show($id) {}
3832

3933
/**
4034
* Show the form for editing the specified resource.
4135
*/
42-
public function edit($id)
43-
{
44-
return view('blog::edit');
45-
}
36+
public function edit($id) {}
4637

4738
/**
4839
* Update the specified resource in storage.

tests/Commands/Make/__snapshots__/ControllerMakeCommandTest__test_it_generated_correct_file_with_content__1.txt

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@ class MyController extends Controller
1818
/**
1919
* Show the form for creating a new resource.
2020
*/
21-
public function create()
22-
{
23-
return view('blog::create');
24-
}
21+
public function create() {}
2522

2623
/**
2724
* Store a newly created resource in storage.
@@ -31,18 +28,12 @@ class MyController extends Controller
3128
/**
3229
* Show the specified resource.
3330
*/
34-
public function show($id)
35-
{
36-
return view('blog::show');
37-
}
31+
public function show($id) {}
3832

3933
/**
4034
* Show the form for editing the specified resource.
4135
*/
42-
public function edit($id)
43-
{
44-
return view('blog::edit');
45-
}
36+
public function edit($id) {}
4637

4738
/**
4839
* Update the specified resource in storage.

tests/Commands/Make/__snapshots__/ControllerMakeCommandTest__test_it_generates_an_api_controller__1.txt

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,48 +12,62 @@ class MyController extends Controller
1212
*/
1313
public function index()
1414
{
15-
//
16-
17-
return response()->json([]);
15+
return response()->json([
16+
'status' => 'success',
17+
'data' => [
18+
// 'users' => []
19+
],
20+
]);
1821
}
1922

2023
/**
2124
* Store a newly created resource in storage.
2225
*/
2326
public function store(Request $request)
2427
{
25-
//
26-
27-
return response()->json([]);
28+
return response()->json([
29+
'status' => 'success',
30+
'data' => [
31+
// 'user' => []
32+
],
33+
]);
2834
}
2935

3036
/**
3137
* Show the specified resource.
3238
*/
3339
public function show($id)
3440
{
35-
//
36-
37-
return response()->json([]);
41+
return response()->json([
42+
'status' => 'success',
43+
'data' => [
44+
// 'user' => []
45+
],
46+
]);
3847
}
3948

4049
/**
4150
* Update the specified resource in storage.
4251
*/
4352
public function update(Request $request, $id)
4453
{
45-
//
46-
47-
return response()->json([]);
54+
return response()->json([
55+
'status' => 'success',
56+
'data' => [
57+
// 'user' => []
58+
],
59+
]);
4860
}
4961

5062
/**
5163
* Remove the specified resource from storage.
5264
*/
5365
public function destroy($id)
5466
{
55-
//
56-
57-
return response()->json([]);
67+
return response()->json([
68+
'status' => 'success',
69+
'data' => null,
70+
'message' => 'Record deleted successfully.',
71+
]);
5872
}
5973
}

tests/Commands/Make/__snapshots__/ControllerMakeCommandTest__test_it_generates_an_invokable_controller__1.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,5 @@ class MyController extends Controller
1010
/**
1111
* Handle the incoming request.
1212
*/
13-
public function __invoke(Request $request)
14-
{
15-
return response()->json([]);
16-
}
13+
public function __invoke(Request $request) {}
1714
}

tests/Commands/Make/__snapshots__/FactoryMakeCommandTest__test_it_makes_factory__1.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
namespace Modules\Blog\Database\Factories;
44

55
use Illuminate\Database\Eloquent\Factories\Factory;
6+
use Modules\Blog\App\Models\Post;
67

78
class PostFactory extends Factory
89
{
910
/**
1011
* The name of the factory's corresponding model.
1112
*/
12-
protected $model = \Modules\Blog\App\Models\Post::class;
13+
protected $model = Post::class;
1314

1415
/**
1516
* Define the model's default state.

tests/Commands/Make/__snapshots__/ModelMakeCommandTest__test_changes_default_namespace__1.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ class Post extends Model
1515
*/
1616
protected $fillable = [];
1717

18-
// protected static function newFactory(): PostFactory
18+
// protected static function newFactory()
1919
// {
20-
// // return PostFactory::new();
20+
// return PostFactory::new();
2121
// }
2222
}

tests/Commands/Make/__snapshots__/ModelMakeCommandTest__test_changes_default_path__1.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ class Post extends Model
1515
*/
1616
protected $fillable = [];
1717

18-
// protected static function newFactory(): PostFactory
18+
// protected static function newFactory()
1919
// {
20-
// // return PostFactory::new();
20+
// return PostFactory::new();
2121
// }
2222
}

0 commit comments

Comments
 (0)