diff --git a/modules/rdf/rdf.test b/modules/rdf/rdf.test index 242f423992ffee4cc344981c14b368595b0a384e..bcbe943e3e1244bc021e49f3f3d2d6675e883367 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 5c374d7786019fbb491e9661a8c64d17949338d0..5d06827c2abc72ea8c3b36af3f6296bd36fa87bd 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>