Skip to content

Commit c7dabc7

Browse files
committed
Merge branch '7.1' into 7.2
* 7.1: [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 53b79fb + 6846c1c commit c7dabc7

6 files changed

+12
-0
lines changed

Tests/Session/Storage/Handler/AbstractRedisSessionHandlerTestCase.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ public function testUseSessionGcMaxLifetimeAsTimeToLive()
8585

8686
public function testDestroySession()
8787
{
88+
$this->storage->open('', '');
8889
$this->redisClient->set(self::PREFIX.'id', 'foo');
8990

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

Tests/Session/Storage/Handler/MemcachedSessionHandlerTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ public function testWriteSessionWithLargeTTL()
107107

108108
public function testDestroySession()
109109
{
110+
$this->storage->open('', '');
110111
$this->memcached
111112
->expects($this->once())
112113
->method('delete')

Tests/Session/Storage/Handler/MigratingSessionHandlerTest.php

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ public function testDestroy()
164164
$this->storage->write('foo', 'bar');
165165
$this->storage->write('baz', 'qux');
166166

167+
$this->storage->open('test', 'test');
168+
167169
$this->assertTrue($this->storage->destroy('foo'));
168170

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

Tests/Session/Storage/Handler/PdoSessionHandlerTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ public function testWrongUsageStillWorks()
223223
{
224224
// wrong method sequence that should no happen, but still works
225225
$storage = new PdoSessionHandler($this->getMemorySqlitePdo());
226+
$storage->open('', 'sid');
226227
$storage->write('id', 'data');
227228
$storage->write('other_id', 'other_data');
228229
$storage->destroy('inexistent');

Tests/Session/Storage/Handler/StrictSessionHandlerTest.php

Lines changed: 5 additions & 0 deletions
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)