diff --git a/link.module b/link.module index 7575759..31449e2 100644 --- a/link.module +++ b/link.module @@ -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, diff --git a/tests/link.multilingual.test b/tests/link.multilingual.test index 33f1002..2aeec79 100644 --- a/tests/link.multilingual.test +++ b/tests/link.multilingual.test @@ -1,4 +1,5 @@ 'Link language path prefix', @@ -100,40 +107,40 @@ public function testLanguagePrefixedPaths() { // 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; diff --git a/tests/link.token.test b/tests/link.token.test index 32b26ca..f21f572 100644 --- a/tests/link.token.test +++ b/tests/link.token.test @@ -161,7 +161,7 @@ public function testStaticTokenLinkCreate2() { * * @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 @@ public function _test_Link_With_Title_Attribute_token_url_form() { * * @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 @@ public function _test_Link_With_Title_Attribute_token_title_form() { /** * 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 @@ public function _testUserTokenLinkCreateInURL() { /** * 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', diff --git a/tests/link.validate.test b/tests/link.validate.test index f6db617..1694b49 100644 --- a/tests/link.validate.test +++ b/tests/link.validate.test @@ -234,7 +234,7 @@ public function testLinkValidateBadUrlValidateOff() { * 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 @@ public function testGermanEszettUrl() { /** * Check Spanish ñ in URL. */ - public function testSpecialNUrl() { + public function testSpecialEneUrl() { $this->linkTestValidateUrl('http://www.testÑñ.com/'); } @@ -531,7 +531,10 @@ public function testValidateEmailLinkBad() { $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 @@ function testValidateTelLinks() { } } - function testValidateTelLinksBad() { + /** + * Confirm that invalid tel: links work as expected. + */ + public function testValidateTelLinksBad() { $links = array( 'tel:0', 'tel:1234567890123456',