View | Details | Raw Unified | Return to bug 21740
Collapse All | Expand All

(-)a/t/db_dependent/ImportExportFramework.t (+34 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
use Modern::Perl;
4
use Test::More tests => 3;
5
use File::Basename qw( dirname );
6
7
use Koha::Database;
8
use Koha::BiblioFrameworks;
9
use Koha::MarcSubfieldStructures;
10
use t::lib::TestBuilder;
11
use C4::ImportExportFramework;
12
13
my $schema = Koha::Database->new->schema;
14
$schema->storage->txn_begin;
15
my $builder = t::lib::TestBuilder->new;
16
17
my $data_filepath = dirname(__FILE__) . '/data/biblio_framework.csv';
18
19
my $frameworkcode = '4T';
20
C4::ImportExportFramework::ImportFramework($data_filepath, $frameworkcode);
21
22
my $dbh = C4::Context->dbh;
23
24
# FIXME Import does not create the biblio framework
25
#my $biblio_framework = Koha::BiblioFrameworks->find($frameworkcode);
26
#ok( $biblio_framework );
27
28
my $nb_tags = $dbh->selectrow_array(q|SELECT COUNT(*) FROM marc_tag_structure WHERE frameworkcode="4T"|);
29
is( $nb_tags, 4, "4 tags should have been imported" );
30
31
my $nb_subfields =
32
  Koha::MarcSubfieldStructures->search( { frameworkcode => $frameworkcode } )
33
  ->count;
34
is( $nb_subfields, 12, "12 subfields should have been imported" );
(-)a/t/db_dependent/data/biblio_framework.csv (-1 / +23 lines)
Line 0 Link Here
0
- 
1
"tagfield","liblibrarian","libopac","repeatable","mandatory","authorised_value","frameworkcode"
2
"000","LEADER","LEADER","0","1","",""
3
"001","CONTROL NUMBER","CONTROL NUMBER","0","0","",""
4
"003","CONTROL NUMBER IDENTIFIER","CONTROL NUMBER IDENTIFIER","0","1","",""
5
"010","LIBRARY OF CONGRESS CONTROL NUMBER","LIBRARY OF CONGRESS CONTROL NUMBER","0","0","",""
6
7
"#-#","#-#","#-#","#-#","#-#","#-#","#-#"
8
9
"tagfield","tagsubfield","liblibrarian","libopac","repeatable","mandatory","kohafield","tab","authorised_value","authtypecode","value_builder","isurl","hidden","frameworkcode","seealso","link","defaultvalue","maxlength"
10
"000","@","fixed length control field","fixed length control field","0","1","","0","","","marc21_leader.pl","0","0","","","","","24"
11
"001","@","control field","control field","0","0","","0","","","","0","0","","","","","9999"
12
"003","@","control field","control field","0","1","","0","","","marc21_orgcode.pl","0","0","","","","","9999"
13
"005","@","control field","control field","0","1","","0","","","marc21_field_005.pl","0","0","","","","","9999"
14
"006","@","fixed length control field","fixed length control field","0","0","","0","","","marc21_field_006.pl","0","-1","","","","","9999"
15
"007","@","fixed length control field","fixed length control field","0","0","","0","","","marc21_field_007.pl","0","0","","","","","9999"
16
"008","@","fixed length control field","fixed length control field","0","1","","0","","","marc21_field_008.pl","0","0","","","","","40"
17
"009","@","fixed length control field","fixed length control field","0","0","","0","","","","0","-6","","","","","9999"
18
"010","8","Field link and sequence number","Field link and sequence number","1","0","","0","","","","0","-6","","","","","9999"
19
"010","a","LC control number","LC control number","0","0","biblioitems.lccn","0","","","","0","0","","","","","9999"
20
"010","b","NUCMC control number","NUCMC control number","1","0","","0","","","","0","-1","","","","","9999"
21
"010","z","Canceled/invalid LC control number","Canceled/invalid LC control number","1","0","","0","","","","0","-1","","","","","9999"
22
23
"#-#","#-#","#-#","#-#","#-#","#-#","#-#","#-#","#-#","#-#","#-#","#-#","#-#","#-#","#-#","#-#","#-#","#-#"

Return to bug 21740