Updating Media dependent modules to versions compatible with core Media.
[yaffs-website] / vendor / symfony / http-kernel / Tests / DataCollector / Util / ValueExporterTest.php
1 <?php
2
3 /*
4  * This file is part of the Symfony package.
5  *
6  * (c) Fabien Potencier <fabien@symfony.com>
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11
12 namespace Symfony\Component\HttpKernel\Tests\DataCollector\Util;
13
14 use PHPUnit\Framework\TestCase;
15 use Symfony\Component\HttpKernel\DataCollector\Util\ValueExporter;
16
17 /**
18  * @group legacy
19  */
20 class ValueExporterTest extends TestCase
21 {
22     /**
23      * @var ValueExporter
24      */
25     private $valueExporter;
26
27     protected function setUp()
28     {
29         $this->valueExporter = new ValueExporter();
30     }
31
32     public function testDateTime()
33     {
34         $dateTime = new \DateTime('2014-06-10 07:35:40', new \DateTimeZone('UTC'));
35         $this->assertSame('Object(DateTime) - 2014-06-10T07:35:40+00:00', $this->valueExporter->exportValue($dateTime));
36     }
37
38     public function testDateTimeImmutable()
39     {
40         $dateTime = new \DateTimeImmutable('2014-06-10 07:35:40', new \DateTimeZone('UTC'));
41         $this->assertSame('Object(DateTimeImmutable) - 2014-06-10T07:35:40+00:00', $this->valueExporter->exportValue($dateTime));
42     }
43
44     public function testIncompleteClass()
45     {
46         $foo = new \__PHP_Incomplete_Class();
47         $array = new \ArrayObject($foo);
48         $array['__PHP_Incomplete_Class_Name'] = 'AppBundle/Foo';
49         $this->assertSame('__PHP_Incomplete_Class(AppBundle/Foo)', $this->valueExporter->exportValue($foo));
50     }
51 }