Bug 17600: Standardize our EXPORT_OK
[koha.git] / t / db_dependent / Members / Statistics.t
1 use Modern::Perl;
2 use Test::More tests => 2;
3
4 # Please add more tests here !!
5
6 use t::lib::Mocks;
7
8 use C4::Members::Statistics qw( get_fields );
9 use Koha::Database; # we need the db here; get_fields looks for the item columns
10
11 my $schema = Koha::Database->schema;
12 $schema->storage->txn_begin;
13
14 t::lib::Mocks::mock_preference( 'StatisticsFields', undef );
15 is( C4::Members::Statistics::get_fields(), 'location|itype|ccode', 'Check default' );
16
17 t::lib::Mocks::mock_preference( 'StatisticsFields', 'barcode|garbagexxx|itemcallnumber|notexistent' );
18 is( C4::Members::Statistics::get_fields(), 'barcode|itemcallnumber', 'Check if wrong item fields were removed by get_fields' );
19
20 $schema->storage->txn_rollback;