Lines 4-16
use Modern::Perl;
Link Here
|
4 |
use Test::More tests => 11; |
4 |
use Test::More tests => 11; |
5 |
|
5 |
|
6 |
use C4::Context; |
6 |
use C4::Context; |
|
|
7 |
use Koha::Database; |
7 |
|
8 |
|
8 |
use_ok('Koha::Item::Search::Field'); |
9 |
use_ok('Koha::Item::Search::Field'); |
9 |
import Koha::Item::Search::Field qw(AddItemSearchField ModItemSearchField |
10 |
import Koha::Item::Search::Field qw(AddItemSearchField ModItemSearchField |
10 |
DelItemSearchField GetItemSearchField GetItemSearchFields); |
11 |
DelItemSearchField GetItemSearchField GetItemSearchFields); |
11 |
|
12 |
|
12 |
my $dbh = C4::Context->dbh; |
13 |
my $schema = Koha::Database->new->schema; |
13 |
$dbh->{AutoCommit} = 0; |
14 |
$schema->storage->txn_begin; |
14 |
|
15 |
|
15 |
# Start with empty table. |
16 |
# Start with empty table. |
16 |
foreach my $field (GetItemSearchFields()) { |
17 |
foreach my $field (GetItemSearchFields()) { |
Lines 35-39
is_deeply($field, {name => 'foo', label => 'Foo', tagfield => '001', tagsubfield
Link Here
|
35 |
ok((defined ModItemSearchField({name => 'foo', label => 'Foobar', tagfield => '100', 'tagsubfield' => 'a'})), "successful mod"); |
36 |
ok((defined ModItemSearchField({name => 'foo', label => 'Foobar', tagfield => '100', 'tagsubfield' => 'a'})), "successful mod"); |
36 |
$field = GetItemSearchField('foo'); |
37 |
$field = GetItemSearchField('foo'); |
37 |
is_deeply($field, {name => 'foo', label => 'Foobar', tagfield => '100', tagsubfield => 'a', authorised_values_category => undef}); |
38 |
is_deeply($field, {name => 'foo', label => 'Foobar', tagfield => '100', tagsubfield => 'a', authorised_values_category => undef}); |
38 |
|
|
|
39 |
$dbh->rollback; |