You are here

public function TestPageTestController::testPageVarDump in Drupal 10

Same name and namespace in other branches
  1. 9 core/modules/system/tests/modules/test_page_test/src/Controller/TestPageTestController.php \Drupal\test_page_test\Controller\TestPageTestController::testPageVarDump()

Returns a test page and with the call to the dump() function.

1 string reference to 'TestPageTestController::testPageVarDump'
test_page_test.routing.yml in core/modules/system/tests/modules/test_page_test/test_page_test.routing.yml
core/modules/system/tests/modules/test_page_test/test_page_test.routing.yml

File

core/modules/system/tests/modules/test_page_test/src/Controller/TestPageTestController.php, line 31

Class

TestPageTestController
Controller routines for test_page_test routes.

Namespace

Drupal\test_page_test\Controller

Code

public function testPageVarDump() {
  $role = Role::create([
    'id' => 'test_role',
    'label' => 'Test role',
  ]);
  dump($role);
  return [
    '#title' => t('Test page with var dump'),
    '#markup' => t('Test page text.'),
  ];
}