validate(); $this->assertEquals([], $operation->getErrors()); $this->assertTrue($result); $this->assertCount(1, $operation->tags); $this->assertEquals(['pet'], $operation->tags); $this->assertEquals('Updates a pet in the store with form data', $operation->summary); $this->assertEquals('updatePetWithForm', $operation->operationId); $this->assertCount(1, $operation->parameters); $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $operation->parameters[0]); $this->assertEquals('petId', $operation->parameters[0]->name); $this->assertInstanceOf(\cebe\openapi\spec\RequestBody::class, $operation->requestBody); $this->assertCount(1, $operation->requestBody->content); $this->assertArrayHasKey('application/x-www-form-urlencoded', $operation->requestBody->content); $this->assertInstanceOf(\cebe\openapi\spec\Responses::class, $operation->responses); $this->assertCount(1, $operation->security); $this->assertInstanceOf(\cebe\openapi\spec\SecurityRequirement::class, $operation->security[0]); $this->assertCount(2, $operation->security[0]->petstore_auth); $this->assertEquals(['write:pets', 'read:pets'], $operation->security[0]->petstore_auth); $this->assertInstanceOf(ExternalDocumentation::class, $operation->externalDocs); $this->assertEquals('Find more info here', $operation->externalDocs->description); $this->assertEquals('https://example.com', $operation->externalDocs->url); // deprecated Default value is false. $this->assertFalse($operation->deprecated); } }