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

(-)a/t/db_dependent/Koha/Acquisition/Fund.t (-1 / +14 lines)
Lines 19-25 Link Here
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
21
22
use Test::More tests => 2;
22
use Test::More tests => 3;
23
23
24
use t::lib::TestBuilder;
24
use t::lib::TestBuilder;
25
25
Lines 43-48 subtest 'to_api() tests' => sub { Link Here
43
    $schema->storage->txn_rollback;
43
    $schema->storage->txn_rollback;
44
};
44
};
45
45
46
subtest 'budget ()' => sub {
47
    plan tests => 1;
48
49
    $schema->storage->txn_begin;
50
51
    my $budget = $builder->build_object({ class => 'Koha::Acquisition::Budgets' });
52
    my $fund = $builder->build_object({ class => 'Koha::Acquisition::Funds', value => { budget_period_id => $budget->budget_period_id } });
53
54
    is($budget->budget_period_id, $fund->budget->budget_period_id, 'Fund\'s budget retrieved correctly');
55
56
    $schema->storage->txn_rollback;
57
};
58
46
subtest 'budget' => sub {
59
subtest 'budget' => sub {
47
    plan tests => 1;
60
    plan tests => 1;
48
61
(-)a/t/db_dependent/Koha/Acquisition/Order.t (-2 / +16 lines)
Lines 19-26 Link Here
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
21
22
use Test::More tests => 12;
22
use Test::More tests => 13;
23
use Test::Exception;
24
23
25
use t::lib::TestBuilder;
24
use t::lib::TestBuilder;
26
use t::lib::Mocks;
25
use t::lib::Mocks;
Lines 622-627 subtest 'filter_by_current & filter_by_cancelled' => sub { Link Here
622
    $schema->storage->txn_rollback;
621
    $schema->storage->txn_rollback;
623
};
622
};
624
623
624
subtest 'creator ()' => sub {
625
    plan tests => 1;
626
627
    $schema->storage->txn_begin;
628
629
    my $patron = $builder->build_object({ class => 'Koha::Patrons' });
630
    my $order = $builder->build_object({ class => 'Koha::Acquisition::Orders', value => { created_by => $patron->borrowernumber } });
631
632
    my $creator = $order->creator;
633
634
    is($creator->borrowernumber, $patron->borrowernumber, 'Patron is order creator');
635
636
    $schema->storage->txn_rollback;
637
};
638
625
subtest 'cancel() tests' => sub {
639
subtest 'cancel() tests' => sub {
626
640
627
    plan tests => 54;
641
    plan tests => 54;
(-)a/t/db_dependent/Koha/Item.t (-2 / +34 lines)
Lines 20-26 Link Here
20
use Modern::Perl;
20
use Modern::Perl;
21
use utf8;
21
use utf8;
22
22
23
use Test::More tests => 28;
23
use Test::More tests => 29;
24
use Test::Exception;
24
use Test::Exception;
25
use Test::MockModule;
25
use Test::MockModule;
26
26
Lines 33-38 use Koha::Database; Link Here
33
use Koha::DateUtils qw( dt_from_string );
33
use Koha::DateUtils qw( dt_from_string );
34
use Koha::Old::Items;
34
use Koha::Old::Items;
35
use Koha::Recalls;
35
use Koha::Recalls;
36
use Koha::AuthorisedValueCategories;
37
use Koha::AuthorisedValues;
36
38
37
use List::MoreUtils qw(all);
39
use List::MoreUtils qw(all);
38
40
Lines 2163-2165 subtest 'is_denied_renewal' => sub { Link Here
2163
2165
2164
    $schema->storage->txn_rollback;
2166
    $schema->storage->txn_rollback;
2165
};
2167
};
2166
- 
2168
2169
subtest '_fetch_authorised_values' => sub {
2170
    plan tests => 1;
2171
2172
    $schema->storage->txn_begin;
2173
2174
    # Delete all Authorised Values of 'Countries' category
2175
    Koha::AuthorisedValues->search({category => 'Countries'})->delete;
2176
    Koha::AuthorisedValueCategories->search({category_name => 'Countries'})->delete;
2177
2178
    # Create 'Countries' category and authorised value
2179
    my $cat = $builder->build_object({ class => 'Koha::AuthorisedValueCategories'});
2180
    my $country = $builder->build_object({ class => 'Koha::AuthorisedValues', value => { category => $cat->category_name } });
2181
2182
    # Create a new biblio framework
2183
    my $fw = $builder->build_object({ class => 'Koha::BiblioFrameworks' });
2184
2185
    # Add a Marc subfield with kohafield setted to 'items.itemnote'
2186
    $builder->build_object({class => 'Koha::MarcSubfieldStructures', value => {frameworkcode => $fw->frameworkcode, authorised_value => $cat->category_name, kohafield => 'items.itemnotes'}});
2187
2188
    # Create biblio and item
2189
    my $biblio = $builder->build_sample_biblio({frameworkcode => $fw->frameworkcode});
2190
    my $item = $builder->build_sample_item({biblionumber => $biblio->biblionumber, itemnotes => $country->authorised_value});
2191
2192
    # Fetch authorised values
2193
    my $avs = $item->_fetch_authorised_values();
2194
2195
    is($avs->{itemnotes}->{lib}, $country->lib, 'Fetched auhtorised value is ok');
2196
2197
    $schema->storage->txn_rollback;
2198
};

Return to bug 8179