Merge remote-tracking branch 'origin/support/3.0' into support/3.1

# Conflicts:
#	tests/php-unit-tests/integration-tests/DictionariesConsistencyTest.php
#	tests/php-unit-tests/src/BaseTestCase/ItopTestCase.php
#	tests/php-unit-tests/unitary-tests/core/CMDBSource/TransactionsTest.php
#	tests/php-unit-tests/unitary-tests/sources/Application/TwigBase/Twig/TwigTest.php
This commit is contained in:
Romain Quetiez
2023-10-27 14:12:06 +02:00
23 changed files with 315 additions and 198 deletions

View File

@@ -48,12 +48,7 @@ class UserRightsTest extends ItopDataTestCase
{
parent::setUp();
try {
utils::GetConfig()->SetModuleSetting('authent-local', 'password_validation.pattern', '');
self::CreateUser('admin', 1);
}
catch (CoreCannotSaveObjectException $e) {
}
utils::GetConfig()->SetModuleSetting('authent-local', 'password_validation.pattern', '');
}
public static $aClasses = [
@@ -103,6 +98,15 @@ class UserRightsTest extends ItopDataTestCase
public function testLogin($sLogin, $bResult)
{
$_SESSION = [];
if ($sLogin == 'admin') {
// Fixture data required in this case only
try {
self::CreateUser('admin', 1);
}
catch (CoreCannotSaveObjectException $e) {
// The admin account could exist, depending on where and when the test suite is executed
}
}
$this->assertEquals($bResult, UserRights::Login($sLogin));
$this->assertEquals($bResult, UserRights::IsLoggedIn());
UserRights::Logoff();
@@ -487,8 +491,7 @@ class UserRightsTest extends ItopDataTestCase
];
}
/**
* @runInSeparateProcess
*@dataProvider NonAdminCannotListAdminProfilesProvider
* @dataProvider NonAdminCannotListAdminProfilesProvider
*/
public function testNonAdminCannotListAdminProfiles($bHideAdministrators, $iExpectedCount)
{