Fix regression in phpunit
This commit is contained in:
parent
453c8981e8
commit
c2a088c5ff
@ -69,8 +69,6 @@ function checkLoginPassEntity($usertotest, $passwordtotest, $entitytotest, $auth
|
|||||||
|
|
||||||
// Validation of login/pass/entity with standard modules
|
// Validation of login/pass/entity with standard modules
|
||||||
if (empty($login)) {
|
if (empty($login)) {
|
||||||
unset($_SESSION["dol_loginmesg"]);
|
|
||||||
|
|
||||||
$test = true;
|
$test = true;
|
||||||
foreach ($authmode as $mode) {
|
foreach ($authmode as $mode) {
|
||||||
if ($test && $mode && !$login) {
|
if ($test && $mode && !$login) {
|
||||||
@ -113,7 +111,7 @@ function checkLoginPassEntity($usertotest, $passwordtotest, $entitytotest, $auth
|
|||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array('other', 'main', 'errors'));
|
$langs->loadLangs(array('other', 'main', 'errors'));
|
||||||
|
|
||||||
$_SESSION["dol_loginmesg"] = (isset($_SESSION["dol_loginmesg"]) ? $_SESSION["dol_loginmesg"].', ' : '').$langs->transnoentitiesnoconv("ErrorFailedToLoadLoginFileForMode", $mode);
|
$_SESSION["dol_loginmesg"] = (empty($_SESSION["dol_loginmesg"]) ? '' : $_SESSION["dol_loginmesg"].', ').$langs->transnoentitiesnoconv("ErrorFailedToLoadLoginFileForMode", $mode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -604,7 +604,7 @@ class SecurityTest extends PHPUnit\Framework\TestCase
|
|||||||
|
|
||||||
$login=checkLoginPassEntity('admin', 'admin', 1, array('forceuser'));
|
$login=checkLoginPassEntity('admin', 'admin', 1, array('forceuser'));
|
||||||
print __METHOD__." login=".$login."\n";
|
print __METHOD__." login=".$login."\n";
|
||||||
$this->assertEquals($login, ''); // Expected '' because should failed because login 'auto' does not exists
|
$this->assertEquals('', $login, 'Error'); // Expected '' because should failed because login 'auto' does not exists
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user