Добавил тест
This commit is contained in:
parent
e3290afe79
commit
c16d2e7e61
@ -78,6 +78,7 @@ class FillTest extends \Codeception\Test\Unit
|
||||
new CollectionItem('2'),
|
||||
];
|
||||
$helloRequest->collection = $collection;
|
||||
$helloRequest->createdAt = new \DateTimeImmutable('2020-05-21 13:36:22');
|
||||
|
||||
$dto = $dto2DataConverter->convert($helloRequest);
|
||||
// codecept_debug(json_encode($dto));
|
||||
@ -127,6 +128,7 @@ class FillTest extends \Codeception\Test\Unit
|
||||
'value' => '2',
|
||||
],
|
||||
],
|
||||
'createdAt' => '2020-05-21T13:36:22+00:00'
|
||||
], $dto);
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ namespace Rinsvent\DTO2Data\Tests\unit\Converter\fixtures\FillTest;
|
||||
|
||||
use Rinsvent\DTO2Data\Attribute\DataPath;
|
||||
use Rinsvent\DTO2Data\Attribute\PropertyPath;
|
||||
use Rinsvent\DTO2Data\Transformer\DateTimeFormat;
|
||||
use Rinsvent\DTO2Data\Transformer\Trim;
|
||||
|
||||
#[HelloSchema]
|
||||
@ -22,4 +23,6 @@ class HelloRequest
|
||||
#[PropertyPath(path: 'uuid.id')]
|
||||
public UUID $uuid;
|
||||
public Collection $collection;
|
||||
#[DateTimeFormat]
|
||||
public \DateTimeImmutable $createdAt;
|
||||
}
|
||||
|
@ -30,5 +30,6 @@ class HelloSchema extends Schema
|
||||
'collection' => [
|
||||
'value'
|
||||
],
|
||||
'createdAt'
|
||||
];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user