From 79b1553b17ca72861144bf38a714f46105abb22b Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Tue, 8 Nov 2016 12:40:45 -0300 Subject: [PATCH] Bug 17587: Remove itemtype-related IsItemIssued.t warnings This patch makes t/db_dependent/Circulation/IsItemIssued.t create good sample data for its tests. It does so by creating a random itemtype. To test: - Run $ prove t/db_dependent/Circulation/IsItemIssued.t => FAIL: lots of warnings about "item-level_itypes set but no itemtype set for item" - Apply the patch - Run: $ prove t/db_dependent/Circulation/IsItemIssued.t => SUCCESS: Tests are green, and no warnings. - Sign off :-D Sponsored-by: ByWater Solutions Signed-off-by: Josef Moravec Signed-off-by: Marcel de Rooy Signed-off-by: Mason James --- t/db_dependent/Circulation/IsItemIssued.t | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/t/db_dependent/Circulation/IsItemIssued.t b/t/db_dependent/Circulation/IsItemIssued.t index 6d0ab98666..02ad8b224f 100644 --- a/t/db_dependent/Circulation/IsItemIssued.t +++ b/t/db_dependent/Circulation/IsItemIssued.t @@ -22,6 +22,13 @@ my $dbh = C4::Context->dbh; my $library = $builder->build({ source => 'Branch' }); my $itemtype = $builder->build({ source => 'Itemtype' })->{itemtype}; +my $module = new Test::MockModule('C4::Context'); +$module->mock('userenv', sub { + { + branch => $library->{branchcode} + } +}); + my $borrowernumber = AddMember( firstname => 'my firstname', surname => 'my surname', -- 2.39.2