[vhffs-dev] [1054] Removed all old tests since they are almost all outdated.

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 1054
Author:   beuss
Date:     2007-11-01 16:23:55 +0000 (Thu, 01 Nov 2007)

Log Message:
-----------
Removed all old tests since they are almost all outdated.

Modified Paths:
--------------
    trunk/vhffs-tests/src/Makefile.am

Removed Paths:
-------------
    trunk/vhffs-tests/src/Group.pl
    trunk/vhffs-tests/src/Object.pl
    trunk/vhffs-tests/src/Services/
    trunk/vhffs-tests/src/Stats.pl
    trunk/vhffs-tests/src/User.pl


Deleted: trunk/vhffs-tests/src/Group.pl
===================================================================
--- trunk/vhffs-tests/src/Group.pl	2007-11-01 10:31:12 UTC (rev 1053)
+++ trunk/vhffs-tests/src/Group.pl	2007-11-01 16:23:55 UTC (rev 1054)
@@ -1,41 +0,0 @@
-use Vhffs::Tests::Main;
-use Vhffs::Tests::Utils;
-use Vhffs::Group;
-use Test::More 'no_plan';
-
-use Data::Dumper;
-
-use strict;
-
-my $main = init Vhffs::Tests::Main;
-isa_ok($main, 'Vhffs::Tests::Main', '$main');
-Vhffs::Tests::Utils::init_db($main->get_db_object);
-
-# We need an user as group moderator
-my $user1 = Vhffs::User::create($main, 'testuser1', 'abcdef');
-isa_ok($user1, 'Vhffs::User', '$user1');
-# Some other users to add to group
-my $user2 = Vhffs::User::create($main, 'testuser2', 'ghijk');
-isa_ok($user2, 'Vhffs::User', '$user2');
-
-my $group1 = Vhffs::Group::create($main, 'testgroup1', $user1->get_uid, undef, 'Test group 1');
-isa_ok($group1, 'Vhffs::Group', $group1);
-cmp_ok($group1->get_groupname, 'eq', 'testgroup1', 'Groupname matches');
-
-# Check for groupname uniqueness constraint
-my ($max_oid) = $main->get_db_object->selectrow_array('SELECT MAX(object_id) FROM vhffs_object');
-ok(! defined(Vhffs::Group::create($main, 'testgroup1', $user1->get_uid, undef, 'Test group 1')), 'Unable to create 2 groups with the same name');
-my ($new_max_oid) = $main->get_db_object->selectrow_array('SELECT MAX(object_id) FROM vhffs_object');
-cmp_ok($new_max_oid, '==', $max_oid, 'Group creation is a "all or nothing" process');
-
-my $group2 = Vhffs::Group::create($main, 'testgroup1', $user1->get_uid, undef, 'Duplicate groupname');
-ok(!defined $group2, 'Unable to create a second group with the same name');
-
-my $group1a = Vhffs::Group::get_by_gid($main, $group1->get_gid);
-is_deeply($group1a, $group1, 'Fetched group matches created one');
-
-ok($group1->is_user_in_group($user1), 'Moderator is in group');
-ok($group1a->add_user( $user2->get_uid ), 'Other user can be added');
-ok($group1->is_user_in_group($user2), 'Second user addition visible in group1');
-ok($group1->remove_user($user2), 'Second user removed from group1');
-

Modified: trunk/vhffs-tests/src/Makefile.am
===================================================================
--- trunk/vhffs-tests/src/Makefile.am	2007-11-01 10:31:12 UTC (rev 1053)
+++ trunk/vhffs-tests/src/Makefile.am	2007-11-01 16:23:55 UTC (rev 1054)
@@ -1,5 +1,2 @@
 TESTS_ENVIRONMENT = @PERL@ -I . -I ../../vhffs-api/src/
-TESTS = Object.pl Group.pl User.pl Stats.pl Services/Svn.pl \
-	Services/Cvs.pl Services/Web.pl Services/DNS.pl Services/Mail.pl \
-	Services/MailingList.pl Services/Mysql.pl Services/Pgsql.pl \
-	Functions.pl Services/Repository.pl Services/Git.pl
+TESTS = Functions.pl 

Deleted: trunk/vhffs-tests/src/Object.pl
===================================================================
--- trunk/vhffs-tests/src/Object.pl	2007-11-01 10:31:12 UTC (rev 1053)
+++ trunk/vhffs-tests/src/Object.pl	2007-11-01 16:23:55 UTC (rev 1054)
@@ -1,24 +0,0 @@
-use Vhffs::Tests::Main;
-use Vhffs::Tests::Utils;
-use Vhffs::Object;
-use Test::More 'no_plan';
-use strict;
-
-
-my $main = init Vhffs::Tests::Main;
-Vhffs::Tests::Utils::init_db($main->get_db_object);
-
-my $owner1 = Vhffs::User::create($main, 'test1', '123');
-isa_ok($owner1, 'Vhffs::User', 'user1');
-
-my $obj1 = Vhffs::Object::create($main, $owner1->get_uid, 'Test object 1');
-isa_ok($obj1, 'Vhffs::Object', '$obj1');
-cmp_ok($obj1->get_description, 'eq', 'Test object 1');
-
-my $obj2 = Vhffs::Object::get_by_oid($main, $obj1->get_oid);
-isa_ok($obj2, 'Vhffs::Object', '$obj2');
-
-is_deeply($obj1, $obj2, 'Fetched object matches created object');
-
-my $history = $obj1->get_history;
-is(scalar(keys %{$history}), 1, 'One history entry');

Deleted: trunk/vhffs-tests/src/Stats.pl
===================================================================
--- trunk/vhffs-tests/src/Stats.pl	2007-11-01 10:31:12 UTC (rev 1053)
+++ trunk/vhffs-tests/src/Stats.pl	2007-11-01 16:23:55 UTC (rev 1054)
@@ -1,369 +0,0 @@
-use strict;
-use Vhffs::Tests::Main;
-use Vhffs::Tests::Utils;
-
-use Vhffs::User;
-use Vhffs::Group;
-use Vhffs::Stats;
-use Vhffs::Constants;
-
-use Vhffs::Services::Web;
-use Vhffs::Services::Cvs;
-use Vhffs::Services::DNS;
-use Vhffs::Services::Mysql;
-use Vhffs::Services::Pgsql;
-use Vhffs::Services::Svn;
-use Vhffs::Services::Git;
-use Vhffs::Services::Mail;
-use Vhffs::Services::MailingList;
-
-use Test::More 'no_plan';
-
-my $main = init Vhffs::Tests::Main;
-my $user;
-my $group;
-my $svc;
-
-ok(defined $main, 'Main object instanciation');
-
-Vhffs::Tests::Utils::init_db($main->get_db_object);
-
-for(my $i = 1 ; $i < 10 ; ++$i) {
-    Vhffs::User::create($main, "testuser0$i", 'dummy', Vhffs::Constants::USER_NORMAL, "testuser0$i\@test.com");
-}
-
-for(my $i = 1 ; $i < 10 ; ++$i) {
-    $user = Vhffs::User::get_by_username($main, "testuser0$i");
-    Vhffs::Group::create($main, "testgroup0$i", $user->get_uid);
-}
-
-$user = Vhffs::User::get_by_username($main, 'testuser01');
-$user->set_admin(Vhffs::Constants::USER_ADMIN);
-$user->commit();
-
-$user = Vhffs::User::get_by_username($main, 'testuser04');
-$user->set_admin(Vhffs::Constants::USER_ADMIN);
-$user->commit();
-
-$user = Vhffs::User::get_by_username($main, 'testuser02');
-$user->set_admin(Vhffs::Constants::USER_MODERATOR);
-$user->commit();
-
-my $stats = new Vhffs::Stats($main);
-
-# Users' stats
-is($stats->get_user_total, 9, 'Right number of users');
-is($stats->get_user_total_admin, 2, 'Right number of admins');
-is($stats->get_user_total_moderator, 1, 'Right number of moderators');
-is($stats->get_groups_total, 9, 'Right number of groups (non user)');
-is($stats->get_groups_in_moderation, 9, 'Right number of "Waiting for Moderation" groups');
-is($stats->get_groups_activated, 0, 'Right number of activated groups');
-
-# Groups' stats
-for(my $i = 1 ; $i < 10 ; ++$i) {
-    $group = Vhffs::Group::get_by_groupname($main, "testgroup0$i");
-    $group->set_status(Vhffs::Constants::WAITING_FOR_CREATION);
-    $group->commit;
-    $stats->refresh;
-    is($stats->get_groups_in_moderation, 9 - $i, (9 - $i).' groups are still waiting for moderation');
-    is($stats->get_groups_activated, 0, 'Groups are waiting for creation, not yet activated');
-}
-
-for(my $i = 1 ; $i < 10 ; ++$i) {
-    $group = Vhffs::Group::get_by_groupname($main, "testgroup0$i");
-    $group->set_status(Vhffs::Constants::ACTIVATED);
-    $group->commit;
-    $stats->refresh();
-    is($stats->get_groups_activated, $i, $i > 1 ? "$i groups are activated" : '1 group is activated');
-}
-
-# Web stats
-for(my $i = 1 ; $i < 10 ; ++$i) {
-    $group = Vhffs::Group::get_by_groupname($main, "testgroup0$i");
-    $user = Vhffs::User::get_by_username($main, "testuser0$i");
-    # Httpd servername must end with a 2-4 letters suffix
-    $svc = Vhffs::Services::Web::create($main, "httpd0$i.test.com", '', $user, $group);
-}
-
-$stats->refresh();
-is($stats->get_web_in_moderation, 9, 'All httpd services waiting for moderation');
-for(my $i = 1 ; $i < 10 ; ++$i) {
-    $svc = Vhffs::Services::Web::get_by_servername($main, "httpd0$i.test.com");
-    $svc->set_status(Vhffs::Constants::WAITING_FOR_CREATION);
-    $svc->commit;
-    $stats->refresh();
-    is($stats->get_web_in_moderation, 9 - $i, (9 - $i).($i >= 8 ? ' httpd service waiting for moderation' : ' httpd services waiting for moderation'));
-    is($stats->get_web_activated, 0, 'No httpd service activated');
-}
-
-for(my $i = 1 ; $i < 10 ; ++$i) {
-    $svc = Vhffs::Services::Web::get_by_servername($main, "httpd0$i.test.com");
-    $svc->set_status(Vhffs::Constants::ACTIVATED);
-    $svc->commit;
-    $stats->refresh();
-    is($stats->get_web_activated, $i, $i > 1 ? "$i httpd services activated" : "$i httpd service activated");
-}
-
-# CVS stats
-
-for(my $i = 1 ; $i < 10 ; ++$i) {
-    $group = Vhffs::Group::get_by_groupname($main, "testgroup0$i");
-    $user = Vhffs::User::get_by_username($main, "testuser0$i");
-    Vhffs::Services::Cvs::create($main, "testcvs0$i", '', $user, $group);
-}
-
-$stats->refresh();
-is($stats->get_cvs_in_moderation, 9, 'All cvs services waiting for moderation');
-for(my $i = 1 ; $i < 10 ; ++$i) {
-    $svc = Vhffs::Services::Cvs::get_by_cvsroot($main, "testcvs0$i");
-
-    $svc->set_status(Vhffs::Constants::WAITING_FOR_CREATION);
-    $svc->commit;
-    $stats->refresh();
-    is($stats->get_cvs_in_moderation, 9 - $i, (9 - $i).($i >= 8 ? ' cvs service waiting for moderation' : ' cvs services waiting for moderation'));
-    is($stats->get_cvs_activated, 0, 'No httpd service activated');
-}
-
-for(my $i = 1 ; $i < 10 ; ++$i) {
-    $svc = Vhffs::Services::Cvs::get_by_cvsroot($main, "testcvs0$i");
-    $svc->set_status(Vhffs::Constants::ACTIVATED);
-    $svc->commit;
-    $stats->refresh();
-    is($stats->get_cvs_activated, $i, $i > 1 ? "$i cvs services activated" : "$i cvs service activated");
-}
-
-# DNS stats
-
-for(my $i = 1 ; $i < 10 ; ++$i) {
-    $group = Vhffs::Group::get_by_groupname($main, "testgroup0$i");
-    $user = Vhffs::User::get_by_username($main, "testuser0$i");
-    $svc = Vhffs::Services::DNS::create($main, "dns0$i.test.com", "Stats domain #$i", $user, $group);
-}
-
-$stats->refresh();
-is($stats->get_dns_in_moderation, 9, 'All DNS services waiting for moderation');
-for(my $i = 1 ; $i < 10 ; ++$i) {
-    $svc = Vhffs::Services::DNS::get_by_domainname($main, "dns0$i.test.com");
-    $svc->set_status(Vhffs::Constants::WAITING_FOR_CREATION);
-    $svc->commit;
-    $stats->refresh();
-    is($stats->get_dns_in_moderation, 9 - $i, (9 - $i).($i >= 8 ? ' DNS service waiting for moderation' : ' DNS services waiting for moderation'));
-    is($stats->get_dns_activated, 0, 'No DNS service activated');
-}
-
-for(my $i = 1 ; $i < 10 ; ++$i) {
-    $svc = Vhffs::Services::DNS::get_by_domainname($main, "dns0$i.test.com");
-    $svc->set_status(Vhffs::Constants::ACTIVATED);
-    $svc->commit;
-    $stats->refresh();
-    is($stats->get_dns_activated, $i, $i > 1 ? "$i DNS services activated" : "$i DNS service activated");
-}
-
-# MySQL stats
-
-for(my $i = 1 ; $i < 10 ; ++$i) {
-    $group = Vhffs::Group::get_by_groupname($main, "testgroup0$i");
-    $user = Vhffs::User::get_by_username($main, "testuser0$i");
-    $svc = Vhffs::Services::Mysql::create($main, "mysqltest0$i", "mysqltest0$i", 'abcdef', "Mysql test DB #0$i", $user, $group);
-}
-
-$stats->refresh();
-is($stats->get_mysql_in_moderation, 9, 'All MySQL services waiting for moderation');
-for(my $i = 1 ; $i < 10 ; ++$i) {
-    $svc = Vhffs::Services::Mysql::get_by_dbname($main, "mysqltest0$i");
-    $svc->set_status(Vhffs::Constants::WAITING_FOR_CREATION);
-    $svc->commit;
-    $stats->refresh();
-    is($stats->get_mysql_in_moderation, 9 - $i, (9 - $i).($i >= 8 ? ' MySQL service waiting for moderation' : ' MySQL services waiting for moderation'));
-    is($stats->get_mysql_activated, 0, 'No MySQL service activated');
-}
-
-for(my $i = 1 ; $i < 10 ; ++$i) {
-    $svc = Vhffs::Services::Mysql::get_by_dbname($main, "mysqltest0$i");
-    $svc->set_status(Vhffs::Constants::ACTIVATED);
-    $svc->commit;
-    $stats->refresh();
-    is($stats->get_mysql_activated, $i, $i > 1 ? "$i MySQL services activated" : "$i MySQL service activated");
-}
-
-# Postgres Stats
-
-for(my $i = 1 ; $i < 10 ; ++$i) {
-    $group = Vhffs::Group::get_by_groupname($main, "testgroup0$i");
-    $user = Vhffs::User::get_by_username($main, "testuser0$i");
-    $svc = Vhffs::Services::Pgsql::create($main, "pgsqltest0$i", "pgsqlu0$i", 'abcdef', "MySQL test DB #0$i", $user, $group);
-}
-
-$stats->refresh();
-is($stats->get_pgsql_in_moderation, 9, 'All PostgreSQL services waiting for moderation');
-for(my $i = 1 ; $i < 10 ; ++$i) {
-    $svc = Vhffs::Services::Pgsql::get_by_dbname($main, "pgsqltest0$i");
-    $svc->set_status(Vhffs::Constants::WAITING_FOR_CREATION);
-    $svc->commit;
-    $stats->refresh();
-    is($stats->get_pgsql_in_moderation, 9 - $i, (9 - $i).($i >= 8 ? ' PostgreSQL service waiting for moderation' : ' PostgreSQL services waiting for moderation'));
-    is($stats->get_pgsql_activated, 0, 'No PostgreSQL service activated');
-}
-
-for(my $i = 1 ; $i < 10 ; ++$i) {
-    $svc = Vhffs::Services::Pgsql::get_by_dbname($main, "pgsqltest0$i");
-    $svc->set_status(Vhffs::Constants::ACTIVATED);
-    $svc->commit;
-    $stats->refresh();
-    is($stats->get_pgsql_activated, $i, $i > 1 ? "$i PostgreSQL services activated" : "$i PostgreSQL service activated");
-}
-
-# SVN Stats
-
-for(my $i = 1 ; $i < 10 ; ++$i) {
-    $group = Vhffs::Group::get_by_groupname($main, "testgroup0$i");
-    $user = Vhffs::User::get_by_username($main, "testuser0$i");
-    $svc = Vhffs::Services::Svn::create($main, "svntest0$i", "SVN #$i for stats tests", $user, $group);
-}
-
-$stats->refresh();
-is($stats->get_svn_in_moderation, 9, 'All SVN services waiting for moderation');
-for(my $i = 1 ; $i < 10 ; ++$i) {
-    $group = Vhffs::Group::get_by_groupname($main, "testgroup0$i");
-    $svc = Vhffs::Services::Svn::get_by_reponame($main, "svntest0$i");
-    $svc->set_status(Vhffs::Constants::WAITING_FOR_CREATION);
-    $svc->commit;
-    $stats->refresh();
-    is($stats->get_svn_in_moderation, 9 - $i, (9 - $i).($i >= 8 ? ' SVN service waiting for moderation' : ' SVN services waiting for moderation'));
-    is($stats->get_svn_activated, 0, 'No SVN service activated');
-}
-
-for(my $i = 1 ; $i < 10 ; ++$i) {
-    $group = Vhffs::Group::get_by_groupname($main, "testgroup0$i");
-    $svc = Vhffs::Services::Svn::get_by_reponame($main, "svntest0$i");
-    $svc->set_status(Vhffs::Constants::ACTIVATED);
-    $svc->commit;
-    $stats->refresh();
-    is($stats->get_svn_activated, $i, $i > 1 ? "$i SVN services activated" : "$i SVN service activated");
-}
-
-# GIT Stats
-
-for(my $i = 1 ; $i < 10 ; ++$i) {
-    $group = Vhffs::Group::get_by_groupname($main, "testgroup0$i");
-    $user = Vhffs::User::get_by_username($main, "testuser0$i");
-    $svc = Vhffs::Services::Git::create($main, "gittest0$i", "git #$i for stats tests", $user, $group);
-}
-
-$stats->refresh();
-is($stats->get_git_in_moderation, 9, 'All GIT services waiting for moderation');
-for(my $i = 1 ; $i < 10 ; ++$i) {
-    $group = Vhffs::Group::get_by_groupname($main, "testgroup0$i");
-    $svc = Vhffs::Services::Git::get_by_reponame($main, "gittest0$i");
-    $svc->set_status(Vhffs::Constants::WAITING_FOR_CREATION);
-    $svc->commit;
-    $stats->refresh();
-    is($stats->get_git_in_moderation, 9 - $i, (9 - $i).($i >= 8 ? ' GIT service waiting for moderation' : ' GIT services waiting for moderation'));
-    is($stats->get_git_activated, 0, 'No GIT service activated');
-}
-
-for(my $i = 1 ; $i < 10 ; ++$i) {
-    $group = Vhffs::Group::get_by_groupname($main, "testgroup0$i");
-    $svc = Vhffs::Services::Git::get_by_reponame($main, "gittest0$i");
-    $svc->set_status(Vhffs::Constants::ACTIVATED);
-    $svc->commit;
-    $stats->refresh();
-    is($stats->get_git_activated, $i, $i > 1 ? "$i GIT services activated" : "$i GIT service activated");
-}
-
-# Mail tests
-
-for(my $i = 1 ; $i < 10 ; ++$i) {
-    $group = Vhffs::Group::get_by_groupname($main, "testgroup0$i");
-    $user = Vhffs::User::get_by_username($main, "testuser0$i");
-    $svc = Vhffs::Services::Mail::create($main, "mail0$i.test.com", "Mail domain #$i for stats' tests", $user, $group);
-}
-
-$stats->refresh();
-is($stats->get_mail_in_moderation, 9, 'All Mail services waiting for moderation');
-for(my $i = 1 ; $i < 10 ; ++$i) {
-    $svc = Vhffs::Services::Mail::get_by_mxdomain($main, "mail0$i.test.com");
-    $svc->set_status(Vhffs::Constants::WAITING_FOR_CREATION);
-    $svc->commit;
-    $stats->refresh();
-    is($stats->get_mail_in_moderation, 9 - $i, (9 - $i).($i >= 8 ? ' Mail service waiting for moderation' : ' Mail services waiting for moderation'));
-    is($stats->get_mail_activated, 0, 'No Mail service activated');
-}
-
-for(my $i = 1 ; $i < 10 ; ++$i) {
-    $svc = Vhffs::Services::Mail::get_by_mxdomain($main, "mail0$i.test.com");
-    $svc->set_status(Vhffs::Constants::ACTIVATED);
-    $svc->commit;
-    $stats->refresh();
-    is($stats->get_mail_activated, $i, $i > 1 ? "$i Mail services activated" : "$i Mail service activated");
-}
-
-# mboxes tests
-
-for(my $i = 1 ; $i < 10 ; ++$i) {
-    $svc = Vhffs::Services::Mail::get_by_mxdomain($main, "mail0$i.test.com");
-    for(my $j = 0 ; $j < 10 ; ++$j) {
-        $svc->addbox("mboxtest0${i}0$j", '123456');
-    }
-    $svc->commit;
-}
-
-$stats->refresh();
-
-is($stats->get_mail_total_boxes, 90, 'All mboxes created');
-
-# forward tests
-
-for(my $i = 1 ; $i < 10 ; ++$i) {
-    $svc = Vhffs::Services::Mail::get_by_mxdomain($main, "mail0$i.test.com");
-    for(my $j = 0 ; $j < 10 ; ++$j) {
-        $svc->addforward("fwdtest0${i}0$j", "test0$i\@test.com");
-    }
-    $svc->commit;
-}
-
-$stats->refresh();
-
-is($stats->get_mail_total_forwards, 90, 'All forwards created');
-
-# Mailing lists tests
-
-for(my $i = 1 ; $i < 10 ; ++$i) {
-    $group = Vhffs::Group::get_by_groupname($main, "testgroup0$i");
-    $user = Vhffs::User::get_by_username($main, "testuser0$i");
-    $svc = Vhffs::Services::MailingList::create($main, "ml", "mail0$i.test.com", undef, "Test list #$i", $user, $group);
-}
-
-$stats->refresh();
-is($stats->get_lists_in_moderation, 9, 'All Mailing Lists services waiting for moderation');
-
-for(my $i = 1 ; $i < 10 ; ++$i) {
-    $svc = Vhffs::Services::MailingList::get_by_mladdress($main, "ml", "mail0$i.test.com");
-    $svc->set_status(Vhffs::Constants::WAITING_FOR_CREATION);
-    $svc->commit;
-    $stats->refresh();
-    is($stats->get_lists_in_moderation, 9 - $i, (9 - $i).($i >= 8 ? ' Mailing List service waiting for moderation' : ' Mailing List services waiting for moderation'));
-    is($stats->get_lists_activated, 0, 'No Mailing List service activated');
-}
-
-for(my $i = 1 ; $i < 10 ; ++$i) {
-    $svc = Vhffs::Services::MailingList::get_by_mladdress($main, "ml", "mail0$i.test.com");
-    $svc->set_status(Vhffs::Constants::ACTIVATED);
-    $svc->commit;
-    $stats->refresh();
-    is($stats->get_lists_activated, $i, $i > 1 ? "$i Mailing List services activated" : "$i Mailing List service activated");
-}
-
-# Subscribers test
-
-for(my $i = 1 ; $i < 10 ; ++$i) {
-    $svc = Vhffs::Services::MailingList::get_by_mladdress($main, "ml", "mail0$i.test.com");
-    for(my $j = 0 ; $j < 10 ; ++$j) {
-        $svc->add_sub("sub0$j\@test.com", Vhffs::Constants::USER_NORMAL);
-    }
-    $svc->commit;
-}
-
-$stats->refresh();
-is($stats->get_lists_totalsubs, 90, 'All subscribers registered'); 
-

Deleted: trunk/vhffs-tests/src/User.pl
===================================================================
--- trunk/vhffs-tests/src/User.pl	2007-11-01 10:31:12 UTC (rev 1053)
+++ trunk/vhffs-tests/src/User.pl	2007-11-01 16:23:55 UTC (rev 1054)
@@ -1,60 +0,0 @@
-use strict;
-use Vhffs::Tests::Main;
-use Vhffs::Tests::Utils;
-use Vhffs::User;
-use Test::More 'no_plan';
-
-my $main = init Vhffs::Tests::Main;
-isa_ok($main, 'Vhffs::Tests::Main', '$main');
-
-Vhffs::Tests::Utils::init_db($main->get_db_object);
-
-my $user1 = Vhffs::User::create($main, 'test1', 'abcdef', 0, 'test1@xxxxxxxx');
-isa_ok($user1, 'Vhffs::User', '$user1');
-cmp_ok($user1->get_username, 'eq', 'test1', 'Username matches');
-cmp_ok($user1->get_mail, 'eq', 'test1@xxxxxxxx', 'Email matches');
-
-my $uid1 = $user1->get_uid;
-ok(Vhffs::User::exists($main, $user1->get_username), 'First user exists');
-ok(Vhffs::User::uid_exists($main->get_db_object, $uid1), 'First user UID exists');
-
-my $user2 = Vhffs::User::create($main, 'test2', 'abcdef', 0, 'test2@xxxxxxxx');
-isa_ok($user2, 'Vhffs::User', '$user2');
-
-$main->get_db_object->{PrintError} = 0;
-ok(!defined Vhffs::User::create($main, 'test2', 'dummy', 1, 'another@xxxxxxxxx'), 'Unable to create duplicate user');
-$main->get_db_object->{PrintError} = 1;
-
-my $user3 = Vhffs::User::get_by_uid($main, $user1->get_uid);
-is_deeply($user3, $user1, 'Fetched user is a copy of original');
-$user3->set_admin(1);
-cmp_ok($user3->commit, '>', 0, 'Third user\'s modifications committed');
-
-$user1 = Vhffs::User::get_by_uid($main, $user1->get_uid);
-ok($user1->is_admin, 'Admin propertie propagated');
-
-# Group stuff
-
-cmp_ok($user1->get_gid, '>', 0, 'User\'s group is valid');
-
-my $group1 = Vhffs::Group::get_by_gid($main, $user1->get_gid);
-isa_ok($group1, 'Vhffs::Group', 'User\'s personal group');
-cmp_ok($user1->get_gid, '==', $group1->get_gid, 'User\'s personnal group GID matched fetched GID');
-cmp_ok($group1->get_groupname, 'eq', $user1->get_username, 'User\'s personnal group groupname matches username');
-
-my $group2 = Vhffs::Group::create($main, 'test1group1', $user1->get_uid, undef, 'Independant group');
-isa_ok($group2, 'Vhffs::Group', 'Independant group');
-
-my $group3 = Vhffs::Group::get_by_groupname($main, 'test1group1');
-isa_ok($group3, 'Vhffs::Group', 'Group for fetching');
-cmp_ok($group3->get_owner_uid, '==', $user1->get_uid, 'Independant group owner matches');
-
-# An user can't have the name if a group, AND it should
-# be a 'all or nothing' process, that is no user is half
-# created
-$main->get_db_object->{PrintError} = 0;
-my $user4 = Vhffs::User::create($main, 'test1group1', 'abcdef');
-$main->get_db_object->{PrintError} = 1;
-ok(!defined $user4, 'Unable to create an user with an existing groupname as username');
-$user4 = Vhffs::User::get_by_username($main, 'test1group1');
-ok(!defined $user4, 'User doesn\'t exist');


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/