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

(-)a/t/db_dependent/AuthorisedValues.t (-3 / +33 lines)
Lines 143-150 is_deeply( Link Here
143
    'categories must be ordered by category names'
143
    'categories must be ordered by category names'
144
);
144
);
145
145
146
subtest 'search_by_*_field + find_by_koha_field + get_description' => sub {
146
subtest 'search_by_*_field + find_by_koha_field + get_description + authorised_values' => sub {
147
    plan tests => 5;
147
    plan tests => 6;
148
148
149
    my $test_cat = Koha::AuthorisedValueCategories->find('TEST');
149
    my $test_cat = Koha::AuthorisedValueCategories->find('TEST');
150
    $test_cat->delete if $test_cat;
150
    $test_cat->delete if $test_cat;
Lines 252-257 subtest 'search_by_*_field + find_by_koha_field + get_description' => sub { Link Here
252
            ],
252
            ],
253
        );
253
        );
254
    };
254
    };
255
    subtest 'authorised_values' => sub {
256
257
        plan tests => 2;
258
259
        $schema->storage->txn_begin;
260
261
        my $authorised_value_category =
262
        $builder->build_object(
263
            {
264
                class => 'Koha::AuthorisedValueCategories',
265
                value => {
266
                    category_name => 'test_avs'
267
                }
268
            }
269
        );
270
271
        is( $authorised_value_category->authorised_values->count, 0, "no authorised values yet" );
272
273
        my $av1 = Koha::AuthorisedValue->new(
274
            {
275
                category         => 'test_avs',
276
                authorised_value => 'value 1',
277
                lib              => 'display value 1',
278
                lib_opac         => 'opac display value 1',
279
                imageurl         => 'image1.png',
280
            }
281
        )->store();
282
        is( $authorised_value_category->authorised_values->count, 1, "one authorised value" );
283
284
        $schema->storage->txn_rollback;
285
    };
255
};
286
};
256
287
257
$schema->storage->txn_rollback;
288
$schema->storage->txn_rollback;
258
- 

Return to bug 32997