4 use Test::More tests => 3;
5 use File::Basename qw( dirname );
8 use Koha::BiblioFrameworks;
9 use Koha::MarcSubfieldStructures;
10 use t::lib::TestBuilder;
11 use C4::ImportExportFramework;
13 my $schema = Koha::Database->new->schema;
14 $schema->storage->txn_begin;
15 my $builder = t::lib::TestBuilder->new;
17 my $data_filepath = dirname(__FILE__) . '/data/biblio_framework.csv';
19 my $frameworkcode = '4T';
20 C4::ImportExportFramework::ImportFramework($data_filepath, $frameworkcode);
22 my $dbh = C4::Context->dbh;
24 # FIXME Import does not create the biblio framework
25 #my $biblio_framework = Koha::BiblioFrameworks->find($frameworkcode);
26 #ok( $biblio_framework );
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" );
32 Koha::MarcSubfieldStructures->search( { frameworkcode => $frameworkcode } )
34 is( $nb_subfields, 12, "12 subfields should have been imported" );