Добавил тест на дату

master v0.0.1
Rinsvent 3 years ago
parent 28c4b91802
commit 8c48ad8970
  1. 23
      tests/unit/DateTimeFormatTransformTest.php
  2. 9
      tests/unit/TrimTransformTest.php

@ -0,0 +1,23 @@
<?php
namespace Rinsvent\DTO2Data\Tests\Converter;
use Rinsvent\Transformer\Transformer;
class DateTimeFormatTransformTest extends \Codeception\Test\Unit
{
/**
* @var \UnitTester
*/
protected $tester;
// tests
public function testSuccessFillRequestData()
{
$t = new Transformer();
$dt = new \DateTime('2022-04-01');
$dt->setTime(5, 23, 21);
$actual = $t->transform($dt, new Transformer\DateTimeFormat());
$this->assertEquals('2022-04-01T05:23:21+00:00', $actual);
}
}

@ -2,15 +2,6 @@
namespace Rinsvent\DTO2Data\Tests\Converter; namespace Rinsvent\DTO2Data\Tests\Converter;
use Rinsvent\DTO2Data\Dto2DataConverter;
use Rinsvent\DTO2Data\Tests\unit\Converter\fixtures\FillTest\Author;
use Rinsvent\DTO2Data\Tests\unit\Converter\fixtures\FillTest\Bar;
use Rinsvent\DTO2Data\Tests\unit\Converter\fixtures\FillTest\BuyRequest;
use Rinsvent\DTO2Data\Tests\unit\Converter\fixtures\FillTest\Collection;
use Rinsvent\DTO2Data\Tests\unit\Converter\fixtures\FillTest\CollectionItem;
use Rinsvent\DTO2Data\Tests\unit\Converter\fixtures\FillTest\HelloRequest;
use Rinsvent\DTO2Data\Tests\unit\Converter\fixtures\FillTest\HelloSchema;
use Rinsvent\DTO2Data\Tests\unit\Converter\fixtures\FillTest\UUID;
use Rinsvent\Transformer\Transformer; use Rinsvent\Transformer\Transformer;
class FillTest extends \Codeception\Test\Unit class FillTest extends \Codeception\Test\Unit

Loading…
Cancel
Save