diff --git a/core/modules/rdf/src/Tests/Field/LinkFieldRdfaTest.php b/core/modules/rdf/src/Tests/Field/LinkFieldRdfaTest.php index 5579248..c2d7360 100644 --- a/core/modules/rdf/src/Tests/Field/LinkFieldRdfaTest.php +++ b/core/modules/rdf/src/Tests/Field/LinkFieldRdfaTest.php @@ -50,7 +50,7 @@ public function testAllFormattersExternal() { $this->entity = entity_create('entity_test', array()); $this->entity->{$this->fieldName}->url = $this->testValue; - $this->runTestAllFormatters(); + $this->runTestAllFormatters('External'); } public function testAllFormattersInternal() { @@ -59,7 +59,7 @@ public function testAllFormattersInternal() { $this->entity = entity_create('entity_test', array()); $this->entity->{$this->fieldName}->url = $this->testValue; - $this->runTestAllFormatters(); + $this->runTestAllFormatters('Internal'); } public function testAllFormattersFront() { @@ -68,23 +68,29 @@ public function testAllFormattersFront() { $this->entity = entity_create('entity_test', array()); $this->entity->{$this->fieldName}->url = $this->testValue; - $this->runTestAllFormatters(); + $this->runTestAllFormatters('Front'); } /** * Tests all link formatters. */ - public function runTestAllFormatters() { + public function runTestAllFormatters($type = NULL) { // set up the expected result $expected_rdf = array( 'value' => $this->testValue, 'type' => 'uri', ); + // assertFormatterRdfa looks for a full path. + if($type == 'Internal'){ + $expected_rdf['value'] = $this->uri . '/' . $this->testValue; + } + if($type == 'Front'){ + $expected_rdf['value'] = $this->uri . '/'; + } - // Test the link formatters with different options and settings. // Test the link formatter: trim at 80, no other settings $formatter = array( - 'type' => 'link', + 'type' => $type . ' link', 'settings' => array( 'trim_length' => 80, 'url_only' => FALSE, @@ -97,7 +103,7 @@ public function runTestAllFormatters() { // Test the link formatter: trim at 40, nofollow, new window $formatter = array( - 'type' => 'link', + 'type' => $type . ' link', 'settings' => array( 'trim_length' => 40, 'url_only' => FALSE, @@ -110,7 +116,7 @@ public function runTestAllFormatters() { // Test the link formatter: trim at 40, URL only (not plaintext) nofollow, new window $formatter = array( - 'type' => 'link', + 'type' => $type . ' link', 'settings' => array( 'trim_length' => 40, 'url_only' => TRUE, @@ -123,7 +129,7 @@ public function runTestAllFormatters() { // Test the link_separate formatter: trim at 40, nofollow, new window $formatter = array( - 'type' => 'link_separate', + 'type' => $type . ' link_separate', 'settings' => array( 'trim_length' => 40, 'rel' => 'nofollow', @@ -140,7 +146,7 @@ public function runTestAllFormatters() { ); // Test the link formatter: trim at 20, url only (as plaintext) $formatter = array( - 'type' => 'link', + 'type' => $type . ' link', 'settings' => array( 'trim_length' => 20, 'url_only' => TRUE, @@ -153,7 +159,7 @@ public function runTestAllFormatters() { // Test the link formatter: do not trim, url only (as plaintext) $formatter = array( - 'type' => 'link', + 'type' => $type . ' link', 'settings' => array( 'trim_length' => 0, 'url_only' => TRUE,