File tree Expand file tree Collapse file tree 1 file changed +25
-3
lines changed Expand file tree Collapse file tree 1 file changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -195,7 +195,7 @@ public function testWriteEmptySecurityPartYaml()
195195
196196 public function testSecurity ()
197197 {
198- $ openapi = new OpenApi ([
198+ $ openapi = $ this -> createOpenAPI ([
199199 'components ' => new Components ([
200200 'securitySchemes ' => [
201201 'BearerAuth ' => new SecurityScheme ([
@@ -216,7 +216,29 @@ public function testSecurity()
216216 ]
217217 ]);
218218
219- $ result = json_decode (json_encode ($ openapi ->getSerializableData ()), true );
220- $ this ->assertTrue ($ result );
219+ $ yaml = \cebe \openapi \Writer::writeToYaml ($ openapi );
220+
221+
222+ $ this ->assertEquals (preg_replace ('~\R~ ' , "\n" , <<<YAML
223+ openapi: 3.0.0
224+ info:
225+ title: 'Test API'
226+ version: 1.0.0
227+ paths:
228+ /test:
229+ get:
230+ security:
231+ BearerAuth: { }
232+ components:
233+ securitySchemes:
234+ BearerAuth:
235+ type: http
236+ scheme: bearer
237+ bearerFormat: 'AuthToken and JWT Format'
238+
239+ YAML
240+ ),
241+ $ yaml
242+ );
221243 }
222244}
You can’t perform that action at this time.
0 commit comments