File tree Expand file tree Collapse file tree 4 files changed +6
-4
lines changed Expand file tree Collapse file tree 4 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ protected function performValidation()
4444
4545 public function getSerializableData ()
4646 {
47+ parent ::getSerializableData ();
4748 return $ this ->_securityRequirement ;
4849 }
4950}
Original file line number Diff line number Diff line change @@ -23,14 +23,10 @@ public function __construct(array $data)
2323 {
2424 parent ::__construct ($ data );
2525
26- $ read = true ;
2726 foreach ($ data as $ index => $ value ) {
2827 if (is_numeric ($ index )) { // read
29- $ requirements = $ value ;
3028 $ this ->_securityRequirements [array_keys ($ value )[0 ]] = new SecurityRequirement (array_values ($ value )[0 ]);
3129 } else { // write
32- $ read = false ;
33- $ requirements = $ data ;
3430 $ this ->_securityRequirements [$ index ] = $ value ;
3531 }
3632 }
@@ -55,6 +51,7 @@ protected function attributes(): array
5551 */
5652 protected function performValidation ()
5753 {
54+ // TODO
5855 }
5956
6057 /**
@@ -64,6 +61,8 @@ protected function performValidation()
6461 */
6562 public function getSerializableData ()
6663 {
64+ parent ::getSerializableData ();
65+
6766 $ data = [];
6867 foreach ($ this ->_securityRequirements ?? [] as $ name => $ securityRequirement ) {
6968 /** @var SecurityRequirement $securityRequirement */
Original file line number Diff line number Diff line change @@ -255,6 +255,7 @@ public function testSecurityAtPathOperationLevel()
255255 );
256256 }
257257
258+ // TODO
258259// public function testSecurityAtGlobalLevel()
259260// {
260261// $openapi = $this->createOpenAPI([
Original file line number Diff line number Diff line change @@ -79,6 +79,7 @@ public function testRead()
7979
8080 $ this ->assertInstanceOf (\cebe \openapi \spec \Responses::class, $ operation ->responses );
8181
82+ $ this ->assertCount (1 , $ operation ->security ->getRequirements ());
8283 $ this ->assertInstanceOf (\cebe \openapi \spec \SecurityRequirements::class, $ operation ->security );
8384 $ this ->assertInstanceOf (\cebe \openapi \spec \SecurityRequirement::class, $ operation ->security ->getRequirement ('petstore_auth ' ));
8485 $ this ->assertCount (2 , $ operation ->security ->getRequirement ('petstore_auth ' )->getSerializableData ());
You can’t perform that action at this time.
0 commit comments