From 59792013ccb13dbd38eefee11e418af67e1c207c Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Mon, 8 Mar 2010 15:46:58 +0000 Subject: #525058 by andypost, mfb, and oneoftwo: Fixed pages view for profile fields broken. --- modules/profile/profile.pages.inc | 2 +- modules/profile/profile.test | 29 ++++++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 2 deletions(-) (limited to 'modules/profile') diff --git a/modules/profile/profile.pages.inc b/modules/profile/profile.pages.inc index 346223285..023b2357c 100644 --- a/modules/profile/profile.pages.inc +++ b/modules/profile/profile.pages.inc @@ -33,7 +33,7 @@ function profile_browse() { ':visibility' => PROFILE_PUBLIC_LISTINGS, ))->fetchAll(); - $query = db_select('users')->extend('PagerDefault'); + $query = db_select('users', 'u')->extend('PagerDefault'); $query->join('profile_value', 'v', 'u.uid = v.uid'); $query ->fields('u', array('uid', 'access')) diff --git a/modules/profile/profile.test b/modules/profile/profile.test index c375fb3a1..61709d34a 100644 --- a/modules/profile/profile.test +++ b/modules/profile/profile.test @@ -394,10 +394,37 @@ class ProfileBlockTestCase extends DrupalWebTestCase { } } +/** + * Test profile browsing. + */ +class ProfileTestBrowsing extends ProfileTestCase { + public static function getInfo() { + return array( + 'name' => 'Profile browsing', + 'description' => 'Test profile browsing.', + 'group' => 'Profile', + ); + } + + /** + * Test profile browsing. + */ + function testProfileBrowsing() { + $this->drupalLogin($this->admin_user); + $field = $this->createProfileField('list', 'simpletest', array('page' => '%value')); + + // Set a random value for the profile field. + $value = $this->setProfileField($field); + + // Check that user is found on the profile browse page. + $this->drupalGet("profile/{$field['form_name']}/$value"); + $this->assertText($this->normal_user->name); + } +} + /** * TODO: * - Test field visibility - * - Test profile browsing * - Test required fields * - Test fields on registration form * - Test updating fields -- cgit v1.2.3