minor #17685 [Serializer] Add missing TZ to tests (nicolas-grekas)
This PR was merged into the 3.1-dev branch.
Discussion
----------
[Serializer] Add missing TZ to tests
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Commits
-------
443dc24
[Serializer] Add missing TZ to tests
This commit is contained in:
commit
8385cd6e15
@ -37,8 +37,8 @@ class DateTimeNormalizerTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function testNormalize()
|
||||
{
|
||||
$this->assertEquals('2016-01-01T00:00:00+00:00', $this->normalizer->normalize(new \DateTime('2016/01/01')));
|
||||
$this->assertEquals('2016-01-01T00:00:00+00:00', $this->normalizer->normalize(new \DateTimeImmutable('2016/01/01')));
|
||||
$this->assertEquals('2016-01-01T00:00:00+00:00', $this->normalizer->normalize(new \DateTime('2016/01/01', new \DateTimeZone('UTC'))));
|
||||
$this->assertEquals('2016-01-01T00:00:00+00:00', $this->normalizer->normalize(new \DateTimeImmutable('2016/01/01', new \DateTimeZone('UTC'))));
|
||||
}
|
||||
|
||||
public function testContextFormat()
|
||||
@ -48,7 +48,7 @@ class DateTimeNormalizerTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function testConstructorFormat()
|
||||
{
|
||||
$this->assertEquals('16', (new DateTimeNormalizer('y'))->normalize(new \DateTime('2016/01/01')));
|
||||
$this->assertEquals('16', (new DateTimeNormalizer('y'))->normalize(new \DateTime('2016/01/01', new \DateTimeZone('UTC'))));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -70,9 +70,9 @@ class DateTimeNormalizerTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function testDenormalize()
|
||||
{
|
||||
$this->assertEquals(new \DateTimeImmutable('2016/01/01'), $this->normalizer->denormalize('2016-01-01T00:00:00+00:00', \DateTimeInterface::class));
|
||||
$this->assertEquals(new \DateTimeImmutable('2016/01/01'), $this->normalizer->denormalize('2016-01-01T00:00:00+00:00', \DateTimeImmutable::class));
|
||||
$this->assertEquals(new \DateTime('2016/01/01'), $this->normalizer->denormalize('2016-01-01T00:00:00+00:00', \DateTime::class));
|
||||
$this->assertEquals(new \DateTimeImmutable('2016/01/01', new \DateTimeZone('UTC')), $this->normalizer->denormalize('2016-01-01T00:00:00+00:00', \DateTimeInterface::class));
|
||||
$this->assertEquals(new \DateTimeImmutable('2016/01/01', new \DateTimeZone('UTC')), $this->normalizer->denormalize('2016-01-01T00:00:00+00:00', \DateTimeImmutable::class));
|
||||
$this->assertEquals(new \DateTime('2016/01/01', new \DateTimeZone('UTC')), $this->normalizer->denormalize('2016-01-01T00:00:00+00:00', \DateTime::class));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user