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,444 @@
|
|
|
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\Exception;
|
|
17
|
+
use PHPMailer\PHPMailer\PHPMailer;
|
|
18
|
+
use PHPMailer\Test\PreSendTestCase;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Test reply-to address setting, getting and clearing functionality.
|
|
22
|
+
*/
|
|
23
|
+
final class ReplyToGetSetClearTest extends PreSendTestCase
|
|
24
|
+
{
|
|
25
|
+
/**
|
|
26
|
+
* Test adding a non-IDN reply-to address.
|
|
27
|
+
*
|
|
28
|
+
* @covers \PHPMailer\PHPMailer\PHPMailer::addReplyTo
|
|
29
|
+
* @covers \PHPMailer\PHPMailer\PHPMailer::addOrEnqueueAnAddress
|
|
30
|
+
* @covers \PHPMailer\PHPMailer\PHPMailer::addAnAddress
|
|
31
|
+
* @covers \PHPMailer\PHPMailer\PHPMailer::getReplyToAddresses
|
|
32
|
+
*
|
|
33
|
+
* @dataProvider dataAddReplyToValidAddressNonIdn
|
|
34
|
+
*
|
|
35
|
+
* @param string $address The email address to set.
|
|
36
|
+
* @param string $name Optional. The name to set.
|
|
37
|
+
* @param string $expected Optional. The email address and name as they are expected to be set.
|
|
38
|
+
* Only needs to be passed if different than the original inputs.
|
|
39
|
+
*/
|
|
40
|
+
public function testAddReplyToValidAddressNonIdn($address, $name = null, $expected = null)
|
|
41
|
+
{
|
|
42
|
+
if (isset($name)) {
|
|
43
|
+
$result = $this->Mail->addReplyTo($address, $name);
|
|
44
|
+
} else {
|
|
45
|
+
$result = $this->Mail->addReplyTo($address);
|
|
46
|
+
$name = '';
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (isset($expected) === false) {
|
|
50
|
+
$expected = [
|
|
51
|
+
'address' => $address,
|
|
52
|
+
'name' => $name,
|
|
53
|
+
];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Test the setting is successful.
|
|
57
|
+
self::assertTrue($result, 'Replyto Addressing failed');
|
|
58
|
+
|
|
59
|
+
// Verify that the address was correctly added to the array.
|
|
60
|
+
$retrieved = $this->Mail->getReplyToAddresses();
|
|
61
|
+
self::assertIsArray($retrieved, 'ReplyTo property is not an array');
|
|
62
|
+
self::assertCount(1, $retrieved, 'ReplyTo property does not contain exactly one address');
|
|
63
|
+
|
|
64
|
+
self::assertCount(
|
|
65
|
+
2,
|
|
66
|
+
$retrieved[0],
|
|
67
|
+
'ReplyTo array for this address does not contain exactly two array items'
|
|
68
|
+
);
|
|
69
|
+
self::assertSame(
|
|
70
|
+
$expected['address'],
|
|
71
|
+
$retrieved[0][0],
|
|
72
|
+
'ReplyTo array for this address does not contain added address'
|
|
73
|
+
);
|
|
74
|
+
self::assertSame(
|
|
75
|
+
$expected['name'],
|
|
76
|
+
$retrieved[0][1],
|
|
77
|
+
'ReplyTo array for this address does not contain added name'
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Data provider.
|
|
83
|
+
*
|
|
84
|
+
* @return array
|
|
85
|
+
*/
|
|
86
|
+
public function dataAddReplyToValidAddressNonIdn()
|
|
87
|
+
{
|
|
88
|
+
return [
|
|
89
|
+
'Valid address' => [
|
|
90
|
+
'address' => 'a@example.com',
|
|
91
|
+
],
|
|
92
|
+
'Valid address with surrounding whitespace and mixed case' => [
|
|
93
|
+
'address' => " \tMiXeD@Example.Com \r\n",
|
|
94
|
+
'name' => null,
|
|
95
|
+
'expected' => [
|
|
96
|
+
'address' => 'MiXeD@Example.Com',
|
|
97
|
+
'name' => '',
|
|
98
|
+
],
|
|
99
|
+
],
|
|
100
|
+
'Valid address with name' => [
|
|
101
|
+
'address' => 'a@example.com',
|
|
102
|
+
'name' => 'ReplyTo name',
|
|
103
|
+
],
|
|
104
|
+
'Valid address with name; name with whitespace and line breaks' => [
|
|
105
|
+
'address' => 'a@example.com',
|
|
106
|
+
'name' => "\t\t ReplyTo\r\nname ",
|
|
107
|
+
'expected' => [
|
|
108
|
+
'address' => 'a@example.com',
|
|
109
|
+
'name' => 'ReplyToname',
|
|
110
|
+
],
|
|
111
|
+
],
|
|
112
|
+
];
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Test adding an invalid non-IDN reply-to address.
|
|
117
|
+
*
|
|
118
|
+
* @covers \PHPMailer\PHPMailer\PHPMailer::addOrEnqueueAnAddress
|
|
119
|
+
* @covers \PHPMailer\PHPMailer\PHPMailer::addAnAddress
|
|
120
|
+
*
|
|
121
|
+
* @dataProvider dataAddReplyToInvalidAddressNonIdn
|
|
122
|
+
*
|
|
123
|
+
* @param string $address The email address to set.
|
|
124
|
+
*/
|
|
125
|
+
public function testAddReplyToInvalidAddressNonIdn($address)
|
|
126
|
+
{
|
|
127
|
+
// Test the setting fails.
|
|
128
|
+
$result = $this->Mail->addReplyTo($address);
|
|
129
|
+
self::assertFalse($result, 'Invalid Replyto address accepted');
|
|
130
|
+
|
|
131
|
+
// Verify that the address was not added to the array.
|
|
132
|
+
$retrieved = $this->Mail->getReplyToAddresses();
|
|
133
|
+
self::assertIsArray($retrieved, 'ReplyTo property is not an array');
|
|
134
|
+
self::assertCount(0, $retrieved, 'ReplyTo property is not empty');
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Test receiving an excepting when adding an invalid non-IDN reply-to address.
|
|
139
|
+
*
|
|
140
|
+
* @covers \PHPMailer\PHPMailer\PHPMailer::addOrEnqueueAnAddress
|
|
141
|
+
* @covers \PHPMailer\PHPMailer\PHPMailer::addAnAddress
|
|
142
|
+
*
|
|
143
|
+
* @dataProvider dataAddReplyToInvalidAddressNonIdn
|
|
144
|
+
*
|
|
145
|
+
* @param string $address The email address to set.
|
|
146
|
+
*/
|
|
147
|
+
public function testAddReplyToInvalidAddressNonIdnException($address)
|
|
148
|
+
{
|
|
149
|
+
$this->expectException(Exception::class);
|
|
150
|
+
$this->expectExceptionMessage('Invalid address: (Reply-To): ' . $address);
|
|
151
|
+
|
|
152
|
+
$mail = new PHPMailer(true);
|
|
153
|
+
$mail->addReplyTo($address);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Data provider.
|
|
158
|
+
*
|
|
159
|
+
* @return array
|
|
160
|
+
*/
|
|
161
|
+
public function dataAddReplyToInvalidAddressNonIdn()
|
|
162
|
+
{
|
|
163
|
+
return [
|
|
164
|
+
'Invalid domain' => ['a@example..com'],
|
|
165
|
+
'Missing @ sign' => ['example.com'],
|
|
166
|
+
];
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Test that the correct Reply-To message header has been added to the message.
|
|
171
|
+
*
|
|
172
|
+
* @covers \PHPMailer\PHPMailer\PHPMailer::addReplyTo
|
|
173
|
+
* @covers \PHPMailer\PHPMailer\PHPMailer::createHeader
|
|
174
|
+
* @covers \PHPMailer\PHPMailer\PHPMailer::addrAppend
|
|
175
|
+
*
|
|
176
|
+
* @dataProvider dataReplyToInMessageHeader
|
|
177
|
+
*
|
|
178
|
+
* @param string $addresses The email address(es) to set for Reply-To.
|
|
179
|
+
* @param string $expected The expected message header.
|
|
180
|
+
*/
|
|
181
|
+
public function testReplyToInMessageHeader($addresses, $expected)
|
|
182
|
+
{
|
|
183
|
+
$this->Mail->Body = 'Here is the main body. There should be ' .
|
|
184
|
+
'a reply to header in this message.';
|
|
185
|
+
$this->Mail->Subject .= ': Reply to header';
|
|
186
|
+
|
|
187
|
+
foreach ($addresses as $address) {
|
|
188
|
+
if (isset($address['name'])) {
|
|
189
|
+
$this->Mail->addReplyTo($address['address'], $address['name']);
|
|
190
|
+
} else {
|
|
191
|
+
$this->Mail->addReplyTo($address['address']);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
$this->buildBody();
|
|
196
|
+
self::assertTrue($this->Mail->preSend(), $this->Mail->ErrorInfo);
|
|
197
|
+
|
|
198
|
+
$message = $this->Mail->getSentMIMEMessage();
|
|
199
|
+
self::assertStringContainsString($expected, $message, 'Message does not contain the expected reply-to header');
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Data provider.
|
|
204
|
+
*
|
|
205
|
+
* @return array
|
|
206
|
+
*/
|
|
207
|
+
public function dataReplyToInMessageHeader()
|
|
208
|
+
{
|
|
209
|
+
$LE = PHPMailer::getLE();
|
|
210
|
+
|
|
211
|
+
return [
|
|
212
|
+
'Single address' => [
|
|
213
|
+
'addresses' => [
|
|
214
|
+
[
|
|
215
|
+
'address' => 'nobody@nobody.com',
|
|
216
|
+
],
|
|
217
|
+
],
|
|
218
|
+
'expected' => $LE . 'Reply-To: nobody@nobody.com' . $LE,
|
|
219
|
+
],
|
|
220
|
+
'Single address + name' => [
|
|
221
|
+
'addresses' => [
|
|
222
|
+
[
|
|
223
|
+
'address' => 'nobody@nobody.com',
|
|
224
|
+
'name' => 'Nobody (Unit Test)',
|
|
225
|
+
],
|
|
226
|
+
],
|
|
227
|
+
'expected' => $LE . 'Reply-To: "Nobody (Unit Test)" <nobody@nobody.com>' . $LE,
|
|
228
|
+
],
|
|
229
|
+
'Multiple addresses, including no name and mixed case email' => [
|
|
230
|
+
'addresses' => [
|
|
231
|
+
[
|
|
232
|
+
'address' => 'nobody@nobody.com',
|
|
233
|
+
'name' => 'Nobody (Unit Test)',
|
|
234
|
+
],
|
|
235
|
+
[
|
|
236
|
+
'address' => 'Somebody@SomeBody.com',
|
|
237
|
+
'name' => 'Somebody (Unit Test)',
|
|
238
|
+
],
|
|
239
|
+
[
|
|
240
|
+
'address' => 'noname@noname.com',
|
|
241
|
+
],
|
|
242
|
+
],
|
|
243
|
+
'expected' => $LE . 'Reply-To: "Nobody (Unit Test)" <nobody@nobody.com>,'
|
|
244
|
+
. ' "Somebody (Unit Test)" <Somebody@SomeBody.com>, noname@noname.com' . $LE,
|
|
245
|
+
],
|
|
246
|
+
];
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Tests handling of IDN reply-to addresses.
|
|
251
|
+
*
|
|
252
|
+
* Verifies that:
|
|
253
|
+
* - CharSet and Unicode -> ASCII conversions for addresses with IDN gets executed correctly.
|
|
254
|
+
* - IDN addresses initially get enqueued.
|
|
255
|
+
* - IDN addresses correctly get added during `preSend()`.
|
|
256
|
+
*
|
|
257
|
+
* @covers \PHPMailer\PHPMailer\PHPMailer::addReplyTo
|
|
258
|
+
* @covers \PHPMailer\PHPMailer\PHPMailer::addOrEnqueueAnAddress
|
|
259
|
+
* @covers \PHPMailer\PHPMailer\PHPMailer::addAnAddress
|
|
260
|
+
* @covers \PHPMailer\PHPMailer\PHPMailer::preSend
|
|
261
|
+
*
|
|
262
|
+
* @requires extension mbstring
|
|
263
|
+
* @requires function idn_to_ascii
|
|
264
|
+
*/
|
|
265
|
+
public function testEnqueueAndAddIdnAddress()
|
|
266
|
+
{
|
|
267
|
+
// This file is UTF-8 encoded. Create a domain encoded in "iso-8859-1".
|
|
268
|
+
$letter = html_entity_decode('ç', ENT_COMPAT, PHPMailer::CHARSET_ISO88591);
|
|
269
|
+
$domain = '@' . 'fran' . $letter . 'ois.ch';
|
|
270
|
+
$address = 'test+replyto' . $domain;
|
|
271
|
+
self::assertTrue($this->Mail->addReplyTo($address), 'Replyto Addressing failed');
|
|
272
|
+
|
|
273
|
+
// Queued addresses are not returned by get*Addresses() before send() call.
|
|
274
|
+
self::assertEmpty($this->Mail->getReplyToAddresses(), 'Unexpected "reply-to" address added');
|
|
275
|
+
|
|
276
|
+
// Check that the queue has been set correctly.
|
|
277
|
+
$queue = $this->getPropertyValue($this->Mail, 'ReplyToQueue');
|
|
278
|
+
self::assertCount(1, $queue, 'Queue does not contain exactly 1 entry');
|
|
279
|
+
self::assertArrayHasKey($address, $queue, 'Queue does not contain an entry for the IDN address');
|
|
280
|
+
|
|
281
|
+
$this->buildBody();
|
|
282
|
+
self::assertTrue($this->Mail->preSend(), $this->Mail->ErrorInfo);
|
|
283
|
+
|
|
284
|
+
// Addresses with IDN are returned by get*Addresses() after preSend() call.
|
|
285
|
+
$domain = $this->Mail->punyencodeAddress($domain);
|
|
286
|
+
$expected = array('test+replyto' . $domain, '');
|
|
287
|
+
$retrieved = $this->Mail->getReplyToAddresses();
|
|
288
|
+
self::assertSame(
|
|
289
|
+
$expected,
|
|
290
|
+
$retrieved[0],
|
|
291
|
+
'Bad "reply-to" addresses'
|
|
292
|
+
);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Tests that non-exact duplicate reply-to addresses do get enqueued (IDN),
|
|
297
|
+
* but don't get added (IDN converted to punycode + non-IDN).
|
|
298
|
+
*
|
|
299
|
+
* @covers \PHPMailer\PHPMailer\PHPMailer::addOrEnqueueAnAddress
|
|
300
|
+
* @covers \PHPMailer\PHPMailer\PHPMailer::addAnAddress
|
|
301
|
+
*
|
|
302
|
+
* @requires extension mbstring
|
|
303
|
+
* @requires function idn_to_ascii
|
|
304
|
+
*/
|
|
305
|
+
public function testNoDuplicateReplyToAddresses()
|
|
306
|
+
{
|
|
307
|
+
$this->Mail->CharSet = PHPMailer::CHARSET_UTF8;
|
|
308
|
+
|
|
309
|
+
self::assertTrue(
|
|
310
|
+
$this->Mail->addReplyTo('test+replyto@françois.ch', 'UTF8 domain'),
|
|
311
|
+
'Initial address + name not queued'
|
|
312
|
+
);
|
|
313
|
+
self::assertFalse(
|
|
314
|
+
$this->Mail->addReplyTo('test+replyto@françois.ch'),
|
|
315
|
+
'Duplicate address should not have been queued'
|
|
316
|
+
);
|
|
317
|
+
// For the queue, a duplicate address in a different case is accepted.
|
|
318
|
+
self::assertTrue(
|
|
319
|
+
$this->Mail->addReplyTo('test+replyto@FRANÇOIS.CH'),
|
|
320
|
+
'Duplicate address, different case address not queued'
|
|
321
|
+
);
|
|
322
|
+
self::assertFalse(
|
|
323
|
+
$this->Mail->addReplyTo('test+replyto@FRANÇOIS.CH'),
|
|
324
|
+
'Duplicate address, different case should not have been queued twice'
|
|
325
|
+
);
|
|
326
|
+
// An address in punycode does not go into the queue, but gets added straight away.
|
|
327
|
+
self::assertTrue(
|
|
328
|
+
$this->Mail->addReplyTo('test+replyto@xn--franois-xxa.ch'),
|
|
329
|
+
'Punycode address, no name not added'
|
|
330
|
+
);
|
|
331
|
+
self::assertFalse(
|
|
332
|
+
$this->Mail->addReplyTo('test+replyto@xn--franois-xxa.ch', 'Punycode domain'),
|
|
333
|
+
'Duplicate punycode address should not have been added, no matter that this one has a name'
|
|
334
|
+
);
|
|
335
|
+
self::assertFalse(
|
|
336
|
+
$this->Mail->addReplyTo('test+replyto@XN--FRANOIS-XXA.CH'),
|
|
337
|
+
'Duplicate punycode address, different case should not have been added'
|
|
338
|
+
);
|
|
339
|
+
|
|
340
|
+
// The one accepted punycode address should already be lined up.
|
|
341
|
+
self::assertCount(1, $this->Mail->getReplyToAddresses(), 'Addresses added did not match expected count of 1');
|
|
342
|
+
|
|
343
|
+
// Check that the non-punycode addresses were added to the queue correctly.
|
|
344
|
+
$queue = $this->getPropertyValue($this->Mail, 'ReplyToQueue');
|
|
345
|
+
self::assertIsArray($queue, 'Queue is not an array');
|
|
346
|
+
self::assertCount(2, $queue, 'Queue does not contain exactly 2 entries');
|
|
347
|
+
self::assertArrayHasKey(
|
|
348
|
+
'test+replyto@françois.ch',
|
|
349
|
+
$queue,
|
|
350
|
+
'Queue does not contain an entry for the lowercase address'
|
|
351
|
+
);
|
|
352
|
+
self::assertArrayHasKey(
|
|
353
|
+
'test+replyto@FRANÇOIS.CH',
|
|
354
|
+
$queue,
|
|
355
|
+
'Queue does not contain an entry for the uppercase address'
|
|
356
|
+
);
|
|
357
|
+
|
|
358
|
+
$this->buildBody();
|
|
359
|
+
self::assertTrue($this->Mail->preSend(), $this->Mail->ErrorInfo);
|
|
360
|
+
|
|
361
|
+
// There should be only one "Reply-To" address after preSend().
|
|
362
|
+
self::assertCount(
|
|
363
|
+
1,
|
|
364
|
+
$this->Mail->getReplyToAddresses(),
|
|
365
|
+
'Bad count of "reply-to" addresses'
|
|
366
|
+
);
|
|
367
|
+
|
|
368
|
+
$expectedAddress = 'test+replyto@xn--franois-xxa.ch';
|
|
369
|
+
$retrieved = $this->Mail->getReplyToAddresses();
|
|
370
|
+
self::assertCount(1, $retrieved, 'Stored addresses after preSend() is not 1');
|
|
371
|
+
|
|
372
|
+
// Verify that the registered reply-to address is the initially added lowercase punycode one.
|
|
373
|
+
self::assertSame(
|
|
374
|
+
$expectedAddress,
|
|
375
|
+
$retrieved[0][0],
|
|
376
|
+
'ReplyTo property does not contain an entry with this address as the key'
|
|
377
|
+
);
|
|
378
|
+
self::assertCount(
|
|
379
|
+
2,
|
|
380
|
+
$retrieved[0],
|
|
381
|
+
'ReplyTo array for this address does not contain exactly two array items'
|
|
382
|
+
);
|
|
383
|
+
self::assertSame(
|
|
384
|
+
$expectedAddress,
|
|
385
|
+
$retrieved[0][0],
|
|
386
|
+
'ReplyTo array for this address does not contain added address'
|
|
387
|
+
);
|
|
388
|
+
self::assertSame(
|
|
389
|
+
'',
|
|
390
|
+
$retrieved[0][1],
|
|
391
|
+
'ReplyTo array for this address does not contain added name'
|
|
392
|
+
);
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Test unsuccessfully adding an Reply-to address when an email address containing
|
|
397
|
+
* an 8bit character is passed and either the MbString or the Intl extension are
|
|
398
|
+
* not available.
|
|
399
|
+
*
|
|
400
|
+
* @covers \PHPMailer\PHPMailer\PHPMailer::addAnAddress
|
|
401
|
+
*/
|
|
402
|
+
public function testAddReplyToFailsOn8BitCharInDomainWithoutOptionalExtensions()
|
|
403
|
+
{
|
|
404
|
+
if (PHPMailer::idnSupported()) {
|
|
405
|
+
self::markTestSkipped('Test requires MbString and/or Intl *not* to be available');
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
self::assertFalse($this->Mail->addReplyTo('test@françois.ch'));
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* Test successfully clearing out both the added as well as the queued Reply-to addresses.
|
|
413
|
+
*
|
|
414
|
+
* @covers \PHPMailer\PHPMailer\PHPMailer::clearReplyTos
|
|
415
|
+
*
|
|
416
|
+
* @requires extension mbstring
|
|
417
|
+
* @requires function idn_to_ascii
|
|
418
|
+
*/
|
|
419
|
+
public function testClearReplyTos()
|
|
420
|
+
{
|
|
421
|
+
self::assertTrue($this->Mail->addReplyTo('example@example.com'), 'Address not added');
|
|
422
|
+
self::assertTrue($this->Mail->addReplyTo('test@françois.ch'), 'IDN Address not queued');
|
|
423
|
+
|
|
424
|
+
// Verify there is something to clear.
|
|
425
|
+
$retrieved = $this->Mail->getReplyToAddresses();
|
|
426
|
+
self::assertIsArray($retrieved, 'ReplyTo property is not an array (pre-clear)');
|
|
427
|
+
self::assertCount(1, $retrieved, 'ReplyTo property does not contain exactly one address');
|
|
428
|
+
|
|
429
|
+
$queue = $this->getPropertyValue($this->Mail, 'ReplyToQueue');
|
|
430
|
+
self::assertIsArray($queue, 'Queue is not an array (pre-clear)');
|
|
431
|
+
self::assertCount(1, $queue, 'Queue does not contain exactly one entry');
|
|
432
|
+
|
|
433
|
+
$this->Mail->clearReplyTos();
|
|
434
|
+
|
|
435
|
+
// Verify the clearing was successful.
|
|
436
|
+
$retrieved = $this->Mail->getReplyToAddresses();
|
|
437
|
+
self::assertIsArray($retrieved, 'ReplyTo property is not an array (post-clear)');
|
|
438
|
+
self::assertCount(0, $retrieved, 'ReplyTo property still contains an address');
|
|
439
|
+
|
|
440
|
+
$queue = $this->getPropertyValue($this->Mail, 'ReplyToQueue');
|
|
441
|
+
self::assertIsArray($queue, 'Queue is not an array (post-clear)');
|
|
442
|
+
self::assertCount(0, $queue, 'Queue still contains an entry');
|
|
443
|
+
}
|
|
444
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
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\SMTP;
|
|
17
|
+
use PHPMailer\Test\TestCase;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Test error registration functionality.
|
|
21
|
+
*
|
|
22
|
+
* @covers \PHPMailer\PHPMailer\PHPMailer::isError
|
|
23
|
+
* @covers \PHPMailer\PHPMailer\PHPMailer::setError
|
|
24
|
+
*/
|
|
25
|
+
final class SetErrorTest extends TestCase
|
|
26
|
+
{
|
|
27
|
+
/**
|
|
28
|
+
* Test simple, non-STMP, error registration.
|
|
29
|
+
*/
|
|
30
|
+
public function testSetErrorNonSmtp()
|
|
31
|
+
{
|
|
32
|
+
self::assertFalse($this->Mail->isError(), 'Errors found after class initialization');
|
|
33
|
+
|
|
34
|
+
// "Abuse" the `PHPMailer::set()` method to register an error.
|
|
35
|
+
self::assertFalse($this->Mail->set('nonexistentproperty', 'value'));
|
|
36
|
+
|
|
37
|
+
self::assertTrue($this->Mail->isError(), 'Error count not incremented');
|
|
38
|
+
self::assertSame(
|
|
39
|
+
'Cannot set or reset variable: nonexistentproperty',
|
|
40
|
+
$this->Mail->ErrorInfo,
|
|
41
|
+
'Error info not correctly set'
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Test simple, non-STMP, error registration, where only one of the two SMTP conditions is met.
|
|
47
|
+
*/
|
|
48
|
+
public function testSetErrorNonSmtpWithMailerSmtp()
|
|
49
|
+
{
|
|
50
|
+
$this->Mail->Mailer = 'smtp';
|
|
51
|
+
|
|
52
|
+
$this->testSetErrorNonSMTP();
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Test simple, non-STMP, error registration, where the other one of the two SMTP conditions is met.
|
|
57
|
+
*/
|
|
58
|
+
public function testSetErrorNonSmtpWithSmtpInstanceSet()
|
|
59
|
+
{
|
|
60
|
+
$stub = $this->getMockBuilder(SMTP::class)->getMock();
|
|
61
|
+
$this->Mail->setSMTPInstance($stub);
|
|
62
|
+
|
|
63
|
+
$this->testSetErrorNonSMTP();
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Test error registration with SMTP enabled and instantiated.
|
|
68
|
+
*
|
|
69
|
+
* @dataProvider dataSetErrorSmtp
|
|
70
|
+
*
|
|
71
|
+
* @param array $mockReturn The value the `SMTP::getError()` method mock should return.
|
|
72
|
+
* @param string $expected The error message which is expected to be registered.
|
|
73
|
+
*/
|
|
74
|
+
public function testSetErrorSmtp($mockReturn, $expected)
|
|
75
|
+
{
|
|
76
|
+
$stub = $this->getMockBuilder(SMTP::class)->getMock();
|
|
77
|
+
$stub->method('getError')
|
|
78
|
+
->willReturn($mockReturn);
|
|
79
|
+
|
|
80
|
+
$this->Mail->Mailer = 'smtp';
|
|
81
|
+
$this->Mail->setSMTPInstance($stub);
|
|
82
|
+
|
|
83
|
+
// "Abuse" the `PHPMailer::set()` method to register an error.
|
|
84
|
+
self::assertFalse($this->Mail->set('nonexistentproperty', 'value'));
|
|
85
|
+
|
|
86
|
+
self::assertTrue($this->Mail->isError(), 'Error count not incremented');
|
|
87
|
+
self::assertSame($expected, $this->Mail->ErrorInfo, 'Error info not correctly set');
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Data provider.
|
|
92
|
+
*
|
|
93
|
+
* @return array
|
|
94
|
+
*/
|
|
95
|
+
public function dataSetErrorSmtp()
|
|
96
|
+
{
|
|
97
|
+
return [
|
|
98
|
+
'No SMTP error' => [
|
|
99
|
+
'mockReturn' => [
|
|
100
|
+
'error' => '',
|
|
101
|
+
'detail' => '',
|
|
102
|
+
'smtp_code' => '',
|
|
103
|
+
'smtp_code_ex' => '',
|
|
104
|
+
],
|
|
105
|
+
'expected' => 'Cannot set or reset variable: nonexistentproperty',
|
|
106
|
+
],
|
|
107
|
+
'SMTP error, no details' => [
|
|
108
|
+
'mockReturn' => [
|
|
109
|
+
'error' => 'Fake error',
|
|
110
|
+
'detail' => '',
|
|
111
|
+
'smtp_code' => '',
|
|
112
|
+
'smtp_code_ex' => '',
|
|
113
|
+
],
|
|
114
|
+
'expected' => 'Cannot set or reset variable: nonexistentproperty SMTP server error: Fake error',
|
|
115
|
+
],
|
|
116
|
+
'SMTP error, full details' => [
|
|
117
|
+
'mockReturn' => [
|
|
118
|
+
'error' => 'Fake error',
|
|
119
|
+
'detail' => 'Fake detail',
|
|
120
|
+
'smtp_code' => 'Fake code',
|
|
121
|
+
'smtp_code_ex' => 'Fake code ex',
|
|
122
|
+
],
|
|
123
|
+
'expected' => 'Cannot set or reset variable: nonexistentproperty SMTP server error: '
|
|
124
|
+
. 'Fake error Detail: Fake detail SMTP code: Fake code Additional SMTP info: Fake code ex',
|
|
125
|
+
],
|
|
126
|
+
];
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Verify that only the last error registered via `setError()` is available.
|
|
131
|
+
*/
|
|
132
|
+
public function testErrorInfoOnlyContainsLastError()
|
|
133
|
+
{
|
|
134
|
+
// "Abuse" the `PHPMailer::set()` method to register a few errors.
|
|
135
|
+
self::assertFalse($this->Mail->set('property1', 'value'));
|
|
136
|
+
self::assertFalse($this->Mail->set('property2', 'value'));
|
|
137
|
+
self::assertFalse($this->Mail->set('property3', 'value'));
|
|
138
|
+
|
|
139
|
+
self::assertTrue($this->Mail->isError(), 'Error count not incremented');
|
|
140
|
+
self::assertSame(
|
|
141
|
+
'Cannot set or reset variable: property3',
|
|
142
|
+
$this->Mail->ErrorInfo,
|
|
143
|
+
'Error info not correctly set'
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Verify that when no errors have been registered, `isError()` returns false.
|
|
149
|
+
*/
|
|
150
|
+
public function testIsErrorWithoutError()
|
|
151
|
+
{
|
|
152
|
+
self::assertFalse($this->Mail->isError(), 'Error count not 0');
|
|
153
|
+
}
|
|
154
|
+
}
|