From c0f24c160ab2f573a06146c66fa7fc7bab97a3a7 Mon Sep 17 00:00:00 2001 From: diosmosis <benaka@piwik.pro> Date: Mon, 15 Dec 2014 21:55:56 -0800 Subject: [PATCH] Trying to fix strange travis error, make sure a database is selected in IntegrationTestCase::restoreDbTables. --- tests/PHPUnit/Framework/TestCase/SystemTestCase.php | 5 +++++ tests/PHPUnit/UI | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/PHPUnit/Framework/TestCase/SystemTestCase.php b/tests/PHPUnit/Framework/TestCase/SystemTestCase.php index 8b85f255aa..3c8061fef0 100755 --- a/tests/PHPUnit/Framework/TestCase/SystemTestCase.php +++ b/tests/PHPUnit/Framework/TestCase/SystemTestCase.php @@ -528,6 +528,11 @@ abstract class SystemTestCase extends PHPUnit_Framework_TestCase */ protected static function restoreDbTables($tables) { + $db = Db::fetchOne("SELECT DATABASE()"); + if (empty($db)) { + Db::exec("USE " . Config::getInstance()->database_tests['dbname']); + } + DbHelper::truncateAllTables(); // insert data diff --git a/tests/PHPUnit/UI b/tests/PHPUnit/UI index 87fee9b102..4cdf80fc99 160000 --- a/tests/PHPUnit/UI +++ b/tests/PHPUnit/UI @@ -1 +1 @@ -Subproject commit 87fee9b1024b1c03d5d5d66a4fb4f699231e8e5f +Subproject commit 4cdf80fc99025b71e5d8e59419d2af749e466df6 -- GitLab