diff --git a/Tests/Session/Storage/Handler/AbstractRedisSessionHandlerTestCase.php b/Tests/Session/Storage/Handler/AbstractRedisSessionHandlerTestCase.php index cd8b31c60..e73281173 100644 --- a/Tests/Session/Storage/Handler/AbstractRedisSessionHandlerTestCase.php +++ b/Tests/Session/Storage/Handler/AbstractRedisSessionHandlerTestCase.php @@ -106,6 +106,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 a3aea2e8e..25edf922d 100644 --- a/Tests/Session/Storage/Handler/MemcachedSessionHandlerTest.php +++ b/Tests/Session/Storage/Handler/MemcachedSessionHandlerTest.php @@ -119,6 +119,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 f56f753af..6fccde04f 100644 --- a/Tests/Session/Storage/Handler/MigratingSessionHandlerTest.php +++ b/Tests/Session/Storage/Handler/MigratingSessionHandlerTest.php @@ -51,6 +51,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 8e9c5fa04..93c7995dd 100644 --- a/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php +++ b/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php @@ -174,6 +174,8 @@ public function testDestroy() ->method('deleteOne') ->with([$this->options['id_field'] => 'foo']); + $this->storage->open('test', 'test'); + $this->assertTrue($this->storage->destroy('foo')); } diff --git a/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php b/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php index 5b5f660c4..455469c5f 100644 --- a/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php +++ b/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php @@ -225,6 +225,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'));