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

(-)a/t/db_dependent/Koha/Ticket.t (-1 / +22 lines)
Lines 19-25 Link Here
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
21
22
use Test::More tests => 7;
22
use Test::More tests => 8;
23
use t::lib::TestBuilder;
23
use t::lib::TestBuilder;
24
use t::lib::Mocks;
24
use t::lib::Mocks;
25
25
Lines 51-56 subtest 'reporter() tests' => sub { Link Here
51
    $schema->storage->txn_rollback;
51
    $schema->storage->txn_rollback;
52
};
52
};
53
53
54
subtest 'assignee() tests' => sub {
55
56
    plan tests => 2;
57
58
    $schema->storage->txn_begin;
59
60
    my $patron = $builder->build_object( { class => 'Koha::Patrons' } );
61
    my $ticket = $builder->build_object(
62
        {
63
            class => 'Koha::Tickets',
64
            value => { assignee_id => $patron->id }
65
        }
66
    );
67
68
    my $assignee = $ticket->assignee;
69
    is( ref($assignee), 'Koha::Patron', 'Koha::Ticket->assignee returns a Koha::Patron object' );
70
    is( $assignee->id,  $patron->id,    'Koha::Ticket->assignee returns the right Koha::Patron' );
71
72
    $schema->storage->txn_rollback;
73
};
74
54
subtest 'resolver() tests' => sub {
75
subtest 'resolver() tests' => sub {
55
76
56
    plan tests => 2;
77
    plan tests => 2;
(-)a/t/db_dependent/Koha/Ticket/Update.t (-2 / +22 lines)
Lines 19-25 Link Here
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
21
22
use Test::More tests => 3;
22
use Test::More tests => 4;
23
use t::lib::TestBuilder;
23
use t::lib::TestBuilder;
24
24
25
use Koha::Database;
25
use Koha::Database;
Lines 73-78 subtest 'user() tests' => sub { Link Here
73
    $schema->storage->txn_rollback;
73
    $schema->storage->txn_rollback;
74
};
74
};
75
75
76
subtest 'assignee() tests' => sub {
77
78
    plan tests => 2;
79
80
    $schema->storage->txn_begin;
81
82
    my $assignee = $builder->build_object( { class => 'Koha::Patrons' } );
83
    my $update   = $builder->build_object(
84
        {
85
            class => 'Koha::Ticket::Updates',
86
            value => { assignee_id => $assignee->id }
87
        }
88
    );
89
90
    my $linked_assignee = $update->assignee;
91
    is( ref($linked_assignee), 'Koha::Patron', 'Koha::Ticket::Update->assignee returns a Koha::Patron object' );
92
    is( $linked_assignee->id,  $assignee->id,  'Koha::Ticket::Update->assignee returns the right Koha::Patron' );
93
94
    $schema->storage->txn_rollback;
95
};
96
76
subtest 'strings_map() tests' => sub {
97
subtest 'strings_map() tests' => sub {
77
    plan tests => 16;
98
    plan tests => 16;
78
99
79
- 

Return to bug 35657