You are here

public function SystemAuthorizeTest::drupalGetAuthorizePHP in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/system/tests/src/Functional/System/SystemAuthorizeTest.php \Drupal\Tests\system\Functional\System\SystemAuthorizeTest::drupalGetAuthorizePHP()

Helper function to initialize authorize.php and load it via drupalGet().

Initializing authorize.php needs to happen in the child Drupal installation, not the parent. So, we visit a menu callback provided by system_test.module which calls system_authorized_init() to initialize the user's session inside the test site, not the framework site. This callback redirects to authorize.php when it's done initializing.

See also

system_authorized_init()

1 call to SystemAuthorizeTest::drupalGetAuthorizePHP()
SystemAuthorizeTest::testFileTransferHooks in core/modules/system/tests/src/Functional/System/SystemAuthorizeTest.php
Tests the FileTransfer hooks.

File

core/modules/system/tests/src/Functional/System/SystemAuthorizeTest.php, line 46

Class

SystemAuthorizeTest
Tests the authorize.php script and related API.

Namespace

Drupal\Tests\system\Functional\System

Code

public function drupalGetAuthorizePHP($page_title = 'system-test-auth') {
  $this
    ->drupalGet('system-test/authorize-init/' . $page_title);
}