Loading core/lib/Drupal/Core/Form/FormBuilder.php +2 −2 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ use Drupal\Core\Theme\ThemeManagerInterface; use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; use Symfony\Component\HttpFoundation\FileBag; use Symfony\Component\HttpFoundation\ParameterBag; use Symfony\Component\HttpFoundation\InputBag; use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpFoundation\Response; Loading Loading @@ -967,7 +967,7 @@ public function doBuildForm($form_id, &$element, FormStateInterface &$form_state $request = $this->requestStack->getCurrentRequest(); // Do not trust any POST data. $request->request = new ParameterBag(); $request->request = new InputBag(); // Make sure file uploads do not get processed. $request->files = new FileBag(); // Ensure PHP globals reflect these changes. Loading core/modules/language/tests/src/Unit/Plugin/LanguageNegotiation/LanguageNegotiationContentEntityTest.php +2 −2 Original line number Diff line number Diff line Loading @@ -12,7 +12,7 @@ use Drupal\Core\Url; use Drupal\language\ConfigurableLanguageManagerInterface; use Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationContentEntity; use Symfony\Component\HttpFoundation\ParameterBag; use Symfony\Component\HttpFoundation\InputBag; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\ServerBag; use Symfony\Component\Routing\Route; Loading Loading @@ -106,7 +106,7 @@ public function testGetLangcode() { // Case 2: A request is available, but the languageManager is not set and // the static::QUERY_PARAMETER is not provided as a named parameter. $request = Request::create('/de/foo', 'GET'); $request->query = new ParameterBag(); $request->query = new InputBag(); $this->assertEquals(NULL, $languageNegotiationContentEntity->getLangcode($request)); // Case 3: A request is available, the languageManager is set, but the Loading core/modules/media_library/tests/src/Unit/MediaLibrarySelectFormTest.php +2 −10 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ use Drupal\views\ResultRow; use Drupal\views\ViewExecutable; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\HttpFoundation\ParameterBag; use Symfony\Component\HttpFoundation\InputBag; use Symfony\Component\HttpFoundation\Request; /** Loading Loading @@ -50,18 +50,10 @@ public function testViewsForm(): void { $container->set('string_translation', $this->createMock(TranslationInterface::class)); \Drupal::setContainer($container); $query = $this->getMockBuilder(ParameterBag::class) ->onlyMethods(['all']) ->disableOriginalConstructor() ->getMock(); $query->expects($this->any()) ->method('all') ->willReturn([]); $request = $this->getMockBuilder(Request::class) ->disableOriginalConstructor() ->getMock(); $request->query = $query; $request->query = new InputBag(); $view = $this->getMockBuilder(ViewExecutable::class) ->onlyMethods(['getRequest', 'initStyle', 'getDisplay']) Loading core/tests/Drupal/Tests/Core/Logger/LoggerChannelTest.php +2 −1 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ use Drupal\Core\Logger\LoggerChannel; use Drupal\Core\Session\AccountInterface; use Drupal\Tests\UnitTestCase; use Symfony\Component\HttpFoundation\HeaderBag; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\RequestStack; use Psr\Log\LoggerInterface; Loading Loading @@ -142,7 +143,7 @@ public function providerTestLog() { $request_mock->expects($this->any()) ->method('getClientIp') ->willReturn('127.0.0.1'); $request_mock->headers = $this->createMock('Symfony\Component\HttpFoundation\ParameterBag'); $request_mock->headers = $this->createMock(HeaderBag::class); // No request or account. $cases[] = [ Loading core/tests/Drupal/Tests/Core/Routing/ContentTypeHeaderMatcherTest.php +2 −2 Original line number Diff line number Diff line Loading @@ -6,7 +6,7 @@ use Drupal\Core\Routing\ContentTypeHeaderMatcher; use Drupal\Tests\UnitTestCase; use Symfony\Component\HttpFoundation\ParameterBag; use Symfony\Component\HttpFoundation\HeaderBag; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Exception\UnsupportedMediaTypeHttpException; Loading Loading @@ -130,7 +130,7 @@ public function testContentTypeRequestHeaderMissing() { $routes = $this->fixtures->contentRouteCollection(); $request = Request::create('path/two', 'POST'); // Delete all request headers that Request::create() sets by default. $request->headers = new ParameterBag(); $request->headers = new HeaderBag(); $this->expectException(UnsupportedMediaTypeHttpException::class); $this->expectExceptionMessage('No "Content-Type" request header specified'); $matcher->filter($routes, $request); Loading Loading
core/lib/Drupal/Core/Form/FormBuilder.php +2 −2 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ use Drupal\Core\Theme\ThemeManagerInterface; use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; use Symfony\Component\HttpFoundation\FileBag; use Symfony\Component\HttpFoundation\ParameterBag; use Symfony\Component\HttpFoundation\InputBag; use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpFoundation\Response; Loading Loading @@ -967,7 +967,7 @@ public function doBuildForm($form_id, &$element, FormStateInterface &$form_state $request = $this->requestStack->getCurrentRequest(); // Do not trust any POST data. $request->request = new ParameterBag(); $request->request = new InputBag(); // Make sure file uploads do not get processed. $request->files = new FileBag(); // Ensure PHP globals reflect these changes. Loading
core/modules/language/tests/src/Unit/Plugin/LanguageNegotiation/LanguageNegotiationContentEntityTest.php +2 −2 Original line number Diff line number Diff line Loading @@ -12,7 +12,7 @@ use Drupal\Core\Url; use Drupal\language\ConfigurableLanguageManagerInterface; use Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationContentEntity; use Symfony\Component\HttpFoundation\ParameterBag; use Symfony\Component\HttpFoundation\InputBag; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\ServerBag; use Symfony\Component\Routing\Route; Loading Loading @@ -106,7 +106,7 @@ public function testGetLangcode() { // Case 2: A request is available, but the languageManager is not set and // the static::QUERY_PARAMETER is not provided as a named parameter. $request = Request::create('/de/foo', 'GET'); $request->query = new ParameterBag(); $request->query = new InputBag(); $this->assertEquals(NULL, $languageNegotiationContentEntity->getLangcode($request)); // Case 3: A request is available, the languageManager is set, but the Loading
core/modules/media_library/tests/src/Unit/MediaLibrarySelectFormTest.php +2 −10 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ use Drupal\views\ResultRow; use Drupal\views\ViewExecutable; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\HttpFoundation\ParameterBag; use Symfony\Component\HttpFoundation\InputBag; use Symfony\Component\HttpFoundation\Request; /** Loading Loading @@ -50,18 +50,10 @@ public function testViewsForm(): void { $container->set('string_translation', $this->createMock(TranslationInterface::class)); \Drupal::setContainer($container); $query = $this->getMockBuilder(ParameterBag::class) ->onlyMethods(['all']) ->disableOriginalConstructor() ->getMock(); $query->expects($this->any()) ->method('all') ->willReturn([]); $request = $this->getMockBuilder(Request::class) ->disableOriginalConstructor() ->getMock(); $request->query = $query; $request->query = new InputBag(); $view = $this->getMockBuilder(ViewExecutable::class) ->onlyMethods(['getRequest', 'initStyle', 'getDisplay']) Loading
core/tests/Drupal/Tests/Core/Logger/LoggerChannelTest.php +2 −1 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ use Drupal\Core\Logger\LoggerChannel; use Drupal\Core\Session\AccountInterface; use Drupal\Tests\UnitTestCase; use Symfony\Component\HttpFoundation\HeaderBag; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\RequestStack; use Psr\Log\LoggerInterface; Loading Loading @@ -142,7 +143,7 @@ public function providerTestLog() { $request_mock->expects($this->any()) ->method('getClientIp') ->willReturn('127.0.0.1'); $request_mock->headers = $this->createMock('Symfony\Component\HttpFoundation\ParameterBag'); $request_mock->headers = $this->createMock(HeaderBag::class); // No request or account. $cases[] = [ Loading
core/tests/Drupal/Tests/Core/Routing/ContentTypeHeaderMatcherTest.php +2 −2 Original line number Diff line number Diff line Loading @@ -6,7 +6,7 @@ use Drupal\Core\Routing\ContentTypeHeaderMatcher; use Drupal\Tests\UnitTestCase; use Symfony\Component\HttpFoundation\ParameterBag; use Symfony\Component\HttpFoundation\HeaderBag; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Exception\UnsupportedMediaTypeHttpException; Loading Loading @@ -130,7 +130,7 @@ public function testContentTypeRequestHeaderMissing() { $routes = $this->fixtures->contentRouteCollection(); $request = Request::create('path/two', 'POST'); // Delete all request headers that Request::create() sets by default. $request->headers = new ParameterBag(); $request->headers = new HeaderBag(); $this->expectException(UnsupportedMediaTypeHttpException::class); $this->expectExceptionMessage('No "Content-Type" request header specified'); $matcher->filter($routes, $request); Loading