mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-21 09:38:48 +02:00
✅ N°4367 Fix \privUITransactionFileTest::testIsTransactionValid
Was crashing because of limitations on loading User objects
This commit is contained in:
@@ -148,11 +148,15 @@ class privUITransactionFileTest extends ItopDataTestCase
|
||||
*/
|
||||
public function testIsTransactionValid()
|
||||
{
|
||||
$this->markTestSkipped('on Jenkins, develop branch we have "Login with user2 throw an error"');
|
||||
|
||||
$this->CreateUser(static::USER1_TEST_LOGIN, self::SAMPLE_DATA_SUPPORT_PROFILE_ID);
|
||||
$this->CreateUser(static::USER2_TEST_LOGIN, self::SAMPLE_DATA_SUPPORT_PROFILE_ID);
|
||||
|
||||
// created users aren't admin, so each one can't see the other (\UserRights::GetSelectFilter)
|
||||
// If calling \UserRights::Login(user1) then \UserRights::Login(user2) we won't be able to load user2 !
|
||||
// As now we are in the admin context, we are calling FindUser() directly so that user objects will be saved in the UserRights cache !
|
||||
// user1 can be omitted as the first \UserRights::Login cache will initialize the UserRights cache
|
||||
$this->InvokeNonPublicStaticMethod(UserRights::class, 'FindUser', [self::USER2_TEST_LOGIN]);
|
||||
|
||||
// create token in the user1 context
|
||||
$bUser1Login1 = UserRights::Login(self::USER1_TEST_LOGIN);
|
||||
$this->assertTrue($bUser1Login1, 'Login with user1 throw an error');
|
||||
|
||||
Reference in New Issue
Block a user