mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-11 12:12:45 +00:00
Merge remote-tracking branch 'origin/master' into 230_merge_master
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace Swagger\Client;
|
||||
|
||||
use Swagger\Client\Model\FormatTest;
|
||||
|
||||
class DateTimeSerializerTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testDateTimeSanitazion()
|
||||
{
|
||||
$dateTime = new \DateTime('April 30, 1973 17:05 CEST');
|
||||
|
||||
$input = new FormatTest([
|
||||
'date_time' => $dateTime,
|
||||
]);
|
||||
|
||||
$data = ObjectSerializer::sanitizeForSerialization($input);
|
||||
|
||||
$this->assertEquals($data->dateTime, '1973-04-30T17:05:00+02:00');
|
||||
}
|
||||
|
||||
public function testDateSanitazion()
|
||||
{
|
||||
$dateTime = new \DateTime('April 30, 1973 17:05 CEST');
|
||||
|
||||
$input = new FormatTest([
|
||||
'date' => $dateTime,
|
||||
]);
|
||||
|
||||
$data = ObjectSerializer::sanitizeForSerialization($input);
|
||||
|
||||
$this->assertEquals($data->date, '1973-04-30');
|
||||
}
|
||||
}
|
||||
@@ -259,7 +259,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
|
||||
$response = $this->api->uploadFile($pet_id, 'test meta', __DIR__ . '/../composer.json');
|
||||
// return ApiResponse
|
||||
$this->assertInstanceOf(ApiResponse::class, $response);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -297,7 +296,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
|
||||
$new_pet = new Model\Pet;
|
||||
// the empty object should be serialised to {}
|
||||
$this->assertSame("{}", "$new_pet");
|
||||
|
||||
}
|
||||
|
||||
// test inheritance in the model
|
||||
@@ -391,5 +389,4 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
|
||||
// 'path' => sys_get_temp_dir() . '/' . $result->getFilename()
|
||||
// ]);
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@@ -28,6 +28,5 @@ class UserApiTest extends \PHPUnit_Framework_TestCase
|
||||
$response,
|
||||
"response string starts with 'logged in user session'"
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user