Bugzilla – Attachment 78599 Details for
Bug 21334
Add bibliographic content type definitions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21334: Unit tests
Bug-21334-Unit-tests.patch (text/plain), 2.24 KB, created by
Josef Moravec
on 2018-09-12 18:37:16 UTC
(
hide
)
Description:
Bug 21334: Unit tests
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2018-09-12 18:37:16 UTC
Size:
2.24 KB
patch
obsolete
>From 53a3993371fc5542b35dc4a8677a4e28f59044ef Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 11 Sep 2018 10:43:32 -0700 >Subject: [PATCH] Bug 21334: Unit tests > >This patch adds unit tests for the new content types being added. >It also adds tests for the 'json' overloading that already takes place >in V1.pm. > >Signed-off-by: Michal Denar <black23@gmail.com> > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > t/db_dependent/Koha/REST/V1.t | 44 +++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 44 insertions(+) > create mode 100644 t/db_dependent/Koha/REST/V1.t > >diff --git a/t/db_dependent/Koha/REST/V1.t b/t/db_dependent/Koha/REST/V1.t >new file mode 100644 >index 0000000..faddea9 >--- /dev/null >+++ b/t/db_dependent/Koha/REST/V1.t >@@ -0,0 +1,44 @@ >+#!/usr/bin/perl >+ >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+ >+use Test::More tests => 1; >+use Test::Mojo; >+use Test::Warn; >+ >+use JSON::Validator::OpenAPI::Mojolicious; >+ >+subtest 'Type definition tests' => sub { >+ >+ plan tests => 4; >+ >+ # initialize Koha::REST::V1 after mocking >+ my $remote_address = '127.0.0.1'; >+ my $t; >+ >+ $t = Test::Mojo->new('Koha::REST::V1'); >+ my $types = $t->app->types; >+ >+ is( $types->type('json'), >+ 'application/json; charset=utf8', >+ 'application/json gets charset added' >+ ); >+ is( $types->type('marcxml'), 'application/marcxml+xml', 'application/marcxml+xml is defined' ); >+ is( $types->type('mij'), 'application/marc-in-json', 'application/marc-in-json is defined' ); >+ is( $types->type('marc'), 'application/marc', 'application/marc is defined' ); >+}; >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 21334
:
78563
|
78564
|
78565
|
78585
| 78599 |
78600