function ImageUploadTest::getUploadUrl

Same name and namespace in other branches
  1. 11.x core/modules/ckeditor5/tests/src/Functional/ImageUploadTest.php \Drupal\Tests\ckeditor5\Functional\ImageUploadTest::getUploadUrl()
  2. 10 core/modules/ckeditor5/tests/src/Functional/ImageUploadTest.php \Drupal\Tests\ckeditor5\Functional\ImageUploadTest::getUploadUrl()

Provides the image upload url.

Return value

\Drupal\Core\Url The upload image url for the basic_html format.

File

core/modules/ckeditor5/tests/src/Functional/ImageUploadTest.php, line 183

Class

ImageUploadTest
Test image upload.

Namespace

Drupal\Tests\ckeditor5\Functional

Code

protected function getUploadUrl() {
  $token = $this->container
    ->get('csrf_token')
    ->get('ckeditor5/upload-image/basic_html');
  return Url::fromRoute('ckeditor5.upload_image', [
    'editor' => 'basic_html',
  ], [
    'query' => [
      'token' => $token,
    ],
  ]);
}

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