function KernelTestHttpRequestTest::exampleRoute

Example of a route defined in a kernel test.

Attributes

#[Route(path: '/kernel-test-example', name: 'kernel_test.example', requirements: [ '_access' => 'TRUE', ], defaults: [ '_title' => 'Example route', ])]

Return value

string[] The render array for the response.

File

core/tests/Drupal/KernelTests/KernelTestHttpRequestTest.php, line 122

Class

KernelTestHttpRequestTest
Tests making HTTP requests in a kernel test.

Namespace

Drupal\KernelTests

Code

public function exampleRoute() : array {
  return [
    '#markup' => $this->testMarkup,
  ];
}

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