diff --git a/config/default.php b/config/default.php index a2090a7468..20caad0ffb 100644 --- a/config/default.php +++ b/config/default.php @@ -230,7 +230,7 @@ 'enabled' => filter_var(env('PASSBOLT_PLUGINS_RESOURCE_TYPES_ENABLED', true), FILTER_VALIDATE_BOOLEAN) ], 'totpResourceTypes' => [ - 'enabled' => filter_var(env('PASSBOLT_PLUGINS_TOTP_RESOURCE_TYPES_ENABLED', false), FILTER_VALIDATE_BOOLEAN), + 'enabled' => filter_var(env('PASSBOLT_PLUGINS_TOTP_RESOURCE_TYPES_ENABLED', true), FILTER_VALIDATE_BOOLEAN), ], 'mobile' => [ 'enabled' => filter_var(env('PASSBOLT_PLUGINS_MOBILE_ENABLED', true), FILTER_VALIDATE_BOOLEAN) diff --git a/plugins/PassboltCe/TotpResourceTypes/tests/TestCase/Controller/ResourceTypes/ResourceTypesIndexControllerTest.php b/plugins/PassboltCe/TotpResourceTypes/tests/TestCase/Controller/ResourceTypes/ResourceTypesIndexControllerTest.php index 5b404b2a23..89fb444a74 100644 --- a/plugins/PassboltCe/TotpResourceTypes/tests/TestCase/Controller/ResourceTypes/ResourceTypesIndexControllerTest.php +++ b/plugins/PassboltCe/TotpResourceTypes/tests/TestCase/Controller/ResourceTypes/ResourceTypesIndexControllerTest.php @@ -31,26 +31,6 @@ class ResourceTypesIndexControllerTest extends AppIntegrationTestCase { use ResourceTypesModelTrait; - /** - * @inheritDoc - */ - public function setUp(): void - { - parent::setUp(); - - $this->enableFeaturePlugin(TotpResourceTypesPlugin::class); - } - - /** - * @inheritDoc - */ - public function tearDown(): void - { - parent::tearDown(); - - $this->disableFeaturePlugin(TotpResourceTypesPlugin::class); - } - public function testResourceTypesIndex_Success_WithTotpResourceTypes() { $this->loadFixtureScenario(ResourceTypesScenario::class); diff --git a/plugins/PassboltCe/TotpResourceTypes/tests/TestCase/Controller/Settings/SettingsIndexControllerTest.php b/plugins/PassboltCe/TotpResourceTypes/tests/TestCase/Controller/Settings/SettingsIndexControllerTest.php index 864a741aa5..c0b3b02e46 100644 --- a/plugins/PassboltCe/TotpResourceTypes/tests/TestCase/Controller/Settings/SettingsIndexControllerTest.php +++ b/plugins/PassboltCe/TotpResourceTypes/tests/TestCase/Controller/Settings/SettingsIndexControllerTest.php @@ -18,7 +18,6 @@ namespace Passbolt\TotpResourceTypes\Test\TestCase\Controller\Settings; use App\Test\Lib\AppIntegrationTestCase; -use Passbolt\TotpResourceTypes\TotpResourceTypesPlugin; class SettingsIndexControllerTest extends AppIntegrationTestCase { @@ -27,8 +26,8 @@ public function testSettingsIndexController_SuccessAsLU() $this->logInAsUser(); $this->getJson('/settings.json?api-version=2'); $this->assertSuccess(); - // Assert TOTP resource type disabled by default - $this->assertFalse($this->_responseJsonBody->passbolt->plugins->totpResourceTypes->enabled); + // Assert TOTP resource type enabled by default + $this->assertTrue($this->_responseJsonBody->passbolt->plugins->totpResourceTypes->enabled); } public function testSettingsIndexController_SuccessAsAN() @@ -38,16 +37,4 @@ public function testSettingsIndexController_SuccessAsAN() // Assert TOTP resource type plugin is not visible for anonymous users $this->assertObjectNotHasAttribute('totpResourceTypes', $this->_responseJsonBody->passbolt->plugins); } - - public function testSettingsIndexController_Success_TotpResourceTypeEnabled() - { - $this->logInAsUser(); - // Enable TotpResourceType plugin - $this->enableFeaturePlugin(TotpResourceTypesPlugin::class); - - $this->getJson('/settings.json?api-version=2'); - - $this->assertSuccess(); - $this->assertTrue($this->_responseJsonBody->passbolt->plugins->totpResourceTypes->enabled); - } } diff --git a/tests/Lib/SolutionBootstrapperTestCase.php b/tests/Lib/SolutionBootstrapperTestCase.php index 8b826b239e..1aca89837f 100644 --- a/tests/Lib/SolutionBootstrapperTestCase.php +++ b/tests/Lib/SolutionBootstrapperTestCase.php @@ -23,7 +23,6 @@ use Cake\Utility\Hash; use Passbolt\EmailDigest\Utility\Digest\DigestsPool; use Passbolt\EmailNotificationSettings\Utility\EmailNotificationSettings; -use Passbolt\TotpResourceTypes\TotpResourceTypesPlugin; abstract class SolutionBootstrapperTestCase extends TestCase { @@ -42,14 +41,12 @@ public function setUp(): void $this->clearPlugins(); DigestsPool::clearInstance(); EmailNotificationSettings::flushCache(); - $this->enableFeaturePlugin(TotpResourceTypesPlugin::class); } public function tearDown(): void { $this->clearPlugins(); unset($this->app); - $this->disableFeaturePlugin(TotpResourceTypesPlugin::class); parent::tearDown(); }