View | Details | Raw Unified | Return to bug 29958
Collapse All | Expand All

(-)a/t/db_dependent/Koha/Item.t (-2 / +25 lines)
Lines 1171-1177 subtest 'columns_to_str' => sub { Link Here
1171
1171
1172
subtest 'store() tests' => sub {
1172
subtest 'store() tests' => sub {
1173
1173
1174
    plan tests => 2;
1174
    plan tests => 3;
1175
1176
    subtest 'dateaccessioned handling' => sub {
1177
1178
        plan tests => 3;
1179
1180
        $schema->storage->txn_begin;
1181
1182
        my $item = $builder->build_sample_item;
1183
1184
        ok( defined $item->dateaccessioned, 'dateaccessioned is set' );
1185
1186
        # reset dateaccessioned on the DB
1187
        $schema->resultset('Item')->find({ itemnumber => $item->id })->update({ dateaccessioned => undef });
1188
        $item->discard_changes;
1189
1190
        ok( !defined $item->dateaccessioned );
1191
1192
        # update something
1193
        $item->replacementprice(100)->store->discard_changes;
1194
1195
        ok( !defined $item->dateaccessioned, 'dateaccessioned not set on update if undefined' );
1196
1197
        $schema->storage->txn_rollback;
1198
    };
1175
1199
1176
    subtest '_set_found_trigger() tests' => sub {
1200
    subtest '_set_found_trigger() tests' => sub {
1177
1201
1178
- 

Return to bug 29958