coverage test for the case of an un-cached profile field fetch in User.t

This commit is contained in:
Colin Kuskie 2007-10-29 22:38:36 +00:00
parent 83c40e4c35
commit 4519ecb261

View file

@ -20,7 +20,7 @@ use WebGUI::Cache;
use WebGUI::User;
use WebGUI::ProfileField;
use Test::More tests => 120; # increment this value for each test you create
use Test::More tests => 121; # increment this value for each test you create
use Test::Deep;
my $session = WebGUI::Test->session;
@ -81,6 +81,10 @@ cmp_ok(abs($user->lastUpdated-$lastUpdate), '<=', 1, 'lastUpdated() -- profileFi
#Fetching a non-existant profile field returns undef
is($user->profileField('notAProfileField'), undef, 'getting non-existant profile fields returns undef');
##Check for valid profileField access, even if it is not cached in the user object.
my $newProfileField = WebGUI::ProfileField->create($session, 'testField', {dataDefault => 'this is a test'});
is($user->profileField('testField'), undef, 'getting profile fields not cached in the user object returns undef');
################################################################
#
# authMethods
@ -534,6 +538,8 @@ END {
$listProfileField->delete;
$visitor->profileField('email', $originalVisitorEmail);
$newProfileField->delete();
$testCache->flush;
my $newNumberOfUsers = $session->db->quickScalar('select count(*) from users');
is ($newNumberOfUsers, $numberOfUsers, 'no new additional users were leaked by this test');