Bugzilla – Attachment 158523 Details for
Bug 32986
Add ability to generate custom slips for patrons
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32986: (follow-up) Unit tests
Bug-32986-follow-up-Unit-tests.patch (text/plain), 2.54 KB, created by
Nick Clemens (kidclamp)
on 2023-11-06 14:08:45 UTC
(
hide
)
Description:
Bug 32986: (follow-up) Unit tests
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2023-11-06 14:08:45 UTC
Size:
2.54 KB
patch
obsolete
>From eeaf80b092453971d77159a8b1323a8b36ff8fac Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Mon, 6 Nov 2023 12:36:43 +0000 >Subject: [PATCH] Bug 32986: (follow-up) Unit tests > >--- > t/db_dependent/Koha/Template/Plugin/Notices.t | 64 +++++++++++++++++++ > 1 file changed, 64 insertions(+) > create mode 100755 t/db_dependent/Koha/Template/Plugin/Notices.t > >diff --git a/t/db_dependent/Koha/Template/Plugin/Notices.t b/t/db_dependent/Koha/Template/Plugin/Notices.t >new file mode 100755 >index 00000000000..7000c1ac5ae >--- /dev/null >+++ b/t/db_dependent/Koha/Template/Plugin/Notices.t >@@ -0,0 +1,64 @@ >+#!/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 => 6; >+ >+use C4::Context; >+use Koha::Database; >+use Koha::ItemTypes; >+ >+use t::lib::TestBuilder; >+use t::lib::Mocks; >+ >+BEGIN { >+ use_ok('Koha::Template::Plugin::Notices'); >+} >+ >+my $schema = Koha::Database->schema; >+my $builder = t::lib::TestBuilder->new; >+ >+$schema->storage->txn_begin; >+ >+my $plugin = Koha::Template::Plugin::Notices->new(); >+ok( $plugin, "initialized Notices plugin" ); >+ >+my $notice_templates = Koha::Notice::Templates->search(); >+ >+my $fetched_templates = $plugin->GetTemplates(undef); >+is( scalar @$fetched_templates, $notice_templates->count, "All templates returned when no parameters passed" ); >+ >+my $notice_A = $builder->build_object( >+ { >+ class => 'Koha::Notice::Templates', >+ value => {} >+ } >+); >+ >+$fetched_templates = $plugin->GetTemplates( $notice_A->module ); >+is( scalar @$fetched_templates, 1, "GetTemplates with module passed gets the one notice in new module" ); >+ >+is_deeply( @$fetched_templates[0]->unblessed, $notice_A->unblessed, 'The notice is correctly retrieved' ); >+ >+$notice_A->delete; >+ >+$fetched_templates = $plugin->GetTemplates( $notice_A->module ); >+is( scalar @$fetched_templates, 0, "No notice returned when invalid module passed" ); >+ >+$schema->storage->txn_rollback; >+ >+1; >-- >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 32986
:
146750
|
148267
|
148361
|
148374
|
148376
|
149506
|
149507
|
153479
|
153480
|
153481
|
153482
|
156800
|
158399
|
158400
|
158401
|
158402
|
158403
|
158404
|
158405
| 158523