Skip to content
Extraits de code Groupes Projets
Valider bb183ede rédigé par diosmosis's avatar diosmosis
Parcourir les fichiers

Workaround phpunit class loading issue caused by testing environment...

Workaround phpunit class loading issue caused by testing environment variables. Sometimes a test case class will be loaded before phpunit starts running (ie, in bootstrap.php), which causes the phpunit file loader to fail if a path to a test file is specified on the command line.
parent 95358189
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -46,7 +46,13 @@ if (getenv('PIWIK_USE_XHPROF') == 1) { ...@@ -46,7 +46,13 @@ if (getenv('PIWIK_USE_XHPROF') == 1) {
// setup container for tests // setup container for tests
function setupRootContainer() { function setupRootContainer() {
Environment::setGlobalEnvironmentManipulator(new TestingEnvironmentManipulator(new TestingEnvironmentVariables())); // before running tests, delete the TestingEnvironmentVariables file, since it can indirectly mess w/
// phpunit's class loading (if a test class is loaded in bootstrap.php, phpunit can't load it from a file,
// so executing the tests in a file will fail)
$vars = new TestingEnvironmentVariables();
$vars->delete();
Environment::setGlobalEnvironmentManipulator(new TestingEnvironmentManipulator($vars));
$rootTestEnvironment = new \Piwik\Application\Environment(null); $rootTestEnvironment = new \Piwik\Application\Environment(null);
$rootTestEnvironment->init(); $rootTestEnvironment->init();
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter