summaryrefslogtreecommitdiffstats
path: root/extensions/PhabBugz/t/basic.t
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2018-08-17 19:20:02 +0200
committerGitHub <noreply@github.com>2018-08-17 19:20:02 +0200
commit72f78546d35342dcf556322cd702bc32e9ed2811 (patch)
tree5699104095d05d06ab237a0dd51feb092f989eeb /extensions/PhabBugz/t/basic.t
parent4a154cbf7bb41e707c5950828ca1b2658d436609 (diff)
downloadbugzilla-72f78546d35342dcf556322cd702bc32e9ed2811.tar.gz
bugzilla-72f78546d35342dcf556322cd702bc32e9ed2811.tar.xz
Bug 1482145 - add more type checking to phabbugz code
Diffstat (limited to 'extensions/PhabBugz/t/basic.t')
-rw-r--r--extensions/PhabBugz/t/basic.t21
1 files changed, 14 insertions, 7 deletions
diff --git a/extensions/PhabBugz/t/basic.t b/extensions/PhabBugz/t/basic.t
index ba2f35e1d..9a6723ccb 100644
--- a/extensions/PhabBugz/t/basic.t
+++ b/extensions/PhabBugz/t/basic.t
@@ -223,15 +223,22 @@ JSON
},
],
);
- my $bug = mock {
- bug_id => 23,
+ my $Attachment = mock 'Bugzilla::Attachment' => (
+ add_constructor => [ fake_new => 'hash' ],
+ );
+ my $Bug = mock 'Bugzilla::Bug' => (
+ add_constructor => [ fake_new => 'hash' ],
+ );
+ my $bug = Bugzilla::Bug->fake_new(
+ bug_id => 23,
attachments => [
- mock {
- contenttype => 'text/x-phabricator-request',
+ Bugzilla::Attachment->fake_new(
+ mimetype => 'text/x-phabricator-request',
filename => 'phabricator-D9999-url.txt',
- },
+ ),
]
- };
+ );
+
my $revisions = get_attachment_revisions($bug);
is(ref($revisions), 'ARRAY', 'it is an array ref');
isa_ok($revisions->[0], 'Bugzilla::Extension::PhabBugz::Revision');
@@ -240,4 +247,4 @@ JSON
};
-done_testing; \ No newline at end of file
+done_testing;