private function LinkDefaultProtocolTest::createNodeWithLink in Link 7
Create a page node with a link field.
Parameters
string $url: The link URL.
Return value
object The created node.
4 calls to LinkDefaultProtocolTest::createNodeWithLink()
- LinkDefaultProtocolTest::testHttpDefaultProtocolOnUrlWithDefinedHttpsProtocol in tests/
LinkDefaultProtocolTest.test - A link with a defined protocol HTTPS overrides the default HTTP protocol.
- LinkDefaultProtocolTest::testHttpDefaultProtocolOnUrlWithoutDefinedProtocol in tests/
LinkDefaultProtocolTest.test - A link without a default protocol uses the default (HTTP).
- 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 122
Class
- LinkDefaultProtocolTest
- Test setting a global protocol, and using it for links when needed.
Code
private function createNodeWithLink($url) {
$link_field = $this
->createLinkField('page');
$settings = array(
'title' => 'Basic page link test',
$link_field => array(
LANGUAGE_NONE => array(
array(
'title' => 'Field protocol link Test',
'url' => $url,
),
),
),
);
return $this
->drupalCreateNode($settings);
}