Bugzilla – Attachment 113261 Details for
Bug 24665
Add ability to run cash register report with new cash register feature
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24665: (QA follow-up) Add tests for 'selected'
Bug-24665-QA-follow-up-Add-tests-for-selected.patch (text/plain), 1.81 KB, created by
Martin Renvoize (ashimema)
on 2020-11-06 16:29:00 UTC
(
hide
)
Description:
Bug 24665: (QA follow-up) Add tests for 'selected'
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-11-06 16:29:00 UTC
Size:
1.81 KB
patch
obsolete
>From 8f6fee75717fd42463f5d989b724aaad99c1b3ff Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 6 Nov 2020 16:27:47 +0000 >Subject: [PATCH] Bug 24665: (QA follow-up) Add tests for 'selected' > >Add a unit test to prove the 'selected' param passed to >Koha::Template::Plugin::Registers is adhered to. >--- > .../Koha/Template/Plugin/Registers.t | 18 +++++++++++++++++- > 1 file changed, 17 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Template/Plugin/Registers.t b/t/db_dependent/Koha/Template/Plugin/Registers.t >index 8ed14cee52..3e110ff6c5 100755 >--- a/t/db_dependent/Koha/Template/Plugin/Registers.t >+++ b/t/db_dependent/Koha/Template/Plugin/Registers.t >@@ -66,7 +66,7 @@ subtest 'session_register_name' => sub { > > subtest 'all() tests' => sub { > >- plan tests => 21; >+ plan tests => 25; > > $schema->storage->txn_begin; > >@@ -179,6 +179,22 @@ subtest 'all() tests' => sub { > ); > } > >+ $result = $plugin->all( { filters => { current_branch => 1 }, selected => $register1->id } ); >+ is( ref($result), 'ARRAY', >+"Return arrayref (userenv: branchcode + register_id, filters: current_branch, selected: register 1)" >+ ); >+ is( >+ scalar( @{$result} ), >+ 2, >+"Array contains 2 branch registers (userenv: branchcode + register_id, filters: current_branch, selected: register 1)" >+ ); >+ for my $register ( @{$result} ) { >+ my $selected = ( $register->{id} == $register1->id ) ? 1 : 0; >+ is( $register->{selected}, $selected, >+"Register is selected $selected (userenv: brancode, filters: current_branch, selected: register 1)" >+ ); >+ } >+ > t::lib::Mocks::mock_preference( 'UseCashRegisters', 0 ); > $result = $plugin->all(); > is( $result, undef, "Return undef when UseCashRegisters is disabled" ); >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24665
:
107150
|
107164
|
112901
|
112960
|
113247
|
113248
| 113261