From 5eac1b8730fcec64a60398239567275cd2e75fc0 Mon Sep 17 00:00:00 2001 From: Pierre Goiffon Date: Mon, 2 May 2022 15:24:59 +0200 Subject: [PATCH 1/4] =?UTF-8?q?:wrench:=20N=C2=B03091=20PHPunit=20XML=20:?= =?UTF-8?q?=20fix=20correct=20PHP=20INI=20settings=20see=20https://phpunit?= =?UTF-8?q?.readthedocs.io/en/8.5/configuration.html#the-php-element?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/phpunit.xml.dist | 6 ++++-- test/postbuild_integration.xml.dist | 7 +++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/test/phpunit.xml.dist b/test/phpunit.xml.dist index c4ed78656..54035eebd 100644 --- a/test/phpunit.xml.dist +++ b/test/phpunit.xml.dist @@ -18,8 +18,10 @@ > - - + + + + diff --git a/test/postbuild_integration.xml.dist b/test/postbuild_integration.xml.dist index 34aab85da..0a3ce6ef0 100644 --- a/test/postbuild_integration.xml.dist +++ b/test/postbuild_integration.xml.dist @@ -17,6 +17,13 @@ verbose="true" > + + + + + + + postbuild_integration From c5527c106cc71cb50cf549877bf55a8576fa23ae Mon Sep 17 00:00:00 2001 From: Pierre Goiffon Date: Mon, 2 May 2022 15:33:39 +0200 Subject: [PATCH 2/4] =?UTF-8?q?:wrench:=20N=C2=B03091=20PHPunit=20XML=20:?= =?UTF-8?q?=20set=20columns?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/phpunit.xml.dist | 1 + 1 file changed, 1 insertion(+) diff --git a/test/phpunit.xml.dist b/test/phpunit.xml.dist index 54035eebd..89f595a4a 100644 --- a/test/phpunit.xml.dist +++ b/test/phpunit.xml.dist @@ -5,6 +5,7 @@ bootstrap="unittestautoload.php" backupGlobals="true" colors="true" + columns="120" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" From 4646a05c7a4e039a383ad37b180383d57a8a32da Mon Sep 17 00:00:00 2001 From: Pierre Goiffon Date: Tue, 3 May 2022 09:01:56 +0200 Subject: [PATCH 3/4] =?UTF-8?q?N=C2=B04824=20Update=20consumers=20after=20?= =?UTF-8?q?swiftmailer/swiftmailer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Multiple things to do as there were some changes in 6.0 Reference : https://github.com/swiftmailer/swiftmailer/blob/master/CHANGES#L107 * Fix "Call to undefined method Swift_Message::newInstance()" exception in notifications * Fix removed Swift_MailTransport --- core/email.class.inc.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/core/email.class.inc.php b/core/email.class.inc.php index 36122e56f..c303bf029 100644 --- a/core/email.class.inc.php +++ b/core/email.class.inc.php @@ -58,7 +58,7 @@ class EMail public function __construct() { $this->m_aData = array(); - $this->m_oMessage = Swift_Message::newInstance(); + $this->m_oMessage = new Swift_Message(); $this->SetRecipientFrom(MetaModel::GetConfig()->Get('email_default_sender_address'), MetaModel::GetConfig()->Get('email_default_sender_label')); } @@ -172,7 +172,7 @@ class EMail $sUserName = self::$m_oConfig->Get('email_transport_smtp.username'); $sPassword = self::$m_oConfig->Get('email_transport_smtp.password'); - $oTransport = Swift_SmtpTransport::newInstance($sHost, $sPort, $sEncryption); + $oTransport = new Swift_SmtpTransport($sHost, $sPort, $sEncryption); if (strlen($sUserName) > 0) { $oTransport->setUsername($sUserName); @@ -181,20 +181,20 @@ class EMail break; case 'Null': - $oTransport = Swift_NullTransport::newInstance(); + $oTransport = new Swift_NullTransport(); break; case 'LogFile': - $oTransport = Swift_LogFileTransport::newInstance(); + $oTransport = new Swift_LogFileTransport(); $oTransport->setLogFile(APPROOT.'log/mail.log'); break; case 'PHPMail': default: - $oTransport = Swift_MailTransport::newInstance(); + $oTransport = new Swift_SendmailTransport(); } - $oMailer = Swift_Mailer::newInstance($oTransport); + $oMailer = new Swift_Mailer($oTransport); $aFailedRecipients = array(); $this->m_oMessage->setMaxLineLength(0); @@ -364,7 +364,7 @@ class EMail $this->m_aData['attachments'] = array(); } $this->m_aData['attachments'][] = array('data' => base64_encode($data), 'filename' => $sFileName, 'mimeType' => $sMimeType); - $this->m_oMessage->attach(Swift_Attachment::newInstance($data, $sFileName, $sMimeType)); + $this->m_oMessage->attach(new Swift_Attachment($data, $sFileName, $sMimeType)); } public function SetSubject($sSubject) From b348e0ff275107f365bad85ea82f26240ba24c8b Mon Sep 17 00:00:00 2001 From: Pierre Goiffon Date: Tue, 3 May 2022 10:51:48 +0200 Subject: [PATCH 4/4] =?UTF-8?q?:wrench:=20N=C2=B03091=20PHPunit=20XML=20:?= =?UTF-8?q?=20change=20html=5Ferrors=20PHP=20setting=20We=20are=20outputti?= =?UTF-8?q?ng=20to=20console,=20and=20will=20get=20results=20in=20Jenkins?= =?UTF-8?q?=20or=20terminal,=20so=20no=20HTML=20please=20:o)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/phpunit.xml.dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/phpunit.xml.dist b/test/phpunit.xml.dist index 89f595a4a..47ecd5e43 100644 --- a/test/phpunit.xml.dist +++ b/test/phpunit.xml.dist @@ -22,7 +22,7 @@ - +