summaryrefslogtreecommitdiffstats
path: root/t/mock-db.t
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2018-08-10 21:41:53 +0200
committerdklawren <dklawren@users.noreply.github.com>2018-08-10 21:41:53 +0200
commitea5beeacb185309572836cc60989f95ea4705f9d (patch)
tree1f8f44b5d1dba73fb05214ba1e539c0918d42bb9 /t/mock-db.t
parent53e1adcc77b3e68c1d8659d418aa5639d9917e42 (diff)
downloadbugzilla-ea5beeacb185309572836cc60989f95ea4705f9d.tar.gz
bugzilla-ea5beeacb185309572836cc60989f95ea4705f9d.tar.xz
Bug 1482475 - Add extensive testing framework
Diffstat (limited to 't/mock-db.t')
-rw-r--r--t/mock-db.t35
1 files changed, 35 insertions, 0 deletions
diff --git a/t/mock-db.t b/t/mock-db.t
new file mode 100644
index 000000000..6cf84f316
--- /dev/null
+++ b/t/mock-db.t
@@ -0,0 +1,35 @@
+#!/usr/bin/perl
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# This Source Code Form is "Incompatible With Secondary Licenses", as
+# defined by the Mozilla Public License, v. 2.0.
+use 5.10.1;
+use strict;
+use warnings;
+use lib qw( . lib local/lib/perl5 );
+use Test::More;
+use Try::Tiny;
+
+use ok 'Bugzilla::Test::MockDB';
+use ok 'Bugzilla::Test::Util', qw(create_user);
+
+try {
+ Bugzilla::Test::MockDB->import();
+ pass('made fake in-memory db');
+}
+catch {
+ diag $_;
+ fail('made fake in-memory db');
+};
+
+try {
+ create_user('bob@pants.gov', '*');
+ ok( Bugzilla::User->new({name => 'bob@pants.gov'})->id, 'create a user' );
+}
+catch {
+ fail('create a user');
+};
+
+done_testing;