Lines 806-812
subtest 'is_superlibrarian() tests' => sub {
Link Here
|
806 |
|
806 |
|
807 |
subtest 'extended_attributes' => sub { |
807 |
subtest 'extended_attributes' => sub { |
808 |
|
808 |
|
809 |
plan tests => 16; |
809 |
plan tests => 17; |
810 |
|
810 |
|
811 |
my $schema = Koha::Database->new->schema; |
811 |
my $schema = Koha::Database->new->schema; |
812 |
$schema->storage->txn_begin; |
812 |
$schema->storage->txn_begin; |
Lines 1190-1200
subtest 'extended_attributes' => sub {
Link Here
|
1190 |
|
1190 |
|
1191 |
ok( $patron->extended_attributes([]), "We can set no attributes, mandatory attribute for other category not required"); |
1191 |
ok( $patron->extended_attributes([]), "We can set no attributes, mandatory attribute for other category not required"); |
1192 |
|
1192 |
|
1193 |
|
1193 |
$schema->storage->txn_rollback; |
1194 |
}; |
1194 |
}; |
1195 |
|
1195 |
|
|
|
1196 |
subtest 'attribute accessor tests' => sub { |
1197 |
plan tests => 2; |
1198 |
|
1199 |
$schema->storage->txn_begin; |
1200 |
|
1201 |
Koha::Patron::Attribute::Types->search->delete; |
1202 |
|
1203 |
my $attribute_type_1 = $builder->build_object( |
1204 |
{ |
1205 |
class => 'Koha::Patron::Attribute::Types', |
1206 |
value => { code => 'smartnumber', repeatable => 0 } |
1207 |
} |
1208 |
); |
1209 |
|
1210 |
my $patron = $builder->build_object({ class => 'Koha::Patrons' }); |
1211 |
|
1212 |
is( $patron->smartnumber, undef, 'smartnumber accessor returns undef when not set'); |
1213 |
|
1214 |
$patron->extended_attributes( |
1215 |
[ |
1216 |
{ code => 'smartnumber', attribute => 'SM1234' } |
1217 |
] |
1218 |
); |
1196 |
|
1219 |
|
|
|
1220 |
is( $patron->smartnumber, 'SM1234', 'smartnumber accessor returns value when set'); |
1197 |
|
1221 |
|
|
|
1222 |
$schema->storage->txn_rollback; |
1223 |
}; |
1198 |
}; |
1224 |
}; |
1199 |
|
1225 |
|
1200 |
subtest 'can_log_into() tests' => sub { |
1226 |
subtest 'can_log_into() tests' => sub { |
1201 |
- |
|
|