Bugzilla – Attachment 76287 Details for
Bug 18072
Add Koha objects for Branch Transfer Limits
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18072: (QA followup) Remove warning from tests
Bug-18072-QA-followup-Remove-warning-from-tests.patch (text/plain), 4.14 KB, created by
Kyle M Hall (khall)
on 2018-06-22 13:52:39 UTC
(
hide
)
Description:
Bug 18072: (QA followup) Remove warning from tests
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2018-06-22 13:52:39 UTC
Size:
4.14 KB
patch
obsolete
>From e74dadeffef80dfc588d5231fd25ab5daf673235 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 11 Sep 2017 15:22:49 -0300 >Subject: [PATCH] Bug 18072: (QA followup) Remove warning from tests > >This patch removes a warning from Items.t due to bad parameters. It also >makes the tests use Test::Exception. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/Koha/Biblios.t | 21 +++++++++++---------- > t/db_dependent/Koha/Items.t | 18 +++++++++++------- > 2 files changed, 22 insertions(+), 17 deletions(-) > >diff --git a/t/db_dependent/Koha/Biblios.t b/t/db_dependent/Koha/Biblios.t >index 0707e0c534..61f74331c1 100644 >--- a/t/db_dependent/Koha/Biblios.t >+++ b/t/db_dependent/Koha/Biblios.t >@@ -19,7 +19,8 @@ > > use Modern::Perl; > >-use Test::More tests => 4; >+use Test::More tests => 5; >+use Test::Exception; > > use C4::Biblio; > use C4::Items; >@@ -184,15 +185,15 @@ subtest 'can_be_transferred' => sub { > is($biblio->can_be_transferred({ to => $library2 }), 0, 'Given all of items' > .' of the biblio are from same, transfer limited library, then transfer' > .' is not possible.'); >- eval { $biblio->can_be_transferred({ to => undef }); }; >- is(ref($@), 'Koha::Exceptions::Library::NotFound', 'Exception thrown when no' >- .' library given.'); >- eval { $biblio->can_be_transferred({ to => 'heaven' }); }; >- is(ref($@), 'Koha::Exceptions::Library::NotFound', 'Exception thrown when' >- .' invalid library is given.'); >- eval { $biblio->can_be_transferred({ to => $library2, from => 'hell' }); }; >- is(ref($@), 'Koha::Exceptions::Library::NotFound', 'Exception thrown when' >- .' invalid library is given.'); >+ throws_ok { $biblio->can_be_transferred({ to => undef }); } >+ 'Koha::Exceptions::Library::NotFound', >+ 'Exception thrown when no library given.'; >+ throws_ok { $biblio->can_be_transferred({ to => 'heaven' }); } >+ 'Koha::Exceptions::Library::NotFound', >+ 'Exception thrown when invalid library is given.'; >+ throws_ok { $biblio->can_be_transferred({ to => $library2, from => 'hell' }); } >+ 'Koha::Exceptions::Library::NotFound', >+ 'Exception thrown when invalid library is given.'; > }; > > $schema->storage->txn_rollback; >diff --git a/t/db_dependent/Koha/Items.t b/t/db_dependent/Koha/Items.t >index 02272d219a..3d997b2f86 100644 >--- a/t/db_dependent/Koha/Items.t >+++ b/t/db_dependent/Koha/Items.t >@@ -20,6 +20,7 @@ > use Modern::Perl; > > use Test::More tests => 9; >+use Test::Exception; > > use C4::Circulation; > use Koha::Item; >@@ -156,14 +157,17 @@ subtest 'can_be_transferred' => sub { > })->count, 1, 'Given we have added a transfer limit,'); > is($item->can_be_transferred({ to => $library2 }), 0, > 'Item can no longer be transferred between libraries.'); >- is($item->can_be_transferred({ to => $library2, $library1 }), 0, >+ is($item->can_be_transferred({ to => $library2, from => $library1 }), 0, > 'We get the same result also if we pass the from-library parameter.'); >- eval { $item->can_be_transferred({ to => undef }); }; >- is(ref($@), 'Koha::Exceptions::Library::NotFound', 'Exception thrown when no library given.'); >- eval { $item->can_be_transferred({ to => 'heaven' }); }; >- is(ref($@), 'Koha::Exceptions::Library::NotFound', 'Exception thrown when invalid library is given.'); >- eval { $item->can_be_transferred({ to => $library2, from => 'hell' }); }; >- is(ref($@), 'Koha::Exceptions::Library::NotFound', 'Exception thrown when invalid library is given.'); >+ throws_ok { $item->can_be_transferred({ to => undef }); } >+ 'Koha::Exceptions::Library::NotFound', >+ 'Exception thrown when no library given.'; >+ throws_ok { $item->can_be_transferred({ to => 'heaven' }); } >+ 'Koha::Exceptions::Library::NotFound', >+ 'Exception thrown when invalid library is given.'; >+ throws_ok { $item->can_be_transferred({ to => $library2, from => 'hell' }); } >+ 'Koha::Exceptions::Library::NotFound', >+ 'Exception thrown when invalid library is given.'; > }; > > $retrieved_item_1->delete; >-- >2.15.2 (Apple Git-101.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 18072
:
59979
|
59980
|
59981
|
59982
|
60009
|
60010
|
60011
|
60116
|
60117
|
60782
|
60783
|
60784
|
63683
|
63684
|
63685
|
63686
|
63687
|
66724
|
67049
|
67050
|
67051
|
67052
|
67053
|
67054
|
67209
|
76282
|
76283
|
76284
|
76285
|
76286
|
76287
|
76288
|
76292
|
76293
|
76294
|
76295
|
76296
|
76297
|
76298