Bug 16443: [QA Follow-up] Add two tests for get_fields
Adds t/db_dependent/Members/Statistics.t. Test plan: Run the test. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> (cherry picked from commit30cf9ee277) Signed-off-by: Frédéric Demians <f.demians@tamil.fr> (cherry picked from commit03d51281b0) Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
This commit is contained in:
parent
bd17c1f874
commit
bf40e2b333
|
|
@ -0,0 +1,20 @@
|
|||
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;
|
||||
Loading…
Reference in New Issue