]> git.koha-community.org Git - koha.git/commit
Bug 28516: Prevent failures if borrower_attribute_types.mandatory=1
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 4 Jun 2021 13:36:59 +0000 (15:36 +0200)
committerFridolin Somers <fridolin.somers@biblibre.com>
Mon, 2 Aug 2021 20:16:11 +0000 (10:16 -1000)
commitcc0d0028e92ae07117b6307228ab88297b861512
tree39efa71737e230a0548a573a0f92e958d677d679
parentd7f9dfe8f34e03d7bd3cec1fc7946cfc2ba2614b
Bug 28516: Prevent failures if borrower_attribute_types.mandatory=1

TestBuilder will generate an integer for the
Koha::Patron::Attribute::Type object, but if 1 is picked some tests are
failing randomly
At least t/db_dependent/Koha/Patrons.t and t/db_dependent/Koha/Patrons/Import.t
The expection "Missing mandatory extended attribute" is raised when the
patron is stored.

Test plan:
The following script should return 0 when the patch is applied:

"""
use t::lib::TestBuilder;
my $builder = t::lib::TestBuilder->new;
my $x = $builder->build_object(
    {
        class => 'Koha::Patron::Attribute::Types',
    }
);
say $x->mandatory;
"""

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 7fef05b641520c08dbc14361fc813b62e220bbdc)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
t/lib/TestBuilder.pm