Lines 33-39
use Koha::AuthorisedValues;
Link Here
|
33 |
use t::lib::Mocks; |
33 |
use t::lib::Mocks; |
34 |
use t::lib::TestBuilder; |
34 |
use t::lib::TestBuilder; |
35 |
|
35 |
|
36 |
use Test::More tests => 15; |
36 |
use Test::More tests => 14; |
37 |
|
37 |
|
38 |
use Test::Warn; |
38 |
use Test::Warn; |
39 |
|
39 |
|
Lines 126-156
subtest 'General Add, Get and Del tests' => sub {
Link Here
|
126 |
$schema->storage->txn_rollback; |
126 |
$schema->storage->txn_rollback; |
127 |
}; |
127 |
}; |
128 |
|
128 |
|
129 |
subtest 'ModItem tests' => sub { |
|
|
130 |
plan tests => 6; |
131 |
|
132 |
$schema->storage->txn_begin; |
133 |
|
134 |
my $builder = t::lib::TestBuilder->new; |
135 |
my $item = $builder->build_sample_item(); |
136 |
|
137 |
my @fields = qw( itemlost withdrawn damaged ); |
138 |
for my $field (@fields) { |
139 |
my $field_on = $field."_on"; |
140 |
|
141 |
$item->$field(1)->store; |
142 |
$item->discard_changes; |
143 |
is( output_pref({ str => $item->$field_on, dateonly => 1 }), output_pref({ dt => dt_from_string(), dateonly => 1 }), "When updating $field, $field_on is updated" ); |
144 |
|
145 |
$item->$field(0)->store; |
146 |
$item->discard_changes; |
147 |
is( $item->$field_on, undef, "When clearing $field, $field_on is cleared" ); |
148 |
} |
149 |
|
150 |
$schema->storage->txn_rollback; |
151 |
|
152 |
}; |
153 |
|
154 |
subtest 'ModItemTransfer tests' => sub { |
129 |
subtest 'ModItemTransfer tests' => sub { |
155 |
plan tests => 8; |
130 |
plan tests => 8; |
156 |
|
131 |
|
157 |
- |
|
|