Lines 105-110
subtest 'constraints' => sub {
Link Here
|
105 |
} |
105 |
} |
106 |
); |
106 |
); |
107 |
|
107 |
|
|
|
108 |
my $nonexistent_borrowernumber = $patron->borrowernumber; |
108 |
# suggestedby |
109 |
# suggestedby |
109 |
$patron->delete; |
110 |
$patron->delete; |
110 |
$suggestion = $suggestion->get_from_storage; |
111 |
$suggestion = $suggestion->get_from_storage; |
Lines 124-130
subtest 'constraints' => sub {
Link Here
|
124 |
"The suggestion is not deleted when the related branch is deleted" ); |
125 |
"The suggestion is not deleted when the related branch is deleted" ); |
125 |
|
126 |
|
126 |
# managerid |
127 |
# managerid |
127 |
throws_ok { $suggestion->managedby(1029384756)->store; } |
128 |
throws_ok { $suggestion->managedby($nonexistent_borrowernumber)->store; } |
128 |
'Koha::Exceptions::Object::FKConstraint', |
129 |
'Koha::Exceptions::Object::FKConstraint', |
129 |
'store raises an exception on invalid managerid'; |
130 |
'store raises an exception on invalid managerid'; |
130 |
my $manager = $builder->build_object( { class => "Koha::Patrons" } ); |
131 |
my $manager = $builder->build_object( { class => "Koha::Patrons" } ); |
Lines 135-141
subtest 'constraints' => sub {
Link Here
|
135 |
"The suggestion is not deleted when the related manager is deleted" ); |
136 |
"The suggestion is not deleted when the related manager is deleted" ); |
136 |
|
137 |
|
137 |
# acceptedby |
138 |
# acceptedby |
138 |
throws_ok { $suggestion->acceptedby(1029384756)->store; } |
139 |
throws_ok { $suggestion->acceptedby($nonexistent_borrowernumber)->store; } |
139 |
'Koha::Exceptions::Object::FKConstraint', |
140 |
'Koha::Exceptions::Object::FKConstraint', |
140 |
'store raises an exception on invalid acceptedby id'; |
141 |
'store raises an exception on invalid acceptedby id'; |
141 |
my $acceptor = $builder->build_object( { class => "Koha::Patrons" } ); |
142 |
my $acceptor = $builder->build_object( { class => "Koha::Patrons" } ); |
Lines 146-152
subtest 'constraints' => sub {
Link Here
|
146 |
"The suggestion is not deleted when the related acceptor is deleted" ); |
147 |
"The suggestion is not deleted when the related acceptor is deleted" ); |
147 |
|
148 |
|
148 |
# rejectedby |
149 |
# rejectedby |
149 |
throws_ok { $suggestion->rejectedby(1029384756)->store; } |
150 |
throws_ok { $suggestion->rejectedby($nonexistent_borrowernumber)->store; } |
150 |
'Koha::Exceptions::Object::FKConstraint', |
151 |
'Koha::Exceptions::Object::FKConstraint', |
151 |
'store raises an exception on invalid rejectedby id'; |
152 |
'store raises an exception on invalid rejectedby id'; |
152 |
my $rejecter = $builder->build_object( { class => "Koha::Patrons" } ); |
153 |
my $rejecter = $builder->build_object( { class => "Koha::Patrons" } ); |
Lines 157-163
subtest 'constraints' => sub {
Link Here
|
157 |
"The suggestion is not deleted when the related rejecter is deleted" ); |
158 |
"The suggestion is not deleted when the related rejecter is deleted" ); |
158 |
|
159 |
|
159 |
# budgetid |
160 |
# budgetid |
160 |
throws_ok { $suggestion->budgetid(1029384756)->store; } |
161 |
throws_ok { $suggestion->budgetid($nonexistent_borrowernumber)->store; } |
161 |
'Koha::Exceptions::Object::FKConstraint', |
162 |
'Koha::Exceptions::Object::FKConstraint', |
162 |
'store raises an exception on invalid budgetid'; |
163 |
'store raises an exception on invalid budgetid'; |
163 |
my $fund = $builder->build_object( { class => "Koha::Acquisition::Funds" } ); |
164 |
my $fund = $builder->build_object( { class => "Koha::Acquisition::Funds" } ); |
164 |
- |
|
|