[Koha-bugs] [Bug 18289] Fix t/Prices.t having a Test::DBIx::Class cache issue

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue May 23 22:06:25 CEST 2017


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18289

Jonathan Druart <jonathan.druart at bugs.koha-community.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jonathan.druart at bugs.koha-c
                   |                            |ommunity.org

--- Comment #3 from Jonathan Druart <jonathan.druart at bugs.koha-community.org> ---
I confirm that this fixes the tests on jenkins.

diff --git a/Koha/Database.pm b/Koha/Database.pm
index df259c5..f8a2fba 100644
--- a/Koha/Database.pm
+++ b/Koha/Database.pm
@@ -215,6 +215,11 @@ sub restore_schema {
     # return something, then this function should, too.
 }

+sub flush_schema_cache {
+    delete $database->{schema};
+    return 1;
+}
+
 =head2 EXPORT

 None by default.
diff --git a/t/Prices.t b/t/Prices.t
index f89c7f6..68dc788 100644
--- a/t/Prices.t
+++ b/t/Prices.t
@@ -29,6 +29,7 @@ use Test::DBIx::Class {

 my $db = Test::MockModule->new('Koha::Database');
 $db->mock( _new_schema => sub { return Schema(); } );
+Koha::Database::flush_schema_cache();

 fixtures_ok [
     Currency => [

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list