Upgrade 1-11.38

This commit is contained in:
xesmyd
2026-03-30 14:10:30 +02:00
parent f2a7e6d1fc
commit ac648ef29d
24665 changed files with 69682 additions and 2205004 deletions
@@ -12,9 +12,9 @@
namespace Symfony\Component\HttpKernel\Tests\Fragment;
use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpKernel\Fragment\FragmentHandler;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Fragment\FragmentHandler;
/**
* @group time-sensitive
@@ -32,35 +32,29 @@ class FragmentHandlerTest extends TestCase
$this->requestStack
->expects($this->any())
->method('getCurrentRequest')
->will($this->returnValue(Request::create('/')))
->willReturn(Request::create('/'))
;
}
/**
* @expectedException \InvalidArgumentException
*/
public function testRenderWhenRendererDoesNotExist()
{
$this->expectException('InvalidArgumentException');
$handler = new FragmentHandler($this->requestStack);
$handler->render('/', 'foo');
}
/**
* @expectedException \InvalidArgumentException
*/
public function testRenderWithUnknownRenderer()
{
$this->expectException('InvalidArgumentException');
$handler = $this->getHandler($this->returnValue(new Response('foo')));
$handler->render('/', 'bar');
}
/**
* @expectedException \RuntimeException
* @expectedExceptionMessage Error when rendering "http://localhost/" (Status code is 404).
*/
public function testDeliverWithUnsuccessfulResponse()
{
$this->expectException('RuntimeException');
$this->expectExceptionMessage('Error when rendering "http://localhost/" (Status code is 404).');
$handler = $this->getHandler($this->returnValue(new Response('foo', 404)));
$handler->render('/', 'foo');
@@ -68,18 +62,18 @@ class FragmentHandlerTest extends TestCase
public function testRender()
{
$handler = $this->getHandler($this->returnValue(new Response('foo')), array('/', Request::create('/'), array('foo' => 'foo', 'ignore_errors' => true)));
$handler = $this->getHandler($this->returnValue(new Response('foo')), ['/', Request::create('/'), ['foo' => 'foo', 'ignore_errors' => true]]);
$this->assertEquals('foo', $handler->render('/', 'foo', array('foo' => 'foo')));
$this->assertEquals('foo', $handler->render('/', 'foo', ['foo' => 'foo']));
}
protected function getHandler($returnValue, $arguments = array())
protected function getHandler($returnValue, $arguments = [])
{
$renderer = $this->getMockBuilder('Symfony\Component\HttpKernel\Fragment\FragmentRendererInterface')->getMock();
$renderer
->expects($this->any())
->method('getName')
->will($this->returnValue('foo'))
->willReturn('foo')
;
$e = $renderer
->expects($this->any())
@@ -88,7 +82,7 @@ class FragmentHandlerTest extends TestCase
;
if ($arguments) {
call_user_func_array(array($e, 'with'), $arguments);
\call_user_func_array([$e, 'with'], $arguments);
}
$handler = new FragmentHandler($this->requestStack);