Skip to content

Commit f54827b

Browse files
committed
Update testAddDataWithNotExistsMethodOnController testcase;
Use mockDriverGetEmptyAndSaveTmpData instead of mockDriverGetTmpData method to ensure the recieved data will be saved without any modifications;
1 parent 8b725cb commit f54827b

File tree

2 files changed

+100
-1
lines changed

2 files changed

+100
-1
lines changed

tests/SwaggerServiceTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ public function testAddDataPostRequestWithObjectParams()
687687

688688
public function testAddDataWithNotExistsMethodOnController()
689689
{
690-
$this->mockDriverGetTmpData($this->getJsonFixture('tmp_data_get_user_request'));
690+
$this->mockDriverGetEmptyAndSaveTmpData($this->getJsonFixture('tmp_data_get_user_request_without_request_class'));
691691

692692
$service = app(SwaggerService::class);
693693

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
{
2+
"openapi": "3.1.0",
3+
"servers": [
4+
{
5+
"url": "http:\/\/localhost"
6+
}
7+
],
8+
"paths": {
9+
"/users/{id}/assign-role/{role-id}": {
10+
"get": {
11+
"tags": [
12+
"users"
13+
],
14+
"consumes": [],
15+
"produces": [
16+
"application/json"
17+
],
18+
"parameters": [
19+
{
20+
"in": "path",
21+
"name": "id",
22+
"description": "",
23+
"required": true,
24+
"schema": {
25+
"type": "string"
26+
}
27+
},
28+
{
29+
"in": "path",
30+
"name": "role-id",
31+
"description": "",
32+
"required": true,
33+
"schema": {
34+
"type": "string"
35+
}
36+
}
37+
],
38+
"responses": {
39+
"200": {
40+
"description": "OK",
41+
"content": {
42+
"application/json": {
43+
"schema": {
44+
"$ref": "#/components/schemas/getUsers{id}assignRole{roleId}200ResponseObject",
45+
"type": "object"
46+
},
47+
"example": {
48+
"id": 2,
49+
"name": "first_client",
50+
"likes_count": 23,
51+
"role": {
52+
"id": 2,
53+
"name": "client"
54+
},
55+
"type": "reader"
56+
}
57+
}
58+
}
59+
}
60+
},
61+
"security": [],
62+
"description": ""
63+
}
64+
}
65+
},
66+
"components": {
67+
"schemas": {
68+
"getUsers{id}assignRole{roleId}200ResponseObject": {
69+
"type": "object",
70+
"properties": {
71+
"id": {
72+
"type": "integer"
73+
},
74+
"name": {
75+
"type": "string"
76+
},
77+
"likes_count": {
78+
"type": "integer"
79+
},
80+
"role": {
81+
"type": "array"
82+
},
83+
"type": {
84+
"type": "string"
85+
}
86+
}
87+
}
88+
}
89+
},
90+
"info": {
91+
"description": "This is automatically collected documentation",
92+
"version": "0.0.0",
93+
"title": "Name of Your Application",
94+
"termsOfService": "",
95+
"contact": {
96+
"email": "your@email.com"
97+
}
98+
}
99+
}

0 commit comments

Comments
 (0)