Добавил тест

This commit is contained in:
Rinsvent 2021-11-06 15:23:18 +07:00
parent e3290afe79
commit c16d2e7e61
3 changed files with 6 additions and 0 deletions

View File

@ -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);
}
}

View File

@ -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;
}

View File

@ -30,5 +30,6 @@ class HelloSchema extends Schema
'collection' => [
'value'
],
'createdAt'
];
}