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 Bug 16053: Add tests 2016-03-21 21:35:04 +00:00
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 Bug 15380: Introduce Koha::Authorit[y|ies] and Koha::Authority::Type[s] 2015-12-31 18:50:41 +00:00
BiblioFrameworks.t Bug 16155: [QA Follow-up] Add transaction to BiblioFrameworks.t 2016-05-04 13:47:58 +00:00
BiblioUtils.t Bug 12478: fix some issues on rebase 2016-04-26 20:20:09 +00:00
Checkouts.t Bug 14757: Add tests for new modules 2016-07-08 13:47:42 +00:00
Cities.t Bug 15081: (followup) Make test files using TestBuilder handle their transactions 2015-11-04 12:32:57 -03:00
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 Bug 12874: A DB field without a default mapping is set to a default value on editing 2014-10-11 12:57:11 -03:00
Issues.t Bug 16086: Add tests for Koha::Issues 2016-04-07 00:31:22 +00:00
ItemTypes.t Bug 12748: (QA followup) make new tests pass 2016-04-26 20:20:14 +00:00
Items.t Bug 17974: Add the Koha::Item->biblio method 2017-06-05 15:40:15 +02:00
Libraries.t Bug 15629: Koha::Libraries - Remove GetBranchesInCategory (1) 2016-02-24 03:55:05 +00:00
MarcSubfieldStructures.t Bug 17249: Remove GetKohaAuthorisedValuesFromField - Add classes MarcSubfieldStructure[s] 2016-10-21 15:13:55 +00:00
News.t Bug 14757: Add tests for new modules 2016-07-08 13:47:42 +00:00
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 Bug 9021 [QA Followup] - Unit tests 2016-02-14 12:40:07 +00:00
Suggestions.t Bug 14757: Add tests for new modules 2016-07-08 13:47:42 +00:00