diff --git a/tests/phpunit/CRM/Contact/BAO/ContactTest.php b/tests/phpunit/CRM/Contact/BAO/ContactTest.php index 2d13628a9780..81998d865d31 100644 --- a/tests/phpunit/CRM/Contact/BAO/ContactTest.php +++ b/tests/phpunit/CRM/Contact/BAO/ContactTest.php @@ -1595,10 +1595,7 @@ public function testUpdateProfileLocationLeak() { //create the contact using create profile contact. $fields = CRM_Contact_BAO_Contact::exportableFields('Individual'); - // for this test, we need to make CiviCRM think we are logged in - // so that updateBlankLocInfo is set to 1 (erase blank value from the database) - CRM_Core_Session::singleton()->set('authSrc', CRM_Core_Permission::AUTH_SRC_LOGIN); - + $this->createLoggedInUser(); // now, emulate the contact update using a profile $contactID = CRM_Contact_BAO_Contact::createProfileContact($updatePfParams, $fields, $contactId, NULL, NULL, NULL, TRUE