Bugzilla – Attachment 99577 Details for
Bug 24722
reserves.priority must be NOT NULL
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24722: Add test
Bug-24722-Add-test.patch (text/plain), 1.81 KB, created by
Jonathan Druart
on 2020-02-25 11:23:25 UTC
(
hide
)
Description:
Bug 24722: Add test
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-02-25 11:23:25 UTC
Size:
1.81 KB
patch
obsolete
>From 9219d97b453e2e85155e0bb84bd179551f5a9df7 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 25 Feb 2020 12:15:21 +0100 >Subject: [PATCH] Bug 24722: Add test > >--- > t/db_dependent/Koha/Holds.t | 28 ++++++++++++++++++++++++++-- > 1 file changed, 26 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Koha/Holds.t b/t/db_dependent/Koha/Holds.t >index c8b967946d..055dd18d11 100644 >--- a/t/db_dependent/Koha/Holds.t >+++ b/t/db_dependent/Koha/Holds.t >@@ -1,6 +1,6 @@ > #!/usr/bin/perl > >-# Copyright 2017 Koha Development team >+# Copyright 2020 Koha Development team > # > # This file is part of Koha > # >@@ -19,7 +19,7 @@ > > use Modern::Perl; > >-use Test::More tests => 1; >+use Test::More tests => 2; > use Test::Warn; > > use C4::Reserves; >@@ -34,6 +34,30 @@ $schema->storage->txn_begin; > > my $builder = t::lib::TestBuilder->new; > >+subtest 'DB constraints' => sub { >+ plan tests => 1; >+ >+ my $patron = $builder->build_object({ class => 'Koha::Patrons' }); >+ my $item = $builder->build_sample_item; >+ my $hold_info = { >+ branchcode => $patron->branchcode, >+ borrowernumber => $patron->borrowernumber, >+ biblionumber => $item->biblionumber, >+ priority => 1, >+ title => "title for fee", >+ itemnumber => $item->itemnumber, >+ }; >+ >+ my $reserve_id = C4::Reserves::AddReserve($hold_info); >+ my $hold = Koha::Holds->find( $reserve_id ); >+ >+ warning_like { >+ eval { $hold->priority(undef)->store } >+ } >+ qr{.*DBD::mysql::st execute failed: Column 'priority' cannot be null.*}, >+ 'DBD should have raised an error about priority that cannot be null'; >+}; >+ > subtest 'cancel' => sub { > plan tests => 12; > my $biblioitem = $builder->build_object( { class => 'Koha::Biblioitems' } ); >-- >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 24722
:
99572
|
99576
|
99577
|
99578
|
99595
|
99596
|
99597
|
99642
|
100822
|
100823
|
100824
|
100825
|
100860
|
100945
|
100946