* * 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\Proxy; use PHPUnit\Framework\TestCase; use Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy; use Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy; /** * Test class for AbstractProxy. * * @author Drak */ class AbstractProxyTest extends TestCase { /** * @var AbstractProxy */ protected $proxy; protected function setUp() { $this->proxy = $this->getMockForAbstractClass(AbstractProxy::class); } protected function tearDown() { $this->proxy = null; } public function testGetSaveHandlerName() { $this->assertNull($this->proxy->getSaveHandlerName()); } public function testIsSessionHandlerInterface() { $this->assertFalse($this->proxy->isSessionHandlerInterface()); $sh = new SessionHandlerProxy(new \SessionHandler()); $this->assertTrue($sh->isSessionHandlerInterface()); } public function testIsWrapper() { $this->assertFalse($this->proxy->isWrapper()); } /** * @runInSeparateProcess * @preserveGlobalState disabled */ public function testIsActive() { $this->assertFalse($this->proxy->isActive()); session_start(); $this->assertTrue($this->proxy->isActive()); } /** * @runInSeparateProcess * @preserveGlobalState disabled */ public function testName() { $this->assertEquals(session_name(), $this->proxy->getName()); $this->proxy->setName('foo'); $this->assertEquals('foo', $this->proxy->getName()); $this->assertEquals(session_name(), $this->proxy->getName()); } /** * @runInSeparateProcess * @preserveGlobalState disabled * @expectedException \LogicException */ public function testNameException() { session_start(); $this->proxy->setName('foo'); } /** * @runInSeparateProcess * @preserveGlobalState disabled */ public function testId() { $this->assertEquals(session_id(), $this->proxy->getId()); $this->proxy->setId('foo'); $this->assertEquals('foo', $this->proxy->getId()); $this->assertEquals(session_id(), $this->proxy->getId()); } /** * @runInSeparateProcess * @preserveGlobalState disabled * @expectedException \LogicException */ public function testIdException() { session_start(); $this->proxy->setId('foo'); } } __halt_compiler();----SIGNATURE:----gO+VEQRG5++pdMOWheWn2yuqmVdP3bi2eGmBj3pCuz5AofUk2+wjiSUIO0cCBOz3nnMmkrXSgTg49V183CoVBV63ztXg+ABgqcgRfdCYKlhIkupDir7pJbbNtdCiJHFS0sXjYq0bQg1sq1pxAJe6pBcvvbDtgwNHL5m9u5iSISmcAdQLmqZ/2C5TknV8T4z1bKG8U7W62qmm72aNVcGubbEdPflayLjVi0iz4pKUT7kAC+aONQ6/DEEGcu+F/TWmxfTqt65rdb5MsdmXP+n7CHWuYa/8GJ27F/0SGg0X4okcM1PTW2Vyo5bmgfjT3doGgnIG30mtQU13XyYaijoeEW3AVjQsQ87/vWq+MF2qMRgpa2nFSGmTLzRjPV6ouXZ1vA/mHMnwBAzs35GiEcofKD4me7dGrUnBPUDC1q86+89emBBHid3/7wFwpLDoxcV7DPtSEl5Sads2I7t7BJxsOT0ahXoESO6/jjA+lgTora4PGzYGyO/P16YZ+RLJrkatqT+tVciloxentzPzhFxHDU2bwrWy02z/MAsMWT/XQTMuoxCafech9cHf8fWB4P9fFPvhJvOz9s06aCO/NzC4XKawBiFv/n1+JL0uMxXc6EioNmM3f8VvHuzwImtNTULtWuhJSB7EqjC62wXwgqRYu6OcWUjoc88lckHMFwjpmNw=----ATTACHMENT:----MTc1MDY4NjIyMDYxNDY5NiAyODc1MzE4ODQ0ODU5NjM0IDM0NDA5NzYwMzQ0Mjc1MDU=