e7d60cff3d0be77b2f63e7f56157311da4c83889
[yaffs-website] / vendor / symfony / http-kernel / Tests / Fixtures / TestClient.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\Fixtures;
13
14 use Symfony\Component\HttpKernel\Client;
15
16 class TestClient extends Client
17 {
18     protected function getScript($request)
19     {
20         $script = parent::getScript($request);
21
22         $autoload = file_exists(__DIR__.'/../../vendor/autoload.php')
23             ? __DIR__.'/../../vendor/autoload.php'
24             : __DIR__.'/../../../../../../vendor/autoload.php'
25         ;
26
27         $script = preg_replace('/(\->register\(\);)/', "$0\nrequire_once '$autoload';\n", $script);
28
29         return $script;
30     }
31 }