diff --git a/core/modules/link/src/Plugin/Field/FieldFormatter/LinkFormatter.php b/core/modules/link/src/Plugin/Field/FieldFormatter/LinkFormatter.php index d33282d..5b3d939 100644 --- a/core/modules/link/src/Plugin/Field/FieldFormatter/LinkFormatter.php +++ b/core/modules/link/src/Plugin/Field/FieldFormatter/LinkFormatter.php @@ -149,9 +149,9 @@ public function viewElements(FieldItemListInterface $items) { ); if (!empty($item->_attributes)) { - // Piggyback on the metadata attributes, - // which will be placed in the field template wrapper, - // and set the URL value in a content attribute. + // Piggyback on the metadata attributes, which will be placed in the + // field template wrapper, and set the URL value in a content + // attribute. $item->_attributes += array('content' => $item->url); } } diff --git a/core/modules/rdf/src/Tests/Field/LinkFieldRdfaTest.php b/core/modules/rdf/src/Tests/Field/LinkFieldRdfaTest.php index ac92b2b..8e283f2 100644 --- a/core/modules/rdf/src/Tests/Field/LinkFieldRdfaTest.php +++ b/core/modules/rdf/src/Tests/Field/LinkFieldRdfaTest.php @@ -23,6 +23,9 @@ class LinkFieldRdfaTest extends FieldRdfaTestBase { */ public static $modules = array('link', 'text'); + /** + * {@inheritdoc} + */ public static function getInfo() { return array( 'name' => 'Field formatter: link', @@ -31,6 +34,9 @@ public static function getInfo() { ); } + /** + * {@inheritdoc} + */ public function setUp() { parent::setUp(); @@ -44,6 +50,9 @@ public function setUp() { } + /** + * Tests all formatters with link to external page. + */ public function testAllFormattersExternal() { // Set up test values. $this->testValue = 'http://test.me'; @@ -59,14 +68,17 @@ public function testAllFormattersExternal() { $this->runTestAllFormatters($expected_rdf, 'external'); } + /** + * Tests all formatters with link to internal page. + */ public function testAllFormattersInternal() { // Set up test values. $this->testValue = 'admin'; $this->entity = entity_create('entity_test', array()); $this->entity->{$this->fieldName}->url = $this->testValue; - // set up the expected result - // assertFormatterRdfa looks for a full path. + // Set up the expected result. + // AssertFormatterRdfa looks for a full path. $expected_rdf = array( 'value' => $this->uri . '/' . $this->testValue, 'type' => 'uri', @@ -75,6 +87,9 @@ public function testAllFormattersInternal() { $this->runTestAllFormatters($expected_rdf, 'internal'); } + /** + * Tests all formatters with link to frontpage. + */ public function testAllFormattersFront() { // Set up test values. $this->testValue = ''; @@ -91,7 +106,7 @@ public function testAllFormattersFront() { } /** - * Tests all link formatters. + * Helper function to test all link formatters. */ public function runTestAllFormatters($expected_rdf, $type = NULL) { @@ -177,7 +192,6 @@ public function runTestAllFormatters($expected_rdf, $type = NULL) { ), ); $this->assertFormatterRdfa($formatter, 'http://schema.org/link', $expected_rdf); - } }