aboutsummaryrefslogtreecommitdiff
path: root/perl/t/wa-keyring.t
diff options
context:
space:
mode:
authorJon Robertson <jonrober@stanford.edu>2013-01-31 16:27:49 -0800
committerRuss Allbery <rra@stanford.edu>2013-01-31 16:35:01 -0800
commitbf18b39b6afe541e6888d32d6a555643cbe9d22e (patch)
tree9d224736f0a6f6b803a749938e631bd262be0c26 /perl/t/wa-keyring.t
parenta30984dc9602e5a7efe9556f337eb21dbcec8319 (diff)
Renamed dbh subroutines and variables for clarity
In moving from DBI to DBIx::Class, we at first left the various variables the same. This goes through to update them for the proper names. * Wallet::Admin::schema was created to return the schema object (and similarly for Wallet::Server and Wallet::Report). * Wallet::Admin::dbh was modified to return the actual DBI handle again (and similarly for Wallet::Server and Wallet::Report). * Various places that used $admin->{dbh} were moved to $admin->{schema}. * Various places using $dbh for the schema object were changed to $schema. Change-Id: I00914866e9a8250855a7828474aa9ce0f37b914f Reviewed-on: https://gerrit.stanford.edu/733 Reviewed-by: Russ Allbery <rra@stanford.edu> Tested-by: Russ Allbery <rra@stanford.edu>
Diffstat (limited to 'perl/t/wa-keyring.t')
-rwxr-xr-xperl/t/wa-keyring.t10
1 files changed, 5 insertions, 5 deletions
diff --git a/perl/t/wa-keyring.t b/perl/t/wa-keyring.t
index 703b7fe..3011d54 100755
--- a/perl/t/wa-keyring.t
+++ b/perl/t/wa-keyring.t
@@ -40,14 +40,14 @@ db_setup;
my $admin = eval { Wallet::Admin->new };
is ($@, '', 'Database connection succeeded');
is ($admin->reinitialize ($user), 1, 'Database initialization succeeded');
-my $dbh = $admin->dbh;
+my $schema = $admin->schema;
# Create a WebAuth context to use.
my $wa = WebAuth->new;
# Test error handling in the absence of configuration.
my $object = eval {
- Wallet::Object::WAKeyring->create ('wa-keyring', 'test', $dbh, @trace)
+ Wallet::Object::WAKeyring->create ('wa-keyring', 'test', $schema, @trace)
};
ok (defined ($object), 'Creating a basic WebAuth keyring object succeeds');
ok ($object->isa ('Wallet::Object::WAKeyring'), ' and is the right class');
@@ -65,7 +65,7 @@ $Wallet::Config::WAKEYRING_BUCKET = 'test-keyrings';
# Okay, now we can test. First, the basic object without store.
$object = eval {
- Wallet::Object::WAKeyring->create ('wa-keyring', 'test', $dbh, @trace)
+ Wallet::Object::WAKeyring->create ('wa-keyring', 'test', $schema, @trace)
};
ok (defined ($object), 'Creating a basic WebAuth keyring object succeeds');
ok ($object->isa ('Wallet::Object::WAKeyring'), ' and is the right class');
@@ -100,7 +100,7 @@ is ($object->destroy (@trace), 1, 'Destroying the object succeeds');
# Now store something and be sure that we get something reasonable.
$object = eval {
- Wallet::Object::WAKeyring->create ('wa-keyring', 'test', $dbh, @trace)
+ Wallet::Object::WAKeyring->create ('wa-keyring', 'test', $schema, @trace)
};
ok (defined ($object), 'Recreating the object succeeds');
my $key = WebAuth::Key->new ($wa, WA_KEY_AES, WA_AES_128);
@@ -159,7 +159,7 @@ is ($object->destroy (@trace), 1, 'Destroying the object succeeds');
# Test error handling in the file store.
system ('rm -r test-keyrings') == 0 or die "cannot remove test-keyrings\n";
$object = eval {
- Wallet::Object::WAKeyring->create ('wa-keyring', 'test', $dbh, @trace)
+ Wallet::Object::WAKeyring->create ('wa-keyring', 'test', $schema, @trace)
};
ok (defined ($object), 'Recreating the object succeeds');
is ($object->get (@trace), undef, ' but retrieving it fails');