Skip to content

Commit

Permalink
Merge branch '5.4' into 6.4
Browse files Browse the repository at this point in the history
* 5.4:
  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
  [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
  [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
  • Loading branch information
xabbuh committed Oct 9, 2024
2 parents df510a6 + e641edd commit 3363819
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ public function testWriteSessionWithLargeTTL()

public function testDestroySession()
{
$this->storage->open('', '');
$this->memcached
->expects($this->once())
->method('delete')
Expand Down
2 changes: 2 additions & 0 deletions Tests/Session/Storage/Handler/MigratingSessionHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
2 changes: 2 additions & 0 deletions Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 1 addition & 0 deletions Tests/Session/Storage/Handler/PdoSessionHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
5 changes: 5 additions & 0 deletions Tests/Session/Storage/Handler/StrictSessionHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand All @@ -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', ''));
Expand All @@ -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'));
}
Expand All @@ -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'));
Expand All @@ -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'));
Expand Down

0 comments on commit 3363819

Please sign in to comment.