4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\HttpKernel\Tests\DataCollector;
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;
20 class DataCollectorTest extends TestCase
22 public function testCloneVarStringWithScheme()
24 $c = new CloneVarDataCollector('scheme://foo');
25 $c->collect(new Request(), new Response());
26 $cloner = new VarCloner();
28 $this->assertEquals($cloner->cloneVar('scheme://foo'), $c->getData());
31 public function testCloneVarExistingFilePath()
33 $c = new CloneVarDataCollector(array($filePath = tempnam(sys_get_temp_dir(), 'clone_var_data_collector_')));
34 $c->collect(new Request(), new Response());
36 $this->assertSame($filePath, $c->getData()[0]);