[Koha-bugs] [Bug 23770] Add Koha::Object(s)->to_api method

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Oct 18 11:00:04 CEST 2019


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

Marcel de Rooy <m.de.rooy at rijksmuseum.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #93893|0                           |1
        is obsolete|                            |

--- Comment #28 from Marcel de Rooy <m.de.rooy at rijksmuseum.nl> ---
Created attachment 94398
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=94398&action=edit
Bug 23770: Unit tests

This patch introduces tests for the new to_api method introduced in
Koha::Object(s).

It uses Koha::City as a sample for simplicity. And it also uses
Koha::Illrequests to test the case in which there's no to_api_mapping
method defined on the class, to highlight that a fallback to calling
TO_JSON is done. [1]

[1] This is done under the assumption Illrequests controller code
doesn't use any kind of mapping as the rest of the API controllers do,
so there's little chance it would be added in a future.

To test:
1. Apply this patchset
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Object.t \
           t/db_dependent/Koha/Objects.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen at theke.io>
Sponsored-by: ByWater Solutions

Signed-off-by: Josef Moravec <josef.moravec at gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy at rijksmuseum.nl>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list