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 590-595 subtest 'filter_by_current & filter_by_cancelled' => sub { Link Here
590
    $schema->storage->txn_rollback;
589
    $schema->storage->txn_rollback;
591
};
590
};
592
591
592
subtest 'creator ()' => sub {
593
    plan tests => 1;
594
595
    $schema->storage->txn_begin;
596
597
    my $patron = $builder->build_object({ class => 'Koha::Patrons' });
598
    my $order = $builder->build_object({ class => 'Koha::Acquisition::Orders', value => { created_by => $patron->borrowernumber } });
599
600
    my $creator = $order->creator;
601
602
    is($creator->borrowernumber, $patron->borrowernumber, 'Patron is order creator');
603
604
    $schema->storage->txn_rollback;
605
};
606
593
subtest 'cancel() tests' => sub {
607
subtest 'cancel() tests' => sub {
594
608
595
    plan tests => 52;
609
    plan tests => 52;
(-)a/t/db_dependent/Koha/Item.t (-2 / +34 lines)
Lines 19-25 Link Here
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
21
22
use Test::More tests => 7;
22
use Test::More tests => 8;
23
23
24
use C4::Biblio;
24
use C4::Biblio;
25
use C4::Circulation;
25
use C4::Circulation;
Lines 27-32 use C4::Circulation; Link Here
27
use Koha::Items;
27
use Koha::Items;
28
use Koha::Database;
28
use Koha::Database;
29
use Koha::Old::Items;
29
use Koha::Old::Items;
30
use Koha::AuthorisedValueCategories;
31
use Koha::AuthorisedValues;
30
32
31
use List::MoreUtils qw(all);
33
use List::MoreUtils qw(all);
32
34
Lines 628-630 subtest 'Tests for itemtype' => sub { Link Here
628
630
629
    $schema->storage->txn_rollback;
631
    $schema->storage->txn_rollback;
630
};
632
};
631
- 
633
634
subtest '_fetch_authorised_values' => sub {
635
    plan tests => 1;
636
637
    $schema->storage->txn_begin;
638
639
    # Delete all Authorised Values of 'Countries' category
640
    Koha::AuthorisedValues->search({category => 'Countries'})->delete;
641
    Koha::AuthorisedValueCategories->search({category_name => 'Countries'})->delete;
642
643
    # Create 'Countries' category and authorised value
644
    my $cat = $builder->build_object({ class => 'Koha::AuthorisedValueCategories'});
645
    my $country = $builder->build_object({ class => 'Koha::AuthorisedValues', value => { category => $cat->category_name } });
646
647
    # Create a new biblio framework
648
    my $fw = $builder->build_object({ class => 'Koha::BiblioFrameworks' });
649
650
    # Add a Marc subfield with kohafield setted to 'items.itemnote'
651
    $builder->build_object({class => 'Koha::MarcSubfieldStructures', value => {frameworkcode => $fw->frameworkcode, authorised_value => $cat->category_name, kohafield => 'items.itemnotes'}});
652
653
    # Create biblio and item
654
    my $biblio = $builder->build_sample_biblio({frameworkcode => $fw->frameworkcode});
655
    my $item = $builder->build_sample_item({biblionumber => $biblio->biblionumber, itemnotes => $country->authorised_value});
656
657
    # Fetch authorised values
658
    my $avs = $item->_fetch_authorised_values();
659
660
    is($avs->{itemnotes}->{lib}, $country->lib, 'Fetched auhtorised value is ok');
661
662
    $schema->storage->txn_rollback;
663
}

Return to bug 8179