|
|
@ -66,10 +66,12 @@ subtest 'session_register_name' => sub { |
|
|
|
|
|
|
|
subtest 'all() tests' => sub { |
|
|
|
|
|
|
|
plan tests => 20; |
|
|
|
plan tests => 21; |
|
|
|
|
|
|
|
$schema->storage->txn_begin; |
|
|
|
|
|
|
|
t::lib::Mocks::mock_preference( 'UseCashRegisters', 1 ); |
|
|
|
|
|
|
|
my $count = Koha::Cash::Registers->search({ archived => 0 })->count; |
|
|
|
my $max_register = Koha::Cash::Registers->search( {}, |
|
|
|
{ order_by => { '-desc' => 'id' }, rows => 1 } )->single; |
|
|
@ -110,8 +112,8 @@ subtest 'all() tests' => sub { |
|
|
|
{ |
|
|
|
class => 'Koha::Cash::Registers', |
|
|
|
value => { |
|
|
|
branch => $library2->branchcode, |
|
|
|
archived => 0 |
|
|
|
branch => $library2->branchcode, |
|
|
|
archived => 0 |
|
|
|
} |
|
|
|
} |
|
|
|
); |
|
|
@ -177,6 +179,10 @@ subtest 'all() tests' => sub { |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
t::lib::Mocks::mock_preference( 'UseCashRegisters', 0 ); |
|
|
|
$result = $plugin->all(); |
|
|
|
is( $result, undef, "Return undef when UseCashRegisters is disabled" ); |
|
|
|
|
|
|
|
$schema->storage->txn_rollback; |
|
|
|
}; |
|
|
|
|
|
|
|