Bugzilla – Attachment 68928 Details for
Bug 7317
Add an Interlibrary Loan Module to Circulation and OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7317: (QA followup) Get rid of warnings from the tests
Bug-7317-QA-followup-Get-rid-of-warnings-from-the-.patch (text/plain), 7.28 KB, created by
Tomás Cohen Arazi (tcohen)
on 2017-11-03 19:07:01 UTC
(
hide
)
Description:
Bug 7317: (QA followup) Get rid of warnings from the tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2017-11-03 19:07:01 UTC
Size:
7.28 KB
patch
obsolete
>From 7e0d2d0edf29a468935f58cb528e8f933ee0c76c Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 1 Nov 2017 16:29:54 -0300 >Subject: [PATCH] Bug 7317: (QA followup) Get rid of warnings from the tests > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/Illrequest.pm | 19 +++++++++++++------ > t/db_dependent/Illrequests.t | 44 ++++++++++++++++++++++---------------------- > 2 files changed, 35 insertions(+), 28 deletions(-) > >diff --git a/Koha/Illrequest.pm b/Koha/Illrequest.pm >index 488fa46cd6..5f6ee12a45 100644 >--- a/Koha/Illrequest.pm >+++ b/Koha/Illrequest.pm >@@ -611,7 +611,8 @@ sub backend_create { > backend => $self->_backend->name > } > }; >- } elsif ( $params->{stage} eq 'copyrightclearance' ) { >+ } elsif ( defined $params->{stage} >+ && $params->{stage} eq 'copyrightclearance' ) { > $params->{stage} = 'init'; > } > >@@ -690,9 +691,13 @@ sub getLimits { > my ( $self, $params ) = @_; > my $limits = $self->_config->getLimitRules($params->{type}); > >- return $limits->{$params->{value}} >- || $limits->{default} >- || { count => -1, method => 'active' }; >+ if ( defined $params->{value} >+ && defined $limits->{$params->{value}} ) { >+ return $limits->{$params->{value}}; >+ } >+ else { >+ return $limits->{default} || { count => -1, method => 'active' }; >+ } > } > > =head3 getPrefix >@@ -884,8 +889,10 @@ EOF > } elsif ( 'draft' eq $params->{stage} ) { > # Create the to header > my $to = $params->{partners}; >- $to =~ s/^\x00//; # Strip leading NULLs >- $to =~ s/\x00/; /; # Replace others with '; ' >+ if ( defined $to ) { >+ $to =~ s/^\x00//; # Strip leading NULLs >+ $to =~ s/\x00/; /; # Replace others with '; ' >+ } > die "No target email addresses found. Either select at least one partner or check your ILL partner library records." if ( !$to ); > # Create the from, replyto and sender headers > my $from = $branch->branchemail; >diff --git a/t/db_dependent/Illrequests.t b/t/db_dependent/Illrequests.t >index 688d6d2881..fd5772fd4c 100644 >--- a/t/db_dependent/Illrequests.t >+++ b/t/db_dependent/Illrequests.t >@@ -220,20 +220,20 @@ subtest 'Backend testing (mocks)' => sub { > # the Dummy plugin installed. load_backend & available_backends don't > # currently have tests as a result. > >+ t::lib::Mocks->mock_config('interlibrary_loans', { backend_dir => 'a_dir' } ); > my $backend = Test::MockObject->new; > $backend->set_isa('Koha::Illbackends::Mock'); > $backend->set_always('name', 'Mock'); > > my $patron = $builder->build({ source => 'Borrower' }); >- my $illrq = $builder->build({ >- source => 'Illrequest', >+ my $illrq = $builder->build_object({ >+ class => 'Koha::Illrequests', > value => { borrowernumber => $patron->{borrowernumber} } > }); >- my $illrq_obj = Koha::Illrequests->find($illrq->{illrequest_id}); > >- $illrq_obj->_backend($backend); >+ $illrq->_backend($backend); > >- isa_ok($illrq_obj->_backend, 'Koha::Illbackends::Mock', >+ isa_ok($illrq->_backend, 'Koha::Illbackends::Mock', > "OK accessing mocked backend."); > > # _backend_capability tests: >@@ -245,15 +245,15 @@ subtest 'Backend testing (mocks)' => sub { > # functionality, such as unmediated in the BLDSS backend (also see > # bugzilla 18837). > $backend->set_always('capabilities', undef); >- is($illrq_obj->_backend_capability('Test'), 0, >+ is($illrq->_backend_capability('Test'), 0, > "0 returned on Mock not implementing capabilities."); > > $backend->set_always('capabilities', 0); >- is($illrq_obj->_backend_capability('Test'), 0, >+ is($illrq->_backend_capability('Test'), 0, > "0 returned on Mock not implementing Test capability."); > > $backend->set_always('capabilities', sub { return 'bar'; } ); >- is($illrq_obj->_backend_capability('Test'), 'bar', >+ is($illrq->_backend_capability('Test'), 'bar', > "'bar' returned on Mock implementing Test capability."); > > # metadata test: we need to be sure that we return the arbitrary values >@@ -270,10 +270,10 @@ subtest 'Backend testing (mocks)' => sub { > ); > > is_deeply( >- $illrq_obj->metadata, >+ $illrq->metadata, > { >- ID => $illrq_obj->illrequest_id, >- Title => $illrq_obj->patron->borrowernumber >+ ID => $illrq->illrequest_id, >+ Title => $illrq->patron->borrowernumber > }, > "Test metadata." > ); >@@ -282,7 +282,7 @@ subtest 'Backend testing (mocks)' => sub { > > # No backend graph extension > $backend->set_always('status_graph', {}); >- is_deeply($illrq_obj->capabilities('COMP'), >+ is_deeply($illrq->capabilities('COMP'), > { > prev_actions => [ 'REQ' ], > id => 'COMP', >@@ -293,10 +293,10 @@ subtest 'Backend testing (mocks)' => sub { > ui_method_icon => 'fa-check', > }, > "Dummy status graph for COMP."); >- is($illrq_obj->capabilities('UNKNOWN'), undef, >+ is($illrq->capabilities('UNKNOWN'), undef, > "Dummy status graph for UNKNOWN."); >- is_deeply($illrq_obj->capabilities(), >- $illrq_obj->_core_status_graph, >+ is_deeply($illrq->capabilities(), >+ $illrq->_core_status_graph, > "Dummy full status graph."); > # Simple backend graph extension > $backend->set_always('status_graph', >@@ -307,18 +307,18 @@ subtest 'Backend testing (mocks)' => sub { > next_actions => [ 'REQ' ], > }, > }); >- is_deeply($illrq_obj->capabilities('QER'), >+ is_deeply($illrq->capabilities('QER'), > { > prev_actions => [ 'REQ' ], > id => 'QER', > next_actions => [ 'REQ' ], > }, > "Simple status graph for QER."); >- is($illrq_obj->capabilities('UNKNOWN'), undef, >+ is($illrq->capabilities('UNKNOWN'), undef, > "Simple status graph for UNKNOWN."); >- is_deeply($illrq_obj->capabilities(), >- $illrq_obj->_status_graph_union( >- $illrq_obj->_core_status_graph, >+ is_deeply($illrq->capabilities(), >+ $illrq->_status_graph_union( >+ $illrq->_core_status_graph, > { > QER => { > prev_actions => [ 'REQ' ], >@@ -333,7 +333,7 @@ subtest 'Backend testing (mocks)' => sub { > > # No backend graph extension > $backend->set_always('status_graph', {}); >- is($illrq_obj->custom_capability('unknown', {}), 0, >+ is($illrq->custom_capability('unknown', {}), 0, > "Unknown candidate."); > > # Simple backend graph extension >@@ -348,7 +348,7 @@ subtest 'Backend testing (mocks)' => sub { > }); > $backend->mock('identity', > sub { my ( $self, $params ) = @_; return $params->{other}; }); >- is($illrq_obj->custom_capability('identity', { test => 1 })->{test}, 1, >+ is($illrq->custom_capability('identity', { test => 1, method => 'blah' })->{test}, 1, > "Resolve identity custom_capability"); > > $schema->storage->txn_rollback; >-- >2.15.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 7317
:
59893
|
59894
|
59895
|
59920
|
60485
|
60486
|
60487
|
60488
|
63081
|
63082
|
63083
|
63084
|
63085
|
63086
|
63087
|
63088
|
63089
|
63090
|
63113
|
63175
|
63176
|
63354
|
63421
|
63472
|
63475
|
65469
|
65470
|
65471
|
65472
|
65473
|
65474
|
65475
|
65476
|
66266
|
67242
|
67243
|
67244
|
67245
|
67246
|
67247
|
67248
|
67249
|
67250
|
67251
|
67252
|
67253
|
67254
|
67255
|
67256
|
67257
|
67258
|
67259
|
67260
|
67261
|
67262
|
67263
|
67264
|
67281
|
67282
|
67283
|
67284
|
67285
|
67286
|
67287
|
67288
|
67289
|
67290
|
67291
|
67292
|
67293
|
67294
|
67295
|
67296
|
67297
|
67298
|
67299
|
67300
|
67301
|
67302
|
67303
|
68185
|
68186
|
68328
|
68391
|
68406
|
68407
|
68408
|
68409
|
68418
|
68444
|
68445
|
68483
|
68484
|
68485
|
68487
|
68516
|
68517
|
68518
|
68519
|
68520
|
68521
|
68522
|
68523
|
68524
|
68525
|
68542
|
68543
|
68544
|
68545
|
68546
|
68547
|
68548
|
68549
|
68550
|
68551
|
68552
|
68558
|
68559
|
68560
|
68561
|
68562
|
68563
|
68564
|
68565
|
68566
|
68567
|
68858
|
68874
|
68877
|
68878
|
68885
|
68886
|
68921
|
68922
|
68926
|
68927
|
68928
|
68929
|
68931
|
68932
|
68933
|
68988
|
68989
|
68999
|
69000
|
69006
|
69008
|
69009
|
69012
|
69014
|
69044
|
69045
|
69046
|
69056
|
69059
|
69060
|
69061
|
69063
|
69064
|
69065
|
69066
|
69069
|
69070
|
69071
|
69074