* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\HttpFoundation\Tests\Session\Storage\Handler; use PHPUnit\Framework\TestCase; /** * @requires PHP 7.0 */ class AbstractSessionHandlerTest extends TestCase { private static $server; public static function setUpBeforeClass() { $spec = array( 1 => array('file', '/dev/null', 'w'), 2 => array('file', '/dev/null', 'w'), ); if (!self::$server = @proc_open('exec php -S localhost:8053', $spec, $pipes, __DIR__.'/Fixtures')) { self::markTestSkipped('PHP server unable to start.'); } sleep(1); } public static function tearDownAfterClass() { if (self::$server) { proc_terminate(self::$server); proc_close(self::$server); } } /** * @dataProvider provideSession */ public function testSession($fixture) { $context = array('http' => array('header' => "Cookie: sid=123abc\r\n")); $context = stream_context_create($context); $result = file_get_contents(sprintf('http://localhost:8053/%s.php', $fixture), false, $context); $this->assertStringEqualsFile(__DIR__.sprintf('/Fixtures/%s.expected', $fixture), $result); } public function provideSession() { foreach (glob(__DIR__.'/Fixtures/*.php') as $file) { yield array(pathinfo($file, PATHINFO_FILENAME)); } } } __halt_compiler();----SIGNATURE:----O/gQX7MheyrEiQWO9qYhgTvlQpxXHNF90LQ2ZxwdmIBvr6wJFrJEEnNHMeqdyzJgsIdyl4RdFq/5Sw0/dsd1MAzAuHCvNAAph1uPKNyKp03iKvHKEd9wJ3dT6Nse9/wzi3+vaHiznflcAGqlLdD0ACZaPpW1m3wwzbgUp268BzeZM7VM3EtaQSDRLY1cavlxO7S6EoCRm2r+x7TFrl3hhv4n0f8fZwRk5BVTwWzMhwf1sogkoYbkyw29OGLAhNhYpDL/VrD/qXPjUS0afM9MtMAUAwLTfta6cIzdjWBxtjiC1GUqXBC7TW8yUeYrWJHY3hnt56FRJG1enIL1U6jMm8gISF6bIgFvTUM24j0aGmJarR57iCDN54niJMStIMchNzujdCcS+ZJFMNTAMoR5Ms3K0RIOfe7gTmTbB4fAhFoKeKFYK95FlASAUfTrzbEQhJPHbXIiZC2OgPOKPd8YV9dGlhdFsjeYFnntyZUl/EsmntveO7h+T7HRWIeiW3akwajH2M4R2IVjnvuDgBPvkBczk0uB9+c8/fmXB65pJ8qed/8s/gu+u4hLNBKiC5Ux3Wq0gNzmP/nZm6N8mw0TY9DcacCJnpftZlnsbyxAu1MKz/YS8B10GTotqcCuamlf7OE5eQDrOS9qVJFb66shfj6xxqQunVR2o0y6pel/bUw=----ATTACHMENT:----NDI5Nzc5MzA1NDY3NjI0IDk2MjE0ODIxNjA2MTcwMTggNTc5NjQ4MDUxMDk1MzE3Mw==