Lines 90-111
subtest 'store() tests' => sub {
Link Here
|
90 |
} |
90 |
} |
91 |
); |
91 |
); |
92 |
|
92 |
|
93 |
$SIG{__WARN__} = sub {}; # FIXME: PrintError = 0 not working! |
93 |
{ |
94 |
|
94 |
local *STDERR; |
95 |
throws_ok |
95 |
open STDERR, '>', '/dev/null'; |
96 |
{ $relationship_2->store; } |
96 |
throws_ok |
97 |
'Koha::Exceptions::Patron::Relationship::DuplicateRelationship', |
97 |
{ $relationship_2->store; } |
98 |
'Exception is thrown for duplicated relationship'; |
98 |
'Koha::Exceptions::Patron::Relationship::DuplicateRelationship', |
99 |
|
99 |
'Exception is thrown for duplicated relationship'; |
100 |
is( "$@", |
100 |
|
101 |
"There already exists a relationship for the same guarantor (" |
101 |
is( "$@", |
102 |
. $patron_2->borrowernumber |
102 |
"There already exists a relationship for the same guarantor (" |
103 |
. ") and guarantee (" |
103 |
. $patron_2->borrowernumber |
104 |
. $patron_1->borrowernumber |
104 |
. ") and guarantee (" |
105 |
. ") combination", |
105 |
. $patron_1->borrowernumber |
106 |
'Exception stringified correctly' |
106 |
. ") combination", |
107 |
); |
107 |
'Exception stringified correctly' |
108 |
|
108 |
); |
|
|
109 |
} |
109 |
|
110 |
|
110 |
$schema->storage->txn_rollback; |
111 |
$schema->storage->txn_rollback; |
111 |
}; |
112 |
}; |
112 |
- |
|
|