Ran coverage on User.t and found that we're missing two entire
methods, so I added TODO tests for them. Overall coverage is low as well. Began converting User.pm to use placeholders.
This commit is contained in:
parent
6efbad606f
commit
2803ae520c
2 changed files with 9 additions and 3 deletions
|
|
@ -384,7 +384,7 @@ sub new {
|
|||
unless ($userData->{_userId} && $userData->{_user}{username}) {
|
||||
my %user;
|
||||
tie %user, 'Tie::CPHash';
|
||||
%user = $session->db->quickHash("select * from users where userId=".$session->db->quote($userId));
|
||||
%user = $session->db->quickHash("select * from users where userId=?",[$userId]);
|
||||
my %profile = $session->db->buildHash("select userProfileField.fieldName, userProfileData.fieldData
|
||||
from userProfileField, userProfileData where userProfileField.fieldName=userProfileData.fieldName and
|
||||
userProfileData.userId=".$session->db->quote($user{userId}));
|
||||
|
|
@ -609,7 +609,7 @@ Returns true if the userId exists in the users table.
|
|||
|
||||
sub validUserId {
|
||||
my ($class, $session, $userId) = @_;
|
||||
my $sth = $session->db->read('select userId from users where userId='.$session->db->quote($userId));
|
||||
my $sth = $session->db->read('select userId from users where userId=?',[$userId]);
|
||||
return ($sth->rows == 1);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue