Bugzilla – Attachment 144517 Details for
Bug 32417
Cannot insert order: Mandatory parameter biblionumber is missing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32417: Add unit test
Bug-32417-Add-unit-test.patch (text/plain), 2.27 KB, created by
David Nind
on 2022-12-09 08:30:51 UTC
(
hide
)
Description:
Bug 32417: Add unit test
Filename:
MIME Type:
Creator:
David Nind
Created:
2022-12-09 08:30:51 UTC
Size:
2.27 KB
patch
obsolete
>From 70f893cfa1f23ac9403e4507954e94bde9a6f67c Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 7 Dec 2022 13:51:14 +0000 >Subject: [PATCH] Bug 32417: Add unit test > >Test plan: >Run t/db_dependent/Koha/Acquisition/Order.t >This test should fail without the follow-up and pass with it. >* not ok 53 - No croak on missing biblionumber when cancelling an order > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> > >Signed-off-by: David Nind <david@davidnind.com> >--- > t/db_dependent/Koha/Acquisition/Order.t | 23 ++++++++++++++++++++++- > 1 file changed, 22 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Acquisition/Order.t b/t/db_dependent/Koha/Acquisition/Order.t >index 26b6cd6856..bc5aa7ec32 100755 >--- a/t/db_dependent/Koha/Acquisition/Order.t >+++ b/t/db_dependent/Koha/Acquisition/Order.t >@@ -624,7 +624,7 @@ subtest 'filter_by_current & filter_by_cancelled' => sub { > > subtest 'cancel() tests' => sub { > >- plan tests => 52; >+ plan tests => 54; > > $schema->storage->txn_begin; > >@@ -915,5 +915,26 @@ subtest 'cancel() tests' => sub { > is( $messages[2]->message, 'error_delbiblio_items', 'Cannot delete on loan item' ); > is( $messages[2]->payload->{biblio}->id, $biblio_id, 'The right biblio is attached' ); > >+ # Call ->store with biblionumber NULL (as ->cancel does) >+ $item_1 = $builder->build_sample_item; >+ $biblio_id = $item_1->biblionumber; >+ $order= $builder->build_object({ >+ class => 'Koha::Acquisition::Orders', >+ value => { >+ orderstatus => 'new', >+ biblionumber => $biblio_id, >+ datecancellationprinted => undef, >+ cancellationreason => undef, >+ } >+ }); >+ my $columns = { >+ biblionumber => undef, >+ cancellationreason => $reason, >+ datecancellationprinted => \'NOW()', >+ orderstatus => 'cancelled', >+ }; >+ lives_ok { $order->set($columns)->store; } 'No croak on missing biblionumber when cancelling an order'; >+ throws_ok { $order->orderstatus('new')->store; } qr/Cannot insert order: Mandatory parameter biblionumber is missing/, 'Expected croak'; >+ > $schema->storage->txn_rollback; > }; >-- >2.30.2
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 32417
:
144467
|
144468
|
144514
|
144515
| 144517 |
144518