Koha/t/db_dependent/Members/Statistics.t
Jonathan Druart f1f9c6dc74 Bug 26384: Fix executable flags
.pm must not have -x
.t must have -x
.pl must have -x

Test plan:
Apply only the first patch, run the tests and confirm that the failures
make sense
Apply this patch and confirm that the test now returns green

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-09-11 09:56:56 +02:00

20 lines
689 B
Perl
Executable file

use Modern::Perl;
use Test::More tests => 2;
# Please add more tests here !!
use t::lib::Mocks;
use C4::Members::Statistics;
use Koha::Database; # we need the db here; get_fields looks for the item columns
my $schema = Koha::Database->schema;
$schema->storage->txn_begin;
t::lib::Mocks::mock_preference( 'StatisticsFields', undef );
is( C4::Members::Statistics::get_fields(), 'location|itype|ccode', 'Check default' );
t::lib::Mocks::mock_preference( 'StatisticsFields', 'barcode|garbagexxx|itemcallnumber|notexistent' );
is( C4::Members::Statistics::get_fields(), 'barcode|itemcallnumber', 'Check if wrong item fields were removed by get_fields' );
$schema->storage->txn_rollback;