update samples

This commit is contained in:
William Cheng 2020-01-10 21:51:59 +08:00
parent cbc12543a9
commit 20c7400d56
4 changed files with 335 additions and 0 deletions

View File

@ -0,0 +1,63 @@
<?php
/**
* InlineObject
*
* PHP version 7.1
*
* @package OpenAPIServer\Model
* @author OpenAPI Generator team
* @link https://github.com/openapitools/openapi-generator
*/
/**
* NOTE: This class is auto generated by the openapi generator program.
* https://github.com/openapitools/openapi-generator
*/
namespace OpenAPIServer\Model;
use OpenAPIServer\Interfaces\ModelInterface;
/**
* InlineObject
*
* @package OpenAPIServer\Model
* @author OpenAPI Generator team
* @link https://github.com/openapitools/openapi-generator
*/
class InlineObject implements ModelInterface
{
private const MODEL_SCHEMA = <<<'SCHEMA'
{
"type" : "object",
"properties" : {
"name" : {
"type" : "string",
"description" : "Updated name of the pet"
},
"status" : {
"type" : "string",
"description" : "Updated status of the pet"
}
}
}
SCHEMA;
/** @var string $name Updated name of the pet*/
private $name;
/** @var string $status Updated status of the pet*/
private $status;
/**
* Returns model schema.
*
* @param bool $assoc When TRUE, returned objects will be converted into associative arrays. Default FALSE.
*
* @return array
*/
public static function getOpenApiSchema($assoc = false)
{
return json_decode(static::MODEL_SCHEMA, $assoc);
}
}

View File

@ -0,0 +1,64 @@
<?php
/**
* InlineObject1
*
* PHP version 7.1
*
* @package OpenAPIServer\Model
* @author OpenAPI Generator team
* @link https://github.com/openapitools/openapi-generator
*/
/**
* NOTE: This class is auto generated by the openapi generator program.
* https://github.com/openapitools/openapi-generator
*/
namespace OpenAPIServer\Model;
use OpenAPIServer\Interfaces\ModelInterface;
/**
* InlineObject1
*
* @package OpenAPIServer\Model
* @author OpenAPI Generator team
* @link https://github.com/openapitools/openapi-generator
*/
class InlineObject1 implements ModelInterface
{
private const MODEL_SCHEMA = <<<'SCHEMA'
{
"type" : "object",
"properties" : {
"additionalMetadata" : {
"type" : "string",
"description" : "Additional data to pass to server"
},
"file" : {
"type" : "string",
"description" : "file to upload",
"format" : "binary"
}
}
}
SCHEMA;
/** @var string $additionalMetadata Additional data to pass to server*/
private $additionalMetadata;
/** @var \SplFileObject $file file to upload*/
private $file;
/**
* Returns model schema.
*
* @param bool $assoc When TRUE, returned objects will be converted into associative arrays. Default FALSE.
*
* @return array
*/
public static function getOpenApiSchema($assoc = false)
{
return json_decode(static::MODEL_SCHEMA, $assoc);
}
}

View File

@ -0,0 +1,104 @@
<?php
/**
* InlineObject1Test
*
* PHP version 7.1
*
* @package OpenAPIServer\Model
* @author OpenAPI Generator team
* @link https://github.com/openapitools/openapi-generator
*/
/**
* OpenAPI Petstore
*
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* The version of the OpenAPI document: 1.0.0
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
/**
* NOTE: This class is auto generated by the openapi generator program.
* https://github.com/openapitools/openapi-generator
* Please update the test case below to test the model.
*/
namespace OpenAPIServer\Model;
use PHPUnit\Framework\TestCase;
use OpenAPIServer\Model\InlineObject1;
/**
* InlineObject1Test Class Doc Comment
*
* @package OpenAPIServer\Model
* @author OpenAPI Generator team
* @link https://github.com/openapitools/openapi-generator
*
* @coversDefaultClass \OpenAPIServer\Model\InlineObject1
*/
class InlineObject1Test extends TestCase
{
/**
* Setup before running any test cases
*/
public static function setUpBeforeClass()
{
}
/**
* Setup before running each test case
*/
public function setUp()
{
}
/**
* Clean up after running each test case
*/
public function tearDown()
{
}
/**
* Clean up after running all test cases
*/
public static function tearDownAfterClass()
{
}
/**
* Test "InlineObject1"
*/
public function testInlineObject1()
{
$testInlineObject1 = new InlineObject1();
}
/**
* Test attribute "additionalMetadata"
*/
public function testPropertyAdditionalMetadata()
{
}
/**
* Test attribute "file"
*/
public function testPropertyFile()
{
}
/**
* Test getOpenApiSchema static method
* @covers ::getOpenApiSchema
*/
public function testGetOpenApiSchema()
{
$schemaObject = InlineObject1::getOpenApiSchema();
$schemaArr = InlineObject1::getOpenApiSchema(true);
$this->assertIsObject($schemaObject);
$this->assertIsArray($schemaArr);
}
}

View File

@ -0,0 +1,104 @@
<?php
/**
* InlineObjectTest
*
* PHP version 7.1
*
* @package OpenAPIServer\Model
* @author OpenAPI Generator team
* @link https://github.com/openapitools/openapi-generator
*/
/**
* OpenAPI Petstore
*
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* The version of the OpenAPI document: 1.0.0
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
/**
* NOTE: This class is auto generated by the openapi generator program.
* https://github.com/openapitools/openapi-generator
* Please update the test case below to test the model.
*/
namespace OpenAPIServer\Model;
use PHPUnit\Framework\TestCase;
use OpenAPIServer\Model\InlineObject;
/**
* InlineObjectTest Class Doc Comment
*
* @package OpenAPIServer\Model
* @author OpenAPI Generator team
* @link https://github.com/openapitools/openapi-generator
*
* @coversDefaultClass \OpenAPIServer\Model\InlineObject
*/
class InlineObjectTest extends TestCase
{
/**
* Setup before running any test cases
*/
public static function setUpBeforeClass()
{
}
/**
* Setup before running each test case
*/
public function setUp()
{
}
/**
* Clean up after running each test case
*/
public function tearDown()
{
}
/**
* Clean up after running all test cases
*/
public static function tearDownAfterClass()
{
}
/**
* Test "InlineObject"
*/
public function testInlineObject()
{
$testInlineObject = new InlineObject();
}
/**
* Test attribute "name"
*/
public function testPropertyName()
{
}
/**
* Test attribute "status"
*/
public function testPropertyStatus()
{
}
/**
* Test getOpenApiSchema static method
* @covers ::getOpenApiSchema
*/
public function testGetOpenApiSchema()
{
$schemaObject = InlineObject::getOpenApiSchema();
$schemaArr = InlineObject::getOpenApiSchema(true);
$this->assertIsObject($schemaObject);
$this->assertIsArray($schemaArr);
}
}