aboutsummaryrefslogtreecommitdiff
path: root/perl/t/server.t
diff options
context:
space:
mode:
authorRuss Allbery <rra@stanford.edu>2007-12-05 01:10:23 +0000
committerRuss Allbery <rra@stanford.edu>2007-12-05 01:10:23 +0000
commitc0c34051887d08a94221f9cbc2b74fbfad34c22c (patch)
treecf6dbd65beee76296f4a16fef21c86419eaa5ed8 /perl/t/server.t
parent0e9a5e25ec9c1977c6426f4aea4b61a658fe6855 (diff)
Determine the class for object and ACL schema implementations from the
database rather than a hard-coded list and provide Wallet::Schema methods for adding new class mappings. Add a missing class mapping for the netdb ACL schema verifier.
Diffstat (limited to 'perl/t/server.t')
-rwxr-xr-xperl/t/server.t10
1 files changed, 6 insertions, 4 deletions
diff --git a/perl/t/server.t b/perl/t/server.t
index 229d58d..a1467d1 100755
--- a/perl/t/server.t
+++ b/perl/t/server.t
@@ -12,14 +12,12 @@ use Test::More tests => 321;
use POSIX qw(strftime);
use Wallet::Config;
+use Wallet::Schema;
use Wallet::Server;
use lib 't/lib';
use Util;
-# Allow creation of base objects for testing purposes.
-$Wallet::Server::MAPPING{base} = 'Wallet::Object::Base';
-
# Some global defaults to use.
my $admin = 'admin@EXAMPLE.COM';
my $user1 = 'alice@EXAMPLE.COM';
@@ -40,6 +38,10 @@ ok ($server->isa ('Wallet::Server'), ' and returned the right class');
my $dbh = $server->dbh;
ok (defined ($dbh), ' and returns a defined database handle');
+# Allow creation of base objects for testing purposes.
+my $schema = Wallet::Schema->new;
+$schema->register_object ($dbh, 'base', 'Wallet::Object::Base');
+
# We're currently running as the administrator, so everything should succeed.
# Set up a bunch of data for us to test with, starting with some ACLs. Test
# the error handling while we're at it.
@@ -867,7 +869,7 @@ is ($server->error, "$user2 not authorized to create base:service/foo",
' with the right error');
# Clean up.
-my $schema = Wallet::Schema->new;
+$schema = Wallet::Schema->new;
$schema->drop ($server->dbh);
unlink 'wallet-db';