create-berna-stencil 1.0.8 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eleventy.js +3 -1
- package/.env.example +8 -0
- package/.gitignore +2 -1
- package/README.md +1 -5
- package/bin/create.js +2 -1
- package/package.json +71 -70
- package/src/.htaccess +18 -0
- package/src/api/.htaccess +12 -0
- package/src/api/composer.json +6 -0
- package/src/api/composer.lock +574 -0
- package/src/api/endpoints/protected/secret.php +16 -0
- package/src/api/endpoints/protected/send-mail.php +75 -0
- package/src/api/endpoints/public/ping.php +16 -0
- package/src/api/index.php +95 -0
- package/src/api/init.php +43 -0
- package/src/api/modules/Response.php +37 -0
- package/src/api/vendor/autoload.php +22 -0
- package/src/api/vendor/composer/ClassLoader.php +579 -0
- package/src/api/vendor/composer/InstalledVersions.php +396 -0
- package/src/api/vendor/composer/LICENSE +21 -0
- package/src/api/vendor/composer/autoload_classmap.php +15 -0
- package/src/api/vendor/composer/autoload_files.php +12 -0
- package/src/api/vendor/composer/autoload_namespaces.php +9 -0
- package/src/api/vendor/composer/autoload_psr4.php +16 -0
- package/src/api/vendor/composer/autoload_real.php +50 -0
- package/src/api/vendor/composer/autoload_static.php +86 -0
- package/src/api/vendor/composer/installed.json +582 -0
- package/src/api/vendor/composer/installed.php +86 -0
- package/src/api/vendor/composer/platform_check.php +25 -0
- package/src/api/vendor/graham-campbell/result-type/.gitattributes +9 -0
- package/src/api/vendor/graham-campbell/result-type/.github/CODE_OF_CONDUCT.md +132 -0
- package/src/api/vendor/graham-campbell/result-type/.github/CONTRIBUTING.md +31 -0
- package/src/api/vendor/graham-campbell/result-type/.github/FUNDING.yml +2 -0
- package/src/api/vendor/graham-campbell/result-type/.github/SECURITY.md +14 -0
- package/src/api/vendor/graham-campbell/result-type/.github/workflows/stale.yml +11 -0
- package/src/api/vendor/graham-campbell/result-type/.github/workflows/tests.yml +40 -0
- package/src/api/vendor/graham-campbell/result-type/CHANGELOG.md +53 -0
- package/src/api/vendor/graham-campbell/result-type/LICENSE +21 -0
- package/src/api/vendor/graham-campbell/result-type/README.md +42 -0
- package/src/api/vendor/graham-campbell/result-type/composer.json +33 -0
- package/src/api/vendor/graham-campbell/result-type/phpunit.xml.dist +13 -0
- package/src/api/vendor/graham-campbell/result-type/src/Error.php +121 -0
- package/src/api/vendor/graham-campbell/result-type/src/Result.php +69 -0
- package/src/api/vendor/graham-campbell/result-type/src/Success.php +120 -0
- package/src/api/vendor/graham-campbell/result-type/tests/ResultTest.php +95 -0
- package/src/api/vendor/phpmailer/phpmailer/.codecov.yml +21 -0
- package/src/api/vendor/phpmailer/phpmailer/.editorconfig +15 -0
- package/src/api/vendor/phpmailer/phpmailer/.gitattributes +17 -0
- package/src/api/vendor/phpmailer/phpmailer/.github/FUNDING.yml +6 -0
- package/src/api/vendor/phpmailer/phpmailer/.github/ISSUE_TEMPLATE/bug_report.md +23 -0
- package/src/api/vendor/phpmailer/phpmailer/.github/actions/build-docs/Dockerfile +15 -0
- package/src/api/vendor/phpmailer/phpmailer/.github/actions/build-docs/entrypoint.sh +5 -0
- package/src/api/vendor/phpmailer/phpmailer/.github/dependabot.yml +21 -0
- package/src/api/vendor/phpmailer/phpmailer/.github/workflows/docs.yaml +30 -0
- package/src/api/vendor/phpmailer/phpmailer/.github/workflows/scorecards.yml +61 -0
- package/src/api/vendor/phpmailer/phpmailer/.github/workflows/tests.yml +237 -0
- package/src/api/vendor/phpmailer/phpmailer/.phan/config.php +41 -0
- package/src/api/vendor/phpmailer/phpmailer/COMMITMENT +46 -0
- package/src/api/vendor/phpmailer/phpmailer/LICENSE +502 -0
- package/src/api/vendor/phpmailer/phpmailer/README.md +232 -0
- package/src/api/vendor/phpmailer/phpmailer/SECURITY.md +37 -0
- package/src/api/vendor/phpmailer/phpmailer/SMTPUTF8.md +48 -0
- package/src/api/vendor/phpmailer/phpmailer/UPGRADING.md +125 -0
- package/src/api/vendor/phpmailer/phpmailer/VERSION +1 -0
- package/src/api/vendor/phpmailer/phpmailer/changelog.md +1122 -0
- package/src/api/vendor/phpmailer/phpmailer/composer.json +84 -0
- package/src/api/vendor/phpmailer/phpmailer/docs/README.md +9 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/DKIM_gen_keys.phps +81 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/DKIM_sign.phps +46 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/README.md +96 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/azure_xoauth2.phps +126 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/callback.phps +76 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/contactform-ajax.phps +146 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/contactform.phps +95 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/contents.html +17 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/contentsutf8.html +23 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/exceptions.phps +40 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/extending.phps +72 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/gmail.phps +106 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/gmail_xoauth.phps +121 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/images/PHPMailer card logo.afdesign +0 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/images/PHPMailer card logo.png +0 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/images/PHPMailer card logo.svg +209 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/images/phpmailer.png +0 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/images/phpmailer_mini.png +0 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/mail.phps +35 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/mailing_list.phps +96 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/pop_before_smtp.phps +60 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/send_file_upload.phps +60 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/send_multiple_file_upload.phps +60 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/sendmail.phps +37 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/sendoauth2.phps +100 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/simple_contact_form.phps +102 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/smime_signed_mail.phps +99 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/smtp.phps +62 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/smtp_check.phps +60 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/smtp_low_memory.phps +117 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/smtp_no_auth.phps +53 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/ssl_options.phps +81 -0
- package/src/api/vendor/phpmailer/phpmailer/get_oauth_token.php +182 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-af.php +26 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-ar.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-as.php +35 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-az.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-ba.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-be.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-bg.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-bn.php +35 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-ca.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-cs.php +28 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-da.php +39 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-de.php +28 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-el.php +33 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-eo.php +37 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-es.php +38 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-et.php +28 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-fa.php +28 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-fi.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-fo.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php +36 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-gl.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-he.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php +35 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-hr.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-hu.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-hy.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-id.php +31 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-it.php +28 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php +37 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-ka.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-ko.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-ku.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-lt.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-lv.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-mg.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-mn.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-ms.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-nb.php +37 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-nl.php +38 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-pl.php +33 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt.php +34 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt_br.php +38 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-ro.php +33 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-ru.php +36 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-si.php +34 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-sk.php +30 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-sl.php +36 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr.php +28 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr_latn.php +28 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-sv.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-tl.php +28 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php +38 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-uk.php +28 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-ur.php +30 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-vi.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh.php +29 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh_cn.php +36 -0
- package/src/api/vendor/phpmailer/phpmailer/phpcs.xml.dist +52 -0
- package/src/api/vendor/phpmailer/phpmailer/phpdoc.dist.xml +20 -0
- package/src/api/vendor/phpmailer/phpmailer/phpunit.xml.dist +36 -0
- package/src/api/vendor/phpmailer/phpmailer/src/DSNConfigurator.php +245 -0
- package/src/api/vendor/phpmailer/phpmailer/src/Exception.php +40 -0
- package/src/api/vendor/phpmailer/phpmailer/src/OAuth.php +139 -0
- package/src/api/vendor/phpmailer/phpmailer/src/OAuthTokenProvider.php +44 -0
- package/src/api/vendor/phpmailer/phpmailer/src/PHPMailer.php +5525 -0
- package/src/api/vendor/phpmailer/phpmailer/src/POP3.php +470 -0
- package/src/api/vendor/phpmailer/phpmailer/src/SMTP.php +1617 -0
- package/src/api/vendor/phpmailer/phpmailer/test/DebugLogTestListener.php +47 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/FileIsAccessibleTest/accessible.txt +1 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/FileIsAccessibleTest/inaccessible.txt +1 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-fr.php +10 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-nl.php +10 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-xa_scri_cc.php +9 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-xb_scri.php +9 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-xc_cc.php +9 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-xd_cc.php +9 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-xd_scri.php +9 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-xe.php +9 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-xx.php +9 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-yy.php +16 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-yz.php +16 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-zz.php +20 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Language/TranslationCompletenessTest.php +97 -0
- package/src/api/vendor/phpmailer/phpmailer/test/OAuth/OAuthTest.php +76 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/AddEmbeddedImageTest.php +178 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/AddStringAttachmentTest.php +147 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/AddStringEmbeddedImageTest.php +161 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/AddrFormatTest.php +70 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/AuthCRAMMD5Test.php +48 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/CustomHeaderTest.php +285 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/DKIMTest.php +258 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/DKIMWithoutExceptionsTest.php +46 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/DSNConfiguratorTest.php +221 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/EncodeQTest.php +110 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/EncodeStringTest.php +135 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/FileIsAccessibleTest.php +103 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/FilenameToTypeTest.php +74 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/GenerateIdTest.php +75 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/GetLastMessageIDTest.php +110 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/HasLineLongerThanMaxTest.php +158 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/Html2TextTest.php +231 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/ICalTest.php +126 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/IsPermittedPathTest.php +108 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/IsValidHostTest.php +107 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/LocalizationTest.php +505 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/MailTransportTest.php +261 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/MbPathinfoTest.php +171 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/MimeTypesTest.php +70 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/NormalizeBreaksTest.php +111 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/PHPMailerTest.php +1388 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/ParseAddressesTest.php +321 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/PunyencodeAddressTest.php +141 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/QuotedStringTest.php +70 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/ReplyToGetSetClearTest.php +444 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/SetErrorTest.php +154 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/SetFromTest.php +202 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/SetTest.php +81 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/SetWordWrapTest.php +120 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/Utf8CharBoundaryTest.php +66 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/ValidateAddressCustomValidatorTest.php +116 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/ValidateAddressTest.php +485 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/WrapTextTest.php +125 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/XMailerTest.php +75 -0
- package/src/api/vendor/phpmailer/phpmailer/test/POP3/PopBeforeSmtpTest.php +139 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PreSendTestCase.php +46 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Security/DenialOfServiceVectorsTest.php +52 -0
- package/src/api/vendor/phpmailer/phpmailer/test/SendTestCase.php +126 -0
- package/src/api/vendor/phpmailer/phpmailer/test/TestCase.php +392 -0
- package/src/api/vendor/phpmailer/phpmailer/test/fakepopserver.sh +126 -0
- package/src/api/vendor/phpmailer/phpmailer/test/fakesendmail.sh +22 -0
- package/src/api/vendor/phpmailer/phpmailer/test/runfakepopserver.sh +12 -0
- package/src/api/vendor/phpmailer/phpmailer/test/testbootstrap-dist.php +8 -0
- package/src/api/vendor/phpmailer/phpmailer/test/validators.php +12 -0
- package/src/api/vendor/phpoption/phpoption/.gitattributes +13 -0
- package/src/api/vendor/phpoption/phpoption/.github/CODE_OF_CONDUCT.md +132 -0
- package/src/api/vendor/phpoption/phpoption/.github/CONTRIBUTING.md +30 -0
- package/src/api/vendor/phpoption/phpoption/.github/FUNDING.yml +2 -0
- package/src/api/vendor/phpoption/phpoption/.github/SECURITY.md +14 -0
- package/src/api/vendor/phpoption/phpoption/.github/workflows/static.yml +40 -0
- package/src/api/vendor/phpoption/phpoption/.github/workflows/tests.yml +40 -0
- package/src/api/vendor/phpoption/phpoption/LICENSE +201 -0
- package/src/api/vendor/phpoption/phpoption/Makefile +17 -0
- package/src/api/vendor/phpoption/phpoption/README.md +201 -0
- package/src/api/vendor/phpoption/phpoption/composer.json +50 -0
- package/src/api/vendor/phpoption/phpoption/phpstan-baseline.neon +44 -0
- package/src/api/vendor/phpoption/phpoption/phpstan.neon.dist +7 -0
- package/src/api/vendor/phpoption/phpoption/phpunit.xml.dist +13 -0
- package/src/api/vendor/phpoption/phpoption/src/PhpOption/LazyOption.php +175 -0
- package/src/api/vendor/phpoption/phpoption/src/PhpOption/None.php +136 -0
- package/src/api/vendor/phpoption/phpoption/src/PhpOption/Option.php +434 -0
- package/src/api/vendor/phpoption/phpoption/src/PhpOption/Some.php +169 -0
- package/src/api/vendor/phpoption/phpoption/tests/PhpOption/Tests/EnsureTest.php +72 -0
- package/src/api/vendor/phpoption/phpoption/tests/PhpOption/Tests/LazyOptionTest.php +357 -0
- package/src/api/vendor/phpoption/phpoption/tests/PhpOption/Tests/NoneTest.php +153 -0
- package/src/api/vendor/phpoption/phpoption/tests/PhpOption/Tests/OptionTest.php +166 -0
- package/src/api/vendor/phpoption/phpoption/tests/PhpOption/Tests/SomeTest.php +194 -0
- package/src/api/vendor/phpoption/phpoption/tests/bootstrap.php +8 -0
- package/src/api/vendor/phpoption/phpoption/vendor-bin/phpstan/composer.json +8 -0
- package/src/api/vendor/symfony/polyfill-ctype/Ctype.php +232 -0
- package/src/api/vendor/symfony/polyfill-ctype/LICENSE +19 -0
- package/src/api/vendor/symfony/polyfill-ctype/README.md +12 -0
- package/src/api/vendor/symfony/polyfill-ctype/bootstrap.php +50 -0
- package/src/api/vendor/symfony/polyfill-ctype/bootstrap80.php +46 -0
- package/src/api/vendor/symfony/polyfill-ctype/composer.json +38 -0
- package/src/api/vendor/symfony/polyfill-mbstring/LICENSE +19 -0
- package/src/api/vendor/symfony/polyfill-mbstring/Mbstring.php +1077 -0
- package/src/api/vendor/symfony/polyfill-mbstring/README.md +13 -0
- package/src/api/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php +119 -0
- package/src/api/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php +1397 -0
- package/src/api/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php +5 -0
- package/src/api/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php +1489 -0
- package/src/api/vendor/symfony/polyfill-mbstring/bootstrap.php +171 -0
- package/src/api/vendor/symfony/polyfill-mbstring/bootstrap80.php +167 -0
- package/src/api/vendor/symfony/polyfill-mbstring/composer.json +39 -0
- package/src/api/vendor/symfony/polyfill-php80/LICENSE +19 -0
- package/src/api/vendor/symfony/polyfill-php80/Php80.php +115 -0
- package/src/api/vendor/symfony/polyfill-php80/PhpToken.php +106 -0
- package/src/api/vendor/symfony/polyfill-php80/README.md +25 -0
- package/src/api/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php +31 -0
- package/src/api/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php +16 -0
- package/src/api/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php +20 -0
- package/src/api/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php +16 -0
- package/src/api/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php +16 -0
- package/src/api/vendor/symfony/polyfill-php80/bootstrap.php +42 -0
- package/src/api/vendor/symfony/polyfill-php80/composer.json +37 -0
- package/src/api/vendor/vlucas/phpdotenv/.editorconfig +15 -0
- package/src/api/vendor/vlucas/phpdotenv/.gitattributes +15 -0
- package/src/api/vendor/vlucas/phpdotenv/.github/CODE_OF_CONDUCT.md +132 -0
- package/src/api/vendor/vlucas/phpdotenv/.github/CONTRIBUTING.md +30 -0
- package/src/api/vendor/vlucas/phpdotenv/.github/FUNDING.yml +2 -0
- package/src/api/vendor/vlucas/phpdotenv/.github/SECURITY.md +14 -0
- package/src/api/vendor/vlucas/phpdotenv/.github/workflows/static.yml +40 -0
- package/src/api/vendor/vlucas/phpdotenv/.github/workflows/tests.yml +70 -0
- package/src/api/vendor/vlucas/phpdotenv/LICENSE +30 -0
- package/src/api/vendor/vlucas/phpdotenv/Makefile +17 -0
- package/src/api/vendor/vlucas/phpdotenv/README.md +370 -0
- package/src/api/vendor/vlucas/phpdotenv/UPGRADING.md +196 -0
- package/src/api/vendor/vlucas/phpdotenv/composer.json +60 -0
- package/src/api/vendor/vlucas/phpdotenv/phpstan-baseline.neon +157 -0
- package/src/api/vendor/vlucas/phpdotenv/phpstan.neon.dist +7 -0
- package/src/api/vendor/vlucas/phpdotenv/phpunit.xml.dist +13 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Dotenv.php +267 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Exception/ExceptionInterface.php +12 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Exception/InvalidEncodingException.php +12 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Exception/InvalidFileException.php +12 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Exception/InvalidPathException.php +12 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Exception/ValidationException.php +12 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Loader/Loader.php +48 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Loader/LoaderInterface.php +20 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Loader/Resolver.php +65 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Parser/Entry.php +59 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Parser/EntryParser.php +299 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Parser/Lexer.php +58 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Parser/Lines.php +127 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Parser/Parser.php +53 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Parser/ParserInterface.php +19 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Parser/Value.php +88 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/AdapterInterface.php +15 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/ApacheAdapter.php +89 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/ArrayAdapter.php +80 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/EnvConstAdapter.php +88 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/GuardedWriter.php +85 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/ImmutableWriter.php +110 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/MultiReader.php +48 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/MultiWriter.php +64 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/PutenvAdapter.php +91 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/ReaderInterface.php +17 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/ReplacingWriter.php +104 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/ServerConstAdapter.php +88 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/WriterInterface.php +27 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/AdapterRepository.php +107 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/RepositoryBuilder.php +272 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/RepositoryInterface.php +51 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Store/File/Paths.php +44 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Store/File/Reader.php +81 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Store/FileStore.php +72 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Store/StoreBuilder.php +141 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Store/StoreInterface.php +17 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Store/StringStore.php +37 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Util/Regex.php +112 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Util/Str.php +108 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Validator.php +207 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/DotenvTest.php +387 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/Loader/LoaderTest.php +86 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/Parser/EntryParserTest.php +234 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/Parser/LexerTest.php +40 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/Parser/LinesTest.php +53 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/Parser/ParserTest.php +98 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/Adapter/ArrayAdapterTest.php +57 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/Adapter/EnvConstAdapterTest.php +75 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/Adapter/PutenvAdapterTest.php +52 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/Adapter/ServerConstAdapterTest.php +75 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/RepositoryTest.php +305 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/Store/StoreTest.php +141 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/ValidatorTest.php +479 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/.env +5 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/assertions.env +18 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/booleans.env +33 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/commented.env +15 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/empty.env +1 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/example.env +1 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/exported.env +7 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/immutable.env +1 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/integers.env +17 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/large.env +2 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/multibyte.env +3 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/multiline.env +14 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/multiple.env +4 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/mutable.env +1 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/nested.env +15 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/quoted.env +11 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/specialchars.env +8 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/unicodevarnames.env +2 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/utf8-with-bom-encoding.env +3 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/windows.env +1 -0
- package/src/api/vendor/vlucas/phpdotenv/vendor-bin/phpstan/composer.json +15 -0
- package/src/api/configExample.php +0 -28
- package/src/api/sendEmail.php +0 -131
|
@@ -0,0 +1,485 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* PHPMailer - PHP email transport unit tests.
|
|
5
|
+
* PHP version 5.5.
|
|
6
|
+
*
|
|
7
|
+
* @author Marcus Bointon <phpmailer@synchromedia.co.uk>
|
|
8
|
+
* @author Andy Prevost
|
|
9
|
+
* @copyright 2012 - 2020 Marcus Bointon
|
|
10
|
+
* @copyright 2004 - 2009 Andy Prevost
|
|
11
|
+
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
namespace PHPMailer\Test\PHPMailer;
|
|
15
|
+
|
|
16
|
+
use PHPMailer\PHPMailer\PHPMailer;
|
|
17
|
+
use Yoast\PHPUnitPolyfills\TestCases\TestCase;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Test email address validation.
|
|
21
|
+
*
|
|
22
|
+
* @todo Recommendation JRF: Rework the tests to actually test all test cases
|
|
23
|
+
* against each type of build-in pattern.
|
|
24
|
+
* As things stand, only the PHP validation is tested (while it shouldn't be as that's
|
|
25
|
+
* the responsibility of PHP Core), while the PCRE and HTML5 regexes are untested, while
|
|
26
|
+
* those are maintained within this repo.
|
|
27
|
+
* There should also be a test to make sure that `auto` and `noregex` correctly
|
|
28
|
+
* fall through to the default validation.
|
|
29
|
+
*
|
|
30
|
+
* @covers \PHPMailer\PHPMailer\PHPMailer::validateAddress
|
|
31
|
+
*/
|
|
32
|
+
final class ValidateAddressTest extends TestCase
|
|
33
|
+
{
|
|
34
|
+
/**
|
|
35
|
+
* Run before this test class.
|
|
36
|
+
*/
|
|
37
|
+
public static function set_up_before_class()
|
|
38
|
+
{
|
|
39
|
+
// Make sure that validator property starts off with its default value.
|
|
40
|
+
PHPMailer::$validator = 'php';
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Run after this test class.
|
|
45
|
+
*/
|
|
46
|
+
public static function tear_down_after_class()
|
|
47
|
+
{
|
|
48
|
+
self::set_up_before_class();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Testing against the pre-defined patterns with a valid address (for coverage).
|
|
53
|
+
*
|
|
54
|
+
* @dataProvider dataPatterns
|
|
55
|
+
*
|
|
56
|
+
* @param string $pattern Validation pattern.
|
|
57
|
+
*/
|
|
58
|
+
public function testPatternsValidAddress($pattern)
|
|
59
|
+
{
|
|
60
|
+
self::assertTrue(
|
|
61
|
+
PHPMailer::validateAddress('test@example.com', $pattern),
|
|
62
|
+
'Good address that failed validation against pattern ' . $pattern
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Testing against the pre-defined patterns with an invalid address (for coverage).
|
|
68
|
+
*
|
|
69
|
+
* @dataProvider dataPatterns
|
|
70
|
+
*
|
|
71
|
+
* @param string $pattern Validation pattern.
|
|
72
|
+
*/
|
|
73
|
+
public function testPatternsInvalidAddress($pattern)
|
|
74
|
+
{
|
|
75
|
+
self::assertFalse(
|
|
76
|
+
PHPMailer::validateAddress('test@example.com.', $pattern),
|
|
77
|
+
'Bad address that passed validation against pattern ' . $pattern
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Data provider.
|
|
83
|
+
*
|
|
84
|
+
* @return array
|
|
85
|
+
*/
|
|
86
|
+
public function dataPatterns()
|
|
87
|
+
{
|
|
88
|
+
$patterns = [
|
|
89
|
+
'auto',
|
|
90
|
+
'pcre',
|
|
91
|
+
'pcre8',
|
|
92
|
+
'html5',
|
|
93
|
+
'php',
|
|
94
|
+
'noregex',
|
|
95
|
+
];
|
|
96
|
+
|
|
97
|
+
return $this->arrayToNamedDataProvider($patterns);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Verify that valid addresses are recognized as such.
|
|
102
|
+
*
|
|
103
|
+
* @dataProvider dataValidAddresses
|
|
104
|
+
* @dataProvider dataAsciiAddresses
|
|
105
|
+
* @dataProvider dataValidIPv6
|
|
106
|
+
*
|
|
107
|
+
* @param string $emailAddress The address to test.
|
|
108
|
+
*/
|
|
109
|
+
public function testValidAddresses($emailAddress)
|
|
110
|
+
{
|
|
111
|
+
self::assertTrue(PHPMailer::validateAddress($emailAddress), 'Good address that failed validation');
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Data provider for valid addresses.
|
|
116
|
+
*
|
|
117
|
+
* @return array
|
|
118
|
+
*/
|
|
119
|
+
public function dataValidAddresses()
|
|
120
|
+
{
|
|
121
|
+
$validaddresses = [
|
|
122
|
+
'first@example.org',
|
|
123
|
+
'first.last@example.org',
|
|
124
|
+
'1234567890123456789012345678901234567890123456789012345678901234@example.org',
|
|
125
|
+
'"first\"last"@example.org',
|
|
126
|
+
'"first@last"@example.org',
|
|
127
|
+
'"first\last"@example.org',
|
|
128
|
+
'first.last@[12.34.56.78]',
|
|
129
|
+
'first.last@x23456789012345678901234567890123456789012345678901234567890123.example.org',
|
|
130
|
+
'first.last@123.example.org',
|
|
131
|
+
'"first\last"@example.org',
|
|
132
|
+
'"Abc\@def"@example.org',
|
|
133
|
+
'"Fred\ Bloggs"@example.org',
|
|
134
|
+
'"Joe.\Blow"@example.org',
|
|
135
|
+
'"Abc@def"@example.org',
|
|
136
|
+
'user+mailbox@example.org',
|
|
137
|
+
'customer/department=shipping@example.org',
|
|
138
|
+
'$A12345@example.org',
|
|
139
|
+
'!def!xyz%abc@example.org',
|
|
140
|
+
'_somename@example.org',
|
|
141
|
+
'dclo@us.example.com',
|
|
142
|
+
'peter.piper@example.org',
|
|
143
|
+
'test@example.org',
|
|
144
|
+
'TEST@example.org',
|
|
145
|
+
'1234567890@example.org',
|
|
146
|
+
'test+test@example.org',
|
|
147
|
+
'test-test@example.org',
|
|
148
|
+
't*est@example.org',
|
|
149
|
+
'+1~1+@example.org',
|
|
150
|
+
'{_test_}@example.org',
|
|
151
|
+
'test.test@example.org',
|
|
152
|
+
'"test.test"@example.org',
|
|
153
|
+
'test."test"@example.org',
|
|
154
|
+
'"test@test"@example.org',
|
|
155
|
+
'test@123.123.123.x123',
|
|
156
|
+
'test@[123.123.123.123]',
|
|
157
|
+
'test@example.example.org',
|
|
158
|
+
'test@example.example.example.org',
|
|
159
|
+
'"test\test"@example.org',
|
|
160
|
+
'"test\blah"@example.org',
|
|
161
|
+
'"test\blah"@example.org',
|
|
162
|
+
'"test\"blah"@example.org',
|
|
163
|
+
'customer/department@example.org',
|
|
164
|
+
'_Yosemite.Sam@example.org',
|
|
165
|
+
'~@example.org',
|
|
166
|
+
'"Austin@Powers"@example.org',
|
|
167
|
+
'Ima.Fool@example.org',
|
|
168
|
+
'"Ima.Fool"@example.org',
|
|
169
|
+
'"first"."last"@example.org',
|
|
170
|
+
'"first".middle."last"@example.org',
|
|
171
|
+
'"first".last@example.org',
|
|
172
|
+
'first."last"@example.org',
|
|
173
|
+
'"first"."middle"."last"@example.org',
|
|
174
|
+
'"first.middle"."last"@example.org',
|
|
175
|
+
'"first.middle.last"@example.org',
|
|
176
|
+
'"first..last"@example.org',
|
|
177
|
+
'"first\"last"@example.org',
|
|
178
|
+
'first."mid\dle"."last"@example.org',
|
|
179
|
+
'name.lastname@example.com',
|
|
180
|
+
'a@example.com',
|
|
181
|
+
'aaa@[123.123.123.123]',
|
|
182
|
+
'a-b@example.com',
|
|
183
|
+
'+@b.c',
|
|
184
|
+
'+@b.com',
|
|
185
|
+
'a@b.co-foo.uk',
|
|
186
|
+
'valid@about.museum',
|
|
187
|
+
'shaitan@my-domain.thisisminekthx',
|
|
188
|
+
'"Joe\Blow"@example.org',
|
|
189
|
+
'user%uucp!path@example.edu',
|
|
190
|
+
'cdburgess+!#$%&\'*-/=?+_{}|~test@example.com',
|
|
191
|
+
'test@test.com',
|
|
192
|
+
'test@xn--example.com',
|
|
193
|
+
'test@example.com',
|
|
194
|
+
];
|
|
195
|
+
|
|
196
|
+
return $this->arrayToNamedDataProvider($validaddresses, 'Valid: ');
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Data provider for IDNs in ASCII form.
|
|
201
|
+
*
|
|
202
|
+
* @return array
|
|
203
|
+
*/
|
|
204
|
+
public function dataAsciiAddresses()
|
|
205
|
+
{
|
|
206
|
+
$asciiaddresses = [
|
|
207
|
+
'first.last@xn--bcher-kva.ch',
|
|
208
|
+
'first.last@xn--j1ail.xn--p1ai',
|
|
209
|
+
'first.last@xn--phplst-6va.com',
|
|
210
|
+
];
|
|
211
|
+
|
|
212
|
+
return $this->arrayToNamedDataProvider($asciiaddresses, 'Valid ascii: ');
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Data provider for valid explicit IPv6 numeric addresses.
|
|
217
|
+
*
|
|
218
|
+
* @todo Fix the failing (commented out) tests.
|
|
219
|
+
*
|
|
220
|
+
* @return array
|
|
221
|
+
*/
|
|
222
|
+
public function dataValidIPv6()
|
|
223
|
+
{
|
|
224
|
+
$validipv6 = [
|
|
225
|
+
//'first.last@[IPv6:::a2:a3:a4:b1:b2:b3:b4]',
|
|
226
|
+
//'first.last@[IPv6:a1:a2:a3:a4:b1:b2:b3::]',
|
|
227
|
+
'first.last@[IPv6:::]',
|
|
228
|
+
'first.last@[IPv6:::b4]',
|
|
229
|
+
'first.last@[IPv6:::b3:b4]',
|
|
230
|
+
'first.last@[IPv6:a1::b4]',
|
|
231
|
+
'first.last@[IPv6:a1::]',
|
|
232
|
+
'first.last@[IPv6:a1:a2::]',
|
|
233
|
+
'first.last@[IPv6:0123:4567:89ab:cdef::]',
|
|
234
|
+
'first.last@[IPv6:0123:4567:89ab:CDEF::]',
|
|
235
|
+
'first.last@[IPv6:::a3:a4:b1:ffff:11.22.33.44]',
|
|
236
|
+
//'first.last@[IPv6:::a2:a3:a4:b1:ffff:11.22.33.44]',
|
|
237
|
+
'first.last@[IPv6:a1:a2:a3:a4::11.22.33.44]',
|
|
238
|
+
//'first.last@[IPv6:a1:a2:a3:a4:b1::11.22.33.44]',
|
|
239
|
+
'first.last@[IPv6:a1::11.22.33.44]',
|
|
240
|
+
'first.last@[IPv6:a1:a2::11.22.33.44]',
|
|
241
|
+
'first.last@[IPv6:0123:4567:89ab:cdef::11.22.33.44]',
|
|
242
|
+
'first.last@[IPv6:0123:4567:89ab:CDEF::11.22.33.44]',
|
|
243
|
+
'first.last@[IPv6:a1::b2:11.22.33.44]',
|
|
244
|
+
'first.last@[IPv6:::12.34.56.78]',
|
|
245
|
+
'first.last@[IPv6:1111:2222:3333::4444:12.34.56.78]',
|
|
246
|
+
'first.last@[IPv6:1111:2222:3333:4444:5555:6666:12.34.56.78]',
|
|
247
|
+
'first.last@[IPv6:::1111:2222:3333:4444:5555:6666]',
|
|
248
|
+
'first.last@[IPv6:1111:2222:3333::4444:5555:6666]',
|
|
249
|
+
'first.last@[IPv6:1111:2222:3333:4444:5555:6666::]',
|
|
250
|
+
'first.last@[IPv6:1111:2222:3333:4444:5555:6666:7777:8888]',
|
|
251
|
+
//'first.last@[IPv6:1111:2222:3333::4444:5555:12.34.56.78]',
|
|
252
|
+
//'first.last@[IPv6:1111:2222:3333::4444:5555:6666:7777]',
|
|
253
|
+
];
|
|
254
|
+
|
|
255
|
+
return $this->arrayToNamedDataProvider($validipv6, 'Valid IPv6: ');
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Verify that invalid addresses are recognized as such.
|
|
260
|
+
*
|
|
261
|
+
* @dataProvider dataInvalidAddresses
|
|
262
|
+
* @dataProvider dataUnicodeAddresses
|
|
263
|
+
* @dataProvider dataInvalidPHPPattern
|
|
264
|
+
*
|
|
265
|
+
* @param string $emailAddress The address to test.
|
|
266
|
+
*/
|
|
267
|
+
public function testInvalidAddresses($emailAddress)
|
|
268
|
+
{
|
|
269
|
+
self::assertFalse(PHPMailer::validateAddress($emailAddress), 'Bad address that passed validation');
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Data provider for invalid addresses.
|
|
274
|
+
*
|
|
275
|
+
* Some failing cases commented out that are apparently up for debate!
|
|
276
|
+
*
|
|
277
|
+
* @return array
|
|
278
|
+
*/
|
|
279
|
+
public function dataInvalidAddresses()
|
|
280
|
+
{
|
|
281
|
+
$invalidaddresses = [
|
|
282
|
+
'first.last@sub.do,com',
|
|
283
|
+
'first\@last@iana.org',
|
|
284
|
+
'123456789012345678901234567890123456789012345678901234567890' .
|
|
285
|
+
'@12345678901234567890123456789012345678901234 [...]',
|
|
286
|
+
'first.last',
|
|
287
|
+
'12345678901234567890123456789012345678901234567890123456789012345@iana.org',
|
|
288
|
+
'.first.last@iana.org',
|
|
289
|
+
'first.last.@iana.org',
|
|
290
|
+
'first..last@iana.org',
|
|
291
|
+
'"first"last"@iana.org',
|
|
292
|
+
'"""@iana.org',
|
|
293
|
+
'"\"@iana.org',
|
|
294
|
+
//'""@iana.org',
|
|
295
|
+
'first\@last@iana.org',
|
|
296
|
+
'first.last@',
|
|
297
|
+
'x@x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.' .
|
|
298
|
+
'x23456789.x23456789.x23456789.x23 [...]',
|
|
299
|
+
'first.last@[.12.34.56.78]',
|
|
300
|
+
'first.last@[12.34.56.789]',
|
|
301
|
+
'first.last@[::12.34.56.78]',
|
|
302
|
+
'first.last@[IPv5:::12.34.56.78]',
|
|
303
|
+
'first.last@[IPv6:1111:2222:3333:4444:5555:12.34.56.78]',
|
|
304
|
+
'first.last@[IPv6:1111:2222:3333:4444:5555:6666:7777:12.34.56.78]',
|
|
305
|
+
'first.last@[IPv6:1111:2222:3333:4444:5555:6666:7777]',
|
|
306
|
+
'first.last@[IPv6:1111:2222:3333:4444:5555:6666:7777:8888:9999]',
|
|
307
|
+
'first.last@[IPv6:1111:2222::3333::4444:5555:6666]',
|
|
308
|
+
'first.last@[IPv6:1111:2222:333x::4444:5555]',
|
|
309
|
+
'first.last@[IPv6:1111:2222:33333::4444:5555]',
|
|
310
|
+
'first.last@-xample.com',
|
|
311
|
+
'first.last@exampl-.com',
|
|
312
|
+
'first.last@x234567890123456789012345678901234567890123456789012345678901234.iana.org',
|
|
313
|
+
'abc\@def@iana.org',
|
|
314
|
+
'abc\@iana.org',
|
|
315
|
+
'Doug\ \"Ace\"\ Lovell@iana.org',
|
|
316
|
+
'abc@def@iana.org',
|
|
317
|
+
'abc\@def@iana.org',
|
|
318
|
+
'abc\@iana.org',
|
|
319
|
+
'@iana.org',
|
|
320
|
+
'doug@',
|
|
321
|
+
'"qu@iana.org',
|
|
322
|
+
'ote"@iana.org',
|
|
323
|
+
'.dot@iana.org',
|
|
324
|
+
'dot.@iana.org',
|
|
325
|
+
'two..dot@iana.org',
|
|
326
|
+
'"Doug "Ace" L."@iana.org',
|
|
327
|
+
'Doug\ \"Ace\"\ L\.@iana.org',
|
|
328
|
+
'hello world@iana.org',
|
|
329
|
+
//'helloworld@iana .org',
|
|
330
|
+
'gatsby@f.sc.ot.t.f.i.tzg.era.l.d.',
|
|
331
|
+
'test.iana.org',
|
|
332
|
+
'test.@iana.org',
|
|
333
|
+
'test..test@iana.org',
|
|
334
|
+
'.test@iana.org',
|
|
335
|
+
'test@test@iana.org',
|
|
336
|
+
'test@@iana.org',
|
|
337
|
+
'-- test --@iana.org',
|
|
338
|
+
'[test]@iana.org',
|
|
339
|
+
'"test"test"@iana.org',
|
|
340
|
+
'()[]\;:,><@iana.org',
|
|
341
|
+
'test@.',
|
|
342
|
+
'test@example.',
|
|
343
|
+
'test@.org',
|
|
344
|
+
'test@12345678901234567890123456789012345678901234567890123456789012345678901234567890' .
|
|
345
|
+
'12345678901234567890 [...]',
|
|
346
|
+
'test@[123.123.123.123',
|
|
347
|
+
'test@123.123.123.123]',
|
|
348
|
+
'NotAnEmail',
|
|
349
|
+
'@NotAnEmail',
|
|
350
|
+
'"test"blah"@iana.org',
|
|
351
|
+
'.wooly@iana.org',
|
|
352
|
+
'wo..oly@iana.org',
|
|
353
|
+
'pootietang.@iana.org',
|
|
354
|
+
'.@iana.org',
|
|
355
|
+
'Ima Fool@iana.org',
|
|
356
|
+
'phil.h\@\@ck@haacked.com',
|
|
357
|
+
'foo@[\1.2.3.4]',
|
|
358
|
+
//'first."".last@iana.org',
|
|
359
|
+
'first\last@iana.org',
|
|
360
|
+
'Abc\@def@iana.org',
|
|
361
|
+
'Fred\ Bloggs@iana.org',
|
|
362
|
+
'Joe.\Blow@iana.org',
|
|
363
|
+
'first.last@[IPv6:1111:2222:3333:4444:5555:6666:12.34.567.89]',
|
|
364
|
+
'{^c\@**Dog^}@cartoon.com',
|
|
365
|
+
//'"foo"(yay)@(hoopla)[1.2.3.4]',
|
|
366
|
+
'cal(foo(bar)@iamcal.com',
|
|
367
|
+
'cal(foo)bar)@iamcal.com',
|
|
368
|
+
'cal(foo\)@iamcal.com',
|
|
369
|
+
'first(12345678901234567890123456789012345678901234567890)last@(1234567890123456789' .
|
|
370
|
+
'01234567890123456789012 [...]',
|
|
371
|
+
'first(middle)last@iana.org',
|
|
372
|
+
'first(abc("def".ghi).mno)middle(abc("def".ghi).mno).last@(abc("def".ghi).mno)example' .
|
|
373
|
+
'(abc("def".ghi).mno). [...]',
|
|
374
|
+
'a(a(b(c)d(e(f))g)(h(i)j)@iana.org',
|
|
375
|
+
'.@',
|
|
376
|
+
'@bar.com',
|
|
377
|
+
'@@bar.com',
|
|
378
|
+
'aaa.com',
|
|
379
|
+
'aaa@.com',
|
|
380
|
+
'aaa@.123',
|
|
381
|
+
'aaa@[123.123.123.123]a',
|
|
382
|
+
'aaa@[123.123.123.333]',
|
|
383
|
+
'a@bar.com.',
|
|
384
|
+
'a@-b.com',
|
|
385
|
+
'a@b-.com',
|
|
386
|
+
'-@..com',
|
|
387
|
+
'-@a..com',
|
|
388
|
+
'invalid@about.museum-',
|
|
389
|
+
'test@...........com',
|
|
390
|
+
'"Unicode NULL' . chr(0) . '"@char.com',
|
|
391
|
+
'Unicode NULL' . chr(0) . '@char.com',
|
|
392
|
+
'first.last@[IPv6::]',
|
|
393
|
+
'first.last@[IPv6::::]',
|
|
394
|
+
'first.last@[IPv6::b4]',
|
|
395
|
+
'first.last@[IPv6::::b4]',
|
|
396
|
+
'first.last@[IPv6::b3:b4]',
|
|
397
|
+
'first.last@[IPv6::::b3:b4]',
|
|
398
|
+
'first.last@[IPv6:a1:::b4]',
|
|
399
|
+
'first.last@[IPv6:a1:]',
|
|
400
|
+
'first.last@[IPv6:a1:::]',
|
|
401
|
+
'first.last@[IPv6:a1:a2:]',
|
|
402
|
+
'first.last@[IPv6:a1:a2:::]',
|
|
403
|
+
'first.last@[IPv6::11.22.33.44]',
|
|
404
|
+
'first.last@[IPv6::::11.22.33.44]',
|
|
405
|
+
'first.last@[IPv6:a1:11.22.33.44]',
|
|
406
|
+
'first.last@[IPv6:a1:::11.22.33.44]',
|
|
407
|
+
'first.last@[IPv6:a1:a2:::11.22.33.44]',
|
|
408
|
+
'first.last@[IPv6:0123:4567:89ab:cdef::11.22.33.xx]',
|
|
409
|
+
'first.last@[IPv6:0123:4567:89ab:CDEFF::11.22.33.44]',
|
|
410
|
+
'first.last@[IPv6:a1::a4:b1::b4:11.22.33.44]',
|
|
411
|
+
'first.last@[IPv6:a1::11.22.33]',
|
|
412
|
+
'first.last@[IPv6:a1::11.22.33.44.55]',
|
|
413
|
+
'first.last@[IPv6:a1::b211.22.33.44]',
|
|
414
|
+
'first.last@[IPv6:a1::b2::11.22.33.44]',
|
|
415
|
+
'first.last@[IPv6:a1::b3:]',
|
|
416
|
+
'first.last@[IPv6::a2::b4]',
|
|
417
|
+
'first.last@[IPv6:a1:a2:a3:a4:b1:b2:b3:]',
|
|
418
|
+
'first.last@[IPv6::a2:a3:a4:b1:b2:b3:b4]',
|
|
419
|
+
'first.last@[IPv6:a1:a2:a3:a4::b1:b2:b3:b4]',
|
|
420
|
+
//This is a valid RFC5322 address, but we don't want to allow it for obvious reasons!
|
|
421
|
+
"(\r\n RCPT TO:user@example.com\r\n DATA \\\nSubject: spam10\\\n\r\n Hello," .
|
|
422
|
+
"\r\n this is a spam mail.\\\n.\r\n QUIT\r\n ) a@example.net",
|
|
423
|
+
];
|
|
424
|
+
|
|
425
|
+
return $this->arrayToNamedDataProvider($invalidaddresses, 'Invalid: ');
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
/**
|
|
429
|
+
* Data provider for IDNs in Unicode form.
|
|
430
|
+
*
|
|
431
|
+
* @return array
|
|
432
|
+
*/
|
|
433
|
+
public function dataUnicodeAddresses()
|
|
434
|
+
{
|
|
435
|
+
$unicodeaddresses = [
|
|
436
|
+
'first.last@bücher.ch',
|
|
437
|
+
'first.last@кто.рф',
|
|
438
|
+
'first.last@phplíst.com',
|
|
439
|
+
];
|
|
440
|
+
|
|
441
|
+
return $this->arrayToNamedDataProvider($unicodeaddresses, 'Invalid Unicode: ');
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* Data provider.
|
|
446
|
+
*
|
|
447
|
+
* These are invalid according to PHP's filter_var() email filter,
|
|
448
|
+
* which doesn't allow dotless domains, numeric TLDs or unbracketed IPv4 literals.
|
|
449
|
+
*
|
|
450
|
+
* @return array
|
|
451
|
+
*/
|
|
452
|
+
public function dataInvalidPHPPattern()
|
|
453
|
+
{
|
|
454
|
+
$invalidphp = [
|
|
455
|
+
'a@b',
|
|
456
|
+
'a@bar',
|
|
457
|
+
'first.last@com',
|
|
458
|
+
'test@123.123.123.123',
|
|
459
|
+
'foobar@192.168.0.1',
|
|
460
|
+
'first.last@example.123',
|
|
461
|
+
];
|
|
462
|
+
|
|
463
|
+
return $this->arrayToNamedDataProvider($invalidphp, 'Invalid PHP: ');
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
* Create a dataprovider array from a single-dimensional array.
|
|
468
|
+
*
|
|
469
|
+
* Each item will have it's value as the test case name for easier debugging.
|
|
470
|
+
*
|
|
471
|
+
* @param array $items Single dimensional array.
|
|
472
|
+
* @param string $prefix Optional. Prefix to add to the data set name.
|
|
473
|
+
*
|
|
474
|
+
* @return array
|
|
475
|
+
*/
|
|
476
|
+
protected function arrayToNamedDataProvider($items, $prefix = '')
|
|
477
|
+
{
|
|
478
|
+
$provider = [];
|
|
479
|
+
foreach ($items as $item) {
|
|
480
|
+
$provider[$prefix . $item] = [$item];
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
return $provider;
|
|
484
|
+
}
|
|
485
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* PHPMailer - PHP email transport unit tests.
|
|
5
|
+
* PHP version 5.5.
|
|
6
|
+
*
|
|
7
|
+
* @author Marcus Bointon <phpmailer@synchromedia.co.uk>
|
|
8
|
+
* @author Andy Prevost
|
|
9
|
+
* @copyright 2012 - 2020 Marcus Bointon
|
|
10
|
+
* @copyright 2004 - 2009 Andy Prevost
|
|
11
|
+
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
namespace PHPMailer\Test\PHPMailer;
|
|
15
|
+
|
|
16
|
+
use PHPMailer\PHPMailer\PHPMailer;
|
|
17
|
+
use PHPMailer\Test\TestCase;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Test word wrapping functionality.
|
|
21
|
+
*
|
|
22
|
+
* @covers \PHPMailer\PHPMailer\PHPMailer::wrapText
|
|
23
|
+
*/
|
|
24
|
+
final class WrapTextTest extends TestCase
|
|
25
|
+
{
|
|
26
|
+
/**
|
|
27
|
+
* Test wrapping text.
|
|
28
|
+
*
|
|
29
|
+
* @dataProvider dataWrapText
|
|
30
|
+
*
|
|
31
|
+
* @param string $message Input text string.
|
|
32
|
+
* @param string $expected Expected function output.
|
|
33
|
+
* @param bool $qp_mode Optional. Whether to run in Quoted-Printable mode. Defaults to `false`.
|
|
34
|
+
* @param int $length Optional. Length to wrap at. Defaults to `50`.
|
|
35
|
+
*/
|
|
36
|
+
public function testWrapText($message, $expected, $qp_mode = false, $length = 50)
|
|
37
|
+
{
|
|
38
|
+
$this->assertSame($expected, $this->Mail->wrapText($message, $length, $qp_mode));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Data provider.
|
|
43
|
+
*
|
|
44
|
+
* @return array
|
|
45
|
+
*/
|
|
46
|
+
public function dataWrapText()
|
|
47
|
+
{
|
|
48
|
+
return [
|
|
49
|
+
'empty string' => [
|
|
50
|
+
'message' => '',
|
|
51
|
+
'expected' => PHPMailer::getLE(),
|
|
52
|
+
'qp_mode' => false,
|
|
53
|
+
],
|
|
54
|
+
'line length less than wrap limit, qp: false' => [
|
|
55
|
+
'message' => 'Lorem ipsum dolor sit amet.',
|
|
56
|
+
'expected' => 'Lorem ipsum dolor sit amet.' . PHPMailer::getLE(),
|
|
57
|
+
'qp_mode' => false,
|
|
58
|
+
],
|
|
59
|
+
'line length less than wrap limit, qp: true' => [
|
|
60
|
+
'message' => 'Lorem ipsum dolor sit amet.',
|
|
61
|
+
'expected' => 'Lorem ipsum dolor sit amet.' . PHPMailer::getLE(),
|
|
62
|
+
'qp_mode' => true,
|
|
63
|
+
],
|
|
64
|
+
'message with line ending at end' => [
|
|
65
|
+
'message' => 'Lorem ipsum dolor' . PHPMailer::CRLF,
|
|
66
|
+
'expected' => 'Lorem ipsum dolor' . PHPMailer::getLE(),
|
|
67
|
+
],
|
|
68
|
+
'line length more than wrap limit, qp: false' => [
|
|
69
|
+
'message' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.'
|
|
70
|
+
. ' Maecenas ultricies nisi justo, eu convallis tortor porttitor a.'
|
|
71
|
+
. ' Nam ut risus tellus. Vivamus imperdiet dictum nibh, in faucibus nunc pretium ac.',
|
|
72
|
+
'expected' => 'Lorem ipsum dolor sit amet, consectetur adipiscing' . PHPMailer::getLE()
|
|
73
|
+
. 'elit. Maecenas ultricies nisi justo, eu convallis' . PHPMailer::getLE()
|
|
74
|
+
. 'tortor porttitor a. Nam ut risus tellus. Vivamus' . PHPMailer::getLE()
|
|
75
|
+
. 'imperdiet dictum nibh, in faucibus nunc pretium' . PHPMailer::getLE()
|
|
76
|
+
. 'ac.' . PHPMailer::getLE(),
|
|
77
|
+
'qp_mode' => false,
|
|
78
|
+
],
|
|
79
|
+
'line length more than wrap limit, qp: true' => [
|
|
80
|
+
'message' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.'
|
|
81
|
+
. ' Maecenas ultricies nisi justo, eu convallis tortor porttitor a.'
|
|
82
|
+
. ' Nam ut risus tellus. Vivamus imperdiet dictum nibh, in faucibus nunc pretium ac.',
|
|
83
|
+
'expected' => 'Lorem ipsum dolor sit amet, consectetur adipiscing =' . PHPMailer::getLE()
|
|
84
|
+
. 'elit. Maecenas ultricies nisi justo, eu convallis =' . PHPMailer::getLE()
|
|
85
|
+
. 'tortor porttitor a. Nam ut risus tellus. Vivamus =' . PHPMailer::getLE()
|
|
86
|
+
. 'imperdiet dictum nibh, in faucibus nunc pretium =' . PHPMailer::getLE()
|
|
87
|
+
. 'ac.' . PHPMailer::getLE(),
|
|
88
|
+
'qp_mode' => true,
|
|
89
|
+
],
|
|
90
|
+
'line length more than wrap limit, message already in qp format, qp: true' => [
|
|
91
|
+
'message' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. =' . PHPMailer::CRLF
|
|
92
|
+
. 'Maecenas ultricies nisi justo, eu convallis tortor porttitor a. =' . PHPMailer::CRLF
|
|
93
|
+
. 'Nam ut risus tellus. Vivamus imperdiet dictum nibh, in faucibus nunc pretium ac.'
|
|
94
|
+
. PHPMailer::CRLF,
|
|
95
|
+
'expected' => 'Lorem ipsum dolor sit amet, consectetur adipiscing =' . PHPMailer::getLE()
|
|
96
|
+
. 'elit. =' . PHPMailer::getLE()
|
|
97
|
+
. 'Maecenas ultricies nisi justo, eu convallis tortor =' . PHPMailer::getLE()
|
|
98
|
+
. 'porttitor a. =' . PHPMailer::getLE()
|
|
99
|
+
. 'Nam ut risus tellus. Vivamus imperdiet dictum =' . PHPMailer::getLE()
|
|
100
|
+
. 'nibh, in faucibus nunc pretium ac.' . PHPMailer::getLE(),
|
|
101
|
+
'qp_mode' => true,
|
|
102
|
+
],
|
|
103
|
+
'very long word in message, qp: false' => [
|
|
104
|
+
'message' => 'Lorem ipsumdolorsitametconsetetursadipscingelitrseddiamnonumy',
|
|
105
|
+
'expected' => 'Lorem' . PHPMailer::getLE()
|
|
106
|
+
. 'ipsumdolorsitametconsetetursadipscingelitrseddiamnonumy' . PHPMailer::getLE(),
|
|
107
|
+
'qp_mode' => false,
|
|
108
|
+
],
|
|
109
|
+
'very long word in message, qp: true' => [
|
|
110
|
+
'message' => 'Lorem ipsumdolorsitametconsetetursadipscingelitrseddiamnonumy',
|
|
111
|
+
'expected' => 'Lorem ipsumdolorsitametconsetetursadipscingelitrs=' . PHPMailer::getLE()
|
|
112
|
+
. 'eddiamnonumy' . PHPMailer::getLE(),
|
|
113
|
+
'qp_mode' => true,
|
|
114
|
+
],
|
|
115
|
+
'very long word in message, message already in qp format, qp: true' => [
|
|
116
|
+
'message' => 'Lorem ipsumdolorsitametconsetetursadipscingelitrseddiam=' . PHPMailer::CRLF
|
|
117
|
+
. 'nonumy',
|
|
118
|
+
'expected' => 'Lorem =' . PHPMailer::getLE()
|
|
119
|
+
. 'ipsumdolorsitametconsetetursadipscingelitrseddiam=' . PHPMailer::getLE()
|
|
120
|
+
. 'nonumy' . PHPMailer::getLE(),
|
|
121
|
+
'qp_mode' => true,
|
|
122
|
+
],
|
|
123
|
+
];
|
|
124
|
+
}
|
|
125
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* PHPMailer - PHP email transport unit tests.
|
|
5
|
+
* PHP version 5.5.
|
|
6
|
+
*
|
|
7
|
+
* @author Marcus Bointon <phpmailer@synchromedia.co.uk>
|
|
8
|
+
* @author Andy Prevost
|
|
9
|
+
* @copyright 2012 - 2020 Marcus Bointon
|
|
10
|
+
* @copyright 2004 - 2009 Andy Prevost
|
|
11
|
+
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
namespace PHPMailer\Test\PHPMailer;
|
|
15
|
+
|
|
16
|
+
use PHPMailer\PHPMailer\PHPMailer;
|
|
17
|
+
use PHPMailer\Test\TestCase;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Test XMailer header setting functionality.
|
|
21
|
+
*
|
|
22
|
+
* @covers \PHPMailer\PHPMailer\PHPMailer::createHeader
|
|
23
|
+
*/
|
|
24
|
+
final class XMailerTest extends TestCase
|
|
25
|
+
{
|
|
26
|
+
/**
|
|
27
|
+
* Test wrapping text.
|
|
28
|
+
*
|
|
29
|
+
* @dataProvider dataXMailer
|
|
30
|
+
*
|
|
31
|
+
* @param string $xmailer Input text string.
|
|
32
|
+
* @param string $expected Expected function output.
|
|
33
|
+
*/
|
|
34
|
+
public function testXMailer($xmailer, $expected)
|
|
35
|
+
{
|
|
36
|
+
$this->Mail->XMailer = $xmailer;
|
|
37
|
+
$headers = $this->Mail->createHeader();
|
|
38
|
+
if ($expected !== null) {
|
|
39
|
+
self::assertStringContainsString($expected, $headers);
|
|
40
|
+
} else {
|
|
41
|
+
self::assertStringNotContainsString('X-Mailer', $headers);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Data provider.
|
|
47
|
+
*
|
|
48
|
+
* @return array
|
|
49
|
+
*/
|
|
50
|
+
public function dataXMailer()
|
|
51
|
+
{
|
|
52
|
+
return [
|
|
53
|
+
'empty string' => [
|
|
54
|
+
'xmailer' => '',
|
|
55
|
+
'expected' => 'X-Mailer: PHPMailer ' . PHPMailer::VERSION . ' (https://github.com/PHPMailer/PHPMailer)',
|
|
56
|
+
],
|
|
57
|
+
'null' => [
|
|
58
|
+
'xmailer' => null,
|
|
59
|
+
'expected' => null,
|
|
60
|
+
],
|
|
61
|
+
'whitespace' => [
|
|
62
|
+
'xmailer' => ' ',
|
|
63
|
+
'expected' => null,
|
|
64
|
+
],
|
|
65
|
+
'non-empty string' => [
|
|
66
|
+
'xmailer' => 'test',
|
|
67
|
+
'expected' => 'X-Mailer: test',
|
|
68
|
+
],
|
|
69
|
+
'invalid value' => [
|
|
70
|
+
'xmailer' => [],
|
|
71
|
+
'expected' => null,
|
|
72
|
+
],
|
|
73
|
+
];
|
|
74
|
+
}
|
|
75
|
+
}
|