Bug 22930

Summary: Make TestBuilder more strict about wrong arguments
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Test SuiteAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: normal    
Priority: P5 - low CC: m.de.rooy, martin.renvoize, nick
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
19.05.00, 18.11.06
Bug Depends on: 15339    
Bug Blocks:    
Attachments: Bug 22930: Make TestBuilder->build_object explodes if parameters are wrong
Bug 22930: Make TestBuilder->build_object explodes if parameters are wrong
Bug 22930: (QA follow-up) Add two test descriptions

Description Jonathan Druart 2019-05-16 15:51:03 UTC
It happens to me too often to call TestBuilder->build[_object] without 'value':

$builder->build_object({ class => 'Koha::Patrons', { categorycode => $category->categorycode });

Then I am loosing minutes to understand what my tests do not fail (yes, fail).

We could make it display a warning or croak or whatever.
Comment 1 Jonathan Druart 2019-05-16 17:58:17 UTC
Created attachment 89864 [details] [review]
Bug 22930: Make TestBuilder->build_object explodes if parameters are wrong

This patch implements bug 15339 for build_object.
We want it to warn if the call is wrong.

Test plan:
Make sure the tests are still returning green
Comment 2 Marcel de Rooy 2019-05-17 08:42:24 UTC
Created attachment 89882 [details] [review]
Bug 22930: Make TestBuilder->build_object explodes if parameters are wrong

This patch implements bug 15339 for build_object.
We want it to warn if the call is wrong.

Test plan:
Make sure the tests are still returning green

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 3 Marcel de Rooy 2019-05-17 08:42:28 UTC
Created attachment 89883 [details] [review]
Bug 22930: (QA follow-up) Add two test descriptions

No more than that ;)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 4 Marcel de Rooy 2019-05-17 08:43:06 UTC
Simple patch. Passing QA rightaway.
Comment 5 Nick Clemens 2019-05-17 14:55:07 UTC
Awesome work all! 

Pushed to master for 19.05
Comment 6 Martin Renvoize 2019-05-30 19:32:47 UTC
Pushed to 18.11.x for 18.11.06