|
Lines 19-25
Link Here
|
| 19 |
|
19 |
|
| 20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
| 21 |
|
21 |
|
| 22 |
use Test::More tests => 7; |
22 |
use Test::More tests => 8; |
| 23 |
|
23 |
|
| 24 |
use C4::Biblio; |
24 |
use C4::Biblio; |
| 25 |
use C4::Context; |
25 |
use C4::Context; |
|
Lines 451-453
subtest '->get_effective_marcorgcode' => sub {
Link Here
|
| 451 |
|
451 |
|
| 452 |
$schema->storage->txn_rollback; |
452 |
$schema->storage->txn_rollback; |
| 453 |
}; |
453 |
}; |
| 454 |
- |
454 |
|
|
|
455 |
subtest 'cash_registers' => sub { |
| 456 |
plan tests => 3; |
| 457 |
|
| 458 |
$schema->storage->txn_begin; |
| 459 |
|
| 460 |
my $library = $builder->build_object( { class => 'Koha::Libraries' } ); |
| 461 |
my $register1 = $builder->build_object( |
| 462 |
{ |
| 463 |
class => 'Koha::Cash::Registers', |
| 464 |
value => { branch => $library->branchcode }, |
| 465 |
} |
| 466 |
); |
| 467 |
my $register2 = $builder->build_object( |
| 468 |
{ |
| 469 |
class => 'Koha::Cash::Registers', |
| 470 |
value => { branch => $library->branchcode }, |
| 471 |
} |
| 472 |
); |
| 473 |
|
| 474 |
my $registers = $library->cash_registers; |
| 475 |
is( ref($registers), 'Koha::Cash::Registers', |
| 476 |
'Koha::Library->cash_registers should return a set of Koha::Cash::Registers' |
| 477 |
); |
| 478 |
is( $registers->count, 2, |
| 479 |
'Koha::Library->cash_registers should return the correct cash registers' |
| 480 |
); |
| 481 |
|
| 482 |
$register1->delete; |
| 483 |
is( $library->cash_registers->next->id, $register2->id, |
| 484 |
'Koha::Library->cash_registers should return the correct cash registers' |
| 485 |
); |
| 486 |
|
| 487 |
$schema->storage->txn_rollback; |
| 488 |
}; |