Skip to content

Commit 6846c1c

Browse files
committed
Merge branch '6.4' into 7.1
* 6.4: [Form] Remove unnecessary imports minor #58472 CS: clean some whitespaces/indentation (keradus) Fix newline harden test to not depend on the system's configured default timezone [Form] Support intl.use_exceptions/error_level in NumberToLocalizedStringTransformer [Doctrine][Messenger] Use common sequence name to get id from Oracle [ExpressionLanguage] Add missing test case for `Lexer` [FrameworkBundle] Fix passing request_stack to session.listener ensure session storages are opened in tests before destroying them [Serializer] Fix `ObjectNormalizer` gives warnings on normalizing with public static property [HttpKernel] Correctly merge `max-age`/`s-maxage` and `Expires` headers [Security][Validator] Check translations for Czech [Security] Fix serialized object representation in tests [DoctrineBridge] Fix risky test warnings [Serializer] Catch `NotNormalizableValueException` for variadic parameters
2 parents f687703 + 3363819 commit 6846c1c

6 files changed

+12
-0
lines changed

Tests/Session/Storage/Handler/AbstractRedisSessionHandlerTestCase.php

+1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ public function testUseSessionGcMaxLifetimeAsTimeToLive()
8989

9090
public function testDestroySession()
9191
{
92+
$this->storage->open('', '');
9293
$this->redisClient->set(self::PREFIX.'id', 'foo');
9394

9495
$this->assertTrue((bool) $this->redisClient->exists(self::PREFIX.'id'));

Tests/Session/Storage/Handler/MemcachedSessionHandlerTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ public function testWriteSessionWithLargeTTL()
109109

110110
public function testDestroySession()
111111
{
112+
$this->storage->open('', '');
112113
$this->memcached
113114
->expects($this->once())
114115
->method('delete')

Tests/Session/Storage/Handler/MigratingSessionHandlerTest.php

+2
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ public function testClose()
5252

5353
public function testDestroy()
5454
{
55+
$this->dualHandler->open('/path/to/save/location', 'xyz');
56+
5557
$sessionId = 'xyz';
5658

5759
$this->currentHandler->expects($this->once())

Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php

+2
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ public function testDestroy()
166166
$this->storage->write('foo', 'bar');
167167
$this->storage->write('baz', 'qux');
168168

169+
$this->storage->open('test', 'test');
170+
169171
$this->assertTrue($this->storage->destroy('foo'));
170172

171173
$sessions = $this->getSessions();

Tests/Session/Storage/Handler/PdoSessionHandlerTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ public function testWrongUsageStillWorks()
224224
{
225225
// wrong method sequence that should no happen, but still works
226226
$storage = new PdoSessionHandler($this->getMemorySqlitePdo());
227+
$storage->open('', 'sid');
227228
$storage->write('id', 'data');
228229
$storage->write('other_id', 'other_data');
229230
$storage->destroy('inexistent');

Tests/Session/Storage/Handler/StrictSessionHandlerTest.php

+5
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ public function testWriteEmptyNewSession()
130130
$handler->expects($this->never())->method('write');
131131
$handler->expects($this->once())->method('destroy')->willReturn(true);
132132
$proxy = new StrictSessionHandler($handler);
133+
$proxy->open('path', 'name');
133134

134135
$this->assertFalse($proxy->validateId('id'));
135136
$this->assertSame('', $proxy->read('id'));
@@ -144,6 +145,7 @@ public function testWriteEmptyExistingSession()
144145
$handler->expects($this->never())->method('write');
145146
$handler->expects($this->once())->method('destroy')->willReturn(true);
146147
$proxy = new StrictSessionHandler($handler);
148+
$proxy->open('path', 'name');
147149

148150
$this->assertSame('data', $proxy->read('id'));
149151
$this->assertTrue($proxy->write('id', ''));
@@ -155,6 +157,7 @@ public function testDestroy()
155157
$handler->expects($this->once())->method('destroy')
156158
->with('id')->willReturn(true);
157159
$proxy = new StrictSessionHandler($handler);
160+
$proxy->open('path', 'name');
158161

159162
$this->assertTrue($proxy->destroy('id'));
160163
}
@@ -166,6 +169,7 @@ public function testDestroyNewSession()
166169
->with('id')->willReturn('');
167170
$handler->expects($this->once())->method('destroy')->willReturn(true);
168171
$proxy = new StrictSessionHandler($handler);
172+
$proxy->open('path', 'name');
169173

170174
$this->assertSame('', $proxy->read('id'));
171175
$this->assertTrue($proxy->destroy('id'));
@@ -181,6 +185,7 @@ public function testDestroyNonEmptyNewSession()
181185
$handler->expects($this->once())->method('destroy')
182186
->with('id')->willReturn(true);
183187
$proxy = new StrictSessionHandler($handler);
188+
$proxy->open('path', 'name');
184189

185190
$this->assertSame('', $proxy->read('id'));
186191
$this->assertTrue($proxy->write('id', 'data'));

0 commit comments

Comments
 (0)