Lines 1-6
Link Here
|
1 |
#!/usr/bin/perl |
1 |
#!/usr/bin/perl |
2 |
|
2 |
|
3 |
# Copyright 2017 Koha Development team |
3 |
# Copyright 2018 Koha Development team |
4 |
# |
4 |
# |
5 |
# This file is part of Koha |
5 |
# This file is part of Koha |
6 |
# |
6 |
# |
Lines 19-25
Link Here
|
19 |
|
19 |
|
20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
21 |
|
21 |
|
22 |
use Test::More tests => 3; |
22 |
use Test::More tests => 4; |
23 |
use t::lib::TestBuilder; |
23 |
use t::lib::TestBuilder; |
24 |
use t::lib::Mocks; |
24 |
use t::lib::Mocks; |
25 |
|
25 |
|
Lines 78-80
subtest 'create_items + effective_create_items tests' => sub {
Link Here
|
78 |
|
78 |
|
79 |
$schema->storage->txn_rollback; |
79 |
$schema->storage->txn_rollback; |
80 |
}; |
80 |
}; |
81 |
- |
81 |
|
|
|
82 |
subtest 'basket_group' => sub { |
83 |
plan tests => 2; |
84 |
|
85 |
$schema->storage->txn_begin; |
86 |
my $b = $builder->build_object( |
87 |
{ |
88 |
class => 'Koha::Acquisition::Baskets', |
89 |
value => { basketgroupid => undef }, # not linked to a basketgroupid |
90 |
} |
91 |
); |
92 |
|
93 |
my $basket = Koha::Acquisition::Baskets->find( $b->basketno ); |
94 |
is( $basket->basket_group, undef, |
95 |
'->basket_group should return undef if not linked to a basket group'); |
96 |
|
97 |
$b = $builder->build_object( |
98 |
{ |
99 |
class => 'Koha::Acquisition::Baskets', |
100 |
# Will be linked to a basket group by TestBuilder |
101 |
} |
102 |
); |
103 |
|
104 |
$basket = Koha::Acquisition::Baskets->find( $b->basketno ); |
105 |
is( ref( $basket->basket_group ), 'Koha::Acquisition::BasketGroup', |
106 |
'->basket_group should return a Koha::Acquisition::BasketGroup object if linked to a basket group'); |
107 |
|
108 |
$schema->storage->txn_rollback; |
109 |
}; |