|
Lines 499-508
subtest 'extended_attributes' => sub {
Link Here
|
| 499 |
#$limited_value = $patron_1->get_extended_attribute( $attribute_type_limited->code ); |
499 |
#$limited_value = $patron_1->get_extended_attribute( $attribute_type_limited->code ); |
| 500 |
#is( $limited_value, undef, ); |
500 |
#is( $limited_value, undef, ); |
| 501 |
|
501 |
|
|
|
502 |
$schema->storage->txn_rollback; |
| 503 |
|
| 502 |
subtest 'non-repeatable attributes tests' => sub { |
504 |
subtest 'non-repeatable attributes tests' => sub { |
| 503 |
|
505 |
|
| 504 |
plan tests => 3; |
506 |
plan tests => 3; |
| 505 |
|
507 |
|
|
|
508 |
$schema->storage->txn_begin; |
| 509 |
|
| 506 |
my $patron = $builder->build_object({ class => 'Koha::Patrons' }); |
510 |
my $patron = $builder->build_object({ class => 'Koha::Patrons' }); |
| 507 |
my $attribute_type = $builder->build_object( |
511 |
my $attribute_type = $builder->build_object( |
| 508 |
{ |
512 |
{ |
|
Lines 526-537
subtest 'extended_attributes' => sub {
Link Here
|
| 526 |
'Exception thrown on non-repeatable attribute'; |
530 |
'Exception thrown on non-repeatable attribute'; |
| 527 |
|
531 |
|
| 528 |
is( $patron->extended_attributes->count, 0, 'Extended attributes storing rolled back' ); |
532 |
is( $patron->extended_attributes->count, 0, 'Extended attributes storing rolled back' ); |
|
|
533 |
|
| 534 |
$schema->storage->txn_rollback; |
| 535 |
|
| 529 |
}; |
536 |
}; |
| 530 |
|
537 |
|
| 531 |
subtest 'unique attributes tests' => sub { |
538 |
subtest 'unique attributes tests' => sub { |
| 532 |
|
539 |
|
| 533 |
plan tests => 5; |
540 |
plan tests => 5; |
| 534 |
|
541 |
|
|
|
542 |
$schema->storage->txn_begin; |
| 543 |
|
| 535 |
my $patron_1 = $builder->build_object({ class => 'Koha::Patrons' }); |
544 |
my $patron_1 = $builder->build_object({ class => 'Koha::Patrons' }); |
| 536 |
my $patron_2 = $builder->build_object({ class => 'Koha::Patrons' }); |
545 |
my $patron_2 = $builder->build_object({ class => 'Koha::Patrons' }); |
| 537 |
|
546 |
|
|
Lines 573-584
subtest 'extended_attributes' => sub {
Link Here
|
| 573 |
|
582 |
|
| 574 |
is( $patron_1->extended_attributes->count, 2, 'Extended attributes stored' ); |
583 |
is( $patron_1->extended_attributes->count, 2, 'Extended attributes stored' ); |
| 575 |
is( $patron_2->extended_attributes->count, 0, 'Extended attributes storing rolled back' ); |
584 |
is( $patron_2->extended_attributes->count, 0, 'Extended attributes storing rolled back' ); |
|
|
585 |
|
| 586 |
$schema->storage->txn_rollback; |
| 587 |
|
| 576 |
}; |
588 |
}; |
| 577 |
|
589 |
|
| 578 |
subtest 'invalid type attributes tests' => sub { |
590 |
subtest 'invalid type attributes tests' => sub { |
| 579 |
|
591 |
|
| 580 |
plan tests => 3; |
592 |
plan tests => 3; |
| 581 |
|
593 |
|
|
|
594 |
$schema->storage->txn_begin; |
| 595 |
|
| 582 |
my $patron = $builder->build_object({ class => 'Koha::Patrons' }); |
596 |
my $patron = $builder->build_object({ class => 'Koha::Patrons' }); |
| 583 |
|
597 |
|
| 584 |
my $attribute_type_1 = $builder->build_object( |
598 |
my $attribute_type_1 = $builder->build_object( |
|
Lines 612-623
subtest 'extended_attributes' => sub {
Link Here
|
| 612 |
'Exception thrown on invalid attribute type'; |
626 |
'Exception thrown on invalid attribute type'; |
| 613 |
|
627 |
|
| 614 |
is( $patron->extended_attributes->count, 0, 'Extended attributes storing rolled back' ); |
628 |
is( $patron->extended_attributes->count, 0, 'Extended attributes storing rolled back' ); |
|
|
629 |
|
| 630 |
$schema->storage->txn_rollback; |
| 631 |
|
| 615 |
}; |
632 |
}; |
| 616 |
|
633 |
|
| 617 |
subtest 'globally mandatory attributes tests' => sub { |
634 |
subtest 'globally mandatory attributes tests' => sub { |
| 618 |
|
635 |
|
| 619 |
plan tests => 5; |
636 |
plan tests => 5; |
| 620 |
|
637 |
|
|
|
638 |
$schema->storage->txn_begin; |
| 639 |
|
| 621 |
my $patron = $builder->build_object({ class => 'Koha::Patrons' }); |
640 |
my $patron = $builder->build_object({ class => 'Koha::Patrons' }); |
| 622 |
|
641 |
|
| 623 |
my $attribute_type_1 = $builder->build_object( |
642 |
my $attribute_type_1 = $builder->build_object( |
|
Lines 658-664
subtest 'extended_attributes' => sub {
Link Here
|
| 658 |
); |
677 |
); |
| 659 |
|
678 |
|
| 660 |
is( $patron->extended_attributes->count, 1, 'Extended attributes succeeded' ); |
679 |
is( $patron->extended_attributes->count, 1, 'Extended attributes succeeded' ); |
|
|
680 |
|
| 681 |
$schema->storage->txn_rollback; |
| 682 |
|
| 661 |
}; |
683 |
}; |
| 662 |
|
684 |
|
| 663 |
$schema->storage->txn_rollback; |
|
|
| 664 |
}; |
685 |
}; |
| 665 |
- |
|
|