Bugzilla – Attachment 85634 Details for
Bug 22363
Move C4::Logs::GetLogs to Koha namespace
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22363: Add tests
Bug-22363-Add-tests.patch (text/plain), 2.58 KB, created by
Katrin Fischer
on 2019-02-25 18:22:00 UTC
(
hide
)
Description:
Bug 22363: Add tests
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2019-02-25 18:22:00 UTC
Size:
2.58 KB
patch
obsolete
>From bf54aebe290d97e30e3e54f6e52f29dc3c43f853 Mon Sep 17 00:00:00 2001 >From: Josef Moravec <josef.moravec@gmail.com> >Date: Mon, 18 Feb 2019 14:01:44 +0000 >Subject: [PATCH] Bug 22363: Add tests > >Signed-off-by: Andrew Isherwood <andrew.isherwood@ptfs-europe.com> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > t/db_dependent/Koha/ActionLogs.t | 70 ++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 70 insertions(+) > create mode 100644 t/db_dependent/Koha/ActionLogs.t > >diff --git a/t/db_dependent/Koha/ActionLogs.t b/t/db_dependent/Koha/ActionLogs.t >new file mode 100644 >index 0000000000..894c8afd5d >--- /dev/null >+++ b/t/db_dependent/Koha/ActionLogs.t >@@ -0,0 +1,70 @@ >+#!/usr/bin/perl >+# This file is part of Koha. >+# >+# Copyright 2019 Koha Development Team >+# >+# 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 => 3; >+ >+use C4::Context; >+use C4::Log; >+use Koha::Database; >+ >+use t::lib::TestBuilder; >+ >+BEGIN { >+ use_ok('Koha::ActionLogs'); >+} >+ >+my $schema = Koha::Database->new->schema; >+my $builder = t::lib::TestBuilder->new; >+ >+subtest 'store() tests' => sub { >+ plan tests => 2; >+ >+ $schema->storage->txn_begin; >+ >+ my $logs_count = Koha::ActionLogs->count; >+ my $log = Koha::ActionLog->new({ >+ module => 'CIRCULATION', >+ action => 'ISSUE', >+ interface => 'intranet', >+ })->store; >+ $log->discard_changes; >+ >+ is( ref($log), 'Koha::ActionLog', 'Log object creation success'); >+ is( Koha::ActionLogs->count, $logs_count + 1, 'Exactly one log was saved'); >+ >+ $schema->storage->txn_rollback; >+}; >+ >+subtest 'search() tests' => sub { >+ plan tests => 1; >+ >+ $schema->storage->txn_begin; >+ >+ my $patron1 = $builder->build_object({ >+ class => 'Koha::Patrons', >+ }); >+ >+ logaction("MEMBERS", "MODIFY", $patron1->borrowernumber, "test"); >+ >+ is(Koha::ActionLogs->search({ object => $patron1->borrowernumber })->count, 1, 'search() return right number of action logs'); >+ >+ $schema->storage->txn_rollback; >+}; >+ >+1; >-- >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 22363
:
85248
|
85249
|
85250
|
85253
|
85254
|
85261
|
85594
|
85595
|
85596
|
85597
|
85632
|
85633
|
85634
|
85635
|
85636
|
85637
|
85749
|
85750
|
85751
|
85752
|
85753