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 t::lib::TestBuilder; |
24 |
use t::lib::TestBuilder; |
25 |
use t::lib::Mocks; |
25 |
use t::lib::Mocks; |
Lines 57-62
subtest 'basket() tests' => sub {
Link Here
|
57 |
$schema->storage->txn_rollback; |
57 |
$schema->storage->txn_rollback; |
58 |
}; |
58 |
}; |
59 |
|
59 |
|
|
|
60 |
subtest 'biblio() tests' => sub { |
61 |
|
62 |
plan tests => 3; |
63 |
|
64 |
$schema->storage->txn_begin; |
65 |
|
66 |
my $order = $builder->build_object( |
67 |
{ |
68 |
class => 'Koha::Acquisition::Orders', |
69 |
value => { biblionumber => undef } |
70 |
} |
71 |
); |
72 |
|
73 |
is( $order->biblio, undef, 'If no linked biblio, undef is returned' ); |
74 |
|
75 |
# Add and link a biblio to the order |
76 |
my $biblio = $builder->build_sample_biblio(); |
77 |
$order->set({ biblionumber => $biblio->biblionumber })->store->discard_changes; |
78 |
|
79 |
my $THE_biblio = $order->biblio; |
80 |
is( ref($THE_biblio), 'Koha::Biblio', 'Returns a Koha::Biblio object' ); |
81 |
is( $THE_biblio->biblionumber, $biblio->biblionumber, 'It is not cheating about the object' ); |
82 |
|
83 |
$schema->storage->txn_rollback; |
84 |
}; |
85 |
|
60 |
subtest 'store' => sub { |
86 |
subtest 'store' => sub { |
61 |
plan tests => 1; |
87 |
plan tests => 1; |
62 |
|
88 |
|
63 |
- |
|
|