mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-18 23:08:46 +02:00
Removed MetaModel to write in conf file
This commit is contained in:
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
|||||||
namespace Combodo\iTop\Test\UnitTest\Application;
|
namespace Combodo\iTop\Test\UnitTest\Application;
|
||||||
|
|
||||||
use Combodo\iTop\Test\UnitTest\ItopDataTestCase;
|
use Combodo\iTop\Test\UnitTest\ItopDataTestCase;
|
||||||
|
use Config;
|
||||||
use Exception;
|
use Exception;
|
||||||
use MetaModel;
|
use MetaModel;
|
||||||
|
|
||||||
@@ -17,6 +18,9 @@ class LoginWebPageTest extends ItopDataTestCase
|
|||||||
public function setUp(): void
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
$sConfigPath = MetaModel::GetConfig()->GetLoadedFile();
|
||||||
|
$this->oConfig = new Config($sConfigPath);
|
||||||
|
|
||||||
$this->BackupConfiguration();
|
$this->BackupConfiguration();
|
||||||
$sFolderPath = APPROOT.'env-production/extension-with-delegated-authentication-endpoints-list';
|
$sFolderPath = APPROOT.'env-production/extension-with-delegated-authentication-endpoints-list';
|
||||||
if (file_exists($sFolderPath)) {
|
if (file_exists($sFolderPath)) {
|
||||||
@@ -51,10 +55,10 @@ class LoginWebPageTest extends ItopDataTestCase
|
|||||||
|
|
||||||
protected function GivenConfigFileAllowedLoginTypes($aAllowedLoginTypes): void
|
protected function GivenConfigFileAllowedLoginTypes($aAllowedLoginTypes): void
|
||||||
{
|
{
|
||||||
@chmod(MetaModel::GetConfig()->GetLoadedFile(), 0770);
|
@chmod($this->oConfig->GetLoadedFile(), 0770);
|
||||||
MetaModel::GetConfig()->SetAllowedLoginTypes($aAllowedLoginTypes);
|
$this->oConfig->SetAllowedLoginTypes($aAllowedLoginTypes);
|
||||||
MetaModel::GetConfig()->WriteToFile();
|
$this->oConfig->WriteToFile($this->oConfig->GetLoadedFile());
|
||||||
@chmod(MetaModel::GetConfig()->GetLoadedFile(), 0444);
|
@chmod($this->oConfig->GetLoadedFile(), 0444);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -95,10 +99,10 @@ class LoginWebPageTest extends ItopDataTestCase
|
|||||||
|
|
||||||
public function testWithoutDelegatedAuthenticationEndpointsListWithForceLoginConf()
|
public function testWithoutDelegatedAuthenticationEndpointsListWithForceLoginConf()
|
||||||
{
|
{
|
||||||
@chmod(MetaModel::GetConfig()->GetLoadedFile(), 0770);
|
@chmod($this->oConfig->GetLoadedFile(), 0770);
|
||||||
MetaModel::GetConfig()->Set('security.force_login_when_no_delegated_authentication_endpoints_list', true);
|
$this->oConfig->Set('security.force_login_when_no_delegated_authentication_endpoints_list', true);
|
||||||
MetaModel::GetConfig()->WriteToFile();
|
$this->oConfig->WriteToFile();
|
||||||
@chmod(MetaModel::GetConfig()->GetLoadedFile(), 0444);
|
@chmod($this->oConfig->GetLoadedFile(), 0444);
|
||||||
$sPageContent = $this->CallItopUri(
|
$sPageContent = $this->CallItopUri(
|
||||||
"pages/exec.php?exec_module=extension-without-delegated-authentication-endpoints-list&exec_page=src/Controller/File.php",
|
"pages/exec.php?exec_module=extension-without-delegated-authentication-endpoints-list&exec_page=src/Controller/File.php",
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user