Skip to content

Commit

Permalink
Merge branch '3.4' into 4.4
Browse files Browse the repository at this point in the history
* 3.4:
  [Cache] fix catching auth errors
  Fix CS
  [FrameworkBundle] set default session.handler alias if handler_id is not provided
  Fix CS
  Readability update
  Fix checks for phpunit releases on Composer 2 (resolves #37601)
  [SCA] Minor fixes on tests
  • Loading branch information
nicolas-grekas committed Jul 23, 2020
2 parents 768f66a + b11fb1a commit 44f5147
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions Tests/ResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -617,20 +617,20 @@ public function testSetCache()

$options = ['etag' => '"whatever"'];
$response->setCache($options);
$this->assertEquals($response->getEtag(), '"whatever"');
$this->assertEquals('"whatever"', $response->getEtag());

$now = $this->createDateTimeNow();
$options = ['last_modified' => $now];
$response->setCache($options);
$this->assertEquals($response->getLastModified()->getTimestamp(), $now->getTimestamp());
$this->assertEquals($now->getTimestamp(), $response->getLastModified()->getTimestamp());

$options = ['max_age' => 100];
$response->setCache($options);
$this->assertEquals($response->getMaxAge(), 100);
$this->assertEquals(100, $response->getMaxAge());

$options = ['s_maxage' => 200];
$response->setCache($options);
$this->assertEquals($response->getMaxAge(), 200);
$this->assertEquals(200, $response->getMaxAge());

$this->assertTrue($response->headers->hasCacheControlDirective('public'));
$this->assertFalse($response->headers->hasCacheControlDirective('private'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function testRead()
->method('findOne')
->willReturnCallback(function ($criteria) use ($testTimeout) {
$this->assertArrayHasKey($this->options['id_field'], $criteria);
$this->assertEquals($criteria[$this->options['id_field']], 'foo');
$this->assertEquals('foo', $criteria[$this->options['id_field']]);

$this->assertArrayHasKey($this->options['expiry_field'], $criteria);
$this->assertArrayHasKey('$gte', $criteria[$this->options['expiry_field']]);
Expand Down
8 changes: 4 additions & 4 deletions Tests/Session/Storage/PhpBridgeSessionStorageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ public function testClear()
$_SESSION['drak'] = 'loves symfony';
$storage->getBag('attributes')->set('symfony', 'greatness');
$key = $storage->getBag('attributes')->getStorageKey();
$this->assertEquals($_SESSION[$key], ['symfony' => 'greatness']);
$this->assertEquals($_SESSION['drak'], 'loves symfony');
$this->assertEquals(['symfony' => 'greatness'], $_SESSION[$key]);
$this->assertEquals('loves symfony', $_SESSION['drak']);
$storage->clear();
$this->assertEquals($_SESSION[$key], []);
$this->assertEquals($_SESSION['drak'], 'loves symfony');
$this->assertEquals([], $_SESSION[$key]);
$this->assertEquals('loves symfony', $_SESSION['drak']);
}
}

0 comments on commit 44f5147

Please sign in to comment.