Bug 19042

Summary: Silence warnings t/db_dependent/Letters.t
Product: Koha Reporter: Mark Tompsett <mtompset>
Component: Test SuiteAssignee: Mark Tompsett <mtompset>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: fridolin.somers, jonathan.druart, katrin.fischer
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 19042: Silence warnings t/db_dependent/Letters.t
Bug 19042: Silence warnings t/db_dependent/Letters.t
Bug 19042: Silence warnings t/db_dependent/Letters.t
Bug 19042: Add mock IndependentBranches=0 for the other test

Description Mark Tompsett 2017-08-04 18:20:38 UTC
The Letters test mocks userenv, but fails to provide flags, which causes the C4::Context IsSuperLibrarian to generate noise. Add a pretty flag value.
Comment 1 Mark Tompsett 2017-08-04 18:22:20 UTC
prove -v t/db_dependent/Letters.t

...
ok 31 - GetLetters gets the name correctly
    # Subtest: getletter
    1..16
    ok 1 - GetLetters gets the branch code correctly
    ok 2 - GetLetters gets the module correctly
    ok 3 - GetLetters gets the code correctly
    ok 4 - GetLetters gets the name correctly
    ok 5 - GetLetters gets the boolean is_html correctly
    ok 6 - GetLetters gets the title correctly
    ok 7 - GetLetters gets the content correctly
    ok 8 - GetLetters gets the message type correctly
C4::Context->userenv not defined! at /home/mtompset/kohaclone/C4/Letters.pm line 207.
    ok 9 - GetLetters gets the branch code correctly
    ok 10 - GetLetters gets the module correctly
    ok 11 - GetLetters gets the code correctly
    ok 12 - GetLetters gets the name correctly
    ok 13 - GetLetters gets the boolean is_html correctly
    ok 14 - GetLetters gets the title correctly
    ok 15 - GetLetters gets the content correctly
    ok 16 - GetLetters gets the message type correctly
...
Comment 2 Mark Tompsett 2017-08-04 18:27:04 UTC
Created attachment 65510 [details] [review]
Bug 19042: Silence warnings t/db_dependent/Letters.t

TEST PLAN
---------
prove t/db_dependent/Letters.t
-- there will be a message: "C4::Context->userenv not defined!"
apply this patch
prove t/db_dependent/Letters.t
-- there will no longer be that message.
run qa test tools
Comment 3 Lee Jamison 2017-08-04 18:34:41 UTC
Created attachment 65511 [details] [review]
Bug 19042: Silence warnings t/db_dependent/Letters.t

TEST PLAN
---------
prove t/db_dependent/Letters.t
-- there will be a message: "C4::Context->userenv not defined!"
apply this patch
prove t/db_dependent/Letters.t
-- there will no longer be that message.
run qa test tools

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Comment 4 Jonathan Druart 2017-08-10 18:03:50 UTC
Created attachment 65835 [details] [review]
Bug 19042: Silence warnings t/db_dependent/Letters.t

TEST PLAN
---------
prove t/db_dependent/Letters.t
-- there will be a message: "C4::Context->userenv not defined!"
apply this patch
prove t/db_dependent/Letters.t
-- there will no longer be that message.
run qa test tools

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 5 Jonathan Druart 2017-08-10 18:03:57 UTC
Created attachment 65836 [details] [review]
Bug 19042: Add mock IndependentBranches=0 for the other test

These tests do not cover correctly getletter, but it is not the goal of
this patch. Superlibrarian behaviour must be tested as well.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 6 Jonathan Druart 2017-08-10 19:31:32 UTC
Pushed to master for 17.11, thanks to everybody involved!
Comment 7 Fridolin Somers 2017-09-29 09:28:56 UTC
Pushed to 17.05.x, will be in 17.05.05.
Comment 8 Katrin Fischer 2017-10-01 21:28:57 UTC
These patches have been pushed to 16.11.x and will be in 16.11.13.