Bugzilla – Attachment 147138 Details for
Bug 33020
Unsupported method history
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33020: Add test
Bug-33020-Add-test.patch (text/plain), 2.01 KB, created by
Marcel de Rooy
on 2023-02-22 13:11:39 UTC
(
hide
)
Description:
Bug 33020: Add test
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2023-02-22 13:11:39 UTC
Size:
2.01 KB
patch
obsolete
>From 5fe64774ad85fa8a02527f1b0c152c475c756138 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 22 Feb 2023 10:20:56 +0100 >Subject: [PATCH] Bug 33020: Add test >Content-Type: text/plain; charset=utf-8 > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/db_dependent/www/rest_api.t | 45 +++++++++++++++++++++++++++++++++++ > 1 file changed, 45 insertions(+) > create mode 100644 t/db_dependent/www/rest_api.t > >diff --git a/t/db_dependent/www/rest_api.t b/t/db_dependent/www/rest_api.t >new file mode 100644 >index 0000000000..3f2fdebfb2 >--- /dev/null >+++ b/t/db_dependent/www/rest_api.t >@@ -0,0 +1,45 @@ >+#!/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; #See plan tests => \d+ below >+use LWP::UserAgent; >+ >+my $intranet = $ENV{KOHA_INTRANET_URL}; >+ >+eval{ >+ use C4::Context; >+}; >+if ($@) { >+ plan skip_all => "Tests skip. You must have a working Context\n"; >+} >+elsif (not defined $intranet) { >+ plan skip_all => "Tests skip. You must set env. variable KOHA_INTRANET_URL to do tests\n"; >+} >+else { >+ plan tests => 1; >+} >+ >+$intranet =~ s#/$##; >+ >+my $api_base_url = "$intranet/api/v1"; >+subtest 'non-existent routes' => sub { >+ plan tests => 1; >+ my $response = LWP::UserAgent->new->get($api_base_url . "/does_not_exist"); >+ is( $response->code, 404, "REST API should return 404 on non-existent routes" ); >+}; >-- >2.30.2
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 33020
:
147113
|
147116
|
147138
|
147139
|
147402
|
147403
|
147404