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:
  fix compatibility with Twig 3.10
  [Strings][EnglishInflector] Fix incorrect pluralisation of 'Album'
  handle union and intersection types for cascaded validations
  move wiring of the property info extractor to the ObjectNormalizer
  move Process component dep to require-dev
  Remove calls to `onConsecutiveCalls()`
  fix: remove unwanted type cast
  accept AbstractAsset instances when filtering schemas
  better distinguish URL schemes and windows drive letters
  convert empty CSV header names into numeric keys
  • Loading branch information
derrabus committed May 2, 2024
2 parents 5dc9699 + 51ffc08 commit a2cf112
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
6 changes: 3 additions & 3 deletions Tests/EventListener/SessionListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class SessionListenerTest extends TestCase
public function testSessionCookieOptions(array $phpSessionOptions, array $sessionOptions, array $expectedSessionOptions)
{
$session = $this->createMock(Session::class);
$session->method('getUsageIndex')->will($this->onConsecutiveCalls(0, 1));
$session->method('getUsageIndex')->willReturn(0, 1);
$session->method('getId')->willReturn('123456');
$session->method('getName')->willReturn('PHPSESSID');
$session->method('save');
Expand Down Expand Up @@ -493,7 +493,7 @@ public function testResponseIsStillPublicIfSessionStartedAndHeaderPresent()
public function testSessionSaveAndResponseHasSessionCookie()
{
$session = $this->getMockBuilder(Session::class)->disableOriginalConstructor()->getMock();
$session->expects($this->exactly(1))->method('getUsageIndex')->will($this->onConsecutiveCalls(0, 1));
$session->expects($this->exactly(1))->method('getUsageIndex')->willReturn(0);
$session->expects($this->exactly(1))->method('getId')->willReturn('123456');
$session->expects($this->exactly(1))->method('getName')->willReturn('PHPSESSID');
$session->expects($this->exactly(1))->method('save');
Expand Down Expand Up @@ -646,7 +646,7 @@ public function testSurrogateMainRequestIsPublic()
{
$session = $this->createMock(Session::class);
$session->expects($this->exactly(1))->method('getName')->willReturn('PHPSESSID');
$session->expects($this->exactly(2))->method('getUsageIndex')->will($this->onConsecutiveCalls(0, 1));
$session->expects($this->exactly(2))->method('getUsageIndex')->willReturn(0, 1);
$sessionFactory = $this->createMock(SessionFactory::class);
$sessionFactory->expects($this->once())->method('createSession')->willReturn($session);

Expand Down
15 changes: 11 additions & 4 deletions Tests/Fragment/InlineFragmentRendererTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,17 @@ public function testRenderExceptionIgnoreErrors()

public function testRenderExceptionIgnoreErrorsWithAlt()
{
$strategy = new InlineFragmentRenderer($this->getKernel($this->onConsecutiveCalls(
$this->throwException(new \RuntimeException('foo')),
$this->returnValue(new Response('bar'))
)));
$strategy = new InlineFragmentRenderer($this->getKernel($this->returnCallback(function () {
static $firstCall = true;

if ($firstCall) {
$firstCall = false;

throw new \RuntimeException('foo');
}

return new Response('bar');
})));

$this->assertEquals('bar', $strategy->render('/', Request::create('/'), ['ignore_errors' => true, 'alt' => '/foo'])->getContent());
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/HttpCache/EsiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ protected function getCache($request, $response)
if (\is_array($response)) {
$cache->expects($this->any())
->method('handle')
->will($this->onConsecutiveCalls(...$response))
->willReturn(...$response)
;
} else {
$cache->expects($this->any())
Expand Down
2 changes: 1 addition & 1 deletion Tests/HttpCache/SsiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ protected function getCache($request, $response)
if (\is_array($response)) {
$cache->expects($this->any())
->method('handle')
->will($this->onConsecutiveCalls(...$response))
->willReturn(...$response)
;
} else {
$cache->expects($this->any())
Expand Down

0 comments on commit a2cf112

Please sign in to comment.