|
Lines 33-39
my $builder = t::lib::TestBuilder->new;
Link Here
|
| 33 |
|
33 |
|
| 34 |
subtest 'store() tests' => sub { |
34 |
subtest 'store() tests' => sub { |
| 35 |
|
35 |
|
| 36 |
plan tests => 4; |
36 |
plan tests => 5; |
|
|
37 |
|
| 38 |
subtest 'Update an attribute should update the patron "updated_on" field' => sub { |
| 39 |
|
| 40 |
plan tests => 1; |
| 41 |
|
| 42 |
$schema->storage->txn_begin; |
| 43 |
|
| 44 |
my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
| 45 |
my $updated_on = $patron->updated_on; |
| 46 |
|
| 47 |
sleep 1; # Timestamps are in one second increments, so we need to wait one second |
| 48 |
|
| 49 |
my $type = $builder->build_object( |
| 50 |
{ |
| 51 |
class => 'Koha::Patron::Attribute::Types', |
| 52 |
value => { |
| 53 |
mandatory => 0, |
| 54 |
repeatable => 0, |
| 55 |
unique_id => 0, |
| 56 |
category_code => undef |
| 57 |
} |
| 58 |
} |
| 59 |
); |
| 60 |
|
| 61 |
my $attr = $patron->add_extended_attribute( |
| 62 |
{ |
| 63 |
code => $type->code, |
| 64 |
attribute => 'TEST' |
| 65 |
} |
| 66 |
); |
| 67 |
|
| 68 |
$attr->set( { attribute => 'TEST' } )->store(); |
| 69 |
|
| 70 |
$patron->discard_changes; |
| 71 |
|
| 72 |
isnt( $updated_on, $patron->updated_on, "Updated on was updated by attribute storage" ); |
| 73 |
|
| 74 |
$schema->storage->txn_rollback; |
| 75 |
}; |
| 37 |
|
76 |
|
| 38 |
subtest 'repeatable attributes tests' => sub { |
77 |
subtest 'repeatable attributes tests' => sub { |
| 39 |
|
78 |
|
| 40 |
- |
|
|