You are here

private function LinkDefaultProtocolTest::setupDefaultProtocol in Link 7

Setup the default global link protocol to either HTTP or HTTPS.

Parameters

string $protocol: The protocol to use.

3 calls to LinkDefaultProtocolTest::setupDefaultProtocol()
LinkDefaultProtocolTest::testHttpDefaultProtocolOnUrlWithDefinedHttpsProtocol in tests/LinkDefaultProtocolTest.test
A link with a defined protocol HTTPS overrides the default HTTP protocol.
LinkDefaultProtocolTest::testHttpsDefaultProtocolOnUrlWithDefinedHttpProtocol in tests/LinkDefaultProtocolTest.test
A link with a defined protocol HTTP overrides the default HTTPS protocol.
LinkDefaultProtocolTest::testHttpsDefaultProtocolOnUrlWithoutDefinedProtocol in tests/LinkDefaultProtocolTest.test
A link with no defined protocol in the URL uses the default (HTTPS).

File

tests/LinkDefaultProtocolTest.test, line 102

Class

LinkDefaultProtocolTest
Test setting a global protocol, and using it for links when needed.

Code

private function setupDefaultProtocol($protocol) {
  $user = $this
    ->drupalCreateUser($this->permissions);
  $this
    ->drupalLogin($user);
  $this
    ->drupalPost('admin/config/content/link', array(
    'link_default_protocol' => $protocol,
  ), 'Save configuration');
}