protected function MetatagTestBase::assertUserEntityTags in Metatag 7
Verify a user entity's meta tags load correctly.
Parameters
object $user: A user object that is to be tested.
2 calls to MetatagTestBase::assertUserEntityTags()
- MetatagCoreUserTest::testEntityCreationWorkflow in tests/
MetatagCoreUserTest.test - Tests creation of a standard entity.
- MetatagCoreWithProfile2Test::testUserProfilePage in tests/
MetatagCoreWithProfile2Test.test - Make sure that the Profile2 entity doesn't interfere with the user entity.
File
- tests/
MetatagTestBase.test, line 764 - A base class for the Metatag tests, provides shared methods.
Class
- MetatagTestBase
- A base class for the Metatag tests, provides shared methods.
Code
protected function assertUserEntityTags($user) {
// Load the user's profile page.
$this
->drupalGet('user/' . $user->uid);
$this
->assertResponse(200);
// Verify the title is using the custom default for this vocabulary.
$xpath = $this
->xpath("//meta[@name='abstract']");
$this
->assertEqual(count($xpath), 1, 'Exactly one abstract meta tag found.');
$this
->assertEqual($xpath[0]['content'], $user->name . " ponies");
}