Lines 19-25
Link Here
|
19 |
|
19 |
|
20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
21 |
|
21 |
|
22 |
use Test::More tests => 1; |
22 |
use Test::More tests => 3; |
23 |
|
23 |
|
24 |
use Koha::Illrequests; |
24 |
use Koha::Illrequests; |
25 |
|
25 |
|
Lines 48-50
subtest 'patron() tests' => sub {
Link Here
|
48 |
|
48 |
|
49 |
$schema->storage->txn_rollback; |
49 |
$schema->storage->txn_rollback; |
50 |
}; |
50 |
}; |
51 |
- |
51 |
|
|
|
52 |
subtest 'get_type_disclaimer_value() tests' => sub { |
53 |
|
54 |
plan tests => 2; |
55 |
|
56 |
$schema->storage->txn_begin; |
57 |
|
58 |
my $request = $builder->build_object( { class => 'Koha::Illrequests' } ); |
59 |
|
60 |
is( |
61 |
$request->get_type_disclaimer_value, undef, |
62 |
'get_type_disclaimer_value() returns undef if no get_type_disclaimer_value is set' |
63 |
); |
64 |
|
65 |
$builder->build_object( |
66 |
{ |
67 |
class => 'Koha::Illrequestattributes', |
68 |
value => { |
69 |
illrequest_id => $request->illrequest_id, |
70 |
type => 'type_disclaimer_value', |
71 |
value => 'Yes' |
72 |
} |
73 |
} |
74 |
); |
75 |
|
76 |
is( |
77 |
$request->get_type_disclaimer_value, "Yes", |
78 |
'get_type_disclaimer_value() returns the value if is set' |
79 |
); |
80 |
|
81 |
$schema->storage->txn_rollback; |
82 |
}; |
83 |
|
84 |
subtest 'get_type_disclaimer_date() tests' => sub { |
85 |
|
86 |
plan tests => 2; |
87 |
|
88 |
$schema->storage->txn_begin; |
89 |
|
90 |
my $request = $builder->build_object( { class => 'Koha::Illrequests' } ); |
91 |
|
92 |
is( |
93 |
$request->get_type_disclaimer_date, undef, |
94 |
'get_type_disclaimer_date() returns undef if no get_type_disclaimer_date is set' |
95 |
); |
96 |
|
97 |
$builder->build_object( |
98 |
{ |
99 |
class => 'Koha::Illrequestattributes', |
100 |
value => { |
101 |
illrequest_id => $request->illrequest_id, |
102 |
type => 'type_disclaimer_date', |
103 |
value => '2023-11-27T14:27:01' |
104 |
} |
105 |
} |
106 |
); |
107 |
|
108 |
is( |
109 |
$request->get_type_disclaimer_date, "2023-11-27T14:27:01", |
110 |
'get_type_disclaimer_date() returns the value if is set' |
111 |
); |
112 |
|
113 |
$schema->storage->txn_rollback; |
114 |
}; |