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

(-)a/t/db_dependent/Koha/Item.t (-2 / +28 lines)
Lines 3356-3367 subtest 'current_branchtransfers relationship' => sub { Link Here
3356
3356
3357
subtest 'location_update_trigger() tests' => sub {
3357
subtest 'location_update_trigger() tests' => sub {
3358
3358
3359
    plan tests => 12;
3359
    plan tests => 18;
3360
3360
3361
    $schema->storage->txn_begin;
3361
    $schema->storage->txn_begin;
3362
3362
3363
    my $location           = 'YA';
3363
    my $location           = 'YA';
3364
    my $permanent_location = 'HEY';
3364
    my $permanent_location = 'HEY';
3365
    my $another_location   = 'SAUNA';
3365
3366
3366
    foreach my $action (qw{ checkin checkout }) {
3367
    foreach my $action (qw{ checkin checkout }) {
3367
3368
Lines 3416-3421 subtest 'location_update_trigger() tests' => sub { Link Here
3416
            $item->location, $permanent_location,
3417
            $item->location, $permanent_location,
3417
            q{_PERM_ does the job"}
3418
            q{_PERM_ does the job"}
3418
        );
3419
        );
3420
3421
        t::lib::Mocks::mock_preference(
3422
            $pref,
3423
            qq{$location: $another_location\n_BLANK_: $permanent_location\n_DEFAULT_: $location }
3424
        );
3425
        $item->location($location)->store;
3426
        $item->location_update_trigger($action);
3427
        is(
3428
            $item->location, $another_location,
3429
            qq{'location' value set from '$location' to '$another_location' with setting `$location: $another_location`}
3430
        );
3431
3432
        $item->location('')->store;
3433
        $item->location_update_trigger($action);
3434
        is(
3435
            $item->location, $permanent_location,
3436
            qq{'location' value set from '' to '$permanent_location' with setting `_BLANK_: $permanent_location`}
3437
        );
3438
3439
        $item->location($permanent_location)->store;
3440
        $item->location_update_trigger($action);
3441
        is(
3442
            $item->location, $location,
3443
            qq{'location' value set from '$permanent_location' to '$location' with setting `_DEFAULT_: $location`}
3444
        );
3445
3419
    }
3446
    }
3420
3447
3421
    $schema->storage->txn_rollback;
3448
    $schema->storage->txn_rollback;
3422
- 

Return to bug 29326