Koha/t
Alex Buckley db3ebe47e8 Bug 17944 - Add Koha::ItemType->can_be_deleted and use it from admin/itemtypes.pl
Removed the sql code from Itemtypes.pm and replaced  it with DBIx
database query in the itemtypes.pl administrative script

Test plan:
1. In the staff interface, stage and manage MARC records for import

2. Try to delete an itemtype. If there are items of that itemtype in the
   database then a message telling you the number of items of that
   itemtype there are will be displayed.

3. Record that number

4. View the admin/itemtpes.pl script and confirm that there is sql code
   written in this file.

5. Apply this patch

6. View the admin/itemtypes.pl script and observe that there is no sql
   in this file. There is however DBIx code, for example
   $schema->resultset('Item')->search({ 'itype' => $itemtype_code} );
   which is searching for items with the itype value matching
   $itemtype_code value.

7. In the staff interface try to delete the same itemtype

8. Record the number of items there are with that itemtype in the
   resulting message

9. The numbers recorded in steps 3 and 8 should match showing that the
   DBIx code is working as intended

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-06-05 11:59:10 -03:00
..
Acquisition
Biblio Bug 17641: Fix t/Biblio/Isbd.t 2016-11-16 14:02:30 +00:00
Budgets
Circulation Bug 17557: Koha::Patrons - Move GetAge to ->set_age (and remove SetAge) 2016-12-16 11:57:38 +00:00
db_dependent Bug 17944 - Add Koha::ItemType->can_be_deleted and use it from admin/itemtypes.pl 2017-06-05 11:59:10 -03:00
edi_testfiles Bug 7736: Support Ordering via Edifact EDI messages 2016-04-01 20:03:17 +00:00
External
Koha Bug 17302: [Follow-up] Make Normalize.pm undef-resistent 2016-09-25 14:04:54 +00:00
lib Bug 18182: Make TestBuilder capable of returning Koha::Object 2017-04-21 00:10:49 +00:00
Members Bug 15690: Hardcoded 16 is uncool 2016-11-14 11:28:43 +00:00
Number
Search
Serials
SIP
00-checkdatabase-version.t
00-deprecated.t
00-load.t Bug 18243: 16034 follow-up: Conditionally test Koha::ExternalContent::* modules loading 2017-03-20 15:28:35 +00:00
00-merge-conflict-markers.t
00-testcritic.t
00-valid-xml.t
Auth_with_shibboleth.t Bug 12026: [QA Follow-up] Add Tests for autocreate 2017-03-31 14:28:18 +00:00
AuthoritiesMarc_MARC21.t Bug 5327 added unit tests for C4/AuthoritiesMarc/MARC21.pm 2012-01-31 17:21:47 +01:00
AuthoritiesMarc_UNIMARC.t
AuthUtils.t Bug 9611: (follow-up) move new password hashing routines to separate module 2013-10-09 03:29:22 +00:00
Barcodes_annual.t
Barcodes_EAN13.t Bug 6448 [2/3] Barcodes::EAN13 autoBarcode 2012-08-02 18:41:44 +02:00
Barcodes_hbyymmincr.t Bug 5327: More basic unit tests for C4 modules 2010-11-01 15:35:50 +13:00
Barcodes_incremental.t
Biblio.t
Biblio2.t
Bookseller.t
Boolean.t
Breeding.t Bug 13279: t/Breeding.t shouldn't depend on the DB 2014-11-20 09:39:53 -03:00
Budgets.t C4::Bookfund no longer exists, removing the test 2009-12-20 14:31:37 +01:00
Cache.t Bug 16769: Uniformise calls to Koha::Cache->set_in_cache 2016-10-10 17:03:54 +00:00
Calendar.t
Charset.t Bug 18152: Add tests 2017-05-08 08:36:57 -04:00
Circulation_barcodedecode.t Bug 15151: Avoid DB access to load C4::Members 2015-11-08 13:10:13 -03:00
ClassSortRoutine.t
ClassSortRoutine_Dewey.t Bug 8837 [QA Followup] - Add unit tests 2014-10-28 09:39:44 -03:00
ClassSortRoutine_Generic.t
ClassSortRoutine_LCC.t bug 6281: introduce LC::CallNumber::LC for sorting LC call numbers 2013-06-10 07:56:53 -07:00
ClassSource.t Bug 5327: Add basic unit tests to some C4 modules 2010-10-30 20:12:53 +13:00
Context.t
Contract.t
Creators.t
DateUtils.t Bug 17502: Throw some exceptions in output_pref 2017-04-21 07:36:25 -04:00
Debug.t Bug 14114: Silence warns and cleanup t/Debug.t 2015-05-22 09:33:34 -03:00
dummy.t
Edifact.t
EdiInvoice.t
Ediorder.t Bug 7736: Support Ordering via Edifact EDI messages 2016-04-01 20:03:17 +00:00
Ediordrsp.t
Form_MessagingPreferences.t
Heading.t Bug 5327: Add basic unit tests to some C4 modules 2010-10-30 20:12:53 +13:00
Images.t
ImportBatch.t
Installer_PerlDependencies.t
Installer_PerlModules.t Bug 17990: Refactor Perl module versions check 2017-02-17 12:13:44 +00:00
Installer_pm.t Bug 17990: Refactor Perl module versions check 2017-02-17 12:13:44 +00:00
ItemCirculationAlertPreference.t
Koha.t Bug 14629 - [QA Followup] Pass invalid ISSN through GetVariationsOfISSN 2016-10-28 11:58:14 +00:00
Koha_Email.t Bug 13172 t/Koha_Email.t was database dependent 2014-10-31 12:10:32 -03:00
Koha_ExternalContent_OverDrive.t Bug 18243: 16034 follow-up: better handling of absence of WebService::ILS::OverDrive::Patron at testing 2017-03-20 15:28:35 +00:00
Koha_MetadataRecord.t
Koha_Template_Plugin_Cache.t Bug 11452: Add unit tests for Koha::Template::Plugin::Cache 2014-01-10 15:42:23 +00:00
Koha_Template_Plugin_Koha.t Bug 18222 - Fix tests broken by Buug 18026 2017-03-20 15:33:45 +00:00
Koha_Util_FrameworkPlugin.t Bug 13437: Preliminary changes for marc21 plugins field 008 2015-06-10 12:51:26 -03:00
Koha_Util_MARC.t Bug 8064: Fix unit tests for createMergeHash 2015-11-09 15:08:57 -03:00
Labels.t
Labels_split_ccn.t
Labels_split_ddcn.t Bug 9978: (followup) Replace license header with the correct license (GPLv3+) 2015-04-20 09:59:43 -03:00
Labels_split_lccn.t Bug 9978: (followup) Replace license header with the correct license (GPLv3+) 2015-04-20 09:59:43 -03:00
Languages.t
Letters.t Bug 17762 (QA Followup) Fix Letters.t - add lang to fixtures 2017-05-09 20:56:43 +00:00
Log.t Bug 11537: (follow-up) mock C4::Context::preference 2014-01-14 19:27:07 +00:00
Logger.t
Matcher.t
Members_Attributes.t
Members_AttributeTypes.t Bug 17825: (followup) Remove unused function AttributeTypeExists 2017-03-31 14:37:21 +00:00
Members_Messaging.t
Message.t
NorwegianPatronDB.t Bug 11401: (followup) make tests run on absent deps 2014-11-14 15:32:25 -03:00
OpenLibrarySearch.t
Output.t
Output_JSONStream.t
Overdues.t
Patron.t
Patroncards.t
Patroncards_Batch.t
Patroncards_Layout.t
Patroncards_Lib.t
Patroncards_Patroncard.t
Patroncards_Profile.t
Patroncards_Template.t
perlcriticrc
Prices.t Bug 13726: Make Koha::Acq::Bookseller using Koha::Object 2016-12-30 11:54:32 +00:00
Print.t
QueryParser.t Bug 12647: PQF QueryParser driver and unit tests fixes 2014-08-11 10:09:38 -03:00
RecordProcessor.t
Ris.t Bug 16668: Fix t/Ris.t tests 2016-06-10 16:59:20 +00:00
RotatingCollections.t
Scheduler.t
Scrubber.t Bug 14116: Silence noisy output for t/Scrubber. 2015-06-01 14:10:56 -03:00
Search.t
Search_PazPar2.t Bug 14117: Silence warnings t/SearchPazPar2.t 2015-06-01 14:10:14 -03:00
SimpleMARC.t
smolder_smoke_signal
SMS.t
SocialData.t
Stats.t
SuggestionEngine.t Bug 8726 follow-up: fix QA issues 2012-09-28 17:14:15 +02:00
SuggestionEngine_AuthorityFile.t
TmplToken.t Bug 5327 added unit tests for C4/TmplToken.pm 2012-01-31 17:21:50 +01:00
Token.t Bug 18124: [Follow-up] Handle default parameters in a sub 2017-03-30 09:07:08 +00:00
XSLT.t Bug 18089: Remove warnings from tests using DBIx::Class fixtures 2017-02-14 14:07:02 +00:00