Bugzilla – Attachment 107236 Details for
Bug 20469
Add item status to staff article requests form
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20469: Add test for ItemTypes plugin
Bug-20469-Add-test-for-ItemTypes-plugin.patch (text/plain), 2.28 KB, created by
Marcel de Rooy
on 2020-07-23 12:43:18 UTC
(
hide
)
Description:
Bug 20469: Add test for ItemTypes plugin
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2020-07-23 12:43:18 UTC
Size:
2.28 KB
patch
obsolete
>From 22c30fe5a018b8558257914bfb4b7b7de43d8d26 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 23 Jul 2020 13:58:45 +0200 >Subject: [PATCH] Bug 20469: Add test for ItemTypes plugin >Content-Type: text/plain; charset=utf-8 > >Test plan: >Run the test. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/db_dependent/Template/Plugin/ItemTypes.t | 44 ++++++++++++++++++++++++++++++ > 1 file changed, 44 insertions(+) > create mode 100644 t/db_dependent/Template/Plugin/ItemTypes.t > >diff --git a/t/db_dependent/Template/Plugin/ItemTypes.t b/t/db_dependent/Template/Plugin/ItemTypes.t >new file mode 100644 >index 0000000000..8d2030de5a >--- /dev/null >+++ b/t/db_dependent/Template/Plugin/ItemTypes.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 t::lib::TestBuilder; >+use t::lib::Mocks; >+ >+use Koha::Database; >+use Koha::Template::Plugin::ItemTypes; >+ >+my $schema = Koha::Database->schema; >+our $builder = t::lib::TestBuilder->new; >+$schema->storage->txn_begin; >+ >+subtest 'Notforloan' => sub { >+ plan tests => 3; >+ >+ my $itemtype1 = $builder->build_object({ class => 'Koha::ItemTypes' }); >+ my $itemtype2 = $builder->build_object({ class => 'Koha::ItemTypes' }); >+ $itemtype2->notforloan(1)->store; >+ >+ my $template_plugin = Koha::Template::Plugin::ItemTypes->new; >+ >+ is( $template_plugin->Notforloan('SHOULD_NOT_BE_THERE'), undef, 'Undefined when not found' ); >+ is( $template_plugin->Notforloan($itemtype1->itemtype), 0, 'Itemtype 1 not set' ); >+ is( $template_plugin->Notforloan($itemtype2->itemtype), 1, 'Itemtype 2 set' ); >+}; >+ >+$schema->storage->txn_rollback; >-- >2.11.0
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 20469
:
73281
|
73282
|
73388
|
76627
|
76628
|
76630
|
76631
|
77184
|
77185
|
77186
|
77222
|
77223
|
77224
|
107235
|
107236
|
107412
|
107413
|
107417
|
107418
|
107419
|
108345
|
108346
|
108347