|
Lines 757-763
subtest 'is_superlibrarian() tests' => sub {
Link Here
|
| 757 |
|
757 |
|
| 758 |
subtest 'extended_attributes' => sub { |
758 |
subtest 'extended_attributes' => sub { |
| 759 |
|
759 |
|
| 760 |
plan tests => 16; |
760 |
plan tests => 17; |
| 761 |
|
761 |
|
| 762 |
my $schema = Koha::Database->new->schema; |
762 |
my $schema = Koha::Database->new->schema; |
| 763 |
$schema->storage->txn_begin; |
763 |
$schema->storage->txn_begin; |
|
Lines 1104-1114
subtest 'extended_attributes' => sub {
Link Here
|
| 1104 |
|
1104 |
|
| 1105 |
ok( $patron->extended_attributes([]), "We can set no attributes, mandatory attribute for other category not required"); |
1105 |
ok( $patron->extended_attributes([]), "We can set no attributes, mandatory attribute for other category not required"); |
| 1106 |
|
1106 |
|
| 1107 |
|
1107 |
$schema->storage->txn_rollback; |
| 1108 |
}; |
1108 |
}; |
| 1109 |
|
1109 |
|
|
|
1110 |
subtest 'attribute accessor tests' => sub { |
| 1111 |
plan tests => 2; |
| 1112 |
|
| 1113 |
$schema->storage->txn_begin; |
| 1114 |
|
| 1115 |
Koha::Patron::Attribute::Types->search->delete; |
| 1116 |
|
| 1117 |
my $attribute_type_1 = $builder->build_object( |
| 1118 |
{ |
| 1119 |
class => 'Koha::Patron::Attribute::Types', |
| 1120 |
value => { code => 'smartnumber', repeatable => 0 } |
| 1121 |
} |
| 1122 |
); |
| 1123 |
|
| 1124 |
my $patron = $builder->build_object({ class => 'Koha::Patrons' }); |
| 1125 |
|
| 1126 |
is( $patron->smartnumber, undef, 'smartnumber accessor returns undef when not set'); |
| 1127 |
|
| 1128 |
$patron->extended_attributes( |
| 1129 |
[ |
| 1130 |
{ code => 'smartnumber', attribute => 'SM1234' } |
| 1131 |
] |
| 1132 |
); |
| 1110 |
|
1133 |
|
|
|
1134 |
is( $patron->smartnumber, 'SM1234', 'smartnumber accessor returns value when set'); |
| 1111 |
|
1135 |
|
|
|
1136 |
$schema->storage->txn_rollback; |
| 1137 |
}; |
| 1112 |
}; |
1138 |
}; |
| 1113 |
|
1139 |
|
| 1114 |
subtest 'can_log_into() tests' => sub { |
1140 |
subtest 'can_log_into() tests' => sub { |
| 1115 |
- |
|
|