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

(-)a/t/db_dependent/Illrequestattributes.t (-13 / +27 lines)
Lines 30-36 use_ok('Koha::Illrequestattributes'); Link Here
30
30
31
subtest 'Basic object tests' => sub {
31
subtest 'Basic object tests' => sub {
32
32
33
    plan tests => 5;
33
    plan tests => 6;
34
34
35
    $schema->storage->txn_begin;
35
    $schema->storage->txn_begin;
36
36
Lines 38-62 subtest 'Basic object tests' => sub { Link Here
38
38
39
    my $builder = t::lib::TestBuilder->new;
39
    my $builder = t::lib::TestBuilder->new;
40
40
41
    my $illrqattr = $builder->build({ source => 'Illrequestattribute' });
41
    my $illrqattr = $builder->build( { source => 'Illrequestattribute' } );
42
42
43
    my $illrqattr_obj = Koha::Illrequestattributes->find(
43
    my $illrqattr_obj = Koha::Illrequestattributes->find(
44
        $illrqattr->{illrequest_id},
44
        $illrqattr->{illrequest_id},
45
        $illrqattr->{backend},
45
        $illrqattr->{type}
46
        $illrqattr->{type}
46
    );
47
    );
47
    isa_ok($illrqattr_obj, 'Koha::Illrequestattribute',
48
    isa_ok(
48
        "Correctly create and load an illrequestattribute object.");
49
        $illrqattr_obj, 'Koha::Illrequestattribute',
49
    is($illrqattr_obj->illrequest_id, $illrqattr->{illrequest_id},
50
        "Correctly create and load an illrequestattribute object."
50
       "Illrequest_id getter works.");
51
    );
51
    is($illrqattr_obj->type, $illrqattr->{type},
52
    is(
52
       "Type getter works.");
53
        $illrqattr_obj->illrequest_id, $illrqattr->{illrequest_id},
53
    is($illrqattr_obj->value, $illrqattr->{value},
54
        "Illrequest_id getter works."
54
       "Value getter works.");
55
    );
56
    is(
57
        $illrqattr_obj->backend, $illrqattr->{backend},
58
        "Backend getter works."
59
    );
60
    is(
61
        $illrqattr_obj->type, $illrqattr->{type},
62
        "Type getter works."
63
    );
64
    is(
65
        $illrqattr_obj->value, $illrqattr->{value},
66
        "Value getter works."
67
    );
55
68
56
    $illrqattr_obj->delete;
69
    $illrqattr_obj->delete;
57
70
58
    is(Koha::Illrequestattributes->search->count, 0,
71
    is(
59
        "No attributes found after delete.");
72
        Koha::Illrequestattributes->search->count, 0,
73
        "No attributes found after delete."
74
    );
60
75
61
    $schema->storage->txn_rollback;
76
    $schema->storage->txn_rollback;
62
};
77
};
63
- 

Return to bug 33970