You are here

function SystemAuthorizeTest::testFileTransferHooks in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/System/SystemAuthorizeTest.php \Drupal\system\Tests\System\SystemAuthorizeTest::testFileTransferHooks()

Tests the FileTransfer hooks

File

core/modules/system/src/Tests/System/SystemAuthorizeTest.php, line 51
Contains \Drupal\system\Tests\System\SystemAuthorizeTest.

Class

SystemAuthorizeTest
Tests the authorize.php script and related API.

Namespace

Drupal\system\Tests\System

Code

function testFileTransferHooks() {
  $page_title = $this
    ->randomMachineName(16);
  $this
    ->drupalGetAuthorizePHP($page_title);
  $this
    ->assertTitle(strtr('@title | Drupal', array(
    '@title' => $page_title,
  )), 'authorize.php page title is correct.');
  $this
    ->assertNoText('It appears you have reached this page in error.');
  $this
    ->assertText('To continue, provide your server connection details');

  // Make sure we see the new connection method added by system_test.
  $this
    ->assertRaw('System Test FileTransfer');

  // Make sure the settings form callback works.
  $this
    ->assertText('System Test Username');

  // Test that \Drupal\Core\Render\BareHtmlPageRenderer adds assets as
  // expected to the first page of the authorize.php script.
  $this
    ->assertRaw('core/misc/states.js');
}