Lines 1465-1491
subtest 'is_child | is_adult' => sub {
Link Here
|
1465 |
); |
1465 |
); |
1466 |
$category = $builder->build_object( |
1466 |
$category = $builder->build_object( |
1467 |
{ |
1467 |
{ |
1468 |
class => 'Koha::Patron::Categories', |
1468 |
class => 'Koha::Patron::Categories', |
1469 |
value => { category_type => 'S' } |
1469 |
value => { category_type => 'S' } |
1470 |
} |
1470 |
} |
1471 |
); |
1471 |
); |
1472 |
my $patron_staff = $builder->build_object( |
1472 |
my $patron_staff = $builder->build_object( |
1473 |
{ |
1473 |
{ |
1474 |
class => 'Koha::Patrons', |
1474 |
class => 'Koha::Patrons', |
1475 |
value => { categorycode => $category->categorycode } |
1475 |
value => { categorycode => $category->categorycode } |
1476 |
} |
1476 |
} |
1477 |
); |
1477 |
); |
1478 |
is( $patron_adult->is_adult, 1, 'Patron from category A should be considered adult' ); |
1478 |
is( $patron_adult->is_adult, 1, 'Patron from category A should be considered adult' ); |
1479 |
is( $patron_adult_i->is_adult, 1, 'Patron from category I should be considered adult' ); |
1479 |
is( $patron_adult_i->is_adult, 1, 'Patron from category I should be considered adult' ); |
1480 |
is( $patron_child->is_adult, 0, 'Patron from category C should not be considered adult' ); |
1480 |
is( $patron_child->is_adult, 0, 'Patron from category C should not be considered adult' ); |
1481 |
is( $patron_other->is_adult, 0, 'Patron from category O should not be considered adult' ); |
1481 |
is( $patron_other->is_adult, 0, 'Patron from category O should not be considered adult' ); |
1482 |
is( $patron_staff->is_adult, 1, 'Patron from category S should be considered adult' ); |
1482 |
is( $patron_staff->is_adult, 1, 'Patron from category S should be considered adult' ); |
1483 |
|
1483 |
|
1484 |
is( $patron_adult->is_child, 0, 'Patron from category A should be considered child' ); |
1484 |
is( $patron_adult->is_child, 0, 'Patron from category A should be considered child' ); |
1485 |
is( $patron_adult_i->is_child, 0, 'Patron from category I should be considered child' ); |
1485 |
is( $patron_adult_i->is_child, 0, 'Patron from category I should be considered child' ); |
1486 |
is( $patron_child->is_child, 1, 'Patron from category C should not be considered child' ); |
1486 |
is( $patron_child->is_child, 1, 'Patron from category C should not be considered child' ); |
1487 |
is( $patron_other->is_child, 0, 'Patron from category O should not be considered child' ); |
1487 |
is( $patron_other->is_child, 0, 'Patron from category O should not be considered child' ); |
1488 |
is( $patron_staff->is_child, 0, 'Patron from category S should not be considered child' ); |
1488 |
is( $patron_staff->is_child, 0, 'Patron from category S should not be considered child' ); |
1489 |
|
1489 |
|
1490 |
# Clean up |
1490 |
# Clean up |
1491 |
$patron_adult->delete; |
1491 |
$patron_adult->delete; |
1492 |
- |
|
|