Lines 40-46
use t::lib::TestBuilder;
Link Here
|
40 |
use t::lib::Mocks; |
40 |
use t::lib::Mocks; |
41 |
|
41 |
|
42 |
my $schema = Koha::Database->new->schema; |
42 |
my $schema = Koha::Database->new->schema; |
43 |
$schema->storage->txn_begin; |
|
|
44 |
|
43 |
|
45 |
my $builder = t::lib::TestBuilder->new; |
44 |
my $builder = t::lib::TestBuilder->new; |
46 |
my $library = $builder->build({source => 'Branch' }); |
45 |
my $library = $builder->build({source => 'Branch' }); |
Lines 1425-1431
subtest 'Log cardnumber change' => sub {
Link Here
|
1425 |
is( scalar @logs, 2, 'With BorrowerLogs, Change in cardnumber should be logged, as well as general alert of patron mod.' ); |
1424 |
is( scalar @logs, 2, 'With BorrowerLogs, Change in cardnumber should be logged, as well as general alert of patron mod.' ); |
1426 |
}; |
1425 |
}; |
1427 |
|
1426 |
|
1428 |
$schema->storage->txn_rollback; |
|
|
1429 |
|
1427 |
|
1430 |
subtest 'Test Koha::Patrons::merge' => sub { |
1428 |
subtest 'Test Koha::Patrons::merge' => sub { |
1431 |
plan tests => 110; |
1429 |
plan tests => 110; |
Lines 1434-1440
subtest 'Test Koha::Patrons::merge' => sub {
Link Here
|
1434 |
|
1432 |
|
1435 |
my $resultsets = $Koha::Patron::RESULTSET_PATRON_ID_MAPPING; |
1433 |
my $resultsets = $Koha::Patron::RESULTSET_PATRON_ID_MAPPING; |
1436 |
|
1434 |
|
1437 |
$schema->storage->txn_begin; |
|
|
1438 |
|
1435 |
|
1439 |
my $keeper = $builder->build_object({ class => 'Koha::Patrons' }); |
1436 |
my $keeper = $builder->build_object({ class => 'Koha::Patrons' }); |
1440 |
my $loser_1 = $builder->build({ source => 'Borrower' })->{borrowernumber}; |
1437 |
my $loser_1 = $builder->build({ source => 'Borrower' })->{borrowernumber}; |
Lines 1469-1481
subtest 'Test Koha::Patrons::merge' => sub {
Link Here
|
1469 |
is( Koha::Patrons->find($loser_1), undef, 'Loser 1 has been deleted' ); |
1466 |
is( Koha::Patrons->find($loser_1), undef, 'Loser 1 has been deleted' ); |
1470 |
is( Koha::Patrons->find($loser_2), undef, 'Loser 2 has been deleted' ); |
1467 |
is( Koha::Patrons->find($loser_2), undef, 'Loser 2 has been deleted' ); |
1471 |
|
1468 |
|
1472 |
$schema->storage->txn_rollback; |
|
|
1473 |
}; |
1469 |
}; |
1474 |
|
1470 |
|
1475 |
subtest '->store' => sub { |
1471 |
subtest '->store' => sub { |
1476 |
plan tests => 3; |
1472 |
plan tests => 3; |
1477 |
my $schema = Koha::Database->new->schema; |
1473 |
my $schema = Koha::Database->new->schema; |
1478 |
$schema->storage->txn_begin; |
|
|
1479 |
|
1474 |
|
1480 |
my $print_error = $schema->storage->dbh->{PrintError}; |
1475 |
my $print_error = $schema->storage->dbh->{PrintError}; |
1481 |
$schema->storage->dbh->{PrintError} = 0; ; # FIXME This does not longer work - because of the transaction in Koha::Patron->store? |
1476 |
$schema->storage->dbh->{PrintError} = 0; ; # FIXME This does not longer work - because of the transaction in Koha::Patron->store? |
Lines 1497-1503
subtest '->store' => sub {
Link Here
|
1497 |
is( $patron_1->password, $digest, 'Password should not have changed on ->store'); |
1492 |
is( $patron_1->password, $digest, 'Password should not have changed on ->store'); |
1498 |
|
1493 |
|
1499 |
$schema->storage->dbh->{PrintError} = $print_error; |
1494 |
$schema->storage->dbh->{PrintError} = $print_error; |
1500 |
$schema->storage->txn_rollback; |
|
|
1501 |
}; |
1495 |
}; |
1502 |
|
1496 |
|
1503 |
|
1497 |
|