You are here

public function ParserTest::testParseDateAsMappingValue in Lockr 7.3

File

vendor/symfony/yaml/Tests/ParserTest.php, line 1539

Class

ParserTest

Namespace

Symfony\Component\Yaml\Tests

Code

public function testParseDateAsMappingValue() {
  $yaml = <<<'EOT'
date: 2002-12-14
EOT;
  $expectedDate = new \DateTime();
  $expectedDate
    ->setTimeZone(new \DateTimeZone('UTC'));
  $expectedDate
    ->setDate(2002, 12, 14);
  $expectedDate
    ->setTime(0, 0, 0);
  $this
    ->assertEquals([
    'date' => $expectedDate,
  ], $this->parser
    ->parse($yaml, Yaml::PARSE_DATETIME));
}