]> 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)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 23 Jun 2021 12:56:53 +0000 (14:56 +0200)
commitfbecb78ca9a9ae19b465b36d1398dd3ca09b840b
tree4d4f9e3b7af12f2a58f91eabe1abfbbe96056467
parent2678d6a4bc480e166d5b1c9e9bc1f1f45ddf6197
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>
t/lib/TestBuilder.pm