Lines 426-437
subtest 'guarantor checks on patron creation / update tests' => sub {
Link Here
|
426 |
$builder->build_object( { class => 'Koha::Patrons', value => { categorycode => $category->categorycode } } ); |
426 |
$builder->build_object( { class => 'Koha::Patrons', value => { categorycode => $category->categorycode } } ); |
427 |
|
427 |
|
428 |
subtest 'patron update tests' => sub { |
428 |
subtest 'patron update tests' => sub { |
429 |
plan tests => 4; |
429 |
plan tests => 7; |
430 |
ok( |
430 |
ok( |
431 |
$guarantee->add_guarantor( { guarantor_id => $guarantor->borrowernumber, relationship => 'guarantor' } ), |
431 |
$guarantee->add_guarantor( { guarantor_id => $guarantor->borrowernumber, relationship => 'guarantor' } ), |
432 |
"Relationship is added, no problem" |
432 |
"Relationship is added, no problem" |
433 |
); |
433 |
); |
434 |
is( $guarantor->guarantee_relationships->count, 1, 'Relationship added' ); |
434 |
is( $guarantor->is_guarantor, 1, 'Is a guarantor' ); |
|
|
435 |
is( $guarantor->is_guarantee, 0, 'Is no guarantee' ); |
436 |
is( $guarantee->is_guarantor, 0, 'Is no guarantor' ); |
437 |
is( $guarantee->is_guarantee, 1, 'Is a guarantee' ); |
438 |
|
435 |
ok( $guarantor->surname("Duck")->store(), "Updating guarantor is okay" ); |
439 |
ok( $guarantor->surname("Duck")->store(), "Updating guarantor is okay" ); |
436 |
ok( $guarantee->surname("Duck")->store(), "Updating guarantee is okay" ); |
440 |
ok( $guarantee->surname("Duck")->store(), "Updating guarantee is okay" ); |
437 |
}; |
441 |
}; |
438 |
- |
|
|