Bugzilla – Attachment 67065 Details for
Bug 10132
Add option to set MarcOrgCode on branch level
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10132: (QA followup) Organize tests in subtest
Bug-10132-QA-followup-Organize-tests-in-subtest.patch (text/plain), 2.42 KB, created by
Tomás Cohen Arazi
on 2017-09-11 19:16:30 UTC
(
hide
)
Description:
Bug 10132: (QA followup) Organize tests in subtest
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi
Created:
2017-09-11 19:16:30 UTC
Size:
2.42 KB
patch
obsolete
>From 484a36d7ffdde157999a91d64e147f88b66b0a09 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 11 Sep 2017 16:02:00 -0300 >Subject: [PATCH] Bug 10132: (QA followup) Organize tests in subtest > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/Koha/Libraries.t | 35 ++++++++++++++++++++++++++++++----- > 1 file changed, 30 insertions(+), 5 deletions(-) > >diff --git a/t/db_dependent/Koha/Libraries.t b/t/db_dependent/Koha/Libraries.t >index 3bf66ec..22c7047 100644 >--- a/t/db_dependent/Koha/Libraries.t >+++ b/t/db_dependent/Koha/Libraries.t >@@ -19,7 +19,7 @@ > > use Modern::Perl; > >-use Test::More tests => 11; >+use Test::More tests => 10; > > use Koha::Library; > use Koha::Libraries; >@@ -88,8 +88,33 @@ is( Koha::Libraries->search->count, $nb_of_libraries + 1, 'Delete should have de > $retrieved_category_2->delete; > is( Koha::LibraryCategories->search->count, $nb_of_categories + 2, 'Delete should have deleted the library category' ); > >-t::lib::Mocks::mock_preference('MARCOrgCode', 'US-Default'); >-is( $new_library_1->get_effective_marcorgcode, 'US-MyLib', 'If defined, use library\'s own marc org code'); >-is( $new_library_2->get_effective_marcorgcode, 'US-Default', 'If not defined library\' marc org code, use the one from system preferences'); >- > $schema->storage->txn_rollback; >+ >+subtest '->get_effective_marcorgcode' => sub { >+ >+ plan tests => 4; >+ >+ $schema->storage->txn_begin; >+ >+ my $library_1 = $builder->build_object({ class => 'Koha::Libraries', >+ value => { marcorgcode => 'US-MyLib' } }); >+ my $library_2 = $builder->build_object({ class => 'Koha::Libraries', >+ value => { marcorgcode => undef } }); >+ >+ t::lib::Mocks::mock_preference('MARCOrgCode', 'US-Default'); >+ >+ is( $library_1->get_effective_marcorgcode, 'US-MyLib', >+ 'If defined, use library\'s own marc org code'); >+ is( $library_2->get_effective_marcorgcode, 'US-Default', >+ 'If not defined library\' marc org code, use the one from system preferences'); >+ >+ t::lib::Mocks::mock_preference('MARCOrgCode', 'Blah'); >+ is( $library_2->get_effective_marcorgcode, 'Blah', >+ 'Fallback is always MARCOrgCode syspref'); >+ >+ $library_2->marcorgcode('ThisIsACode')->store(); >+ is( $library_2->get_effective_marcorgcode, 'ThisIsACode', >+ 'Pick library_2 code'); >+ >+ $schema->storage->txn_rollback; >+}; >-- >2.7.4
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 10132
:
64183
|
64184
|
64185
|
64186
|
64187
|
67060
|
67061
|
67062
|
67063
|
67064
| 67065 |
67066
|
67067
|
67208
|
67211