function SystemAuthorizeTest::drupalGetAuthorizePHP

Same name in other branches
  1. 9 core/modules/system/tests/src/Functional/System/SystemAuthorizeTest.php \Drupal\Tests\system\Functional\System\SystemAuthorizeTest::drupalGetAuthorizePHP()
  2. 8.9.x core/modules/system/tests/src/Functional/System/SystemAuthorizeTest.php \Drupal\Tests\system\Functional\System\SystemAuthorizeTest::drupalGetAuthorizePHP()
  3. 10 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()

2 calls to SystemAuthorizeTest::drupalGetAuthorizePHP()
SystemAuthorizeTest::testError in core/modules/system/tests/src/Functional/System/SystemAuthorizeTest.php
Tests error handling in authorize.php.
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 49

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') : void {
    $this->drupalGet('system-test/authorize-init/' . $page_title);
}

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