Commit graph

48 commits

Author SHA1 Message Date
Colin Kuskie
fd62170df6 Change getGroups to always return safe copies of data.
Add tests to check for safe copies.
Add a test for getGroupIdsRecursive.
2008-08-02 22:48:32 +00:00
Colin Kuskie
30e0d913c4 Begin a test for getGroupIdsRecursive 2008-08-01 23:25:35 +00:00
Colin Kuskie
8d561101b5 Add a test to User.t to make sure it isn't leaking groups.
Update POD in User.pm and Group.pm.
2008-08-01 23:06:23 +00:00
Doug Bell
4b82481594 changed User.t and Group.t to use a less used ip address to make tests pass on my network that uses 192.168.0.0/16\
fixed a logic bug in WebGUI/Workflow/Cron
2008-02-18 06:08:16 +00:00
JT Smith
93b5ca16e4 updating copyright year 2008-02-07 23:28:18 +00:00
Colin Kuskie
397783f15d final coverage tests to bring User.pm up to 100% 2007-10-31 21:15:49 +00:00
Colin Kuskie
17441c13c2 Fixed broken friends method caching. The cache was never populated, so it
would fail every time.
Added a missing DESTROY method to Group.pm.  That way it won't puke when trying
to call an undefined method when the User object is cleaned up.
Added coverage tests for friends method in User.pm
2007-10-31 21:00:54 +00:00
Colin Kuskie
2165538936 coverage tests for identifier method 2007-10-29 23:21:43 +00:00
Colin Kuskie
4519ecb261 coverage test for the case of an un-cached profile field fetch in User.t 2007-10-29 22:38:36 +00:00
Colin Kuskie
b8a4033036 Add more coverage tests for methods added to User.pm
for Friends.
Fix a bug in the isOnline method, which was looking sessions
exactly 600 seconds old.
2007-10-26 02:54:47 +00:00
Colin Kuskie
d66f8fa337 Add a new test for coverage of isInGroup with a non-existant group 2007-10-19 01:36:09 +00:00
Colin Kuskie
8d7c31253b add a new test to check getting a user with an undefined Id 2007-10-17 14:36:17 +00:00
Colin Kuskie
83310ba311 update copyright on tests 2007-07-07 03:56:44 +00:00
Colin Kuskie
0c9d1f4332 RFE for a new user access method, lookup by username and return
an object.   Includes tests for validating the code.
2007-07-06 17:53:18 +00:00
Colin Kuskie
2893409d05 add uiLevel tests for Visitor and Admin 2007-06-10 22:55:52 +00:00
Colin Kuskie
907f31b97d update User test for new User Profile table scheme 2007-05-29 18:09:50 +00:00
Colin Kuskie
81e1001d59 More coverage tests. With the exception of the deprecated identifier method, User.pm is 100% covered 2007-03-04 05:35:47 +00:00
Colin Kuskie
1412f023f1 Fixed a bug in WebGUI::User::profileField, where the check for whether or not
a profile field existed in the db always passed because it used quickArray in
scalar context.  Since quickArray always returns 1 element, this was always true
and it never returned undef like it was supposed to.

To fix this, I added a new method called quickScalar that returns the first column
from the row as a scalar.  It has a basic test in SQL.t.

Then there's the new test in User.t for coverage that exposed this problem, and
I also removed a whole slew of duplicate tests.
2007-03-04 04:18:59 +00:00
Colin Kuskie
1a278fed6c remove some old debug code and cover the caching of user profile fields on user creation 2007-03-04 03:40:25 +00:00
Colin Kuskie
70d7bb2513 Remove some dead code in Group.t
Add more tests for coverage in User.t
2007-02-25 05:57:54 +00:00
Colin Kuskie
128ab06bf6 Built a test for newByEmail and removed the TODO test. 2007-02-24 04:36:11 +00:00
Colin Kuskie
31139678ee Corner cases for User.pm coverage
Converted 2 more queries to use placeholders
2007-02-24 00:37:55 +00:00
Colin Kuskie
2a0eb20bc7 Tests for the canUseAdminMode method of User.pm
Uncovered and fixed a bug where $session->user instead of $self was used in canUseAdminMode
Added an explicit test in Config.pm to make sure that array refs can be passed to ->set.
2007-02-23 23:39:35 +00:00
Colin Kuskie
2803ae520c 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.
2007-02-23 22:27:23 +00:00
Colin Kuskie
751adbcf30 more delta time fixes 2006-08-04 17:53:32 +00:00
Colin Kuskie
d888c5c134 add explicit test for new users being added to group Everyone on creation 2006-08-04 05:15:38 +00:00
Colin Kuskie
4b891f22f8 We're getting occasional failures of tests for timings. Using
the lastUpdated method on a user, for example.  I've made two changes
to try and fix these:

1) Changed the tests to use cmp_ok instead of ok, so that future failures
will print the measured times as a debug, like is and isn't do.

2) Reversed the order of the method and time measurement.  This might help
the difference stay smaller since the two statements are closer.
2006-08-01 18:28:58 +00:00
Colin Kuskie
fa4fe985ae fix User.t so that it will tolerate 1 second variances in update times 2006-06-02 18:06:46 +00:00
Colin Kuskie
3d10acb8ce update User test now that group caches are flushed properly 2006-05-19 03:53:50 +00:00
Colin Kuskie
cb2a8d025e I am 4 kinds of fool 2006-04-15 16:51:23 +00:00
Colin Kuskie
bbd17516e8 add cache clearing to end of User and Group tests, too 2006-04-15 02:36:52 +00:00
Colin Kuskie
1c6fec6695 Flush cache for User and Group tests to pass.
Add group cache clear to Group.pm
templateId clash due fixed
2006-04-15 02:32:38 +00:00
Colin Kuskie
ad694fb030 Fix User.t so that it assigns IPs in a way that works with the new isInGroup code.
User.pm: Collapse all methods into getUsers(1) inside isInGroup
Group.pm: Disable the cache whenever a scratchFilter or ipFilter is assigned.
Begin updating Group documentation for changes to dbQuery
2006-04-12 23:33:11 +00:00
Colin Kuskie
3e179fa4ad Group.t: group karma tests, better clean-up at end
User.t: better clean-up at end
Scratch.t: no newlines in test output
Session/Scratch.pm: convert to use placeholders
Ad.pm: Add missing line of POD.
Group.pm: add method to get all users in a group by karma.
User.pm: isInGroup to use getKarmaUsers.
2006-04-06 16:52:34 +00:00
JT Smith
de20e89c98 fixed errors reported by smoke tests 2006-03-25 19:50:46 +00:00
Colin Kuskie
0cda78d536 bad test nomenclature 2006-03-19 00:24:40 +00:00
Colin Kuskie
e8a364f526 New user and group tests for caching and membership and default group settings.
Cache busting in User.pm.
Allow Visitor to be formally added to groups 2 and 7.
More placeholder work.
Update Help for Secondary Admins.
2006-03-18 05:36:04 +00:00
Colin Kuskie
5ec8690e53 More user testing, for addToGroup. Also, make sure that the test for ipFilter
always cleans up after itself.

Fix a bug where Operation::User::_submenu was still using form->process.  Switched
to using stow instead.

If the uid is "new", links for delete and become user are not shown anymore.
2006-03-18 00:18:31 +00:00
Colin Kuskie
cd6759f311 Modify WebGUI IP fields to use CIDR format instead of a regular expression.
Multiple IPs are separated by commas, whitespace is ignored.
In groups, that affects the ipFilter field,  User::isInGroup.
In settings, that affects Settings::debugIp and Session::ErrorHandler::canShowDebug.

Fixed a bug in WebGUI::Utility::isInSubnet where Net::Subnets->check needs a scalar.

Modified t/User.t to use addresses in CIDR format.
2006-02-14 22:35:21 +00:00
Colin Kuskie
84fd39285f new user tests for valid userId 2006-02-14 06:52:58 +00:00
Colin Kuskie
62a841ced9 Move 6.8's Group ipFilter test into User.t since isInGroup was moved into WebGUI::User.pm
forward port of ipFilter bugfix, typo
2006-02-10 20:31:26 +00:00
Matthew Wilson
6266be5b65 lots more fixes and enhanced User.t 2006-01-18 15:22:43 +00:00
Matthew Wilson
29a75c50b8 increment number of tests. 2006-01-18 03:29:12 +00:00
Matthew Wilson
e33c7bebc3 an absolute slew of changes. 2006-01-18 01:45:55 +00:00
Christian Hansen
83d59837fd Ported all tests 2006-01-17 22:06:21 +00:00
JT Smith
b1ab07d24f more session related bug fixes 2006-01-14 21:30:49 +00:00
JT Smith
20a4aebb13 first round at fixing tests to work with new session system 2006-01-12 22:49:38 +00:00
Roy Johnson
6151e59cbd Added tests for User.pm
Fixed lastUpdated bugs in User.pm
Fixed karma bug in User.pm
2005-12-06 05:10:58 +00:00