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\HttpFoundation\Tests;
14 use PHPUnit\Framework\TestCase;
19 class ResponseFunctionalTest extends TestCase
21 private static $server;
23 public static function setUpBeforeClass()
26 1 => array('file', '/dev/null', 'w'),
27 2 => array('file', '/dev/null', 'w'),
29 if (!self::$server = @proc_open('exec php -S localhost:8054', $spec, $pipes, __DIR__.'/Fixtures/response-functional')) {
30 self::markTestSkipped('PHP server unable to start.');
35 public static function tearDownAfterClass()
38 proc_terminate(self::$server);
39 proc_close(self::$server);
44 * @dataProvider provideCookie
46 public function testCookie($fixture)
48 $result = file_get_contents(sprintf('http://localhost:8054/%s.php', $fixture));
49 $this->assertStringMatchesFormatFile(__DIR__.sprintf('/Fixtures/response-functional/%s.expected', $fixture), $result);
52 public function provideCookie()
54 foreach (glob(__DIR__.'/Fixtures/response-functional/*.php') as $file) {
55 yield array(pathinfo($file, PATHINFO_FILENAME));