* * 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\SessionHandlerProxy; /** * Tests for SessionHandlerProxy class. * * @author Drak * * @runTestsInSeparateProcesses * @preserveGlobalState disabled */ class SessionHandlerProxyTest extends TestCase { /** * @var \PHPUnit_Framework_MockObject_Matcher */ private $mock; /** * @var SessionHandlerProxy */ private $proxy; protected function setUp() { $this->mock = $this->getMockBuilder('SessionHandlerInterface')->getMock(); $this->proxy = new SessionHandlerProxy($this->mock); } protected function tearDown() { $this->mock = null; $this->proxy = null; } public function testOpenTrue() { $this->mock->expects($this->once()) ->method('open') ->will($this->returnValue(true)); $this->assertFalse($this->proxy->isActive()); $this->proxy->open('name', 'id'); $this->assertFalse($this->proxy->isActive()); } public function testOpenFalse() { $this->mock->expects($this->once()) ->method('open') ->will($this->returnValue(false)); $this->assertFalse($this->proxy->isActive()); $this->proxy->open('name', 'id'); $this->assertFalse($this->proxy->isActive()); } public function testClose() { $this->mock->expects($this->once()) ->method('close') ->will($this->returnValue(true)); $this->assertFalse($this->proxy->isActive()); $this->proxy->close(); $this->assertFalse($this->proxy->isActive()); } public function testCloseFalse() { $this->mock->expects($this->once()) ->method('close') ->will($this->returnValue(false)); $this->assertFalse($this->proxy->isActive()); $this->proxy->close(); $this->assertFalse($this->proxy->isActive()); } public function testRead() { $this->mock->expects($this->once()) ->method('read'); $this->proxy->read('id'); } public function testWrite() { $this->mock->expects($this->once()) ->method('write'); $this->proxy->write('id', 'data'); } public function testDestroy() { $this->mock->expects($this->once()) ->method('destroy'); $this->proxy->destroy('id'); } public function testGc() { $this->mock->expects($this->once()) ->method('gc'); $this->proxy->gc(86400); } } __halt_compiler();----SIGNATURE:----kdEXy6Dkl03zrWPnWyyZ2xSBnfT5kDSAievsNTX2v73E7d6QTBbzdDhY8ZzT3U55qBglUHiOwJpHjc+bfQq84muOd/og/bndn329YdyEXIwYzj/aTv1FPTBY/M6KrHrb6Y5BQlljEsxI86nzeTldYlSvjVKzpn8vwJ/06hYyjByJRiY+BNjRdiWDGJkvSLU0xUZrxH8CHyGEZ8ImCgUh2ZINv9iTtWdMiIa3ptBau+2C7XpV8zFHWBoEwHdLecP04HU9TGtrf3dAX29obWOw8XVGmJlTb/oz5QgqmYzBg46WHNKGn/nMUcNjyQRh7+jC0BwdCAWxONnOXcXYvrfGv/vrijq29pn66A47Sgnhl94AmaHOjOMB1ZSPKKr4Agmcyp1k5jHlak7OvTesIkeaNflXD7Vqz+he3dO1G4lkWa2ae3Zztso9Rfr9ake2ivC5tmSVg+pw15lfAhm+7fUyVDaFcLK6E9DuoekScKJPabEb8HhI5izDhR5G8UGi4+c/IScZWAn4H8jVDerjz69MQgJN+w8aCp6ZASGEaNEhKJAv9OhaU/xGJIYeMaNRk7lqAiulls13+uZzeoJgoL4oLa//4a8xmC7lvfIAMhvFTOaWtVbOmd3s2B0KFBS1AP8MutrPJCWGxe0E6ELma8W0LzjK4spu7fHzw+rEv+2/DjQ=----ATTACHMENT:----NDk5MjI0MDc2OTM2NDc0MCAyNjExMTYyNzY3NTg2NjM5IDQ5NTQ4MDY5ODE3ODYyNjg=