function RequirementsTest::setServerSoftware

Same name and namespace in other branches
  1. 11.x core/modules/file/tests/src/Kernel/RequirementsTest.php \Drupal\Tests\file\Kernel\RequirementsTest::setServerSoftware()

Sets the server software attribute in the request.

1 call to RequirementsTest::setServerSoftware()
RequirementsTest::testUploadRequirements in core/modules/file/tests/src/Kernel/RequirementsTest.php
Tests the file upload requirements.

File

core/modules/file/tests/src/Kernel/RequirementsTest.php, line 72

Class

RequirementsTest
Tests the file requirements.

Namespace

Drupal\Tests\file\Kernel

Code

private function setServerSoftware(?string $software) : void {
  $request = new Request();
  $request->setSession(new Session(new MockArraySessionStorage()));
  if (is_string($software)) {
    $request->server
      ->set('SERVER_SOFTWARE', $software);
  }
  $requestStack = new RequestStack();
  $requestStack->push($request);
  $this->container
    ->set('request_stack', $requestStack);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.