View | Details | Raw Unified | Return to bug 28031
Collapse All | Expand All

(-)a/t/db_dependent/Koha/Patron/Attribute.t (-2 / +33 lines)
Lines 33-39 my $builder = t::lib::TestBuilder->new; Link Here
33
33
34
subtest 'store() tests' => sub {
34
subtest 'store() tests' => sub {
35
35
36
    plan tests => 3;
36
    plan tests => 4;
37
37
38
    subtest 'repeatable attributes tests' => sub {
38
    subtest 'repeatable attributes tests' => sub {
39
39
Lines 215-220 subtest 'store() tests' => sub { Link Here
215
215
216
        $schema->storage->txn_rollback;
216
        $schema->storage->txn_rollback;
217
    };
217
    };
218
219
    subtest 'Edit attribute tests for non-repeatable tests (Bug 28031)' => sub {
220
221
        plan tests => 1;
222
223
        my $patron = $builder->build_object({ class => 'Koha::Patrons' });
224
        my $non_repeatable_type = $builder->build_object(
225
            {
226
                class => 'Koha::Patron::Attribute::Types',
227
                value => {
228
                    mandatory     => 0,
229
                    repeatable    => 0,
230
                    unique_id     => 1,
231
                    category_code => undef
232
                }
233
            }
234
        );
235
236
        # Here we test the case of editing an already stored attribute
237
        my $non_repeatable_attr = $patron->add_extended_attribute(
238
            {
239
                code      => $non_repeatable_type->code,
240
                attribute => 'WOW'
241
            }
242
        );
243
244
        $non_repeatable_attr->set({ attribute => 'HEY' })
245
                        ->store
246
                        ->discard_changes;
247
248
        is( $non_repeatable_attr->attribute, 'HEY', 'Value stored correctly' );
249
    };
218
};
250
};
219
251
220
subtest 'type() tests' => sub {
252
subtest 'type() tests' => sub {
221
- 

Return to bug 28031