aboutsummaryrefslogtreecommitdiff
path: root/perl/t
diff options
context:
space:
mode:
Diffstat (limited to 'perl/t')
-rwxr-xr-xperl/t/admin.t11
-rwxr-xr-xperl/t/server.t3
2 files changed, 9 insertions, 5 deletions
diff --git a/perl/t/admin.t b/perl/t/admin.t
index 9795f19..4b8302d 100755
--- a/perl/t/admin.t
+++ b/perl/t/admin.t
@@ -8,7 +8,7 @@
#
# See LICENSE for licensing terms.
-use Test::More tests => 27;
+use Test::More tests => 29;
use Wallet::Admin;
use Wallet::Schema;
@@ -35,8 +35,8 @@ is ($acls[0][0], 1, ' and that is ACL ID 1');
is ($acls[0][1], 'ADMIN', ' with the right name');
# Register a base object so that we can create a simple object.
-my $schema = Wallet::Schema->new;
-$schema->register_object ($admin->dbh, 'base', 'Wallet::Object::Base');
+is ($admin->register_object ('base', 'Wallet::Object::Base'), 1,
+ 'Registering Wallet::Object::Base works');
# Create an object.
$server = eval { Wallet::Server->new ('admin@EXAMPLE.COM', 'localhost') };
@@ -50,6 +50,11 @@ is (scalar (@objects), 1, ' and now there is one object');
is ($objects[0][0], 'base', ' with the right type');
is ($objects[0][1], 'service/admin', ' and the right name');
+# Test registering a new ACL type. We don't have a good way of really using
+# this right now.
+is ($admin->register_verifier ('base', 'Wallet::ACL::Base'), 1,
+ 'Registering Wallet::ACL::Base works');
+
# Create another ACL.
is ($server->acl_create ('first'), 1, 'ACL creation succeeds');
@acls = $admin->list_acls;
diff --git a/perl/t/server.t b/perl/t/server.t
index 423127f..08edd56 100755
--- a/perl/t/server.t
+++ b/perl/t/server.t
@@ -40,8 +40,7 @@ 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');
+$setup->register_object ('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