54fd39e0d8c8f65d57ead5c5069fd5725e79c33a
[yaffs-website] / vendor / symfony / http-kernel / Tests / DataCollector / DataCollectorTest.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;
13
14 use PHPUnit\Framework\TestCase;
15 use Symfony\Component\HttpFoundation\Request;
16 use Symfony\Component\HttpFoundation\Response;
17 use Symfony\Component\HttpKernel\Tests\Fixtures\DataCollector\CloneVarDataCollector;
18 use Symfony\Component\VarDumper\Cloner\VarCloner;
19
20 class DataCollectorTest extends TestCase
21 {
22     public function testCloneVarStringWithScheme()
23     {
24         $c = new CloneVarDataCollector('scheme://foo');
25         $c->collect(new Request(), new Response());
26         $cloner = new VarCloner();
27
28         $this->assertEquals($cloner->cloneVar('scheme://foo'), $c->getData());
29     }
30
31     public function testCloneVarExistingFilePath()
32     {
33         $c = new CloneVarDataCollector(array($filePath = tempnam(sys_get_temp_dir(), 'clone_var_data_collector_')));
34         $c->collect(new Request(), new Response());
35
36         $this->assertSame($filePath, $c->getData()[0]);
37     }
38 }