Bug 19042 - Silence warnings t/db_dependent/Letters.t
Summary: Silence warnings t/db_dependent/Letters.t
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: M. Tompsett
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-04 18:20 UTC by M. Tompsett
Modified: 2017-12-07 22:24 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 19042: Silence warnings t/db_dependent/Letters.t (1.02 KB, patch)
2017-08-04 18:27 UTC, M. Tompsett
Details | Diff | Splinter Review
Bug 19042: Silence warnings t/db_dependent/Letters.t (1.07 KB, patch)
2017-08-04 18:34 UTC, Lee Jamison
Details | Diff | Splinter Review
Bug 19042: Silence warnings t/db_dependent/Letters.t (1.14 KB, patch)
2017-08-10 18:03 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 19042: Add mock IndependentBranches=0 for the other test (1.18 KB, patch)
2017-08-10 18:03 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description M. 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 M. 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 M. 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.