Koha-clms/t/db_dependent/Koha
Marcel de Rooy 89bf455529 Bug 18361: [SQUASHED FOR 16.11] Koha::Objects->find should accept composite primary keys
Changes the $id parameter to an array. (IssuingRule has three keys.)
The build_object method in TestBuilder.pm has been adjusted to pass
multiple primary key values to find.

Also adjusted the POD section to show more clearly that we accept
the same parameters as DBIx ResultSet does.

Test plan:
Run t/db_dependent/Koha/Object.t
Run t/db_dependent/Koha/Objects.t
Run t/db_dependent/TestBuilder.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Bug 18361: Additional tests for Koha::Objects->find

Adding a subtest find in t/db_dependent/Koha/Objects.t.

Test plan:
Run t/db_dependent/Koha/Objects.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Bug 18361: (QA followup) Add tests for the no params case

This patch adds a test for the trivial case in which no param is passed
and the ->find method returns undef.

For completeness purposes.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Bug 18361: [QA Follow-up] Resolve warning on undef values supplied

The following warning was raised in Letters.t:
DBIx::Class::ResultSource::_minimal_valueset_satisfying_constraint():
NULL/undef values supplied for requested unique constraint 'primary' (NULL
values in column(s): 'id'). This is almost certainly not what you wanted,
though you can set DBIC_NULLABLE_KEY_NOWARN to disable this warning.

This warning is triggered by this line in C4/Letters.pm:
    Koha::SMS::Providers->find( $member->{'sms_provider_id'} );
As you already guessed, the sms_provider_id returns undef.

Resolved in sub find by testing if there are parameters and if so, they
should not be all undefined. (In most cases there will be only one
parameter; but this report is about composite keys.)

Added a trivial test case in Objects.t too.

Test plan:
Run t/db_dependent/Koha/Object.t
Run t/db_dependent/Koha/Objects.t
Run t/db_dependent/Letters.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2017-08-16 22:58:34 +02:00
..
Acquisition
…
Item Bug 16686: Add test for Koha::Item::Transfer[s] and Koha::Item->get_transfer 2016-09-02 13:56:03 +00:00
Patron Bug 14637: Followup - Fix number of tests due to rebase 2017-01-03 23:35:00 +00:00
Authorities.t
…
BiblioFrameworks.t
…
BiblioUtils.t
…
Checkouts.t
…
Cities.t
…
CsvProfiles.t Bug 15451: Add the 2 new modules Koha::CsvProfile[s] 2016-07-22 17:18:34 +00:00
GetDailyQuote.t Bug 18767: Remove useless diags from GetDailyQuote.t 2017-06-13 08:01:21 +02:00
IsKohaFieldLinked.t
…
Issues.t
…
ItemTypes.t
…
Items.t Bug 17974: Add the Koha::Item->biblio method 2017-06-05 15:40:15 +02:00
Libraries.t
…
MarcSubfieldStructures.t Bug 17249: Remove GetKohaAuthorisedValuesFromField - Add classes MarcSubfieldStructure[s] 2016-10-21 15:13:55 +00:00
News.t
…
Object.t Bug 17594: Make Koha::Object->discard_changes available 2016-11-15 15:15:26 +00:00
Objects.t Bug 18361: [SQUASHED FOR 16.11] Koha::Objects->find should accept composite primary keys 2017-08-16 22:58:34 +02:00
Patrons.t Bug 17782: Fix tests 2017-02-07 22:24:20 +01:00
Ratings.t Bug 17089: [QA Follow-up] Add some test descriptions to Ratings.t 2016-09-09 09:31:30 +00:00
Reviews.t Bug 15839: Koha::Reviews - Remove approvereview & unapprovereview 2016-09-09 10:29:57 +00:00
SMS_Providers.t
…
Suggestions.t
…