diff options
Diffstat (limited to 'perl/t')
-rwxr-xr-x | perl/t/schema.t | 2 | ||||
-rwxr-xr-x | perl/t/server.t | 10 |
2 files changed, 7 insertions, 5 deletions
diff --git a/perl/t/schema.t b/perl/t/schema.t index 1068048..70378de 100755 --- a/perl/t/schema.t +++ b/perl/t/schema.t @@ -21,7 +21,7 @@ ok (defined $schema, 'Wallet::Schema creation'); ok ($schema->isa ('Wallet::Schema'), ' and class verification'); my @sql = $schema->sql; ok (@sql > 0, 'sql() returns something'); -is (scalar (@sql), 26, ' and returns the right number of statements'); +is (scalar (@sql), 28, ' and returns the right number of statements'); # Connect to a database and test create. db_setup; 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'; |