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

(-)a/t/db_dependent/SIP/Message.t (-18 / +2 lines)
Lines 122-130 subtest 'UseLocationAsAQInSIP syspref tests' => sub { Link Here
122
    my $builder = t::lib::TestBuilder->new();
122
    my $builder = t::lib::TestBuilder->new();
123
123
124
    my $branchcode = $builder->build({ source => 'Branch' })->{branchcode};
124
    my $branchcode = $builder->build({ source => 'Branch' })->{branchcode};
125
    my $branchcode_permanent_location = $builder->build({ source => 'Branch' })->{branchcode};
126
127
    my $mocks = create_mocks( \$branchcode, \$branchcode_permanent_location );
128
125
129
    t::lib::Mocks::mock_preference('UseLocationAsAQInSIP', 0);
126
    t::lib::Mocks::mock_preference('UseLocationAsAQInSIP', 0);
130
127
Lines 136-142 subtest 'UseLocationAsAQInSIP syspref tests' => sub { Link Here
136
            restricted    => 0,
133
            restricted    => 0,
137
            homebranch    => $branchcode,
134
            homebranch    => $branchcode,
138
            holdingbranch => $branchcode,
135
            holdingbranch => $branchcode,
139
            permanent_location => $branchcode_permanent_location
136
            permanent_location => "PERMANENT_LOCATION"
140
        }
137
        }
141
    );
138
    );
142
139
Lines 145-164 subtest 'UseLocationAsAQInSIP syspref tests' => sub { Link Here
145
142
146
    t::lib::Mocks::mock_preference('UseLocationAsAQInSIP', 1);
143
    t::lib::Mocks::mock_preference('UseLocationAsAQInSIP', 1);
147
144
148
    $item = $builder->build_sample_item(
149
        {
150
            damaged       => 0,
151
            withdrawn     => 0,
152
            itemlost      => 0,
153
            restricted    => 0,
154
            homebranch    => $branchcode,
155
            holdingbranch => $branchcode,
156
            permanent_location => $branchcode_permanent_location
157
        }
158
    );
159
160
    $sip_item = C4::SIP::ILS::Item->new( $item->barcode );
145
    $sip_item = C4::SIP::ILS::Item->new( $item->barcode );
161
    is( $sip_item->permanent_location, $branchcode_permanent_location, "When UseLocationAsAQInSIP is set SIP item has permanent_location set to value of item permanent_location" );
146
    is( $sip_item->permanent_location, "PERMANENT_LOCATION", "When UseLocationAsAQInSIP is set SIP item has permanent_location set to value of item permanent_location" );
162
147
163
    $schema->storage->txn_rollback;
148
    $schema->storage->txn_rollback;
164
};
149
};
165
- 

Return to bug 20058