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

(-)a/t/db_dependent/Koha/CirculationRules.t (-2 / +26 lines)
Lines 33-39 my $schema = Koha::Database->new->schema; Link Here
33
my $builder = t::lib::TestBuilder->new;
33
my $builder = t::lib::TestBuilder->new;
34
34
35
subtest 'set_rule + get_effective_rule' => sub {
35
subtest 'set_rule + get_effective_rule' => sub {
36
    plan tests => 8;
36
    plan tests => 9;
37
37
38
    $schema->storage->txn_begin;
38
    $schema->storage->txn_begin;
39
39
Lines 102-107 subtest 'set_rule + get_effective_rule' => sub { Link Here
102
    is( $rule->rule_value, 1,
102
    is( $rule->rule_value, 1,
103
        'Default rule is returned if there is no rule for this branchcode' );
103
        'Default rule is returned if there is no rule for this branchcode' );
104
104
105
    subtest 'test rules that cannot be blank' => sub {
106
        plan tests => 3;
107
        foreach my $no_blank_rule ( ('holdallowed','hold_fulfillment_policy','returnbranch') ){
108
            Koha::CirculationRules->set_rule(
109
                {
110
                    branchcode   => $branchcode,
111
                    itemtype     => '*',
112
                    rule_name    => $no_blank_rule,
113
                    rule_value   => '',
114
                }
115
            );
116
117
            $rule = Koha::CirculationRules->get_effective_rule(
118
                {
119
                    branchcode   => $branchcode,
120
                    categorycode => undef,
121
                    itemtype     => undef,
122
                    rule_name    => $no_blank_rule,
123
                }
124
            );
125
            is( $rule, undef, 'Rules that cannot be blank are not set when passed blank string' );
126
        }
127
    };
128
129
105
    subtest 'test rule matching with different combinations of rule scopes' => sub {
130
    subtest 'test rule matching with different combinations of rule scopes' => sub {
106
        my ( $tests, $order ) = prepare_tests_for_rule_scope_combinations(
131
        my ( $tests, $order ) = prepare_tests_for_rule_scope_combinations(
107
            {
132
            {
108
- 

Return to bug 26529