OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
3-31-025chanakya
/
Xpress
/
vendor
/
phpmailer
/
phpmailer
/
test
/
PHPMailer
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
03/26/2025 04:28:13 AM
rwxr-xr-x
📄
AddEmbeddedImageTest.php
6.45 KB
03/26/2025 04:24:29 AM
rw-r--r--
📄
AddStringAttachmentTest.php
5.19 KB
03/26/2025 04:24:29 AM
rw-r--r--
📄
AddStringEmbeddedImageTest.php
5.53 KB
03/26/2025 04:24:29 AM
rw-r--r--
📄
AddrFormatTest.php
2.08 KB
03/26/2025 04:24:29 AM
rw-r--r--
📄
AuthCRAMMD5Test.php
1.54 KB
03/26/2025 04:24:29 AM
rw-r--r--
📄
CustomHeaderTest.php
9.2 KB
03/26/2025 04:24:29 AM
rw-r--r--
📄
DKIMTest.php
9.51 KB
03/26/2025 04:24:29 AM
rw-r--r--
📄
DSNConfiguratorTest.php
6.49 KB
03/26/2025 04:24:29 AM
rw-r--r--
📄
EncodeQTest.php
3.96 KB
03/26/2025 04:24:29 AM
rw-r--r--
📄
EncodeStringTest.php
4.58 KB
03/26/2025 04:24:29 AM
rw-r--r--
📄
FileIsAccessibleTest.php
3.32 KB
03/26/2025 04:24:29 AM
rw-r--r--
📄
FilenameToTypeTest.php
2.22 KB
03/26/2025 04:24:29 AM
rw-r--r--
📄
GenerateIdTest.php
2.63 KB
03/26/2025 04:24:29 AM
rw-r--r--
📄
GetLastMessageIDTest.php
3.32 KB
03/26/2025 04:24:29 AM
rw-r--r--
📄
HasLineLongerThanMaxTest.php
4.69 KB
03/26/2025 04:24:29 AM
rw-r--r--
📄
Html2TextTest.php
9.79 KB
03/26/2025 04:24:29 AM
rw-r--r--
📄
ICalTest.php
4.32 KB
03/26/2025 04:24:29 AM
rw-r--r--
📄
IsPermittedPathTest.php
3.74 KB
03/26/2025 04:24:29 AM
rw-r--r--
📄
IsValidHostTest.php
4.18 KB
03/26/2025 04:24:29 AM
rw-r--r--
📄
LocalizationTest.php
18.51 KB
03/26/2025 04:24:29 AM
rw-r--r--
📄
MailTransportTest.php
3.67 KB
03/26/2025 04:24:29 AM
rw-r--r--
📄
MbPathinfoTest.php
5.74 KB
03/26/2025 04:24:29 AM
rw-r--r--
📄
MimeTypesTest.php
1.93 KB
03/26/2025 04:24:29 AM
rw-r--r--
📄
NormalizeBreaksTest.php
3.62 KB
03/26/2025 04:24:29 AM
rw-r--r--
📄
PHPMailerTest.php
47.39 KB
03/26/2025 04:24:30 AM
rw-r--r--
📄
ParseAddressesTest.php
14.27 KB
03/26/2025 04:24:29 AM
rw-r--r--
📄
PunyencodeAddressTest.php
4.77 KB
03/26/2025 04:24:30 AM
rw-r--r--
📄
QuotedStringTest.php
2.08 KB
03/26/2025 04:24:30 AM
rw-r--r--
📄
ReplyToGetSetClearTest.php
17.23 KB
03/26/2025 04:24:30 AM
rw-r--r--
📄
SetErrorTest.php
5.19 KB
03/26/2025 04:24:30 AM
rw-r--r--
📄
SetFromTest.php
7.08 KB
03/26/2025 04:24:30 AM
rw-r--r--
📄
SetTest.php
2.32 KB
03/26/2025 04:24:30 AM
rw-r--r--
📄
SetWordWrapTest.php
4.01 KB
03/26/2025 04:24:30 AM
rw-r--r--
📄
Utf8CharBoundaryTest.php
1.95 KB
03/26/2025 04:24:30 AM
rw-r--r--
📄
ValidateAddressCustomValidatorTest.php
3.65 KB
03/26/2025 04:24:30 AM
rw-r--r--
📄
ValidateAddressTest.php
17.2 KB
03/26/2025 04:24:30 AM
rw-r--r--
📄
WrapTextTest.php
6.05 KB
03/26/2025 04:24:30 AM
rw-r--r--
📄
XMailerTest.php
2 KB
03/26/2025 04:24:30 AM
rw-r--r--
Editing: SetWordWrapTest.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\Test\PreSendTestCase; /** * Test automatic wordwrap functionality. * * @covers \PHPMailer\PHPMailer\PHPMailer::setWordWrap * @covers \PHPMailer\PHPMailer\PHPMailer::wrapText */ final class SetWordWrapTest extends PreSendTestCase { /** * Test word-wrapping a message. * * @dataProvider dataWordWrap * * @param int $wrapAt The number of characters to wrap at. * @param string $message The message to use. * @param string $subjectSuffix Subject suffix to use. */ public function testWordWrap($wrapAt, $message, $subjectSuffix) { $this->Mail->WordWrap = $wrapAt; $my_body = str_repeat($message, 10); $nBodyLen = strlen($my_body); $my_body .= "\n\nThis is the above body length: " . $nBodyLen; $this->Mail->Body = $my_body; $this->Mail->Subject .= ': ' . $subjectSuffix; $this->buildBody(); $originalLines = explode("\n", $this->Mail->Body); $this->Mail->preSend(); $lines = explode("\n", $this->Mail->Body); self::assertGreaterThanOrEqual( count($originalLines), count($lines), 'Line count of message less than expected' ); foreach ($lines as $i => $line) { self::assertLessThanOrEqual( $wrapAt, strlen(trim($line)), 'Character count for line ' . ($i + 1) . ' does not comply with the expected ' . $wrapAt . ' characters.' . PHP_EOL . 'Line contents: "' . $line . '"' ); } } /** * Data provider. * * @return array */ public function dataWordWrap() { return [ 'ascii message' => [ 'wrapAt' => 40, 'message' => 'Here is the main body of this message. It should ' . 'be quite a few lines. It should be wrapped at ' . '40 characters. Make sure that it is. ', 'subjectSuffix' => 'Wordwrap', ], 'multibyte message' => [ 'wrapAt' => 40, 'message' => '飛兒樂 團光茫 飛兒樂 團光茫 飛兒樂 團光茫 飛兒樂 團光茫 ' . '飛飛兒樂 團光茫兒樂 團光茫飛兒樂 團光飛兒樂 團光茫飛兒樂 團光茫兒樂 團光茫 ' . '飛兒樂 團光茫飛兒樂 團飛兒樂 團光茫光茫飛兒樂 團光茫. ', 'subjectSuffix' => 'Wordwrap multibyte', ], ]; } /** * Test explicitly NOT word-wrapping a message. */ public function testNoWordWrap() { $this->Mail->WordWrap = 0; $my_body = str_repeat('Irrelevant text, we\'re not wrapping', 10); $nBodyLen = strlen($my_body); $my_body .= "\n\nLong unwrapped message: " . $nBodyLen; $this->Mail->Body = $my_body; $this->Mail->Subject .= ': No wordwrap'; $this->buildBody(); $originalLines = explode("\n", $this->Mail->Body); $this->Mail->preSend(); $lines = explode("\n", $this->Mail->Body); self::assertSameSize($originalLines, $lines, 'Line count of message has changed'); foreach ($lines as $i => $line) { self::assertSame( $originalLines[$i], $line, 'Line ' . ($i + 1) . ' has been changed while it shouldn\'t have been' . PHP_EOL . 'Line contents: "' . $originalLines[$i] . '"' ); } } }