OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
cream
/
Xpress
/
vendor
/
phpmailer
/
phpmailer
/
test
/
PHPMailer
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
05/19/2025 10:07:16 AM
rwxr-xr-x
📄
AddEmbeddedImageTest.php
6.45 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
AddStringAttachmentTest.php
5.19 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
AddStringEmbeddedImageTest.php
5.53 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
AddrFormatTest.php
2.08 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
AuthCRAMMD5Test.php
1.54 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
CustomHeaderTest.php
9.2 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
DKIMTest.php
9.51 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
DSNConfiguratorTest.php
6.49 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
EncodeQTest.php
3.96 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
EncodeStringTest.php
4.58 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
FileIsAccessibleTest.php
3.32 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
FilenameToTypeTest.php
2.22 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
GenerateIdTest.php
2.63 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
GetLastMessageIDTest.php
3.32 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
HasLineLongerThanMaxTest.php
4.69 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
Html2TextTest.php
9.79 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
ICalTest.php
4.32 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
IsPermittedPathTest.php
3.74 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
IsValidHostTest.php
4.18 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
LocalizationTest.php
18.51 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
MailTransportTest.php
3.67 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
MbPathinfoTest.php
5.74 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
MimeTypesTest.php
1.93 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
NormalizeBreaksTest.php
3.62 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
PHPMailerTest.php
47.39 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
ParseAddressesTest.php
14.27 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
PunyencodeAddressTest.php
4.77 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
QuotedStringTest.php
2.08 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
ReplyToGetSetClearTest.php
17.23 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
SetErrorTest.php
5.19 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
SetFromTest.php
7.08 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
SetTest.php
2.32 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
SetWordWrapTest.php
4.01 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
Utf8CharBoundaryTest.php
1.95 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
ValidateAddressCustomValidatorTest.php
3.65 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
ValidateAddressTest.php
17.2 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
WrapTextTest.php
6.05 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
XMailerTest.php
2 KB
05/19/2025 10:07:16 AM
rw-r--r--
Editing: NormalizeBreaksTest.php
Close
<?php /** * PHPMailer - PHP email transport unit tests. * PHP version 5.5. * * @author Marcus Bointon <phpmailer@synchromedia.co.uk> * @author Andy Prevost * @copyright 2012 - 2020 Marcus Bointon * @copyright 2004 - 2009 Andy Prevost * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License */ namespace PHPMailer\Test\PHPMailer; use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\Test\TestCase as MailerTestCase; use Yoast\PHPUnitPolyfills\TestCases\TestCase; /** * Test normalize line breaks functionality. * * @covers \PHPMailer\PHPMailer\PHPMailer::normalizeBreaks */ final class NormalizeBreaksTest extends TestCase { /** * Test line break normalization. * * @dataProvider dataNormalizeBreaks * * @param string $input Input text string. * @param string $expected Expected function output. * @param string $breaktype Optional. What kind of line break to use. */ public function testNormalizeBreaks($input, $expected, $breaktype = null) { $result = PHPMailer::normalizeBreaks($input, $breaktype); self::assertSame($expected, $result, 'Line break reformatting failed'); } /** * Data provider. * * @return array */ public function dataNormalizeBreaks() { $LE = PHPMailer::getLE(); $baseExpected = 'hello' . PHPMailer::CRLF . 'World' . PHPMailer::CRLF . 'Again' . PHPMailer::CRLF; return [ 'Text without line breaks' => [ 'input' => 'hello World!', 'expected' => 'hello World!', ], 'Unix line breaks' => [ 'input' => "hello\nWorld\nAgain\n", 'expected' => $baseExpected, ], 'Mac line breaks' => [ 'input' => "hello\rWorld\rAgain\r", 'expected' => $baseExpected, ], 'Windows line breaks' => [ 'input' => "hello\r\nWorld\r\nAgain\r\n", 'expected' => $baseExpected, ], 'Mixed line breaks' => [ 'input' => "hello\nWorld\rAgain\r\n", 'expected' => $baseExpected, ], 'Mac line breaks, enforce Unix' => [ 'input' => "1\r2\r3\r", 'expected' => "1\n2\n3\n", 'breaktype' => "\n", ], 'Unix line breaks, enforce Mac' => [ 'input' => "1\n2\n3\n", 'expected' => "1\r2\r3\r", 'breaktype' => "\r", ], 'Mixed line breaks, enforce preset' => [ 'input' => "1\r\n2\r3\n", 'expected' => "1{$LE}2{$LE}3{$LE}", 'breaktype' => $LE, ], ]; } /** * Test line break normalization with a custom line ending setting. */ public function testNormalizeBreaksWithCustomLineEnding() { $input = "hello\rWorld\rAgain\r"; $expected = "hello\n\rWorld\n\rAgain\n\r"; $origLE = PHPMailer::getLE(); MailerTestCase::updateStaticProperty(PHPMailer::class, 'LE', "\n\r"); $result = PHPMailer::normalizeBreaks($input); /* * Reset the static property *before* the assertion to ensure the reset executes * even when the test would fail. */ MailerTestCase::updateStaticProperty(PHPMailer::class, 'LE', $origLE); self::assertSame($expected, $result, 'Line break reformatting failed'); } }