From 8abbb26c1ab0f14d2588be01f805e13365582ca4 Mon Sep 17 00:00:00 2001 From: diosmosis <benaka@piwik.pro> Date: Sun, 4 Oct 2015 05:40:13 -0700 Subject: [PATCH] Since autoloading is used now, do not manually include fixture files during tests. Fixes case when one plugin has issue in fixture class making it impossible to run tests (since the tests:run will just fail). --- plugins/TestRunner/Commands/TestsSetupFixture.php | 13 ------------- tests/PHPUnit/bootstrap.php | 12 ------------ 2 files changed, 25 deletions(-) diff --git a/plugins/TestRunner/Commands/TestsSetupFixture.php b/plugins/TestRunner/Commands/TestsSetupFixture.php index b41ed4bd70..510578cb76 100644 --- a/plugins/TestRunner/Commands/TestsSetupFixture.php +++ b/plugins/TestRunner/Commands/TestsSetupFixture.php @@ -240,19 +240,6 @@ class TestsSetupFixture extends ConsoleCommand { require_once PIWIK_INCLUDE_PATH . '/libs/PiwikTracker/PiwikTracker.php'; - $fixturesToLoad = array( - '/tests/PHPUnit/Fixtures/*.php', - '/tests/UI/Fixtures/*.php', - '/plugins/*/tests/Fixtures/*.php', - '/plugins/*/Test/Fixtures/*.php', - ); - - foreach($fixturesToLoad as $fixturePath) { - foreach (glob(PIWIK_INCLUDE_PATH . $fixturePath) as $file) { - require_once $file; - } - } - $file = $input->getOption('file'); if ($file) { if (is_file($file)) { diff --git a/tests/PHPUnit/bootstrap.php b/tests/PHPUnit/bootstrap.php index 2b3cdf0146..5eed01f806 100644 --- a/tests/PHPUnit/bootstrap.php +++ b/tests/PHPUnit/bootstrap.php @@ -60,18 +60,6 @@ function setupRootContainer() { setupRootContainer(); // do it in a function so it doesn't appear in $_GLOBALS and so PHPUnit won't try to serialize it. -// require test fixtures -$fixturesToLoad = array( - '/tests/UI/Fixtures/*.php', - '/plugins/*/tests/Fixtures/*.php', - '/plugins/*/Test/Fixtures/*.php', -); -foreach($fixturesToLoad as $fixturePath) { - foreach (glob(PIWIK_INCLUDE_PATH . $fixturePath) as $file) { - require_once $file; - } -} - Locale::setDefaultLocale(); function prepareServerVariables(Config $config) -- GitLab