PMCORE-3909 PMCORE-3905: Add option to disable session warning in web entry when "Require user login" is selected

This commit is contained in:
Roly Gutierrez
2022-08-11 19:00:12 -04:00
parent 7aeb33e475
commit 9135a175bb
23 changed files with 224 additions and 76 deletions

View File

@@ -781,6 +781,7 @@
"WE_TYPE": "SINGLE",
"WE_AUTHENTICATION": "ANONYMOUS",
"WE_HIDE_INFORMATION_BAR": "1",
"WE_HIDE_ACTIVE_SESSION_WARNING": "0",
"WE_CALLBACK": "PROCESSMAKER",
"WE_CALLBACK_URL": "",
"WE_LINK_GENERATION": "DEFAULT",

View File

@@ -99,4 +99,42 @@ class WebEntryTest extends TestCase
$isWebEntry = BmWebEntry::isWebEntry($emptyProcess, $emptyFilePath);
$this->assertFalse($isWebEntry);
}
/**
* Test the method verifyHideActiveSessionWarningOption()
* @test
* @covers \ProcessMaker\BusinessModel\WebEntry::verifyHideActiveSessionWarningOption()
*/
public function it_should_test_verifyHideActiveSessionWarningOption_method()
{
// Initializing variables
$phpExtension = '.php';
$postFileExtension = 'Post.php';
$infoFileExtension = 'Info.php';
$webEntryFilename = 'My_Custom_Form';
//assert true result
$webEntry = factory(WebEntry::class)->create([
'WE_DATA' => $webEntryFilename . $phpExtension,
'WE_HIDE_ACTIVE_SESSION_WARNING' => '0'
]);
$weUid = $webEntry->WE_UID;
$webEntry = new BmWebEntry();
$result = $webEntry->verifyHideActiveSessionWarningOption($weUid);
$this->assertEquals($result, true);
//assert false result
$webEntry = factory(WebEntry::class)->create([
'WE_DATA' => $webEntryFilename . $phpExtension,
'WE_HIDE_ACTIVE_SESSION_WARNING' => '1'
]);
$weUid = $webEntry->WE_UID;
$webEntry = new BmWebEntry();
$result = $webEntry->verifyHideActiveSessionWarningOption($weUid);
$this->assertEquals($result, false);
}
}