diff options
-rw-r--r-- | modules/rdf/rdf.test | 18 | ||||
-rw-r--r-- | modules/user/user-profile.tpl.php | 2 |
2 files changed, 18 insertions, 2 deletions
diff --git a/modules/rdf/rdf.test b/modules/rdf/rdf.test index 242f42399..bcbe943e3 100644 --- a/modules/rdf/rdf.test +++ b/modules/rdf/rdf.test @@ -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')); + } } diff --git a/modules/user/user-profile.tpl.php b/modules/user/user-profile.tpl.php index 5c374d778..5d06827c2 100644 --- a/modules/user/user-profile.tpl.php +++ b/modules/user/user-profile.tpl.php @@ -33,6 +33,6 @@ * @see template_preprocess_user_profile() */ ?> -<div class="profile"> +<div class="profile"<?php print $attributes; ?>> <?php print render($user_profile); ?> </div> |