PMCORE-3880 PhpUnit: Error: Call to undefined function factory

This commit is contained in:
Roly Gutierrez
2022-07-21 00:04:21 -04:00
parent 99fa155266
commit 01833eb210
295 changed files with 6494 additions and 4762 deletions

View File

@@ -1596,7 +1596,7 @@ class PmDynaform
$this->record["DYN_CONTENT"] = G::json_encode($json);
}
private function jsonReplace(&$json, $id, $for = "id", $update)
private function jsonReplace(&$json, $id, $for = "id", $update = null)
{
foreach ($json as $key => &$value) {
$sw1 = is_array($value);

View File

@@ -324,7 +324,7 @@ class ReportTables
* @param array $fields
* @return string
*/
private function buildFieldsSection(string $fieldsSection = "", array $fields): string
private function buildFieldsSection(string $fieldsSection = "", array $fields = []): string
{
foreach ($fields as $field) {
$fieldsSection = $fieldsSection . ", `{$field['sFieldName']}`";
@@ -341,7 +341,7 @@ class ReportTables
* @param MySQLiConnection $connection
* @return string
*/
private function buildValuesSection(string $valuesSection = "", array $fields, array $appData, MySQLiConnection $connection): string
private function buildValuesSection(string $valuesSection = "", array $fields = [], array $appData = [], MySQLiConnection $connection = null): string
{
foreach ($fields as $field) {
switch ($field['sType']) {

View File

@@ -620,9 +620,9 @@ class SpoolRun
}
$phpMailer->Body = $msBody;
//Attachments
$attachment = @unserialize($this->fileData['attachments']);
if ($attachment === false) {
$attachment = $this->fileData['attachments'];
$attachment = $this->fileData['attachments'];
if (is_string($attachment)) {
$attachment = @unserialize($attachment);
}
if (is_array($attachment)) {
foreach ($attachment as $key => $fileAttach) {

View File

@@ -1779,7 +1779,7 @@ class WorkspaceTools
* @param int $versionBackupEngine
* @param string $connection
*/
public function executeSQLScript($database, $filename, $parameters, $versionBackupEngine = 1, $connection)
public function executeSQLScript($database, $filename, $parameters, $versionBackupEngine = 1, $connection = '')
{
DB::connection($connection)
->statement('CREATE DATABASE IF NOT EXISTS ' . $database);

View File

@@ -367,13 +367,13 @@ class Users extends BaseUsers
$arrayData["birthday"] = $fields["USR_BIRTHDAY"];
$arrayData["position"] = $fields["USR_POSITION"];
$arrayData["replacedby"] = $fields["USR_REPLACED_BY"];
if(strlen($arrayData["replacedby"] != 0)) {
if(strlen($arrayData["replacedby"]) != 0) {
$oUser = UsersPeer::retrieveByPK($arrayData["replacedby"]);
$arrayData["replacedbyfullname"] = $oUser->getUsrFirstname() . ' ' . $oUser->getUsrLastname();
}
$arrayData["duedate"] = $fields["USR_DUE_DATE"];
$arrayData["calendar"] = $fields["USR_CALENDAR"];
if(strlen($fields["USR_CALENDAR"] != 0)) {
if(strlen($fields["USR_CALENDAR"]) != 0) {
$arrayData["calendarname"] = $calendar->calendarName($fields["USR_CALENDAR"]);
}
$arrayData["status"] = $fields["USR_STATUS"];