'set_attribute_types',
'prepare_columns',
'set_column_keys',
- 'set_patron_attributes',
+ 'generate_patron_attributes',
'check_branch_code',
'format_dates',
);
my $attr_type_3 = $patrons_import->set_attribute_types($params_3);
# Then ...
- isa_ok($attr_type_3, 'C4::Members::AttributeTypes');
- is($attr_type_3->{code}, $code_3, 'Got the expected code attribute type from set attribute types');
+ isa_ok($attr_type_3, 'Koha::Patron::Attribute::Type');
+ is($attr_type_3->code, $code_3, 'Got the expected code attribute type from set attribute types');
};
subtest 'test_set_column_keys' => sub {
is(scalar @columnkeys_1, @columns - 1 + $extended, 'Got the expected array size from set column keys with extended');
};
-subtest 'test_set_patron_attributes' => sub {
+subtest 'test_generate_patron_attributes' => sub {
plan tests => 13;
# Given ... nothing at all
# When ... Then ...
- my $result_0 = $patrons_import->set_patron_attributes(undef, undef, undef);
+ my $result_0 = $patrons_import->generate_patron_attributes(undef, undef, undef);
is($result_0, undef, 'Got the expected undef from set patron attributes with nothing');
# Given ... not extended.
my $extended_1 = 0;
# When ... Then ...
- my $result_1 = $patrons_import->set_patron_attributes($extended_1, undef, undef);
+ my $result_1 = $patrons_import->generate_patron_attributes($extended_1, undef, undef);
is($result_1, undef, 'Got the expected undef from set patron attributes with not extended');
# Given ... NO patrons attributes
my @feedback_2;
# When ...
- my $result_2 = $patrons_import->set_patron_attributes($extended_2, $patron_attributes_2, \@feedback_2);
+ my $result_2 = $patrons_import->generate_patron_attributes($extended_2, $patron_attributes_2, \@feedback_2);
# Then ...
is($result_2, undef, 'Got the expected undef from set patron attributes with no patrons attributes');
my @feedback_3;
# When ...
- my $result_3 = $patrons_import->set_patron_attributes($extended_2, $patron_attributes_3, \@feedback_3);
+ my $result_3 = $patrons_import->generate_patron_attributes($extended_2, $patron_attributes_3, \@feedback_3);
# Then ...
ok($result_3, 'Got some data back from set patron attributes');
is($result_3->[0]->{code}, 'grade', 'Got the expected first code from set patron attributes');
- is($result_3->[0]->{value}, '01', 'Got the expected first value from set patron attributes');
+ is($result_3->[0]->{attribute}, '01', 'Got the expected first value from set patron attributes');
is($result_3->[1]->{code}, 'homeroom', 'Got the expected second code from set patron attributes');
- is($result_3->[1]->{value}, 1150605, 'Got the expected second value from set patron attributes');
+ is($result_3->[1]->{attribute}, 1150605, 'Got the expected second value from set patron attributes');
is(scalar @feedback_3, 1, 'Got the expected 1 array size from set patron attributes with extended user');
is($feedback_3[0]->{feedback}, 1, 'Got the expected second feedback from set patron attributes with extended user');