Bugzilla – Attachment 155037 Details for
Bug 12532
Copy guarantee email to guarantor (or redirect if guarantee has no email set)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21272: Unit test
Bug-21272-Unit-test.patch (text/plain), 2.63 KB, created by
Hammat wele
on 2023-08-31 19:12:31 UTC
(
hide
)
Description:
Bug 21272: Unit test
Filename:
MIME Type:
Creator:
Hammat wele
Created:
2023-08-31 19:12:31 UTC
Size:
2.63 KB
patch
obsolete
>From 2531f820320970c4efacfe92fbdca058d0223d31 Mon Sep 17 00:00:00 2001 >From: Hammat Wele <hammat.wele@inlibro.com> >Date: Thu, 31 Aug 2023 19:11:04 +0000 >Subject: [PATCH] Bug 21272: Unit test > >https://bugs.koha-community.org/show_bug.cgi?id=12532 >--- > t/db_dependent/ImportBatch.t | 30 +++++++++++++++++++++++++++++- > 1 file changed, 29 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/ImportBatch.t b/t/db_dependent/ImportBatch.t >index c9ef54391a..9e57c9c81e 100755 >--- a/t/db_dependent/ImportBatch.t >+++ b/t/db_dependent/ImportBatch.t >@@ -216,7 +216,7 @@ my $import_batch = C4::ImportBatch::GetImportBatch( $id_import_batch3 ); > is( $import_batch, undef, "Batch 3 has been deleted"); > > subtest "_batchCommitItems" => sub { >- plan tests => 3; >+ plan tests => 6; > > my $exist_item = $builder->build_sample_item; > my $import_item = $builder->build_object({ class => 'Koha::Import::Record::Items', value => { >@@ -246,6 +246,34 @@ subtest "_batchCommitItems" => sub { > $import_item->discard_changes(); > is( $import_item->status, 'error', "Import item marked as error when duplicate barcode and action always_add"); > is( $import_item->import_error, 'duplicate item barcode', 'Error correctly set when import item has duplicate barcode and action always_add' ); >+ >+ $import_item = $builder->build_object({ class => 'Koha::Import::Record::Items', value => { >+ marcxml => q{<?xml version="1.0" encoding="UTF-8"?> >+<collection >+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >+ xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd" >+ xmlns="http://www.loc.gov/MARC21/slim"> >+ >+<record> >+ <leader>00000 a </leader> >+ <datafield tag="952" ind1=" " ind2=" "> >+ <subfield code="a">WBRC</subfield> >+ <subfield code="b">WBRC</subfield> >+ <subfield code="c">GEN</subfield> >+ <subfield code="p">BCDETEST</subfield> >+ <subfield code="y">BK</subfield> >+ </datafield> >+</record> >+</collection> >+ }, >+ }}); >+ >+ ( $num_items_added, $num_items_replaced, $num_items_errored ) = >+ C4::ImportBatch::_batchCommitItems( $import_item->import_record_id, 32, 'always_add',64 ); >+ is( $num_items_errored, 1, "Item with wrong branchcode fails when action always_add" ); >+ $import_item->discard_changes(); >+ is( $import_item->status, 'error', "Import item marked as error when wrong branchcode detected and action always_add"); >+ is( $import_item->import_error, 'Branch code WBRC missing', 'Error correctly set when import item has a wrong branchcode detected and action always_add' ); > }; > > subtest "RecordsFromMarcPlugin" => sub { >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 12532
:
29510
|
30747
|
35313
|
36752
|
39787
|
39925
|
48645
|
53649
|
53689
|
53690
|
53699
|
53700
|
55985
|
56052
|
56053
|
59445
|
59446
|
59447
|
63197
|
64802
|
64824
|
67115
|
68340
|
70865
|
72064
|
72617
|
75099
|
77606
|
80313
|
85134
|
85135
|
87815
|
87816
|
88208
|
88209
|
88210
|
88211
|
88212
|
88213
|
88295
|
88296
|
114455
|
114456
|
114457
|
114458
|
114459
|
114460
|
114461
|
131091
|
131092
|
131093
|
131094
|
149233
|
150071
|
150208
|
150217
|
150240
|
150256
|
151028
|
151029
|
154854
|
154855
|
154856
|
154857
|
155036
|
155037
|
155828
|
155829
|
155830
|
155831
|
155832
|
155833
|
155834
|
155835
|
155836
|
155837
|
155873
|
155874
|
155875
|
155876
|
155877
|
155878
|
155879
|
155880
|
155881
|
155882
|
155883
|
155886
|
155934
|
155935
|
155936
|
155937
|
155938
|
155939
|
155940
|
155941
|
155942
|
155943
|
155944
|
155945
|
155946