https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182

--- Comment #1 from Tomás Cohen Arazi <tomasco...@gmail.com> ---
Created attachment 60819
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=60819&action=edit
Bug 18182: Make TestBuilder capable of returning Koha::Object

This patch adds a new method to t::lib::TestBuilder so it can return
Koha::Object-derived objects. The new method is called ->build_object
and requires the plural of the target class to be passed, along with the
field to be used as id on searching the object.

The plural is because the singular form is not aware of its plural (I
always thought we should move plural stuff into the singular class, this
is one of the reasons).

The id is required because that's the way to find the recently created
object.

If any of those parameters is ommited, a warning is raised and undef is
returned.

To test:
- Apply the patches
- Run:
  $ sudo koha-shell kohadev
 k$ cd kohaclone
 k$ prove t/db_dependent/TestBuilder.t
=> SUCCESS: Tests pass!
- Sign off :-D

Sponsored-by: ByWater Solutions

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to