Lines 17-26
Link Here
|
17 |
|
17 |
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
|
19 |
|
20 |
use Test::More tests => 4; |
20 |
use Test::More tests => 5; |
21 |
use Test::MockModule; |
21 |
use Test::MockModule; |
22 |
|
22 |
|
23 |
use Koha::Database; |
23 |
use Koha::Database; |
|
|
24 |
use Koha::Caches; |
24 |
|
25 |
|
25 |
my $indexes = { |
26 |
my $indexes = { |
26 |
'authorities' => { |
27 |
'authorities' => { |
Lines 54-61
Koha::SearchFields->search->delete;
Link Here
|
54 |
Koha::SearchMarcMaps->search->delete; |
55 |
Koha::SearchMarcMaps->search->delete; |
55 |
$schema->resultset('SearchMarcToField')->search->delete; |
56 |
$schema->resultset('SearchMarcToField')->search->delete; |
56 |
|
57 |
|
|
|
58 |
|
57 |
Koha::SearchEngine::Elasticsearch->reset_elasticsearch_mappings; |
59 |
Koha::SearchEngine::Elasticsearch->reset_elasticsearch_mappings; |
58 |
|
60 |
|
|
|
61 |
my $cache = Koha::Caches->get_instance(); |
62 |
is( $cache->get_from_cache('elasticsearch_search_fields_staff_client'), undef, 'Cache has been flushed by reset_elasticsearch_mappings' ); |
63 |
|
59 |
my $search_fields = Koha::SearchFields->search({}); |
64 |
my $search_fields = Koha::SearchFields->search({}); |
60 |
is($search_fields->count, 2, 'There is 2 search fields after reset'); |
65 |
is($search_fields->count, 2, 'There is 2 search fields after reset'); |
61 |
|
66 |
|
Lines 66-68
my $title_sf = Koha::SearchFields->search({ name => 'title' })->next;
Link Here
|
66 |
is($title_sf->weight, '20.00', 'Title search field is weighted with 20'); |
71 |
is($title_sf->weight, '20.00', 'Title search field is weighted with 20'); |
67 |
|
72 |
|
68 |
$schema->storage->txn_rollback; |
73 |
$schema->storage->txn_rollback; |
69 |
- |
74 |
|
|
|
75 |
$cache = Koha::Caches->get_instance(); |
76 |
$cache->clear_from_cache('elasticsearch_search_fields_staff_client'); |
77 |
$cache->clear_from_cache('elasticsearch_search_fields_opac'); |