diff --git a/Tests/Session/Storage/Handler/AbstractRedisSessionHandlerTestCase.php b/Tests/Session/Storage/Handler/AbstractRedisSessionHandlerTestCase.php index 4df1553c8..0288abd9f 100644 --- a/Tests/Session/Storage/Handler/AbstractRedisSessionHandlerTestCase.php +++ b/Tests/Session/Storage/Handler/AbstractRedisSessionHandlerTestCase.php @@ -89,6 +89,7 @@ public function testUseSessionGcMaxLifetimeAsTimeToLive() public function testDestroySession() { + $this->storage->open('', ''); $this->redisClient->set(self::PREFIX.'id', 'foo'); $this->assertTrue((bool) $this->redisClient->exists(self::PREFIX.'id')); diff --git a/Tests/Session/Storage/Handler/MemcachedSessionHandlerTest.php b/Tests/Session/Storage/Handler/MemcachedSessionHandlerTest.php index 379fcb0d1..15616e3f9 100644 --- a/Tests/Session/Storage/Handler/MemcachedSessionHandlerTest.php +++ b/Tests/Session/Storage/Handler/MemcachedSessionHandlerTest.php @@ -109,6 +109,7 @@ public function testWriteSessionWithLargeTTL() public function testDestroySession() { + $this->storage->open('', ''); $this->memcached ->expects($this->once()) ->method('delete') diff --git a/Tests/Session/Storage/Handler/MigratingSessionHandlerTest.php b/Tests/Session/Storage/Handler/MigratingSessionHandlerTest.php index eb988dfd6..959ffab97 100644 --- a/Tests/Session/Storage/Handler/MigratingSessionHandlerTest.php +++ b/Tests/Session/Storage/Handler/MigratingSessionHandlerTest.php @@ -52,6 +52,8 @@ public function testClose() public function testDestroy() { + $this->dualHandler->open('/path/to/save/location', 'xyz'); + $sessionId = 'xyz'; $this->currentHandler->expects($this->once()) diff --git a/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php b/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php index f43115a13..04dfdbef8 100644 --- a/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php +++ b/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php @@ -166,6 +166,8 @@ public function testDestroy() $this->storage->write('foo', 'bar'); $this->storage->write('baz', 'qux'); + $this->storage->open('test', 'test'); + $this->assertTrue($this->storage->destroy('foo')); $sessions = $this->getSessions(); diff --git a/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php b/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php index ede4703aa..55a238732 100644 --- a/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php +++ b/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php @@ -224,6 +224,7 @@ public function testWrongUsageStillWorks() { // wrong method sequence that should no happen, but still works $storage = new PdoSessionHandler($this->getMemorySqlitePdo()); + $storage->open('', 'sid'); $storage->write('id', 'data'); $storage->write('other_id', 'other_data'); $storage->destroy('inexistent'); diff --git a/Tests/Session/Storage/Handler/StrictSessionHandlerTest.php b/Tests/Session/Storage/Handler/StrictSessionHandlerTest.php index 68db5f4cf..27c952cd2 100644 --- a/Tests/Session/Storage/Handler/StrictSessionHandlerTest.php +++ b/Tests/Session/Storage/Handler/StrictSessionHandlerTest.php @@ -130,6 +130,7 @@ public function testWriteEmptyNewSession() $handler->expects($this->never())->method('write'); $handler->expects($this->once())->method('destroy')->willReturn(true); $proxy = new StrictSessionHandler($handler); + $proxy->open('path', 'name'); $this->assertFalse($proxy->validateId('id')); $this->assertSame('', $proxy->read('id')); @@ -144,6 +145,7 @@ public function testWriteEmptyExistingSession() $handler->expects($this->never())->method('write'); $handler->expects($this->once())->method('destroy')->willReturn(true); $proxy = new StrictSessionHandler($handler); + $proxy->open('path', 'name'); $this->assertSame('data', $proxy->read('id')); $this->assertTrue($proxy->write('id', '')); @@ -155,6 +157,7 @@ public function testDestroy() $handler->expects($this->once())->method('destroy') ->with('id')->willReturn(true); $proxy = new StrictSessionHandler($handler); + $proxy->open('path', 'name'); $this->assertTrue($proxy->destroy('id')); } @@ -166,6 +169,7 @@ public function testDestroyNewSession() ->with('id')->willReturn(''); $handler->expects($this->once())->method('destroy')->willReturn(true); $proxy = new StrictSessionHandler($handler); + $proxy->open('path', 'name'); $this->assertSame('', $proxy->read('id')); $this->assertTrue($proxy->destroy('id')); @@ -181,6 +185,7 @@ public function testDestroyNonEmptyNewSession() $handler->expects($this->once())->method('destroy') ->with('id')->willReturn(true); $proxy = new StrictSessionHandler($handler); + $proxy->open('path', 'name'); $this->assertSame('', $proxy->read('id')); $this->assertTrue($proxy->write('id', 'data'));