|
Lines 153-159
subtest 'get_effective_issuing_rule' => sub {
Link Here
|
| 153 |
}; |
153 |
}; |
| 154 |
|
154 |
|
| 155 |
subtest 'set_rule' => sub { |
155 |
subtest 'set_rule' => sub { |
| 156 |
plan tests => 3; |
156 |
plan tests => 4; |
| 157 |
|
157 |
|
| 158 |
$schema->storage->txn_begin; |
158 |
$schema->storage->txn_begin; |
| 159 |
|
159 |
|
|
Lines 205-211
subtest 'set_rule' => sub {
Link Here
|
| 205 |
branchcode => $branchcode, |
205 |
branchcode => $branchcode, |
| 206 |
categorycode => $categorycode, |
206 |
categorycode => $categorycode, |
| 207 |
itemtype => $itemtype, |
207 |
itemtype => $itemtype, |
| 208 |
rule_name => 'fine', |
208 |
rule_name => 'article_requests', |
| 209 |
rule_value => '', |
209 |
rule_value => '', |
| 210 |
} ); |
210 |
} ); |
| 211 |
}, 'setting fine with branch/category/itemtype succeeds' ); |
211 |
}, 'setting fine with branch/category/itemtype succeeds' ); |
|
Lines 300-305
subtest 'set_rule' => sub {
Link Here
|
| 300 |
}, qr/categorycode/, 'setting holdallowed with categorycode fails' ); |
300 |
}, qr/categorycode/, 'setting holdallowed with categorycode fails' ); |
| 301 |
}; |
301 |
}; |
| 302 |
|
302 |
|
|
|
303 |
subtest 'Call with badly formatted params' => sub { |
| 304 |
plan tests => 4; |
| 305 |
|
| 306 |
Koha::CirculationRules->delete; |
| 307 |
|
| 308 |
foreach my $monetary_rule ( ( 'article_request_fee', 'fine', 'overduefinescap', 'recall_overdue_fine' ) ) { |
| 309 |
throws_ok( |
| 310 |
sub { |
| 311 |
Koha::CirculationRules->set_rule( |
| 312 |
{ |
| 313 |
branchcode => '*', |
| 314 |
itemtype => '*', |
| 315 |
rule_name => $monetary_rule, |
| 316 |
rule_value => '10,00', |
| 317 |
} |
| 318 |
); |
| 319 |
}, |
| 320 |
qr//, |
| 321 |
"setting $monetary_rule fails when passed value is not decimal" |
| 322 |
); |
| 323 |
} |
| 324 |
}; |
| 325 |
|
| 303 |
$schema->storage->txn_rollback; |
326 |
$schema->storage->txn_rollback; |
| 304 |
}; |
327 |
}; |
| 305 |
|
328 |
|
| 306 |
- |
|
|