Commit aaf9e301 authored by damienmckenna's avatar damienmckenna Committed by Damien McKenna
Browse files

Issue #3094370 by DamienMcKenna: Coding standards tidy-up.

parent 601d0f11
......@@ -603,7 +603,7 @@ function _link_sanitize(&$item, $delta, &$field, $instance, &$entity) {
$display_url = str_replace('mailto:', '', $url);
}
elseif ($type === LINK_EXTERNAL) {
$display_url = $item['url'];
$display_url = $item['url'];
}
elseif ($type == LINK_TEL) {
$display_url = str_replace('tel:', '', $url);
......@@ -948,7 +948,7 @@ function link_field_process($element, $form_state, $complete_form) {
if (!$instance) {
// The element comes from a custom form, we have to manually create the
// $instance settings.
$instance['settings'] = array (
$instance['settings'] = array(
'title_maxlength' => isset($element['#title_maxlength']) ? $element['#title_maxlength'] : 128,
'title' => isset($element['#title_mode']) ? $element['#title_mode'] : 'optional',
'title_label_use_field_label' => isset($element['#title_label_use_field_label']) ? $element['#title_label_use_field_label'] : FALSE,
......
<?php
/**
* @file
* Tests that exercise the relative / absolute output of the link module.
......@@ -62,10 +63,16 @@ class LinkMultilingualTestCase extends LinkBaseTestClass {
drupal_static_reset('locale_url_outbound_alter');
drupal_static_reset('locale_language_url_rewrite_url');
}
}
}
/**
*
*/
class LinkMultilingualPathTest extends LinkMultilingualTestCase {
/**
*
*/
public static function getInfo() {
return array(
'name' => 'Link language path prefix',
......@@ -100,40 +107,40 @@ class LinkMultilingualPathTest extends LinkMultilingualTestCase {
// Create test content.
$url_tests = array(
1 => array(
'href' => 'http://dummy.com/' . $this->randomName(),
'label' => $this->randomName(),
),
'href' => 'http://dummy.com/' . $this->randomName(),
'label' => $this->randomName(),
),
2 => array(
'href' => 'node/1',
'label' => $this->randomName(),
),
'href' => 'node/1',
'label' => $this->randomName(),
),
3 => array(
'href' => 'node/1?property=value',
'label' => $this->randomName(),
'query' => array('property' => 'value'),
),
'href' => 'node/1?property=value',
'label' => $this->randomName(),
'query' => array('property' => 'value'),
),
4 => array(
'href' => 'node/1#position',
'label' => $this->randomName(),
'fragment' => 'position',
),
'href' => 'node/1#position',
'label' => $this->randomName(),
'fragment' => 'position',
),
5 => array(
'href' => 'node/1?property=value2#lower',
'label' => $this->randomName(),
'fragment' => 'lower',
'query' => array('property' => 'value2'),
),
'href' => 'node/1?property=value2#lower',
'label' => $this->randomName(),
'fragment' => 'lower',
'query' => array('property' => 'value2'),
),
);
foreach ($url_tests as $index => &$input) {
$this->drupalGet('node/add/page');
$edit = array(
'title' => $input['label'],
$field_name_absolute . '[und][0][title]' => $input['label'],
$field_name_absolute . '[und][0][url]' => $input['href'],
$field_name_relative . '[und][0][title]' => $input['label'],
$field_name_relative . '[und][0][url]' => $input['href'],
);
'title' => $input['label'],
$field_name_absolute . '[und][0][title]' => $input['label'],
$field_name_absolute . '[und][0][url]' => $input['href'],
$field_name_relative . '[und][0][title]' => $input['label'],
$field_name_relative . '[und][0][url]' => $input['href'],
);
$this->drupalPost(NULL, $edit, t('Save'));
$url = $this->getUrl();
$input['url'] = $url;
......
......@@ -161,7 +161,7 @@ class LinkTokenTest extends LinkBaseTestClass {
*
* @codingStandardsIgnoreStart
*/
public function _test_Link_With_Title_Attribute_token_url_form() {
public function xTestLinkWithTitleAttributeTokenUrlForm() {
/* $this->loginWithPermissions($this->permissions);
$this->acquireContentTypes(1);
$field_settings = array(
......@@ -231,7 +231,7 @@ class LinkTokenTest extends LinkBaseTestClass {
*
* @codingStandardsIgnoreStart
*/
public function _test_Link_With_Title_Attribute_token_title_form() {
public function xTestLinkWithTitleAttributeTokenTitleForm() {
// @codingStandardsIgnoreEnd
$this->loginWithPermissions($this->permissions);
$this->acquireContentTypes(1);
......@@ -289,12 +289,8 @@ class LinkTokenTest extends LinkBaseTestClass {
/**
* Trying to set the url to contain a token.
*
* @codingStandardsIgnoreStart
*/
public function _testUserTokenLinkCreateInURL() {
//@codingStandardsIgnoreEnd
public function xTestUserTokenLinkCreateInUrl() {
$this->web_user = $this->drupalCreateUser(array(
'administer content types',
'administer fields',
......@@ -352,12 +348,8 @@ class LinkTokenTest extends LinkBaseTestClass {
/**
* Trying to set the url to contain a token.
*
* @codingStandardsIgnoreStart
*/
public function _testUserTokenLinkCreateInURL2() {
// @codingStandardsIgnoreEnd
public function xTestUserTokenLinkCreateInUrl2() {
$this->web_user = $this->drupalCreateUser(array(
'administer content types',
'administer fields',
......
......@@ -234,7 +234,7 @@ class LinkValidateTest extends LinkValidateTestCase {
* Test if a bad url can sneak through un-filtered if we play with the
* validation...
*/
public function _testLinkValidateSwitchingBetweenValidationStatus() {
public function xTestLinkValidateSwitchingBetweenValidationStatus() {
$this->acquireContentTypes(1);
$this->web_user = $this->drupalCreateUser(array(
'administer content types',
......@@ -418,7 +418,7 @@ class LinkValidateSpecificURL extends LinkValidateTestCase {
/**
* Check Spanish ñ in URL.
*/
public function testSpecialNUrl() {
public function testSpecialEneUrl() {
$this->linkTestValidateUrl('http://www.testÑñ.com/');
}
......@@ -531,7 +531,10 @@ class LinkValidateUrlLight extends DrupalWebTestCase {
$this->assertEqual(FALSE, $valid, 'Make sure just a bad address is correctly failed');
}
function testValidateTelLinks() {
/**
* Confirm that valid tel: links work as expected.
*/
public function testValidateTelLinks() {
$links = array(
'tel:01',
'tel:123456789012345',
......@@ -545,7 +548,10 @@ class LinkValidateUrlLight extends DrupalWebTestCase {
}
}
function testValidateTelLinksBad() {
/**
* Confirm that invalid tel: links work as expected.
*/
public function testValidateTelLinksBad() {
$links = array(
'tel:0',
'tel:1234567890123456',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment