diff --git a/core/includes/common.inc b/core/includes/common.inc index d6f9055..5b05285 100644 --- a/core/includes/common.inc +++ b/core/includes/common.inc @@ -3482,12 +3482,6 @@ function drupal_pre_render_link($element) { // By default, link options to pass to l() are normally set in #options. $element += array('#options' => array()); - // The title might be a render array. Render it to pass a string to l(). - if (is_array($element['#title'])) { - $element['#title'] = drupal_render($element['#title']); - $element['#options']['html'] = TRUE; - } - // However, within the scope of renderable elements, #attributes is a valid // way to specify attributes, too. Take them into account, but do not override // attributes from #options. diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/Field/TaxonomyTermReferenceRdfaTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/Field/TaxonomyTermReferenceRdfaTest.php new file mode 100644 index 0000000..95bf3c1 --- /dev/null +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/Field/TaxonomyTermReferenceRdfaTest.php @@ -0,0 +1,109 @@ + 'Field formatter - taxonomy term reference', + 'description' => 'Tests RDFa output by taxonomy term reference field formatters.', + 'group' => 'RDF', + ); + } + + public function setUp() { + parent::setUp(); + + $vocabulary = entity_create('taxonomy_vocabulary', array( + 'name' => $this->randomName(), + 'vid' => drupal_strtolower($this->randomName()), + 'langcode' => Language::LANGCODE_NOT_SPECIFIED, + )); + $vocabulary->save(); + + entity_create('field_entity', array( + 'field_name' => $this->fieldName, + 'type' => 'taxonomy_term_reference', + 'cardinality' => FIELD_CARDINALITY_UNLIMITED, + 'settings' => array( + 'allowed_values' => array( + array( + 'vocabulary' => $vocabulary->id(), + 'parent' => 0, + ), + ), + ), + ))->save(); + entity_create('field_instance', array( + 'entity_type' => 'node', + 'field_name' => $this->fieldName, + 'bundle' => 'test_node_type', + ))->save(); + $this->term = entity_create('taxonomy_term', array( + 'name' => $this->randomName(), + 'vid' => $vocabulary->id(), + 'langcode' => Language::LANGCODE_NOT_SPECIFIED, + )); + $this->term->save(); + + // Add the mapping. + $mapping = rdf_get_mapping('node', 'test_node_type'); + $mapping->setFieldMapping($this->fieldName, array( + 'properties' => array('schema:about'), + ))->save(); + + // Set up test values. + $this->entity = $this->drupalCreateNode(array('type' => 'test_node_type')); + $this->entity->get($this->fieldName)->offsetGet(0)->get('target_id')->setValue($this->term->id()); + $this->entity->save(); + $this->uri = $this->getAbsoluteUri($this->entity); + } + + /** + * Tests the plain formatter. + */ + public function testPlainFormatter() { + $term_uri = $this->getAbsoluteUri($this->term); + $this->assertFormatterRdfa('taxonomy_term_reference_plain', 'http://schema.org/about', $term_uri, 'uri'); + } + + /** + * Test the link formatter. + */ + public function testLinkFormatter() { + $term_uri = $this->getAbsoluteUri($this->term); + $this->assertFormatterRdfa('taxonomy_term_reference_link', 'http://schema.org/about', $term_uri, 'uri'); + } +} diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/FunctionsUnitTest.php b/core/modules/system/lib/Drupal/system/Tests/Theme/FunctionsUnitTest.php deleted file mode 100644 index c6300c4..0000000 --- a/core/modules/system/lib/Drupal/system/Tests/Theme/FunctionsUnitTest.php +++ /dev/null @@ -1,42 +0,0 @@ - 'Theme functions unit test', - 'description' => 'Tests common theme functions.', - 'group' => 'Theme', - ); - } - - /** - * Test the HTML data wrapper. - */ - public function testHtmlDataWrapper() { - $element = array( - '#theme' => 'html_data_wrapper', - '#attributes' => array('itemprop' => 'http://schema.org/name'), - 'children' => array('#markup' => 'test name'), - ); - - $rendered = drupal_render($element); - $expected = 'test name'; - $this->assertEqual($rendered, $expected, 'theme_html_data_wrapper produces expected output'); - } -} diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 0658913..dfa7bf4 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -191,9 +191,6 @@ function system_theme() { 'system_date_format_localize_form' => array( 'render element' => 'form', ), - 'html_data_wrapper' => array( - 'render element' => 'element', - ), )); } @@ -3288,12 +3285,6 @@ function theme_exposed_filters($variables) { return '