Lines 17-23
Link Here
|
17 |
|
17 |
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
|
19 |
|
20 |
use Test::More tests => 5; |
20 |
use Test::More tests => 7; |
21 |
use Test::MockModule; |
21 |
use Test::MockModule; |
22 |
|
22 |
|
23 |
use Koha::Database; |
23 |
use Koha::Database; |
Lines 29-34
my $indexes = {
Link Here
|
29 |
'label' => 'Match', |
29 |
'label' => 'Match', |
30 |
'type' => '', |
30 |
'type' => '', |
31 |
'weight' => 15, |
31 |
'weight' => 15, |
|
|
32 |
'mandatory' => 0, |
32 |
'mappings' => [] |
33 |
'mappings' => [] |
33 |
} |
34 |
} |
34 |
}, |
35 |
}, |
Lines 37-42
my $indexes = {
Link Here
|
37 |
'label' => 'title', |
38 |
'label' => 'title', |
38 |
'type' => '', |
39 |
'type' => '', |
39 |
'weight' => 20, |
40 |
'weight' => 20, |
|
|
41 |
'mandatory' => 1, |
40 |
'mapping' => [] |
42 |
'mapping' => [] |
41 |
} |
43 |
} |
42 |
} |
44 |
} |
Lines 66-74
is($search_fields->count, 2, 'There is 2 search fields after reset');
Link Here
|
66 |
|
68 |
|
67 |
my $match_sf = Koha::SearchFields->search({ name => 'Match' })->next; |
69 |
my $match_sf = Koha::SearchFields->search({ name => 'Match' })->next; |
68 |
is($match_sf->weight, '15.00', 'Match search field is weighted with 15'); |
70 |
is($match_sf->weight, '15.00', 'Match search field is weighted with 15'); |
|
|
71 |
is($match_sf->mandatory, '0', 'Match search field is not mandatory'); |
69 |
|
72 |
|
70 |
my $title_sf = Koha::SearchFields->search({ name => 'title' })->next; |
73 |
my $title_sf = Koha::SearchFields->search({ name => 'title' })->next; |
71 |
is($title_sf->weight, '20.00', 'Title search field is weighted with 20'); |
74 |
is($title_sf->weight, '20.00', 'Title search field is weighted with 20'); |
|
|
75 |
is($title_sf->mandatory, '1', 'Title search field is mandatory'); |
72 |
|
76 |
|
73 |
$schema->storage->txn_rollback; |
77 |
$schema->storage->txn_rollback; |
74 |
|
78 |
|