Skip to content
Snippets Groups Projects
Commit 326e6273 authored by Angie Byron's avatar Angie Byron
Browse files

#608036 follow-up by scor: Add attributes variable for profile.tpl.php. (with tests)

parent 0dd16127
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -126,7 +126,7 @@ class RdfMappingDefinitionTestCase extends DrupalWebTestCase {
public static function getInfo() {
return array(
'name' => 'RDF mapping definition functionality',
'description' => 'Test the different types of RDF mappings and ensure the proper RDFa markup in included in node pages.',
'description' => 'Test the different types of RDF mappings and ensure the proper RDFa markup in included in nodes and user profile pages.',
'group' => 'RDF',
);
}
......@@ -187,4 +187,20 @@ class RdfMappingDefinitionTestCase extends DrupalWebTestCase {
$this->assertRaw('property="dc:title"');
$this->assertRaw('property="dc:date dc:created"');
}
/**
* Create a random user and ensure the default mapping for user is used.
*/
function testUserProfilesAttributesInMarkup() {
// Create a user with access to user profiles.
$user = $this->drupalCreateUser(array('access user profiles'));
$this->drupalLogin($user);
// Browse to the user profile page.
$this->drupalGet('user/' . $user->uid);
// Ensure the default bundle mapping for user is used. These attributes come
// from the user default bundle definition.
$profile_url = url('user/' . $user->uid);
$user_profile_about = $this->xpath("//div[@class='profile' and @typeof='sioc:User' and @about='$profile_url']");
$this->assertTrue(!empty($user_profile_about), t('RDFa markup found on user profile page'));
}
}
......@@ -33,6 +33,6 @@
* @see template_preprocess_user_profile()
*/
?>
<div class="profile">
<div class="profile"<?php print $attributes; ?>>
<?php print render($user_profile); ?>
</div>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment