Bugzilla – Attachment 188842 Details for
Bug 39320
Create a 'landing page' for ERM
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39320: (QA follow-up): Add counts API tests
252bd38.patch (text/plain), 2.79 KB, created by
Tomás Cohen Arazi (tcohen)
on 2025-10-31 18:21:57 UTC
(
hide
)
Description:
Bug 39320: (QA follow-up): Add counts API tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2025-10-31 18:21:57 UTC
Size:
2.79 KB
patch
obsolete
>From 252bd3888e7248f1cc539bb6fe5fda381a87a70e Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@openfifth.co.uk> >Date: Fri, 17 Oct 2025 09:28:39 +0000 >Subject: [PATCH] Bug 39320: (QA follow-up): Add counts API tests >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >prove t/db_dependent/api/v1/erm_counts.t > >Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/api/v1/erm_counts.t | 73 ++++++++++++++++++++++++++++++ > 1 file changed, 73 insertions(+) > create mode 100755 t/db_dependent/api/v1/erm_counts.t > >diff --git a/t/db_dependent/api/v1/erm_counts.t b/t/db_dependent/api/v1/erm_counts.t >new file mode 100755 >index 00000000000..920242920a4 >--- /dev/null >+++ b/t/db_dependent/api/v1/erm_counts.t >@@ -0,0 +1,73 @@ >+#!/usr/bin/env 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 <https://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+ >+use Test::NoWarnings; >+use Test::More tests => 2; >+use Test::Mojo; >+ >+use t::lib::TestBuilder; >+use t::lib::Mocks; >+ >+use Koha::Database; >+ >+my $schema = Koha::Database->new->schema; >+my $builder = t::lib::TestBuilder->new; >+ >+my $t = Test::Mojo->new('Koha::REST::V1'); >+ >+subtest 'count() tests' => sub { >+ >+ plan tests => 3; >+ >+ $schema->storage->txn_begin; >+ >+ my $librarian = $builder->build_object( >+ { >+ class => 'Koha::Patrons', >+ value => { flags => 2**28 } >+ } >+ ); >+ >+ my $password = 'thePassword123'; >+ $librarian->set_password( { password => $password, skip_validation => 1 } ); >+ my $userid = $librarian->userid; >+ >+ ## Authorized user tests >+ my $agreement = $builder->build_object( >+ { >+ class => 'Koha::ERM::Agreements', >+ } >+ ); >+ >+ my $license = $builder->build_object( >+ { >+ class => 'Koha::ERM::Licenses', >+ } >+ ); >+ >+ $t->get_ok("//$userid:$password@/api/v1/erm/counts")->status_is(200)->json_is( >+ { >+ counts => { >+ agreements_count => 1, documents_count => 0, eholdings_packages_count => 0, >+ eholdings_titles_count => 0, licenses_count => 1, usage_data_providers_count => 0 >+ } >+ } >+ ); >+ $schema->storage->txn_rollback; >+}; >-- >2.51.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 39320
:
187513
|
187514
|
187515
|
187516
|
187517
|
187518
|
187519
|
187520
|
187521
|
187522
|
187563
|
187568
|
187635
|
187636
|
187637
|
187638
|
187639
|
187640
|
187641
|
187642
|
187643
|
187644
|
187645
|
188094
|
188095
|
188096
|
188097
|
188098
|
188099
|
188100
|
188101
|
188102
|
188103
|
188104
|
188151
|
188279
|
188280
|
188281
|
188282
|
188283
|
188284
|
188285
|
188312
|
188315
|
188372
|
188375
|
188376
|
188637
|
188638
|
188639
|
188640
|
188641
|
188830
|
188831
|
188832
|
188833
|
188834
|
188835
|
188836
|
188837
|
188838
|
188839
|
188840
|
188841
| 188842 |
188843
|
188844
|
188845
|
188846
|
188847
|
188848
|
188849
|
188850
|
188851
|
188852
|
188853
|
188854
|
188855
|
188856
|
188857
|
188858
|
188859
|
188860
|
188861
|
188862
|
188863
|
188864