Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Feature/Auth/SecondFactorTest.php
Show All 26 Lines | class SecondFactorTest extends TestCase | ||||
/** | /** | ||||
* Test that 2FA config is removed from Roundcube database | * Test that 2FA config is removed from Roundcube database | ||||
* on entitlement delete | * on entitlement delete | ||||
*/ | */ | ||||
public function testEntitlementDelete(): void | public function testEntitlementDelete(): void | ||||
{ | { | ||||
// Create the user, and assign 2FA to him, and add Roundcube setup | // Create the user, and assign 2FA to him, and add Roundcube setup | ||||
$sku_2fa = Sku::where('title', '2fa')->first(); | $sku_2fa = Sku::withEnvTenantContext()->where('title', '2fa')->first(); | ||||
$user = $this->getTestUser('entitlement-test@kolabnow.com'); | $user = $this->getTestUser('entitlement-test@kolabnow.com'); | ||||
$user->assignSku($sku_2fa); | $user->assignSku($sku_2fa); | ||||
SecondFactor::seed('entitlement-test@kolabnow.com'); | SecondFactor::seed('entitlement-test@kolabnow.com'); | ||||
$entitlement = Entitlement::where('sku_id', $sku_2fa->id) | $entitlement = Entitlement::where('sku_id', $sku_2fa->id) | ||||
->where('entitleable_id', $user->id) | ->where('entitleable_id', $user->id) | ||||
->first(); | ->first(); | ||||
Show All 20 Lines |