Lines 50-55
my $b1 = Koha::Patron->new(
Link Here
|
50 |
} |
50 |
} |
51 |
); |
51 |
); |
52 |
$b1->store(); |
52 |
$b1->store(); |
|
|
53 |
my $now = dt_from_string; |
53 |
my $b2 = Koha::Patron->new( |
54 |
my $b2 = Koha::Patron->new( |
54 |
{ |
55 |
{ |
55 |
surname => 'Test 2', |
56 |
surname => 'Test 2', |
Lines 72-84
$b3->store();
Link Here
|
72 |
my $b1_new = Koha::Patrons->find( $b1->borrowernumber() ); |
73 |
my $b1_new = Koha::Patrons->find( $b1->borrowernumber() ); |
73 |
is( $b1->surname(), $b1_new->surname(), "Found matching patron" ); |
74 |
is( $b1->surname(), $b1_new->surname(), "Found matching patron" ); |
74 |
isnt( $b1_new->updated_on, undef, "borrowers.updated_on should be set" ); |
75 |
isnt( $b1_new->updated_on, undef, "borrowers.updated_on should be set" ); |
75 |
is( dt_from_string($b1_new->updated_on), dt_from_string, "borrowers.updated_on should have been set to now on creating" ); |
76 |
is( dt_from_string($b1_new->updated_on), $now, "borrowers.updated_on should have been set to now on creating" ); |
76 |
|
77 |
|
77 |
my $b3_new = Koha::Patrons->find( $b3->borrowernumber() ); |
78 |
my $b3_new = Koha::Patrons->find( $b3->borrowernumber() ); |
78 |
is( dt_from_string($b3_new->updated_on), $three_days_ago, "borrowers.updated_on should have been kept to what we set on creating" ); |
79 |
is( dt_from_string($b3_new->updated_on), $three_days_ago, "borrowers.updated_on should have been kept to what we set on creating" ); |
79 |
$b3_new->set({ surname => 'another surname for Test 3' }); |
80 |
$b3_new->set({ surname => 'another surname for Test 3' }); |
80 |
$b3_new = Koha::Patrons->find( $b3->borrowernumber() ); |
81 |
$b3_new = Koha::Patrons->find( $b3->borrowernumber() ); |
81 |
is( dt_from_string($b1_new->updated_on), dt_from_string, "borrowers.updated_on should have been set to now on updating" ); |
82 |
is( $b3_new->surname, 'Test 3', "borrowers.surname should have not been updated with set without store" ); |
82 |
|
83 |
|
83 |
my @patrons = Koha::Patrons->search( { branchcode => $branchcode } ); |
84 |
my @patrons = Koha::Patrons->search( { branchcode => $branchcode } ); |
84 |
is( @patrons, 3, "Found 3 patrons with Search" ); |
85 |
is( @patrons, 3, "Found 3 patrons with Search" ); |
85 |
- |
|
|