|
Lines 30-36
my $builder = t::lib::TestBuilder->new;
Link Here
|
| 30 |
|
30 |
|
| 31 |
subtest "store() tests" => sub { |
31 |
subtest "store() tests" => sub { |
| 32 |
|
32 |
|
| 33 |
plan tests => 8; |
33 |
plan tests => 11; |
| 34 |
|
34 |
|
| 35 |
$schema->storage->txn_begin; |
35 |
$schema->storage->txn_begin; |
| 36 |
|
36 |
|
|
Lines 61-66
subtest "store() tests" => sub {
Link Here
|
| 61 |
'Koha::Exceptions::Checkouts::ReturnClaims::NoCreatedBy', |
61 |
'Koha::Exceptions::Checkouts::ReturnClaims::NoCreatedBy', |
| 62 |
'Exception thrown correctly'; |
62 |
'Exception thrown correctly'; |
| 63 |
|
63 |
|
|
|
64 |
my $nullified_created_by = $builder->build_object( |
| 65 |
{ |
| 66 |
class => 'Koha::Checkouts::ReturnClaims', |
| 67 |
value => { |
| 68 |
created_by => undef |
| 69 |
} |
| 70 |
} |
| 71 |
); |
| 72 |
|
| 73 |
is( $nullified_created_by->created_by, undef, 'Is undef' ); |
| 74 |
ok( $nullified_created_by->in_storage, 'In storage' ); |
| 75 |
is( |
| 76 |
ref($nullified_created_by->notes('Some other note')->store), |
| 77 |
'Koha::Checkouts::ReturnClaim', |
| 78 |
'No exception, store success' |
| 79 |
); |
| 80 |
|
| 64 |
is( Koha::Checkouts::ReturnClaims->search({ issue_id => $checkout->id })->count, 0, 'No claims stored' ); |
81 |
is( Koha::Checkouts::ReturnClaims->search({ issue_id => $checkout->id })->count, 0, 'No claims stored' ); |
| 65 |
|
82 |
|
| 66 |
my $claim = Koha::Checkouts::ReturnClaim->new( |
83 |
my $claim = Koha::Checkouts::ReturnClaim->new( |
| 67 |
- |
|
|