Bugzilla – Attachment 147113 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), 1.92 KB, created by
Jonathan Druart
on 2023-02-22 09:21:09 UTC
(
hide
)
Description:
Bug 33020: Add test
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-02-22 09:21:09 UTC
Size:
1.92 KB
patch
obsolete
>From 100a594b6bb7c0818381b630d2da97e9518dbbd5 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 > >--- > 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 00000000000..3f2fdebfb2e >--- /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.25.1
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