From bf40e2b333dd4705983686d60e4c7dd4c83c4a2e Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 10 Jun 2016 11:49:45 +0200 Subject: [PATCH] Bug 16443: [QA Follow-up] Add two tests for get_fields MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Adds t/db_dependent/Members/Statistics.t. Test plan: Run the test. Signed-off-by: Marcel de Rooy Signed-off-by: Kyle M Hall Signed-off-by: Kyle M Hall (cherry picked from commit 30cf9ee277481b54ed75e500c38f328f2d82b831) Signed-off-by: Frédéric Demians (cherry picked from commit 03d51281b079c379a2fba0caf8a9df8ec9c6d500) Signed-off-by: Julian Maurice --- t/db_dependent/Members/Statistics.t | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 t/db_dependent/Members/Statistics.t diff --git a/t/db_dependent/Members/Statistics.t b/t/db_dependent/Members/Statistics.t new file mode 100644 index 0000000000..fe0ca9b193 --- /dev/null +++ b/t/db_dependent/Members/Statistics.t @@ -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; -- 2.11.4.GIT