|
Lines 22-28
Link Here
|
| 22 |
# Add more tests here!!! |
22 |
# Add more tests here!!! |
| 23 |
|
23 |
|
| 24 |
use Modern::Perl; |
24 |
use Modern::Perl; |
| 25 |
use Test::More tests => 18; |
25 |
use Test::More tests => 19; |
|
|
26 |
use File::Temp qw(tempfile); |
| 27 |
use utf8; |
| 28 |
|
| 26 |
use Koha::Database; |
29 |
use Koha::Database; |
| 27 |
|
30 |
|
| 28 |
BEGIN { |
31 |
BEGIN { |
|
Lines 70-72
ok( ! foreign_key_exists( 'borrowers', 'xxx' ), 'FK xxxx does not exist' );
Link Here
|
| 70 |
|
73 |
|
| 71 |
ok( primary_key_exists( 'borrowers', 'borrowernumber'), 'Borrowers has primary key on borrowernumber'); |
74 |
ok( primary_key_exists( 'borrowers', 'borrowernumber'), 'Borrowers has primary key on borrowernumber'); |
| 72 |
ok( ! primary_key_exists( 'borrowers', 'email'), 'Borrowers does not have a primary key on email'); |
75 |
ok( ! primary_key_exists( 'borrowers', 'email'), 'Borrowers does not have a primary key on email'); |
| 73 |
- |
76 |
|
|
|
77 |
subtest 'marc_framework_sql_list' => sub { |
| 78 |
plan tests => 1; |
| 79 |
|
| 80 |
my ($fh, $filepath) = tempfile( DIR => C4::Context->config("intranetdir") . "/installer/data/mysql/en/marcflavour/marc21/mandatory", SUFFIX => '.yml', UNLINK => 1 ); |
| 81 |
print $fh Encode::encode_utf8("---\ndescription:\n - \"Standardowe typy haseł przedmiotowych MARC21\"\n"); |
| 82 |
close $fh; |
| 83 |
|
| 84 |
my $yaml_files = $installer->marc_framework_sql_list('en', 'MARC21'); |
| 85 |
|
| 86 |
my $description; |
| 87 |
FILE: for my $file ( @$yaml_files ) { |
| 88 |
for my $framework ( @{ $file->{frameworks}} ) { |
| 89 |
if ( $framework->{fwkfile} eq $filepath ) { |
| 90 |
$description = $framework->{fwkdescription}->[0]; |
| 91 |
last FILE; |
| 92 |
} |
| 93 |
} |
| 94 |
} |
| 95 |
is( $description, 'Standardowe typy haseł przedmiotowych MARC21' ); |
| 96 |
}; |