[Jifty-commit] r1430 - in wifty: .
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Sat Jul 1 16:35:48 EDT 2006
Author: nelhage
Date: Sat Jul 1 16:35:47 2006
New Revision: 1430
Added:
wifty/trunk/lib/Wifty/Test.pm
Modified:
wifty/ (props changed)
Log:
r13512 at phanatique: nelhage | 2006-06-30 15:53:33 +0200
Adding some test users
Added: wifty/trunk/lib/Wifty/Test.pm
==============================================================================
--- (empty file)
+++ wifty/trunk/lib/Wifty/Test.pm Sat Jul 1 16:35:47 2006
@@ -0,0 +1,53 @@
+use warnings;
+use strict;
+
+package Wifty::Test;
+use base qw/Jifty::Test/;
+
+=head2 setup
+
+Set up for testing. Calls L<Jifty::Test/setup> and L</setup_db>.
+
+=cut
+
+sub setup {
+ my $class = shift;
+ $class->SUPER::setup;
+ $class->setup_db;
+}
+
+=head2 setup_db
+
+Add two users to the database:
+
+Some User <someuser at localhost>, password 'sekrit'
+Other User <otheruser at localhost>, password 'motdepasse'
+
+This should be kept in sync with C<t/0-test-database>.
+
+=cut
+
+sub setup_db {
+ my $class = shift;
+
+ my $admin = Wifty::CurrentUser->superuser;
+
+ my $someuser = Wifty::Model::User->new(current_user => $admin);
+ $someuser->create(
+ name => 'Some User',
+ email => 'someuser at localhost',
+ password => 'sekrit',
+ email_confirmed => 1,
+ );
+
+ my $otheruser = Wifty::Model::User->new(current_user => $admin);
+ $otheruser->create(
+ name => 'Other User',
+ email => 'otheruser at localhost',
+ password => 'motdepasse',
+ email_confirmed => 1,
+ );
+
+}
+
+1;
More information about the Jifty-commit
mailing list