From e699711b365f0e343702e41ecf50d8e025cf5f4a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Feb 2012 01:36:01 +0100 Subject: [PATCH] Fix: Add a test to be sure PHPunit tests are run with correct language. --- test/phpunit/AllTests.php | 6 ++++++ test/phpunit/ContactTest.php | 1 + 2 files changed, 7 insertions(+) diff --git a/test/phpunit/AllTests.php b/test/phpunit/AllTests.php index 28d4f8cf7b3..5e898adc897 100644 --- a/test/phpunit/AllTests.php +++ b/test/phpunit/AllTests.php @@ -31,6 +31,12 @@ global $conf,$user,$langs,$db; require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; +if ($langs->defaultlang != 'en_US') +{ + print "Error: Default language for company to run tests must be set to en_US or auto. Current is ".$langs->defaultlang."\n"; + exit; +} + if (empty($user->id)) { print "Load permissions for admin user nb 1\n"; diff --git a/test/phpunit/ContactTest.php b/test/phpunit/ContactTest.php index 84ad96e5e98..331de748cd9 100755 --- a/test/phpunit/ContactTest.php +++ b/test/phpunit/ContactTest.php @@ -36,6 +36,7 @@ if (empty($user->id)) $user->fetch(1); $user->getrights(); } + $conf->global->MAIN_DISABLE_ALL_MAILS=1;