forked from loafle/openapi-generator-original
Update PHP client default value (#417)
* update php default value * update php samples with oas3
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace OpenAPI\Client;
|
||||
|
||||
use OpenAPI\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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user