Bug 28031: Regression tests
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
e453ff963a
commit
f382fafae0
1 changed files with 33 additions and 1 deletions
|
@ -33,7 +33,7 @@ my $builder = t::lib::TestBuilder->new;
|
|||
|
||||
subtest 'store() tests' => sub {
|
||||
|
||||
plan tests => 3;
|
||||
plan tests => 4;
|
||||
|
||||
subtest 'repeatable attributes tests' => sub {
|
||||
|
||||
|
@ -215,6 +215,38 @@ subtest 'store() tests' => sub {
|
|||
|
||||
$schema->storage->txn_rollback;
|
||||
};
|
||||
|
||||
subtest 'Edit attribute tests for non-repeatable tests (Bug 28031)' => sub {
|
||||
|
||||
plan tests => 1;
|
||||
|
||||
my $patron = $builder->build_object({ class => 'Koha::Patrons' });
|
||||
my $non_repeatable_type = $builder->build_object(
|
||||
{
|
||||
class => 'Koha::Patron::Attribute::Types',
|
||||
value => {
|
||||
mandatory => 0,
|
||||
repeatable => 0,
|
||||
unique_id => 1,
|
||||
category_code => undef
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
# Here we test the case of editing an already stored attribute
|
||||
my $non_repeatable_attr = $patron->add_extended_attribute(
|
||||
{
|
||||
code => $non_repeatable_type->code,
|
||||
attribute => 'WOW'
|
||||
}
|
||||
);
|
||||
|
||||
$non_repeatable_attr->set({ attribute => 'HEY' })
|
||||
->store
|
||||
->discard_changes;
|
||||
|
||||
is( $non_repeatable_attr->attribute, 'HEY', 'Value stored correctly' );
|
||||
};
|
||||
};
|
||||
|
||||
subtest 'type() tests' => sub {
|
||||
|
|
Loading…
Reference in a new issue