You are here

public function UploadTest::getRequest in IMCE 8.2

Same name and namespace in other branches
  1. 8 tests/src/Kernel/Plugin/ImcePlugin/UploadTest.php \Drupal\Tests\imce\Kernel\Plugin\ImcePlugin\UploadTest::getRequest()

Get the request parameter.

Return value

\Symfony\Component\HttpFoundation\Request The request object.

Overrides KernelTestBasePlugin::getRequest

File

tests/src/Kernel/Plugin/ImcePlugin/UploadTest.php, line 55

Class

UploadTest
Kernel tests for Imce plugins for Imce Plugin Core.

Namespace

Drupal\Tests\imce\Kernel\Plugin\ImcePlugin

Code

public function getRequest() {
  $request = Request::create("/imce", 'POST', [
    'jsop' => 'upload',
    'token' => 'LLuA1R0aUOzoduSJkJxN5aoHVdJnQk8LbTBgdivOU4Y',
    'active_path' => '.',
    'files[imce][]' => 'file.txt',
  ]);
  $session = new Session();
  $session
    ->set('imce_active_path', '.');
  $request
    ->setSession($session);
  return $request;
}