+ Fix web entry login bloqued when session_block configuration is enabled.
+ Include behat test.
This commit is contained in:
davidcallizaya
2017-07-04 16:51:24 -04:00
parent 966c2890fe
commit cb80a42125
16 changed files with 4256 additions and 261 deletions

View File

@@ -26,6 +26,11 @@ class WorkflowTestCase extends TestCase
$pdo->exec(file_get_contents(PATH_RBAC_CORE.'data/mysql/schema.sql'));
$pdo->exec(file_get_contents(PATH_CORE.'data/mysql/insert.sql'));
$pdo->exec(file_get_contents(PATH_RBAC_CORE.'data/mysql/insert.sql'));
$pdo->exec("INSERT INTO `APP_SEQUENCE` (`ID`) VALUES ('1')");
$pdo->exec("INSERT INTO `OAUTH_CLIENTS` (`CLIENT_ID`, `CLIENT_SECRET`, `CLIENT_NAME`, `CLIENT_DESCRIPTION`, `CLIENT_WEBSITE`, `REDIRECT_URI`, `USR_UID`) VALUES
('x-pm-local-client', '179ad45c6ce2cb97cf1029e212046e81', 'PM Web Designer', 'ProcessMaker Web Designer App', 'www.processmaker.com', 'http://".$_SERVER["HTTP_HOST"].":".$_SERVER['SERVER_PORT']."/sys".SYS_SYS."/en/neoclassic/oauth2/grant', '00000000000000000000000000000001');");
$pdo->exec("INSERT INTO `OAUTH_ACCESS_TOKENS` (`ACCESS_TOKEN`, `CLIENT_ID`, `USER_ID`, `EXPIRES`, `SCOPE`) VALUES
('39704d17049f5aef45e884e7b769989269502f83', 'x-pm-local-client', '00000000000000000000000000000001', '2017-06-15 17:55:19', 'view_processes edit_processes *');");
}
/**
@@ -114,4 +119,81 @@ class WorkflowTestCase extends TestCase
}
return rmdir($dir);
}
/**
* Set specific env.ini configuration.
*
* @param type $param
* @param type $value
*/
protected function setEnvIni($param, $value)
{
$config = file_get_contents(PATH_CONFIG.'env.ini');
if (substr($config, -1, 1) !== "\n") {
$config.="\n";
}
$regexp = '/^\s*'.preg_quote($param).'\s*=\s*.*\n$/m';
if (preg_match($regexp, $config."\n")) {
if ($value === null) {
$config = preg_replace($regexp, "", $config);
} else {
$value1 = is_numeric($value) ? $value : json_encode($value, true);
$config = preg_replace($regexp, "$param = $value1\n", $config);
}
} elseif ($value !== null) {
$value1 = is_numeric($value) ? $value : json_encode($value, true);
$config.="$param = $value1\n";
}
file_put_contents(PATH_CONFIG.'env.ini', $config);
}
/**
* Unset specific env.ini configuration.
*
* @param type $param
*/
protected function unsetEnvIni($param)
{
$this->setEnvIni($param, null);
}
/**
* Installa an licese file.
*
* @param type $path
* @throws \Exception
*/
protected function installLicense($path)
{
$licenseFile = glob($path);
if (!$licenseFile) {
throw new \Exception('To continue please put a valid license at features/resources');
}
G::LoadClass('pmLicenseManager');
$licenseManager = new pmLicenseManager();
$licenseManager->installLicense($licenseFile[0]);
}
/**
* Add a PM configuration.
*
* @return \Configurations
*/
protected function config($config=[]){
$configGetStarted = new \Configuration;
$data = array_merge([
'OBJ_UID' => '',
'PRO_UID' => '',
'USR_UID' => '',
'APP_UID' => '',
], $config);
$configGetStarted->create($data);
}
protected function getBaseUrl($url)
{
return (\G::is_https() ? "https://" : "http://").
$GLOBALS["APP_HOST"].':'.$GLOBALS['SERVER_PORT']."/sys".SYS_SYS."/".
SYS_LANG."/".SYS_SKIN."/".$url;
}
}