summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2016-09-10 18:35:49 +0200
committerDylan William Hardison <dylan@hardison.net>2016-09-10 18:36:45 +0200
commitc61b7ce75f229d4034099e8e93c56d98208bc799 (patch)
tree4ce22a766edd030c70c16e9dac2f0fee9b764e79
parent4da53d8f712210eba8ab81f85bb64ec15720085a (diff)
downloadbugzilla-c61b7ce75f229d4034099e8e93c56d98208bc799.tar.gz
bugzilla-c61b7ce75f229d4034099e8e93c56d98208bc799.tar.xz
Bug 1294569 - 100markdown.t doesn't work without a working DB
-rw-r--r--t/100markdown.t30
1 files changed, 30 insertions, 0 deletions
diff --git a/t/100markdown.t b/t/100markdown.t
index 5cc6ecd4e..70dece55f 100644
--- a/t/100markdown.t
+++ b/t/100markdown.t
@@ -13,12 +13,42 @@ use warnings;
use lib qw(. lib local/lib/perl5 t);
use Test2::Bundle::Extended;
+use Bugzilla::Util;
+BEGIN {
+ my $terms = {
+ "bug" => "bug",
+ "Bug" => "Bug",
+ "abug" => "a bug",
+ "Abug" => "A bug",
+ "aBug" => "a Bug",
+ "ABug" => "A Bug",
+ "bugs" => "bugs",
+ "Bugs" => "Bugs",
+ "comment" => "comment",
+ "comments" => "comments",
+ "zeroSearchResults" => "Zarro Boogs found",
+ "Bugzilla" => "Bugzilla"
+ };
+ no warnings 'redefine', 'once';
+ *Bugzilla::Util::template_var = sub {
+ my $name = shift;
+ if ($name eq 'terms') {
+ return $terms;
+ } else {
+ die "sorry!";
+ }
+ };
+}
use Bugzilla;
+use Bugzilla::Constants;
use Bugzilla::Bug;
use Bugzilla::Comment;
use Bugzilla::User;
use Bugzilla::Markdown;
+Bugzilla->usage_mode(USAGE_MODE_TEST);
+Bugzilla->error_mode(ERROR_MODE_DIE);
+
my $user_mock = mock 'Bugzilla::User' => (
override_constructor => ['new', 'hash'],
);